@nvidia-elements/forms 2.0.10 → 2.0.11

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 CHANGED
@@ -1,3 +1,19 @@
1
+ ## [2.0.11](https://github.com/NVIDIA/elements/compare/@nvidia-elements/forms-v2.0.10...@nvidia-elements/forms-v2.0.11) (2026-11-02)
2
+
3
+ ### Features
4
+
5
+ * **core:** joystick ([a4461e1](https://github.com/NVIDIA/elements/commit/a4461e10930ec198bc43b846f7b090f5db70c371))
6
+ * **foundations:** add i18n support ([074f46c](https://github.com/NVIDIA/elements/commit/074f46ce0e148d00f40e6e320abec01e6fee5704))
7
+
8
+ ### Bug Fixes
9
+
10
+ * **cli:** update @inquirer/prompts to 8.7.5 ([8bfbeb0](https://github.com/NVIDIA/elements/commit/8bfbeb0953fae54aae4fdce15b455e2fed94a60b))
11
+ * **cli:** update marked-terminal to 7.3.1 ([d11932c](https://github.com/NVIDIA/elements/commit/d11932c791ae22a0847c00f20e5bd433d7b66444))
12
+ * **core:** i18n refactor ([4b6e10c](https://github.com/NVIDIA/elements/commit/4b6e10cd1ac30622b030be926e2d39e7e8039f95))
13
+ * **forms:** preserve managed tabindex across button state changes ([ee959b4](https://github.com/NVIDIA/elements/commit/ee959b407ad08ef158ffd3f422b57b2b895b40ba))
14
+ * **media:** i18n refactor ([a730282](https://github.com/NVIDIA/elements/commit/a73028216d642440d5fe583584703793e38d39d9))
15
+ * **viewport:** i18n refactor ([2a6825b](https://github.com/NVIDIA/elements/commit/2a6825b24be4ed4304c2b57c91bbaf3435a5a480))
16
+
1
17
  ## [2.0.10](https://github.com/NVIDIA/elements/compare/@nvidia-elements/forms-v2.0.9...@nvidia-elements/forms-v2.0.10) (2026-10-28)
2
18
 
3
19
  ### Features
@@ -458,7 +458,7 @@
458
458
  },
459
459
  {
460
460
  "kind": "field",
461
- "name": "#initialTabIndex",
461
+ "name": "#enabledTabIndex",
462
462
  "privacy": "private",
463
463
  "type": {
464
464
  "text": "number",
@@ -472,6 +472,21 @@
472
472
  },
473
473
  "default": "0"
474
474
  },
475
+ {
476
+ "kind": "field",
477
+ "name": "#unavailable",
478
+ "privacy": "private",
479
+ "type": {
480
+ "text": "boolean | undefined",
481
+ "_sourceAliases": [],
482
+ "values": [
483
+ {
484
+ "value": "boolean",
485
+ "description": ""
486
+ }
487
+ ]
488
+ }
489
+ },
475
490
  {
476
491
  "kind": "method",
477
492
  "name": "hostConnected"
@@ -479,6 +494,11 @@
479
494
  {
480
495
  "kind": "method",
481
496
  "name": "hostUpdated"
497
+ },
498
+ {
499
+ "kind": "method",
500
+ "name": "#updateTabIndex",
501
+ "privacy": "private"
482
502
  }
483
503
  ]
484
504
  }
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region src/index.ts
2
- var e = "2.0.10";
2
+ var e = "2.0.11";
3
3
  //#endregion
4
4
  export { e as VERSION };
5
5
 
@@ -2,18 +2,23 @@
2
2
  var e = class {
3
3
  #e = null;
4
4
  #t = 0;
5
+ #n;
5
6
  constructor(e) {
6
7
  this.host = e, this.host.addController(this);
7
8
  }
8
9
  hostConnected() {
9
- this.host.hasAttribute("tabindex") && (this.#t = this.host.tabIndex);
10
+ this.#n === void 0 && this.host.hasAttribute("tabindex") && (this.#t = this.host.tabIndex);
10
11
  }
11
12
  hostUpdated() {
12
- if (this.host.readOnly) {
13
- this.host._internals.role && this.host._internals.role !== "none" && (this.#e = this.host._internals.role), this.host._internals.role = "none", this.host.tabIndex = -1, this.host.removeAttribute("tabindex");
13
+ if (this.#r(), this.host.readOnly) {
14
+ this.host._internals.role && this.host._internals.role !== "none" && (this.#e = this.host._internals.role), this.host._internals.role = "none";
14
15
  return;
15
16
  }
16
- !this.host._internals.role || this.host._internals.role === "none" ? this.host._internals.role = this.#e ?? "button" : this.#e = this.host._internals.role, this.host.tabIndex = this.host.disabled ? -1 : this.#t;
17
+ !this.host._internals.role || this.host._internals.role === "none" ? this.host._internals.role = this.#e ?? "button" : this.#e = this.host._internals.role;
18
+ }
19
+ #r() {
20
+ let e = this.host.disabled || this.host.readOnly, t = this.#n === void 0 || this.#n && !e;
21
+ e && this.#n === !1 && (this.#t = this.host.tabIndex), this.#n = e, this.host.readOnly ? (this.host.tabIndex = -1, this.host.removeAttribute("tabindex")) : this.host.disabled ? this.host.tabIndex = -1 : t && (this.host.tabIndex = this.#t);
17
22
  }
18
23
  };
19
24
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"type-button.controller.js","names":[],"sources":["../../../src/internal/controllers/type-button.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from './types.js';\n\ntype ButtonBehaviorHost = ReactiveElement & {\n disabled: boolean;\n readOnly: boolean;\n _internals?: ElementInternals;\n};\n\nexport class TypeButtonController<T extends ButtonBehaviorHost> implements ReactiveController {\n #enabledRole: string | null = null;\n #initialTabIndex = 0;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n if (this.host.hasAttribute('tabindex')) {\n this.#initialTabIndex = this.host.tabIndex;\n }\n }\n\n hostUpdated() {\n if (this.host.readOnly) {\n if (this.host._internals!.role && this.host._internals!.role !== 'none') {\n this.#enabledRole = this.host._internals!.role;\n }\n\n this.host._internals!.role = 'none';\n this.host.tabIndex = -1;\n this.host.removeAttribute('tabindex');\n return;\n }\n\n if (!this.host._internals!.role || this.host._internals!.role === 'none') {\n this.host._internals!.role = this.#enabledRole ?? 'button';\n } else {\n this.#enabledRole = this.host._internals!.role;\n }\n\n this.host.tabIndex = this.host.disabled ? -1 : this.#initialTabIndex;\n }\n}\n"],"mappings":";AAWA,IAAa,IAAb,MAA8F;CAC5F,KAA8B;CAC9B,KAAmB;CAEnB,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,AAAI,KAAK,KAAK,aAAa,UAAU,MACnC,KAAK,KAAmB,KAAK,KAAK;CAEtC;CAEA,cAAc;EACZ,IAAI,KAAK,KAAK,UAAU;GAOtB,AANI,KAAK,KAAK,WAAY,QAAQ,KAAK,KAAK,WAAY,SAAS,WAC/D,KAAK,KAAe,KAAK,KAAK,WAAY,OAG5C,KAAK,KAAK,WAAY,OAAO,QAC7B,KAAK,KAAK,WAAW,IACrB,KAAK,KAAK,gBAAgB,UAAU;GACpC;EACF;EAQA,AANI,CAAC,KAAK,KAAK,WAAY,QAAQ,KAAK,KAAK,WAAY,SAAS,SAChE,KAAK,KAAK,WAAY,OAAO,KAAK,MAAgB,WAElD,KAAK,KAAe,KAAK,KAAK,WAAY,MAG5C,KAAK,KAAK,WAAW,KAAK,KAAK,WAAW,KAAK,KAAK;CACtD;AACF"}
1
+ {"version":3,"file":"type-button.controller.js","names":[],"sources":["../../../src/internal/controllers/type-button.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from './types.js';\n\ntype ButtonBehaviorHost = ReactiveElement & {\n disabled: boolean;\n readOnly: boolean;\n _internals?: ElementInternals;\n};\n\nexport class TypeButtonController<T extends ButtonBehaviorHost> implements ReactiveController {\n #enabledRole: string | null = null;\n #enabledTabIndex = 0;\n #unavailable?: boolean;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n if (this.#unavailable === undefined && this.host.hasAttribute('tabindex')) {\n this.#enabledTabIndex = this.host.tabIndex;\n }\n }\n\n hostUpdated() {\n this.#updateTabIndex();\n if (this.host.readOnly) {\n if (this.host._internals!.role && this.host._internals!.role !== 'none') {\n this.#enabledRole = this.host._internals!.role;\n }\n\n this.host._internals!.role = 'none';\n return;\n }\n\n if (!this.host._internals!.role || this.host._internals!.role === 'none') {\n this.host._internals!.role = this.#enabledRole ?? 'button';\n } else {\n this.#enabledRole = this.host._internals!.role;\n }\n }\n\n #updateTabIndex() {\n const unavailable = this.host.disabled || this.host.readOnly;\n const restore = this.#unavailable === undefined || (this.#unavailable && !unavailable);\n\n if (unavailable && this.#unavailable === false) {\n this.#enabledTabIndex = this.host.tabIndex;\n }\n\n this.#unavailable = unavailable;\n if (this.host.readOnly) {\n this.host.tabIndex = -1;\n this.host.removeAttribute('tabindex');\n } else if (this.host.disabled) {\n this.host.tabIndex = -1;\n } else if (restore) {\n this.host.tabIndex = this.#enabledTabIndex;\n }\n }\n}\n"],"mappings":";AAWA,IAAa,IAAb,MAA8F;CAC5F,KAA8B;CAC9B,KAAmB;CACnB;CAEA,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,AAAI,KAAK,OAAiB,KAAA,KAAa,KAAK,KAAK,aAAa,UAAU,MACtE,KAAK,KAAmB,KAAK,KAAK;CAEtC;CAEA,cAAc;EAEZ,IADA,KAAK,GAAgB,GACjB,KAAK,KAAK,UAAU;GAKtB,AAJI,KAAK,KAAK,WAAY,QAAQ,KAAK,KAAK,WAAY,SAAS,WAC/D,KAAK,KAAe,KAAK,KAAK,WAAY,OAG5C,KAAK,KAAK,WAAY,OAAO;GAC7B;EACF;EAEA,AAAI,CAAC,KAAK,KAAK,WAAY,QAAQ,KAAK,KAAK,WAAY,SAAS,SAChE,KAAK,KAAK,WAAY,OAAO,KAAK,MAAgB,WAElD,KAAK,KAAe,KAAK,KAAK,WAAY;CAE9C;CAEA,KAAkB;EAChB,IAAM,IAAc,KAAK,KAAK,YAAY,KAAK,KAAK,UAC9C,IAAU,KAAK,OAAiB,KAAA,KAAc,KAAK,MAAgB,CAAC;EAO1E,AALI,KAAe,KAAK,OAAiB,OACvC,KAAK,KAAmB,KAAK,KAAK,WAGpC,KAAK,KAAe,GAChB,KAAK,KAAK,YACZ,KAAK,KAAK,WAAW,IACrB,KAAK,KAAK,gBAAgB,UAAU,KAC3B,KAAK,KAAK,WACnB,KAAK,KAAK,WAAW,KACZ,MACT,KAAK,KAAK,WAAW,KAAK;CAE9B;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nvidia-elements/forms",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "release": {
5
5
  "extends": "../../release.config.js"
6
6
  },
@@ -89,7 +89,7 @@
89
89
  "@internals/testing": "0.0.0",
90
90
  "@internals/eslint": "0.0.0",
91
91
  "@internals/vite": "0.0.0",
92
- "@nvidia-elements/lint": "2.9.0",
92
+ "@nvidia-elements/lint": "2.9.1",
93
93
  "@typescript/lib-dom": "npm:@types/web@0.0.312",
94
94
  "@vitest/browser": "5.0.0",
95
95
  "@vitest/coverage-istanbul": "5.0.0",