@nvidia-elements/core 0.2.1 → 0.2.3

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 (145) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/accordion/accordion2.js +39 -39
  3. package/dist/alert/alert-group2.js +14 -14
  4. package/dist/alert/alert2.js +20 -20
  5. package/dist/avatar/avatar-group2.js +1 -1
  6. package/dist/avatar/avatar2.js +6 -6
  7. package/dist/badge/badge2.js +21 -21
  8. package/dist/breadcrumb/breadcrumb2.js +12 -12
  9. package/dist/bundles/index.d.ts +418 -1802
  10. package/dist/bundles/index.js +6 -6
  11. package/dist/button/button.d.ts +5 -2
  12. package/dist/button/button2.js +13 -13
  13. package/dist/button/button2.js.map +1 -1
  14. package/dist/button-group/button-group2.js +15 -15
  15. package/dist/card/card2.js +17 -17
  16. package/dist/chat-message/chat-message2.js +7 -7
  17. package/dist/checkbox/checkbox-group2.js +7 -7
  18. package/dist/checkbox/checkbox2.js +7 -7
  19. package/dist/color/color2.js +7 -7
  20. package/dist/combobox/combobox2.js +10 -10
  21. package/dist/copy-button/copy-button2.js +10 -10
  22. package/dist/custom-elements-jsx.d.ts +346 -613
  23. package/dist/custom-elements-vue.d.ts +346 -613
  24. package/dist/custom-elements.json +4870 -14220
  25. package/dist/data.html.json +252 -168
  26. package/dist/data.snippets.json +32 -32
  27. package/dist/date/date2.js +7 -7
  28. package/dist/datetime/datetime2.js +7 -7
  29. package/dist/dialog/dialog-footer2.js +6 -6
  30. package/dist/dialog/dialog-header2.js +6 -6
  31. package/dist/dialog/dialog2.js +19 -19
  32. package/dist/divider/divider2.js +5 -5
  33. package/dist/dot/dot2.js +8 -8
  34. package/dist/drawer/drawer-content2.js +6 -6
  35. package/dist/drawer/drawer-footer2.js +6 -6
  36. package/dist/drawer/drawer-header2.js +6 -6
  37. package/dist/drawer/drawer2.js +19 -19
  38. package/dist/dropdown/dropdown-footer2.js +6 -6
  39. package/dist/dropdown/dropdown-header2.js +6 -6
  40. package/dist/dropdown/dropdown2.js +16 -16
  41. package/dist/dropdown-group/dropdown-group.js +16 -16
  42. package/dist/dropzone/dropzone.d.ts +1 -404
  43. package/dist/dropzone/dropzone2.js +14 -14
  44. package/dist/dropzone/dropzone2.js.map +1 -1
  45. package/dist/file/file2.js +1 -1
  46. package/dist/format-datetime/format-datetime2.js +10 -10
  47. package/dist/format-number/format-number2.js +16 -16
  48. package/dist/format-relative-time/format-relative-time2.js +7 -7
  49. package/dist/forms/control/control2.js +19 -19
  50. package/dist/forms/control-group/control-group2.js +6 -6
  51. package/dist/forms/control-message/control-message2.js +9 -9
  52. package/dist/grid/cell/cell2.js +1 -1
  53. package/dist/grid/column/column2.js +10 -10
  54. package/dist/grid/footer/footer2.js +6 -6
  55. package/dist/grid/grid2.js +12 -12
  56. package/dist/grid/header/header2.js +9 -9
  57. package/dist/grid/placeholder/placeholder2.js +1 -1
  58. package/dist/grid/row/row2.js +9 -9
  59. package/dist/icon/icon2.js +15 -15
  60. package/dist/icon-button/icon-button2.js +9 -9
  61. package/dist/index.js +4 -4
  62. package/dist/input/input-group2.js +1 -1
  63. package/dist/input/input2.js +6 -6
  64. package/dist/internal/controllers/keynav-grid.controller.js +39 -39
  65. package/dist/internal/controllers/type-button.controller.examples.js.map +1 -1
  66. package/dist/internal/controllers/type-button.controller.examples.json +1 -1
  67. package/dist/internal/controllers/type-command.controller.d.ts +10 -1
  68. package/dist/internal/controllers/type-command.controller.js +23 -14
  69. package/dist/internal/controllers/type-command.controller.js.map +1 -1
  70. package/dist/internal/controllers/type-native-popover.utils.js +7 -7
  71. package/dist/internal/decorators/scoped-registry.js +24 -6
  72. package/dist/internal/decorators/scoped-registry.js.map +1 -1
  73. package/dist/internal/index.d.ts +0 -1
  74. package/dist/internal/index.js +40 -41
  75. package/dist/internal/services/global.service.js +1 -1
  76. package/dist/internal/utils/focus.js +1 -1
  77. package/dist/internal/utils/focus.js.map +1 -1
  78. package/dist/logo/logo2.js +6 -6
  79. package/dist/menu/menu-item.d.ts +4 -2
  80. package/dist/menu/menu-item2.js +12 -12
  81. package/dist/menu/menu-item2.js.map +1 -1
  82. package/dist/menu/menu2.js +10 -10
  83. package/dist/month/month2.js +7 -7
  84. package/dist/notification/notification-group2.js +11 -11
  85. package/dist/notification/notification2.js +22 -22
  86. package/dist/page/page-panel/page-panel-content2.js +1 -1
  87. package/dist/page/page-panel/page-panel-footer2.js +6 -6
  88. package/dist/page/page-panel/page-panel-header2.js +6 -6
  89. package/dist/page/page-panel/page-panel2.js +14 -14
  90. package/dist/page/page2.js +9 -9
  91. package/dist/page-header/page-header2.js +1 -1
  92. package/dist/page-loader/page-loader2.js +10 -10
  93. package/dist/pagination/pagination.d.ts +1 -404
  94. package/dist/pagination/pagination2.js +17 -17
  95. package/dist/pagination/pagination2.js.map +1 -1
  96. package/dist/panel/panel2.js +21 -21
  97. package/dist/password/password2.js +7 -7
  98. package/dist/preferences-input/preferences-input.d.ts +1 -404
  99. package/dist/preferences-input/preferences-input2.js +9 -9
  100. package/dist/preferences-input/preferences-input2.js.map +1 -1
  101. package/dist/progress-bar/progress-bar2.js +8 -8
  102. package/dist/progress-ring/progress-ring2.js +15 -15
  103. package/dist/progressive-filter-chip/progressive-filter-chip2.js +15 -15
  104. package/dist/pulse/pulse2.js +6 -6
  105. package/dist/radio/radio-group2.js +7 -7
  106. package/dist/radio/radio2.js +7 -7
  107. package/dist/range/range2.js +5 -5
  108. package/dist/resize-handle/resize-handle.d.ts +1 -404
  109. package/dist/resize-handle/resize-handle2.js +16 -16
  110. package/dist/resize-handle/resize-handle2.js.map +1 -1
  111. package/dist/search/search2.js +8 -8
  112. package/dist/select/select2.js +18 -18
  113. package/dist/skeleton/skeleton2.js +7 -7
  114. package/dist/sort-button/sort-button.d.ts +4 -2
  115. package/dist/sort-button/sort-button2.js +19 -19
  116. package/dist/sort-button/sort-button2.js.map +1 -1
  117. package/dist/sparkline/sparkline2.js +14 -14
  118. package/dist/star-rating/star-rating2.js +6 -6
  119. package/dist/steps/steps.d.ts +4 -2
  120. package/dist/steps/steps2.js +36 -36
  121. package/dist/steps/steps2.js.map +1 -1
  122. package/dist/switch/switch-group2.js +6 -6
  123. package/dist/switch/switch2.js +7 -7
  124. package/dist/tabs/tabs-group2.js +21 -21
  125. package/dist/tabs/tabs.d.ts +4 -2
  126. package/dist/tabs/tabs2.js +30 -30
  127. package/dist/tabs/tabs2.js.map +1 -1
  128. package/dist/tag/tag.d.ts +5 -2
  129. package/dist/tag/tag2.js +20 -20
  130. package/dist/tag/tag2.js.map +1 -1
  131. package/dist/textarea/textarea2.js +1 -1
  132. package/dist/time/time2.js +7 -7
  133. package/dist/toast/toast2.js +21 -21
  134. package/dist/toggletip/toggletip-footer2.js +6 -6
  135. package/dist/toggletip/toggletip-header2.js +6 -6
  136. package/dist/toggletip/toggletip2.js +17 -17
  137. package/dist/toolbar/toolbar2.js +11 -11
  138. package/dist/tooltip/tooltip2.js +16 -16
  139. package/dist/tree/tree-node2.js +30 -30
  140. package/dist/tree/tree2.js +14 -14
  141. package/dist/week/week2.js +7 -7
  142. package/package.json +3 -3
  143. package/dist/internal/base/button.d.ts +0 -114
  144. package/dist/internal/base/button.js +0 -117
  145. package/dist/internal/base/button.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { attachInternals as e } from "../../internal/utils/a11y.js";
2
- import { stateSelected as t } from "../../internal/controllers/state-selected.controller.js";
3
- import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
4
- import { audit as r } from "../../internal/controllers/audit.controller.js";
5
- import { useStyles as i } from "../../internal/styles/index.js";
1
+ import { audit as e } from "../../internal/controllers/audit.controller.js";
2
+ import { attachInternals as t } from "../../internal/utils/a11y.js";
3
+ import { stateSelected as n } from "../../internal/controllers/state-selected.controller.js";
4
+ import { useStyles as r } from "../../internal/styles/index.js";
5
+ import { __decorate as i } from "../../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
6
6
  import { GridCell as a } from "../cell/cell2.js";
7
7
  import o from "./row.js";
8
8
  import { LitElement as s, html as c } from "lit";
@@ -10,12 +10,12 @@ import { property as l } from "lit/decorators/property.js";
10
10
  //#region src/grid/row/row.ts
11
11
  var u = class extends s {
12
12
  static {
13
- this.styles = i([o]);
13
+ this.styles = r([o]);
14
14
  }
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-grid-row",
18
- version: "0.2.1",
18
+ version: "0.2.3",
19
19
  children: [a.metadata.tag]
20
20
  };
21
21
  }
@@ -23,10 +23,10 @@ var u = class extends s {
23
23
  return c`<div internal-host><slot></slot></div>`;
24
24
  }
25
25
  connectedCallback() {
26
- super.connectedCallback(), e(this), this._internals.role = "row";
26
+ super.connectedCallback(), t(this), this._internals.role = "row";
27
27
  }
28
28
  };
29
- n([l({ type: Boolean })], u.prototype, "selected", void 0), u = n([t(), r()], u);
29
+ i([l({ type: Boolean })], u.prototype, "selected", void 0), u = i([n(), e()], u);
30
30
  //#endregion
31
31
  export { u as GridRow };
32
32
 
@@ -1,9 +1,9 @@
1
1
  import { parseVersion as e } from "../internal/utils/objects.js";
2
2
  import { attachInternals as t } from "../internal/utils/a11y.js";
3
- import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
4
- import { useStyles as r } from "../internal/styles/index.js";
5
- import { ICON_IMPORTS as i } from "./icons.js";
6
- import a from "./icon.js";
3
+ import { useStyles as n } from "../internal/styles/index.js";
4
+ import { ICON_IMPORTS as r } from "./icons.js";
5
+ import i from "./icon.js";
6
+ import { __decorate as a } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
7
7
  import { LitElement as o, html as s, isServer as c } from "lit";
8
8
  import { property as l } from "lit/decorators/property.js";
9
9
  import { unsafeSVG as u } from "lit/directives/unsafe-svg.js";
@@ -11,16 +11,16 @@ import { state as d } from "lit/decorators/state.js";
11
11
  //#region src/icon/icon.ts
12
12
  var f = class e extends o {
13
13
  static {
14
- this.styles = r([a]);
14
+ this.styles = n([i]);
15
15
  }
16
16
  static {
17
17
  this.metadata = {
18
18
  tag: "nve-icon",
19
- version: "0.2.1"
19
+ version: "0.2.3"
20
20
  };
21
21
  }
22
22
  static {
23
- this._icons = i;
23
+ this._icons = r;
24
24
  }
25
25
  static get _iconsRegistry() {
26
26
  return this.registeredIcon?._icons ?? e._icons;
@@ -71,25 +71,25 @@ var f = class e extends o {
71
71
  }, this.svg = t;
72
72
  }
73
73
  };
74
- n([l({
74
+ a([l({
75
75
  type: String,
76
76
  reflect: !0
77
- })], f.prototype, "status", void 0), n([l({
77
+ })], f.prototype, "status", void 0), a([l({
78
78
  type: String,
79
79
  reflect: !0
80
- })], f.prototype, "size", void 0), n([l({
80
+ })], f.prototype, "size", void 0), a([l({
81
81
  type: String,
82
82
  reflect: !0
83
- })], f.prototype, "direction", void 0), n([l({
83
+ })], f.prototype, "direction", void 0), a([l({
84
84
  type: String,
85
85
  reflect: !0
86
- })], f.prototype, "name", void 0), n([d()], f.prototype, "svg", void 0);
86
+ })], f.prototype, "name", void 0), a([d()], f.prototype, "svg", void 0);
87
87
  function p(t) {
88
88
  if (typeof globalThis.customElements?.get == "function") {
89
- let n = e(t.metadata.version), r = e("0.2.1");
90
- n.minor <= r.minor && n.major <= r.major && (t._icons = {
89
+ let n = e(t.metadata.version), i = e("0.2.3");
90
+ n.minor <= i.minor && n.major <= i.major && (t._icons = {
91
91
  ...t._icons,
92
- ...i
92
+ ...r
93
93
  });
94
94
  }
95
95
  }
@@ -1,7 +1,7 @@
1
1
  import { removeEmptySlotWhitespace as e } from "../internal/utils/dom.js";
2
- import { __decorate as t } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
- import { scopedRegistry as n } from "../internal/decorators/scoped-registry.js";
4
- import { useStyles as r } from "../internal/styles/index.js";
2
+ import { scopedRegistry as t } from "../internal/decorators/scoped-registry.js";
3
+ import { useStyles as n } from "../internal/styles/index.js";
4
+ import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
5
5
  import { Icon as i } from "../icon/icon2.js";
6
6
  import { Button as a } from "../button/button2.js";
7
7
  import o from "./icon-button.js";
@@ -10,12 +10,12 @@ import { property as c } from "lit/decorators/property.js";
10
10
  //#region src/icon-button/icon-button.ts
11
11
  var l = class extends a {
12
12
  static {
13
- this.styles = r([...a.styles, o]);
13
+ this.styles = n([...a.styles, o]);
14
14
  }
15
15
  static {
16
16
  this.metadata = {
17
17
  tag: "nve-icon-button",
18
- version: "0.2.1"
18
+ version: "0.2.3"
19
19
  };
20
20
  }
21
21
  static {
@@ -25,16 +25,16 @@ var l = class extends a {
25
25
  return s`<div internal-host interaction-state focus-within aria-hidden="true"><slot @slotchange="${(t) => e(t.target)}"><nve-icon .name="${this.iconName}" .direction="${this.direction}" .size="${this.size}" aria-hidden="true" part="icon"></nve-icon></slot></div><slot name="anchor"></slot>`;
26
26
  }
27
27
  };
28
- t([c({
28
+ r([c({
29
29
  type: String,
30
30
  attribute: "icon-name"
31
- })], l.prototype, "iconName", void 0), t([c({
31
+ })], l.prototype, "iconName", void 0), r([c({
32
32
  type: String,
33
33
  reflect: !0
34
- })], l.prototype, "direction", void 0), t([c({
34
+ })], l.prototype, "direction", void 0), r([c({
35
35
  type: String,
36
36
  reflect: !0
37
- })], l.prototype, "size", void 0), l = t([n()], l);
37
+ })], l.prototype, "size", void 0), l = r([t()], l);
38
38
  //#endregion
39
39
  export { l as IconButton };
40
40
 
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { getThemeTokens as e } from "./internal/utils/dom.js";
2
- import { I18nService as t } from "./internal/services/i18n.service.js";
1
+ import { I18nService as e } from "./internal/services/i18n.service.js";
2
+ import { getThemeTokens as t } from "./internal/utils/dom.js";
3
3
  import { statusIcons as n } from "./internal/types/index.js";
4
4
  //#region src/index.ts
5
- var r = "0.2.1", i = "@nvidia-elements";
5
+ var r = "0.2.3", i = "@nvidia-elements";
6
6
  //#endregion
7
- export { t as I18nService, i as SCOPE, r as VERSION, e as getThemeTokens, n as statusIcons };
7
+ export { e as I18nService, i as SCOPE, r as VERSION, t as getThemeTokens, n as statusIcons };
8
8
 
9
9
  //# sourceMappingURL=index.js.map
@@ -11,7 +11,7 @@ var a = class extends n {
11
11
  static {
12
12
  this.metadata = {
13
13
  tag: "nve-input-group",
14
- version: "0.2.1"
14
+ version: "0.2.3"
15
15
  };
16
16
  }
17
17
  async connectedCallback() {
@@ -1,5 +1,5 @@
1
- import { __decorate as e } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
2
- import { useStyles as t } from "../internal/styles/index.js";
1
+ import { useStyles as e } from "../internal/styles/index.js";
2
+ import { __decorate as t } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
3
3
  import { Control as n } from "../forms/control/control2.js";
4
4
  import r from "./input.js";
5
5
  import { property as i } from "lit/decorators/property.js";
@@ -9,19 +9,19 @@ var a = r, o = class extends n {
9
9
  super(...e), this.rounded = !1;
10
10
  }
11
11
  static {
12
- this.styles = t([...n.styles, r]);
12
+ this.styles = e([...n.styles, r]);
13
13
  }
14
14
  static {
15
15
  this.metadata = {
16
16
  tag: "nve-input",
17
- version: "0.2.1"
17
+ version: "0.2.3"
18
18
  };
19
19
  }
20
20
  };
21
- e([i({
21
+ t([i({
22
22
  type: String,
23
23
  reflect: !0
24
- })], o.prototype, "container", void 0), e([i({
24
+ })], o.prototype, "container", void 0), t([i({
25
25
  type: Boolean,
26
26
  reflect: !0
27
27
  })], o.prototype, "rounded", void 0);
@@ -1,8 +1,8 @@
1
1
  import { GlobalStateService as e } from "../services/global.service.js";
2
- import { focusElement as t, getActiveElement as n, initializeKeyListItems as r, isSimpleFocusable as i, setActiveKeyListItem as a } from "../utils/focus.js";
3
- import { KeynavCode as o, getFlattenedDOMTree as s, getFlattenedFocusableItems as c, hasInvalidDOMGrid as l, isContextMenuClick as u, validKeyNavigationCode as d } from "../utils/dom.js";
4
- import { onChildListMutation as f, throttle as p } from "../utils/events.js";
5
- import { LogService as m } from "../services/log.service.js";
2
+ import { onChildListMutation as t, throttle as n } from "../utils/events.js";
3
+ import { LogService as r } from "../services/log.service.js";
4
+ import { focusElement as i, getActiveElement as a, initializeKeyListItems as o, isSimpleFocusable as s, setActiveKeyListItem as c } from "../utils/focus.js";
5
+ import { KeynavCode as l, getFlattenedDOMTree as u, getFlattenedFocusableItems as d, hasInvalidDOMGrid as f, isContextMenuClick as p, validKeyNavigationCode as m } from "../utils/dom.js";
6
6
  //#region src/internal/controllers/keynav-grid.controller.ts
7
7
  function h() {
8
8
  return (e) => e.addInitializer((e) => new g(e));
@@ -26,58 +26,58 @@ var g = class {
26
26
  this.host = e, this.host.addController(this);
27
27
  }
28
28
  async hostConnected() {
29
- await this.host.updateComplete, r(this.#r), this.#t.grid.addEventListener("keyup", (e) => this.#s(e)), this.#t.grid.addEventListener("keydown", (e) => this.#a(e)), this.#t.grid.addEventListener("mouseup", (e) => this.#i(e)), this.#e.push(f(this.host, p(() => r(this.#r), 500)));
29
+ await this.host.updateComplete, o(this.#r), this.#t.grid.addEventListener("keyup", (e) => this.#s(e)), this.#t.grid.addEventListener("keydown", (e) => this.#a(e)), this.#t.grid.addEventListener("mouseup", (e) => this.#i(e)), this.#e.push(t(this.host, n(() => o(this.#r), 500)));
30
30
  }
31
31
  hostDisconnected() {
32
32
  this.#e.forEach((e) => e?.disconnect());
33
33
  }
34
34
  #i(e) {
35
- if (!u(e)) {
35
+ if (!p(e)) {
36
36
  let t = e.composedPath()[0], n = this.#r.find((e) => e === t) ? t : null;
37
37
  n && this.#o(e, n);
38
38
  }
39
39
  }
40
40
  #a(t) {
41
- let r = Array.from(this.#n), a = Array.from(this.#r);
42
- if (e.state.env !== "production" && l(r)) {
43
- m.warn("Invalid grid structure, all rows must have the same number of cells");
41
+ let n = Array.from(this.#n), i = Array.from(this.#r);
42
+ if (e.state.env !== "production" && f(n)) {
43
+ r.warn("Invalid grid structure, all rows must have the same number of cells");
44
44
  return;
45
45
  }
46
- if (d(t) && i(n())) {
47
- let { x: e, y: n } = y(a, r, {
46
+ if (m(t) && s(a())) {
47
+ let { x: e, y: r } = y(i, n, {
48
48
  code: t.code,
49
49
  ctrlKey: t.ctrlKey,
50
50
  dir: this.host.dir
51
- }), i = Array.from(s(r[n])).filter((e) => !!a.find((t) => t === e))[e];
52
- this.#o(t, i), t.preventDefault();
51
+ }), a = Array.from(u(n[r])).filter((e) => !!i.find((t) => t === e))[e];
52
+ this.#o(t, a), t.preventDefault();
53
53
  }
54
54
  }
55
- #o(e, n) {
56
- a(this.#r, n);
57
- let r = c(n), o = r.filter((e) => i(e));
58
- o.length === 1 && r.length === 1 ? t(o[0]) : t(n);
59
- let s = {
55
+ #o(e, t) {
56
+ c(this.#r, t);
57
+ let n = d(t), r = n.filter((e) => s(e));
58
+ r.length === 1 && n.length === 1 ? i(r[0]) : i(t);
59
+ let a = {
60
60
  code: e instanceof KeyboardEvent ? e.code : null,
61
61
  shiftKey: e.shiftKey,
62
- activeItem: n
62
+ activeItem: t
63
63
  };
64
- n.dispatchEvent(new CustomEvent("nve-key-change", {
64
+ t.dispatchEvent(new CustomEvent("nve-key-change", {
65
65
  bubbles: !0,
66
66
  composed: !0,
67
- detail: s
67
+ detail: a
68
68
  }));
69
69
  }
70
70
  #s(e) {
71
71
  let t = Array.from(this.#r).find((e) => e.tabIndex === 0);
72
- e.code === "Escape" && t?.focus(), e.code === "Enter" && t === e.composedPath()[0] && c(t)[0]?.focus();
72
+ e.code === "Escape" && t?.focus(), e.code === "Enter" && t === e.composedPath()[0] && d(t)[0]?.focus();
73
73
  }
74
74
  };
75
75
  function _(e, t) {
76
- let n = t === "rtl" ? o.ArrowRight : o.ArrowLeft, r = t === "rtl" ? o.ArrowLeft : o.ArrowRight;
77
- return e === o.ArrowUp ? {
76
+ let n = t === "rtl" ? l.ArrowRight : l.ArrowLeft, r = t === "rtl" ? l.ArrowLeft : l.ArrowRight;
77
+ return e === l.ArrowUp ? {
78
78
  dx: 0,
79
79
  dy: -1
80
- } : e === o.ArrowDown ? {
80
+ } : e === l.ArrowDown ? {
81
81
  dx: 0,
82
82
  dy: 1
83
83
  } : e === n ? {
@@ -86,39 +86,39 @@ function _(e, t) {
86
86
  } : e === r ? {
87
87
  dx: 1,
88
88
  dy: 0
89
- } : e === o.PageUp ? {
89
+ } : e === l.PageUp ? {
90
90
  dx: 0,
91
91
  dy: -4
92
- } : e === o.PageDown ? {
92
+ } : e === l.PageDown ? {
93
93
  dx: 0,
94
94
  dy: 4
95
95
  } : null;
96
96
  }
97
97
  function v(e, t, n) {
98
- let { x: r, y: i } = t, { columnCount: a, rowCount: s, ctrlKey: c } = n;
99
- return e === o.End ? {
98
+ let { x: r, y: i } = t, { columnCount: a, rowCount: o, ctrlKey: s } = n;
99
+ return e === l.End ? {
100
100
  x: a,
101
- y: c ? s : i
102
- } : e === o.Home ? {
101
+ y: s ? o : i
102
+ } : e === l.Home ? {
103
103
  x: 0,
104
- y: c ? 0 : i
104
+ y: s ? 0 : i
105
105
  } : {
106
106
  x: r,
107
107
  y: i
108
108
  };
109
109
  }
110
110
  function y(e, t, n) {
111
- let r = e.find((e) => e.tabIndex === 0), i = t.find((e) => s(e).find((e) => e === r)), a = Array.from(s(i)).filter((t) => !!e.find((e) => e === t)), o = t.length - 1, c = a.length - 1, l = a.indexOf(r), u = t.indexOf(i), d = _(n.code, n.dir);
112
- return d ? (l = Math.max(0, Math.min(c, l + d.dx)), u = Math.max(0, Math.min(o, u + d.dy))) : {x: l, y: u} = v(n.code, {
113
- x: l,
114
- y: u
111
+ let r = e.find((e) => e.tabIndex === 0), i = t.find((e) => u(e).find((e) => e === r)), a = Array.from(u(i)).filter((t) => !!e.find((e) => e === t)), o = t.length - 1, s = a.length - 1, c = a.indexOf(r), l = t.indexOf(i), d = _(n.code, n.dir);
112
+ return d ? (c = Math.max(0, Math.min(s, c + d.dx)), l = Math.max(0, Math.min(o, l + d.dy))) : {x: c, y: l} = v(n.code, {
113
+ x: c,
114
+ y: l
115
115
  }, {
116
- columnCount: c,
116
+ columnCount: s,
117
117
  rowCount: o,
118
118
  ctrlKey: n.ctrlKey
119
119
  }), {
120
- x: l,
121
- y: u
120
+ x: c,
121
+ y: l
122
122
  };
123
123
  }
124
124
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"type-button.controller.examples.js","names":[],"sources":["../../../src/internal/controllers/type-button.controller.examples.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { css, html } from 'lit';\nimport { BaseButton } from '@nvidia-elements/core/internal';\nimport '@nvidia-elements/core/card/define.js';\nimport '@nvidia-elements/core/button/define.js';\nimport '@nvidia-elements/core/icon-button/define.js';\n\nexport default {\n title: 'Internal/Controllers'\n}\n\nclass UIButton extends BaseButton {\n static styles = [css`\n :host {\n --background: hsl(0, 0%, 90%);\n --color: hsl(0, 0%, 0%);\n --cursor: pointer;\n display: inline-flex;\n position: relative;\n }\n\n [internal-host] {\n background: var(--background);\n color: var(--color);\n cursor: var(--cursor);\n padding: 8px 12px;\n min-width: 75px;\n text-align: center;\n }\n\n /* element states */\n :host(:hover) {\n --background: hsl(0, 0%, 95%);\n }\n\n :host(:state(active)) {\n --background: hsl(0, 0%, 85%);\n }\n\n :host(:state(pressed)) {\n --background: hsl(0, 0%, 85%);\n }\n\n :host(:state(expanded)) {\n --background: hsl(0, 0%, 85%);\n }\n\n :host(:state(disabled)) {\n --background: hsl(0, 0%, 80%);\n --color: hsl(0, 0%, 60%);\n --cursor: not-allowed;\n }\n\n :host(:state(readonly)) {\n --cursor: initial;\n --color: blue;\n }\n\n /* anchor styles */\n [internal-host]:focus-within {\n outline: Highlight solid 2px;\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n ::slotted(a) {\n color: var(--color) !important;\n text-decoration: none !important;\n outline: 0 !important;\n }\n\n ::slotted(a)::after {\n position: absolute;\n content: '';\n inset: 0;\n display: block;\n }\n `]\n}\n\ncustomElements.get('ui-button') || customElements.define('ui-button', UIButton);\n\n/**\n * Example of custom element button using the base button and controllers.\n * When a custom element extends the base button it will inherit all the\n * necessary button behaviors and states.\n * @summary Custom button element using BaseButton with pressed, expanded, disabled, and link states.\n * @tags test-case\n */\nexport const TypeButtonDemo = {\n render: () => html`\n<ui-button>button</ui-button>\n<ui-button pressed>pressed</ui-button>\n<ui-button expanded>expanded</ui-button>\n<ui-button selected>selected</ui-button>\n<ui-button disabled>disabled</ui-button>\n<ui-button><a href=\"#\">link</a></ui-button>\n\n<form id=\"type-button-demo-form\" style=\"display: inline-flex;\">\n <ui-button type=\"submit\">submit</ui-button>\n</form>\n<script type=\"module\">\n const form = document.querySelector('#type-button-demo-form');\n form.addEventListener('submit', (e) => {\n e.preventDefault();\n alert('submit!');\n });\n</script>`\n};\n"],"mappings":";AAGA,IAAA,IAAc"}
1
+ {"version":3,"file":"type-button.controller.examples.js","names":[],"sources":["../../../src/internal/controllers/type-button.controller.examples.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { css, html, LitElement } from 'lit';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport '@nvidia-elements/core/card/define.js';\nimport '@nvidia-elements/core/button/define.js';\nimport '@nvidia-elements/core/icon-button/define.js';\n\nexport default {\n title: 'Internal/Controllers'\n}\n\nclass UIButton extends ButtonFormControlMixin(LitElement) {\n static styles = [css`\n :host {\n --background: hsl(0, 0%, 90%);\n --color: hsl(0, 0%, 0%);\n --cursor: pointer;\n display: inline-flex;\n position: relative;\n }\n\n [internal-host] {\n background: var(--background);\n color: var(--color);\n cursor: var(--cursor);\n padding: 8px 12px;\n min-width: 75px;\n text-align: center;\n }\n\n /* element states */\n :host(:hover) {\n --background: hsl(0, 0%, 95%);\n }\n\n :host(:state(active)) {\n --background: hsl(0, 0%, 85%);\n }\n\n :host(:state(pressed)) {\n --background: hsl(0, 0%, 85%);\n }\n\n :host(:state(expanded)) {\n --background: hsl(0, 0%, 85%);\n }\n\n :host(:state(disabled)) {\n --background: hsl(0, 0%, 80%);\n --color: hsl(0, 0%, 60%);\n --cursor: not-allowed;\n }\n\n :host(:state(readonly)) {\n --cursor: initial;\n --color: blue;\n }\n\n /* anchor styles */\n [internal-host]:focus-within {\n outline: Highlight solid 2px;\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n ::slotted(a) {\n color: var(--color) !important;\n text-decoration: none !important;\n outline: 0 !important;\n }\n\n ::slotted(a)::after {\n position: absolute;\n content: '';\n inset: 0;\n display: block;\n }\n `]\n}\n\ncustomElements.get('ui-button') || customElements.define('ui-button', UIButton);\n\n/**\n * Example of custom element button using the button form control mixin.\n * When a custom element applies the mixin it inherits button behaviors and states.\n * @summary Custom button element using ButtonFormControlMixin with pressed, expanded, disabled, and link states.\n * @tags test-case\n */\nexport const TypeButtonDemo = {\n render: () => html`\n<ui-button>button</ui-button>\n<ui-button pressed>pressed</ui-button>\n<ui-button expanded>expanded</ui-button>\n<ui-button selected>selected</ui-button>\n<ui-button disabled>disabled</ui-button>\n<ui-button><a href=\"#\">link</a></ui-button>\n\n<form id=\"type-button-demo-form\" style=\"display: inline-flex;\">\n <ui-button type=\"submit\">submit</ui-button>\n</form>\n<script type=\"module\">\n const form = document.querySelector('#type-button-demo-form');\n form.addEventListener('submit', (e) => {\n e.preventDefault();\n alert('submit!');\n });\n</script>`\n};\n"],"mappings":";AAGA,IAAA,IAAc"}
@@ -5,7 +5,7 @@
5
5
  "id": "internal-controllers-type-button.controller-type-button-demo",
6
6
  "name": "TypeButtonDemo",
7
7
  "template": "<ui-button>button</ui-button>\n<ui-button pressed>pressed</ui-button>\n<ui-button expanded>expanded</ui-button>\n<ui-button selected>selected</ui-button>\n<ui-button disabled>disabled</ui-button>\n<ui-button><a href=\"#\">link</a></ui-button>\n<form id=\"type-button-demo-form\" style=\"display: inline-flex\">\n <ui-button type=\"submit\">submit</ui-button>\n</form>\n<script type=\"module\">\n const form = document.querySelector(\"#type-button-demo-form\");\n form.addEventListener(\"submit\", (e) => {\n e.preventDefault();\n alert(\"submit!\");\n });\n</script>\n",
8
- "summary": "Custom button element using BaseButton with pressed, expanded, disabled, and link states.",
8
+ "summary": "Custom button element using ButtonFormControlMixin with pressed, expanded, disabled, and link states.",
9
9
  "description": "",
10
10
  "composition": false,
11
11
  "tags": [
@@ -9,12 +9,21 @@ export type Command = ReactiveElement & HTMLElement & {
9
9
  commandfor: string | null;
10
10
  commandForElement: HTMLElement | null;
11
11
  readOnly: boolean;
12
+ /**
13
+ * @deprecated Use `readOnly`. The `readonly` attribute remains supported.
14
+ */
15
+ readonly?: boolean;
12
16
  disabled: boolean;
13
17
  };
14
18
  export declare class TypeCommandController<T extends Command> implements ReactiveController {
15
19
  #private;
16
20
  private host;
17
- constructor(host: T);
21
+ constructor(host: T, options?: TypeCommandControllerOptions);
22
+ get target(): HTMLElement | null;
18
23
  hostUpdated(): Promise<void>;
19
24
  hostDisconnected(): void;
25
+ dispatchCommand(): boolean;
26
+ }
27
+ export interface TypeCommandControllerOptions {
28
+ trigger?: 'click' | 'manual';
20
29
  }
@@ -4,27 +4,36 @@ function t() {
4
4
  return (e) => e.addInitializer((e) => new n(e));
5
5
  }
6
6
  var n = class {
7
- constructor(e) {
8
- this.host = e, this.host.addController(this);
7
+ #e;
8
+ constructor(e, t = {}) {
9
+ this.host = e, this.#e = t.trigger ?? "click", this.host.addController(this);
10
+ }
11
+ get target() {
12
+ return this.host.commandForElement ? this.host.commandForElement : this.host.commandfor ? e(this.host.getRootNode()).find((e) => e.id === this.host.commandfor) ?? null : null;
9
13
  }
10
14
  async hostUpdated() {
11
- await this.host.updateComplete, this.#e();
15
+ await this.host.updateComplete, this.#n();
12
16
  }
13
17
  hostDisconnected() {
14
- this.host.removeEventListener("click", this.#t);
18
+ this.host.removeEventListener("click", this.#r);
19
+ }
20
+ get #t() {
21
+ return this.host.readOnly || this.host.readonly === !0;
15
22
  }
16
- #e() {
17
- !this.host.readOnly && !this.host.disabled ? this.host.addEventListener("click", this.#t) : this.host.removeEventListener("click", this.#t);
23
+ #n() {
24
+ this.#e === "manual" || this.#t || this.host.disabled ? this.host.removeEventListener("click", this.#r) : this.host.addEventListener("click", this.#r);
18
25
  }
19
- #t = () => {
20
- if ((this.host.commandfor || this.host.commandForElement) && globalThis.CommandEvent) {
21
- let t = e(this.host.getRootNode()).find((e) => e.id === this.host.commandfor || e === this.host.commandForElement);
22
- t ? t.dispatchEvent(new globalThis.CommandEvent("command", {
23
- command: this.host.command,
24
- source: this.host
25
- })) : console.warn("commandForElement", this.host.commandfor || this.host.commandForElement, "not found");
26
- }
26
+ #r = (e) => {
27
+ e.defaultPrevented || this.dispatchCommand();
27
28
  };
29
+ dispatchCommand() {
30
+ if (this.#t || this.host.disabled || !this.host.command) return !1;
31
+ let e = this.target;
32
+ return e ? (e.dispatchEvent(new globalThis.CommandEvent("command", {
33
+ command: this.host.command,
34
+ source: this.host
35
+ })), !0) : ((this.host.commandfor || this.host.commandForElement) && console.warn("commandForElement", this.host.commandfor || this.host.commandForElement, "not found"), !1);
36
+ }
28
37
  };
29
38
  //#endregion
30
39
  export { n as TypeCommandController, t as typeCommand };
@@ -1 +1 @@
1
- {"version":3,"file":"type-command.controller.js","names":["#updateListener","#triggerCommand"],"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 type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { getFlattenedDOMTree } from '../utils/dom.js';\n\n/**\n * Adds Invoker Commands API support for interactive custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\nexport function typeCommand<T extends Command>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new TypeCommandController(instance));\n}\n\nexport type Command = ReactiveElement &\n HTMLElement & {\n command: string;\n commandfor: string | null;\n commandForElement: HTMLElement | null;\n readOnly: boolean;\n disabled: boolean;\n };\n\nexport class TypeCommandController<T extends Command> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n async hostUpdated() {\n await this.host.updateComplete;\n this.#updateListener();\n }\n\n hostDisconnected() {\n this.host.removeEventListener('click', this.#triggerCommand);\n }\n\n #updateListener() {\n if (!this.host.readOnly && !this.host.disabled) {\n this.host.addEventListener('click', this.#triggerCommand);\n } else {\n this.host.removeEventListener('click', this.#triggerCommand);\n }\n }\n\n #triggerCommand = () => {\n if ((this.host.commandfor || this.host.commandForElement) && globalThis.CommandEvent) {\n const match = getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(\n el => el.id === this.host.commandfor || el === this.host.commandForElement\n );\n if (!match) {\n console.warn('commandForElement', this.host.commandfor || this.host.commandForElement, 'not found');\n } else {\n match.dispatchEvent(new globalThis.CommandEvent('command', { command: this.host.command, source: this.host }));\n }\n }\n };\n}\n"],"mappings":";;AAWA,SAAgB,IAAiD;CAC/D,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAsB,CAAQ,CAAC;AAC/E;AAWA,IAAa,IAAb,MAAoF;CAClF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,MAAM,cAAc;EAElB,AADA,MAAM,KAAK,KAAK,gBAChB,KAAKA,GAAgB;CACvB;CAEA,mBAAmB;EACjB,KAAK,KAAK,oBAAoB,SAAS,KAAKC,EAAe;CAC7D;CAEA,KAAkB;EAChB,AAAI,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,KAAK,WACpC,KAAK,KAAK,iBAAiB,SAAS,KAAKA,EAAe,IAExD,KAAK,KAAK,oBAAoB,SAAS,KAAKA,EAAe;CAE/D;CAEA,WAAwB;EACtB,KAAK,KAAK,KAAK,cAAc,KAAK,KAAK,sBAAsB,WAAW,cAAc;GACpF,IAAM,IAAQ,EAAoB,KAAK,KAAK,YAAY,CAAgB,EAAE,MACxE,MAAM,EAAG,OAAO,KAAK,KAAK,cAAc,MAAO,KAAK,KAAK,iBAC3D;GACA,AAAK,IAGH,EAAM,cAAc,IAAI,WAAW,aAAa,WAAW;IAAE,SAAS,KAAK,KAAK;IAAS,QAAQ,KAAK;GAAK,CAAC,CAAC,IAF7G,QAAQ,KAAK,qBAAqB,KAAK,KAAK,cAAc,KAAK,KAAK,mBAAmB,WAAW;EAItG;CACF;AACF"}
1
+ {"version":3,"file":"type-command.controller.js","names":["#trigger","#updateListener","#triggerCommand","#isReadOnly"],"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 type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { getFlattenedDOMTree } from '../utils/dom.js';\n\n/**\n * Adds Invoker Commands API support for interactive custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\nexport function typeCommand<T extends Command>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new TypeCommandController(instance));\n}\n\nexport type Command = ReactiveElement &\n HTMLElement & {\n command: string;\n commandfor: string | null;\n commandForElement: HTMLElement | null;\n readOnly: boolean;\n /**\n * @deprecated Use `readOnly`. The `readonly` attribute remains supported.\n */\n readonly?: boolean;\n disabled: boolean;\n };\n\nexport class TypeCommandController<T extends Command> implements ReactiveController {\n #trigger: 'click' | 'manual';\n\n constructor(\n private host: T,\n options: TypeCommandControllerOptions = {}\n ) {\n this.#trigger = options.trigger ?? 'click';\n this.host.addController(this);\n }\n\n get target(): HTMLElement | null {\n if (this.host.commandForElement) {\n return this.host.commandForElement;\n }\n\n if (!this.host.commandfor) {\n return null;\n }\n\n return (\n getFlattenedDOMTree(this.host.getRootNode() as HTMLElement).find(el => el.id === this.host.commandfor) ?? null\n );\n }\n\n async hostUpdated() {\n await this.host.updateComplete;\n this.#updateListener();\n }\n\n hostDisconnected() {\n this.host.removeEventListener('click', this.#triggerCommand);\n }\n\n get #isReadOnly() {\n return this.host.readOnly || this.host.readonly === true;\n }\n\n #updateListener() {\n if (this.#trigger === 'manual' || this.#isReadOnly || this.host.disabled) {\n this.host.removeEventListener('click', this.#triggerCommand);\n } else {\n this.host.addEventListener('click', this.#triggerCommand);\n }\n }\n\n #triggerCommand = (event: Event) => {\n if (event.defaultPrevented) {\n return;\n }\n\n this.dispatchCommand();\n };\n\n dispatchCommand() {\n if (this.#isReadOnly || this.host.disabled || !this.host.command) {\n return false;\n }\n\n const target = this.target;\n if (!target) {\n if (this.host.commandfor || this.host.commandForElement) {\n console.warn('commandForElement', this.host.commandfor || this.host.commandForElement, '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\nexport interface TypeCommandControllerOptions {\n trigger?: 'click' | 'manual';\n}\n"],"mappings":";;AAWA,SAAgB,IAAiD;CAC/D,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAsB,CAAQ,CAAC;AAC/E;AAeA,IAAa,IAAb,MAAoF;CAClF;CAEA,YACE,GACA,IAAwC,CAAC,GACzC;EAEA,AAJQ,KAAA,OAAA,GAGR,KAAKA,KAAW,EAAQ,WAAW,SACnC,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,IAAI,SAA6B;EAS/B,OARI,KAAK,KAAK,oBACL,KAAK,KAAK,oBAGd,KAAK,KAAK,aAKb,EAAoB,KAAK,KAAK,YAAY,CAAgB,EAAE,MAAK,MAAM,EAAG,OAAO,KAAK,KAAK,UAAU,KAAK,OAJnG;CAMX;CAEA,MAAM,cAAc;EAElB,AADA,MAAM,KAAK,KAAK,gBAChB,KAAKC,GAAgB;CACvB;CAEA,mBAAmB;EACjB,KAAK,KAAK,oBAAoB,SAAS,KAAKC,EAAe;CAC7D;CAEA,IAAIC,KAAc;EAChB,OAAO,KAAK,KAAK,YAAY,KAAK,KAAK,aAAa;CACtD;CAEA,KAAkB;EAChB,AAAI,KAAKH,OAAa,YAAY,KAAKG,MAAe,KAAK,KAAK,WAC9D,KAAK,KAAK,oBAAoB,SAAS,KAAKD,EAAe,IAE3D,KAAK,KAAK,iBAAiB,SAAS,KAAKA,EAAe;CAE5D;CAEA,MAAmB,MAAiB;EAC9B,EAAM,oBAIV,KAAK,gBAAgB;CACvB;CAEA,kBAAkB;EAChB,IAAI,KAAKC,MAAe,KAAK,KAAK,YAAY,CAAC,KAAK,KAAK,SACvD,OAAO;EAGT,IAAM,IAAS,KAAK;EASpB,OARK,KAOL,EAAO,cAAc,IAAI,WAAW,aAAa,WAAW;GAAE,SAAS,KAAK,KAAK;GAAS,QAAQ,KAAK;EAAK,CAAC,CAAC,GACvG,QAPD,KAAK,KAAK,cAAc,KAAK,KAAK,sBACpC,QAAQ,KAAK,qBAAqB,KAAK,KAAK,cAAc,KAAK,KAAK,mBAAmB,WAAW,GAE7F;CAKX;AACF"}
@@ -1,20 +1,20 @@
1
1
  import { getIdMatchNotFoundWarning as e } from "../utils/audit-logs.js";
2
- import { getFlattenedDOMTree as t } from "../utils/dom.js";
3
- import { LogService as n } from "../services/log.service.js";
2
+ import { LogService as t } from "../services/log.service.js";
3
+ import { getFlattenedDOMTree as n } from "../utils/dom.js";
4
4
  //#region src/internal/controllers/type-native-popover.utils.ts
5
- function r(e, n) {
6
- return typeof n == "string" ? t(e.parentNode).filter((e) => e?.id !== "").find((e) => e.id === n) ?? globalThis.document.body : n;
5
+ function r(e, t) {
6
+ return typeof t == "string" ? n(e.parentNode).filter((e) => e?.id !== "").find((e) => e.id === t) ?? globalThis.document.body : t;
7
7
  }
8
8
  function i(r) {
9
9
  let i = r.anchor ?? r._activeTrigger;
10
10
  if (typeof i == "string" && i?.length) {
11
- let a = t(r.parentNode).find((e) => e.id === i);
12
- return a || n.warn(e(i)), a ?? globalThis.document.body;
11
+ let a = n(r.parentNode).find((e) => e.id === i);
12
+ return a || t.warn(e(i)), a ?? globalThis.document.body;
13
13
  } else if (i && i !== globalThis.document.body) return i;
14
14
  else return globalThis.document.body;
15
15
  }
16
16
  function a(e) {
17
- return !!t(e).filter((e) => e.popover && e.matches(":popover-open")).length;
17
+ return !!n(e).filter((e) => e.popover && e.matches(":popover-open")).length;
18
18
  }
19
19
  //#endregion
20
20
  export { i as getHostAnchor, r as getHostTrigger, a as hasOpenPopover };
@@ -1,21 +1,39 @@
1
1
  import { GlobalStateService as e } from "../services/global.service.js";
2
2
  import { defineElement as t, supportsScopedRegistry as n } from "../utils/dom.js";
3
3
  //#region src/internal/decorators/scoped-registry.ts
4
- function r() {
4
+ var r = /* @__PURE__ */ new WeakSet();
5
+ function i(e, t) {
6
+ return { importNode: (n, r = !1) => e.importNode(n, {
7
+ customElementRegistry: t,
8
+ selfOnly: !r
9
+ }) };
10
+ }
11
+ function a(e, t) {
12
+ if (r.has(e)) return;
13
+ let n = e.prototype, a = n.createRenderRoot;
14
+ a && (r.add(e), Object.defineProperty(n, "createRenderRoot", {
15
+ configurable: !0,
16
+ value() {
17
+ let e = a.call(this);
18
+ return e instanceof ShadowRoot && (this.renderOptions ??= {}, this.renderOptions.creationScope = i(e.ownerDocument, t)), e;
19
+ }
20
+ }));
21
+ }
22
+ function o() {
5
23
  return (r) => {
6
24
  let i = r;
7
25
  e.state.scopedRegistry ??= {};
8
- let a = e.state.scopedRegistry[i.metadata.version] ?? customElements;
9
- n && Object.defineProperty(i, "shadowRootOptions", {
26
+ let o = e.state.scopedRegistry[i.metadata.version] ?? customElements;
27
+ n && (Object.defineProperty(i, "shadowRootOptions", {
10
28
  configurable: !0,
11
29
  value: {
12
30
  ...i.shadowRootOptions ?? { mode: "open" },
13
- customElementRegistry: a
31
+ customElementRegistry: o
14
32
  }
15
- }), t(i, a);
33
+ }), a(i, o)), t(i, o);
16
34
  };
17
35
  }
18
36
  //#endregion
19
- export { r as scopedRegistry };
37
+ export { o as scopedRegistry };
20
38
 
21
39
  //# sourceMappingURL=scoped-registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scoped-registry.js","names":[],"sources":["../../../src/internal/decorators/scoped-registry.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { GlobalStateService } from '../services/global.service.js';\nimport type { ElementDefinition, LegacyDecoratorTarget } from '../types/index.js';\nimport { defineElement, supportsScopedRegistry } from '../utils/dom.js';\n\n/** decorator which registers element dependencies with the scoped custom element registry when available */\nexport function scopedRegistry(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => {\n const element = target as unknown as ElementDefinition;\n GlobalStateService.state.scopedRegistry ??= {};\n const customElementRegistry = GlobalStateService.state.scopedRegistry[element.metadata.version] ?? customElements;\n if (supportsScopedRegistry) {\n Object.defineProperty(element, 'shadowRootOptions', {\n configurable: true,\n value: { ...(element.shadowRootOptions ?? { mode: 'open' }), customElementRegistry }\n });\n }\n defineElement(element, customElementRegistry);\n };\n}\n"],"mappings":";;;AAQA,SAAgB,IAAiC;CAC/C,QAAQ,MAAkC;EACxC,IAAM,IAAU;EAChB,EAAmB,MAAM,mBAAmB,CAAC;EAC7C,IAAM,IAAwB,EAAmB,MAAM,eAAe,EAAQ,SAAS,YAAY;EAOnG,AANI,KACF,OAAO,eAAe,GAAS,qBAAqB;GAClD,cAAc;GACd,OAAO;IAAE,GAAI,EAAQ,qBAAqB,EAAE,MAAM,OAAO;IAAI;GAAsB;EACrF,CAAC,GAEH,EAAc,GAAS,CAAqB;CAC9C;AACF"}
1
+ {"version":3,"file":"scoped-registry.js","names":[],"sources":["../../../src/internal/decorators/scoped-registry.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { RenderOptions } from 'lit';\nimport { GlobalStateService } from '../services/global.service.js';\nimport type { ElementDefinition, LegacyDecoratorTarget } from '../types/index.js';\nimport { defineElement, supportsScopedRegistry } from '../utils/dom.js';\n\ninterface ScopedRegistryHost extends HTMLElement {\n createRenderRoot?: () => HTMLElement | DocumentFragment;\n renderOptions?: RenderOptions;\n}\n\nconst litCreationScopeElements = new WeakSet<ElementDefinition>();\n\n/** Lit passes a legacy `deep` boolean, but scoped registries require `ImportNodeOptions`. https://html.spec.whatwg.org/multipage/custom-elements.html#scoped-custom-element-registries */\nfunction createScopedCreationScope(ownerDocument: Document, customElementRegistry: CustomElementRegistry) {\n return {\n importNode: (node: Node, deep = false) =>\n ownerDocument.importNode(node, {\n customElementRegistry,\n selfOnly: !deep\n })\n } satisfies NonNullable<RenderOptions['creationScope']>;\n}\n\nfunction attachLitCreationScope(element: ElementDefinition, customElementRegistry: CustomElementRegistry) {\n if (litCreationScopeElements.has(element)) return;\n\n const host = element.prototype as ScopedRegistryHost;\n const createRenderRoot = host.createRenderRoot;\n if (!createRenderRoot) return;\n\n litCreationScopeElements.add(element);\n Object.defineProperty(host, 'createRenderRoot', {\n configurable: true,\n value(this: ScopedRegistryHost) {\n const renderRoot = createRenderRoot.call(this);\n if (renderRoot instanceof ShadowRoot) {\n this.renderOptions ??= {};\n this.renderOptions.creationScope = createScopedCreationScope(renderRoot.ownerDocument, customElementRegistry);\n }\n return renderRoot;\n }\n });\n}\n\n/** decorator which registers element dependencies with the scoped custom element registry when available */\nexport function scopedRegistry(): ClassDecorator {\n return (target: LegacyDecoratorTarget) => {\n const element = target as unknown as ElementDefinition;\n GlobalStateService.state.scopedRegistry ??= {};\n const customElementRegistry = GlobalStateService.state.scopedRegistry[element.metadata.version] ?? customElements;\n if (supportsScopedRegistry) {\n Object.defineProperty(element, 'shadowRootOptions', {\n configurable: true,\n value: { ...(element.shadowRootOptions ?? { mode: 'open' }), customElementRegistry }\n });\n attachLitCreationScope(element, customElementRegistry);\n }\n defineElement(element, customElementRegistry);\n };\n}\n"],"mappings":";;;AAaA,IAAM,oBAA2B,IAAI,QAA2B;AAGhE,SAAS,EAA0B,GAAyB,GAA8C;CACxG,OAAO,EACL,aAAa,GAAY,IAAO,OAC9B,EAAc,WAAW,GAAM;EAC7B;EACA,UAAU,CAAC;CACb,CAAC,EACL;AACF;AAEA,SAAS,EAAuB,GAA4B,GAA8C;CACxG,IAAI,EAAyB,IAAI,CAAO,GAAG;CAE3C,IAAM,IAAO,EAAQ,WACf,IAAmB,EAAK;CACzB,MAEL,EAAyB,IAAI,CAAO,GACpC,OAAO,eAAe,GAAM,oBAAoB;EAC9C,cAAc;EACd,QAAgC;GAC9B,IAAM,IAAa,EAAiB,KAAK,IAAI;GAK7C,OAJI,aAAsB,eACxB,KAAK,kBAAkB,CAAC,GACxB,KAAK,cAAc,gBAAgB,EAA0B,EAAW,eAAe,CAAqB,IAEvG;EACT;CACF,CAAC;AACH;AAGA,SAAgB,IAAiC;CAC/C,QAAQ,MAAkC;EACxC,IAAM,IAAU;EAChB,EAAmB,MAAM,mBAAmB,CAAC;EAC7C,IAAM,IAAwB,EAAmB,MAAM,eAAe,EAAQ,SAAS,YAAY;EAQnG,AAPI,MACF,OAAO,eAAe,GAAS,qBAAqB;GAClD,cAAc;GACd,OAAO;IAAE,GAAI,EAAQ,qBAAqB,EAAE,MAAM,OAAO;IAAI;GAAsB;EACrF,CAAC,GACD,EAAuB,GAAS,CAAqB,IAEvD,EAAc,GAAS,CAAqB;CAC9C;AACF"}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @internal private common utilities for Elements
3
3
  */
4
- export * from './base/button.js';
5
4
  export * from './controllers/audit.controller.js';
6
5
  export * from './controllers/i18n.controller.js';
7
6
  export * from './controllers/keynav-grid.controller.js';