@nvidia-elements/core 0.1.2 → 0.1.4
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 +17 -0
- package/dist/accordion/accordion2.js +4 -4
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge2.js +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundles/index.d.ts +6 -1
- package/dist/bundles/index.js +1 -1
- package/dist/button/button.examples.js.map +1 -1
- package/dist/button/button.examples.json +2 -2
- 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/color2.js +1 -1
- package/dist/combobox/combobox2.js +1 -1
- package/dist/copy-button/copy-button2.js +1 -1
- package/dist/custom-elements-jsx.d.ts +24 -33
- package/dist/custom-elements-vue.d.ts +24 -33
- package/dist/custom-elements.json +255 -106
- package/dist/data.html.json +16 -48
- package/dist/data.snippets.json +45 -45
- package/dist/date/date2.js +1 -1
- package/dist/datetime/datetime2.js +1 -1
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +1 -1
- package/dist/divider/divider2.js +1 -1
- package/dist/dot/dot2.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 +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropzone/dropzone2.js +1 -1
- package/dist/file/file2.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/forms/control/control2.js +1 -1
- package/dist/forms/control-group/control-group2.js +1 -1
- package/dist/forms/control-message/control-message2.js +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/index.js +1 -1
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +1 -1
- package/dist/internal/base/button.d.ts +6 -1
- package/dist/internal/base/button.js +9 -2
- package/dist/internal/base/button.js.map +1 -1
- package/dist/internal/controllers/state-current.controller.d.ts +1 -1
- package/dist/internal/controllers/state-current.controller.js +1 -1
- package/dist/internal/controllers/state-current.controller.js.map +1 -1
- package/dist/internal/controllers/state-disabled.controller.d.ts +1 -1
- package/dist/internal/controllers/state-disabled.controller.js +1 -1
- package/dist/internal/controllers/state-disabled.controller.js.map +1 -1
- package/dist/internal/controllers/state-expanded.controller.d.ts +1 -1
- package/dist/internal/controllers/state-expanded.controller.js +1 -1
- package/dist/internal/controllers/state-expanded.controller.js.map +1 -1
- package/dist/internal/controllers/state-pressed.controller.d.ts +1 -1
- package/dist/internal/controllers/state-pressed.controller.js +1 -1
- package/dist/internal/controllers/state-pressed.controller.js.map +1 -1
- package/dist/internal/controllers/state-selected.controller.d.ts +1 -1
- package/dist/internal/controllers/state-selected.controller.js +1 -1
- package/dist/internal/controllers/state-selected.controller.js.map +1 -1
- package/dist/internal/controllers/type-anchor.controller.d.ts +1 -1
- package/dist/internal/controllers/type-anchor.controller.js +1 -1
- package/dist/internal/controllers/type-anchor.controller.js.map +1 -1
- package/dist/internal/controllers/type-button.controller.d.ts +1 -1
- package/dist/internal/controllers/type-button.controller.js +1 -1
- package/dist/internal/controllers/type-button.controller.js.map +1 -1
- package/dist/internal/controllers/type-command.controller.d.ts +1 -1
- package/dist/internal/controllers/type-command.controller.js +1 -1
- package/dist/internal/controllers/type-command.controller.js.map +1 -1
- package/dist/internal/controllers/type-interest.controller.d.ts +1 -1
- package/dist/internal/controllers/type-interest.controller.js.map +1 -1
- package/dist/internal/controllers/type-submit.controller.d.ts +1 -1
- package/dist/internal/controllers/type-submit.controller.js +1 -1
- package/dist/internal/controllers/type-submit.controller.js.map +1 -1
- package/dist/internal/services/global.service.js +1 -1
- package/dist/internal/types/index.d.ts +4 -0
- package/dist/internal/types/index.js.map +1 -1
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/menu-item2.js +1 -1
- package/dist/menu/menu2.js +1 -1
- package/dist/month/month2.js +1 -1
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +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-panel2.js +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 +1 -1
- package/dist/panel/panel2.js +4 -4
- package/dist/password/password2.js +1 -1
- package/dist/preferences-input/preferences-input2.js +1 -1
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-ring/progress-ring2.js +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +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 +1 -1
- package/dist/search/search2.js +1 -1
- package/dist/select/select2.js +1 -1
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/sort-button/sort-button2.js +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/tabs2.js +2 -2
- package/dist/tag/tag2.js +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +1 -1
- package/dist/toast/toast2.js +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node2.js +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/week/week2.js +1 -1
- package/package.json +3 -5
- package/postinstall.mjs +0 -113
package/dist/dialog/dialog2.js
CHANGED
package/dist/divider/divider2.js
CHANGED
package/dist/dot/dot2.js
CHANGED
package/dist/drawer/drawer2.js
CHANGED
package/dist/file/file2.js
CHANGED
package/dist/grid/cell/cell2.js
CHANGED
package/dist/grid/grid2.js
CHANGED
package/dist/grid/row/row2.js
CHANGED
package/dist/icon/icon2.js
CHANGED
|
@@ -16,7 +16,7 @@ var f = class e extends o {
|
|
|
16
16
|
static {
|
|
17
17
|
this.metadata = {
|
|
18
18
|
tag: "nve-icon",
|
|
19
|
-
version: "0.1.
|
|
19
|
+
version: "0.1.4"
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
@@ -86,7 +86,7 @@ n([l({
|
|
|
86
86
|
})], f.prototype, "name", void 0), n([d()], f.prototype, "svg", void 0);
|
|
87
87
|
function p(t) {
|
|
88
88
|
if (typeof globalThis.customElements?.get == "function") {
|
|
89
|
-
let n = e(t.metadata.version), r = e("0.1.
|
|
89
|
+
let n = e(t.metadata.version), r = e("0.1.4");
|
|
90
90
|
n.minor <= r.minor && n.major <= r.major && (t._icons = {
|
|
91
91
|
...t._icons,
|
|
92
92
|
...i
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { getThemeTokens as e } from "./internal/utils/dom.js";
|
|
|
2
2
|
import { I18nService as t } from "./internal/services/i18n.service.js";
|
|
3
3
|
import { statusIcons as n } from "./internal/types/index.js";
|
|
4
4
|
//#region src/index.ts
|
|
5
|
-
var r = "0.1.
|
|
5
|
+
var r = "0.1.4", i = "@nvidia-elements";
|
|
6
6
|
//#endregion
|
|
7
7
|
export { t as I18nService, i as SCOPE, r as VERSION, e as getThemeTokens, n as statusIcons };
|
|
8
8
|
|
package/dist/input/input2.js
CHANGED
|
@@ -21,7 +21,12 @@ export declare class BaseButton extends LitElement {
|
|
|
21
21
|
* Like input readonly, sets a button semantically as visual treatment only
|
|
22
22
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
readOnly: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use `readOnly`. The `readonly` attribute remains supported.
|
|
27
|
+
*/
|
|
28
|
+
get readonly(): boolean;
|
|
29
|
+
set readonly(value: boolean);
|
|
25
30
|
/**
|
|
26
31
|
* Like input form, sets a button to submit a form outside its parent form.
|
|
27
32
|
* Returns a reference to the form element if available.
|
|
@@ -17,11 +17,17 @@ import { property as _ } from "lit/decorators/property.js";
|
|
|
17
17
|
//#region src/internal/base/button.ts
|
|
18
18
|
var v = class extends m {
|
|
19
19
|
constructor(...e) {
|
|
20
|
-
super(...e), this.#e = null, this.disabled = !1, this.popoverTargetElement = null, this.commandForElement = null, this.commandfor = null, this.interestForElement = null, this.interestfor = null;
|
|
20
|
+
super(...e), this.readOnly = !1, this.#e = null, this.disabled = !1, this.popoverTargetElement = null, this.commandForElement = null, this.commandfor = null, this.interestForElement = null, this.interestfor = null;
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.formAssociated = !0;
|
|
24
24
|
}
|
|
25
|
+
get readonly() {
|
|
26
|
+
return this.readOnly;
|
|
27
|
+
}
|
|
28
|
+
set readonly(e) {
|
|
29
|
+
this.readOnly = e;
|
|
30
|
+
}
|
|
25
31
|
#e;
|
|
26
32
|
set form(e) {
|
|
27
33
|
this.#e = e, typeof e == "string" ? this.setAttribute("form", e) : this.removeAttribute("form");
|
|
@@ -48,8 +54,9 @@ p([_({
|
|
|
48
54
|
reflect: !0
|
|
49
55
|
})], v.prototype, "expanded", void 0), p([_({
|
|
50
56
|
type: Boolean,
|
|
57
|
+
attribute: "readonly",
|
|
51
58
|
reflect: !0
|
|
52
|
-
})], v.prototype, "
|
|
59
|
+
})], v.prototype, "readOnly", void 0), p([_({
|
|
53
60
|
type: String,
|
|
54
61
|
attribute: "form",
|
|
55
62
|
converter: { fromAttribute: (e) => e }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":["#form"],"sources":["../../../src/internal/base/button.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, isServer, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { stateActive } from '../controllers/state-active.controller.js';\nimport { stateDisabled } from '../controllers/state-disabled.controller.js';\nimport { stateExpanded } from '../controllers/state-expanded.controller.js';\nimport { statePressed } from '../controllers/state-pressed.controller.js';\nimport { stateSelected } from '../controllers/state-selected.controller.js';\nimport { typeButton } from '../controllers/type-button.controller.js';\nimport { typeAnchor } from '../controllers/type-anchor.controller.js';\nimport { typeSubmit } from '../controllers/type-submit.controller.js';\nimport { typeNativePopoverTrigger } from '../controllers/type-native-popover-trigger.controller.js';\nimport { stateCurrent } from '../controllers/state-current.controller.js';\nimport { typeCommand } from '../controllers/type-command.controller.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { typeInterest } from '../controllers/type-interest.controller.js';\n\n/**\n * Standard button behaviors for custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/button/\n */\n@typeButton<BaseButton>()\n@typeAnchor<BaseButton>()\n@typeSubmit<BaseButton & { form: HTMLFormElement | null }>() // override to exclude type string from getter, see comment in getter below\n@typeNativePopoverTrigger<BaseButton>()\n@typeCommand<BaseButton>()\n@typeInterest<BaseButton>()\n@stateActive<BaseButton>()\n@stateCurrent<BaseButton>()\n@statePressed<BaseButton>()\n@stateSelected<BaseButton>()\n@stateDisabled<BaseButton>()\n@stateExpanded<BaseButton>()\nexport class BaseButton extends LitElement {\n static formAssociated = true;\n\n /**\n * Use for toggle button types.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed\n */\n @property({ type: Boolean, reflect: true }) pressed: boolean;\n\n /**\n * Use for buttons that expand/collapse content.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded\n */\n @property({ type: Boolean, reflect: true }) expanded: boolean;\n\n /**\n * Like input readonly, sets a button semantically as visual treatment only\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly\n */\n @property({ type: Boolean, reflect: true }) readonly: boolean;\n\n #form: string | HTMLFormElement | null = null;\n\n /**\n * Like input form, sets a button to submit a form outside its parent form.\n * Returns a reference to the form element if available.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/form\n */\n @property({\n type: String,\n attribute: 'form',\n converter: {\n fromAttribute: (value: string) => value\n }\n })\n set form(form: string | HTMLFormElement) {\n this.#form = form;\n if (typeof form === 'string') {\n this.setAttribute('form', form);\n } else {\n this.removeAttribute('form');\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/related-getter-setter-pairs\n get form(): HTMLFormElement | null | string {\n // string should drop from the type but without it the type does not derive from the setter correctly\n if (this.#form && typeof this.#form !== 'string') {\n return this.#form;\n } else if (typeof this.#form === 'string' && !isServer) {\n const rootNode = this.getRootNode() as Document | ShadowRoot;\n return rootNode.getElementById ? (rootNode.getElementById(this.#form) as HTMLFormElement) : null;\n } else {\n return this._internals?.form;\n }\n }\n\n /**\n * The name of the button, submitted as a pair with the button's value as part of the form data, when that button submits the form.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-name\n */\n @property({ type: String, reflect: true }) name: string;\n\n /**\n * Defines the value associated with the button's name when submitting the form data. The server receives this value in params when the form submits through this button.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-value\n */\n @property({ type: String, reflect: true }) value: string;\n\n /**\n * Defines the button behavior when associated within an <form> element.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n */\n @property({ type: String, reflect: true }) type: 'button' | 'submit' | 'reset';\n\n /**\n * This Boolean attribute prevents the user from interacting with the button: it cannot receive press or focus events.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-disabled\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * This Boolean attribute prevents the selected state when the button belongs to a multi-choice selection group\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected\n */\n @property({ type: Boolean, reflect: true }) selected: boolean;\n\n /**\n * This Boolean attribute sets the current state, used to represent the current page or navigation link\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current\n */\n @property({ type: String, reflect: true }) current: 'page' | 'step';\n\n /**\n * Establishing a relationship between a popover and its invoker button.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetElement\n */\n @property({ type: Object }) popoverTargetElement: HTMLElement | null = null; // eslint-disable-line local/primitive-property\n\n /**\n * The idref of the element that receives the popover.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#popovertarget\n */\n @property({ type: String, attribute: 'popovertarget', reflect: true }) popovertarget: string;\n\n /**\n * The popover target action to perform on the popover target element.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetAction\n */\n @property({ type: String, attribute: 'popovertargetaction', reflect: true })\n popoverTargetAction: 'show' | 'hide' | 'toggle';\n\n /**\n * The element that receives the command.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\n @property({ type: Object }) commandForElement: HTMLElement | null = null; // eslint-disable-line local/primitive-property\n\n /**\n * The idref of the element that receives the command.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\n @property({ type: String, attribute: 'commandfor', reflect: true }) commandfor: string | null = null;\n\n /**\n * The command to execute on the element.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\n @property({ type: String, attribute: 'command', reflect: true }) command: string;\n\n /**\n * The element that receives the interest.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/interestForElement\n */\n @property({ type: Object }) interestForElement: HTMLElement | null = null; // eslint-disable-line local/primitive-property\n\n /**\n * The idref of the element that receives the interest.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/interestForElement\n */\n @property({ type: String, reflect: true }) interestfor: string | null = null;\n\n /**\n * @private\n * An instance of `ElementInternals` that decorators/controllers set dynamically\n */\n declare _internals: ElementInternals;\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n }\n\n render() {\n return html`<div internal-host><slot></slot></div>`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCO,IAAA,IAAA,cAAyB,EAAW;;yBAqBA,sBA0Dc,gCAkBgB,+BAmBH,wBAM4B,gCAY3B,yBAMG;;;wBA3IhD;;CAoBxB;CAOA,IAOI,KAAK,GAAgC;EAEvC,AADA,KAAKA,KAAQ,GACT,OAAO,KAAS,WAClB,KAAK,aAAa,QAAQ,CAAI,IAE9B,KAAK,gBAAgB,MAAM;CAE/B;CAGA,IAAI,OAAwC;EAE1C,IAAI,KAAKA,MAAS,OAAO,KAAKA,MAAU,UACtC,OAAO,KAAKA;EACP,IAAI,OAAO,KAAKA,MAAU,YAAY,CAAC,GAAU;GACtD,IAAM,IAAW,KAAK,YAAY;GAClC,OAAO,EAAS,iBAAkB,EAAS,eAAe,KAAKA,EAAK,IAAwB;EAC9F,OACE,OAAO,KAAK,YAAY;CAE5B;CA6FA,oBAAoB;EAElB,AADA,MAAM,kBAAkB,GACxB,EAAgB,IAAI;CACtB;CAEA,SAAS;EACP,OAAO,CAAI;CACb;AACF;GArJG,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,MAMzC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,MAMzC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,MASzC,EAAS;CACR,MAAM;CACN,WAAW;CACX,WAAW,EACT,gBAAgB,MAAkB,EACpC;AACF,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,IAAA,MA2BA,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,MAMxC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,MAMxC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,QAAA,KAAA,CAAA,MAMxC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,MAMzC,EAAS;CAAE,MAAM;CAAS,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,MAMzC,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,MAMxC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,wBAAA,KAAA,CAAA,MAMzB,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAiB,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,iBAAA,KAAA,CAAA,MAMpE,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAuB,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,uBAAA,KAAA,CAAA,MAO1E,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,qBAAA,KAAA,CAAA,MAMzB,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAc,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,MAMjE,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAW,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,MAM9D,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,EAAA,WAAA,sBAAA,KAAA,CAAA,MAMzB,EAAS;CAAE,MAAM;CAAQ,SAAS;AAAK,CAAC,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA;CAxJ1C,EAAuB;CACvB,EAAuB;CACvB,EAA0D;CAC1D,EAAqC;CACrC,EAAwB;CACxB,EAAyB;CACzB,EAAwB;CACxB,EAAyB;CACzB,EAAyB;CACzB,EAA0B;CAC1B,EAA0B;CAC1B,EAA0B"}
|
|
1
|
+
{"version":3,"file":"button.js","names":["#form"],"sources":["../../../src/internal/base/button.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, isServer, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { stateActive } from '../controllers/state-active.controller.js';\nimport { stateDisabled } from '../controllers/state-disabled.controller.js';\nimport { stateExpanded } from '../controllers/state-expanded.controller.js';\nimport { statePressed } from '../controllers/state-pressed.controller.js';\nimport { stateSelected } from '../controllers/state-selected.controller.js';\nimport { typeButton } from '../controllers/type-button.controller.js';\nimport { typeAnchor } from '../controllers/type-anchor.controller.js';\nimport { typeSubmit } from '../controllers/type-submit.controller.js';\nimport { typeNativePopoverTrigger } from '../controllers/type-native-popover-trigger.controller.js';\nimport { stateCurrent } from '../controllers/state-current.controller.js';\nimport { typeCommand } from '../controllers/type-command.controller.js';\nimport { attachInternals } from '../utils/a11y.js';\nimport { typeInterest } from '../controllers/type-interest.controller.js';\n\n/**\n * Standard button behaviors for custom elements.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/button/\n */\n@typeButton<BaseButton>()\n@typeAnchor<BaseButton>()\n@typeSubmit<BaseButton & { form: HTMLFormElement | null }>() // override to exclude type string from getter, see comment in getter below\n@typeNativePopoverTrigger<BaseButton>()\n@typeCommand<BaseButton>()\n@typeInterest<BaseButton>()\n@stateActive<BaseButton>()\n@stateCurrent<BaseButton>()\n@statePressed<BaseButton>()\n@stateSelected<BaseButton>()\n@stateDisabled<BaseButton>()\n@stateExpanded<BaseButton>()\nexport class BaseButton extends LitElement {\n static formAssociated = true;\n\n /**\n * Use for toggle button types.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed\n */\n @property({ type: Boolean, reflect: true }) pressed: boolean;\n\n /**\n * Use for buttons that expand/collapse content.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded\n */\n @property({ type: Boolean, reflect: true }) expanded: boolean;\n\n /**\n * Like input readonly, sets a button semantically as visual treatment only\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly\n */\n @property({ type: Boolean, attribute: 'readonly', reflect: true }) readOnly = false;\n\n /**\n * @deprecated Use `readOnly`. The `readonly` attribute remains supported.\n */\n get readonly(): boolean {\n return this.readOnly;\n }\n\n set readonly(value: boolean) {\n this.readOnly = value; // eslint-disable-line local/stateless-property\n }\n\n #form: string | HTMLFormElement | null = null;\n\n /**\n * Like input form, sets a button to submit a form outside its parent form.\n * Returns a reference to the form element if available.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/form\n */\n @property({\n type: String,\n attribute: 'form',\n converter: {\n fromAttribute: (value: string) => value\n }\n })\n set form(form: string | HTMLFormElement) {\n this.#form = form;\n if (typeof form === 'string') {\n this.setAttribute('form', form);\n } else {\n this.removeAttribute('form');\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/related-getter-setter-pairs\n get form(): HTMLFormElement | null | string {\n // string should drop from the type but without it the type does not derive from the setter correctly\n if (this.#form && typeof this.#form !== 'string') {\n return this.#form;\n } else if (typeof this.#form === 'string' && !isServer) {\n const rootNode = this.getRootNode() as Document | ShadowRoot;\n return rootNode.getElementById ? (rootNode.getElementById(this.#form) as HTMLFormElement) : null;\n } else {\n return this._internals?.form;\n }\n }\n\n /**\n * The name of the button, submitted as a pair with the button's value as part of the form data, when that button submits the form.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-name\n */\n @property({ type: String, reflect: true }) name: string;\n\n /**\n * Defines the value associated with the button's name when submitting the form data. The server receives this value in params when the form submits through this button.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-value\n */\n @property({ type: String, reflect: true }) value: string;\n\n /**\n * Defines the button behavior when associated within an <form> element.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n */\n @property({ type: String, reflect: true }) type: 'button' | 'submit' | 'reset';\n\n /**\n * This Boolean attribute prevents the user from interacting with the button: it cannot receive press or focus events.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-disabled\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * This Boolean attribute prevents the selected state when the button belongs to a multi-choice selection group\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected\n */\n @property({ type: Boolean, reflect: true }) selected: boolean;\n\n /**\n * This Boolean attribute sets the current state, used to represent the current page or navigation link\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current\n */\n @property({ type: String, reflect: true }) current: 'page' | 'step';\n\n /**\n * Establishing a relationship between a popover and its invoker button.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetElement\n */\n @property({ type: Object }) popoverTargetElement: HTMLElement | null = null; // eslint-disable-line local/primitive-property\n\n /**\n * The idref of the element that receives the popover.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#popovertarget\n */\n @property({ type: String, attribute: 'popovertarget', reflect: true }) popovertarget: string;\n\n /**\n * The popover target action to perform on the popover target element.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetAction\n */\n @property({ type: String, attribute: 'popovertargetaction', reflect: true })\n popoverTargetAction: 'show' | 'hide' | 'toggle';\n\n /**\n * The element that receives the command.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\n @property({ type: Object }) commandForElement: HTMLElement | null = null; // eslint-disable-line local/primitive-property\n\n /**\n * The idref of the element that receives the command.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\n @property({ type: String, attribute: 'commandfor', reflect: true }) commandfor: string | null = null;\n\n /**\n * The command to execute on the element.\n * https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API\n */\n @property({ type: String, attribute: 'command', reflect: true }) command: string;\n\n /**\n * The element that receives the interest.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/interestForElement\n */\n @property({ type: Object }) interestForElement: HTMLElement | null = null; // eslint-disable-line local/primitive-property\n\n /**\n * The idref of the element that receives the interest.\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/interestForElement\n */\n @property({ type: String, reflect: true }) interestfor: string | null = null;\n\n /**\n * @private\n * An instance of `ElementInternals` that decorators/controllers set dynamically\n */\n declare _internals: ElementInternals;\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n }\n\n render() {\n return html`<div internal-host><slot></slot></div>`;\n }\n}\n"],"mappings":"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"}
|
|
@@ -6,7 +6,7 @@ import { ReactiveController, ReactiveElement } from 'lit';
|
|
|
6
6
|
export declare function stateCurrent<T extends Current>(): ClassDecorator;
|
|
7
7
|
type Current = ReactiveElement & {
|
|
8
8
|
current: 'page' | 'step';
|
|
9
|
-
|
|
9
|
+
readOnly?: boolean;
|
|
10
10
|
_internals?: ElementInternals;
|
|
11
11
|
};
|
|
12
12
|
export declare class StateCurrentController<T extends Current> implements ReactiveController {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-current.controller.js","names":[],"sources":["../../../src/internal/controllers/state-current.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds current support for interactive custom elements including CSS State psuedo-selector :state(current) and aria-current.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current\n */\nexport function stateCurrent<T extends Current>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateCurrentController(instance));\n}\n\ntype Current = ReactiveElement & { current: 'page' | 'step';
|
|
1
|
+
{"version":3,"file":"state-current.controller.js","names":[],"sources":["../../../src/internal/controllers/state-current.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds current support for interactive custom elements including CSS State psuedo-selector :state(current) and aria-current.\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current\n */\nexport function stateCurrent<T extends Current>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateCurrentController(instance));\n}\n\ntype Current = ReactiveElement & { current: 'page' | 'step'; readOnly?: boolean; _internals?: ElementInternals };\n\nexport class StateCurrentController<T extends Current> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.readOnly) {\n this.host._internals!.ariaCurrent = null;\n this.host._internals!.states.delete('current');\n return;\n }\n\n if (this.host._internals?.states.has('anchor') && this.host.current) {\n this.host._internals!.ariaCurrent = null;\n this.host._internals!.states.add('current');\n this.host.querySelector('a')?.setAttribute('aria-current', 'page');\n return;\n }\n\n if (this.host.current !== null && this.host.current !== undefined) {\n this.host._internals!.ariaCurrent = `${this.host.current}`;\n }\n\n if (this.host.current) {\n this.host._internals!.states.add('current');\n } else {\n this.host._internals!.states.delete('current');\n }\n }\n}\n"],"mappings":";;AAWA,SAAgB,IAAkD;CAChE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAuB,CAAQ,CAAC;AAChF;AAIA,IAAa,IAAb,MAAqF;CACnF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,EAAgB,KAAK,IAAI;CAC3B;CAEA,cAAc;EACZ,IAAI,KAAK,KAAK,UAAU;GAEtB,AADA,KAAK,KAAK,WAAY,cAAc,MACpC,KAAK,KAAK,WAAY,OAAO,OAAO,SAAS;GAC7C;EACF;EAEA,IAAI,KAAK,KAAK,YAAY,OAAO,IAAI,QAAQ,KAAK,KAAK,KAAK,SAAS;GAGnE,AAFA,KAAK,KAAK,WAAY,cAAc,MACpC,KAAK,KAAK,WAAY,OAAO,IAAI,SAAS,GAC1C,KAAK,KAAK,cAAc,GAAG,GAAG,aAAa,gBAAgB,MAAM;GACjE;EACF;EAMA,AAJI,KAAK,KAAK,YAAY,QAAQ,KAAK,KAAK,YAAY,KAAA,MACtD,KAAK,KAAK,WAAY,cAAc,GAAG,KAAK,KAAK,YAG/C,KAAK,KAAK,UACZ,KAAK,KAAK,WAAY,OAAO,IAAI,SAAS,IAE1C,KAAK,KAAK,WAAY,OAAO,OAAO,SAAS;CAEjD;AACF"}
|
|
@@ -7,7 +7,7 @@ import { ReactiveController, ReactiveElement } from 'lit';
|
|
|
7
7
|
export declare function stateDisabled<T extends Disabled>(): ClassDecorator;
|
|
8
8
|
export type Disabled = ReactiveElement & {
|
|
9
9
|
disabled: boolean;
|
|
10
|
-
|
|
10
|
+
readOnly?: boolean;
|
|
11
11
|
_internals?: ElementInternals;
|
|
12
12
|
};
|
|
13
13
|
export declare class StateDisabledController<T extends Disabled> implements ReactiveController {
|
|
@@ -11,7 +11,7 @@ var n = class {
|
|
|
11
11
|
e(this.host);
|
|
12
12
|
}
|
|
13
13
|
hostUpdated() {
|
|
14
|
-
this.host.disabled !== null && this.host.disabled !== void 0 ? this.host._internals.ariaDisabled = `${this.host.disabled}` : this.host._internals.ariaDisabled = null, this.host.disabled ? this.host._internals.states.add("disabled") : this.host._internals.states.delete("disabled"), this.host.
|
|
14
|
+
this.host.disabled !== null && this.host.disabled !== void 0 ? this.host._internals.ariaDisabled = `${this.host.disabled}` : this.host._internals.ariaDisabled = null, this.host.disabled ? this.host._internals.states.add("disabled") : this.host._internals.states.delete("disabled"), this.host.readOnly && (this.host._internals.ariaDisabled = null);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-disabled.controller.js","names":[],"sources":["../../../src/internal/controllers/state-disabled.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds disabled support for interactive custom elements including CSS State psuedo-selector :state(disabled) and aria-disabled.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled\n */\nexport function stateDisabled<T extends Disabled>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateDisabledController(instance));\n}\n\nexport type Disabled = ReactiveElement & { disabled: boolean;
|
|
1
|
+
{"version":3,"file":"state-disabled.controller.js","names":[],"sources":["../../../src/internal/controllers/state-disabled.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds disabled support for interactive custom elements including CSS State psuedo-selector :state(disabled) and aria-disabled.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled\n */\nexport function stateDisabled<T extends Disabled>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateDisabledController(instance));\n}\n\nexport type Disabled = ReactiveElement & { disabled: boolean; readOnly?: boolean; _internals?: ElementInternals };\n\nexport class StateDisabledController<T extends Disabled> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.disabled !== null && this.host.disabled !== undefined) {\n this.host._internals!.ariaDisabled = `${this.host.disabled}`;\n } else {\n this.host._internals!.ariaDisabled = null;\n }\n\n if (this.host.disabled) {\n this.host._internals!.states.add('disabled');\n } else {\n this.host._internals!.states.delete('disabled');\n }\n\n if (this.host.readOnly) {\n this.host._internals!.ariaDisabled = null;\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAoD;CAClE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAwB,CAAQ,CAAC;AACjF;AAIA,IAAa,IAAb,MAAuF;CACrF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,EAAgB,KAAK,IAAI;CAC3B;CAEA,cAAc;EAaZ,AAZI,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,aAAa,KAAA,IACxD,KAAK,KAAK,WAAY,eAAe,GAAG,KAAK,KAAK,aAElD,KAAK,KAAK,WAAY,eAAe,MAGnC,KAAK,KAAK,WACZ,KAAK,KAAK,WAAY,OAAO,IAAI,UAAU,IAE3C,KAAK,KAAK,WAAY,OAAO,OAAO,UAAU,GAG5C,KAAK,KAAK,aACZ,KAAK,KAAK,WAAY,eAAe;CAEzC;AACF"}
|
|
@@ -7,7 +7,7 @@ import { ReactiveController, ReactiveElement } from 'lit';
|
|
|
7
7
|
export declare function stateExpanded<T extends Expanded>(): ClassDecorator;
|
|
8
8
|
export type Expanded = ReactiveElement & {
|
|
9
9
|
expanded: boolean;
|
|
10
|
-
|
|
10
|
+
readOnly?: boolean;
|
|
11
11
|
_internals?: ElementInternals;
|
|
12
12
|
};
|
|
13
13
|
export declare class StateExpandedController<T extends Expanded> implements ReactiveController {
|
|
@@ -11,7 +11,7 @@ var n = class {
|
|
|
11
11
|
e(this.host);
|
|
12
12
|
}
|
|
13
13
|
hostUpdated() {
|
|
14
|
-
this.host.expanded !== null && this.host.expanded !== void 0 && (this.host._internals.ariaExpanded = `${this.host.expanded}`), this.host.expanded ? this.host._internals.states.add("expanded") : this.host._internals.states.delete("expanded"), this.host.
|
|
14
|
+
this.host.expanded !== null && this.host.expanded !== void 0 && (this.host._internals.ariaExpanded = `${this.host.expanded}`), this.host.expanded ? this.host._internals.states.add("expanded") : this.host._internals.states.delete("expanded"), this.host.readOnly && (this.host._internals.ariaExpanded = null, this.host._internals.states.delete("expanded"));
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-expanded.controller.js","names":[],"sources":["../../../src/internal/controllers/state-expanded.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds expanded support for interactive custom elements including CSS State psuedo-selector :state(expanded) and aria-expanded.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded\n */\nexport function stateExpanded<T extends Expanded>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateExpandedController(instance));\n}\n\nexport type Expanded = ReactiveElement & { expanded: boolean;
|
|
1
|
+
{"version":3,"file":"state-expanded.controller.js","names":[],"sources":["../../../src/internal/controllers/state-expanded.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds expanded support for interactive custom elements including CSS State psuedo-selector :state(expanded) and aria-expanded.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded\n */\nexport function stateExpanded<T extends Expanded>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StateExpandedController(instance));\n}\n\nexport type Expanded = ReactiveElement & { expanded: boolean; readOnly?: boolean; _internals?: ElementInternals };\n\nexport class StateExpandedController<T extends Expanded> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.expanded !== null && this.host.expanded !== undefined) {\n this.host._internals!.ariaExpanded = `${this.host.expanded}`;\n }\n\n if (this.host.expanded) {\n this.host._internals!.states.add('expanded');\n } else {\n this.host._internals!.states.delete('expanded');\n }\n\n if (this.host.readOnly) {\n this.host._internals!.ariaExpanded = null;\n this.host._internals!.states.delete('expanded');\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAoD;CAClE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAwB,CAAQ,CAAC;AACjF;AAIA,IAAa,IAAb,MAAuF;CACrF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,EAAgB,KAAK,IAAI;CAC3B;CAEA,cAAc;EAWZ,AAVI,KAAK,KAAK,aAAa,QAAQ,KAAK,KAAK,aAAa,KAAA,MACxD,KAAK,KAAK,WAAY,eAAe,GAAG,KAAK,KAAK,aAGhD,KAAK,KAAK,WACZ,KAAK,KAAK,WAAY,OAAO,IAAI,UAAU,IAE3C,KAAK,KAAK,WAAY,OAAO,OAAO,UAAU,GAG5C,KAAK,KAAK,aACZ,KAAK,KAAK,WAAY,eAAe,MACrC,KAAK,KAAK,WAAY,OAAO,OAAO,UAAU;CAElD;AACF"}
|
|
@@ -7,7 +7,7 @@ import { ReactiveController, ReactiveElement } from 'lit';
|
|
|
7
7
|
export declare function statePressed<T extends Pressed>(): ClassDecorator;
|
|
8
8
|
export type Pressed = ReactiveElement & {
|
|
9
9
|
pressed: boolean;
|
|
10
|
-
|
|
10
|
+
readOnly?: boolean;
|
|
11
11
|
_internals?: ElementInternals;
|
|
12
12
|
};
|
|
13
13
|
export declare class StatePressedController<T extends Pressed> implements ReactiveController {
|
|
@@ -11,7 +11,7 @@ var n = class {
|
|
|
11
11
|
e(this.host);
|
|
12
12
|
}
|
|
13
13
|
hostUpdated() {
|
|
14
|
-
this.host.pressed !== null && this.host.pressed !== void 0 && (this.host._internals.ariaPressed = `${this.host.pressed}`), this.host.pressed ? this.host._internals.states.add("pressed") : this.host._internals.states.delete("pressed"), this.host.
|
|
14
|
+
this.host.pressed !== null && this.host.pressed !== void 0 && (this.host._internals.ariaPressed = `${this.host.pressed}`), this.host.pressed ? this.host._internals.states.add("pressed") : this.host._internals.states.delete("pressed"), this.host.readOnly && (this.host._internals.ariaPressed = null, this.host._internals.states.delete("pressed"));
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-pressed.controller.js","names":[],"sources":["../../../src/internal/controllers/state-pressed.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds pressed support for interactive custom elements including CSS State psuedo-selector :state(pressed) and aria-pressed.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed\n */\nexport function statePressed<T extends Pressed>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StatePressedController(instance));\n}\n\nexport type Pressed = ReactiveElement & { pressed: boolean;
|
|
1
|
+
{"version":3,"file":"state-pressed.controller.js","names":[],"sources":["../../../src/internal/controllers/state-pressed.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\nimport type { LegacyDecoratorTarget } from '../types/index.js';\nimport { attachInternals } from '../utils/a11y.js';\n\n/**\n * Adds pressed support for interactive custom elements including CSS State psuedo-selector :state(pressed) and aria-pressed.\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed\n */\nexport function statePressed<T extends Pressed>(): ClassDecorator {\n return (target: LegacyDecoratorTarget) =>\n target.addInitializer!((instance: T) => new StatePressedController(instance));\n}\n\nexport type Pressed = ReactiveElement & { pressed: boolean; readOnly?: boolean; _internals?: ElementInternals };\n\nexport class StatePressedController<T extends Pressed> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n attachInternals(this.host);\n }\n\n hostUpdated() {\n if (this.host.pressed !== null && this.host.pressed !== undefined) {\n this.host._internals!.ariaPressed = `${this.host.pressed}`;\n }\n\n if (this.host.pressed) {\n this.host._internals!.states.add('pressed');\n } else {\n this.host._internals!.states.delete('pressed');\n }\n\n if (this.host.readOnly) {\n this.host._internals!.ariaPressed = null;\n this.host._internals!.states.delete('pressed');\n }\n }\n}\n"],"mappings":";;AAYA,SAAgB,IAAkD;CAChE,QAAQ,MACN,EAAO,gBAAiB,MAAgB,IAAI,EAAuB,CAAQ,CAAC;AAChF;AAIA,IAAa,IAAb,MAAqF;CACnF,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,EAAgB,KAAK,IAAI;CAC3B;CAEA,cAAc;EAWZ,AAVI,KAAK,KAAK,YAAY,QAAQ,KAAK,KAAK,YAAY,KAAA,MACtD,KAAK,KAAK,WAAY,cAAc,GAAG,KAAK,KAAK,YAG/C,KAAK,KAAK,UACZ,KAAK,KAAK,WAAY,OAAO,IAAI,SAAS,IAE1C,KAAK,KAAK,WAAY,OAAO,OAAO,SAAS,GAG3C,KAAK,KAAK,aACZ,KAAK,KAAK,WAAY,cAAc,MACpC,KAAK,KAAK,WAAY,OAAO,OAAO,SAAS;CAEjD;AACF"}
|
|
@@ -7,7 +7,7 @@ import { ReactiveController, ReactiveElement } from 'lit';
|
|
|
7
7
|
export declare function stateSelected<T extends Selected>(): ClassDecorator;
|
|
8
8
|
export type Selected = ReactiveElement & {
|
|
9
9
|
selected: boolean;
|
|
10
|
-
|
|
10
|
+
readOnly?: boolean;
|
|
11
11
|
_internals?: ElementInternals;
|
|
12
12
|
};
|
|
13
13
|
export declare class StateSelectedController<T extends Selected> implements ReactiveController {
|