@nvidia-elements/forms 2.0.9 → 2.0.10

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,29 @@
1
+ ## [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
+
3
+ ### Features
4
+
5
+ * **core:** tree node invoker command support ([2d889e4](https://github.com/NVIDIA/elements/commit/2d889e485b5aad0980731821691973d57c2ee343))
6
+ * **foundations:** scroll box ([fa9d947](https://github.com/NVIDIA/elements/commit/fa9d947d076a9cbc356a307aa0fb1f219bb701a4))
7
+ * **lint:** new rules ([1352a3e](https://github.com/NVIDIA/elements/commit/1352a3e579e6a2e3d4bff29c03c91379dbd30f93))
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cli:** update bun to 1.4.4 ([dc0a9d4](https://github.com/NVIDIA/elements/commit/dc0a9d4079cf3d8c7251ed4dfb6ff8ce728f8be1))
12
+ * **code:** foundations utility functions ([aef8463](https://github.com/NVIDIA/elements/commit/aef846300b4861cc07c87ae32d844267302f62a3))
13
+ * **core:** add min-width for fit-text styling for filter chip ([7bf423e](https://github.com/NVIDIA/elements/commit/7bf423ed11413e9aa33ca4f28658a1bcac011d26))
14
+ * **core:** foundations utility functions ([4618981](https://github.com/NVIDIA/elements/commit/4618981acecdd4de0ed4b225c070a4506a6fd4fd))
15
+ * **core:** migrate runtime to static lint checks ([e616f85](https://github.com/NVIDIA/elements/commit/e616f85788c699b6c89c410625a23481834e48dd))
16
+ * **core:** observe only host hidden changes for popover visibility ([3a2b58d](https://github.com/NVIDIA/elements/commit/3a2b58d26b7223677d8f23f8643dd6d1cc173882))
17
+ * **docs:** prevent code block copy buttons from overflowing the page ([6972e4b](https://github.com/NVIDIA/elements/commit/6972e4b7e3dfaa936a650167c47a3d6d0cca2a35))
18
+ * **forms:** enable invoke method for controller ([68c8aa3](https://github.com/NVIDIA/elements/commit/68c8aa33a4d9254601b56b219ae6cc4268b54306))
19
+ * **foundations:** missing dist publish ([5521fc0](https://github.com/NVIDIA/elements/commit/5521fc0d55e0542d028727531267241bc31f9401))
20
+ * **foundations:** utility exports ([9039bf0](https://github.com/NVIDIA/elements/commit/9039bf0c4fbeac17a16987b873c4de47d07fc313))
21
+ * **lint:** add tree invoker command support ([bde2265](https://github.com/NVIDIA/elements/commit/bde2265de1ed48981de745d1f4ca733d28b65df0))
22
+ * **markdown:** foundations utility functions ([1ed4bc6](https://github.com/NVIDIA/elements/commit/1ed4bc6dfe4eef0663ab78e450af9765a2265ae2))
23
+ * **media:** foundations utility functions ([ee9b3c7](https://github.com/NVIDIA/elements/commit/ee9b3c7d18c04d3b1aa3c6bfef9dec528b9c0da1))
24
+ * **monaco:** foundations utility functions ([a62e1db](https://github.com/NVIDIA/elements/commit/a62e1db32f0331108bb6518248cbf01bedb0076d))
25
+ * **viewport:** foundations utility functions ([74fe7db](https://github.com/NVIDIA/elements/commit/74fe7db2d00c3b1cd99a99bfc97556a58d017899))
26
+
1
27
  ## [2.0.9](https://github.com/NVIDIA/elements/compare/@nvidia-elements/forms-v2.0.8...@nvidia-elements/forms-v2.0.9) (2026-10-23)
2
28
 
3
29
  ### Features
@@ -540,8 +540,8 @@
540
540
  },
541
541
  {
542
542
  "kind": "method",
543
- "name": "#dispatchCommand",
544
- "privacy": "private"
543
+ "name": "invoke",
544
+ "description": "Dispatches the configured command for controls that handle their own activation."
545
545
  },
546
546
  {
547
547
  "kind": "field",
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region src/index.ts
2
- var e = "2.0.9";
2
+ var e = "2.0.10";
3
3
  //#endregion
4
4
  export { e as VERSION };
5
5
 
@@ -2,8 +2,8 @@ import type { ReactiveController, ReactiveElement } from './types.js';
2
2
  type CommandBehaviorHost = ReactiveElement & {
3
3
  command?: string;
4
4
  commandForElement: HTMLElement | null;
5
- disabled: boolean;
6
- readOnly: boolean;
5
+ disabled?: boolean;
6
+ readOnly?: boolean;
7
7
  };
8
8
  type TypeCommandControllerOptions = {
9
9
  events?: readonly string[];
@@ -14,6 +14,8 @@ export declare class TypeCommandController<T extends CommandBehaviorHost> implem
14
14
  constructor(host: T, { events }?: TypeCommandControllerOptions);
15
15
  hostUpdated(): void;
16
16
  hostDisconnected(): void;
17
+ /** Dispatches the configured command for controls that handle their own activation. */
18
+ invoke(): boolean;
17
19
  get target(): HTMLElement | null;
18
20
  }
19
21
  export {};
@@ -15,9 +15,9 @@ var t = class {
15
15
  this.#e.forEach((e) => this.host.removeEventListener(e, this.#n));
16
16
  }
17
17
  #n = (e) => {
18
- e.defaultPrevented || this.#r();
18
+ e.defaultPrevented || this.invoke();
19
19
  };
20
- #r() {
20
+ invoke() {
21
21
  if (this.host.readOnly || this.host.disabled || !this.host.command) return !1;
22
22
  let e = this.target;
23
23
  return e ? (e.dispatchEvent(new globalThis.CommandEvent("command", {
@@ -1 +1 @@
1
- {"version":3,"file":"type-command.controller.js","names":[],"sources":["../../../src/internal/controllers/type-command.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getFlattenedDOMTree } from '../utils.js';\nimport type { ReactiveController, ReactiveElement } from './types.js';\n\ntype CommandBehaviorHost = ReactiveElement & {\n command?: string;\n commandForElement: HTMLElement | null;\n disabled: boolean;\n readOnly: boolean;\n};\n\ntype TypeCommandControllerOptions = {\n events?: readonly string[];\n};\n\nexport class TypeCommandController<T extends CommandBehaviorHost> implements ReactiveController {\n readonly #events: readonly string[];\n\n constructor(\n private host: T,\n { events = ['click'] }: TypeCommandControllerOptions = {}\n ) {\n this.#events = [...new Set(events)];\n this.host.addController(this);\n }\n\n hostUpdated() {\n this.#removeCommandBehavior();\n if (!this.host.readOnly && !this.host.disabled) {\n this.#events.forEach(eventType => this.host.addEventListener(eventType, this.#onCommand));\n }\n }\n\n hostDisconnected() {\n this.#removeCommandBehavior();\n }\n\n #removeCommandBehavior() {\n this.#events.forEach(eventType => this.host.removeEventListener(eventType, this.#onCommand));\n }\n\n #onCommand = (event: Event) => {\n if (!event.defaultPrevented) {\n this.#dispatchCommand();\n }\n };\n\n #dispatchCommand() {\n if (this.host.readOnly || this.host.disabled || !this.host.command) {\n return false;\n }\n\n const target = this.target;\n if (!target) {\n console.warn(\n 'commandForElement',\n this.host.commandForElement || this.host.getAttribute('commandfor'),\n 'not found'\n );\n return false;\n }\n\n target.dispatchEvent(new globalThis.CommandEvent('command', { command: this.host.command, source: this.host }));\n return true;\n }\n\n get target(): HTMLElement | null {\n if (this.host.commandForElement) {\n return this.host.commandForElement;\n }\n\n const id = this.host.getAttribute('commandfor');\n if (!id) {\n return null;\n }\n\n return getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(el => el.id === id) ?? null;\n }\n}\n"],"mappings":";;AAiBA,IAAa,IAAb,MAAgG;CAC9F;CAEA,YACE,GACA,EAAE,YAAS,CAAC,OAAO,MAAoC,CAAC,GACxD;EAEA,AAJQ,KAAA,OAAA,GAGR,KAAK,KAAU,CAAC,GAAG,IAAI,IAAI,CAAM,CAAC,GAClC,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,cAAc;EAEZ,AADA,KAAK,GAAuB,GACxB,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,KAAK,YACpC,KAAK,GAAQ,SAAQ,MAAa,KAAK,KAAK,iBAAiB,GAAW,KAAK,EAAU,CAAC;CAE5F;CAEA,mBAAmB;EACjB,KAAK,GAAuB;CAC9B;CAEA,KAAyB;EACvB,KAAK,GAAQ,SAAQ,MAAa,KAAK,KAAK,oBAAoB,GAAW,KAAK,EAAU,CAAC;CAC7F;CAEA,MAAc,MAAiB;EAC7B,AAAK,EAAM,oBACT,KAAK,GAAiB;CAE1B;CAEA,KAAmB;EACjB,IAAI,KAAK,KAAK,YAAY,KAAK,KAAK,YAAY,CAAC,KAAK,KAAK,SACzD,OAAO;EAGT,IAAM,IAAS,KAAK;EAWpB,OAVK,KASL,EAAO,cAAc,IAAI,WAAW,aAAa,WAAW;GAAE,SAAS,KAAK,KAAK;GAAS,QAAQ,KAAK;EAAK,CAAC,CAAC,GACvG,OATL,QAAQ,KACN,qBACA,KAAK,KAAK,qBAAqB,KAAK,KAAK,aAAa,YAAY,GAClE,WACF,GACO;CAKX;CAEA,IAAI,SAA6B;EAC/B,IAAI,KAAK,KAAK,mBACZ,OAAO,KAAK,KAAK;EAGnB,IAAM,IAAK,KAAK,KAAK,aAAa,YAAY;EAK9C,OAJK,IAIE,EAAoB,KAAK,KAAK,YAAY,CAAgB,CAAC,CAAC,MAAK,MAAM,EAAG,OAAO,CAAE,KAAK,OAHtF;CAIX;AACF"}
1
+ {"version":3,"file":"type-command.controller.js","names":[],"sources":["../../../src/internal/controllers/type-command.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getFlattenedDOMTree } from '../utils.js';\nimport type { ReactiveController, ReactiveElement } from './types.js';\n\ntype CommandBehaviorHost = ReactiveElement & {\n command?: string;\n commandForElement: HTMLElement | null;\n disabled?: boolean;\n readOnly?: boolean;\n};\n\ntype TypeCommandControllerOptions = {\n events?: readonly string[];\n};\n\nexport class TypeCommandController<T extends CommandBehaviorHost> implements ReactiveController {\n readonly #events: readonly string[];\n\n constructor(\n private host: T,\n { events = ['click'] }: TypeCommandControllerOptions = {}\n ) {\n this.#events = [...new Set(events)];\n this.host.addController(this);\n }\n\n hostUpdated() {\n this.#removeCommandBehavior();\n if (!this.host.readOnly && !this.host.disabled) {\n this.#events.forEach(eventType => this.host.addEventListener(eventType, this.#onCommand));\n }\n }\n\n hostDisconnected() {\n this.#removeCommandBehavior();\n }\n\n #removeCommandBehavior() {\n this.#events.forEach(eventType => this.host.removeEventListener(eventType, this.#onCommand));\n }\n\n #onCommand = (event: Event) => {\n if (!event.defaultPrevented) {\n this.invoke();\n }\n };\n\n /** Dispatches the configured command for controls that handle their own activation. */\n invoke() {\n if (this.host.readOnly || this.host.disabled || !this.host.command) {\n return false;\n }\n\n const target = this.target;\n if (!target) {\n console.warn(\n 'commandForElement',\n this.host.commandForElement || this.host.getAttribute('commandfor'),\n 'not found'\n );\n return false;\n }\n\n target.dispatchEvent(new globalThis.CommandEvent('command', { command: this.host.command, source: this.host }));\n return true;\n }\n\n get target(): HTMLElement | null {\n if (this.host.commandForElement) {\n return this.host.commandForElement;\n }\n\n const id = this.host.getAttribute('commandfor');\n if (!id) {\n return null;\n }\n\n return getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(el => el.id === id) ?? null;\n }\n}\n"],"mappings":";;AAiBA,IAAa,IAAb,MAAgG;CAC9F;CAEA,YACE,GACA,EAAE,YAAS,CAAC,OAAO,MAAoC,CAAC,GACxD;EAEA,AAJQ,KAAA,OAAA,GAGR,KAAK,KAAU,CAAC,GAAG,IAAI,IAAI,CAAM,CAAC,GAClC,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,cAAc;EAEZ,AADA,KAAK,GAAuB,GACxB,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,KAAK,YACpC,KAAK,GAAQ,SAAQ,MAAa,KAAK,KAAK,iBAAiB,GAAW,KAAK,EAAU,CAAC;CAE5F;CAEA,mBAAmB;EACjB,KAAK,GAAuB;CAC9B;CAEA,KAAyB;EACvB,KAAK,GAAQ,SAAQ,MAAa,KAAK,KAAK,oBAAoB,GAAW,KAAK,EAAU,CAAC;CAC7F;CAEA,MAAc,MAAiB;EAC7B,AAAK,EAAM,oBACT,KAAK,OAAO;CAEhB;CAGA,SAAS;EACP,IAAI,KAAK,KAAK,YAAY,KAAK,KAAK,YAAY,CAAC,KAAK,KAAK,SACzD,OAAO;EAGT,IAAM,IAAS,KAAK;EAWpB,OAVK,KASL,EAAO,cAAc,IAAI,WAAW,aAAa,WAAW;GAAE,SAAS,KAAK,KAAK;GAAS,QAAQ,KAAK;EAAK,CAAC,CAAC,GACvG,OATL,QAAQ,KACN,qBACA,KAAK,KAAK,qBAAqB,KAAK,KAAK,aAAa,YAAY,GAClE,WACF,GACO;CAKX;CAEA,IAAI,SAA6B;EAC/B,IAAI,KAAK,KAAK,mBACZ,OAAO,KAAK,KAAK;EAGnB,IAAM,IAAK,KAAK,KAAK,aAAa,YAAY;EAK9C,OAJK,IAIE,EAAoB,KAAK,KAAK,YAAY,CAAgB,CAAC,CAAC,MAAK,MAAM,EAAG,OAAO,CAAE,KAAK,OAHtF;CAIX;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nvidia-elements/forms",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "release": {
5
5
  "extends": "../../release.config.js"
6
6
  },
@@ -89,12 +89,12 @@
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.7.4",
92
+ "@nvidia-elements/lint": "2.9.0",
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",
96
96
  "axe-core": "4.11.0",
97
- "eslint": "10.12.0",
97
+ "eslint": "10.13.0",
98
98
  "lit": "3.3.3",
99
99
  "publint": "0.3.24",
100
100
  "typescript": "6.0.3",