@nanoporetech-digital/components 8.13.0 → 8.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.
Files changed (32) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/nano-components.cjs.js +1 -1
  3. package/dist/cjs/nano-input-otp.cjs.entry.js +18 -5
  4. package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
  5. package/dist/collection/components/input-otp/input-otp.js +49 -5
  6. package/dist/components/nano-input-otp.js +20 -6
  7. package/dist/esm/loader.js +1 -1
  8. package/dist/esm/nano-components.js +1 -1
  9. package/dist/esm/nano-input-otp.entry.js +18 -5
  10. package/dist/nano-components/nano-components.css +1 -0
  11. package/dist/nano-components/nano-components.esm.js +1 -1
  12. package/dist/nano-components/nano-input-otp.entry.js +1 -1
  13. package/dist/style/components.css +1 -1
  14. package/dist/style/components.css.map +1 -1
  15. package/dist/style/nano.css +1 -1
  16. package/dist/style/nano.css.map +1 -1
  17. package/dist/types/components/input-otp/input-otp.d.ts +8 -0
  18. package/dist/types/components.d.ts +9 -0
  19. package/docs-json.json +38 -2
  20. package/hydrate/index.js +20 -6
  21. package/hydrate/index.mjs +20 -6
  22. package/package.json +2 -2
  23. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/generate-vue-component.d.ts +0 -0
  24. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/index.d.ts +0 -0
  25. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/output-vue.d.ts +0 -0
  26. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/plugin.d.ts +0 -0
  27. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/types.d.ts +0 -0
  28. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/utils.d.ts +0 -0
  29. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/stencil.config.d.ts +0 -0
  30. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
  31. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/testing/mocks/intersection-observer.d.ts +0 -0
  32. /package/dist/types/builds/{YtJk83se → uSGJX_GU}/0/Digital/nano-components/packages/components/.stencil/wdio.conf.d.ts +0 -0
@@ -113,6 +113,10 @@ export declare class InputOTP implements ComponentInterface {
113
113
  * Emitted when the input group loses focus.
114
114
  */
115
115
  nanoBlur: EventEmitter<FocusEvent>;
116
+ /**
117
+ * Emitted when the input group is cleared.
118
+ */
119
+ nanoClear: EventEmitter<void>;
116
120
  /**
117
121
  * Emitted when the input group has focus.
118
122
  */
@@ -124,6 +128,10 @@ export declare class InputOTP implements ComponentInterface {
124
128
  * Otherwise, the first empty input box or the last input if all are filled will be focused.
125
129
  */
126
130
  setFocus(index?: number): Promise<void>;
131
+ /**
132
+ * Resets the input boxes to empty values.
133
+ */
134
+ clear(): Promise<void>;
127
135
  valueChanged(): void;
128
136
  componentWillLoad(): void;
129
137
  componentDidLoad(): void;
@@ -2196,6 +2196,10 @@ export namespace Components {
2196
2196
  * @default false
2197
2197
  */
2198
2198
  "allowInvalid": boolean;
2199
+ /**
2200
+ * Resets the input boxes to empty values.
2201
+ */
2202
+ "clear": () => Promise<void>;
2199
2203
  /**
2200
2204
  * If `true`, the user cannot interact with the input.
2201
2205
  * @default false
@@ -4485,6 +4489,7 @@ declare global {
4485
4489
  "nanoChange": InputOtpChangeEventDetail;
4486
4490
  "nanoComplete": InputOtpCompleteEventDetail;
4487
4491
  "nanoBlur": FocusEvent;
4492
+ "nanoClear": void;
4488
4493
  "nanoFocus": FocusEvent;
4489
4494
  }
4490
4495
  /**
@@ -7410,6 +7415,10 @@ declare namespace LocalJSX {
7410
7415
  * The `nanoChange` event is fired when the user modifies the input's value. Unlike the `nanoInput` event, the `nanoChange` event is only fired when changes are committed, not as the user types. The `nanoChange` event fires when the `<nano-input-otp>` component loses focus after its value has changed. This event will not emit when programmatically setting the `value` property.
7411
7416
  */
7412
7417
  "onNanoChange"?: (event: NanoInputOtpCustomEvent<InputOtpChangeEventDetail>) => void;
7418
+ /**
7419
+ * Emitted when the input group is cleared.
7420
+ */
7421
+ "onNanoClear"?: (event: NanoInputOtpCustomEvent<void>) => void;
7413
7422
  /**
7414
7423
  * Emitted when all input boxes have been filled with valid values.
7415
7424
  */
package/docs-json.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-10-29T14:52:38",
2
+ "timestamp": "2025-10-31T16:57:11",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.36.1",
@@ -3369,7 +3369,7 @@
3369
3369
  "references": {
3370
3370
  "Breadcrumb": {
3371
3371
  "location": "local",
3372
- "path": "/builds/YtJk83se/0/Digital/nano-components/packages/components/src/components/breadcrumb/breadcrumb.tsx",
3372
+ "path": "/builds/uSGJX_GU/0/Digital/nano-components/packages/components/src/components/breadcrumb/breadcrumb.tsx",
3373
3373
  "id": "src/components/breadcrumb/breadcrumb.tsx::Breadcrumb"
3374
3374
  }
3375
3375
  }
@@ -18213,6 +18213,28 @@
18213
18213
  }
18214
18214
  ],
18215
18215
  "methods": [
18216
+ {
18217
+ "name": "clear",
18218
+ "returns": {
18219
+ "type": "Promise<void>",
18220
+ "docs": ""
18221
+ },
18222
+ "complexType": {
18223
+ "signature": "() => Promise<void>",
18224
+ "parameters": [],
18225
+ "references": {
18226
+ "Promise": {
18227
+ "location": "global",
18228
+ "id": "global::Promise"
18229
+ }
18230
+ },
18231
+ "return": "Promise<void>"
18232
+ },
18233
+ "signature": "clear() => Promise<void>",
18234
+ "parameters": [],
18235
+ "docs": "Resets the input boxes to empty values.",
18236
+ "docsTags": []
18237
+ },
18216
18238
  {
18217
18239
  "name": "setFocus",
18218
18240
  "returns": {
@@ -18293,6 +18315,20 @@
18293
18315
  "docs": "The `nanoChange` event is fired when the user modifies the input's value.\nUnlike the `nanoInput` event, the `nanoChange` event is only fired when changes\nare committed, not as the user types.\n\nThe `nanoChange` event fires when the `<nano-input-otp>` component loses\nfocus after its value has changed.\n\nThis event will not emit when programmatically setting the `value` property.",
18294
18316
  "docsTags": []
18295
18317
  },
18318
+ {
18319
+ "event": "nanoClear",
18320
+ "detail": "void",
18321
+ "bubbles": true,
18322
+ "complexType": {
18323
+ "original": "void",
18324
+ "resolved": "void",
18325
+ "references": {}
18326
+ },
18327
+ "cancelable": true,
18328
+ "composed": true,
18329
+ "docs": "Emitted when the input group is cleared.",
18330
+ "docsTags": []
18331
+ },
18296
18332
  {
18297
18333
  "event": "nanoComplete",
18298
18334
  "detail": "InputOtpCompleteEventDetail",
package/hydrate/index.js CHANGED
@@ -17769,6 +17769,7 @@ class InputOTP {
17769
17769
  this.nanoChange = createEvent(this, "nanoChange", 7);
17770
17770
  this.nanoComplete = createEvent(this, "nanoComplete", 7);
17771
17771
  this.nanoBlur = createEvent(this, "nanoBlur", 7);
17772
+ this.nanoClear = createEvent(this, "nanoClear", 7);
17772
17773
  this.nanoFocus = createEvent(this, "nanoFocus", 7);
17773
17774
  }
17774
17775
  inputRefs = [];
@@ -17872,6 +17873,10 @@ class InputOTP {
17872
17873
  * Emitted when the input group loses focus.
17873
17874
  */
17874
17875
  nanoBlur;
17876
+ /**
17877
+ * Emitted when the input group is cleared.
17878
+ */
17879
+ nanoClear;
17875
17880
  /**
17876
17881
  * Emitted when the input group has focus.
17877
17882
  */
@@ -17892,6 +17897,16 @@ class InputOTP {
17892
17897
  this.inputRefs[tabbableIndex]?.focus();
17893
17898
  }
17894
17899
  }
17900
+ /**
17901
+ * Resets the input boxes to empty values.
17902
+ */
17903
+ async clear() {
17904
+ this.value = '';
17905
+ this.inputRefs.forEach((input, index) => {
17906
+ input.value = this.inputValues[index] || '';
17907
+ });
17908
+ this.nanoClear.emit();
17909
+ }
17895
17910
  valueChanged() {
17896
17911
  this.initializeValues();
17897
17912
  this.updateTabIndexes();
@@ -18432,31 +18447,29 @@ class InputOTP {
18432
18447
  * - `valid` is true if all input boxes are filled with valid values.
18433
18448
  */
18434
18449
  computeValidity() {
18435
- const { inputValues } = this;
18436
18450
  this.invalid =
18437
18451
  this.allowInvalid &&
18438
18452
  this.inputValues.some((val) => val !== '' && !this.validKeyPattern.test(val));
18439
18453
  this.valid =
18440
18454
  this.inputValues.length === this.length &&
18441
18455
  this.inputValues.every((val) => val !== '' && this.validKeyPattern.test(val));
18442
- inputValues.some((v) => v !== '' && !this.validKeyPattern.test(v));
18443
18456
  }
18444
18457
  render() {
18445
18458
  const { disabled, hasFocus, inputId, inputRefs, inputValues, length, readonly, invalid, valid, } = this;
18446
18459
  const inputmode = this.getInputmode();
18447
18460
  const tabbableIndex = this.getTabbableIndex();
18448
18461
  const pattern = this.getPattern();
18449
- return (hAsync(Host, { key: '9b64211ca6a227c5f905a76a50ca3a44eff0a96b', class: {
18462
+ return (hAsync(Host, { key: '69c1b3c4a4cae21665bb7e3646a27a89f8d0a73b', class: {
18450
18463
  'has-focus': hasFocus,
18451
18464
  'input-otp-disabled': disabled,
18452
18465
  'input-otp-readonly': readonly,
18453
18466
  'nano-invalid': invalid,
18454
18467
  'nano-valid': valid,
18455
- } }, hAsync("div", { key: 'cc7fb4411962398f143d2dd17c40448111956e80', class: "input-otp-container" }, hAsync("div", { key: '4408d19628b34a25cb3bc39a0df1dd859700399f', class: "input-otp-group", role: "group", "aria-label": "One-time password input" }, Array.from({ length }).map((_, index) => (hAsync(Fragment, null, hAsync("div", { class: "native-wrapper" }, hAsync("input", { class: "native-input", id: `${inputId}-${index}`, "aria-label": `Input ${index + 1} of ${length}`, type: "text", inputmode: inputmode, pattern: pattern, disabled: disabled, readOnly: readonly, tabIndex: index === tabbableIndex ? 0 : -1, value: inputValues[index] || '', autocomplete: "one-time-code", ref: (el) => (inputRefs[index] = el), onInput: this.onInput(index), onBlur: this.onBlur, onFocus: this.onFocus(index), onKeyDown: this.onKeyDown(index), onPaste: this.onPaste })), this.showSeparator(index) && (hAsync("div", { class: "input-otp-separator" })))))), this.showValidity && (hAsync("div", { key: 'cc45bac1e7f7675b467bae6153d9ffa586ec6655', class: {
18468
+ } }, hAsync("div", { key: '9fcd9882d552cde88adfa7578e556155651bbb4d', class: "input-otp-container" }, hAsync("div", { key: '3e2c1a83282c08c1ccef81c4f13a895f1efeec13', class: "input-otp-group", role: "group", "aria-label": "One-time password input" }, Array.from({ length }).map((_, index) => (hAsync(Fragment, null, hAsync("div", { class: "native-wrapper" }, hAsync("input", { class: "native-input", id: `${inputId}-${index}`, "aria-label": `Input ${index + 1} of ${length}`, type: "text", inputmode: inputmode, pattern: pattern, disabled: disabled, readOnly: readonly, tabIndex: index === tabbableIndex ? 0 : -1, value: inputValues[index] || '', autocomplete: "one-time-code", ref: (el) => (inputRefs[index] = el), onInput: this.onInput(index), onBlur: this.onBlur, onFocus: this.onFocus(index), onKeyDown: this.onKeyDown(index), onPaste: this.onPaste })), this.showSeparator(index) && (hAsync("div", { class: "input-otp-separator" })))))), this.showValidity && (hAsync("div", { key: 'b5d9d9f3023cca6fcf9d8a394287de2333eeff54', class: {
18456
18469
  'input-otp-icon': true,
18457
18470
  'input-otp-icon--valid': valid,
18458
18471
  'input-otp-icon--invalid': invalid,
18459
- }, part: "validity-icon" }, hAsync("slot", { key: '84bd77959eaa572898cd48525512d93b6406b6b6', name: "validity-icon" }, hAsync("nano-icon", { key: 'c903d61964571e006aca28afea7a911f47527d43', hidden: !valid, name: "light/circle-check", class: "input-otp-valid-icon", "aria-label": "Valid input" }))))), this.slotCtrl.has('[default]') && (hAsync("div", { key: 'ddbf6145b86b48ad942227ec15ab419612e5ef41', class: "input-otp-description" }, hAsync("slot", { key: '56862b93b96aee7ecad1b36472666f94f2021a5f' })))));
18472
+ }, part: "validity-icon" }, hAsync("slot", { key: 'd4a3123b713487f579a503ea1158e73b97a35198', name: "validity-icon" }, hAsync("nano-icon", { key: '2d7886aadaaa786f3594ace3d4fa3d2ebbdc30c3', hidden: !valid, name: "light/circle-check", class: "input-otp-valid-icon", "aria-label": "Valid input" }))))), this.slotCtrl.has('[default]') && (hAsync("div", { key: '32b6883425e8f62bda344ad6f92ff63a5fef98f4', class: "input-otp-description" }, hAsync("slot", { key: '81b5c65f7c8bab2f8bf371c03bc5a2ae455b6c3f' })))));
18460
18473
  }
18461
18474
  static get watchers() { return {
18462
18475
  "value": ["valueChanged"]
@@ -18480,7 +18493,8 @@ class InputOTP {
18480
18493
  "previousInputValues": [32],
18481
18494
  "invalid": [32],
18482
18495
  "valid": [32],
18483
- "setFocus": [64]
18496
+ "setFocus": [64],
18497
+ "clear": [64]
18484
18498
  },
18485
18499
  "$listeners$": undefined,
18486
18500
  "$lazyBundleId$": "-",
package/hydrate/index.mjs CHANGED
@@ -17767,6 +17767,7 @@ class InputOTP {
17767
17767
  this.nanoChange = createEvent(this, "nanoChange", 7);
17768
17768
  this.nanoComplete = createEvent(this, "nanoComplete", 7);
17769
17769
  this.nanoBlur = createEvent(this, "nanoBlur", 7);
17770
+ this.nanoClear = createEvent(this, "nanoClear", 7);
17770
17771
  this.nanoFocus = createEvent(this, "nanoFocus", 7);
17771
17772
  }
17772
17773
  inputRefs = [];
@@ -17870,6 +17871,10 @@ class InputOTP {
17870
17871
  * Emitted when the input group loses focus.
17871
17872
  */
17872
17873
  nanoBlur;
17874
+ /**
17875
+ * Emitted when the input group is cleared.
17876
+ */
17877
+ nanoClear;
17873
17878
  /**
17874
17879
  * Emitted when the input group has focus.
17875
17880
  */
@@ -17890,6 +17895,16 @@ class InputOTP {
17890
17895
  this.inputRefs[tabbableIndex]?.focus();
17891
17896
  }
17892
17897
  }
17898
+ /**
17899
+ * Resets the input boxes to empty values.
17900
+ */
17901
+ async clear() {
17902
+ this.value = '';
17903
+ this.inputRefs.forEach((input, index) => {
17904
+ input.value = this.inputValues[index] || '';
17905
+ });
17906
+ this.nanoClear.emit();
17907
+ }
17893
17908
  valueChanged() {
17894
17909
  this.initializeValues();
17895
17910
  this.updateTabIndexes();
@@ -18430,31 +18445,29 @@ class InputOTP {
18430
18445
  * - `valid` is true if all input boxes are filled with valid values.
18431
18446
  */
18432
18447
  computeValidity() {
18433
- const { inputValues } = this;
18434
18448
  this.invalid =
18435
18449
  this.allowInvalid &&
18436
18450
  this.inputValues.some((val) => val !== '' && !this.validKeyPattern.test(val));
18437
18451
  this.valid =
18438
18452
  this.inputValues.length === this.length &&
18439
18453
  this.inputValues.every((val) => val !== '' && this.validKeyPattern.test(val));
18440
- inputValues.some((v) => v !== '' && !this.validKeyPattern.test(v));
18441
18454
  }
18442
18455
  render() {
18443
18456
  const { disabled, hasFocus, inputId, inputRefs, inputValues, length, readonly, invalid, valid, } = this;
18444
18457
  const inputmode = this.getInputmode();
18445
18458
  const tabbableIndex = this.getTabbableIndex();
18446
18459
  const pattern = this.getPattern();
18447
- return (hAsync(Host, { key: '9b64211ca6a227c5f905a76a50ca3a44eff0a96b', class: {
18460
+ return (hAsync(Host, { key: '69c1b3c4a4cae21665bb7e3646a27a89f8d0a73b', class: {
18448
18461
  'has-focus': hasFocus,
18449
18462
  'input-otp-disabled': disabled,
18450
18463
  'input-otp-readonly': readonly,
18451
18464
  'nano-invalid': invalid,
18452
18465
  'nano-valid': valid,
18453
- } }, hAsync("div", { key: 'cc7fb4411962398f143d2dd17c40448111956e80', class: "input-otp-container" }, hAsync("div", { key: '4408d19628b34a25cb3bc39a0df1dd859700399f', class: "input-otp-group", role: "group", "aria-label": "One-time password input" }, Array.from({ length }).map((_, index) => (hAsync(Fragment, null, hAsync("div", { class: "native-wrapper" }, hAsync("input", { class: "native-input", id: `${inputId}-${index}`, "aria-label": `Input ${index + 1} of ${length}`, type: "text", inputmode: inputmode, pattern: pattern, disabled: disabled, readOnly: readonly, tabIndex: index === tabbableIndex ? 0 : -1, value: inputValues[index] || '', autocomplete: "one-time-code", ref: (el) => (inputRefs[index] = el), onInput: this.onInput(index), onBlur: this.onBlur, onFocus: this.onFocus(index), onKeyDown: this.onKeyDown(index), onPaste: this.onPaste })), this.showSeparator(index) && (hAsync("div", { class: "input-otp-separator" })))))), this.showValidity && (hAsync("div", { key: 'cc45bac1e7f7675b467bae6153d9ffa586ec6655', class: {
18466
+ } }, hAsync("div", { key: '9fcd9882d552cde88adfa7578e556155651bbb4d', class: "input-otp-container" }, hAsync("div", { key: '3e2c1a83282c08c1ccef81c4f13a895f1efeec13', class: "input-otp-group", role: "group", "aria-label": "One-time password input" }, Array.from({ length }).map((_, index) => (hAsync(Fragment, null, hAsync("div", { class: "native-wrapper" }, hAsync("input", { class: "native-input", id: `${inputId}-${index}`, "aria-label": `Input ${index + 1} of ${length}`, type: "text", inputmode: inputmode, pattern: pattern, disabled: disabled, readOnly: readonly, tabIndex: index === tabbableIndex ? 0 : -1, value: inputValues[index] || '', autocomplete: "one-time-code", ref: (el) => (inputRefs[index] = el), onInput: this.onInput(index), onBlur: this.onBlur, onFocus: this.onFocus(index), onKeyDown: this.onKeyDown(index), onPaste: this.onPaste })), this.showSeparator(index) && (hAsync("div", { class: "input-otp-separator" })))))), this.showValidity && (hAsync("div", { key: 'b5d9d9f3023cca6fcf9d8a394287de2333eeff54', class: {
18454
18467
  'input-otp-icon': true,
18455
18468
  'input-otp-icon--valid': valid,
18456
18469
  'input-otp-icon--invalid': invalid,
18457
- }, part: "validity-icon" }, hAsync("slot", { key: '84bd77959eaa572898cd48525512d93b6406b6b6', name: "validity-icon" }, hAsync("nano-icon", { key: 'c903d61964571e006aca28afea7a911f47527d43', hidden: !valid, name: "light/circle-check", class: "input-otp-valid-icon", "aria-label": "Valid input" }))))), this.slotCtrl.has('[default]') && (hAsync("div", { key: 'ddbf6145b86b48ad942227ec15ab419612e5ef41', class: "input-otp-description" }, hAsync("slot", { key: '56862b93b96aee7ecad1b36472666f94f2021a5f' })))));
18470
+ }, part: "validity-icon" }, hAsync("slot", { key: 'd4a3123b713487f579a503ea1158e73b97a35198', name: "validity-icon" }, hAsync("nano-icon", { key: '2d7886aadaaa786f3594ace3d4fa3d2ebbdc30c3', hidden: !valid, name: "light/circle-check", class: "input-otp-valid-icon", "aria-label": "Valid input" }))))), this.slotCtrl.has('[default]') && (hAsync("div", { key: '32b6883425e8f62bda344ad6f92ff63a5fef98f4', class: "input-otp-description" }, hAsync("slot", { key: '81b5c65f7c8bab2f8bf371c03bc5a2ae455b6c3f' })))));
18458
18471
  }
18459
18472
  static get watchers() { return {
18460
18473
  "value": ["valueChanged"]
@@ -18478,7 +18491,8 @@ class InputOTP {
18478
18491
  "previousInputValues": [32],
18479
18492
  "invalid": [32],
18480
18493
  "valid": [32],
18481
- "setFocus": [64]
18494
+ "setFocus": [64],
18495
+ "clear": [64]
18482
18496
  },
18483
18497
  "$listeners$": undefined,
18484
18498
  "$lazyBundleId$": "-",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanoporetech-digital/components",
3
- "version": "8.13.0",
3
+ "version": "8.14.1",
4
4
  "sideEffects": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -60,7 +60,7 @@
60
60
  "smart-array-filter": "^4.0.2",
61
61
  "stencil-wormhole": "3.2.1",
62
62
  "tyqs": "^0.1.3",
63
- "@nanoporetech-digital/style": "8.13.0"
63
+ "@nanoporetech-digital/style": "8.14.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@algolia/client-search": "^4.22.1",