@nvidia-elements/core 2.23.3 → 2.23.5
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 +16 -0
- package/dist/accordion/accordion2.js +49 -49
- package/dist/accordion/accordion2.js.map +1 -1
- package/dist/alert/alert-group2.js +22 -21
- package/dist/alert/alert-group2.js.map +1 -1
- package/dist/alert/alert2.js +29 -28
- package/dist/alert/alert2.js.map +1 -1
- package/dist/avatar/avatar-group2.js +9 -9
- package/dist/avatar/avatar-group2.js.map +1 -1
- package/dist/avatar/avatar2.js +12 -11
- package/dist/avatar/avatar2.js.map +1 -1
- package/dist/badge/badge2.js +27 -26
- package/dist/badge/badge2.js.map +1 -1
- package/dist/breadcrumb/breadcrumb2.js +17 -17
- package/dist/breadcrumb/breadcrumb2.js.map +1 -1
- package/dist/bundles/index.js +6 -6
- package/dist/button/button2.js +12 -12
- package/dist/button/button2.js.map +1 -1
- package/dist/button-group/button-group2.js +18 -18
- package/dist/button-group/button-group2.js.map +1 -1
- package/dist/card/card2.js +28 -28
- package/dist/card/card2.js.map +1 -1
- package/dist/chat-message/chat-message2.js +15 -14
- package/dist/chat-message/chat-message2.js.map +1 -1
- package/dist/checkbox/checkbox-group2.js +8 -8
- package/dist/checkbox/checkbox-group2.js.map +1 -1
- package/dist/checkbox/checkbox2.js +8 -8
- package/dist/checkbox/checkbox2.js.map +1 -1
- package/dist/color/color2.js +21 -21
- package/dist/color/color2.js.map +1 -1
- package/dist/combobox/combobox2.js +37 -37
- package/dist/combobox/combobox2.js.map +1 -1
- package/dist/copy-button/copy-button.d.ts +1 -1
- package/dist/copy-button/copy-button2.js +21 -21
- package/dist/copy-button/copy-button2.js.map +1 -1
- package/dist/custom-elements.json +0 -76
- package/dist/data.snippets.json +27 -27
- package/dist/date/date2.js +19 -19
- package/dist/date/date2.js.map +1 -1
- package/dist/datetime/datetime2.js +19 -19
- package/dist/datetime/datetime2.js.map +1 -1
- package/dist/dialog/dialog-footer2.js +7 -7
- package/dist/dialog/dialog-footer2.js.map +1 -1
- package/dist/dialog/dialog-header2.js +7 -7
- package/dist/dialog/dialog-header2.js.map +1 -1
- package/dist/dialog/dialog.js +1 -1
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/dialog/dialog2.js +25 -25
- package/dist/dialog/dialog2.js.map +1 -1
- package/dist/divider/divider2.js +12 -12
- package/dist/divider/divider2.js.map +1 -1
- package/dist/dot/dot2.js +17 -16
- package/dist/dot/dot2.js.map +1 -1
- package/dist/drag-handle/drag-handle2.js +12 -12
- package/dist/drag-handle/drag-handle2.js.map +1 -1
- package/dist/drawer/drawer-content2.js +7 -7
- package/dist/drawer/drawer-content2.js.map +1 -1
- package/dist/drawer/drawer-footer2.js +7 -7
- package/dist/drawer/drawer-footer2.js.map +1 -1
- package/dist/drawer/drawer-header2.js +7 -7
- package/dist/drawer/drawer-header2.js.map +1 -1
- package/dist/drawer/drawer.js +1 -1
- package/dist/drawer/drawer.js.map +1 -1
- package/dist/drawer/drawer2.js +21 -21
- package/dist/drawer/drawer2.js.map +1 -1
- package/dist/dropdown/dropdown-footer2.js +7 -7
- package/dist/dropdown/dropdown-footer2.js.map +1 -1
- package/dist/dropdown/dropdown-header2.js +7 -7
- package/dist/dropdown/dropdown-header2.js.map +1 -1
- package/dist/dropdown/dropdown2.js +21 -21
- package/dist/dropdown/dropdown2.js.map +1 -1
- package/dist/dropdown-group/dropdown-group.js +10 -10
- package/dist/dropdown-group/dropdown-group.js.map +1 -1
- package/dist/dropzone/dropzone2.js +19 -19
- package/dist/dropzone/dropzone2.js.map +1 -1
- package/dist/file/file2.js +8 -8
- package/dist/file/file2.js.map +1 -1
- package/dist/format-bytes/format-bytes2.js +13 -13
- package/dist/format-bytes/format-bytes2.js.map +1 -1
- package/dist/format-datetime/format-datetime2.js +14 -14
- package/dist/format-datetime/format-datetime2.js.map +1 -1
- package/dist/format-number/format-number2.js +20 -20
- package/dist/format-number/format-number2.js.map +1 -1
- package/dist/format-relative-time/format-relative-time2.js +11 -11
- package/dist/format-relative-time/format-relative-time2.js.map +1 -1
- package/dist/format-truncate/format-truncate2.js +21 -21
- package/dist/format-truncate/format-truncate2.js.map +1 -1
- package/dist/forms/control/control2.js +30 -29
- package/dist/forms/control/control2.js.map +1 -1
- package/dist/forms/control-group/control-group2.js +19 -18
- package/dist/forms/control-group/control-group2.js.map +1 -1
- package/dist/forms/control-message/control-message2.js +15 -15
- package/dist/forms/control-message/control-message2.js.map +1 -1
- package/dist/gauge/gauge2.js +20 -20
- package/dist/gauge/gauge2.js.map +1 -1
- package/dist/ghost/ghost2.js +10 -10
- package/dist/ghost/ghost2.js.map +1 -1
- package/dist/grid/cell/cell2.js +9 -9
- package/dist/grid/cell/cell2.js.map +1 -1
- package/dist/grid/column/column2.js +16 -16
- package/dist/grid/column/column2.js.map +1 -1
- package/dist/grid/footer/footer2.js +12 -12
- package/dist/grid/footer/footer2.js.map +1 -1
- package/dist/grid/grid2.js +30 -30
- package/dist/grid/grid2.js.map +1 -1
- package/dist/grid/header/header2.js +20 -20
- package/dist/grid/header/header2.js.map +1 -1
- package/dist/grid/placeholder/placeholder2.js +9 -9
- package/dist/grid/placeholder/placeholder2.js.map +1 -1
- package/dist/grid/row/row2.js +15 -15
- package/dist/grid/row/row2.js.map +1 -1
- package/dist/icon/icon2.js +40 -40
- package/dist/icon/icon2.js.map +1 -1
- package/dist/icon-button/icon-button2.js +17 -17
- package/dist/icon-button/icon-button2.js.map +1 -1
- package/dist/iframe/iframe2.js +7 -7
- package/dist/iframe/iframe2.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/input/input-group2.js +8 -8
- package/dist/input/input-group2.js.map +1 -1
- package/dist/input/input2.js +10 -10
- package/dist/input/input2.js.map +1 -1
- package/dist/internal/controllers/state-expanded.controller.js +1 -1
- package/dist/internal/controllers/state-expanded.controller.js.map +1 -1
- package/dist/internal/controllers/state-highlighted.controller.js +1 -1
- package/dist/internal/controllers/state-highlighted.controller.js.map +1 -1
- package/dist/internal/controllers/state-scroll.controller.js +1 -1
- package/dist/internal/controllers/state-scroll.controller.js.map +1 -1
- package/dist/internal/controllers/state-selected.controller.js +1 -1
- package/dist/internal/controllers/state-selected.controller.js.map +1 -1
- package/dist/internal/controllers/type-anchor.controller.js +1 -1
- package/dist/internal/controllers/type-anchor.controller.js.map +1 -1
- package/dist/internal/controllers/type-closable.controller.js +1 -1
- package/dist/internal/controllers/type-closable.controller.js.map +1 -1
- package/dist/internal/controllers/type-expandable.controller.js +1 -1
- package/dist/internal/controllers/type-expandable.controller.js.map +1 -1
- package/dist/internal/controllers/type-native-popover.controller.js +6 -6
- package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
- package/dist/internal/controllers/type-popover.controller.examples.js.map +1 -1
- package/dist/internal/controllers/type-selectable.controller.js +1 -1
- package/dist/internal/controllers/type-selectable.controller.js.map +1 -1
- package/dist/internal/index.d.ts +0 -1
- package/dist/internal/index.js +57 -61
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/styles/index.d.ts +0 -1
- package/dist/internal/styles/index.js +5 -15
- package/dist/internal/styles/index.js.map +1 -1
- package/dist/internal/utils/a11y.d.ts +0 -3
- package/dist/internal/utils/a11y.js +6 -9
- package/dist/internal/utils/a11y.js.map +1 -1
- package/dist/joystick/joystick2.js +19 -19
- package/dist/joystick/joystick2.js.map +1 -1
- package/dist/logo/logo2.js +14 -13
- package/dist/logo/logo2.js.map +1 -1
- package/dist/menu/menu-group2.js +20 -20
- package/dist/menu/menu-group2.js.map +1 -1
- package/dist/menu/menu-item2.js +11 -11
- package/dist/menu/menu-item2.js.map +1 -1
- package/dist/menu/menu2.js +14 -14
- package/dist/menu/menu2.js.map +1 -1
- package/dist/month/month2.js +19 -19
- package/dist/month/month2.js.map +1 -1
- package/dist/notification/notification-group2.js +13 -13
- package/dist/notification/notification-group2.js.map +1 -1
- package/dist/notification/notification2.js +31 -31
- package/dist/notification/notification2.js.map +1 -1
- package/dist/page/page-panel/page-panel-content2.js +7 -7
- package/dist/page/page-panel/page-panel-content2.js.map +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +9 -9
- package/dist/page/page-panel/page-panel-footer2.js.map +1 -1
- package/dist/page/page-panel/page-panel-header2.js +9 -9
- package/dist/page/page-panel/page-panel-header2.js.map +1 -1
- package/dist/page/page-panel/page-panel2.js +15 -15
- package/dist/page/page-panel/page-panel2.js.map +1 -1
- package/dist/page/page2.js +13 -13
- package/dist/page/page2.js.map +1 -1
- package/dist/page-header/page-header2.js +10 -10
- package/dist/page-header/page-header2.js.map +1 -1
- package/dist/page-loader/page-loader2.js +13 -13
- package/dist/page-loader/page-loader2.js.map +1 -1
- package/dist/pagination/pagination2.js +34 -34
- package/dist/pagination/pagination2.js.map +1 -1
- package/dist/panel/panel2.js +36 -36
- package/dist/panel/panel2.js.map +1 -1
- package/dist/password/password2.js +19 -19
- package/dist/password/password2.js.map +1 -1
- package/dist/preferences-input/preferences-input.d.ts +1 -1
- package/dist/preferences-input/preferences-input2.js +25 -25
- package/dist/preferences-input/preferences-input2.js.map +1 -1
- package/dist/progress-bar/progress-bar2.js +13 -13
- package/dist/progress-bar/progress-bar2.js.map +1 -1
- package/dist/progress-dot/progress-dot2.js +15 -15
- package/dist/progress-dot/progress-dot2.js.map +1 -1
- package/dist/progress-ring/progress-ring2.js +20 -20
- package/dist/progress-ring/progress-ring2.js.map +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +28 -28
- package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
- package/dist/pulse/pulse2.js +15 -15
- package/dist/pulse/pulse2.js.map +1 -1
- package/dist/radio/radio-group2.js +8 -8
- package/dist/radio/radio-group2.js.map +1 -1
- package/dist/radio/radio2.js +8 -8
- package/dist/radio/radio2.js.map +1 -1
- package/dist/range/range2.js +16 -16
- package/dist/range/range2.js.map +1 -1
- package/dist/resize-handle/resize-handle2.js +17 -17
- package/dist/resize-handle/resize-handle2.js.map +1 -1
- package/dist/search/search2.js +20 -20
- package/dist/search/search2.js.map +1 -1
- package/dist/select/select2.js +32 -32
- package/dist/select/select2.js.map +1 -1
- package/dist/skeleton/skeleton2.js +14 -14
- package/dist/skeleton/skeleton2.js.map +1 -1
- package/dist/sort-button/sort-button.d.ts +1 -1
- package/dist/sort-button/sort-button2.js +16 -16
- package/dist/sort-button/sort-button2.js.map +1 -1
- package/dist/sparkline/sparkline2.js +45 -44
- package/dist/sparkline/sparkline2.js.map +1 -1
- package/dist/star-rating/star-rating2.js +14 -14
- package/dist/star-rating/star-rating2.js.map +1 -1
- package/dist/steps/steps2.js +32 -32
- package/dist/steps/steps2.js.map +1 -1
- package/dist/switch/switch-group2.js +8 -8
- package/dist/switch/switch-group2.js.map +1 -1
- package/dist/switch/switch2.js +8 -8
- package/dist/switch/switch2.js.map +1 -1
- package/dist/tabs/tabs-group2.js +18 -18
- package/dist/tabs/tabs-group2.js.map +1 -1
- package/dist/tabs/tabs-item-group2.js +9 -9
- package/dist/tabs/tabs-item-group2.js.map +1 -1
- package/dist/tabs/tabs2.js +28 -28
- package/dist/tabs/tabs2.js.map +1 -1
- package/dist/tag/tag2.js +19 -18
- package/dist/tag/tag2.js.map +1 -1
- package/dist/textarea/textarea2.js +9 -9
- package/dist/textarea/textarea2.js.map +1 -1
- package/dist/time/time2.js +19 -19
- package/dist/time/time2.js.map +1 -1
- package/dist/toast/toast2.js +28 -28
- package/dist/toast/toast2.js.map +1 -1
- package/dist/toggletip/toggletip-footer2.js +7 -7
- package/dist/toggletip/toggletip-footer2.js.map +1 -1
- package/dist/toggletip/toggletip-header2.js +7 -7
- package/dist/toggletip/toggletip-header2.js.map +1 -1
- package/dist/toggletip/toggletip2.js +23 -23
- package/dist/toggletip/toggletip2.js.map +1 -1
- package/dist/toolbar/toolbar2.js +20 -19
- package/dist/toolbar/toolbar2.js.map +1 -1
- package/dist/tooltip/tooltip2.js +20 -20
- package/dist/tooltip/tooltip2.js.map +1 -1
- package/dist/tree/tree-node2.js +39 -39
- package/dist/tree/tree-node2.js.map +1 -1
- package/dist/tree/tree2.js +20 -20
- package/dist/tree/tree2.js.map +1 -1
- package/dist/week/week2.js +19 -19
- package/dist/week/week2.js.map +1 -1
- package/dist/workspace/panel/panel2.js +14 -14
- package/dist/workspace/panel/panel2.js.map +1 -1
- package/dist/workspace/panel-content/panel-content2.js +7 -7
- package/dist/workspace/panel-content/panel-content2.js.map +1 -1
- package/dist/workspace/panel-footer/panel-footer2.js +9 -9
- package/dist/workspace/panel-footer/panel-footer2.js.map +1 -1
- package/dist/workspace/panel-header/panel-header2.js +16 -16
- package/dist/workspace/panel-header/panel-header2.js.map +1 -1
- package/dist/workspace/workspace2.js +97 -97
- package/dist/workspace/workspace2.js.map +1 -1
- package/package.json +2 -2
- package/dist/internal/decorators/scoped-registry.d.ts +0 -2
- package/dist/internal/decorators/scoped-registry.js +0 -36
- package/dist/internal/decorators/scoped-registry.js.map +0 -1
- package/dist/internal/styles/base.js +0 -5
- package/dist/internal/styles/base.js.map +0 -1
- package/dist/internal/styles/interaction-state.js +0 -5
- package/dist/internal/styles/interaction-state.js.map +0 -1
package/dist/tree/tree-node2.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { audit as e } from "../internal/controllers/audit.controller.js";
|
|
2
2
|
import { isFocusable as t } from "../internal/utils/focus.js";
|
|
3
3
|
import { getFlattenedFocusableItems as n } from "../internal/utils/dom.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import m from "../
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
4
|
+
import { stateExpanded as r } from "../internal/controllers/state-expanded.controller.js";
|
|
5
|
+
import { stateHighlighted as i } from "../internal/controllers/state-highlighted.controller.js";
|
|
6
|
+
import { stateSelected as a } from "../internal/controllers/state-selected.controller.js";
|
|
7
|
+
import { typeAnchor as o } from "../internal/controllers/type-anchor.controller.js";
|
|
8
|
+
import { TypeExpandableController as s } from "../internal/controllers/type-expandable.controller.js";
|
|
9
|
+
import { TypeSelectableController as c } from "../internal/controllers/type-selectable.controller.js";
|
|
10
|
+
import { typeSSR as l } from "../internal/controllers/type-ssr.controller.js";
|
|
11
|
+
import { hostAttr as u } from "../internal/decorators/host-attr.js";
|
|
12
|
+
import d from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
13
|
+
import { Icon as f } from "../icon/icon2.js";
|
|
14
|
+
import { IconButton as p } from "../icon-button/icon-button2.js";
|
|
15
|
+
import { Checkbox as m } from "../checkbox/checkbox2.js";
|
|
16
|
+
import { updateNodeSelection as h } from "./utils.js";
|
|
17
|
+
import g from "./tree-node.js";
|
|
18
|
+
import { attachInternals as _ } from "@nvidia-elements/foundations/internal/a11y";
|
|
19
|
+
import { LitElement as v, html as y, nothing as b } from "lit";
|
|
20
|
+
import { property as x } from "lit/decorators/property.js";
|
|
21
|
+
import { I18nController as S } from "@nvidia-elements/foundations/internal/i18n";
|
|
22
|
+
import { scopedRegistry as C } from "@nvidia-elements/foundations/internal/decorators";
|
|
23
|
+
import { useStyles as w } from "@nvidia-elements/foundations/internal/styles";
|
|
24
24
|
import { state as T } from "lit/decorators/state.js";
|
|
25
25
|
import { queryAssignedElements as E } from "lit/decorators/query-assigned-elements.js";
|
|
26
26
|
import { TypeCommandController as D } from "@nvidia-elements/forms/internal";
|
|
27
27
|
// src/tree/tree-node.ts
|
|
28
|
-
var O = { expand: "expand" }, k = class extends
|
|
28
|
+
var O = { expand: "expand" }, k = class extends v {
|
|
29
29
|
constructor(...e) {
|
|
30
|
-
super(...e), this.command = "", this.commandfor = null, this.commandForElement = null, this.expanded = !1, this.selected = !1, this.expandable = !1, this.highlighted = !1, this.#e = new
|
|
30
|
+
super(...e), this.command = "", this.commandfor = null, this.commandForElement = null, this.expanded = !1, this.selected = !1, this.expandable = !1, this.highlighted = !1, this.#e = new S(this, O), this.i18n = this.#e.i18n, this.slot = "nodes", this.indeterminate = !1, this.behaviorExpand = !1, this.behaviorSelect = !1, this.#n = new s(this), this.#r = new c(this), this.#i = new D(this, { events: [] }), this.#c = (e) => {
|
|
31
31
|
let t = this.selectable && e.code === "Space", n = this.#a && (e.code === "ArrowLeft" || e.code === "ArrowRight");
|
|
32
32
|
e.target === this && (t || n) && e.preventDefault();
|
|
33
33
|
}, this.#u = (e) => {
|
|
@@ -47,25 +47,25 @@ var O = { expand: "expand" }, k = class extends b {
|
|
|
47
47
|
static {
|
|
48
48
|
this.metadata = {
|
|
49
49
|
tag: "nve-tree-node",
|
|
50
|
-
version: "2.23.
|
|
50
|
+
version: "2.23.5",
|
|
51
51
|
parents: ["nve-tree", "nve-tree-node"]
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
static {
|
|
55
55
|
this.elementDefinitions = {
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
56
|
+
[p.metadata.tag]: p,
|
|
57
|
+
[f.metadata.tag]: f,
|
|
58
|
+
[m.metadata.tag]: m
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
static {
|
|
62
|
-
this.styles =
|
|
62
|
+
this.styles = w([g]);
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return
|
|
65
|
+
return y`<div internal-host @slotchange="${this.#o}"><div part="_node">${this.#a ? y`<nve-icon-button part="icon-button" exportparts="icon:icon-button-icon" @pointerup="${this.#f}" role="presentation" tabindex="-1" size="sm" container="inline" nofocus><nve-icon part="icon" name="caret" direction="${this.expanded ? "down" : "right"}" size="sm"></nve-icon></nve-icon-button>` : b} ${this.selectable === "multi" ? y`<nve-checkbox part="checkbox" nofocus><input type="checkbox" @change="${this.#h}" .checked="${this.selected}" .indeterminate="${this.indeterminate}" .ariaLabel="${this.i18n.expand}" tabindex="-1"></nve-checkbox>` : b}<div tabindex="0" part="_node-header"><div class="node-title" @click="${this.#d}"><slot name="prefix" part="_prefix"></slot><slot></slot><slot name="suffix" part="_suffix"></slot></div><slot name="content" part="_content"></slot></div></div><div role="group" part="_nodes"><slot name="nodes"></slot></div></div>`;
|
|
66
66
|
}
|
|
67
67
|
connectedCallback() {
|
|
68
|
-
super.connectedCallback(),
|
|
68
|
+
super.connectedCallback(), _(this), this._internals.role = "treeitem", this.addEventListener("keydown", this.#c), this.addEventListener("keyup", this.#u), this.#o();
|
|
69
69
|
}
|
|
70
70
|
disconnectedCallback() {
|
|
71
71
|
super.disconnectedCallback(), this.removeEventListener("keydown", this.#c), this.removeEventListener("keyup", this.#u);
|
|
@@ -107,26 +107,26 @@ var O = { expand: "expand" }, k = class extends b {
|
|
|
107
107
|
#h() {
|
|
108
108
|
this.#r.toggle(), this.behaviorSelect && (this.nodes.forEach((e) => {
|
|
109
109
|
e.selected = this.selected, e.indeterminate = !1;
|
|
110
|
-
}), this.#t.nodes.forEach((e) =>
|
|
110
|
+
}), this.#t.nodes.forEach((e) => h(e)));
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
|
|
113
|
+
d([x({ type: String })], k.prototype, "command", void 0), d([x({
|
|
114
114
|
type: String,
|
|
115
115
|
reflect: !0
|
|
116
|
-
})], k.prototype, "commandfor", void 0),
|
|
116
|
+
})], k.prototype, "commandfor", void 0), d([x({ attribute: !1 })], k.prototype, "commandForElement", void 0), d([x({
|
|
117
117
|
type: Boolean,
|
|
118
118
|
reflect: !0
|
|
119
|
-
})], k.prototype, "expanded", void 0),
|
|
119
|
+
})], k.prototype, "expanded", void 0), d([x({
|
|
120
120
|
type: Boolean,
|
|
121
121
|
reflect: !0
|
|
122
|
-
})], k.prototype, "selected", void 0),
|
|
122
|
+
})], k.prototype, "selected", void 0), d([x({ type: Boolean })], k.prototype, "expandable", void 0), d([x({ type: String })], k.prototype, "selectable", void 0), d([x({ type: Boolean })], k.prototype, "highlighted", void 0), d([x({ type: Object })], k.prototype, "i18n", void 0), d([u()], k.prototype, "slot", void 0), d([E({ slot: "nodes" })], k.prototype, "nodes", void 0), d([T()], k.prototype, "indeterminate", void 0), d([T()], k.prototype, "behaviorExpand", void 0), d([T()], k.prototype, "behaviorSelect", void 0), k = d([
|
|
123
123
|
e(),
|
|
124
|
-
|
|
125
|
-
s(),
|
|
124
|
+
l({ log: !1 }),
|
|
126
125
|
o(),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
a(),
|
|
127
|
+
r(),
|
|
128
|
+
C(),
|
|
129
|
+
i()
|
|
130
130
|
], k);
|
|
131
131
|
export { k as TreeNode };
|
|
132
132
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-node2.js","names":["styles","_decorate","__decorate","tree_node_default","i18nDefaults","TreeNode","LitElement","_args","#i18nController","I18nController","#typeExpandableController","TypeExpandableController","#typeSelectableController","TypeSelectableController","#typeCommandController","TypeCommandController","#onKeydown","isSelectionKey","isExpansionKey","#isExpandable","#onKeyup","#invokeFromKeyboard","#toggleSelection","#tree","IconButton","Icon","Checkbox","useStyles","#nodeUpdate","#toggleExpand","nothing","#toggleMultiSelection","#nodeHeaderClick","attachInternals","#toggleExpandableState","origin","hasFocusableElements","getFlattenedFocusableItems","path","target","isFocusable","#toggleSingleSelection","n","updateNodeSelection","node","property","hostAttr","queryAssignedElements","state","audit","typeSSR","typeAnchor","stateSelected","stateExpanded","scopedRegistry","stateHighlighted"],"sources":["../../src/tree/tree-node.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LitElement, html, nothing } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport {\n TypeExpandableController,\n TypeSelectableController,\n attachInternals,\n audit,\n getFlattenedFocusableItems,\n hostAttr,\n isFocusable,\n scopedRegistry,\n stateExpanded,\n stateHighlighted,\n stateSelected,\n typeAnchor,\n typeSSR,\n useStyles\n} from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { Checkbox } from '@nvidia-elements/core/checkbox';\nimport { TypeCommandController } from '@nvidia-elements/forms/internal';\nimport type { Tree } from './tree.js';\nimport styles from './tree-node.css?inline';\nimport { updateNodeSelection } from './utils.js';\n\nconst i18nDefaults = {\n expand: 'expand'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-tree-node\n * @description A tree view widget presents a hierarchical list. Any item in the hierarchy may have child items, and items that have children can expand or collapse to show or hide the children.\n * @documentation https://nvidia.github.io/elements/docs/elements/tree/\n * @since 1.2.0\n * @entrypoint \\@nvidia-elements/core/tree\n * @event open - Dispatched when the node opens.\n * @event close - Dispatched when the node closes.\n * @event select - Dispatched when the node selection state changes.\n * @command --select - use to select the node\n * @command --deselect - use to deselect the node\n * @command --toggle-select - use to toggle the node selection state\n * @command --open - use to open the node\n * @command --close - use to close the node\n * @command --toggle - use to toggle open / closed state of the node\n * @slot - Use default slot for basic text content or nested <nve-tree-node> elements.\n * @slot prefix - Use for prefix content before the node title.\n * @slot suffix - Use for suffix content after the node title.\n * @slot content - Use only for extended long form content containing interactive elements or form inputs.\n * @cssprop --color\n * @cssprop --border-radius\n * @cssprop --font-size\n * @cssprop --min-height\n * @cssprop --text-wrap\n * @cssprop --font-weight\n * @cssprop --width\n\n * @csspart icon-button - The icon button element\n * @csspart icon - The icon element\n * @csspart checkbox - The checkbox element\n\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/treeview/\n *\n */\n@audit()\n@typeSSR({ log: false }) // warning about ssr mismatch disabled as tree node will never be a 1:1 match in ssr due to performance constraints and slot complexity\n@typeAnchor()\n@stateSelected()\n@stateExpanded()\n@scopedRegistry()\n@stateHighlighted()\nexport class TreeNode extends LitElement {\n /** Command to invoke on a node title click or Enter on its header. */\n @property({ type: String }) command = '';\n\n /** ID of the element that receives the command. */\n @property({ type: String, reflect: true }) commandfor: string | null = null;\n\n /** Direct command target, taking precedence over commandfor. */\n @property({ attribute: false }) commandForElement: HTMLElement | null = null;\n\n /**\n * Determines if node is in an expanded state.\n */\n @property({ type: Boolean, reflect: true }) expanded = false;\n\n /**\n * Determines whether if node is in a selected state.\n */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n /**\n * Determines whether a node can be expandable. Expandable by default if slotted nodes exist.\n */\n @property({ type: Boolean }) expandable = false;\n\n /**\n * Determines whether a node can be in a selected state. Nodes can be in a single or multi select state.\n */\n @property({ type: String }) selectable: 'single' | 'multi';\n\n /**\n * Determines the highlighted state of the element. Highlighted states serve non-interactive selections where nodes may relate to other selected portions of the UI.\n */\n @property({ type: Boolean }) highlighted = false;\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /**\n * Updates internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** @private */\n @hostAttr() slot = 'nodes';\n\n get #tree() {\n return this.closest<Tree>('nve-tree');\n }\n\n /**\n * Returns the slotted child tree nodes.\n */\n @queryAssignedElements({ slot: 'nodes' }) readonly nodes!: TreeNode[];\n\n /** @private */\n @state() indeterminate = false;\n\n /** @private */\n @state() behaviorExpand = false;\n\n /** @private */\n @state() behaviorSelect = false;\n\n #typeExpandableController = new TypeExpandableController(this);\n\n #typeSelectableController = new TypeSelectableController(this);\n\n #typeCommandController = new TypeCommandController(this, { events: [] });\n\n get #isExpandable() {\n return this.expandable || this.expanded || !!this.nodes?.length;\n }\n\n static metadata = {\n tag: 'nve-tree-node',\n version: '0.0.0',\n parents: ['nve-tree', 'nve-tree-node']\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton,\n [Icon.metadata.tag]: Icon,\n [Checkbox.metadata.tag]: Checkbox\n };\n\n static styles = useStyles([styles]);\n\n declare _internals: ElementInternals;\n\n /* eslint-disable @nvidia-elements/lint/no-missing-control-label */\n render() {\n return html`\n <div internal-host @slotchange=${this.#nodeUpdate}>\n <div part=\"_node\">\n ${\n this.#isExpandable\n ? html`\n <nve-icon-button part=\"icon-button\" exportparts=\"icon:icon-button-icon\" @pointerup=${this.#toggleExpand} role=\"presentation\" tabindex=\"-1\" size=\"sm\" container=\"inline\" nofocus>\n <nve-icon part=\"icon\" name=\"caret\" direction=${this.expanded ? 'down' : 'right'} size=\"sm\"></nve-icon>\n </nve-icon-button>`\n : nothing\n }\n ${\n this.selectable === 'multi'\n ? html`\n <nve-checkbox part=\"checkbox\" nofocus>\n <input type=\"checkbox\" @change=${this.#toggleMultiSelection} .checked=${this.selected} .indeterminate=${this.indeterminate} .ariaLabel=${this.i18n.expand} tabindex=\"-1\" />\n </nve-checkbox>`\n : nothing\n }\n <div tabindex=\"0\" part=\"_node-header\">\n <div class=\"node-title\" @click=${this.#nodeHeaderClick}>\n <slot name=\"prefix\" part=\"_prefix\"></slot>\n <slot></slot>\n <slot name=\"suffix\" part=\"_suffix\"></slot>\n </div>\n <slot name=\"content\" part=\"_content\"></slot>\n </div>\n </div>\n <div role=\"group\" part=\"_nodes\"><slot name=\"nodes\"></slot></div>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'treeitem';\n this.addEventListener('keydown', this.#onKeydown);\n this.addEventListener('keyup', this.#onKeyup);\n this.#nodeUpdate();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this.#onKeydown);\n this.removeEventListener('keyup', this.#onKeyup);\n }\n\n /** opens and sets the expanded state automatically if behaviorExpand is true */\n open() {\n this.#typeExpandableController.open();\n }\n\n /** closes and sets the expanded state automatically if behaviorExpand is true */\n close() {\n this.#typeExpandableController.close();\n }\n\n #nodeUpdate() {\n this.requestUpdate();\n this.#toggleExpandableState();\n }\n\n #toggleExpandableState() {\n this.#isExpandable ? this._internals.states.add('is-expandable') : this._internals.states.delete('is-expandable');\n }\n\n #onKeydown = (e: KeyboardEvent) => {\n const isSelectionKey = this.selectable && e.code === 'Space';\n const isExpansionKey = this.#isExpandable && (e.code === 'ArrowLeft' || e.code === 'ArrowRight');\n\n if (e.target === this && (isSelectionKey || isExpansionKey)) {\n e.preventDefault();\n }\n };\n\n #invokeFromKeyboard(e: KeyboardEvent) {\n if (e.code !== 'Enter' || e.defaultPrevented || e.repeat) {\n return;\n }\n const origin = e.composedPath()[0];\n const header = this.shadowRoot?.querySelector('[part=\"_node-header\"]');\n if (origin === header || origin === this) {\n this.#typeCommandController.invoke();\n }\n }\n\n #onKeyup = (e: KeyboardEvent) => {\n this.#invokeFromKeyboard(e);\n if (this.#isExpandable && e.code === 'ArrowLeft' && e.target === this) {\n this.close();\n }\n\n if (this.#isExpandable && e.code === 'ArrowRight' && e.target === this) {\n this.open();\n }\n\n if (e.code === 'Space' && e.target === this && this.selectable) {\n this.#toggleSelection();\n }\n };\n\n #nodeHeaderClick(e: Event) {\n const hasFocusableElements = getFlattenedFocusableItems(e.currentTarget as HTMLElement).length;\n if (this.#isExpandable && !this.selectable && !hasFocusableElements) {\n this.#toggleExpand();\n }\n\n if (this.selectable && (!hasFocusableElements || (e.target as HTMLElement).localName === 'a')) {\n this.#toggleSelection();\n }\n\n const path = e.composedPath();\n const hasInteractiveTarget = path\n .slice(0, path.indexOf(e.currentTarget as HTMLElement))\n .some(target => target instanceof Element && isFocusable(target));\n if (!hasInteractiveTarget && !e.defaultPrevented) {\n this.#typeCommandController.invoke();\n }\n }\n\n #toggleExpand() {\n this.#typeExpandableController.toggle();\n }\n\n #toggleSelection() {\n if (this.selectable === 'single') {\n this.#toggleSingleSelection();\n }\n\n if (this.selectable === 'multi') {\n this.#toggleMultiSelection();\n }\n }\n\n #toggleSingleSelection() {\n this.#typeSelectableController.toggle();\n if (this.behaviorSelect) {\n this.#tree!.nodes.filter(n => n !== this).forEach(n => (n.selected = false));\n }\n }\n\n #toggleMultiSelection() {\n this.#typeSelectableController.toggle();\n\n if (this.behaviorSelect) {\n this.nodes.forEach(n => {\n n.selected = this.selected;\n n.indeterminate = false;\n });\n this.#tree!.nodes.forEach(node => updateNodeSelection(node));\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAMI,IAAe,EACnB,QAAQ,SACV,GA2CaC,IAAN,cAAuBC,EAAW;;EAkL3B,A,aAhL0B,KAAA,UAAA,IAGiC,KAAA,aAAA,MAGC,KAAA,oBAAA,MAKjB,KAAA,WAAA,IAKA,KAAA,WAAA,IAKb,KAAA,aAAA,IAUC,KAAA,cAAA,IAEH,KAAAE,KAAA,IAAIC,EAAqB,MAAML,CAAY,GAKhD,KAAA,OAAA,KAAKI,GAAgB,MAGrC,KAAA,OAAA,SAYM,KAAA,gBAAA,IAGC,KAAA,iBAAA,IAGA,KAAA,iBAAA,IAEE,KAAAE,KAAA,IAAIC,EAAyB,IAAI,GAEjC,KAAAC,KAAA,IAAIC,EAAyB,IAAI,GAEpC,KAAAC,KAAA,IAAIC,EAAsB,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,GA2FzD,KAAAC,MAAA,MAAqB;GACjC,IAAMC,IAAiB,KAAK,cAAc,EAAE,SAAS,SAC/CC,IAAiB,KAAKC,OAAkB,EAAE,SAAS,eAAe,EAAE,SAAS;GAEnF,AAAI,EAAE,WAAW,SAASF,KAAkBC,MAC1C,EAAE,eAAe;EAErB,GAaY,KAAAE,MAAA,MAAqB;GAU/B,AATA,KAAKC,GAAoB,CAAC,GACtB,KAAKF,MAAiB,EAAE,SAAS,eAAe,EAAE,WAAW,QAC/D,KAAK,MAAM,GAGT,KAAKA,MAAiB,EAAE,SAAS,gBAAgB,EAAE,WAAW,QAChE,KAAK,KAAK,GA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GvCJ,EAAA,CAAA+C,EAAM,CAAA,GAAA3C,EAAA,WAAA,iBAAA,KAAA,CAAA,GAGNJ,EAAA,CAAA+C,EAAM,CAAA,GAAA3C,EAAA,WAAA,kBAAA,KAAA,CAAA,GAGNJ,EAAA,CAAA+C,EAAM,CAAA,GAAA3C,EAAA,WAAA,kBAAA,KAAA,CAAA,G;CApER4C,EAAM;CACNC,EAAQ,EAAE,KAAK,GAAM,CAAC;CACtBC,EAAW;CACXC,EAAc;CACdC,EAAc;CACdC,EAAe;CACfC,EAAiB"}
|
|
1
|
+
{"version":3,"file":"tree-node2.js","names":["styles","_decorate","__decorate","tree_node_default","i18nDefaults","TreeNode","LitElement","_args","#i18nController","I18nController","#typeExpandableController","TypeExpandableController","#typeSelectableController","TypeSelectableController","#typeCommandController","TypeCommandController","#onKeydown","isSelectionKey","isExpansionKey","#isExpandable","#onKeyup","#invokeFromKeyboard","#toggleSelection","#tree","IconButton","Icon","Checkbox","useStyles","#nodeUpdate","#toggleExpand","nothing","#toggleMultiSelection","#nodeHeaderClick","attachInternals","#toggleExpandableState","origin","hasFocusableElements","getFlattenedFocusableItems","path","target","isFocusable","#toggleSingleSelection","n","updateNodeSelection","node","property","hostAttr","queryAssignedElements","state","audit","typeSSR","typeAnchor","stateSelected","stateExpanded","scopedRegistry","stateHighlighted"],"sources":["../../src/tree/tree-node.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LitElement, html, nothing } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport {\n TypeExpandableController,\n TypeSelectableController,\n audit,\n getFlattenedFocusableItems,\n hostAttr,\n isFocusable,\n stateExpanded,\n stateHighlighted,\n stateSelected,\n typeAnchor,\n typeSSR\n} from '@nvidia-elements/core/internal';\nimport { scopedRegistry } from '@nvidia-elements/foundations/internal/decorators';\nimport { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { Checkbox } from '@nvidia-elements/core/checkbox';\nimport { TypeCommandController } from '@nvidia-elements/forms/internal';\nimport type { Tree } from './tree.js';\nimport styles from './tree-node.css?inline';\nimport { updateNodeSelection } from './utils.js';\n\nconst i18nDefaults = {\n expand: 'expand'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-tree-node\n * @description A tree view widget presents a hierarchical list. Any item in the hierarchy may have child items, and items that have children can expand or collapse to show or hide the children.\n * @documentation https://nvidia.github.io/elements/docs/elements/tree/\n * @since 1.2.0\n * @entrypoint \\@nvidia-elements/core/tree\n * @event open - Dispatched when the node opens.\n * @event close - Dispatched when the node closes.\n * @event select - Dispatched when the node selection state changes.\n * @command --select - use to select the node\n * @command --deselect - use to deselect the node\n * @command --toggle-select - use to toggle the node selection state\n * @command --open - use to open the node\n * @command --close - use to close the node\n * @command --toggle - use to toggle open / closed state of the node\n * @slot - Use default slot for basic text content or nested <nve-tree-node> elements.\n * @slot prefix - Use for prefix content before the node title.\n * @slot suffix - Use for suffix content after the node title.\n * @slot content - Use only for extended long form content containing interactive elements or form inputs.\n * @cssprop --color\n * @cssprop --border-radius\n * @cssprop --font-size\n * @cssprop --min-height\n * @cssprop --text-wrap\n * @cssprop --font-weight\n * @cssprop --width\n\n * @csspart icon-button - The icon button element\n * @csspart icon - The icon element\n * @csspart checkbox - The checkbox element\n\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/treeview/\n *\n */\n@audit()\n@typeSSR({ log: false }) // warning about ssr mismatch disabled as tree node will never be a 1:1 match in ssr due to performance constraints and slot complexity\n@typeAnchor()\n@stateSelected()\n@stateExpanded()\n@scopedRegistry()\n@stateHighlighted()\nexport class TreeNode extends LitElement {\n /** Command to invoke on a node title click or Enter on its header. */\n @property({ type: String }) command = '';\n\n /** ID of the element that receives the command. */\n @property({ type: String, reflect: true }) commandfor: string | null = null;\n\n /** Direct command target, taking precedence over commandfor. */\n @property({ attribute: false }) commandForElement: HTMLElement | null = null;\n\n /**\n * Determines if node is in an expanded state.\n */\n @property({ type: Boolean, reflect: true }) expanded = false;\n\n /**\n * Determines whether if node is in a selected state.\n */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n /**\n * Determines whether a node can be expandable. Expandable by default if slotted nodes exist.\n */\n @property({ type: Boolean }) expandable = false;\n\n /**\n * Determines whether a node can be in a selected state. Nodes can be in a single or multi select state.\n */\n @property({ type: String }) selectable: 'single' | 'multi';\n\n /**\n * Determines the highlighted state of the element. Highlighted states serve non-interactive selections where nodes may relate to other selected portions of the UI.\n */\n @property({ type: Boolean }) highlighted = false;\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /**\n * Updates internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** @private */\n @hostAttr() slot = 'nodes';\n\n get #tree() {\n return this.closest<Tree>('nve-tree');\n }\n\n /**\n * Returns the slotted child tree nodes.\n */\n @queryAssignedElements({ slot: 'nodes' }) readonly nodes!: TreeNode[];\n\n /** @private */\n @state() indeterminate = false;\n\n /** @private */\n @state() behaviorExpand = false;\n\n /** @private */\n @state() behaviorSelect = false;\n\n #typeExpandableController = new TypeExpandableController(this);\n\n #typeSelectableController = new TypeSelectableController(this);\n\n #typeCommandController = new TypeCommandController(this, { events: [] });\n\n get #isExpandable() {\n return this.expandable || this.expanded || !!this.nodes?.length;\n }\n\n static metadata = {\n tag: 'nve-tree-node',\n version: '0.0.0',\n parents: ['nve-tree', 'nve-tree-node']\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton,\n [Icon.metadata.tag]: Icon,\n [Checkbox.metadata.tag]: Checkbox\n };\n\n static styles = useStyles([styles]);\n\n declare _internals: ElementInternals;\n\n /* eslint-disable @nvidia-elements/lint/no-missing-control-label */\n render() {\n return html`\n <div internal-host @slotchange=${this.#nodeUpdate}>\n <div part=\"_node\">\n ${\n this.#isExpandable\n ? html`\n <nve-icon-button part=\"icon-button\" exportparts=\"icon:icon-button-icon\" @pointerup=${this.#toggleExpand} role=\"presentation\" tabindex=\"-1\" size=\"sm\" container=\"inline\" nofocus>\n <nve-icon part=\"icon\" name=\"caret\" direction=${this.expanded ? 'down' : 'right'} size=\"sm\"></nve-icon>\n </nve-icon-button>`\n : nothing\n }\n ${\n this.selectable === 'multi'\n ? html`\n <nve-checkbox part=\"checkbox\" nofocus>\n <input type=\"checkbox\" @change=${this.#toggleMultiSelection} .checked=${this.selected} .indeterminate=${this.indeterminate} .ariaLabel=${this.i18n.expand} tabindex=\"-1\" />\n </nve-checkbox>`\n : nothing\n }\n <div tabindex=\"0\" part=\"_node-header\">\n <div class=\"node-title\" @click=${this.#nodeHeaderClick}>\n <slot name=\"prefix\" part=\"_prefix\"></slot>\n <slot></slot>\n <slot name=\"suffix\" part=\"_suffix\"></slot>\n </div>\n <slot name=\"content\" part=\"_content\"></slot>\n </div>\n </div>\n <div role=\"group\" part=\"_nodes\"><slot name=\"nodes\"></slot></div>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'treeitem';\n this.addEventListener('keydown', this.#onKeydown);\n this.addEventListener('keyup', this.#onKeyup);\n this.#nodeUpdate();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this.#onKeydown);\n this.removeEventListener('keyup', this.#onKeyup);\n }\n\n /** opens and sets the expanded state automatically if behaviorExpand is true */\n open() {\n this.#typeExpandableController.open();\n }\n\n /** closes and sets the expanded state automatically if behaviorExpand is true */\n close() {\n this.#typeExpandableController.close();\n }\n\n #nodeUpdate() {\n this.requestUpdate();\n this.#toggleExpandableState();\n }\n\n #toggleExpandableState() {\n this.#isExpandable ? this._internals.states.add('is-expandable') : this._internals.states.delete('is-expandable');\n }\n\n #onKeydown = (e: KeyboardEvent) => {\n const isSelectionKey = this.selectable && e.code === 'Space';\n const isExpansionKey = this.#isExpandable && (e.code === 'ArrowLeft' || e.code === 'ArrowRight');\n\n if (e.target === this && (isSelectionKey || isExpansionKey)) {\n e.preventDefault();\n }\n };\n\n #invokeFromKeyboard(e: KeyboardEvent) {\n if (e.code !== 'Enter' || e.defaultPrevented || e.repeat) {\n return;\n }\n const origin = e.composedPath()[0];\n const header = this.shadowRoot?.querySelector('[part=\"_node-header\"]');\n if (origin === header || origin === this) {\n this.#typeCommandController.invoke();\n }\n }\n\n #onKeyup = (e: KeyboardEvent) => {\n this.#invokeFromKeyboard(e);\n if (this.#isExpandable && e.code === 'ArrowLeft' && e.target === this) {\n this.close();\n }\n\n if (this.#isExpandable && e.code === 'ArrowRight' && e.target === this) {\n this.open();\n }\n\n if (e.code === 'Space' && e.target === this && this.selectable) {\n this.#toggleSelection();\n }\n };\n\n #nodeHeaderClick(e: Event) {\n const hasFocusableElements = getFlattenedFocusableItems(e.currentTarget as HTMLElement).length;\n if (this.#isExpandable && !this.selectable && !hasFocusableElements) {\n this.#toggleExpand();\n }\n\n if (this.selectable && (!hasFocusableElements || (e.target as HTMLElement).localName === 'a')) {\n this.#toggleSelection();\n }\n\n const path = e.composedPath();\n const hasInteractiveTarget = path\n .slice(0, path.indexOf(e.currentTarget as HTMLElement))\n .some(target => target instanceof Element && isFocusable(target));\n if (!hasInteractiveTarget && !e.defaultPrevented) {\n this.#typeCommandController.invoke();\n }\n }\n\n #toggleExpand() {\n this.#typeExpandableController.toggle();\n }\n\n #toggleSelection() {\n if (this.selectable === 'single') {\n this.#toggleSingleSelection();\n }\n\n if (this.selectable === 'multi') {\n this.#toggleMultiSelection();\n }\n }\n\n #toggleSingleSelection() {\n this.#typeSelectableController.toggle();\n if (this.behaviorSelect) {\n this.#tree!.nodes.filter(n => n !== this).forEach(n => (n.selected = false));\n }\n }\n\n #toggleMultiSelection() {\n this.#typeSelectableController.toggle();\n\n if (this.behaviorSelect) {\n this.nodes.forEach(n => {\n n.selected = this.selected;\n n.indeterminate = false;\n });\n this.#tree!.nodes.forEach(node => updateNodeSelection(node));\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAMI,IAAe,EACnB,QAAQ,SACV,GA2CaC,IAAN,cAAuBC,EAAW;;EAkL3B,A,aAhL0B,KAAA,UAAA,IAGiC,KAAA,aAAA,MAGC,KAAA,oBAAA,MAKjB,KAAA,WAAA,IAKA,KAAA,WAAA,IAKb,KAAA,aAAA,IAUC,KAAA,cAAA,IAEH,KAAAE,KAAA,IAAIC,EAAqB,MAAML,CAAY,GAKhD,KAAA,OAAA,KAAKI,GAAgB,MAGrC,KAAA,OAAA,SAYM,KAAA,gBAAA,IAGC,KAAA,iBAAA,IAGA,KAAA,iBAAA,IAEE,KAAAE,KAAA,IAAIC,EAAyB,IAAI,GAEjC,KAAAC,KAAA,IAAIC,EAAyB,IAAI,GAEpC,KAAAC,KAAA,IAAIC,EAAsB,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,GA2FzD,KAAAC,MAAA,MAAqB;GACjC,IAAMC,IAAiB,KAAK,cAAc,EAAE,SAAS,SAC/CC,IAAiB,KAAKC,OAAkB,EAAE,SAAS,eAAe,EAAE,SAAS;GAEnF,AAAI,EAAE,WAAW,SAASF,KAAkBC,MAC1C,EAAE,eAAe;EAErB,GAaY,KAAAE,MAAA,MAAqB;GAU/B,AATA,KAAKC,GAAoB,CAAC,GACtB,KAAKF,MAAiB,EAAE,SAAS,eAAe,EAAE,WAAW,QAC/D,KAAK,MAAM,GAGT,KAAKA,MAAiB,EAAE,SAAS,gBAAgB,EAAE,WAAW,QAChE,KAAK,KAAK,GAGR,EAAE,SAAS,WAAW,EAAE,WAAW,QAAQ,KAAK,cAClD,KAAKG,GAAiB;EAE1B;;CA5JA;CA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A,CAAA+C,EAAM,CAAA,GAAA3C,EAAA,WAAA,kBAAA,KAAA,CAAA,GAGNJ,EAAA,CAAA+C,EAAM,CAAA,GAAA3C,EAAA,WAAA,kBAAA,KAAA,CAAA,G;CApER4C,EAAM;CACNC,EAAQ,EAAE,KAAK,GAAM,CAAC;CACtBC,EAAW;CACXC,EAAc;CACdC,EAAc;CACdC,EAAe;CACfC,EAAiB"}
|
package/dist/tree/tree2.js
CHANGED
|
@@ -2,32 +2,32 @@ import { audit as e } from "../internal/controllers/audit.controller.js";
|
|
|
2
2
|
import { onChildListMutation as t } from "../internal/utils/events.js";
|
|
3
3
|
import { appendRootNodeStyle as n } from "../internal/utils/dom.js";
|
|
4
4
|
import { keyNavigationList as r } from "../internal/controllers/keynav-list.controller.js";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import o from "
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import l from "
|
|
11
|
-
import u from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
5
|
+
import i from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
6
|
+
import { updateNodeSelection as a } from "./utils.js";
|
|
7
|
+
import { TreeNode as o } from "./tree-node2.js";
|
|
8
|
+
import s from "./tree.js";
|
|
9
|
+
import c from "./tree.global.js";
|
|
10
|
+
import { attachInternals as l } from "@nvidia-elements/foundations/internal/a11y";
|
|
11
|
+
import { LitElement as u, html as d } from "lit";
|
|
12
|
+
import { property as f } from "lit/decorators/property.js";
|
|
13
|
+
import { useStyles as p } from "@nvidia-elements/foundations/internal/styles";
|
|
14
14
|
// src/tree/tree.ts
|
|
15
|
-
var m = class extends
|
|
15
|
+
var m = class extends u {
|
|
16
16
|
constructor(...e) {
|
|
17
17
|
super(...e), this.behaviorExpand = !1, this.behaviorSelect = !1, this.border = !1, this.#e = [];
|
|
18
18
|
}
|
|
19
19
|
static {
|
|
20
|
-
this.styles =
|
|
20
|
+
this.styles = p([s]);
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.metadata = {
|
|
24
24
|
tag: "nve-tree",
|
|
25
|
-
version: "2.23.
|
|
25
|
+
version: "2.23.5",
|
|
26
26
|
children: ["nve-tree-node"]
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
get nodes() {
|
|
30
|
-
return Array.from(this.querySelectorAll(
|
|
30
|
+
return Array.from(this.querySelectorAll(o.metadata.tag));
|
|
31
31
|
}
|
|
32
32
|
get keynavListConfig() {
|
|
33
33
|
return {
|
|
@@ -39,11 +39,11 @@ var m = class extends d {
|
|
|
39
39
|
return this.nodes.filter((e) => e.expanded || e.parentNode.expanded || e.parentNode === this);
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return
|
|
42
|
+
return d`<div internal-host><slot name="nodes"></slot></div>`;
|
|
43
43
|
}
|
|
44
44
|
#e;
|
|
45
45
|
connectedCallback() {
|
|
46
|
-
super.connectedCallback(),
|
|
46
|
+
super.connectedCallback(), l(this), n(this, c), this._internals.role = "tree", this.#e.push(t(this, () => {
|
|
47
47
|
this.#t();
|
|
48
48
|
}, { subtree: !0 }));
|
|
49
49
|
}
|
|
@@ -62,19 +62,19 @@ var m = class extends d {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
#r() {
|
|
65
|
-
this.behaviorSelect && this.selectable === "multi" && this.nodes.forEach((e) =>
|
|
65
|
+
this.behaviorSelect && this.selectable === "multi" && this.nodes.forEach((e) => a(e));
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
i([f({ type: String })], m.prototype, "selectable", void 0), i([f({
|
|
69
69
|
type: Boolean,
|
|
70
70
|
attribute: "behavior-expand"
|
|
71
|
-
})], m.prototype, "behaviorExpand", void 0),
|
|
71
|
+
})], m.prototype, "behaviorExpand", void 0), i([f({
|
|
72
72
|
type: Boolean,
|
|
73
73
|
attribute: "behavior-select"
|
|
74
|
-
})], m.prototype, "behaviorSelect", void 0),
|
|
74
|
+
})], m.prototype, "behaviorSelect", void 0), i([f({
|
|
75
75
|
type: Boolean,
|
|
76
76
|
reflect: !0
|
|
77
|
-
})], m.prototype, "border", void 0), m =
|
|
77
|
+
})], m.prototype, "border", void 0), m = i([e(), r()], m);
|
|
78
78
|
export { m as Tree };
|
|
79
79
|
|
|
80
80
|
//# sourceMappingURL=tree2.js.map
|
package/dist/tree/tree2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree2.js","names":["styles","globalStyles","_decorate","__decorate","tree_default","tree_global_default","Tree","LitElement","_args","#observers","useStyles","TreeNode","node","el","attachInternals","appendRootNodeStyle","onChildListMutation","#syncNodes","o","props","#syncNodeOptions","#syncNodeSelections","updateNodeSelection","property","audit","keyNavigationList"],"sources":["../../src/tree/tree.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues } from 'lit';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { KeynavListConfig } from '@nvidia-elements/core/internal';\nimport {
|
|
1
|
+
{"version":3,"file":"tree2.js","names":["styles","globalStyles","_decorate","__decorate","tree_default","tree_global_default","Tree","LitElement","_args","#observers","useStyles","TreeNode","node","el","attachInternals","appendRootNodeStyle","onChildListMutation","#syncNodes","o","props","#syncNodeOptions","#syncNodeSelections","updateNodeSelection","property","audit","keyNavigationList"],"sources":["../../src/tree/tree.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues } from 'lit';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { KeynavListConfig } from '@nvidia-elements/core/internal';\nimport { appendRootNodeStyle, audit, keyNavigationList, onChildListMutation } from '@nvidia-elements/core/internal';\nimport { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { updateNodeSelection } from './utils.js';\nimport { TreeNode } from './tree-node.js';\nimport styles from './tree.css?inline';\nimport globalStyles from './tree.global.css?inline';\n\n/**\n * @element nve-tree\n * @description A tree view widget presents a hierarchical list. Any item in the hierarchy may have child items, and items that have children can expand or collapse to show or hide the children.\n * @documentation https://nvidia.github.io/elements/docs/elements/tree/\n * @since 1.2.0\n * @entrypoint \\@nvidia-elements/core/tree\n * @slot - tree nodes\n * @cssprop --max-width\n * @cssprop --node-border - Border style for tree node depth indicator\n * @event open - Dispatched from a child nve-tree-node when opened.\n * @event close - Dispatched from a child nve-tree-node when closed.\n * @event select - Dispatched from a child nve-tree-node when its selection state changes.\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/treeview/\n *\n */\n@audit()\n@keyNavigationList<Tree>()\nexport class Tree extends LitElement {\n /**\n * Determines whether all nodes can be in a selected state. Nodes can be in a single or multi select state.\n */\n @property({ type: String }) selectable: 'single' | 'multi';\n\n /**\n * Determines whether the tree nodes should handle auto-expanding behavior.\n */\n @property({ type: Boolean, attribute: 'behavior-expand' }) behaviorExpand = false;\n\n /**\n * Determines whether the tree nodes should handle auto-select behavior.\n */\n @property({ type: Boolean, attribute: 'behavior-select' }) behaviorSelect = false;\n\n /**\n * Determines if the node depth border renders.\n */\n @property({ type: Boolean, reflect: true }) border = false;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-tree',\n version: '0.0.0',\n children: ['nve-tree-node']\n };\n\n _internals: ElementInternals;\n\n /** Returns the tree nodes in document order. */\n get nodes() {\n return Array.from(this.querySelectorAll<TreeNode>(TreeNode.metadata.tag));\n }\n\n /** @private */\n get keynavListConfig(): KeynavListConfig {\n return {\n items: this.openNodes\n .map(node => node.shadowRoot!.querySelector('[part=\"_node-header\"]'))\n .filter((el): el is HTMLElement => el !== null),\n layout: 'vertical'\n };\n }\n\n /** @private */\n get openNodes(): TreeNode[] {\n return this.nodes.filter(\n node => node.expanded || (node.parentNode as TreeNode).expanded || (node.parentNode as Tree) === this\n );\n }\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"nodes\"></slot>\n </div>\n `;\n }\n\n #observers: MutationObserver[] = [];\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n appendRootNodeStyle(this, globalStyles);\n this._internals.role = 'tree';\n\n this.#observers.push(\n onChildListMutation(\n this,\n () => {\n this.#syncNodes();\n },\n { subtree: true }\n )\n );\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#observers.forEach(o => o.disconnect());\n }\n\n async updated(props: PropertyValues<this>) {\n super.updated(props);\n await this.updateComplete;\n this.#syncNodes();\n }\n\n #syncNodes() {\n this.#syncNodeOptions();\n this.#syncNodeSelections();\n }\n\n #syncNodeOptions() {\n this.nodes.forEach(node => {\n node.selectable = this.selectable;\n node.behaviorExpand = this.behaviorExpand;\n node.behaviorSelect = this.behaviorSelect;\n });\n }\n\n #syncNodeSelections() {\n if (this.behaviorSelect && this.selectable === 'multi') {\n this.nodes.forEach(node => updateNodeSelection(node));\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCO,IAAMM,IAAN,cAAmBC,EAAW;;EA6DF,A,aApD2C,KAAA,iBAAA,IAKA,KAAA,iBAAA,IAKvB,KAAA,SAAA,IA0CpB,KAAAE,KAAA,CAAC;;;EAxClB,KAAA,SAAAC,EAAU,CAACV,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,UAAU,CAAC,eAAe;EAC5B;;CAKA,IAAI,QAAQ;EACV,OAAO,MAAM,KAAK,KAAK,iBAA2BW,EAAS,SAAS,GAAG,CAAC;CAC1E;CAGA,IAAI,mBAAqC;EACvC,OAAO;GACL,OAAO,KAAK,UACT,KAAI,MAAQC,EAAK,WAAY,cAAc,yBAAuB,CAAC,CAAC,CACpE,QAAQ,MAA0BC,MAAO,IAAI;GAChD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A,KAAA,CAAA,GAKxDJ,EAAA,CAAAqB,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAAjB,EAAA,WAAA,UAAA,KAAA,CAAA,GArB3C,IAAAJ,EAAA,CAAAsB,EAAM,GACNC,EAAwB,CAAA,GAAAnB,CAAA"}
|
package/dist/week/week2.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import n from "../
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import o from "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
2
|
+
import { IconButton as t } from "../icon-button/icon-button2.js";
|
|
3
|
+
import { Control as n } from "../forms/control/control2.js";
|
|
4
|
+
import { inputStyles as r } from "../input/input2.js";
|
|
5
|
+
import i from "./week.js";
|
|
6
|
+
import { html as a } from "lit";
|
|
7
|
+
import { property as o } from "lit/decorators/property.js";
|
|
8
|
+
import { scopedRegistry as s } from "@nvidia-elements/foundations/internal/decorators";
|
|
9
|
+
import { useStyles as c } from "@nvidia-elements/foundations/internal/styles";
|
|
10
10
|
// src/week/week.ts
|
|
11
|
-
var l = { expand: "expand" }, u = class extends
|
|
11
|
+
var l = { expand: "expand" }, u = class extends n {
|
|
12
12
|
get i18nDefaults() {
|
|
13
13
|
return l;
|
|
14
14
|
}
|
|
15
15
|
static {
|
|
16
|
-
this.styles =
|
|
17
|
-
...
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
this.styles = c([
|
|
17
|
+
...n.styles,
|
|
18
|
+
r,
|
|
19
|
+
i
|
|
20
20
|
]);
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.metadata = {
|
|
24
24
|
tag: "nve-week",
|
|
25
|
-
version: "2.23.
|
|
25
|
+
version: "2.23.5"
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
static {
|
|
29
|
-
this.elementDefinitions = { [
|
|
29
|
+
this.elementDefinitions = { [t.metadata.tag]: t };
|
|
30
30
|
}
|
|
31
31
|
get suffixContent() {
|
|
32
|
-
return
|
|
32
|
+
return a`<nve-icon-button exportparts="icon:icon-button-icon" part="icon-button" .ariaLabel="${this.i18n.expand}" icon-name="calendar" container="inline" @click="${this.showPicker}"></nve-icon-button>`;
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
e([o({
|
|
36
36
|
type: String,
|
|
37
37
|
reflect: !0
|
|
38
|
-
})], u.prototype, "container", void 0), u =
|
|
38
|
+
})], u.prototype, "container", void 0), u = e([s()], u);
|
|
39
39
|
export { u as Week };
|
|
40
40
|
|
|
41
41
|
//# sourceMappingURL=week2.js.map
|
package/dist/week/week2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"week2.js","names":["styles","_decorate","__decorate","week_default","i18nDefaults","Week","Control","useStyles","inputStyles","IconButton","property","scopedRegistry"],"sources":["../../src/week/week.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { ContainerElement } from '@nvidia-elements/core/internal';\nimport { scopedRegistry
|
|
1
|
+
{"version":3,"file":"week2.js","names":["styles","_decorate","__decorate","week_default","i18nDefaults","Week","Control","useStyles","inputStyles","IconButton","property","scopedRegistry"],"sources":["../../src/week/week.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { ContainerElement } from '@nvidia-elements/core/internal';\nimport { scopedRegistry } from '@nvidia-elements/foundations/internal/decorators';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport { inputStyles } from '@nvidia-elements/core/input';\nimport type { I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport styles from './week.css?inline';\n\nconst i18nDefaults = {\n expand: 'expand'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-week\n * @description A week picker is a control that enables users to choose a week value.\n * @documentation https://nvidia.github.io/elements/docs/elements/week/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/week\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --cursor\n * @csspart icon-button - The calendar icon button element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/week\n */\n@scopedRegistry()\nexport class Week extends Control implements ContainerElement {\n protected override get i18nDefaults(): I18nDefaults {\n return i18nDefaults;\n }\n\n /**\n * Reduces the visual container for a minimal borderless appearance while preserving whitespace bounds.\n * Use when embedding within another container such as a toolbar.\n */\n @property({ type: String, reflect: true }) container?: 'flat';\n\n static styles = useStyles([...Control.styles, inputStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-week',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n protected get suffixContent() {\n return html`<nve-icon-button exportparts=\"icon:icon-button-icon\" part=\"icon-button\" .ariaLabel=${this.i18n.expand} icon-name=\"calendar\" container=\"inline\" @click=${this.showPicker}></nve-icon-button>`;\n }\n}\n"],"mappings":";;;;;;;;;;AAcA,IAAMI,IAAe,EACnB,QAAQ,SACV,GAmBaC,IAAN,cAAmBC,EAAoC;CAC5D,IAAuB,eAA6B;EAClD,OAAOF;CACT;;EAQgB,KAAA,SAAAG,EAAU;GAAC,GAAGD,EAAQ;GAAQE;GAAaR;EAAM,CAAC;;;EAEvC,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,GACzBS,EAAW,SAAS,MAAMA,EAC7B;;CAEA,IAAc,gBAAgB;EAC5B,OAAO,CAAI,uFAAsF,KAAK,KAAK,OAAO,oDAAkD,KAAK,WAAW;CACtL;AACF;AAhBGR,EAAA,CAAAS,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAL,EAAA,WAAA,aAAA,KAAA,CAAA,GAV1C,IAAAJ,EAAA,CAAAU,EAAe,CAAA,GAAAN,CAAA"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import e from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
2
|
+
import t from "./panel.js";
|
|
3
|
+
import { attachInternals as n } from "@nvidia-elements/foundations/internal/a11y";
|
|
4
|
+
import { LitElement as r, html as i } from "lit";
|
|
5
|
+
import { property as a } from "lit/decorators/property.js";
|
|
6
|
+
import { useStyles as o } from "@nvidia-elements/foundations/internal/styles";
|
|
7
7
|
import { state as s } from "lit/decorators/state.js";
|
|
8
8
|
// src/workspace/panel/panel.ts
|
|
9
|
-
var c = class extends
|
|
9
|
+
var c = class extends r {
|
|
10
10
|
constructor(...e) {
|
|
11
11
|
super(...e), this.minWidth = 0, this.minHeight = 0, this.selected = !1, this.headerHeight = 0;
|
|
12
12
|
}
|
|
13
13
|
static {
|
|
14
|
-
this.styles =
|
|
14
|
+
this.styles = o([t]);
|
|
15
15
|
}
|
|
16
16
|
static {
|
|
17
17
|
this.metadata = {
|
|
18
18
|
tag: "nve-workspace-panel",
|
|
19
|
-
version: "2.23.
|
|
19
|
+
version: "2.23.5",
|
|
20
20
|
parents: ["nve-workspace"],
|
|
21
21
|
children: [
|
|
22
22
|
"nve-workspace-panel-header",
|
|
@@ -26,11 +26,11 @@ var c = class extends i {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
connectedCallback() {
|
|
29
|
-
super.connectedCallback(),
|
|
29
|
+
super.connectedCallback(), n(this);
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
32
|
let { selected: e, headerHeight: t } = this;
|
|
33
|
-
return
|
|
33
|
+
return i`<div internal-host><div class="surface"><slot name="header"></slot><div class="content" style="${`top:${t}px`}" ?hidden="${!e}"><div class="body" tabindex="0"><slot></slot></div><slot name="footer"></slot></div></div><div class="frame" ?hidden="${!e}"></div></div>`;
|
|
34
34
|
}
|
|
35
35
|
_present(e) {
|
|
36
36
|
e ? this._internals.states.add("workspace-presented") : this._internals.states.delete("workspace-presented");
|
|
@@ -39,15 +39,15 @@ var c = class extends i {
|
|
|
39
39
|
this.selected = e.selected, this.headerHeight = e.headerHeight, this.querySelector(":scope > nve-workspace-panel-header")?._configure(e);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
e([a({
|
|
43
43
|
type: Number,
|
|
44
44
|
attribute: "min-width",
|
|
45
45
|
reflect: !0
|
|
46
|
-
})], c.prototype, "minWidth", void 0),
|
|
46
|
+
})], c.prototype, "minWidth", void 0), e([a({
|
|
47
47
|
type: Number,
|
|
48
48
|
attribute: "min-height",
|
|
49
49
|
reflect: !0
|
|
50
|
-
})], c.prototype, "minHeight", void 0),
|
|
50
|
+
})], c.prototype, "minHeight", void 0), e([s()], c.prototype, "selected", void 0), e([s()], c.prototype, "headerHeight", void 0);
|
|
51
51
|
export { c as WorkspacePanel };
|
|
52
52
|
|
|
53
53
|
//# sourceMappingURL=panel2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel2.js","names":["styles","_decorate","__decorate","panel_default","WorkspacePanel","LitElement","_args","useStyles","attachInternals","headerHeight","selected","presented","configuration","property","state"],"sources":["../../../src/workspace/panel/panel.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\n\nimport { attachInternals
|
|
1
|
+
{"version":3,"file":"panel2.js","names":["styles","_decorate","__decorate","panel_default","WorkspacePanel","LitElement","_args","useStyles","attachInternals","headerHeight","selected","presented","configuration","property","state"],"sources":["../../../src/workspace/panel/panel.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\n\nimport { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\n\nimport type { WorkspaceHeaderConfiguration } from '../utils/presentation/header-configuration.utils.js';\n\nimport type { WorkspacePanelHeader } from '../panel-header/panel-header.js';\n\nimport styles from './panel.css?inline';\n\n/**\n * @element nve-workspace-panel\n * @description Stable application content and its workspace chrome.\n * @documentation https://nvidia.github.io/elements/docs/elements/workspace/\n * @since 0.0.0\n * @stable false\n * @entrypoint \\@nvidia-elements/core/workspace\n * @command --enter-fullscreen - Present this panel's group in native fullscreen.\n * @command --exit-fullscreen - Exit native fullscreen.\n * @command --toggle-fullscreen - Toggle native fullscreen for this panel's group.\n * @command --open - Open and activate the targeted supplied panel. Repeated activation is silent.\n * @command --close - Close the targeted panel when its workspace is closable.\n * @command --select - Activate an open supplied panel without reopening a closed panel.\n * @command --place - Apply the invoker's typed placement request when rearrangeable; membership changes also require groupable.\n * @slot - Application content.\n * @slot header - Title and controls.\n * @slot footer - Status and actions.\n * @cssprop --background\n * @cssprop --border\n * @cssprop --box-shadow\n */\nexport class WorkspacePanel extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-workspace-panel',\n version: '0.0.0',\n parents: ['nve-workspace'],\n children: ['nve-workspace-panel-header', 'nve-workspace-panel-content', 'nve-workspace-panel-footer']\n };\n\n /** Application minimum total panel width in pixels. */\n @property({ type: Number, attribute: 'min-width', reflect: true }) minWidth = 0;\n\n /** Application minimum total panel height in pixels. */\n @property({ type: Number, attribute: 'min-height', reflect: true }) minHeight = 0;\n\n @state() private selected = false;\n\n @state() private headerHeight = 0;\n\n /** @internal */\n declare _internals: ElementInternals;\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n }\n\n render() {\n const { selected, headerHeight } = this;\n return html`\n <div internal-host>\n <div class=\"surface\">\n <slot name=\"header\"></slot>\n <div class=\"content\" style=${`top:${headerHeight}px`} ?hidden=${!selected}>\n <div class=\"body\" tabindex=\"0\"><slot></slot></div>\n <slot name=\"footer\"></slot>\n </div>\n </div>\n <div class=\"frame\" ?hidden=${!selected}></div>\n </div>\n `;\n }\n\n /** @internal */\n _present(presented: boolean) {\n if (presented) this._internals.states.add('workspace-presented');\n else this._internals.states.delete('workspace-presented');\n }\n\n /** @internal */\n _configure(configuration: WorkspaceHeaderConfiguration & { scrollLeft: number }) {\n this.selected = configuration.selected;\n this.headerHeight = configuration.headerHeight;\n this.querySelector<WorkspacePanelHeader>(':scope > nve-workspace-panel-header')?._configure(configuration);\n }\n}\n"],"mappings":";;;;;;;;AAqCA,IAAaI,IAAb,cAAoCC,EAAW;;EAkBb,A,aAP8C,KAAA,WAAA,GAGE,KAAA,YAAA,GAEpD,KAAA,WAAA,IAEI,KAAA,eAAA;;;EAjBhB,KAAA,SAAAE,EAAU,CAACP,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,SAAS,CAAC,eAAe;GACzB,UAAU;IAAC;IAA8B;IAA+B;GAA4B;EACtG;;CAeA,oBAAoB;EAElB,AADA,MAAM,kBAAkB,GACxBQ,EAAgB,IAAI;CACtB;CAEA,SAAS;EACP,IAAM,EAAE,aAAU,oBAAiB;EACnC,OAAO,CAAI,kGAIwB,OAAOC,EAAa,IAAI,aAAW,CAACC,EAAS,yHAK/C,CAACA,EAAS;CAG7C;CAGA,SAAS,GAAoB;EAC3B,AAAIC,IAAW,KAAK,WAAW,OAAO,IAAI,qBAAqB,IAC1D,KAAK,WAAW,OAAO,OAAO,qBAAqB;CAC1D;CAGA,WAAW,GAAsE;EAG/E,AAFA,KAAK,WAAWC,EAAc,UAC9B,KAAK,eAAeA,EAAc,cAClC,KAAK,cAAoC,qCAAqC,CAAC,EAAE,WAAWA,CAAa;CAC3G;AACF;AA7CGX,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAa,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,YAAA,KAAA,CAAA,GAGhEH,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAc,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,aAAA,KAAA,CAAA,GAEjEH,EAAA,CAAAa,EAAM,CAAA,GAAAV,EAAA,WAAA,YAAA,KAAA,CAAA,GAENH,EAAA,CAAAa,EAAM,CAAA,GAAAV,EAAA,WAAA,gBAAA,KAAA,CAAA"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "
|
|
3
|
-
import {
|
|
1
|
+
import e from "./panel-content.js";
|
|
2
|
+
import { LitElement as t, html as n } from "lit";
|
|
3
|
+
import { useStyles as r } from "@nvidia-elements/foundations/internal/styles";
|
|
4
4
|
// src/workspace/panel-content/panel-content.ts
|
|
5
|
-
var i = class extends
|
|
5
|
+
var i = class extends t {
|
|
6
6
|
static {
|
|
7
|
-
this.styles =
|
|
7
|
+
this.styles = r([e]);
|
|
8
8
|
}
|
|
9
9
|
static {
|
|
10
10
|
this.metadata = {
|
|
11
11
|
tag: "nve-workspace-panel-content",
|
|
12
|
-
version: "2.23.
|
|
12
|
+
version: "2.23.5",
|
|
13
13
|
parents: ["nve-workspace-panel"]
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return
|
|
17
|
+
return n`<div internal-host><slot></slot></div>`;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
export { i as WorkspacePanelContent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-content2.js","names":["styles","panel_content_default","WorkspacePanelContent","LitElement","useStyles"],"sources":["../../../src/workspace/panel-content/panel-content.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\n\nimport { useStyles } from '@nvidia-elements/
|
|
1
|
+
{"version":3,"file":"panel-content2.js","names":["styles","panel_content_default","WorkspacePanelContent","LitElement","useStyles"],"sources":["../../../src/workspace/panel-content/panel-content.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\n\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\n\nimport styles from './panel-content.css?inline';\n\n/**\n * @element nve-workspace-panel-content\n * @description Provides padding for workspace panel content.\n * @documentation https://nvidia.github.io/elements/docs/elements/workspace/\n * @since 0.0.0\n * @stable false\n * @entrypoint \\@nvidia-elements/core/workspace\n * @slot - Application content.\n * @cssprop --padding\n */\nexport class WorkspacePanelContent extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = { tag: 'nve-workspace-panel-content', version: '0.0.0', parents: ['nve-workspace-panel'] };\n\n render() {\n return html`\n <div internal-host><slot></slot></div>\n `;\n }\n}\n"],"mappings":";;;;AAmBA,IAAaE,IAAb,cAA2CC,EAAW;;EACpC,KAAA,SAAAC,EAAU,CAACJ,CAAM,CAAC;;;EAEP,KAAA,WAAA;GAAE,KAAK;GAA+B,SAAS;GAAS,SAAS,CAAC,qBAAqB;EAAE;;CAEpH,SAAS;EACP,OAAO,CAAI;CAGb;AACF"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { hostAttr as e } from "../../internal/decorators/host-attr.js";
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
2
|
+
import t from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
3
|
+
import n from "./panel-footer.js";
|
|
4
|
+
import { LitElement as r, html as i } from "lit";
|
|
5
|
+
import { useStyles as a } from "@nvidia-elements/foundations/internal/styles";
|
|
6
6
|
// src/workspace/panel-footer/panel-footer.ts
|
|
7
|
-
var o = class extends
|
|
7
|
+
var o = class extends r {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e), this.slot = "footer";
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
|
-
this.styles =
|
|
12
|
+
this.styles = a([n]);
|
|
13
13
|
}
|
|
14
14
|
static {
|
|
15
15
|
this.metadata = {
|
|
16
16
|
tag: "nve-workspace-panel-footer",
|
|
17
|
-
version: "2.23.
|
|
17
|
+
version: "2.23.5",
|
|
18
18
|
parents: ["nve-workspace-panel"]
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return
|
|
22
|
+
return i`<div internal-host><slot></slot></div>`;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
t([e()], o.prototype, "slot", void 0);
|
|
26
26
|
export { o as WorkspacePanelFooter };
|
|
27
27
|
|
|
28
28
|
//# sourceMappingURL=panel-footer2.js.map
|