@design.estate/dees-catalog 1.0.223 → 1.0.225
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_bundle/bundle.js +24 -22
- package/dist_bundle/bundle.js.map +3 -3
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/dees-table.d.ts +1 -1
- package/dist_ts_web/elements/dees-table.js +33 -18
- package/dist_watch/bundle.js +1088 -1044
- package/dist_watch/bundle.js.map +4 -4
- package/package.json +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/dees-table.ts +32 -19
package/package.json
CHANGED
|
@@ -263,6 +263,8 @@ export class DeesTable<T> extends DeesElement {
|
|
|
263
263
|
th,
|
|
264
264
|
td {
|
|
265
265
|
position: relative;
|
|
266
|
+
vertical-align: top;
|
|
267
|
+
|
|
266
268
|
padding: 0px;
|
|
267
269
|
border-right: 1px dashed ${cssManager.bdTheme('#999', '#808080')};
|
|
268
270
|
}
|
|
@@ -582,44 +584,55 @@ export class DeesTable<T> extends DeesElement {
|
|
|
582
584
|
`;
|
|
583
585
|
}
|
|
584
586
|
|
|
585
|
-
public async firstUpdated() {
|
|
587
|
+
public async firstUpdated() {
|
|
588
|
+
}
|
|
586
589
|
|
|
587
590
|
public async updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void> {
|
|
588
591
|
super.updated(changedProperties);
|
|
589
|
-
this.
|
|
592
|
+
this.determineColumnWidths();
|
|
590
593
|
}
|
|
591
594
|
|
|
592
|
-
|
|
595
|
+
public async determineColumnWidths() {
|
|
596
|
+
const domtools = await this.domtoolsPromise;
|
|
597
|
+
await domtools.convenience.smartdelay.delayFor(0);
|
|
593
598
|
// Get the table element
|
|
594
599
|
const table = this.shadowRoot.querySelector('table');
|
|
595
600
|
if (!table) return;
|
|
596
601
|
|
|
597
|
-
// Create a colgroup if it doesn't exist
|
|
598
|
-
let colgroup = table.querySelector('colgroup');
|
|
599
|
-
if (!colgroup) {
|
|
600
|
-
colgroup = document.createElement('colgroup');
|
|
601
|
-
table.insertBefore(colgroup, table.firstChild);
|
|
602
|
-
}
|
|
603
|
-
|
|
604
602
|
// Get the first row's cells to measure the widths
|
|
605
603
|
const cells = table.rows[0].cells;
|
|
606
604
|
|
|
607
|
-
|
|
605
|
+
const handleColumnByIndex = async (i: number, waitForRenderArg: boolean = false) => {
|
|
606
|
+
const done = plugins.smartpromise.defer();
|
|
608
607
|
const cell = cells[i];
|
|
609
608
|
|
|
610
609
|
// Get computed width
|
|
611
610
|
const width = window.getComputedStyle(cell).width;
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
611
|
+
if (cell.textContent.includes('Actions')) {
|
|
612
|
+
const neededWidth = this.dataActions.filter(actionArg => actionArg.type.includes('inRow')).length * 35;
|
|
613
|
+
cell.style.width = `${Math.max(neededWidth, 68)}px`;
|
|
614
|
+
} else {
|
|
615
|
+
cell.style.width = width;
|
|
616
|
+
}
|
|
617
|
+
if (waitForRenderArg) {
|
|
618
|
+
requestAnimationFrame(() => {
|
|
619
|
+
done.resolve();
|
|
620
|
+
});
|
|
621
|
+
await done.promise;
|
|
618
622
|
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
if (cells[cells.length - 1].textContent.includes('Actions')) {
|
|
626
|
+
await handleColumnByIndex(cells.length - 1, true);
|
|
627
|
+
}
|
|
619
628
|
|
|
620
|
-
|
|
621
|
-
|
|
629
|
+
for (let i = 0; i < cells.length; i++) {
|
|
630
|
+
if (cells[i].textContent.includes('Actions')) {
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
await handleColumnByIndex(i);
|
|
622
634
|
}
|
|
635
|
+
table.style.tableLayout = 'fixed';
|
|
623
636
|
}
|
|
624
637
|
|
|
625
638
|
getActionsForType(typeArg: ITableAction['type'][0]) {
|