@nanoporetech-digital/components 2.13.2 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/cjs/nano-datalist_3.cjs.entry.js +13 -5
- package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-field-validator.cjs.entry.js +8 -6
- package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-nav-item_2.cjs.entry.js +2 -1
- package/dist/cjs/nano-nav-item_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/accordion/accordion.js +1 -1
- package/dist/collection/components/alert/alert.js +1 -1
- package/dist/collection/components/algolia/algolia-filter.js +2 -2
- package/dist/collection/components/algolia/algolia-input.js +5 -5
- package/dist/collection/components/algolia/algolia-results.js +1 -1
- package/dist/collection/components/algolia/algolia.js +6 -6
- package/dist/collection/components/checkbox/checkbox-group.js +2 -2
- package/dist/collection/components/checkbox/checkbox.js +3 -3
- package/dist/collection/components/datalist/datalist.js +14 -6
- package/dist/collection/components/datalist/datalist.js.map +1 -1
- package/dist/collection/components/date-input/date-input.js +8 -8
- package/dist/collection/components/date-picker/date-picker.js +5 -5
- package/dist/collection/components/details/details.js +1 -1
- package/dist/collection/components/dialog/dialog.js +1 -1
- package/dist/collection/components/dropdown/dropdown.js +1 -1
- package/dist/collection/components/field-validator/field-validator.js +14 -12
- package/dist/collection/components/field-validator/field-validator.js.map +1 -1
- package/dist/collection/components/file-upload/file-upload.js +4 -4
- package/dist/collection/components/global-nav/global-nav.js +4 -4
- package/dist/collection/components/grid/grid-item.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/input/input.js +5 -5
- package/dist/collection/components/nav-item/nav-item.js +4 -4
- package/dist/collection/components/range/range.js +4 -4
- package/dist/collection/components/resize-observe/resize-observe.js +1 -1
- package/dist/collection/components/select/select.js +9 -9
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/slides/slides.js +7 -7
- package/dist/collection/components/tabs/tab-group.js +2 -2
- package/dist/components/datalist.js +13 -4
- package/dist/components/datalist.js.map +1 -1
- package/dist/components/nano-field-validator.js +8 -6
- package/dist/components/nano-field-validator.js.map +1 -1
- package/dist/components/select.js +2 -1
- package/dist/components/select.js.map +1 -1
- package/dist/custom-elements/index.js +22 -11
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/nano-datalist_3.entry.js +13 -5
- package/dist/esm/nano-datalist_3.entry.js.map +1 -1
- package/dist/esm/nano-field-validator.entry.js +8 -6
- package/dist/esm/nano-field-validator.entry.js.map +1 -1
- package/dist/esm/nano-nav-item_2.entry.js +2 -1
- package/dist/esm/nano-nav-item_2.entry.js.map +1 -1
- package/dist/esm-es5/nano-datalist_3.entry.js +2 -2
- package/dist/esm-es5/nano-datalist_3.entry.js.map +1 -1
- package/dist/esm-es5/nano-field-validator.entry.js +1 -1
- package/dist/esm-es5/nano-field-validator.entry.js.map +1 -1
- package/dist/esm-es5/nano-nav-item_2.entry.js +1 -1
- package/dist/esm-es5/nano-nav-item_2.entry.js.map +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/{p-ed0bdea9.entry.js → p-3f51bdf5.entry.js} +2 -2
- package/dist/nano-components/p-3f51bdf5.entry.js.map +1 -0
- package/dist/nano-components/p-53957ec6.system.js +1 -1
- package/dist/nano-components/p-6ce533f1.system.entry.js +5 -0
- package/dist/nano-components/p-6ce533f1.system.entry.js.map +1 -0
- package/dist/nano-components/p-a8ab65fa.entry.js +5 -0
- package/dist/nano-components/p-a8ab65fa.entry.js.map +1 -0
- package/dist/nano-components/p-bc34955f.system.entry.js +5 -0
- package/dist/nano-components/p-bc34955f.system.entry.js.map +1 -0
- package/dist/nano-components/{p-cb512cff.system.entry.js → p-e7628969.system.entry.js} +2 -2
- package/dist/nano-components/p-e7628969.system.entry.js.map +1 -0
- package/dist/nano-components/p-f0e9397c.entry.js +5 -0
- package/dist/nano-components/p-f0e9397c.entry.js.map +1 -0
- package/dist/types/components/datalist/datalist.d.ts +1 -0
- package/docs-json.json +1 -1
- package/package.json +2 -2
- package/dist/nano-components/p-32900c91.entry.js +0 -5
- package/dist/nano-components/p-32900c91.entry.js.map +0 -1
- package/dist/nano-components/p-3f5de726.system.entry.js +0 -5
- package/dist/nano-components/p-3f5de726.system.entry.js.map +0 -1
- package/dist/nano-components/p-aa84c727.system.entry.js +0 -5
- package/dist/nano-components/p-aa84c727.system.entry.js.map +0 -1
- package/dist/nano-components/p-cb512cff.system.entry.js.map +0 -1
- package/dist/nano-components/p-db02ad4c.entry.js +0 -5
- package/dist/nano-components/p-db02ad4c.entry.js.map +0 -1
- package/dist/nano-components/p-ed0bdea9.entry.js.map +0 -1
@@ -8974,7 +8974,7 @@ let DataList = class extends H {
|
|
8974
8974
|
e.stopPropagation();
|
8975
8975
|
this.changeInputValue(e.detail);
|
8976
8976
|
raf(() => this.inputChange());
|
8977
|
-
if (this.type
|
8977
|
+
if (this.type !== 'selctMulti')
|
8978
8978
|
this.shouldOpen = false;
|
8979
8979
|
};
|
8980
8980
|
// sets focus immediately on open when 'select' - mirroring native behaviour
|
@@ -8986,6 +8986,14 @@ let DataList = class extends H {
|
|
8986
8986
|
else if (this.type === 'select')
|
8987
8987
|
this.listBox.showActiveElement();
|
8988
8988
|
};
|
8989
|
+
this.handleHide = () => {
|
8990
|
+
this.open = false;
|
8991
|
+
const activeElement = getActiveElement();
|
8992
|
+
if (activeElement === document.body ||
|
8993
|
+
activeElement.closest(this.host.tagName.toLowerCase())) {
|
8994
|
+
this.connectedInput.focus();
|
8995
|
+
}
|
8996
|
+
};
|
8989
8997
|
this.inputClick = () => {
|
8990
8998
|
this.shouldOpen = true;
|
8991
8999
|
// open dropdown if possible
|
@@ -9166,8 +9174,8 @@ let DataList = class extends H {
|
|
9166
9174
|
let autocompleteType = 'both';
|
9167
9175
|
let readonly = false;
|
9168
9176
|
switch (this.type) {
|
9169
|
-
case '
|
9170
|
-
|
9177
|
+
case 'input':
|
9178
|
+
dwConfig = { closeOnSelect: true };
|
9171
9179
|
break;
|
9172
9180
|
case 'select':
|
9173
9181
|
autocompleteType = 'list';
|
@@ -9389,7 +9397,7 @@ let DataList = class extends H {
|
|
9389
9397
|
return (h$1(Host$1, { role: "listbox", "aria-owns": this.optionIds.join(' '), "aria-label": "Select options from the list below" }, h$1("nano-dropdown", Object.assign({}, this.dropDownConfig, { ref: (el) => (this.nanoDropdown = el), dialogTitle: "Select options from the list below", class: {
|
9390
9398
|
dlist__dropdown: true,
|
9391
9399
|
'dlist--isfiltered': this.isFiltered,
|
9392
|
-
}, onNanoAfterShow: this.handleShow, onNanoAfterHide:
|
9400
|
+
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide }), h$1("nano-menu", { hidden: !this.actvOptEles.length, type: "listbox", label: this.inputLabel ? this.inputLabel.textContent : undefined, class: {
|
9393
9401
|
dlist__menu: true,
|
9394
9402
|
'dlist__menu--open': this.dropwdownOpen,
|
9395
9403
|
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown, ref: (el) => (this.listBox = el) }, h$1("slot", { name: "list-top" }), !this.options.length && h$1("slot", null), !!this.options.length && h$1("slot", { name: "internal-opts" }), h$1("slot", { name: "list-bottom" })), h$1("nano-menu", { type: "listbox", label: "No results found", hidden: !!this.actvOptEles.length, class: {
|
@@ -13257,10 +13265,10 @@ let FieldValidator = class extends H {
|
|
13257
13265
|
const found = this.allFields.find((field) => this.getName(field) === key);
|
13258
13266
|
// field update has come programmatically (not from ui),
|
13259
13267
|
// so let's update the underlying ui field
|
13260
|
-
if (
|
13261
|
-
found.tagName === 'NANO-FILE-UPLOAD' &&
|
13262
|
-
|
13263
|
-
|
13268
|
+
if (found &&
|
13269
|
+
((found.tagName === 'NANO-FILE-UPLOAD' &&
|
13270
|
+
!this.fileStateEqual(key, found)) ||
|
13271
|
+
(found.tagName !== 'NANO-FILE-UPLOAD' && found.value !== newVal))) {
|
13264
13272
|
this.storeToFields([found]);
|
13265
13273
|
}
|
13266
13274
|
if (this.validateOn === 'dirty' && this.dirty) {
|
@@ -13469,7 +13477,9 @@ let FieldValidator = class extends H {
|
|
13469
13477
|
* @param state - the state to load in the store
|
13470
13478
|
*/
|
13471
13479
|
async setStore(state) {
|
13472
|
-
Object.entries(state).forEach(([key, val]) =>
|
13480
|
+
Object.entries(state).forEach(([key, val]) => {
|
13481
|
+
this.store.state[key] = val;
|
13482
|
+
});
|
13473
13483
|
}
|
13474
13484
|
/**
|
13475
13485
|
* Sets custom validity for all / some form fields.
|
@@ -13595,7 +13605,7 @@ let FieldValidator = class extends H {
|
|
13595
13605
|
if (cb.checked)
|
13596
13606
|
this._store.state[fieldName] = cb.value;
|
13597
13607
|
}
|
13598
|
-
else if (this.allFields.filter((f) => this.getName(
|
13608
|
+
else if (this.allFields.filter((f) => this.getName(f) === fieldName &&
|
13599
13609
|
(f.tagName === 'NANO-CHECKBOX' ||
|
13600
13610
|
f.type === 'checkbox')).length > 1) {
|
13601
13611
|
// multiple checkbox type control
|
@@ -18751,6 +18761,8 @@ let Select = class extends H {
|
|
18751
18761
|
/** nano-dropdown config options you can pass to the nested dropdown component */
|
18752
18762
|
this.dropDownConfig = {};
|
18753
18763
|
this.customValidate = () => {
|
18764
|
+
if (!this.nativeSelect)
|
18765
|
+
return;
|
18754
18766
|
this.nativeSelect.setCustomValidity('');
|
18755
18767
|
// add custom validations 'cos html5 validations are a bit rubbish on selects
|
18756
18768
|
if (this.required && !this.valArray.length) {
|
@@ -18803,7 +18815,6 @@ let Select = class extends H {
|
|
18803
18815
|
e.preventDefault();
|
18804
18816
|
if (!this.multiple) {
|
18805
18817
|
this.value = e.detail.value;
|
18806
|
-
this.inputCtrl.focus();
|
18807
18818
|
return;
|
18808
18819
|
}
|
18809
18820
|
if (this.value && this.value.length && this.value.includes(e.detail.value))
|