@nanoporetech-digital/components 2.14.0 → 2.14.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/CHANGELOG.md +23 -0
- package/dist/cjs/nano-field-validator.cjs.entry.js +30 -19
- package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-nav-item_2.cjs.entry.js +2 -0
- 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 +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 +36 -25
- 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 -7
- 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/nano-field-validator.js +30 -19
- package/dist/components/nano-field-validator.js.map +1 -1
- package/dist/components/select.js +2 -0
- package/dist/components/select.js.map +1 -1
- package/dist/custom-elements/index.js +32 -19
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/nano-field-validator.entry.js +30 -19
- package/dist/esm/nano-field-validator.entry.js.map +1 -1
- package/dist/esm/nano-nav-item_2.entry.js +2 -0
- package/dist/esm/nano-nav-item_2.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-a1108493.entry.js → p-3f51bdf5.entry.js} +2 -2
- package/dist/nano-components/p-3f51bdf5.entry.js.map +1 -0
- package/dist/nano-components/{p-f268fe08.system.entry.js → p-3f9c097b.system.entry.js} +2 -2
- package/dist/nano-components/p-3f9c097b.system.entry.js.map +1 -0
- package/dist/nano-components/p-3fcb6eea.entry.js +5 -0
- package/dist/nano-components/p-3fcb6eea.entry.js.map +1 -0
- package/dist/nano-components/p-53957ec6.system.js +1 -1
- package/dist/nano-components/{p-e8c4ca40.system.entry.js → p-e7628969.system.entry.js} +2 -2
- package/dist/nano-components/p-e7628969.system.entry.js.map +1 -0
- package/docs-json.json +1 -1
- package/package.json +2 -2
- package/dist/nano-components/p-0a1d463e.entry.js +0 -5
- package/dist/nano-components/p-0a1d463e.entry.js.map +0 -1
- package/dist/nano-components/p-a1108493.entry.js.map +0 -1
- package/dist/nano-components/p-e8c4ca40.system.entry.js.map +0 -1
- package/dist/nano-components/p-f268fe08.system.entry.js.map +0 -1
@@ -13266,9 +13266,16 @@ let FieldValidator = class extends H {
|
|
13266
13266
|
// field update has come programmatically (not from ui),
|
13267
13267
|
// so let's update the underlying ui field
|
13268
13268
|
if (found &&
|
13269
|
+
(found.tagName === 'NANO-CHECKBOX' ||
|
13270
|
+
['radio', 'checkbox'].includes(found.type))) {
|
13271
|
+
// it's a cb - always change
|
13272
|
+
this.storeToFields([found]);
|
13273
|
+
}
|
13274
|
+
else if (found &&
|
13269
13275
|
((found.tagName === 'NANO-FILE-UPLOAD' &&
|
13270
13276
|
!this.fileStateEqual(key, found)) ||
|
13271
13277
|
(found.tagName !== 'NANO-FILE-UPLOAD' && found.value !== newVal))) {
|
13278
|
+
// not a cb. Only change if value is different
|
13272
13279
|
this.storeToFields([found]);
|
13273
13280
|
}
|
13274
13281
|
if (this.validateOn === 'dirty' && this.dirty) {
|
@@ -13478,9 +13485,7 @@ let FieldValidator = class extends H {
|
|
13478
13485
|
*/
|
13479
13486
|
async setStore(state) {
|
13480
13487
|
Object.entries(state).forEach(([key, val]) => {
|
13481
|
-
|
13482
|
-
if (found)
|
13483
|
-
this.store.state[key] = val;
|
13488
|
+
this.store.state[key] = val;
|
13484
13489
|
});
|
13485
13490
|
}
|
13486
13491
|
/**
|
@@ -13554,29 +13559,35 @@ let FieldValidator = class extends H {
|
|
13554
13559
|
return;
|
13555
13560
|
if (field.tagName === 'NANO-CHECKBOX' ||
|
13556
13561
|
['radio', 'checkbox'].includes(field.type)) {
|
13557
|
-
let
|
13558
|
-
if (
|
13559
|
-
|
13560
|
-
|
13562
|
+
let cbs = this.allFields.filter((f) => this.getName(field) === this.getName(f));
|
13563
|
+
if (cbs[0].type === 'radio' ||
|
13564
|
+
cbs[0].type === 'segment' ||
|
13565
|
+
cbs[0].type === 'segment-pill') {
|
13561
13566
|
// single radio type control
|
13562
|
-
|
13563
|
-
|
13564
|
-
|
13565
|
-
|
13567
|
+
cbs.forEach((cb) => {
|
13568
|
+
if (this._store.state[fieldName] === cb.value)
|
13569
|
+
cb.checked = true;
|
13570
|
+
else
|
13571
|
+
cb.checked = false;
|
13572
|
+
});
|
13566
13573
|
}
|
13567
13574
|
else if (Array.isArray(this._store.state[fieldName])) {
|
13568
13575
|
// multiple checkbox like controls
|
13569
|
-
|
13570
|
-
cb.
|
13571
|
-
|
13572
|
-
|
13576
|
+
cbs.forEach((cb) => {
|
13577
|
+
if (this._store.state[fieldName].includes(cb.value))
|
13578
|
+
cb.checked = true;
|
13579
|
+
else
|
13580
|
+
cb.checked = false;
|
13581
|
+
});
|
13573
13582
|
}
|
13574
13583
|
else {
|
13575
13584
|
// single checkbox like control
|
13576
|
-
|
13577
|
-
|
13578
|
-
|
13579
|
-
|
13585
|
+
cbs.forEach((cb) => {
|
13586
|
+
if (this._store.state[fieldName] === cb.value)
|
13587
|
+
cb.checked = true;
|
13588
|
+
else
|
13589
|
+
cb.checked = false;
|
13590
|
+
});
|
13580
13591
|
}
|
13581
13592
|
return;
|
13582
13593
|
}
|
@@ -18763,6 +18774,8 @@ let Select = class extends H {
|
|
18763
18774
|
/** nano-dropdown config options you can pass to the nested dropdown component */
|
18764
18775
|
this.dropDownConfig = {};
|
18765
18776
|
this.customValidate = () => {
|
18777
|
+
if (!this.nativeSelect)
|
18778
|
+
return;
|
18766
18779
|
this.nativeSelect.setCustomValidity('');
|
18767
18780
|
// add custom validations 'cos html5 validations are a bit rubbish on selects
|
18768
18781
|
if (this.required && !this.valArray.length) {
|