@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.
Files changed (40) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/nano-checkbox.cjs.entry.js +8 -4
  3. package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
  4. package/dist/cjs/nano-components.cjs.js +1 -1
  5. package/dist/cjs/nano-datalist_3.cjs.entry.js +7 -6
  6. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  7. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +9 -9
  8. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  9. package/dist/collection/components/checkbox/checkbox.js +8 -4
  10. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  11. package/dist/collection/components/datalist/datalist.js +9 -6
  12. package/dist/collection/components/datalist/datalist.js.map +1 -1
  13. package/dist/collection/components/select/select.js +9 -9
  14. package/dist/collection/components/select/select.js.map +1 -1
  15. package/dist/components/datalist.js +8 -6
  16. package/dist/components/datalist.js.map +1 -1
  17. package/dist/components/nano-checkbox.js +8 -4
  18. package/dist/components/nano-checkbox.js.map +1 -1
  19. package/dist/components/select.js +9 -9
  20. package/dist/components/select.js.map +1 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/nano-checkbox.entry.js +8 -4
  23. package/dist/esm/nano-checkbox.entry.js.map +1 -1
  24. package/dist/esm/nano-components.js +1 -1
  25. package/dist/esm/nano-datalist_3.entry.js +7 -6
  26. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  27. package/dist/esm/nano-global-nav-user-profile_3.entry.js +9 -9
  28. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  29. package/dist/nano-components/nano-checkbox.entry.js +1 -1
  30. package/dist/nano-components/nano-checkbox.entry.js.map +1 -1
  31. package/dist/nano-components/nano-components.esm.js +1 -1
  32. package/dist/nano-components/nano-components.esm.js.map +1 -1
  33. package/dist/nano-components/nano-datalist_3.entry.js +1 -1
  34. package/dist/nano-components/nano-datalist_3.entry.js.map +1 -1
  35. package/dist/nano-components/nano-global-nav-user-profile_3.entry.js +1 -1
  36. package/dist/nano-components/nano-global-nav-user-profile_3.entry.js.map +1 -1
  37. package/docs-json.json +1 -1
  38. package/hydrate/index.js +24 -19
  39. package/hydrate/index.mjs +24 -19
  40. 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' && this.name && this.checked) {
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(document.querySelectorAll(`${transformTag('nano-checkbox')}[name="${this.name}"]`))?.filter((radio) => !radio.closest('form'));
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: '743ba20f7dc131a5df0dbef97f12682228b3a49d', class: { ...createColorClasses(this.color), 'nano-checkbox': true } }, h("label", { key: '9b0f1649bcf44a7685c3e1f91da816e7283f41e0', class: {
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: '77bac537123647d224667f66ef9d8a3ea732af9a', 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: '6ee7540510d902daaf303edcc2a677e9819d3b00', class: 'nanocb__input nanocb__input--' + this.type }), h("div", { key: '0ea0aea0ca852394ae4a3ccc6eb998e990d61f01', id: labelId, class: 'nanocb__label nanocb__label--' + this.type }, this.label && !!this.label.length && h("span", { key: 'a1b43b59fc067cba5fd22b87add0c5352666ca2f' }, this.label), h("span", { key: 'e2a1abe3e02c9a3deeda47430b164a0b0f03982b', hidden: this.label && !!this.label.length }, h("slot", { key: '30738b530444fd2051465eb6ff9098ebb06e2e88' }))))));
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: '967dd82369e855a7f9edf70cb17737d36efc1828', class: "nano-datalist", role: this.actvOptEles.length ? 'listbox' : undefined, "aria-owns": this.optionIds.length ? this.optionIds.join(' ') : undefined, "aria-label": this.optionIds.length
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: 'd98ed992c76129d5f1a1b5cb3c2a7e4c0c385118', ...this.dropDownConfig, ref: (el) => (this.nanoDropdown = el), dialogTitle: "Select options from the list below", class: {
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: 'b06ac3c64408a331819e3326fb72adfdf5c07b91', hidden: !this.actvOptEles.length, type: "listbox", label: this.inputLabel ? this.inputLabel.textContent : undefined, class: {
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: '58683fab717385e8dff20602683964327093f660', name: "list-top" }), h("slot", { key: '949fb5e02b13f878cde4d90a9848fcb18b35ea2c' }), h("slot", { key: 'ed9bccc1520dc103e1673fae32094b05245ab704', name: "internal-opts" }), h("slot", { key: 'aca33681c6282a17386c9934b93cfce6622c08e1', name: "list-bottom" })), h("nano-menu", { key: '4de595aded1e1f586a8d11d21bf6151758da9f9d', type: "listbox", label: "No results found", hidden: !!this.actvOptEles.length, class: {
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: '0da09df34253d8bd83bdd263e25f40b9075d30a7', name: "no-result" })), !!this.actvOptEles && (h("div", { key: 'ee9d3f67a82cc6a2e0c25efb0c79e031995d0587', class: "dlist__status" }, this.actvOptEles.length, " result", this.actvOptEles.length > 1 ? 's' : '', " available.")))));
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: '536c9704da65bc7e7415e679382384c076696d51', type: this.multiple ? 'select-multiple' : 'select-one', "aria-disabled": this.disabled ? 'true' : null, class: {
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: 'c7fd0db291f3362fcdfca52f443899260a284490', ...wrapOptions }, h(FormControl, { key: '9ea819ba91334497b7ef3e5fddf9308acc1aded9', ...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: 'f467f7b65f6edb3e98a5dcd99a4a4b275152b323', class: "select__multi-wrap select" }, this.multipleValues(labelId, moreId, helperEndId))), !this.multiple && [
23008
- this.mask && (h("div", { key: '9f993b544220f7be26b9ed9d33fe1516c7652da5', class: "select__mask" }, this.getLabel(this.value))),
23009
- h("input", { key: 'f3b4f85878ac17e3b9701a217a69e96bb68ea5e0', 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 }),
23010
- ])), !this.readonly && !this.disabled && (h("nano-datalist", { key: '52a43b32040be9aad63e1f6975e0ab9e9202aacd', onNanoOptionsUpdated: this.setOptions, ref: (el) => (this.datalist = el), selected: this.valArray, type: this.multiple ? 'selctMulti' : 'select', onNanoSelect: this.setValue, onNanoDeselect: (e) => {
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), 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 }));
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' && this.name && this.checked) {
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(document.querySelectorAll(`${transformTag('nano-checkbox')}[name="${this.name}"]`))?.filter((radio) => !radio.closest('form'));
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: '743ba20f7dc131a5df0dbef97f12682228b3a49d', class: { ...createColorClasses(this.color), 'nano-checkbox': true } }, h("label", { key: '9b0f1649bcf44a7685c3e1f91da816e7283f41e0', class: {
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: '77bac537123647d224667f66ef9d8a3ea732af9a', 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: '6ee7540510d902daaf303edcc2a677e9819d3b00', class: 'nanocb__input nanocb__input--' + this.type }), h("div", { key: '0ea0aea0ca852394ae4a3ccc6eb998e990d61f01', id: labelId, class: 'nanocb__label nanocb__label--' + this.type }, this.label && !!this.label.length && h("span", { key: 'a1b43b59fc067cba5fd22b87add0c5352666ca2f' }, this.label), h("span", { key: 'e2a1abe3e02c9a3deeda47430b164a0b0f03982b', hidden: this.label && !!this.label.length }, h("slot", { key: '30738b530444fd2051465eb6ff9098ebb06e2e88' }))))));
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: '967dd82369e855a7f9edf70cb17737d36efc1828', class: "nano-datalist", role: this.actvOptEles.length ? 'listbox' : undefined, "aria-owns": this.optionIds.length ? this.optionIds.join(' ') : undefined, "aria-label": this.optionIds.length
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: 'd98ed992c76129d5f1a1b5cb3c2a7e4c0c385118', ...this.dropDownConfig, ref: (el) => (this.nanoDropdown = el), dialogTitle: "Select options from the list below", class: {
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: 'b06ac3c64408a331819e3326fb72adfdf5c07b91', hidden: !this.actvOptEles.length, type: "listbox", label: this.inputLabel ? this.inputLabel.textContent : undefined, class: {
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: '58683fab717385e8dff20602683964327093f660', name: "list-top" }), h("slot", { key: '949fb5e02b13f878cde4d90a9848fcb18b35ea2c' }), h("slot", { key: 'ed9bccc1520dc103e1673fae32094b05245ab704', name: "internal-opts" }), h("slot", { key: 'aca33681c6282a17386c9934b93cfce6622c08e1', name: "list-bottom" })), h("nano-menu", { key: '4de595aded1e1f586a8d11d21bf6151758da9f9d', type: "listbox", label: "No results found", hidden: !!this.actvOptEles.length, class: {
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: '0da09df34253d8bd83bdd263e25f40b9075d30a7', name: "no-result" })), !!this.actvOptEles && (h("div", { key: 'ee9d3f67a82cc6a2e0c25efb0c79e031995d0587', class: "dlist__status" }, this.actvOptEles.length, " result", this.actvOptEles.length > 1 ? 's' : '', " available.")))));
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: '536c9704da65bc7e7415e679382384c076696d51', type: this.multiple ? 'select-multiple' : 'select-one', "aria-disabled": this.disabled ? 'true' : null, class: {
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: 'c7fd0db291f3362fcdfca52f443899260a284490', ...wrapOptions }, h(FormControl, { key: '9ea819ba91334497b7ef3e5fddf9308acc1aded9', ...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: 'f467f7b65f6edb3e98a5dcd99a4a4b275152b323', class: "select__multi-wrap select" }, this.multipleValues(labelId, moreId, helperEndId))), !this.multiple && [
23004
- this.mask && (h("div", { key: '9f993b544220f7be26b9ed9d33fe1516c7652da5', class: "select__mask" }, this.getLabel(this.value))),
23005
- h("input", { key: 'f3b4f85878ac17e3b9701a217a69e96bb68ea5e0', 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 }),
23006
- ])), !this.readonly && !this.disabled && (h("nano-datalist", { key: '52a43b32040be9aad63e1f6975e0ab9e9202aacd', onNanoOptionsUpdated: this.setOptions, ref: (el) => (this.datalist = el), selected: this.valArray, type: this.multiple ? 'selctMulti' : 'select', onNanoSelect: this.setValue, onNanoDeselect: (e) => {
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), 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
+ 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 = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanoporetech-digital/components",
3
- "version": "7.9.0",
3
+ "version": "7.9.2",
4
4
  "sideEffects": false,
5
5
  "repository": {
6
6
  "type": "git",