@quartzds/core 1.0.0-beta.116 → 1.0.0-beta.117
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 +33 -0
- package/components/index.js +3 -3
- package/components/{p-7CRVW1fF.js → p-BCa4FoJP.js} +7 -7
- package/components/{p-7CRVW1fF.js.map → p-BCa4FoJP.js.map} +1 -1
- package/components/{p-CmhdNcHF.js → p-BGl6PA-C.js} +3 -3
- package/components/{p-CmhdNcHF.js.map → p-BGl6PA-C.js.map} +1 -1
- package/components/{p-DrEQjX2g.js → p-Bv2vPjgL.js} +3 -3
- package/components/{p-DrEQjX2g.js.map → p-Bv2vPjgL.js.map} +1 -1
- package/components/{p-BSl6ytcf.js → p-C4iXKwHq.js} +12 -12
- package/components/{p-BSl6ytcf.js.map → p-C4iXKwHq.js.map} +1 -1
- package/components/{p-BfIOTt4N.js → p-CDRwHAIT.js} +4 -4
- package/components/{p-BfIOTt4N.js.map → p-CDRwHAIT.js.map} +1 -1
- package/components/{p-DQLjJn7-.js → p-CZRW1LV_.js} +3 -3
- package/components/{p-DQLjJn7-.js.map → p-CZRW1LV_.js.map} +1 -1
- package/components/{p-1i9z6mOq.js → p-CfVrtH_A.js} +10 -10
- package/components/{p-1i9z6mOq.js.map → p-CfVrtH_A.js.map} +1 -1
- package/components/{p-BrXeIZb3.js → p-Coe8I0X0.js} +6 -6
- package/components/{p-BrXeIZb3.js.map → p-Coe8I0X0.js.map} +1 -1
- package/components/{p-pO0PWoAm.js → p-CzutKF-O.js} +7 -7
- package/components/{p-pO0PWoAm.js.map → p-CzutKF-O.js.map} +1 -1
- package/components/{p-BEWDu8_P.js → p-D2489VzR.js} +3 -3
- package/components/{p-BEWDu8_P.js.map → p-D2489VzR.js.map} +1 -1
- package/components/{p-BxvGYLMb.js → p-DIdfXfUb.js} +6 -6
- package/components/{p-BxvGYLMb.js.map → p-DIdfXfUb.js.map} +1 -1
- package/components/{p-Ctm34vK2.js → p-DMT3qq3d.js} +7 -7
- package/components/{p-Ctm34vK2.js.map → p-DMT3qq3d.js.map} +1 -1
- package/components/{p-DOvh7lZm.js → p-DvvOpIKW.js} +7 -7
- package/components/p-DvvOpIKW.js.map +1 -0
- package/components/{p-C-IkQWNh.js → p-DzyNwfi7.js} +5 -5
- package/components/{p-C-IkQWNh.js.map → p-DzyNwfi7.js.map} +1 -1
- package/components/{p-CAjMAg1t.js → p-FsslOC0B.js} +4 -4
- package/components/{p-CAjMAg1t.js.map → p-FsslOC0B.js.map} +1 -1
- package/components/{p-DOjR-Isr.js → p-Lp5372iD.js} +6 -6
- package/components/{p-DOjR-Isr.js.map → p-Lp5372iD.js.map} +1 -1
- package/components/{p-BqX-Z4lF.js → p-SM1InhPr.js} +9 -9
- package/components/{p-BqX-Z4lF.js.map → p-SM1InhPr.js.map} +1 -1
- package/components/{p-bSwFyyHH.js → p-mB5Jgu0P.js} +10 -10
- package/components/p-mB5Jgu0P.js.map +1 -0
- package/components/qds-action-item.js +5 -5
- package/components/qds-avatar-media.js +2 -2
- package/components/qds-badge-counter.js +2 -2
- package/components/qds-badge-indicator.js +2 -2
- package/components/qds-breadcrumb-item.js +5 -5
- package/components/qds-button.js +2 -2
- package/components/qds-checkbox.js +2 -2
- package/components/qds-chip.js +6 -6
- package/components/qds-dialog.js +9 -9
- package/components/qds-divider.js +2 -2
- package/components/qds-dropdown.js +2 -2
- package/components/qds-form-message.js +4 -4
- package/components/qds-icon-button.js +7 -7
- package/components/qds-icon.js +2 -2
- package/components/qds-inline-link.js +6 -6
- package/components/qds-input.js +6 -6
- package/components/qds-label.js +2 -2
- package/components/qds-list-item.js +33 -30
- package/components/qds-list-item.js.map +1 -1
- package/components/qds-loader.js +4 -4
- package/components/qds-loader.js.map +1 -1
- package/components/qds-menu-item.js +8 -8
- package/components/qds-mini-button.js +2 -2
- package/components/qds-progress-bar.js +3 -3
- package/components/qds-radio.js +2 -2
- package/components/qds-select.js +9 -9
- package/components/qds-standalone-link.js +6 -6
- package/components/qds-switch.js +8 -8
- package/components/qds-tab.js +14 -14
- package/components/qds-tabbar.js +13 -13
- package/components/qds-table-cell.js +4 -4
- package/components/qds-table-head-cell.js +4 -4
- package/components/qds-table-row.js +3 -3
- package/components/qds-table.js +3 -3
- package/components/qds-tag.js +2 -2
- package/components/qds-textarea.js +29 -10
- package/components/qds-textarea.js.map +1 -1
- package/components/qds-title.js +2 -2
- package/components/qds-tooltip.js +2 -2
- package/dist/cjs/app-globals-CLoao1by.js +13 -0
- package/dist/cjs/{app-globals-B9YnPciY.js.map → app-globals-CLoao1by.js.map} +1 -1
- package/dist/cjs/{controls-BkyD_3My.js → controls-DKGeNyr5.js} +3 -3
- package/dist/cjs/{controls-BkyD_3My.js.map → controls-DKGeNyr5.js.map} +1 -1
- package/dist/cjs/{floating-ui.dom-BgRFi0kr.js → floating-ui.dom-Bvzubd50.js} +3 -3
- package/dist/cjs/{floating-ui.dom-BgRFi0kr.js.map → floating-ui.dom-Bvzubd50.js.map} +1 -1
- package/dist/cjs/{helpers-BH_NFaV-.js → helpers-C5uYCt6R.js} +3 -3
- package/dist/cjs/{helpers-BH_NFaV-.js.map → helpers-C5uYCt6R.js.map} +1 -1
- package/dist/cjs/{index-uGYTAljz.js → index-DIY7gpXM.js} +3 -3
- package/dist/cjs/{index-uGYTAljz.js.map → index-DIY7gpXM.js.map} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{library-C_NJJiFI.js → library-CeKRI2f2.js} +4 -4
- package/dist/cjs/{library-C_NJJiFI.js.map → library-CeKRI2f2.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/qds-action-item.cjs.entry.js +3 -3
- package/dist/cjs/qds-avatar-media.qds-checkbox.qds-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-avatar-media_3.cjs.entry.js +10 -10
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js +2 -2
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +3 -3
- package/dist/cjs/qds-button.cjs.entry.js +4 -4
- package/dist/cjs/qds-chip.cjs.entry.js +3 -3
- package/dist/cjs/qds-dialog.cjs.entry.js +4 -4
- package/dist/cjs/qds-divider.cjs.entry.js +3 -3
- package/dist/cjs/qds-dropdown.cjs.entry.js +5 -5
- package/dist/cjs/qds-form-message.cjs.entry.js +3 -3
- package/dist/cjs/qds-icon-button.cjs.entry.js +3 -3
- package/dist/cjs/qds-icon.cjs.entry.js +5 -5
- package/dist/cjs/qds-inline-link.cjs.entry.js +5 -5
- package/dist/cjs/qds-input.cjs.entry.js +4 -4
- package/dist/cjs/qds-label.cjs.entry.js +3 -3
- package/dist/cjs/qds-list-item.cjs.entry.js +25 -22
- package/dist/cjs/qds-list-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-loader.cjs.entry.js +3 -3
- package/dist/cjs/qds-loader.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-menu-item.cjs.entry.js +5 -5
- package/dist/cjs/qds-mini-button.cjs.entry.js +4 -4
- package/dist/cjs/qds-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/qds-select.cjs.entry.js +8 -8
- package/dist/cjs/qds-standalone-link.cjs.entry.js +5 -5
- package/dist/cjs/qds-switch.cjs.entry.js +7 -7
- package/dist/cjs/qds-tab.cjs.entry.js +8 -8
- package/dist/cjs/qds-tabbar.cjs.entry.js +7 -7
- package/dist/cjs/qds-table-cell.cjs.entry.js +4 -4
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +4 -4
- package/dist/cjs/qds-table-row.cjs.entry.js +3 -3
- package/dist/cjs/qds-table.cjs.entry.js +3 -3
- package/dist/cjs/qds-tag.qds-title.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tag_2.cjs.entry.js +8 -8
- package/dist/cjs/qds-textarea.cjs.entry.js +25 -9
- package/dist/cjs/qds-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/qds.cjs.js +4 -4
- package/dist/custom-elements.json +55 -6
- package/dist/docs.json +80 -4
- package/dist/esm/app-globals-WylVyaRG.js +11 -0
- package/dist/esm/{app-globals-DOPFtKjb.js.map → app-globals-WylVyaRG.js.map} +1 -1
- package/dist/esm/{controls-DQLjJn7-.js → controls-CZRW1LV_.js} +3 -3
- package/dist/esm/{controls-DQLjJn7-.js.map → controls-CZRW1LV_.js.map} +1 -1
- package/dist/esm/{floating-ui.dom-DrEQjX2g.js → floating-ui.dom-Bv2vPjgL.js} +3 -3
- package/dist/esm/{floating-ui.dom-DrEQjX2g.js.map → floating-ui.dom-Bv2vPjgL.js.map} +1 -1
- package/dist/esm/{helpers-t9FQ7Vl_.js → helpers-Cg4Khj8r.js} +3 -3
- package/dist/esm/{helpers-t9FQ7Vl_.js.map → helpers-Cg4Khj8r.js.map} +1 -1
- package/dist/esm/{index-D8Hb0u1k.js → index-Hg1Liloy.js} +3 -3
- package/dist/esm/{index-D8Hb0u1k.js.map → index-Hg1Liloy.js.map} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{library-C7n28y3j.js → library-CBfntPWH.js} +4 -4
- package/dist/esm/{library-C7n28y3j.js.map → library-CBfntPWH.js.map} +1 -1
- package/dist/esm/loader.js +5 -5
- package/dist/esm/qds-action-item.entry.js +3 -3
- package/dist/esm/qds-avatar-media.qds-checkbox.qds-radio.entry.js.map +1 -1
- package/dist/esm/qds-avatar-media_3.entry.js +10 -10
- package/dist/esm/qds-badge-counter_2.entry.js +2 -2
- package/dist/esm/qds-breadcrumb-item.entry.js +3 -3
- package/dist/esm/qds-button.entry.js +4 -4
- package/dist/esm/qds-chip.entry.js +3 -3
- package/dist/esm/qds-dialog.entry.js +4 -4
- package/dist/esm/qds-divider.entry.js +3 -3
- package/dist/esm/qds-dropdown.entry.js +5 -5
- package/dist/esm/qds-form-message.entry.js +3 -3
- package/dist/esm/qds-icon-button.entry.js +3 -3
- package/dist/esm/qds-icon.entry.js +5 -5
- package/dist/esm/qds-inline-link.entry.js +5 -5
- package/dist/esm/qds-input.entry.js +4 -4
- package/dist/esm/qds-label.entry.js +3 -3
- package/dist/esm/qds-list-item.entry.js +25 -22
- package/dist/esm/qds-list-item.entry.js.map +1 -1
- package/dist/esm/qds-loader.entry.js +3 -3
- package/dist/esm/qds-loader.entry.js.map +1 -1
- package/dist/esm/qds-menu-item.entry.js +5 -5
- package/dist/esm/qds-mini-button.entry.js +4 -4
- package/dist/esm/qds-progress-bar.entry.js +3 -3
- package/dist/esm/qds-select.entry.js +8 -8
- package/dist/esm/qds-standalone-link.entry.js +5 -5
- package/dist/esm/qds-switch.entry.js +7 -7
- package/dist/esm/qds-tab.entry.js +8 -8
- package/dist/esm/qds-tabbar.entry.js +7 -7
- package/dist/esm/qds-table-cell.entry.js +4 -4
- package/dist/esm/qds-table-head-cell.entry.js +4 -4
- package/dist/esm/qds-table-row.entry.js +3 -3
- package/dist/esm/qds-table.entry.js +3 -3
- package/dist/esm/qds-tag.qds-title.entry.js.map +1 -1
- package/dist/esm/qds-tag_2.entry.js +8 -8
- package/dist/esm/qds-textarea.entry.js +25 -9
- package/dist/esm/qds-textarea.entry.js.map +1 -1
- package/dist/esm/qds-tooltip.entry.js +4 -4
- package/dist/esm/qds.js +5 -5
- package/dist/types/components/list-item/list-item.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +11 -1
- package/dist/types/components.d.ts +18 -2
- package/dist/vscode.html-custom-data.json +22 -0
- package/hydrate/index.js +92 -71
- package/hydrate/index.mjs +92 -71
- package/loader/cdn.js +1 -1
- package/loader/index.cjs.js +1 -1
- package/loader/index.es2017.js +1 -1
- package/loader/index.js +1 -1
- package/package.json +1 -1
- package/components/p-DOvh7lZm.js.map +0 -1
- package/components/p-bSwFyyHH.js.map +0 -1
- package/dist/cjs/app-globals-B9YnPciY.js +0 -13
- package/dist/esm/app-globals-DOPFtKjb.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
3
|
+
|
|
4
|
+
SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
# Change Log
|
|
8
|
+
|
|
9
|
+
[](https://conventionalcommits.org)
|
|
10
|
+
[](https://semver.org/spec/v2.0.0)
|
|
11
|
+
|
|
12
|
+
> All notable changes to this project will be documented in this file
|
|
13
|
+
|
|
14
|
+
## @quartzds/core 1.0.0-beta.117 (2026-01-15)
|
|
15
|
+
|
|
16
|
+
* fix(qds-loader): apply updated design tokens for neutral and neutral-contrast importance ([037d2b1](https://github.com/quartzds/core-foundations/commit/037d2b1))
|
|
17
|
+
* fix(qds-avatar-media): enforce size inheritance from container ([0749e64](https://github.com/quartzds/core-foundations/commit/0749e64))
|
|
18
|
+
* fix(qds-list-item): merge text, subtitle & kicker into one tooltip for accessibility ([5a84283](https://github.com/quartzds/core-foundations/commit/5a84283))
|
|
19
|
+
* fix(qds-list-item): replace label tag by div ([f357a15](https://github.com/quartzds/core-foundations/commit/f357a15))
|
|
20
|
+
* feat(qds-list-item)!: redefine default and selection behavior ([cceaa49](https://github.com/quartzds/core-foundations/commit/cceaa49))
|
|
21
|
+
* Merge pull request #1563 from quartzds/list-item_redefine_selection ([32922de](https://github.com/quartzds/core-foundations/commit/32922de)), closes [#1563](https://github.com/quartzds/core-foundations/issues/1563)
|
|
22
|
+
* Merge pull request #1595 from quartzds/textarea-update ([b255e42](https://github.com/quartzds/core-foundations/commit/b255e42)), closes [#1595](https://github.com/quartzds/core-foundations/issues/1595)
|
|
23
|
+
* Merge pull request #1598 from quartzds/1503-tokens-ready-loader---fix ([b580463](https://github.com/quartzds/core-foundations/commit/b580463)), closes [#1598](https://github.com/quartzds/core-foundations/issues/1598)
|
|
24
|
+
* Merge pull request #1614 from quartzds/fix-avatar-media-inherit-size ([b3edde7](https://github.com/quartzds/core-foundations/commit/b3edde7)), closes [#1614](https://github.com/quartzds/core-foundations/issues/1614)
|
|
25
|
+
* feat(qds-textarea): add readonly property ([7ab1341](https://github.com/quartzds/core-foundations/commit/7ab1341))
|
|
26
|
+
* feat(qds-textarea): add status property ([90bc438](https://github.com/quartzds/core-foundations/commit/90bc438))
|
|
27
|
+
* refactor(qds-tag): remove fallback values ([c70dff4](https://github.com/quartzds/core-foundations/commit/c70dff4))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### BREAKING CHANGE
|
|
31
|
+
|
|
32
|
+
* The default `undefined` value no longer implies selection. Use `select` for selectable list-items.
|
|
33
|
+
|
|
1
34
|
<!--
|
|
2
35
|
SPDX-FileCopyrightText: © 2025 Schneider Electric
|
|
3
36
|
|
package/components/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SPDX-FileCopyrightText: ©
|
|
2
|
+
* SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
export { g as getAssetPath, r as render, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-
|
|
7
|
-
export { r as registerIconLibrary, u as unregisterIconLibrary } from './p-
|
|
6
|
+
export { g as getAssetPath, r as render, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-D2489VzR.js';
|
|
7
|
+
export { r as registerIconLibrary, u as unregisterIconLibrary } from './p-DIdfXfUb.js';
|
|
8
8
|
export { QdsActionItem, defineCustomElement as defineCustomElementQdsActionItem } from './qds-action-item.js';
|
|
9
9
|
export { QdsAvatarMedia, defineCustomElement as defineCustomElementQdsAvatarMedia } from './qds-avatar-media.js';
|
|
10
10
|
export { QdsBadgeCounter, defineCustomElement as defineCustomElementQdsBadgeCounter } from './qds-badge-counter.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SPDX-FileCopyrightText: ©
|
|
2
|
+
* SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, c as createEvent, h, e as Host } from './p-
|
|
7
|
-
import { o as offset, f as flip, s as shift, c as computePosition, a as autoUpdate, l as limitShift } from './p-
|
|
8
|
-
import { V as VERTICAL_MOVE_KEYS, e as ignorePromise, f as propertyToPx, r as resolveTarget } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, c as createEvent, h, e as Host } from './p-D2489VzR.js';
|
|
7
|
+
import { o as offset, f as flip, s as shift, c as computePosition, a as autoUpdate, l as limitShift } from './p-Bv2vPjgL.js';
|
|
8
|
+
import { V as VERTICAL_MOVE_KEYS, e as ignorePromise, f as propertyToPx, r as resolveTarget } from './p-BGl6PA-C.js';
|
|
9
9
|
|
|
10
10
|
const dropdownCss = ":host([hidden]){display:none!important}:host{background-color:var(--qds-theme-popup-background);border:none;border-radius:var(--qds-popup-border-radius);box-shadow:var(--qds-popup-elevation);box-sizing:border-box;display:inline-block;inset:unset;margin:0;overflow:initial;padding:0}";
|
|
11
11
|
|
|
@@ -334,7 +334,7 @@ const Dropdown = /*@__PURE__*/ proxyCustomElement(class Dropdown extends H {
|
|
|
334
334
|
__classPrivateFieldGet(this, _Dropdown_instances, "m", _Dropdown_disconnectReferenceElement).call(this);
|
|
335
335
|
}
|
|
336
336
|
render() {
|
|
337
|
-
return (h(Host, { key: '
|
|
337
|
+
return (h(Host, { key: '90e10ed114c27348c236436902ce7ebf1f01e64c', onKeyDown: __classPrivateFieldGet(this, _Dropdown_onKeydown, "f"), onFocusout: __classPrivateFieldGet(this, _Dropdown_onFocusout, "f") }, h("slot", { key: '356f9bbd800868ae08e0d11e2710e03ff2b3663f', onSlotchange: __classPrivateFieldGet(this, _Dropdown_onSlotchange, "f") })));
|
|
338
338
|
}
|
|
339
339
|
static get delegatesFocus() { return true; }
|
|
340
340
|
get host() { return this; }
|
|
@@ -417,6 +417,6 @@ function defineCustomElement() {
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
export { Dropdown as D, defineCustomElement as d };
|
|
420
|
-
//# sourceMappingURL=p-
|
|
420
|
+
//# sourceMappingURL=p-BCa4FoJP.js.map
|
|
421
421
|
|
|
422
|
-
//# sourceMappingURL=p-
|
|
422
|
+
//# sourceMappingURL=p-BCa4FoJP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-7CRVW1fF.js","mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,4RAA4R;;ACAhT;AACA;AACA;;;;;;;;;;;;;;;;;;AA0CA,IAAI,kBAAkB,GAAG,CAAC;AAE1B,MAAM,WAAW,GAAG,CAClB,OAA2B,KAE3B,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,YAAY;AAEhD,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IAChD,iBAAiB;IACjB,eAAe;AAChB,CAAA,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,OAAgB,KACrC,OAAO,YAAYA,CAAW;IAC9B,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;AAC/C,IAAA,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC;IACjC,CAAC,OAAO,CAAC,KAAK;MAWH,QAAQ,iBAAAC,kBAAA,CAAA,MAAA,QAAA,SAAAD,CAAA,CAAA;AALrB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAcE;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAgBjD;;;AAGG;AACqB,QAAA,IAAM,CAAA,MAAA,GAAY,KAAK;AAE/C;;;AAGG;AACqB,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK;AAahD;;;;AAIG;AACqB,QAAA,IAAS,CAAA,SAAA,GAAc,cAAc;AAoC7D;;;AAGG;AACqB,QAAA,IAAgB,CAAA,gBAAA,GAAY,KAAK;QAsBzD,iBA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I,CAAC;AACnE,QAAA,SAAS,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC;QACvC,SAAS,CAAC,KAAK,EAAE;AACnB,KAAC,CAAC;AACJ,CAAC,EAAA,oCAAA,GAAA,SAAA,oCAAA,GAAA;AAGC,IAAA,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC;AAE5C,IAAA,IAAI,EAAE,sBAAA,CAAA,IAAI,kCAAkB,YAAY,UAAU,CAAC,OAAO,CAAC;QAAE;IAE7D,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,mBAAmB,CACxC,UAAU,EACV,sBAAA,CAAA,IAAI,EAAiB,yBAAA,EAAA,GAAA,CAAA,CACtB;IACD,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,mBAAmB,CAAC,SAAS,EAAE,sBAAA,CAAA,IAAI,EAAgB,wBAAA,EAAA,GAAA,CAAA,CAAC;AAC3E,IAAA,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,eAAe,CAAC,eAAe,CAAC;AACvD,IAAA,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,eAAe,CAAC,eAAe,CAAC;AACzD,CAAC;;;;;;;;;;;;;;;;;","names":["HTMLElement","__stencil_proxyCustomElement"],"sources":["src/components/dropdown/dropdown.css?tag=qds-dropdown&encapsulation=shadow","src/components/dropdown/dropdown.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n background-color: var(--qds-theme-popup-background);\n border-radius: var(--qds-popup-border-radius);\n border: none;\n box-shadow: var(--qds-popup-elevation);\n box-sizing: border-box;\n display: inline-block;\n inset: unset;\n margin: 0;\n overflow: initial;\n padding: 0;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n AutoUpdateOptions,\n DetectOverflowOptions,\n FlipOptions,\n Middleware,\n Placement,\n ReferenceElement,\n ShiftOptions,\n Strategy,\n} from '@floating-ui/dom'\nimport {\n autoUpdate,\n computePosition,\n flip,\n limitShift,\n offset,\n shift,\n} from '@floating-ui/dom'\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Host,\n Listen,\n Method,\n Prop,\n Watch,\n} from '@stencil/core'\n\nimport type { OffsetOptions } from '../../helpers'\nimport {\n ignorePromise,\n propertyToPx,\n resolveTarget,\n VERTICAL_MOVE_KEYS,\n} from '../../helpers'\n\nlet autoIncrementingId = 1\n\nconst isQdsButton = (\n element: globalThis.Element,\n): element is HTMLQdsButtonElement =>\n element.tagName.toLowerCase() === 'qds-button'\n\nconst ALLOWED_TAGS: ReadonlySet<string> = new Set([\n 'qds-action-item',\n 'qds-menu-item',\n])\n\nconst isEnabledItem = (element: unknown): element is HTMLElement =>\n element instanceof HTMLElement &&\n ALLOWED_TAGS.has(element.tagName.toLowerCase()) &&\n !element.hasAttribute('disabled') &&\n !element.inert\n\n/**\n * @slot Content to display in the dropdown.\n * @see https://quartz.se.com/build/components/dropdown\n */\n@Component({\n tag: 'qds-dropdown',\n shadow: { delegatesFocus: true },\n styleUrl: 'dropdown.css',\n})\nexport class Dropdown implements ComponentInterface {\n /**\n * Options to pass to Floating UI's\n * [`autoUpdate()` function](https://floating-ui.com/docs/autoUpdate).\n *\n * @see https://floating-ui.com/docs/autoupdate#options\n */\n @Prop() public readonly autoUpdateOptions?: AutoUpdateOptions\n\n /**\n * Prevents the dropdown from being shown by user interaction. The dropdown\n * can still be displayed by calling the `show()` method.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n *\n * The [`crossAxis` option](https://floating-ui.com/docs/flip#crossaxis) is\n * set to the value of the `noShift` property by default for interoperability\n * with the [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/flip#options\n */\n @Prop() public readonly flipOptions?: Partial<\n DetectOverflowOptions & FlipOptions\n >\n\n /**\n * Disable Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n */\n @Prop() public readonly noFlip: boolean = false\n\n /**\n * Disable Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n */\n @Prop() public readonly noShift: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`offset` middleware](https://floating-ui.com/docs/offset).\n *\n * The [`mainAxis` option](https://floating-ui.com/docs/offset#mainaxis) is\n * not supported.\n *\n * @see https://floating-ui.com/docs/offset#options\n */\n @Prop() public readonly offsetOptions?: OffsetOptions\n\n /**\n * Where to place the dropdown relative to the `target`.\n *\n * @see https://floating-ui.com/docs/tutorial#placements\n */\n @Prop() public readonly placement: Placement = 'bottom-start'\n\n /**\n * Options to pass to Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/shift#options\n */\n @Prop() public readonly shiftOptions?: Partial<\n DetectOverflowOptions & ShiftOptions\n >\n\n /**\n * The CSS position strategy to use.\n *\n * @see https://floating-ui.com/docs/computeposition#strategy\n */\n @Prop() public readonly strategy?: Strategy\n\n /**\n * The trigger element that will trigger the dropdown. The target specified\n * can be any of the following:\n *\n * - A CSS selector string\n * - A reference to an [`Element`][] or [Virtual Element][]\n * - A function returning a reference to an [`Element`][],\n * [Virtual Element][], or a CSS selector string\n *\n * [`Element`]: https://developer.mozilla.org/docs/Web/API/Element\n * [Virtual Element]: https://floating-ui.com/docs/virtual-elements\n */\n @Prop() public readonly target!:\n | ReferenceElement\n | string\n | (() => ReferenceElement | string)\n\n /**\n * By default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for\n * dropdowns that allow for multiple interactions.\n */\n @Prop() public readonly keepOpenOnSelect: boolean = false\n\n /**\n * Emitted when the user instructs the browser that they wish to dismiss the\n * current open dropdown by pressing the `Esc` key.\n *\n * When a dropdown is dismissed with the `Esc` key, both the `qdsCancel` and\n * `qdsClose` events are emitted.\n */\n @Event({ eventName: 'qdsCancel', bubbles: false })\n private readonly cancelEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the dropdown is closed.\n */\n @Event({ eventName: 'qdsClose', bubbles: false, cancelable: false })\n private readonly closeEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #cleanup?: () => void\n\n #Items: HTMLElement[] = []\n\n #gap = 0\n\n #middleware?: (Middleware | false)[]\n\n #referenceElement?: ReferenceElement\n\n #open = false\n\n /**\n * Whether the dropdown has been opened at least once.\n * This is used to determine whether the dropdown should update its position, gap\n * and middleware when it is opened.\n */\n #opened = false\n\n /**\n * Updates the gap between the dropdown and its target element.\n */\n @Method()\n public async updateGap(): Promise<void> {\n this.#gap = propertyToPx(this.host, '--qds-accessory-gap-floating') ?? 0\n\n await this.updateMiddleware()\n }\n\n /**\n * Shows the dropdown.\n */\n @Method()\n public async show(): Promise<void> {\n if (this.#open) return\n\n const reference = this.#referenceElement\n const { host } = this\n\n if (reference instanceof globalThis.Element) {\n reference.setAttribute('aria-expanded', 'true')\n reference.setAttribute('aria-controls', host.id)\n host.setAttribute('aria-labelledby', reference.id)\n if (!reference.hasAttribute('aria-haspopup'))\n reference.setAttribute('aria-haspopup', 'true')\n\n if (isQdsButton(reference) && reference.action === 'dropdown')\n reference.action = 'dropdown-close'\n }\n\n if (!this.#opened) {\n await this.updateGap()\n this.#opened = true\n }\n this.startAutoUpdate()\n this.#open = true\n host.hidden = false\n host.showPopover()\n }\n\n /**\n * Closes the dropdown.\n */\n @Method()\n public async close(): Promise<void> {\n if (!this.#open) return\n\n if (this.#referenceElement instanceof globalThis.Element) {\n this.#referenceElement.setAttribute('aria-expanded', 'false')\n this.#referenceElement.removeAttribute('aria-controls')\n\n if (\n isQdsButton(this.#referenceElement) &&\n this.#referenceElement.action === 'dropdown-close'\n )\n this.#referenceElement.action = 'dropdown'\n }\n\n if (this.#cleanup) this.#cleanup()\n this.#open = false\n this.host.hidden = true\n this.host.hidePopover()\n\n this.closeEmitter.emit()\n }\n\n @Listen('click', { target: 'document' })\n protected async handleMouseDown(event: MouseEvent): Promise<void> {\n if (!this.#open) return\n\n const composedPath = event.composedPath()\n const withinBounds =\n composedPath.includes(this.host) ||\n (this.#referenceElement instanceof globalThis.Element &&\n composedPath.includes(this.#referenceElement))\n if (!withinBounds) await this.close()\n }\n\n @Listen('click')\n protected async onItemClick(event: MouseEvent): Promise<void> {\n if (!this.keepOpenOnSelect && isEnabledItem(event.target)) {\n await this.close()\n }\n }\n\n @Watch('target')\n protected async updateReferenceElement(): Promise<void> {\n this.#disconnectReferenceElement()\n\n this.#referenceElement = resolveTarget(this.target)\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#referenceElement.setAttribute('aria-expanded', 'false')\n this.#referenceElement.addEventListener(\n 'click',\n this.#boundOnReferenceClick,\n )\n this.#referenceElement.addEventListener('focusout', this.#boundOnFocusout)\n this.#referenceElement.addEventListener('keydown', this.#boundOnKeydown)\n\n if (this.host.role === 'menu') {\n this.#referenceElement.id ||= `qds-dropdown-trigger-${autoIncrementingId}`\n this.host.setAttribute('aria-labelledby', this.#referenceElement.id)\n }\n }\n\n @Watch('flipOptions')\n @Watch('noFlip')\n @Watch('noShift')\n @Watch('offsetOptions')\n @Watch('shiftOptions')\n protected async updateMiddleware(): Promise<void> {\n this.#middleware = [\n offset({\n ...this.offsetOptions,\n mainAxis: this.#gap,\n }),\n !this.noFlip &&\n flip({\n crossAxis: this.noShift,\n ...this.flipOptions,\n }),\n !this.noShift &&\n shift({\n limiter: limitShift(),\n ...this.shiftOptions,\n }),\n ]\n }\n\n @Watch('placement')\n @Watch('strategy')\n protected async updatePosition(): Promise<void> {\n if (!this.#referenceElement) return\n\n const { x, y, strategy } = await computePosition(\n this.#referenceElement,\n this.host,\n {\n middleware: this.#middleware,\n placement: this.placement,\n strategy: this.strategy,\n },\n )\n Object.assign(this.host.style, {\n position: strategy,\n left: `${x}px`,\n top: `${y}px`,\n })\n }\n\n @Watch('autoUpdateOptions')\n protected startAutoUpdate(): void {\n if (!this.#referenceElement) return\n\n if (this.#cleanup) this.#cleanup()\n this.#cleanup = autoUpdate(\n this.#referenceElement,\n this.host,\n () => {\n ignorePromise(this.updatePosition())\n },\n this.autoUpdateOptions,\n )\n }\n\n public async componentWillLoad(): Promise<void> {\n this.host.hidden = true\n this.host.popover = 'manual'\n this.internals.role = 'menu'\n this.host.id ||= `qds-dropdown-${autoIncrementingId}`\n await this.updateReferenceElement()\n autoIncrementingId += 1\n }\n\n public disconnectedCallback(): void {\n this.#disconnectReferenceElement()\n }\n\n public render() {\n return (\n <Host onKeyDown={this.#onKeydown} onFocusout={this.#onFocusout}>\n <slot onSlotchange={this.#onSlotchange} />\n </Host>\n )\n }\n\n readonly #onFocusout = async (event: Event): Promise<void> => {\n if (!(event instanceof FocusEvent)) return\n const { relatedTarget } = event\n\n if (\n relatedTarget instanceof globalThis.Element &&\n !this.host.contains(relatedTarget) &&\n this.#referenceElement !== relatedTarget\n )\n await this.close()\n }\n\n #focusOnTrigger(): void {\n if (\n this.#referenceElement instanceof globalThis.HTMLElement ||\n this.#referenceElement instanceof globalThis.SVGElement\n ) {\n this.#referenceElement.focus()\n }\n }\n\n readonly #onKeydown = async (event: Event): Promise<void> => {\n if (!(event instanceof KeyboardEvent)) return\n\n const { key, target } = event\n\n if (key === 'Enter' && !this.keepOpenOnSelect && isEnabledItem(target)) {\n await this.close()\n this.#focusOnTrigger()\n return\n }\n\n if (\n key === 'Escape' &&\n (target === this.#referenceElement ||\n (target instanceof globalThis.Element &&\n target.closest('qds-dropdown') === this.host))\n ) {\n const cancelEvent = this.cancelEmitter.emit()\n if (cancelEvent.defaultPrevented) return\n\n await this.close()\n this.#focusOnTrigger()\n\n return\n }\n\n if (\n target === this.#referenceElement &&\n (key === 'ArrowDown' || key === 'ArrowUp')\n ) {\n if (!this.#open) await this.show()\n this.#focusFirstItem()\n event.preventDefault()\n return\n }\n\n if (!VERTICAL_MOVE_KEYS.has(key)) return\n\n const Items = this.#Items.filter(\n (item: HTMLElement) =>\n isEnabledItem(item) && item.closest('qds-dropdown') === this.host,\n )\n\n if (Items.length === 0) return\n\n event.preventDefault()\n event.stopPropagation()\n\n const currentIndex = Items.findIndex(\n (item: HTMLElement) => item.getAttribute('tabindex') === '0',\n )\n\n let nextIndex = currentIndex\n\n switch (key) {\n case 'ArrowUp': {\n nextIndex = currentIndex > 0 ? currentIndex - 1 : Items.length - 1\n break\n }\n case 'ArrowDown': {\n nextIndex = currentIndex < Items.length - 1 ? currentIndex + 1 : 0\n break\n }\n case 'Home': {\n nextIndex = 0\n break\n }\n case 'End': {\n nextIndex = Items.length - 1\n break\n }\n default: {\n return\n }\n }\n const nextItem = Items[nextIndex]\n for (const [index, item] of Items.entries()) {\n ;(item as HTMLElement).setAttribute(\n 'tabindex',\n index === nextIndex ? '0' : '-1',\n )\n }\n\n nextItem.focus()\n event.preventDefault()\n }\n\n readonly #onReferenceClick = async (): Promise<void> => {\n if (this.disabled) return\n\n if (this.#open) {\n await this.close()\n return\n }\n\n await this.show()\n this.#focusFirstItem()\n }\n\n #focusFirstItem(): void {\n requestAnimationFrame(() => {\n const firstItem = this.#Items.find(\n (item) =>\n item instanceof HTMLElement &&\n isEnabledItem(item) &&\n item.closest('qds-dropdown') === this.host,\n )\n if (!firstItem) return\n for (const item of this.#Items) item.setAttribute('tabindex', '-1')\n firstItem.setAttribute('tabindex', '0')\n firstItem.focus()\n })\n }\n\n #disconnectReferenceElement(): void {\n this.host.removeAttribute('aria-labelledby')\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#referenceElement.removeEventListener(\n 'focusout',\n this.#boundOnFocusout,\n )\n this.#referenceElement.removeEventListener('keydown', this.#boundOnKeydown)\n this.#referenceElement.removeAttribute('aria-expanded')\n this.#referenceElement.removeAttribute('aria-controls')\n }\n\n readonly #boundOnFocusout = (event: Event): void => {\n ignorePromise(this.#onFocusout(event))\n }\n\n readonly #boundOnKeydown = (event: Event): void => {\n ignorePromise(this.#onKeydown(event))\n }\n\n readonly #boundOnReferenceClick = (): void => {\n ignorePromise(this.#onReferenceClick())\n }\n\n readonly #onSlotchange = (event: Event): void => {\n const slot = event.target as HTMLSlotElement\n const assignedElements = slot.assignedElements({ flatten: true })\n\n this.#Items = assignedElements.filter((element): element is HTMLElement =>\n isEnabledItem(element),\n )\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-BCa4FoJP.js","mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,4RAA4R;;ACAhT;AACA;AACA;;;;;;;;;;;;;;;;;;AA0CA,IAAI,kBAAkB,GAAG,CAAC;AAE1B,MAAM,WAAW,GAAG,CAClB,OAA2B,KAE3B,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,YAAY;AAEhD,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IAChD,iBAAiB;IACjB,eAAe;AAChB,CAAA,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,OAAgB,KACrC,OAAO,YAAYA,CAAW;IAC9B,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;AAC/C,IAAA,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC;IACjC,CAAC,OAAO,CAAC,KAAK;MAWH,QAAQ,iBAAAC,kBAAA,CAAA,MAAA,QAAA,SAAAD,CAAA,CAAA;AALrB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAcE;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAgBjD;;;AAGG;AACqB,QAAA,IAAM,CAAA,MAAA,GAAY,KAAK;AAE/C;;;AAGG;AACqB,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK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;QAChB,KAAK,MAAM,IAAI,IAAI,sBAAA,CAAA,IAAI,EAAO,eAAA,EAAA,GAAA,CAAA;AAAE,YAAA,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC;AACnE,QAAA,SAAS,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC;QACvC,SAAS,CAAC,KAAK,EAAE;AACnB,KAAC,CAAC;AACJ,CAAC,EAAA,oCAAA,GAAA,SAAA,oCAAA,GAAA;AAGC,IAAA,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC;AAE5C,IAAA,IAAI,EAAE,sBAAA,CAAA,IAAI,kCAAkB,YAAY,UAAU,CAAC,OAAO,CAAC;QAAE;IAE7D,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,mBAAmB,CACxC,UAAU,EACV,sBAAA,CAAA,IAAI,EAAiB,yBAAA,EAAA,GAAA,CAAA,CACtB;IACD,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,mBAAmB,CAAC,SAAS,EAAE,sBAAA,CAAA,IAAI,EAAgB,wBAAA,EAAA,GAAA,CAAA,CAAC;AAC3E,IAAA,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,eAAe,CAAC,eAAe,CAAC;AACvD,IAAA,sBAAA,CAAA,IAAI,EAAkB,0BAAA,EAAA,GAAA,CAAA,CAAC,eAAe,CAAC,eAAe,CAAC;AACzD,CAAC;;;;;;;;;;;;;;;;;","names":["HTMLElement","__stencil_proxyCustomElement"],"sources":["src/components/dropdown/dropdown.css?tag=qds-dropdown&encapsulation=shadow","src/components/dropdown/dropdown.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n background-color: var(--qds-theme-popup-background);\n border-radius: var(--qds-popup-border-radius);\n border: none;\n box-shadow: var(--qds-popup-elevation);\n box-sizing: border-box;\n display: inline-block;\n inset: unset;\n margin: 0;\n overflow: initial;\n padding: 0;\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n AutoUpdateOptions,\n DetectOverflowOptions,\n FlipOptions,\n Middleware,\n Placement,\n ReferenceElement,\n ShiftOptions,\n Strategy,\n} from '@floating-ui/dom'\nimport {\n autoUpdate,\n computePosition,\n flip,\n limitShift,\n offset,\n shift,\n} from '@floating-ui/dom'\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Host,\n Listen,\n Method,\n Prop,\n Watch,\n} from '@stencil/core'\n\nimport type { OffsetOptions } from '../../helpers'\nimport {\n ignorePromise,\n propertyToPx,\n resolveTarget,\n VERTICAL_MOVE_KEYS,\n} from '../../helpers'\n\nlet autoIncrementingId = 1\n\nconst isQdsButton = (\n element: globalThis.Element,\n): element is HTMLQdsButtonElement =>\n element.tagName.toLowerCase() === 'qds-button'\n\nconst ALLOWED_TAGS: ReadonlySet<string> = new Set([\n 'qds-action-item',\n 'qds-menu-item',\n])\n\nconst isEnabledItem = (element: unknown): element is HTMLElement =>\n element instanceof HTMLElement &&\n ALLOWED_TAGS.has(element.tagName.toLowerCase()) &&\n !element.hasAttribute('disabled') &&\n !element.inert\n\n/**\n * @slot Content to display in the dropdown.\n * @see https://quartz.se.com/build/components/dropdown\n */\n@Component({\n tag: 'qds-dropdown',\n shadow: { delegatesFocus: true },\n styleUrl: 'dropdown.css',\n})\nexport class Dropdown implements ComponentInterface {\n /**\n * Options to pass to Floating UI's\n * [`autoUpdate()` function](https://floating-ui.com/docs/autoUpdate).\n *\n * @see https://floating-ui.com/docs/autoupdate#options\n */\n @Prop() public readonly autoUpdateOptions?: AutoUpdateOptions\n\n /**\n * Prevents the dropdown from being shown by user interaction. The dropdown\n * can still be displayed by calling the `show()` method.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n *\n * The [`crossAxis` option](https://floating-ui.com/docs/flip#crossaxis) is\n * set to the value of the `noShift` property by default for interoperability\n * with the [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/flip#options\n */\n @Prop() public readonly flipOptions?: Partial<\n DetectOverflowOptions & FlipOptions\n >\n\n /**\n * Disable Floating UI's\n * [`flip` middleware](https://floating-ui.com/docs/flip).\n */\n @Prop() public readonly noFlip: boolean = false\n\n /**\n * Disable Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n */\n @Prop() public readonly noShift: boolean = false\n\n /**\n * Options to pass to Floating UI's\n * [`offset` middleware](https://floating-ui.com/docs/offset).\n *\n * The [`mainAxis` option](https://floating-ui.com/docs/offset#mainaxis) is\n * not supported.\n *\n * @see https://floating-ui.com/docs/offset#options\n */\n @Prop() public readonly offsetOptions?: OffsetOptions\n\n /**\n * Where to place the dropdown relative to the `target`.\n *\n * @see https://floating-ui.com/docs/tutorial#placements\n */\n @Prop() public readonly placement: Placement = 'bottom-start'\n\n /**\n * Options to pass to Floating UI's\n * [`shift` middleware](https://floating-ui.com/docs/shift).\n *\n * @see https://floating-ui.com/docs/shift#options\n */\n @Prop() public readonly shiftOptions?: Partial<\n DetectOverflowOptions & ShiftOptions\n >\n\n /**\n * The CSS position strategy to use.\n *\n * @see https://floating-ui.com/docs/computeposition#strategy\n */\n @Prop() public readonly strategy?: Strategy\n\n /**\n * The trigger element that will trigger the dropdown. The target specified\n * can be any of the following:\n *\n * - A CSS selector string\n * - A reference to an [`Element`][] or [Virtual Element][]\n * - A function returning a reference to an [`Element`][],\n * [Virtual Element][], or a CSS selector string\n *\n * [`Element`]: https://developer.mozilla.org/docs/Web/API/Element\n * [Virtual Element]: https://floating-ui.com/docs/virtual-elements\n */\n @Prop() public readonly target!:\n | ReferenceElement\n | string\n | (() => ReferenceElement | string)\n\n /**\n * By default, the dropdown is closed when an item is selected. This attribute will keep it open instead. Useful for\n * dropdowns that allow for multiple interactions.\n */\n @Prop() public readonly keepOpenOnSelect: boolean = false\n\n /**\n * Emitted when the user instructs the browser that they wish to dismiss the\n * current open dropdown by pressing the `Esc` key.\n *\n * When a dropdown is dismissed with the `Esc` key, both the `qdsCancel` and\n * `qdsClose` events are emitted.\n */\n @Event({ eventName: 'qdsCancel', bubbles: false })\n private readonly cancelEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the dropdown is closed.\n */\n @Event({ eventName: 'qdsClose', bubbles: false, cancelable: false })\n private readonly closeEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #cleanup?: () => void\n\n #Items: HTMLElement[] = []\n\n #gap = 0\n\n #middleware?: (Middleware | false)[]\n\n #referenceElement?: ReferenceElement\n\n #open = false\n\n /**\n * Whether the dropdown has been opened at least once.\n * This is used to determine whether the dropdown should update its position, gap\n * and middleware when it is opened.\n */\n #opened = false\n\n /**\n * Updates the gap between the dropdown and its target element.\n */\n @Method()\n public async updateGap(): Promise<void> {\n this.#gap = propertyToPx(this.host, '--qds-accessory-gap-floating') ?? 0\n\n await this.updateMiddleware()\n }\n\n /**\n * Shows the dropdown.\n */\n @Method()\n public async show(): Promise<void> {\n if (this.#open) return\n\n const reference = this.#referenceElement\n const { host } = this\n\n if (reference instanceof globalThis.Element) {\n reference.setAttribute('aria-expanded', 'true')\n reference.setAttribute('aria-controls', host.id)\n host.setAttribute('aria-labelledby', reference.id)\n if (!reference.hasAttribute('aria-haspopup'))\n reference.setAttribute('aria-haspopup', 'true')\n\n if (isQdsButton(reference) && reference.action === 'dropdown')\n reference.action = 'dropdown-close'\n }\n\n if (!this.#opened) {\n await this.updateGap()\n this.#opened = true\n }\n this.startAutoUpdate()\n this.#open = true\n host.hidden = false\n host.showPopover()\n }\n\n /**\n * Closes the dropdown.\n */\n @Method()\n public async close(): Promise<void> {\n if (!this.#open) return\n\n if (this.#referenceElement instanceof globalThis.Element) {\n this.#referenceElement.setAttribute('aria-expanded', 'false')\n this.#referenceElement.removeAttribute('aria-controls')\n\n if (\n isQdsButton(this.#referenceElement) &&\n this.#referenceElement.action === 'dropdown-close'\n )\n this.#referenceElement.action = 'dropdown'\n }\n\n if (this.#cleanup) this.#cleanup()\n this.#open = false\n this.host.hidden = true\n this.host.hidePopover()\n\n this.closeEmitter.emit()\n }\n\n @Listen('click', { target: 'document' })\n protected async handleMouseDown(event: MouseEvent): Promise<void> {\n if (!this.#open) return\n\n const composedPath = event.composedPath()\n const withinBounds =\n composedPath.includes(this.host) ||\n (this.#referenceElement instanceof globalThis.Element &&\n composedPath.includes(this.#referenceElement))\n if (!withinBounds) await this.close()\n }\n\n @Listen('click')\n protected async onItemClick(event: MouseEvent): Promise<void> {\n if (!this.keepOpenOnSelect && isEnabledItem(event.target)) {\n await this.close()\n }\n }\n\n @Watch('target')\n protected async updateReferenceElement(): Promise<void> {\n this.#disconnectReferenceElement()\n\n this.#referenceElement = resolveTarget(this.target)\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#referenceElement.setAttribute('aria-expanded', 'false')\n this.#referenceElement.addEventListener(\n 'click',\n this.#boundOnReferenceClick,\n )\n this.#referenceElement.addEventListener('focusout', this.#boundOnFocusout)\n this.#referenceElement.addEventListener('keydown', this.#boundOnKeydown)\n\n if (this.host.role === 'menu') {\n this.#referenceElement.id ||= `qds-dropdown-trigger-${autoIncrementingId}`\n this.host.setAttribute('aria-labelledby', this.#referenceElement.id)\n }\n }\n\n @Watch('flipOptions')\n @Watch('noFlip')\n @Watch('noShift')\n @Watch('offsetOptions')\n @Watch('shiftOptions')\n protected async updateMiddleware(): Promise<void> {\n this.#middleware = [\n offset({\n ...this.offsetOptions,\n mainAxis: this.#gap,\n }),\n !this.noFlip &&\n flip({\n crossAxis: this.noShift,\n ...this.flipOptions,\n }),\n !this.noShift &&\n shift({\n limiter: limitShift(),\n ...this.shiftOptions,\n }),\n ]\n }\n\n @Watch('placement')\n @Watch('strategy')\n protected async updatePosition(): Promise<void> {\n if (!this.#referenceElement) return\n\n const { x, y, strategy } = await computePosition(\n this.#referenceElement,\n this.host,\n {\n middleware: this.#middleware,\n placement: this.placement,\n strategy: this.strategy,\n },\n )\n Object.assign(this.host.style, {\n position: strategy,\n left: `${x}px`,\n top: `${y}px`,\n })\n }\n\n @Watch('autoUpdateOptions')\n protected startAutoUpdate(): void {\n if (!this.#referenceElement) return\n\n if (this.#cleanup) this.#cleanup()\n this.#cleanup = autoUpdate(\n this.#referenceElement,\n this.host,\n () => {\n ignorePromise(this.updatePosition())\n },\n this.autoUpdateOptions,\n )\n }\n\n public async componentWillLoad(): Promise<void> {\n this.host.hidden = true\n this.host.popover = 'manual'\n this.internals.role = 'menu'\n this.host.id ||= `qds-dropdown-${autoIncrementingId}`\n await this.updateReferenceElement()\n autoIncrementingId += 1\n }\n\n public disconnectedCallback(): void {\n this.#disconnectReferenceElement()\n }\n\n public render() {\n return (\n <Host onKeyDown={this.#onKeydown} onFocusout={this.#onFocusout}>\n <slot onSlotchange={this.#onSlotchange} />\n </Host>\n )\n }\n\n readonly #onFocusout = async (event: Event): Promise<void> => {\n if (!(event instanceof FocusEvent)) return\n const { relatedTarget } = event\n\n if (\n relatedTarget instanceof globalThis.Element &&\n !this.host.contains(relatedTarget) &&\n this.#referenceElement !== relatedTarget\n )\n await this.close()\n }\n\n #focusOnTrigger(): void {\n if (\n this.#referenceElement instanceof globalThis.HTMLElement ||\n this.#referenceElement instanceof globalThis.SVGElement\n ) {\n this.#referenceElement.focus()\n }\n }\n\n readonly #onKeydown = async (event: Event): Promise<void> => {\n if (!(event instanceof KeyboardEvent)) return\n\n const { key, target } = event\n\n if (key === 'Enter' && !this.keepOpenOnSelect && isEnabledItem(target)) {\n await this.close()\n this.#focusOnTrigger()\n return\n }\n\n if (\n key === 'Escape' &&\n (target === this.#referenceElement ||\n (target instanceof globalThis.Element &&\n target.closest('qds-dropdown') === this.host))\n ) {\n const cancelEvent = this.cancelEmitter.emit()\n if (cancelEvent.defaultPrevented) return\n\n await this.close()\n this.#focusOnTrigger()\n\n return\n }\n\n if (\n target === this.#referenceElement &&\n (key === 'ArrowDown' || key === 'ArrowUp')\n ) {\n if (!this.#open) await this.show()\n this.#focusFirstItem()\n event.preventDefault()\n return\n }\n\n if (!VERTICAL_MOVE_KEYS.has(key)) return\n\n const Items = this.#Items.filter(\n (item: HTMLElement) =>\n isEnabledItem(item) && item.closest('qds-dropdown') === this.host,\n )\n\n if (Items.length === 0) return\n\n event.preventDefault()\n event.stopPropagation()\n\n const currentIndex = Items.findIndex(\n (item: HTMLElement) => item.getAttribute('tabindex') === '0',\n )\n\n let nextIndex = currentIndex\n\n switch (key) {\n case 'ArrowUp': {\n nextIndex = currentIndex > 0 ? currentIndex - 1 : Items.length - 1\n break\n }\n case 'ArrowDown': {\n nextIndex = currentIndex < Items.length - 1 ? currentIndex + 1 : 0\n break\n }\n case 'Home': {\n nextIndex = 0\n break\n }\n case 'End': {\n nextIndex = Items.length - 1\n break\n }\n default: {\n return\n }\n }\n const nextItem = Items[nextIndex]\n for (const [index, item] of Items.entries()) {\n ;(item as HTMLElement).setAttribute(\n 'tabindex',\n index === nextIndex ? '0' : '-1',\n )\n }\n\n nextItem.focus()\n event.preventDefault()\n }\n\n readonly #onReferenceClick = async (): Promise<void> => {\n if (this.disabled) return\n\n if (this.#open) {\n await this.close()\n return\n }\n\n await this.show()\n this.#focusFirstItem()\n }\n\n #focusFirstItem(): void {\n requestAnimationFrame(() => {\n const firstItem = this.#Items.find(\n (item) =>\n item instanceof HTMLElement &&\n isEnabledItem(item) &&\n item.closest('qds-dropdown') === this.host,\n )\n if (!firstItem) return\n for (const item of this.#Items) item.setAttribute('tabindex', '-1')\n firstItem.setAttribute('tabindex', '0')\n firstItem.focus()\n })\n }\n\n #disconnectReferenceElement(): void {\n this.host.removeAttribute('aria-labelledby')\n\n if (!(this.#referenceElement instanceof globalThis.Element)) return\n\n this.#referenceElement.removeEventListener(\n 'focusout',\n this.#boundOnFocusout,\n )\n this.#referenceElement.removeEventListener('keydown', this.#boundOnKeydown)\n this.#referenceElement.removeAttribute('aria-expanded')\n this.#referenceElement.removeAttribute('aria-controls')\n }\n\n readonly #boundOnFocusout = (event: Event): void => {\n ignorePromise(this.#onFocusout(event))\n }\n\n readonly #boundOnKeydown = (event: Event): void => {\n ignorePromise(this.#onKeydown(event))\n }\n\n readonly #boundOnReferenceClick = (): void => {\n ignorePromise(this.#onReferenceClick())\n }\n\n readonly #onSlotchange = (event: Event): void => {\n const slot = event.target as HTMLSlotElement\n const assignedElements = slot.assignedElements({ flatten: true })\n\n this.#Items = assignedElements.filter((element): element is HTMLElement =>\n isEnabledItem(element),\n )\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SPDX-FileCopyrightText: ©
|
|
2
|
+
* SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
@@ -269,6 +269,6 @@ const VERTICAL_MOVE_KEYS = new Set([
|
|
|
269
269
|
]);
|
|
270
270
|
|
|
271
271
|
export { HORIZONTAL_MOVE_KEYS as H, VERTICAL_MOVE_KEYS as V, isEllipsisActive as a, inheritAriaAttributes as b, pickInputEventAttributes as c, determineLinkIcon as d, ignorePromise as e, propertyToPx as f, resolvePanelElement as g, componentOnReady as h, invariant as i, roundByDPR as j, isTouchDevice as k, pickFocusEventAttributes as p, resolveTarget as r };
|
|
272
|
-
//# sourceMappingURL=p-
|
|
272
|
+
//# sourceMappingURL=p-BGl6PA-C.js.map
|
|
273
273
|
|
|
274
|
-
//# sourceMappingURL=p-
|
|
274
|
+
//# sourceMappingURL=p-BGl6PA-C.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-CmhdNcHF.js","mappings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.ts"],"sourcesContent":["// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n MiddlewareState,\n OffsetOptions as LibraryOffsetOptions,\n ReferenceElement,\n} from '@floating-ui/dom'\nimport type { Except, Replace } from 'type-fest'\n\nimport type { LinkIcon } from './components/shared'\n\nexport type Attributes = Record<string, string | undefined>\n\nconst inheritAttributes = (\n element: Element,\n attributes: string[] = [],\n): Attributes => {\n const attributeObject: Attributes = {}\n\n for (const attribute of attributes) {\n const value = element.getAttribute(attribute)\n if (value !== null) {\n attributeObject[attribute] = value\n element.removeAttribute(attribute)\n }\n }\n\n return attributeObject\n}\n\ntype ARIAAttribute =\n | Replace<Lowercase<keyof ARIAMixin>, 'aria', 'aria-'>\n | 'aria-activedescendant'\n | 'aria-braillelabel'\n | 'aria-brailleroledescription'\n | 'aria-colindextext'\n | 'aria-controls'\n | 'aria-describedby'\n | 'aria-description'\n | 'aria-details'\n | 'aria-errormessage'\n | 'aria-flowto'\n | 'aria-labelledby'\n | 'aria-owns'\n | 'aria-relevant'\n | 'aria-rowindextext'\n\nconst ariaAttributes: ARIAAttribute[] = [\n 'aria-activedescendant',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-braillelabel',\n 'aria-brailleroledescription',\n 'aria-busy',\n 'aria-checked',\n 'aria-colcount',\n 'aria-colindex',\n 'aria-colindextext',\n 'aria-colspan',\n 'aria-controls',\n 'aria-current',\n 'aria-describedby',\n 'aria-description',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-flowto',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-level',\n 'aria-live',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-owns',\n 'aria-placeholder',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-roledescription',\n 'aria-rowcount',\n 'aria-rowindex',\n 'aria-rowindextext',\n 'aria-rowspan',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n 'role',\n]\n\n/**\n * Returns an array of aria attributes that should be copied from\n * the shadow host element to a target within the light DOM.\n *\n * @param element The element that the attributes should be copied from.\n */\nexport const inheritAriaAttributes = (\n element: Element,\n): ReturnType<typeof inheritAttributes> =>\n inheritAttributes(element, ariaAttributes)\n\nconst isProduction = process.env.NODE_ENV === 'production'\nconst prefix = 'Invariant failed'\n\n/**\n * Throws an error if the value is falsy.\n *\n * @param value Value to test.\n * @param message Optional message to display in development builds.\n */\nexport function invariant(value: unknown, message?: string): asserts value {\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n if (value) return\n if (isProduction) throw new Error(prefix)\n\n const error = message === undefined ? prefix : `${prefix}: ${message}`\n throw new Error(error)\n}\n\n/**\n * From an object pick a set of keys.\n *\n * @param object Object to pick from.\n * @param keys They keys to pick.\n * @returns New object with only the picked keys.\n */\nexport const pick = <T, K extends keyof T>(\n object: T,\n ...keys: K[]\n): Pick<T, K> => {\n const returnValue: Partial<Pick<T, K>> = {}\n for (const key of keys) returnValue[key] = object[key]\n return returnValue as Pick<T, K>\n}\n\nexport type QdsFocusEventDetail = Pick<FocusEvent, 'relatedTarget'>\nexport type QdsInputEventDetail = Pick<\n InputEvent,\n 'data' | 'inputType' | 'isComposing'\n>\nexport const pickFocusEventAttributes = (\n event: FocusEvent,\n): QdsFocusEventDetail => pick(event, 'relatedTarget')\nexport const pickInputEventAttributes = (\n event: InputEvent,\n): QdsInputEventDetail => pick(event, 'data', 'inputType', 'isComposing')\n\nconst getConversionFactor = (\n element: Element,\n unit: string,\n): number | undefined => {\n switch (unit) {\n case 'cm': {\n return 96 / 2.54\n }\n case 'em': {\n return Number.parseFloat(\n globalThis.getComputedStyle(\n element.parentElement ?? document.documentElement,\n ).fontSize,\n )\n }\n case 'in': {\n return 96\n }\n case 'mm': {\n return 96 / 25.4\n }\n case 'pc': {\n return 16\n }\n case 'pt': {\n return 96 / 72\n }\n case 'px': {\n return 1\n }\n case 'rem': {\n return Number.parseFloat(\n globalThis.getComputedStyle(document.documentElement).fontSize,\n )\n }\n default: {\n return undefined\n }\n }\n}\n\nexport const propertyToPx = (\n element: Element,\n property: string,\n): number | undefined => {\n const value = globalThis.getComputedStyle(element).getPropertyValue(property)\n const number = Number.parseFloat(value)\n if (Number.isNaN(number)) return undefined\n const unit = /\\s*[\\d+.-]*\\s*(.*)/.exec(value)?.[1] ?? ''\n\n const conversionFactor = getConversionFactor(element, unit) ?? 1\n return number * conversionFactor\n}\n\nexport const ignorePromise = <T>(promise: Promise<T>): void => {\n promise.catch(() => {\n invariant(false)\n })\n}\n\nexport const isTouchDevice = (): boolean =>\n 'ontouchstart' in globalThis ||\n ('maxTouchPoints' in globalThis && globalThis.navigator.maxTouchPoints > 0)\n\nexport const roundByDPR = (value: number): number => {\n const dpr = devicePixelRatio || 1\n return Math.round(value * dpr) / dpr\n}\n\n/**\n * Checks if an element's ellipsis is active.\n *\n * @param element The element to check.\n * @returns `true` if ellipsis is active, `false` otherwise.\n */\nexport const isEllipsisActive = (element: HTMLElement): boolean => {\n if (!element.parentElement) return false\n\n const temporary = element.cloneNode(true) as HTMLElement\n Object.assign(temporary.style, {\n position: 'fixed',\n overflow: 'visible',\n whiteSpace: 'nowrap',\n visibility: 'hidden',\n })\n element.parentElement.append(temporary)\n\n try {\n const fullWidth = temporary.getBoundingClientRect().width\n const displayWidth = element.getBoundingClientRect().width\n\n return fullWidth > displayWidth\n } finally {\n temporary.remove()\n }\n}\n\nexport const determineLinkIcon = (\n target?: string,\n // eslint-disable-next-line unicorn/prevent-abbreviations\n rel?: string,\n): LinkIcon | undefined => {\n if (!(rel?.split(' ') ?? []).includes('external')) return undefined\n return target === '_blank' ? 'external-new-tab-link' : 'external-link'\n}\n\nexport const resolveTarget = (\n target?: ReferenceElement | string | (() => ReferenceElement | string),\n): ReferenceElement | undefined => {\n const resolvedTarget = typeof target === 'function' ? target() : target\n if (typeof resolvedTarget !== 'string') return resolvedTarget\n\n const element = document.querySelector(resolvedTarget)\n if (element === null) throw new Error('String must resolve to an Element.')\n return element\n}\n\n/**\n * Patched version of requestAnimationFrame that avoids ngzone\n * Use only when you know ngzone should not run\n */\nexport const raf = (h: FrameRequestCallback): number => {\n const win = window as Window & {\n ['__zone_symbol__requestAnimationFrame']?: (\n callback: FrameRequestCallback,\n ) => number\n }\n // eslint-disable-next-line no-underscore-dangle\n if (typeof win.__zone_symbol__requestAnimationFrame === 'function') {\n // eslint-disable-next-line no-underscore-dangle\n return win.__zone_symbol__requestAnimationFrame(h)\n }\n if (typeof requestAnimationFrame === 'function') {\n return requestAnimationFrame(h)\n }\n return setTimeout(h)\n}\n\n/**\n * Waits for a component to be ready for\n * both custom element and non-custom element builds.\n * If non-custom element build, el.componentOnReady\n * will be used.\n * For custom element builds, we wait a frame\n * so that the inner contents of the component\n * have a chance to render.\n *\n * Use this utility rather than calling\n * el.componentOnReady yourself.\n *\n * Reference: https://stenciljs.com/docs/api#componentonready\n */\nexport const componentOnReady = <\n T extends { componentOnReady?: () => Promise<T> },\n>(\n element: T,\n callback: (element_: T) => void,\n): void => {\n if (element.componentOnReady === undefined) {\n raf(() => {\n callback(element)\n })\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n element.componentOnReady().then((resolvedElement) => {\n callback(resolvedElement)\n })\n }\n}\n\nfunction resolvePanelFromValue(value: unknown): HTMLElement | undefined {\n if (value instanceof HTMLElement) {\n return value\n }\n\n if (typeof value === 'string') {\n const element = document.querySelector(value)\n return element instanceof HTMLElement ? element : undefined\n }\n\n return undefined\n}\n\nexport function resolvePanelElement(\n tab: HTMLQdsTabElement,\n): HTMLElement | undefined {\n const panelValue = typeof tab.panel === 'function' ? tab.panel() : tab.panel\n return resolvePanelFromValue(panelValue)\n}\n\nexport type OffsetValue = Except<\n Exclude<\n LibraryOffsetOptions,\n // eslint-disable-next-line @typescript-eslint/ban-types\n Function | number\n >,\n 'mainAxis'\n>\nexport type OffsetFunction = (state: MiddlewareState) => OffsetValue\nexport type OffsetOptions = OffsetFunction | OffsetValue\n\nexport const HORIZONTAL_MOVE_KEYS: ReadonlySet<string> = new Set([\n 'ArrowLeft',\n 'ArrowRight',\n 'Home',\n 'End',\n])\n\nexport const VERTICAL_MOVE_KEYS: ReadonlySet<string> = new Set([\n 'ArrowUp',\n 'ArrowDown',\n 'Home',\n 'End',\n])\n"],"version":3}
|
|
1
|
+
{"file":"p-BGl6PA-C.js","mappings":";;;;;AAAA;AACA;AACA;AAaA,MAAM,iBAAiB,GAAG,CACxB,OAAgB,EAChB,UAAuB,GAAA,EAAE,KACX;IACd,MAAM,eAAe,GAAe,EAAE;AAEtC,IAAA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC;AAC7C,QAAA,IAAI,KAAK,KAAK,IAAI,EAAE;AAClB,YAAA,eAAe,CAAC,SAAS,CAAC,GAAG,KAAK;AAClC,YAAA,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC;;;AAItC,IAAA,OAAO,eAAe;AACxB,CAAC;AAmBD,MAAM,cAAc,GAAoB;IACtC,uBAAuB;IACvB,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,6BAA6B;IAC7B,WAAW;IACX,cAAc;IACd,eAAe;IACf,eAAe;IACf,mBAAmB;IACnB,cAAc;IACd,eAAe;IACf,cAAc;IACd,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,eAAe;IACf,aAAa;IACb,eAAe;IACf,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,YAAY;IACZ,iBAAiB;IACjB,YAAY;IACZ,WAAW;IACX,gBAAgB;IAChB,sBAAsB;IACtB,kBAA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ACjC,GAAsB,EAAA;IAEtB,MAAM,UAAU,GAAG,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU,GAAG,GAAG,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,KAAK;AAC5E,IAAA,OAAO,qBAAqB,CAAC,UAAU,CAAC;AAC1C;AAaa,MAAA,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IAC/D,WAAW;IACX,YAAY;IACZ,MAAM;IACN,KAAK;AACN,CAAA;AAEY,MAAA,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,SAAS;IACT,WAAW;IACX,MAAM;IACN,KAAK;AACN,CAAA;;;;","names":[],"sources":["src/helpers.ts"],"sourcesContent":["// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {\n MiddlewareState,\n OffsetOptions as LibraryOffsetOptions,\n ReferenceElement,\n} from '@floating-ui/dom'\nimport type { Except, Replace } from 'type-fest'\n\nimport type { LinkIcon } from './components/shared'\n\nexport type Attributes = Record<string, string | undefined>\n\nconst inheritAttributes = (\n element: Element,\n attributes: string[] = [],\n): Attributes => {\n const attributeObject: Attributes = {}\n\n for (const attribute of attributes) {\n const value = element.getAttribute(attribute)\n if (value !== null) {\n attributeObject[attribute] = value\n element.removeAttribute(attribute)\n }\n }\n\n return attributeObject\n}\n\ntype ARIAAttribute =\n | Replace<Lowercase<keyof ARIAMixin>, 'aria', 'aria-'>\n | 'aria-activedescendant'\n | 'aria-braillelabel'\n | 'aria-brailleroledescription'\n | 'aria-colindextext'\n | 'aria-controls'\n | 'aria-describedby'\n | 'aria-description'\n | 'aria-details'\n | 'aria-errormessage'\n | 'aria-flowto'\n | 'aria-labelledby'\n | 'aria-owns'\n | 'aria-relevant'\n | 'aria-rowindextext'\n\nconst ariaAttributes: ARIAAttribute[] = [\n 'aria-activedescendant',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-braillelabel',\n 'aria-brailleroledescription',\n 'aria-busy',\n 'aria-checked',\n 'aria-colcount',\n 'aria-colindex',\n 'aria-colindextext',\n 'aria-colspan',\n 'aria-controls',\n 'aria-current',\n 'aria-describedby',\n 'aria-description',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-flowto',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-level',\n 'aria-live',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-owns',\n 'aria-placeholder',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-roledescription',\n 'aria-rowcount',\n 'aria-rowindex',\n 'aria-rowindextext',\n 'aria-rowspan',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n 'role',\n]\n\n/**\n * Returns an array of aria attributes that should be copied from\n * the shadow host element to a target within the light DOM.\n *\n * @param element The element that the attributes should be copied from.\n */\nexport const inheritAriaAttributes = (\n element: Element,\n): ReturnType<typeof inheritAttributes> =>\n inheritAttributes(element, ariaAttributes)\n\nconst isProduction = process.env.NODE_ENV === 'production'\nconst prefix = 'Invariant failed'\n\n/**\n * Throws an error if the value is falsy.\n *\n * @param value Value to test.\n * @param message Optional message to display in development builds.\n */\nexport function invariant(value: unknown, message?: string): asserts value {\n // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n if (value) return\n if (isProduction) throw new Error(prefix)\n\n const error = message === undefined ? prefix : `${prefix}: ${message}`\n throw new Error(error)\n}\n\n/**\n * From an object pick a set of keys.\n *\n * @param object Object to pick from.\n * @param keys They keys to pick.\n * @returns New object with only the picked keys.\n */\nexport const pick = <T, K extends keyof T>(\n object: T,\n ...keys: K[]\n): Pick<T, K> => {\n const returnValue: Partial<Pick<T, K>> = {}\n for (const key of keys) returnValue[key] = object[key]\n return returnValue as Pick<T, K>\n}\n\nexport type QdsFocusEventDetail = Pick<FocusEvent, 'relatedTarget'>\nexport type QdsInputEventDetail = Pick<\n InputEvent,\n 'data' | 'inputType' | 'isComposing'\n>\nexport const pickFocusEventAttributes = (\n event: FocusEvent,\n): QdsFocusEventDetail => pick(event, 'relatedTarget')\nexport const pickInputEventAttributes = (\n event: InputEvent,\n): QdsInputEventDetail => pick(event, 'data', 'inputType', 'isComposing')\n\nconst getConversionFactor = (\n element: Element,\n unit: string,\n): number | undefined => {\n switch (unit) {\n case 'cm': {\n return 96 / 2.54\n }\n case 'em': {\n return Number.parseFloat(\n globalThis.getComputedStyle(\n element.parentElement ?? document.documentElement,\n ).fontSize,\n )\n }\n case 'in': {\n return 96\n }\n case 'mm': {\n return 96 / 25.4\n }\n case 'pc': {\n return 16\n }\n case 'pt': {\n return 96 / 72\n }\n case 'px': {\n return 1\n }\n case 'rem': {\n return Number.parseFloat(\n globalThis.getComputedStyle(document.documentElement).fontSize,\n )\n }\n default: {\n return undefined\n }\n }\n}\n\nexport const propertyToPx = (\n element: Element,\n property: string,\n): number | undefined => {\n const value = globalThis.getComputedStyle(element).getPropertyValue(property)\n const number = Number.parseFloat(value)\n if (Number.isNaN(number)) return undefined\n const unit = /\\s*[\\d+.-]*\\s*(.*)/.exec(value)?.[1] ?? ''\n\n const conversionFactor = getConversionFactor(element, unit) ?? 1\n return number * conversionFactor\n}\n\nexport const ignorePromise = <T>(promise: Promise<T>): void => {\n promise.catch(() => {\n invariant(false)\n })\n}\n\nexport const isTouchDevice = (): boolean =>\n 'ontouchstart' in globalThis ||\n ('maxTouchPoints' in globalThis && globalThis.navigator.maxTouchPoints > 0)\n\nexport const roundByDPR = (value: number): number => {\n const dpr = devicePixelRatio || 1\n return Math.round(value * dpr) / dpr\n}\n\n/**\n * Checks if an element's ellipsis is active.\n *\n * @param element The element to check.\n * @returns `true` if ellipsis is active, `false` otherwise.\n */\nexport const isEllipsisActive = (element: HTMLElement): boolean => {\n if (!element.parentElement) return false\n\n const temporary = element.cloneNode(true) as HTMLElement\n Object.assign(temporary.style, {\n position: 'fixed',\n overflow: 'visible',\n whiteSpace: 'nowrap',\n visibility: 'hidden',\n })\n element.parentElement.append(temporary)\n\n try {\n const fullWidth = temporary.getBoundingClientRect().width\n const displayWidth = element.getBoundingClientRect().width\n\n return fullWidth > displayWidth\n } finally {\n temporary.remove()\n }\n}\n\nexport const determineLinkIcon = (\n target?: string,\n // eslint-disable-next-line unicorn/prevent-abbreviations\n rel?: string,\n): LinkIcon | undefined => {\n if (!(rel?.split(' ') ?? []).includes('external')) return undefined\n return target === '_blank' ? 'external-new-tab-link' : 'external-link'\n}\n\nexport const resolveTarget = (\n target?: ReferenceElement | string | (() => ReferenceElement | string),\n): ReferenceElement | undefined => {\n const resolvedTarget = typeof target === 'function' ? target() : target\n if (typeof resolvedTarget !== 'string') return resolvedTarget\n\n const element = document.querySelector(resolvedTarget)\n if (element === null) throw new Error('String must resolve to an Element.')\n return element\n}\n\n/**\n * Patched version of requestAnimationFrame that avoids ngzone\n * Use only when you know ngzone should not run\n */\nexport const raf = (h: FrameRequestCallback): number => {\n const win = window as Window & {\n ['__zone_symbol__requestAnimationFrame']?: (\n callback: FrameRequestCallback,\n ) => number\n }\n // eslint-disable-next-line no-underscore-dangle\n if (typeof win.__zone_symbol__requestAnimationFrame === 'function') {\n // eslint-disable-next-line no-underscore-dangle\n return win.__zone_symbol__requestAnimationFrame(h)\n }\n if (typeof requestAnimationFrame === 'function') {\n return requestAnimationFrame(h)\n }\n return setTimeout(h)\n}\n\n/**\n * Waits for a component to be ready for\n * both custom element and non-custom element builds.\n * If non-custom element build, el.componentOnReady\n * will be used.\n * For custom element builds, we wait a frame\n * so that the inner contents of the component\n * have a chance to render.\n *\n * Use this utility rather than calling\n * el.componentOnReady yourself.\n *\n * Reference: https://stenciljs.com/docs/api#componentonready\n */\nexport const componentOnReady = <\n T extends { componentOnReady?: () => Promise<T> },\n>(\n element: T,\n callback: (element_: T) => void,\n): void => {\n if (element.componentOnReady === undefined) {\n raf(() => {\n callback(element)\n })\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n element.componentOnReady().then((resolvedElement) => {\n callback(resolvedElement)\n })\n }\n}\n\nfunction resolvePanelFromValue(value: unknown): HTMLElement | undefined {\n if (value instanceof HTMLElement) {\n return value\n }\n\n if (typeof value === 'string') {\n const element = document.querySelector(value)\n return element instanceof HTMLElement ? element : undefined\n }\n\n return undefined\n}\n\nexport function resolvePanelElement(\n tab: HTMLQdsTabElement,\n): HTMLElement | undefined {\n const panelValue = typeof tab.panel === 'function' ? tab.panel() : tab.panel\n return resolvePanelFromValue(panelValue)\n}\n\nexport type OffsetValue = Except<\n Exclude<\n LibraryOffsetOptions,\n // eslint-disable-next-line @typescript-eslint/ban-types\n Function | number\n >,\n 'mainAxis'\n>\nexport type OffsetFunction = (state: MiddlewareState) => OffsetValue\nexport type OffsetOptions = OffsetFunction | OffsetValue\n\nexport const HORIZONTAL_MOVE_KEYS: ReadonlySet<string> = new Set([\n 'ArrowLeft',\n 'ArrowRight',\n 'Home',\n 'End',\n])\n\nexport const VERTICAL_MOVE_KEYS: ReadonlySet<string> = new Set([\n 'ArrowUp',\n 'ArrowDown',\n 'Home',\n 'End',\n])\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SPDX-FileCopyrightText: ©
|
|
2
|
+
* SPDX-FileCopyrightText: © 2026 Schneider Electric
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
@@ -1688,6 +1688,6 @@ const computePosition = (reference, floating, options) => {
|
|
|
1688
1688
|
};
|
|
1689
1689
|
|
|
1690
1690
|
export { autoUpdate as a, arrow as b, computePosition as c, flip as f, limitShift as l, offset as o, shift as s };
|
|
1691
|
-
//# sourceMappingURL=p-
|
|
1691
|
+
//# sourceMappingURL=p-Bv2vPjgL.js.map
|
|
1692
1692
|
|
|
1693
|
-
//# sourceMappingURL=p-
|
|
1693
|
+
//# sourceMappingURL=p-Bv2vPjgL.js.map
|