@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"star-rating2.js","names":["styles","_decorate","__decorate","star_rating_default","StarRating","Control","_args","useStyles","Icon","props","getElementUpdate","max","min","#setValue","value","starValue","i","diff","#getStepValue","#handleMouseMove","rect","position","index","state","scopedRegistry"],"sources":["../../src/star-rating/star-rating.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 type { PropertyValues } from 'lit';\nimport { state } from 'lit/decorators/state.js';\nimport {
|
|
1
|
+
{"version":3,"file":"star-rating2.js","names":["styles","_decorate","__decorate","star_rating_default","StarRating","Control","_args","useStyles","Icon","props","getElementUpdate","max","min","#setValue","value","starValue","i","diff","#getStepValue","#handleMouseMove","rect","position","index","state","scopedRegistry"],"sources":["../../src/star-rating/star-rating.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 type { PropertyValues } from 'lit';\nimport { state } from 'lit/decorators/state.js';\nimport { getElementUpdate } 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 { Icon } from '@nvidia-elements/core/icon';\nimport styles from './star-rating.css?inline';\n\n/**\n * @element nve-star-rating\n * @description A star rating component lets users rate something using stars, providing a quick visual representation of feedback\n * @documentation https://nvidia.github.io/elements/docs/elements/star-rating/\n * @since 1.23.1\n * @entrypoint \\@nvidia-elements/core/star-rating\n * @cssprop --star-size\n * @cssprop --color\n * @cssprop --stroke-color\n * @cssprop --width\n * @cssprop --height\n * @csspart icon - The icon element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range\n *\n */\n@scopedRegistry()\nexport class StarRating extends Control {\n static styles = useStyles([...Control.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-star-rating',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon\n };\n\n @state() private min = 0;\n @state() private max = 5;\n @state() private value = 0;\n @state() private active = 0;\n @state() private precision = 0.5;\n\n firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n\n getElementUpdate(this.input, 'max', (max: unknown) => {\n if (max) {\n this.max = parseInt(max as string);\n }\n });\n\n getElementUpdate(this.input, 'min', (min: unknown) => {\n if (min) {\n this.min = parseInt(min as string);\n }\n });\n\n getElementUpdate(this.input, 'value', (value: unknown) => {\n this.#setValue(value ? parseFloat(value as string) : this.input.valueAsNumber);\n });\n\n this.input.addEventListener('input', () => (this.value = this.input.valueAsNumber));\n\n this.value = this.input.valueAsNumber;\n }\n\n protected get prefixContent() {\n return html`\n <div aria-hidden=\"true\" class=\"stars\" @mouseleave=${() => (this.active = 0)}>\n ${new Array(this.max).fill('').map((_, i) => {\n const starValue = i + 1;\n const currentValue = this.active || this.value;\n const diff = currentValue - i;\n\n const iconName = diff >= 1 ? 'star' : diff >= 0.5 ? 'star-half' : 'star-stroke';\n\n return html`\n <nve-icon part=\"icon\"\n @click=${() => this.#setValue(this.#getStepValue(i, starValue))}\n @mousemove=${(e: MouseEvent) => this.#handleMouseMove(e, i, starValue)}\n name=${iconName}\n ></nve-icon>\n `;\n })}\n </div>\n `;\n }\n\n #handleMouseMove(e: MouseEvent, index: number, starValue: number) {\n const target = e.currentTarget as HTMLElement;\n const rect = target.getBoundingClientRect();\n const position = (e.clientX - rect.left) / rect.width;\n\n this.active = position <= 0.5 ? index + 0.5 : starValue;\n }\n\n #getStepValue(index: number, starValue: number) {\n // If hovering (active has a value), use that value\n if (this.active > 0) {\n return this.active;\n }\n\n // If clicking on the current value, toggle it off\n if (this.value === starValue || this.value === index + 0.5) {\n return 0;\n }\n\n // Otherwise, return the star value\n return starValue;\n }\n\n #setValue(value: number) {\n this.input.valueAsNumber = value === this.value ? 0 : value;\n this.input.dispatchEvent(new Event('input', { bubbles: true }));\n this.input.dispatchEvent(new Event('change', { bubbles: true }));\n }\n}\n"],"mappings":";;;;;;;;;;AA6BO,IAAMI,IAAN,cAAyBC,EAAQ;;EAgBT,A,aAJN,KAAA,MAAA,GACA,KAAA,MAAA,GACE,KAAA,QAAA,GACC,KAAA,SAAA,GACG,KAAA,YAAA;;;EAfb,KAAA,SAAAE,EAAU,CAAC,GAAGF,EAAQ,QAAQL,CAAM,CAAC;;;EAE1B,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,GACzBQ,EAAK,SAAS,MAAMA,EACvB;;CAQA,aAAa,GAA6B;EAqBxC,AApBA,MAAM,aAAaC,CAAK,GAExBC,EAAiB,KAAK,OAAO,QAAQ,MAAiB;GACpD,AAAIC,MACF,KAAK,MAAM,SAASA,CAAa;EAErC,CAAC,GAEDD,EAAiB,KAAK,OAAO,QAAQ,MAAiB;GACpD,AAAIE,MACF,KAAK,MAAM,SAASA,CAAa;EAErC,CAAC,GAEDF,EAAiB,KAAK,OAAO,UAAU,MAAmB;GACxD,KAAKG,GAAUC,IAAQ,WAAWA,CAAe,IAAI,KAAK,MAAM,aAAa;EAC/E,CAAC,GAED,KAAK,MAAM,iBAAiB,eAAgB,KAAK,QAAQ,KAAK,MAAM,aAAc,GAElF,KAAK,QAAQ,KAAK,MAAM;CAC1B;CAEA,IAAc,gBAAgB;EAC5B,OAAO,CAAI,4DACgD,KAAK,SAAS,EAAG,IACpE,MAAM,KAAK,GAAG,CA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,EAAA,CAAAuB,EAAe,CAAA,GAAApB,CAAA"}
|
package/dist/steps/steps2.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { audit as e } from "../internal/controllers/audit.controller.js";
|
|
2
2
|
import { keyNavigationList as t } from "../internal/controllers/keynav-list.controller.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import o from "
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import l from "
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
3
|
+
import { stateSelected as n } from "../internal/controllers/state-selected.controller.js";
|
|
4
|
+
import r from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
5
|
+
import { IconButton as i } from "../icon-button/icon-button2.js";
|
|
6
|
+
import { ProgressRing as a } from "../progress-ring/progress-ring2.js";
|
|
7
|
+
import o from "./steps-item.js";
|
|
8
|
+
import s from "./steps.js";
|
|
9
|
+
import { attachInternals as c } from "@nvidia-elements/foundations/internal/a11y";
|
|
10
|
+
import { LitElement as l, html as u } from "lit";
|
|
11
|
+
import { property as d } from "lit/decorators/property.js";
|
|
12
|
+
import { scopedRegistry as f } from "@nvidia-elements/foundations/internal/decorators";
|
|
13
|
+
import { useStyles as p } from "@nvidia-elements/foundations/internal/styles";
|
|
14
14
|
import { ButtonFormControlMixin as m } from "@nvidia-elements/forms/mixins";
|
|
15
15
|
import { state as h } from "lit/decorators/state.js";
|
|
16
16
|
import { queryAssignedElements as g } from "lit/decorators/query-assigned-elements.js";
|
|
17
17
|
import { when as _ } from "lit/directives/when.js";
|
|
18
18
|
// src/steps/steps.ts
|
|
19
|
-
var v = class extends m(
|
|
19
|
+
var v = class extends m(l) {
|
|
20
20
|
static {
|
|
21
|
-
this.styles =
|
|
21
|
+
this.styles = p([o]);
|
|
22
22
|
}
|
|
23
23
|
static {
|
|
24
24
|
this.metadata = {
|
|
25
25
|
tag: "nve-steps-item",
|
|
26
|
-
version: "2.23.
|
|
26
|
+
version: "2.23.6",
|
|
27
27
|
parents: ["nve-steps"]
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
static {
|
|
31
31
|
this.elementDefinitions = {
|
|
32
|
-
[
|
|
33
|
-
[
|
|
32
|
+
[i.metadata.tag]: i,
|
|
33
|
+
[a.metadata.tag]: a
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
render() {
|
|
37
|
-
return
|
|
37
|
+
return u`<div internal-host focus-within><slot name="status-icon">${this.status ? "" : u`<nve-icon-button part="icon-button" readonly="readonly" id="number-icon" .disabled="${this.disabled}">${this.index}</nve-icon-button>`} ${this.status === "success" ? u`<nve-icon-button part="icon-button" readonly="readonly" size="sm" interaction="emphasis" icon-name="check"></nve-icon-button>` : ""} ${this.status === "danger" ? u`<nve-icon-button part="icon-button" readonly="readonly" size="sm" interaction="destructive" icon-name="exclamation-circle"></nve-icon-button>` : ""} ${this.status === "pending" ? u`<nve-progress-ring part="progress-ring" status="accent" size="sm"></nve-progress-ring>` : ""}</slot>${_(this.container !== "condensed", () => u`<slot></slot>`)}</div>`;
|
|
38
38
|
}
|
|
39
39
|
constructor() {
|
|
40
40
|
super(), this.selected = !1, this.index = 0, this.type = "button";
|
|
@@ -43,33 +43,33 @@ var v = class extends m(d) {
|
|
|
43
43
|
super.connectedCallback(), this._internals.role = "tab";
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
r([d({
|
|
47
47
|
type: Boolean,
|
|
48
48
|
reflect: !0
|
|
49
|
-
})], v.prototype, "selected", void 0),
|
|
49
|
+
})], v.prototype, "selected", void 0), r([d({
|
|
50
50
|
type: String,
|
|
51
51
|
reflect: !0
|
|
52
|
-
})], v.prototype, "status", void 0),
|
|
52
|
+
})], v.prototype, "status", void 0), r([d({
|
|
53
53
|
type: String,
|
|
54
54
|
reflect: !0
|
|
55
|
-
})], v.prototype, "container", void 0),
|
|
55
|
+
})], v.prototype, "container", void 0), r([h()], v.prototype, "index", void 0), v = r([
|
|
56
56
|
e(),
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
f(),
|
|
58
|
+
n()
|
|
59
59
|
], v);
|
|
60
|
-
var y = class extends
|
|
60
|
+
var y = class extends l {
|
|
61
61
|
constructor(...e) {
|
|
62
62
|
super(...e), this.vertical = !1, this.behaviorSelect = !1, this.#t = (e) => {
|
|
63
63
|
this.#e(e.target);
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
static {
|
|
67
|
-
this.styles =
|
|
67
|
+
this.styles = p([s]);
|
|
68
68
|
}
|
|
69
69
|
static {
|
|
70
70
|
this.metadata = {
|
|
71
71
|
tag: "nve-steps",
|
|
72
|
-
version: "2.23.
|
|
72
|
+
version: "2.23.6",
|
|
73
73
|
children: ["nve-steps-item"]
|
|
74
74
|
};
|
|
75
75
|
}
|
|
@@ -83,10 +83,10 @@ var y = class extends d {
|
|
|
83
83
|
this.behaviorSelect && e.matches("nve-steps-item") && !e.disabled && (this.steps.forEach((e) => e.selected = !1), e.selected = !0);
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
|
-
return
|
|
86
|
+
return u`<div internal-host><slot @slotchange="${this.#n}"></slot></div>`;
|
|
87
87
|
}
|
|
88
88
|
connectedCallback() {
|
|
89
|
-
super.connectedCallback(),
|
|
89
|
+
super.connectedCallback(), c(this), this._internals.role = "tablist", this.addEventListener("click", this.#t);
|
|
90
90
|
}
|
|
91
91
|
disconnectedCallback() {
|
|
92
92
|
super.disconnectedCallback(), this.removeEventListener("click", this.#t);
|
|
@@ -101,16 +101,16 @@ var y = class extends d {
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
r([d({
|
|
105
105
|
type: Boolean,
|
|
106
106
|
reflect: !0
|
|
107
|
-
})], y.prototype, "vertical", void 0),
|
|
107
|
+
})], y.prototype, "vertical", void 0), r([d({
|
|
108
108
|
type: String,
|
|
109
109
|
reflect: !0
|
|
110
|
-
})], y.prototype, "container", void 0),
|
|
110
|
+
})], y.prototype, "container", void 0), r([d({
|
|
111
111
|
type: Boolean,
|
|
112
112
|
attribute: "behavior-select"
|
|
113
|
-
})], y.prototype, "behaviorSelect", void 0),
|
|
113
|
+
})], y.prototype, "behaviorSelect", void 0), r([g({ selector: "nve-steps-item" })], y.prototype, "steps", void 0), y = r([e(), t()], y);
|
|
114
114
|
export { y as Steps, v as StepsItem };
|
|
115
115
|
|
|
116
116
|
//# sourceMappingURL=steps2.js.map
|
package/dist/steps/steps2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps2.js","names":["stepsItemStyleSheet","_decorate","stepsStyleSheet","__decorate","steps_item_default","steps_default","StepsItem","ButtonFormControlMixin","LitElement","useStyles","IconButton","ProgressRing","when","property","state","audit","scopedRegistry","stateSelected","Steps","_args","#onClick","#selectTab","stepsItem","#syncChildSteps","attachInternals","props","i","queryAssignedElements","keyNavigationList"],"sources":["../../src/steps/steps.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 { state } from 'lit/decorators/state.js';\nimport { when } from 'lit/directives/when.js';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport type { KeynavListConfig } from '@nvidia-elements/core/internal';\nimport {
|
|
1
|
+
{"version":3,"file":"steps2.js","names":["stepsItemStyleSheet","_decorate","stepsStyleSheet","__decorate","steps_item_default","steps_default","StepsItem","ButtonFormControlMixin","LitElement","useStyles","IconButton","ProgressRing","when","property","state","audit","scopedRegistry","stateSelected","Steps","_args","#onClick","#selectTab","stepsItem","#syncChildSteps","attachInternals","props","i","queryAssignedElements","keyNavigationList"],"sources":["../../src/steps/steps.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 { state } from 'lit/decorators/state.js';\nimport { when } from 'lit/directives/when.js';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport type { KeynavListConfig } from '@nvidia-elements/core/internal';\nimport { stateSelected, keyNavigationList, audit } 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 stepsItemStyleSheet from './steps-item.css?inline';\nimport stepsStyleSheet from './steps.css?inline';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport { ProgressRing } from '@nvidia-elements/core/progress-ring';\n\n/**\n * @element nve-steps-item\n * @description Represents an individual step within a multi-step workflow, displaying its status and enabling navigation within the parent steps component.\n * @documentation https://nvidia.github.io/elements/docs/elements/steps/\n * @since 0.30.0\n * @entrypoint \\@nvidia-elements/core/steps\n * @slot - default slot for step text\n * @slot status-icon - custom slotted step icon\n * @cssprop --font-size\n * @cssprop --border-top\n * @cssprop --width\n * @cssprop --font-weight\n * @cssprop --border-radius\n * @cssprop --color\n * @cssprop --text-transform\n * @csspart icon-button - The icon button element\n * @csspart progress-ring - The progress ring element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n */\n@audit()\n@scopedRegistry()\n@stateSelected<StepsItem>()\nexport class StepsItem extends ButtonFormControlMixin(LitElement) {\n /**\n * Determines which item the user selects, defaults to false.\n */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n /**\n * Controls the step status. `accent` has no default status icon, `danger` displays an alert icon, `success` displays a check icon, and `pending` displays a progress indicator. Omit the property to display the step number.\n */\n @property({ type: String, reflect: true }) status?: 'accent' | 'danger' | 'success' | 'pending';\n\n /**\n * Determines whether the steps should display in condensed format with no text labels.\n */\n @property({ type: String, reflect: true }) container?: 'condensed';\n\n /** @private */\n @state() index: number = 0;\n\n static styles = useStyles([stepsItemStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-steps-item',\n version: '0.0.0',\n parents: ['nve-steps']\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton,\n [ProgressRing.metadata.tag]: ProgressRing\n };\n\n render() {\n return html`\n <div internal-host focus-within>\n <slot name=\"status-icon\">\n ${!this.status ? html`<nve-icon-button part=\"icon-button\" readonly id=\"number-icon\" .disabled=${this.disabled}>${this.index}</nve-icon-button>` : ''}\n ${this.status === 'success' ? html`<nve-icon-button part=\"icon-button\" readonly size=\"sm\" interaction=\"emphasis\" icon-name=\"check\"></nve-icon-button>` : ''}\n ${this.status === 'danger' ? html`<nve-icon-button part=\"icon-button\" readonly size=\"sm\" interaction=\"destructive\" icon-name=\"exclamation-circle\"></nve-icon-button>` : ''}\n ${this.status === 'pending' ? html`<nve-progress-ring part=\"progress-ring\" status=\"accent\" size=\"sm\"></nve-progress-ring>` : ''}\n </slot>\n ${when(this.container !== 'condensed', () => html`<slot></slot>`)}\n </div>\n `;\n }\n\n constructor() {\n super();\n this.type = 'button';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._internals.role = 'tab';\n }\n}\n\n/**\n * @element nve-steps\n * @description Steps enables a multi-step workflow allowing a user to complete a goal in a specific sequence.\n * @documentation https://nvidia.github.io/elements/docs/elements/steps/\n * @since 0.30.0\n * @entrypoint \\@nvidia-elements/core/steps\n * @slot - default slot for steps-item\n * @cssprop --gap\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n */\n@audit()\n@keyNavigationList<Steps>()\nexport class Steps extends LitElement {\n /**\n * Determines whether the steps should display in a vertical layout vs. defaulting to horizontal.\n */\n @property({ type: Boolean, reflect: true }) vertical = false;\n\n /**\n * Determines whether the steps should display in condensed format with no text labels.\n */\n @property({ type: String, reflect: true }) container?: 'condensed';\n\n /**\n * Determines whether the steps should handle selection behavior vs. defaults to off.\n */\n @property({ type: Boolean, attribute: 'behavior-select' }) behaviorSelect = false;\n\n static styles = useStyles([stepsStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-steps',\n version: '0.0.0',\n children: ['nve-steps-item']\n };\n\n /** @private */\n get keynavListConfig(): KeynavListConfig {\n return {\n items: this.steps,\n layout: this.vertical ? 'vertical' : 'horizontal'\n };\n }\n\n @queryAssignedElements({ selector: 'nve-steps-item' }) private steps!: StepsItem[];\n\n /** @private */\n declare _internals: ElementInternals;\n\n #selectTab(stepsItem: HTMLElement & { matches: Element['matches']; disabled?: boolean; selected?: boolean }) {\n if (!this.behaviorSelect || !stepsItem.matches('nve-steps-item') || stepsItem.disabled) {\n return;\n }\n\n this.steps.forEach(i => (i.selected = false));\n stepsItem.selected = true;\n }\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#syncChildSteps}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'tablist';\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n #onClick = (e: Event) => {\n this.#selectTab(e.target as HTMLElement & { matches: Element['matches']; disabled?: boolean; selected?: boolean });\n };\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n if (props.has('container') || props.has('vertical')) {\n this.#syncChildSteps();\n }\n }\n\n #syncChildSteps() {\n this._internals.ariaOrientation = this.vertical ? 'vertical' : 'horizontal';\n this.steps.forEach((item, i) => {\n item.index = i + 1;\n item.container = this.container;\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0CO,IAAMM,IAAN,cAAwBC,EAAuBC,CAAU,CAAC,CAAC;;EAmBhD,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AA,CAAAY,EAAS;CAAE,MAAM;CAAS,WAAW;AAAkB,CAAC,CAAA,GAAAK,EAAA,WAAA,kBAAA,KAAA,CAAA,GAkBxDjB,EAAA,CAAA0B,EAAsB,EAAE,UAAU,iBAAiB,CAAC,CAAA,GAAAT,EAAA,WAAA,SAAA,KAAA,CAAA,GAlCtD,IAAAjB,EAAA,CAAAc,EAAM,GACNa,EAAyB,CAAA,GAAAV,CAAA"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { audit as e } from "../internal/controllers/audit.controller.js";
|
|
2
|
-
import
|
|
3
|
-
import n from "../
|
|
4
|
-
import
|
|
5
|
-
import i from "
|
|
2
|
+
import t from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
3
|
+
import { ControlGroup as n } from "../forms/control-group/control-group2.js";
|
|
4
|
+
import r from "./switch-group.js";
|
|
5
|
+
import { useStyles as i } from "@nvidia-elements/foundations/internal/styles";
|
|
6
6
|
// src/switch/switch-group.ts
|
|
7
|
-
var a = class extends
|
|
7
|
+
var a = class extends n {
|
|
8
8
|
static {
|
|
9
|
-
this.styles =
|
|
9
|
+
this.styles = i([...n.styles, r]);
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
12
|
this.metadata = {
|
|
13
13
|
tag: "nve-switch-group",
|
|
14
|
-
version: "2.23.
|
|
14
|
+
version: "2.23.6",
|
|
15
15
|
children: [
|
|
16
16
|
"label",
|
|
17
17
|
"nve-control-message",
|
|
@@ -20,7 +20,7 @@ var a = class extends r {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
a =
|
|
23
|
+
a = t([e()], a);
|
|
24
24
|
export { a as SwitchGroup };
|
|
25
25
|
|
|
26
26
|
//# sourceMappingURL=switch-group2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-group2.js","names":["styles","_decorate","__decorate","switch_group_default","SwitchGroup","ControlGroup","useStyles","audit"],"sources":["../../src/switch/switch-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { CSSResult } from 'lit';\nimport { audit
|
|
1
|
+
{"version":3,"file":"switch-group2.js","names":["styles","_decorate","__decorate","switch_group_default","SwitchGroup","ControlGroup","useStyles","audit"],"sources":["../../src/switch/switch-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { CSSResult } from 'lit';\nimport { audit } from '@nvidia-elements/core/internal';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { ControlGroup } from '@nvidia-elements/core/forms';\nimport styles from './switch-group.css?inline';\n\n/**\n * @element nve-switch-group\n * @description A switch group is a container for a group of switches.\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/switch\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/switch/\n */\n@audit()\nexport class SwitchGroup extends ControlGroup {\n static styles: CSSResult[] = useStyles([...ControlGroup.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-switch-group',\n version: '0.0.0',\n children: ['label', 'nve-control-message', 'nve-switch']\n };\n}\n"],"mappings":";;;;;;AAiBO,IAAMI,IAAN,cAA0BC,EAAa;;EACf,KAAA,SAAAC,EAAU,CAAC,GAAGD,EAAa,QAAQL,CAAM,CAAC;;;EAE5C,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,UAAU;IAAC;IAAS;IAAuB;GAAY;EACzD;;AACF;AATC,IAAAC,EAAA,CAAAM,EAAM,CAAA,GAAAH,CAAA"}
|
package/dist/switch/switch2.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { audit as e } from "../internal/controllers/audit.controller.js";
|
|
2
2
|
import { hostAttr as t } from "../internal/decorators/host-attr.js";
|
|
3
|
-
import
|
|
4
|
-
import r from "../
|
|
5
|
-
import
|
|
6
|
-
import a from "
|
|
3
|
+
import n from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
4
|
+
import { Control as r } from "../forms/control/control2.js";
|
|
5
|
+
import i from "./switch.js";
|
|
6
|
+
import { useStyles as a } from "@nvidia-elements/foundations/internal/styles";
|
|
7
7
|
// src/switch/switch.ts
|
|
8
|
-
var o = class extends
|
|
8
|
+
var o = class extends r {
|
|
9
9
|
constructor(...e) {
|
|
10
10
|
super(...e), this.nveControl = "inline";
|
|
11
11
|
}
|
|
12
12
|
static {
|
|
13
|
-
this.styles =
|
|
13
|
+
this.styles = a([...r.styles, i]);
|
|
14
14
|
}
|
|
15
15
|
static {
|
|
16
16
|
this.metadata = {
|
|
17
17
|
tag: "nve-switch",
|
|
18
|
-
version: "2.23.
|
|
18
|
+
version: "2.23.6",
|
|
19
19
|
children: [
|
|
20
20
|
"label",
|
|
21
21
|
"input",
|
|
@@ -24,7 +24,7 @@ var o = class extends i {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
n([t({ attribute: "nve-control" })], o.prototype, "nveControl", void 0), o = n([e()], o);
|
|
28
28
|
export { o as Switch };
|
|
29
29
|
|
|
30
30
|
//# sourceMappingURL=switch2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch2.js","names":["styles","_decorate","__decorate","switch_default","Switch","Control","_args","useStyles","hostAttr","audit"],"sources":["../../src/switch/switch.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { CSSResult } from 'lit';\nimport { audit, hostAttr
|
|
1
|
+
{"version":3,"file":"switch2.js","names":["styles","_decorate","__decorate","switch_default","Switch","Control","_args","useStyles","hostAttr","audit"],"sources":["../../src/switch/switch.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { CSSResult } from 'lit';\nimport { audit, hostAttr } from '@nvidia-elements/core/internal';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { Control } from '@nvidia-elements/core/forms';\nimport styles from './switch.css?inline';\n\n/**\n * @element nve-switch\n * @description A switch is a control that enables users to switch between two mutually exclusive options (on or off, checked or unchecked) through a single click or tap.\n * @documentation https://nvidia.github.io/elements/docs/elements/switch/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/switch\n * @cssprop --cursor\n * @cssprop --border-radius\n * @cssprop --border-width\n * @cssprop --border\n * @cssprop --background\n * @cssprop --width\n * @cssprop --height\n * @cssprop --anchor-width\n * @cssprop --anchor-height\n * @cssprop --anchor-border-radius\n * @cssprop --anchor-background\n * @cssprop --padding\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/switch/\n */\n@audit()\nexport class Switch extends Control {\n @hostAttr({ attribute: 'nve-control' }) protected nveControl = 'inline';\n\n static styles: CSSResult[] = useStyles([...Control.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-switch',\n version: '0.0.0',\n children: ['label', 'input', 'nve-control-message']\n };\n}\n"],"mappings":";;;;;;;AA8BO,IAAMI,IAAN,cAAqBC,EAAQ;;EAC6B,A,aAAA,KAAA,aAAA;;;EAElC,KAAA,SAAAE,EAAU,CAAC,GAAGF,EAAQ,QAAQL,CAAM,CAAC;;;EAEvC,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,UAAU;IAAC;IAAS;IAAS;GAAqB;EACpD;;AACF;AATGC,EAAA,CAAAO,EAAS,EAAE,WAAW,cAAc,CAAC,CAAA,GAAAJ,EAAA,WAAA,cAAA,KAAA,CAAA,GAFvC,IAAAH,EAAA,CAAAQ,EAAM,CAAA,GAAAL,CAAA"}
|
package/dist/tabs/tabs-group2.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { audit as e } from "../internal/controllers/audit.controller.js";
|
|
2
2
|
import { generateId as t, sameOrderedStringArray as n, uniqueNonEmptyStrings as r } from "../internal/utils/dom.js";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import o from "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import l from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import i from "../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
4
|
+
import { getTabItems as a } from "./utils.js";
|
|
5
|
+
import { Tabs as o } from "./tabs2.js";
|
|
6
|
+
import s from "./tabs-group.js";
|
|
7
|
+
import { attachInternals as c } from "@nvidia-elements/foundations/internal/a11y";
|
|
8
|
+
import { LitElement as l, html as u } from "lit";
|
|
9
|
+
import { property as d } from "lit/decorators/property.js";
|
|
10
|
+
import { useStyles as f } from "@nvidia-elements/foundations/internal/styles";
|
|
11
11
|
import { state as p } from "lit/decorators/state.js";
|
|
12
12
|
import { queryAssignedElements as m } from "lit/decorators/query-assigned-elements.js";
|
|
13
13
|
// src/tabs/tabs-group.ts
|
|
14
|
-
var h, g = class extends
|
|
14
|
+
var h, g = class extends l {
|
|
15
15
|
static {
|
|
16
16
|
h = this;
|
|
17
17
|
}
|
|
@@ -29,12 +29,12 @@ var h, g = class extends u {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
static {
|
|
32
|
-
this.styles =
|
|
32
|
+
this.styles = f([s]);
|
|
33
33
|
}
|
|
34
34
|
static {
|
|
35
35
|
this.metadata = {
|
|
36
36
|
tag: "nve-tabs-group",
|
|
37
|
-
version: "2.23.
|
|
37
|
+
version: "2.23.6",
|
|
38
38
|
children: ["nve-tabs"]
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -53,10 +53,10 @@ var h, g = class extends u {
|
|
|
53
53
|
}
|
|
54
54
|
#e;
|
|
55
55
|
render() {
|
|
56
|
-
return
|
|
56
|
+
return u`<div internal-host><slot @slotchange="${this.#t}"></slot>${this.panelValues.map((e) => u`<slot name="${e}" @slotchange="${this.#n}"></slot>`)}</div>`;
|
|
57
57
|
}
|
|
58
58
|
connectedCallback() {
|
|
59
|
-
super.connectedCallback(),
|
|
59
|
+
super.connectedCallback(), c(this), this._internals.role = "group", this.addEventListener("command", this.#r);
|
|
60
60
|
}
|
|
61
61
|
firstUpdated() {
|
|
62
62
|
this.updateComplete.then(() => {
|
|
@@ -114,11 +114,11 @@ var h, g = class extends u {
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
#u() {
|
|
117
|
-
let e = this.defaultSlotElements.find((e) => e.localName ===
|
|
118
|
-
return e instanceof
|
|
117
|
+
let e = this.defaultSlotElements.find((e) => e.localName === o.metadata.tag) ?? this.querySelector(o.metadata.tag);
|
|
118
|
+
return e instanceof o ? e : void 0;
|
|
119
119
|
}
|
|
120
120
|
#d() {
|
|
121
|
-
return
|
|
121
|
+
return a(Array.from(this.#u()?.children ?? []));
|
|
122
122
|
}
|
|
123
123
|
#f() {
|
|
124
124
|
return Array.from(this.renderRoot.querySelectorAll("slot[name]"));
|
|
@@ -130,10 +130,10 @@ var h, g = class extends u {
|
|
|
130
130
|
return e.find((e) => this.#p(e) && e.selected) ?? e.find((e) => this.#p(e));
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
|
-
|
|
133
|
+
i([m({ flatten: !0 })], g.prototype, "defaultSlotElements", void 0), i([d({
|
|
134
134
|
type: String,
|
|
135
135
|
reflect: !0
|
|
136
|
-
})], g.prototype, "alignment", void 0),
|
|
136
|
+
})], g.prototype, "alignment", void 0), i([p()], g.prototype, "panelValues", void 0), i([p()], g.prototype, "selectedValue", void 0), g = h = i([e()], g);
|
|
137
137
|
export { g as TabsGroup };
|
|
138
138
|
|
|
139
139
|
//# sourceMappingURL=tabs-group2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-group2.js","names":["styles","_decorate","__decorate","tabs_group_default","_TabsGroup","TabsGroup","LitElement","_args","#handleDefaultSlotChange","#observeTabs","#syncFromTabs","#handlePanelSlotChange","#syncPanels","#handleCommand","event","value","tabItems","#getTabItems","tabItem","#isSelectableTab","item","#setActiveTab","useStyles","attachInternals","#tabsObserver","changedProperties","props","tabs","#getTabsElement","nextPanelValues","uniqueNonEmptyStrings","selectedTab","#resolveSelectedTab","#commitState","options","changed","nextTab","emitEvent","sameOrderedStringArray","nextSelectedValue","tabMap","#getPanelSlots","#syncPanelSlot","slot","panels","generateId","index","panel","el","element","Tabs","getTabItems","queryAssignedElements","property","state","audit"],"sources":["../../src/tabs/tabs-group.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 { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport { state } from 'lit/decorators/state.js';\nimport {\n attachInternals,\n audit,\n generateId,\n sameOrderedStringArray,\n uniqueNonEmptyStrings,\n useStyles\n} from '@nvidia-elements/core/internal';\nimport { Tabs, type TabsItem } from './tabs.js';\nimport styles from './tabs-group.css?inline';\nimport { getTabItems } from './utils.js';\n\n/** Invoker command source for `--toggle` (e.g. `nve-tabs-item` with `value`). */\ntype TabsGroupCommandSource = HTMLElement & {\n disabled?: boolean;\n value?: string | null;\n};\n\n/** `command` event from Invoker Commands; `source` is the control that fired. */\ntype TabsGroupCommandEvent = Event & {\n command?: string;\n source?: TabsGroupCommandSource | null;\n};\n\n/** Payload for the composed `select` event when the active tab value changes via command. */\ntype TabsGroupSelectDetail = { value: string };\n\n/** Arranges the tab strip and slot-matched panels: stacked column (`top`), or sidebar row with tabs at inline-start (`start`) or inline-end (`end`). */\nexport type TabsGroupAlignment = 'top' | 'start' | 'end';\n\n/**\n * @element nve-tabs-group\n * @description Coordinates tabs with matching panel content using Invoker Commands and slot-matched panels.\n * @documentation https://nvidia.github.io/elements/docs/elements/tabs/\n * @since 1.67.0\n * @entrypoint \\@nvidia-elements/core/tabs\n * @command --toggle - Select the matching tab and reveal the panel whose slot matches the invoker value.\n * @event select - Dispatched when the selected tab value changes after an invoker `--toggle` updates selection\n * @slot - Default slot for a single nve-tabs element. Do not use behavior-select on nve-tabs when using this group.\n * @slot {value} - Named panel content where the slot name matches a nve-tabs-item value.\n * @cssprop --padding\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n * @responsive false\n */\n@audit()\nexport class TabsGroup extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-tabs-group',\n version: '0.0.0',\n children: ['nve-tabs']\n };\n\n /** Options for observing the slotted `nve-tabs` subtree (tab list / item attribute changes). */\n protected static readonly subtreeObserverInit = {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['disabled', 'id', 'selected', 'value']\n } as const satisfies MutationObserverInit;\n\n @queryAssignedElements({ flatten: true }) private defaultSlotElements!: HTMLElement[];\n\n /**\n * Arranges the tab strip relative to slot-matched panels: stacked column (`top`), or sidebar row with tabs at\n * inline-start (`start`) or inline-end (`end`) beside the panel region.\n */\n @property({ type: String, reflect: true }) alignment: TabsGroupAlignment = 'top';\n\n @state() private panelValues: string[] = [];\n\n @state() private selectedValue = '';\n\n /** @private */\n declare _internals: ElementInternals;\n\n #tabsObserver?: MutationObserver;\n\n /**\n * Renders the default slot (single `nve-tabs`) plus one named `<slot name={value}>` per distinct selectable\n * `nve-tabs-item` value. `#syncPanelSlot` applies panel visibility and ARIA from `selectedValue`.\n */\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#handleDefaultSlotChange}></slot>\n ${this.panelValues.map(value => html`<slot name=${value} @slotchange=${this.#handlePanelSlotChange}></slot>`)}\n </div>\n `;\n }\n\n // --- Lifecycle & command ---\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'group';\n this.addEventListener('command', this.#handleCommand as EventListener);\n }\n\n firstUpdated() {\n void this.updateComplete.then(() => {\n if (!this.isConnected) {\n return;\n }\n\n this.#syncFromTabs();\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('command', this.#handleCommand as EventListener);\n this.#tabsObserver?.disconnect();\n }\n\n updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n\n if (!this.#tabsObserver) {\n this.#observeTabs();\n }\n\n // `@state()` fields are not in `PropertyValues<this>` keys; cast for membership checks.\n const props = changedProperties as ReadonlyMap<PropertyKey, unknown>;\n if (props.has('panelValues') || props.has('selectedValue')) {\n this.#syncPanels();\n }\n }\n\n #handleDefaultSlotChange = (): void => {\n this.#observeTabs();\n this.#syncFromTabs();\n };\n\n #handlePanelSlotChange = (): void => {\n this.#syncPanels();\n };\n\n /**\n * Handles Invoker `--toggle` on a tab item: selects the matching `nve-tabs-item` and syncs panels.\n * Ignores non-toggle commands and invokers without a non-empty string `value`.\n */\n #handleCommand = (event: TabsGroupCommandEvent): void => {\n if (event.command !== '--toggle') {\n return;\n }\n\n const value = event.source?.value;\n if (typeof value !== 'string' || !value.length) {\n return;\n }\n\n const tabItems = this.#getTabItems();\n const tabItem = tabItems.find(item => this.#isSelectableTab(item) && item.value === value);\n if (!tabItem) {\n return;\n }\n\n this.#setActiveTab(tabItems, tabItem, { emitEvent: true });\n };\n\n // --- Tab strip sync (tabs → state) ---\n\n /** Attaches a single `MutationObserver` on the slotted `nve-tabs` element to mirror tab list changes into state. */\n #observeTabs(): void {\n this.#tabsObserver?.disconnect();\n\n const tabs = this.#getTabsElement();\n if (!tabs) {\n return;\n }\n\n this.#tabsObserver = new MutationObserver(() => this.#syncFromTabs());\n this.#tabsObserver.observe(tabs, TabsGroup.subtreeObserverInit);\n }\n\n /**\n * Reads the current tab items: derives ordered `panelValues` for render, resolves which tab should be active,\n * and commits selection. Called on slot change, subtree mutations, and after mount.\n */\n #syncFromTabs(): void {\n const tabItems = this.#getTabItems();\n const nextPanelValues = uniqueNonEmptyStrings(tabItems.map(item => item.value));\n\n const selectedTab = this.#resolveSelectedTab(tabItems);\n\n if (!selectedTab) {\n tabItems.forEach(item => (item.selected = false));\n this.#commitState(nextPanelValues, '');\n return;\n }\n\n this.#setActiveTab(tabItems, selectedTab, { emitEvent: false, nextPanelValues });\n }\n\n /**\n * Sets exactly one selected tab, updates `panelValues` / `selectedValue`, and optionally dispatches `select`.\n *\n * @param emitEvent - When true (command path), dispatches `select` if selection actually changed.\n */\n #setActiveTab(\n tabItems: TabsItem[],\n nextTab: TabsItem,\n options: { emitEvent: boolean; nextPanelValues?: string[] }\n ): void {\n const { emitEvent } = options;\n const nextPanelValues = options.nextPanelValues ?? uniqueNonEmptyStrings(tabItems.map(item => item.value));\n // True when the effective selection differs from the prior committed state (value, flags, or multi-select).\n // `select` is only dispatched when both `emitEvent` (invoker/command path) and `changed` are true.\n const changed =\n this.selectedValue !== nextTab.value ||\n !nextTab.selected ||\n tabItems.some(item => item !== nextTab && item.selected);\n\n tabItems.forEach(item => {\n item.selected = item === nextTab;\n });\n\n this.#commitState(nextPanelValues, nextTab.value);\n\n if (emitEvent && changed) {\n this.dispatchEvent(\n new CustomEvent<TabsGroupSelectDetail>('select', {\n bubbles: true,\n composed: true,\n detail: { value: nextTab.value }\n })\n );\n }\n }\n\n /** Updates reactive state for panel slot names and the active tab value without touching the tab items. */\n #commitState(nextPanelValues: string[], nextSelectedValue: string): void {\n if (!sameOrderedStringArray(this.panelValues, nextPanelValues)) {\n this.panelValues = nextPanelValues;\n }\n\n if (this.selectedValue !== nextSelectedValue) {\n this.selectedValue = nextSelectedValue;\n }\n }\n\n // --- Panel sync (state → panels & ARIA) ---\n\n /** For each named panel slot, wires `hidden` and tab↔panel ARIA ids to match `selectedValue`. */\n #syncPanels(): void {\n const tabItems = this.#getTabItems();\n const tabMap = new Map(\n tabItems.filter(item => this.#isSelectableTab(item)).map(item => [item.value, item] satisfies [string, TabsItem])\n );\n\n this.#getPanelSlots().forEach(slot => {\n this.#syncPanelSlot(slot, tabMap);\n });\n }\n\n /**\n * If no selectable tab exists for `slot.name`, hides all assigned nodes. Otherwise shows only the panel(s)\n * for the active value and assigns `role=\"tabpanel\"` / `aria-labelledby` when missing.\n */\n #syncPanelSlot(slot: HTMLSlotElement, tabMap: ReadonlyMap<string, TabsItem>): void {\n const tabItem = tabMap.get(slot.name);\n const panels = slot.assignedElements({ flatten: true }) as HTMLElement[];\n\n if (!tabItem) {\n panels.forEach(panel => {\n panel.hidden = true;\n });\n return;\n }\n\n tabItem.id ||= generateId();\n\n panels.forEach((panel, index) => {\n panel.id ||= generateId();\n\n if (!tabItem.hasAttribute('aria-controls') && index === 0) {\n tabItem.setAttribute('aria-controls', panel.id);\n }\n\n if (!panel.hasAttribute('aria-labelledby')) {\n panel.setAttribute('aria-labelledby', tabItem.id);\n }\n\n if (!panel.hasAttribute('role')) {\n panel.setAttribute('role', 'tabpanel');\n }\n\n const isActive = slot.name === this.selectedValue;\n panel.hidden = !isActive;\n });\n }\n\n // --- DOM queries ---\n\n /** Resolves the single slotted `nve-tabs` (default slot), with a light-DOM fallback for edge timing. */\n #getTabsElement(): Tabs | undefined {\n const el =\n this.defaultSlotElements.find(element => element.localName === Tabs.metadata.tag) ??\n this.querySelector(Tabs.metadata.tag);\n return el instanceof Tabs ? el : undefined;\n }\n\n #getTabItems(): TabsItem[] {\n return getTabItems(Array.from(this.#getTabsElement()?.children ?? []));\n }\n\n #getPanelSlots(): HTMLSlotElement[] {\n return Array.from(this.renderRoot.querySelectorAll<HTMLSlotElement>('slot[name]'));\n }\n\n /** Selectable tabs have a non-empty `value` and are not `disabled`. */\n #isSelectableTab(tabItem: TabsItem): tabItem is TabsItem & { value: string } {\n return typeof tabItem.value === 'string' && tabItem.value.length > 0 && !tabItem.disabled;\n }\n\n /** Prefer the selectable tab that is already selected; otherwise the first selectable tab. */\n #resolveSelectedTab(tabItems: readonly TabsItem[]): TabsItem | undefined {\n return (\n tabItems.find(item => this.#isSelectableTab(item) && item.selected) ??\n tabItems.find(item => this.#isSelectableTab(item))\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;A,OAqDaK,IAAN,cAAwBC,EAAW;;;;;EAmGtB,A,aA5EyD,KAAA,YAAA,OAElC,KAAA,cAAA,CAAC,GAET,KAAA,gBAAA,IA2DM,KAAAE,WAAA;GAErC,AADA,KAAKC,GAAa,GAClB,KAAKC,GAAc;EACrB,GAEqC,KAAAC,WAAA;GACnC,KAAKC,GAAY;EACnB,GAMkB,KAAAC,MAAA,MAAuC;GACvD,IAAIC,EAAM,YAAY,YACpB;GAGF,IAAMC,IAAQD,EAAM,QAAQ;GAC5B,IAAI,OAAOC,KAAU,YAAY,CAACA,EAAM,QACtC;GAGF,IAAMC,IAAW,KAAKC,GAAa,GAC7BC,IAAUF,EAAS,MAAK,MAAQ,KAAKG,GAAiBC,CAAI,KAAKA,EAAK,UAAUL,CAAK;GACzF,AAAKG,KAIL,KAAKG,GAAcL,GAAUE,GAAS,EAAE,WAAW,GAAK,CAAC;EAC3D;;;EAnHgB,KAAA,SAAAI,EAAU,CAACtB,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,UAAU,CAAC,UAAU;EACvB;;;EAGgD,KAAA,sBAAA;GAC9C,WAAW;GACX,SAAS;GACT,YAAY;GACZ,iBAAiB;IAAC;IAAY;IAAM;IAAY;GAAO;EACzD;;CAiBA;CAMA,SAAS;EACP,OAAO,CAAI,yCAEa,KAAKQ,GAAyB,WAChD,KAAK,YAAY,KAAI,MAAS,CAAI,eAAcO,EAAM,iBAAe,KAAKJ,GAAuB,UAAS,EAAE;CAGpH;CAIA,oBAAoB;EAIlB,AAHA,MAAM,kBAAkB,GACxBY,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO,SACvB,KAAK,iBAAiB,WAAW,KAAKV,EAA+B;CACvE;CAEA,eAAe;EACb,KAAU,eAAe,WAAW;GAClC,AAAK,KAAK,e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,KAChF,KAAK,cAAcA,EAAK,SAAS,GAAG;EACtC,OAAOF,aAAcE,IAAOF,IAAK,KAAA;CACnC;CAEA,KAA2B;EACzB,OAAOG,EAAY,MAAM,KAAK,KAAKvB,GAAgB,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;CACvE;CAEA,KAAoC;EAClC,OAAO,MAAM,KAAK,KAAK,WAAW,iBAAkC,YAAY,CAAC;CACnF;CAGA,GAAiB,GAA4D;EAC3E,OAAO,OAAOV,EAAQ,SAAU,YAAYA,EAAQ,MAAM,SAAS,KAAK,CAACA,EAAQ;CACnF;CAGA,GAAoB,GAAqD;EACvE,OACEF,EAAS,MAAK,MAAQ,KAAKG,GAAiBC,CAAI,KAAKA,EAAK,QAAQ,KAClEJ,EAAS,MAAK,MAAQ,KAAKG,GAAiBC,CAAI,CAAC;CAErD;AACF;AAvQGnB,EAAA,CAAAmD,EAAsB,EAAE,SAAS,GAAK,CAAC,CAAA,GAAA/C,EAAA,WAAA,uBAAA,KAAA,CAAA,GAMvCJ,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAhD,EAAA,WAAA,aAAA,KAAA,CAAA,GAExCJ,EAAA,CAAAqD,EAAM,CAAA,GAAAjD,EAAA,WAAA,eAAA,KAAA,CAAA,GAENJ,EAAA,CAAAqD,EAAM,CAAA,GAAAjD,EAAA,WAAA,iBAAA,KAAA,CAAA,GA5BR,IAAA,IAAAJ,EAAA,CAAAsD,EAAM,CAAA,GAAAlD,CAAA"}
|
|
1
|
+
{"version":3,"file":"tabs-group2.js","names":["styles","_decorate","__decorate","tabs_group_default","_TabsGroup","TabsGroup","LitElement","_args","#handleDefaultSlotChange","#observeTabs","#syncFromTabs","#handlePanelSlotChange","#syncPanels","#handleCommand","event","value","tabItems","#getTabItems","tabItem","#isSelectableTab","item","#setActiveTab","useStyles","attachInternals","#tabsObserver","changedProperties","props","tabs","#getTabsElement","nextPanelValues","uniqueNonEmptyStrings","selectedTab","#resolveSelectedTab","#commitState","options","changed","nextTab","emitEvent","sameOrderedStringArray","nextSelectedValue","tabMap","#getPanelSlots","#syncPanelSlot","slot","panels","generateId","index","panel","el","element","Tabs","getTabItems","queryAssignedElements","property","state","audit"],"sources":["../../src/tabs/tabs-group.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 { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport { state } from 'lit/decorators/state.js';\nimport { audit, generateId, sameOrderedStringArray, uniqueNonEmptyStrings } from '@nvidia-elements/core/internal';\nimport { attachInternals } from '@nvidia-elements/foundations/internal/a11y';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport { Tabs, type TabsItem } from './tabs.js';\nimport styles from './tabs-group.css?inline';\nimport { getTabItems } from './utils.js';\n\n/** Invoker command source for `--toggle` (e.g. `nve-tabs-item` with `value`). */\ntype TabsGroupCommandSource = HTMLElement & {\n disabled?: boolean;\n value?: string | null;\n};\n\n/** `command` event from Invoker Commands; `source` is the control that fired. */\ntype TabsGroupCommandEvent = Event & {\n command?: string;\n source?: TabsGroupCommandSource | null;\n};\n\n/** Payload for the composed `select` event when the active tab value changes via command. */\ntype TabsGroupSelectDetail = { value: string };\n\n/** Arranges the tab strip and slot-matched panels: stacked column (`top`), or sidebar row with tabs at inline-start (`start`) or inline-end (`end`). */\nexport type TabsGroupAlignment = 'top' | 'start' | 'end';\n\n/**\n * @element nve-tabs-group\n * @description Coordinates tabs with matching panel content using Invoker Commands and slot-matched panels.\n * @documentation https://nvidia.github.io/elements/docs/elements/tabs/\n * @since 1.67.0\n * @entrypoint \\@nvidia-elements/core/tabs\n * @command --toggle - Select the matching tab and reveal the panel whose slot matches the invoker value.\n * @event select - Dispatched when the selected tab value changes after an invoker `--toggle` updates selection\n * @slot - Default slot for a single nve-tabs element. Do not use behavior-select on nve-tabs when using this group.\n * @slot {value} - Named panel content where the slot name matches a nve-tabs-item value.\n * @cssprop --padding\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n * @responsive false\n */\n@audit()\nexport class TabsGroup extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-tabs-group',\n version: '0.0.0',\n children: ['nve-tabs']\n };\n\n /** Options for observing the slotted `nve-tabs` subtree (tab list / item attribute changes). */\n protected static readonly subtreeObserverInit = {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['disabled', 'id', 'selected', 'value']\n } as const satisfies MutationObserverInit;\n\n @queryAssignedElements({ flatten: true }) private defaultSlotElements!: HTMLElement[];\n\n /**\n * Arranges the tab strip relative to slot-matched panels: stacked column (`top`), or sidebar row with tabs at\n * inline-start (`start`) or inline-end (`end`) beside the panel region.\n */\n @property({ type: String, reflect: true }) alignment: TabsGroupAlignment = 'top';\n\n @state() private panelValues: string[] = [];\n\n @state() private selectedValue = '';\n\n /** @private */\n declare _internals: ElementInternals;\n\n #tabsObserver?: MutationObserver;\n\n /**\n * Renders the default slot (single `nve-tabs`) plus one named `<slot name={value}>` per distinct selectable\n * `nve-tabs-item` value. `#syncPanelSlot` applies panel visibility and ARIA from `selectedValue`.\n */\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#handleDefaultSlotChange}></slot>\n ${this.panelValues.map(value => html`<slot name=${value} @slotchange=${this.#handlePanelSlotChange}></slot>`)}\n </div>\n `;\n }\n\n // --- Lifecycle & command ---\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'group';\n this.addEventListener('command', this.#handleCommand as EventListener);\n }\n\n firstUpdated() {\n void this.updateComplete.then(() => {\n if (!this.isConnected) {\n return;\n }\n\n this.#syncFromTabs();\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('command', this.#handleCommand as EventListener);\n this.#tabsObserver?.disconnect();\n }\n\n updated(changedProperties: PropertyValues<this>) {\n super.updated(changedProperties);\n\n if (!this.#tabsObserver) {\n this.#observeTabs();\n }\n\n // `@state()` fields are not in `PropertyValues<this>` keys; cast for membership checks.\n const props = changedProperties as ReadonlyMap<PropertyKey, unknown>;\n if (props.has('panelValues') || props.has('selectedValue')) {\n this.#syncPanels();\n }\n }\n\n #handleDefaultSlotChange = (): void => {\n this.#observeTabs();\n this.#syncFromTabs();\n };\n\n #handlePanelSlotChange = (): void => {\n this.#syncPanels();\n };\n\n /**\n * Handles Invoker `--toggle` on a tab item: selects the matching `nve-tabs-item` and syncs panels.\n * Ignores non-toggle commands and invokers without a non-empty string `value`.\n */\n #handleCommand = (event: TabsGroupCommandEvent): void => {\n if (event.command !== '--toggle') {\n return;\n }\n\n const value = event.source?.value;\n if (typeof value !== 'string' || !value.length) {\n return;\n }\n\n const tabItems = this.#getTabItems();\n const tabItem = tabItems.find(item => this.#isSelectableTab(item) && item.value === value);\n if (!tabItem) {\n return;\n }\n\n this.#setActiveTab(tabItems, tabItem, { emitEvent: true });\n };\n\n // --- Tab strip sync (tabs → state) ---\n\n /** Attaches a single `MutationObserver` on the slotted `nve-tabs` element to mirror tab list changes into state. */\n #observeTabs(): void {\n this.#tabsObserver?.disconnect();\n\n const tabs = this.#getTabsElement();\n if (!tabs) {\n return;\n }\n\n this.#tabsObserver = new MutationObserver(() => this.#syncFromTabs());\n this.#tabsObserver.observe(tabs, TabsGroup.subtreeObserverInit);\n }\n\n /**\n * Reads the current tab items: derives ordered `panelValues` for render, resolves which tab should be active,\n * and commits selection. Called on slot change, subtree mutations, and after mount.\n */\n #syncFromTabs(): void {\n const tabItems = this.#getTabItems();\n const nextPanelValues = uniqueNonEmptyStrings(tabItems.map(item => item.value));\n\n const selectedTab = this.#resolveSelectedTab(tabItems);\n\n if (!selectedTab) {\n tabItems.forEach(item => (item.selected = false));\n this.#commitState(nextPanelValues, '');\n return;\n }\n\n this.#setActiveTab(tabItems, selectedTab, { emitEvent: false, nextPanelValues });\n }\n\n /**\n * Sets exactly one selected tab, updates `panelValues` / `selectedValue`, and optionally dispatches `select`.\n *\n * @param emitEvent - When true (command path), dispatches `select` if selection actually changed.\n */\n #setActiveTab(\n tabItems: TabsItem[],\n nextTab: TabsItem,\n options: { emitEvent: boolean; nextPanelValues?: string[] }\n ): void {\n const { emitEvent } = options;\n const nextPanelValues = options.nextPanelValues ?? uniqueNonEmptyStrings(tabItems.map(item => item.value));\n // True when the effective selection differs from the prior committed state (value, flags, or multi-select).\n // `select` is only dispatched when both `emitEvent` (invoker/command path) and `changed` are true.\n const changed =\n this.selectedValue !== nextTab.value ||\n !nextTab.selected ||\n tabItems.some(item => item !== nextTab && item.selected);\n\n tabItems.forEach(item => {\n item.selected = item === nextTab;\n });\n\n this.#commitState(nextPanelValues, nextTab.value);\n\n if (emitEvent && changed) {\n this.dispatchEvent(\n new CustomEvent<TabsGroupSelectDetail>('select', {\n bubbles: true,\n composed: true,\n detail: { value: nextTab.value }\n })\n );\n }\n }\n\n /** Updates reactive state for panel slot names and the active tab value without touching the tab items. */\n #commitState(nextPanelValues: string[], nextSelectedValue: string): void {\n if (!sameOrderedStringArray(this.panelValues, nextPanelValues)) {\n this.panelValues = nextPanelValues;\n }\n\n if (this.selectedValue !== nextSelectedValue) {\n this.selectedValue = nextSelectedValue;\n }\n }\n\n // --- Panel sync (state → panels & ARIA) ---\n\n /** For each named panel slot, wires `hidden` and tab↔panel ARIA ids to match `selectedValue`. */\n #syncPanels(): void {\n const tabItems = this.#getTabItems();\n const tabMap = new Map(\n tabItems.filter(item => this.#isSelectableTab(item)).map(item => [item.value, item] satisfies [string, TabsItem])\n );\n\n this.#getPanelSlots().forEach(slot => {\n this.#syncPanelSlot(slot, tabMap);\n });\n }\n\n /**\n * If no selectable tab exists for `slot.name`, hides all assigned nodes. Otherwise shows only the panel(s)\n * for the active value and assigns `role=\"tabpanel\"` / `aria-labelledby` when missing.\n */\n #syncPanelSlot(slot: HTMLSlotElement, tabMap: ReadonlyMap<string, TabsItem>): void {\n const tabItem = tabMap.get(slot.name);\n const panels = slot.assignedElements({ flatten: true }) as HTMLElement[];\n\n if (!tabItem) {\n panels.forEach(panel => {\n panel.hidden = true;\n });\n return;\n }\n\n tabItem.id ||= generateId();\n\n panels.forEach((panel, index) => {\n panel.id ||= generateId();\n\n if (!tabItem.hasAttribute('aria-controls') && index === 0) {\n tabItem.setAttribute('aria-controls', panel.id);\n }\n\n if (!panel.hasAttribute('aria-labelledby')) {\n panel.setAttribute('aria-labelledby', tabItem.id);\n }\n\n if (!panel.hasAttribute('role')) {\n panel.setAttribute('role', 'tabpanel');\n }\n\n const isActive = slot.name === this.selectedValue;\n panel.hidden = !isActive;\n });\n }\n\n // --- DOM queries ---\n\n /** Resolves the single slotted `nve-tabs` (default slot), with a light-DOM fallback for edge timing. */\n #getTabsElement(): Tabs | undefined {\n const el =\n this.defaultSlotElements.find(element => element.localName === Tabs.metadata.tag) ??\n this.querySelector(Tabs.metadata.tag);\n return el instanceof Tabs ? el : undefined;\n }\n\n #getTabItems(): TabsItem[] {\n return getTabItems(Array.from(this.#getTabsElement()?.children ?? []));\n }\n\n #getPanelSlots(): HTMLSlotElement[] {\n return Array.from(this.renderRoot.querySelectorAll<HTMLSlotElement>('slot[name]'));\n }\n\n /** Selectable tabs have a non-empty `value` and are not `disabled`. */\n #isSelectableTab(tabItem: TabsItem): tabItem is TabsItem & { value: string } {\n return typeof tabItem.value === 'string' && tabItem.value.length > 0 && !tabItem.disabled;\n }\n\n /** Prefer the selectable tab that is already selected; otherwise the first selectable tab. */\n #resolveSelectedTab(tabItems: readonly TabsItem[]): TabsItem | undefined {\n return (\n tabItems.find(item => this.#isSelectableTab(item) && item.selected) ??\n tabItems.find(item => this.#isSelectableTab(item))\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;A,OAgDaK,IAAN,cAAwBC,EAAW;;;;;EAmGtB,A,aA5EyD,KAAA,YA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AC,CAAC,CAAC;CACvE;CAEA,KAAoC;EAClC,OAAO,MAAM,KAAK,KAAK,WAAW,iBAAkC,YAAY,CAAC;CACnF;CAGA,GAAiB,GAA4D;EAC3E,OAAO,OAAOV,EAAQ,SAAU,YAAYA,EAAQ,MAAM,SAAS,KAAK,CAACA,EAAQ;CACnF;CAGA,GAAoB,GAAqD;EACvE,OACEF,EAAS,MAAK,MAAQ,KAAKG,GAAiBC,CAAI,KAAKA,EAAK,QAAQ,KAClEJ,EAAS,MAAK,MAAQ,KAAKG,GAAiBC,CAAI,CAAC;CAErD;AACF;AAvQGnB,EAAA,CAAAmD,EAAsB,EAAE,SAAS,GAAK,CAAC,CAAA,GAAA/C,EAAA,WAAA,uBAAA,KAAA,CAAA,GAMvCJ,EAAA,CAAAoD,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAAhD,EAAA,WAAA,aAAA,KAAA,CAAA,GAExCJ,EAAA,CAAAqD,EAAM,CAAA,GAAAjD,EAAA,WAAA,eAAA,KAAA,CAAA,GAENJ,EAAA,CAAAqD,EAAM,CAAA,GAAAjD,EAAA,WAAA,iBAAA,KAAA,CAAA,GA5BR,IAAA,IAAAJ,EAAA,CAAAsD,EAAM,CAAA,GAAAlD,CAAA"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { audit as e } from "../internal/controllers/audit.controller.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 "./tabs-item-group.js";
|
|
4
|
+
import { LitElement as r, html as i, nothing as a } from "lit";
|
|
5
|
+
import { useStyles as o } from "@nvidia-elements/foundations/internal/styles";
|
|
6
6
|
import { state as s } from "lit/decorators/state.js";
|
|
7
7
|
// src/tabs/tabs-item-group.ts
|
|
8
|
-
var c = class extends
|
|
8
|
+
var c = class extends r {
|
|
9
9
|
constructor(...e) {
|
|
10
10
|
super(...e), this.accessoryTabEnabled = !0;
|
|
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-tabs-item-group",
|
|
18
|
-
version: "2.23.
|
|
18
|
+
version: "2.23.6",
|
|
19
19
|
parents: ["nve-tabs"],
|
|
20
20
|
children: ["nve-tabs-item"]
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return
|
|
24
|
+
return i`<div internal-host><slot name="prefix" tabindex="${this.accessoryTabEnabled ? a : -1}"></slot><slot></slot><slot name="suffix" tabindex="${this.accessoryTabEnabled ? a : -1}"></slot></div>`;
|
|
25
25
|
}
|
|
26
26
|
disconnectedCallback() {
|
|
27
27
|
super.disconnectedCallback(), this.accessoryTabEnabled = !0;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
t([s()], c.prototype, "accessoryTabEnabled", void 0), c = t([e()], c);
|
|
31
31
|
export { c as TabsItemGroup };
|
|
32
32
|
|
|
33
33
|
//# sourceMappingURL=tabs-item-group2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-item-group2.js","names":["styles","_decorate","__decorate","tabs_item_group_default","TabsItemGroup","LitElement","_args","useStyles","nothing","state","audit"],"sources":["../../src/tabs/tabs-item-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement, nothing } from 'lit';\nimport { state } from 'lit/decorators/state.js';\nimport { audit
|
|
1
|
+
{"version":3,"file":"tabs-item-group2.js","names":["styles","_decorate","__decorate","tabs_item_group_default","TabsItemGroup","LitElement","_args","useStyles","nothing","state","audit"],"sources":["../../src/tabs/tabs-item-group.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement, nothing } from 'lit';\nimport { state } from 'lit/decorators/state.js';\nimport { audit } from '@nvidia-elements/core/internal';\nimport { useStyles } from '@nvidia-elements/foundations/internal/styles';\nimport styles from './tabs-item-group.css?inline';\n\n/**\n * @element nve-tabs-item-group\n * @description Groups a tab item with application-owned accessory controls.\n * @documentation https://nvidia.github.io/elements/docs/elements/tabs/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/tabs\n * @slot - A single nve-tabs-item.\n * @slot prefix - Controls before the tab item.\n * @slot suffix - Controls after the tab item.\n * @cssprop --gap - Spacing between the tab item and accessories.\n * @cssprop --height\n * @cssprop --padding\n * @cssprop --width\n * @cssprop --border-radius\n */\n@audit()\nexport class TabsItemGroup extends LitElement {\n /** @private */\n @state() accessoryTabEnabled = true;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-tabs-item-group',\n version: '0.0.0',\n parents: ['nve-tabs'],\n children: ['nve-tabs-item']\n };\n\n render() {\n return html`\n <div internal-host>\n <slot name=\"prefix\" tabindex=${this.accessoryTabEnabled ? nothing : -1}></slot>\n <slot></slot>\n <slot name=\"suffix\" tabindex=${this.accessoryTabEnabled ? nothing : -1}></slot>\n </div>\n `;\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.accessoryTabEnabled = true;\n }\n}\n"],"mappings":";;;;;;;AAyBO,IAAMI,IAAN,cAA4BC,EAAW;;EAEb,A,aAAA,KAAA,sBAAA;;;EAEf,KAAA,SAAAE,EAAU,CAACP,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,SAAS,CAAC,UAAU;GACpB,UAAU,CAAC,eAAe;EAC5B;;CAEA,SAAS;EACP,OAAO,CAAI,oDAEwB,KAAK,sBAAsBQ,IAAU,GAAG,sDAExC,KAAK,sBAAsBA,IAAU,GAAG;CAG7E;CAEA,uBAAuB;EAErB,AADA,MAAM,qBAAqB,GAC3B,KAAK,sBAAsB;CAC7B;AACF;AAzBGP,EAAA,CAAAQ,EAAM,CAAA,GAAAL,EAAA,WAAA,uBAAA,KAAA,CAAA,GAHR,IAAAH,EAAA,CAAAS,EAAM,CAAA,GAAAN,CAAA"}
|