Skip to content

Commit

Permalink
feat: migrate to generic construction
Browse files Browse the repository at this point in the history
  • Loading branch information
mathuo committed Dec 23, 2024
1 parent f6e7e4e commit c578889
Show file tree
Hide file tree
Showing 23 changed files with 561 additions and 591 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
className: 'test-a test-b',
});

Expand All @@ -51,7 +53,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand All @@ -70,7 +74,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -100,7 +106,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -160,7 +168,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -287,7 +297,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(1000, 1000);
Expand Down Expand Up @@ -323,7 +335,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -446,7 +460,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -475,7 +491,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -533,7 +551,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -591,7 +611,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -667,7 +689,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -761,7 +785,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -855,7 +881,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -949,7 +977,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -1073,7 +1103,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -1197,7 +1229,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -1323,7 +1357,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -1447,7 +1483,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(800, 400);
Expand Down Expand Up @@ -1571,7 +1609,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.fromJSON({
Expand Down Expand Up @@ -1698,7 +1738,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(1000, 1000);
Expand Down Expand Up @@ -1728,7 +1770,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});
gridview.layout(1000, 1000);

Expand Down Expand Up @@ -1757,7 +1801,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: false,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});
gridview.layout(1000, 1000);

Expand Down Expand Up @@ -1795,7 +1841,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

let addGroup: GridviewPanel[] = [];
Expand Down Expand Up @@ -1917,7 +1965,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(1600, 800);
Expand Down Expand Up @@ -2043,7 +2093,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(6000, 5000);
Expand Down Expand Up @@ -2318,7 +2370,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.VERTICAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

gridview.layout(5000, 6000);
Expand Down Expand Up @@ -2591,7 +2645,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

let el = gridview.element.querySelector('.dv-view-container');
Expand Down Expand Up @@ -2670,7 +2726,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
});

expect(gridview.disableResizing).toBeFalsy();
Expand All @@ -2680,7 +2738,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
disableAutoResizing: true,
});

Expand All @@ -2691,7 +2751,9 @@ describe('gridview', () => {
const gridview = new GridviewComponent(container, {
proportionalLayout: true,
orientation: Orientation.HORIZONTAL,
components: { default: TestGridview },
createComponent: (options) => {
return new TestGridview(options.id, options.name);
},
disableAutoResizing: true,
});
gridview.layout(1000, 1000);
Expand Down
Loading

0 comments on commit c578889

Please sign in to comment.