@nvidia-elements/core 2.19.0 → 2.20.0
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 +18 -0
- package/dist/_virtual/_rolldown/runtime.js +17 -0
- package/dist/accordion/accordion2.js +60 -57
- package/dist/accordion/accordion2.js.map +1 -1
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +37 -31
- package/dist/alert/alert2.js.map +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge.d.ts +0 -6
- package/dist/badge/badge2.js +31 -36
- package/dist/badge/badge2.js.map +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundle.d.ts +2 -0
- package/dist/bundles/index.d.ts +153 -27
- package/dist/bundles/index.js +9 -9
- package/dist/button/button2.js +1 -1
- package/dist/button-group/button-group2.js +1 -1
- package/dist/card/card2.js +4 -4
- package/dist/chat-message/chat-message2.js +1 -1
- package/dist/checkbox/checkbox-group2.js +1 -1
- package/dist/checkbox/checkbox2.js +1 -1
- package/dist/color/color.d.ts +2 -0
- package/dist/color/color2.js +7 -4
- package/dist/color/color2.js.map +1 -1
- package/dist/combobox/combobox.d.ts +2 -0
- package/dist/combobox/combobox2.js +14 -6
- package/dist/combobox/combobox2.js.map +1 -1
- package/dist/copy-button/copy-button2.js +26 -23
- package/dist/copy-button/copy-button2.js.map +1 -1
- package/dist/custom-elements-jsx.d.ts +166 -4
- package/dist/custom-elements-vue.d.ts +160 -4
- package/dist/custom-elements.json +1239 -220
- package/dist/data.html.json +117 -10
- package/dist/date/date.d.ts +2 -0
- package/dist/date/date2.js +7 -4
- package/dist/date/date2.js.map +1 -1
- package/dist/datetime/datetime.d.ts +2 -0
- package/dist/datetime/datetime2.js +7 -4
- package/dist/datetime/datetime2.js.map +1 -1
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +27 -27
- package/dist/dialog/dialog2.js.map +1 -1
- package/dist/divider/divider2.js +1 -1
- package/dist/dot/dot2.js +1 -1
- package/dist/drag-handle/drag-handle2.js +1 -1
- package/dist/drawer/drawer-content2.js +1 -1
- package/dist/drawer/drawer-footer2.js +1 -1
- package/dist/drawer/drawer-header2.js +1 -1
- package/dist/drawer/drawer2.js +27 -27
- package/dist/drawer/drawer2.js.map +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +23 -23
- package/dist/dropdown/dropdown2.js.map +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropzone/dropzone2.js +28 -22
- package/dist/dropzone/dropzone2.js.map +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/format-bytes/format-bytes2.js +1 -1
- package/dist/format-datetime/format-datetime2.js +1 -1
- package/dist/format-number/format-number2.js +1 -1
- package/dist/format-relative-time/format-relative-time2.js +1 -1
- package/dist/format-truncate/format-truncate2.js +1 -1
- package/dist/forms/control/control.d.ts +3 -0
- package/dist/forms/control/control2.js +34 -31
- package/dist/forms/control/control2.js.map +1 -1
- package/dist/forms/control-group/control-group2.js +1 -1
- package/dist/forms/control-message/control-message2.js +1 -1
- package/dist/gauge/gauge2.js +26 -21
- package/dist/gauge/gauge2.js.map +1 -1
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/column/column2.js +1 -1
- package/dist/grid/footer/footer2.js +1 -1
- package/dist/grid/grid2.js +1 -1
- package/dist/grid/header/header2.js +1 -1
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/row/row2.js +1 -1
- package/dist/icon/icon2.js +2 -2
- package/dist/icon-button/icon-button2.js +1 -1
- package/dist/iframe/iframe2.js +1 -1
- package/dist/index.js +5 -6
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +1 -1
- package/dist/internal/index.d.ts +1 -2
- package/dist/internal/index.js +150 -33
- package/dist/internal/index.js.map +1 -0
- package/dist/internal/types/index.d.ts +1 -1
- package/dist/internal/types/index.js.map +1 -1
- package/dist/joystick/define.d.ts +6 -0
- package/dist/joystick/define.js +7 -0
- package/dist/joystick/define.js.map +1 -0
- package/dist/joystick/index.d.ts +1 -0
- package/dist/joystick/index.js +2 -0
- package/dist/joystick/joystick.d.ts +126 -0
- package/dist/joystick/joystick.examples.js +6 -0
- package/dist/joystick/joystick.examples.js.map +1 -0
- package/dist/joystick/joystick.examples.json +107 -0
- package/dist/joystick/joystick.js +6 -0
- package/dist/joystick/joystick.js.map +1 -0
- package/dist/joystick/joystick2.js +347 -0
- package/dist/joystick/joystick2.js.map +1 -0
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/menu-group2.js +1 -1
- package/dist/menu/menu-item2.js +1 -1
- package/dist/menu/menu2.js +1 -1
- package/dist/month/month.d.ts +2 -0
- package/dist/month/month2.js +7 -4
- package/dist/month/month2.js.map +1 -1
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +38 -32
- package/dist/notification/notification2.js.map +1 -1
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +1 -1
- package/dist/page/page-panel/page-panel-header2.js +1 -1
- package/dist/page/page-panel/page-panel.d.ts +0 -7
- package/dist/page/page-panel/page-panel2.js +18 -20
- package/dist/page/page-panel/page-panel2.js.map +1 -1
- package/dist/page/page2.js +1 -1
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-loader/page-loader2.js +1 -1
- package/dist/pagination/pagination2.js +45 -38
- package/dist/pagination/pagination2.js.map +1 -1
- package/dist/panel/panel2.js +43 -38
- package/dist/panel/panel2.js.map +1 -1
- package/dist/password/password.d.ts +2 -0
- package/dist/password/password2.js +10 -4
- package/dist/password/password2.js.map +1 -1
- package/dist/preferences-input/preferences-input2.js +32 -27
- package/dist/preferences-input/preferences-input2.js.map +1 -1
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-dot/progress-dot2.js +17 -17
- package/dist/progress-dot/progress-dot2.js.map +1 -1
- package/dist/progress-ring/progress-ring2.js +27 -22
- package/dist/progress-ring/progress-ring2.js.map +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +30 -30
- package/dist/progressive-filter-chip/progressive-filter-chip2.js.map +1 -1
- package/dist/pulse/pulse2.js +1 -1
- package/dist/radio/radio-group2.js +1 -1
- package/dist/radio/radio2.js +1 -1
- package/dist/range/range2.js +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 +1 -1
- package/dist/select/select2.js +44 -41
- package/dist/select/select2.js.map +1 -1
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/sort-button/sort-button2.js +20 -20
- package/dist/sort-button/sort-button2.js.map +1 -1
- package/dist/sparkline/sparkline2.js +1 -1
- package/dist/star-rating/star-rating2.js +1 -1
- package/dist/steps/steps2.js +2 -2
- package/dist/switch/switch-group2.js +1 -1
- package/dist/switch/switch2.js +1 -1
- package/dist/tabs/tabs-group2.js +1 -1
- package/dist/tabs/tabs-item-group2.js +1 -1
- package/dist/tabs/tabs2.js +2 -2
- package/dist/tag/tag2.js +19 -19
- package/dist/tag/tag2.js.map +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time.d.ts +2 -0
- package/dist/time/time2.js +7 -4
- package/dist/time/time2.js.map +1 -1
- package/dist/toast/toast2.js +35 -29
- package/dist/toast/toast2.js.map +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +25 -25
- package/dist/toggletip/toggletip2.js.map +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node2.js +45 -45
- package/dist/tree/tree-node2.js.map +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/week/week.d.ts +2 -0
- package/dist/week/week2.js +7 -4
- package/dist/week/week2.js.map +1 -1
- package/package.json +14 -2
- package/dist/internal/controllers/i18n.controller.d.ts +0 -19
- package/dist/internal/controllers/i18n.controller.examples.js +0 -6
- package/dist/internal/controllers/i18n.controller.examples.js.map +0 -1
- package/dist/internal/controllers/i18n.controller.examples.json +0 -16
- package/dist/internal/controllers/i18n.controller.js +0 -38
- package/dist/internal/controllers/i18n.controller.js.map +0 -1
- package/dist/internal/services/i18n.service.d.ts +0 -64
- package/dist/internal/services/i18n.service.js +0 -73
- package/dist/internal/services/i18n.service.js.map +0 -1
package/dist/month/month2.js
CHANGED
|
@@ -8,7 +8,10 @@ import o from "./month.js";
|
|
|
8
8
|
import { html as s } from "lit";
|
|
9
9
|
import { property as c } from "lit/decorators/property.js";
|
|
10
10
|
//#region src/month/month.ts
|
|
11
|
-
var l = class extends r {
|
|
11
|
+
var l = { expand: "expand" }, u = class extends r {
|
|
12
|
+
get i18nDefaults() {
|
|
13
|
+
return l;
|
|
14
|
+
}
|
|
12
15
|
static {
|
|
13
16
|
this.styles = t([
|
|
14
17
|
...r.styles,
|
|
@@ -19,7 +22,7 @@ var l = class extends r {
|
|
|
19
22
|
static {
|
|
20
23
|
this.metadata = {
|
|
21
24
|
tag: "nve-month",
|
|
22
|
-
version: "2.
|
|
25
|
+
version: "2.20.0"
|
|
23
26
|
};
|
|
24
27
|
}
|
|
25
28
|
static {
|
|
@@ -32,8 +35,8 @@ var l = class extends r {
|
|
|
32
35
|
n([c({
|
|
33
36
|
type: String,
|
|
34
37
|
reflect: !0
|
|
35
|
-
})],
|
|
38
|
+
})], u.prototype, "container", void 0), u = n([e()], u);
|
|
36
39
|
//#endregion
|
|
37
|
-
export {
|
|
40
|
+
export { u as Month };
|
|
38
41
|
|
|
39
42
|
//# sourceMappingURL=month2.js.map
|
package/dist/month/month2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"month2.js","names":[],"sources":["../../src/month/month.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { ContainerElement } from '@nvidia-elements/core/internal';\nimport { scopedRegistry, useStyles } from '@nvidia-elements/core/internal';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { inputStyles } from '@nvidia-elements/core/input';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport styles from './month.css?inline';\n\n/**\n * @element nve-month\n * @description A month picker is a control that enables users to choose a month value.\n * @documentation https://nvidia.github.io/elements/docs/elements/month/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/month\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --cursor\n * @csspart icon-button - The calendar icon button element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month\n */\n@scopedRegistry()\nexport class Month extends Control implements ContainerElement {\n /**\n * Reduces the visual container for a minimal borderless appearance while preserving whitespace bounds.\n * Use when embedding within another container such as a toolbar.\n */\n @property({ type: String, reflect: true }) container?: 'flat';\n\n static styles = useStyles([...Control.styles, inputStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-month',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n protected get suffixContent() {\n return html`<nve-icon-button part=\"icon-button\" .ariaLabel=${this.i18n.expand} icon-name=\"calendar\" container=\"inline\" @click=${this.showPicker}></nve-icon-button>`;\n }\n}\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"month2.js","names":[],"sources":["../../src/month/month.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { ContainerElement } from '@nvidia-elements/core/internal';\nimport { scopedRegistry, useStyles } from '@nvidia-elements/core/internal';\nimport { Control } from '@nvidia-elements/core/forms';\nimport { inputStyles } from '@nvidia-elements/core/input';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport styles from './month.css?inline';\n\nconst i18nDefaults = {\n expand: 'expand'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-month\n * @description A month picker is a control that enables users to choose a month value.\n * @documentation https://nvidia.github.io/elements/docs/elements/month/\n * @since 0.3.0\n * @entrypoint \\@nvidia-elements/core/month\n * @cssprop --padding\n * @cssprop --font-size\n * @cssprop --height\n * @cssprop --background\n * @cssprop --border-radius\n * @cssprop --border\n * @cssprop --cursor\n * @csspart icon-button - The calendar icon button element\n * @aria https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/month\n */\n@scopedRegistry()\nexport class Month extends Control implements ContainerElement {\n protected override get i18nDefaults(): I18nDefaults {\n return i18nDefaults;\n }\n\n /**\n * Reduces the visual container for a minimal borderless appearance while preserving whitespace bounds.\n * Use when embedding within another container such as a toolbar.\n */\n @property({ type: String, reflect: true }) container?: 'flat';\n\n static styles = useStyles([...Control.styles, inputStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-month',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton\n };\n\n protected get suffixContent() {\n return html`<nve-icon-button part=\"icon-button\" .ariaLabel=${this.i18n.expand} icon-name=\"calendar\" container=\"inline\" @click=${this.showPicker}></nve-icon-button>`;\n }\n}\n"],"mappings":";;;;;;;;;;AAaA,IAAM,IAAe,EACnB,QAAQ,SACV,GAmBa,IAAN,cAAoB,EAAoC;CAC7D,IAAuB,eAA6B;EAClD,OAAO;CACT;;EAQgB,KAAA,SAAA,EAAU;GAAC,GAAG,EAAQ;GAAQ;GAAa;EAAM,CAAC;;;EAEvC,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA,GACzB,EAAW,SAAS,MAAM,EAC7B;;CAEA,IAAc,gBAAgB;EAC5B,OAAO,CAAI,mDAAkD,KAAK,KAAK,OAAO,oDAAkD,KAAK,WAAW;CAClJ;AACF;AAhBG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,GAV1C,IAAA,EAAA,CAAA,EAAe,CAAA,GAAA,CAAA"}
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import s from "../
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import u from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { attachInternals as e } from "../internal/utils/a11y.js";
|
|
2
|
+
import { TypeNativePopoverController as t } from "../internal/controllers/type-native-popover.controller.js";
|
|
3
|
+
import { scopedRegistry as n } from "../internal/decorators/scoped-registry.js";
|
|
4
|
+
import { useStyles as r } from "../internal/styles/index.js";
|
|
5
|
+
import { popoverStyles as i } from "../internal/styles/popover2.js";
|
|
6
|
+
import { statusIcons as a } from "../internal/types/index.js";
|
|
7
|
+
import o from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
8
|
+
import { Icon as s } from "../icon/icon2.js";
|
|
9
|
+
import { IconButton as c } from "../icon-button/icon-button2.js";
|
|
10
|
+
import l from "./notification.js";
|
|
11
|
+
import { LitElement as u, html as d } from "lit";
|
|
12
|
+
import { property as f } from "lit/decorators/property.js";
|
|
13
|
+
import { I18nController as p } from "@nvidia-elements/foundations/internal/i18n";
|
|
14
14
|
//#region src/notification/notification.ts
|
|
15
|
-
var m =
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
var m = {
|
|
16
|
+
close: "close",
|
|
17
|
+
danger: "danger",
|
|
18
|
+
information: "information",
|
|
19
|
+
success: "success",
|
|
20
|
+
warning: "warning"
|
|
21
|
+
}, h = class extends u {
|
|
22
|
+
constructor(...e) {
|
|
23
|
+
super(...e), this.anchor = globalThis.document?.body, this.closable = !1, this.closeTimeout = 0, this.#e = new p(this, m), this.i18n = this.#e.i18n, this.inline = !1;
|
|
18
24
|
}
|
|
19
25
|
#e;
|
|
20
26
|
get popoverType() {
|
|
@@ -26,34 +32,34 @@ var m = class extends d {
|
|
|
26
32
|
#t;
|
|
27
33
|
#n;
|
|
28
34
|
get #r() {
|
|
29
|
-
return
|
|
35
|
+
return d`<slot name="icon"><nve-icon .name="${a[this.status]}" .ariaLabel="${(this.status ? this.i18n[this.status] : void 0) ?? this.i18n.information}" part="status-icon"></nve-icon></slot>${this.closable ? d`<nve-icon-button part="icon-button" @click="${this.hidePopover}" icon-name="cancel" size="sm" container="flat" .ariaLabel="${this.i18n.close}"></nve-icon-button>` : ""}<slot></slot>`;
|
|
30
36
|
}
|
|
31
37
|
static {
|
|
32
|
-
this.styles =
|
|
38
|
+
this.styles = r([i, l]);
|
|
33
39
|
}
|
|
34
40
|
static {
|
|
35
41
|
this.metadata = {
|
|
36
42
|
tag: "nve-notification",
|
|
37
|
-
version: "2.
|
|
43
|
+
version: "2.20.0"
|
|
38
44
|
};
|
|
39
45
|
}
|
|
40
46
|
static {
|
|
41
47
|
this.elementDefinitions = {
|
|
42
|
-
[
|
|
43
|
-
[
|
|
48
|
+
[s.metadata.tag]: s,
|
|
49
|
+
[c.metadata.tag]: c
|
|
44
50
|
};
|
|
45
51
|
}
|
|
46
52
|
render() {
|
|
47
|
-
return
|
|
53
|
+
return d`<div internal-host>${this.#r}</div>`;
|
|
48
54
|
}
|
|
49
55
|
connectedCallback() {
|
|
50
|
-
super.connectedCallback(),
|
|
56
|
+
super.connectedCallback(), e(this), this.#n = new MutationObserver(() => this.#i()), this.#n.observe(this, { attributeFilter: ["hidden"] }), this._internals.role = "alert", this.#i();
|
|
51
57
|
}
|
|
52
58
|
disconnectedCallback() {
|
|
53
59
|
this.#a(), this.#n?.disconnect(), this.#n = void 0, super.disconnectedCallback();
|
|
54
60
|
}
|
|
55
61
|
async firstUpdated(e) {
|
|
56
|
-
super.firstUpdated(e), this.popoverInline ? this.setAttribute("nve-popover", "") : this.typeNativePopoverController = new
|
|
62
|
+
super.firstUpdated(e), this.popoverInline ? this.setAttribute("nve-popover", "") : this.typeNativePopoverController = new t(this), this.#i();
|
|
57
63
|
}
|
|
58
64
|
updated(e) {
|
|
59
65
|
super.updated(e), (e.has("closeTimeout") || e.has("container") || e.has("inline")) && this.#i();
|
|
@@ -71,27 +77,27 @@ var m = class extends d {
|
|
|
71
77
|
this.#t !== void 0 && (clearTimeout(this.#t), this.#t = void 0);
|
|
72
78
|
}
|
|
73
79
|
};
|
|
74
|
-
|
|
80
|
+
o([f({ type: String })], h.prototype, "anchor", void 0), o([f({ type: String })], h.prototype, "trigger", void 0), o([f({
|
|
75
81
|
type: String,
|
|
76
82
|
reflect: !0
|
|
77
|
-
})],
|
|
83
|
+
})], h.prototype, "position", void 0), o([f({
|
|
78
84
|
type: String,
|
|
79
85
|
reflect: !0
|
|
80
|
-
})],
|
|
86
|
+
})], h.prototype, "alignment", void 0), o([f({
|
|
81
87
|
type: Boolean,
|
|
82
88
|
reflect: !0,
|
|
83
89
|
attribute: "behavior-trigger"
|
|
84
|
-
})],
|
|
90
|
+
})], h.prototype, "behaviorTrigger", void 0), o([f({ type: Boolean })], h.prototype, "closable", void 0), o([f({
|
|
85
91
|
type: Number,
|
|
86
92
|
attribute: "close-timeout"
|
|
87
|
-
})],
|
|
93
|
+
})], h.prototype, "closeTimeout", void 0), o([f({
|
|
88
94
|
type: String,
|
|
89
95
|
reflect: !0
|
|
90
|
-
})],
|
|
96
|
+
})], h.prototype, "status", void 0), o([f({
|
|
91
97
|
type: String,
|
|
92
98
|
reflect: !0
|
|
93
|
-
})],
|
|
99
|
+
})], h.prototype, "container", void 0), o([f({ type: Object })], h.prototype, "i18n", void 0), o([f({ type: Boolean })], h.prototype, "inline", void 0), h = o([n()], h);
|
|
94
100
|
//#endregion
|
|
95
|
-
export {
|
|
101
|
+
export { h as Notification };
|
|
96
102
|
|
|
97
103
|
//# sourceMappingURL=notification2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification2.js","names":[],"sources":["../../src/notification/notification.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 { Icon } from '@nvidia-elements/core/icon';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { PopoverAlign, PopoverType, SupportStatus, PopoverPosition } from '@nvidia-elements/core/internal';\nimport {\n attachInternals,\n popoverStyles,\n statusIcons,\n useStyles,\n I18nController,\n TypeNativePopoverController,\n scopedRegistry\n} from '@nvidia-elements/core/internal';\nimport styles from './notification.css?inline';\n\n/**\n * @element nve-notification\n * @description Displays real time updates without interrupting the user's workflow to communicate an important message or status.\n * @documentation https://nvidia.github.io/elements/docs/elements/notification/\n * @since 0.6.0\n * @entrypoint \\@nvidia-elements/core/notification\n * @event beforetoggle - Dispatched on a popover just before showing or hiding. [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforetoggle_event)\n * @event toggle - Dispatched on a popover element just after showing or hiding. [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/toggle_event)\n * @event open - Dispatched when the notification opens.\n * @event close - Dispatched when the notification closes.\n * @slot - The message communicated by the notification.\n * @slot icon - content slot for the status icon\n * @cssprop --border-radius\n * @cssprop --background\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --box-shadow\n * @cssprop --min-width\n * @cssprop --width\n * @cssprop --max-width\n * @cssprop --border\n * @cssprop --status-border\n * @cssprop --gap\n * @cssprop --status-color\n * @cssprop --animation-duration - Duration of notification open/close animations\n * @csspart status-icon - The status icon element\n * @csspart icon-button - The close icon button element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/\n */\n@scopedRegistry()\nexport class Notification extends LitElement {\n /**\n * (optional) By default the popover will automatically anchor itself relative to the trigger element.\n * Pass an optional custom anchor element as an idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) anchor: string | HTMLElement = globalThis.document?.body;\n\n /**\n * @deprecated Use the popover API instead.\n * The trigger defines what element triggers an `open` interaction event.\n * A trigger can accept a idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) trigger: string | HTMLElement;\n\n /**\n * Sets the side position of the popover relative to the provided anchor element.\n */\n @property({ type: String, reflect: true }) position: PopoverPosition;\n\n /**\n * Sets the alignment of the popover relative to the provided anchor element.\n */\n @property({ type: String, reflect: true }) alignment: PopoverAlign;\n\n /**\n * @deprecated Use the popover API instead.\n * Determines if popover visibility behavior should be automatically controlled by the trigger.\n */\n @property({ type: Boolean, reflect: true, attribute: 'behavior-trigger' }) behaviorTrigger: boolean;\n\n /**\n * Determines if a close button should render within notification.\n */\n @property({ type: Boolean }) closable = false;\n\n /**\n * A delayed `close` event will occur determined from the provided millisecond value.\n */\n @property({ type: Number, attribute: 'close-timeout' }) closeTimeout = 0;\n\n /**\n * Determines the visual status of the notification.\n */\n @property({ type: String, reflect: true }) status: SupportStatus;\n\n /**\n * Flat container option applies when embedding within another containing element such as a drawer.\n */\n @property({ type: String, reflect: true }) container?: 'flat';\n\n #i18nController: I18nController<this> = new I18nController<this>(this);\n\n /**\n * Enables updating internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /**\n * @private\n */\n @property({ type: Boolean }) inline = false;\n\n /** @private */\n get popoverType(): PopoverType {\n return 'manual';\n }\n\n /** @private */\n get popoverInline() {\n return this.parentElement?.localName === 'nve-notification-group' || this.inline || this.container === 'flat';\n }\n\n /** @private */\n declare _internals: ElementInternals;\n\n protected typeNativePopoverController: TypeNativePopoverController<Notification>;\n\n #closeTimeout?: ReturnType<typeof setTimeout>;\n\n #hiddenAttributeObserver?: MutationObserver;\n\n get #popoverContent() {\n return html`\n <slot name=\"icon\"><nve-icon .name=${statusIcons[this.status]} .ariaLabel=${(this.status ? (this.i18n as Record<string, string>)[this.status] : undefined) ?? this.i18n.information} part=\"status-icon\"></nve-icon></slot>\n ${this.closable ? html`<nve-icon-button part=\"icon-button\" @click=${this.hidePopover} icon-name=\"cancel\" size=\"sm\" container=\"flat\" .ariaLabel=${this.i18n.close}></nve-icon-button>` : ''}\n <slot></slot>`;\n }\n\n static styles = useStyles([popoverStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-notification',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon,\n [IconButton.metadata.tag]: IconButton\n };\n\n render() {\n return html`\n <div internal-host>\n ${this.#popoverContent}\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this.#hiddenAttributeObserver = new MutationObserver(() => this.#syncInlineCloseTimeout());\n this.#hiddenAttributeObserver.observe(this, { attributeFilter: ['hidden'] });\n this._internals.role = 'alert';\n this.#syncInlineCloseTimeout();\n }\n\n disconnectedCallback() {\n this.#clearCloseTimeout();\n this.#hiddenAttributeObserver?.disconnect();\n this.#hiddenAttributeObserver = undefined;\n super.disconnectedCallback();\n }\n\n async firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n\n if (!this.popoverInline) {\n this.typeNativePopoverController = new TypeNativePopoverController<Notification>(this);\n } else {\n this.setAttribute('nve-popover', '');\n }\n\n this.#syncInlineCloseTimeout();\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n\n if (props.has('closeTimeout') || props.has('container') || props.has('inline')) {\n this.#syncInlineCloseTimeout();\n }\n }\n\n hidePopover(): void {\n this.#clearCloseTimeout();\n\n if (this.popoverInline) {\n this.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }));\n } else {\n super.hidePopover();\n }\n }\n\n /**\n * The popover controller provides this functionality.\n * But when the notification is in inline mode the\n * controller does not run so this sets it up directly.\n */\n #syncInlineCloseTimeout() {\n this.#clearCloseTimeout();\n\n if (this.popoverInline && this.closeTimeout && !this.hidden) {\n this.#closeTimeout = setTimeout(() => this.hidePopover(), this.closeTimeout);\n }\n }\n\n #clearCloseTimeout() {\n if (this.#closeTimeout !== undefined) {\n clearTimeout(this.#closeTimeout);\n this.#closeTimeout = undefined;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAkDO,IAAM,IAAN,cAA2B,EAAW;;EA4DL,aAvDqB,KAAA,SAAA,WAAW,UAAU,MA4BxC,KAAA,WAAA,IAK+B,KAAA,eAAA,GAY/B,KAAA,KAAA,IAAI,EAAqB,IAAI,GAKlC,KAAA,OAAA,KAAK,GAAgB,MAKlB,KAAA,SAAA;;CAVtC;CAaA,IAAI,cAA2B;EAC7B,OAAO;CACT;CAGA,IAAI,gBAAgB;EAClB,OAAO,KAAK,eAAe,cAAc,4BAA4B,KAAK,UAAU,KAAK,cAAc;CACzG;CAOA;CAEA;CAEA,IAAI,KAAkB;EACpB,OAAO,CAAI,sCACyB,EAAY,KAAK,QAAQ,iBAAe,KAAK,SAAU,KAAK,KAAgC,KAAK,UAAU,KAAA,MAAc,KAAK,KAAK,YAAY,yCACjL,KAAK,WAAW,CAAI,+CAA8C,KAAK,YAAY,8DAA4D,KAAK,KAAK,MAAM,wBAAuB,GAAG;CAE7L;;EAEgB,KAAA,SAAA,EAAU,CAAC,GAAe,CAAM,CAAC;;;EAEtB,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;EACX;;;EAE4B,KAAA,qBAAA;IACzB,EAAK,SAAS,MAAM;IACpB,EAAW,SAAS,MAAM;EAC7B;;CAEA,SAAS;EACP,OAAO,CAAI,sBAEP,KAAK,GAAgB;CAG3B;CAEA,o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AAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAKzB,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAKxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,GAMxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAmB,CAAC,CAAA,GAAA,EAAA,WAAA,mBAAA,KAAA,CAAA,GAKxE,EAAA,CAAA,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAK1B,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAgB,CAAC,CAAA,GAAA,EAAA,WAAA,gBAAA,KAAA,CAAA,GAKrD,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAKxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,GAOxC,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAKzB,EAAA,CAAA,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GA7D5B,IAAA,EAAA,CAAA,EAAe,CAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"notification2.js","names":[],"sources":["../../src/notification/notification.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 { Icon } from '@nvidia-elements/core/icon';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport type { PopoverAlign, PopoverType, SupportStatus, PopoverPosition } from '@nvidia-elements/core/internal';\nimport {\n attachInternals,\n popoverStyles,\n statusIcons,\n useStyles,\n TypeNativePopoverController,\n scopedRegistry\n} from '@nvidia-elements/core/internal';\nimport { I18nController, type I18nDefaults } from '@nvidia-elements/foundations/internal/i18n';\nimport styles from './notification.css?inline';\n\nconst i18nDefaults = {\n close: 'close',\n danger: 'danger',\n information: 'information',\n success: 'success',\n warning: 'warning'\n} satisfies I18nDefaults;\n\n/**\n * @element nve-notification\n * @description Displays real time updates without interrupting the user's workflow to communicate an important message or status.\n * @documentation https://nvidia.github.io/elements/docs/elements/notification/\n * @since 0.6.0\n * @entrypoint \\@nvidia-elements/core/notification\n * @event beforetoggle - Dispatched on a popover just before showing or hiding. [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforetoggle_event)\n * @event toggle - Dispatched on a popover element just after showing or hiding. [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/toggle_event)\n * @event open - Dispatched when the notification opens.\n * @event close - Dispatched when the notification closes.\n * @slot - The message communicated by the notification.\n * @slot icon - content slot for the status icon\n * @cssprop --border-radius\n * @cssprop --background\n * @cssprop --color\n * @cssprop --padding\n * @cssprop --box-shadow\n * @cssprop --min-width\n * @cssprop --width\n * @cssprop --max-width\n * @cssprop --border\n * @cssprop --status-border\n * @cssprop --gap\n * @cssprop --status-color\n * @cssprop --animation-duration - Duration of notification open/close animations\n * @csspart status-icon - The status icon element\n * @csspart icon-button - The close icon button element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/\n */\n@scopedRegistry()\nexport class Notification extends LitElement {\n /**\n * (optional) By default the popover will automatically anchor itself relative to the trigger element.\n * Pass an optional custom anchor element as an idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) anchor: string | HTMLElement = globalThis.document?.body;\n\n /**\n * @deprecated Use the popover API instead.\n * The trigger defines what element triggers an `open` interaction event.\n * A trigger can accept a idref string within the same render root or a HTMLElement DOM reference.\n */\n @property({ type: String }) trigger: string | HTMLElement;\n\n /**\n * Sets the side position of the popover relative to the provided anchor element.\n */\n @property({ type: String, reflect: true }) position: PopoverPosition;\n\n /**\n * Sets the alignment of the popover relative to the provided anchor element.\n */\n @property({ type: String, reflect: true }) alignment: PopoverAlign;\n\n /**\n * @deprecated Use the popover API instead.\n * Determines if popover visibility behavior should be automatically controlled by the trigger.\n */\n @property({ type: Boolean, reflect: true, attribute: 'behavior-trigger' }) behaviorTrigger: boolean;\n\n /**\n * Determines if a close button should render within notification.\n */\n @property({ type: Boolean }) closable = false;\n\n /**\n * A delayed `close` event will occur determined from the provided millisecond value.\n */\n @property({ type: Number, attribute: 'close-timeout' }) closeTimeout = 0;\n\n /**\n * Determines the visual status of the notification.\n */\n @property({ type: String, reflect: true }) status: SupportStatus;\n\n /**\n * Flat container option applies when embedding within another containing element such as a drawer.\n */\n @property({ type: String, reflect: true }) container?: 'flat';\n\n #i18nController: I18nController<this> = new I18nController<this>(this, i18nDefaults);\n\n /**\n * Enables updating internal string values for internationalization.\n */\n @property({ type: Object }) i18n = this.#i18nController.i18n;\n\n /**\n * @private\n */\n @property({ type: Boolean }) inline = false;\n\n /** @private */\n get popoverType(): PopoverType {\n return 'manual';\n }\n\n /** @private */\n get popoverInline() {\n return this.parentElement?.localName === 'nve-notification-group' || this.inline || this.container === 'flat';\n }\n\n /** @private */\n declare _internals: ElementInternals;\n\n protected typeNativePopoverController: TypeNativePopoverController<Notification>;\n\n #closeTimeout?: ReturnType<typeof setTimeout>;\n\n #hiddenAttributeObserver?: MutationObserver;\n\n get #popoverContent() {\n return html`\n <slot name=\"icon\"><nve-icon .name=${statusIcons[this.status]} .ariaLabel=${(this.status ? (this.i18n as Record<string, string>)[this.status] : undefined) ?? this.i18n.information} part=\"status-icon\"></nve-icon></slot>\n ${this.closable ? html`<nve-icon-button part=\"icon-button\" @click=${this.hidePopover} icon-name=\"cancel\" size=\"sm\" container=\"flat\" .ariaLabel=${this.i18n.close}></nve-icon-button>` : ''}\n <slot></slot>`;\n }\n\n static styles = useStyles([popoverStyles, styles]);\n\n static readonly metadata = {\n tag: 'nve-notification',\n version: '0.0.0'\n };\n\n static elementDefinitions = {\n [Icon.metadata.tag]: Icon,\n [IconButton.metadata.tag]: IconButton\n };\n\n render() {\n return html`\n <div internal-host>\n ${this.#popoverContent}\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this.#hiddenAttributeObserver = new MutationObserver(() => this.#syncInlineCloseTimeout());\n this.#hiddenAttributeObserver.observe(this, { attributeFilter: ['hidden'] });\n this._internals.role = 'alert';\n this.#syncInlineCloseTimeout();\n }\n\n disconnectedCallback() {\n this.#clearCloseTimeout();\n this.#hiddenAttributeObserver?.disconnect();\n this.#hiddenAttributeObserver = undefined;\n super.disconnectedCallback();\n }\n\n async firstUpdated(props: PropertyValues<this>) {\n super.firstUpdated(props);\n\n if (!this.popoverInline) {\n this.typeNativePopoverController = new TypeNativePopoverController<Notification>(this);\n } else {\n this.setAttribute('nve-popover', '');\n }\n\n this.#syncInlineCloseTimeout();\n }\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n\n if (props.has('closeTimeout') || props.has('container') || props.has('inline')) {\n this.#syncInlineCloseTimeout();\n }\n }\n\n hidePopover(): void {\n this.#clearCloseTimeout();\n\n if (this.popoverInline) {\n this.dispatchEvent(new CustomEvent('close', { bubbles: true, composed: true }));\n } else {\n super.hidePopover();\n }\n }\n\n /**\n * The popover controller provides this functionality.\n * But when the notification is in inline mode the\n * controller does not run so this sets it up directly.\n */\n #syncInlineCloseTimeout() {\n this.#clearCloseTimeout();\n\n if (this.popoverInline && this.closeTimeout && !this.hidden) {\n this.#closeTimeout = setTimeout(() => this.hidePopover(), this.closeTimeout);\n }\n }\n\n #clearCloseTimeout() {\n if (this.#closeT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AAA,KAAA,CAAA,GAMxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAmB,CAAC,CAAA,GAAA,EAAA,WAAA,mBAAA,KAAA,CAAA,GAKxE,EAAA,CAAA,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAK1B,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAgB,CAAC,CAAA,GAAA,EAAA,WAAA,gBAAA,KAAA,CAAA,GAKrD,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAKxC,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,aAAA,KAAA,CAAA,GAOxC,EAAA,CAAA,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,GAKzB,EAAA,CAAA,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GA7D5B,IAAA,EAAA,CAAA,EAAe,CAAA,GAAA,CAAA"}
|
|
@@ -27,17 +27,10 @@ import type { Size } from '@nvidia-elements/core/internal';
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
export declare class PagePanel extends LitElement {
|
|
30
|
-
#private;
|
|
31
30
|
/**
|
|
32
31
|
* Sets the max size of the panel.
|
|
33
32
|
*/
|
|
34
33
|
size?: Size;
|
|
35
|
-
/**
|
|
36
|
-
* Enables updating internal string values for internationalization.
|
|
37
|
-
*/
|
|
38
|
-
i18n: Partial<import("@nvidia-elements/core/internal").I18nStrings & {
|
|
39
|
-
__set: boolean;
|
|
40
|
-
}>;
|
|
41
34
|
static styles: import("lit").CSSResult[];
|
|
42
35
|
static readonly metadata: {
|
|
43
36
|
tag: string;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import a from "
|
|
7
|
-
import o from "./page-panel.js";
|
|
8
|
-
import s from "
|
|
9
|
-
import {
|
|
10
|
-
import { property as u } from "lit/decorators/property.js";
|
|
1
|
+
import { appendRootNodeStyle as e } from "../../internal/utils/dom.js";
|
|
2
|
+
import { attachInternals as t } from "../../internal/utils/a11y.js";
|
|
3
|
+
import { TypeExpandableController as n } from "../../internal/controllers/type-expandable.controller.js";
|
|
4
|
+
import { useStyles as r } from "../../internal/styles/index.js";
|
|
5
|
+
import i from "../../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
6
|
+
import a from "./page-panel.js";
|
|
7
|
+
import o from "./page-panel.global.js";
|
|
8
|
+
import { LitElement as s, html as c } from "lit";
|
|
9
|
+
import { property as l } from "lit/decorators/property.js";
|
|
11
10
|
//#region src/page/page-panel/page-panel.ts
|
|
12
|
-
var
|
|
13
|
-
#e;
|
|
11
|
+
var u = class extends s {
|
|
14
12
|
static {
|
|
15
|
-
this.styles =
|
|
13
|
+
this.styles = r([a]);
|
|
16
14
|
}
|
|
17
15
|
static {
|
|
18
16
|
this.metadata = {
|
|
19
17
|
tag: "nve-page-panel",
|
|
20
|
-
version: "2.
|
|
18
|
+
version: "2.20.0",
|
|
21
19
|
parents: ["nve-page"]
|
|
22
20
|
};
|
|
23
21
|
}
|
|
@@ -25,23 +23,23 @@ var d = class extends c {
|
|
|
25
23
|
return [...super.observedAttributes, "hidden"];
|
|
26
24
|
}
|
|
27
25
|
constructor() {
|
|
28
|
-
super(),
|
|
26
|
+
super(), new n(this, { useHidden: !0 });
|
|
29
27
|
}
|
|
30
28
|
render() {
|
|
31
|
-
return
|
|
29
|
+
return c`<div internal-host><div part="_header"><slot name="header"></slot><slot name="actions"></slot></div><div class="content"><slot></slot></div><div><slot name="footer"></slot></div></div>`;
|
|
32
30
|
}
|
|
33
31
|
connectedCallback() {
|
|
34
|
-
super.connectedCallback(),
|
|
32
|
+
super.connectedCallback(), t(this), this._internals.states.delete("reopened"), e(this, o), this._internals.role = "region";
|
|
35
33
|
}
|
|
36
34
|
attributeChangedCallback(e, t, n) {
|
|
37
35
|
super.attributeChangedCallback(e, t, n), e === "hidden" && t !== null && n === null && this.isConnected && this._internals.states.add("reopened");
|
|
38
36
|
}
|
|
39
37
|
};
|
|
40
|
-
|
|
38
|
+
i([l({
|
|
41
39
|
type: String,
|
|
42
40
|
reflect: !0
|
|
43
|
-
})],
|
|
41
|
+
})], u.prototype, "size", void 0);
|
|
44
42
|
//#endregion
|
|
45
|
-
export {
|
|
43
|
+
export { u as PagePanel };
|
|
46
44
|
|
|
47
45
|
//# sourceMappingURL=page-panel2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-panel2.js","names":[],"sources":["../../../src/page/page-panel/page-panel.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { Size } from '@nvidia-elements/core/internal';\nimport {\n appendRootNodeStyle,\n attachInternals,\n
|
|
1
|
+
{"version":3,"file":"page-panel2.js","names":[],"sources":["../../../src/page/page-panel/page-panel.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport type { Size } from '@nvidia-elements/core/internal';\nimport {\n appendRootNodeStyle,\n attachInternals,\n TypeExpandableController,\n useStyles\n} from '@nvidia-elements/core/internal';\nimport styles from './page-panel.css?inline';\nimport globalStyles from './page-panel.global.css?inline';\n\n/**\n * @element nve-page-panel\n * @description Child panel for embedded panels within the page component. Typically used for left/right/bottom page slot positions.\n * @documentation https://nvidia.github.io/elements/docs/elements/page/\n * @entrypoint \\@nvidia-elements/core/page\n * @since 1.15.0\n * @event open - Dispatched after an invoker command removes `hidden` and opens the panel.\n * @event close - Dispatched after an invoker command sets `hidden` and closes the panel.\n * @slot - `nve-page-panel-content` elements that provide the panel body.\n * @slot actions - slot for action / dismiss buttons\n * @command --open - Removes `hidden` and dispatches `open`.\n * @command --close - Sets `hidden` and dispatches `close`.\n * @command --toggle - Toggles `hidden` and dispatches `open` or `close`.\n * @cssprop --background\n * @cssprop --border\n * @cssprop --color\n * @cssprop --gap\n * @cssprop --padding\n * @cssprop --height\n * @cssprop --width\n * @cssprop --max-width\n * @cssprop --max-height\n * @cssprop --animation-duration - Duration of panel open/close animations\n * @aria https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/region_role\n *\n */\nexport class PagePanel extends LitElement {\n /**\n * Sets the max size of the panel.\n */\n @property({ type: String, reflect: true }) size?: Size;\n\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-page-panel',\n version: '0.0.0',\n parents: ['nve-page']\n };\n\n static get observedAttributes() {\n return [...super.observedAttributes, 'hidden'];\n }\n\n constructor() {\n super();\n new TypeExpandableController(this, { useHidden: true });\n }\n\n /** @private */\n declare _internals: ElementInternals;\n\n render() {\n return html`\n <div internal-host>\n <div part=\"_header\">\n <slot name=\"header\"></slot>\n <slot name=\"actions\"></slot>\n </div>\n <div class=\"content\">\n <slot></slot>\n </div>\n <div>\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.states.delete('reopened');\n appendRootNodeStyle(this, globalStyles);\n this._internals.role = 'region';\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name === 'hidden' && oldValue !== null && newValue === null && this.isConnected) {\n this._internals.states.add('reopened');\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAyCA,IAAa,IAAb,cAA+B,EAAW;;EAMxB,KAAA,SAAA,EAAU,CAAC,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,SAAS,CAAC,UAAU;EACtB;;CAEA,WAAW,qBAAqB;EAC9B,OAAO,CAAC,GAAG,MAAM,oBAAoB,QAAQ;CAC/C;CAEA,cAAc;EAEZ,AADA,MAAM,GACN,IAAI,EAAyB,MAAM,EAAE,WAAW,GAAK,CAAC;CACxD;CAKA,SAAS;EACP,OAAO,CAAI;CAcb;CAEA,oBAAoB;EAKlB,AAJA,MAAM,kBAAkB,GACxB,EAAgB,IAAI,GACpB,KAAK,WAAW,OAAO,OAAO,UAAU,GACxC,EAAoB,MAAM,CAAY,GACtC,KAAK,WAAW,OAAO;CACzB;CAEA,yBAAyB,GAAc,GAAyB,GAAyB;EAEvF,AADA,MAAM,yBAAyB,GAAM,GAAU,CAAQ,GACnD,MAAS,YAAY,MAAa,QAAQ,MAAa,QAAQ,KAAK,eACtE,KAAK,WAAW,OAAO,IAAI,UAAU;CAEzC;AACF;AArDG,EAAA,CAAA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA"}
|
package/dist/page/page2.js
CHANGED
|
@@ -1,39 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import s from "../
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import u from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { keyNavigationList as e } from "../internal/controllers/keynav-list.controller.js";
|
|
2
|
+
import { attachInternals as t } from "../internal/utils/a11y.js";
|
|
3
|
+
import { typeSSR as n } from "../internal/controllers/type-ssr.controller.js";
|
|
4
|
+
import { scopedRegistry as r } from "../internal/decorators/scoped-registry.js";
|
|
5
|
+
import { useStyles as i } from "../internal/styles/index.js";
|
|
6
|
+
import { formatStandardNumber as a } from "../internal/utils/objects.js";
|
|
7
|
+
import o from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
8
|
+
import { IconButton as s } from "../icon-button/icon-button2.js";
|
|
9
|
+
import { Select as c } from "../select/select2.js";
|
|
10
|
+
import l from "./pagination.js";
|
|
11
|
+
import { LitElement as u, html as d, nothing as f } from "lit";
|
|
12
|
+
import { property as p } from "lit/decorators/property.js";
|
|
13
|
+
import { I18nController as m } from "@nvidia-elements/foundations/internal/i18n";
|
|
14
14
|
import { FormControlMixin as h } from "@nvidia-elements/forms/mixins";
|
|
15
15
|
//#region src/pagination/pagination.ts
|
|
16
|
-
var g =
|
|
16
|
+
var g = {
|
|
17
|
+
of: "of",
|
|
18
|
+
previous: "previous",
|
|
19
|
+
next: "next",
|
|
20
|
+
start: "start",
|
|
21
|
+
end: "end",
|
|
22
|
+
currentPage: "current page"
|
|
23
|
+
}, _ = class extends h(u) {
|
|
17
24
|
#e;
|
|
18
25
|
static {
|
|
19
|
-
this.styles =
|
|
26
|
+
this.styles = i([l]);
|
|
20
27
|
}
|
|
21
28
|
static {
|
|
22
29
|
this.metadata = {
|
|
23
30
|
tag: "nve-pagination",
|
|
24
|
-
version: "2.
|
|
31
|
+
version: "2.20.0",
|
|
25
32
|
valueSchema: { type: "number" }
|
|
26
33
|
};
|
|
27
34
|
}
|
|
28
35
|
static {
|
|
29
36
|
this.elementDefinitions = {
|
|
30
|
-
[
|
|
31
|
-
[
|
|
37
|
+
[s.metadata.tag]: s,
|
|
38
|
+
[c.metadata.tag]: c
|
|
32
39
|
};
|
|
33
40
|
}
|
|
34
41
|
get keynavListConfig() {
|
|
35
42
|
return {
|
|
36
|
-
items: this.shadowRoot.querySelectorAll(`${
|
|
43
|
+
items: this.shadowRoot.querySelectorAll(`${s.metadata.tag}, input, select`),
|
|
37
44
|
layout: "horizontal"
|
|
38
45
|
};
|
|
39
46
|
}
|
|
@@ -48,29 +55,29 @@ var g = class extends h(d) {
|
|
|
48
55
|
}
|
|
49
56
|
get #i() {
|
|
50
57
|
let e = (this.value - 1) * this.step + 1, t = Math.min(this.value * this.step, this.items || Infinity);
|
|
51
|
-
return `${
|
|
58
|
+
return `${a(e)}-${a(t)}`;
|
|
52
59
|
}
|
|
53
60
|
get #a() {
|
|
54
|
-
return this.items ?
|
|
61
|
+
return this.items ? d`<label><slot name="suffix-label">${this.i18n.of} ${a(this.items)}</slot></label>` : f;
|
|
55
62
|
}
|
|
56
63
|
get #o() {
|
|
57
|
-
return
|
|
64
|
+
return d`<nve-icon-button part="icon-button previous-icon-button" @click="${() => this.#m(this.value - 1)}" .disabled="${this.disabled || this.#t <= this.step}" .ariaLabel="${this.i18n.previous}" container="inline" icon-name="chevron" direction="left"></nve-icon-button>`;
|
|
58
65
|
}
|
|
59
66
|
get #s() {
|
|
60
|
-
return
|
|
67
|
+
return d`<nve-icon-button part="icon-button next-icon-button" @click="${() => this.#m(this.value + 1)}" .disabled="${this.disabled || this.#t >= this.items}" .ariaLabel="${this.i18n.next}" container="inline" icon-name="chevron" direction="right"></nve-icon-button>`;
|
|
61
68
|
}
|
|
62
69
|
get #c() {
|
|
63
|
-
return
|
|
70
|
+
return d`<nve-icon-button part="icon-button start-icon-button" @click="${() => this.#m(1)}" .disabled="${this.disabled || this.#t <= this.step}" .ariaLabel="${this.i18n.start}" container="inline" icon-name="arrow-stop" direction="left"></nve-icon-button>`;
|
|
64
71
|
}
|
|
65
72
|
get #l() {
|
|
66
|
-
return
|
|
73
|
+
return d`<nve-icon-button part="icon-button end-icon-button" @click="${() => this.#m(this.items / this.step)}" .disabled="${this.disabled || (this.value - 1) * this.step + this.step >= this.items}" .ariaLabel="${this.i18n.end}" container="inline" icon-name="arrow-stop" direction="right"></nve-icon-button>`;
|
|
67
74
|
}
|
|
68
75
|
#u;
|
|
69
76
|
get #d() {
|
|
70
|
-
return this.disableStep ?
|
|
77
|
+
return this.disableStep ? d`<label>${this.#i} </label>` : d`<nve-select part="select" .container="${this.container}"><select .ariaLabel="${this.i18n.currentPage}" @change="${(e) => this.#p(parseInt(e.target.value, 10))}" value="${this.step}" .disabled="${this.disabled || this.disableStep}">${this.stepSizes.map((e) => d`<option ?selected="${this.step === e}" value="${e}">${e}</option>`)}</select><div class="select-label">${this.#i}</div></nve-select>`;
|
|
71
78
|
}
|
|
72
79
|
render() {
|
|
73
|
-
return
|
|
80
|
+
return d`<div internal-host role="presentation">${this.skippable && this.items ? d`${this.#c} ${this.#o} ${this.#d} ${this.#a} ${this.#s} ${this.#l}` : d`${this.#d} ${this.#a} ${this.#o} ${this.#s}`}</div>`;
|
|
74
81
|
}
|
|
75
82
|
constructor() {
|
|
76
83
|
super(), this.step = 10, this.stepSizes = [
|
|
@@ -78,10 +85,10 @@ var g = class extends h(d) {
|
|
|
78
85
|
20,
|
|
79
86
|
50,
|
|
80
87
|
100
|
|
81
|
-
], this.#e = new
|
|
88
|
+
], this.#e = new m(this, g), this.i18n = this.#e.i18n, this.value = 1;
|
|
82
89
|
}
|
|
83
90
|
async connectedCallback() {
|
|
84
|
-
super.connectedCallback(),
|
|
91
|
+
super.connectedCallback(), t(this), this._internals.role = "toolbar", await this.updateComplete, this.#f();
|
|
85
92
|
}
|
|
86
93
|
disconnectedCallback() {
|
|
87
94
|
super.disconnectedCallback(), this.#u?.unobserve(this);
|
|
@@ -107,21 +114,21 @@ var g = class extends h(d) {
|
|
|
107
114
|
}));
|
|
108
115
|
}
|
|
109
116
|
};
|
|
110
|
-
|
|
117
|
+
o([p({ type: Number })], _.prototype, "step", void 0), o([p({
|
|
111
118
|
type: Array,
|
|
112
119
|
attribute: "step-sizes"
|
|
113
|
-
})],
|
|
120
|
+
})], _.prototype, "stepSizes", void 0), o([p({ type: Number })], _.prototype, "items", void 0), o([p({ type: Boolean })], _.prototype, "skippable", void 0), o([p({
|
|
114
121
|
type: Boolean,
|
|
115
122
|
attribute: "disable-step"
|
|
116
|
-
})],
|
|
123
|
+
})], _.prototype, "disableStep", void 0), o([p({
|
|
117
124
|
type: String,
|
|
118
125
|
reflect: !0
|
|
119
|
-
})],
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
],
|
|
126
|
+
})], _.prototype, "container", void 0), o([p({ type: Object })], _.prototype, "i18n", void 0), _ = o([
|
|
127
|
+
n(),
|
|
128
|
+
e(),
|
|
129
|
+
r()
|
|
130
|
+
], _);
|
|
124
131
|
//#endregion
|
|
125
|
-
export {
|
|
132
|
+
export { _ as Pagination };
|
|
126
133
|
|
|
127
134
|
//# sourceMappingURL=pagination2.js.map
|