@nvidia-elements/forms
Advanced tools
+34
-0
@@ -0,1 +1,35 @@ | ||
| ## <small>2.0.4 (2026-07-21)</small> | ||
| * fix(cli): improve api metadata ([b2c13ab](https://github.com/NVIDIA/elements/commit/b2c13ab)) | ||
| * fix(cli): mute interactions on non tty sessions ([ba3230a](https://github.com/NVIDIA/elements/commit/ba3230a)) | ||
| * fix(code): include custom data documentation references ([f4efebb](https://github.com/NVIDIA/elements/commit/f4efebb)) | ||
| * fix(core): align root tree nodes ([6008461](https://github.com/NVIDIA/elements/commit/6008461)) | ||
| * fix(core): api documentation ([a02b9e2](https://github.com/NVIDIA/elements/commit/a02b9e2)) | ||
| * fix(core): collapsed tab group ([b7be2d9](https://github.com/NVIDIA/elements/commit/b7be2d9)) | ||
| * fix(core): ensure proper property and attribute reflection for button types ([af780c6](https://github.com/NVIDIA/elements/commit/af780c6)) | ||
| * fix(core): include custom data documentation references ([bf9168c](https://github.com/NVIDIA/elements/commit/bf9168c)) | ||
| * fix(core): page header text wrap issue ([03c481f](https://github.com/NVIDIA/elements/commit/03c481f)) | ||
| * fix(forms): proper property and attribute reflection for button mixin ([e6093dd](https://github.com/NVIDIA/elements/commit/e6093dd)) | ||
| * fix(lint): enhance data binding checks and update test cases for popover triggers ([56e4701](https://github.com/NVIDIA/elements/commit/56e4701)) | ||
| * fix(lint): support framework event bindings ([4a1e72d](https://github.com/NVIDIA/elements/commit/4a1e72d)) | ||
| * fix(markdown): include custom data documentation references ([b887400](https://github.com/NVIDIA/elements/commit/b887400)) | ||
| * fix(monaco): include custom data documentation references ([75f42f5](https://github.com/NVIDIA/elements/commit/75f42f5)) | ||
| * chore(ci): indexnow doc updates ([669552f](https://github.com/NVIDIA/elements/commit/669552f)) | ||
| * chore(ci): update lighthouse ([b5b71ca](https://github.com/NVIDIA/elements/commit/b5b71ca)) | ||
| * chore(ci): update metrics ([96ebb4b](https://github.com/NVIDIA/elements/commit/96ebb4b)) | ||
| * chore(docs): add custom data reference tests ([af48603](https://github.com/NVIDIA/elements/commit/af48603)) | ||
| * chore(internals): generate custom data references ([3f2bd36](https://github.com/NVIDIA/elements/commit/3f2bd36)) | ||
| * chore(release): @nvidia-elements/cli-v2.1.5 [skip ci] ([7e217b8](https://github.com/NVIDIA/elements/commit/7e217b8)) | ||
| * chore(release): @nvidia-elements/code-v2.0.2 [skip ci] ([f69e036](https://github.com/NVIDIA/elements/commit/f69e036)) | ||
| * chore(release): @nvidia-elements/core-v2.1.0 [skip ci] ([9a874bd](https://github.com/NVIDIA/elements/commit/9a874bd)) | ||
| * chore(release): @nvidia-elements/core-v2.1.1 [skip ci] ([3e67a33](https://github.com/NVIDIA/elements/commit/3e67a33)) | ||
| * chore(release): @nvidia-elements/core-v2.1.2 [skip ci] ([051719c](https://github.com/NVIDIA/elements/commit/051719c)) | ||
| * chore(release): @nvidia-elements/core-v2.1.3 [skip ci] ([b6c09ba](https://github.com/NVIDIA/elements/commit/b6c09ba)) | ||
| * chore(release): @nvidia-elements/lint-v2.1.0 [skip ci] ([e668854](https://github.com/NVIDIA/elements/commit/e668854)) | ||
| * chore(release): @nvidia-elements/lint-v2.1.1 [skip ci] ([efb7a71](https://github.com/NVIDIA/elements/commit/efb7a71)) | ||
| * chore(release): @nvidia-elements/markdown-v2.0.2 [skip ci] ([953ef48](https://github.com/NVIDIA/elements/commit/953ef48)) | ||
| * chore(release): @nvidia-elements/monaco-v2.0.2 [skip ci] ([12820b1](https://github.com/NVIDIA/elements/commit/12820b1)) | ||
| * chore(release): @nvidia-elements/styles-v2.1.0 [skip ci] ([25eb987](https://github.com/NVIDIA/elements/commit/25eb987)) | ||
| * feat(lint): add prefer-aria-label-in-compact-containers rule ([130279f](https://github.com/NVIDIA/elements/commit/130279f)) | ||
| ## <small>2.0.3 (2026-07-18)</small> | ||
@@ -2,0 +36,0 @@ |
@@ -580,2 +580,13 @@ { | ||
| { | ||
| "kind": "field", | ||
| "name": "#inferredInterestForElement", | ||
| "privacy": "private", | ||
| "type": { | ||
| "text": "HTMLElement | null", | ||
| "_sourceAliases": [], | ||
| "values": [] | ||
| }, | ||
| "default": "null" | ||
| }, | ||
| { | ||
| "kind": "method", | ||
@@ -600,4 +611,45 @@ "name": "hostConnected" | ||
| "kind": "method", | ||
| "name": "#updateInterestForElement", | ||
| "name": "#dispatchInterestEvent", | ||
| "privacy": "private", | ||
| "parameters": [ | ||
| { | ||
| "name": "type", | ||
| "type": { | ||
| "text": "'interest' | 'loseinterest'" | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "kind": "method", | ||
| "name": "#getInterestForElement", | ||
| "privacy": "private" | ||
| }, | ||
| { | ||
| "kind": "method", | ||
| "name": "#getExplicitInterestForElement", | ||
| "privacy": "private", | ||
| "return": { | ||
| "type": { | ||
| "text": "HTMLElement | null | undefined" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "kind": "method", | ||
| "name": "#getHintPopoverTarget", | ||
| "privacy": "private" | ||
| }, | ||
| { | ||
| "kind": "method", | ||
| "name": "#getElementById", | ||
| "privacy": "private", | ||
| "parameters": [ | ||
| { | ||
| "name": "id", | ||
| "type": { | ||
| "text": "string | null" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
@@ -604,0 +656,0 @@ ] |
+1
-1
| //#region src/index.ts | ||
| var e = "2.0.3"; | ||
| var e = "2.0.4"; | ||
| //#endregion | ||
@@ -4,0 +4,0 @@ export { e as VERSION }; |
| import { getFlattenedDOMTree as e } from "../utils.js"; | ||
| //#region src/internal/controllers/type-interest-invoker.controller.ts | ||
| var t = class { | ||
| #e = null; | ||
| constructor(e) { | ||
@@ -8,28 +9,38 @@ this.host = e, this.host.addController(this); | ||
| hostConnected() { | ||
| this.host.addEventListener("mouseenter", this.#e), this.host.addEventListener("mouseleave", this.#t), this.host.addEventListener("focus", this.#e), this.host.addEventListener("blur", this.#t); | ||
| this.host.addEventListener("mouseenter", this.#t), this.host.addEventListener("mouseleave", this.#n), this.host.addEventListener("focus", this.#t), this.host.addEventListener("blur", this.#n); | ||
| } | ||
| hostDisconnected() { | ||
| this.host.removeEventListener("mouseenter", this.#e), this.host.removeEventListener("mouseleave", this.#t), this.host.removeEventListener("focus", this.#e), this.host.removeEventListener("blur", this.#t); | ||
| this.host.removeEventListener("mouseenter", this.#t), this.host.removeEventListener("mouseleave", this.#n), this.host.removeEventListener("focus", this.#t), this.host.removeEventListener("blur", this.#n); | ||
| } | ||
| #e = (e) => { | ||
| if (!(e.type === "focus" && !this.host.matches(":focus-visible")) && !this.host.popoverTargetElement?.matches(":popover-open") && (this.#n(), this.host.interestForElement)) { | ||
| let e = new Event("interest", { cancelable: !0 }); | ||
| e.source = this.host, this.host.interestForElement.dispatchEvent(e); | ||
| } | ||
| #t = (e) => { | ||
| e.type === "focus" && !this.host.matches(":focus-visible") || this.host.popoverTargetElement?.matches(":popover-open") || this.#r("interest"); | ||
| }; | ||
| #t = () => { | ||
| if (this.#n(), this.host.interestForElement) { | ||
| let e = new Event("loseinterest", { cancelable: !0 }); | ||
| e.source = this.host, this.host.interestForElement.dispatchEvent(e); | ||
| } | ||
| }; | ||
| #n() { | ||
| let t = this.host.getAttribute("interestfor"); | ||
| t && !this.host.interestForElement && (this.host.interestForElement = e(this.host.getRootNode()).find((e) => e.id === t) ?? null); | ||
| let n = this.host.getAttribute("popovertarget"); | ||
| if (n && !t) { | ||
| let t = e(this.host.getRootNode()).find((e) => e.id === n); | ||
| t && t.popover === "hint" && (this.host.interestForElement = t); | ||
| } | ||
| #n = () => this.#r("loseinterest"); | ||
| #r(e) { | ||
| let t = this.#i(); | ||
| if (!t) return; | ||
| let n = new Event(e, { cancelable: !0 }); | ||
| n.source = this.host, t.dispatchEvent(n); | ||
| } | ||
| #i() { | ||
| let e = this.#a(); | ||
| if (e !== void 0) return e; | ||
| let t = this.#o(), n = this.#e; | ||
| return this.#e = t, t && this.host.interestForElement !== t ? this.host.interestForElement = t : !t && n && this.host.interestForElement === n && (this.host.interestForElement = null), t; | ||
| } | ||
| #a() { | ||
| let e = this.host.getAttribute("interestfor"); | ||
| if (e) return this.#e = null, this.#s(e); | ||
| let t = this.host.interestForElement; | ||
| if (!(!t || t === this.#e)) return this.#e = null, t; | ||
| } | ||
| #o() { | ||
| let e = this.host.popoverTargetElement; | ||
| if (e instanceof HTMLElement && e.popover === "hint") return e; | ||
| let t = this.#s(this.host.getAttribute("popovertarget")); | ||
| return t instanceof HTMLElement && t.popover === "hint" ? t : null; | ||
| } | ||
| #s(t) { | ||
| return t ? e(this.host.getRootNode()).find((e) => e.id === t) ?? null : null; | ||
| } | ||
| }; | ||
@@ -36,0 +47,0 @@ //#endregion |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"type-interest-invoker.controller.js","names":["#onInterest","#onLoseInterest","#updateInterestForElement"],"sources":["../../../src/internal/controllers/type-interest-invoker.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getFlattenedDOMTree } from '../utils.js';\nimport type { ReactiveController, ReactiveElement } from './types.js';\n\ntype InterestEvent = Event & { source: HTMLElement };\n\ntype InterestInvokerHost = ReactiveElement & {\n interestForElement: HTMLElement | null;\n popoverTargetElement: HTMLElement | null;\n};\n\nexport class TypeInterestInvokerController<T extends InterestInvokerHost> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('mouseenter', this.#onInterest);\n this.host.addEventListener('mouseleave', this.#onLoseInterest);\n this.host.addEventListener('focus', this.#onInterest);\n this.host.addEventListener('blur', this.#onLoseInterest);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('mouseenter', this.#onInterest);\n this.host.removeEventListener('mouseleave', this.#onLoseInterest);\n this.host.removeEventListener('focus', this.#onInterest);\n this.host.removeEventListener('blur', this.#onLoseInterest);\n }\n\n #onInterest = (event: Event) => {\n if (event.type === 'focus' && !this.host.matches(':focus-visible')) {\n return;\n }\n\n if (this.host.popoverTargetElement?.matches(':popover-open')) {\n return;\n }\n\n this.#updateInterestForElement();\n if (this.host.interestForElement) {\n const interest = new Event('interest', { cancelable: true }) as InterestEvent;\n interest.source = this.host;\n this.host.interestForElement.dispatchEvent(interest);\n }\n };\n\n #onLoseInterest = () => {\n this.#updateInterestForElement();\n if (this.host.interestForElement) {\n const event = new Event('loseinterest', { cancelable: true }) as InterestEvent;\n event.source = this.host;\n this.host.interestForElement.dispatchEvent(event);\n }\n };\n\n #updateInterestForElement() {\n const interestForIdRef = this.host.getAttribute('interestfor');\n if (interestForIdRef && !this.host.interestForElement) {\n this.host.interestForElement =\n getFlattenedDOMTree(this.host.getRootNode()).find(element => element.id === interestForIdRef) ?? null;\n }\n\n const popoverTargetIdRef = this.host.getAttribute('popovertarget');\n if (popoverTargetIdRef && !interestForIdRef) {\n const target = getFlattenedDOMTree(this.host.getRootNode()).find(element => element.id === popoverTargetIdRef);\n if (target && target.popover === 'hint') {\n this.host.interestForElement = target;\n }\n }\n }\n}\n"],"mappings":";;AAaA,IAAa,IAAb,MAAwG;CACtG,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EAId,AAHA,KAAK,KAAK,iBAAiB,cAAc,KAAKA,EAAW,GACzD,KAAK,KAAK,iBAAiB,cAAc,KAAKC,EAAe,GAC7D,KAAK,KAAK,iBAAiB,SAAS,KAAKD,EAAW,GACpD,KAAK,KAAK,iBAAiB,QAAQ,KAAKC,EAAe;CACzD;CAEA,mBAAmB;EAIjB,AAHA,KAAK,KAAK,oBAAoB,cAAc,KAAKD,EAAW,GAC5D,KAAK,KAAK,oBAAoB,cAAc,KAAKC,EAAe,GAChE,KAAK,KAAK,oBAAoB,SAAS,KAAKD,EAAW,GACvD,KAAK,KAAK,oBAAoB,QAAQ,KAAKC,EAAe;CAC5D;CAEA,MAAe,MAAiB;EAC1B,QAAM,SAAS,WAAW,CAAC,KAAK,KAAK,QAAQ,gBAAgB,MAI7D,MAAK,KAAK,sBAAsB,QAAQ,eAAe,MAI3D,KAAKC,GAA0B,GAC3B,KAAK,KAAK,qBAAoB;GAChC,IAAM,IAAW,IAAI,MAAM,YAAY,EAAE,YAAY,GAAK,CAAC;GAE3D,AADA,EAAS,SAAS,KAAK,MACvB,KAAK,KAAK,mBAAmB,cAAc,CAAQ;EACrD;CACF;CAEA,WAAwB;EAEtB,IADA,KAAKA,GAA0B,GAC3B,KAAK,KAAK,oBAAoB;GAChC,IAAM,IAAQ,IAAI,MAAM,gBAAgB,EAAE,YAAY,GAAK,CAAC;GAE5D,AADA,EAAM,SAAS,KAAK,MACpB,KAAK,KAAK,mBAAmB,cAAc,CAAK;EAClD;CACF;CAEA,KAA4B;EAC1B,IAAM,IAAmB,KAAK,KAAK,aAAa,aAAa;EAC7D,AAAI,KAAoB,CAAC,KAAK,KAAK,uBACjC,KAAK,KAAK,qBACR,EAAoB,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,MAAK,MAAW,EAAQ,OAAO,CAAgB,KAAK;EAGrG,IAAM,IAAqB,KAAK,KAAK,aAAa,eAAe;EACjE,IAAI,KAAsB,CAAC,GAAkB;GAC3C,IAAM,IAAS,EAAoB,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,MAAK,MAAW,EAAQ,OAAO,CAAkB;GAC7G,AAAI,KAAU,EAAO,YAAY,WAC/B,KAAK,KAAK,qBAAqB;EAEnC;CACF;AACF"} | ||
| {"version":3,"file":"type-interest-invoker.controller.js","names":["#onInterest","#onLoseInterest","#dispatchInterestEvent","#getInterestForElement","#getExplicitInterestForElement","#getHintPopoverTarget","#inferredInterestForElement","#getElementById"],"sources":["../../../src/internal/controllers/type-interest-invoker.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getFlattenedDOMTree } from '../utils.js';\nimport type { ReactiveController, ReactiveElement } from './types.js';\n\ntype InterestEvent = Event & { source: HTMLElement };\n\ntype InterestInvokerHost = ReactiveElement & {\n interestForElement: HTMLElement | null;\n popoverTargetElement: HTMLElement | null;\n};\n\nexport class TypeInterestInvokerController<T extends InterestInvokerHost> implements ReactiveController {\n #inferredInterestForElement: HTMLElement | null = null;\n\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('mouseenter', this.#onInterest);\n this.host.addEventListener('mouseleave', this.#onLoseInterest);\n this.host.addEventListener('focus', this.#onInterest);\n this.host.addEventListener('blur', this.#onLoseInterest);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('mouseenter', this.#onInterest);\n this.host.removeEventListener('mouseleave', this.#onLoseInterest);\n this.host.removeEventListener('focus', this.#onInterest);\n this.host.removeEventListener('blur', this.#onLoseInterest);\n }\n\n #onInterest = (event: Event) => {\n if (event.type === 'focus' && !this.host.matches(':focus-visible')) {\n return;\n }\n\n if (this.host.popoverTargetElement?.matches(':popover-open')) {\n return;\n }\n\n this.#dispatchInterestEvent('interest');\n };\n\n #onLoseInterest = () => this.#dispatchInterestEvent('loseinterest');\n\n #dispatchInterestEvent(type: 'interest' | 'loseinterest') {\n const target = this.#getInterestForElement();\n if (!target) {\n return;\n }\n\n const event = new Event(type, { cancelable: true }) as InterestEvent;\n event.source = this.host;\n target.dispatchEvent(event);\n }\n\n #getInterestForElement() {\n const explicitTarget = this.#getExplicitInterestForElement();\n if (explicitTarget !== undefined) {\n return explicitTarget;\n }\n\n const inferredTarget = this.#getHintPopoverTarget();\n const previousTarget = this.#inferredInterestForElement;\n this.#inferredInterestForElement = inferredTarget;\n if (inferredTarget && this.host.interestForElement !== inferredTarget) {\n this.host.interestForElement = inferredTarget;\n } else if (!inferredTarget && previousTarget && this.host.interestForElement === previousTarget) {\n this.host.interestForElement = null;\n }\n return inferredTarget;\n }\n\n #getExplicitInterestForElement(): HTMLElement | null | undefined {\n const interestForIdRef = this.host.getAttribute('interestfor');\n if (interestForIdRef) {\n this.#inferredInterestForElement = null;\n return this.#getElementById(interestForIdRef);\n }\n\n const interestForElement = this.host.interestForElement;\n if (!interestForElement || interestForElement === this.#inferredInterestForElement) {\n return undefined;\n }\n\n this.#inferredInterestForElement = null;\n return interestForElement;\n }\n\n #getHintPopoverTarget() {\n const popoverTarget = this.host.popoverTargetElement;\n if (popoverTarget instanceof HTMLElement && popoverTarget.popover === 'hint') {\n return popoverTarget;\n }\n\n const target = this.#getElementById(this.host.getAttribute('popovertarget'));\n return target instanceof HTMLElement && target.popover === 'hint' ? target : null;\n }\n\n #getElementById(id: string | null) {\n return id ? (getFlattenedDOMTree(this.host.getRootNode()).find(element => element.id === id) ?? null) : null;\n }\n}\n"],"mappings":";;AAaA,IAAa,IAAb,MAAwG;CACtG,KAAkD;CAElD,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EAId,AAHA,KAAK,KAAK,iBAAiB,cAAc,KAAKA,EAAW,GACzD,KAAK,KAAK,iBAAiB,cAAc,KAAKC,EAAe,GAC7D,KAAK,KAAK,iBAAiB,SAAS,KAAKD,EAAW,GACpD,KAAK,KAAK,iBAAiB,QAAQ,KAAKC,EAAe;CACzD;CAEA,mBAAmB;EAIjB,AAHA,KAAK,KAAK,oBAAoB,cAAc,KAAKD,EAAW,GAC5D,KAAK,KAAK,oBAAoB,cAAc,KAAKC,EAAe,GAChE,KAAK,KAAK,oBAAoB,SAAS,KAAKD,EAAW,GACvD,KAAK,KAAK,oBAAoB,QAAQ,KAAKC,EAAe;CAC5D;CAEA,MAAe,MAAiB;EAC1B,EAAM,SAAS,WAAW,CAAC,KAAK,KAAK,QAAQ,gBAAgB,KAI7D,KAAK,KAAK,sBAAsB,QAAQ,eAAe,KAI3D,KAAKC,GAAuB,UAAU;CACxC;CAEA,WAAwB,KAAKA,GAAuB,cAAc;CAElE,GAAuB,GAAmC;EACxD,IAAM,IAAS,KAAKC,GAAuB;EAC3C,IAAI,CAAC,GACH;EAGF,IAAM,IAAQ,IAAI,MAAM,GAAM,EAAE,YAAY,GAAK,CAAC;EAElD,AADA,EAAM,SAAS,KAAK,MACpB,EAAO,cAAc,CAAK;CAC5B;CAEA,KAAyB;EACvB,IAAM,IAAiB,KAAKC,GAA+B;EAC3D,IAAI,MAAmB,KAAA,GACrB,OAAO;EAGT,IAAM,IAAiB,KAAKC,GAAsB,GAC5C,IAAiB,KAAKC;EAO5B,OANA,KAAKA,KAA8B,GAC/B,KAAkB,KAAK,KAAK,uBAAuB,IACrD,KAAK,KAAK,qBAAqB,IACtB,CAAC,KAAkB,KAAkB,KAAK,KAAK,uBAAuB,MAC/E,KAAK,KAAK,qBAAqB,OAE1B;CACT;CAEA,KAAiE;EAC/D,IAAM,IAAmB,KAAK,KAAK,aAAa,aAAa;EAC7D,IAAI,GAEF,OADA,KAAKA,KAA8B,MAC5B,KAAKC,GAAgB,CAAgB;EAG9C,IAAM,IAAqB,KAAK,KAAK;EACjC,OAAC,KAAsB,MAAuB,KAAKD,KAKvD,OADA,KAAKA,KAA8B,MAC5B;CACT;CAEA,KAAwB;EACtB,IAAM,IAAgB,KAAK,KAAK;EAChC,IAAI,aAAyB,eAAe,EAAc,YAAY,QACpE,OAAO;EAGT,IAAM,IAAS,KAAKC,GAAgB,KAAK,KAAK,aAAa,eAAe,CAAC;EAC3E,OAAO,aAAkB,eAAe,EAAO,YAAY,SAAS,IAAS;CAC/E;CAEA,GAAgB,GAAmB;EACjC,OAAO,IAAM,EAAoB,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,MAAK,MAAW,EAAQ,OAAO,CAAE,KAAK,OAAQ;CAC1G;AACF"} |
@@ -8,3 +8,2 @@ import type { PopoverTargetAction } from '../../mixins/button.types.js'; | ||
| popoverTargetElement: HTMLElement | null; | ||
| popovertarget?: string; | ||
| }; | ||
@@ -11,0 +10,0 @@ export declare class TypePopoverTriggerController<T extends PopoverTriggerHost> implements ReactiveController { |
@@ -16,5 +16,5 @@ import { getFlattenedDOMTree as e, getHostAnchor as t } from "../utils.js"; | ||
| let t = this.host.popoverTargetElement, n = t === this.#e; | ||
| if (!this.host.popovertarget) return this.#e = void 0, n ? (this.host.popoverTargetElement = null, null) : t; | ||
| if (!this.host.getAttribute("popovertarget")) return this.#e = void 0, n ? (this.host.popoverTargetElement = null, null) : t; | ||
| if (t && !n) return t; | ||
| let r = e(this.host.getRootNode()).find((e) => e.id === this.host.popovertarget) ?? null; | ||
| let r = e(this.host.getRootNode()).find((e) => e.id === this.host.getAttribute("popovertarget")) ?? null; | ||
| return r !== t && (this.host.popoverTargetElement = r), this.#e = r, r; | ||
@@ -21,0 +21,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"type-popover-trigger.controller.js","names":["#onClick","#resolvedPopoverTarget","#resolvePopoverTarget","#invokePopover","#handoverInterest","#getPopoverSource"],"sources":["../../../src/internal/controllers/type-popover-trigger.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PopoverTargetAction } from '../../mixins/button.types.js';\nimport { getFlattenedDOMTree, getHostAnchor } from '../utils.js';\nimport type { PopoverAnchorElement } from '../utils.js';\nimport type { ReactiveController, ReactiveElement } from './types.js';\n\ntype InterestEvent = Event & { source: HTMLElement };\n\ntype PopoverTriggerHost = ReactiveElement & {\n disabled: boolean;\n interestForElement: HTMLElement | null;\n popoverTargetAction?: PopoverTargetAction;\n popoverTargetElement: HTMLElement | null;\n popovertarget?: string;\n};\n\nexport class TypePopoverTriggerController<T extends PopoverTriggerHost> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('click', this.#onClick);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('click', this.#onClick);\n }\n\n #resolvedPopoverTarget: HTMLElement | null | undefined;\n\n #resolvePopoverTarget() {\n const popoverTargetElement = this.host.popoverTargetElement;\n const controllerResolvedTarget = popoverTargetElement === this.#resolvedPopoverTarget;\n\n if (!this.host.popovertarget) {\n this.#resolvedPopoverTarget = undefined;\n if (controllerResolvedTarget) {\n this.host.popoverTargetElement = null;\n return null;\n }\n\n return popoverTargetElement;\n }\n\n if (popoverTargetElement && !controllerResolvedTarget) {\n return popoverTargetElement;\n }\n\n const resolvedPopoverTarget =\n getFlattenedDOMTree(this.host.getRootNode()).find(element => element.id === this.host.popovertarget) ?? null;\n if (resolvedPopoverTarget !== popoverTargetElement) {\n this.host.popoverTargetElement = resolvedPopoverTarget;\n }\n this.#resolvedPopoverTarget = resolvedPopoverTarget;\n\n return resolvedPopoverTarget;\n }\n\n #onClick = (event: MouseEvent) => {\n if (event.defaultPrevented || this.host.disabled) {\n return;\n }\n\n const popoverTargetElement = this.#resolvePopoverTarget();\n if (!popoverTargetElement) {\n return;\n }\n\n if (this.#invokePopover(popoverTargetElement)) {\n this.#handoverInterest();\n }\n };\n\n #getPopoverSource(popoverTargetElement: HTMLElement) {\n if ((popoverTargetElement as PopoverAnchorElement).anchor) {\n return getHostAnchor(popoverTargetElement as PopoverAnchorElement);\n }\n\n return this.host as HTMLElement;\n }\n\n #invokePopover(popoverTargetElement: HTMLElement) {\n if (this.host.popoverTargetAction === 'hide') {\n popoverTargetElement.hidePopover();\n return false;\n }\n\n const source = this.#getPopoverSource(popoverTargetElement);\n if (this.host.popoverTargetAction === 'show') {\n popoverTargetElement.showPopover({ source });\n } else {\n popoverTargetElement.togglePopover({ source });\n }\n\n return popoverTargetElement.matches(':popover-open');\n }\n\n #handoverInterest() {\n if (this.host.interestForElement) {\n const loseInterest = new Event('loseinterest', { cancelable: true }) as InterestEvent;\n loseInterest.source = this.host;\n this.host.interestForElement.dispatchEvent(loseInterest);\n }\n }\n}\n"],"mappings":";;AAkBA,IAAa,IAAb,MAAsG;CACpG,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,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AAK,mBAAmB,cAAc,CAAY;EACzD;CACF;AACF"} | ||
| {"version":3,"file":"type-popover-trigger.controller.js","names":["#onClick","#resolvedPopoverTarget","#resolvePopoverTarget","#invokePopover","#handoverInterest","#getPopoverSource"],"sources":["../../../src/internal/controllers/type-popover-trigger.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PopoverTargetAction } from '../../mixins/button.types.js';\nimport { getFlattenedDOMTree, getHostAnchor } from '../utils.js';\nimport type { PopoverAnchorElement } from '../utils.js';\nimport type { ReactiveController, ReactiveElement } from './types.js';\n\ntype InterestEvent = Event & { source: HTMLElement };\n\ntype PopoverTriggerHost = ReactiveElement & {\n disabled: boolean;\n interestForElement: HTMLElement | null;\n popoverTargetAction?: PopoverTargetAction;\n popoverTargetElement: HTMLElement | null;\n};\n\nexport class TypePopoverTriggerController<T extends PopoverTriggerHost> implements ReactiveController {\n constructor(private host: T) {\n this.host.addController(this);\n }\n\n hostConnected() {\n this.host.addEventListener('click', this.#onClick);\n }\n\n hostDisconnected() {\n this.host.removeEventListener('click', this.#onClick);\n }\n\n #resolvedPopoverTarget: HTMLElement | null | undefined;\n\n #resolvePopoverTarget() {\n const popoverTargetElement = this.host.popoverTargetElement;\n const controllerResolvedTarget = popoverTargetElement === this.#resolvedPopoverTarget;\n\n if (!this.host.getAttribute('popovertarget')) {\n this.#resolvedPopoverTarget = undefined;\n if (controllerResolvedTarget) {\n this.host.popoverTargetElement = null;\n return null;\n }\n\n return popoverTargetElement;\n }\n\n if (popoverTargetElement && !controllerResolvedTarget) {\n return popoverTargetElement;\n }\n\n const resolvedPopoverTarget =\n getFlattenedDOMTree(this.host.getRootNode()).find(\n element => element.id === this.host.getAttribute('popovertarget')\n ) ?? null;\n if (resolvedPopoverTarget !== popoverTargetElement) {\n this.host.popoverTargetElement = resolvedPopoverTarget;\n }\n this.#resolvedPopoverTarget = resolvedPopoverTarget;\n\n return resolvedPopoverTarget;\n }\n\n #onClick = (event: MouseEvent) => {\n if (event.defaultPrevented || this.host.disabled) {\n return;\n }\n\n const popoverTargetElement = this.#resolvePopoverTarget();\n if (!popoverTargetElement) {\n return;\n }\n\n if (this.#invokePopover(popoverTargetElement)) {\n this.#handoverInterest();\n }\n };\n\n #getPopoverSource(popoverTargetElement: HTMLElement) {\n if ((popoverTargetElement as PopoverAnchorElement).anchor) {\n return getHostAnchor(popoverTargetElement as PopoverAnchorElement);\n }\n\n return this.host as HTMLElement;\n }\n\n #invokePopover(popoverTargetElement: HTMLElement) {\n if (this.host.popoverTargetAction === 'hide') {\n popoverTargetElement.hidePopover();\n return false;\n }\n\n const source = this.#getPopoverSource(popoverTargetElement);\n if (this.host.popoverTargetAction === 'show') {\n popoverTargetElement.showPopover({ source });\n } else {\n popoverTargetElement.togglePopover({ source });\n }\n\n return popoverTargetElement.matches(':popover-open');\n }\n\n #handoverInterest() {\n if (this.host.interestForElement) {\n const loseInterest = new Event('loseinterest', { cancelable: true }) as InterestEvent;\n loseInterest.source = this.host;\n this.host.interestForElement.dispatchEvent(loseInterest);\n }\n }\n}\n"],"mappings":";;AAiBA,IAAa,IAAb,MAAsG;CACpG,YAAY,GAAiB;EAC3B,AADkB,KAAA,OAAA,GAClB,KAAK,KAAK,cAAc,IAAI;CAC9B;CAEA,gBAAgB;EACd,KAAK,KAAK,iBAAiB,SAAS,KAAKA,EAAQ;CACnD;CAEA,mBAAmB;EACjB,KAAK,KAAK,oBAAoB,SAAS,KAAKA,EAAQ;CACtD;CAEA;CAEA,KAAwB;EACtB,IAAM,IAAuB,KAAK,KAAK,sBACjC,IAA2B,MAAyB,KAAKC;EAE/D,IAAI,CAAC,KAAK,KAAK,aAAa,eAAe,GAOzC,OANA,KAAKA,KAAyB,KAAA,GAC1B,KACF,KAAK,KAAK,uBAAuB,MAC1B,QAGF;EAGT,IAAI,KAAwB,CAAC,GAC3B,OAAO;EAGT,IAAM,IACJ,EAAoB,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,MAC3C,MAAW,EAAQ,OAAO,KAAK,KAAK,aAAa,eAAe,CAClE,KAAK;EAMP,OALI,MAA0B,MAC5B,KAAK,KAAK,uBAAuB,IAEnC,KAAKA,KAAyB,GAEvB;CACT;CAEA,MAAY,MAAsB;EAChC,IAAI,EAAM,oBAAoB,KAAK,KAAK,UACtC;EAGF,IAAM,IAAuB,KAAKC,GAAsB;EACnD,KAID,KAAKC,GAAe,CAAoB,KAC1C,KAAKC,GAAkB;CAE3B;CAEA,GAAkB,GAAmC;EAKnD,OAJK,EAA8C,SAC1C,EAAc,CAA4C,IAG5D,KAAK;CACd;CAEA,GAAe,GAAmC;EAChD,IAAI,KAAK,KAAK,wBAAwB,QAEpC,OADA,EAAqB,YAAY,GAC1B;EAGT,IAAM,IAAS,KAAKC,GAAkB,CAAoB;EAO1D,OANI,KAAK,KAAK,wBAAwB,SACpC,EAAqB,YAAY,EAAE,UAAO,CAAC,IAE3C,EAAqB,cAAc,EAAE,UAAO,CAAC,GAGxC,EAAqB,QAAQ,eAAe;CACrD;CAEA,KAAoB;EAClB,IAAI,KAAK,KAAK,oBAAoB;GAChC,IAAM,IAAe,IAAI,MAAM,gBAAgB,EAAE,YAAY,GAAK,CAAC;GAEnE,AADA,EAAa,SAAS,KAAK,MAC3B,KAAK,KAAK,mBAAmB,cAAc,CAAY;EACzD;CACF;AACF"} |
+133
-143
@@ -1,20 +0,29 @@ | ||
| import { attachInternals as e, getStringValue as t, hasAttributeValue as n, isFormElement as r, setAttributeValue as i } from "../internal/utils.js"; | ||
| import { TypeAnchorController as a } from "../internal/controllers/type-anchor.controller.js"; | ||
| import { TypeButtonController as o } from "../internal/controllers/type-button.controller.js"; | ||
| import { TypeCommandController as s } from "../internal/controllers/type-command.controller.js"; | ||
| import { TypeInterestInvokerController as c } from "../internal/controllers/type-interest-invoker.controller.js"; | ||
| import { TypeSubmitController as l } from "../internal/controllers/type-submit.controller.js"; | ||
| import { TypePopoverTriggerController as u } from "../internal/controllers/type-popover-trigger.controller.js"; | ||
| import { StateActiveController as d } from "../internal/controllers/state-active.controller.js"; | ||
| import { StateCurrentController as f } from "../internal/controllers/state-current.controller.js"; | ||
| import { StateDisabledController as p } from "../internal/controllers/state-disabled.controller.js"; | ||
| import { StateExpandedController as m } from "../internal/controllers/state-expanded.controller.js"; | ||
| import { StatePressedController as h } from "../internal/controllers/state-pressed.controller.js"; | ||
| import { StateReadOnlyController as g } from "../internal/controllers/state-readonly.controller.js"; | ||
| import { StateSelectedController as _ } from "../internal/controllers/state-selected.controller.js"; | ||
| import { attachInternals as e, getFlattenedDOMTree as t, getStringValue as n, hasAttributeValue as r, isFormElement as i, setAttributeValue as a } from "../internal/utils.js"; | ||
| import { TypeAnchorController as o } from "../internal/controllers/type-anchor.controller.js"; | ||
| import { TypeButtonController as s } from "../internal/controllers/type-button.controller.js"; | ||
| import { TypeCommandController as c } from "../internal/controllers/type-command.controller.js"; | ||
| import { TypeInterestInvokerController as l } from "../internal/controllers/type-interest-invoker.controller.js"; | ||
| import { TypeSubmitController as u } from "../internal/controllers/type-submit.controller.js"; | ||
| import { TypePopoverTriggerController as d } from "../internal/controllers/type-popover-trigger.controller.js"; | ||
| import { StateActiveController as f } from "../internal/controllers/state-active.controller.js"; | ||
| import { StateCurrentController as p } from "../internal/controllers/state-current.controller.js"; | ||
| import { StateDisabledController as m } from "../internal/controllers/state-disabled.controller.js"; | ||
| import { StateExpandedController as h } from "../internal/controllers/state-expanded.controller.js"; | ||
| import { StatePressedController as g } from "../internal/controllers/state-pressed.controller.js"; | ||
| import { StateReadOnlyController as _ } from "../internal/controllers/state-readonly.controller.js"; | ||
| import { StateSelectedController as v } from "../internal/controllers/state-selected.controller.js"; | ||
| //#region src/mixins/button.ts | ||
| function v(v) { | ||
| return class y extends v { | ||
| var y = { | ||
| commandfor: "commandForElement", | ||
| interestfor: "interestForElement", | ||
| popovertarget: "popoverTargetElement" | ||
| }; | ||
| function b(b) { | ||
| return class x extends b { | ||
| constructor(...t) { | ||
| super(...t), this.#t = null, this.#n = null, this.#i = !1, this.#o = null, this.#s = !1, this.#c = null, this.#l = null, this.#d = /* @__PURE__ */ new Map(), this.#p = null, this.#g = !1, this.#v = !1, this._internals = e(this), this._typeAnchorController = new a(this), this._typeButtonController = new o(this), this._typeSubmitController = new l(this), this._typeCommandController = new s(this), this._typeInterestInvokerController = new c(this), this._typePopoverTriggerController = new u(this), this._stateActiveController = new d(this), this._stateDisabledController = new p(this), this._stateExpandedController = new m(this), this._statePressedController = new h(this), this._stateSelectedController = new _(this), this._stateCurrentController = new f(this), this._stateReadOnlyController = new g(this); | ||
| super(...t), this.#n = !1, this.#r = { | ||
| commandForElement: null, | ||
| interestForElement: null, | ||
| popoverTargetElement: null | ||
| }, this.#a = null, this.#o = !1, this.#c = /* @__PURE__ */ new Map(), this.#d = !1, this.#p = !1, this._internals = e(this), this._typeAnchorController = new o(this), this._typeButtonController = new s(this), this._typeSubmitController = new u(this), this._typeCommandController = new c(this), this._typeInterestInvokerController = new l(this), this._typePopoverTriggerController = new d(this), this._stateActiveController = new f(this), this._stateDisabledController = new m(this), this._stateExpandedController = new h(this), this._statePressedController = new g(this), this._stateSelectedController = new v(this), this._stateCurrentController = new p(this), this._stateReadOnlyController = new _(this); | ||
| } | ||
@@ -40,7 +49,2 @@ static { | ||
| #h; | ||
| #g; | ||
| #_; | ||
| #v; | ||
| #y; | ||
| #b; | ||
| static get observedAttributes() { | ||
@@ -66,6 +70,6 @@ return (super.observedAttributes ?? []).concat([ | ||
| get pressed() { | ||
| return this.#h; | ||
| return this.#u; | ||
| } | ||
| set pressed(e) { | ||
| this.#T({ | ||
| this.#w({ | ||
| property: "pressed", | ||
@@ -77,6 +81,6 @@ value: !!e, | ||
| get expanded() { | ||
| return this.#a; | ||
| return this.#i; | ||
| } | ||
| set expanded(e) { | ||
| this.#T({ | ||
| this.#w({ | ||
| property: "expanded", | ||
@@ -88,6 +92,6 @@ value: !!e, | ||
| get readOnly() { | ||
| return this.#g || !!this._typeAnchorController?.readOnly; | ||
| return this.#d || !!this._typeAnchorController?.readOnly; | ||
| } | ||
| set readOnly(e) { | ||
| this.#T({ | ||
| this.#w({ | ||
| property: "readOnly", | ||
@@ -107,9 +111,9 @@ value: !!e, | ||
| let t = this.form; | ||
| this.#o = e, typeof e == "string" ? this.setAttribute("form", e) : this.removeAttribute("form"), this.#M("form", t), this.#x(); | ||
| this.#a = e, typeof e == "string" ? this.setAttribute("form", e) : this.removeAttribute("form"), this.#j("form", t), this.#g(); | ||
| } | ||
| get form() { | ||
| if (this.#o && typeof this.#o != "string") return this.#o; | ||
| if (typeof this.#o == "string" && globalThis.document !== void 0) { | ||
| let e = this.getRootNode(), t = e.getElementById ? e.getElementById(this.#o) : null; | ||
| return r(t) ? t : null; | ||
| if (this.#a && typeof this.#a != "string") return this.#a; | ||
| if (typeof this.#a == "string" && globalThis.document !== void 0) { | ||
| let e = this.getRootNode(), t = e.getElementById ? e.getElementById(this.#a) : null; | ||
| return i(t) ? t : null; | ||
| } | ||
@@ -119,6 +123,6 @@ return this._internals?.form ?? null; | ||
| get name() { | ||
| return this.#u; | ||
| return this.#s; | ||
| } | ||
| set name(e) { | ||
| this.#O({ | ||
| this.#D({ | ||
| property: "name", | ||
@@ -129,6 +133,6 @@ value: e | ||
| get value() { | ||
| return this.#b; | ||
| return this.#h; | ||
| } | ||
| set value(e) { | ||
| this.#O({ | ||
| this.#D({ | ||
| property: "value", | ||
@@ -139,6 +143,6 @@ value: e | ||
| get type() { | ||
| return this.#y ?? this._typeSubmitController?.defaultType; | ||
| return this.#m ?? this._typeSubmitController?.defaultType; | ||
| } | ||
| set type(e) { | ||
| this.#O({ | ||
| this.#D({ | ||
| property: "type", | ||
@@ -149,6 +153,6 @@ value: e | ||
| get disabled() { | ||
| return this.#i; | ||
| return this.#n; | ||
| } | ||
| set disabled(e) { | ||
| this.#T({ | ||
| this.#w({ | ||
| property: "disabled", | ||
@@ -160,6 +164,6 @@ value: !!e, | ||
| get selected() { | ||
| return this.#_; | ||
| return this.#f; | ||
| } | ||
| set selected(e) { | ||
| this.#T({ | ||
| this.#w({ | ||
| property: "selected", | ||
@@ -171,6 +175,6 @@ value: !!e, | ||
| get current() { | ||
| return this.#r; | ||
| return this.#t; | ||
| } | ||
| set current(e) { | ||
| this.#O({ | ||
| this.#D({ | ||
| property: "current", | ||
@@ -181,22 +185,12 @@ value: e | ||
| get popoverTargetElement() { | ||
| return this.#p; | ||
| return this.#x("popovertarget"); | ||
| } | ||
| set popoverTargetElement(e) { | ||
| let t = this.#p; | ||
| this.#p = e, this.#M("popoverTargetElement", t), this.#x(); | ||
| this.#C("popovertarget", e); | ||
| } | ||
| get popovertarget() { | ||
| return this.#m; | ||
| } | ||
| set popovertarget(e) { | ||
| this.#O({ | ||
| property: "popovertarget", | ||
| value: e | ||
| }); | ||
| } | ||
| get popoverTargetAction() { | ||
| return this.#f; | ||
| return this.#l === "show" || this.#l === "hide" ? this.#l : "toggle"; | ||
| } | ||
| set popoverTargetAction(e) { | ||
| this.#O({ | ||
| this.#D({ | ||
| property: "popoverTargetAction", | ||
@@ -208,17 +202,7 @@ value: e, | ||
| get commandForElement() { | ||
| return this.#t; | ||
| return this.#x("commandfor"); | ||
| } | ||
| set commandForElement(e) { | ||
| let t = this.#t; | ||
| this.#t = e, this.#M("commandForElement", t), this.#x(); | ||
| this.#C("commandfor", e); | ||
| } | ||
| get commandfor() { | ||
| return this.#n; | ||
| } | ||
| set commandfor(e) { | ||
| this.#O({ | ||
| property: "commandfor", | ||
| value: e | ||
| }); | ||
| } | ||
| get command() { | ||
@@ -228,3 +212,3 @@ return this.#e; | ||
| set command(e) { | ||
| this.#O({ | ||
| this.#D({ | ||
| property: "command", | ||
@@ -235,17 +219,7 @@ value: e | ||
| get interestForElement() { | ||
| return this.#c; | ||
| return this.#x("interestfor"); | ||
| } | ||
| set interestForElement(e) { | ||
| let t = this.#c; | ||
| this.#c = e, this.#M("interestForElement", t), this.#x(); | ||
| this.#C("interestfor", e); | ||
| } | ||
| get interestfor() { | ||
| return this.#l; | ||
| } | ||
| set interestfor(e) { | ||
| this.#O({ | ||
| property: "interestfor", | ||
| value: e | ||
| }); | ||
| } | ||
| addController(e) { | ||
@@ -255,3 +229,3 @@ this._controllers ??= /* @__PURE__ */ new Set(), this._controllers.add(e); | ||
| connectedCallback() { | ||
| super.connectedCallback?.(), this._controllers?.forEach((e) => e.hostConnected?.()), e(this), this.#s = !0, this.#P(), this.#S(), this.#x(); | ||
| super.connectedCallback?.(), this._controllers?.forEach((e) => e.hostConnected?.()), e(this), this.#o = !0, this.#N(), this.#_(), this.#g(); | ||
| } | ||
@@ -262,21 +236,21 @@ disconnectedCallback() { | ||
| updated(e) { | ||
| Object.getPrototypeOf(y.prototype).updated?.call(this, e), this.#v = !1, this.#S(); | ||
| Object.getPrototypeOf(x.prototype).updated?.call(this, e), this.#p = !1, this.#_(); | ||
| } | ||
| attributeChangedCallback(e, t, n) { | ||
| super.attributeChangedCallback?.(e, t, n), t !== n && (this.#C(e, n), this.#w(e, t, n)); | ||
| super.attributeChangedCallback?.(e, t, n), t !== n && (this.#v(e, n), this.#b(e, t), this.#y(e, t, n)); | ||
| } | ||
| #x() { | ||
| !this.isConnected || this.#v || (this.#v = !0, this.#N().then(() => { | ||
| this.#v && (this.#v = !1, this.isConnected && this.#S()); | ||
| #g() { | ||
| !this.isConnected || this.#p || (this.#p = !0, this.#M().then(() => { | ||
| this.#p && (this.#p = !1, this.isConnected && this.#_()); | ||
| })); | ||
| } | ||
| #S() { | ||
| #_() { | ||
| this._controllers?.forEach((e) => e.hostUpdated?.()); | ||
| } | ||
| #C(e, t) { | ||
| (e === "pressed" || e === "expanded" || e === "selected" || e === "disabled") && this.#T({ | ||
| #v(e, t) { | ||
| (e === "pressed" || e === "expanded" || e === "selected" || e === "disabled") && this.#w({ | ||
| property: e, | ||
| value: t !== null, | ||
| reflect: !1 | ||
| }), e === "readonly" && this.#T({ | ||
| }), e === "readonly" && this.#w({ | ||
| property: "readOnly", | ||
@@ -287,70 +261,86 @@ value: t !== null, | ||
| } | ||
| #w(e, t, n) { | ||
| e === "form" && (r(this.#o) && n === null || (this.#o = n, this.#M("form", t))), e === "popovertargetaction" && this.#O({ | ||
| property: "popoverTargetAction", | ||
| value: n, | ||
| reflect: !1 | ||
| }), this.#O({ | ||
| property: e, | ||
| value: n, | ||
| reflect: !1 | ||
| }); | ||
| #y(e, t, n) { | ||
| if (!(e === "commandfor" || e === "interestfor" || e === "popovertarget")) { | ||
| if (e === "form" && (i(this.#a) && n === null || (this.#a = n, this.#j("form", t))), e === "popovertargetaction") { | ||
| this.#D({ | ||
| property: "popoverTargetAction", | ||
| value: n, | ||
| reflect: !1 | ||
| }); | ||
| return; | ||
| } | ||
| this.#D({ | ||
| property: e, | ||
| value: n, | ||
| reflect: !1 | ||
| }); | ||
| } | ||
| } | ||
| #T({ property: e, value: t, reflect: r, attribute: i = e }) { | ||
| let a = this.#E(e); | ||
| a === t && (!r || n(this, i, t ? "" : null)) || (this.#D(e, t), !(r && this.#j(i, t ? "" : null)) && (this.#M(e, a), this.#x())); | ||
| #b(e, t) { | ||
| let n = y[e]; | ||
| if (!n) return; | ||
| let r = this.#r[n] ?? this.#S(t); | ||
| this.#r[n] = null, this.#j(n, r), this.#g(); | ||
| } | ||
| #E(e) { | ||
| #x(e) { | ||
| return this.#r[y[e]] ?? this.#S(this.getAttribute(e)); | ||
| } | ||
| #S(e) { | ||
| return e ? t(this.getRootNode()).find((t) => t.id === e) ?? null : null; | ||
| } | ||
| #C(e, t) { | ||
| let n = y[e], i = this[n]; | ||
| i === t && r(this, e, t ? "" : null) || (a(this, e, t ? "" : null), this.#r[n] = t, this.#j(n, i), this.#g()); | ||
| } | ||
| #w({ property: e, value: t, reflect: n, attribute: i = e }) { | ||
| let a = this.#T(e); | ||
| a === t && (!n || r(this, i, t ? "" : null)) || (this.#E(e, t), !(n && this.#A(i, t ? "" : null)) && (this.#j(e, a), this.#g())); | ||
| } | ||
| #T(e) { | ||
| return { | ||
| disabled: this.#i, | ||
| expanded: this.#a, | ||
| pressed: this.#h, | ||
| readOnly: this.#g, | ||
| selected: this.#_ | ||
| disabled: this.#n, | ||
| expanded: this.#i, | ||
| pressed: this.#u, | ||
| readOnly: this.#d, | ||
| selected: this.#f | ||
| }[e]; | ||
| } | ||
| #D(e, t) { | ||
| e === "disabled" ? this.#i = t : e === "expanded" ? this.#a = t : e === "pressed" ? this.#h = t : e === "readOnly" ? this.#g = t : e === "selected" && (this.#_ = t); | ||
| #E(e, t) { | ||
| e === "disabled" ? this.#n = t : e === "expanded" ? this.#i = t : e === "pressed" ? this.#u = t : e === "readOnly" ? this.#d = t : e === "selected" && (this.#f = t); | ||
| } | ||
| #O({ property: e, value: r, attribute: i = e, reflect: a = !0 }) { | ||
| let o = this.#k(e), s = t(r); | ||
| o === s && (!a || n(this, i, s)) || (this.#A(e, s), !(a && this.#j(i, s)) && (this.#M(e, o), this.#x())); | ||
| #D({ property: e, value: t, attribute: i = e, reflect: a = !0 }) { | ||
| let o = this.#O(e), s = n(t); | ||
| o === s && (!a || r(this, i, s)) || (this.#k(e, s), !(a && this.#A(i, s)) && (this.#j(e, o), this.#g())); | ||
| } | ||
| #k(e) { | ||
| #O(e) { | ||
| return { | ||
| command: this.#e, | ||
| commandfor: this.#n, | ||
| current: this.#r, | ||
| interestfor: this.#l, | ||
| name: this.#u, | ||
| popoverTargetAction: this.#f, | ||
| popovertarget: this.#m, | ||
| type: this.#y, | ||
| value: this.#b | ||
| current: this.#t, | ||
| name: this.#s, | ||
| popoverTargetAction: this.#l, | ||
| type: this.#m, | ||
| value: this.#h | ||
| }[e]; | ||
| } | ||
| #A(e, t) { | ||
| #k(e, t) { | ||
| ({ | ||
| command: () => this.#e = t ?? void 0, | ||
| commandfor: () => this.#n = t, | ||
| current: () => this.#r = t, | ||
| interestfor: () => this.#l = t, | ||
| name: () => this.#u = t ?? void 0, | ||
| popoverTargetAction: () => this.#f = t, | ||
| popovertarget: () => this.#m = t ?? void 0, | ||
| type: () => this.#y = t, | ||
| value: () => this.#b = t ?? void 0 | ||
| current: () => this.#t = t, | ||
| name: () => this.#s = t ?? void 0, | ||
| popoverTargetAction: () => this.#l = t, | ||
| type: () => this.#m = t, | ||
| value: () => this.#h = t ?? void 0 | ||
| })[e]?.(); | ||
| } | ||
| #A(e, t) { | ||
| return !this.isConnected && !this.#o ? (this.hasAttribute(e) || this.#c.set(e, t), !0) : (a(this, e, t), !1); | ||
| } | ||
| #j(e, t) { | ||
| return !this.isConnected && !this.#s ? (this.hasAttribute(e) || this.#d.set(e, t), !0) : (i(this, e, t), !1); | ||
| } | ||
| #M(e, t) { | ||
| this.requestUpdate?.(e, t); | ||
| } | ||
| #N() { | ||
| #M() { | ||
| return this.updateComplete ?? Promise.resolve(); | ||
| } | ||
| #P() { | ||
| this.#d.forEach((e, t) => i(this, t, e)), this.#d.clear(); | ||
| #N() { | ||
| this.#c.forEach((e, t) => a(this, t, e)), this.#c.clear(); | ||
| } | ||
@@ -360,4 +350,4 @@ }; | ||
| //#endregion | ||
| export { v as ButtonFormControlMixin }; | ||
| export { b as ButtonFormControlMixin }; | ||
| //# sourceMappingURL=button.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"button.js","names":["#pressed","#setBooleanState","#expanded","#readOnly","#form","#requestHostUpdate","#queueBehaviorSync","#name","#setStringState","#value","#type","#disabled","#selected","#current","#popoverTargetElement","#popovertarget","#popoverTargetAction","#commandForElement","#commandfor","#command","#interestForElement","#interestfor","#hasConnected","#flushPendingAttributeReflections","#syncBehavior","#syncQueued","#handleBooleanAttributeChange","#handleStringAttributeChange","#getHostUpdateComplete","#getBooleanValue","#setBooleanValue","#reflectAttribute","#getStringValue","#setStringValue","#pendingAttributeReflections"],"sources":["../../src/mixins/button.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { TypeAnchorController } from '../internal/controllers/type-anchor.controller.js';\nimport { TypeButtonController } from '../internal/controllers/type-button.controller.js';\nimport { TypeCommandController } from '../internal/controllers/type-command.controller.js';\nimport { TypeInterestInvokerController } from '../internal/controllers/type-interest-invoker.controller.js';\nimport { TypeSubmitController } from '../internal/controllers/type-submit.controller.js';\nimport { TypePopoverTriggerController } from '../internal/controllers/type-popover-trigger.controller.js';\nimport { StateActiveController } from '../internal/controllers/state-active.controller.js';\nimport { StateCurrentController } from '../internal/controllers/state-current.controller.js';\nimport { StateDisabledController } from '../internal/controllers/state-disabled.controller.js';\nimport { StateExpandedController } from '../internal/controllers/state-expanded.controller.js';\nimport { StatePressedController } from '../internal/controllers/state-pressed.controller.js';\nimport { StateReadOnlyController } from '../internal/controllers/state-readonly.controller.js';\nimport { StateSelectedController } from '../internal/controllers/state-selected.controller.js';\nimport type { ReactiveController } from '../internal/controllers/types.js';\nimport {\n attachInternals,\n getStringValue,\n hasAttributeValue,\n isFormElement,\n setAttributeValue\n} from '../internal/utils.js';\nimport type { ButtonFormControlMixinInstance, ButtonType, CurrentState, PopoverTargetAction } from './button.types.js';\nexport type { ButtonFormControlMixinInstance, ButtonType, CurrentState, PopoverTargetAction } from './button.types.js';\n\ntype ChangedProperties = Map<PropertyKey, unknown>;\ninterface ButtonFormControlHost {\n connectedCallback?(): void;\n disconnectedCallback?(): void;\n attributeChangedCallback?(name: string, oldValue: string | null, newValue: string | null): void;\n requestUpdate?(name?: string, oldValue?: unknown): void;\n updateComplete?: Promise<unknown>;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Constructor = (new (...args: any[]) => HTMLElement & ButtonFormControlHost) & { observedAttributes?: string[] };\n\ninterface BooleanStateOptions {\n property: string;\n value: boolean;\n reflect: boolean;\n attribute?: string;\n}\n\ninterface StringStateOptions {\n property: string;\n value: unknown;\n attribute?: string;\n reflect?: boolean;\n}\n\ntype ButtonFormControlConstructor<TBase extends Constructor> = new (\n ...args: ConstructorParameters<TBase>\n) => InstanceType<TBase> & ButtonFormControlMixinInstance;\nexport type ButtonFormControlMixinReturn<TBase extends Constructor> = ButtonFormControlConstructor<TBase> & {\n formAssociated: boolean;\n observedAttributes: string[];\n} & Omit<TBase, 'prototype'>;\n\n/**\n * @description A mixin that adds native button-style form, command, popover, and interaction behavior.\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/button/\n */\nexport function ButtonFormControlMixin<TBase extends Constructor>(\n SuperClass: TBase\n): ButtonFormControlMixinReturn<TBase> {\n return class ButtonFormControlBase extends SuperClass {\n static formAssociated = true;\n\n #command: string | undefined;\n #commandForElement: HTMLElement | null = null;\n #commandfor: string | null = null;\n #current: CurrentState | undefined;\n #disabled = false;\n #expanded: boolean | undefined;\n #form: string | HTMLFormElement | null = null;\n #hasConnected = false;\n #interestForElement: HTMLElement | null = null;\n #interestfor: string | null = null;\n #name: string | undefined;\n #pendingAttributeReflections = new Map<string, string | null>();\n #popoverTargetAction: PopoverTargetAction | undefined;\n #popoverTargetElement: HTMLElement | null = null;\n #popovertarget: string | undefined;\n #pressed: boolean | undefined;\n #readOnly = false;\n #selected: boolean | undefined;\n #syncQueued = false;\n #type: ButtonType | undefined;\n #value: string | undefined;\n\n _internals = attachInternals(this);\n\n static get observedAttributes() {\n return (super.observedAttributes ?? []).concat([\n 'pressed',\n 'expanded',\n 'readonly',\n 'form',\n 'name',\n 'value',\n 'type',\n 'disabled',\n 'selected',\n 'current',\n 'popovertarget',\n 'popovertargetaction',\n 'commandfor',\n 'command',\n 'interestfor'\n ]);\n }\n\n get pressed(): boolean {\n return this.#pressed as boolean;\n }\n\n set pressed(value: boolean | unknown) {\n this.#setBooleanState({ property: 'pressed', value: Boolean(value), reflect: true });\n }\n\n get expanded(): boolean {\n return this.#expanded as boolean;\n }\n\n set expanded(value: boolean | unknown) {\n this.#setBooleanState({ property: 'expanded', value: Boolean(value), reflect: true });\n }\n\n get readOnly(): boolean {\n return this.#readOnly || Boolean(this._typeAnchorController?.readOnly);\n }\n\n set readOnly(value: boolean | unknown) {\n this.#setBooleanState({ property: 'readOnly', value: Boolean(value), reflect: true, attribute: 'readonly' });\n }\n\n get readonly(): boolean {\n return this.readOnly;\n }\n\n set readonly(value: boolean) {\n this.readOnly = value;\n }\n\n set form(form: string | HTMLFormElement | null) {\n const oldValue = this.form;\n this.#form = form;\n if (typeof form === 'string') {\n this.setAttribute('form', form);\n } else {\n this.removeAttribute('form');\n }\n this.#requestHostUpdate('form', oldValue);\n this.#queueBehaviorSync();\n }\n\n get form(): HTMLFormElement | null | string {\n if (this.#form && typeof this.#form !== 'string') {\n return this.#form;\n }\n\n if (typeof this.#form === 'string' && typeof globalThis.document !== 'undefined') {\n const rootNode = this.getRootNode() as Document | ShadowRoot;\n const form = rootNode.getElementById ? rootNode.getElementById(this.#form) : null;\n return isFormElement(form) ? form : null;\n }\n\n return this._internals?.form ?? null;\n }\n\n get name(): string {\n return this.#name as string;\n }\n\n set name(value: string | unknown) {\n this.#setStringState({ property: 'name', value });\n }\n\n get value(): string {\n return this.#value as string;\n }\n\n set value(value: string | unknown) {\n this.#setStringState({ property: 'value', value });\n }\n\n get type(): ButtonType {\n return (this.#type ?? this._typeSubmitController?.defaultType) as ButtonType;\n }\n\n set type(value: ButtonType | unknown) {\n this.#setStringState({ property: 'type', value });\n }\n\n get disabled(): boolean {\n return this.#disabled;\n }\n\n set disabled(value: boolean | unknown) {\n this.#setBooleanState({ property: 'disabled', value: Boolean(value), reflect: true });\n }\n\n get selected(): boolean {\n return this.#selected as boolean;\n }\n\n set selected(value: boolean | unknown) {\n this.#setBooleanState({ property: 'selected', value: Boolean(value), reflect: true });\n }\n\n get current(): CurrentState {\n return this.#current as CurrentState;\n }\n\n set current(value: CurrentState | unknown) {\n this.#setStringState({ property: 'current', value });\n }\n\n get popoverTargetElement(): HTMLElement | null {\n return this.#popoverTargetElement;\n }\n\n set popoverTargetElement(value: HTMLElement | null) {\n const oldValue = this.#popoverTargetElement;\n this.#popoverTargetElement = value;\n this.#requestHostUpdate('popoverTargetElement', oldValue);\n this.#queueBehaviorSync();\n }\n\n get popovertarget(): string {\n return this.#popovertarget as string;\n }\n\n set popovertarget(value: string | unknown) {\n this.#setStringState({ property: 'popovertarget', value });\n }\n\n get popoverTargetAction(): PopoverTargetAction {\n return this.#popoverTargetAction as PopoverTargetAction;\n }\n\n set popoverTargetAction(value: PopoverTargetAction | unknown) {\n this.#setStringState({ property: 'popoverTargetAction', value, attribute: 'popovertargetaction' });\n }\n\n get commandForElement(): HTMLElement | null {\n return this.#commandForElement;\n }\n\n set commandForElement(value: HTMLElement | null) {\n const oldValue = this.#commandForElement;\n this.#commandForElement = value;\n this.#requestHostUpdate('commandForElement', oldValue);\n this.#queueBehaviorSync();\n }\n\n get commandfor(): string | null {\n return this.#commandfor;\n }\n\n set commandfor(value: string | null | unknown) {\n this.#setStringState({ property: 'commandfor', value });\n }\n\n get command(): string {\n return this.#command as string;\n }\n\n set command(value: string | unknown) {\n this.#setStringState({ property: 'command', value });\n }\n\n get interestForElement(): HTMLElement | null {\n return this.#interestForElement;\n }\n\n set interestForElement(value: HTMLElement | null) {\n const oldValue = this.#interestForElement;\n this.#interestForElement = value;\n this.#requestHostUpdate('interestForElement', oldValue);\n this.#queueBehaviorSync();\n }\n\n get interestfor(): string | null {\n return this.#interestfor;\n }\n\n set interestfor(value: string | null | unknown) {\n this.#setStringState({ property: 'interestfor', value });\n }\n\n protected _controllers?: Set<ReactiveController>;\n protected _typeAnchorController = new TypeAnchorController(this);\n protected _typeButtonController = new TypeButtonController(this);\n protected _typeSubmitController = new TypeSubmitController(this);\n protected _typeCommandController = new TypeCommandController(this);\n protected _typeInterestInvokerController = new TypeInterestInvokerController(this);\n protected _typePopoverTriggerController = new TypePopoverTriggerController(this);\n protected _stateActiveController = new StateActiveController(this);\n protected _stateDisabledController = new StateDisabledController(this);\n protected _stateExpandedController = new StateExpandedController(this);\n protected _statePressedController = new StatePressedController(this);\n protected _stateSelectedController = new StateSelectedController(this);\n protected _stateCurrentController = new StateCurrentController(this);\n protected _stateReadOnlyController = new StateReadOnlyController(this);\n\n addController(controller: ReactiveController) {\n this._controllers ??= new Set<ReactiveController>();\n this._controllers.add(controller);\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n this._controllers?.forEach(controller => controller.hostConnected?.());\n attachInternals(this);\n this.#hasConnected = true;\n this.#flushPendingAttributeReflections();\n\n this.#syncBehavior();\n this.#queueBehaviorSync();\n }\n\n disconnectedCallback() {\n this._controllers?.forEach(controller => controller.hostDisconnected?.());\n super.disconnectedCallback?.();\n }\n\n protected updated(changedProperties: ChangedProperties) {\n const superUpdated = Object.getPrototypeOf(ButtonFormControlBase.prototype).updated as\n | ((changedProperties: ChangedProperties) => void)\n | undefined;\n superUpdated?.call(this, changedProperties);\n this.#syncQueued = false;\n this.#syncBehavior();\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (oldValue === newValue) {\n return;\n }\n\n this.#handleBooleanAttributeChange(name, newValue);\n this.#handleStringAttributeChange(name, oldValue, newValue);\n }\n\n #queueBehaviorSync() {\n if (!this.isConnected || this.#syncQueued) {\n return;\n }\n\n this.#syncQueued = true;\n void this.#getHostUpdateComplete().then(() => {\n if (!this.#syncQueued) return;\n this.#syncQueued = false;\n if (this.isConnected) this.#syncBehavior();\n });\n }\n\n #syncBehavior() {\n this._controllers?.forEach(controller => controller.hostUpdated?.());\n }\n\n #handleBooleanAttributeChange(name: string, newValue: string | null) {\n if (name === 'pressed' || name === 'expanded' || name === 'selected' || name === 'disabled') {\n this.#setBooleanState({ property: name, value: newValue !== null, reflect: false });\n }\n\n if (name === 'readonly') {\n this.#setBooleanState({ property: 'readOnly', value: newValue !== null, reflect: false });\n }\n }\n\n #handleStringAttributeChange(name: string, oldValue: string | null, newValue: string | null) {\n if (name === 'form') {\n if (!(isFormElement(this.#form) && newValue === null)) {\n this.#form = newValue;\n this.#requestHostUpdate('form', oldValue);\n }\n }\n\n if (name === 'popovertargetaction') {\n this.#setStringState({ property: 'popoverTargetAction', value: newValue, reflect: false });\n }\n\n this.#setStringState({ property: name, value: newValue, reflect: false });\n }\n\n #setBooleanState({ property, value, reflect, attribute = property }: BooleanStateOptions) {\n const oldValue = this.#getBooleanValue(property);\n if (oldValue === value && (!reflect || hasAttributeValue(this, attribute, value ? '' : null))) {\n return;\n }\n\n this.#setBooleanValue(property, value);\n if (reflect && this.#reflectAttribute(attribute, value ? '' : null)) {\n return;\n }\n this.#requestHostUpdate(property, oldValue);\n this.#queueBehaviorSync();\n }\n\n #getBooleanValue(property: string) {\n return {\n disabled: this.#disabled,\n expanded: this.#expanded,\n pressed: this.#pressed,\n readOnly: this.#readOnly,\n selected: this.#selected\n }[property];\n }\n\n #setBooleanValue(property: string, value: boolean) {\n if (property === 'disabled') {\n this.#disabled = value;\n } else if (property === 'expanded') {\n this.#expanded = value;\n } else if (property === 'pressed') {\n this.#pressed = value;\n } else if (property === 'readOnly') {\n this.#readOnly = value;\n } else if (property === 'selected') {\n this.#selected = value;\n }\n }\n\n #setStringState({ property, value, attribute = property, reflect = true }: StringStateOptions) {\n const oldValue = this.#getStringValue(property);\n const nextValue = getStringValue(value);\n if (oldValue === nextValue && (!reflect || hasAttributeValue(this, attribute, nextValue))) {\n return;\n }\n\n this.#setStringValue(property, nextValue);\n if (reflect && this.#reflectAttribute(attribute, nextValue)) {\n return;\n }\n this.#requestHostUpdate(property, oldValue);\n this.#queueBehaviorSync();\n }\n\n #getStringValue(property: string) {\n return {\n command: this.#command,\n commandfor: this.#commandfor,\n current: this.#current,\n interestfor: this.#interestfor,\n name: this.#name,\n popoverTargetAction: this.#popoverTargetAction,\n popovertarget: this.#popovertarget,\n type: this.#type,\n value: this.#value\n }[property];\n }\n\n #setStringValue(property: string, value: string | null) {\n const setters: Record<string, () => void> = {\n command: () => (this.#command = value ?? undefined),\n commandfor: () => (this.#commandfor = value),\n current: () => (this.#current = value as CurrentState),\n interestfor: () => (this.#interestfor = value),\n name: () => (this.#name = value ?? undefined),\n popoverTargetAction: () => (this.#popoverTargetAction = value as PopoverTargetAction),\n popovertarget: () => (this.#popovertarget = value ?? undefined),\n type: () => (this.#type = value as ButtonType),\n value: () => (this.#value = value ?? undefined)\n };\n setters[property]?.();\n }\n\n #reflectAttribute(attribute: string, value: string | null) {\n if (!this.isConnected && !this.#hasConnected) {\n if (!this.hasAttribute(attribute)) {\n this.#pendingAttributeReflections.set(attribute, value);\n }\n return true;\n }\n\n setAttributeValue(this, attribute, value);\n return false;\n }\n\n #requestHostUpdate(name?: string, oldValue?: unknown) {\n this.requestUpdate?.(name, oldValue);\n }\n\n #getHostUpdateComplete() {\n return this.updateComplete ?? Promise.resolve();\n }\n\n #flushPendingAttributeReflections() {\n this.#pendingAttributeReflections.forEach((value, attribute) => setAttributeValue(this, attribute, value));\n this.#pendingAttributeReflections.clear();\n }\n } as unknown as ButtonFormControlMixinReturn<TBase>;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiEA,SAAgB,EACd,GACqC;CACrC,OAAO,MAAM,UAA8B,EAAW;;0BAIX,gBACZ,gBAEjB,cAE6B,gBACzB,cAC0B,gBACZ,gCAEC,IAAI,IAA2B,aAElB,gBAGhC,cAEE,sBAID,EAAgB,IAAI,gCA0MC,IAAI,EAAqB,IAAI,gCAC7B,IAAI,EAAqB,IAAI,gCAC7B,IAAI,EAAqB,IAAI,iCAC5B,IAAI,EAAsB,IAAI,yCACtB,IAAI,EAA8B,IAAI,wCACvC,IAAI,EAA6B,IAAI,iCAC5C,IAAI,EAAsB,IAAI,mCAC5B,IAAI,EAAwB,IAAI,mCAChC,IAAI,EAAwB,IAAI,kCACjC,IAAI,EAAuB,IAAI,mCAC9B,IAAI,EAAwB,IAAI,kCACjC,IAAI,EAAuB,IAAI,mCAC9B,IAAI,EAAwB,IAAI;;;yBA9O7C;;EAExB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA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KAAKU,KAAW,KAAS,KAAA;IACzC,kBAAmB,KAAKD,KAAc;IACtC,eAAgB,KAAKL,KAAW;IAChC,mBAAoB,KAAKQ,KAAe;IACxC,YAAa,KAAKd,KAAQ,KAAS,KAAA;IACnC,2BAA4B,KAAKS,KAAuB;IACxD,qBAAsB,KAAKD,KAAiB,KAAS,KAAA;IACrD,YAAa,KAAKL,KAAQ;IAC1B,aAAc,KAAKD,KAAS,KAAS,KAAA;GAEvC,EAAA,CAAQ,EAAS,GAAG;EACtB;EAEA,GAAkB,GAAmB,GAAsB;GASzD,OARI,CAAC,KAAK,eAAe,CAAC,KAAKa,MACxB,KAAK,aAAa,CAAS,KAC9B,KAAKY,GAA6B,IAAI,GAAW,CAAK,GAEjD,OAGT,EAAkB,MAAM,GAAW,CAAK,GACjC;EACT;EAEA,GAAmB,GAAe,GAAoB;GACpD,KAAK,gBAAgB,GAAM,CAAQ;EACrC;EAEA,KAAyB;GACvB,OAAO,KAAK,kBAAkB,QAAQ,QAAQ;EAChD;EAEA,KAAoC;GAElC,AADA,KAAKA,GAA6B,SAAS,GAAO,MAAc,EAAkB,MAAM,GAAW,CAAK,CAAC,GACzG,KAAKA,GAA6B,MAAM;EAC1C;CACF;AACF"} | ||
| {"version":3,"file":"button.js","names":["#pressed","#setBooleanState","#expanded","#readOnly","#form","#requestHostUpdate","#queueBehaviorSync","#name","#setStringState","#value","#type","#disabled","#selected","#current","#getElementTarget","#setElementTarget","#popoverTargetAction","#command","#hasConnected","#flushPendingAttributeReflections","#syncBehavior","#syncQueued","#handleBooleanAttributeChange","#handleElementTargetAttributeChange","#handleStringAttributeChange","#getHostUpdateComplete","#elementTargets","#getElementById","#getBooleanValue","#setBooleanValue","#reflectAttribute","#getStringValue","#setStringValue","#pendingAttributeReflections"],"sources":["../../src/mixins/button.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { TypeAnchorController } from '../internal/controllers/type-anchor.controller.js';\nimport { TypeButtonController } from '../internal/controllers/type-button.controller.js';\nimport { TypeCommandController } from '../internal/controllers/type-command.controller.js';\nimport { TypeInterestInvokerController } from '../internal/controllers/type-interest-invoker.controller.js';\nimport { TypeSubmitController } from '../internal/controllers/type-submit.controller.js';\nimport { TypePopoverTriggerController } from '../internal/controllers/type-popover-trigger.controller.js';\nimport { StateActiveController } from '../internal/controllers/state-active.controller.js';\nimport { StateCurrentController } from '../internal/controllers/state-current.controller.js';\nimport { StateDisabledController } from '../internal/controllers/state-disabled.controller.js';\nimport { StateExpandedController } from '../internal/controllers/state-expanded.controller.js';\nimport { StatePressedController } from '../internal/controllers/state-pressed.controller.js';\nimport { StateReadOnlyController } from '../internal/controllers/state-readonly.controller.js';\nimport { StateSelectedController } from '../internal/controllers/state-selected.controller.js';\nimport type { ReactiveController } from '../internal/controllers/types.js';\nimport {\n attachInternals,\n getFlattenedDOMTree,\n getStringValue,\n hasAttributeValue,\n isFormElement,\n setAttributeValue\n} from '../internal/utils.js';\nimport type { ButtonFormControlMixinInstance, ButtonType, CurrentState, PopoverTargetAction } from './button.types.js';\nexport type { ButtonFormControlMixinInstance, ButtonType, CurrentState, PopoverTargetAction } from './button.types.js';\n\ntype ChangedProperties = Map<PropertyKey, unknown>;\ninterface ButtonFormControlHost {\n connectedCallback?(): void;\n disconnectedCallback?(): void;\n attributeChangedCallback?(name: string, oldValue: string | null, newValue: string | null): void;\n requestUpdate?(name?: string, oldValue?: unknown): void;\n updateComplete?: Promise<unknown>;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Constructor = (new (...args: any[]) => HTMLElement & ButtonFormControlHost) & { observedAttributes?: string[] };\n\ninterface BooleanStateOptions {\n property: string;\n value: boolean;\n reflect: boolean;\n attribute?: string;\n}\n\ninterface StringStateOptions {\n property: string;\n value: unknown;\n attribute?: string;\n reflect?: boolean;\n}\n\nconst ELEMENT_TARGET_PROPERTIES = {\n commandfor: 'commandForElement',\n interestfor: 'interestForElement',\n popovertarget: 'popoverTargetElement'\n} as const;\ntype ElementTargetAttribute = keyof typeof ELEMENT_TARGET_PROPERTIES;\ntype ElementTargetProperty = (typeof ELEMENT_TARGET_PROPERTIES)[ElementTargetAttribute];\n\ntype ButtonFormControlConstructor<TBase extends Constructor> = new (\n ...args: ConstructorParameters<TBase>\n) => InstanceType<TBase> & ButtonFormControlMixinInstance;\nexport type ButtonFormControlMixinReturn<TBase extends Constructor> = ButtonFormControlConstructor<TBase> & {\n formAssociated: boolean;\n observedAttributes: string[];\n} & Omit<TBase, 'prototype'>;\n\n/**\n * @description A mixin that adds native button-style form, command, popover, and interaction behavior.\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/button/\n */\nexport function ButtonFormControlMixin<TBase extends Constructor>(\n SuperClass: TBase\n): ButtonFormControlMixinReturn<TBase> {\n return class ButtonFormControlBase extends SuperClass {\n static formAssociated = true;\n\n #command: string | undefined;\n #current: CurrentState | undefined;\n #disabled = false;\n #elementTargets: Record<ElementTargetProperty, HTMLElement | null> = {\n commandForElement: null,\n interestForElement: null,\n popoverTargetElement: null\n };\n #expanded: boolean | undefined;\n #form: string | HTMLFormElement | null = null;\n #hasConnected = false;\n #name: string | undefined;\n #pendingAttributeReflections = new Map<string, string | null>();\n #popoverTargetAction: PopoverTargetAction | undefined;\n #pressed: boolean | undefined;\n #readOnly = false;\n #selected: boolean | undefined;\n #syncQueued = false;\n #type: ButtonType | undefined;\n #value: string | undefined;\n\n _internals = attachInternals(this);\n\n static get observedAttributes() {\n return (super.observedAttributes ?? []).concat([\n 'pressed',\n 'expanded',\n 'readonly',\n 'form',\n 'name',\n 'value',\n 'type',\n 'disabled',\n 'selected',\n 'current',\n 'popovertarget',\n 'popovertargetaction',\n 'commandfor',\n 'command',\n 'interestfor'\n ]);\n }\n\n get pressed(): boolean {\n return this.#pressed as boolean;\n }\n\n set pressed(value: boolean | unknown) {\n this.#setBooleanState({ property: 'pressed', value: Boolean(value), reflect: true });\n }\n\n get expanded(): boolean {\n return this.#expanded as boolean;\n }\n\n set expanded(value: boolean | unknown) {\n this.#setBooleanState({ property: 'expanded', value: Boolean(value), reflect: true });\n }\n\n get readOnly(): boolean {\n return this.#readOnly || Boolean(this._typeAnchorController?.readOnly);\n }\n\n set readOnly(value: boolean | unknown) {\n this.#setBooleanState({ property: 'readOnly', value: Boolean(value), reflect: true, attribute: 'readonly' });\n }\n\n get readonly(): boolean {\n return this.readOnly;\n }\n\n set readonly(value: boolean) {\n this.readOnly = value;\n }\n\n set form(form: string | HTMLFormElement | null) {\n const oldValue = this.form;\n this.#form = form;\n if (typeof form === 'string') {\n this.setAttribute('form', form);\n } else {\n this.removeAttribute('form');\n }\n this.#requestHostUpdate('form', oldValue);\n this.#queueBehaviorSync();\n }\n\n get form(): HTMLFormElement | null | string {\n if (this.#form && typeof this.#form !== 'string') {\n return this.#form;\n }\n\n if (typeof this.#form === 'string' && typeof globalThis.document !== 'undefined') {\n const rootNode = this.getRootNode() as Document | ShadowRoot;\n const form = rootNode.getElementById ? rootNode.getElementById(this.#form) : null;\n return isFormElement(form) ? form : null;\n }\n\n return this._internals?.form ?? null;\n }\n\n get name(): string {\n return this.#name as string;\n }\n\n set name(value: string | unknown) {\n this.#setStringState({ property: 'name', value });\n }\n\n get value(): string {\n return this.#value as string;\n }\n\n set value(value: string | unknown) {\n this.#setStringState({ property: 'value', value });\n }\n\n get type(): ButtonType {\n return (this.#type ?? this._typeSubmitController?.defaultType) as ButtonType;\n }\n\n set type(value: ButtonType | unknown) {\n this.#setStringState({ property: 'type', value });\n }\n\n get disabled(): boolean {\n return this.#disabled;\n }\n\n set disabled(value: boolean | unknown) {\n this.#setBooleanState({ property: 'disabled', value: Boolean(value), reflect: true });\n }\n\n get selected(): boolean {\n return this.#selected as boolean;\n }\n\n set selected(value: boolean | unknown) {\n this.#setBooleanState({ property: 'selected', value: Boolean(value), reflect: true });\n }\n\n get current(): CurrentState {\n return this.#current as CurrentState;\n }\n\n set current(value: CurrentState | unknown) {\n this.#setStringState({ property: 'current', value });\n }\n\n get popoverTargetElement(): HTMLElement | null {\n return this.#getElementTarget('popovertarget');\n }\n\n set popoverTargetElement(value: HTMLElement | null) {\n this.#setElementTarget('popovertarget', value);\n }\n\n get popoverTargetAction(): PopoverTargetAction {\n return this.#popoverTargetAction === 'show' || this.#popoverTargetAction === 'hide'\n ? this.#popoverTargetAction\n : 'toggle';\n }\n\n set popoverTargetAction(value: PopoverTargetAction | unknown) {\n this.#setStringState({ property: 'popoverTargetAction', value, attribute: 'popovertargetaction' });\n }\n\n get commandForElement(): HTMLElement | null {\n return this.#getElementTarget('commandfor');\n }\n\n set commandForElement(value: HTMLElement | null) {\n this.#setElementTarget('commandfor', value);\n }\n\n get command(): string {\n return this.#command as string;\n }\n\n set command(value: string | unknown) {\n this.#setStringState({ property: 'command', value });\n }\n\n get interestForElement(): HTMLElement | null {\n return this.#getElementTarget('interestfor');\n }\n\n set interestForElement(value: HTMLElement | null) {\n this.#setElementTarget('interestfor', value);\n }\n\n protected _controllers?: Set<ReactiveController>;\n protected _typeAnchorController = new TypeAnchorController(this);\n protected _typeButtonController = new TypeButtonController(this);\n protected _typeSubmitController = new TypeSubmitController(this);\n protected _typeCommandController = new TypeCommandController(this);\n protected _typeInterestInvokerController = new TypeInterestInvokerController(this);\n protected _typePopoverTriggerController = new TypePopoverTriggerController(this);\n protected _stateActiveController = new StateActiveController(this);\n protected _stateDisabledController = new StateDisabledController(this);\n protected _stateExpandedController = new StateExpandedController(this);\n protected _statePressedController = new StatePressedController(this);\n protected _stateSelectedController = new StateSelectedController(this);\n protected _stateCurrentController = new StateCurrentController(this);\n protected _stateReadOnlyController = new StateReadOnlyController(this);\n\n addController(controller: ReactiveController) {\n this._controllers ??= new Set<ReactiveController>();\n this._controllers.add(controller);\n }\n\n connectedCallback() {\n super.connectedCallback?.();\n this._controllers?.forEach(controller => controller.hostConnected?.());\n attachInternals(this);\n this.#hasConnected = true;\n this.#flushPendingAttributeReflections();\n\n this.#syncBehavior();\n this.#queueBehaviorSync();\n }\n\n disconnectedCallback() {\n this._controllers?.forEach(controller => controller.hostDisconnected?.());\n super.disconnectedCallback?.();\n }\n\n protected updated(changedProperties: ChangedProperties) {\n const superUpdated = Object.getPrototypeOf(ButtonFormControlBase.prototype).updated as\n | ((changedProperties: ChangedProperties) => void)\n | undefined;\n superUpdated?.call(this, changedProperties);\n this.#syncQueued = false;\n this.#syncBehavior();\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (oldValue === newValue) {\n return;\n }\n\n this.#handleBooleanAttributeChange(name, newValue);\n this.#handleElementTargetAttributeChange(name, oldValue);\n this.#handleStringAttributeChange(name, oldValue, newValue);\n }\n\n #queueBehaviorSync() {\n if (!this.isConnected || this.#syncQueued) {\n return;\n }\n\n this.#syncQueued = true;\n void this.#getHostUpdateComplete().then(() => {\n if (!this.#syncQueued) return;\n this.#syncQueued = false;\n if (this.isConnected) this.#syncBehavior();\n });\n }\n\n #syncBehavior() {\n this._controllers?.forEach(controller => controller.hostUpdated?.());\n }\n\n #handleBooleanAttributeChange(name: string, newValue: string | null) {\n if (name === 'pressed' || name === 'expanded' || name === 'selected' || name === 'disabled') {\n this.#setBooleanState({ property: name, value: newValue !== null, reflect: false });\n }\n\n if (name === 'readonly') {\n this.#setBooleanState({ property: 'readOnly', value: newValue !== null, reflect: false });\n }\n }\n\n #handleStringAttributeChange(name: string, oldValue: string | null, newValue: string | null) {\n if (name === 'commandfor' || name === 'interestfor' || name === 'popovertarget') {\n return;\n }\n\n if (name === 'form') {\n if (!(isFormElement(this.#form) && newValue === null)) {\n this.#form = newValue;\n this.#requestHostUpdate('form', oldValue);\n }\n }\n\n if (name === 'popovertargetaction') {\n this.#setStringState({ property: 'popoverTargetAction', value: newValue, reflect: false });\n return;\n }\n\n this.#setStringState({ property: name, value: newValue, reflect: false });\n }\n\n #handleElementTargetAttributeChange(name: string, oldValue: string | null) {\n const property = ELEMENT_TARGET_PROPERTIES[name as ElementTargetAttribute];\n if (!property) {\n return;\n }\n\n const oldTarget = this.#elementTargets[property] ?? this.#getElementById(oldValue);\n this.#elementTargets[property] = null;\n this.#requestHostUpdate(property, oldTarget);\n this.#queueBehaviorSync();\n }\n\n #getElementTarget(attribute: ElementTargetAttribute) {\n return (\n this.#elementTargets[ELEMENT_TARGET_PROPERTIES[attribute]] ?? this.#getElementById(this.getAttribute(attribute))\n );\n }\n\n #getElementById(id: string | null) {\n return id ? (getFlattenedDOMTree(this.getRootNode()).find(element => element.id === id) ?? null) : null;\n }\n\n #setElementTarget(attribute: ElementTargetAttribute, value: HTMLElement | null) {\n const property = ELEMENT_TARGET_PROPERTIES[attribute];\n const oldValue = this[property];\n if (oldValue === value && hasAttributeValue(this, attribute, value ? '' : null)) {\n return;\n }\n setAttributeValue(this, attribute, value ? '' : null);\n this.#elementTargets[property] = value;\n this.#requestHostUpdate(property, oldValue);\n this.#queueBehaviorSync();\n }\n\n #setBooleanState({ property, value, reflect, attribute = property }: BooleanStateOptions) {\n const oldValue = this.#getBooleanValue(property);\n if (oldValue === value && (!reflect || hasAttributeValue(this, attribute, value ? '' : null))) {\n return;\n }\n\n this.#setBooleanValue(property, value);\n if (reflect && this.#reflectAttribute(attribute, value ? '' : null)) {\n return;\n }\n this.#requestHostUpdate(property, oldValue);\n this.#queueBehaviorSync();\n }\n\n #getBooleanValue(property: string) {\n return {\n disabled: this.#disabled,\n expanded: this.#expanded,\n pressed: this.#pressed,\n readOnly: this.#readOnly,\n selected: this.#selected\n }[property];\n }\n\n #setBooleanValue(property: string, value: boolean) {\n if (property === 'disabled') {\n this.#disabled = value;\n } else if (property === 'expanded') {\n this.#expanded = value;\n } else if (property === 'pressed') {\n this.#pressed = value;\n } else if (property === 'readOnly') {\n this.#readOnly = value;\n } else if (property === 'selected') {\n this.#selected = value;\n }\n }\n\n #setStringState({ property, value, attribute = property, reflect = true }: StringStateOptions) {\n const oldValue = this.#getStringValue(property);\n const nextValue = getStringValue(value);\n if (oldValue === nextValue && (!reflect || hasAttributeValue(this, attribute, nextValue))) {\n return;\n }\n\n this.#setStringValue(property, nextValue);\n if (reflect && this.#reflectAttribute(attribute, nextValue)) {\n return;\n }\n this.#requestHostUpdate(property, oldValue);\n this.#queueBehaviorSync();\n }\n\n #getStringValue(property: string) {\n return {\n command: this.#command,\n current: this.#current,\n name: this.#name,\n popoverTargetAction: this.#popoverTargetAction,\n type: this.#type,\n value: this.#value\n }[property];\n }\n\n #setStringValue(property: string, value: string | null) {\n const setters: Record<string, () => void> = {\n command: () => (this.#command = value ?? undefined),\n current: () => (this.#current = value as CurrentState),\n name: () => (this.#name = value ?? undefined),\n popoverTargetAction: () => (this.#popoverTargetAction = value as PopoverTargetAction),\n type: () => (this.#type = value as ButtonType),\n value: () => (this.#value = value ?? undefined)\n };\n setters[property]?.();\n }\n\n #reflectAttribute(attribute: string, value: string | null) {\n if (!this.isConnected && !this.#hasConnected) {\n if (!this.hasAttribute(attribute)) {\n this.#pendingAttributeReflections.set(attribute, value);\n }\n return true;\n }\n\n setAttributeValue(this, attribute, value);\n return false;\n }\n\n #requestHostUpdate(name?: string, oldValue?: unknown) {\n this.requestUpdate?.(name, oldValue);\n }\n\n #getHostUpdateComplete() {\n return this.updateComplete ?? Promise.resolve();\n }\n\n #flushPendingAttributeReflections() {\n this.#pendingAttributeReflections.forEach((value, attribute) => setAttributeValue(this, attribute, value));\n this.#pendingAttributeReflections.clear();\n }\n } as unknown as ButtonFormControlMixinReturn<TBase>;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsDA,IAAM,IAA4B;CAChC,YAAY;CACZ,aAAa;CACb,eAAe;AACjB;AAgBA,SAAgB,EACd,GACqC;CACrC,OAAO,MAAM,UAA8B,EAAW;;0BAKxC,cACyD;IACnE,mBAAmB;IACnB,oBAAoB;IACpB,sBAAsB;GACxB,aAEyC,gBACzB,8BAEe,IAAI,IAA2B,aAGlD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AS,GAAO,MAAc,EAAkB,MAAM,GAAW,CAAK,CAAC,GACzG,KAAKA,GAA6B,MAAM;EAC1C;CACF;AACF"} |
@@ -78,11 +78,6 @@ export type ButtonType = 'button' | 'submit' | 'reset'; | ||
| * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/popoverTargetElement | ||
| */ | ||
| popoverTargetElement: HTMLElement | null; | ||
| /** | ||
| * The id reference of the element that receives the popover. | ||
| * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#popovertarget | ||
| * @attr popovertarget | ||
| * @reflect | ||
| */ | ||
| popovertarget: string; | ||
| popoverTargetElement: HTMLElement | null; | ||
| /** | ||
@@ -89,0 +84,0 @@ * The popover target action to perform on the popover target element. |
+4
-4
| { | ||
| "name": "@nvidia-elements/forms", | ||
| "version": "2.0.3", | ||
| "version": "2.0.4", | ||
| "release": { | ||
@@ -99,7 +99,7 @@ "extends": "../../release.config.js" | ||
| "vitest": "4.1.10", | ||
| "@nvidia-elements/styles": "2.0.2", | ||
| "@nvidia-elements/styles": "2.1.0", | ||
| "@internals/testing": "0.0.0", | ||
| "@internals/eslint": "0.0.0", | ||
| "@internals/vite": "0.0.0", | ||
| "@nvidia-elements/lint": "2.0.1", | ||
| "@internals/testing": "0.0.0" | ||
| "@nvidia-elements/lint": "2.1.1" | ||
| }, | ||
@@ -106,0 +106,0 @@ "wireit": { |
376924
2.01%4406
1.08%