@nova-design-system/nova-webcomponents 3.0.0-beta.34 → 3.0.0-beta.36
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/blazor-docs.json +1402 -175
- package/dist/cjs/index-ddc37f87.js +12 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/native.cjs.js +1 -1
- package/dist/cjs/{nv-badge.cjs.entry.js → nv-badge_2.cjs.entry.js} +43 -1
- package/dist/cjs/nv-badge_2.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +1067 -0
- package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-fieldnumber.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldpassword.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldradio.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldselect.cjs.entry.js +5 -5
- package/dist/cjs/nv-fieldtext.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldtextarea.cjs.entry.js +3 -3
- package/dist/cjs/nv-fieldtoggle.cjs.entry.js +2 -2
- package/dist/cjs/nv-icon.cjs.entry.js +1 -1
- package/dist/cjs/{nv-iconbutton.cjs.entry.js → nv-iconbutton_2.cjs.entry.js} +28 -2
- package/dist/cjs/nv-iconbutton_2.cjs.entry.js.map +1 -0
- package/dist/cjs/nv-menu.cjs.entry.js +1 -1
- package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
- package/dist/cjs/nv-popover.cjs.entry.js +1 -1
- package/dist/cjs/nv-row.cjs.entry.js +1 -1
- package/dist/cjs/nv-stack.cjs.entry.js +1 -1
- package/dist/cjs/nv-table.cjs.entry.js +2 -2
- package/dist/cjs/nv-tablebody.cjs.entry.js +1 -1
- package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -1
- package/dist/cjs/nv-tabledatacell.cjs.entry.js +1 -1
- package/dist/cjs/nv-tablehead.cjs.entry.js +1 -1
- package/dist/cjs/nv-tablerow.cjs.entry.js +1 -1
- package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.css +12 -0
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.docs.js +6 -0
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.docs.js.map +1 -0
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +185 -0
- package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js.map +1 -0
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.css +204 -0
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +249 -0
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -0
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +1651 -0
- package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -0
- package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +3 -3
- package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +3 -3
- package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
- package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -5
- package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +3 -3
- package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -3
- package/dist/collection/components/nv-fieldtoggle/nv-fieldtoggle.js +2 -2
- package/dist/collection/components/nv-icon/nv-icon.js +1 -1
- package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
- package/dist/collection/components/nv-loader/nv-loader.js +1 -1
- package/dist/collection/components/nv-menu/nv-menu.js +1 -1
- package/dist/collection/components/nv-menuitem/nv-menuitem.js +1 -1
- package/dist/collection/components/nv-popover/nv-popover.js +1 -1
- package/dist/collection/components/nv-row/nv-row.js +1 -1
- package/dist/collection/components/nv-stack/nv-stack.js +1 -1
- package/dist/collection/components/nv-table/nv-table.js +2 -2
- package/dist/collection/components/nv-tablebody/nv-tablebody.js +1 -1
- package/dist/collection/components/nv-tablecolumn/nv-tablecolumn.js +1 -1
- package/dist/collection/components/nv-tabledatacell/nv-tabledatacell.js +1 -1
- package/dist/collection/components/nv-tablehead/nv-tablehead.js +1 -1
- package/dist/collection/components/nv-tablerow/nv-tablerow.js +1 -1
- package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
- package/dist/components/nv-alert.js +1 -1
- package/dist/components/nv-avatar.js +1 -1
- package/dist/components/nv-badge.js +1 -173
- package/dist/components/nv-badge.js.map +1 -1
- package/dist/components/nv-breadcrumb.js +3 -3
- package/dist/components/nv-button.js +1 -1
- package/dist/components/nv-fieldcheckbox.js +1 -152
- package/dist/components/nv-fieldcheckbox.js.map +1 -1
- package/dist/components/nv-fielddropdown.js +5 -5
- package/dist/components/nv-fielddropdownitem.js +1 -1
- package/dist/components/nv-fielddropdownitemcheck.d.ts +11 -0
- package/dist/components/nv-fielddropdownitemcheck.js +8 -0
- package/dist/components/nv-fielddropdownitemcheck.js.map +1 -0
- package/dist/components/nv-fieldmultiselect.d.ts +11 -0
- package/dist/components/nv-fieldmultiselect.js +1159 -0
- package/dist/components/nv-fieldmultiselect.js.map +1 -0
- package/dist/components/nv-fieldnumber.js +4 -4
- package/dist/components/nv-fieldpassword.js +6 -6
- package/dist/components/nv-fieldradio.js +3 -3
- package/dist/components/nv-fieldselect.js +6 -6
- package/dist/components/nv-fieldtext.js +4 -4
- package/dist/components/nv-fieldtextarea.js +3 -3
- package/dist/components/nv-fieldtoggle.js +2 -2
- package/dist/components/nv-icon.js +1 -1
- package/dist/components/nv-iconbutton.js +1 -1
- package/dist/components/nv-loader.js +1 -1
- package/dist/components/nv-menu.js +2 -2
- package/dist/components/nv-menuitem.js +2 -2
- package/dist/components/nv-popover.js +1 -1
- package/dist/components/nv-row.js +1 -1
- package/dist/components/nv-stack.js +1 -1
- package/dist/components/nv-table.js +2 -2
- package/dist/components/nv-tablebody.js +1 -1
- package/dist/components/nv-tablecolumn.js +1 -1
- package/dist/components/nv-tabledatacell.js +1 -1
- package/dist/components/nv-tablehead.js +1 -1
- package/dist/components/nv-tablerow.js +1 -1
- package/dist/components/nv-tooltip.js +1 -1
- package/dist/components/{p-b7462fc2.js → p-0b30dd1b.js} +2 -2
- package/dist/components/{p-b7462fc2.js.map → p-0b30dd1b.js.map} +1 -1
- package/dist/{esm/nv-badge.entry.js → components/p-2abfadb8.js} +48 -12
- package/dist/components/p-2abfadb8.js.map +1 -0
- package/dist/components/{p-a61d9ce8.js → p-5b98036c.js} +2 -2
- package/dist/components/{p-a61d9ce8.js.map → p-5b98036c.js.map} +1 -1
- package/dist/components/p-63afc71f.js +74 -0
- package/dist/components/p-63afc71f.js.map +1 -0
- package/dist/components/{p-ce67d70c.js → p-78e7c594.js} +2 -2
- package/dist/components/{p-ce67d70c.js.map → p-78e7c594.js.map} +1 -1
- package/dist/components/{p-09a2a880.js → p-7a19fef7.js} +2 -2
- package/dist/components/{p-09a2a880.js.map → p-7a19fef7.js.map} +1 -1
- package/dist/components/{p-e7131c30.js → p-7c0db67e.js} +3 -3
- package/dist/components/{p-e7131c30.js.map → p-7c0db67e.js.map} +1 -1
- package/dist/components/p-afa1c98e.js +156 -0
- package/dist/components/p-afa1c98e.js.map +1 -0
- package/dist/components/{p-0cdf2cc7.js → p-d3b1c116.js} +4 -4
- package/dist/components/{p-0cdf2cc7.js.map → p-d3b1c116.js.map} +1 -1
- package/dist/docs.json +1394 -183
- package/dist/esm/index-cd557d0a.js +12 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/native.js +1 -1
- package/dist/esm/nv-badge_2.entry.js +182 -0
- package/dist/esm/nv-badge_2.entry.js.map +1 -0
- package/dist/esm/nv-fieldmultiselect.entry.js +1063 -0
- package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -0
- package/dist/esm/nv-fieldnumber.entry.js +3 -3
- package/dist/esm/nv-fieldpassword.entry.js +3 -3
- package/dist/esm/nv-fieldradio.entry.js +3 -3
- package/dist/esm/nv-fieldselect.entry.js +5 -5
- package/dist/esm/nv-fieldtext.entry.js +3 -3
- package/dist/esm/nv-fieldtextarea.entry.js +3 -3
- package/dist/esm/nv-fieldtoggle.entry.js +2 -2
- package/dist/esm/nv-icon.entry.js +1 -1
- package/dist/esm/{nv-iconbutton.entry.js → nv-iconbutton_2.entry.js} +28 -3
- package/dist/esm/nv-iconbutton_2.entry.js.map +1 -0
- package/dist/esm/nv-menu.entry.js +1 -1
- package/dist/esm/nv-menuitem.entry.js +1 -1
- package/dist/esm/nv-popover.entry.js +1 -1
- package/dist/esm/nv-row.entry.js +1 -1
- package/dist/esm/nv-stack.entry.js +1 -1
- package/dist/esm/nv-table.entry.js +2 -2
- package/dist/esm/nv-tablebody.entry.js +1 -1
- package/dist/esm/nv-tablecolumn.entry.js +1 -1
- package/dist/esm/nv-tabledatacell.entry.js +1 -1
- package/dist/esm/nv-tablehead.entry.js +1 -1
- package/dist/esm/nv-tablerow.entry.js +1 -1
- package/dist/esm/nv-tooltip.entry.js +1 -1
- package/dist/native/native.css +1 -1
- package/dist/native/native.esm.js +1 -1
- package/dist/native/native.esm.js.map +1 -1
- package/dist/native/{p-b902c7c0.entry.js → p-0a9a738c.entry.js} +2 -2
- package/dist/native/{p-f1545844.entry.js → p-18b227b5.entry.js} +2 -2
- package/dist/native/p-18b227b5.entry.js.map +1 -0
- package/dist/native/{p-3e9521a0.entry.js → p-1e2bd4e3.entry.js} +2 -2
- package/dist/native/p-225962f2.entry.js +2 -0
- package/dist/native/{p-bbc45099.entry.js.map → p-225962f2.entry.js.map} +1 -1
- package/dist/native/{p-f2ea8aa9.entry.js → p-3283505f.entry.js} +2 -2
- package/dist/native/{p-c59e3500.entry.js → p-3adf0c45.entry.js} +2 -2
- package/dist/native/{p-0710efd7.entry.js → p-4e056cd8.entry.js} +2 -2
- package/dist/native/p-4ffd5c51.entry.js +2 -0
- package/dist/native/{p-6c1b9c89.entry.js.map → p-4ffd5c51.entry.js.map} +1 -1
- package/dist/native/{p-ee78addb.entry.js → p-552e7ea4.entry.js} +2 -2
- package/dist/native/{p-74778f5f.entry.js → p-575ea40b.entry.js} +2 -2
- package/dist/native/p-5f160072.entry.js +2 -0
- package/dist/native/{p-10a06059.entry.js → p-6bb2c88f.entry.js} +2 -2
- package/dist/native/{p-e56d3715.entry.js → p-6ea62d17.entry.js} +2 -2
- package/dist/native/{p-45aa0c68.entry.js → p-788712dd.entry.js} +2 -2
- package/dist/native/{p-9cef006d.entry.js → p-7dfb4a60.entry.js} +2 -2
- package/dist/native/p-826f1d28.entry.js +2 -0
- package/dist/native/p-826f1d28.entry.js.map +1 -0
- package/dist/native/p-8ae9aaf1.entry.js +2 -0
- package/dist/native/p-967f1aee.entry.js +2 -0
- package/dist/native/p-967f1aee.entry.js.map +1 -0
- package/dist/native/{p-f4ecacf6.entry.js → p-cd251f91.entry.js} +2 -2
- package/dist/native/p-e8d181e6.entry.js +2 -0
- package/dist/native/{p-e390557d.entry.js → p-ed825c80.entry.js} +2 -2
- package/dist/native/{p-d0f83d1f.entry.js → p-f79752ca.entry.js} +2 -2
- package/dist/native/p-fc8cad13.entry.js +2 -0
- package/dist/types/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.d.ts +56 -0
- package/dist/types/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.docs.d.ts +4 -0
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +404 -0
- package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.d.ts +4 -0
- package/dist/types/components.d.ts +329 -0
- package/dist/vscode-data.json +324 -0
- package/hydrate/index.js +1201 -38
- package/hydrate/index.mjs +1201 -38
- package/package.json +11 -3
- package/dist/cjs/nv-badge.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-iconbutton.cjs.entry.js.map +0 -1
- package/dist/cjs/nv-loader.cjs.entry.js +0 -35
- package/dist/cjs/nv-loader.cjs.entry.js.map +0 -1
- package/dist/esm/nv-badge.entry.js.map +0 -1
- package/dist/esm/nv-iconbutton.entry.js.map +0 -1
- package/dist/esm/nv-loader.entry.js +0 -31
- package/dist/esm/nv-loader.entry.js.map +0 -1
- package/dist/native/p-132b8588.entry.js +0 -2
- package/dist/native/p-132b8588.entry.js.map +0 -1
- package/dist/native/p-5d67a825.entry.js +0 -2
- package/dist/native/p-6c1b9c89.entry.js +0 -2
- package/dist/native/p-907c3eda.entry.js +0 -2
- package/dist/native/p-91d4b4d7.entry.js +0 -2
- package/dist/native/p-a9b6461b.entry.js +0 -2
- package/dist/native/p-a9b6461b.entry.js.map +0 -1
- package/dist/native/p-bbc45099.entry.js +0 -2
- package/dist/native/p-f1545844.entry.js.map +0 -1
- package/dist/native/p-f42e87b5.entry.js +0 -2
- /package/dist/native/{p-b902c7c0.entry.js.map → p-0a9a738c.entry.js.map} +0 -0
- /package/dist/native/{p-3e9521a0.entry.js.map → p-1e2bd4e3.entry.js.map} +0 -0
- /package/dist/native/{p-f2ea8aa9.entry.js.map → p-3283505f.entry.js.map} +0 -0
- /package/dist/native/{p-c59e3500.entry.js.map → p-3adf0c45.entry.js.map} +0 -0
- /package/dist/native/{p-0710efd7.entry.js.map → p-4e056cd8.entry.js.map} +0 -0
- /package/dist/native/{p-ee78addb.entry.js.map → p-552e7ea4.entry.js.map} +0 -0
- /package/dist/native/{p-74778f5f.entry.js.map → p-575ea40b.entry.js.map} +0 -0
- /package/dist/native/{p-5d67a825.entry.js.map → p-5f160072.entry.js.map} +0 -0
- /package/dist/native/{p-10a06059.entry.js.map → p-6bb2c88f.entry.js.map} +0 -0
- /package/dist/native/{p-e56d3715.entry.js.map → p-6ea62d17.entry.js.map} +0 -0
- /package/dist/native/{p-45aa0c68.entry.js.map → p-788712dd.entry.js.map} +0 -0
- /package/dist/native/{p-9cef006d.entry.js.map → p-7dfb4a60.entry.js.map} +0 -0
- /package/dist/native/{p-907c3eda.entry.js.map → p-8ae9aaf1.entry.js.map} +0 -0
- /package/dist/native/{p-f4ecacf6.entry.js.map → p-cd251f91.entry.js.map} +0 -0
- /package/dist/native/{p-f42e87b5.entry.js.map → p-e8d181e6.entry.js.map} +0 -0
- /package/dist/native/{p-e390557d.entry.js.map → p-ed825c80.entry.js.map} +0 -0
- /package/dist/native/{p-d0f83d1f.entry.js.map → p-f79752ca.entry.js.map} +0 -0
- /package/dist/native/{p-91d4b4d7.entry.js.map → p-fc8cad13.entry.js.map} +0 -0
package/hydrate/index.mjs
CHANGED
|
@@ -9573,6 +9573,1167 @@ class NvFielddropdownitem {
|
|
|
9573
9573
|
}; }
|
|
9574
9574
|
}
|
|
9575
9575
|
|
|
9576
|
+
const nvFielddropdownitemcheckCss = "nv-fielddropdownitemcheck slot-fb,nv-fielddropdownitemcheck span{all:unset}nv-fielddropdownitemcheck nv-fieldcheckbox input[type=checkbox]{all:unset;display:inline-block;margin:0;padding:0;width:20px;height:20px}";
|
|
9577
|
+
var NvFielddropdownitemcheckStyle0 = nvFielddropdownitemcheckCss;
|
|
9578
|
+
|
|
9579
|
+
class NvFielddropdownitemcheck {
|
|
9580
|
+
constructor(hostRef) {
|
|
9581
|
+
registerInstance(this, hostRef);
|
|
9582
|
+
this.itemChecked = createEvent(this, "itemChecked", 7);
|
|
9583
|
+
/****************************************************************************/
|
|
9584
|
+
//#region PROPERTIES
|
|
9585
|
+
/**
|
|
9586
|
+
* Indicates whether the checkbox is selected.
|
|
9587
|
+
*/
|
|
9588
|
+
this.checked = false;
|
|
9589
|
+
/**
|
|
9590
|
+
* Disables the item, preventing any user interaction.
|
|
9591
|
+
*/
|
|
9592
|
+
this.disabled = false;
|
|
9593
|
+
/**
|
|
9594
|
+
* when the child <nv-fieldcheckbox> change its `checked` state,
|
|
9595
|
+
* update `this.checked` and emit `itemChecked`.
|
|
9596
|
+
* @param {CustomEvent<boolean>} event - The event emitted by the <nv-fieldcheckbox> component.
|
|
9597
|
+
*/
|
|
9598
|
+
this.onFieldcheckboxChanged = (event) => {
|
|
9599
|
+
if (this.disabled)
|
|
9600
|
+
return;
|
|
9601
|
+
// NvFieldcheckbox has emitted checkedChanged
|
|
9602
|
+
this.checked = event.detail; // get the new state
|
|
9603
|
+
this.itemChecked.emit({
|
|
9604
|
+
value: this.value,
|
|
9605
|
+
checked: this.checked,
|
|
9606
|
+
group: this.group,
|
|
9607
|
+
});
|
|
9608
|
+
};
|
|
9609
|
+
}
|
|
9610
|
+
render() {
|
|
9611
|
+
return (hAsync(Host, { key: '790fd77fd927ace8081971a16d37896b44fe95f5' }, hAsync("div", { key: '8dbd46bbc2cd9bd83a81117bd66f62bdef3ece88' }, hAsync("nv-fieldcheckbox", { key: '1564df63e41efa0dce2f2b47aefc61d7b41bbffc', checked: this.checked, name: this.label || this.value, label: this.label || this.value, "label-placement": "after", description: this.description, disabled: this.disabled, tabindex: "-1", role: "option", onCheckedChanged: this.onFieldcheckboxChanged }))));
|
|
9612
|
+
}
|
|
9613
|
+
get el() { return getElement(this); }
|
|
9614
|
+
static get style() { return NvFielddropdownitemcheckStyle0; }
|
|
9615
|
+
static get cmpMeta() { return {
|
|
9616
|
+
"$flags$": 0,
|
|
9617
|
+
"$tagName$": "nv-fielddropdownitemcheck",
|
|
9618
|
+
"$members$": {
|
|
9619
|
+
"checked": [1540],
|
|
9620
|
+
"value": [513],
|
|
9621
|
+
"label": [513],
|
|
9622
|
+
"description": [513],
|
|
9623
|
+
"group": [513],
|
|
9624
|
+
"disabled": [516]
|
|
9625
|
+
},
|
|
9626
|
+
"$listeners$": undefined,
|
|
9627
|
+
"$lazyBundleId$": "-",
|
|
9628
|
+
"$attrsToReflect$": [["checked", "checked"], ["value", "value"], ["label", "label"], ["description", "description"], ["group", "group"], ["disabled", "disabled"]]
|
|
9629
|
+
}; }
|
|
9630
|
+
}
|
|
9631
|
+
|
|
9632
|
+
const nvFieldmultiselectCss = "nv-fieldmultiselect{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box}nv-fieldmultiselect[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldmultiselect[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive)}nv-fieldmultiselect[required]:not([required=false])>label::after{content:\"*\";color:var(--components-form-text-required);font-weight:700}nv-fieldmultiselect label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fieldmultiselect nv-popover{width:100%;display:block}nv-fieldmultiselect .input-wrapper-multiselect{display:flex;flex-wrap:wrap;gap:var(--form-gap-x);align-items:stretch;align-self:stretch;width:100%}nv-fieldmultiselect .input-container-multiselect{display:flex;flex-grow:1;padding:calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);justify-content:center;align-items:center;gap:var(--form-field-gap);align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default);background:var(--nv-field-background);transition:all 150ms ease-out;display:flex;align-items:center;position:relative;width:100%;min-height:40px}nv-fieldmultiselect .input-container-multiselect:hover{border-color:var(--nv-field-border-hover)}nv-fieldmultiselect .input-container-multiselect:focus-within{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldmultiselect .input-container-multiselect:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldmultiselect .input-container-multiselect:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldmultiselect .input-container-multiselect input,nv-fieldmultiselect .input-container-multiselect p.non-filterable-text{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);text-overflow:ellipsis;font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height);width:100%;padding-right:2rem;flex-grow:1;margin:0;min-height:100%;box-sizing:border-box}nv-fieldmultiselect .input-container-multiselect input:focus,nv-fieldmultiselect .input-container-multiselect p.non-filterable-text:focus{outline:none}nv-fieldmultiselect .input-container-multiselect input::placeholder,nv-fieldmultiselect .input-container-multiselect p.non-filterable-text::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldmultiselect .input-container-multiselect .toggle-dropdown-icon{position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:2}nv-fieldmultiselect .input-container-multiselect nv-icon.validation{color:var(--nv-field-border-default);position:absolute;right:50px}nv-fieldmultiselect .input-container-multiselect.focus-within,nv-fieldmultiselect .input-container-multiselect:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldmultiselect .non-filterable-text{display:block;border-radius:var(--form-field-radius);background-color:var(--nv-field-background);color:var(--components-form-field-content-text);font-size:var(--form-field-font-size);font-weight:500;line-height:var(--form-field-line-height);box-sizing:border-box;cursor:pointer;height:100%;min-height:40px}nv-fieldmultiselect .non-filterable-text span{display:inline-block;width:100%;overflow:hidden;text-overflow:ellipsis}nv-fieldmultiselect .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldmultiselect .error-description{align-self:stretch;color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}.input-container-multiselect.focus-within,.input-container-multiselect:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}.no-results-message{text-align:center;padding:10px;color:var(--nv-field-error-text, #999)}.multiselect-divider{display:block;width:100%;height:1px;background-color:var(--multiselect-divider-color, #ccc);margin:8px 0}";
|
|
9633
|
+
var NvFieldmultiselectStyle0 = nvFieldmultiselectCss;
|
|
9634
|
+
|
|
9635
|
+
/**
|
|
9636
|
+
* @slot content - The content of the list.
|
|
9637
|
+
* @slot leading-input - Content to be placed before the input text, within the input container.
|
|
9638
|
+
* @slot before-input - Content to be placed before the input text, outside the input container.
|
|
9639
|
+
* @slot after-input - Content to be placed after the input text, outside the input container.
|
|
9640
|
+
* @slot label - Content to be placed as the label, will override the label prop.
|
|
9641
|
+
* @slot description - Content to be placed as the description, will override the description prop.
|
|
9642
|
+
* @slot error-description - Content to be placed as the error description, will override the errorDescription prop.
|
|
9643
|
+
*/
|
|
9644
|
+
class NvFieldmultiselect {
|
|
9645
|
+
constructor(hostRef) {
|
|
9646
|
+
registerInstance(this, hostRef);
|
|
9647
|
+
this.dropdownItemSelected = createEvent(this, "dropdownItemSelected", 7);
|
|
9648
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
9649
|
+
this.multiselectChange = createEvent(this, "multiselectChange", 7);
|
|
9650
|
+
/****************************************************************************/
|
|
9651
|
+
//#region PROPERTIES
|
|
9652
|
+
/**
|
|
9653
|
+
* Sets the ID for the input element and the for attribute of the associated
|
|
9654
|
+
* label. If no ID is provided, a random one will be automatically generated
|
|
9655
|
+
* to ensure unique identification, facilitating proper label association and
|
|
9656
|
+
* accessibility.
|
|
9657
|
+
*/
|
|
9658
|
+
this.inputId = v4();
|
|
9659
|
+
/**
|
|
9660
|
+
* Defines the maximum height of the multiselect list when open.
|
|
9661
|
+
*/
|
|
9662
|
+
this.maxHeight = '200px';
|
|
9663
|
+
/**
|
|
9664
|
+
* Text for the badge showing the number of selected items.
|
|
9665
|
+
*/
|
|
9666
|
+
this.badgeLabel = '';
|
|
9667
|
+
/**
|
|
9668
|
+
* The text to display when no items match the filter.
|
|
9669
|
+
*/
|
|
9670
|
+
this.emptyresult = 'No results found';
|
|
9671
|
+
/**
|
|
9672
|
+
* Marks the input field as required.
|
|
9673
|
+
*/
|
|
9674
|
+
this.required = false;
|
|
9675
|
+
/**
|
|
9676
|
+
* Alters the input field's appearance to indicate an error.
|
|
9677
|
+
*/
|
|
9678
|
+
this.error = false;
|
|
9679
|
+
/**
|
|
9680
|
+
* Display the input field's content without allowing users to change it.
|
|
9681
|
+
*/
|
|
9682
|
+
this.readonly = false;
|
|
9683
|
+
/**
|
|
9684
|
+
* Disables the input field.
|
|
9685
|
+
*/
|
|
9686
|
+
this.disabled = false;
|
|
9687
|
+
/**
|
|
9688
|
+
* The autocomplete prop for faster input filling.
|
|
9689
|
+
*/
|
|
9690
|
+
this.autocomplete = 'off';
|
|
9691
|
+
/**
|
|
9692
|
+
* Enables or disables the filtering feature for the multiselect items.
|
|
9693
|
+
*/
|
|
9694
|
+
this.filterable = false;
|
|
9695
|
+
/**
|
|
9696
|
+
* State of the multiselect popover.
|
|
9697
|
+
*/
|
|
9698
|
+
this.open = false;
|
|
9699
|
+
/**
|
|
9700
|
+
* Options configuration for the multiselect items.
|
|
9701
|
+
*/
|
|
9702
|
+
this.parsedOptions = [];
|
|
9703
|
+
/**
|
|
9704
|
+
* List of selected values in the multiselect.
|
|
9705
|
+
*/
|
|
9706
|
+
this.selectedValues = [];
|
|
9707
|
+
/**
|
|
9708
|
+
* Sorted options for display.
|
|
9709
|
+
*/
|
|
9710
|
+
this.sortedOptions = [];
|
|
9711
|
+
/**
|
|
9712
|
+
* The text entered by the user for filtering multiselect items.
|
|
9713
|
+
*/
|
|
9714
|
+
this.filterText = '';
|
|
9715
|
+
/**
|
|
9716
|
+
* Determines whether the multiselect is filterable.
|
|
9717
|
+
*/
|
|
9718
|
+
this.isFilterable = this.filterable;
|
|
9719
|
+
/**
|
|
9720
|
+
* Delay in milliseconds before the search is triggered when typing in the filter input.
|
|
9721
|
+
* @default 300
|
|
9722
|
+
*/
|
|
9723
|
+
this.debounceDelay = 300;
|
|
9724
|
+
/**
|
|
9725
|
+
* State for the mode of the multiselect.
|
|
9726
|
+
* @type {'options' | 'slots'}
|
|
9727
|
+
* @default 'options'
|
|
9728
|
+
*/
|
|
9729
|
+
this.modeState = 'options'; // Default value
|
|
9730
|
+
this.isHandlingEscape = false;
|
|
9731
|
+
/**x
|
|
9732
|
+
* Handle badge close for options mode.
|
|
9733
|
+
*/
|
|
9734
|
+
this.handleBadgeCloseOptions = () => {
|
|
9735
|
+
this.selectedValues = [];
|
|
9736
|
+
this.multiselectChange.emit(this.selectedValues);
|
|
9737
|
+
// Uncheck all elements
|
|
9738
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
9739
|
+
items.forEach(item => {
|
|
9740
|
+
item.checked = false;
|
|
9741
|
+
item.style.display = '';
|
|
9742
|
+
});
|
|
9743
|
+
// Reorder options without the divider since there are no selected elements
|
|
9744
|
+
this.parsedOptions = this.parsedOptions.filter(option => !option.isDivider);
|
|
9745
|
+
// Reorder options without the divider since there are no selected elements
|
|
9746
|
+
this.reorderOptionsContent();
|
|
9747
|
+
};
|
|
9748
|
+
/**
|
|
9749
|
+
* Handle badge close for slots mode.
|
|
9750
|
+
*/
|
|
9751
|
+
this.handleBadgeCloseSlots = () => {
|
|
9752
|
+
this.selectedValues = [];
|
|
9753
|
+
this.multiselectChange.emit(this.selectedValues);
|
|
9754
|
+
// Uncheck all elements
|
|
9755
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
9756
|
+
items.forEach(item => {
|
|
9757
|
+
item.checked = false;
|
|
9758
|
+
item.style.display = '';
|
|
9759
|
+
});
|
|
9760
|
+
// Reorder slot content
|
|
9761
|
+
this.reorderSlotContent();
|
|
9762
|
+
};
|
|
9763
|
+
/**
|
|
9764
|
+
* Handle popover close
|
|
9765
|
+
*/
|
|
9766
|
+
this.handlePopoverClose = () => {
|
|
9767
|
+
// If we are handling Escape, ignore this event
|
|
9768
|
+
if (this.isHandlingEscape) {
|
|
9769
|
+
return;
|
|
9770
|
+
}
|
|
9771
|
+
this.open = false;
|
|
9772
|
+
this.filterText = '';
|
|
9773
|
+
// Only reorder based on the mode
|
|
9774
|
+
if (this.modeState === 'options') {
|
|
9775
|
+
this.reorderOptionsContent();
|
|
9776
|
+
}
|
|
9777
|
+
else {
|
|
9778
|
+
this.reorderSlotContent();
|
|
9779
|
+
}
|
|
9780
|
+
// Reset filter if needed
|
|
9781
|
+
if (this.filterable) {
|
|
9782
|
+
this.resetFilter();
|
|
9783
|
+
}
|
|
9784
|
+
};
|
|
9785
|
+
/**
|
|
9786
|
+
* Handle input blur for options mode.
|
|
9787
|
+
*/
|
|
9788
|
+
this.handleInputBlurOptions = () => {
|
|
9789
|
+
setTimeout(() => {
|
|
9790
|
+
if (!this.el.contains(document.activeElement)) {
|
|
9791
|
+
// Close the popover without affecting the divider
|
|
9792
|
+
this.open = false;
|
|
9793
|
+
this.popoverElement.hide();
|
|
9794
|
+
// Reset filter if needed
|
|
9795
|
+
if (this.filterable) {
|
|
9796
|
+
this.filterText = '';
|
|
9797
|
+
this.resetFilter();
|
|
9798
|
+
}
|
|
9799
|
+
}
|
|
9800
|
+
}, 150);
|
|
9801
|
+
};
|
|
9802
|
+
/**
|
|
9803
|
+
* Handle click on the input container for options mode.
|
|
9804
|
+
* @param {MouseEvent} event - The click event.
|
|
9805
|
+
*/
|
|
9806
|
+
this.handleInputContainerClickOptions = (event) => {
|
|
9807
|
+
if (this.disabled || this.readonly) {
|
|
9808
|
+
return;
|
|
9809
|
+
}
|
|
9810
|
+
const target = event.target;
|
|
9811
|
+
if (target.tagName === 'P' || target.tagName === 'SPAN') {
|
|
9812
|
+
this.open = true;
|
|
9813
|
+
this.popoverElement.show();
|
|
9814
|
+
const inputContainer = this.el.querySelector('.input-container');
|
|
9815
|
+
if (inputContainer) {
|
|
9816
|
+
inputContainer.classList.add('focus-within');
|
|
9817
|
+
const removeFocusWithin = () => {
|
|
9818
|
+
inputContainer.classList.remove('focus-within');
|
|
9819
|
+
};
|
|
9820
|
+
this.popoverElement.addEventListener('hide', removeFocusWithin);
|
|
9821
|
+
}
|
|
9822
|
+
}
|
|
9823
|
+
};
|
|
9824
|
+
/**
|
|
9825
|
+
* Handle click on the input container for slots mode.
|
|
9826
|
+
* @param {MouseEvent} event - The click event.
|
|
9827
|
+
*/
|
|
9828
|
+
this.handleInputContainerClickSlots = (event) => {
|
|
9829
|
+
if (this.disabled || this.readonly) {
|
|
9830
|
+
return;
|
|
9831
|
+
}
|
|
9832
|
+
const target = event.target;
|
|
9833
|
+
if (target.tagName === 'P' || target.tagName === 'SPAN') {
|
|
9834
|
+
this.open = true;
|
|
9835
|
+
this.popoverElement.show();
|
|
9836
|
+
const inputContainer = this.el.querySelector('.input-container');
|
|
9837
|
+
if (inputContainer) {
|
|
9838
|
+
inputContainer.classList.add('focus-within');
|
|
9839
|
+
const removeFocusWithin = () => {
|
|
9840
|
+
inputContainer.classList.remove('focus-within');
|
|
9841
|
+
};
|
|
9842
|
+
this.popoverElement.addEventListener('hide', removeFocusWithin);
|
|
9843
|
+
}
|
|
9844
|
+
}
|
|
9845
|
+
};
|
|
9846
|
+
/**
|
|
9847
|
+
* Handle input change for options mode.
|
|
9848
|
+
* @param {Event} event - The input event.
|
|
9849
|
+
*/
|
|
9850
|
+
this.handleInputOptions = (event) => {
|
|
9851
|
+
if (!this.filterable)
|
|
9852
|
+
return;
|
|
9853
|
+
if (this.disabled || this.readonly) {
|
|
9854
|
+
return;
|
|
9855
|
+
}
|
|
9856
|
+
const input = event.target;
|
|
9857
|
+
this.value = input.value;
|
|
9858
|
+
this.valueChanged.emit(this.value);
|
|
9859
|
+
// Clear any existing timer
|
|
9860
|
+
if (this.debounceTimer) {
|
|
9861
|
+
window.clearTimeout(this.debounceTimer);
|
|
9862
|
+
}
|
|
9863
|
+
// Set a new timer for filtering
|
|
9864
|
+
this.debounceTimer = window.setTimeout(() => {
|
|
9865
|
+
this.filterText = input.value.toLowerCase();
|
|
9866
|
+
this.filterItemsOption();
|
|
9867
|
+
}, this.debounceDelay);
|
|
9868
|
+
};
|
|
9869
|
+
/**
|
|
9870
|
+
* Handle input change for slots mode
|
|
9871
|
+
* @param {Event} event - The input event.
|
|
9872
|
+
*/
|
|
9873
|
+
this.handleInputSlots = (event) => {
|
|
9874
|
+
if (!this.filterable)
|
|
9875
|
+
return;
|
|
9876
|
+
if (this.disabled || this.readonly)
|
|
9877
|
+
return;
|
|
9878
|
+
const input = event.target;
|
|
9879
|
+
this.value = input.value;
|
|
9880
|
+
this.valueChanged.emit(this.value);
|
|
9881
|
+
// Clear any existing timer
|
|
9882
|
+
if (this.debounceTimer) {
|
|
9883
|
+
window.clearTimeout(this.debounceTimer);
|
|
9884
|
+
}
|
|
9885
|
+
// Set a new timer for filtering
|
|
9886
|
+
this.debounceTimer = window.setTimeout(() => {
|
|
9887
|
+
this.filterText = input.value.toLowerCase();
|
|
9888
|
+
this.filterSlotsItems();
|
|
9889
|
+
}, this.debounceDelay);
|
|
9890
|
+
};
|
|
9891
|
+
/**
|
|
9892
|
+
* Handle input focus for options mode.
|
|
9893
|
+
*/
|
|
9894
|
+
this.handleInputFocusOptions = () => {
|
|
9895
|
+
if (this.disabled || this.readonly) {
|
|
9896
|
+
return;
|
|
9897
|
+
}
|
|
9898
|
+
this.open = true;
|
|
9899
|
+
};
|
|
9900
|
+
/**
|
|
9901
|
+
* Handle input focus for slots mode.
|
|
9902
|
+
*/
|
|
9903
|
+
this.handleInputFocusSlots = () => {
|
|
9904
|
+
if (this.disabled || this.readonly) {
|
|
9905
|
+
return;
|
|
9906
|
+
}
|
|
9907
|
+
this.open = true;
|
|
9908
|
+
};
|
|
9909
|
+
/**
|
|
9910
|
+
* Handle input blur for slots mode.
|
|
9911
|
+
*/
|
|
9912
|
+
this.handleInputBlurSlots = () => {
|
|
9913
|
+
setTimeout(() => {
|
|
9914
|
+
if (!this.el.contains(document.activeElement)) {
|
|
9915
|
+
// Fermer le popover sans affecter le divider
|
|
9916
|
+
this.open = false;
|
|
9917
|
+
this.popoverElement.hide();
|
|
9918
|
+
// Reset filter if needed
|
|
9919
|
+
if (this.filterable) {
|
|
9920
|
+
this.filterText = '';
|
|
9921
|
+
this.resetFilter();
|
|
9922
|
+
}
|
|
9923
|
+
}
|
|
9924
|
+
}, 150);
|
|
9925
|
+
};
|
|
9926
|
+
/**
|
|
9927
|
+
* Toggle the multiselect popover for options mode.
|
|
9928
|
+
*/
|
|
9929
|
+
this.togglePopoverOptions = () => {
|
|
9930
|
+
if (this.disabled || this.readonly) {
|
|
9931
|
+
return;
|
|
9932
|
+
}
|
|
9933
|
+
if (this.open) {
|
|
9934
|
+
this.handlePopoverClose();
|
|
9935
|
+
}
|
|
9936
|
+
else {
|
|
9937
|
+
this.open = true;
|
|
9938
|
+
this.popoverElement.show();
|
|
9939
|
+
if (!this.filterable) {
|
|
9940
|
+
this.focusFirstItem();
|
|
9941
|
+
}
|
|
9942
|
+
}
|
|
9943
|
+
};
|
|
9944
|
+
/**
|
|
9945
|
+
* Toggle the multiselect popover for slots mode.
|
|
9946
|
+
*/
|
|
9947
|
+
this.togglePopoverSlots = () => {
|
|
9948
|
+
if (this.disabled || this.readonly) {
|
|
9949
|
+
return;
|
|
9950
|
+
}
|
|
9951
|
+
if (this.open) {
|
|
9952
|
+
this.handlePopoverClose();
|
|
9953
|
+
}
|
|
9954
|
+
else {
|
|
9955
|
+
this.open = true;
|
|
9956
|
+
this.popoverElement.show();
|
|
9957
|
+
if (!this.filterable) {
|
|
9958
|
+
this.focusFirstItem();
|
|
9959
|
+
}
|
|
9960
|
+
}
|
|
9961
|
+
};
|
|
9962
|
+
}
|
|
9963
|
+
//#endregion PROPERTIES
|
|
9964
|
+
/****************************************************************************/
|
|
9965
|
+
//#region LIFECYCLE
|
|
9966
|
+
/**
|
|
9967
|
+
* Subscribe to click outside event.
|
|
9968
|
+
*/
|
|
9969
|
+
connectedCallback() {
|
|
9970
|
+
document.addEventListener('click', this.handleClickOutside.bind(this));
|
|
9971
|
+
}
|
|
9972
|
+
/**
|
|
9973
|
+
* Set the mode state and handle options change.
|
|
9974
|
+
*/
|
|
9975
|
+
componentWillLoad() {
|
|
9976
|
+
this.modeState = this.mode;
|
|
9977
|
+
// Don't call handleOptionsChange if we are in slots mode
|
|
9978
|
+
if (this.modeState === 'options') {
|
|
9979
|
+
this.handleOptionsChange(this.options);
|
|
9980
|
+
}
|
|
9981
|
+
// Add the listener for the hide event
|
|
9982
|
+
requestAnimationFrame(() => {
|
|
9983
|
+
if (this.popoverElement) {
|
|
9984
|
+
this.popoverElement.addEventListener('hide', () => {
|
|
9985
|
+
this.handlePopoverClose();
|
|
9986
|
+
});
|
|
9987
|
+
}
|
|
9988
|
+
});
|
|
9989
|
+
// Specific initialization for slots mode
|
|
9990
|
+
if (this.modeState === 'slots') {
|
|
9991
|
+
Promise.resolve().then(() => {
|
|
9992
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
9993
|
+
// Initialize selectedValues with checked items
|
|
9994
|
+
this.selectedValues = items
|
|
9995
|
+
.filter(item => item.hasAttribute('checked'))
|
|
9996
|
+
.map(item => item.getAttribute('value') || '');
|
|
9997
|
+
// Force a reorder after initialization
|
|
9998
|
+
requestAnimationFrame(() => {
|
|
9999
|
+
this.reorderSlotContent();
|
|
10000
|
+
});
|
|
10001
|
+
});
|
|
10002
|
+
}
|
|
10003
|
+
// Initialize the sorted options array with the parsed options for initial rendering
|
|
10004
|
+
if (this.modeState === 'options') {
|
|
10005
|
+
this.sortedOptions = [...this.parsedOptions];
|
|
10006
|
+
}
|
|
10007
|
+
// Apply filtering if the multiselect is filterable and there is a value
|
|
10008
|
+
if (this.filterable && this.value) {
|
|
10009
|
+
this.filterText = String(this.value).toLocaleLowerCase();
|
|
10010
|
+
this.filterItems();
|
|
10011
|
+
}
|
|
10012
|
+
else {
|
|
10013
|
+
// Reset visibility state of all dropdown items
|
|
10014
|
+
this.resetFilter();
|
|
10015
|
+
}
|
|
10016
|
+
}
|
|
10017
|
+
/**
|
|
10018
|
+
* Force reorder if options mode in componentDidLoad because of the initial render not trigger @watch
|
|
10019
|
+
*/
|
|
10020
|
+
componentDidLoad() {
|
|
10021
|
+
if (this.modeState === 'options') {
|
|
10022
|
+
requestAnimationFrame(() => {
|
|
10023
|
+
this.reorderOptionsContent();
|
|
10024
|
+
});
|
|
10025
|
+
}
|
|
10026
|
+
}
|
|
10027
|
+
/**
|
|
10028
|
+
* Unsubscribe from click outside event.
|
|
10029
|
+
*/
|
|
10030
|
+
disconnectedCallback() {
|
|
10031
|
+
document.removeEventListener('click', this.handleClickOutside.bind(this));
|
|
10032
|
+
// Remove the listener for the hide event
|
|
10033
|
+
if (this.popoverElement) {
|
|
10034
|
+
this.popoverElement.removeEventListener('hide', () => {
|
|
10035
|
+
this.handlePopoverClose();
|
|
10036
|
+
});
|
|
10037
|
+
}
|
|
10038
|
+
}
|
|
10039
|
+
/**
|
|
10040
|
+
* Emitted when the input loses focus.
|
|
10041
|
+
* @param {CustomEvent<boolean>} event - The event object containing the focus state.
|
|
10042
|
+
*/
|
|
10043
|
+
handleOpenChanged(event) {
|
|
10044
|
+
// Update the open state of popover
|
|
10045
|
+
this.open = event.detail;
|
|
10046
|
+
if (this.open) {
|
|
10047
|
+
if (this.filterText) {
|
|
10048
|
+
this.filterItems();
|
|
10049
|
+
}
|
|
10050
|
+
}
|
|
10051
|
+
else if (this.modeState === 'options') {
|
|
10052
|
+
this.reorderOptionsContent();
|
|
10053
|
+
}
|
|
10054
|
+
else {
|
|
10055
|
+
this.reorderSlotContent();
|
|
10056
|
+
}
|
|
10057
|
+
}
|
|
10058
|
+
/**
|
|
10059
|
+
* Listen for the `itemChecked` event emitted by child items.
|
|
10060
|
+
* @param {CustomEvent<{ value: string; checked: boolean }>} event - The event object containing the selected value and its checked state.
|
|
10061
|
+
*/
|
|
10062
|
+
handleItemChecked(event) {
|
|
10063
|
+
if (this.disabled || this.readonly) {
|
|
10064
|
+
return;
|
|
10065
|
+
}
|
|
10066
|
+
const { value, checked } = event.detail;
|
|
10067
|
+
if (value !== undefined && value !== null) {
|
|
10068
|
+
const newSelectedValues = [...this.selectedValues];
|
|
10069
|
+
const valueIndex = newSelectedValues.indexOf(value);
|
|
10070
|
+
if (checked && valueIndex === -1) {
|
|
10071
|
+
newSelectedValues.push(value);
|
|
10072
|
+
}
|
|
10073
|
+
else if (!checked && valueIndex > -1) {
|
|
10074
|
+
newSelectedValues.splice(valueIndex, 1);
|
|
10075
|
+
}
|
|
10076
|
+
// Update the state and emit the event only if the selection has changed
|
|
10077
|
+
if (JSON.stringify(this.selectedValues) !==
|
|
10078
|
+
JSON.stringify(newSelectedValues)) {
|
|
10079
|
+
this.selectedValues = newSelectedValues;
|
|
10080
|
+
// Use requestAnimationFrame to ensure the state is updated before emitting the event
|
|
10081
|
+
requestAnimationFrame(() => {
|
|
10082
|
+
this.multiselectChange.emit(this.selectedValues);
|
|
10083
|
+
});
|
|
10084
|
+
}
|
|
10085
|
+
}
|
|
10086
|
+
else {
|
|
10087
|
+
console.warn('Received itemChecked event with undefined or null value'); // Warning log
|
|
10088
|
+
}
|
|
10089
|
+
}
|
|
10090
|
+
/**
|
|
10091
|
+
* Emitted when the options change.
|
|
10092
|
+
* @param {string | Array<{label: string, value: string, isDivider?: boolean, disabled?: boolean, description?: string, checked?: boolean}>} newValue - The new value of the options.
|
|
10093
|
+
*/
|
|
10094
|
+
handleOptionsChange(newValue) {
|
|
10095
|
+
if (typeof newValue === 'string') {
|
|
10096
|
+
try {
|
|
10097
|
+
const parsedOpts = JSON.parse(newValue);
|
|
10098
|
+
this.selectedValues = parsedOpts
|
|
10099
|
+
.filter(option => option.checked)
|
|
10100
|
+
.map(option => option.value);
|
|
10101
|
+
this.parsedOptions = [...parsedOpts];
|
|
10102
|
+
}
|
|
10103
|
+
catch (error) {
|
|
10104
|
+
console.error('Error parsing options:', error);
|
|
10105
|
+
this.parsedOptions = [];
|
|
10106
|
+
}
|
|
10107
|
+
}
|
|
10108
|
+
else if (Array.isArray(newValue)) {
|
|
10109
|
+
this.selectedValues = newValue
|
|
10110
|
+
.filter(option => option.checked)
|
|
10111
|
+
.map(option => option.value);
|
|
10112
|
+
this.parsedOptions = [...newValue];
|
|
10113
|
+
}
|
|
10114
|
+
else {
|
|
10115
|
+
this.parsedOptions = [];
|
|
10116
|
+
}
|
|
10117
|
+
// Wait for the options to be fully loaded
|
|
10118
|
+
Promise.resolve().then(() => {
|
|
10119
|
+
requestAnimationFrame(() => {
|
|
10120
|
+
if (this.modeState === 'options') {
|
|
10121
|
+
this.reorderOptionsContent();
|
|
10122
|
+
}
|
|
10123
|
+
});
|
|
10124
|
+
});
|
|
10125
|
+
}
|
|
10126
|
+
/**
|
|
10127
|
+
* Emitted when the value changes.
|
|
10128
|
+
*/
|
|
10129
|
+
watchValueHandler() {
|
|
10130
|
+
// Handle value change and update the corresponding multiselect item if it exists
|
|
10131
|
+
this.setInitialSelection();
|
|
10132
|
+
}
|
|
10133
|
+
/**
|
|
10134
|
+
* Emitted when the filterable property changes.
|
|
10135
|
+
* @param {boolean} newValue - The new value of the filterable property.
|
|
10136
|
+
*/
|
|
10137
|
+
watchFilterableHandler(newValue) {
|
|
10138
|
+
this.isFilterable = newValue;
|
|
10139
|
+
this.filterable = newValue;
|
|
10140
|
+
}
|
|
10141
|
+
// Add a listener for the slot content
|
|
10142
|
+
handleSlotChange(event) {
|
|
10143
|
+
// Check: we only want to reorder if it's the "content" slot
|
|
10144
|
+
const slot = event.target;
|
|
10145
|
+
if (slot && slot.name === 'content') {
|
|
10146
|
+
// To give other platforms (VueJS, React, etc.) time to insert all their items,
|
|
10147
|
+
// we place the reorder in a requestAnimationFrame
|
|
10148
|
+
requestAnimationFrame(() => {
|
|
10149
|
+
this.reorderSlotContent();
|
|
10150
|
+
});
|
|
10151
|
+
}
|
|
10152
|
+
}
|
|
10153
|
+
//#endregion EVENTS
|
|
10154
|
+
/****************************************************************************/
|
|
10155
|
+
//#region METHODS
|
|
10156
|
+
/**
|
|
10157
|
+
* Retrieves the current filter text entered by the user.
|
|
10158
|
+
* @returns {string} The filter text.
|
|
10159
|
+
*/
|
|
10160
|
+
async getFilterText() {
|
|
10161
|
+
return this.filterText;
|
|
10162
|
+
}
|
|
10163
|
+
/**
|
|
10164
|
+
* Set the initial selection based on the current value and update the inputElement value.
|
|
10165
|
+
*/
|
|
10166
|
+
setInitialSelection() {
|
|
10167
|
+
var _a;
|
|
10168
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem'));
|
|
10169
|
+
const selectedItem = items.find(item => {
|
|
10170
|
+
var _a;
|
|
10171
|
+
return item.getAttribute('label') === this.value ||
|
|
10172
|
+
item.getAttribute('value') === this.value ||
|
|
10173
|
+
((_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === this.value;
|
|
10174
|
+
});
|
|
10175
|
+
// Remove 'selected' from all items first to reset the state
|
|
10176
|
+
items.forEach(item => {
|
|
10177
|
+
item.removeAttribute('selected');
|
|
10178
|
+
item.classList.remove('selected');
|
|
10179
|
+
});
|
|
10180
|
+
if (selectedItem) {
|
|
10181
|
+
// Add the `selected` attribute and `selected` class for visual styling
|
|
10182
|
+
selectedItem.setAttribute('selected', 'true');
|
|
10183
|
+
selectedItem.classList.add('selected');
|
|
10184
|
+
// Update the value and inputElement value to reflect the pre-selected item
|
|
10185
|
+
this.value =
|
|
10186
|
+
selectedItem.getAttribute('label') ||
|
|
10187
|
+
selectedItem.getAttribute('value') ||
|
|
10188
|
+
((_a = selectedItem.textContent) === null || _a === void 0 ? void 0 : _a.trim()) ||
|
|
10189
|
+
'';
|
|
10190
|
+
if (this.inputElement) {
|
|
10191
|
+
this.inputElement.value = this.value;
|
|
10192
|
+
}
|
|
10193
|
+
}
|
|
10194
|
+
}
|
|
10195
|
+
/**
|
|
10196
|
+
* Reset the filter and make all items visible.
|
|
10197
|
+
*/
|
|
10198
|
+
async resetFilter() {
|
|
10199
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
10200
|
+
// Reset visibility state of all dropdown items
|
|
10201
|
+
items.forEach(item => {
|
|
10202
|
+
item.style.display = '';
|
|
10203
|
+
});
|
|
10204
|
+
// Clean up filter-related UI elements
|
|
10205
|
+
const ul = this.el.querySelector('ul');
|
|
10206
|
+
if (ul) {
|
|
10207
|
+
const emptyMessage = ul.querySelector('[data-empty]');
|
|
10208
|
+
if (emptyMessage)
|
|
10209
|
+
emptyMessage.remove();
|
|
10210
|
+
// Reorder with divider if needed
|
|
10211
|
+
const selectedItems = items.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10212
|
+
const unselectedItems = items.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10213
|
+
if (selectedItems.length > 0) {
|
|
10214
|
+
this.manageDivider(ul, selectedItems, unselectedItems);
|
|
10215
|
+
}
|
|
10216
|
+
}
|
|
10217
|
+
}
|
|
10218
|
+
/**
|
|
10219
|
+
* Returns the list of selected values.
|
|
10220
|
+
* @returns {string[]} The selected values.
|
|
10221
|
+
*/
|
|
10222
|
+
async getSelectedValues() {
|
|
10223
|
+
return this.selectedValues;
|
|
10224
|
+
}
|
|
10225
|
+
/**
|
|
10226
|
+
* Reorder the content of the slot.
|
|
10227
|
+
*/
|
|
10228
|
+
reorderSlotContent() {
|
|
10229
|
+
if (this.modeState === 'options')
|
|
10230
|
+
return;
|
|
10231
|
+
const ul = this.el.querySelector('ul');
|
|
10232
|
+
if (!ul)
|
|
10233
|
+
return;
|
|
10234
|
+
// Remove all existing <hr class="multiselect-divider">
|
|
10235
|
+
ul.querySelectorAll('hr.multiselect-divider').forEach(divider => divider.remove());
|
|
10236
|
+
// Retrieve all items (not hidden)
|
|
10237
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck')).filter(item => item.style.display !== 'none');
|
|
10238
|
+
// If you possibly have a "No results" message:
|
|
10239
|
+
const hasEmptyMessage = ul.querySelector('[data-empty]');
|
|
10240
|
+
if (hasEmptyMessage) {
|
|
10241
|
+
// if there is a "No results found" message, do not reorder
|
|
10242
|
+
return;
|
|
10243
|
+
}
|
|
10244
|
+
// Separate checked vs unchecked
|
|
10245
|
+
const selectedItems = items.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10246
|
+
const unselectedItems = items.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10247
|
+
// Reinsert CHECKED items FIRST
|
|
10248
|
+
// appendChild() moves the element without recreating it
|
|
10249
|
+
// this is not trigger a re-rendering of the component in the platforms
|
|
10250
|
+
selectedItems.forEach(item => {
|
|
10251
|
+
ul.appendChild(item); // <-- The <li> (or <nv-fielddropdownitemcheck>) is just "moved" to the end of the list
|
|
10252
|
+
});
|
|
10253
|
+
// Add a divider if needed
|
|
10254
|
+
if (selectedItems.length > 0 && unselectedItems.length > 0) {
|
|
10255
|
+
const divider = document.createElement('hr');
|
|
10256
|
+
divider.className = 'multiselect-divider';
|
|
10257
|
+
ul.appendChild(divider);
|
|
10258
|
+
}
|
|
10259
|
+
// Reinsert UNCHECKED items at the end
|
|
10260
|
+
unselectedItems.forEach(item => {
|
|
10261
|
+
ul.appendChild(item);
|
|
10262
|
+
});
|
|
10263
|
+
}
|
|
10264
|
+
/**
|
|
10265
|
+
* Reorder the content for options mode with async handling
|
|
10266
|
+
*/
|
|
10267
|
+
reorderOptionsContent() {
|
|
10268
|
+
const ul = this.el.querySelector('ul[role="content"]');
|
|
10269
|
+
if (!ul)
|
|
10270
|
+
return;
|
|
10271
|
+
const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck')).filter(item => item.style.display !== 'none');
|
|
10272
|
+
const selectedItems = items.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10273
|
+
const unselectedItems = items.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10274
|
+
// Reorder the elements
|
|
10275
|
+
selectedItems.forEach(item => ul.appendChild(item));
|
|
10276
|
+
unselectedItems.forEach(item => ul.appendChild(item));
|
|
10277
|
+
// Manage the divider after the reordering
|
|
10278
|
+
this.manageDivider(ul, selectedItems, unselectedItems);
|
|
10279
|
+
}
|
|
10280
|
+
/**
|
|
10281
|
+
* Filter multiselect items based on the text entered by the user.
|
|
10282
|
+
*/
|
|
10283
|
+
filterItems() {
|
|
10284
|
+
const ul = this.el.querySelector('ul');
|
|
10285
|
+
if (!ul)
|
|
10286
|
+
return;
|
|
10287
|
+
// Remove existing empty message if any
|
|
10288
|
+
const existingEmptyMessage = ul.querySelector('[data-empty]');
|
|
10289
|
+
if (existingEmptyMessage) {
|
|
10290
|
+
existingEmptyMessage.remove();
|
|
10291
|
+
}
|
|
10292
|
+
if (!this.filterText.trim()) {
|
|
10293
|
+
if (this.parsedOptions && this.parsedOptions.length > 0) {
|
|
10294
|
+
// Reset options display
|
|
10295
|
+
const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
10296
|
+
items.forEach(item => {
|
|
10297
|
+
item.style.display = '';
|
|
10298
|
+
});
|
|
10299
|
+
}
|
|
10300
|
+
else {
|
|
10301
|
+
// Reset slot items display
|
|
10302
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
10303
|
+
items.forEach(item => {
|
|
10304
|
+
item.style.display = '';
|
|
10305
|
+
});
|
|
10306
|
+
}
|
|
10307
|
+
// Reorder with divider
|
|
10308
|
+
const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
10309
|
+
const selectedItems = items.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10310
|
+
const unselectedItems = items.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10311
|
+
this.manageDivider(ul, selectedItems, unselectedItems);
|
|
10312
|
+
return;
|
|
10313
|
+
}
|
|
10314
|
+
const normalizedFilter = this.normalizeText(this.filterText);
|
|
10315
|
+
let hasVisibleItems = false;
|
|
10316
|
+
if (this.parsedOptions && this.parsedOptions.length > 0) {
|
|
10317
|
+
// Filter options mode
|
|
10318
|
+
const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
10319
|
+
items.forEach(item => {
|
|
10320
|
+
const option = this.parsedOptions.find(opt => opt.value === item.getAttribute('value'));
|
|
10321
|
+
if (option && !option.isDivider) {
|
|
10322
|
+
const matchesFilter = this.normalizeText(option.label).includes(normalizedFilter) ||
|
|
10323
|
+
this.normalizeText(option.value).includes(normalizedFilter);
|
|
10324
|
+
item.style.display = matchesFilter ? '' : 'none';
|
|
10325
|
+
if (matchesFilter)
|
|
10326
|
+
hasVisibleItems = true;
|
|
10327
|
+
}
|
|
10328
|
+
});
|
|
10329
|
+
// Manage the divider with the visible items
|
|
10330
|
+
const visibleItems = items.filter(item => item.style.display !== 'none');
|
|
10331
|
+
const visibleSelected = visibleItems.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10332
|
+
const visibleUnselected = visibleItems.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10333
|
+
this.manageDivider(ul, visibleSelected, visibleUnselected);
|
|
10334
|
+
}
|
|
10335
|
+
else {
|
|
10336
|
+
// Filter slot items mode
|
|
10337
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
10338
|
+
items.forEach(item => {
|
|
10339
|
+
const label = item.getAttribute('label') || '';
|
|
10340
|
+
const value = item.getAttribute('value') || '';
|
|
10341
|
+
const textContent = item.textContent || '';
|
|
10342
|
+
const matchesFilter = this.normalizeText(label).includes(normalizedFilter) ||
|
|
10343
|
+
this.normalizeText(value).includes(normalizedFilter) ||
|
|
10344
|
+
this.normalizeText(textContent).includes(normalizedFilter);
|
|
10345
|
+
item.style.display = matchesFilter ? '' : 'none';
|
|
10346
|
+
if (matchesFilter)
|
|
10347
|
+
hasVisibleItems = true;
|
|
10348
|
+
});
|
|
10349
|
+
}
|
|
10350
|
+
// Add empty message if no items match the filter
|
|
10351
|
+
if (!hasVisibleItems) {
|
|
10352
|
+
const emptyMessage = document.createElement('li');
|
|
10353
|
+
emptyMessage.setAttribute('data-empty', 'true');
|
|
10354
|
+
emptyMessage.textContent = this.emptyresult;
|
|
10355
|
+
emptyMessage.classList.add('no-results-message');
|
|
10356
|
+
ul.appendChild(emptyMessage);
|
|
10357
|
+
}
|
|
10358
|
+
this.reorderSlotContent();
|
|
10359
|
+
}
|
|
10360
|
+
/**
|
|
10361
|
+
* Filter multiselect items in options mode.
|
|
10362
|
+
*/
|
|
10363
|
+
filterItemsOption() {
|
|
10364
|
+
const ul = this.el.querySelector('ul');
|
|
10365
|
+
if (!ul)
|
|
10366
|
+
return;
|
|
10367
|
+
const normalizedFilter = this.normalizeText(this.filterText);
|
|
10368
|
+
let hasVisibleItems = false;
|
|
10369
|
+
const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
10370
|
+
// Reset items if the filter text is empty
|
|
10371
|
+
if (!this.filterText.trim()) {
|
|
10372
|
+
// Remove the empty message if it exists
|
|
10373
|
+
this.removeEmptyMessageOption(ul);
|
|
10374
|
+
items.forEach(item => (item.style.display = ''));
|
|
10375
|
+
this.reorderOptionsContent(); // Reorder after reset
|
|
10376
|
+
return;
|
|
10377
|
+
}
|
|
10378
|
+
// Filter the items
|
|
10379
|
+
items.forEach(item => {
|
|
10380
|
+
const label = item.getAttribute('label') || '';
|
|
10381
|
+
const value = item.getAttribute('value') || '';
|
|
10382
|
+
const matchesFilter = this.normalizeText(label).includes(normalizedFilter) ||
|
|
10383
|
+
this.normalizeText(value).includes(normalizedFilter);
|
|
10384
|
+
item.style.display = matchesFilter ? '' : 'none';
|
|
10385
|
+
if (matchesFilter)
|
|
10386
|
+
hasVisibleItems = true;
|
|
10387
|
+
});
|
|
10388
|
+
// Manage the divider with the visible items
|
|
10389
|
+
const visibleItems = items.filter(item => item.style.display !== 'none');
|
|
10390
|
+
const visibleSelected = visibleItems.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10391
|
+
const visibleUnselected = visibleItems.filter(item => !this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10392
|
+
this.manageDivider(ul, visibleSelected, visibleUnselected);
|
|
10393
|
+
// Add or remove the empty message based on the case
|
|
10394
|
+
if (!hasVisibleItems) {
|
|
10395
|
+
this.addEmptyMessageOption(ul);
|
|
10396
|
+
}
|
|
10397
|
+
else {
|
|
10398
|
+
this.removeEmptyMessageOption(ul);
|
|
10399
|
+
}
|
|
10400
|
+
}
|
|
10401
|
+
/**
|
|
10402
|
+
* Filter multiselect items in slots mode
|
|
10403
|
+
*/
|
|
10404
|
+
filterSlotsItems() {
|
|
10405
|
+
if (this.modeState === 'options')
|
|
10406
|
+
return;
|
|
10407
|
+
const ul = this.el.querySelector('ul');
|
|
10408
|
+
if (!ul)
|
|
10409
|
+
return;
|
|
10410
|
+
// Remove existing empty message if any
|
|
10411
|
+
const existingEmptyMessage = ul.querySelector('[data-empty]');
|
|
10412
|
+
if (existingEmptyMessage) {
|
|
10413
|
+
existingEmptyMessage.remove();
|
|
10414
|
+
}
|
|
10415
|
+
// If filter text is empty, reset all items visibility
|
|
10416
|
+
if (!this.filterText.trim()) {
|
|
10417
|
+
this.resetFilter();
|
|
10418
|
+
return;
|
|
10419
|
+
}
|
|
10420
|
+
const normalizedFilter = this.normalizeText(this.filterText);
|
|
10421
|
+
let hasVisibleItems = false;
|
|
10422
|
+
// Get all items and preserve them in the DOM
|
|
10423
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
10424
|
+
// Instead of removing/reordering, just hide/show items
|
|
10425
|
+
items.forEach(item => {
|
|
10426
|
+
var _a;
|
|
10427
|
+
const label = item.getAttribute('label') || '';
|
|
10428
|
+
const value = item.getAttribute('value') || '';
|
|
10429
|
+
const textContent = ((_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '';
|
|
10430
|
+
const matchesFilter = this.normalizeText(label).includes(normalizedFilter) ||
|
|
10431
|
+
this.normalizeText(value).includes(normalizedFilter) ||
|
|
10432
|
+
this.normalizeText(textContent).includes(normalizedFilter);
|
|
10433
|
+
item.style.display = matchesFilter ? '' : 'none';
|
|
10434
|
+
if (matchesFilter)
|
|
10435
|
+
hasVisibleItems = true;
|
|
10436
|
+
});
|
|
10437
|
+
// Get visible items after filtering
|
|
10438
|
+
const visibleItems = items.filter(item => item.style.display !== 'none');
|
|
10439
|
+
const visibleSelectedItems = visibleItems.filter(item => this.selectedValues.includes(item.getAttribute('value') || ''));
|
|
10440
|
+
this.manageDivider(ul, visibleSelectedItems, visibleItems.filter(item => !this.selectedValues.includes(item.getAttribute('value') || '')));
|
|
10441
|
+
// Add empty message if no items match the filter
|
|
10442
|
+
if (!hasVisibleItems) {
|
|
10443
|
+
const emptyMessage = document.createElement('li');
|
|
10444
|
+
emptyMessage.setAttribute('data-empty', 'true');
|
|
10445
|
+
emptyMessage.textContent = this.emptyresult;
|
|
10446
|
+
emptyMessage.classList.add('no-results-message');
|
|
10447
|
+
ul.appendChild(emptyMessage);
|
|
10448
|
+
}
|
|
10449
|
+
}
|
|
10450
|
+
/**
|
|
10451
|
+
* Normalizes text by removing accents and converting to lowercase
|
|
10452
|
+
* @param {string} text - The text to normalize
|
|
10453
|
+
* @returns {string} The normalized text
|
|
10454
|
+
*
|
|
10455
|
+
* @example
|
|
10456
|
+
* normalizeText("Café Latte") => "cafe latte"
|
|
10457
|
+
*
|
|
10458
|
+
* @description
|
|
10459
|
+
* This function performs text normalization in three steps:
|
|
10460
|
+
* 1. Decomposes characters into their base form and combining characters (NFD)
|
|
10461
|
+
* 2. Removes all diacritical marks (accents, umlauts, etc.)
|
|
10462
|
+
* 3. Converts to lowercase and trims whitespace
|
|
10463
|
+
*
|
|
10464
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize} - MDN documentation on String.normalize()
|
|
10465
|
+
* @see {@link https://en.wikipedia.org/wiki/Unicode_equivalence#Normal_forms} - More info about Unicode normalization forms
|
|
10466
|
+
*/
|
|
10467
|
+
normalizeText(text) {
|
|
10468
|
+
return text
|
|
10469
|
+
.normalize('NFD') // Decompose characters into base + combining characters (e.g., é => e + ´)
|
|
10470
|
+
.replace(/[\u0300-\u036f]/g, '') // Remove all diacritical marks (Unicode range for combining characters)
|
|
10471
|
+
.toLowerCase() // Convert to lowercase
|
|
10472
|
+
.trim(); // Remove leading and trailing whitespace
|
|
10473
|
+
}
|
|
10474
|
+
/**
|
|
10475
|
+
* Handle click outside the component.
|
|
10476
|
+
* @param {MouseEvent} event - The click event.
|
|
10477
|
+
*/
|
|
10478
|
+
handleClickOutside(event) {
|
|
10479
|
+
if (this.el.contains(event.target) ||
|
|
10480
|
+
(this.inputElement && this.inputElement.contains(event.target))) {
|
|
10481
|
+
return;
|
|
10482
|
+
}
|
|
10483
|
+
// Use handlePopoverClose for all cases
|
|
10484
|
+
this.handlePopoverClose();
|
|
10485
|
+
}
|
|
10486
|
+
/**
|
|
10487
|
+
* Handle keyboard events & arrow key navigation.
|
|
10488
|
+
* If the multiselect is not open, opens it and focuses on the first item if the list is not filterable.
|
|
10489
|
+
* If the multiselect is open, handles arrow key navigation and closes it if the focus is outside the component.
|
|
10490
|
+
* @param {KeyboardEvent} event - The keyboard event.
|
|
10491
|
+
*/
|
|
10492
|
+
async handleKeyDown(event) {
|
|
10493
|
+
if (!this.open) {
|
|
10494
|
+
if (event.key === 'ArrowDown') {
|
|
10495
|
+
this.open = true;
|
|
10496
|
+
this.popoverElement.show();
|
|
10497
|
+
// Focus on the first item if the list is not filterable
|
|
10498
|
+
if (!this.filterable) {
|
|
10499
|
+
requestAnimationFrame(() => {
|
|
10500
|
+
this.focusFirstItem();
|
|
10501
|
+
});
|
|
10502
|
+
}
|
|
10503
|
+
event.preventDefault();
|
|
10504
|
+
return;
|
|
10505
|
+
}
|
|
10506
|
+
return;
|
|
10507
|
+
}
|
|
10508
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck:not([style*="display: none"])'));
|
|
10509
|
+
if (items.length === 0) {
|
|
10510
|
+
console.warn('No visible items found to navigate');
|
|
10511
|
+
return;
|
|
10512
|
+
}
|
|
10513
|
+
let currentIndex = items.findIndex(item => item.classList.contains('highlighted'));
|
|
10514
|
+
if (event.key === 'ArrowDown') {
|
|
10515
|
+
event.preventDefault();
|
|
10516
|
+
currentIndex =
|
|
10517
|
+
currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;
|
|
10518
|
+
this.updateHighlightedItem(items, currentIndex);
|
|
10519
|
+
}
|
|
10520
|
+
else if (event.key === 'ArrowUp') {
|
|
10521
|
+
event.preventDefault();
|
|
10522
|
+
currentIndex =
|
|
10523
|
+
currentIndex === -1
|
|
10524
|
+
? items.length - 1
|
|
10525
|
+
: (currentIndex - 1 + items.length) % items.length;
|
|
10526
|
+
this.updateHighlightedItem(items, currentIndex);
|
|
10527
|
+
}
|
|
10528
|
+
else if (event.key === 'Enter' && currentIndex >= 0) {
|
|
10529
|
+
event.preventDefault();
|
|
10530
|
+
const selectedItem = items[currentIndex];
|
|
10531
|
+
// Toggle the checked state
|
|
10532
|
+
const isCurrentlyChecked = selectedItem.hasAttribute('checked');
|
|
10533
|
+
selectedItem.checked = !isCurrentlyChecked;
|
|
10534
|
+
// Trigger a click event to ensure proper event handling
|
|
10535
|
+
selectedItem.dispatchEvent(new MouseEvent('click', {
|
|
10536
|
+
view: window,
|
|
10537
|
+
bubbles: true,
|
|
10538
|
+
cancelable: true,
|
|
10539
|
+
}));
|
|
10540
|
+
}
|
|
10541
|
+
else if (event.key === 'Escape') {
|
|
10542
|
+
event.preventDefault();
|
|
10543
|
+
event.stopPropagation(); // Prevent the event from propagating to the popover
|
|
10544
|
+
// Do the reorder and wait a bit before closing
|
|
10545
|
+
const handleEscape = async () => {
|
|
10546
|
+
this.isHandlingEscape = true; // Disable the hide listener
|
|
10547
|
+
if (this.modeState === 'options') {
|
|
10548
|
+
this.reorderOptionsContent();
|
|
10549
|
+
}
|
|
10550
|
+
else {
|
|
10551
|
+
this.reorderSlotContent();
|
|
10552
|
+
}
|
|
10553
|
+
// Wait for the reorder to be applied
|
|
10554
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
10555
|
+
// Reactivate the hide listener after a short delay
|
|
10556
|
+
setTimeout(() => {
|
|
10557
|
+
this.isHandlingEscape = false;
|
|
10558
|
+
this.open = false;
|
|
10559
|
+
this.popoverElement.hide();
|
|
10560
|
+
}, 150);
|
|
10561
|
+
if (this.inputElement) {
|
|
10562
|
+
this.inputElement.blur();
|
|
10563
|
+
}
|
|
10564
|
+
};
|
|
10565
|
+
await handleEscape();
|
|
10566
|
+
}
|
|
10567
|
+
}
|
|
10568
|
+
/**
|
|
10569
|
+
* Updates the highlighted item in the dropdown list.
|
|
10570
|
+
*
|
|
10571
|
+
* @param {(HTMLNvFielddropdownitemElement | HTMLNvFielddropdownitemcheckElement)[]} items - The items to update.
|
|
10572
|
+
* @param {number} index - The index of the item to highlight.
|
|
10573
|
+
*/
|
|
10574
|
+
updateHighlightedItem(items, index) {
|
|
10575
|
+
items.forEach((item, i) => {
|
|
10576
|
+
if (i === index) {
|
|
10577
|
+
item.classList.add('highlighted');
|
|
10578
|
+
item.setAttribute('tabindex', '0');
|
|
10579
|
+
item.scrollIntoView({ block: 'nearest' });
|
|
10580
|
+
// Focus on the nv-fieldcheckbox inside
|
|
10581
|
+
const checkbox = item.querySelector('nv-fieldcheckbox');
|
|
10582
|
+
if (checkbox) {
|
|
10583
|
+
checkbox.focus();
|
|
10584
|
+
}
|
|
10585
|
+
}
|
|
10586
|
+
else {
|
|
10587
|
+
item.classList.remove('highlighted');
|
|
10588
|
+
item.setAttribute('tabindex', '-1');
|
|
10589
|
+
}
|
|
10590
|
+
});
|
|
10591
|
+
}
|
|
10592
|
+
/**
|
|
10593
|
+
* Focus on the first item in the dropdown list.
|
|
10594
|
+
*/
|
|
10595
|
+
focusFirstItem() {
|
|
10596
|
+
const firstItem = this.el.querySelector('nv-fielddropdownitemcheck:not([style*="display: none"])');
|
|
10597
|
+
if (firstItem) {
|
|
10598
|
+
firstItem.setAttribute('tabindex', '0');
|
|
10599
|
+
firstItem.classList.add('highlighted');
|
|
10600
|
+
firstItem.scrollIntoView({ block: 'nearest' });
|
|
10601
|
+
// Focus on the nv-fieldcheckbox inside
|
|
10602
|
+
const checkbox = firstItem.querySelector('nv-fieldcheckbox');
|
|
10603
|
+
if (checkbox) {
|
|
10604
|
+
checkbox.focus();
|
|
10605
|
+
}
|
|
10606
|
+
}
|
|
10607
|
+
else {
|
|
10608
|
+
console.warn('No visible first item found to focus');
|
|
10609
|
+
}
|
|
10610
|
+
}
|
|
10611
|
+
addEmptyMessageOption(ul) {
|
|
10612
|
+
const existingMessage = ul.querySelector('[data-empty]');
|
|
10613
|
+
if (existingMessage)
|
|
10614
|
+
return;
|
|
10615
|
+
const emptyMessage = document.createElement('li');
|
|
10616
|
+
emptyMessage.setAttribute('data-empty', 'true');
|
|
10617
|
+
emptyMessage.textContent = this.emptyresult;
|
|
10618
|
+
emptyMessage.classList.add('no-results-message');
|
|
10619
|
+
ul.appendChild(emptyMessage);
|
|
10620
|
+
}
|
|
10621
|
+
removeEmptyMessageOption(ul) {
|
|
10622
|
+
const existingMessage = ul.querySelector('[data-empty]');
|
|
10623
|
+
if (existingMessage)
|
|
10624
|
+
existingMessage.remove();
|
|
10625
|
+
}
|
|
10626
|
+
/**
|
|
10627
|
+
* Watch for changes in the mode prop and update modeState accordingly
|
|
10628
|
+
* @param {string} newValue - The new mode value
|
|
10629
|
+
*/
|
|
10630
|
+
handleModeChange(newValue) {
|
|
10631
|
+
this.modeState = newValue;
|
|
10632
|
+
}
|
|
10633
|
+
manageDivider(ul, selectedItems, unselectedItems) {
|
|
10634
|
+
let divider = ul.querySelector('hr.multiselect-divider');
|
|
10635
|
+
if (!divider) {
|
|
10636
|
+
divider = document.createElement('hr');
|
|
10637
|
+
divider.className = 'multiselect-divider';
|
|
10638
|
+
ul.appendChild(divider);
|
|
10639
|
+
}
|
|
10640
|
+
const shouldShowDivider = selectedItems.length > 0 && unselectedItems.length > 0;
|
|
10641
|
+
if (shouldShowDivider) {
|
|
10642
|
+
// Place the divider after the last selected item
|
|
10643
|
+
const lastSelectedItem = selectedItems[selectedItems.length - 1];
|
|
10644
|
+
lastSelectedItem.after(divider);
|
|
10645
|
+
divider.style.display = '';
|
|
10646
|
+
}
|
|
10647
|
+
else {
|
|
10648
|
+
divider.style.display = 'none';
|
|
10649
|
+
}
|
|
10650
|
+
}
|
|
10651
|
+
//#endregion METHODS
|
|
10652
|
+
/****************************************************************************/
|
|
10653
|
+
//#region RENDER
|
|
10654
|
+
/**
|
|
10655
|
+
* Renders the component in options mode
|
|
10656
|
+
* @returns {any} The JSX for options mode
|
|
10657
|
+
*/
|
|
10658
|
+
renderOptionsMode() {
|
|
10659
|
+
return (hAsync(Host, null, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { htmlFor: this.inputId }, hAsync("slot", { name: "label" }, this.label))), hAsync("nv-popover", { ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, hAsync("div", { class: "input-wrapper-multiselect", slot: "trigger" }, hAsync("slot", { name: "before-input" }), hAsync("div", { class: "input-container-multiselect" }, hAsync("slot", { name: "leading-input" }), hAsync("nv-badge", { slot: "leading-input", "prevent-auto-close": "true", color: "10", dismissible: this.selectedValues.length > 0, hidden: this.selectedValues.length <= 0, label: `${this.selectedValues.length} ${this.badgeLabel}`, "aria-label": `Clear all ${this.selectedValues.length} ${this.badgeLabel} items`, onCloseClicked: this.handleBadgeCloseOptions }), this.isFilterable || this.disabled || this.readonly ? (hAsync("input", { id: this.inputId, ref: e => (this.inputElement = e), autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.value, required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInputOptions, onFocus: this.handleInputFocusOptions, onBlur: this.handleInputBlurOptions, onKeyDown: this.handleKeyDown })) : (hAsync("p", { id: this.inputId, class: "non-filterable-text", onClick: this.handleInputContainerClickOptions, tabIndex: 0, onKeyDown: this.handleKeyDown, onFocus: this.handleInputFocusOptions, role: "combobox", "aria-expanded": this.open }, hAsync("span", null, this.value || this.placeholder))), hAsync("nv-iconbutton", { class: "toggle-dropdown-icon", name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide dropdown' : 'Show dropdown', "aria-pressed": this.open.toString(), onClick: this.togglePopoverOptions })), hAsync("slot", { name: "after-input" })), hAsync("div", { slot: "content", role: "listbox", "aria-multiselectable": "true", style: { 'max-height': this.maxHeight, 'overflow-y': 'auto' } }, hAsync("ul", { role: "content" }, this.parsedOptions.map(option => (hAsync("nv-fielddropdownitemcheck", { label: option.label, description: option.description, value: option.value, checked: this.selectedValues.includes(option.value), disabled: option.disabled }))), hAsync("hr", { class: "multiselect-divider", style: { display: 'none' } })))), this.renderDescriptions()));
|
|
10660
|
+
}
|
|
10661
|
+
/**
|
|
10662
|
+
* Renders the component in slots mode
|
|
10663
|
+
* @returns {any} The JSX for slots mode
|
|
10664
|
+
*/
|
|
10665
|
+
renderSlotsMode() {
|
|
10666
|
+
return (hAsync(Host, null, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { htmlFor: this.inputId }, hAsync("slot", { name: "label" }, this.label))), hAsync("nv-popover", { ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, hAsync("div", { class: "input-wrapper-multiselect", slot: "trigger" }, hAsync("slot", { name: "before-input" }), hAsync("div", { class: "input-container-multiselect", onClick: this.handleInputContainerClickSlots }, hAsync("slot", { name: "leading-input" }, hAsync("p", null, "No leading input")), hAsync("nv-badge", { slot: "leading-input", "prevent-auto-close": "true", color: "10", dismissible: this.selectedValues.length > 0, hidden: this.selectedValues.length <= 0, label: `${this.selectedValues.length} ${this.badgeLabel}`, "aria-label": `Clear all ${this.selectedValues.length} ${this.badgeLabel} items`, onCloseClicked: this.handleBadgeCloseSlots }), this.isFilterable || this.disabled || this.readonly ? (hAsync("input", { id: this.inputId, ref: e => (this.inputElement = e), autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.value, required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInputSlots, onFocus: this.handleInputFocusSlots, onBlur: this.handleInputBlurSlots, onKeyDown: this.handleKeyDown })) : (hAsync("p", { id: this.inputId, class: "non-filterable-text", onClick: this.handleInputContainerClickSlots, tabIndex: 0, onKeyDown: this.handleKeyDown, onFocus: this.handleInputFocusSlots, role: "combobox", "aria-expanded": this.open }, hAsync("span", null, this.value || this.placeholder))), hAsync("nv-iconbutton", { class: "toggle-dropdown-icon", name: this.open ? 'chevron-top' : 'chevron-down', size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide dropdown' : 'Show dropdown', "aria-pressed": this.open.toString(), onClick: this.togglePopoverSlots })), hAsync("slot", { name: "after-input" })), hAsync("div", { slot: "content", role: "listbox", "aria-multiselectable": "true", style: { 'max-height': this.maxHeight, 'overflow-y': 'auto' } }, hAsync("slot", { name: "content" }))), this.renderDescriptions()));
|
|
10667
|
+
}
|
|
10668
|
+
/**
|
|
10669
|
+
* Renders description and error description sections
|
|
10670
|
+
* @returns {any} The JSX for descriptions
|
|
10671
|
+
*/
|
|
10672
|
+
renderDescriptions() {
|
|
10673
|
+
return [
|
|
10674
|
+
(this.description || this.el.querySelector('[slot="description"]')) && (hAsync("div", { class: "description" }, hAsync("slot", { name: "description" }, this.description))),
|
|
10675
|
+
(this.errorDescription ||
|
|
10676
|
+
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { hidden: !this.error, class: "error-description" }, hAsync("slot", { name: "error-description" }, this.errorDescription))),
|
|
10677
|
+
];
|
|
10678
|
+
}
|
|
10679
|
+
/**
|
|
10680
|
+
* Main render method that decides which mode to render
|
|
10681
|
+
* @returns {any} The JSX for the component
|
|
10682
|
+
*/
|
|
10683
|
+
render() {
|
|
10684
|
+
return this.modeState === 'options'
|
|
10685
|
+
? this.renderOptionsMode()
|
|
10686
|
+
: this.renderSlotsMode();
|
|
10687
|
+
}
|
|
10688
|
+
get el() { return getElement(this); }
|
|
10689
|
+
static get watchers() { return {
|
|
10690
|
+
"options": ["handleOptionsChange"],
|
|
10691
|
+
"value": ["watchValueHandler"],
|
|
10692
|
+
"filterable": ["watchFilterableHandler"],
|
|
10693
|
+
"mode": ["handleModeChange"]
|
|
10694
|
+
}; }
|
|
10695
|
+
static get style() { return NvFieldmultiselectStyle0; }
|
|
10696
|
+
static get cmpMeta() { return {
|
|
10697
|
+
"$flags$": 4,
|
|
10698
|
+
"$tagName$": "nv-fieldmultiselect",
|
|
10699
|
+
"$members$": {
|
|
10700
|
+
"inputId": [513, "input-id"],
|
|
10701
|
+
"name": [513],
|
|
10702
|
+
"label": [513],
|
|
10703
|
+
"description": [513],
|
|
10704
|
+
"placeholder": [513],
|
|
10705
|
+
"maxHeight": [513, "max-height"],
|
|
10706
|
+
"badgeLabel": [513, "badge-label"],
|
|
10707
|
+
"emptyresult": [513],
|
|
10708
|
+
"required": [516],
|
|
10709
|
+
"error": [516],
|
|
10710
|
+
"errorDescription": [513, "error-description"],
|
|
10711
|
+
"readonly": [516],
|
|
10712
|
+
"disabled": [516],
|
|
10713
|
+
"autocomplete": [513],
|
|
10714
|
+
"filterable": [1540],
|
|
10715
|
+
"value": [1537],
|
|
10716
|
+
"open": [1540],
|
|
10717
|
+
"mode": [513],
|
|
10718
|
+
"options": [513],
|
|
10719
|
+
"debounceDelay": [514, "debounce-delay"],
|
|
10720
|
+
"parsedOptions": [32],
|
|
10721
|
+
"selectedValues": [32],
|
|
10722
|
+
"sortedOptions": [32],
|
|
10723
|
+
"filterText": [32],
|
|
10724
|
+
"isFilterable": [32],
|
|
10725
|
+
"modeState": [32],
|
|
10726
|
+
"isHandlingEscape": [32],
|
|
10727
|
+
"getFilterText": [64],
|
|
10728
|
+
"resetFilter": [64],
|
|
10729
|
+
"getSelectedValues": [64]
|
|
10730
|
+
},
|
|
10731
|
+
"$listeners$": [[0, "openChanged", "handleOpenChanged"], [0, "itemChecked", "handleItemChecked"], [0, "slotchange", "handleSlotChange"], [0, "keydown", "handleKeyDown"]],
|
|
10732
|
+
"$lazyBundleId$": "-",
|
|
10733
|
+
"$attrsToReflect$": [["inputId", "input-id"], ["name", "name"], ["label", "label"], ["description", "description"], ["placeholder", "placeholder"], ["maxHeight", "max-height"], ["badgeLabel", "badge-label"], ["emptyresult", "emptyresult"], ["required", "required"], ["error", "error"], ["errorDescription", "error-description"], ["readonly", "readonly"], ["disabled", "disabled"], ["autocomplete", "autocomplete"], ["filterable", "filterable"], ["value", "value"], ["open", "open"], ["mode", "mode"], ["options", "options"], ["debounceDelay", "debounce-delay"]]
|
|
10734
|
+
}; }
|
|
10735
|
+
}
|
|
10736
|
+
|
|
9576
10737
|
const nvFieldnumberCss = "nv-fieldnumber {\n --nv-field-border-default: var(--components-form-field-border-default);\n --nv-field-border-hover: var(--components-form-field-border-hover);\n --nv-field-border-focus: var(--components-form-field-border-focus);\n --nv-field-border-disabled: var(--components-form-field-border-default);\n --nv-field-border-readonly: var(--components-form-field-border-default);\n --nv-field-focus-box-shadow: var(--color-focus-brand);\n --nv-field-background: var(--components-form-field-background-default);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--form-gap-y);\n box-sizing: border-box;\n}\nnv-fieldnumber[readonly]:not([readonly=false]) {\n --nv-field-border-default: var(--components-form-field-border-readonly);\n --nv-field-border-hover: var(--nv-field-border-default);\n --nv-field-border-focus: var(--components-form-field-border-focus);\n --nv-field-border-disabled: var(--nv-field-border-default);\n --nv-field-border-readonly: var(--nv-field-border-default);\n --nv-field-background: var(--components-form-field-background-readonly);\n}\nnv-fieldnumber[error]:not([error=false]) {\n --nv-field-border-default: var(--components-form-field-border-error);\n --nv-field-border-hover: var(--nv-field-border-default);\n --nv-field-border-focus: var(--nv-field-border-default);\n --nv-field-border-disabled: var(--nv-field-border-default);\n --nv-field-border-readonly: var(--nv-field-border-default);\n --nv-field-focus-box-shadow: var(--color-focus-destructive);\n}\nnv-fieldnumber[success]:not([success=false]) {\n --nv-field-border-default: var(--components-form-field-border-success);\n --nv-field-border-hover: var(--nv-field-border-default);\n --nv-field-border-focus: var(--nv-field-border-default);\n --nv-field-border-disabled: var(--nv-field-border-default);\n --nv-field-border-readonly: var(--nv-field-border-default);\n --nv-field-focus-box-shadow: var(--color-focus-success);\n}\nnv-fieldnumber[required]:not([required=false]) label::after {\n content: \"*\";\n color: var(--components-form-text-required);\n font-weight: 700;\n}\nnv-fieldnumber label {\n display: flex;\n align-items: center;\n gap: var(--form-label-gap);\n align-self: stretch;\n color: var(--components-form-text-label-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-label-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-label-line-height);\n}\nnv-fieldnumber .input-wrapper {\n display: flex;\n flex-wrap: wrap;\n gap: var(--form-gap-x);\n align-items: stretch;\n align-self: stretch;\n}\nnv-fieldnumber .input-wrapper .input-container {\n display: flex;\n flex-grow: 1;\n padding: calc(var(--form-field-padding-y) - 1px) var(--form-field-padding-x);\n justify-content: center;\n align-items: center;\n gap: var(--form-field-gap);\n align-self: stretch;\n border-radius: var(--form-field-radius);\n border-width: 1px;\n border-style: solid;\n border-color: var(--nv-field-border-default);\n opacity: var(--components-form-opacity-default);\n background: var(--nv-field-background);\n transition: all 150ms ease-out;\n container-type: inline-size;\n container-name: field-number-input-container;\n overflow: hidden;\n position: relative;\n}\nnv-fieldnumber .input-wrapper .input-container:hover {\n border-color: var(--nv-field-border-hover);\n}\nnv-fieldnumber .input-wrapper .input-container:focus-within {\n border-color: var(--nv-field-border-focus);\n box-shadow: 0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow);\n}\nnv-fieldnumber .input-wrapper .input-container:has(input:read-only) {\n opacity: 0.5;\n background-color: var(--components-form-field-background-readonly);\n border-color: var(--nv-field-border-readonly);\n}\nnv-fieldnumber .input-wrapper .input-container:has(input:disabled) {\n opacity: 0.5;\n background-color: var(--components-form-field-background-disabled);\n border-color: var(--nv-field-border-disabled);\n}\nnv-fieldnumber .input-wrapper .input-container input {\n display: flex;\n align-items: center;\n flex: 1 0 0;\n overflow: hidden;\n background-color: transparent;\n color: var(--components-form-field-content-text);\n text-overflow: ellipsis;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 500;\n line-height: var(--form-field-line-height);\n width: 100%;\n appearance: textfield;\n}\nnv-fieldnumber .input-wrapper .input-container input:focus {\n outline: none;\n}\nnv-fieldnumber .input-wrapper .input-container input::placeholder {\n overflow: hidden;\n color: var(--components-form-field-content-placeholder);\n text-overflow: ellipsis;\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-field-font-size);\n font-style: normal;\n font-weight: 400;\n line-height: var(--form-field-line-height);\n}\nnv-fieldnumber .input-wrapper .input-container input::-webkit-inner-spin-button, nv-fieldnumber .input-wrapper .input-container input::-webkit-outer-spin-button {\n appearance: none;\n margin: 0;\n}\nnv-fieldnumber .input-wrapper .input-container nv-icon.validation {\n color: var(--nv-field-border-default);\n}\nnv-fieldnumber .input-wrapper .input-container .stepper {\n position: absolute;\n right: 0;\n height: 100%;\n display: flex;\n align-items: center;\n border-left: var(--notification-border-width-low-emphasis) solid var(--components-form-field-border-readonly);\n}\nnv-fieldnumber .input-wrapper .input-container .stepper nv-icon {\n color: var(--components-form-field-icon-default);\n height: 100%;\n}\nnv-fieldnumber .input-wrapper .input-container .stepper nv-icon:first-child {\n padding: var(--form-field-inner-button-padding-y) var(--form-field-inner-button-padding-x-int) var(--form-field-inner-button-padding-y) var(--form-field-inner-button-padding-x-ext);\n}\nnv-fieldnumber .input-wrapper .input-container .stepper nv-icon:last-child {\n padding: var(--form-field-inner-button-padding-y) var(--form-field-inner-button-padding-x-ext) var(--form-field-inner-button-padding-y) var(--form-field-inner-button-padding-x-int);\n}\nnv-fieldnumber .input-wrapper .input-container .stepper nv-icon:hover {\n background: var(--color-interaction-container-neutral-background-hover);\n}\nnv-fieldnumber .input-wrapper .input-container .stepper-spacer {\n width: calc(2 * (var(--form-field-icon-size) + var(--form-field-inner-button-padding-x-ext) + var(--form-field-inner-button-padding-x-int)) + var(--form-field-padding-x) + var(--notification-border-width-low-emphasis));\n}\n@container field-number-input-container (width < 150px) {\n nv-fieldnumber .input-wrapper .input-container .stepper-spacer {\n display: none;\n }\n nv-fieldnumber .input-wrapper .input-container .stepper {\n display: none;\n }\n}\nnv-fieldnumber .description {\n align-self: stretch;\n color: var(--components-form-text-description-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-description-font-size);\n font-style: normal;\n line-height: var(--form-description-line-height);\n}\nnv-fieldnumber .error-description {\n align-self: stretch;\n color: var(--components-form-text-description-default);\n font-family: \"TT Norms Pro\", sans-serif;\n font-size: var(--form-description-font-size);\n font-style: normal;\n line-height: var(--form-description-line-height);\n color: var(--components-form-text-description-error);\n}";
|
|
9577
10738
|
var NvFieldnumberStyle0 = nvFieldnumberCss;
|
|
9578
10739
|
|
|
@@ -9678,9 +10839,9 @@ class NvFieldnumber {
|
|
|
9678
10839
|
/****************************************************************************/
|
|
9679
10840
|
//#region RENDER
|
|
9680
10841
|
render() {
|
|
9681
|
-
return (hAsync(Host, { key: '
|
|
9682
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
9683
|
-
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '
|
|
10842
|
+
return (hAsync(Host, { key: '3e63ee0ddeea7114b2b46d1b487beda165f15ee7' }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: '3d2466d944f46dcf3898a91db177566b17a47bae', htmlFor: this.inputId }, hAsync("slot", { key: '9aabd8d4192de72fcc4b1244f48bf8339426576d', name: "label" }, this.label))), hAsync("div", { key: '03307177d9b82f77fea2c41d12239ed4b9073287', class: "input-wrapper" }, hAsync("slot", { key: '64ca5e34fa924a92e83eed4abe011e5ff5bedcef', name: "before-input" }), hAsync("div", { key: 'df01a5825076af1678b41ccd4164d4c094ff2c49', class: "input-container", onClick: this.handleInputContainerClick }, hAsync("slot", { key: 'af451d8c693374942d9d15ae6fe639d447bc3212', name: "leading-input" }), hAsync("input", { key: '60e0f22c61738e0bfb1ab769ff2521d7b6e41add', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: "number", required: this.required, max: this.max, min: this.min, step: this.step, value: this.value, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), this.error && (hAsync("nv-icon", { key: '2a821cf41606870dbd5d3d1a8073809da575eef6', name: "alert-circle", class: "validation", size: "md" })), this.success && (hAsync("nv-icon", { key: 'ed13f730a9ce5b27d635b0061f361229bdce6893', name: "circle-check", class: "validation", size: "md" })), hAsync("div", { key: '5e181e738b0074d619b85c966aa0fc248fa8b2df', class: "stepper-spacer" }), hAsync("div", { key: '2dd786b7af88781f1adb3b342a6cd80ed1e65b20', class: "stepper" }, hAsync("nv-icon", { key: '9f2e2780c82b6459207de3a921064114f116c8df', name: "minus", size: "md", onClick: this.handleMinus, class: clsx({ disabled: this.isMinValueReached() }) }), hAsync("nv-icon", { key: 'b7004ec1823b71b89862c4a4b2038946fb2ca776', name: "plus", size: "md", onClick: this.handlePlus, class: clsx({ disabled: this.isMaxValueReached() }) }))), hAsync("slot", { key: 'b44ad95be87ef5b4201a3eebb660de56b5fec6e0', name: "after-input" })), (this.description ||
|
|
10843
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '8a5f2d1d5afcd40338187f9675ee780330f5c253', class: "description" }, hAsync("slot", { key: '07618e9a9c36d13f2ae33e49b16a4744aad87150', name: "description" }, this.description))), (this.errorDescription ||
|
|
10844
|
+
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '95f049c2b32537c63afb6b7edcb19f1c9100da7d', hidden: !this.error, class: "error-description" }, hAsync("slot", { key: '4390b2d8bba172e04f0cd6740c347af56738d208', name: "error-description" }, this.errorDescription)))));
|
|
9684
10845
|
}
|
|
9685
10846
|
static get formAssociated() { return true; }
|
|
9686
10847
|
get el() { return getElement(this); }
|
|
@@ -9822,9 +10983,9 @@ class NvFieldpassword {
|
|
|
9822
10983
|
/****************************************************************************/
|
|
9823
10984
|
//#region RENDER
|
|
9824
10985
|
render() {
|
|
9825
|
-
return (hAsync(Host, { key: '
|
|
9826
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
9827
|
-
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '
|
|
10986
|
+
return (hAsync(Host, { key: '3651f681b77d6955486e2d2bcc2f70d61e012089' }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: '24032106e853a32c2e35418e2f32126cdcf1c2e8', htmlFor: this.inputId }, hAsync("slot", { key: '44deddd654d370beaeff254eba1c054ba1250267', name: "label" }, this.label))), hAsync("div", { key: 'fbbb86259a866dfd5c0c660b8e6afe5978d82dd1', class: "input-wrapper" }, hAsync("slot", { key: '05595aab730f9c430bda896137383cff6def5b9f', name: "before-input" }), hAsync("div", { key: '0f693ce1d94f1b40cbd215a8ee92040801e9f12f', class: "input-container", onClick: this.handleInputContainerClick }, hAsync("slot", { key: '8d0c453201a6f6c874da6708f539ac3b9c62eb57', name: "leading-input" }), hAsync("input", { key: 'eaf902b52d59e1ec745d06a684cc6743878fd17a', id: this.inputId, ref: e => (this.inputElement = e), autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, type: this.showPasswordState ? 'text' : 'password', inputMode: this.mode, value: this.value, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), !this.hidePasswordIcon && (hAsync("nv-iconbutton", { key: '7e52b6f031d680c601012b70e30a5b685da753b1', class: "toggle-password-icon", name: this.showPasswordState ? 'eye' : 'eye-off', size: "md", emphasis: "lower", onClick: this.togglePasswordVisibility, onKeyDown: this.handleKeyDown, "aria-label": this.showPasswordState ? 'Hide password' : 'Show password', "aria-pressed": this.showPasswordState.toString() })), (this.success || this.error) && (hAsync("nv-icon", { key: '4aeb80d040982ffa14d9783d1a6321358d883eb5', name: this.success ? 'circle-check' : 'alert-circle', class: "validation", size: "md" }))), hAsync("slot", { key: '0eaf082103ba3440d7dbd94c113a944a02de92ad', name: "after-input" })), (this.description ||
|
|
10987
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '4de2f9371c606f503daf93370e2bf5a61c2241eb', class: "description" }, hAsync("slot", { key: 'fbbe4144a1a4d9b601156c53f25d08809989bead', name: "description" }, this.description))), (this.errorDescription ||
|
|
10988
|
+
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: 'd8d81ec37edc4e05b24ee7b3c051899d49902899', hidden: !this.error, class: "error-description" }, hAsync("slot", { key: 'd6c21cdefc94b7dc9c494dda505507cfb3c06c1b', name: "error-description" }, this.errorDescription)))));
|
|
9828
10989
|
}
|
|
9829
10990
|
static get formAssociated() { return true; }
|
|
9830
10991
|
get el() { return getElement(this); }
|
|
@@ -9944,9 +11105,9 @@ class NvFieldradio {
|
|
|
9944
11105
|
/****************************************************************************/
|
|
9945
11106
|
//#region RENDER
|
|
9946
11107
|
render() {
|
|
9947
|
-
return (hAsync(Host, { key: '
|
|
9948
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
9949
|
-
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '
|
|
11108
|
+
return (hAsync(Host, { key: '529231ea33610d441eeabfcb0c87febc003549f7', class: clsx(this.labelPlacement === 'before' && 'label-placement-before', this.error && 'error') }, hAsync("input", { key: 'ec0ccd0b2f380eeb8cfbfc8554a15218209ab7a3', type: "radio", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: this.checked, disabled: this.disabled }), hAsync("div", { key: 'c6e0281290c266e68c4c09cd697384e32bad5204', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: '0ac8815394c4d2176165cf3b41c1d946aad87a3d', htmlFor: this.inputId }, hAsync("slot", { key: '3e872fba160c095bb25b8b0e16a03947a2880383', name: "label" }, this.label))), (this.description ||
|
|
11109
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: 'c1a34348e13f9cf27a73cada9c770913badb8e65', class: "description" }, hAsync("slot", { key: 'f214bfdf9291dc6460abbef754b00953baa9b4bc', name: "description" }, this.description))), (this.errorDescription ||
|
|
11110
|
+
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '67c582d253edb3c504e2ad02a2db35bd1544a764', hidden: !this.error, class: "error-description" }, hAsync("slot", { key: '428a6e4c7a2de0d22d6fc5e693ade6ac906d4ce3', name: "error-description" }, this.errorDescription))))));
|
|
9950
11111
|
}
|
|
9951
11112
|
static get formAssociated() { return true; }
|
|
9952
11113
|
get el() { return getElement(this); }
|
|
@@ -10289,13 +11450,13 @@ class NvFieldselect {
|
|
|
10289
11450
|
* @returns {HTMLStencilElement} The HTML element to render.
|
|
10290
11451
|
*/
|
|
10291
11452
|
render() {
|
|
10292
|
-
return (hAsync(Host, { key: '
|
|
11453
|
+
return (hAsync(Host, { key: '488eabdf0d55be6e34cc726317f2081cd62cd36b' }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: '8f7a27d3829bb0d794525b3e7cae99d8512bd541', htmlFor: this.inputId }, hAsync("slot", { key: 'd716b5c2d050859dfa2ff640b8c71e9e2e52d167', name: "label" }, this.label))), hAsync("div", { key: '193c698fe743b361df7d51db8242ecd4ac4a845e', class: "select-wrapper" }, hAsync("slot", { key: '8b6d17fb246b1226f0fb0ec682aad0c96256744d', name: "before-input" }), hAsync("div", { key: 'aeba6544e7f59ea79ea9dd69ece2d322d4639d9c', class: "select-container", onClick: this.handleSelectContainerClick }, hAsync("slot", { key: 'a895b3ff375f8b39c7dbfffc7b7e197ead24d756', name: "leading-input" }), this.internalReadonly && (hAsync("input", { key: 'ed6f534b074ee0a9d4c2ceea8fb3501174ffe21d', id: this.inputId + '-readonly', type: "text", value: this.computedDisplayValue, readonly: true, class: "readonly-input", "aria-readonly": "true", "aria-label": this.label, "aria-describedby": this.error
|
|
10293
11454
|
? `${this.inputId}-error`
|
|
10294
|
-
: `${this.inputId}-description` })), hAsync("select", { key: '
|
|
11455
|
+
: `${this.inputId}-description` })), hAsync("select", { key: 'b04cd5dc7a761235bb99bf6dfafc7df460d4015b', id: this.inputId, ref: el => (this.selectElement = el), name: this.name, disabled: this.disabled, required: this.required, multiple: this.multiple, onChange: this.handleSelectChange, class: this.internalReadonly ? 'hidden' : '', "aria-label": this.label, "aria-describedby": this.error
|
|
10295
11456
|
? `${this.inputId}-error`
|
|
10296
|
-
: `${this.inputId}-description` }, hAsync("slot", { key: '
|
|
10297
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
10298
|
-
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '
|
|
11457
|
+
: `${this.inputId}-description` }, hAsync("slot", { key: '53e76753cce820e5a2e0603e06c3b45213e74665' })), this.internalReadonly && (hAsync("nv-icon", { key: '74de038ef7f426556da9d3366a60a9eac11f06e1', name: "chevron-down", class: "readonly-icon", size: "sm" })), this.error && (hAsync("nv-icon", { key: '354f4ee5153f48e8f0221b27310482c3b046ffa2', name: "alert-circle", class: "validation", size: "sm" })), this.success && (hAsync("nv-icon", { key: '118d5be3c1b859e18b0ebd430763059be07f7416', name: "circle-check", class: "validation", size: "sm" }))), hAsync("slot", { key: 'f30fab6851bef6311e2c0302b70ce779d46baffc', name: "after-input" })), (this.description ||
|
|
11458
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: 'a56d029e8e9d9c5ba3c019ea735b71781641c1fe', class: "description", id: `${this.inputId}-description` }, hAsync("slot", { key: 'fc6315884c44da3092a3cb2536cae28e1d767553', name: "description" }, this.description))), (this.errorDescription ||
|
|
11459
|
+
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '92997cdace95b2bc58dfdc41b184c7147e0817e3', class: "error-description", id: `${this.inputId}-error` }, hAsync("slot", { key: '75eefd84cabcfa330eab1453317643a4036dd33d', name: "error-description" }, this.errorDescription)))));
|
|
10299
11460
|
}
|
|
10300
11461
|
static get formAssociated() { return true; }
|
|
10301
11462
|
get el() { return getElement(this); }
|
|
@@ -10435,9 +11596,9 @@ class NvFieldtext {
|
|
|
10435
11596
|
/****************************************************************************/
|
|
10436
11597
|
//#region RENDER
|
|
10437
11598
|
render() {
|
|
10438
|
-
return (hAsync(Host, { key: '
|
|
10439
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
10440
|
-
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '
|
|
11599
|
+
return (hAsync(Host, { key: 'a72abeeb27e5ca2cd99bae24bc82244c804f3139' }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: '5cc62313402e322db31535acca086c380f457dc6', htmlFor: this.inputId }, hAsync("slot", { key: 'f815f5311aa3ce60fa7f77d29cd90750cb399820', name: "label" }, this.label))), hAsync("div", { key: '1d4c261110faf55ca25b65d86b77a7666dfe8adc', class: "input-wrapper" }, hAsync("slot", { key: '5743bcb174019f5a92c20c5d6336e17842d7bb08', name: "before-input" }), hAsync("div", { key: '7def6d8c23971148763ba6c901e1a07307c1ca9a', class: "input-container", onClick: this.handleInputContainerClick }, hAsync("slot", { key: 'ce53a9e36919808dc3738ee05983e97785585e9f', name: "leading-input" }), hAsync("input", { key: '5f434436a8708c2895bea87a2327ddc6a222d2a6', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: this.type, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, pattern: this.pattern, autocomplete: this.autocomplete, multiple: this.multiple, value: this.value, onInput: this.handleInput }), this.error && (hAsync("nv-icon", { key: '023814741ab991b0f46e132c243f7a7c513b82c8', name: "alert-circle", class: "validation", size: "sm" })), this.success && (hAsync("nv-icon", { key: '06d572bedac515cb797799bb887d2b624f173cb1', name: "circle-check", class: "validation", size: "sm" }))), hAsync("slot", { key: 'd81a53001f95f60ad44bc8aabd45803d5eca54e6', name: "after-input" })), (this.description ||
|
|
11600
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: 'f0f6afc05adf9493ee5f5eb90a454006b07d131c', class: "description" }, hAsync("slot", { key: '70b93af3c69573b8ba4ca9d8db28773de1a88362', name: "description" }, this.description))), (this.errorDescription ||
|
|
11601
|
+
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: 'ce2b969356c92da9eab40792cba126d15f88250e', hidden: !this.error, class: "error-description" }, hAsync("slot", { key: 'd6aa536ce3fc900bc5dcfbae524458ca925081f6', name: "error-description" }, this.errorDescription)))));
|
|
10441
11602
|
}
|
|
10442
11603
|
static get formAssociated() { return true; }
|
|
10443
11604
|
get el() { return getElement(this); }
|
|
@@ -10645,9 +11806,9 @@ class NvFieldtextarea {
|
|
|
10645
11806
|
/****************************************************************************/
|
|
10646
11807
|
//#region RENDER
|
|
10647
11808
|
render() {
|
|
10648
|
-
return (hAsync(Host, { key: '
|
|
10649
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
10650
|
-
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: '
|
|
11809
|
+
return (hAsync(Host, { key: '13efbb6d3808652f3b0f3e348338cc770140533b' }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: '3584c6a3045e5dcf1f3a26af77e9d1d0399ba82c', htmlFor: this.inputId }, hAsync("slot", { key: '7ec834555eec08002bdf5f28d6ab9ee0ec59914d', name: "label" }, this.label))), hAsync("div", { key: '386206a939b02f2ac97bfae21242f98ed4a5a814', class: "textarea-wrapper" }, hAsync("div", { key: 'c1bef6551b677cbad2eef80e8d8a9e04d326a1fc', class: "textarea-container", onClick: this.handleTextareaContainerClick }, hAsync("textarea", { key: 'f519c3ec458df4d91163122277f1b91d1ec21315', id: this.inputId, ref: e => (this.textareaElement = e), placeholder: this.placeholder, name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, maxlength: this.maxlength, minlength: this.minlength, autocomplete: "off", value: this.value, onInput: this.handleTextarea, rows: this.rows, class: clsx(this.resize === 'none' && 'resize-none', this.resize === 'vertical' && 'resize-y', this.resize === 'horizontal' && 'resize-x', this.resize === 'both' && 'resize') }))), (this.description ||
|
|
11810
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: 'd431c988df6f442196c004514b78832ebcf5e0f5', class: "description" }, hAsync("slot", { key: '8830e8ee7b9649fb13dfd86e2d0b7730e23106d6', name: "description" }, this.description))), (this.errorDescription ||
|
|
11811
|
+
this.el.querySelector('[slot="error-description"]')) && (hAsync("div", { key: 'fb8d9b7347f0033faa7b4355817517273351d3af', hidden: !this.error, class: "error-description" }, hAsync("slot", { key: 'f39fbf2ab7e01c1c2a2f611450adaede41632473', name: "error-description" }, this.errorDescription)))));
|
|
10651
11812
|
}
|
|
10652
11813
|
static get formAssociated() { return true; }
|
|
10653
11814
|
get el() { return getElement(this); }
|
|
@@ -10751,8 +11912,8 @@ class NvFieldtoggle {
|
|
|
10751
11912
|
/****************************************************************************/
|
|
10752
11913
|
//#region RENDER
|
|
10753
11914
|
render() {
|
|
10754
|
-
return (hAsync(Host, { key: '
|
|
10755
|
-
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '
|
|
11915
|
+
return (hAsync(Host, { key: '3ea6cc0c5c5955ab9e2447d940e7716a8e120bd8', class: clsx(this.labelPlacement === 'before' && 'label-placement-before') }, hAsync("div", { key: '5b7df808f832edcbc600df0c64af6ad7c1e41e40', class: "input-container" }, hAsync("input", { key: '8680c917371bf0c7b0a91610f18e51800f65f094', type: "checkbox", id: this.inputId, name: this.name, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly })), hAsync("div", { key: '3273cf879e7ebdf9cb0ab81df4b674d39943c8fe', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (hAsync("label", { key: 'd98f1db14a1de22dc47f6f6cb95431211c364ddf', htmlFor: this.inputId, class: clsx(this.hideLabel && 'visually-hidden') }, hAsync("slot", { key: '1a1ca78c91d39e230a95af52fff8dd1f97a095e0', name: "label" }, this.label))), (this.description ||
|
|
11916
|
+
this.el.querySelector('[slot="description"]')) && (hAsync("div", { key: '9c63a661b4a722575d74d2a0f38a41813b0b822e', class: "description" }, hAsync("slot", { key: '5074ff74cc430a43387905a53d854e2acda5c8b5', name: "description" }, this.description))))));
|
|
10756
11917
|
}
|
|
10757
11918
|
get el() { return getElement(this); }
|
|
10758
11919
|
static get watchers() { return {
|
|
@@ -10825,7 +11986,7 @@ class NvIcon {
|
|
|
10825
11986
|
//#region RENDER
|
|
10826
11987
|
render() {
|
|
10827
11988
|
//const iconSprite = getAssetPath('assets/icon-sprite.svg');
|
|
10828
|
-
return (hAsync(Host, { key: '
|
|
11989
|
+
return (hAsync(Host, { key: 'f61ded4f06fd48ef89b4fcf48350401a71f5642e', class: clsx(this.color && `${this.color}`), role: "img", "aria-label": `${this.name}-icon` }, hAsync("svg", { key: '9d3dd25cfa34416cc0baf547cac1cf74c72b7f06', stroke: "currentColor", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: `nv-icon-${this.size}` }, hAsync("use", { key: 'a66fe0b7a80cdd59425ad94eab3a16c03ef6218d', href: `${this.spriteUrl}#${this.name}` }))));
|
|
10829
11990
|
}
|
|
10830
11991
|
static get style() { return NvIconStyle0; }
|
|
10831
11992
|
static get cmpMeta() { return {
|
|
@@ -10955,7 +12116,7 @@ class NvIconbutton {
|
|
|
10955
12116
|
/****************************************************************************/
|
|
10956
12117
|
//#region RENDER
|
|
10957
12118
|
render() {
|
|
10958
|
-
return (hAsync(Host, { key: '
|
|
12119
|
+
return (hAsync(Host, { key: 'da500bc993c56223fbbef59de813d6abc4edae66', role: "button", type: this.type, tabindex: "0", disabled: this.disabled ? true : undefined, class: clsx('root', `size-${this.size}`, `emphasis-${this.emphasis}`, this.loading && 'loading', `shape-${this.shape}`), onClick: this.handleClick }, this.loading && hAsync("nv-loader", { key: '853eb4bb3b24acab512e4a97d1d62d9f9868c54b', size: this.size }), !this.loading && hAsync("nv-icon", { key: 'ae37d9c53d96da31230b0ea783ba90873bc63fd3', name: this.name, size: this.size }), hAsync("slot", { key: 'e244d12cf966dc1636eee84dcf4ce91a8982127e' })));
|
|
10959
12120
|
}
|
|
10960
12121
|
static get formAssociated() { return true; }
|
|
10961
12122
|
get el() { return getElement(this); }
|
|
@@ -11003,7 +12164,7 @@ class NvLoader {
|
|
|
11003
12164
|
//#region RENDER
|
|
11004
12165
|
/* <slot> empty to force rendering change */
|
|
11005
12166
|
render() {
|
|
11006
|
-
return (hAsync(Host, { key: '
|
|
12167
|
+
return (hAsync(Host, { key: 'd47cddef84d79aa07307501fc9aa43d33ae79287', class: clsx(this.size && `size-${this.size}`, this.color && `color-${this.color}`) }));
|
|
11007
12168
|
}
|
|
11008
12169
|
static get style() { return NvLoaderStyle0; }
|
|
11009
12170
|
static get cmpMeta() { return {
|
|
@@ -11179,7 +12340,7 @@ class NvMenu {
|
|
|
11179
12340
|
/****************************************************************************/
|
|
11180
12341
|
//#region RENDER
|
|
11181
12342
|
render() {
|
|
11182
|
-
return (hAsync(Host, { key: '
|
|
12343
|
+
return (hAsync(Host, { key: 'a28164031ff34af57a3039e7e9077114a84e5ead' }, hAsync("slot", { key: 'b84c1bce094b2039b2f8d6e202752a48ce5967e6', name: "trigger" }), hAsync("nv-popover", { key: '0bf868e671a882d1a0073f0bae321541f9bda10b', ref: el => (this.popoverElement = el), triggerMode: "click", triggerElement: this.triggerElement, placement: this.placement, nested: this.nested, open: this.open }, hAsync("slot", { key: '09d7a81d65214f6b803ca4fb84995aa16e747174', name: "content" }))));
|
|
11183
12344
|
}
|
|
11184
12345
|
get el() { return getElement(this); }
|
|
11185
12346
|
static get style() { return NvMenuStyle0; }
|
|
@@ -11249,7 +12410,7 @@ class NvMenuitem {
|
|
|
11249
12410
|
/****************************************************************************/
|
|
11250
12411
|
//#region RENDER
|
|
11251
12412
|
render() {
|
|
11252
|
-
return (hAsync(Host, { key: '
|
|
12413
|
+
return (hAsync(Host, { key: '31ff42ca3327ad886aa6c7095f70b56013a91bc9', role: "menuitem", tabindex: this.disabled ? '-1' : '0' }, this.icon && hAsync("nv-icon", { key: '27d59e5fb7877401d74915f6176d5d37b441d24b', name: this.icon }), hAsync("span", { key: '9ee13d14d026e8aa9738c29051ea3eddb72973b6', "data-scope": "text" }, hAsync("slot", { key: '09ae4f46f55268113c030b106838ff4f21a81dd2' })), this.shortcut && !this.hasSubmenu && hAsync("kbd", { key: '56336e605425e598f3c9e3384b5a12f84f529e73' }, this.shortcut), this.hasSubmenu && hAsync("nv-icon", { key: '18a8b87eb166189bdebc7fa7a362fec7725257d1', name: "chevron-right" })));
|
|
11253
12414
|
}
|
|
11254
12415
|
get el() { return getElement(this); }
|
|
11255
12416
|
static get style() { return NvMenuitemStyle0; }
|
|
@@ -13649,7 +14810,7 @@ class NvPopover {
|
|
|
13649
14810
|
/****************************************************************************/
|
|
13650
14811
|
//#region RENDER
|
|
13651
14812
|
render() {
|
|
13652
|
-
return (hAsync(Host, { key: '
|
|
14813
|
+
return (hAsync(Host, { key: '1014588b3220a543ba8f51aa82664b933e4ff477' }, hAsync("slot", { key: '5a6d7bb46a32f77a4eab3fe0fd105b268862c2aa', name: "trigger" }), hAsync("div", { key: 'c9043c20aa2667b80bd3668992a017b89da0dbba', "data-scope": "popover", hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (hAsync("div", { key: '1ffcc0878409b66d7cecd398e18d1923465d5381', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), hAsync("slot", { key: '814d6cdc6150c66342c35607364bfcf60c85b036', name: "content" }))));
|
|
13653
14814
|
}
|
|
13654
14815
|
get el() { return getElement(this); }
|
|
13655
14816
|
static get watchers() { return {
|
|
@@ -13694,7 +14855,7 @@ class NvRow {
|
|
|
13694
14855
|
/****************************************************************************/
|
|
13695
14856
|
//#region RENDER
|
|
13696
14857
|
render() {
|
|
13697
|
-
return (hAsync(Host, { key: '
|
|
14858
|
+
return (hAsync(Host, { key: 'd114427cd2f3e3ec93f16d42db6f011c299d7550' }, hAsync("slot", { key: '1246a285010f7e84b97ab00d82878e1abce631c2' })));
|
|
13698
14859
|
}
|
|
13699
14860
|
static get style() { return NvRowStyle0; }
|
|
13700
14861
|
static get cmpMeta() { return {
|
|
@@ -13729,7 +14890,7 @@ class NvStack {
|
|
|
13729
14890
|
/****************************************************************************/
|
|
13730
14891
|
//#region RENDER
|
|
13731
14892
|
render() {
|
|
13732
|
-
return (hAsync(Host, { key: '
|
|
14893
|
+
return (hAsync(Host, { key: 'b62a759491ca6e1a54836be2a02623f7fa10afc9', class: clsx(this.fill && 'nv-stack-fill', this.flex && 'nv-stack-flex', this.full && 'w-full', this.gutter && !this.vertical && `gutter-x-${this.gutter}`, this.gutter && this.vertical && `gutter-y-${this.gutter}`, this.vertical && 'nv-stack-vertical') }, hAsync("slot", { key: '80fe393d0d3fc5b63d158ec2a77d50c98e23058b' })));
|
|
13733
14894
|
}
|
|
13734
14895
|
static get style() { return NvStackStyle0; }
|
|
13735
14896
|
static get cmpMeta() { return {
|
|
@@ -13878,7 +15039,7 @@ class NvTable {
|
|
|
13878
15039
|
.querySelector('[slot="body"]')
|
|
13879
15040
|
.querySelectorAll('nv-tablerow'))
|
|
13880
15041
|
: [];
|
|
13881
|
-
return (hAsync(Host, { key: '
|
|
15042
|
+
return (hAsync(Host, { key: '8de3c15197a92540c43b80df5eb14e456d7fa9fb' }, hAsync("div", { key: '355ae5642547c995b0cd61f6ed5c56086546717a', class: "hidden" }, hAsync("slot", { key: '92fadc1b368c4938723dd006ffe860ef7e3f333b' }), hAsync("slot", { key: '68d5eee9f4f162bf8b8674e5b0387cd2c7c9443d', name: "head" }), hAsync("slot", { key: 'a03dba982bbea6e7a49072aa44a0e3329c289759', name: "body" })), hAsync("slot", { key: 'f8474331714b5c1f07c63d84eabdca28daac467f', name: "before" }), this.parsedColumns.length === 0 &&
|
|
13882
15043
|
this.parsedData.length === 0 &&
|
|
13883
15044
|
headerRows.length === 0 &&
|
|
13884
15045
|
bodyRows.length === 0 ? (hAsync("p", null, this.noColumnsNoDataMessage)) : (hAsync("table", null, this.parsedColumns.length > 0 ? (hAsync("thead", null, hAsync("tr", null, this.parsedColumns.map(column => (hAsync("th", null, column)))))) : headerRows.length > 0 ? (hAsync("thead", null, headerRows.map(row => {
|
|
@@ -13889,7 +15050,7 @@ class NvTable {
|
|
|
13889
15050
|
: Object.values(row).map(value => hAsync("td", null, value)))))) : bodyRows.length > 0 ? (bodyRows.map(row => {
|
|
13890
15051
|
const cells = Array.from(row.querySelectorAll('nv-tabledatacell'));
|
|
13891
15052
|
return (hAsync("tr", null, cells.map(cell => (hAsync("td", { colSpan: cell.colspan, rowSpan: cell.rowspan, headers: cell.headers, innerHTML: cell.innerHTML })))));
|
|
13892
|
-
})) : null))), hAsync("slot", { key: '
|
|
15053
|
+
})) : null))), hAsync("slot", { key: 'cb6d29a453c6d76ce6e97cd5928b180d70c37a33', name: "after" })));
|
|
13893
15054
|
}
|
|
13894
15055
|
get el() { return getElement(this); }
|
|
13895
15056
|
static get watchers() { return {
|
|
@@ -13933,7 +15094,7 @@ class NvTablebody {
|
|
|
13933
15094
|
/****************************************************************************/
|
|
13934
15095
|
//#region RENDER
|
|
13935
15096
|
render() {
|
|
13936
|
-
return (hAsync(Host, { key: '
|
|
15097
|
+
return (hAsync(Host, { key: '500001e6d0de218e7d0d7a8bd689164d65aaa039' }, hAsync("tbody", { key: '97d4947747a3dcdd6f8d1d941cdc8fa19b983908' }, hAsync("slot", { key: 'cbecc34bdc025bf64b9d810ed2ff23bb6dfc6f31' }))));
|
|
13937
15098
|
}
|
|
13938
15099
|
static get style() { return NvTablebodyStyle0; }
|
|
13939
15100
|
static get cmpMeta() { return {
|
|
@@ -13976,7 +15137,7 @@ class NvTablecolumn {
|
|
|
13976
15137
|
/****************************************************************************/
|
|
13977
15138
|
//#region RENDER
|
|
13978
15139
|
render() {
|
|
13979
|
-
return (hAsync(Host, { key: '
|
|
15140
|
+
return (hAsync(Host, { key: 'd84688d8480034f9ccfc0965056fe97d7fded63d' }, hAsync("th", { key: '66af0bd8372fd31f26f1d76dce881a50b4c2c3a7', abbr: this.abbr, colSpan: this.colspan, headers: this.headers, rowSpan: this.rowspan, scope: this.scope }, hAsync("slot", { key: '4a7517e19a7f9db8f29d748c75dad359e75dc367' }))));
|
|
13980
15141
|
}
|
|
13981
15142
|
static get style() { return NvTablecolumnStyle0; }
|
|
13982
15143
|
static get cmpMeta() { return {
|
|
@@ -14027,7 +15188,7 @@ class NvTabledatacell {
|
|
|
14027
15188
|
/****************************************************************************/
|
|
14028
15189
|
//#region RENDER
|
|
14029
15190
|
render() {
|
|
14030
|
-
return (hAsync(Host, { key: '
|
|
15191
|
+
return (hAsync(Host, { key: '7a1ce39e2214eb2f85ce54642c9ce01b8af84267' }, hAsync("td", { key: '74359eaa2f3b91c9c58bf1fb24444614c6b21676', colSpan: this.colspan, rowSpan: this.rowspan, headers: this.headers }, hAsync("slot", { key: 'cc6eb32e097d4b11a43194aaeda4db1ddda1ff12' }))));
|
|
14031
15192
|
}
|
|
14032
15193
|
static get style() { return NvTabledatacellStyle0; }
|
|
14033
15194
|
static get cmpMeta() { return {
|
|
@@ -14057,7 +15218,7 @@ class NvTablehead {
|
|
|
14057
15218
|
/****************************************************************************/
|
|
14058
15219
|
//#region RENDER
|
|
14059
15220
|
render() {
|
|
14060
|
-
return (hAsync(Host, { key: '
|
|
15221
|
+
return (hAsync(Host, { key: '49d3a0f625f25d004fb3c0b4fe570c9bece0cf28' }, hAsync("thead", { key: '7c3c48978fd21f6e942c2b7da1646c79e0e96e37' }, hAsync("slot", { key: 'f61a4f0f89571e1d3d0548b1391207a3d0f09319' }))));
|
|
14061
15222
|
}
|
|
14062
15223
|
static get style() { return NvTableheadStyle0; }
|
|
14063
15224
|
static get cmpMeta() { return {
|
|
@@ -14083,7 +15244,7 @@ class NvTablerow {
|
|
|
14083
15244
|
/****************************************************************************/
|
|
14084
15245
|
//#region RENDER
|
|
14085
15246
|
render() {
|
|
14086
|
-
return (hAsync(Host, { key: '
|
|
15247
|
+
return (hAsync(Host, { key: 'b36e5025d1bdc47acfb8502ca733681b34bb5481' }, hAsync("tr", { key: '60d9831825ab3fe6acda82ae63336c4f2dddf52a' }, hAsync("slot", { key: 'd5f7388f36ef8a3c06d2ba13c6d2b751479be426' }))));
|
|
14087
15248
|
}
|
|
14088
15249
|
static get style() { return NvTablerowStyle0; }
|
|
14089
15250
|
static get cmpMeta() { return {
|
|
@@ -14132,7 +15293,7 @@ class NvTooltip {
|
|
|
14132
15293
|
/****************************************************************************/
|
|
14133
15294
|
//#region RENDER
|
|
14134
15295
|
render() {
|
|
14135
|
-
return (hAsync(Host, { key: '
|
|
15296
|
+
return (hAsync(Host, { key: '4813090b7b9cabaa208ee6b7e384003a64a5db4b' }, hAsync("slot", { key: 'b80271e22aab3dca30afc8c35eb9861df29669c5' }), hAsync("nv-popover", { key: '854d726cccce5018b4eed180c97798cade7a46c5', triggerMode: "hover", hasArrow: true, placement: this.placement, triggerElement: this.triggerElement, groupName: 'tooltip', enterDelay: this.enterDelay }, hAsync("p", { key: '343519886ef5f664a5ad461b5f3978cec527c9fb', slot: "content" }, this.message), hAsync("slot", { key: '75eeb2a6f32e6eba85dc5d717773be4611a05de4', name: "content" }))));
|
|
14136
15297
|
}
|
|
14137
15298
|
get el() { return getElement(this); }
|
|
14138
15299
|
static get style() { return NvTooltipStyle0; }
|
|
@@ -14169,6 +15330,8 @@ registerComponents([
|
|
|
14169
15330
|
NvDatagridrow,
|
|
14170
15331
|
NvFieldcheckbox,
|
|
14171
15332
|
NvFielddropdownitem,
|
|
15333
|
+
NvFielddropdownitemcheck,
|
|
15334
|
+
NvFieldmultiselect,
|
|
14172
15335
|
NvFieldnumber,
|
|
14173
15336
|
NvFieldpassword,
|
|
14174
15337
|
NvFieldradio,
|