@nvidia-elements/core 2.23.4 → 2.23.6
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 +10 -10
- 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 +1032 -337
- 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/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/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/controllers/workspace-composition.controller.d.ts +4 -1
- package/dist/workspace/controllers/workspace-composition.controller.js +69 -39
- package/dist/workspace/controllers/workspace-composition.controller.js.map +1 -1
- package/dist/workspace/controllers/workspace-rearrange.controller.js +27 -27
- package/dist/workspace/controllers/workspace-rearrange.controller.js.map +1 -1
- package/dist/workspace/controllers/workspace-restoration.controller.js +2 -2
- package/dist/workspace/controllers/workspace-restoration.controller.js.map +1 -1
- package/dist/workspace/panel/panel2.js +15 -15
- 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/utils/comparison.utils.d.ts +3 -0
- package/dist/workspace/utils/comparison.utils.js +13 -0
- package/dist/workspace/utils/comparison.utils.js.map +1 -0
- package/dist/workspace/utils/evaluation.utils.d.ts +65 -6
- package/dist/workspace/utils/evaluation.utils.js +334 -99
- package/dist/workspace/utils/evaluation.utils.js.map +1 -1
- package/dist/workspace/utils/geometry/allocation.utils.js +15 -13
- package/dist/workspace/utils/geometry/allocation.utils.js.map +1 -1
- package/dist/workspace/utils/geometry/sizing.utils.d.ts +2 -0
- package/dist/workspace/utils/geometry/sizing.utils.js +37 -17
- package/dist/workspace/utils/geometry/sizing.utils.js.map +1 -1
- package/dist/workspace/utils/interaction/boundary.utils.d.ts +2 -2
- package/dist/workspace/utils/interaction/boundary.utils.js +2 -2
- package/dist/workspace/utils/interaction/boundary.utils.js.map +1 -1
- package/dist/workspace/utils/interaction/drag-preview.utils.d.ts +3 -3
- package/dist/workspace/utils/interaction/drag-preview.utils.js.map +1 -1
- package/dist/workspace/utils/interaction/insertion-offers.utils.d.ts +11 -9
- package/dist/workspace/utils/interaction/insertion-offers.utils.js +37 -43
- package/dist/workspace/utils/interaction/insertion-offers.utils.js.map +1 -1
- package/dist/workspace/utils/interaction/placement-decision.utils.d.ts +6 -1
- package/dist/workspace/utils/interaction/placement-decision.utils.js +94 -87
- package/dist/workspace/utils/interaction/placement-decision.utils.js.map +1 -1
- package/dist/workspace/utils/model/layout.utils.d.ts +2 -1
- package/dist/workspace/utils/model/layout.utils.js +12 -10
- package/dist/workspace/utils/model/layout.utils.js.map +1 -1
- package/dist/workspace/utils/model/membership.utils.d.ts +4 -0
- package/dist/workspace/utils/model/membership.utils.js +13 -4
- package/dist/workspace/utils/model/membership.utils.js.map +1 -1
- package/dist/workspace/utils/model/operations.utils.d.ts +1 -0
- package/dist/workspace/utils/model/operations.utils.js +51 -46
- package/dist/workspace/utils/model/operations.utils.js.map +1 -1
- package/dist/workspace/utils/model/projection.utils.d.ts +4 -2
- package/dist/workspace/utils/model/projection.utils.js +49 -40
- package/dist/workspace/utils/model/projection.utils.js.map +1 -1
- package/dist/workspace/utils/model/value.utils.d.ts +4 -3
- package/dist/workspace/utils/model/value.utils.js +15 -50
- package/dist/workspace/utils/model/value.utils.js.map +1 -1
- package/dist/workspace/utils/placement/acquisition-sizing.utils.d.ts +2 -0
- package/dist/workspace/utils/placement/acquisition-sizing.utils.js +30 -22
- package/dist/workspace/utils/placement/acquisition-sizing.utils.js.map +1 -1
- package/dist/workspace/utils/placement/group-insertion.utils.d.ts +19 -13
- package/dist/workspace/utils/placement/group-insertion.utils.js +50 -47
- package/dist/workspace/utils/placement/group-insertion.utils.js.map +1 -1
- package/dist/workspace/utils/placement/planner.utils.d.ts +13 -2
- package/dist/workspace/utils/placement/planner.utils.js +79 -73
- package/dist/workspace/utils/placement/planner.utils.js.map +1 -1
- package/dist/workspace/utils/placement/preparation.utils.d.ts +5 -2
- package/dist/workspace/utils/placement/preparation.utils.js +45 -41
- package/dist/workspace/utils/placement/preparation.utils.js.map +1 -1
- package/dist/workspace/utils/placement/region.utils.js +32 -32
- package/dist/workspace/utils/placement/region.utils.js.map +1 -1
- package/dist/workspace/utils/placement/scope.utils.d.ts +34 -0
- package/dist/workspace/utils/placement/scope.utils.js +155 -0
- package/dist/workspace/utils/placement/scope.utils.js.map +1 -0
- package/dist/workspace/utils/placement/session.utils.d.ts +11 -0
- package/dist/workspace/utils/placement/session.utils.js +78 -0
- package/dist/workspace/utils/placement/session.utils.js.map +1 -0
- package/dist/workspace/utils/placement/split-sizing.utils.d.ts +2 -2
- package/dist/workspace/utils/placement/split-sizing.utils.js +19 -19
- package/dist/workspace/utils/placement/split-sizing.utils.js.map +1 -1
- package/dist/workspace/utils/presentation/composition.utils.d.ts +1 -1
- package/dist/workspace/utils/presentation/composition.utils.js +4 -2
- package/dist/workspace/utils/presentation/composition.utils.js.map +1 -1
- package/dist/workspace/utils/presentation/groups.utils.d.ts +3 -3
- package/dist/workspace/utils/presentation/groups.utils.js +40 -30
- package/dist/workspace/utils/presentation/groups.utils.js.map +1 -1
- package/dist/workspace/utils/presentation/measurements.utils.d.ts +1 -0
- package/dist/workspace/utils/presentation/measurements.utils.js +6 -14
- package/dist/workspace/utils/presentation/measurements.utils.js.map +1 -1
- package/dist/workspace/utils/presentation/offers.utils.d.ts +1 -1
- package/dist/workspace/utils/presentation/offers.utils.js +3 -3
- package/dist/workspace/utils/presentation/offers.utils.js.map +1 -1
- package/dist/workspace/utils/presentation/preview.utils.d.ts +6 -0
- package/dist/workspace/utils/presentation/preview.utils.js +14 -3
- package/dist/workspace/utils/presentation/preview.utils.js.map +1 -1
- package/dist/workspace/workspace.examples.js.map +1 -1
- package/dist/workspace/workspace.examples.json +4 -4
- package/dist/workspace/workspace.js +1 -1
- package/dist/workspace/workspace.js.map +1 -1
- package/dist/workspace/workspace2.js +233 -239
- 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/workspace/utils/placement/context.utils.d.ts +0 -36
- package/dist/workspace/utils/placement/context.utils.js +0 -135
- package/dist/workspace/utils/placement/context.utils.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { hostAttr as e } from "../../internal/decorators/host-attr.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import t from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
3
|
+
import { Icon as n } from "../../icon/icon2.js";
|
|
4
|
+
import r from "./control-message.js";
|
|
5
|
+
import { LitElement as i, html as a } from "lit";
|
|
6
|
+
import { property as o } from "lit/decorators/property.js";
|
|
7
|
+
import { scopedRegistry as s } from "@nvidia-elements/foundations/internal/decorators";
|
|
8
|
+
import { useStyles as c } from "@nvidia-elements/foundations/internal/styles";
|
|
9
9
|
// src/forms/control-message/control-message.ts
|
|
10
10
|
var l = {
|
|
11
11
|
undefined: "information-circle",
|
|
@@ -13,33 +13,33 @@ var l = {
|
|
|
13
13
|
warning: "exclamation-triangle",
|
|
14
14
|
success: "checkmark-circle",
|
|
15
15
|
error: "exclamation-circle"
|
|
16
|
-
}, u = class extends
|
|
16
|
+
}, u = class extends i {
|
|
17
17
|
constructor(...e) {
|
|
18
18
|
super(...e), this.error = null, this.slot = "messages";
|
|
19
19
|
}
|
|
20
20
|
static {
|
|
21
|
-
this.styles =
|
|
21
|
+
this.styles = c([r]);
|
|
22
22
|
}
|
|
23
23
|
static {
|
|
24
24
|
this.metadata = {
|
|
25
25
|
tag: "nve-control-message",
|
|
26
|
-
version: "2.23.
|
|
26
|
+
version: "2.23.6"
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
static {
|
|
30
|
-
this.elementDefinitions = { [
|
|
30
|
+
this.elementDefinitions = { [n.metadata.tag]: n };
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
|
-
return
|
|
33
|
+
return a`<div internal-host><slot name="icon"><nve-icon part="icon" name="${this.error ? l.error : l[this.status]}"></nve-icon></slot><slot></slot></div>`;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
t([o({
|
|
37
37
|
type: String,
|
|
38
38
|
reflect: !0
|
|
39
|
-
})], u.prototype, "status", void 0),
|
|
39
|
+
})], u.prototype, "status", void 0), t([o({
|
|
40
40
|
type: String,
|
|
41
41
|
reflect: !0
|
|
42
|
-
})], u.prototype, "error", void 0),
|
|
42
|
+
})], u.prototype, "error", void 0), t([e()], u.prototype, "slot", void 0), u = t([s()], u);
|
|
43
43
|
export { u as ControlMessage };
|
|
44
44
|
|
|
45
45
|
//# sourceMappingURL=control-message2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-message2.js","names":["styles","_decorate","__decorate","control_message_default","statusIcons","ControlMessage","LitElement","_args","useStyles","Icon","property","hostAttr","scopedRegistry"],"sources":["../../../src/forms/control-message/control-message.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { hostAttr
|
|
1
|
+
{"version":3,"file":"control-message2.js","names":["styles","_decorate","__decorate","control_message_default","statusIcons","ControlMessage","LitElement","_args","useStyles","Icon","property","hostAttr","scopedRegistry"],"sources":["../../../src/forms/control-message/control-message.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { hostAttr } from '@nvidia-elements/core/internal';\nimport { scopedRegistry } from '@nvidia-elements/foundations/internal/decorators';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { type ValidityStateError } from '../utils/types.js';\nimport styles from './control-message.css?inline';\n\nconst statusIcons = {\n undefined: 'information-circle',\n disabled: 'information-circle',\n warning: 'exclamation-triangle',\n success: 'checkmark-circle',\n error: 'exclamation-circle'\n} as const;\n\n/**\n * @element nve-control-message\n * @description Defining a Validity State on a control-message allows messages to show conditionally based on the current HTML5 validity state.\n * @documentation https://nvidia.github.io/elements/docs/elements/control/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/forms\n * @slot - Validation or supporting message text for the associated control.\n * @slot icon - override the icon with a custom icon\n * @cssprop --color\n * @cssprop --font-weight\n * @cssprop --font-size\n * @csspart icon - The icon element\n * @aria https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals\n * @package true\n */\n@scopedRegistry()\nexport class ControlMessage extends LitElement {\n /**\n * Visual treatment for current form control validation status\n */\n @property({ type: String, reflect: true }) status?: 'warning' | 'error' | 'success' | 'disabled';\n\n /**\n * Validation error code for current form control\n * https://developer.mozilla.org/en-US/docs/Web/API/ValidityState\n */\n @property({ type: String, reflect: true }) error: ValidityStateError | null = null;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-control-message',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon\n };\n\n /** @private */\n @hostAttr() slot = 'messages';\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"icon\"><nve-icon part=\"icon\" name=${this.error ? statusIcons.error : statusIcons[this.status!]}></nve-icon></slot>\n <slot></slot>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;;;;AAYA,IAAMI,IAAc;CAClB,WAAW;CACX,UAAU;CACV,SAAS;CACT,SAAS;CACT,OAAO;AACT,GAkBaC,IAAN,cAA6BC,EAAW;;EAwB1B,A,aAd2D,KAAA,QAAA,MAc3D,KAAA,OAAA;;;EAZH,KAAA,SAAAE,EAAU,CAACR,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,GACzBS,EAAK,SAAS,MAAMA,EACvB;;CAKA,SAAS;EACP,OAAO,CAAI,oEAEwC,KAAK,QAAQL,EAAY,QAAQA,EAAY,KAAK,QAAS;CAIhH;AACF;AA9BGH,EAAA,CAAAS,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAL,EAAA,WAAA,UAAA,KAAA,CAAA,GAMxCJ,EAAA,CAAAS,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAL,EAAA,WAAA,SAAA,KAAA,CAAA,GAcxCJ,EAAA,CAAAU,EAAS,CAAA,GAAAN,EAAA,WAAA,QAAA,KAAA,CAAA,GAzBX,IAAAJ,EAAA,CAAAW,EAAe,CAAA,GAAAP,CAAA"}
|
package/dist/gauge/gauge2.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
2
|
+
import t from "./gauge.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 { I18nController as o } from "@nvidia-elements/foundations/internal/i18n";
|
|
7
|
+
import { styleMap as s } from "lit/directives/style-map.js";
|
|
8
|
+
import { useStyles as c } from "@nvidia-elements/foundations/internal/styles";
|
|
9
9
|
// src/gauge/gauge.ts
|
|
10
10
|
var l = {
|
|
11
11
|
default: {
|
|
@@ -35,17 +35,17 @@ var l = {
|
|
|
35
35
|
information: "information",
|
|
36
36
|
success: "success",
|
|
37
37
|
warning: "warning"
|
|
38
|
-
}, f = class extends
|
|
38
|
+
}, f = class extends r {
|
|
39
39
|
constructor(...e) {
|
|
40
|
-
super(...e), this.value = 0, this.max = 100, this.status = "neutral", this.thumb = "fill", this.#e = new
|
|
40
|
+
super(...e), this.value = 0, this.max = 100, this.status = "neutral", this.thumb = "fill", this.#e = new o(this, d), this.i18n = this.#e.i18n, this.#t = 0, this.#r = 0;
|
|
41
41
|
}
|
|
42
42
|
static {
|
|
43
|
-
this.styles =
|
|
43
|
+
this.styles = c([t]);
|
|
44
44
|
}
|
|
45
45
|
static {
|
|
46
46
|
this.metadata = {
|
|
47
47
|
tag: "nve-gauge",
|
|
48
|
-
version: "2.23.
|
|
48
|
+
version: "2.23.6"
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
#e;
|
|
@@ -60,11 +60,11 @@ var l = {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
|
-
let e = this.#f(), t = this.#t, n = this.#p(), r = this.#l(e, t),
|
|
64
|
-
return
|
|
63
|
+
let e = this.#f(), t = this.#t, n = this.#p(), r = this.#l(e, t), a = this.#u(e, t), o = n === "fill", c = t > 0 && (n === "fill" || n === "dot");
|
|
64
|
+
return i`<div internal-host><svg viewBox="${e.viewBox}" role="presentation" aria-hidden="true"><defs><mask id="background-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="${e.surfaceHeight}"><path d="${e.path}" class="background"></path></mask><mask id="fill-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="${e.surfaceHeight}"><path d="${a}" class="gauge" ?empty="${t <= 0}"></path></mask></defs><foreignObject width="128" height="${e.surfaceHeight}" mask="url(#background-mask)"><div xmlns="http://www.w3.org/1999/xhtml" class="background-surface"></div></foreignObject><foreignObject class="fill-layer" width="128" height="${e.surfaceHeight}" mask="url(#fill-mask)" ?hidden="${!o || t <= 0}"><div xmlns="http://www.w3.org/1999/xhtml" class="fill-surface"></div></foreignObject><circle class="fill-dot-end" cx="${e.center + e.radius}" cy="${e.center}" ?hidden="${!c}" style="${s(u("dot", r, e))}"></circle><g class="needle" ?hidden="${n !== "needle"}" style="${s(u("needle", r, e))}"><line class="needle-line" x1="${e.center}" y1="${e.center}" x2="${e.center + 40}" y2="${e.center}"></line><circle class="needle-hub" cx="${e.center}" cy="${e.center}"></circle></g></svg><slot></slot></div>`;
|
|
65
65
|
}
|
|
66
66
|
connectedCallback() {
|
|
67
|
-
super.connectedCallback(),
|
|
67
|
+
super.connectedCallback(), n(this), this._internals.role = "progressbar";
|
|
68
68
|
}
|
|
69
69
|
disconnectedCallback() {
|
|
70
70
|
super.disconnectedCallback(), this.#n && (this.#s(), this.#t = this.#a(), this.requestUpdate());
|
|
@@ -129,19 +129,19 @@ var l = {
|
|
|
129
129
|
return this.thumb === "dot" || this.thumb === "needle" ? this.thumb : "fill";
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
|
|
132
|
+
e([a({ type: Number })], f.prototype, "value", void 0), e([a({ type: Number })], f.prototype, "max", void 0), e([a({
|
|
133
133
|
type: String,
|
|
134
134
|
reflect: !0
|
|
135
|
-
})], f.prototype, "status", void 0),
|
|
135
|
+
})], f.prototype, "status", void 0), e([a({
|
|
136
136
|
type: String,
|
|
137
137
|
reflect: !0
|
|
138
|
-
})], f.prototype, "shape", void 0),
|
|
138
|
+
})], f.prototype, "shape", void 0), e([a({
|
|
139
139
|
type: String,
|
|
140
140
|
reflect: !0
|
|
141
|
-
})], f.prototype, "thumb", void 0),
|
|
141
|
+
})], f.prototype, "thumb", void 0), e([a({
|
|
142
142
|
type: String,
|
|
143
143
|
reflect: !0
|
|
144
|
-
})], f.prototype, "size", void 0),
|
|
144
|
+
})], f.prototype, "size", void 0), e([a({ type: Object })], f.prototype, "i18n", void 0);
|
|
145
145
|
export { f as Gauge };
|
|
146
146
|
|
|
147
147
|
//# sourceMappingURL=gauge2.js.map
|
package/dist/gauge/gauge2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gauge2.js","names":["styles","_decorate","__decorate","gauge_default","GAUGE_GEOMETRY","thumbStyle","thumb","progressAngle","geometry","i18nDefaults","Gauge","LitElement","_args","#i18nController","I18nController","#paintedProgress","#progressFrame","useStyles","sourceMax","max","#geometry","progress","#normalizedThumb","#angleAtProgress","fillPath","#pathAtProgress","showFill","showDot","styleMap","attachInternals","#progressAnimation","#stopProgressAnimation","#targetProgress","props","#animateProgress","#normalizedValues","value","statusLabel","status","target","timing","#animationTiming","from","animation","paint","paintFrame","gaugeStyles","duration","milliseconds","easing","start","#pointAtAngle","sweepAngle","end","largeArcFlag","radians","angle","property"],"sources":["../../src/gauge/gauge.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 { styleMap } from 'lit/directives/style-map.js';\nimport type { Size, SupportStatus } from '@nvidia-elements/core/internal';\nimport { attachInternals, useStyles } from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport styles from './gauge.css?inline';\n\nconst GAUGE_GEOMETRY = {\n default: {\n center: 64,\n path: 'M 27.23 100.77 A 52 52 0 1 1 100.77 100.77',\n radius: 52,\n startAngle: 135,\n sweepAngle: 270,\n surfaceHeight: 128,\n viewBox: '8.53 8.53 110.93 95.7'\n },\n half: {\n center: 64,\n path: 'M 12 64 A 52 52 0 0 1 116 64',\n radius: 52,\n startAngle: 180,\n sweepAngle: 180,\n surfaceHeight: 64,\n viewBox: '8.53 8.53 110.93 58.93'\n }\n} as const;\n\ntype GaugeGeometry = (typeof GAUGE_GEOMETRY)[keyof typeof GAUGE_GEOMETRY];\n\nconst thumbStyle = (thumb: 'dot' | 'needle', progressAngle: number, geometry: GaugeGeometry) => ({\n [`--_${thumb}-angle`]: `${progressAngle}deg`,\n [`--_${thumb}-origin`]: `${geometry.center}px ${geometry.center}px`,\n [`--_${thumb}-start-angle`]: `${geometry.startAngle}deg`\n});\n\nconst i18nDefaults = {\n danger: 'danger',\n information: 'information',\n success: 'success',\n warning: 'warning'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-gauge\n * @description Use a gauge to show system resource usage.\n * @documentation https://nvidia.github.io/elements/docs/elements/gauge/\n * @since 2.0.4\n * @entrypoint \\@nvidia-elements/core/gauge\n * @slot - Content to display in the gauge center.\n * @cssprop --track-width\n * @cssprop --accent-color\n * @cssprop --background\n * @cssprop --needle-background\n * @cssprop --track-background\n * @cssprop --thumb-background\n * @cssprop --color\n * @cssprop --width\n * @cssprop --height\n * @cssprop --font-size\n * @cssprop --gap\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/progressbar_role\n * @stable false\n */\nexport class Gauge extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-gauge',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n /** The current `value` of the gauge. */\n @property({ type: Number }) value = 0;\n\n /** The `max` value of the gauge that the `value` is proportionally scaled to. */\n @property({ type: Number }) max? = 100;\n\n /** Four visual treatments represent the `status` of tasks. */\n @property({ type: String, reflect: true }) status?: SupportStatus | 'neutral' = 'neutral';\n\n /** Determines the gauge shape. Set `half` for a compact semi-circular arc. */\n @property({ type: String, reflect: true }) shape?: 'half';\n\n /** Controls the value indicator. Set `dot` for only the end dot or `needle` for a pointer. */\n @property({ type: String, reflect: true }) thumb: 'fill' | 'dot' | 'needle' = 'fill';\n\n /** T-shirt `size` of the gauge. */\n @property({ type: String, reflect: true }) size?: Size;\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /** Enables updating internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** Progress the gauge paints, which eases toward the value instead of jumping to it. */\n #paintedProgress = 0;\n\n #progressAnimation?: Animation;\n\n #progressFrame = 0;\n\n #normalizedValues() {\n const sourceMax = this.max;\n const max = sourceMax !== undefined && Number.isFinite(sourceMax) && sourceMax > 0 ? sourceMax : 100;\n const value = Number.isFinite(this.value) ? Math.min(Math.max(this.value, 0), max) : 0;\n return { value, max };\n }\n\n render() {\n const geometry = this.#geometry();\n const progress = this.#paintedProgress;\n const thumb = this.#normalizedThumb();\n const progressAngle = this.#angleAtProgress(geometry, progress);\n const fillPath = this.#pathAtProgress(geometry, progress);\n const showFill = thumb === 'fill';\n const showDot = progress > 0 && (thumb === 'fill' || thumb === 'dot');\n\n return html`\n <div internal-host>\n <svg viewBox=${geometry.viewBox} role=\"presentation\" aria-hidden=\"true\">\n <defs>\n <mask id=\"background-mask\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"128\" height=${geometry.surfaceHeight}>\n <path d=${geometry.path} class=\"background\"></path>\n </mask>\n <mask id=\"fill-mask\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"128\" height=${geometry.surfaceHeight}>\n <path d=${fillPath} class=\"gauge\" ?empty=${progress <= 0}></path>\n </mask>\n </defs>\n <foreignObject width=\"128\" height=${geometry.surfaceHeight} mask=\"url(#background-mask)\">\n <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"background-surface\"></div>\n </foreignObject>\n <foreignObject class=\"fill-layer\" width=\"128\" height=${geometry.surfaceHeight} mask=\"url(#fill-mask)\"\n ?hidden=${!showFill || progress <= 0}>\n <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"fill-surface\"></div>\n </foreignObject>\n <circle class=\"fill-dot-end\" cx=${geometry.center + geometry.radius} cy=${geometry.center}\n ?hidden=${!showDot}\n style=${styleMap(thumbStyle('dot', progressAngle, geometry))}>\n </circle>\n <g class=\"needle\"\n ?hidden=${thumb !== 'needle'}\n style=${styleMap(thumbStyle('needle', progressAngle, geometry))}>\n <line class=\"needle-line\" x1=${geometry.center} y1=${geometry.center} x2=${geometry.center + 40} y2=${geometry.center}></line>\n <circle class=\"needle-hub\" cx=${geometry.center} cy=${geometry.center}></circle>\n </g>\n </svg>\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'progressbar';\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n // settle the value, otherwise reattaching paints the frame where the animation stopped\n if (this.#progressAnimation) {\n this.#stopProgressAnimation();\n this.#paintedProgress = this.#targetProgress();\n this.requestUpdate();\n }\n }\n\n willUpdate(props: PropertyValues<this>) {\n super.willUpdate(props);\n\n if (props.has('value') || props.has('max')) {\n this.#animateProgress();\n }\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n const { value, max } = this.#normalizedValues();\n this._internals.ariaValueNow = `${value}`;\n this._internals.ariaValueMax = `${max}`;\n const { status } = this;\n const statusLabel =\n status !== undefined && status !== 'neutral' && status !== 'accent' ? this.i18n[status] : undefined;\n this._internals.ariaLabel = statusLabel ?? this.i18n.information ?? null;\n }\n\n #targetProgress() {\n const { value, max } = this.#normalizedValues();\n return (value / max) * 100;\n }\n\n /**\n * Eases the painted progress toward the value with the duration and easing declared in css, so\n * that `prefers-reduced-motion` and a `--_animation-duration` override both settle immediately.\n */\n #animateProgress() {\n const target = this.#targetProgress();\n const timing = this.hasUpdated ? this.#animationTiming() : undefined;\n\n this.#stopProgressAnimation();\n\n if (!timing || target === this.#paintedProgress) {\n this.#paintedProgress = target;\n return;\n }\n\n const from = this.#paintedProgress;\n // keyframeless animations only keep time, leaving every painted frame to `render`\n const animation = this.animate(null, timing);\n const paint = (progress: number) => {\n this.#paintedProgress = from + (target - from) * progress;\n this.requestUpdate();\n };\n const paintFrame = () => {\n paint(animation.effect?.getComputedTiming().progress ?? 0);\n\n if (animation.playState === 'running') {\n this.#progressFrame = requestAnimationFrame(paintFrame);\n }\n };\n\n animation.finished.then(\n () => {\n // a value that changes on the frame this settles already started the next animation\n if (this.#progressAnimation === animation) {\n this.#stopProgressAnimation();\n paint(1);\n }\n },\n () => undefined\n );\n\n this.#progressAnimation = animation;\n this.#progressFrame = requestAnimationFrame(paintFrame);\n }\n\n #stopProgressAnimation() {\n // only a browser render starts an animation, so server rendering never reaches these apis\n if (this.#progressAnimation) {\n cancelAnimationFrame(this.#progressFrame);\n this.#progressAnimation.cancel();\n this.#progressAnimation = undefined;\n }\n }\n\n #animationTiming() {\n const gaugeStyles = getComputedStyle(this);\n const duration = gaugeStyles.getPropertyValue('--_animation-duration').trim();\n const milliseconds = parseFloat(duration) * (duration.endsWith('ms') ? 1 : 1000);\n const easing = gaugeStyles.getPropertyValue('--nve-ref-animation-easing-100').trim();\n\n return milliseconds > 0 ? { duration: milliseconds, easing: easing || 'linear' } : undefined;\n }\n\n #angleAtProgress(geometry: GaugeGeometry, progress: number) {\n return geometry.startAngle + geometry.sweepAngle * (progress / 100);\n }\n\n #pathAtProgress(geometry: GaugeGeometry, progress: number) {\n const start = this.#pointAtAngle(geometry, geometry.startAngle);\n const sweepAngle = geometry.sweepAngle * (progress / 100);\n const end = this.#pointAtAngle(geometry, geometry.startAngle + sweepAngle);\n const largeArcFlag = sweepAngle > 180 ? 1 : 0;\n return `M ${start.x} ${start.y} A ${geometry.radius} ${geometry.radius} 0 ${largeArcFlag} 1 ${end.x} ${end.y}`;\n }\n\n #pointAtAngle(geometry: GaugeGeometry, angle: number) {\n const radians = (angle * Math.PI) / 180;\n return {\n x: geometry.center + geometry.radius * Math.cos(radians),\n y: geometry.center + geometry.radius * Math.sin(radians)\n };\n }\n\n #geometry() {\n return this.shape === 'half' ? GAUGE_GEOMETRY.half : GAUGE_GEOMETRY.default;\n }\n\n #normalizedThumb() {\n return this.thumb === 'dot' || this.thumb === 'needle' ? this.thumb : 'fill';\n }\n}\n"],"mappings":";;;;;;;;;AAYA,IAAMI,IAAiB;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AC,CAAA,GAAA/C,EAAA,WAAA,SAAA,KAAA,CAAA,GAGxCT,EAAA,CAAAwD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA/C,EAAA,WAAA,SAAA,KAAA,CAAA,GAGxCT,EAAA,CAAAwD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA/C,EAAA,WAAA,QAAA,KAAA,CAAA,GAKxCT,EAAA,CAAAwD,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA/C,EAAA,WAAA,QAAA,KAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"gauge2.js","names":["styles","_decorate","__decorate","gauge_default","GAUGE_GEOMETRY","thumbStyle","thumb","progressAngle","geometry","i18nDefaults","Gauge","LitElement","_args","#i18nController","I18nController","#paintedProgress","#progressFrame","useStyles","sourceMax","max","#geometry","progress","#normalizedThumb","#angleAtProgress","fillPath","#pathAtProgress","showFill","showDot","styleMap","attachInternals","#progressAnimation","#stopProgressAnimation","#targetProgress","props","#animateProgress","#normalizedValues","value","statusLabel","status","target","timing","#animationTiming","from","animation","paint","paintFrame","gaugeStyles","duration","milliseconds","easing","start","#pointAtAngle","sweepAngle","end","largeArcFlag","radians","angle","property"],"sources":["../../src/gauge/gauge.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 { styleMap } from 'lit/directives/style-map.js';\nimport type { Size, SupportStatus } from '@nvidia-elements/core/internal';\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 styles from './gauge.css?inline';\n\nconst GAUGE_GEOMETRY = {\n default: {\n center: 64,\n path: 'M 27.23 100.77 A 52 52 0 1 1 100.77 100.77',\n radius: 52,\n startAngle: 135,\n sweepAngle: 270,\n surfaceHeight: 128,\n viewBox: '8.53 8.53 110.93 95.7'\n },\n half: {\n center: 64,\n path: 'M 12 64 A 52 52 0 0 1 116 64',\n radius: 52,\n startAngle: 180,\n sweepAngle: 180,\n surfaceHeight: 64,\n viewBox: '8.53 8.53 110.93 58.93'\n }\n} as const;\n\ntype GaugeGeometry = (typeof GAUGE_GEOMETRY)[keyof typeof GAUGE_GEOMETRY];\n\nconst thumbStyle = (thumb: 'dot' | 'needle', progressAngle: number, geometry: GaugeGeometry) => ({\n [`--_${thumb}-angle`]: `${progressAngle}deg`,\n [`--_${thumb}-origin`]: `${geometry.center}px ${geometry.center}px`,\n [`--_${thumb}-start-angle`]: `${geometry.startAngle}deg`\n});\n\nconst i18nDefaults = {\n danger: 'danger',\n information: 'information',\n success: 'success',\n warning: 'warning'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-gauge\n * @description Use a gauge to show system resource usage.\n * @documentation https://nvidia.github.io/elements/docs/elements/gauge/\n * @since 2.0.4\n * @entrypoint \\@nvidia-elements/core/gauge\n * @slot - Content to display in the gauge center.\n * @cssprop --track-width\n * @cssprop --accent-color\n * @cssprop --background\n * @cssprop --needle-background\n * @cssprop --track-background\n * @cssprop --thumb-background\n * @cssprop --color\n * @cssprop --width\n * @cssprop --height\n * @cssprop --font-size\n * @cssprop --gap\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/progressbar_role\n * @stable false\n */\nexport class Gauge extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-gauge',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n /** The current `value` of the gauge. */\n @property({ type: Number }) value = 0;\n\n /** The `max` value of the gauge that the `value` is proportionally scaled to. */\n @property({ type: Number }) max? = 100;\n\n /** Four visual treatments represent the `status` of tasks. */\n @property({ type: String, reflect: true }) status?: SupportStatus | 'neutral' = 'neutral';\n\n /** Determines the gauge shape. Set `half` for a compact semi-circular arc. */\n @property({ type: String, reflect: true }) shape?: 'half';\n\n /** Controls the value indicator. Set `dot` for only the end dot or `needle` for a pointer. */\n @property({ type: String, reflect: true }) thumb: 'fill' | 'dot' | 'needle' = 'fill';\n\n /** T-shirt `size` of the gauge. */\n @property({ type: String, reflect: true }) size?: Size;\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /** Enables updating internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /** Progress the gauge paints, which eases toward the value instead of jumping to it. */\n #paintedProgress = 0;\n\n #progressAnimation?: Animation;\n\n #progressFrame = 0;\n\n #normalizedValues() {\n const sourceMax = this.max;\n const max = sourceMax !== undefined && Number.isFinite(sourceMax) && sourceMax > 0 ? sourceMax : 100;\n const value = Number.isFinite(this.value) ? Math.min(Math.max(this.value, 0), max) : 0;\n return { value, max };\n }\n\n render() {\n const geometry = this.#geometry();\n const progress = this.#paintedProgress;\n const thumb = this.#normalizedThumb();\n const progressAngle = this.#angleAtProgress(geometry, progress);\n const fillPath = this.#pathAtProgress(geometry, progress);\n const showFill = thumb === 'fill';\n const showDot = progress > 0 && (thumb === 'fill' || thumb === 'dot');\n\n return html`\n <div internal-host>\n <svg viewBox=${geometry.viewBox} role=\"presentation\" aria-hidden=\"true\">\n <defs>\n <mask id=\"background-mask\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"128\" height=${geometry.surfaceHeight}>\n <path d=${geometry.path} class=\"background\"></path>\n </mask>\n <mask id=\"fill-mask\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"128\" height=${geometry.surfaceHeight}>\n <path d=${fillPath} class=\"gauge\" ?empty=${progress <= 0}></path>\n </mask>\n </defs>\n <foreignObject width=\"128\" height=${geometry.surfaceHeight} mask=\"url(#background-mask)\">\n <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"background-surface\"></div>\n </foreignObject>\n <foreignObject class=\"fill-layer\" width=\"128\" height=${geometry.surfaceHeight} mask=\"url(#fill-mask)\"\n ?hidden=${!showFill || progress <= 0}>\n <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"fill-surface\"></div>\n </foreignObject>\n <circle class=\"fill-dot-end\" cx=${geometry.center + geometry.radius} cy=${geometry.center}\n ?hidden=${!showDot}\n style=${styleMap(thumbStyle('dot', progressAngle, geometry))}>\n </circle>\n <g class=\"needle\"\n ?hidden=${thumb !== 'needle'}\n style=${styleMap(thumbStyle('needle', progressAngle, geometry))}>\n <line class=\"needle-line\" x1=${geometry.center} y1=${geometry.center} x2=${geometry.center + 40} y2=${geometry.center}></line>\n <circle class=\"needle-hub\" cx=${geometry.center} cy=${geometry.center}></circle>\n </g>\n </svg>\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'progressbar';\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n // settle the value, otherwise reattaching paints the frame where the animation stopped\n if (this.#progressAnimation) {\n this.#stopProgressAnimation();\n this.#paintedProgress = this.#targetProgress();\n this.requestUpdate();\n }\n }\n\n willUpdate(props: PropertyValues<this>) {\n super.willUpdate(props);\n\n if (props.has('value') || props.has('max')) {\n this.#animateProgress();\n }\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n const { value, max } = this.#normalizedValues();\n this._internals.ariaValueNow = `${value}`;\n this._internals.ariaValueMax = `${max}`;\n const { status } = this;\n const statusLabel =\n status !== undefined && status !== 'neutral' && status !== 'accent' ? this.i18n[status] : undefined;\n this._internals.ariaLabel = statusLabel ?? this.i18n.information ?? null;\n }\n\n #targetProgress() {\n const { value, max } = this.#normalizedValues();\n return (value / max) * 100;\n }\n\n /**\n * Eases the painted progress toward the value with the duration and easing declared in css, so\n * that `prefers-reduced-motion` and a `--_animation-duration` override both settle immediately.\n */\n #animateProgress() {\n const target = this.#targetProgress();\n const timing = this.hasUpdated ? this.#animationTiming() : undefined;\n\n this.#stopProgressAnimation();\n\n if (!timing || target === this.#paintedProgress) {\n this.#paintedProgress = target;\n return;\n }\n\n const from = this.#paintedProgress;\n // keyframeless animations only keep time, leaving every painted frame to `render`\n const animation = this.animate(null, timing);\n const paint = (progress: number) => {\n this.#paintedProgress = from + (target - from) * progress;\n this.requestUpdate();\n };\n const paintFrame = () => {\n paint(animation.effect?.getComputedTiming().progress ?? 0);\n\n if (animation.playState === 'running') {\n this.#progressFrame = requestAnimationFrame(paintFrame);\n }\n };\n\n animation.finished.then(\n () => {\n // a value that changes on the frame this settles already started the next animation\n if (this.#progressAnimation === animation) {\n this.#stopProgressAnimation();\n paint(1);\n }\n },\n () => undefined\n );\n\n this.#progressAnimation = animation;\n this.#progressFrame = requestAnimationFrame(paintFrame);\n }\n\n #stopProgressAnimation() {\n // only a browser render starts an animation, so server rendering never reaches these apis\n if (this.#progressAnimation) {\n cancelAnimationFrame(this.#progressFrame);\n this.#progressAnimation.cancel();\n this.#progressAnimation = undefined;\n }\n }\n\n #animationTiming() {\n const gaugeStyles = getComputedStyle(this);\n const duration = gaugeStyles.getPropertyValue('--_animation-duration').trim();\n const milliseconds = parseFloat(duration) * (duration.endsWith('ms') ? 1 : 1000);\n const easing = gaugeStyles.getPropertyValue('--nve-ref-animation-easing-100').trim();\n\n return milliseconds > 0 ? { duration: milliseconds, easing: easing || 'linear' } : undefined;\n }\n\n #angleAtProgress(geometry: GaugeGeometry, progress: number) {\n return geometry.startAngle + geometry.sweepAngle * (progress / 100);\n }\n\n #pathAtProgress(geometry: GaugeGeometry, progress: number) {\n const start = this.#pointAtAngle(geometry, geometry.startAngle);\n const sweepAngle = geometry.sweepAngle * (progress / 100);\n const end = this.#pointAtAngle(geometry, geometry.startAngle + sweepAngle);\n const largeArcFlag = sweepAngle > 180 ? 1 : 0;\n return `M ${start.x} ${start.y} A ${geometry.radius} ${geometry.radius} 0 ${largeArcFlag} 1 ${end.x} ${end.y}`;\n }\n\n #pointAtAngle(geometry: GaugeGeometry, angle: number) {\n const radians = (angle * Math.PI) / 180;\n return {\n x: geometry.center + geometry.radius * Math.cos(radians),\n y: geometry.center + geometry.radius * Math.sin(radians)\n };\n }\n\n #geometry() {\n return this.shape === 'half' ? GAUGE_GEOMETRY.half : GAUGE_GEOMETRY.default;\n }\n\n #normalizedThumb() {\n return this.thumb === 'dot' || this.thumb === 'needle' ? this.thumb : 'fill';\n }\n}\n"],"mappings":";;;;;;;;;AAaA,IAAMI,IAAiB;CACrB,SAAS;EACP,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,YAAY;EACZ,YAAY;EACZ,eAAe;EACf,SAAS;CACX;CACA,MAAM;EACJ,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,YAAY;EACZ,YAAY;EACZ,eAAe;EACf,SAAS;CACX;AACF,GAIMC,KAAc,GAAyB,GAAuB,OAA6B;EAC9F,MAAMC,EAAM,UAAU,GAAGC,EAAc;EACvC,MAAMD,EAAM,WAAW,GAAGE,EAAS,OAAO,KAAKA,EAAS,OAAO;EAC/D,MAAMF,EAAM,gBAAgB,GAAGE,EAAS,WAAW;AACtD,IAEMC,IAAe;CACnB,QAAQ;CACR,aAAa;CACb,SAAS;CACT,SAAS;AACX,GAuBaC,IAAb,cAA2BC,EAAW;;EAuCnB,A,aA3BmB,KAAA,QAAA,GAGD,KAAA,MAAA,KAG6C,KAAA,SAAA,WAMF,KAAA,QAAA,QAKtC,KAAAE,KAAA,IAAIC,EAAqB,MAAML,CAAY,GAGhD,KAAA,OAAA,KAAKI,GAAgB,MAGrC,KAAAE,KAAA,GAIF,KAAAC,KAAA;;;EAtCD,KAAA,SAAAC,EAAU,CAACjB,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAuBA;CAMA;CAEA;CAEA;CAEA,KAAoB;EAClB,IAAMkB,IAAY,KAAK,KACjBC,IAAMD,MAAc,KAAA,KAAa,OAAO,SAASA,CA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M,OAAO,CAAC,CAAA,GAAA/C,EAAA,WAAA,SAAA,KAAA,CAAA,GAGzBT,EAAA,CAAAwD,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA/C,EAAA,WAAA,OAAA,KAAA,CAAA,GAGzBT,EAAA,CAAAwD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA/C,EAAA,WAAA,UAAA,KAAA,CAAA,GAGxCT,EAAA,CAAAwD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA/C,EAAA,WAAA,SAAA,KAAA,CAAA,GAGxCT,EAAA,CAAAwD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA/C,EAAA,WAAA,SAAA,KAAA,CAAA,GAGxCT,EAAA,CAAAwD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA/C,EAAA,WAAA,QAAA,KAAA,CAAA,GAKxCT,EAAA,CAAAwD,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA/C,EAAA,WAAA,QAAA,KAAA,CAAA"}
|
package/dist/ghost/ghost2.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import e from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
2
|
+
import t from "./ghost.js";
|
|
3
|
+
import { LitElement as n, html as r } from "lit";
|
|
4
|
+
import { property as i } from "lit/decorators/property.js";
|
|
5
|
+
import { useStyles as a } from "@nvidia-elements/foundations/internal/styles";
|
|
6
6
|
// src/ghost/ghost.ts
|
|
7
|
-
var o = class extends
|
|
7
|
+
var o = class extends n {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e), this.layers = 1;
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
|
-
this.styles =
|
|
12
|
+
this.styles = a([t]);
|
|
13
13
|
}
|
|
14
14
|
static {
|
|
15
15
|
this.metadata = {
|
|
16
16
|
tag: "nve-ghost",
|
|
17
|
-
version: "2.23.
|
|
17
|
+
version: "2.23.6"
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
21
|
let e = Number.isFinite(this.layers) ? Math.min(3, Math.max(1, Math.trunc(this.layers))) : 1;
|
|
22
|
-
return
|
|
22
|
+
return r`<div internal-host inert aria-hidden="true" style="${`--_back-layers:${e - 1}`}">${Array.from({ length: e - 1 }, (t, n) => r`<div class="surface rear" style="${`--_layer:${e - n - 1}`}"></div>`)}<div class="surface front"><slot></slot></div></div>`;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
e([i({ type: Number })], o.prototype, "layers", void 0);
|
|
26
26
|
export { o as Ghost };
|
|
27
27
|
|
|
28
28
|
//# sourceMappingURL=ghost2.js.map
|
package/dist/ghost/ghost2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ghost2.js","names":["styles","_decorate","__decorate","ghost_default","Ghost","LitElement","_args","useStyles","layers","index","property"],"sources":["../../src/ghost/ghost.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 { useStyles } from '@nvidia-elements/
|
|
1
|
+
{"version":3,"file":"ghost2.js","names":["styles","_decorate","__decorate","ghost_default","Ghost","LitElement","_args","useStyles","layers","index","property"],"sources":["../../src/ghost/ghost.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 { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport styles from './ghost.css?inline';\n\n/**\n * @element nve-ghost\n * @description An inert visual preview of content or its prospective placement. Applications control its geometry, movement, and accessible feedback.\n * @documentation https://nvidia.github.io/elements/docs/elements/ghost/\n * @since 0.0.0\n * @stable false\n * @entrypoint \\@nvidia-elements/core/ghost\n * @slot - Presentation content for the preview.\n * @cssprop --background\n * @cssprop --border\n * @cssprop --border-radius\n * @cssprop --color\n * @cssprop --stack-offset-x - Nonnegative horizontal distance between layers. Defaults to 4px.\n * @cssprop --stack-offset-y - Nonnegative vertical distance between layers. Defaults to 4px.\n * @cssprop --padding\n */\nexport class Ghost extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = { tag: 'nve-ghost', version: '0.0.0' };\n\n /** Number of visual surfaces. Rendering truncates fractions and clamps to one through three; nonfinite values use one. */\n @property({ type: Number }) layers = 1;\n\n render() {\n const layers = Number.isFinite(this.layers) ? Math.min(3, Math.max(1, Math.trunc(this.layers))) : 1;\n return html`\n <div internal-host inert aria-hidden=\"true\" style=${`--_back-layers:${layers - 1}`}>\n ${Array.from(\n { length: layers - 1 },\n (_, index) => html`<div class=\"surface rear\" style=${`--_layer:${layers - index - 1}`}></div>`\n )}\n <div class=\"surface front\"><slot></slot></div>\n </div>\n `;\n }\n}\n"],"mappings":";;;;;;AAwBA,IAAaI,IAAb,cAA2BC,EAAW;;EAMC,A,aAAA,KAAA,SAAA;;;EALrB,KAAA,SAAAE,EAAU,CAACP,CAAM,CAAC;;;EAEP,KAAA,WAAA;GAAE,KAAK;GAAa,SAAS;EAAQ;;CAKhE,SAAS;EACP,IAAMQ,IAAS,OAAO,SAAS,KAAK,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,MAAM,CAAC,CAAC,IAAI;EAClG,OAAO,CAAI,sDAC2C,kBAAkBA,IAAS,IAAI,IAC/E,MAAM,KACN,EAAE,QAAQA,IAAS,EAAE,IACpB,GAAG,MAAU,CAAI,oCAAmC,YAAYA,IAASC,IAAQ,IAAI,SACxF,EAAE;CAIR;AACF;AAdGR,EAAA,CAAAS,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAN,EAAA,WAAA,UAAA,KAAA,CAAA"}
|
package/dist/grid/cell/cell2.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import n from "
|
|
4
|
-
import {
|
|
1
|
+
import e from "./cell.js";
|
|
2
|
+
import { attachInternals as t } from "@nvidia-elements/foundations/internal/a11y";
|
|
3
|
+
import { LitElement as n, html as r } from "lit";
|
|
4
|
+
import { useStyles as i } from "@nvidia-elements/foundations/internal/styles";
|
|
5
5
|
// src/grid/cell/cell.ts
|
|
6
|
-
var a = class extends
|
|
6
|
+
var a = class extends n {
|
|
7
7
|
static {
|
|
8
|
-
this.styles =
|
|
8
|
+
this.styles = i([e]);
|
|
9
9
|
}
|
|
10
10
|
static {
|
|
11
11
|
this.metadata = {
|
|
12
12
|
tag: "nve-grid-cell",
|
|
13
|
-
version: "2.23.
|
|
13
|
+
version: "2.23.6"
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return
|
|
17
|
+
return r`<div internal-host focusable="active"><slot></slot></div>`;
|
|
18
18
|
}
|
|
19
19
|
connectedCallback() {
|
|
20
|
-
super.connectedCallback(),
|
|
20
|
+
super.connectedCallback(), t(this), this._internals.role = "gridcell";
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
export { a as GridCell };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell2.js","names":["styles","cell_default","GridCell","LitElement","useStyles","attachInternals"],"sources":["../../../src/grid/cell/cell.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 {
|
|
1
|
+
{"version":3,"file":"cell2.js","names":["styles","cell_default","GridCell","LitElement","useStyles","attachInternals"],"sources":["../../../src/grid/cell/cell.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 { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport styles from './cell.css?inline';\n\n/**\n * @element nve-grid-cell\n * @description Represents an individual data cell within a grid row, displaying content aligned to its parent column.\n * @documentation https://nvidia.github.io/elements/docs/elements/data-grid/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/grid\n * @slot - Data or interactive controls displayed within the cell.\n * @cssprop --background\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --min-height\n * @cssprop --min-width\n * @cssprop --font-weight\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --border-left\n * @cssprop --border-right\n * @cssprop --justify-content\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/grid/\n */\nexport class GridCell extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-grid-cell',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host focusable=\"active\">\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'gridcell';\n }\n}\n"],"mappings":";;;;;AA4BA,IAAaE,IAAb,cAA8BC,EAAW;;EACvB,KAAA,SAAAC,EAAU,CAACJ,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAKA,SAAS;EACP,OAAO,CAAI;CAKb;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxBK,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO;CACzB;AACF"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { appendRootNodeStyle as e } from "../../internal/utils/dom.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
5
|
-
import i from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import t from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
3
|
+
import n from "./column.js";
|
|
4
|
+
import { attachInternals as r } from "@nvidia-elements/foundations/internal/a11y";
|
|
5
|
+
import { LitElement as i, html as a } from "lit";
|
|
6
|
+
import { property as o } from "lit/decorators/property.js";
|
|
7
|
+
import { useStyles as s } from "@nvidia-elements/foundations/internal/styles";
|
|
8
8
|
// src/grid/column/column.ts
|
|
9
|
-
var c = class
|
|
9
|
+
var c = class t extends i {
|
|
10
10
|
static {
|
|
11
|
-
this.styles =
|
|
11
|
+
this.styles = s([n]);
|
|
12
12
|
}
|
|
13
13
|
static {
|
|
14
14
|
this.metadata = {
|
|
15
15
|
tag: "nve-grid-column",
|
|
16
|
-
version: "2.23.
|
|
16
|
+
version: "2.23.6"
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
get #e() {
|
|
20
20
|
return this.parentElement.parentElement;
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return
|
|
23
|
+
return a`<div internal-host focusable="active"><slot></slot><slot name="actions"></slot></div>`;
|
|
24
24
|
}
|
|
25
25
|
connectedCallback() {
|
|
26
|
-
super.connectedCallback(),
|
|
26
|
+
super.connectedCallback(), r(this), this._internals.role = "columnheader", this.addEventListener("sort", this.#t);
|
|
27
27
|
}
|
|
28
28
|
disconnectedCallback() {
|
|
29
29
|
super.disconnectedCallback(), this.removeEventListener("sort", this.#t);
|
|
@@ -50,7 +50,7 @@ var c = class r extends a {
|
|
|
50
50
|
this.#n ? this.#n.replaceSync(i) : this.#n = e(this.#e, i), this.setAttribute(t, "");
|
|
51
51
|
}
|
|
52
52
|
#i() {
|
|
53
|
-
let e = Array.from(this.parentElement.querySelectorAll(
|
|
53
|
+
let e = Array.from(this.parentElement.querySelectorAll(t.metadata.tag)), n = e.slice(e.indexOf(this) + 1, e.length), r = this.getBoundingClientRect(), i = this.#e.getBoundingClientRect(), a = this.offsetLeft < i.width / 2 ? "left" : "right", o = r.left - i.left, s = n.reduce((e, t) => e + t.getBoundingClientRect().width, 0), c = `[id='${this.#e.id}'] nve-grid-column:nth-of-type(${this.ariaColIndex}),
|
|
54
54
|
[id='${this.#e.id}'] nve-grid-cell:nth-of-type(${this.ariaColIndex})`;
|
|
55
55
|
return {
|
|
56
56
|
side: a,
|
|
@@ -81,17 +81,17 @@ var c = class r extends a {
|
|
|
81
81
|
}`);
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
t([o({
|
|
85
85
|
type: String,
|
|
86
86
|
reflect: !0
|
|
87
|
-
})], c.prototype, "width", void 0),
|
|
87
|
+
})], c.prototype, "width", void 0), t([o({
|
|
88
88
|
type: String,
|
|
89
89
|
reflect: !0
|
|
90
|
-
})], c.prototype, "position", void 0),
|
|
90
|
+
})], c.prototype, "position", void 0), t([o({
|
|
91
91
|
type: String,
|
|
92
92
|
reflect: !0,
|
|
93
93
|
attribute: "column-align"
|
|
94
|
-
})], c.prototype, "columnAlign", void 0),
|
|
94
|
+
})], c.prototype, "columnAlign", void 0), t([o({
|
|
95
95
|
type: String,
|
|
96
96
|
reflect: !0,
|
|
97
97
|
attribute: "aria-colindex"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column2.js","names":["styles","_decorate","__decorate","column_default","GridColumn","LitElement","useStyles","#grid","attachInternals","#onSort","props","#computeColumnAlignment","#computeColumnPositions","#positionStylesheet","#buildFixedStyles","combinedStyle","positionStyle","borderStyle","appendRootNodeStyle","side","columns","rightColumns","position","gridPosition","leftStyle","rightStyle","width","c","selector","#buildBorderStyle","isLastLeft","isLastRight","property"],"sources":["../../../src/grid/column/column.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 { useStyles, attachInternals, appendRootNodeStyle } from '@nvidia-elements/core/internal';\nimport type { Grid } from '@nvidia-elements/core/grid';\nimport styles from './column.css?inline';\n\n/**\n * @element nve-grid-column\n * @description Defines a column header within a grid, specifying the column's label, width, and alignment for all cells beneath it.\n * @documentation https://nvidia.github.io/elements/docs/elements/data-grid/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/grid\n * @slot - Column heading text or controls.\n * @slot actions - slot for column actions\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --font-weight\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --min-width\n * @cssprop --justify-content\n * @cssprop --border-left\n * @cssprop --border-right\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/grid/\n */\nexport class GridColumn extends LitElement {\n /**\n * Only set a fixed px width when you know the grid width. Most cases this should remain unset.\n * If the total width of all columns is less than the grid width then the last column fills the remaining space.\n * By default column widths are evenly divided unless width is explicitly provided.\n */\n @property({ type: String, reflect: true }) width: string;\n\n /**\n * Set the `position` property or attribute to `fixed` or `sticky` to make the column fixed or sticky.\n * Fixed columns do not scroll horizontally with the grid. Sticky columns scroll horizontally with the grid\n * until the column reaches the edge of the grid.\n */\n @property({ type: String, reflect: true }) position: 'fixed' | 'sticky' | '';\n\n /**\n * Control the content alignment within a given column.\n */\n @property({ type: String, reflect: true, attribute: 'column-align' }) columnAlign: 'start' | 'center' | 'end';\n\n /**\n * @private\n */\n @property({ type: String, reflect: true, attribute: 'aria-colindex' }) ariaColIndex: string; // eslint-disable-line local/reserved-property-names\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-grid-column',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n get #grid() {\n return this.parentElement!.parentElement as Grid;\n }\n\n render() {\n return html`\n <div internal-host focusable=\"active\">\n <slot></slot>\n <slot name=\"actions\"></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'columnheader';\n this.addEventListener('sort', this.#onSort);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('sort', this.#onSort);\n }\n\n #onSort = (e: Event) => {\n this.ariaSort = (e as CustomEvent<{ next: string }>).detail.next;\n };\n\n willUpdate(props: PropertyValues<this>) {\n if (props.has('width') && this.width && Number.isFinite(Number(this.width))) {\n this.width = `${this.width}px`; // eslint-disable-line local/stateless-property\n }\n }\n\n async updated(props: PropertyValues<this>) {\n super.updated(props);\n\n if (props.get('columnAlign') !== this.columnAlign) {\n this.#computeColumnAlignment();\n }\n\n if (props.get('position') !== this.position) {\n this.#computeColumnPositions();\n }\n\n if (props.get('ariaColIndex') !== this.ariaColIndex) {\n this.#computeColumnPositions();\n this.#computeColumnAlignment();\n }\n\n if (props.get('width') !== this.width) {\n this.dispatchEvent(new CustomEvent('nve-grid-column-resize', { bubbles: true, composed: true }));\n }\n }\n\n #positionStylesheet: CSSStyleSheet;\n\n #computeColumnPositions() {\n if (this.position !== 'fixed') {\n this.removeAttribute('left');\n this.removeAttribute('right');\n this.#positionStylesheet?.replaceSync('');\n return;\n }\n\n const { side, positionStyle, borderStyle } = this.#buildFixedStyles();\n const combinedStyle = `${positionStyle}\\n${borderStyle}`;\n\n if (this.#positionStylesheet) {\n this.#positionStylesheet.replaceSync(combinedStyle);\n } else {\n this.#positionStylesheet = appendRootNodeStyle(this.#grid, combinedStyle);\n }\n\n this.setAttribute(side, '');\n }\n\n #buildFixedStyles() {\n const columns = Array.from(this.parentElement!.querySelectorAll<GridColumn>(GridColumn.metadata.tag));\n const rightColumns = columns.slice(columns.indexOf(this) + 1, columns.length);\n const position = this.getBoundingClientRect();\n const gridPosition = this.#grid.getBoundingClientRect();\n const side = this.offsetLeft < gridPosition.width / 2 ? 'left' : 'right';\n const leftStyle = position.left - gridPosition.left;\n const rightStyle = rightColumns.reduce((width, c) => width + c.getBoundingClientRect().width, 0);\n const selector = `[id='${this.#grid.id}'] nve-grid-column:nth-of-type(${this.ariaColIndex}),\n [id='${this.#grid.id}'] nve-grid-cell:nth-of-type(${this.ariaColIndex})`;\n\n const positionStyle = `\n ${selector} {\n position: sticky;\n z-index: 99;\n ${side === 'left' ? `left: ${leftStyle}px;` : `right: ${rightStyle}px;`}\n }\n `;\n\n const borderStyle = this.#buildBorderStyle(selector, side);\n return { side, positionStyle, borderStyle };\n }\n\n #buildBorderStyle(selector: string, side: 'left' | 'right') {\n const isLastLeft = side === 'left' && (this.nextElementSibling as GridColumn)?.position !== this.position;\n const isLastRight = side === 'right' && (this.previousElementSibling as GridColumn)?.position !== this.position;\n\n if (!isLastLeft && !isLastRight) {\n return '';\n }\n\n return `\n ${selector} {\n box-shadow: var(--scroll-shadow);\n clip-path: inset(0px ${isLastLeft ? '-4px' : '0'} 0px ${isLastRight ? '-4px' : '0'});\n --border-${side === 'right' ? 'left' : 'right'}: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color-muted);\n }\n `;\n }\n\n #computeColumnAlignment() {\n if (this.columnAlign !== undefined) {\n appendRootNodeStyle(\n this.#grid,\n `[id='${this.#grid.id}'] nve-grid-column:nth-of-type(${this.ariaColIndex}),\n [id='${this.#grid.id}'] nve-grid-cell:nth-of-type(${this.ariaColIndex}) {\n --justify-content: ${this.columnAlign}\n }`\n );\n }\n }\n}\n"],"mappings":";;;;;;;;AA6BA,IAAaI,IAAb,MAAaA,UAAmBC,EAAW;;EAyBzB,KAAA,SAAAC,EAAU,CAACN,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAKA,IAAIO,KAAQ;EACV,OAAO,KAAK,cAAe;CAC7B;CAEA,SAAS;EACP,OAAO,CAAI;CAMb;CAEA,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxBC,EAAgB,IAAI,GACpB,KAAK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,SAAS;AAAK,CAAC,CAAA,GAAA5B,EAAA,WAAA,YAAA,KAAA,CAAA,GAKxCH,EAAA,CAAA+B,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,WAAW;AAAe,CAAC,CAAA,GAAA5B,EAAA,WAAA,eAAA,KAAA,CAAA,GAKnEH,EAAA,CAAA+B,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,WAAW;AAAgB,CAAC,CAAA,GAAA5B,EAAA,WAAA,gBAAA,KAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"column2.js","names":["styles","_decorate","__decorate","column_default","GridColumn","LitElement","useStyles","#grid","attachInternals","#onSort","props","#computeColumnAlignment","#computeColumnPositions","#positionStylesheet","#buildFixedStyles","combinedStyle","positionStyle","borderStyle","appendRootNodeStyle","side","columns","rightColumns","position","gridPosition","leftStyle","rightStyle","width","c","selector","#buildBorderStyle","isLastLeft","isLastRight","property"],"sources":["../../../src/grid/column/column.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 { appendRootNodeStyle } from '@nvidia-elements/core/internal';\nimport { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport type { Grid } from '@nvidia-elements/core/grid';\nimport styles from './column.css?inline';\n\n/**\n * @element nve-grid-column\n * @description Defines a column header within a grid, specifying the column's label, width, and alignment for all cells beneath it.\n * @documentation https://nvidia.github.io/elements/docs/elements/data-grid/\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/grid\n * @slot - Column heading text or controls.\n * @slot actions - slot for column actions\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --font-weight\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --min-width\n * @cssprop --justify-content\n * @cssprop --border-left\n * @cssprop --border-right\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/grid/\n */\nexport class GridColumn extends LitElement {\n /**\n * Only set a fixed px width when you know the grid width. Most cases this should remain unset.\n * If the total width of all columns is less than the grid width then the last column fills the remaining space.\n * By default column widths are evenly divided unless width is explicitly provided.\n */\n @property({ type: String, reflect: true }) width: string;\n\n /**\n * Set the `position` property or attribute to `fixed` or `sticky` to make the column fixed or sticky.\n * Fixed columns do not scroll horizontally with the grid. Sticky columns scroll horizontally with the grid\n * until the column reaches the edge of the grid.\n */\n @property({ type: String, reflect: true }) position: 'fixed' | 'sticky' | '';\n\n /**\n * Control the content alignment within a given column.\n */\n @property({ type: String, reflect: true, attribute: 'column-align' }) columnAlign: 'start' | 'center' | 'end';\n\n /**\n * @private\n */\n @property({ type: String, reflect: true, attribute: 'aria-colindex' }) ariaColIndex: string; // eslint-disable-line local/reserved-property-names\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-grid-column',\n version: '0.0.0'\n };\n\n /** @private */\n declare _internals: ElementInternals;\n\n get #grid() {\n return this.parentElement!.parentElement as Grid;\n }\n\n render() {\n return html`\n <div internal-host focusable=\"active\">\n <slot></slot>\n <slot name=\"actions\"></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'columnheader';\n this.addEventListener('sort', this.#onSort);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('sort', this.#onSort);\n }\n\n #onSort = (e: Event) => {\n this.ariaSort = (e as CustomEvent<{ next: string }>).detail.next;\n };\n\n willUpdate(props: PropertyValues<this>) {\n if (props.has('width') && this.width && Number.isFinite(Number(this.width))) {\n this.width = `${this.width}px`; // eslint-disable-line local/stateless-property\n }\n }\n\n async updated(props: PropertyValues<this>) {\n super.updated(props);\n\n if (props.get('columnAlign') !== this.columnAlign) {\n this.#computeColumnAlignment();\n }\n\n if (props.get('position') !== this.position) {\n this.#computeColumnPositions();\n }\n\n if (props.get('ariaColIndex') !== this.ariaColIndex) {\n this.#computeColumnPositions();\n this.#computeColumnAlignment();\n }\n\n if (props.get('width') !== this.width) {\n this.dispatchEvent(new CustomEvent('nve-grid-column-resize', { bubbles: true, composed: true }));\n }\n }\n\n #positionStylesheet: CSSStyleSheet;\n\n #computeColumnPositions() {\n if (this.position !== 'fixed') {\n this.removeAttribute('left');\n this.removeAttribute('right');\n this.#positionStylesheet?.replaceSync('');\n return;\n }\n\n const { side, positionStyle, borderStyle } = this.#buildFixedStyles();\n const combinedStyle = `${positionStyle}\\n${borderStyle}`;\n\n if (this.#positionStylesheet) {\n this.#positionStylesheet.replaceSync(combinedStyle);\n } else {\n this.#positionStylesheet = appendRootNodeStyle(this.#grid, combinedStyle);\n }\n\n this.setAttribute(side, '');\n }\n\n #buildFixedStyles() {\n const columns = Array.from(this.parentElement!.querySelectorAll<GridColumn>(GridColumn.metadata.tag));\n const rightColumns = columns.slice(columns.indexOf(this) + 1, columns.length);\n const position = this.getBoundingClientRect();\n const gridPosition = this.#grid.getBoundingClientRect();\n const side = this.offsetLeft < gridPosition.width / 2 ? 'left' : 'right';\n const leftStyle = position.left - gridPosition.left;\n const rightStyle = rightColumns.reduce((width, c) => width + c.getBoundingClientRect().width, 0);\n const selector = `[id='${this.#grid.id}'] nve-grid-column:nth-of-type(${this.ariaColIndex}),\n [id='${this.#grid.id}'] nve-grid-cell:nth-of-type(${this.ariaColIndex})`;\n\n const positionStyle = `\n ${selector} {\n position: sticky;\n z-index: 99;\n ${side === 'left' ? `left: ${leftStyle}px;` : `right: ${rightStyle}px;`}\n }\n `;\n\n const borderStyle = this.#buildBorderStyle(selector, side);\n return { side, positionStyle, borderStyle };\n }\n\n #buildBorderStyle(selector: string, side: 'left' | 'right') {\n const isLastLeft = side === 'left' && (this.nextElementSibling as GridColumn)?.position !== this.position;\n const isLastRight = side === 'right' && (this.previousElementSibling as GridColumn)?.position !== this.position;\n\n if (!isLastLeft && !isLastRight) {\n return '';\n }\n\n return `\n ${selector} {\n box-shadow: var(--scroll-shadow);\n clip-path: inset(0px ${isLastLeft ? '-4px' : '0'} 0px ${isLastRight ? '-4px' : '0'});\n --border-${side === 'right' ? 'left' : 'right'}: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color-muted);\n }\n `;\n }\n\n #computeColumnAlignment() {\n if (this.columnAlign !== undefined) {\n appendRootNodeStyle(\n this.#grid,\n `[id='${this.#grid.id}'] nve-grid-column:nth-of-type(${this.ariaColIndex}),\n [id='${this.#grid.id}'] nve-grid-cell:nth-of-type(${this.ariaColIndex}) {\n --justify-content: ${this.columnAlign}\n }`\n );\n }\n }\n}\n"],"mappings":";;;;;;;;AA+BA,IAAaI,IAAb,MAAaA,UAAmBC,EAAW;;EAyBzB,KAAA,SAAAC,EAAU,CAACN,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;CAKA,IAAIO,KAAQ;EACV,OAAO,KAAK,cAAe;CAC7B;CAEA,SAAS;EACP,OAAO,CAAI;CAMb;CAEA,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxBC,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO,gBACvB,KAAK,iBAAiB,QAAQ,KAAKC,EAAO;CAC5C;CAEA,uBAAuB;EAErB,AADA,MAAM,qBAAqB,GAC3B,KAAK,oBAAoB,QAAQ,KAAKA,EAAO;CAC/C;CAEA,MAAW,MAAa;EACtB,KAAK,WAAY,EAAoC,OAAO;CAC9D;CAEA,WAAW,GAA6B;EACtC,AAAIC,EAAM,IAAI,OAAO,KAAK,KAAK,SAAS,OAAO,SAAS,OAAO,KAAK,KAAK,CAAC,MACxE,KAAK,QAAQ,GAAG,KAAK,MAAM;CAE/B;CAEA,MAAM,QAAQ,GAA6B;EAgBzC,AAfA,MAAM,QAAQA,CAAK,GAEfA,EAAM,IAAI,aAAa,MAAM,KAAK,eACpC,KAAKC,GAAwB,GAG3BD,EAAM,IAAI,UAAU,MAAM,KA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AAW,KAAA;;;GAK3C,aADV,KAAKI,GAAkBD,GAAUT,CACvB;EAAY;CAC5C;CAEA,GAAkB,GAAkB,GAAwB;EAC1D,IAAMW,IAAaX,MAAS,UAAW,KAAK,oBAAmC,aAAa,KAAK,UAC3FY,IAAcZ,MAAS,WAAY,KAAK,wBAAuC,aAAa,KAAK;EAMvG,OAJI,CAACW,KAAc,CAACC,IACX,KAGF;UACDH,EAAS;;iCAEcE,IAAa,SAAS,IAAI,OAAOC,IAAc,SAAS,IAAI;qBACxEZ,MAAS,UAAU,SAAS,QAAQ;;;CAGvD;CAEA,KAA0B;EACxB,AAAI,KAAK,gBAAgB,KAAA,KACvBD,EACE,KAAKX,IACL,QAAQ,KAAKA,GAAM,GAAG,iCAAiC,KAAK,aAAa;eAClE,KAAKA,GAAM,GAAG,+BAA+B,KAAK,aAAa;+BAC/C,KAAK,YAAA;UAE9B;CAEJ;AACF;AA9JGN,EAAA,CAAA+B,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA5B,EAAA,WAAA,SAAA,KAAA,CAAA,GAOxCH,EAAA,CAAA+B,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA5B,EAAA,WAAA,YAAA,KAAA,CAAA,GAKxCH,EAAA,CAAA+B,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,WAAW;AAAe,CAAC,CAAA,GAAA5B,EAAA,WAAA,eAAA,KAAA,CAAA,GAKnEH,EAAA,CAAA+B,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,WAAW;AAAgB,CAAC,CAAA,GAAA5B,EAAA,WAAA,gBAAA,KAAA,CAAA"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
5
|
-
import i from "
|
|
6
|
-
import {
|
|
1
|
+
import { hostAttr as e } from "../../internal/decorators/host-attr.js";
|
|
2
|
+
import t from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
3
|
+
import n from "./footer.js";
|
|
4
|
+
import { attachInternals as r } from "@nvidia-elements/foundations/internal/a11y";
|
|
5
|
+
import { LitElement as i, html as a } from "lit";
|
|
6
|
+
import { useStyles as o } from "@nvidia-elements/foundations/internal/styles";
|
|
7
7
|
// src/grid/footer/footer.ts
|
|
8
|
-
var s = class extends
|
|
8
|
+
var s = class extends i {
|
|
9
9
|
constructor(...e) {
|
|
10
10
|
super(...e), this.slot = "footer";
|
|
11
11
|
}
|
|
12
12
|
static {
|
|
13
|
-
this.styles =
|
|
13
|
+
this.styles = o([n]);
|
|
14
14
|
}
|
|
15
15
|
static {
|
|
16
16
|
this.metadata = {
|
|
17
17
|
tag: "nve-grid-footer",
|
|
18
|
-
version: "2.23.
|
|
18
|
+
version: "2.23.6"
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
22
|
this.elementDefinitions = {};
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
|
-
return
|
|
25
|
+
return a`<div internal-host role="gridcell"><slot></slot></div>`;
|
|
26
26
|
}
|
|
27
27
|
connectedCallback() {
|
|
28
|
-
super.connectedCallback(),
|
|
28
|
+
super.connectedCallback(), r(this), this._internals.role = "row";
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
t([e()], s.prototype, "slot", void 0);
|
|
32
32
|
export { s as GridFooter };
|
|
33
33
|
|
|
34
34
|
//# sourceMappingURL=footer2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer2.js","names":["styles","_decorate","__decorate","footer_default","GridFooter","LitElement","_args","useStyles","attachInternals","hostAttr"],"sources":["../../../src/grid/footer/footer.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 {
|
|
1
|
+
{"version":3,"file":"footer2.js","names":["styles","_decorate","__decorate","footer_default","GridFooter","LitElement","_args","useStyles","attachInternals","hostAttr"],"sources":["../../../src/grid/footer/footer.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 { hostAttr } from '@nvidia-elements/core/internal';\nimport { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport styles from './footer.css?inline';\n\n/**\n * @element nve-grid-footer\n * @since 0.11.0\n * @entrypoint \\@nvidia-elements/core/grid\n * @description Grid footer displays contextual information or user actions such as pagination.\n * @slot - Grid summary, pagination, or other footer controls.\n * @cssprop --background\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --height\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/grid/\n */\nexport class GridFooter extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-grid-footer',\n version: '0.0.0'\n };\n\n static elementDefinitions = {};\n\n /** @private */\n _internals: ElementInternals;\n\n /** @private */\n @hostAttr() slot = 'footer';\n\n render() {\n return html`\n <div internal-host role=\"gridcell\">\n <slot></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'row';\n }\n}\n"],"mappings":";;;;;;;AAqBA,IAAaI,IAAb,cAAgCC,EAAW;;EActB,A,aAAA,KAAA,OAAA;;;EAbH,KAAA,SAAAE,EAAU,CAACP,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,CAAC;;CAQ7B,SAAS;EACP,OAAO,CAAI;CAKb;CAEA,oBAAoB;EAGlB,AAFA,MAAM,kBAAkB,GACxBQ,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO;CACzB;AACF;AAfGP,EAAA,CAAAQ,EAAS,CAAA,GAAAL,EAAA,WAAA,QAAA,KAAA,CAAA"}
|