@nanoporetech-digital/components 3.5.1 → 3.6.0
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/CHANGELOG.md +20 -0
- package/dist/cjs/{date-utils-c581f187.js → date-utils-42fbcb42.js} +5 -3
- package/dist/cjs/date-utils-42fbcb42.js.map +1 -0
- package/dist/cjs/index-41582c2a.js +2 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-datalist_3.cjs.entry.js +10 -5
- package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
- package/dist/cjs/nano-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/nano-demo.cjs.entry.js +3 -2
- package/dist/cjs/nano-demo.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-dropdown.cjs.entry.js +5 -2
- package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-file-upload.cjs.entry.js +4 -0
- package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +1 -2
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-tooltip.cjs.entry.js → nano-progress-bar_2.cjs.entry.js} +28 -4
- package/dist/cjs/nano-progress-bar_2.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js +74 -12
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-sticker.cjs.entry.js +2 -0
- package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-067e0c12.js → nano-table-b031ec24.js} +164 -84
- package/dist/cjs/nano-table-b031ec24.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{table.worker-a4d75c46.js → table.worker-dadd1eb0.js} +3 -3
- package/dist/cjs/table.worker-dadd1eb0.js.map +1 -0
- package/dist/{esm/table.worker-e9fb087e.js → cjs/table.worker-e2f9ccfa.js} +1 -1
- package/dist/collection/components/datalist/datalist.js +3 -3
- package/dist/collection/components/datalist/datalist.js.map +1 -1
- package/dist/collection/components/demo/demo.js +3 -2
- package/dist/collection/components/demo/demo.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.js +5 -2
- package/dist/collection/components/dropdown/dropdown.js.map +1 -1
- package/dist/collection/components/file-upload/file-upload.js +4 -0
- package/dist/collection/components/file-upload/file-upload.js.map +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js.map +1 -1
- package/dist/collection/components/menu/menu.js +8 -3
- package/dist/collection/components/menu/menu.js.map +1 -1
- package/dist/collection/components/nav-item/nav-item.js +1 -2
- package/dist/collection/components/nav-item/nav-item.js.map +1 -1
- package/dist/collection/components/resize-observe/resize-observe.js +118 -14
- package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
- package/dist/collection/components/sticker/sticker.js +2 -0
- package/dist/collection/components/sticker/sticker.js.map +1 -1
- package/dist/collection/components/table/table-interface.js.map +1 -1
- package/dist/collection/components/table/table.cell.js +10 -5
- package/dist/collection/components/table/table.cell.js.map +1 -1
- package/dist/collection/components/table/table.css +9 -23
- package/dist/collection/components/table/table.js +227 -88
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.row.js +19 -12
- package/dist/collection/components/table/table.row.js.map +1 -1
- package/dist/collection/components/table/table.store.js +1 -1
- package/dist/collection/components/table/table.store.js.map +1 -1
- package/dist/collection/components/table/table.utils.js +4 -4
- package/dist/collection/components/table/table.utils.js.map +1 -1
- package/dist/collection/components/table/table.worker.js +8 -0
- package/dist/collection/components/table/table.worker.js.map +1 -1
- package/dist/collection/components/tabs/tab-group.js +1 -1
- package/dist/collection/components/tabs/tab-group.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.js +25 -3
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/utils/date-utils.js +4 -2
- package/dist/collection/utils/date-utils.js.map +1 -1
- package/dist/collection/utils/testing/index.js +15 -8
- package/dist/collection/utils/testing/index.js.map +1 -1
- package/dist/components/datalist.js +3 -3
- package/dist/components/datalist.js.map +1 -1
- package/dist/components/date-picker.js +4 -2
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dropdown.js +5 -2
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/icon.js.map +1 -1
- package/dist/components/menu.js +8 -3
- package/dist/components/menu.js.map +1 -1
- package/dist/components/nano-demo.js +21 -14
- package/dist/components/nano-demo.js.map +1 -1
- package/dist/components/nano-file-upload.js +4 -0
- package/dist/components/nano-file-upload.js.map +1 -1
- package/dist/components/nano-tab-group.js +1 -1
- package/dist/components/nano-tab-group.js.map +1 -1
- package/dist/components/nav-item.js +1 -2
- package/dist/components/nav-item.js.map +1 -1
- package/dist/components/resize-observe.js +80 -14
- package/dist/components/resize-observe.js.map +1 -1
- package/dist/components/sticker.js +2 -0
- package/dist/components/sticker.js.map +1 -1
- package/dist/components/table.js +187 -98
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.worker.js +1 -1
- package/dist/components/tooltip.js +6 -3
- package/dist/components/tooltip.js.map +1 -1
- package/dist/custom-elements/index.js +277 -116
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/{date-utils-bb82b123.js → date-utils-6b7a6e1f.js} +5 -3
- package/dist/esm/date-utils-6b7a6e1f.js.map +1 -0
- package/dist/esm/index-3c280603.js +2 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-datalist_3.entry.js +10 -5
- package/dist/esm/nano-datalist_3.entry.js.map +1 -1
- package/dist/esm/nano-date-input.entry.js +1 -1
- package/dist/esm/nano-date-picker.entry.js +1 -1
- package/dist/esm/nano-demo.entry.js +3 -2
- package/dist/esm/nano-demo.entry.js.map +1 -1
- package/dist/esm/nano-dropdown.entry.js +5 -2
- package/dist/esm/nano-dropdown.entry.js.map +1 -1
- package/dist/esm/nano-file-upload.entry.js +4 -0
- package/dist/esm/nano-file-upload.entry.js.map +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +1 -2
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-icon-button.entry.js +1 -1
- package/dist/esm/nano-icon-button.entry.js.map +1 -1
- package/dist/esm/nano-icon.entry.js.map +1 -1
- package/dist/esm/{nano-tooltip.entry.js → nano-progress-bar_2.entry.js} +29 -6
- package/dist/esm/nano-progress-bar_2.entry.js.map +1 -0
- package/dist/esm/nano-resize-observe_2.entry.js +74 -12
- package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
- package/dist/esm/nano-sticker.entry.js +2 -0
- package/dist/esm/nano-sticker.entry.js.map +1 -1
- package/dist/esm/nano-tab-group.entry.js +1 -1
- package/dist/esm/nano-tab-group.entry.js.map +1 -1
- package/dist/esm/{nano-table-95921f46.js → nano-table-74d627a5.js} +164 -84
- package/dist/esm/nano-table-74d627a5.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/{table.worker-769f1441.js → table.worker-2908df63.js} +3 -3
- package/dist/esm/table.worker-2908df63.js.map +1 -0
- package/dist/{nano-components/p-e9fb087e.js → esm/table.worker-e2f9ccfa.js} +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/p-135fed16.entry.js +5 -0
- package/dist/nano-components/p-135fed16.entry.js.map +1 -0
- package/dist/nano-components/{p-2cb4615b.entry.js → p-2a97ef51.entry.js} +2 -2
- package/dist/nano-components/{p-2cb4615b.entry.js.map → p-2a97ef51.entry.js.map} +0 -0
- package/dist/nano-components/{p-751927d1.entry.js → p-3f25fc76.entry.js} +2 -2
- package/dist/nano-components/p-3f25fc76.entry.js.map +1 -0
- package/dist/nano-components/p-5d149792.entry.js +5 -0
- package/dist/nano-components/p-5d149792.entry.js.map +1 -0
- package/dist/nano-components/p-69e5a37d.entry.js.map +1 -1
- package/dist/nano-components/p-6ad194e4.entry.js +5 -0
- package/dist/nano-components/p-6ad194e4.entry.js.map +1 -0
- package/dist/nano-components/{p-46b348b7.entry.js → p-6cb77d5c.entry.js} +2 -2
- package/dist/nano-components/{p-46b348b7.entry.js.map → p-6cb77d5c.entry.js.map} +0 -0
- package/dist/nano-components/{p-85cfb0af.entry.js → p-9a4297e1.entry.js} +2 -2
- package/dist/nano-components/p-9a4297e1.entry.js.map +1 -0
- package/dist/nano-components/{p-d1c8eca4.entry.js → p-b55ffa92.entry.js} +2 -2
- package/dist/nano-components/p-b55ffa92.entry.js.map +1 -0
- package/dist/nano-components/p-cc5e7acb.entry.js +5 -0
- package/dist/nano-components/p-cc5e7acb.entry.js.map +1 -0
- package/dist/nano-components/p-cecb9af1.js +5 -0
- package/dist/nano-components/p-cecb9af1.js.map +1 -0
- package/dist/nano-components/{p-601e18d5.entry.js → p-d5303933.entry.js} +2 -2
- package/dist/nano-components/p-d5303933.entry.js.map +1 -0
- package/dist/nano-components/{p-4f0e14b5.entry.js → p-d565991d.entry.js} +2 -2
- package/dist/nano-components/p-d565991d.entry.js.map +1 -0
- package/dist/nano-components/p-d7ed2d6e.js +5 -0
- package/dist/nano-components/p-d7ed2d6e.js.map +1 -0
- package/dist/nano-components/p-d81d40d9.js +5 -0
- package/dist/nano-components/{p-26905bca.js.map → p-d81d40d9.js.map} +0 -0
- package/dist/nano-components/{p-244223f0.entry.js → p-dc50b93c.entry.js} +2 -2
- package/dist/nano-components/p-dc50b93c.entry.js.map +1 -0
- package/dist/{cjs/table.worker-e9fb087e.js → nano-components/p-e2f9ccfa.js} +1 -1
- package/dist/nano-components/{p-fb12a45d.entry.js → p-f5ee07b3.entry.js} +2 -2
- package/dist/nano-components/{p-fb12a45d.entry.js.map → p-f5ee07b3.entry.js.map} +0 -0
- package/dist/types/components/icon/icon.d.ts +1 -1
- package/dist/types/components/menu/menu.d.ts +1 -0
- package/dist/types/components/resize-observe/resize-observe.d.ts +20 -1
- package/dist/types/components/table/table-interface.d.ts +35 -24
- package/dist/types/components/table/table.cell.d.ts +1 -1
- package/dist/types/components/table/table.d.ts +48 -15
- package/dist/types/components/table/table.row.d.ts +1 -1
- package/dist/types/components/table/table.store.d.ts +1 -1
- package/dist/types/components/table/table.utils.d.ts +1 -1
- package/dist/types/components/table/table.worker.d.ts +3 -3
- package/dist/types/components/tooltip/tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +59 -14
- package/dist/types/utils/date-utils.d.ts +1 -1
- package/docs-json.json +179 -31
- package/docs-vscode.json +26 -3
- package/package.json +2 -2
- package/dist/cjs/date-utils-c581f187.js.map +0 -1
- package/dist/cjs/nano-progress-bar.cjs.entry.js +0 -33
- package/dist/cjs/nano-progress-bar.cjs.entry.js.map +0 -1
- package/dist/cjs/nano-table-067e0c12.js.map +0 -1
- package/dist/cjs/nano-tooltip.cjs.entry.js.map +0 -1
- package/dist/cjs/table.worker-a4d75c46.js.map +0 -1
- package/dist/esm/date-utils-bb82b123.js.map +0 -1
- package/dist/esm/nano-progress-bar.entry.js +0 -29
- package/dist/esm/nano-progress-bar.entry.js.map +0 -1
- package/dist/esm/nano-table-95921f46.js.map +0 -1
- package/dist/esm/nano-tooltip.entry.js.map +0 -1
- package/dist/esm/table.worker-769f1441.js.map +0 -1
- package/dist/nano-components/p-15a60f7e.js +0 -5
- package/dist/nano-components/p-15a60f7e.js.map +0 -1
- package/dist/nano-components/p-244223f0.entry.js.map +0 -1
- package/dist/nano-components/p-26905bca.js +0 -5
- package/dist/nano-components/p-4f0e14b5.entry.js.map +0 -1
- package/dist/nano-components/p-601e18d5.entry.js.map +0 -1
- package/dist/nano-components/p-751927d1.entry.js.map +0 -1
- package/dist/nano-components/p-85cfb0af.entry.js.map +0 -1
- package/dist/nano-components/p-8fc2a38d.js +0 -5
- package/dist/nano-components/p-8fc2a38d.js.map +0 -1
- package/dist/nano-components/p-9e8c9bac.entry.js +0 -5
- package/dist/nano-components/p-9e8c9bac.entry.js.map +0 -1
- package/dist/nano-components/p-a2e38472.entry.js +0 -5
- package/dist/nano-components/p-a2e38472.entry.js.map +0 -1
- package/dist/nano-components/p-b9c8b99f.entry.js +0 -5
- package/dist/nano-components/p-b9c8b99f.entry.js.map +0 -1
- package/dist/nano-components/p-d1c8eca4.entry.js.map +0 -1
- package/dist/nano-components/p-f43d1d8e.entry.js +0 -5
- package/dist/nano-components/p-f43d1d8e.entry.js.map +0 -1
- package/dist/nano-components/p-feb9f164.entry.js +0 -5
- package/dist/nano-components/p-feb9f164.entry.js.map +0 -1
@@ -9612,13 +9612,13 @@ const DataList = class extends H {
|
|
9612
9612
|
: undefined }, h$1("nano-dropdown", { ...this.dropDownConfig, ref: (el) => (this.nanoDropdown = el), dialogTitle: "Select options from the list below", class: {
|
9613
9613
|
dlist__dropdown: true,
|
9614
9614
|
'dlist--isfiltered': this.isFiltered,
|
9615
|
-
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide }, h$1("nano-menu", { hidden: !this.actvOptEles.length, type: "listbox", label: this.inputLabel ? this.inputLabel.textContent : undefined, class: {
|
9615
|
+
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide, role: "group" }, h$1("nano-menu", { hidden: !this.actvOptEles.length, type: "listbox", label: this.inputLabel ? this.inputLabel.textContent : undefined, class: {
|
9616
9616
|
dlist__menu: true,
|
9617
9617
|
'dlist__menu--open': this.dropwdownOpen,
|
9618
|
-
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown, ref: (el) => (this.listBox = el) }, h$1("slot", { name: "list-top" }), !this.options.length && h$1("slot", null), !!this.options.length && h$1("slot", { name: "internal-opts" }), h$1("slot", { name: "list-bottom" })), h$1("nano-menu", { type: "listbox", label: "No results found", hidden: !!this.actvOptEles.length, class: {
|
9618
|
+
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown, ref: (el) => (this.listBox = el), role: "list" }, h$1("slot", { name: "list-top" }), !this.options.length && h$1("slot", null), !!this.options.length && h$1("slot", { name: "internal-opts" }), h$1("slot", { name: "list-bottom" })), h$1("nano-menu", { type: "listbox", label: "No results found", hidden: !!this.actvOptEles.length, class: {
|
9619
9619
|
dlist__menu: true,
|
9620
9620
|
'dlist__menu--open': this.dropwdownOpen,
|
9621
|
-
} }, h$1("slot", { name: "no-result" })), !!this.actvOptEles && (h$1("div", {
|
9621
|
+
} }, h$1("slot", { name: "no-result" })), !!this.actvOptEles && (h$1("div", { class: "dlist__status" }, this.actvOptEles.length, " result", this.actvOptEles.length > 1 ? 's' : '', " available.")))));
|
9622
9622
|
}
|
9623
9623
|
get host() { return this; }
|
9624
9624
|
static get watchers() { return {
|
@@ -9651,7 +9651,7 @@ var DaysOfWeek;
|
|
9651
9651
|
* @param year
|
9652
9652
|
* @param month
|
9653
9653
|
* @param day
|
9654
|
-
* @returns a new Date
|
9654
|
+
* @returns a new Date object
|
9655
9655
|
*/
|
9656
9656
|
function createDate(year, month, day) {
|
9657
9657
|
const dayInt = parseInt(day, 10);
|
@@ -9668,6 +9668,7 @@ function createDate(year, month, day) {
|
|
9668
9668
|
if (isValid) {
|
9669
9669
|
return new Date(yearInt, monthInt - 1, dayInt);
|
9670
9670
|
}
|
9671
|
+
return undefined;
|
9671
9672
|
}
|
9672
9673
|
/**
|
9673
9674
|
* @param value date string in ISO format YYYY-MM-DD
|
@@ -9675,11 +9676,12 @@ function createDate(year, month, day) {
|
|
9675
9676
|
*/
|
9676
9677
|
function parseISODate(value) {
|
9677
9678
|
if (!value)
|
9678
|
-
return;
|
9679
|
+
return undefined;
|
9679
9680
|
const matches = value.match(ISO_DATE_FORMAT);
|
9680
9681
|
if (matches) {
|
9681
9682
|
return createDate(matches[1], matches[2], matches[3]);
|
9682
9683
|
}
|
9684
|
+
return undefined;
|
9683
9685
|
}
|
9684
9686
|
/**
|
9685
9687
|
* print date in format YYYY-MM-DD
|
@@ -10731,8 +10733,8 @@ const Demo = class extends H {
|
|
10731
10733
|
return (h$1(Host$1, null, h$1("nano-table", { rowRender: {
|
10732
10734
|
template: (_, c, TableCell) => [
|
10733
10735
|
c.renderedRow,
|
10734
|
-
c.
|
10735
|
-
return (h$1("tr", { class: "child-row" }, h$1(TableCell, { header: true }, item.name), h$1(TableCell, null, capitalise(c.
|
10736
|
+
c.rowModel.includedItems?.length ? (c.rowModel.includedItems?.map((item) => {
|
10737
|
+
return (h$1("tr", { class: "child-row" }, h$1(TableCell, { header: true }, item.name), h$1(TableCell, null, capitalise(c.rowModel.status || this.order.status)), h$1(TableCell, null, capitalise(item.sku)), h$1(TableCell, null, capitalise(item.salesTag)), h$1(TableCell, null, mediumDate(item.requestedShippingDate))));
|
10736
10738
|
})) : (h$1(Fragment$1, null)),
|
10737
10739
|
].flat(1),
|
10738
10740
|
}, columns: [
|
@@ -10741,6 +10743,7 @@ const Demo = class extends H {
|
|
10741
10743
|
prop: 'name',
|
10742
10744
|
pinned: 'start',
|
10743
10745
|
rowHeader: true,
|
10746
|
+
autoTooltip: true,
|
10744
10747
|
},
|
10745
10748
|
{
|
10746
10749
|
title: 'Status',
|
@@ -13484,7 +13487,8 @@ const Dropdown = class extends H {
|
|
13484
13487
|
setTimeout(() => this.updateAccessibleTrigger(), 100);
|
13485
13488
|
}
|
13486
13489
|
disconnectedCallback() {
|
13487
|
-
this.
|
13490
|
+
if (this.host.isConnected)
|
13491
|
+
this.hide();
|
13488
13492
|
if (this.popover)
|
13489
13493
|
this.popover.destroy();
|
13490
13494
|
}
|
@@ -13492,7 +13496,9 @@ const Dropdown = class extends H {
|
|
13492
13496
|
return (h$1("div", { part: "base", id: this.dropdownId, class: {
|
13493
13497
|
dropdown: true,
|
13494
13498
|
'dropdown--open': this.open,
|
13495
|
-
} }, h$1("span", { part: "trigger", class: "dropdown__trigger", ref: (el) => (this.trigger = el), onKeyDown: this.handleTriggerKeyDown, onClick: this.togglePanel }, h$1("slot", { name: "trigger", onSlotchange: this.handleTriggerSlotChange })), h$1("div", { ref: (el) => (this.positioner = el), class: "dropdown__positioner" }, h$1("div", { ref: (el) => (this.panel = el), part: "panel", class: `dropdown__panel ${this.placement.split('-').join(' ')}`, "aria-hidden": !this.open, role:
|
13499
|
+
} }, h$1("span", { part: "trigger", class: "dropdown__trigger", ref: (el) => (this.trigger = el), onKeyDown: this.handleTriggerKeyDown, onClick: this.togglePanel }, h$1("slot", { name: "trigger", onSlotchange: this.handleTriggerSlotChange })), h$1("div", { ref: (el) => (this.positioner = el), class: "dropdown__positioner" }, h$1("div", { ref: (el) => (this.panel = el), part: "panel", class: `dropdown__panel ${this.placement.split('-').join(' ')}`, "aria-hidden": !this.open, role: this.host.getAttribute('role') === 'group' ? 'group' : 'dialog', "aria-modal": this.host.getAttribute('role') === 'group' ? undefined : 'true', "aria-labelledby": this.dialogTitle ? this.labelId : undefined }, this.dialogTitle && (h$1("span", { id: this.labelId, class: "dropdown__accessible-title", "aria-live": this.host.getAttribute('role') === 'group'
|
13500
|
+
? undefined
|
13501
|
+
: 'polite' }, this.dialogTitle)), h$1("slot", null)))));
|
13496
13502
|
}
|
13497
13503
|
get host() { return this; }
|
13498
13504
|
static get watchers() { return {
|
@@ -14349,6 +14355,10 @@ const FileUpload = class extends H {
|
|
14349
14355
|
if (!this.canChangeFileList || !this.removeFiles.length)
|
14350
14356
|
return;
|
14351
14357
|
this.fileList = this.fileList.filter((fileItem) => !this.removeFiles.find((rmFile) => rmFile === fileItem));
|
14358
|
+
try {
|
14359
|
+
this.removeFiles.forEach((f) => f.location ? URL.revokeObjectURL(f.location) : '');
|
14360
|
+
}
|
14361
|
+
catch (e) { }
|
14352
14362
|
this.removeFiles = [];
|
14353
14363
|
};
|
14354
14364
|
this.onInputChange = () => {
|
@@ -17029,7 +17039,7 @@ const IconButton = class extends H {
|
|
17029
17039
|
return (h$1(TagType, { part: "base", ref: (el) => (this.button = el), class: {
|
17030
17040
|
'icon-button': true,
|
17031
17041
|
'icon-button--disabled': this.disabled,
|
17032
|
-
}, "aria-label": this.label, name: this.name, value: this.value, href: this.href || undefined, target: this.href && this.target ? this.target : undefined, type: !this.href && this.type ? this.type : undefined }, h$1("nano-icon", { name: this.iconName, src: this.iconSrc, "aria-hidden": "true" })));
|
17042
|
+
}, "aria-label": this.label, name: this.name, value: this.value, href: this.href || undefined, target: this.href && this.target ? this.target : undefined, type: !this.href && this.type ? this.type : undefined }, h$1("nano-icon", { name: this.iconName, src: this.iconSrc, "aria-hidden": "true", lazy: false })));
|
17033
17043
|
}
|
17034
17044
|
static get style() { return iconButtonCss; }
|
17035
17045
|
};
|
@@ -17821,12 +17831,17 @@ const Menu = class extends H {
|
|
17821
17831
|
}
|
17822
17832
|
}
|
17823
17833
|
// Component Lifecycle
|
17834
|
+
componentDidLoad() {
|
17835
|
+
{
|
17836
|
+
getDirectChildren(this.el, ':not(nano-nav-item):not(nano-option):not([role])', true).forEach((el) => el.setAttribute('role', 'none'));
|
17837
|
+
}
|
17838
|
+
}
|
17824
17839
|
render() {
|
17825
|
-
return (h$1(Host$1,
|
17840
|
+
return (h$1(Host$1, { role: this.type === 'menu' ? 'menu' : 'group' }, h$1("div", { onClick: this.handleClick, onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onFocus: this.handleFocus, "aria-label": this.label ? this.label : undefined, ref: (el) => (this.menu = el), part: "base", class: {
|
17826
17841
|
menu: true,
|
17827
17842
|
['menu--' + this.type]: true,
|
17828
17843
|
'menu--has-focus': this.hasFocus,
|
17829
|
-
}, tabIndex: -1 }, h$1("slot", null))));
|
17844
|
+
}, tabIndex: -1, role: "group" }, h$1("slot", null))));
|
17830
17845
|
}
|
17831
17846
|
get el() { return this; }
|
17832
17847
|
static get style() { return menuCss; }
|
@@ -18097,8 +18112,7 @@ const NavItem = class extends H {
|
|
18097
18112
|
this.fromHover = false;
|
18098
18113
|
if (this.hasSecondarySlot)
|
18099
18114
|
this.toggleSecondary();
|
18100
|
-
else
|
18101
|
-
this.el.querySelector('*')?.click();
|
18115
|
+
// else this.el.querySelector<HTMLElement>('*')?.click();
|
18102
18116
|
};
|
18103
18117
|
this.didOpen = false;
|
18104
18118
|
this.isInGlobalNav = false;
|
@@ -18874,12 +18888,17 @@ const ResizeObserve = class extends H {
|
|
18874
18888
|
constructor() {
|
18875
18889
|
super();
|
18876
18890
|
this.__registerHost();
|
18891
|
+
this.__attachShadow();
|
18877
18892
|
this.nanoResizeStateChange = createEvent(this, "nanoResizeStateChange", 7);
|
18878
18893
|
this.nanoResizeObserverReady = createEvent(this, "nanoResizeObserverReady", 7);
|
18894
|
+
this.nanoResizeContentFitChange = createEvent(this, "nanoResizeContentFitChange", 7);
|
18879
18895
|
this.isReady = false;
|
18880
18896
|
this.assessChanges = () => {
|
18881
18897
|
if (!this.currentWidth && !this.currentHeight)
|
18882
18898
|
return;
|
18899
|
+
readTask(() => this.assesContentFit());
|
18900
|
+
if (!this.states || !this.appliedStates)
|
18901
|
+
return;
|
18883
18902
|
const changedStates = { h: new Map(), w: new Map() };
|
18884
18903
|
let hasChanged = false;
|
18885
18904
|
Object.keys(this.appliedStates).forEach((dimType) => {
|
@@ -18909,6 +18928,9 @@ const ResizeObserve = class extends H {
|
|
18909
18928
|
this.currentWidth = undefined;
|
18910
18929
|
this.currentHeight = undefined;
|
18911
18930
|
this.classNames = [];
|
18931
|
+
this.contentFitX = null;
|
18932
|
+
this.contentFitY = null;
|
18933
|
+
this.notifyContentFit = undefined;
|
18912
18934
|
this.states = undefined;
|
18913
18935
|
}
|
18914
18936
|
classNameChange() {
|
@@ -18924,8 +18946,6 @@ const ResizeObserve = class extends H {
|
|
18924
18946
|
statesChanged() {
|
18925
18947
|
if (!this.states)
|
18926
18948
|
return;
|
18927
|
-
if (!this.ro)
|
18928
|
-
this.attachRO();
|
18929
18949
|
const toBpDir = (bpDir) => {
|
18930
18950
|
const bpDirSpl = bpDir.split(/(\d+)/).filter((bs) => bs.length);
|
18931
18951
|
return { bp: parseInt(bpDirSpl[0]), dir: bpDirSpl[1] };
|
@@ -18948,7 +18968,59 @@ const ResizeObserve = class extends H {
|
|
18948
18968
|
}
|
18949
18969
|
});
|
18950
18970
|
}
|
18971
|
+
assesContentFit() {
|
18972
|
+
if (!this.notifyContentFit)
|
18973
|
+
return;
|
18974
|
+
const findNonContentsEle = (ele) => {
|
18975
|
+
if (window.getComputedStyle(ele).display !== 'contents')
|
18976
|
+
return ele;
|
18977
|
+
const recurse = (e) => {
|
18978
|
+
return Array.from(e.children).find((cEle) => {
|
18979
|
+
if (window.getComputedStyle(cEle).display !== 'contents')
|
18980
|
+
return cEle;
|
18981
|
+
recurse(cEle);
|
18982
|
+
});
|
18983
|
+
};
|
18984
|
+
return recurse(ele);
|
18985
|
+
};
|
18986
|
+
let didChange = false;
|
18987
|
+
const measureEle = findNonContentsEle(this.host.firstElementChild);
|
18988
|
+
if (measureEle) {
|
18989
|
+
if (this.notifyContentFit?.includes('x')) {
|
18990
|
+
if (this.currentWidth < measureEle.scrollWidth &&
|
18991
|
+
this.contentFitX !== false) {
|
18992
|
+
didChange = true;
|
18993
|
+
this.contentFitX = false;
|
18994
|
+
}
|
18995
|
+
else if (this.currentWidth >= measureEle.scrollWidth &&
|
18996
|
+
this.contentFitX !== true) {
|
18997
|
+
didChange = true;
|
18998
|
+
this.contentFitX = true;
|
18999
|
+
}
|
19000
|
+
}
|
19001
|
+
if (this.notifyContentFit?.includes('y')) {
|
19002
|
+
if (this.currentHeight < measureEle.scrollHeight &&
|
19003
|
+
this.contentFitY !== false) {
|
19004
|
+
didChange = true;
|
19005
|
+
this.contentFitY = false;
|
19006
|
+
}
|
19007
|
+
else if (this.currentHeight >= measureEle.scrollHeight &&
|
19008
|
+
this.contentFitY !== true) {
|
19009
|
+
didChange = true;
|
19010
|
+
this.contentFitY = true;
|
19011
|
+
}
|
19012
|
+
}
|
19013
|
+
if (didChange) {
|
19014
|
+
this.nanoResizeContentFitChange.emit({
|
19015
|
+
x: this.contentFitX,
|
19016
|
+
y: this.contentFitY,
|
19017
|
+
});
|
19018
|
+
}
|
19019
|
+
}
|
19020
|
+
}
|
18951
19021
|
applyChanges(changes) {
|
19022
|
+
if (!this.states)
|
19023
|
+
return;
|
18952
19024
|
let classNames = [...this.classNames];
|
18953
19025
|
Object.keys(changes).forEach((dimType) => {
|
18954
19026
|
changes[dimType].forEach((state) => {
|
@@ -18979,35 +19051,40 @@ const ResizeObserve = class extends H {
|
|
18979
19051
|
return retObj;
|
18980
19052
|
}
|
18981
19053
|
attachRO() {
|
18982
|
-
this.ro = new ResizeObserver((
|
18983
|
-
|
18984
|
-
|
18985
|
-
|
18986
|
-
}
|
19054
|
+
this.ro = new ResizeObserver(() => {
|
19055
|
+
const { width, height } = this.host.getBoundingClientRect();
|
19056
|
+
this.currentWidth = Math.ceil(width);
|
19057
|
+
this.currentHeight = Math.ceil(height);
|
18987
19058
|
});
|
18988
19059
|
this.ro.observe(this.host);
|
18989
19060
|
}
|
18990
19061
|
componentWillLoad() {
|
18991
19062
|
this.classNames = Array.from(this.host.classList);
|
18992
|
-
if (!this.states)
|
18993
|
-
return;
|
18994
19063
|
if (!this.currentWidth || !this.currentHeight) {
|
18995
19064
|
readTask(() => {
|
18996
19065
|
const { width, height } = this.host.getBoundingClientRect();
|
18997
|
-
this.currentWidth = width;
|
18998
|
-
this.currentHeight = height;
|
19066
|
+
this.currentWidth = Math.ceil(width);
|
19067
|
+
this.currentHeight = Math.ceil(height);
|
18999
19068
|
});
|
19000
19069
|
}
|
19001
19070
|
this.statesChanged();
|
19002
19071
|
// set all class as 'not-' by deafult
|
19003
19072
|
this.applyChanges(this.appliedStates);
|
19004
19073
|
}
|
19074
|
+
connectedCallback() {
|
19075
|
+
if (!this.ro)
|
19076
|
+
this.attachRO();
|
19077
|
+
}
|
19005
19078
|
disconnectedCallback() {
|
19006
19079
|
if (this.ro)
|
19007
19080
|
this.ro.disconnect();
|
19008
19081
|
}
|
19009
19082
|
render() {
|
19010
|
-
return (h$1(Host$1, null, h$1("slot", null)
|
19083
|
+
return (h$1(Host$1, null, h$1("slot", null), !!this.notifyContentFit &&
|
19084
|
+
(this.contentFitX !== null || this.contentFitY !== null) && [
|
19085
|
+
!!this.contentFitX ? (h$1("slot", { name: "content-fit-x" })) : (h$1("slot", { name: "content-nofit-x" })),
|
19086
|
+
!!this.contentFitY ? (h$1("slot", { name: "content-fit-y" })) : (h$1("slot", { name: "content-nofit-y" })),
|
19087
|
+
]));
|
19011
19088
|
}
|
19012
19089
|
get host() { return this; }
|
19013
19090
|
static get watchers() { return {
|
@@ -24444,6 +24521,8 @@ const Sticker = class extends H {
|
|
24444
24521
|
/** A root sticker is a fixed element Or this sticker is sticking to another.
|
24445
24522
|
* We need a content resize watcher to make sure we maintain a correct placeholder size in the body */
|
24446
24523
|
stickerResizeListener() {
|
24524
|
+
if (!this.content)
|
24525
|
+
return;
|
24447
24526
|
if (this.contentSizeObserver) {
|
24448
24527
|
this.contentSizeObserver.disconnect();
|
24449
24528
|
this.contentSizeObserver = undefined;
|
@@ -25035,7 +25114,7 @@ const TabGroup = class extends H {
|
|
25035
25114
|
this.updateScrollControls();
|
25036
25115
|
}, 500);
|
25037
25116
|
/** maintain a weakmap of mutation observers to maintain tab / indicator position on all changes. */
|
25038
|
-
const nodes = ev.target.
|
25117
|
+
const nodes = ev.target.assignedElements({ flatten: true });
|
25039
25118
|
nodes.forEach((node) => {
|
25040
25119
|
if (!this.mutationObservers.get(node)) {
|
25041
25120
|
const mo = new MutationObserver(() => {
|
@@ -25488,7 +25567,7 @@ function storeSetData(host, rows) {
|
|
25488
25567
|
row[colName] = Number(coerceDate);
|
25489
25568
|
});
|
25490
25569
|
row['__index'] = i;
|
25491
|
-
row['__uuid'] = cyrb53(
|
25570
|
+
row['__uuid'] = cyrb53(cols.map((c) => row[c.prop]).join());
|
25492
25571
|
return row;
|
25493
25572
|
});
|
25494
25573
|
store.data.state.rows = rows;
|
@@ -25550,7 +25629,7 @@ function colDataModel(rowIndex, colIndex) {
|
|
25550
25629
|
const column = columns[colIndex];
|
25551
25630
|
const prop = column?.prop;
|
25552
25631
|
const rowModel = rows[rowIndex];
|
25553
|
-
const cellModel = rowModel[columns[colIndex].prop];
|
25632
|
+
const cellModel = rowModel ? rowModel[columns[colIndex].prop] : '';
|
25554
25633
|
return {
|
25555
25634
|
prop,
|
25556
25635
|
cellModel,
|
@@ -25567,9 +25646,9 @@ function colDataModel(rowIndex, colIndex) {
|
|
25567
25646
|
function rowDataModel(rowIndex) {
|
25568
25647
|
const store = fetchStores();
|
25569
25648
|
const rows = store.data.state.rows;
|
25570
|
-
const
|
25649
|
+
const rowModel = rows[rowIndex];
|
25571
25650
|
return {
|
25572
|
-
|
25651
|
+
rowModel,
|
25573
25652
|
rowIndex,
|
25574
25653
|
};
|
25575
25654
|
}
|
@@ -25636,7 +25715,7 @@ function mergeCellProperties(rowIndex, colIndex, defaultProps) {
|
|
25636
25715
|
* @returns - a JSX node
|
25637
25716
|
*/
|
25638
25717
|
function colheadFootRender(col) {
|
25639
|
-
const tpl = col?.
|
25718
|
+
const tpl = col?.columnTemplate;
|
25640
25719
|
return tpl ? (tpl(h, col)) : (h(Fragment, null, col.title));
|
25641
25720
|
}
|
25642
25721
|
const stickyHIOs = new WeakMap();
|
@@ -25999,7 +26078,7 @@ function cellRender(rowIndex, colIndex) {
|
|
25999
26078
|
: d;
|
26000
26079
|
}
|
26001
26080
|
}
|
26002
|
-
return tpl ? (tpl(h, model)) : (h(Fragment, null, model.cellModel?.toString()));
|
26081
|
+
return tpl ? (tpl(h, model)) : model.cellModel ? (h(Fragment, null, model.cellModel?.toString())) : ('');
|
26003
26082
|
}
|
26004
26083
|
const baseCellClasses = (colIndex, toString = false) => {
|
26005
26084
|
const store = fetchStores();
|
@@ -26016,9 +26095,9 @@ const baseCellClasses = (colIndex, toString = false) => {
|
|
26016
26095
|
return classes;
|
26017
26096
|
};
|
26018
26097
|
const TableCell = ({ rowIndex, colIndex, nestedContent, }) => {
|
26019
|
-
const
|
26020
|
-
|
26021
|
-
|
26098
|
+
const Content = () => nestedContent
|
26099
|
+
? nestedContent()
|
26100
|
+
: cellRender(rowIndex, colIndex) || (h("span", { class: "placeholder" }, "\u00A0"));
|
26022
26101
|
let CellType = 'td';
|
26023
26102
|
const store = fetchStores();
|
26024
26103
|
const column = store.config.state.columns[colIndex];
|
@@ -26032,24 +26111,37 @@ const TableCell = ({ rowIndex, colIndex, nestedContent, }) => {
|
|
26032
26111
|
: { ...props, scope: 'row' };
|
26033
26112
|
CellType = 'th';
|
26034
26113
|
}
|
26114
|
+
const ContentWrap = (props) => (h("div", { ...props, class: {
|
26115
|
+
[`${CSSNAMESPACE}__cell-content`]: true,
|
26116
|
+
[`${CSSNAMESPACE}__cell-content--wrap`]: !!column.wrap,
|
26117
|
+
} },
|
26118
|
+
h(Content, null)));
|
26035
26119
|
return (h(CellType
|
26036
26120
|
// role="gridcell"
|
26037
|
-
, { ...props },
|
26038
|
-
|
26121
|
+
, { ...props }, column.autoTooltip && !column.wrap ? (h("nano-resize-observe", { notifyContentFit: "x", onNanoResizeContentFitChange: (e) => (e.target.firstElementChild.disabled =
|
26122
|
+
e.detail.x) },
|
26123
|
+
h("nano-tooltip", { disabled: true, hoist: true },
|
26124
|
+
h(ContentWrap, null),
|
26125
|
+
h("span", { slot: "content" },
|
26126
|
+
h(Content, null))))) : (h(ContentWrap, null))));
|
26039
26127
|
};
|
26040
26128
|
|
26041
|
-
const TableRow = ({ rowRenderer, rowIndex,
|
26129
|
+
const TableRow = ({ rowRenderer, rowIndex, rowModel, onColumnPinned }, children, utils) => {
|
26042
26130
|
let extraProps = {};
|
26043
|
-
const TableCell = ({ header }, children) => {
|
26044
|
-
const cell = h("div", { class:
|
26131
|
+
const TableCell = ({ header, wrap }, children) => {
|
26132
|
+
const cell = (h("div", { class: {
|
26133
|
+
[`${CSSNAMESPACE}__cell-content`]: true,
|
26134
|
+
[`${CSSNAMESPACE}__cell-content--wrap`]: wrap,
|
26135
|
+
} }, children));
|
26045
26136
|
return header ? h("th", { scope: "row" }, cell) : h("td", null, cell);
|
26046
26137
|
};
|
26047
|
-
if (!
|
26138
|
+
if (!rowModel) {
|
26048
26139
|
const model = rowDataModel(rowIndex);
|
26049
|
-
|
26140
|
+
rowModel = model.rowModel;
|
26050
26141
|
}
|
26051
26142
|
if (rowRenderer?.rowProperties) {
|
26052
|
-
extraProps =
|
26143
|
+
extraProps =
|
26144
|
+
rowRenderer.rowProperties({ rowModel, rowIndex }) || extraProps;
|
26053
26145
|
}
|
26054
26146
|
let pinned;
|
26055
26147
|
if (rowRenderer?.pinned && typeof rowRenderer.pinned === 'function') {
|
@@ -26060,15 +26152,15 @@ const TableRow = ({ rowRenderer, rowIndex, row, onColumnPinned }, children, util
|
|
26060
26152
|
const tpl = rowRenderer?.template;
|
26061
26153
|
if (tpl) {
|
26062
26154
|
let toRender = tpl(h, {
|
26063
|
-
renderedRow: (h("tr", { ...props, key:
|
26064
|
-
|
26155
|
+
renderedRow: (h("tr", { ...props, key: rowModel.__uuid }, children)),
|
26156
|
+
rowModel,
|
26065
26157
|
rowIndex,
|
26066
26158
|
}, TableCell);
|
26067
26159
|
if (Array.isArray(toRender)) {
|
26068
26160
|
toRender = utils.map(toRender, (node, i) => {
|
26069
26161
|
if (node.vtag === 'tr') {
|
26070
26162
|
if (!node.vkey)
|
26071
|
-
node.vkey = `${
|
26163
|
+
node.vkey = `${rowModel.__uuid}_${i}`;
|
26072
26164
|
node.vattrs = mergeProperties({ class: headerPinClasses('tr', pinned, true) }, node.vattrs);
|
26073
26165
|
if (!!node.vchildren) {
|
26074
26166
|
node.vchildren = utils.map(node.vchildren, (cNode, i) => {
|
@@ -26094,15 +26186,18 @@ const TableRow = ({ rowRenderer, rowIndex, row, onColumnPinned }, children, util
|
|
26094
26186
|
}
|
26095
26187
|
return toRender;
|
26096
26188
|
}
|
26097
|
-
return (h("tr", { ...props, key:
|
26189
|
+
return (h("tr", { ...props, key: rowModel.__uuid }, children));
|
26098
26190
|
};
|
26099
26191
|
const TableHeadFootRow = ({ rowRenderer, onColumnPinned }, children, utils) => {
|
26100
26192
|
let extraProps = {};
|
26101
26193
|
if (rowRenderer.rowProperties) {
|
26102
26194
|
extraProps = rowRenderer.rowProperties() || {};
|
26103
26195
|
}
|
26104
|
-
const TableCell = ({ header }, children) => {
|
26105
|
-
const cell = h("div", { class:
|
26196
|
+
const TableCell = ({ header, wrap }, children) => {
|
26197
|
+
const cell = (h("div", { class: {
|
26198
|
+
[`${CSSNAMESPACE}__cell-content`]: true,
|
26199
|
+
[`${CSSNAMESPACE}__cell-content--wrap`]: wrap,
|
26200
|
+
} }, children));
|
26106
26201
|
return header !== false ? h("th", { scope: "col" }, cell) : h("td", null, cell);
|
26107
26202
|
};
|
26108
26203
|
const pinned = rowRenderer.pinned || null;
|
@@ -26144,15 +26239,15 @@ const TableHeadFootRow = ({ rowRenderer, onColumnPinned }, children, utils) => {
|
|
26144
26239
|
return h("tr", { ...props }, children);
|
26145
26240
|
};
|
26146
26241
|
|
26147
|
-
const tableCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}nano-table{display:block;width:100%;--max-col-width:clamp(200px,
|
26242
|
+
const tableCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}nano-table{display:block;width:100%;--max-col-width:clamp(200px, 500px, 50vw);--color:var(--nano-color-mediumgrey, #68767e);--font-size:0.87rem;--cell-line-height:1.5;--thead-font-size:0.95rem;--thead-color:#455560;--tfoot-color:#455560;--border-color:#dddbda;--border-style:thin solid var(--border-color);--border-tint-color:#0084a9;--border-tint-style:3px solid var(--border-tint-color);--cell-bg-rgb:var(--nano-color-white-rgb, 255 255 255);--head-bg-rgb:250, 250, 249;--foot-bg-rgb:var(--head-bg-rgb);--th-row-bg-rgb:var(--cell-bg-rgb);--ordered-bg-rgb:var(--nano-color-offwhite-rgb, 249 249 251);--td-padding-start:0.625rem;--td-padding-end:0.625rem;--td-padding-top:0.5rem;--td-padding-bottom:0.4125rem;--th-padding-start:0.625rem;--th-padding-end:0.625rem;--th-padding-top:0.875rem;--th-padding-bottom:0.6875rem;--td-padding-v:var(--td-padding-top) var(--td-padding-bottom);--td-padding-h:var(--td-padding-start) var(--td-padding-end);--th-padding-v:var(--th-padding-top) var(--th-padding-bottom);--th-padding-h:var(--th-padding-start) var(--th-padding-end);--foot-th-padding-v:var(--td-padding-top) var(--td-padding-bottom);--foot-th-padding-h:var(--td-padding-start) var(--td-padding-end);--head-th-padding-v:var(--th-padding-top) var(--th-padding-bottom);--head-th-padding-h:var(--th-padding-start) var(--th-padding-end);--bookend-col-padding:2rem}.nano-tbl{color:var(--color);text-align:start;width:100%;font-size:var(--font-size);border-spacing:0 0;border-collapse:separate;background:rgb(var(--cell-bg-rgb));border-inline-end:1px solid transparent;border-block-start:1px solid transparent;position:relative;z-index:1}.nano-tbl__wrap{display:table;min-width:100%}.nano-tbl__top-anchor{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;position:relative}.nano-tbl__ordered{background-color:var(--ordered-bg);border-inline-start:var(--border-style);border-inline-end:var(--border-style)}.nano-tbl__drag-mask{display:none;position:absolute;inset-block:-2px -2px;z-index:10;opacity:0;transition:0.2s ease opacity}.nano-tbl__drag-mask--start{width:calc(50% + 2px);inset-inline-start:-2px;border-inline-start:2px dashed var(--border-tint-color)}.nano-tbl__drag-mask--end{width:50%;inset-inline-end:0;border-inline-end:2px dashed var(--border-tint-color)}.nano-tbl__drag-mask--active{opacity:1}.nano-tbl__dragging .nano-tbl__drag-mask{display:block}.nano-tbl__drag--start{opacity:0.4}.nano-tbl__dragging .nano-tbl__td,.nano-tbl__dragging .nano-tbl__th{cursor:no-drop}.nano-tbl__dragging .nano-tbl__td .nano-tbl__cell-content,.nano-tbl__dragging .nano-tbl__th .nano-tbl__cell-content{pointer-events:none}.nano-tbl__order-btn{padding:0;border:none;outline:none;font:inherit;background:none;-webkit-appearance:none;appearance:none;color:inherit;display:flex;gap:10px;align-items:center;width:100%}.nano-tbl__status-icons{margin-inline:auto 10px;display:flex;gap:10px}.nano-tbl__progress-bar{font-size:0.2rem;position:sticky;inset-block-start:0;inset-inline:0;z-index:10;transition:scale 0.25s;scale:0;width:100%;height:0}.nano-tbl__progress-bar--show{scale:1;height:auto}.nano-tbl__caption--hide{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}.nano-tbl__td,.nano-tbl__th{line-height:var(--cell-line-height);text-align:start;border-block-start:var(--border-style);max-width:var(--max-col-width);background-color:rgb(var(--cell-bg-rgb))}tbody:first-of-type tr:first-child .nano-tbl__td,tbody:first-of-type tr:first-child .nano-tbl__th{border-block-start:none}tbody:last-of-type tr:last-child .nano-tbl__td,tbody:last-of-type tr:last-child .nano-tbl__th{border-block-end:var(--border-style)}.md .nano-tbl__td:first-child .nano-tbl__cell-content,.md .nano-tbl__th:first-child .nano-tbl__cell-content{padding-inline-start:var(--bookend-col-padding)}.md .nano-tbl__td:last-child .nano-tbl__cell-content,.md .nano-tbl__th:last-child .nano-tbl__cell-content{padding-inline-end:var(--bookend-col-padding)}@media (max-width: 768px){.nano-tbl__td:first-child .nano-tbl__cell-content,.nano-tbl__th:first-child .nano-tbl__cell-content{padding-inline-start:var(--td-padding-start) !important}.nano-tbl__td:last-child .nano-tbl__cell-content,.nano-tbl__th:last-child .nano-tbl__cell-content{padding-inline-end:var(--td-padding-end) !important}}thead .nano-tbl__td,thead .nano-tbl__th{color:var(--thead-color);font-weight:800;background:rgba(var(--head-bg-rgb), 90%);font-size:var(--thead-font-size);border-block-start:none !important;transition:all 0.2s ease}thead .nano-tbl__td .nano-tbl__cell-content,thead .nano-tbl__th .nano-tbl__cell-content{padding-block:var(--head-th-padding-v);padding-inline:var(--head-th-padding-h)}tfoot .nano-tbl__td,tfoot .nano-tbl__th{color:var(--tfoot-color);font-weight:800;border-block-start:none;background:rgba(var(--foot-bg-rgb), 90%);font-size:var(--thead-font-size)}tfoot .nano-tbl__td .nano-tbl__cell-content,tfoot .nano-tbl__th .nano-tbl__cell-content{padding-block:var(--foot-th-padding-v);padding-inline:var(--foot-th-padding-h)}.nano-tbl__td.nano-tbl__ordered,.nano-tbl__th.nano-tbl__ordered{background-color:rgba(var(--ordered-bg-rgb), 0.8) !important}.nano-tbl__cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-block:var(--td-padding-v);padding-inline:var(--td-padding-h)}.nano-tbl__cell-content--no-result{padding-block:2rem}.nano-tbl__cell-content--wrap{white-space:normal;overflow:visible}.nano-tbl tbody{will-change:scroll-position;opacity:1;transition:0.1s ease opacity;transform:translateZ(0)}.nano-tbl tbody.nano-tbl__inactive{opacity:0}.nano-tbl th[scope=row]{font-weight:800;margin:0}.nano-tbl__pin{position:sticky}.nano-tbl__pin--start{inset-inline:-1px auto;transition:max-width 0.25s ease}.nano-tbl__pin--start::after{content:\"\";position:absolute;inset:0;box-shadow:5px 1px 4px 0 rgba(0, 0, 0, 0.2);opacity:0;z-index:-1}.nano-tbl__pinned--start .nano-tbl__pin--start{z-index:2;max-width:125px !important}.sm .nano-tbl__pinned--start .nano-tbl__pin--start{max-width:var(--max-col-width) !important}.nano-tbl__pinned--start .nano-tbl__pin--start::after{opacity:1}.nano-tbl__pin--end{}.nano-tbl__pin--start+.nano-tbl__pin--end{inset-inline:auto auto}.nano-tbl__pin--start+.nano-tbl__pin--end::after{display:none}.sm .nano-tbl__pin--end{inset-inline:auto -1px !important;max-width:min(50vw, 200px)}.sm .nano-tbl__pin--end::after{display:block !important;content:\"\";position:absolute;inset:0;box-shadow:-5px 1px 4px 0 rgba(0, 0, 0, 0.2);opacity:0;z-index:-1}.sm .nano-tbl__pinned--end .nano-tbl__pin--end::after{opacity:1}.nano-tbl__pin--top{inset-block:-1px auto}.nano-tbl__pinned--top .nano-tbl__pin--top{z-index:4 !important}.nano-tbl__pin--bottom{inset-block:auto -1px}.nano-tbl__pinned--bottom .nano-tbl__pin--bottom{z-index:5 !important}.nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pin--start{z-index:5 !important}.nano-tbl__pinned--top.nano-tbl__pinned--start .nano-tbl__pin--top.nano-tbl__pin--start{z-index:6 !important}.nano-tbl__pinned--end .nano-tbl__pin--top.nano-tbl__pin--end{z-index:5 !important}.nano-tbl__pinned--top.nano-tbl__pinned--end .nano-tbl__pin--top.nano-tbl__pin--end{z-index:6 !important}.nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pin--start{z-index:5 !important}.nano-tbl__pinned--bottom.nano-tbl__pinned--start .nano-tbl__pin--bottom.nano-tbl__pin--start{z-index:6 !important}.nano-tbl__pinned--end .nano-tbl__pin--bottom.nano-tbl__pin--end{z-index:5 !important}.nano-tbl__pinned--bottom.nano-tbl__pinned--end .nano-tbl__pin--bottom.nano-tbl__pin--end{z-index:6 !important}.nano-tbl thead tr:last-of-type td,.nano-tbl thead tr:last-of-type th{border-block-end:var(--border-tint-style)}.nano-tbl tfoot tr:first-of-type td,.nano-tbl tfoot tr:first-of-type th{border-block-start:none}.nano-tbl tfoot tr:last-of-type td,.nano-tbl tfoot tr:last-of-type th{border-block-end:var(--border-tint-style)}.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:first-of-type td,.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:first-of-type th{border-block-start:var(--border-tint-style) !important}.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:last-of-type td,.nano-tbl__pinned--bottom .nano-tbl tfoot tr.nano-tbl__pin--bottom:last-of-type th{border-block-end:none !important}.nano-tbl .unlimited-width{max-width:none}.nano-tbl__spinner{font-size:1.5rem;transition:scale 0.25s;scale:0;padding:0.5rem;position:absolute;inset-block-end:0;inset-inline-start:calc(50% - 0.75rem);z-index:0}.nano-tbl__spinner--show{scale:1;position:sticky}.nano-tbl nano-skeleton{line-height:var(--cell-line-height)}";
|
26148
26243
|
|
26149
26244
|
let id$1 = 0;
|
26150
26245
|
const Table = class extends H {
|
26151
26246
|
constructor() {
|
26152
26247
|
super();
|
26153
26248
|
this.__registerHost();
|
26154
|
-
this.nanoTblBlockRendered = createEvent(this, "nanoTblBlockRendered", 7);
|
26155
26249
|
this.nanoTblReady = createEvent(this, "nanoTblReady", 7);
|
26250
|
+
this.nanoTblBlockRendered = createEvent(this, "nanoTblBlockRendered", 7);
|
26156
26251
|
this.nanoTblBeforeSort = createEvent(this, "nanoTblBeforeSort", 7);
|
26157
26252
|
this.nanoTblAfterSort = createEvent(this, "nanoTblAfterSort", 7);
|
26158
26253
|
this.nanoTblColDrag = createEvent(this, "nanoTblColDrag", 7);
|
@@ -26161,22 +26256,33 @@ const Table = class extends H {
|
|
26161
26256
|
this.nanoTblAfterFilter = createEvent(this, "nanoTblAfterFilter", 7);
|
26162
26257
|
this.nanoTblBeforeSearch = createEvent(this, "nanoTblBeforeSearch", 7);
|
26163
26258
|
this.nanoTblAfterSearch = createEvent(this, "nanoTblAfterSearch", 7);
|
26259
|
+
this.nanoTblBeforeEdit = createEvent(this, "nanoTblBeforeEdit", 7);
|
26164
26260
|
this.debounceSetLoading = (l) => {
|
26165
|
-
this.
|
26261
|
+
this.internalLoading = l;
|
26166
26262
|
};
|
26167
26263
|
this.renderId = 'tbl-' + id$1++;
|
26168
26264
|
this.filters = [];
|
26169
26265
|
this.currentFilters = '[]';
|
26170
26266
|
this.currentSort = '';
|
26267
|
+
this.measureHeight = 0;
|
26171
26268
|
this.blockIos = new WeakMap();
|
26172
26269
|
this.blockHeights = [];
|
26173
26270
|
this.unitHeight = 0;
|
26174
26271
|
// Scroll / IO used for hiding / showing blocks
|
26175
26272
|
this.ignoreIO = true;
|
26176
26273
|
this._isReady = false;
|
26274
|
+
/**
|
26275
|
+
* Fired when a column is dragged
|
26276
|
+
* @param column
|
26277
|
+
*/
|
26177
26278
|
this.colDrag = (column) => {
|
26178
26279
|
this.nanoTblColDrag.emit({ column });
|
26179
26280
|
};
|
26281
|
+
/**
|
26282
|
+
* Fired when a column is dropped after being dragged
|
26283
|
+
* @param fromCol
|
26284
|
+
* @param toCol
|
26285
|
+
*/
|
26180
26286
|
this.colDrop = (fromCol, toCol) => {
|
26181
26287
|
const cols = this.store.config.state.columns;
|
26182
26288
|
const toIndex = cols.findIndex((col) => col.prop === toCol);
|
@@ -26189,7 +26295,7 @@ const Table = class extends H {
|
|
26189
26295
|
});
|
26190
26296
|
if (dropEvent.defaultPrevented)
|
26191
26297
|
return;
|
26192
|
-
this.
|
26298
|
+
this.columns = arrMove(fromIndex, toIndex, cols);
|
26193
26299
|
};
|
26194
26300
|
/**
|
26195
26301
|
* Start a sort - can be cancelled by `preventDefault`
|
@@ -26201,7 +26307,7 @@ const Table = class extends H {
|
|
26201
26307
|
// did order change?
|
26202
26308
|
if (this.currentSort === order + ':' + column)
|
26203
26309
|
return;
|
26204
|
-
this.
|
26310
|
+
this._loading = true;
|
26205
26311
|
const sortEvent = this.nanoTblBeforeSort.emit({ column: column, order });
|
26206
26312
|
if (sortEvent.defaultPrevented)
|
26207
26313
|
return;
|
@@ -26210,13 +26316,24 @@ const Table = class extends H {
|
|
26210
26316
|
this.scrollToTop(element);
|
26211
26317
|
if (this.customSortFn) {
|
26212
26318
|
try {
|
26213
|
-
await this.customSortFn(column, order);
|
26214
|
-
|
26319
|
+
const res = await this.customSortFn(column, order);
|
26320
|
+
// if the response is 'true', the custom sort did it's thing
|
26321
|
+
// handover to finish and stop loading state.
|
26322
|
+
// if response is falsey, carry on to do a FE sort
|
26323
|
+
if (res === true) {
|
26324
|
+
this.sortComplete(order, column);
|
26325
|
+
this._loading = false;
|
26326
|
+
return;
|
26327
|
+
}
|
26215
26328
|
}
|
26216
26329
|
catch (e) {
|
26330
|
+
// if response errored, stop loading state
|
26331
|
+
// clear current sort cache
|
26217
26332
|
console.warn('custom sort failed', e);
|
26333
|
+
this.currentSort = '';
|
26334
|
+
this._loading = false;
|
26335
|
+
return;
|
26218
26336
|
}
|
26219
|
-
return;
|
26220
26337
|
}
|
26221
26338
|
try {
|
26222
26339
|
await storeSort(this.host, column, order);
|
@@ -26227,7 +26344,8 @@ const Table = class extends H {
|
|
26227
26344
|
this.currentSort = '';
|
26228
26345
|
}
|
26229
26346
|
finally {
|
26230
|
-
this.
|
26347
|
+
if (this.blocks.length)
|
26348
|
+
this._loading = false;
|
26231
26349
|
}
|
26232
26350
|
};
|
26233
26351
|
/**
|
@@ -26240,31 +26358,35 @@ const Table = class extends H {
|
|
26240
26358
|
if (!el || this.blockIos.has(el))
|
26241
26359
|
return;
|
26242
26360
|
const blockIo = new IntersectionObserver(([ioEntry]) => {
|
26243
|
-
if (
|
26361
|
+
if (ioEntry.intersectionRatio === 0)
|
26244
26362
|
return;
|
26245
|
-
|
26246
|
-
|
26247
|
-
|
26248
|
-
|
26249
|
-
|
26250
|
-
|
26251
|
-
|
26252
|
-
|
26253
|
-
|
26254
|
-
if (this.
|
26255
|
-
|
26363
|
+
// This is a bit gross
|
26364
|
+
// The Intersection Observer (IO) fires in an incorrect order when the scrolling is very fast
|
26365
|
+
// i.e. we go past blocks 3, 2, 1 and land on 0, but 3 can fire as 'intersecting' after 0.
|
26366
|
+
// To fix that, we check - for realzies - if the block IS visible.
|
26367
|
+
// BUT that test is not as sensitive to a block being visible via the IO,
|
26368
|
+
// so doesn't always fire if scrolling slowly
|
26369
|
+
// *sigh*
|
26370
|
+
readTask(() => {
|
26371
|
+
if (this.scrollSpeed < 100 || isInViewport(el, 0.01)) {
|
26372
|
+
if (!this.ignoreIO) {
|
26373
|
+
const potentialBlocks = [
|
26256
26374
|
blockIndex,
|
26257
26375
|
blockIndex + 1,
|
26258
26376
|
Math.max(0, blockIndex - 1),
|
26259
26377
|
];
|
26260
|
-
this.
|
26261
|
-
|
26262
|
-
|
26263
|
-
}
|
26264
|
-
requestAnimationFrame(() => this.setBlockHeight());
|
26378
|
+
if (potentialBlocks.toString() !== this.activeBlocks.toString()) {
|
26379
|
+
this.activeBlocks = potentialBlocks;
|
26380
|
+
this.setBlockHeight();
|
26381
|
+
}
|
26265
26382
|
}
|
26266
|
-
|
26267
|
-
|
26383
|
+
// fire the event regardless
|
26384
|
+
this.nanoTblBlockRendered.emit({
|
26385
|
+
block: blockIndex,
|
26386
|
+
totalBlocks: this.blockElements.length,
|
26387
|
+
});
|
26388
|
+
}
|
26389
|
+
});
|
26268
26390
|
}, {
|
26269
26391
|
threshold: [0],
|
26270
26392
|
root: this.scrollParent === document.scrollingElement
|
@@ -26286,7 +26408,8 @@ const Table = class extends H {
|
|
26286
26408
|
this.type = 'table';
|
26287
26409
|
this.caption = undefined;
|
26288
26410
|
this.showCaption = false;
|
26289
|
-
this.
|
26411
|
+
this.loading = undefined;
|
26412
|
+
this.internalLoading = false;
|
26290
26413
|
this.placeholderSize = 5;
|
26291
26414
|
this.rows = undefined;
|
26292
26415
|
this.columns = [];
|
@@ -26300,26 +26423,25 @@ const Table = class extends H {
|
|
26300
26423
|
this.customSortFn = undefined;
|
26301
26424
|
this.defaultSort = true;
|
26302
26425
|
this.defaultColDraggable = false;
|
26426
|
+
this.virtualTotalItems = 0;
|
26303
26427
|
this.blocks = [];
|
26304
26428
|
this.activeBlocks = [0, 1, 2];
|
26305
|
-
this.measureHeight = 0;
|
26306
26429
|
this.debounceSetLoading = debounce$2(this.debounceSetLoading.bind(this), 50);
|
26307
26430
|
}
|
26308
|
-
|
26309
|
-
|
26310
|
-
* or when performing custom filtering or sorting */
|
26311
|
-
get loading() {
|
26312
|
-
return this._loading;
|
26431
|
+
get _loading() {
|
26432
|
+
return this.loading !== undefined ? this.loading : this.internalLoading;
|
26313
26433
|
}
|
26314
|
-
set
|
26434
|
+
set _loading(l) {
|
26435
|
+
if (this.loading !== undefined)
|
26436
|
+
return;
|
26315
26437
|
this.debounceSetLoading(l);
|
26316
26438
|
}
|
26317
26439
|
handleRowsChange() {
|
26318
26440
|
if (!this.rows) {
|
26319
|
-
this.
|
26441
|
+
this._loading = true;
|
26320
26442
|
return;
|
26321
26443
|
}
|
26322
|
-
this.
|
26444
|
+
this._loading = true;
|
26323
26445
|
Promise.resolve(this.rows).then(async (rows) => {
|
26324
26446
|
await storeSetData(this.host, rows);
|
26325
26447
|
// reset everything
|
@@ -26328,7 +26450,7 @@ const Table = class extends H {
|
|
26328
26450
|
await this.columnInit();
|
26329
26451
|
if (!this.isReady)
|
26330
26452
|
this.setInitialBlockDimension();
|
26331
|
-
this.
|
26453
|
+
this._loading = false;
|
26332
26454
|
});
|
26333
26455
|
}
|
26334
26456
|
async handleColsChange() {
|
@@ -26343,6 +26465,9 @@ const Table = class extends H {
|
|
26343
26465
|
handleSearchTermChange() {
|
26344
26466
|
this.searchStart();
|
26345
26467
|
}
|
26468
|
+
virtualTotalItemsChangeHandler() {
|
26469
|
+
this.setBlocks();
|
26470
|
+
}
|
26346
26471
|
/** Remove any column sorts currently applied
|
26347
26472
|
* @returns a promise which resolves when complete */
|
26348
26473
|
async resetSorting() {
|
@@ -26383,11 +26508,25 @@ const Table = class extends H {
|
|
26383
26508
|
this.filters = this.filters.filter((f) => !columnNames.includes(f.prop));
|
26384
26509
|
return this.filterStart();
|
26385
26510
|
}
|
26511
|
+
/** Updates a row model at a given index
|
26512
|
+
* @param row - the row to update.
|
26513
|
+
* *Note* - this should come from the `col.cellTemplate` or `row.rowRender.template` `rowModel` property
|
26514
|
+
* - rows are augmented with certain properties to aid with efficient rendering
|
26515
|
+
* @param rowIndex - the row index to insert this row
|
26516
|
+
*/
|
26517
|
+
async updateRow(row, rowIndex) {
|
26518
|
+
this.rows.splice(rowIndex, 1, row);
|
26519
|
+
this.handleRowsChange();
|
26520
|
+
}
|
26386
26521
|
// uses the first 'tr' of an active block as our yard stick
|
26387
26522
|
set measureEle(el) {
|
26388
26523
|
if (!el)
|
26389
26524
|
return;
|
26390
|
-
|
26525
|
+
const potentialHeight = el.getBoundingClientRect().height;
|
26526
|
+
this.measureHeight =
|
26527
|
+
Math.abs(this.measureHeight - potentialHeight) < 5
|
26528
|
+
? this.measureHeight
|
26529
|
+
: potentialHeight;
|
26391
26530
|
this.unitHeight =
|
26392
26531
|
el.querySelector('tr')?.getBoundingClientRect().height || this.unitHeight;
|
26393
26532
|
}
|
@@ -26433,7 +26572,7 @@ const Table = class extends H {
|
|
26433
26572
|
this.nanoTblAfterSort.emit({ column: column, order });
|
26434
26573
|
}
|
26435
26574
|
async searchStart() {
|
26436
|
-
this.
|
26575
|
+
this._loading = true;
|
26437
26576
|
const sortEvent = this.nanoTblBeforeSearch.emit({ term: this.searchTerm });
|
26438
26577
|
if (sortEvent.defaultPrevented)
|
26439
26578
|
return;
|
@@ -26447,7 +26586,7 @@ const Table = class extends H {
|
|
26447
26586
|
console.warn('search failed', e);
|
26448
26587
|
}
|
26449
26588
|
finally {
|
26450
|
-
this.
|
26589
|
+
this._loading = false;
|
26451
26590
|
}
|
26452
26591
|
}
|
26453
26592
|
async filterStart(filters, additive = true) {
|
@@ -26464,7 +26603,7 @@ const Table = class extends H {
|
|
26464
26603
|
}
|
26465
26604
|
if (this.currentFilters === JSON.stringify(this.filters))
|
26466
26605
|
return;
|
26467
|
-
this.
|
26606
|
+
this._loading = true;
|
26468
26607
|
const sortEvent = this.nanoTblBeforeFilter.emit({ filters: this.filters });
|
26469
26608
|
if (sortEvent.defaultPrevented)
|
26470
26609
|
return;
|
@@ -26473,12 +26612,21 @@ const Table = class extends H {
|
|
26473
26612
|
this.scrollToTop();
|
26474
26613
|
if (this.customFilterFn) {
|
26475
26614
|
try {
|
26476
|
-
await this.customFilterFn(this.filters);
|
26477
|
-
|
26615
|
+
const res = await this.customFilterFn(this.filters);
|
26616
|
+
// if the response is 'true', the custom filter did it's thing
|
26617
|
+
// handover to finish and stop loading state.
|
26618
|
+
// if response is falsey, carry on to do a FE filter
|
26619
|
+
if (res === true) {
|
26620
|
+
this.filterComplete();
|
26621
|
+
this._loading = false;
|
26622
|
+
}
|
26478
26623
|
}
|
26479
26624
|
catch (e) {
|
26625
|
+
// if response errored, stop loading state
|
26626
|
+
// clear current sort cache
|
26480
26627
|
console.warn('custom filter failed', e);
|
26481
26628
|
this.currentFilters = '';
|
26629
|
+
this._loading = false;
|
26482
26630
|
}
|
26483
26631
|
return;
|
26484
26632
|
}
|
@@ -26490,7 +26638,7 @@ const Table = class extends H {
|
|
26490
26638
|
console.warn('filter failed', e);
|
26491
26639
|
}
|
26492
26640
|
finally {
|
26493
|
-
this.
|
26641
|
+
this._loading = false;
|
26494
26642
|
}
|
26495
26643
|
}
|
26496
26644
|
filterComplete() {
|
@@ -26578,23 +26726,33 @@ const Table = class extends H {
|
|
26578
26726
|
* These can then be hidden / shown to improve performance.
|
26579
26727
|
*/
|
26580
26728
|
setBlocks() {
|
26581
|
-
|
26729
|
+
const dRows = this.store.data.state.rows;
|
26730
|
+
if (!dRows.length) {
|
26731
|
+
this.blocks = [];
|
26732
|
+
return;
|
26733
|
+
}
|
26582
26734
|
this.ignoreIO = true;
|
26583
26735
|
let i = 1;
|
26584
|
-
const l = this.
|
26736
|
+
const l = this.virtualTotalItems > dRows.length
|
26737
|
+
? this.virtualTotalItems
|
26738
|
+
: dRows.length;
|
26585
26739
|
let rows = [];
|
26586
26740
|
const blocks = [];
|
26587
26741
|
this.blockHeights = [];
|
26588
26742
|
// old skool loop for perf
|
26589
26743
|
for (i; i <= l; i++) {
|
26590
|
-
rows.push(this.store.data.state.rows[i - 1]);
|
26744
|
+
rows.push(this.store.data.state.rows[i - 1] || { __uuid: '' });
|
26591
26745
|
if (i % this.perBlock === 0) {
|
26746
|
+
// assign a UUID for the whole block
|
26747
|
+
// for block diffing
|
26592
26748
|
blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });
|
26593
26749
|
rows = [];
|
26594
26750
|
}
|
26595
26751
|
}
|
26596
|
-
|
26752
|
+
// any leftover rows
|
26753
|
+
if (rows.length) {
|
26597
26754
|
blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });
|
26755
|
+
}
|
26598
26756
|
this.blocks = blocks;
|
26599
26757
|
}
|
26600
26758
|
/**
|
@@ -26621,11 +26779,11 @@ const Table = class extends H {
|
|
26621
26779
|
}
|
26622
26780
|
/** cache the height for all active blocks for later renders */
|
26623
26781
|
setBlockHeight() {
|
26624
|
-
|
26625
|
-
this.
|
26626
|
-
|
26627
|
-
|
26628
|
-
|
26782
|
+
this.activeBlocks.forEach((blockIndex) => {
|
26783
|
+
const el = this.blockElements[blockIndex];
|
26784
|
+
if (!el)
|
26785
|
+
return;
|
26786
|
+
readTask(() => {
|
26629
26787
|
const height = el.getBoundingClientRect().height;
|
26630
26788
|
// cache height to our block heights array
|
26631
26789
|
// for subsequent renders
|
@@ -26686,15 +26844,15 @@ const Table = class extends H {
|
|
26686
26844
|
sortable: this.defaultSort,
|
26687
26845
|
draggable: this.defaultColDraggable,
|
26688
26846
|
} }),
|
26689
|
-
]))), this._loading && !this.blocks.length && (h$1("tbody", { class: `${CSSNAMESPACE}__active` }, [...Array(10).keys()].map((rowIndex) => (h$1("tr", null, this.store.config.state.columns.map((_colModel, colIndex) => (h$1(TableCell, { rowIndex: rowIndex, colIndex: colIndex, nestedContent: h$1("nano-skeleton", null) })))))))), !this._loading && !this.blocks.length && (h$1("tr", null, h$1("th", { class: `${CSSNAMESPACE}__th`, colSpan: this.store.config.state.columns.length }, h$1("div", { class: "nano-tbl__cell-content nano-tbl__cell-content--no-result" }, h$1("slot", { name: "no-results" }, "No results found"))))), this.blocks.map((block, blockIndex) => (h$1("tbody", { key: block.__uuid, id: `tbody-${this.renderId}-${blockIndex}`, ref: (tb) => {
|
26847
|
+
]))), this._loading && !this.blocks.length && (h$1("tbody", { class: `${CSSNAMESPACE}__active` }, [...Array(10).keys()].map((rowIndex) => (h$1("tr", null, this.store.config.state.columns.map((_colModel, colIndex) => (h$1(TableCell, { rowIndex: rowIndex, colIndex: colIndex, nestedContent: () => h$1("nano-skeleton", null) })))))))), !this._loading && !this.blocks.length && (h$1("tr", null, h$1("th", { class: `${CSSNAMESPACE}__th`, colSpan: this.store.config.state.columns.length }, h$1("div", { class: "nano-tbl__cell-content nano-tbl__cell-content--no-result" }, h$1("slot", { name: "no-results" }, "No results found"))))), this.blocks.map((block, blockIndex) => (h$1("tbody", { key: block.__uuid, id: `tbody-${this.renderId}-${blockIndex}`, ref: (tb) => {
|
26690
26848
|
this.blockElements.push(tb);
|
26691
|
-
this.setupBlockIO(tb, blockIndex);
|
26849
|
+
requestAnimationFrame(() => this.setupBlockIO(tb, blockIndex));
|
26692
26850
|
}, class: {
|
26693
26851
|
[`${CSSNAMESPACE}__inactive`]: !this.activeBlocks.includes(blockIndex),
|
26694
26852
|
[`${CSSNAMESPACE}__active`]: this.activeBlocks.includes(blockIndex),
|
26695
26853
|
} }, this.activeBlocks.includes(blockIndex) ? (block.rows.map((row, i) => {
|
26696
26854
|
const rowIndex = blockIndex > 0 ? blockIndex * this.perBlock + i : i;
|
26697
|
-
return (h$1(TableRow, { rowRenderer: this.rowRender,
|
26855
|
+
return (h$1(TableRow, { rowRenderer: this.rowRender, rowModel: row, rowIndex: rowIndex }, this.store.config.state.columns.map((_colModel, colIndex) => (h$1(TableCell, { rowIndex: rowIndex, colIndex: colIndex })))));
|
26698
26856
|
})) : (h$1("td", { colSpan: this.store.config.state.columns.length, style: {
|
26699
26857
|
height: this.getBlockHeight(blockIndex),
|
26700
26858
|
} }))))), this.showFooter && (h$1("tfoot", null, h$1(TableHeadFootRow, { rowRenderer: this.footRender, onColumnPinned: this.handleColumnPinned }, this.store.config.state.columns.map((colModel) => [
|
@@ -26711,7 +26869,8 @@ const Table = class extends H {
|
|
26711
26869
|
static get watchers() { return {
|
26712
26870
|
"rows": ["handleRowsChange"],
|
26713
26871
|
"columns": ["handleColsChange"],
|
26714
|
-
"searchTerm": ["handleSearchTermChange"]
|
26872
|
+
"searchTerm": ["handleSearchTermChange"],
|
26873
|
+
"virtualTotalItems": ["virtualTotalItemsChangeHandler"]
|
26715
26874
|
}; }
|
26716
26875
|
static get style() { return tableCss; }
|
26717
26876
|
};
|
@@ -26781,6 +26940,7 @@ const Tooltip = class extends H {
|
|
26781
26940
|
this.distance = 10;
|
26782
26941
|
this.open = false;
|
26783
26942
|
this.skidding = 0;
|
26943
|
+
this.hoist = false;
|
26784
26944
|
this.trigger = 'hover focus';
|
26785
26945
|
}
|
26786
26946
|
get target() {
|
@@ -26800,7 +26960,7 @@ const Tooltip = class extends H {
|
|
26800
26960
|
/** Shows the tooltip. */
|
26801
26961
|
async show() {
|
26802
26962
|
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
26803
|
-
if (this.isVisible) {
|
26963
|
+
if (this.isVisible || this.disabled) {
|
26804
26964
|
return;
|
26805
26965
|
}
|
26806
26966
|
const slShow = this.nanoShow.emit();
|
@@ -26843,6 +27003,7 @@ const Tooltip = class extends H {
|
|
26843
27003
|
}
|
26844
27004
|
syncOptions() {
|
26845
27005
|
this.popover.setOptions({
|
27006
|
+
strategy: this.hoist ? 'fixed' : 'absolute',
|
26846
27007
|
placement: this.placement,
|
26847
27008
|
distance: this.distance,
|
26848
27009
|
skidding: this.skidding,
|
@@ -26873,10 +27034,10 @@ const Tooltip = class extends H {
|
|
26873
27034
|
this.popover.destroy();
|
26874
27035
|
}
|
26875
27036
|
render() {
|
26876
|
-
return (h$1(Host$1, { onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick }, h$1("slot", { onSlotchange: this.handleSlotChange }),
|
27037
|
+
return (h$1(Host$1, { onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick }, h$1("slot", { onSlotchange: this.handleSlotChange }), h$1("div", { ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner" }, h$1("div", { part: "base", ref: (el) => (this.tooltip = el), class: {
|
26877
27038
|
tooltip: true,
|
26878
27039
|
'tooltip--open': this.open,
|
26879
|
-
}, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, h$1("slot", { name: "content", onSlotchange: this.handleTTSlotChange }, h$1("div", { id: this.componentId }, this.content)), h$1("div", { class: "tooltip-arrow", "data-popper-arrow": true })))))
|
27040
|
+
}, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, h$1("slot", { name: "content", onSlotchange: this.handleTTSlotChange }, h$1("div", { id: this.componentId }, this.content)), h$1("div", { class: "tooltip-arrow", "data-popper-arrow": true })))));
|
26880
27041
|
}
|
26881
27042
|
get host() { return this; }
|
26882
27043
|
static get watchers() { return {
|
@@ -26922,7 +27083,7 @@ const NanoOption = /*@__PURE__*/proxyCustomElement(Option, [1,"nano-option",{"va
|
|
26922
27083
|
const NanoProgressBar = /*@__PURE__*/proxyCustomElement(ProgressBar, [1,"nano-progress-bar",{"value":[2],"indeterminate":[4],"showPercent":[4,"show-percent"]}]);
|
26923
27084
|
const NanoRange = /*@__PURE__*/proxyCustomElement(Range, [6,"nano-range",{"color":[1],"debounce":[2],"name":[1],"dualKnobs":[4,"dual-knobs"],"min":[2],"max":[2],"pin":[4],"snaps":[4],"step":[2],"ticks":[4],"disabled":[4],"value":[1026],"ratioA":[32],"ratioB":[32],"pressedKnob":[32]}]);
|
26924
27085
|
const NanoRating = /*@__PURE__*/proxyCustomElement(Rating, [2,"nano-rating",{"value":[1538],"max":[2],"precision":[2],"readonly":[4],"disabled":[4],"name":[1],"symbolName":[1,"symbol-name"],"symbol":[16],"hoverValue":[32],"isHovering":[32]}]);
|
26925
|
-
const NanoResizeObserve = /*@__PURE__*/proxyCustomElement(ResizeObserve, [
|
27086
|
+
const NanoResizeObserve = /*@__PURE__*/proxyCustomElement(ResizeObserve, [1,"nano-resize-observe",{"notifyContentFit":[1,"notify-content-fit"],"states":[1],"currentWidth":[32],"currentHeight":[32],"classNames":[32],"contentFitX":[32],"contentFitY":[32]}]);
|
26926
27087
|
const NanoSelect = /*@__PURE__*/proxyCustomElement(Select, [6,"nano-select",{"invalid":[2564],"validityMessage":[2049,"validity-message"],"color":[1],"autofocus":[4],"disabled":[516],"validateOn":[1025,"validate-on"],"showInlineError":[516,"show-inline-error"],"label":[1],"hideLabel":[4,"hide-label"],"floatLabel":[4,"float-label"],"multiple":[4],"name":[1],"placeholder":[1],"readonly":[516],"required":[4],"size":[2],"max":[2],"min":[2],"form":[1],"allowCustomValues":[4,"allow-custom-values"],"value":[6145],"options":[6160],"clearSelect":[4,"clear-select"],"mask":[4],"debounce":[2],"dropDownConfig":[1040],"currInsertIndex":[32],"showErrorMsg":[32],"errorMessage":[32],"hasFocus":[32],"hasLabelSlot":[32],"hasHelperSlot":[32],"hasHelperEndSlot":[32],"inputSearchVal":[32],"_invalid":[32],"_eOptions":[32]},[[16,"reset","onReset"],[17,"mousedown","handleBlur"],[0,"keydown","handleBlur"]]]);
|
26927
27088
|
const NanoSkeleton = /*@__PURE__*/proxyCustomElement(Skeleton, [1,"nano-skeleton",{"animated":[4]}]);
|
26928
27089
|
const NanoSlide = /*@__PURE__*/proxyCustomElement(Slide$2, [1,"nano-slide",{"ready":[1540]}]);
|
@@ -26933,8 +27094,8 @@ const NanoSticker = /*@__PURE__*/proxyCustomElement(Sticker, [1,"nano-sticker",{
|
|
26933
27094
|
const NanoTab = /*@__PURE__*/proxyCustomElement(Tab, [1,"nano-tab",{"panel":[513],"active":[516],"disabled":[516],"closable":[4]}]);
|
26934
27095
|
const NanoTabContent = /*@__PURE__*/proxyCustomElement(TabPanel, [1,"nano-tab-content",{"name":[513],"active":[516]}]);
|
26935
27096
|
const NanoTabGroup = /*@__PURE__*/proxyCustomElement(TabGroup, [1,"nano-tab-group",{"placement":[1],"noScrollControls":[4,"no-scroll-controls"],"color":[1],"storeId":[1,"store-id"],"storeMethod":[1,"store-method"],"disableSwipe":[4,"disable-swipe"],"hasScrollControls":[32],"hideControlRight":[32],"hideControlLeft":[32],"tab":[32]},[[0,"nanoTabClose","handleTabClose"]]]);
|
26936
|
-
const NanoTable = /*@__PURE__*/proxyCustomElement(Table, [4,"nano-table",{"type":[1],"caption":[1],"showCaption":[4,"show-caption"],"loading":[
|
26937
|
-
const NanoTooltip = /*@__PURE__*/proxyCustomElement(Tooltip, [1,"nano-tooltip",{"content":[1],"placement":[1],"disabled":[4],"distance":[2],"open":[1540],"skidding":[2],"trigger":[1]}]);
|
27097
|
+
const NanoTable = /*@__PURE__*/proxyCustomElement(Table, [4,"nano-table",{"type":[1],"caption":[1],"showCaption":[4,"show-caption"],"loading":[4],"placeholderSize":[2,"placeholder-size"],"rows":[1040],"columns":[1040],"headRender":[16],"rowRender":[16],"footRender":[16],"showFooter":[4,"show-footer"],"perBlock":[2,"per-block"],"blocksLength":[2050,"blocks-length"],"searchTerm":[1,"search-term"],"customFilterFn":[16],"customSortFn":[16],"defaultSort":[4,"default-sort"],"defaultColDraggable":[4,"default-col-draggable"],"virtualTotalItems":[2,"virtual-total-items"],"internalLoading":[32],"blocks":[32],"activeBlocks":[32]},[[9,"scroll","scrollListener"]]]);
|
27098
|
+
const NanoTooltip = /*@__PURE__*/proxyCustomElement(Tooltip, [1,"nano-tooltip",{"content":[1],"placement":[1],"disabled":[4],"distance":[2],"open":[1540],"skidding":[2],"hoist":[4],"trigger":[1]}]);
|
26938
27099
|
const defineCustomElements = (opts) => {
|
26939
27100
|
if (typeof customElements !== 'undefined') {
|
26940
27101
|
[
|
@@ -29083,7 +29244,7 @@ const index = /*#__PURE__*/Object.freeze({
|
|
29083
29244
|
|
29084
29245
|
const workerName = 'table.worker';
|
29085
29246
|
const workerMsgId = 'stencil.table.worker';
|
29086
|
-
const workerPath = /*@__PURE__*/new URL('./assets/table.worker-
|
29247
|
+
const workerPath = /*@__PURE__*/new URL('./assets/table.worker-e2f9ccfa.js', import.meta.url).href;
|
29087
29248
|
const blob = new Blob(['importScripts("' + workerPath + '")'], { type: 'text/javascript' });
|
29088
29249
|
const url = URL.createObjectURL(blob);
|
29089
29250
|
const worker = /*@__PURE__*/createWorker(url, workerName, workerMsgId);
|