;
- displayShelves: boolean;
tooltips: Tooltips|null;
} {
return {
@@ -91,7 +86,6 @@ export default defineComponent({
animateTimeout: undefined,
animateIndex: null,
animations: ["heartBeat", "tada", "shakeX", "rubberBand"],
- displayShelves: false,
tooltips: null
};
},
@@ -105,7 +99,6 @@ export default defineComponent({
return ;
}
this.brand = brand;
- this.displayShelves = this.brand.shelf;
const firstRange = this.brand.ranges.at(0);
@@ -139,21 +132,32 @@ export default defineComponent({
chunkInefficientCustom(ranges: Array
, chunkSize: number):Array> {
const out: Array> = [];
let row: Array = [];
- ranges.forEach((range: TypeRange, i: number) => {
- if (range.width === 2) {
- if(row.length) {
+ ranges
+ .sort((a, b) => a.order - b.order)
+ .forEach((range, _i) => {
+ // Handle special width=2 case immediately
+ if (range.width === 2) {
+ if (row.length > 0) {
+ out.push(row);
+ row = [];
+ }
+ out.push([range]);
+ return;
+ }
+
+ // Add to current row
+ row.push(range);
+
+ // Push row if it reaches chunk size
+ if (row.length === chunkSize) {
out.push(row);
row = [];
}
- out.push([range]);
- return;
- }
- row.push(range);
- if (i % chunkSize) {
- out.push(row);
- row = [];
- }
- });
+ });
+ // Push any remaining elements
+ if (row.length > 0) {
+ out.push(row);
+ }
return out;
},
t(text: string, params: Record = {}, localeToUse: string|null = null): string {