@nvidia-elements/core 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.132.0/helpers → _@oxc-project_runtime@0.133.0/helpers/esm}/decorate.js +1 -1
- package/dist/accordion/accordion2.js +5 -5
- package/dist/alert/alert-group2.js +2 -2
- package/dist/alert/alert2.js +2 -2
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar.examples.js.map +1 -1
- package/dist/avatar/avatar.examples.json +1 -1
- package/dist/avatar/avatar2.js +2 -2
- package/dist/badge/badge2.js +2 -2
- package/dist/breadcrumb/breadcrumb2.js +2 -2
- package/dist/bundles/index.d.ts +6 -17
- package/dist/bundles/index.js +6 -6
- package/dist/button/button2.js +2 -2
- package/dist/button-group/button-group2.js +2 -2
- package/dist/card/card.examples.js.map +1 -1
- package/dist/card/card.examples.json +1 -1
- package/dist/card/card2.js +5 -5
- package/dist/chat-message/chat-message.d.ts +0 -2
- package/dist/chat-message/chat-message2.js +2 -2
- package/dist/chat-message/chat-message2.js.map +1 -1
- package/dist/checkbox/checkbox-group2.js +2 -2
- package/dist/checkbox/checkbox2.js +2 -2
- package/dist/color/color2.js +2 -2
- package/dist/combobox/combobox2.js +8 -8
- package/dist/copy-button/copy-button2.js +2 -2
- package/dist/custom-elements.json +155 -720
- package/dist/data.html.json +26 -3
- package/dist/data.snippets.json +27 -27
- package/dist/date/date2.js +2 -2
- package/dist/datetime/datetime2.js +2 -2
- package/dist/dialog/dialog-footer2.js +2 -2
- package/dist/dialog/dialog-header2.js +2 -2
- package/dist/dialog/dialog2.js +2 -2
- package/dist/divider/divider2.js +2 -2
- package/dist/dot/dot2.js +2 -2
- package/dist/drawer/drawer-content2.js +2 -2
- package/dist/drawer/drawer-footer2.js +2 -2
- package/dist/drawer/drawer-header2.js +2 -2
- package/dist/drawer/drawer2.js +2 -2
- package/dist/dropdown/dropdown-footer2.js +2 -2
- package/dist/dropdown/dropdown-header2.js +2 -2
- package/dist/dropdown/dropdown2.js +2 -2
- package/dist/dropdown-group/dropdown-group.d.ts +0 -1
- package/dist/dropdown-group/dropdown-group.js +2 -2
- package/dist/dropdown-group/dropdown-group.js.map +1 -1
- package/dist/dropzone/dropzone.d.ts +0 -1
- package/dist/dropzone/dropzone2.js +2 -2
- package/dist/dropzone/dropzone2.js.map +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/format-datetime/format-datetime.d.ts +1 -0
- package/dist/format-datetime/format-datetime2.js +2 -2
- package/dist/format-datetime/format-datetime2.js.map +1 -1
- package/dist/format-number/format-number.d.ts +1 -0
- package/dist/format-number/format-number2.js +2 -2
- package/dist/format-number/format-number2.js.map +1 -1
- package/dist/format-relative-time/format-relative-time.d.ts +1 -0
- package/dist/format-relative-time/format-relative-time2.js +6 -3
- package/dist/format-relative-time/format-relative-time2.js.map +1 -1
- package/dist/forms/control/control.js +1 -1
- package/dist/forms/control/control.js.map +1 -1
- package/dist/forms/control/control2.js +39 -21
- package/dist/forms/control/control2.js.map +1 -1
- package/dist/forms/control-group/control-group.js +1 -1
- package/dist/forms/control-group/control-group.js.map +1 -1
- package/dist/forms/control-group/control-group2.js +2 -2
- package/dist/forms/control-group/control-group2.js.map +1 -1
- package/dist/forms/control-message/control-message2.js +2 -2
- package/dist/forms/utils/states.d.ts +6 -3
- package/dist/forms/utils/states.js +40 -32
- package/dist/forms/utils/states.js.map +1 -1
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/column/column2.js +2 -2
- package/dist/grid/footer/footer2.js +2 -2
- package/dist/grid/grid2.js +2 -2
- package/dist/grid/header/header2.js +2 -2
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/row/row2.js +2 -2
- package/dist/icon/icon2.js +3 -3
- package/dist/icon-button/icon-button2.js +2 -2
- package/dist/index.js +1 -1
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +2 -2
- package/dist/internal/controllers/keynav-grid.controller.js +22 -18
- package/dist/internal/controllers/keynav-grid.controller.js.map +1 -1
- package/dist/internal/controllers/keynav-list.controller.d.ts +1 -0
- package/dist/internal/controllers/keynav-list.controller.js +6 -1
- package/dist/internal/controllers/keynav-list.controller.js.map +1 -1
- package/dist/internal/controllers/type-native-popover.controller.js +70 -40
- package/dist/internal/controllers/type-native-popover.controller.js.map +1 -1
- package/dist/internal/index.d.ts +0 -9
- package/dist/internal/index.js +20 -29
- package/dist/internal/services/global.service.js +1 -1
- package/dist/internal/services/log.service.js +1 -1
- package/dist/internal/services/log.service.js.map +1 -1
- package/dist/internal/types/index.d.ts +3 -0
- package/dist/internal/types/index.js.map +1 -1
- package/dist/internal/utils/dom.d.ts +1 -1
- package/dist/internal/utils/dom.js +71 -54
- package/dist/internal/utils/dom.js.map +1 -1
- package/dist/logo/logo2.js +2 -2
- package/dist/menu/menu-item2.js +2 -2
- package/dist/menu/menu2.js +2 -2
- package/dist/month/month2.js +2 -2
- package/dist/notification/notification-group2.js +2 -2
- package/dist/notification/notification2.js +2 -2
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +2 -2
- package/dist/page/page-panel/page-panel-header2.js +2 -2
- package/dist/page/page-panel/page-panel2.js +2 -2
- package/dist/page/page.examples.js.map +1 -1
- package/dist/page/page.examples.json +1 -1
- package/dist/page/page2.js +2 -2
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-loader/page-loader2.js +2 -2
- package/dist/pagination/pagination2.js +2 -2
- package/dist/panel/panel2.js +5 -5
- package/dist/password/password2.js +2 -2
- package/dist/preferences-input/preferences-input.js +1 -1
- package/dist/preferences-input/preferences-input.js.map +1 -1
- package/dist/preferences-input/preferences-input2.js +2 -2
- package/dist/progress-bar/progress-bar2.js +2 -2
- package/dist/progress-ring/progress-ring2.js +2 -2
- package/dist/progressive-filter-chip/progressive-filter-chip.examples.js.map +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip.examples.json +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +2 -2
- package/dist/pulse/pulse2.js +2 -2
- package/dist/radio/radio-group2.js +2 -2
- package/dist/radio/radio2.js +2 -2
- package/dist/range/range2.js +2 -2
- package/dist/resize-handle/resize-handle2.js +2 -2
- package/dist/search/search2.js +2 -2
- package/dist/select/select2.js +35 -21
- package/dist/select/select2.js.map +1 -1
- package/dist/skeleton/skeleton2.js +2 -2
- package/dist/sort-button/sort-button2.js +2 -2
- package/dist/sparkline/sparkline.utils.js +4 -2
- package/dist/sparkline/sparkline.utils.js.map +1 -1
- package/dist/sparkline/sparkline2.js +2 -2
- package/dist/star-rating/star-rating2.js +2 -2
- package/dist/steps/steps2.js +3 -3
- package/dist/switch/switch-group2.js +2 -2
- package/dist/switch/switch2.js +2 -2
- package/dist/tabs/tabs-group2.js +2 -2
- package/dist/tabs/tabs.examples.js.map +1 -1
- package/dist/tabs/tabs.examples.json +1 -1
- package/dist/tabs/tabs2.js +3 -3
- package/dist/tag/tag2.js +2 -2
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +2 -2
- package/dist/toast/toast2.js +2 -2
- package/dist/toggletip/toggletip-footer.d.ts +1 -1
- package/dist/toggletip/toggletip-footer2.js +2 -2
- package/dist/toggletip/toggletip-footer2.js.map +1 -1
- package/dist/toggletip/toggletip-header.d.ts +1 -1
- package/dist/toggletip/toggletip-header2.js +2 -2
- package/dist/toggletip/toggletip-header2.js.map +1 -1
- package/dist/toggletip/toggletip2.js +2 -2
- package/dist/toolbar/toolbar2.js +2 -2
- package/dist/tooltip/tooltip2.js +2 -2
- package/dist/tree/tree-node2.js +2 -2
- package/dist/tree/tree2.js +2 -2
- package/dist/week/week2.js +2 -2
- package/package.json +8 -8
- package/dist/internal/controllers/state-active.controller.d.ts +0 -18
- package/dist/internal/controllers/state-active.controller.js +0 -29
- package/dist/internal/controllers/state-active.controller.js.map +0 -1
- package/dist/internal/controllers/state-current.controller.d.ts +0 -18
- package/dist/internal/controllers/state-current.controller.js +0 -28
- package/dist/internal/controllers/state-current.controller.js.map +0 -1
- package/dist/internal/controllers/state-disabled.controller.d.ts +0 -18
- package/dist/internal/controllers/state-disabled.controller.js +0 -20
- package/dist/internal/controllers/state-disabled.controller.js.map +0 -1
- package/dist/internal/controllers/state-pressed.controller.d.ts +0 -18
- package/dist/internal/controllers/state-pressed.controller.js +0 -20
- package/dist/internal/controllers/state-pressed.controller.js.map +0 -1
- package/dist/internal/controllers/type-button.controller.d.ts +0 -18
- package/dist/internal/controllers/type-button.controller.examples.js +0 -6
- package/dist/internal/controllers/type-button.controller.examples.js.map +0 -1
- package/dist/internal/controllers/type-button.controller.examples.json +0 -16
- package/dist/internal/controllers/type-button.controller.js +0 -21
- package/dist/internal/controllers/type-button.controller.js.map +0 -1
- package/dist/internal/controllers/type-command.controller.d.ts +0 -25
- package/dist/internal/controllers/type-command.controller.js +0 -38
- package/dist/internal/controllers/type-command.controller.js.map +0 -1
- package/dist/internal/controllers/type-interest.controller.d.ts +0 -23
- package/dist/internal/controllers/type-interest.controller.js +0 -51
- package/dist/internal/controllers/type-interest.controller.js.map +0 -1
- package/dist/internal/controllers/type-native-popover-trigger.controller.d.ts +0 -16
- package/dist/internal/controllers/type-native-popover-trigger.controller.js +0 -25
- package/dist/internal/controllers/type-native-popover-trigger.controller.js.map +0 -1
- package/dist/internal/controllers/type-submit.controller.d.ts +0 -22
- package/dist/internal/controllers/type-submit.controller.js +0 -49
- package/dist/internal/controllers/type-submit.controller.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences-input.js","names":[],"sources":["../../src/preferences-input/preferences-input.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --color: var(--nve-sys-interaction-color);\n display: block;\n width: fit-content;\n}\n\n[internal-host] {\n color: var(--color);\n display: flex;\n gap: var(--nve-ref-space-sm);\n flex-direction: column;\n}\n\nnve-menu {\n --width: 100%;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"preferences-input.js","names":[],"sources":["../../src/preferences-input/preferences-input.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --color: var(--nve-sys-interaction-color);\n display: block;\n width: fit-content;\n}\n\n[internal-host] {\n color: var(--color);\n display: flex;\n gap: var(--nve-ref-space-sm);\n flex-direction: column;\n}\n\nnve-control,\nnve-switch {\n --label-text-transform: capitalize;\n}\n\nnve-menu {\n --width: 100%;\n}\n"],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { I18nController as e } from "../internal/controllers/i18n.controller.js";
|
|
2
2
|
import { scopedRegistry as t } from "../internal/decorators/scoped-registry.js";
|
|
3
3
|
import { useStyles as n } from "../internal/styles/index.js";
|
|
4
|
-
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.
|
|
4
|
+
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
5
5
|
import { Icon as i } from "../icon/icon2.js";
|
|
6
6
|
import { Control as a } from "../forms/control/control2.js";
|
|
7
7
|
import { Switch as o } from "../switch/switch2.js";
|
|
@@ -43,7 +43,7 @@ var x = class extends g(d) {
|
|
|
43
43
|
static {
|
|
44
44
|
this.metadata = {
|
|
45
45
|
tag: "nve-preferences-input",
|
|
46
|
-
version: "2.0.
|
|
46
|
+
version: "2.0.3",
|
|
47
47
|
valueSchema: {
|
|
48
48
|
type: "object",
|
|
49
49
|
properties: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { scopedRegistry as e } from "../internal/decorators/scoped-registry.js";
|
|
2
2
|
import { useStyles as t } from "../internal/styles/index.js";
|
|
3
|
-
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
4
4
|
import r from "./progress-bar.js";
|
|
5
5
|
import { LitElement as i, html as a } from "lit";
|
|
6
6
|
import { property as o } from "lit/decorators/property.js";
|
|
@@ -16,7 +16,7 @@ var c = class extends i {
|
|
|
16
16
|
static {
|
|
17
17
|
this.metadata = {
|
|
18
18
|
tag: "nve-progress-bar",
|
|
19
|
-
version: "2.0.
|
|
19
|
+
version: "2.0.3"
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
@@ -3,7 +3,7 @@ import { attachInternals as t } from "../internal/utils/a11y.js";
|
|
|
3
3
|
import { scopedRegistry as n } from "../internal/decorators/scoped-registry.js";
|
|
4
4
|
import { useStyles as r } from "../internal/styles/index.js";
|
|
5
5
|
import { statusIcons as i } from "../internal/types/index.js";
|
|
6
|
-
import { __decorate as a } from "../_virtual/_@oxc-project_runtime@0.
|
|
6
|
+
import { __decorate as a } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
7
7
|
import { Icon as o } from "../icon/icon2.js";
|
|
8
8
|
import s from "./progress-ring.js";
|
|
9
9
|
import { LitElement as c, html as l } from "lit";
|
|
@@ -19,7 +19,7 @@ var d = class extends c {
|
|
|
19
19
|
static {
|
|
20
20
|
this.metadata = {
|
|
21
21
|
tag: "nve-progress-ring",
|
|
22
|
-
version: "2.0.
|
|
22
|
+
version: "2.0.3"
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
static {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressive-filter-chip.examples.js","names":[],"sources":["../../src/progressive-filter-chip/progressive-filter-chip.examples.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 '@nvidia-elements/core/progressive-filter-chip/define.js';\nimport '@nvidia-elements/core/input/define.js';\nimport '@nvidia-elements/core/card/define.js';\nimport '@nvidia-elements/core/select/define.js';\n\nexport default {\n title: 'Elements/Progressive Filter Chip',\n component: 'nve-progressive-filter-chip',\n};\n\n/**\n * @summary Basic progressive filter chip with cascading select dropdowns for multi-criteria filtering.\n */\nexport const Default = {\n render: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option>workload</option>\n <option selected>instance</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option>sort by</option>\n <option selected>filter by</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"filter\">\n <option selected>utilization</option>\n <option>status</option>\n </select>\n </nve-select>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with proper layer stacking within dropdown contexts.\n */\nexport const Layer = {\n render: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option>workload</option>\n <option selected>instance</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option>sort by</option>\n <option selected>filter by</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"filter\">\n <option selected>utilization</option>\n <option>status</option>\n </select>\n </nve-select>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with multi-select dropdown for filtering by many values simultaneously.\n */\nexport const Multiple = {\nrender: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option selected>status</option>\n <option>workload</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option selected>filter by</option>\n <option>sort by</option>\n </select>\n </nve-select>\n <nve-select>\n <select multiple aria-label=\"filter\">\n <option selected>progress</option>\n <option>pending</option>\n <option>success</option>\n <option>failed</option>\n </select>\n </nve-select>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with numeric text input for threshold-based filtering (greater than, less than).\n */\nexport const TextInput = {\n render: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option selected>memory</option>\n <option>CPU</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option selected>greater than</option>\n <option>less than</option>\n <option>equal to</option>\n </select>\n </nve-select>\n <nve-input>\n <input type=\"number\" min=\"0\" max=\"100\" value=\"50\" aria-label=\"filter\" />\n </nve-input>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with date picker inputs for filtering by date range criteria.\n */\nexport const DateRange = {\n render: () => html`\n <nve-progressive-filter-chip>\n <nve-select>\n <select aria-label=\"date type\">\n <option>recording date</option>\n <option>process date</option>\n </select>\n </nve-select>\n <nve-date>\n <input type=\"date\" value=\"2022-05-11\" aria-label=\"start date\" />\n </nve-date>\n <nve-date>\n <input type=\"date\" value=\"2022-12-07\" aria-label=\"end date\" />\n </nve-date>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with custom button trigger opening a map coordinate picker dropdown.\n */\nexport const Custom = {\n render: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option>GPS</option>\n <option selected>Cellular</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option>contains</option>\n <option>excludes</option>\n </select>\n </nve-select>\n <nve-button style=\"width: 190px\" popovertarget=\"map-dropdown\">37.3706254,-121.9671894</nve-button>\n </nve-progressive-filter-chip>\n <nve-dropdown id=\"map-dropdown\">\n <nve-input>\n <nve-icon-button icon-name=\"map-pin\" readonly></nve-icon-button>\n <input value=\"37.3706254,-121.9671894\" disabled aria-label=\"map coordinates\" />\n </nve-input>\n <img src=\"static/images/test-map-2.webp\" width=\"300px\" alt=\"non-interactive demo map\" />\n </nve-dropdown>\n `\n}\n\n/**\n * @summary Progressive filter chip with input validation states showing required field and error styling.\n */\nexport const Validation = {\n render: () => html`\n<div nve-layout=\"column gap:lg\">\n <nve-progressive-filter-chip closable>\n <nve-input>\n <input type=\"text\" value=\"validation\" required aria-label=\"validation\" />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n </nve-input>\n <nve-input>\n <input type=\"text\" aria-label=\"validation\" />\n </nve-input>\n </nve-progressive-filter-chip>\n\n <nve-progressive-filter-chip closable>\n <nve-input status=\"error\">\n <input type=\"text\" value=\"manual validation\" formnovalidate aria-label=\"manual validation\" />\n </nve-input>\n <nve-input>\n <input type=\"text\" aria-label=\"validation\" />\n </nve-input>\n </nve-progressive-filter-chip>\n</div>\n `\n}\n"],"mappings":";AAGA,IAAA,IAAS"}
|
|
1
|
+
{"version":3,"file":"progressive-filter-chip.examples.js","names":[],"sources":["../../src/progressive-filter-chip/progressive-filter-chip.examples.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 '@nvidia-elements/core/progressive-filter-chip/define.js';\nimport '@nvidia-elements/core/input/define.js';\nimport '@nvidia-elements/core/card/define.js';\nimport '@nvidia-elements/core/select/define.js';\n\nexport default {\n title: 'Elements/Progressive Filter Chip',\n component: 'nve-progressive-filter-chip',\n};\n\n/**\n * @summary Basic progressive filter chip with cascading select dropdowns for multi-criteria filtering.\n */\nexport const Default = {\n render: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option>workload</option>\n <option selected>instance</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option>sort by</option>\n <option selected>filter by</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"filter\">\n <option selected>utilization</option>\n <option>status</option>\n </select>\n </nve-select>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with proper layer stacking within dropdown contexts.\n */\nexport const Layer = {\n render: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option>workload</option>\n <option selected>instance</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option>sort by</option>\n <option selected>filter by</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"filter\">\n <option selected>utilization</option>\n <option>status</option>\n </select>\n </nve-select>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with multi-select dropdown for filtering by many values simultaneously.\n */\nexport const Multiple = {\nrender: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option selected>status</option>\n <option>workload</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option selected>filter by</option>\n <option>sort by</option>\n </select>\n </nve-select>\n <nve-select>\n <select multiple aria-label=\"filter\">\n <option selected>progress</option>\n <option>pending</option>\n <option>success</option>\n <option>failed</option>\n </select>\n </nve-select>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with numeric text input for threshold-based filtering (greater than, less than).\n */\nexport const TextInput = {\n render: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option selected>memory</option>\n <option>CPU</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option selected>greater than</option>\n <option>less than</option>\n <option>equal to</option>\n </select>\n </nve-select>\n <nve-input>\n <input type=\"number\" min=\"0\" max=\"100\" value=\"50\" aria-label=\"filter\" />\n </nve-input>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with date picker inputs for filtering by date range criteria.\n */\nexport const DateRange = {\n render: () => html`\n <nve-progressive-filter-chip>\n <nve-select>\n <select aria-label=\"date type\">\n <option>recording date</option>\n <option>process date</option>\n </select>\n </nve-select>\n <nve-date>\n <input type=\"date\" value=\"2022-05-11\" aria-label=\"start date\" />\n </nve-date>\n <nve-date>\n <input type=\"date\" value=\"2022-12-07\" aria-label=\"end date\" />\n </nve-date>\n </nve-progressive-filter-chip>\n `\n}\n\n/**\n * @summary Progressive filter chip with custom button trigger opening a map coordinate picker dropdown.\n */\nexport const Custom = {\n render: () => html`\n <nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option>GPS</option>\n <option selected>Cellular</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option>contains</option>\n <option>excludes</option>\n </select>\n </nve-select>\n <nve-button style=\"width: 190px\" popovertarget=\"map-dropdown\">37.3706254,-121.9671894</nve-button>\n </nve-progressive-filter-chip>\n <nve-dropdown id=\"map-dropdown\">\n <nve-input>\n <nve-icon-button icon-name=\"map-pin\" readonly></nve-icon-button>\n <input value=\"37.3706254,-121.9671894\" disabled aria-label=\"map coordinates\" />\n </nve-input>\n <img src=\"/static/images/test-map-2.webp\" width=\"300px\" alt=\"non-interactive demo map\" />\n </nve-dropdown>\n `\n}\n\n/**\n * @summary Progressive filter chip with input validation states showing required field and error styling.\n */\nexport const Validation = {\n render: () => html`\n<div nve-layout=\"column gap:lg\">\n <nve-progressive-filter-chip closable>\n <nve-input>\n <input type=\"text\" value=\"validation\" required aria-label=\"validation\" />\n <nve-control-message error=\"valueMissing\">required</nve-control-message>\n </nve-input>\n <nve-input>\n <input type=\"text\" aria-label=\"validation\" />\n </nve-input>\n </nve-progressive-filter-chip>\n\n <nve-progressive-filter-chip closable>\n <nve-input status=\"error\">\n <input type=\"text\" value=\"manual validation\" formnovalidate aria-label=\"manual validation\" />\n </nve-input>\n <nve-input>\n <input type=\"text\" aria-label=\"validation\" />\n </nve-input>\n </nve-progressive-filter-chip>\n</div>\n `\n}\n"],"mappings":";AAGA,IAAA,IAAS"}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
{
|
|
51
51
|
"id": "progressive-filter-chip-custom",
|
|
52
52
|
"name": "Custom",
|
|
53
|
-
"template": "<nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option>GPS</option>\n <option selected>Cellular</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option>contains</option>\n <option>excludes</option>\n </select>\n </nve-select>\n <nve-button style=\"width: 190px\" popovertarget=\"map-dropdown\">37.3706254,-121.9671894</nve-button>\n</nve-progressive-filter-chip>\n<nve-dropdown id=\"map-dropdown\">\n <nve-input>\n <nve-icon-button icon-name=\"map-pin\" readonly></nve-icon-button>\n <input value=\"37.3706254,-121.9671894\" disabled aria-label=\"map coordinates\" />\n </nve-input>\n <img src=\"static/images/test-map-2.webp\" width=\"300px\" alt=\"non-interactive demo map\" />\n</nve-dropdown>\n",
|
|
53
|
+
"template": "<nve-progressive-filter-chip closable>\n <nve-select>\n <select aria-label=\"dataset\">\n <option>GPS</option>\n <option selected>Cellular</option>\n </select>\n </nve-select>\n <nve-select>\n <select aria-label=\"condition\">\n <option>contains</option>\n <option>excludes</option>\n </select>\n </nve-select>\n <nve-button style=\"width: 190px\" popovertarget=\"map-dropdown\">37.3706254,-121.9671894</nve-button>\n</nve-progressive-filter-chip>\n<nve-dropdown id=\"map-dropdown\">\n <nve-input>\n <nve-icon-button icon-name=\"map-pin\" readonly></nve-icon-button>\n <input value=\"37.3706254,-121.9671894\" disabled aria-label=\"map coordinates\" />\n </nve-input>\n <img src=\"/static/images/test-map-2.webp\" width=\"300px\" alt=\"non-interactive demo map\" />\n</nve-dropdown>\n",
|
|
54
54
|
"summary": "Progressive filter chip with custom button trigger opening a map coordinate picker dropdown.",
|
|
55
55
|
"description": "",
|
|
56
56
|
"composition": true,
|
|
@@ -5,7 +5,7 @@ import { TypeClosableController as i } from "../internal/controllers/type-closab
|
|
|
5
5
|
import { typeSSR as a } from "../internal/controllers/type-ssr.controller.js";
|
|
6
6
|
import { scopedRegistry as o } from "../internal/decorators/scoped-registry.js";
|
|
7
7
|
import { useStyles as s } from "../internal/styles/index.js";
|
|
8
|
-
import { __decorate as c } from "../_virtual/_@oxc-project_runtime@0.
|
|
8
|
+
import { __decorate as c } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
9
9
|
import { IconButton as l } from "../icon-button/icon-button2.js";
|
|
10
10
|
import { Input as u } from "../input/input2.js";
|
|
11
11
|
import { Select as d } from "../select/select2.js";
|
|
@@ -23,7 +23,7 @@ var b = class extends h {
|
|
|
23
23
|
static {
|
|
24
24
|
this.metadata = {
|
|
25
25
|
tag: "nve-progressive-filter-chip",
|
|
26
|
-
version: "2.0.
|
|
26
|
+
version: "2.0.3"
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
static {
|
package/dist/pulse/pulse2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { attachInternals as e } from "../internal/utils/a11y.js";
|
|
2
2
|
import { useStyles as t } from "../internal/styles/index.js";
|
|
3
|
-
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
4
4
|
import { Icon as r } from "../icon/icon2.js";
|
|
5
5
|
import i from "./pulse.js";
|
|
6
6
|
import { LitElement as a, html as o } from "lit";
|
|
@@ -13,7 +13,7 @@ var c = class extends a {
|
|
|
13
13
|
static {
|
|
14
14
|
this.metadata = {
|
|
15
15
|
tag: "nve-pulse",
|
|
16
|
-
version: "2.0.
|
|
16
|
+
version: "2.0.3"
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
static {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { audit as e } from "../internal/controllers/audit.controller.js";
|
|
2
2
|
import { typeSSR as t } from "../internal/controllers/type-ssr.controller.js";
|
|
3
3
|
import { useStyles as n } from "../internal/styles/index.js";
|
|
4
|
-
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.
|
|
4
|
+
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
5
5
|
import { ControlGroup as i } from "../forms/control-group/control-group2.js";
|
|
6
6
|
import a from "./radio-group.js";
|
|
7
7
|
//#region src/radio/radio-group.ts
|
|
@@ -12,7 +12,7 @@ var o = class extends i {
|
|
|
12
12
|
static {
|
|
13
13
|
this.metadata = {
|
|
14
14
|
tag: "nve-radio-group",
|
|
15
|
-
version: "2.0.
|
|
15
|
+
version: "2.0.3",
|
|
16
16
|
children: [
|
|
17
17
|
"label",
|
|
18
18
|
"nve-control-message",
|
package/dist/radio/radio2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
3
|
import { useStyles as n } from "../internal/styles/index.js";
|
|
4
|
-
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.
|
|
4
|
+
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
5
5
|
import { Control as i } from "../forms/control/control2.js";
|
|
6
6
|
import a from "./radio.js";
|
|
7
7
|
//#region src/radio/radio.ts
|
|
@@ -15,7 +15,7 @@ var o = class extends i {
|
|
|
15
15
|
static {
|
|
16
16
|
this.metadata = {
|
|
17
17
|
tag: "nve-radio",
|
|
18
|
-
version: "2.0.
|
|
18
|
+
version: "2.0.3",
|
|
19
19
|
children: [
|
|
20
20
|
"label",
|
|
21
21
|
"input",
|
package/dist/range/range2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { appendRootNodeStyle as e, getElementUpdate as t } from "../internal/utils/dom.js";
|
|
2
2
|
import { useStyles as n } from "../internal/styles/index.js";
|
|
3
|
-
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
4
4
|
import { Control as i } from "../forms/control/control2.js";
|
|
5
5
|
import a from "./range.global.js";
|
|
6
6
|
import o from "./range.js";
|
|
@@ -17,7 +17,7 @@ var d = class extends i {
|
|
|
17
17
|
static {
|
|
18
18
|
this.metadata = {
|
|
19
19
|
tag: "nve-range",
|
|
20
|
-
version: "2.0.
|
|
20
|
+
version: "2.0.3"
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
connectedCallback() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { I18nController as e } from "../internal/controllers/i18n.controller.js";
|
|
2
2
|
import { typeTouch as t } from "../internal/controllers/type-touch.controller.js";
|
|
3
3
|
import { useStyles as n } from "../internal/styles/index.js";
|
|
4
|
-
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.
|
|
4
|
+
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
5
5
|
import i from "./resize-handle.js";
|
|
6
6
|
import { LitElement as a, html as o } from "lit";
|
|
7
7
|
import { property as s } from "lit/decorators/property.js";
|
|
@@ -18,7 +18,7 @@ var u = class extends c(a) {
|
|
|
18
18
|
static {
|
|
19
19
|
this.metadata = {
|
|
20
20
|
tag: "nve-resize-handle",
|
|
21
|
-
version: "2.0.
|
|
21
|
+
version: "2.0.3",
|
|
22
22
|
valueSchema: { type: "number" }
|
|
23
23
|
};
|
|
24
24
|
}
|
package/dist/search/search2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { scopedRegistry as e } from "../internal/decorators/scoped-registry.js";
|
|
2
2
|
import { useStyles as t } from "../internal/styles/index.js";
|
|
3
|
-
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
4
4
|
import { Control as r } from "../forms/control/control2.js";
|
|
5
5
|
import { IconButton as i } from "../icon-button/icon-button2.js";
|
|
6
6
|
import { inputStyles as a } from "../input/input2.js";
|
|
@@ -22,7 +22,7 @@ var l = class extends r {
|
|
|
22
22
|
static {
|
|
23
23
|
this.metadata = {
|
|
24
24
|
tag: "nve-search",
|
|
25
|
-
version: "2.0.
|
|
25
|
+
version: "2.0.3"
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
static {
|
package/dist/select/select2.js
CHANGED
|
@@ -4,7 +4,7 @@ import { focusElementTimeout as r, onListboxActivate as i } from "../internal/ut
|
|
|
4
4
|
import { appendRootNodeStyle as a, getElementUpdate as o } from "../internal/utils/dom.js";
|
|
5
5
|
import { scopedRegistry as s } from "../internal/decorators/scoped-registry.js";
|
|
6
6
|
import { useStyles as c } from "../internal/styles/index.js";
|
|
7
|
-
import { __decorate as l } from "../_virtual/_@oxc-project_runtime@0.
|
|
7
|
+
import { __decorate as l } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
8
8
|
import { Icon as u } from "../icon/icon2.js";
|
|
9
9
|
import { Control as d } from "../forms/control/control2.js";
|
|
10
10
|
import { Tag as f } from "../tag/tag2.js";
|
|
@@ -19,7 +19,7 @@ import { ifDefined as x } from "lit/directives/if-defined.js";
|
|
|
19
19
|
//#region src/select/select.ts
|
|
20
20
|
var S = class extends d {
|
|
21
21
|
constructor(...t) {
|
|
22
|
-
super(...t), this.#e = new e(this), this.i18n = this.#e.i18n, this.#l = [], this.#p = /* @__PURE__ */ new
|
|
22
|
+
super(...t), this.#e = new e(this), this.i18n = this.#e.i18n, this.#l = [], this.#p = /* @__PURE__ */ new Map();
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
25
|
this.styles = c([...d.styles, g]);
|
|
@@ -27,7 +27,7 @@ var S = class extends d {
|
|
|
27
27
|
static {
|
|
28
28
|
this.metadata = {
|
|
29
29
|
tag: "nve-select",
|
|
30
|
-
version: "2.0.
|
|
30
|
+
version: "2.0.3"
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
static {
|
|
@@ -70,57 +70,71 @@ var S = class extends d {
|
|
|
70
70
|
return v`<div class="tags-label ${e ? "placeholder" : ""}" aria-hidden="true">${t}</div>`;
|
|
71
71
|
}
|
|
72
72
|
get prefixContent() {
|
|
73
|
-
return this.#t?.multiple && this.#t?.size === 0 ? v`${this.#u}<div class="tags">${this.#n.filter((e) => e.selected && e !== this.#c).map((e) => v`<nve-tag part="tag" readonly="readonly" color="gray-slate" closable .value="${e.value}" @click="${() => this.#
|
|
73
|
+
return this.#t?.multiple && this.#t?.size === 0 ? v`${this.#u}<div class="tags">${this.#n.filter((e) => e.selected && e !== this.#c).map((e) => v`<nve-tag part="tag" readonly="readonly" color="gray-slate" closable .value="${e.value}" @click="${() => this.#x(e, !1)}">${e.textContent}</nve-tag>`)}</div>` : y;
|
|
74
74
|
}
|
|
75
75
|
get #d() {
|
|
76
|
-
return v`<nve-menu part="menu" role="listbox" style="--width:100%;--min-width:fit-content" aria-label="${x(this.i18n.select)}">${this.#n.filter((e) => e !== this.#c).map((e, t) => v`<nve-menu-item part="menu-item" role="option" @click="${() => this.#
|
|
76
|
+
return v`<nve-menu part="menu" role="listbox" style="--width:100%;--min-width:fit-content" aria-label="${x(this.i18n.select)}">${this.#n.filter((e) => e !== this.#c).map((e, t) => v`<nve-menu-item part="menu-item" role="option" @click="${() => this.#x(e, !e.selected)}" ?selected="${e.selected}" ?disabled="${e.disabled}" ?hidden="${!!e.hidden}" aria-selected="${e.selected}"><slot name="option-${t + 1}"><nve-icon part="icon" name="check" size="sm" aria-hidden="true"></nve-icon>${e.innerText}</slot></nve-menu-item>`)}</nve-menu>`;
|
|
77
77
|
}
|
|
78
78
|
get suffixContent() {
|
|
79
|
-
return this.#t?.size === 0 ? v`<nve-icon name="caret" part="caret" direction="down" size="sm" aria-hidden="true"></nve-icon><nve-dropdown part="dropdown" @close="${this.#
|
|
79
|
+
return this.#t?.size === 0 ? v`<nve-icon name="caret" part="caret" direction="down" size="sm" aria-hidden="true"></nve-icon><nve-dropdown part="dropdown" @close="${this.#y}" @open="${this.#v}" hidden .anchor="${this.#a}" position="bottom">${this.#d}</nve-dropdown>` : this.#d;
|
|
80
80
|
}
|
|
81
81
|
async firstUpdated(e) {
|
|
82
|
-
super.firstUpdated(e), await this.updateComplete, this.#
|
|
82
|
+
super.firstUpdated(e), await this.updateComplete, this.#_();
|
|
83
83
|
}
|
|
84
84
|
#f() {
|
|
85
85
|
this.#l.push(o(this.#t, "value", () => this.requestUpdate()), n(this.#t, () => this.requestUpdate(), {
|
|
86
86
|
attributes: !0,
|
|
87
87
|
subtree: !0
|
|
88
|
-
}), n(this.#t, () => this.#
|
|
88
|
+
}), n(this.#t, () => this.#g(), { subtree: !0 }));
|
|
89
89
|
}
|
|
90
90
|
#p;
|
|
91
91
|
#m() {
|
|
92
|
-
this.#
|
|
93
|
-
|
|
92
|
+
this.#h(), this.#b(), this.#f(), this.#g();
|
|
93
|
+
}
|
|
94
|
+
#h() {
|
|
95
|
+
this.#l.forEach((e) => e.disconnect()), this.#l = [], this.#p.clear();
|
|
96
|
+
}
|
|
97
|
+
#g() {
|
|
98
|
+
let e = new Set(this.#n);
|
|
99
|
+
this.#p.forEach((t, n) => {
|
|
100
|
+
e.has(n) || (t.disconnect(), this.#p.delete(n), this.#l = this.#l.filter((e) => e !== t));
|
|
101
|
+
}), this.#n.forEach((e) => {
|
|
102
|
+
if (!this.#p.has(e)) {
|
|
103
|
+
let t = o(e, "selected", () => this.requestUpdate());
|
|
104
|
+
this.#p.set(e, t), this.#l.push(t);
|
|
105
|
+
}
|
|
94
106
|
});
|
|
95
107
|
}
|
|
96
108
|
connectedCallback() {
|
|
97
|
-
super.connectedCallback(), a(this, _)
|
|
109
|
+
super.connectedCallback(), a(this, _), this.updateComplete.then(() => {
|
|
110
|
+
this.isConnected && this.#m();
|
|
111
|
+
});
|
|
98
112
|
}
|
|
99
113
|
disconnectedCallback() {
|
|
100
|
-
super.disconnectedCallback(), this.#
|
|
114
|
+
super.disconnectedCallback(), this.#h();
|
|
101
115
|
}
|
|
102
116
|
async updated(e) {
|
|
103
|
-
super.updated(e), this.#t?.size && this.#t?.size !== 0
|
|
117
|
+
super.updated(e), this.#t?.size && this.#t?.size !== 0 ? (this._internals.states.add("size"), this.style.setProperty("--size", `${this.#t?.size + .75}`)) : (this._internals.states.delete("size"), this.style.removeProperty("--size")), this.#t?.multiple && this.#t?.size === 0 ? this._internals.states.add("multiple") : this._internals.states.delete("multiple");
|
|
104
118
|
}
|
|
105
|
-
#
|
|
119
|
+
#_() {
|
|
106
120
|
this.#t?.size === 0 && i(this.#t, () => {
|
|
107
121
|
this.requestUpdate(), this.#r.style.setProperty("--min-width", `${this.#a.getBoundingClientRect().width}px`), this.#r.showPopover(), r(this.#i[0]);
|
|
108
122
|
});
|
|
109
123
|
}
|
|
110
|
-
#
|
|
124
|
+
#v() {
|
|
111
125
|
this.#r.hidden = !1, this.#s.direction = "up";
|
|
112
126
|
}
|
|
113
|
-
#
|
|
127
|
+
#y() {
|
|
114
128
|
this.#r.hidden = !0, this.#s.direction = "down";
|
|
115
129
|
}
|
|
116
|
-
#
|
|
117
|
-
let e = new ResizeObserver((e) => this.#
|
|
130
|
+
#b() {
|
|
131
|
+
let e = new ResizeObserver((e) => this.#S(e[0].contentRect.width));
|
|
118
132
|
this.#l.push(e), e.observe(this.#a);
|
|
119
133
|
}
|
|
120
|
-
async #
|
|
121
|
-
(this.#t.multiple || !this.#t.multiple && e.value !== this.#t.value) && (e.selected = t), this.#t.selectedOptions.length < 1 && (this.#t.value = t ? e.value : ""), this.#t.dispatchEvent(new Event("input", { bubbles: !0 })), this.#t.dispatchEvent(new Event("change", { bubbles: !0 })), this.requestUpdate(), !this.#t.multiple && this.#r ? this.#r.hidePopover() : (await this.updateComplete, this.#
|
|
134
|
+
async #x(e, t) {
|
|
135
|
+
(this.#t.multiple || !this.#t.multiple && e.value !== this.#t.value) && (e.selected = t), this.#t.selectedOptions.length < 1 && (this.#t.value = t ? e.value : ""), this.#t.dispatchEvent(new Event("input", { bubbles: !0 })), this.#t.dispatchEvent(new Event("change", { bubbles: !0 })), this.requestUpdate(), !this.#t.multiple && this.#r ? this.#r.hidePopover() : (await this.updateComplete, this.#S(this.#a.getBoundingClientRect().width));
|
|
122
136
|
}
|
|
123
|
-
#
|
|
137
|
+
#S(e) {
|
|
124
138
|
let t = this.#o;
|
|
125
139
|
this.#t?.multiple && t && t.getBoundingClientRect().width > e - 48 ? this._internals.states.add("multiple-overflow") : this._internals.states.delete("multiple-overflow");
|
|
126
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select2.js","names":["#i18nController","#select","#options","#dropdown","#menuItems","#input","#tags","#caret","#placeholderOption","#multipleSelectLabel","#selectValue","#menu","#closeDropdown","#openDropdown","#setupCustomSelectUI","#setupOverflowListener","#syncSelectValueStates","#syncOptionSelectedStates","#observers","#trackedOptions","#updateMultipleOverflow"],"sources":["../../src/select/select.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, nothing } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport {\n focusElementTimeout,\n onListboxActivate,\n useStyles,\n i18n,\n I18nController,\n onChildListMutation,\n getElementUpdate,\n scopedRegistry,\n appendRootNodeStyle\n} from '@nvidia-elements/core/internal';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { Menu, MenuItem } from '@nvidia-elements/core/menu';\nimport { Dropdown } from '@nvidia-elements/core/dropdown';\nimport { Tag } from '@nvidia-elements/core/tag';\nimport styles from './select.css?inline';\nimport globalStyles from './select.global.css?inline';\n\n/**\n * @element nve-select\n * @description A select is a control that enables users to select an option from a list of options.\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/select\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --color\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --border-bottom\n * @cssprop --cursor\n * @cssprop --font-weight\n * @cssprop --text-align\n * @cssprop --scroll-height\n * @cssprop --width\n * @cssprop --control-width\n * @cssprop --max-width\n * @cssprop --min-width\n * @cssprop --box-shadow\n * @cssprop --max-height\n * @cssprop --text-transform\n * @csspart tag\n * @csspart menu - The dropdown menu element\n * @csspart menu-item - The menu item elements\n * @csspart icon - The icon element\n * @csspart caret - The caret/chevron icon element\n * @csspart dropdown - The dropdown popup element\n * @slot - Select input element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select\n */\n@i18n<Select>()\n@scopedRegistry()\nexport class Select extends Control {\n static styles = useStyles([...Control.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-select',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon,\n [Dropdown.metadata.tag]: Dropdown,\n [Menu.metadata.tag]: Menu,\n [MenuItem.metadata.tag]: MenuItem,\n [Tag.metadata.tag]: Tag\n };\n\n /** Flat container option applies when embedding the component within another containing element */\n @property({ type: String, reflect: true }) container?: 'flat' | 'inline';\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /** Updates internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n get #select() {\n return this.input as unknown as HTMLSelectElement;\n }\n\n get #options() {\n return Array.from(this.#select?.options ? this.#select.options : []);\n }\n\n get #dropdown() {\n return this.shadowRoot!.querySelector<Dropdown>(Dropdown.metadata.tag);\n }\n\n get #menuItems() {\n return this.shadowRoot!.querySelectorAll<MenuItem>(MenuItem.metadata.tag);\n }\n\n get #input() {\n return this.shadowRoot!.querySelector<HTMLElement>('[input]');\n }\n\n get #tags() {\n return this.shadowRoot!.querySelector('.tags');\n }\n\n get #caret() {\n return this.shadowRoot!.querySelector<Icon>('[name=\"caret\"]');\n }\n\n get #placeholderOption() {\n return this.#options.find(o => o.selected && o.hidden && o.disabled);\n }\n\n #observers: (MutationObserver | ResizeObserver)[] = [];\n\n get #multipleSelectLabel() {\n const option = this.#placeholderOption;\n const label = option ? option.innerText : `${this.#select.selectedOptions.length} ${this.i18n.selected}`;\n return html`<div class=\"tags-label ${option ? 'placeholder' : ''}\" aria-hidden=\"true\">${label}</div>`;\n }\n\n protected get prefixContent() {\n return this.#select?.multiple && this.#select?.size === 0\n ? html`\n ${this.#multipleSelectLabel}\n <div class=\"tags\">\n ${this.#options\n .filter(o => o.selected && o !== this.#placeholderOption)\n .map(\n o => html`\n <nve-tag part=\"tag\" readonly color=\"gray-slate\" closable .value=${o.value} @click=${() => this.#selectValue(o, false)}>${o.textContent}</nve-tag>`\n )}\n </div>`\n : nothing;\n }\n\n get #menu() {\n return html`\n <nve-menu part=\"menu\" role=\"listbox\" style=\"--width: 100%; --min-width: fit-content\" aria-label=${ifDefined(this.i18n.select)}>\n ${this.#options\n .filter(o => o !== this.#placeholderOption)\n .map(\n (o, i) => html`\n <nve-menu-item part=\"menu-item\" role=\"option\" @click=${() => this.#selectValue(o, !o.selected)} ?selected=${o.selected} ?disabled=${o.disabled} ?hidden=${!!o.hidden} aria-selected=${o.selected}>\n <slot name=\"option-${i + 1}\">\n <nve-icon part=\"icon\" name=\"check\" size=\"sm\" aria-hidden=\"true\"></nve-icon> ${o.innerText}\n </slot>\n </nve-menu-item>`\n )}\n </nve-menu>`;\n }\n\n protected get suffixContent() {\n return this.#select?.size === 0\n ? html`\n <nve-icon name=\"caret\" part=\"caret\" direction=\"down\" size=\"sm\" aria-hidden=\"true\"></nve-icon>\n <nve-dropdown part=\"dropdown\" @close=${this.#closeDropdown} @open=${this.#openDropdown} hidden .anchor=${this.#input as HTMLElement} position=\"bottom\">\n ${this.#menu}\n </nve-dropdown>`\n : this.#menu;\n }\n\n async firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n await this.updateComplete;\n this.#setupCustomSelectUI();\n this.#setupOverflowListener();\n this.#syncSelectValueStates();\n this.#syncOptionSelectedStates();\n }\n\n #syncSelectValueStates() {\n this.#observers.push(\n getElementUpdate(this.#select, 'value', () => this.requestUpdate()),\n onChildListMutation(this.#select, () => this.requestUpdate(), { attributes: true, subtree: true }),\n onChildListMutation(this.#select, () => this.#syncOptionSelectedStates(), { subtree: true })\n );\n }\n\n #trackedOptions = new Set();\n #syncOptionSelectedStates() {\n this.#options.forEach(o => {\n if (!this.#trackedOptions.has(o)) {\n this.#trackedOptions.add(o);\n this.#observers.push(getElementUpdate(o, 'selected', () => this.requestUpdate()));\n }\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n appendRootNodeStyle(this, globalStyles);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#observers.forEach(observer => observer.disconnect());\n }\n\n async updated(props: PropertyValues<this>) {\n super.updated(props);\n if (this.#select?.size && this.#select?.size !== 0) {\n this._internals.states.add('size');\n this.style.setProperty('--size', `${this.#select?.size + 0.75}`);\n }\n\n if (this.#select?.multiple && this.#select?.size === 0) {\n this._internals.states.add('multiple');\n }\n }\n\n #setupCustomSelectUI() {\n if (this.#select?.size === 0) {\n onListboxActivate(this.#select, () => {\n this.requestUpdate(); // update menu items\n this.#dropdown!.style.setProperty('--min-width', `${this.#input!.getBoundingClientRect().width}px`);\n this.#dropdown!.showPopover();\n focusElementTimeout(this.#menuItems[0] as HTMLElement);\n });\n }\n }\n\n #openDropdown() {\n this.#dropdown!.hidden = false;\n this.#caret!.direction = 'up';\n }\n\n #closeDropdown() {\n this.#dropdown!.hidden = true;\n this.#caret!.direction = 'down';\n }\n\n #setupOverflowListener() {\n const observer = new ResizeObserver(entries => this.#updateMultipleOverflow(entries[0]!.contentRect.width));\n this.#observers.push(observer);\n observer.observe(this.#input!);\n }\n\n async #selectValue(option: HTMLOptionElement, selected: boolean) {\n if (this.#select.multiple || (!this.#select.multiple && option.value !== this.#select.value)) {\n option.selected = selected;\n }\n\n // native select only the first selected option determines the select input value\n if (this.#select.selectedOptions.length < 1) {\n this.#select.value = selected ? option.value : '';\n }\n\n this.#select.dispatchEvent(new Event('input', { bubbles: true }));\n this.#select.dispatchEvent(new Event('change', { bubbles: true }));\n this.requestUpdate();\n\n if (!this.#select.multiple && this.#dropdown) {\n this.#dropdown.hidePopover();\n } else {\n await this.updateComplete;\n this.#updateMultipleOverflow(this.#input!.getBoundingClientRect().width);\n }\n }\n\n #updateMultipleOverflow(width: number) {\n const tags = this.#tags;\n if (this.#select?.multiple && tags && tags.getBoundingClientRect().width > width - 48) {\n this._internals.states.add('multiple-overflow');\n } else {\n this._internals.states.delete('multiple-overflow');\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6DO,IAAA,IAAA,cAAqB,EAAQ;;yBAmBM,IAAI,EAAqB,IAAI,eAGlC,KAAKA,GAAgB,gBAkCJ,CAAC,6BAkEnC,IAAI,IAAI;;;gBAzHV,EAAU,CAAC,GAAG,EAAQ,QAAQ,CAAM,CAAC;;;kBAE1B;GACzB,KAAK;GACL,SAAS;EACX;;;4BAE4B;IACzB,EAAK,SAAS,MAAM;IACpB,EAAS,SAAS,MAAM;IACxB,EAAK,SAAS,MAAM;IACpB,EAAS,SAAS,MAAM;IACxB,EAAI,SAAS,MAAM;EACtB;;CAKA;CAKA,IAAIC,KAAU;EACZ,OAAO,KAAK;CACd;CAEA,IAAIC,KAAW;EACb,OAAO,MAAM,KAAK,KAAKD,IAAS,UAAU,KAAKA,GAAQ,UAAU,CAAC,CAAC;CACrE;CAEA,IAAIE,KAAY;EACd,OAAO,KAAK,WAAY,cAAwB,EAAS,SAAS,GAAG;CACvE;CAEA,IAAIC,KAAa;EACf,OAAO,KAAK,WAAY,iBAA2B,EAAS,SAAS,GAAG;CAC1E;CAEA,IAAIC,KAAS;EACX,OAAO,KAAK,WAAY,cAA2B,SAAS;CAC9D;CAEA,IAAIC,KAAQ;EACV,OAAO,KAAK,WAAY,cAAc,OAAO;CAC/C;CAEA,IAAIC,KAAS;EACX,OAAO,KAAK,WAAY,cAAoB,kBAAgB;CAC9D;CAEA,IAAIC,KAAqB;EACvB,OAAO,KAAKN,GAAS,MAAK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,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"select2.js","names":["#i18nController","#select","#options","#dropdown","#menuItems","#input","#tags","#caret","#placeholderOption","#multipleSelectLabel","#selectValue","#menu","#closeDropdown","#openDropdown","#setupCustomSelectUI","#observers","#syncOptionSelectedStates","#disconnectObservers","#setupOverflowListener","#syncSelectValueStates","#optionObservers","#setupObservers","#updateMultipleOverflow"],"sources":["../../src/select/select.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, nothing } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport {\n focusElementTimeout,\n onListboxActivate,\n useStyles,\n i18n,\n I18nController,\n onChildListMutation,\n getElementUpdate,\n scopedRegistry,\n appendRootNodeStyle\n} from '@nvidia-elements/core/internal';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { Icon } from '@nvidia-elements/core/icon';\nimport { Menu, MenuItem } from '@nvidia-elements/core/menu';\nimport { Dropdown } from '@nvidia-elements/core/dropdown';\nimport { Tag } from '@nvidia-elements/core/tag';\nimport styles from './select.css?inline';\nimport globalStyles from './select.global.css?inline';\n\n/**\n * @element nve-select\n * @description A select is a control that enables users to select an option from a list of options.\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/select\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --color\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --border-bottom\n * @cssprop --cursor\n * @cssprop --font-weight\n * @cssprop --text-align\n * @cssprop --scroll-height\n * @cssprop --width\n * @cssprop --control-width\n * @cssprop --max-width\n * @cssprop --min-width\n * @cssprop --box-shadow\n * @cssprop --max-height\n * @cssprop --text-transform\n * @csspart tag\n * @csspart menu - The dropdown menu element\n * @csspart menu-item - The menu item elements\n * @csspart icon - The icon element\n * @csspart caret - The caret/chevron icon element\n * @csspart dropdown - The dropdown popup element\n * @slot - Select input element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select\n */\n@i18n<Select>()\n@scopedRegistry()\nexport class Select extends Control {\n static styles = useStyles([...Control.styles, styles]);\n\n static readonly metadata = {\n tag: 'nve-select',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon,\n [Dropdown.metadata.tag]: Dropdown,\n [Menu.metadata.tag]: Menu,\n [MenuItem.metadata.tag]: MenuItem,\n [Tag.metadata.tag]: Tag\n };\n\n /** Flat container option applies when embedding the component within another containing element */\n @property({ type: String, reflect: true }) container?: 'flat' | 'inline';\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /** Updates internal string values for internationalization. */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n get #select() {\n return this.input as unknown as HTMLSelectElement;\n }\n\n get #options() {\n return Array.from(this.#select?.options ? this.#select.options : []);\n }\n\n get #dropdown() {\n return this.shadowRoot!.querySelector<Dropdown>(Dropdown.metadata.tag);\n }\n\n get #menuItems() {\n return this.shadowRoot!.querySelectorAll<MenuItem>(MenuItem.metadata.tag);\n }\n\n get #input() {\n return this.shadowRoot!.querySelector<HTMLElement>('[input]');\n }\n\n get #tags() {\n return this.shadowRoot!.querySelector('.tags');\n }\n\n get #caret() {\n return this.shadowRoot!.querySelector<Icon>('[name=\"caret\"]');\n }\n\n get #placeholderOption() {\n return this.#options.find(o => o.selected && o.hidden && o.disabled);\n }\n\n #observers: (MutationObserver | ResizeObserver)[] = [];\n\n get #multipleSelectLabel() {\n const option = this.#placeholderOption;\n const label = option ? option.innerText : `${this.#select.selectedOptions.length} ${this.i18n.selected}`;\n return html`<div class=\"tags-label ${option ? 'placeholder' : ''}\" aria-hidden=\"true\">${label}</div>`;\n }\n\n protected get prefixContent() {\n return this.#select?.multiple && this.#select?.size === 0\n ? html`\n ${this.#multipleSelectLabel}\n <div class=\"tags\">\n ${this.#options\n .filter(o => o.selected && o !== this.#placeholderOption)\n .map(\n o => html`\n <nve-tag part=\"tag\" readonly color=\"gray-slate\" closable .value=${o.value} @click=${() => this.#selectValue(o, false)}>${o.textContent}</nve-tag>`\n )}\n </div>`\n : nothing;\n }\n\n get #menu() {\n return html`\n <nve-menu part=\"menu\" role=\"listbox\" style=\"--width: 100%; --min-width: fit-content\" aria-label=${ifDefined(this.i18n.select)}>\n ${this.#options\n .filter(o => o !== this.#placeholderOption)\n .map(\n (o, i) => html`\n <nve-menu-item part=\"menu-item\" role=\"option\" @click=${() => this.#selectValue(o, !o.selected)} ?selected=${o.selected} ?disabled=${o.disabled} ?hidden=${!!o.hidden} aria-selected=${o.selected}>\n <slot name=\"option-${i + 1}\">\n <nve-icon part=\"icon\" name=\"check\" size=\"sm\" aria-hidden=\"true\"></nve-icon> ${o.innerText}\n </slot>\n </nve-menu-item>`\n )}\n </nve-menu>`;\n }\n\n protected get suffixContent() {\n return this.#select?.size === 0\n ? html`\n <nve-icon name=\"caret\" part=\"caret\" direction=\"down\" size=\"sm\" aria-hidden=\"true\"></nve-icon>\n <nve-dropdown part=\"dropdown\" @close=${this.#closeDropdown} @open=${this.#openDropdown} hidden .anchor=${this.#input as HTMLElement} position=\"bottom\">\n ${this.#menu}\n </nve-dropdown>`\n : this.#menu;\n }\n\n async firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n await this.updateComplete;\n this.#setupCustomSelectUI();\n }\n\n #syncSelectValueStates() {\n this.#observers.push(\n getElementUpdate(this.#select, 'value', () => this.requestUpdate()),\n onChildListMutation(this.#select, () => this.requestUpdate(), { attributes: true, subtree: true }),\n onChildListMutation(this.#select, () => this.#syncOptionSelectedStates(), { subtree: true })\n );\n }\n\n #optionObservers = new Map<HTMLOptionElement, MutationObserver>();\n\n #setupObservers() {\n this.#disconnectObservers();\n this.#setupOverflowListener();\n this.#syncSelectValueStates();\n this.#syncOptionSelectedStates();\n }\n\n #disconnectObservers() {\n this.#observers.forEach(observer => observer.disconnect());\n this.#observers = [];\n this.#optionObservers.clear();\n }\n\n #syncOptionSelectedStates() {\n const options = new Set(this.#options);\n\n this.#optionObservers.forEach((observer, option) => {\n if (!options.has(option)) {\n observer.disconnect();\n this.#optionObservers.delete(option);\n this.#observers = this.#observers.filter(o => o !== observer);\n }\n });\n\n this.#options.forEach(o => {\n if (!this.#optionObservers.has(o)) {\n const observer = getElementUpdate(o, 'selected', () => this.requestUpdate());\n this.#optionObservers.set(o, observer);\n this.#observers.push(observer);\n }\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n appendRootNodeStyle(this, globalStyles);\n void this.updateComplete.then(() => {\n if (this.isConnected) {\n this.#setupObservers();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.#disconnectObservers();\n }\n\n async updated(props: PropertyValues<this>) {\n super.updated(props);\n if (this.#select?.size && this.#select?.size !== 0) {\n this._internals.states.add('size');\n this.style.setProperty('--size', `${this.#select?.size + 0.75}`);\n } else {\n this._internals.states.delete('size');\n this.style.removeProperty('--size');\n }\n\n if (this.#select?.multiple && this.#select?.size === 0) {\n this._internals.states.add('multiple');\n } else {\n this._internals.states.delete('multiple');\n }\n }\n\n #setupCustomSelectUI() {\n if (this.#select?.size === 0) {\n onListboxActivate(this.#select, () => {\n this.requestUpdate(); // update menu items\n this.#dropdown!.style.setProperty('--min-width', `${this.#input!.getBoundingClientRect().width}px`);\n this.#dropdown!.showPopover();\n focusElementTimeout(this.#menuItems[0] as HTMLElement);\n });\n }\n }\n\n #openDropdown() {\n this.#dropdown!.hidden = false;\n this.#caret!.direction = 'up';\n }\n\n #closeDropdown() {\n this.#dropdown!.hidden = true;\n this.#caret!.direction = 'down';\n }\n\n #setupOverflowListener() {\n const observer = new ResizeObserver(entries => this.#updateMultipleOverflow(entries[0]!.contentRect.width));\n this.#observers.push(observer);\n observer.observe(this.#input!);\n }\n\n async #selectValue(option: HTMLOptionElement, selected: boolean) {\n if (this.#select.multiple || (!this.#select.multiple && option.value !== this.#select.value)) {\n option.selected = selected;\n }\n\n // native select only the first selected option determines the select input value\n if (this.#select.selectedOptions.length < 1) {\n this.#select.value = selected ? option.value : '';\n }\n\n this.#select.dispatchEvent(new Event('input', { bubbles: true }));\n this.#select.dispatchEvent(new Event('change', { bubbles: true }));\n this.requestUpdate();\n\n if (!this.#select.multiple && this.#dropdown) {\n this.#dropdown.hidePopover();\n } else {\n await this.updateComplete;\n this.#updateMultipleOverflow(this.#input!.getBoundingClientRect().width);\n }\n }\n\n #updateMultipleOverflow(width: number) {\n const tags = this.#tags;\n if (this.#select?.multiple && tags && tags.getBoundingClientRect().width > width - 48) {\n this._internals.states.add('multiple-overflow');\n } else {\n this._internals.states.delete('multiple-overflow');\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6DO,IAAA,IAAA,cAAqB,EAAQ;;yBAmBM,IAAI,EAAqB,IAAI,eAGlC,KAAKA,GAAgB,gBAkCJ,CAAC,6BA+DlC,IAAI,IAAyC;;;gBAtHhD,EAAU,CAAC,GAAG,EAAQ,QAAQ,CAAM,CAAC;;;kBAE1B;GACzB,KAAK;GACL,SAAS;EACX;;;4BAE4B;IACzB,EAAK,SAAS,MAAM;IACpB,EAAS,SAAS,MAAM;IACxB,EAAK,SAAS,MAAM;IACpB,EAAS,SAAS,MAAM;IACxB,EAAI,SAAS,MAAM;EACtB;;CAKA;CAKA,IAAIC,KAAU;EACZ,OAAO,KAAK;CACd;CAEA,IAAIC,KAAW;EACb,OAAO,MAAM,KAAK,KAAKD,IAAS,UAAU,KAAKA,GAAQ,UAAU,CAAC,CAAC;CACrE;CAEA,IAAIE,KAAY;EACd,OAAO,KAAK,WAAY,cAAwB,EAAS,SAAS,GAAG;CACvE;CAEA,IAAIC,KAAa;EACf,OAAO,KAAK,WAAY,iBAA2B,EAAS,SAAS,GAAG;CAC1E;CAEA,IAAIC,KAAS;EACX,OAAO,KAAK,WAAY,cAA2B,SAAS;CAC9D;CAEA,IAAIC,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AAgB,SAAS,MACxC,KAAKA,GAAQ,QAAQ,IAAW,EAAO,QAAQ,KAGjD,KAAKA,GAAQ,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,GAAK,CAAC,CAAC,GAChE,KAAKA,GAAQ,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,GAAK,CAAC,CAAC,GACjE,KAAK,cAAc,GAEf,CAAC,KAAKA,GAAQ,YAAY,KAAKE,KACjC,KAAKA,GAAU,YAAY,KAE3B,MAAM,KAAK,gBACX,KAAKmB,GAAwB,KAAKjB,GAAQ,sBAAsB,EAAE,KAAK;CAE3E;CAEA,GAAwB,GAAe;EACrC,IAAM,IAAO,KAAKC;EAClB,AAAI,KAAKL,IAAS,YAAY,KAAQ,EAAK,sBAAsB,EAAE,QAAQ,IAAQ,KACjF,KAAK,WAAW,OAAO,IAAI,mBAAmB,IAE9C,KAAK,WAAW,OAAO,OAAO,mBAAmB;CAErD;AACF;GAlOG,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,MAKxC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,UAxB3B,EAAa,GACb,EAAe,CAAA,GAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { attachInternals as e } from "../internal/utils/a11y.js";
|
|
2
2
|
import { useStyles as t } from "../internal/styles/index.js";
|
|
3
|
-
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as n } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
4
4
|
import r from "./skeleton.js";
|
|
5
5
|
import { LitElement as i, html as a } from "lit";
|
|
6
6
|
import { property as o } from "lit/decorators/property.js";
|
|
@@ -15,7 +15,7 @@ var s = class extends i {
|
|
|
15
15
|
static {
|
|
16
16
|
this.metadata = {
|
|
17
17
|
tag: "nve-skeleton",
|
|
18
|
-
version: "2.0.
|
|
18
|
+
version: "2.0.3"
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { I18nController as e } from "../internal/controllers/i18n.controller.js";
|
|
2
2
|
import { scopedRegistry as t } from "../internal/decorators/scoped-registry.js";
|
|
3
3
|
import { useStyles as n } from "../internal/styles/index.js";
|
|
4
|
-
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.
|
|
4
|
+
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
5
5
|
import { Icon as i } from "../icon/icon2.js";
|
|
6
6
|
import a from "./sort-button.js";
|
|
7
7
|
import { LitElement as o, html as s } from "lit";
|
|
@@ -19,7 +19,7 @@ var u = {
|
|
|
19
19
|
static {
|
|
20
20
|
this.metadata = {
|
|
21
21
|
tag: "nve-sort-button",
|
|
22
|
-
version: "2.0.
|
|
22
|
+
version: "2.0.3"
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
static {
|
|
@@ -54,7 +54,7 @@ function d(e, t, n) {
|
|
|
54
54
|
case "step": return _(e);
|
|
55
55
|
case "smooth": return g(e);
|
|
56
56
|
case "linear": return h(e);
|
|
57
|
-
default:
|
|
57
|
+
default: return h(e);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function f(e, t, n = 100) {
|
|
@@ -70,7 +70,9 @@ function f(e, t, n = 100) {
|
|
|
70
70
|
case "linear":
|
|
71
71
|
r = h(e);
|
|
72
72
|
break;
|
|
73
|
-
default:
|
|
73
|
+
default:
|
|
74
|
+
r = h(e);
|
|
75
|
+
break;
|
|
74
76
|
}
|
|
75
77
|
let i = e[e.length - 1], a = e[0];
|
|
76
78
|
return r += ` L ${i.x.toFixed(2)} ${n.toFixed(2)}`, r += ` L ${a.x.toFixed(2)} ${n.toFixed(2)} Z`, r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sparkline.utils.js","names":[],"sources":["../../src/sparkline/sparkline.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Dimensions, Interpolation, Point, Rect, Scale, SparklineMark } from '@nvidia-elements/core/internal';\n\nexport const PRECISION = 2;\nexport const VIEW_HEIGHT = 100;\nconst DEFAULT_INTERVAL_LENGTH_EM = 0.6;\n\nconst HORIZONTAL_UNIT_WIDTH = VIEW_HEIGHT * DEFAULT_INTERVAL_LENGTH_EM;\nconst COLUMN_GAP_RATIO = 0.7;\nconst WINLOSS_GAP_RATIO = 0.85;\n\nexport function toValidData(data: unknown): number[] {\n if (!Array.isArray(data)) return [];\n return data.filter(Number.isFinite);\n}\n\nexport function calculateViewBox(\n mark: SparklineMark,\n pointCount: number,\n intervalLength = DEFAULT_INTERVAL_LENGTH_EM\n): Dimensions {\n const isIntervalBased = mark === 'line' || mark === 'area' || mark === 'gradient';\n const widthUnitCount = isIntervalBased ? Math.max(pointCount - 1, 1) : pointCount;\n const normalizedIntervalLength =\n Number.isFinite(intervalLength) && intervalLength > 0 ? intervalLength : DEFAULT_INTERVAL_LENGTH_EM;\n const width =\n mark === 'line' ? widthUnitCount * VIEW_HEIGHT * normalizedIntervalLength : widthUnitCount * HORIZONTAL_UNIT_WIDTH;\n\n return {\n width,\n height: VIEW_HEIGHT\n };\n}\n\nexport function calculateDomain(\n values: number[],\n options: { explicitMin?: number; explicitMax?: number; includeZero?: boolean } = {}\n): Scale | undefined {\n if (values.length === 0) return undefined;\n const { explicitMin, explicitMax, includeZero = false } = options;\n\n const dataMinimum = Math.min(...values);\n const dataMaximum = Math.max(...values);\n\n return {\n min: explicitMin ?? (includeZero ? Math.min(dataMinimum, 0) : dataMinimum),\n max: explicitMax ?? (includeZero ? Math.max(dataMaximum, 0) : dataMaximum)\n };\n}\n\nexport function valueToY(value: number, range: { min: number; max: number }, viewHeight = VIEW_HEIGHT): number {\n const span = range.max - range.min;\n if (span === 0) return viewHeight / 2;\n return viewHeight - ((value - range.min) / span) * viewHeight;\n}\n\nexport function toPlotPoints(\n values: number[],\n range: { min: number; max: number },\n view: { width: number; height?: number }\n): Point[] {\n const viewHeight = view.height ?? VIEW_HEIGHT;\n const stepX = values.length > 1 ? view.width / (values.length - 1) : 0;\n return values.map((value, index) => ({\n x: index * stepX,\n y: valueToY(value, range, viewHeight)\n }));\n}\n\nexport function calculateSymbolIndices(\n values: number[],\n denote: { first: boolean; last: boolean; min: boolean; max: boolean }\n): Set<number> {\n const indices = new Set<number>();\n if (values.length === 0) return indices;\n\n if (denote.first) indices.add(0);\n if (denote.last) indices.add(values.length - 1);\n\n const needsExtrema = denote.min || denote.max;\n if (!needsExtrema) return indices;\n\n const min = Math.min(...values);\n const max = Math.max(...values);\n\n values.forEach((value, index) => {\n if (denote.min && value === min) indices.add(index);\n if (denote.max && value === max) indices.add(index);\n });\n\n return indices;\n}\n\nexport function toInterpolation(interpolation: unknown): Interpolation {\n switch (interpolation) {\n case 'linear':\n return 'linear';\n case 'smooth':\n return 'smooth';\n case 'step':\n return 'step';\n default: {\n return 'linear';\n }\n }\n}\n\nexport function toLinePath(points: Point[], interpolation: Interpolation, viewWidth: number): string {\n if (points.length === 0) return '';\n if (points.length === 1) {\n const y = points[0]!.y.toFixed(PRECISION);\n return `M 0 ${y} L ${viewWidth.toFixed(PRECISION)} ${y}`;\n }\n\n switch (interpolation) {\n case 'step':\n return toStepOpenPath(points);\n case 'smooth':\n return toSmoothOpenPath(points);\n case 'linear':\n return toLinearOpenPath(points);\n default: {\n const exhaustiveCheck: never = interpolation;\n throw new Error(`Unhandled interpolation: ${exhaustiveCheck}`);\n }\n }\n}\n\nexport function toAreaPath(points: Point[], interpolation: Interpolation, viewHeight = VIEW_HEIGHT): string {\n if (points.length === 0) return '';\n\n let openPath = '';\n switch (interpolation) {\n case 'step':\n openPath = toStepOpenPath(points);\n break;\n case 'smooth':\n openPath = toSmoothOpenPath(points);\n break;\n case 'linear':\n openPath = toLinearOpenPath(points);\n break;\n default: {\n const exhaustiveCheck: never = interpolation;\n throw new Error(`Unhandled interpolation: ${exhaustiveCheck}`);\n }\n }\n\n const last = points[points.length - 1]!;\n const first = points[0]!;\n openPath += ` L ${last.x.toFixed(PRECISION)} ${viewHeight.toFixed(PRECISION)}`;\n openPath += ` L ${first.x.toFixed(PRECISION)} ${viewHeight.toFixed(PRECISION)} Z`;\n return openPath;\n}\n\nexport function toColumnRects(points: Point[], baselineY: number, width: number): Rect[] {\n const { bandSize: bandWidth, stepSize: stepX } = calculateBandSizing(points.length, width, COLUMN_GAP_RATIO);\n\n return points.map((point, index) => {\n const x = index * stepX + (stepX - bandWidth) / 2;\n const height = Math.abs(point.y - baselineY);\n const y = Math.min(point.y, baselineY);\n return { x, y, width: bandWidth, height };\n });\n}\n\nexport function toWinLossRects(\n values: number[],\n baselineY: number,\n dimensions: { width: number; height: number }\n): (Rect & { className: 'win' | 'loss' | 'draw' })[] {\n const { bandSize: bandWidth, stepSize: stepX } = calculateBandSizing(\n values.length,\n dimensions.width,\n WINLOSS_GAP_RATIO\n );\n const barHeight = dimensions.height / 2;\n\n return values.map((value, index) => {\n const x = index * stepX + (stepX - bandWidth) / 2;\n\n if (value > 0) {\n return { className: 'win', x, y: baselineY - barHeight, width: bandWidth, height: barHeight };\n }\n\n if (value < 0) {\n return { className: 'loss', x, y: baselineY, width: bandWidth, height: barHeight };\n }\n\n return {\n className: 'draw',\n x,\n y: baselineY - barHeight / 4,\n width: bandWidth,\n height: barHeight / 2\n };\n });\n}\n\nfunction toLinearOpenPath(points: Point[]): string {\n return points.reduce((path, point, index) => {\n if (index === 0) {\n return `M ${point.x.toFixed(PRECISION)} ${point.y.toFixed(PRECISION)}`;\n }\n return `${path} L ${point.x.toFixed(PRECISION)} ${point.y.toFixed(PRECISION)}`;\n }, '');\n}\n\nfunction toSmoothOpenPath(points: Point[]): string {\n const segments = points.map((point, index) => {\n if (index === 0) {\n return `M ${point.x.toFixed(PRECISION)} ${point.y.toFixed(PRECISION)}`;\n }\n const previous = points[index - 1]!;\n const deltaX = (point.x - previous.x) / 3;\n const p = PRECISION;\n return `C ${(previous.x + deltaX).toFixed(p)} ${previous.y.toFixed(p)} ${(point.x - deltaX).toFixed(p)} ${point.y.toFixed(p)} ${point.x.toFixed(p)} ${point.y.toFixed(p)}`;\n });\n return segments.join(' ');\n}\n\nfunction toStepOpenPath(points: Point[]): string {\n let path = `M ${points[0]!.x.toFixed(PRECISION)} ${points[0]!.y.toFixed(PRECISION)}`;\n for (let index = 1; index < points.length; index++) {\n const point = points[index]!;\n path += ` H ${point.x.toFixed(PRECISION)} V ${point.y.toFixed(PRECISION)}`;\n }\n return path;\n}\n\nfunction calculateBandSizing(count: number, viewDimension: number, gapRatio: number) {\n if (count <= 0) return { bandSize: 0, stepSize: 0 };\n\n const stepSize = viewDimension / count;\n const bandSize = stepSize * gapRatio;\n return { bandSize, stepSize };\n}\n"],"mappings":"AAOA,IAAM,IAA6B,IAE7B,IAAA,MAAsC,GACtC,IAAmB,IACnB,IAAoB;AAE1B,SAAgB,EAAY,GAAyB;CAEnD,OADK,MAAM,QAAQ,CAAI,IAChB,EAAK,OAAO,OAAO,QAAQ,IADD,CAAC;AAEpC;AAEA,SAAgB,EACd,GACA,GACA,IAAiB,GACL;CAEZ,IAAM,IADkB,MAAS,UAAU,MAAS,UAAU,MAAS,aAC9B,KAAK,IAAI,IAAa,GAAG,CAAC,IAAI,GACjE,IACJ,OAAO,SAAS,CAAc,KAAK,IAAiB,IAAI,IAAiB;CAI3E,OAAO;EACL,OAHA,MAAS,SAAS,IAAA,MAA+B,IAA2B,IAAiB;EAI7F,QAAA;CACF;AACF;AAEA,SAAgB,EACd,GACA,IAAiF,CAAC,GAC/D;CACnB,IAAI,EAAO,WAAW,GAAG;CACzB,IAAM,EAAE,gBAAa,gBAAa,iBAAc,OAAU,GAEpD,IAAc,KAAK,IAAI,GAAG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EAAe,GAAyB;CAC/C,IAAI,IAAO,KAAK,EAAO,GAAI,EAAE,QAAA,CAAiB,EAAE,GAAG,EAAO,GAAI,EAAE,QAAA,CAAiB;CACjF,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAO,QAAQ,KAAS;EAClD,IAAM,IAAQ,EAAO;EACrB,KAAQ,MAAM,EAAM,EAAE,QAAA,CAAiB,EAAE,KAAK,EAAM,EAAE,QAAA,CAAiB;CACzE;CACA,OAAO;AACT;AAEA,SAAS,EAAoB,GAAe,GAAuB,GAAkB;CACnF,IAAI,KAAS,GAAG,OAAO;EAAE,UAAU;EAAG,UAAU;CAAE;CAElD,IAAM,IAAW,IAAgB;CAEjC,OAAO;EAAE,UADQ,IAAW;EACT;CAAS;AAC9B"}
|
|
1
|
+
{"version":3,"file":"sparkline.utils.js","names":[],"sources":["../../src/sparkline/sparkline.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Dimensions, Interpolation, Point, Rect, Scale, SparklineMark } from '@nvidia-elements/core/internal';\n\nexport const PRECISION = 2;\nexport const VIEW_HEIGHT = 100;\nconst DEFAULT_INTERVAL_LENGTH_EM = 0.6;\n\nconst HORIZONTAL_UNIT_WIDTH = VIEW_HEIGHT * DEFAULT_INTERVAL_LENGTH_EM;\nconst COLUMN_GAP_RATIO = 0.7;\nconst WINLOSS_GAP_RATIO = 0.85;\n\nexport function toValidData(data: unknown): number[] {\n if (!Array.isArray(data)) return [];\n return data.filter(Number.isFinite);\n}\n\nexport function calculateViewBox(\n mark: SparklineMark,\n pointCount: number,\n intervalLength = DEFAULT_INTERVAL_LENGTH_EM\n): Dimensions {\n const isIntervalBased = mark === 'line' || mark === 'area' || mark === 'gradient';\n const widthUnitCount = isIntervalBased ? Math.max(pointCount - 1, 1) : pointCount;\n const normalizedIntervalLength =\n Number.isFinite(intervalLength) && intervalLength > 0 ? intervalLength : DEFAULT_INTERVAL_LENGTH_EM;\n const width =\n mark === 'line' ? widthUnitCount * VIEW_HEIGHT * normalizedIntervalLength : widthUnitCount * HORIZONTAL_UNIT_WIDTH;\n\n return {\n width,\n height: VIEW_HEIGHT\n };\n}\n\nexport function calculateDomain(\n values: number[],\n options: { explicitMin?: number; explicitMax?: number; includeZero?: boolean } = {}\n): Scale | undefined {\n if (values.length === 0) return undefined;\n const { explicitMin, explicitMax, includeZero = false } = options;\n\n const dataMinimum = Math.min(...values);\n const dataMaximum = Math.max(...values);\n\n return {\n min: explicitMin ?? (includeZero ? Math.min(dataMinimum, 0) : dataMinimum),\n max: explicitMax ?? (includeZero ? Math.max(dataMaximum, 0) : dataMaximum)\n };\n}\n\nexport function valueToY(value: number, range: { min: number; max: number }, viewHeight = VIEW_HEIGHT): number {\n const span = range.max - range.min;\n if (span === 0) return viewHeight / 2;\n return viewHeight - ((value - range.min) / span) * viewHeight;\n}\n\nexport function toPlotPoints(\n values: number[],\n range: { min: number; max: number },\n view: { width: number; height?: number }\n): Point[] {\n const viewHeight = view.height ?? VIEW_HEIGHT;\n const stepX = values.length > 1 ? view.width / (values.length - 1) : 0;\n return values.map((value, index) => ({\n x: index * stepX,\n y: valueToY(value, range, viewHeight)\n }));\n}\n\nexport function calculateSymbolIndices(\n values: number[],\n denote: { first: boolean; last: boolean; min: boolean; max: boolean }\n): Set<number> {\n const indices = new Set<number>();\n if (values.length === 0) return indices;\n\n if (denote.first) indices.add(0);\n if (denote.last) indices.add(values.length - 1);\n\n const needsExtrema = denote.min || denote.max;\n if (!needsExtrema) return indices;\n\n const min = Math.min(...values);\n const max = Math.max(...values);\n\n values.forEach((value, index) => {\n if (denote.min && value === min) indices.add(index);\n if (denote.max && value === max) indices.add(index);\n });\n\n return indices;\n}\n\nexport function toInterpolation(interpolation: unknown): Interpolation {\n switch (interpolation) {\n case 'linear':\n return 'linear';\n case 'smooth':\n return 'smooth';\n case 'step':\n return 'step';\n default: {\n return 'linear';\n }\n }\n}\n\nexport function toLinePath(points: Point[], interpolation: Interpolation, viewWidth: number): string {\n if (points.length === 0) return '';\n if (points.length === 1) {\n const y = points[0]!.y.toFixed(PRECISION);\n return `M 0 ${y} L ${viewWidth.toFixed(PRECISION)} ${y}`;\n }\n\n switch (interpolation) {\n case 'step':\n return toStepOpenPath(points);\n case 'smooth':\n return toSmoothOpenPath(points);\n case 'linear':\n return toLinearOpenPath(points);\n default:\n return toLinearOpenPath(points);\n }\n}\n\nexport function toAreaPath(points: Point[], interpolation: Interpolation, viewHeight = VIEW_HEIGHT): string {\n if (points.length === 0) return '';\n\n let openPath = '';\n switch (interpolation) {\n case 'step':\n openPath = toStepOpenPath(points);\n break;\n case 'smooth':\n openPath = toSmoothOpenPath(points);\n break;\n case 'linear':\n openPath = toLinearOpenPath(points);\n break;\n default:\n openPath = toLinearOpenPath(points);\n break;\n }\n\n const last = points[points.length - 1]!;\n const first = points[0]!;\n openPath += ` L ${last.x.toFixed(PRECISION)} ${viewHeight.toFixed(PRECISION)}`;\n openPath += ` L ${first.x.toFixed(PRECISION)} ${viewHeight.toFixed(PRECISION)} Z`;\n return openPath;\n}\n\nexport function toColumnRects(points: Point[], baselineY: number, width: number): Rect[] {\n const { bandSize: bandWidth, stepSize: stepX } = calculateBandSizing(points.length, width, COLUMN_GAP_RATIO);\n\n return points.map((point, index) => {\n const x = index * stepX + (stepX - bandWidth) / 2;\n const height = Math.abs(point.y - baselineY);\n const y = Math.min(point.y, baselineY);\n return { x, y, width: bandWidth, height };\n });\n}\n\nexport function toWinLossRects(\n values: number[],\n baselineY: number,\n dimensions: { width: number; height: number }\n): (Rect & { className: 'win' | 'loss' | 'draw' })[] {\n const { bandSize: bandWidth, stepSize: stepX } = calculateBandSizing(\n values.length,\n dimensions.width,\n WINLOSS_GAP_RATIO\n );\n const barHeight = dimensions.height / 2;\n\n return values.map((value, index) => {\n const x = index * stepX + (stepX - bandWidth) / 2;\n\n if (value > 0) {\n return { className: 'win', x, y: baselineY - barHeight, width: bandWidth, height: barHeight };\n }\n\n if (value < 0) {\n return { className: 'loss', x, y: baselineY, width: bandWidth, height: barHeight };\n }\n\n return {\n className: 'draw',\n x,\n y: baselineY - barHeight / 4,\n width: bandWidth,\n height: barHeight / 2\n };\n });\n}\n\nfunction toLinearOpenPath(points: Point[]): string {\n return points.reduce((path, point, index) => {\n if (index === 0) {\n return `M ${point.x.toFixed(PRECISION)} ${point.y.toFixed(PRECISION)}`;\n }\n return `${path} L ${point.x.toFixed(PRECISION)} ${point.y.toFixed(PRECISION)}`;\n }, '');\n}\n\nfunction toSmoothOpenPath(points: Point[]): string {\n const segments = points.map((point, index) => {\n if (index === 0) {\n return `M ${point.x.toFixed(PRECISION)} ${point.y.toFixed(PRECISION)}`;\n }\n const previous = points[index - 1]!;\n const deltaX = (point.x - previous.x) / 3;\n const p = PRECISION;\n return `C ${(previous.x + deltaX).toFixed(p)} ${previous.y.toFixed(p)} ${(point.x - deltaX).toFixed(p)} ${point.y.toFixed(p)} ${point.x.toFixed(p)} ${point.y.toFixed(p)}`;\n });\n return segments.join(' ');\n}\n\nfunction toStepOpenPath(points: Point[]): string {\n let path = `M ${points[0]!.x.toFixed(PRECISION)} ${points[0]!.y.toFixed(PRECISION)}`;\n for (let index = 1; index < points.length; index++) {\n const point = points[index]!;\n path += ` H ${point.x.toFixed(PRECISION)} V ${point.y.toFixed(PRECISION)}`;\n }\n return path;\n}\n\nfunction calculateBandSizing(count: number, viewDimension: number, gapRatio: number) {\n if (count <= 0) return { bandSize: 0, stepSize: 0 };\n\n const stepSize = viewDimension / count;\n const bandSize = stepSize * gapRatio;\n return { bandSize, stepSize };\n}\n"],"mappings":"AAOA,IAAM,IAA6B,IAE7B,IAAA,MAAsC,GACtC,IAAmB,IACnB,IAAoB;AAE1B,SAAgB,EAAY,GAAyB;CAEnD,OADK,MAAM,QAAQ,CAAI,IAChB,EAAK,OAAO,OAAO,QAAQ,IADD,CAAC;AAEpC;AAEA,SAAgB,EACd,GAC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G,EAAM,EAAE,QAAA,CAAiB;EAErE,IAAM,IAAW,EAAO,IAAQ,IAC1B,KAAU,EAAM,IAAI,EAAS,KAAK;EAExC,OAAO,MAAM,EAAS,IAAI,GAAQ,QAAQ,CAAC,EAAE,GAAG,EAAS,EAAE,QAAQ,CAAC,EAAE,IAAI,EAAM,IAAI,GAAQ,QAAQ,CAAC,EAAE,GAAG,EAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAM,EAAE,QAAQ,CAAC;CACzK,CACO,EAAS,KAAK,GAAG;AAC1B;AAEA,SAAS,EAAe,GAAyB;CAC/C,IAAI,IAAO,KAAK,EAAO,GAAI,EAAE,QAAA,CAAiB,EAAE,GAAG,EAAO,GAAI,EAAE,QAAA,CAAiB;CACjF,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAO,QAAQ,KAAS;EAClD,IAAM,IAAQ,EAAO;EACrB,KAAQ,MAAM,EAAM,EAAE,QAAA,CAAiB,EAAE,KAAK,EAAM,EAAE,QAAA,CAAiB;CACzE;CACA,OAAO;AACT;AAEA,SAAS,EAAoB,GAAe,GAAuB,GAAkB;CACnF,IAAI,KAAS,GAAG,OAAO;EAAE,UAAU;EAAG,UAAU;CAAE;CAElD,IAAM,IAAW,IAAgB;CAEjC,OAAO;EAAE,UADQ,IAAW;EACT;CAAS;AAC9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { attachInternals as e } from "../internal/utils/a11y.js";
|
|
2
2
|
import { statusStateStyles as t, supportStateStyles as n, useStyles as r } from "../internal/styles/index.js";
|
|
3
|
-
import { __decorate as i } from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import { __decorate as i } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
4
4
|
import { calculateDomain as a, calculateSymbolIndices as o, calculateViewBox as s, toAreaPath as c, toColumnRects as l, toInterpolation as u, toLinePath as d, toPlotPoints as f, toValidData as p, toWinLossRects as m, valueToY as h } from "./sparkline.utils.js";
|
|
5
5
|
import g from "./sparkline.js";
|
|
6
6
|
import { LitElement as _, html as v, nothing as y, svg as b } from "lit";
|
|
@@ -21,7 +21,7 @@ var C = class extends _ {
|
|
|
21
21
|
static {
|
|
22
22
|
this.metadata = {
|
|
23
23
|
tag: "nve-sparkline",
|
|
24
|
-
version: "2.0.
|
|
24
|
+
version: "2.0.3"
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getElementUpdate as e } from "../internal/utils/dom.js";
|
|
2
2
|
import { scopedRegistry as t } from "../internal/decorators/scoped-registry.js";
|
|
3
3
|
import { useStyles as n } from "../internal/styles/index.js";
|
|
4
|
-
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.
|
|
4
|
+
import { __decorate as r } from "../_virtual/_@oxc-project_runtime@0.133.0/helpers/esm/decorate.js";
|
|
5
5
|
import { Icon as i } from "../icon/icon2.js";
|
|
6
6
|
import { Control as a } from "../forms/control/control2.js";
|
|
7
7
|
import o from "./star-rating.js";
|
|
@@ -18,7 +18,7 @@ var l = class extends a {
|
|
|
18
18
|
static {
|
|
19
19
|
this.metadata = {
|
|
20
20
|
tag: "nve-star-rating",
|
|
21
|
-
version: "2.0.
|
|
21
|
+
version: "2.0.3"
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
static {
|