@nova-design-system/nova-react 3.5.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/cjs/{timeline.animation-1b88f052-B8-vCVrY.js → collapse.animation-16e3af45-CChx_tQJ.js} +4 -25
- package/dist/cjs/fade.animation-71e8e34c-BAw_TYsB.js +68 -0
- package/dist/cjs/{index-Te0zRbKN.js → index-Cv7U-U85.js} +2237 -1595
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/nv-accordion-item.entry-BgDBJjHO.js +178 -0
- package/dist/cjs/nv-accordion.entry-1dHBq_qo.js +164 -0
- package/dist/cjs/{nv-alert.entry-CPbApg9_.js → nv-alert.entry-6J-BEBxl.js} +10 -8
- package/dist/cjs/{nv-avatar.entry-CwM8IOei.js → nv-avatar.entry-Lav6aVEw.js} +2 -2
- package/dist/cjs/{nv-badge_2.entry-Bqu-2k7E.js → nv-badge_2.entry-DaAOJgy_.js} +14 -12
- package/dist/cjs/{nv-breadcrumb.entry-CmceXVS9.js → nv-breadcrumb.entry-BKoLlkWC.js} +2 -2
- package/dist/cjs/{nv-breadcrumbs.entry-B7xbEUl5.js → nv-breadcrumbs.entry-BdGgzdxC.js} +2 -2
- package/dist/cjs/{nv-button.entry-Cd_CE1fx.js → nv-button.entry-Pe2qJFy0.js} +2 -2
- package/dist/cjs/{nv-calendar.entry-B2lm2nvb.js → nv-calendar.entry-WRFrbZtz.js} +97 -67
- package/dist/cjs/{nv-col.entry-BF8XR4B1.js → nv-col.entry-C3IgKfxS.js} +2 -2
- package/dist/cjs/{nv-datagrid.entry-CcQ8XP6J.js → nv-datagrid.entry-Bh1mgk8D.js} +3 -3
- package/dist/cjs/{nv-datagridcolumn.entry-uGbQ4NMr.js → nv-datagridcolumn.entry-DopvtY6C.js} +2 -2
- package/dist/cjs/{nv-dialog.entry-DyK4wFFz.js → nv-dialog.entry-D8oF5B-9.js} +20 -7
- package/dist/cjs/{nv-dialogfooter_2.entry-DT3kR9Xn.js → nv-dialogfooter_2.entry-QE1dFuOh.js} +3 -3
- package/dist/cjs/{nv-fieldcheckbox.entry-D_wHbgcq.js → nv-fieldcheckbox.entry-BbC0JUWc.js} +5 -5
- package/dist/cjs/{nv-fielddate.entry-BaIcP2EG.js → nv-fielddate.entry-BIuQgdYW.js} +122 -36
- package/dist/cjs/{nv-fielddaterange.entry-BNcF2N2M.js → nv-fielddaterange.entry-C82h1WUR.js} +33 -5
- package/dist/cjs/{nv-fielddropdown.entry-DWlDvODi.js → nv-fielddropdown.entry-CWqg8M3_.js} +4 -4
- package/dist/cjs/{nv-fielddropdownitem.entry-BIy_GUKA.js → nv-fielddropdownitem.entry-KuL1iVS4.js} +2 -2
- package/dist/cjs/{nv-fieldmultiselect.entry-B74CLRuh.js → nv-fieldmultiselect.entry-CAdWlUw2.js} +96 -103
- package/dist/cjs/{nv-fieldnumber.entry-BQBy1EIj.js → nv-fieldnumber.entry-Bbk2wO5k.js} +4 -4
- package/dist/cjs/{nv-fieldpassword.entry-DNFZvmBx.js → nv-fieldpassword.entry-BOtLqrGx.js} +4 -4
- package/dist/cjs/{nv-fieldradio.entry-BIR29jv5.js → nv-fieldradio.entry-CY4txacC.js} +4 -4
- package/dist/cjs/{nv-fieldselect.entry-DulA_N5q.js → nv-fieldselect.entry-CRP6e7uq.js} +6 -6
- package/dist/cjs/{nv-fieldslider.entry-DCslY5gg.js → nv-fieldslider.entry-BLO9yOcu.js} +54 -10
- package/dist/cjs/{nv-fieldtext.entry-Dvv8KjJC.js → nv-fieldtext.entry-BqgV8SxD.js} +4 -4
- package/dist/cjs/{nv-fieldtextarea.entry-rVcnznae.js → nv-fieldtextarea.entry-dDaXddme.js} +4 -4
- package/dist/cjs/{nv-fieldtime.entry-_fXkWsoI.js → nv-fieldtime.entry-DAIYFHO7.js} +11 -11
- package/dist/cjs/{nv-icon.entry-BGyFETNH.js → nv-icon.entry-CxE0uTUN.js} +2 -2
- package/dist/cjs/{nv-iconbutton_2.entry-CtClzxKf.js → nv-iconbutton_2.entry-DAWQjqvb.js} +3 -3
- package/dist/cjs/{nv-menu.entry-B3vFxd1E.js → nv-menu.entry-Fg1jfAeH.js} +2 -2
- package/dist/cjs/{nv-menuitem.entry-BIWwr98d.js → nv-menuitem.entry-CGg4iJrd.js} +2 -2
- package/dist/cjs/{nv-popover.entry-vonHjF_y.js → nv-popover.entry-DsKxPxfa.js} +9 -8
- package/dist/cjs/{nv-row.entry-BYUhLZ0r.js → nv-row.entry-BsPFwLLA.js} +2 -2
- package/dist/cjs/{nv-stack.entry-Cxc6QmII.js → nv-stack.entry-4Ec3nJml.js} +2 -2
- package/dist/cjs/{nv-table.entry-DSBUXcSF.js → nv-table.entry-Bv0iDqou.js} +3 -3
- package/dist/cjs/{nv-tablecolumn.entry-BP857bqD.js → nv-tablecolumn.entry-XJJCmUC2.js} +1 -1
- package/dist/cjs/{nv-toggle.entry-CnquGUlJ.js → nv-toggle.entry-C72c_569.js} +3 -3
- package/dist/cjs/{nv-tooltip.entry-XvxL_FTH.js → nv-tooltip.entry-BNvm30iV.js} +4 -3
- package/dist/cjs/{fade.animation-2a077983-aKN0EDTo.js → stylefire.es-74da334a-y0piPjlz.js} +0 -64
- package/dist/cjs/timeline.animation-adf35ecb-CE6Dsdxr.js +23 -0
- package/dist/generated/components.js +18 -2
- package/dist/generated/components.server.js +23 -3
- package/dist/types/generated/components.d.ts +17 -3
- package/dist/types/generated/components.server.d.ts +17 -3
- package/package.json +1 -1
package/dist/cjs/{nv-fieldmultiselect.entry-B74CLRuh.js → nv-fieldmultiselect.entry-CAdWlUw2.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Cv7U-U85.js');
|
|
4
4
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ const NvFieldmultiselect = class {
|
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
this.valueChanged = index.createEvent(this, "valueChanged");
|
|
14
|
-
this.
|
|
14
|
+
this.filterTextChanged = index.createEvent(this, "filterTextChanged");
|
|
15
15
|
/****************************************************************************/
|
|
16
16
|
//#region PROPERTIES
|
|
17
17
|
/**
|
|
@@ -28,6 +28,11 @@ const NvFieldmultiselect = class {
|
|
|
28
28
|
* always type in fresh data.
|
|
29
29
|
*/
|
|
30
30
|
this.autocomplete = 'off';
|
|
31
|
+
/**
|
|
32
|
+
* Specifies the selected values of the multiselect field.
|
|
33
|
+
* This is the canonical value for the component and is used for form submission.
|
|
34
|
+
*/
|
|
35
|
+
this.value = [];
|
|
31
36
|
/**
|
|
32
37
|
* Marks the input field as required.
|
|
33
38
|
*/
|
|
@@ -81,17 +86,13 @@ const NvFieldmultiselect = class {
|
|
|
81
86
|
* Text for the badge showing the number of selected items.
|
|
82
87
|
*/
|
|
83
88
|
this.badgeLabel = '';
|
|
84
|
-
//#endregion PROPERTIES
|
|
85
|
-
/****************************************************************************/
|
|
86
|
-
//#region STATE
|
|
87
89
|
/**
|
|
88
90
|
* The text entered by the user for filtering multiselect items.
|
|
89
91
|
*/
|
|
90
92
|
this.filterText = '';
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.selectedValues = [];
|
|
93
|
+
//#endregion PROPERTIES
|
|
94
|
+
/****************************************************************************/
|
|
95
|
+
//#region STATE
|
|
95
96
|
/**
|
|
96
97
|
* Sorted options for display.
|
|
97
98
|
*/
|
|
@@ -101,8 +102,8 @@ const NvFieldmultiselect = class {
|
|
|
101
102
|
* Handle badge close for options mode.
|
|
102
103
|
*/
|
|
103
104
|
this.handleBadgeCloseOptions = () => {
|
|
104
|
-
this.
|
|
105
|
-
this.
|
|
105
|
+
this.value = [];
|
|
106
|
+
this.valueChanged.emit(this.value);
|
|
106
107
|
// Uncheck all elements
|
|
107
108
|
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
108
109
|
items.forEach(item => {
|
|
@@ -118,8 +119,8 @@ const NvFieldmultiselect = class {
|
|
|
118
119
|
* Handle badge close for slots mode.
|
|
119
120
|
*/
|
|
120
121
|
this.handleBadgeCloseSlots = () => {
|
|
121
|
-
this.
|
|
122
|
-
this.
|
|
122
|
+
this.value = [];
|
|
123
|
+
this.valueChanged.emit(this.value);
|
|
123
124
|
// Uncheck all elements
|
|
124
125
|
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
125
126
|
items.forEach(item => {
|
|
@@ -137,12 +138,19 @@ const NvFieldmultiselect = class {
|
|
|
137
138
|
if (this.isHandlingEscape) {
|
|
138
139
|
return;
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
-
// Reset filter if needed
|
|
141
|
+
// Reset filter if needed, but preserve the filter text
|
|
142
142
|
if (this.filterable) {
|
|
143
143
|
this.resetFilter();
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* Clear the filter text
|
|
148
|
+
*/
|
|
149
|
+
this.clearFilterText = () => {
|
|
150
|
+
this.filterText = '';
|
|
151
|
+
this.filterTextChanged.emit('');
|
|
152
|
+
this.resetFilter();
|
|
153
|
+
};
|
|
146
154
|
/**
|
|
147
155
|
* Handle input blur for options mode.
|
|
148
156
|
*/
|
|
@@ -151,10 +159,9 @@ const NvFieldmultiselect = class {
|
|
|
151
159
|
if (!this.el.contains(document.activeElement)) {
|
|
152
160
|
// Close the popover without affecting the divider
|
|
153
161
|
this.open = false;
|
|
154
|
-
//
|
|
162
|
+
// Clear filter text when focus is lost
|
|
155
163
|
if (this.filterable) {
|
|
156
|
-
this.
|
|
157
|
-
this.resetFilter();
|
|
164
|
+
this.clearFilterText();
|
|
158
165
|
}
|
|
159
166
|
}
|
|
160
167
|
}, 150);
|
|
@@ -212,15 +219,14 @@ const NvFieldmultiselect = class {
|
|
|
212
219
|
return;
|
|
213
220
|
}
|
|
214
221
|
const input = event.target;
|
|
215
|
-
this.
|
|
216
|
-
this.
|
|
222
|
+
this.filterText = input.value;
|
|
223
|
+
this.filterTextChanged.emit(this.filterText);
|
|
217
224
|
// Clear any existing timer
|
|
218
225
|
if (this.debounceTimer) {
|
|
219
226
|
window.clearTimeout(this.debounceTimer);
|
|
220
227
|
}
|
|
221
228
|
// Set a new timer for filtering
|
|
222
229
|
this.debounceTimer = window.setTimeout(() => {
|
|
223
|
-
this.filterText = input.value.toLowerCase();
|
|
224
230
|
this.filterItemsOption();
|
|
225
231
|
}, this.debounceDelay);
|
|
226
232
|
};
|
|
@@ -234,15 +240,14 @@ const NvFieldmultiselect = class {
|
|
|
234
240
|
if (this.disabled || this.readonly)
|
|
235
241
|
return;
|
|
236
242
|
const input = event.target;
|
|
237
|
-
this.
|
|
238
|
-
this.
|
|
243
|
+
this.filterText = input.value;
|
|
244
|
+
this.filterTextChanged.emit(this.filterText);
|
|
239
245
|
// Clear any existing timer
|
|
240
246
|
if (this.debounceTimer) {
|
|
241
247
|
window.clearTimeout(this.debounceTimer);
|
|
242
248
|
}
|
|
243
249
|
// Set a new timer for filtering
|
|
244
250
|
this.debounceTimer = window.setTimeout(() => {
|
|
245
|
-
this.filterText = input.value.toLowerCase();
|
|
246
251
|
this.filterSlotsItems();
|
|
247
252
|
}, this.debounceDelay);
|
|
248
253
|
};
|
|
@@ -272,10 +277,9 @@ const NvFieldmultiselect = class {
|
|
|
272
277
|
if (!this.el.contains(document.activeElement)) {
|
|
273
278
|
// Close the popover without affecting the divider
|
|
274
279
|
this.open = false;
|
|
275
|
-
//
|
|
280
|
+
// Clear filter text when focus is lost
|
|
276
281
|
if (this.filterable) {
|
|
277
|
-
this.
|
|
278
|
-
this.resetFilter();
|
|
282
|
+
this.clearFilterText();
|
|
279
283
|
}
|
|
280
284
|
}
|
|
281
285
|
}, 150);
|
|
@@ -306,14 +310,14 @@ const NvFieldmultiselect = class {
|
|
|
306
310
|
* @returns {any} The JSX for options mode
|
|
307
311
|
*/
|
|
308
312
|
this.renderOptionsMode = () => {
|
|
309
|
-
return (index.h(index.Host, { "aria-label": this.label, "aria-expanded": this.open.toString() }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { htmlFor: this.inputId }, index.h("slot", { name: "label" }, this.label))), index.h("nv-popover", { ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { class: "input-wrapper-multiselect", slot: "trigger" }, index.h("slot", { name: "before-input" }), index.h("div", { class: "input-container-multiselect" }, index.h("slot", { name: "leading-input" }), this.
|
|
313
|
+
return (index.h(index.Host, { "aria-label": this.label, "aria-expanded": this.open.toString() }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { htmlFor: this.inputId }, index.h("slot", { name: "label" }, this.label))), index.h("nv-popover", { ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { class: "input-wrapper-multiselect", slot: "trigger" }, index.h("slot", { name: "before-input" }), index.h("div", { class: "input-container-multiselect" }, index.h("slot", { name: "leading-input" }), this.value.length > 0 && (index.h("nv-badge", { slot: "leading-input", "prevent-auto-close": true, color: "10", dismissible: this.value.length > 0, label: `${this.value.length} ${this.badgeLabel}`, "aria-label": `Clear all ${this.value.length} ${this.badgeLabel} items`, onCloseClicked: this.handleBadgeCloseOptions })), this.filterable || this.disabled || this.readonly ? (index.h("input", { type: "text", id: this.inputId, ref: e => (this.inputElement = e), autofocus: this.autofocus, autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.filterText, required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInputOptions, onFocus: this.handleInputFocusOptions, onBlur: this.handleInputBlurOptions, onKeyDown: this.handleKeyDown, "data-scope": "focusable" })) : (index.h("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, "data-scope": "focusable" }, index.h("span", null, this.placeholder))), this.error && (index.h("nv-icon", { name: "alert-circle", class: "validation", size: "md" })), this.filterable && this.filterText.length > 0 && (index.h("nv-iconbutton", { "data-scope": "clear-filter", name: "x", size: "md", emphasis: "lower", tabindex: "-1", onClick: this.clearFilterText, "aria-label": "Clear filter text" })), index.h("nv-iconbutton", { "data-scope": "toggle-dropdown", 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 })), index.h("slot", { name: "after-input" })), index.h("div", { slot: "content", role: "listbox", "aria-multiselectable": "true", style: this.maxHeight ? { maxHeight: this.maxHeight } : {} }, index.h("ul", { role: "content" }, this.options.map(option => (index.h("nv-fielddropdownitemcheck", { label: option.label, description: option.description, value: option.value, checked: this.value.includes(option.value), disabled: option.disabled }))), index.h("hr", { class: "multiselect-divider", style: { display: 'none' } })))), this.renderDescriptions()));
|
|
310
314
|
};
|
|
311
315
|
/**
|
|
312
316
|
* Renders the component in slots mode
|
|
313
317
|
* @returns {any} The JSX for slots mode
|
|
314
318
|
*/
|
|
315
319
|
this.renderSlotsMode = () => {
|
|
316
|
-
return (index.h(index.Host, { "aria-label": this.label, "aria-expanded": this.open.toString() }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { htmlFor: this.inputId }, index.h("slot", { name: "label" }, this.label))), index.h("nv-popover", { ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { class: "input-wrapper-multiselect", slot: "trigger" }, index.h("slot", { name: "before-input" }), index.h("div", { class: "input-container-multiselect", onClick: this.handleInputContainerClickSlots }, index.h("slot", { name: "leading-input" }), this.
|
|
320
|
+
return (index.h(index.Host, { "aria-label": this.label, "aria-expanded": this.open.toString() }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { htmlFor: this.inputId }, index.h("slot", { name: "label" }, this.label))), index.h("nv-popover", { ref: el => (this.popoverElement = el), triggerMode: "controlled", placement: "bottom-start", open: this.open }, index.h("div", { class: "input-wrapper-multiselect", slot: "trigger" }, index.h("slot", { name: "before-input" }), index.h("div", { class: "input-container-multiselect", onClick: this.handleInputContainerClickSlots }, index.h("slot", { name: "leading-input" }), this.value.length > 0 && (index.h("nv-badge", { slot: "leading-input", "prevent-auto-close": true, color: "10", dismissible: this.value.length > 0, label: `${this.value.length} ${this.badgeLabel}`, "aria-label": `Clear all ${this.value.length} ${this.badgeLabel} items`, onCloseClicked: this.handleBadgeCloseSlots })), this.filterable || this.disabled || this.readonly ? (index.h("input", { id: this.inputId, ref: e => (this.inputElement = e), autocomplete: this.autocomplete, placeholder: this.placeholder, name: this.name, value: this.filterText, required: this.required, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInputSlots, onFocus: this.handleInputFocusSlots, onBlur: this.handleInputBlurSlots, onKeyDown: this.handleKeyDown, "data-scope": "focusable" })) : (index.h("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, "data-scope": "focusable" }, index.h("span", null, this.placeholder))), this.error && (index.h("nv-icon", { name: "alert-circle", class: "validation", size: "md" })), this.filterable && this.filterText.length > 0 && (index.h("nv-iconbutton", { name: "x", size: "md", emphasis: "lower", tabindex: "-1", onClick: this.clearFilterText, "aria-label": "Clear filter text" })), index.h("nv-iconbutton", { "data-scope": "toggle-dropdown", 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 })), index.h("slot", { name: "after-input" })), index.h("div", { slot: "content", role: "listbox", "aria-multiselectable": "true", style: this.maxHeight ? { maxHeight: this.maxHeight } : {} }, index.h("slot", { name: "content" }))), this.renderDescriptions()));
|
|
317
321
|
};
|
|
318
322
|
}
|
|
319
323
|
//#endregion EVENTS
|
|
@@ -322,7 +326,7 @@ const NvFieldmultiselect = class {
|
|
|
322
326
|
handleOptionsChange(newValue) {
|
|
323
327
|
if (!newValue)
|
|
324
328
|
return;
|
|
325
|
-
this.
|
|
329
|
+
this.value = newValue
|
|
326
330
|
.filter(option => option.checked)
|
|
327
331
|
.map(option => option.value);
|
|
328
332
|
this.reorderOptionsContent();
|
|
@@ -331,8 +335,10 @@ const NvFieldmultiselect = class {
|
|
|
331
335
|
* Emitted when the value changes.
|
|
332
336
|
*/
|
|
333
337
|
watchValueHandler() {
|
|
334
|
-
//
|
|
335
|
-
this.
|
|
338
|
+
// Synchronize child components when value changes programmatically
|
|
339
|
+
if (this.el && this.el.isConnected) {
|
|
340
|
+
this.syncChildComponents();
|
|
341
|
+
}
|
|
336
342
|
}
|
|
337
343
|
//#endregion WATCHERS
|
|
338
344
|
/****************************************************************************/
|
|
@@ -372,22 +378,23 @@ const NvFieldmultiselect = class {
|
|
|
372
378
|
}
|
|
373
379
|
const { value, checked } = event.detail;
|
|
374
380
|
if (value !== undefined && value !== null) {
|
|
375
|
-
const
|
|
376
|
-
const valueIndex =
|
|
381
|
+
const newValue = [...this.value];
|
|
382
|
+
const valueIndex = newValue.indexOf(value);
|
|
377
383
|
if (checked && valueIndex === -1) {
|
|
378
|
-
|
|
384
|
+
newValue.push(value);
|
|
379
385
|
}
|
|
380
386
|
else if (!checked && valueIndex > -1) {
|
|
381
|
-
|
|
387
|
+
newValue.splice(valueIndex, 1);
|
|
382
388
|
}
|
|
383
|
-
//
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
// Always update the state and emit the event when an item is checked/unchecked
|
|
390
|
+
this.value = newValue;
|
|
391
|
+
this.valueChanged.emit(this.value);
|
|
392
|
+
// Update the checked state of all items to ensure consistency
|
|
393
|
+
this.syncChildComponents();
|
|
394
|
+
// Preserve the filter text in the input
|
|
395
|
+
if (this.filterable && this.inputElement) {
|
|
396
|
+
// Keep the current filter text in the input
|
|
397
|
+
this.inputElement.value = this.filterText;
|
|
391
398
|
}
|
|
392
399
|
}
|
|
393
400
|
else {
|
|
@@ -426,12 +433,10 @@ const NvFieldmultiselect = class {
|
|
|
426
433
|
}
|
|
427
434
|
// Specific initialization for slots mode
|
|
428
435
|
if (!this.options) {
|
|
436
|
+
// Use a microtask to ensure DOM is ready
|
|
429
437
|
Promise.resolve().then(() => {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
this.selectedValues = items
|
|
433
|
-
.filter(item => item.hasAttribute('checked'))
|
|
434
|
-
.map(item => item.getAttribute('value') || '');
|
|
438
|
+
// Synchronize child components
|
|
439
|
+
this.syncChildComponents();
|
|
435
440
|
// Force a reorder after initialization
|
|
436
441
|
requestAnimationFrame(() => {
|
|
437
442
|
this.reorderSlotContent();
|
|
@@ -442,13 +447,8 @@ const NvFieldmultiselect = class {
|
|
|
442
447
|
if (this.options) {
|
|
443
448
|
this.sortedOptions = [...((_a = this.options) !== null && _a !== void 0 ? _a : [])];
|
|
444
449
|
}
|
|
445
|
-
//
|
|
446
|
-
if (this.
|
|
447
|
-
this.filterText = String(this.value).toLocaleLowerCase();
|
|
448
|
-
this.filterItems();
|
|
449
|
-
}
|
|
450
|
-
else {
|
|
451
|
-
// Reset visibility state of all dropdown items
|
|
450
|
+
// Reset filter if needed
|
|
451
|
+
if (!this.filterText) {
|
|
452
452
|
this.resetFilter();
|
|
453
453
|
}
|
|
454
454
|
}
|
|
@@ -459,6 +459,8 @@ const NvFieldmultiselect = class {
|
|
|
459
459
|
if (this.options) {
|
|
460
460
|
this.handleOptionsChange(this.options);
|
|
461
461
|
}
|
|
462
|
+
// Final synchronization of child components after everything is loaded
|
|
463
|
+
this.syncChildComponents();
|
|
462
464
|
}
|
|
463
465
|
/**
|
|
464
466
|
* Unsubscribe from click outside event.
|
|
@@ -476,38 +478,6 @@ const NvFieldmultiselect = class {
|
|
|
476
478
|
async getFilterText() {
|
|
477
479
|
return this.filterText;
|
|
478
480
|
}
|
|
479
|
-
/**
|
|
480
|
-
* Set the initial selection based on the current value and update the inputElement value.
|
|
481
|
-
*/
|
|
482
|
-
setInitialSelection() {
|
|
483
|
-
var _a;
|
|
484
|
-
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitem'));
|
|
485
|
-
const selectedItem = items.find(item => {
|
|
486
|
-
var _a;
|
|
487
|
-
return item.getAttribute('label') === this.value ||
|
|
488
|
-
item.getAttribute('value') === this.value ||
|
|
489
|
-
((_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === this.value;
|
|
490
|
-
});
|
|
491
|
-
// Remove 'selected' from all items first to reset the state
|
|
492
|
-
items.forEach(item => {
|
|
493
|
-
item.removeAttribute('selected');
|
|
494
|
-
item.classList.remove('selected');
|
|
495
|
-
});
|
|
496
|
-
if (selectedItem) {
|
|
497
|
-
// Add the `selected` attribute and `selected` class for visual styling
|
|
498
|
-
selectedItem.setAttribute('selected', 'true');
|
|
499
|
-
selectedItem.classList.add('selected');
|
|
500
|
-
// Update the value and inputElement value to reflect the pre-selected item
|
|
501
|
-
this.value =
|
|
502
|
-
selectedItem.getAttribute('label') ||
|
|
503
|
-
selectedItem.getAttribute('value') ||
|
|
504
|
-
((_a = selectedItem.textContent) === null || _a === void 0 ? void 0 : _a.trim()) ||
|
|
505
|
-
'';
|
|
506
|
-
if (this.inputElement) {
|
|
507
|
-
this.inputElement.value = this.value;
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
481
|
/**
|
|
512
482
|
* Reset the filter and make all items visible.
|
|
513
483
|
*/
|
|
@@ -524,8 +494,8 @@ const NvFieldmultiselect = class {
|
|
|
524
494
|
if (emptyMessage)
|
|
525
495
|
emptyMessage.remove();
|
|
526
496
|
// Reorder with divider if needed
|
|
527
|
-
const selectedItems = items.filter(item => this.
|
|
528
|
-
const unselectedItems = items.filter(item => !this.
|
|
497
|
+
const selectedItems = items.filter(item => this.value.includes(item.getAttribute('value') || ''));
|
|
498
|
+
const unselectedItems = items.filter(item => !this.value.includes(item.getAttribute('value') || ''));
|
|
529
499
|
if (selectedItems.length > 0) {
|
|
530
500
|
this.manageDivider(ul, selectedItems, unselectedItems);
|
|
531
501
|
}
|
|
@@ -536,7 +506,7 @@ const NvFieldmultiselect = class {
|
|
|
536
506
|
* @returns {string[]} The selected values.
|
|
537
507
|
*/
|
|
538
508
|
async getSelectedValues() {
|
|
539
|
-
return this.
|
|
509
|
+
return this.value;
|
|
540
510
|
}
|
|
541
511
|
/**
|
|
542
512
|
* Reorder the content of the slot.
|
|
@@ -558,8 +528,8 @@ const NvFieldmultiselect = class {
|
|
|
558
528
|
return;
|
|
559
529
|
}
|
|
560
530
|
// Separate checked vs unchecked
|
|
561
|
-
const selectedItems = items.filter(item => this.
|
|
562
|
-
const unselectedItems = items.filter(item => !this.
|
|
531
|
+
const selectedItems = items.filter(item => this.value.includes(item.getAttribute('value') || ''));
|
|
532
|
+
const unselectedItems = items.filter(item => !this.value.includes(item.getAttribute('value') || ''));
|
|
563
533
|
// Reinsert CHECKED items FIRST
|
|
564
534
|
// appendChild() moves the element without recreating it
|
|
565
535
|
// this is not trigger a re-rendering of the component in the platforms
|
|
@@ -585,8 +555,8 @@ const NvFieldmultiselect = class {
|
|
|
585
555
|
if (!ul)
|
|
586
556
|
return;
|
|
587
557
|
const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck')).filter(item => item.style.display !== 'none');
|
|
588
|
-
const selectedItems = items.filter(item => this.
|
|
589
|
-
const unselectedItems = items.filter(item => !this.
|
|
558
|
+
const selectedItems = items.filter(item => this.value.includes(item.getAttribute('value') || ''));
|
|
559
|
+
const unselectedItems = items.filter(item => !this.value.includes(item.getAttribute('value') || ''));
|
|
590
560
|
// Reorder the elements
|
|
591
561
|
selectedItems.forEach(item => ul.appendChild(item));
|
|
592
562
|
unselectedItems.forEach(item => ul.appendChild(item));
|
|
@@ -622,8 +592,8 @@ const NvFieldmultiselect = class {
|
|
|
622
592
|
}
|
|
623
593
|
// Reorder with divider
|
|
624
594
|
const items = Array.from(ul.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
625
|
-
const selectedItems = items.filter(item => this.
|
|
626
|
-
const unselectedItems = items.filter(item => !this.
|
|
595
|
+
const selectedItems = items.filter(item => this.value.includes(item.getAttribute('value') || ''));
|
|
596
|
+
const unselectedItems = items.filter(item => !this.value.includes(item.getAttribute('value') || ''));
|
|
627
597
|
this.manageDivider(ul, selectedItems, unselectedItems);
|
|
628
598
|
return;
|
|
629
599
|
}
|
|
@@ -644,8 +614,8 @@ const NvFieldmultiselect = class {
|
|
|
644
614
|
});
|
|
645
615
|
// Manage the divider with the visible items
|
|
646
616
|
const visibleItems = items.filter(item => item.style.display !== 'none');
|
|
647
|
-
const visibleSelected = visibleItems.filter(item => this.
|
|
648
|
-
const visibleUnselected = visibleItems.filter(item => !this.
|
|
617
|
+
const visibleSelected = visibleItems.filter(item => this.value.includes(item.getAttribute('value') || ''));
|
|
618
|
+
const visibleUnselected = visibleItems.filter(item => !this.value.includes(item.getAttribute('value') || ''));
|
|
649
619
|
this.manageDivider(ul, visibleSelected, visibleUnselected);
|
|
650
620
|
}
|
|
651
621
|
else {
|
|
@@ -703,8 +673,8 @@ const NvFieldmultiselect = class {
|
|
|
703
673
|
});
|
|
704
674
|
// Manage the divider with the visible items
|
|
705
675
|
const visibleItems = items.filter(item => item.style.display !== 'none');
|
|
706
|
-
const visibleSelected = visibleItems.filter(item => this.
|
|
707
|
-
const visibleUnselected = visibleItems.filter(item => !this.
|
|
676
|
+
const visibleSelected = visibleItems.filter(item => this.value.includes(item.getAttribute('value') || ''));
|
|
677
|
+
const visibleUnselected = visibleItems.filter(item => !this.value.includes(item.getAttribute('value') || ''));
|
|
708
678
|
this.manageDivider(ul, visibleSelected, visibleUnselected);
|
|
709
679
|
// Add or remove the empty message based on the case
|
|
710
680
|
if (!hasVisibleItems) {
|
|
@@ -752,8 +722,8 @@ const NvFieldmultiselect = class {
|
|
|
752
722
|
});
|
|
753
723
|
// Get visible items after filtering
|
|
754
724
|
const visibleItems = items.filter(item => item.style.display !== 'none');
|
|
755
|
-
const visibleSelectedItems = visibleItems.filter(item => this.
|
|
756
|
-
this.manageDivider(ul, visibleSelectedItems, visibleItems.filter(item => !this.
|
|
725
|
+
const visibleSelectedItems = visibleItems.filter(item => this.value.includes(item.getAttribute('value') || ''));
|
|
726
|
+
this.manageDivider(ul, visibleSelectedItems, visibleItems.filter(item => !this.value.includes(item.getAttribute('value') || '')));
|
|
757
727
|
// Add empty message if no items match the filter
|
|
758
728
|
if (!hasVisibleItems) {
|
|
759
729
|
const emptyMessage = document.createElement('li');
|
|
@@ -950,6 +920,29 @@ const NvFieldmultiselect = class {
|
|
|
950
920
|
divider.style.display = 'none';
|
|
951
921
|
}
|
|
952
922
|
}
|
|
923
|
+
/**
|
|
924
|
+
* Synchronizes the checked state of all child nv-fielddropdownitemcheck components
|
|
925
|
+
* with the current selectedValues state.
|
|
926
|
+
*/
|
|
927
|
+
syncChildComponents() {
|
|
928
|
+
// Early return if element is not ready
|
|
929
|
+
if (!this.el || !this.el.isConnected) {
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
const items = Array.from(this.el.querySelectorAll('nv-fielddropdownitemcheck'));
|
|
933
|
+
items.forEach(item => {
|
|
934
|
+
// Get the effective value: use explicit value if present, otherwise use label
|
|
935
|
+
const itemValue = item.getAttribute('value') || item.getAttribute('label') || '';
|
|
936
|
+
if (this.value.includes(itemValue)) {
|
|
937
|
+
item.setAttribute('checked', '');
|
|
938
|
+
item.checked = true;
|
|
939
|
+
}
|
|
940
|
+
else {
|
|
941
|
+
item.removeAttribute('checked');
|
|
942
|
+
item.checked = false;
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
}
|
|
953
946
|
/**
|
|
954
947
|
* Renders description and error description sections
|
|
955
948
|
* @returns {any} The JSX for descriptions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Cv7U-U85.js');
|
|
4
4
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -115,9 +115,9 @@ const NvFieldnumber = class {
|
|
|
115
115
|
/****************************************************************************/
|
|
116
116
|
//#region RENDER
|
|
117
117
|
render() {
|
|
118
|
-
return (index.h(index.Host, { key: '
|
|
119
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
120
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
118
|
+
return (index.h(index.Host, { key: '0fcd74073e1c3f2c8de00c21e1ff782d4ed2fbe8' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'c4dc1dc4efd2150fb897f0602b07ab22643756e6', htmlFor: this.inputId }, index.h("slot", { key: 'a0aa360dd532e11fd0273c8ba8d5ded3adc45642', name: "label" }, this.label))), index.h("div", { key: 'c2ffeb70a8e5ffe43ec5061e035add48fd0f09a2', class: "input-wrapper" }, index.h("slot", { key: '62ef15b0961ae4af93940d3d2dd10fdb6a636d4d', name: "before-input" }), index.h("div", { key: '07be430ad207b6023ee969b7ad290d4946f4b6fe', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '69978ac5971a25cc8c0515250d741ac8a658c3bd', name: "leading-input" }), index.h("input", { key: '284f8da710438e470a26541b7cf72f89730ef3ab', id: this.inputId, ref: e => (this.inputElement = e), placeholder: this.placeholder, name: this.name, type: "number", autofocus: this.autofocus, required: this.required, max: this.max, min: this.min, step: this.step, value: this.value, disabled: this.disabled, readOnly: this.readonly, onInput: this.handleInput }), index.h("slot", { key: 'd028cd632cff77f592429e97a81a1d45aeec621d', name: "trailing-input" }), this.error && (index.h("nv-icon", { key: '7de629b71971559c647ba4ad4885815124bb63b3', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: '135e609c2e568174db3503633f389c70a2fceaba', name: "circle-check", class: "validation", size: "md" })), index.h("div", { key: '17a952157f55ff65911d852a4274de5db4241508', class: "stepper" }, index.h("nv-iconbutton", { key: '33d0412ea6ed883d92b64363b404628d610e2339', size: "md", name: "minus", emphasis: "lower", onClick: this.handleMinus, disabled: this.isMinValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }), index.h("nv-iconbutton", { key: '68bf536a5fe5bb0b3c2c3bd5508324c050cb8764', size: "md", name: "plus", emphasis: "lower", onClick: this.handlePlus, disabled: this.isMaxValueReached(), onMouseDown: this.preventSelection, tabindex: "-1" }))), index.h("slot", { key: '3922a559b4ca954bee9caea379c940e7b132f65f', name: "after-input" })), (this.description ||
|
|
119
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '8844bf48e0251717549d4e0079370fe2f590c616', class: "description" }, index.h("slot", { key: 'f35c77ffa2f01a66d72ef75a65c5c634b14bbdbc', name: "description" }, this.description))), (this.errorDescription ||
|
|
120
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'ce407c77dd30a235c7691727480c911ad6128392', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '7ffb85e03e5a9a949f022398537c74a812b8a12f', name: "error-description" }, this.errorDescription)))));
|
|
121
121
|
}
|
|
122
122
|
static get formAssociated() { return true; }
|
|
123
123
|
get el() { return index.getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Cv7U-U85.js');
|
|
4
4
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -106,9 +106,9 @@ const NvFieldpassword = class {
|
|
|
106
106
|
/****************************************************************************/
|
|
107
107
|
//#region RENDER
|
|
108
108
|
render() {
|
|
109
|
-
return (index.h(index.Host, { key: '
|
|
110
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
111
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
109
|
+
return (index.h(index.Host, { key: 'b8d142f5a35087f977437af4d2094783e455d9a0' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'f26d2c14ee03d1ef80fe263a1849c0da03a39a8c', htmlFor: this.inputId }, index.h("slot", { key: '13dfa9e681e1b5a7244e7debc7d1c1af36bedd37', name: "label" }, this.label))), index.h("div", { key: '5a01c9cc4573543e0d6633f9b8fadfa1ad6b066a', class: "input-wrapper" }, index.h("slot", { key: '2ff066ad5da2d3fe0885ccc1a0c97f9817ff4bbe', name: "before-input" }), index.h("div", { key: '429535a2b55ea4af5374067948f5be1d16898694', class: "input-container", onClick: this.handleInputContainerClick }, index.h("slot", { key: '00d8fa3cd0e8af41f1b9c46cefc256a29187db9d', name: "leading-input" }), index.h("input", { key: '7aa5db4e17d62e3a9c10e8b5e2dabe224033b2da', id: this.inputId, ref: e => (this.inputElement = e), autofocus: this.autofocus, 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.success || this.error) && (index.h("nv-icon", { key: '0c919def4c580387d87a2f500a663f4dba5874cb', name: this.success ? 'circle-check' : 'alert-circle', class: "validation", size: "md" })), !this.hidePasswordIcon && (index.h("nv-iconbutton", { key: '2b020de565c3311431c83c68a773731055c1c6c5', name: this.showPasswordState ? 'eye' : 'eye-off', size: "md", emphasis: "lower", onClick: this.togglePasswordVisibility, "aria-label": this.showPasswordState ? 'Hide password' : 'Show password', "aria-pressed": this.showPasswordState.toString() }))), index.h("slot", { key: '938de4d9c513e3aef3de1e9a108e69558843b466', name: "after-input" })), (this.description ||
|
|
110
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '6150e4be7c79bf10a1a2db3b14334c4fd9d2396c', class: "description" }, index.h("slot", { key: 'de557936e4ed9e0798cbbb95f832fa6a831d63a9', name: "description" }, this.description))), (this.errorDescription ||
|
|
111
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '74e43aa5f463f8156d44d261d5641c0aafccc5fc', hidden: !this.error, class: "error-description" }, index.h("slot", { key: '4956c95a870964a712524fb30d26e9fd500edef8', name: "error-description" }, this.errorDescription)))));
|
|
112
112
|
}
|
|
113
113
|
static get formAssociated() { return true; }
|
|
114
114
|
get el() { return index.getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Cv7U-U85.js');
|
|
4
4
|
var clsx297c1ffe = require('./clsx-297c1ffe-BtxeOLZW.js');
|
|
5
5
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
6
6
|
require('react');
|
|
@@ -87,9 +87,9 @@ const NvFieldradio = class {
|
|
|
87
87
|
/****************************************************************************/
|
|
88
88
|
//#region RENDER
|
|
89
89
|
render() {
|
|
90
|
-
return (index.h(index.Host, { key: '
|
|
91
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
92
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
90
|
+
return (index.h(index.Host, { key: '5721fd4ffd6d8b1392e65d0b8eaea4dea241be63', class: clsx297c1ffe.clsx(this.labelPlacement === 'before' && 'label-placement-before', this.error && 'error') }, index.h("input", { key: 'c54d8952edb57e34016a85ba2b6b9c7fc2a20a37', type: "radio", id: this.inputId, name: this.name, autofocus: this.autofocus, autocomplete: "off", value: this.value, checked: this.checked, disabled: this.disabled }), index.h("div", { key: 'e80c6c12fbf461776822185109e05aea5a6c954b', class: "text-container" }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '0f89b274c7ee7ea7d2e3116a004575176d044b5b', htmlFor: this.inputId }, index.h("slot", { key: '04b04fbc8ad5a199def48e728c74f13e7230414d', name: "label" }, this.label))), (this.description ||
|
|
91
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'e5c5048c50d0089393a29f12eb09f0ae26aedcfc', class: "description" }, index.h("slot", { key: '6902044f273d508a79a66a3f185fc4a9ac48e94f', name: "description" }, this.description))), (this.errorDescription ||
|
|
92
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '8d388b64deccd2f398485dfa0b83d70b8c50ae47', hidden: !this.error, class: "error-description" }, index.h("slot", { key: 'c5237272b97c754d2745eb62a85519f2c14dfb27', name: "error-description" }, this.errorDescription))))));
|
|
93
93
|
}
|
|
94
94
|
static get formAssociated() { return true; }
|
|
95
95
|
get el() { return index.getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Cv7U-U85.js');
|
|
4
4
|
var v4A79185f4 = require('./v4-a79185f4-2n0dOd_Y.js');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -347,13 +347,13 @@ const NvFieldselect = class {
|
|
|
347
347
|
* @returns {HTMLStencilElement} The HTML element to render.
|
|
348
348
|
*/
|
|
349
349
|
render() {
|
|
350
|
-
return (index.h(index.Host, { key: '
|
|
350
|
+
return (index.h(index.Host, { key: 'ff869c177289342a39ae292a530359af940a5669' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: '10815f70059de9b1774ccc26b69d441d250e1833', htmlFor: this.inputId }, index.h("slot", { key: 'afe78cd3671151060fd1e2a37b77c164767908fa', name: "label" }, this.label))), index.h("div", { key: '064d8f512bc5f11831096d3a092afb00dcfeb1bc', class: "select-wrapper" }, index.h("slot", { key: 'c12d375bc5a558d25f1eb34343e2ad5fce784558', name: "before-input" }), index.h("div", { key: 'ffb39cfc0444edc49a4e2b6318990085009d7598', class: "select-container", onClick: this.handleSelectContainerClick }, index.h("slot", { key: 'd5fccac0e92fe0553b8478a6f5dc9be4591e8c23', name: "leading-input" }), this.internalReadonly && (index.h("input", { key: '94dc05d08de8120c78fa140df5eb3adc09ce97da', 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
|
|
351
351
|
? `${this.inputId}-error`
|
|
352
|
-
: `${this.inputId}-description` })), index.h("select", { key: '
|
|
352
|
+
: `${this.inputId}-description` })), index.h("select", { key: '85ffba58429aaa393cc9178e0866a61f85d92103', id: this.inputId, ref: el => (this.selectElement = el), name: this.name, autofocus: this.autofocus, disabled: this.disabled, required: this.required, multiple: this.multiple, onChange: this.handleSelectChange, class: this.internalReadonly ? 'hidden' : '', "aria-label": this.label, "aria-describedby": this.error
|
|
353
353
|
? `${this.inputId}-error`
|
|
354
|
-
: `${this.inputId}-description` }, this.parsedOptions.length > 0 ? (this.parsedOptions.map(option => (index.h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (index.h("slot", null))), index.h("div", { key: '
|
|
355
|
-
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: '
|
|
356
|
-
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '
|
|
354
|
+
: `${this.inputId}-description` }, this.parsedOptions.length > 0 ? (this.parsedOptions.map(option => (index.h("option", { value: option.value, selected: option.selected, disabled: option.disabled }, option.label)))) : (index.h("slot", null))), index.h("div", { key: '694b0306ddaf671faea9dd863bb7f2917b567ffb', class: "select-icons" }, this.error && (index.h("nv-icon", { key: '4f86b0916dcbfefb24af5e5e2c0ca009ece6193b', name: "alert-circle", class: "validation", size: "md" })), this.success && (index.h("nv-icon", { key: 'f99ba37d4a70b7c352b4abb0be0b5eb85b4cc947', name: "circle-check", class: "validation", size: "md" })), !this.multiple && (index.h("nv-iconbutton", { key: 'b152a3b110b0f780b29adcf1efb4aadf98cf81be', name: "chevron-down", size: "md", emphasis: "lower", tabindex: -1 })))), index.h("slot", { key: '63c6076165bae5d36732179c4a761d5b381076b5', name: "after-input" })), (this.description ||
|
|
355
|
+
this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'dd3e41b62290c580e050eb5a4742aabc7395cbda', class: "description", id: `${this.inputId}-description` }, index.h("slot", { key: '87bedab511a8b3d07d6616e4937342b6d272c5f3', name: "description" }, this.description))), (this.errorDescription ||
|
|
356
|
+
this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: 'd4cf69f5f2446fbbf8ed36910d89c3aa7ac2c826', class: "error-description", id: `${this.inputId}-error` }, index.h("slot", { key: '2fc8b58658bd406af834dcad378b3b00aca40b22', name: "error-description" }, this.errorDescription)))));
|
|
357
357
|
}
|
|
358
358
|
static get formAssociated() { return true; }
|
|
359
359
|
get el() { return index.getElement(this); }
|