@nanoporetech-digital/components 7.9.0 → 7.9.2
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-checkbox.cjs.entry.js +8 -4
- package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-datalist_3.cjs.entry.js +7 -6
- package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +9 -9
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.js +8 -4
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/datalist/datalist.js +9 -6
- package/dist/collection/components/datalist/datalist.js.map +1 -1
- package/dist/collection/components/select/select.js +9 -9
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/components/datalist.js +8 -6
- package/dist/components/datalist.js.map +1 -1
- package/dist/components/nano-checkbox.js +8 -4
- package/dist/components/nano-checkbox.js.map +1 -1
- package/dist/components/select.js +9 -9
- package/dist/components/select.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-checkbox.entry.js +8 -4
- package/dist/esm/nano-checkbox.entry.js.map +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-datalist_3.entry.js +7 -6
- package/dist/esm/nano-datalist_3.entry.js.map +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +9 -9
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/nano-components/nano-checkbox.entry.js +1 -1
- package/dist/nano-components/nano-checkbox.entry.js.map +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/nano-datalist_3.entry.js +1 -1
- package/dist/nano-components/nano-datalist_3.entry.js.map +1 -1
- package/dist/nano-components/nano-global-nav-user-profile_3.entry.js +1 -1
- package/dist/nano-components/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/docs-json.json +1 -1
- package/hydrate/index.js +24 -19
- package/hydrate/index.mjs +24 -19
- package/package.json +1 -1
package/hydrate/index.js
CHANGED
@@ -7991,14 +7991,18 @@ class Checkbox {
|
|
7991
7991
|
if (!this.input)
|
7992
7992
|
return;
|
7993
7993
|
this.input.checked = this.checked;
|
7994
|
-
if (this.inputType === 'radio' &&
|
7994
|
+
if (this.inputType === 'radio' &&
|
7995
|
+
this.name &&
|
7996
|
+
this.checked &&
|
7997
|
+
this.host.isConnected) {
|
7995
7998
|
const form = this.host.closest('form');
|
7999
|
+
const root = this.host.getRootNode();
|
7996
8000
|
let ctrls;
|
7997
8001
|
if (form) {
|
7998
8002
|
ctrls = Array.from(form.querySelectorAll(`${transformTag('nano-checkbox')}[name="${this.name}"]`));
|
7999
8003
|
}
|
8000
8004
|
else {
|
8001
|
-
ctrls = Array.from(
|
8005
|
+
ctrls = Array.from(root.querySelectorAll(`${transformTag('nano-checkbox')}[name="${this.name}"]`))?.filter((radio) => !radio.closest('form'));
|
8002
8006
|
}
|
8003
8007
|
ctrls.map((el) => {
|
8004
8008
|
if (el !== this.host)
|
@@ -8177,14 +8181,14 @@ class Checkbox {
|
|
8177
8181
|
}
|
8178
8182
|
render() {
|
8179
8183
|
const labelId = this.inputId + '-lbl';
|
8180
|
-
return (h(Host, { key: '
|
8184
|
+
return (h(Host, { key: '92eaee0287da5164176c1893add5d48ff518153a', class: { ...createColorClasses(this.color), 'nano-checkbox': true } }, h("label", { key: '5082a3b8114162d5b52e9f24abe031f8796665e2', class: {
|
8181
8185
|
nanocb: true,
|
8182
8186
|
'nanocb--checked': this.checked,
|
8183
8187
|
'nanocb--invalid': this.invalid,
|
8184
8188
|
'nanocb--disabled': this.disabled,
|
8185
8189
|
'nanocb--focused': this.hasFocus,
|
8186
8190
|
'nanocb--indeterminate': this.indeterminate,
|
8187
|
-
}, htmlFor: this.inputId }, h("input", { key: '
|
8191
|
+
}, htmlFor: this.inputId }, h("input", { key: '2b91ea2ac18ac260710202040db3f7a4574a1922', type: this.inputType, name: this.name, form: this.form, required: this.required, checked: this.checked, disabled: this.disabled, value: this.value, "aria-labelledby": labelId, onBlur: this.handleBlur, onFocus: this.handleFocus, onChange: this.handleChange, ref: (input) => (this.input = input), id: this.inputId, onInvalid: this.handleInvalid }), h("span", { key: '0594a16034577181d4f3b1801b08d1761bd4cfe8', class: 'nanocb__input nanocb__input--' + this.type }), h("div", { key: '051e89cbd5aeabad7f6e70369a3f9316f86eb8f8', id: labelId, class: 'nanocb__label nanocb__label--' + this.type }, this.label && !!this.label.length && h("span", { key: 'ddb4067806f185c0d564a0a54c7642a57313e482' }, this.label), h("span", { key: '745cbff6863337008827893a7b451c4a31fb1e91', hidden: this.label && !!this.label.length }, h("slot", { key: '023db905814a76b115e2779d717932125c0bff4a' }))))));
|
8188
8192
|
}
|
8189
8193
|
static get watchers() { return {
|
8190
8194
|
"checked": ["handleCheckedChange"],
|
@@ -8724,7 +8728,7 @@ class DataList {
|
|
8724
8728
|
// forceUpdate(this.host);
|
8725
8729
|
}
|
8726
8730
|
watchTypeChange() {
|
8727
|
-
if (!this.connectedInput)
|
8731
|
+
if (!this.connectedInput || this.disabled)
|
8728
8732
|
return;
|
8729
8733
|
let dwConfig = { closeOnSelect: false };
|
8730
8734
|
let autocompleteType = 'both';
|
@@ -9067,18 +9071,18 @@ class DataList {
|
|
9067
9071
|
this.removeEventListeners(this.connectedInput);
|
9068
9072
|
}
|
9069
9073
|
render() {
|
9070
|
-
return (h(Host, { key: '
|
9074
|
+
return (h(Host, { key: 'e6a6afd64373143835f8e12f9349e839abaf63e1', class: "nano-datalist", role: this.actvOptEles.length ? 'listbox' : undefined, "aria-owns": this.optionIds.length ? this.optionIds.join(' ') : undefined, "aria-label": this.optionIds.length
|
9071
9075
|
? 'Select options from the list below'
|
9072
|
-
: undefined }, h("nano-dropdown", { key: '
|
9076
|
+
: undefined }, h("nano-dropdown", { key: 'bd1a92afc347e6e3a9d63695bd56fb76b3a06464', ...this.dropDownConfig, ref: (el) => (this.nanoDropdown = el), dialogTitle: "Select options from the list below", class: {
|
9073
9077
|
dlist__dropdown: true,
|
9074
9078
|
'dlist--isfiltered': this.isFiltered,
|
9075
|
-
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide, role: "group" }, h("nano-menu", { key: '
|
9079
|
+
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide, role: "group" }, h("nano-menu", { key: '846d438e2314582af9a962289ab0f908857083fa', hidden: !this.actvOptEles.length, type: "listbox", label: this.inputLabel ? this.inputLabel.textContent : undefined, class: {
|
9076
9080
|
dlist__menu: true,
|
9077
9081
|
'dlist__menu--open': this.dropwdownOpen,
|
9078
|
-
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown, ref: (el) => (this.listBox = el) }, h("slot", { key: '
|
9082
|
+
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown, ref: (el) => (this.listBox = el) }, h("slot", { key: 'f306217f59daac3e67e41bd5dbbf2a3681d56007', name: "list-top" }), h("slot", { key: '0174164d6761691413ead34af1436ee370849d98' }), h("slot", { key: 'fdcaea628c1920017a4d250b125769d422d306dc', name: "internal-opts" }), h("slot", { key: 'bcb453282e86a98805fa0c8f357b389110764252', name: "list-bottom" })), h("nano-menu", { key: '61b91937f773707bd6369649d5761951459b7991', type: "listbox", label: "No results found", hidden: !!this.actvOptEles.length, class: {
|
9079
9083
|
dlist__menu: true,
|
9080
9084
|
'dlist__menu--open': this.dropwdownOpen,
|
9081
|
-
} }, h("slot", { key: '
|
9085
|
+
} }, h("slot", { key: '433a4643f759e5391b13ee757628c6f196cb8060', name: "no-result" })), !!this.actvOptEles && (h("div", { key: 'caafff3ec17cba31fdc5092d96da166f64541776', class: "dlist__status" }, this.actvOptEles.length, " result", this.actvOptEles.length > 1 ? 's' : '', " available.")))));
|
9082
9086
|
}
|
9083
9087
|
static get watchers() { return {
|
9084
9088
|
"open": ["openWatcher"],
|
@@ -9086,6 +9090,7 @@ class DataList {
|
|
9086
9090
|
"options": ["handleOptionsChange"],
|
9087
9091
|
"type": ["watchTypeChange"],
|
9088
9092
|
"connectedInput": ["watchTypeChange", "manageInputEvents"],
|
9093
|
+
"disabled": ["watchTypeChange"],
|
9089
9094
|
"selected": ["watchActvOptChange"],
|
9090
9095
|
"actvOptEles": ["watchActvOptChange", "manageCanOpen", "fireActiveOptsEvent"],
|
9091
9096
|
"hasNoResult": ["manageCanOpen"],
|
@@ -22760,6 +22765,8 @@ class Select {
|
|
22760
22765
|
this.inputSearchVal = '';
|
22761
22766
|
};
|
22762
22767
|
removeValue = (toFind) => {
|
22768
|
+
if (this.readonly || this.disabled)
|
22769
|
+
return;
|
22763
22770
|
if (!this.multiple || !this.value.length)
|
22764
22771
|
return;
|
22765
22772
|
if (!toFind)
|
@@ -22992,7 +22999,7 @@ class Select {
|
|
22992
22999
|
disabled,
|
22993
23000
|
clearControl: this.clearSelect,
|
22994
23001
|
}))(this);
|
22995
|
-
return (h(Host, { key: '
|
23002
|
+
return (h(Host, { key: 'a8b87fdaaa377377dc9a9c3a6b4937ae854f43bb', type: this.multiple ? 'select-multiple' : 'select-one', "aria-disabled": this.disabled ? 'true' : null, class: {
|
22996
23003
|
...createColorClasses(this.color),
|
22997
23004
|
'has-value': !!this.value.length || !!this.inputSearchVal.length,
|
22998
23005
|
'has-focus': this.hasFocus,
|
@@ -23004,15 +23011,13 @@ class Select {
|
|
23004
23011
|
'has-clr-btn': this.clearSelect,
|
23005
23012
|
masked: this.mask,
|
23006
23013
|
'nano-select': true,
|
23007
|
-
} }, h(FormControlWrap, { key: '
|
23008
|
-
this.mask && (h("div", { key: '
|
23009
|
-
h("input", { key: '
|
23010
|
-
])),
|
23014
|
+
} }, h(FormControlWrap, { key: '6bb32ca83cc5d25f65510f938dbe79b43fa5c108', ...wrapOptions }, h(FormControl, { key: 'c66fc73cb316399ecd7cf26eb1f34d30b40b4692', ...controlOptions, onClearText: this.clearSelectValue, control: this.el, ref: (el) => (this.selectWrap = el), endValueSlot: h("slot", { name: "down-arrow" }, h("nano-icon", { slot: "value-end", name: "light/chevron-down" })) }, this.multiple && (h("div", { key: '5b26becd4bea50f2bbbd6545490517520bf54bf2', class: "select__multi-wrap select" }, this.multipleValues(labelId, moreId, helperEndId))), !this.multiple && [
|
23015
|
+
this.mask && (h("div", { key: 'b01c76ac8e10f63b7bba076799fb70583f8f0b8f', class: "select__mask" }, this.getLabel(this.value))),
|
23016
|
+
h("input", { key: 'f030e89b72b594dde16b701c9ca07c65542162b2', id: this.selectId, class: "select__native-input", ref: (input) => (this.inputCtrl = input), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, form: this.form, placeholder: this.placeholder, readonly: true, required: this.required, value: this.getLabel(this.value), onFocus: this.onFocus }),
|
23017
|
+
])), h("nano-datalist", { key: '74dbc317d620eb13e4b3b82559fb8f19f6b3bda5', disabled: this.disabled || this.readonly, onNanoOptionsUpdated: this.setOptions, ref: (el) => (this.datalist = el), selected: this.valArray, type: this.multiple ? 'selctMulti' : 'select', onNanoSelect: this.setValue, onNanoDeselect: (e) => {
|
23011
23018
|
e.preventDefault();
|
23012
23019
|
this.removeValue(e.detail.value);
|
23013
|
-
}, options: this._options.length ? this._options : undefined }, this.allowCustomValues &&
|
23014
|
-
this.multiple &&
|
23015
|
-
!!this.inputSearchVal && (h("nano-option", { key: '8c051e25608cb6790bde692084c965bc064db0fa', slot: "list-top", value: this.inputSearchVal, selected: false, label: this.inputSearchVal, onNanoSelect: () => this.inputCtrl.focus() }, h("span", { key: '8f8b1abae976d352d71f3e74c9636ffc10800326', slot: "check-icon" }), "Add '", this.inputSearchVal, "'")), h("slot", { key: '139819ef432722a337fe9c9bb2c3713f8e1d4130' }))), h("select", { key: '15f20b80edea9e26b60c3c6d494d928e4cc479cc', id: this.selectId + '-hidden', class: "select__native-ctrl", ref: (select) => (this.nativeSelect = select), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, form: this.form, multiple: this.multiple, name: this.name, required: this.required, onInvalid: this.handleInvalid }, this.allowCustomValues &&
|
23020
|
+
}, options: this._options.length ? this._options : undefined }, this.allowCustomValues && this.multiple && !!this.inputSearchVal && (h("nano-option", { key: '3aba3b3160c0ab202782d54fbdb5c8fba8575319', slot: "list-top", value: this.inputSearchVal, selected: false, label: this.inputSearchVal, onNanoSelect: () => this.inputCtrl.focus() }, h("span", { key: 'fee57aeb5bcce9ad2c30d4e208c11cf7aaebabc6', slot: "check-icon" }), "Add '", this.inputSearchVal, "'")), h("slot", { key: '922baf9809f37affb5c956f74b85bf727c4e40f4' })), h("select", { key: '9cdfe75682e7c7f4e9cd56123f07f8c195d2d47c', id: this.selectId + '-hidden', class: "select__native-ctrl", ref: (select) => (this.nativeSelect = select), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, form: this.form, multiple: this.multiple, name: this.name, required: this.required, onInvalid: this.handleInvalid }, this.allowCustomValues &&
|
23016
23021
|
this.valArray.map((val) => {
|
23017
23022
|
return (h("option", { value: val, selected: true }, val));
|
23018
23023
|
}), !this.allowCustomValues &&
|
@@ -23021,7 +23026,7 @@ class Select {
|
|
23021
23026
|
}))));
|
23022
23027
|
}
|
23023
23028
|
multipleValues(labelId, moreId, helperEndId) {
|
23024
|
-
const input = (h("input", { class: "select__multi-input", id: this.selectId, ref: (input) => (this.inputCtrl = input),
|
23029
|
+
const input = (h("input", { class: "select__multi-input", id: this.selectId, ref: (input) => (this.inputCtrl = input), readonly: this.readonly, disabled: this.disabled, autoFocus: this.autofocus, autocomplete: "off", onKeyDown: this.handleDocumentKeyDown, onInput: this.onMultiInput, value: this.inputSearchVal, onTouchStart: this.onClick, onMouseDown: this.onClick, onFocus: this.onFocus, placeholder: this.placeholder && !this.value.length ? this.placeholder : '', "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId }));
|
23025
23030
|
if (!this.value.length)
|
23026
23031
|
return input;
|
23027
23032
|
const toReturn = [];
|
package/hydrate/index.mjs
CHANGED
@@ -7987,14 +7987,18 @@ class Checkbox {
|
|
7987
7987
|
if (!this.input)
|
7988
7988
|
return;
|
7989
7989
|
this.input.checked = this.checked;
|
7990
|
-
if (this.inputType === 'radio' &&
|
7990
|
+
if (this.inputType === 'radio' &&
|
7991
|
+
this.name &&
|
7992
|
+
this.checked &&
|
7993
|
+
this.host.isConnected) {
|
7991
7994
|
const form = this.host.closest('form');
|
7995
|
+
const root = this.host.getRootNode();
|
7992
7996
|
let ctrls;
|
7993
7997
|
if (form) {
|
7994
7998
|
ctrls = Array.from(form.querySelectorAll(`${transformTag('nano-checkbox')}[name="${this.name}"]`));
|
7995
7999
|
}
|
7996
8000
|
else {
|
7997
|
-
ctrls = Array.from(
|
8001
|
+
ctrls = Array.from(root.querySelectorAll(`${transformTag('nano-checkbox')}[name="${this.name}"]`))?.filter((radio) => !radio.closest('form'));
|
7998
8002
|
}
|
7999
8003
|
ctrls.map((el) => {
|
8000
8004
|
if (el !== this.host)
|
@@ -8173,14 +8177,14 @@ class Checkbox {
|
|
8173
8177
|
}
|
8174
8178
|
render() {
|
8175
8179
|
const labelId = this.inputId + '-lbl';
|
8176
|
-
return (h(Host, { key: '
|
8180
|
+
return (h(Host, { key: '92eaee0287da5164176c1893add5d48ff518153a', class: { ...createColorClasses(this.color), 'nano-checkbox': true } }, h("label", { key: '5082a3b8114162d5b52e9f24abe031f8796665e2', class: {
|
8177
8181
|
nanocb: true,
|
8178
8182
|
'nanocb--checked': this.checked,
|
8179
8183
|
'nanocb--invalid': this.invalid,
|
8180
8184
|
'nanocb--disabled': this.disabled,
|
8181
8185
|
'nanocb--focused': this.hasFocus,
|
8182
8186
|
'nanocb--indeterminate': this.indeterminate,
|
8183
|
-
}, htmlFor: this.inputId }, h("input", { key: '
|
8187
|
+
}, htmlFor: this.inputId }, h("input", { key: '2b91ea2ac18ac260710202040db3f7a4574a1922', type: this.inputType, name: this.name, form: this.form, required: this.required, checked: this.checked, disabled: this.disabled, value: this.value, "aria-labelledby": labelId, onBlur: this.handleBlur, onFocus: this.handleFocus, onChange: this.handleChange, ref: (input) => (this.input = input), id: this.inputId, onInvalid: this.handleInvalid }), h("span", { key: '0594a16034577181d4f3b1801b08d1761bd4cfe8', class: 'nanocb__input nanocb__input--' + this.type }), h("div", { key: '051e89cbd5aeabad7f6e70369a3f9316f86eb8f8', id: labelId, class: 'nanocb__label nanocb__label--' + this.type }, this.label && !!this.label.length && h("span", { key: 'ddb4067806f185c0d564a0a54c7642a57313e482' }, this.label), h("span", { key: '745cbff6863337008827893a7b451c4a31fb1e91', hidden: this.label && !!this.label.length }, h("slot", { key: '023db905814a76b115e2779d717932125c0bff4a' }))))));
|
8184
8188
|
}
|
8185
8189
|
static get watchers() { return {
|
8186
8190
|
"checked": ["handleCheckedChange"],
|
@@ -8720,7 +8724,7 @@ class DataList {
|
|
8720
8724
|
// forceUpdate(this.host);
|
8721
8725
|
}
|
8722
8726
|
watchTypeChange() {
|
8723
|
-
if (!this.connectedInput)
|
8727
|
+
if (!this.connectedInput || this.disabled)
|
8724
8728
|
return;
|
8725
8729
|
let dwConfig = { closeOnSelect: false };
|
8726
8730
|
let autocompleteType = 'both';
|
@@ -9063,18 +9067,18 @@ class DataList {
|
|
9063
9067
|
this.removeEventListeners(this.connectedInput);
|
9064
9068
|
}
|
9065
9069
|
render() {
|
9066
|
-
return (h(Host, { key: '
|
9070
|
+
return (h(Host, { key: 'e6a6afd64373143835f8e12f9349e839abaf63e1', class: "nano-datalist", role: this.actvOptEles.length ? 'listbox' : undefined, "aria-owns": this.optionIds.length ? this.optionIds.join(' ') : undefined, "aria-label": this.optionIds.length
|
9067
9071
|
? 'Select options from the list below'
|
9068
|
-
: undefined }, h("nano-dropdown", { key: '
|
9072
|
+
: undefined }, h("nano-dropdown", { key: 'bd1a92afc347e6e3a9d63695bd56fb76b3a06464', ...this.dropDownConfig, ref: (el) => (this.nanoDropdown = el), dialogTitle: "Select options from the list below", class: {
|
9069
9073
|
dlist__dropdown: true,
|
9070
9074
|
'dlist--isfiltered': this.isFiltered,
|
9071
|
-
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide, role: "group" }, h("nano-menu", { key: '
|
9075
|
+
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide, role: "group" }, h("nano-menu", { key: '846d438e2314582af9a962289ab0f908857083fa', hidden: !this.actvOptEles.length, type: "listbox", label: this.inputLabel ? this.inputLabel.textContent : undefined, class: {
|
9072
9076
|
dlist__menu: true,
|
9073
9077
|
'dlist__menu--open': this.dropwdownOpen,
|
9074
|
-
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown, ref: (el) => (this.listBox = el) }, h("slot", { key: '
|
9078
|
+
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown, ref: (el) => (this.listBox = el) }, h("slot", { key: 'f306217f59daac3e67e41bd5dbbf2a3681d56007', name: "list-top" }), h("slot", { key: '0174164d6761691413ead34af1436ee370849d98' }), h("slot", { key: 'fdcaea628c1920017a4d250b125769d422d306dc', name: "internal-opts" }), h("slot", { key: 'bcb453282e86a98805fa0c8f357b389110764252', name: "list-bottom" })), h("nano-menu", { key: '61b91937f773707bd6369649d5761951459b7991', type: "listbox", label: "No results found", hidden: !!this.actvOptEles.length, class: {
|
9075
9079
|
dlist__menu: true,
|
9076
9080
|
'dlist__menu--open': this.dropwdownOpen,
|
9077
|
-
} }, h("slot", { key: '
|
9081
|
+
} }, h("slot", { key: '433a4643f759e5391b13ee757628c6f196cb8060', name: "no-result" })), !!this.actvOptEles && (h("div", { key: 'caafff3ec17cba31fdc5092d96da166f64541776', class: "dlist__status" }, this.actvOptEles.length, " result", this.actvOptEles.length > 1 ? 's' : '', " available.")))));
|
9078
9082
|
}
|
9079
9083
|
static get watchers() { return {
|
9080
9084
|
"open": ["openWatcher"],
|
@@ -9082,6 +9086,7 @@ class DataList {
|
|
9082
9086
|
"options": ["handleOptionsChange"],
|
9083
9087
|
"type": ["watchTypeChange"],
|
9084
9088
|
"connectedInput": ["watchTypeChange", "manageInputEvents"],
|
9089
|
+
"disabled": ["watchTypeChange"],
|
9085
9090
|
"selected": ["watchActvOptChange"],
|
9086
9091
|
"actvOptEles": ["watchActvOptChange", "manageCanOpen", "fireActiveOptsEvent"],
|
9087
9092
|
"hasNoResult": ["manageCanOpen"],
|
@@ -22756,6 +22761,8 @@ class Select {
|
|
22756
22761
|
this.inputSearchVal = '';
|
22757
22762
|
};
|
22758
22763
|
removeValue = (toFind) => {
|
22764
|
+
if (this.readonly || this.disabled)
|
22765
|
+
return;
|
22759
22766
|
if (!this.multiple || !this.value.length)
|
22760
22767
|
return;
|
22761
22768
|
if (!toFind)
|
@@ -22988,7 +22995,7 @@ class Select {
|
|
22988
22995
|
disabled,
|
22989
22996
|
clearControl: this.clearSelect,
|
22990
22997
|
}))(this);
|
22991
|
-
return (h(Host, { key: '
|
22998
|
+
return (h(Host, { key: 'a8b87fdaaa377377dc9a9c3a6b4937ae854f43bb', type: this.multiple ? 'select-multiple' : 'select-one', "aria-disabled": this.disabled ? 'true' : null, class: {
|
22992
22999
|
...createColorClasses(this.color),
|
22993
23000
|
'has-value': !!this.value.length || !!this.inputSearchVal.length,
|
22994
23001
|
'has-focus': this.hasFocus,
|
@@ -23000,15 +23007,13 @@ class Select {
|
|
23000
23007
|
'has-clr-btn': this.clearSelect,
|
23001
23008
|
masked: this.mask,
|
23002
23009
|
'nano-select': true,
|
23003
|
-
} }, h(FormControlWrap, { key: '
|
23004
|
-
this.mask && (h("div", { key: '
|
23005
|
-
h("input", { key: '
|
23006
|
-
])),
|
23010
|
+
} }, h(FormControlWrap, { key: '6bb32ca83cc5d25f65510f938dbe79b43fa5c108', ...wrapOptions }, h(FormControl, { key: 'c66fc73cb316399ecd7cf26eb1f34d30b40b4692', ...controlOptions, onClearText: this.clearSelectValue, control: this.el, ref: (el) => (this.selectWrap = el), endValueSlot: h("slot", { name: "down-arrow" }, h("nano-icon", { slot: "value-end", name: "light/chevron-down" })) }, this.multiple && (h("div", { key: '5b26becd4bea50f2bbbd6545490517520bf54bf2', class: "select__multi-wrap select" }, this.multipleValues(labelId, moreId, helperEndId))), !this.multiple && [
|
23011
|
+
this.mask && (h("div", { key: 'b01c76ac8e10f63b7bba076799fb70583f8f0b8f', class: "select__mask" }, this.getLabel(this.value))),
|
23012
|
+
h("input", { key: 'f030e89b72b594dde16b701c9ca07c65542162b2', id: this.selectId, class: "select__native-input", ref: (input) => (this.inputCtrl = input), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, form: this.form, placeholder: this.placeholder, readonly: true, required: this.required, value: this.getLabel(this.value), onFocus: this.onFocus }),
|
23013
|
+
])), h("nano-datalist", { key: '74dbc317d620eb13e4b3b82559fb8f19f6b3bda5', disabled: this.disabled || this.readonly, onNanoOptionsUpdated: this.setOptions, ref: (el) => (this.datalist = el), selected: this.valArray, type: this.multiple ? 'selctMulti' : 'select', onNanoSelect: this.setValue, onNanoDeselect: (e) => {
|
23007
23014
|
e.preventDefault();
|
23008
23015
|
this.removeValue(e.detail.value);
|
23009
|
-
}, options: this._options.length ? this._options : undefined }, this.allowCustomValues &&
|
23010
|
-
this.multiple &&
|
23011
|
-
!!this.inputSearchVal && (h("nano-option", { key: '8c051e25608cb6790bde692084c965bc064db0fa', slot: "list-top", value: this.inputSearchVal, selected: false, label: this.inputSearchVal, onNanoSelect: () => this.inputCtrl.focus() }, h("span", { key: '8f8b1abae976d352d71f3e74c9636ffc10800326', slot: "check-icon" }), "Add '", this.inputSearchVal, "'")), h("slot", { key: '139819ef432722a337fe9c9bb2c3713f8e1d4130' }))), h("select", { key: '15f20b80edea9e26b60c3c6d494d928e4cc479cc', id: this.selectId + '-hidden', class: "select__native-ctrl", ref: (select) => (this.nativeSelect = select), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, form: this.form, multiple: this.multiple, name: this.name, required: this.required, onInvalid: this.handleInvalid }, this.allowCustomValues &&
|
23016
|
+
}, options: this._options.length ? this._options : undefined }, this.allowCustomValues && this.multiple && !!this.inputSearchVal && (h("nano-option", { key: '3aba3b3160c0ab202782d54fbdb5c8fba8575319', slot: "list-top", value: this.inputSearchVal, selected: false, label: this.inputSearchVal, onNanoSelect: () => this.inputCtrl.focus() }, h("span", { key: 'fee57aeb5bcce9ad2c30d4e208c11cf7aaebabc6', slot: "check-icon" }), "Add '", this.inputSearchVal, "'")), h("slot", { key: '922baf9809f37affb5c956f74b85bf727c4e40f4' })), h("select", { key: '9cdfe75682e7c7f4e9cd56123f07f8c195d2d47c', id: this.selectId + '-hidden', class: "select__native-ctrl", ref: (select) => (this.nativeSelect = select), "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId, disabled: this.disabled, form: this.form, multiple: this.multiple, name: this.name, required: this.required, onInvalid: this.handleInvalid }, this.allowCustomValues &&
|
23012
23017
|
this.valArray.map((val) => {
|
23013
23018
|
return (h("option", { value: val, selected: true }, val));
|
23014
23019
|
}), !this.allowCustomValues &&
|
@@ -23017,7 +23022,7 @@ class Select {
|
|
23017
23022
|
}))));
|
23018
23023
|
}
|
23019
23024
|
multipleValues(labelId, moreId, helperEndId) {
|
23020
|
-
const input = (h("input", { class: "select__multi-input", id: this.selectId, ref: (input) => (this.inputCtrl = input),
|
23025
|
+
const input = (h("input", { class: "select__multi-input", id: this.selectId, ref: (input) => (this.inputCtrl = input), readonly: this.readonly, disabled: this.disabled, autoFocus: this.autofocus, autocomplete: "off", onKeyDown: this.handleDocumentKeyDown, onInput: this.onMultiInput, value: this.inputSearchVal, onTouchStart: this.onClick, onMouseDown: this.onClick, onFocus: this.onFocus, placeholder: this.placeholder && !this.value.length ? this.placeholder : '', "aria-labelledby": labelId + ' ' + moreId + ' ' + helperEndId }));
|
23021
23026
|
if (!this.value.length)
|
23022
23027
|
return input;
|
23023
23028
|
const toReturn = [];
|