@quartzds/core 1.0.0-beta.113 → 1.0.0-beta.115
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 +50 -0
- package/components/index.d.ts +2 -2
- package/components/index.js +2 -2
- package/components/{p-CB1GgGmx.js → p--vOFwWP9.js} +4 -4
- package/components/{p-CB1GgGmx.js.map → p--vOFwWP9.js.map} +1 -1
- package/{dist/esm/helpers-CDZIefsI.js → components/p-Bs-thw7N.js} +24 -8
- package/components/{p-CzJQDr3N.js.map → p-Bs-thw7N.js.map} +1 -1
- package/components/{p-9fm05BrQ.js → p-D6kEwmWw.js} +16 -9
- package/components/p-D6kEwmWw.js.map +1 -0
- package/components/{p-jzP-octC.js → p-DG13nyez.js} +13 -13
- package/components/p-DG13nyez.js.map +1 -0
- package/components/{p-oYV2Vg_F.js → p-DHsQa63F.js} +6 -6
- package/components/{p-oYV2Vg_F.js.map → p-DHsQa63F.js.map} +1 -1
- package/components/{p-GGIVf4ry.js → p-DQ0iArwG.js} +12 -12
- package/components/p-DQ0iArwG.js.map +1 -0
- package/components/{p-Cin_uEzc.js → p-DRvYbv4e.js} +6 -6
- package/components/{p-Cin_uEzc.js.map → p-DRvYbv4e.js.map} +1 -1
- package/components/p-DabDNFFa.js +112 -0
- package/components/p-DabDNFFa.js.map +1 -0
- package/components/{p-CPvTGxdE.js → p-DeLdhUte.js} +9 -9
- package/components/p-DeLdhUte.js.map +1 -0
- package/components/{p-CK_Yxg3A.js → p-Df4zqimN.js} +11 -9
- package/components/p-Df4zqimN.js.map +1 -0
- package/components/{p-Dqnx5weA.js → p-Dmky30vp.js} +3 -3
- package/components/{p-Dqnx5weA.js.map → p-Dmky30vp.js.map} +1 -1
- package/components/{p-CSR3ZAEX.js → p-I5PkZmy8.js} +4 -4
- package/components/{p-CSR3ZAEX.js.map → p-I5PkZmy8.js.map} +1 -1
- package/components/qds-action-item.js +7 -7
- package/components/qds-action-item.js.map +1 -1
- package/components/{qds-nav-list-item.d.ts → qds-avatar-media.d.ts} +4 -4
- package/components/qds-avatar-media.js +14 -0
- package/components/qds-avatar-media.js.map +1 -0
- package/components/qds-breadcrumb-item.js +7 -7
- package/components/qds-breadcrumb-item.js.map +1 -1
- package/components/qds-button.js +1 -1
- package/components/qds-checkbox.js +1 -1
- package/components/qds-chip.js +11 -11
- package/components/qds-chip.js.map +1 -1
- package/components/qds-dialog.js +26 -7
- package/components/qds-dialog.js.map +1 -1
- package/components/qds-dropdown.js +1 -1
- package/components/qds-form-message.js +5 -5
- package/components/qds-form-message.js.map +1 -1
- package/components/qds-icon-button.js +10 -8
- package/components/qds-icon-button.js.map +1 -1
- package/components/qds-icon.js +1 -1
- package/components/qds-inline-link.js +43 -13
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.js +6 -6
- package/components/qds-label.js +1 -1
- package/components/qds-list-item.js +22 -16
- package/components/qds-list-item.js.map +1 -1
- package/components/qds-loader.js +3 -3
- package/components/qds-loader.js.map +1 -1
- package/components/qds-menu-item.js +9 -9
- package/components/qds-menu-item.js.map +1 -1
- package/components/qds-mini-button.js +1 -1
- package/components/qds-progress-bar.js +1 -1
- package/components/qds-radio.js +1 -1
- package/components/qds-select.js +5 -5
- package/components/qds-standalone-link.js +43 -13
- package/components/qds-standalone-link.js.map +1 -1
- package/components/qds-switch.js +5 -5
- package/components/qds-tab.js +11 -11
- package/components/qds-tab.js.map +1 -1
- package/components/qds-tabbar.js +8 -8
- package/components/qds-table-cell.js +2 -2
- package/components/qds-table-head-cell.js +2 -2
- package/components/qds-table-row.js +1 -1
- package/components/qds-table.js +1 -1
- package/components/qds-tag.js +1 -1
- package/components/qds-textarea.js +3 -3
- package/components/qds-title.js +1 -1
- package/components/qds-tooltip.js +1 -1
- package/dist/cjs/{helpers-D--0PcCT.js → helpers-BH_NFaV-.js} +24 -8
- package/dist/cjs/helpers-BH_NFaV-.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{library-CF8K3bIq.js → library-C_NJJiFI.js} +15 -8
- package/dist/cjs/library-C_NJJiFI.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qds-action-item.cjs.entry.js +5 -5
- package/dist/cjs/qds-action-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-avatar-media.qds-checkbox.qds-radio.entry.cjs.js.map +1 -0
- package/dist/cjs/{qds-checkbox_2.cjs.entry.js → qds-avatar-media_3.cjs.entry.js} +79 -8
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +5 -5
- package/dist/cjs/qds-breadcrumb-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-button.cjs.entry.js +8 -8
- package/dist/cjs/qds-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-chip.cjs.entry.js +8 -8
- package/dist/cjs/qds-chip.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-dialog.cjs.entry.js +23 -4
- package/dist/cjs/qds-dialog.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/qds-form-message.cjs.entry.js +4 -4
- package/dist/cjs/qds-form-message.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-icon-button.cjs.entry.js +8 -6
- package/dist/cjs/qds-icon-button.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-icon.cjs.entry.js +2 -2
- package/dist/cjs/qds-inline-link.cjs.entry.js +39 -8
- package/dist/cjs/qds-inline-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-input.cjs.entry.js +4 -4
- package/dist/cjs/qds-label.cjs.entry.js +9 -9
- package/dist/cjs/qds-label.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-list-item.cjs.entry.js +10 -10
- package/dist/cjs/qds-list-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-loader.cjs.entry.js +2 -2
- package/dist/cjs/qds-loader.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-menu-item.cjs.entry.js +6 -6
- package/dist/cjs/qds-menu-item.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-mini-button.cjs.entry.js +1 -1
- package/dist/cjs/qds-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/qds-select.cjs.entry.js +4 -4
- package/dist/cjs/qds-standalone-link.cjs.entry.js +39 -8
- package/dist/cjs/qds-standalone-link.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-switch.cjs.entry.js +4 -4
- package/dist/cjs/qds-tab.cjs.entry.js +7 -7
- package/dist/cjs/qds-tab.entry.cjs.js.map +1 -1
- package/dist/cjs/qds-tabbar.cjs.entry.js +5 -5
- package/dist/cjs/qds-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-row.cjs.entry.js +1 -1
- package/dist/cjs/qds-table.cjs.entry.js +1 -1
- package/dist/cjs/qds-tag_2.cjs.entry.js +6 -6
- package/dist/cjs/qds-textarea.cjs.entry.js +3 -3
- package/dist/cjs/qds-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/qds.cjs.js +1 -1
- package/dist/custom-elements.json +311 -367
- package/dist/docs.json +223 -331
- package/{components/p-CzJQDr3N.js → dist/esm/helpers-t9FQ7Vl_.js} +24 -8
- package/dist/esm/helpers-t9FQ7Vl_.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/{library-B2PJ_ZJB.js → library-C7n28y3j.js} +15 -8
- package/dist/esm/library-C7n28y3j.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qds-action-item.entry.js +5 -5
- package/dist/esm/qds-action-item.entry.js.map +1 -1
- package/dist/esm/qds-avatar-media.qds-checkbox.qds-radio.entry.js.map +1 -0
- package/dist/esm/{qds-checkbox_2.entry.js → qds-avatar-media_3.entry.js} +79 -9
- package/dist/esm/qds-breadcrumb-item.entry.js +5 -5
- package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/qds-button.entry.js +8 -8
- package/dist/esm/qds-button.entry.js.map +1 -1
- package/dist/esm/qds-chip.entry.js +8 -8
- package/dist/esm/qds-chip.entry.js.map +1 -1
- package/dist/esm/qds-dialog.entry.js +23 -4
- package/dist/esm/qds-dialog.entry.js.map +1 -1
- package/dist/esm/qds-dropdown.entry.js +1 -1
- package/dist/esm/qds-form-message.entry.js +4 -4
- package/dist/esm/qds-form-message.entry.js.map +1 -1
- package/dist/esm/qds-icon-button.entry.js +8 -6
- package/dist/esm/qds-icon-button.entry.js.map +1 -1
- package/dist/esm/qds-icon.entry.js +2 -2
- package/dist/esm/qds-inline-link.entry.js +39 -8
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +4 -4
- package/dist/esm/qds-label.entry.js +9 -9
- package/dist/esm/qds-label.entry.js.map +1 -1
- package/dist/esm/qds-list-item.entry.js +10 -10
- package/dist/esm/qds-list-item.entry.js.map +1 -1
- package/dist/esm/qds-loader.entry.js +2 -2
- package/dist/esm/qds-loader.entry.js.map +1 -1
- package/dist/esm/qds-menu-item.entry.js +6 -6
- package/dist/esm/qds-menu-item.entry.js.map +1 -1
- package/dist/esm/qds-mini-button.entry.js +1 -1
- package/dist/esm/qds-progress-bar.entry.js +1 -1
- package/dist/esm/qds-select.entry.js +4 -4
- package/dist/esm/qds-standalone-link.entry.js +39 -8
- package/dist/esm/qds-standalone-link.entry.js.map +1 -1
- package/dist/esm/qds-switch.entry.js +4 -4
- package/dist/esm/qds-tab.entry.js +7 -7
- package/dist/esm/qds-tab.entry.js.map +1 -1
- package/dist/esm/qds-tabbar.entry.js +5 -5
- package/dist/esm/qds-table-cell.entry.js +2 -2
- package/dist/esm/qds-table-head-cell.entry.js +2 -2
- package/dist/esm/qds-table-row.entry.js +1 -1
- package/dist/esm/qds-table.entry.js +1 -1
- package/dist/esm/qds-tag_2.entry.js +6 -6
- package/dist/esm/qds-textarea.entry.js +3 -3
- package/dist/esm/qds-tooltip.entry.js +2 -2
- package/dist/esm/qds.js +1 -1
- package/dist/types/components/avatar-media/avatar-media.d.ts +39 -0
- package/dist/types/components/icon-button/icon-button.d.ts +1 -1
- package/dist/types/components/inline-link/inline-link.d.ts +1 -1
- package/dist/types/components/label/label.d.ts +1 -1
- package/dist/types/components/standalone-link/standalone-link.d.ts +1 -1
- package/dist/types/components.d.ts +94 -125
- package/dist/types/helpers.d.ts +3 -3
- package/dist/vscode.html-custom-data.json +29 -52
- package/hydrate/index.js +694 -632
- package/hydrate/index.mjs +694 -632
- package/package.json +1 -1
- package/components/p-9fm05BrQ.js.map +0 -1
- package/components/p-CK_Yxg3A.js.map +0 -1
- package/components/p-CPvTGxdE.js.map +0 -1
- package/components/p-GGIVf4ry.js.map +0 -1
- package/components/p-jzP-octC.js.map +0 -1
- package/components/qds-nav-list-item.js +0 -164
- package/components/qds-nav-list-item.js.map +0 -1
- package/dist/cjs/helpers-D--0PcCT.js.map +0 -1
- package/dist/cjs/library-CF8K3bIq.js.map +0 -1
- package/dist/cjs/qds-checkbox.qds-radio.entry.cjs.js.map +0 -1
- package/dist/cjs/qds-nav-list-item.cjs.entry.js +0 -120
- package/dist/cjs/qds-nav-list-item.entry.cjs.js.map +0 -1
- package/dist/esm/helpers-CDZIefsI.js.map +0 -1
- package/dist/esm/library-B2PJ_ZJB.js.map +0 -1
- package/dist/esm/qds-checkbox.qds-radio.entry.js.map +0 -1
- package/dist/esm/qds-nav-list-item.entry.js +0 -118
- package/dist/esm/qds-nav-list-item.entry.js.map +0 -1
- package/dist/types/components/nav-list-item/nav-list-item.d.ts +0 -67
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, d as readTask, h } from './p-BEWDu8_P.js';
|
|
7
|
-
import { p as pickFocusEventAttributes, i as invariant, a as
|
|
8
|
-
import { d as defineCustomElement$4 } from './p-
|
|
9
|
-
import { d as defineCustomElement$3 } from './p-
|
|
10
|
-
import { d as defineCustomElement$2 } from './p
|
|
7
|
+
import { p as pickFocusEventAttributes, i as invariant, a as isEllipsisActive } from './p-Bs-thw7N.js';
|
|
8
|
+
import { d as defineCustomElement$4 } from './p-Dmky30vp.js';
|
|
9
|
+
import { d as defineCustomElement$3 } from './p-D6kEwmWw.js';
|
|
10
|
+
import { d as defineCustomElement$2 } from './p--vOFwWP9.js';
|
|
11
11
|
|
|
12
|
-
const menuItemCss = ":host([hidden]){display:none!important}:host{display:block}:host(:focus-visible){border-radius:var(--qds-focus-border-radius);outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-menu-item-container{align-items:center;display:flex}.qds-disabled{cursor:not-allowed;opacity:var(--qds-theme-disabled);pointer-events:none}.qds-icon{color:var(--qds-theme-text-standard)}.qds-text{color:var(--qds-theme-title);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-shortcut{color:var(--qds-theme-text-subdued)}[data-size=small] .qds-menu-item-container{gap:var(--qds-list-item-small-gap-internal);min-height:var(--qds-list-item-small-height);padding-inline:var(--qds-list-item-small-padding-horizontal)}[data-size=small] .menu-item-checkable
|
|
12
|
+
const menuItemCss = ":host([hidden]){display:none!important}:host{display:block}:host(:focus-visible){border-radius:var(--qds-focus-border-radius);outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-menu-item-container{align-items:center;display:flex}.qds-disabled{cursor:not-allowed;opacity:var(--qds-theme-disabled);pointer-events:none}.qds-icon{color:var(--qds-theme-text-standard)}.qds-text{color:var(--qds-theme-title);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-shortcut{color:var(--qds-theme-text-subdued)}[data-size=small] .qds-menu-item-container{gap:var(--qds-list-item-small-gap-internal);min-height:var(--qds-list-item-small-height);padding-inline:var(--qds-list-item-small-padding-horizontal)}[data-size=small] .menu-item-checkable,[data-size=small] .qds-icon{height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}[data-size=small] .qds-text{font:var(--qds-list-item-small-title)}[data-size=standard] .qds-menu-item-container{gap:var(--qds-list-item-standard-gap-internal);min-height:var(--qds-list-item-standard-height);padding-inline:var(--qds-list-item-standard-padding-horizontal)}[data-size=standard] .menu-item-checkable,[data-size=standard] .qds-icon{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}[data-size=standard] .qds-text{font:var(--qds-list-item-standard-title)}[data-size=large] .qds-menu-item-container{gap:var(--qds-list-item-large-gap-internal);min-height:var(--qds-list-item-large-height);padding-inline:var(--qds-list-item-large-padding-horizontal)}[data-size=large] .menu-item-checkable,[data-size=large] .qds-icon{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}[data-size=large] .qds-text{font:var(--qds-list-item-large-title)}.qds-menu-item{align-items:center;-webkit-appearance:none;appearance:none;border:none;border-radius:var(--qds-control-border-radius);box-sizing:border-box;color:var(--qds-theme-text-standard);cursor:pointer;display:flex;flex-grow:1;text-align:initial;-webkit-text-decoration:none;text-decoration:none}.qds-menu-item:not(.qds-selected):not(.qds-disabled):hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-menu-item:not(.qds-selected):not(.qds-disabled):active{background-color:var(--qds-theme-interactive-background-pressed)}";
|
|
13
13
|
|
|
14
14
|
// SPDX-FileCopyrightText: © 2025 Schneider Electric
|
|
15
15
|
//
|
|
@@ -103,10 +103,10 @@ const MenuItem = /*@__PURE__*/ proxyCustomElement(class MenuItem extends H {
|
|
|
103
103
|
invariant(__classPrivateFieldGet(this, _MenuItem_span, "f"));
|
|
104
104
|
const span = __classPrivateFieldGet(this, _MenuItem_span, "f");
|
|
105
105
|
readTask(() => {
|
|
106
|
-
this.tooltip =
|
|
106
|
+
this.tooltip = isEllipsisActive(span);
|
|
107
107
|
});
|
|
108
108
|
__classPrivateFieldSet(this, _MenuItem_ro, new ResizeObserver(([spanEntry]) => {
|
|
109
|
-
this.tooltip =
|
|
109
|
+
this.tooltip = isEllipsisActive(spanEntry.target);
|
|
110
110
|
}), "f");
|
|
111
111
|
__classPrivateFieldGet(this, _MenuItem_ro, "f").observe(__classPrivateFieldGet(this, _MenuItem_span, "f"));
|
|
112
112
|
}
|
|
@@ -117,11 +117,11 @@ const MenuItem = /*@__PURE__*/ proxyCustomElement(class MenuItem extends H {
|
|
|
117
117
|
this.disabledChanged();
|
|
118
118
|
}
|
|
119
119
|
render() {
|
|
120
|
-
return (h("div", { key: '
|
|
120
|
+
return (h("div", { key: 'b8454a28e6a29f24a95f4950b638e954147f0def', class: {
|
|
121
121
|
'qds-menu-item': true,
|
|
122
122
|
'qds-disabled': __classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_computedDisabled_get),
|
|
123
123
|
'qds-has-submenu': __classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_hasSubmenu_get),
|
|
124
|
-
}, ref: __classPrivateFieldGet(this, _MenuItem_menuitemDivRef, "f"), "data-size": __classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_computedSize_get), "aria-hidden": "true" }, h("div", { key: '
|
|
124
|
+
}, ref: __classPrivateFieldGet(this, _MenuItem_menuitemDivRef, "f"), "data-size": __classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_computedSize_get), "aria-hidden": "true" }, h("div", { key: '1a68b3955e885de3eaaba08f7c3942725d6a2cbc', class: "qds-menu-item-container" }, __classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_computedCheckable_get) && !__classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_computedChecked_get) && (h("span", { key: '04d8061f121116785a71b6d757d4c7655f7d4570', class: "menu-item-checkable" })), __classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_computedChecked_get) && (h("qds-icon", { key: 'd6485fb3a39a1e017612c1931fc35b2ad87dc021', class: "qds-icon", library: "core", name: "checked" })), this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '546959fe9b235fad85fb7f3b69970ebb0de895b8', class: "qds-icon", library: this.iconLibrary, name: this.iconName })), h("span", { key: '12d44c8e4ef630aafe51033de1e396ee5bad418b', class: "qds-text", ref: __classPrivateFieldGet(this, _MenuItem_spanRef, "f") }, this.text), this.shortcut !== undefined && this.shortcut !== '' && (h("span", { key: '93e81f7b27658b66c941bcee3c013e7b801d11f4', class: "qds-shortcut" }, this.shortcut)), __classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_hasSubmenu_get) && (h("qds-icon", { key: '9dbad66e98cf520a37e0fb17f593b6144073e3b3', class: "qds-icon", library: "core", name: "navigation" }))), __classPrivateFieldGet(this, _MenuItem_instances, "a", _MenuItem_hasSubmenu_get) && (h("qds-dropdown", { key: '4ee1c768d8b95446472d0d421b22fc1f5762789a', class: "qds-accessory qds-related", placement: "right-start", target: __classPrivateFieldGet(this, _MenuItem_menuitemDivRef, "f") }, h("slot", { key: 'a94adab6a68f516340c6436a440674ed03a9c984' }))), this.tooltip && (h("qds-tooltip", { key: 'de57b2a6a63a5b251bc5657969e784d2ecbc0f10', ref: __classPrivateFieldGet(this, _MenuItem_tooltipRef, "f") }, this.text))));
|
|
125
125
|
}
|
|
126
126
|
get host() { return this; }
|
|
127
127
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-menu-item.js","mappings":";;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,yqFAAyqF;;ACA7rF;AACA;AACA;;;;;;;;;;;;;;;;;;MAoCa,QAAQ,iBAAAA,kBAAA,CAAA,MAAA,QAAA,SAAAC,CAAA,CAAA;AALrB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;;AAME;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAa,KAAK;AASlD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAEvD;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAU,UAAU;AAsB/B,QAAA,IAAc,CAAA,cAAA,GAAG,KAAK;AAEtB,QAAA,IAAO,CAAA,OAAA,GAAG,KAAK;QAwBhC,YAAoB,CAAA,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AAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,0BAAA,GAAA,SAAA,0BAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,IAAI,IAAI,SAAS;AAC/B,CAAC,EAAA,+BAAA,GAAA,SAAA,+BAAA,GAAA;AAGC,IAAA,OAAO,sBAAA,CAAA,IAAI,EAAc,mBAAA,EAAA,GAAA,EAAA,0BAAA,CAAA,KAAK,UAAU;AAC1C,CAAC,EAAA,6BAAA,GAAA,SAAA,6BAAA,GAAA;AAGC,IAAA,QACE,CAAC,sBAAA,CAAA,IAAI,EAAmB,mBAAA,EAAA,GAAA,EAAA,+BAAA,CAAA,IAAI,CAAC,sBAAA,CAAA,IAAI,EAAY,mBAAA,EAAA,GAAA,EAAA,wBAAA,CAAA,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK;AAE3E,CAAC,EAAA,8BAAA,GAAA,SAAA,8BAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,QAAQ,IAAI,KAAK;AAC/B,CAAC,EAAA,wBAAA,GAAA,SAAA,wBAAA,GAAA;IAGC,OAAO,IAAI,CAAC,cAAc;AAC5B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/menu-item/menu-item.css?tag=qds-menu-item&encapsulation=shadow","src/components/menu-item/menu-item.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n:host(:focus-visible) {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n border-radius: var(--qds-focus-border-radius);\n}\n\n.qds-menu-item-container {\n display: flex;\n align-items: center;\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n cursor: not-allowed;\n}\n\n.qds-icon {\n color: var(--qds-theme-text-standard);\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--qds-theme-title);\n}\n\n.qds-shortcut {\n color: var(--qds-theme-text-subdued);\n}\n\n[data-size='small'] {\n .qds-menu-item-container {\n min-height: var(--qds-list-item-small-height);\n gap: var(--qds-list-item-small-gap-internal);\n padding-inline: var(--qds-list-item-small-padding-horizontal);\n }\n\n .menu-item-checkable {\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n\n .qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n .qds-main-icon {\n font-size: var(--qds-list-item-small-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-small-title);\n }\n}\n\n[data-size='standard'] {\n .qds-menu-item-container {\n min-height: var(--qds-list-item-standard-height);\n gap: var(--qds-list-item-standard-gap-internal);\n padding-inline: var(--qds-list-item-standard-padding-horizontal);\n }\n\n .menu-item-checkable {\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n\n .qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n .qds-main-icon {\n font-size: var(--qds-list-item-standard-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-standard-title);\n }\n}\n\n[data-size='large'] {\n .qds-menu-item-container {\n min-height: var(--qds-list-item-large-height);\n gap: var(--qds-list-item-large-gap-internal);\n padding-inline: var(--qds-list-item-large-padding-horizontal);\n }\n\n .menu-item-checkable {\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n\n .qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n .qds-main-icon {\n font-size: var(--qds-list-item-large-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-large-title);\n }\n}\n\n.qds-menu-item {\n box-sizing: border-box;\n display: flex;\n flex-grow: 1;\n align-items: center;\n appearance: none;\n border: none;\n border-radius: var(--qds-control-border-radius);\n cursor: pointer;\n text-align: initial;\n text-decoration: none;\n color: var(--qds-theme-text-standard);\n\n &:not(.qds-selected, .qds-disabled) {\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2025 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n readTask,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n invariant,\n isOverflowing,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Size } from '../shared'\n\nexport type Type = 'checkbox' | undefined\n\n/**\n *\n *\n * @see https://quartz.se.com/build/components/menu-item\n */\n@Component({\n tag: 'qds-menu-item',\n shadow: true,\n styleUrl: 'menu-item.css',\n})\nexport class MenuItem implements ComponentInterface {\n /**\n * Prevents the menu item from being interacted with: it cannot be clicked\n * or focused.\n */\n @Prop() public readonly disabled?: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The menu item's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Whether or not the menu item should be selectable.\n */\n @Prop() public type: Type\n\n /**\n * Whether or not the menu item is checked.\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * The menu item's text\n */\n @Prop() public readonly text!: string\n\n /**\n * The shortcut of the action.\n */\n @Prop() public readonly shortcut?: string\n\n @State() private hasSubmenuSlot = false\n\n @State() private tooltip = false\n\n /**\n * Emitted when the menu item loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the menu item gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the menu item is checked.\n */\n @Event({ eventName: 'qdsSelect', cancelable: false })\n private readonly selectEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #ro?: ResizeObserver\n\n #menuItem!: HTMLDivElement\n\n #span?: HTMLSpanElement\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedType(): Type {\n return this.type ?? undefined\n }\n\n get #computedCheckable(): boolean {\n return this.#computedType === 'checkbox'\n }\n\n get #computedChecked(): boolean {\n return (\n (this.#computedCheckable && !this.#hasSubmenu && this.checked) ?? false\n )\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n get #hasSubmenu(): boolean {\n return this.hasSubmenuSlot\n }\n\n @Listen('blur')\n protected onBlur(event: FocusEvent): void {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('focus')\n protected onFocus(event: FocusEvent): void {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (this.#computedCheckable) {\n this.checked = !this.#computedChecked\n this.selectEmitter.emit()\n }\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.#computedDisabled.toString()\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.internals.ariaChecked = this.#computedChecked.toString()\n }\n\n public componentDidLoad(): void {\n this.checkedChanged()\n invariant(this.#span)\n\n const span = this.#span\n readTask(() => {\n this.tooltip = isOverflowing(span)\n })\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isOverflowing(spanEntry.target)\n })\n this.#ro.observe(this.#span)\n }\n\n public componentWillLoad(): void {\n this.hasSubmenuSlot = this.host.hasChildNodes()\n this.internals.role =\n this.type === 'checkbox' ? 'menuitemcheckbox' : 'menuitem'\n this.disabledChanged()\n }\n\n public render() {\n return (\n <div\n class={{\n 'qds-menu-item': true,\n 'qds-disabled': this.#computedDisabled,\n 'qds-has-submenu': this.#hasSubmenu,\n }}\n ref={this.#menuitemDivRef}\n data-size={this.#computedSize}\n aria-hidden=\"true\"\n >\n <div class=\"qds-menu-item-container\">\n {this.#computedCheckable && !this.#computedChecked && (\n <span class=\"menu-item-checkable\" />\n )}\n {this.#computedChecked && (\n <qds-icon class=\"qds-icon\" library=\"core\" name=\"checked\" />\n )}\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <span class=\"qds-text\" ref={this.#spanRef}>\n {this.text}\n </span>\n {this.shortcut !== undefined && this.shortcut !== '' && (\n <span class=\"qds-shortcut\">{this.shortcut}</span>\n )}\n {this.#hasSubmenu && (\n <qds-icon class=\"qds-icon\" library=\"core\" name=\"navigation\" />\n )}\n </div>\n {this.#hasSubmenu && (\n <qds-dropdown\n class=\"qds-accessory qds-related\"\n placement=\"right-start\"\n target={this.#menuitemDivRef}\n >\n <slot />\n </qds-dropdown>\n )}\n {this.tooltip && (\n <qds-tooltip ref={this.#tooltipRef}>{this.text}</qds-tooltip>\n )}\n </div>\n )\n }\n\n readonly #menuitemDivRef = (menuItem?: HTMLDivElement): HTMLDivElement => {\n if (menuItem) {\n this.#menuItem = menuItem\n }\n\n return this.#menuItem\n }\n\n readonly #spanRef = (span?: HTMLSpanElement): void => {\n this.#span = span\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#menuItem\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-menu-item.js","mappings":";;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,yyEAAyy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names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/menu-item/menu-item.css?tag=qds-menu-item&encapsulation=shadow","src/components/menu-item/menu-item.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n:host(:focus-visible) {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n border-radius: var(--qds-focus-border-radius);\n}\n\n.qds-menu-item-container {\n display: flex;\n align-items: center;\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n cursor: not-allowed;\n}\n\n.qds-icon {\n color: var(--qds-theme-text-standard);\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--qds-theme-title);\n}\n\n.qds-shortcut {\n color: var(--qds-theme-text-subdued);\n}\n\n[data-size='small'] {\n .qds-menu-item-container {\n min-height: var(--qds-list-item-small-height);\n gap: var(--qds-list-item-small-gap-internal);\n padding-inline: var(--qds-list-item-small-padding-horizontal);\n }\n\n .menu-item-checkable,\n .qds-icon {\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-small-title);\n }\n}\n\n[data-size='standard'] {\n .qds-menu-item-container {\n min-height: var(--qds-list-item-standard-height);\n gap: var(--qds-list-item-standard-gap-internal);\n padding-inline: var(--qds-list-item-standard-padding-horizontal);\n }\n\n .menu-item-checkable,\n .qds-icon {\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-standard-title);\n }\n}\n\n[data-size='large'] {\n .qds-menu-item-container {\n min-height: var(--qds-list-item-large-height);\n gap: var(--qds-list-item-large-gap-internal);\n padding-inline: var(--qds-list-item-large-padding-horizontal);\n }\n\n .menu-item-checkable,\n .qds-icon {\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n\n .qds-text {\n font: var(--qds-list-item-large-title);\n }\n}\n\n.qds-menu-item {\n box-sizing: border-box;\n display: flex;\n flex-grow: 1;\n align-items: center;\n appearance: none;\n border: none;\n border-radius: var(--qds-control-border-radius);\n cursor: pointer;\n text-align: initial;\n text-decoration: none;\n color: var(--qds-theme-text-standard);\n\n &:not(.qds-selected, .qds-disabled) {\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2025 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n readTask,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n invariant,\n isEllipsisActive,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Size } from '../shared'\n\nexport type Type = 'checkbox' | undefined\n\n/**\n *\n *\n * @see https://quartz.se.com/build/components/menu-item\n */\n@Component({\n tag: 'qds-menu-item',\n shadow: true,\n styleUrl: 'menu-item.css',\n})\nexport class MenuItem implements ComponentInterface {\n /**\n * Prevents the menu item from being interacted with: it cannot be clicked\n * or focused.\n */\n @Prop() public readonly disabled?: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The menu item's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Whether or not the menu item should be selectable.\n */\n @Prop() public type: Type\n\n /**\n * Whether or not the menu item is checked.\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * The menu item's text\n */\n @Prop() public readonly text!: string\n\n /**\n * The shortcut of the action.\n */\n @Prop() public readonly shortcut?: string\n\n @State() private hasSubmenuSlot = false\n\n @State() private tooltip = false\n\n /**\n * Emitted when the menu item loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the menu item gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the menu item is checked.\n */\n @Event({ eventName: 'qdsSelect', cancelable: false })\n private readonly selectEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #ro?: ResizeObserver\n\n #menuItem!: HTMLDivElement\n\n #span?: HTMLSpanElement\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedType(): Type {\n return this.type ?? undefined\n }\n\n get #computedCheckable(): boolean {\n return this.#computedType === 'checkbox'\n }\n\n get #computedChecked(): boolean {\n return (\n (this.#computedCheckable && !this.#hasSubmenu && this.checked) ?? false\n )\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n get #hasSubmenu(): boolean {\n return this.hasSubmenuSlot\n }\n\n @Listen('blur')\n protected onBlur(event: FocusEvent): void {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('focus')\n protected onFocus(event: FocusEvent): void {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (this.#computedCheckable) {\n this.checked = !this.#computedChecked\n this.selectEmitter.emit()\n }\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.#computedDisabled.toString()\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.internals.ariaChecked = this.#computedChecked.toString()\n }\n\n public componentDidLoad(): void {\n this.checkedChanged()\n invariant(this.#span)\n\n const span = this.#span\n readTask(() => {\n this.tooltip = isEllipsisActive(span)\n })\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isEllipsisActive(spanEntry.target as HTMLSpanElement)\n })\n this.#ro.observe(this.#span)\n }\n\n public componentWillLoad(): void {\n this.hasSubmenuSlot = this.host.hasChildNodes()\n this.internals.role =\n this.type === 'checkbox' ? 'menuitemcheckbox' : 'menuitem'\n this.disabledChanged()\n }\n\n public render() {\n return (\n <div\n class={{\n 'qds-menu-item': true,\n 'qds-disabled': this.#computedDisabled,\n 'qds-has-submenu': this.#hasSubmenu,\n }}\n ref={this.#menuitemDivRef}\n data-size={this.#computedSize}\n aria-hidden=\"true\"\n >\n <div class=\"qds-menu-item-container\">\n {this.#computedCheckable && !this.#computedChecked && (\n <span class=\"menu-item-checkable\" />\n )}\n {this.#computedChecked && (\n <qds-icon class=\"qds-icon\" library=\"core\" name=\"checked\" />\n )}\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <span class=\"qds-text\" ref={this.#spanRef}>\n {this.text}\n </span>\n {this.shortcut !== undefined && this.shortcut !== '' && (\n <span class=\"qds-shortcut\">{this.shortcut}</span>\n )}\n {this.#hasSubmenu && (\n <qds-icon class=\"qds-icon\" library=\"core\" name=\"navigation\" />\n )}\n </div>\n {this.#hasSubmenu && (\n <qds-dropdown\n class=\"qds-accessory qds-related\"\n placement=\"right-start\"\n target={this.#menuitemDivRef}\n >\n <slot />\n </qds-dropdown>\n )}\n {this.tooltip && (\n <qds-tooltip ref={this.#tooltipRef}>{this.text}</qds-tooltip>\n )}\n </div>\n )\n }\n\n readonly #menuitemDivRef = (menuItem?: HTMLDivElement): HTMLDivElement => {\n if (menuItem) {\n this.#menuItem = menuItem\n }\n\n return this.#menuItem\n }\n\n readonly #spanRef = (span?: HTMLSpanElement): void => {\n this.#span = span\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#menuItem\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { M as MiniButton, d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { M as MiniButton, d as defineCustomElement$1 } from './p-I5PkZmy8.js';
|
|
7
7
|
|
|
8
8
|
const QdsMiniButton = MiniButton;
|
|
9
9
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -88,7 +88,7 @@ const ProgressBar = /*@__PURE__*/ proxyCustomElement(class ProgressBar extends H
|
|
|
88
88
|
this.valueChanged();
|
|
89
89
|
}
|
|
90
90
|
render() {
|
|
91
|
-
return (h("div", { key: '
|
|
91
|
+
return (h("div", { key: '2035bc7abf352a5bfaaf04a046dd30f9672dc975', "aria-hidden": "true", class: "qds-track", "data-size": __classPrivateFieldGet(this, _ProgressBar_instances, "a", _ProgressBar_computedSize_get) }, h("div", { key: '470492d53476ee40851d999a165c147069a4d449', class: {
|
|
92
92
|
'qds-bar': true,
|
|
93
93
|
'qds-indeterminate': __classPrivateFieldGet(this, _ProgressBar_position, "f") === -1,
|
|
94
94
|
}, "data-size": __classPrivateFieldGet(this, _ProgressBar_instances, "a", _ProgressBar_computedSize_get), style: { width: this.width } })));
|
package/components/qds-radio.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { R as Radio, d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { R as Radio, d as defineCustomElement$1 } from './p-Df4zqimN.js';
|
|
7
7
|
|
|
8
8
|
const QdsRadio = Radio;
|
|
9
9
|
const defineCustomElement = defineCustomElement$1;
|
package/components/qds-select.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-BEWDu8_P.js';
|
|
7
|
-
import { i as invariant, p as pickFocusEventAttributes, c as pickInputEventAttributes, b as inheritAriaAttributes } from './p-
|
|
7
|
+
import { i as invariant, p as pickFocusEventAttributes, c as pickInputEventAttributes, b as inheritAriaAttributes } from './p-Bs-thw7N.js';
|
|
8
8
|
import { V as VALID_STATE, C as CUSTOM_ERROR_FLAGS, N as NO_ERROR_FLAGS } from './p-DQLjJn7-.js';
|
|
9
|
-
import { d as defineCustomElement$2 } from './p-
|
|
9
|
+
import { d as defineCustomElement$2 } from './p-D6kEwmWw.js';
|
|
10
10
|
|
|
11
11
|
const selectCss = ":host([hidden]){display:none!important}:host{display:inline-block}slot{display:none}.qds-container{box-sizing:border-box;display:grid;grid-template-areas:\"i\"}.qds-container,.qds-select{width:inherit}.qds-icon,.qds-select{color:var(--qds-theme-control-text-standard);grid-area:i}.qds-icon{margin-inline-end:calc(var(--qds-control-input-padding-horizontal) + var(--qds-control-border-width));place-self:center end;pointer-events:none}.qds-select{-webkit-appearance:none;appearance:none;background-color:var(--qds-theme-control-input-background);border-color:var(--qds-theme-control-border);border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n ) var(--qds-control-border-radius-top-right,var(--qds-control-border-radius)) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n );border-style:solid;border-width:var(--qds-control-border-width) var(--qds-control-border-width-inline-end,var(--qds-control-border-width)) var(--qds-control-border-width-block-end,var(--qds-control-border-width)) var(--qds-control-border-width);margin:0;outline:0;padding-block:0;padding-inline:var(--qds-control-input-padding-horizontal);text-overflow:ellipsis}.qds-select:not(:focus):user-invalid{border-color:var(--qds-theme-feedback-result-failure)}.qds-select:disabled,.qds-select:disabled+.qds-icon{opacity:var(--qds-theme-disabled)}:is(::slotted(optgroup),::slotted(optgroup:not(:disabled)>option),::slotted(option)):disabled{opacity:var(--qds-theme-disabled)}::slotted(optgroup){font:var(--qds-accessory-section-title)}::slotted(optgroup>option),::slotted(option){font:var(--qds-list-item-label-main)}.qds-select[data-size=small]{font:var(--qds-control-small-text)}.qds-select[data-size=small]:not([multiple]){height:var(--qds-control-small-height);padding-inline-end:calc(var(--qds-control-small-icon-size) + var(--qds-text-icon-gap) + var(--qds-control-input-padding-horizontal))}.qds-icon[data-size=small]{height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}.qds-select[data-size=standard]{font:var(--qds-control-standard-text)}.qds-select[data-size=standard]:not([multiple]){height:var(--qds-control-standard-height);padding-inline-end:calc(var(--qds-control-standard-icon-size) + var(--qds-text-icon-gap) + var(--qds-control-input-padding-horizontal))}.qds-icon[data-size=standard]{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.qds-select[data-size=large]{font:var(--qds-control-large-text)}.qds-select[data-size=large]:not([multiple]){height:var(--qds-control-large-height);padding-inline-end:calc(var(--qds-control-large-icon-size) + var(--qds-text-icon-gap) + var(--qds-control-input-padding-horizontal))}.qds-icon[data-size=large]{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}.qds-focus-ring{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n ));grid-area:i;height:calc(100% + var(--qds-control-border-width) - var(--qds-control-border-width-block-end, var(--qds-control-border-width)));isolation:isolate;outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset);pointer-events:none;visibility:hidden;width:calc(100% + var(--qds-control-border-width) - var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n ))}.qds-select:focus-visible~.qds-focus-ring{visibility:visible}";
|
|
12
12
|
|
|
@@ -264,12 +264,12 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends H {
|
|
|
264
264
|
this.selectedIndex = __classPrivateFieldGet(this, _Select_select, "f").selectedIndex;
|
|
265
265
|
}
|
|
266
266
|
render() {
|
|
267
|
-
return (h("div", { key: '
|
|
267
|
+
return (h("div", { key: '49394446e10b83dd16df332de3ec060f4b4aef0d', class: {
|
|
268
268
|
'qds-container': true,
|
|
269
269
|
'qds-multiple': this.multiple ?? false,
|
|
270
|
-
}, "data-size": __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedSize_get) }, h("select", { key: '
|
|
270
|
+
}, "data-size": __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedSize_get) }, h("select", { key: '58acde98cc4a7c03b8a7a926c5ea17bbd55b5807', autoComplete: this.autoComplete,
|
|
271
271
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
272
|
-
autoFocus: this.host.autofocus, class: "qds-select", "data-size": __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedSize_get), disabled: __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedDisabled_get), multiple: this.multiple, name: this.name, onBlur: __classPrivateFieldGet(this, _Select_onBlur, "f"), onChange: __classPrivateFieldGet(this, _Select_onChange, "f"), onFocus: __classPrivateFieldGet(this, _Select_onFocus, "f"), onInput: __classPrivateFieldGet(this, _Select_onInput, "f"), ref: __classPrivateFieldGet(this, _Select_ref, "f"), required: this.required, tabIndex: __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedDisabled_get) ? undefined : this.tabIndex, ...__classPrivateFieldGet(this, _Select_inheritedAttributes, "f") }), this.multiple !== true && (h("qds-icon", { key: '
|
|
272
|
+
autoFocus: this.host.autofocus, class: "qds-select", "data-size": __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedSize_get), disabled: __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedDisabled_get), multiple: this.multiple, name: this.name, onBlur: __classPrivateFieldGet(this, _Select_onBlur, "f"), onChange: __classPrivateFieldGet(this, _Select_onChange, "f"), onFocus: __classPrivateFieldGet(this, _Select_onFocus, "f"), onInput: __classPrivateFieldGet(this, _Select_onInput, "f"), ref: __classPrivateFieldGet(this, _Select_ref, "f"), required: this.required, tabIndex: __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedDisabled_get) ? undefined : this.tabIndex, ...__classPrivateFieldGet(this, _Select_inheritedAttributes, "f") }), this.multiple !== true && (h("qds-icon", { key: 'd1dfe5e5050081b8dcf6e0b8c4d63645247d2e29', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Select_instances, "a", _Select_computedSize_get), library: "core", name: "dropdown" })), h("slot", { key: 'f189efbbb5ee2a4635cc5dc0a29e55818e6a4abe', onSlotchange: __classPrivateFieldGet(this, _Select_onSlotchange, "f") }), h("div", { key: 'a176b166b864bec1cc20d9c482ea62e445c9719b', class: "qds-focus-ring" })));
|
|
273
273
|
}
|
|
274
274
|
static get delegatesFocus() { return true; }
|
|
275
275
|
static get formAssociated() { return true; }
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-BEWDu8_P.js';
|
|
7
|
-
import { p as pickFocusEventAttributes, d as determineLinkIcon } from './p-
|
|
8
|
-
import { d as defineCustomElement$2 } from './p-
|
|
7
|
+
import { p as pickFocusEventAttributes, i as invariant, d as determineLinkIcon } from './p-Bs-thw7N.js';
|
|
8
|
+
import { d as defineCustomElement$2 } from './p-D6kEwmWw.js';
|
|
9
9
|
|
|
10
|
-
const standaloneLinkCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-icon-crop{align-items:center;display:flex;justify-content:center}.qds-icon{flex-shrink:0;transform:scaleX(var(--qds-direction-factor,1))}.qds-standalone-link{
|
|
10
|
+
const standaloneLinkCss = ":host([hidden]){display:none!important}:host{border-radius:var(--qds-focus-border-radius);display:inline-block}:host(:focus-visible){outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-icon-crop{align-items:center;display:flex;justify-content:center}.qds-icon{flex-shrink:0;transform:scaleX(var(--qds-direction-factor,1))}.qds-standalone-link{box-sizing:border-box;display:inline-flex;justify-content:center;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-text-decoration:none;text-decoration:none;width:100%}.qds-standalone-link:active,.qds-standalone-link:hover{-webkit-text-decoration:underline;text-decoration:underline}.qds-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}[data-importance=subdued]{color:var(--qds-theme-link-subdued-default)}.qds-visitable[data-importance=subdued]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=subdued]:hover{color:var(--qds-theme-link-subdued-hover)}[data-importance=subdued]:active{color:var(--qds-theme-link-subdued-pressed)}.qds-visitable[data-importance=subdued]:visited:hover{color:var(--qds-theme-link-visited-hover)}.qds-visitable[data-importance=subdued]:visited:active{color:var(--qds-theme-link-visited-pressed)}[data-importance=standard]{color:var(--qds-theme-link-standard-default)}.qds-visitable[data-importance=standard]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=standard]:hover{color:var(--qds-theme-link-standard-hover)}[data-importance=standard]:active{color:var(--qds-theme-link-standard-pressed)}.qds-visitable[data-importance=standard]:visited:hover{color:var(--qds-theme-link-visited-hover)}.qds-visitable[data-importance=standard]:visited:active{color:var(--qds-theme-link-visited-pressed)}[data-importance=emphasized]{color:var(--qds-theme-link-emphasized-default)}.qds-visitable[data-importance=emphasized]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=emphasized]:hover{color:var(--qds-theme-link-emphasized-hover)}[data-importance=emphasized]:active{color:var(--qds-theme-link-emphasized-pressed)}.qds-visitable[data-importance=emphasized]:visited:hover{color:var(--qds-theme-link-visited-hover)}.qds-visitable[data-importance=emphasized]:visited:active{color:var(--qds-theme-link-visited-pressed)}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-standalone-link[data-size=small]{font:var(--qds-control-small-link);gap:var(--qds-control-small-gap-internal);min-height:var(--qds-control-small-height);padding-block:var(--qds-control-small-padding-auto-height)}[data-size=small][data-importance=subdued]{font:var(--qds-control-small-text)}.qds-icon-crop[data-size=small]{height:var(--qds-control-small-icon-crop-height)}.qds-icon[data-size=small]{height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}.qds-standalone-link[data-size=standard]{font:var(--qds-control-standard-link);gap:var(--qds-control-standard-gap-internal);min-height:var(--qds-control-standard-height);padding-block:var(--qds-control-standard-padding-auto-height)}[data-size=standard][data-importance=subdued]{font:var(--qds-control-standard-text)}.qds-icon-crop[data-size=standard]{height:var(--qds-control-standard-icon-crop-height)}.qds-icon[data-size=standard]{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.qds-standalone-link[data-size=large]{font:var(--qds-control-large-link);gap:var(--qds-control-large-gap-internal);min-height:var(--qds-control-large-height);padding-block:var(--qds-control-large-padding-auto-height)}[data-size=large][data-importance=subdued]{font:var(--qds-control-large-text)}.qds-icon-crop[data-size=large]{height:var(--qds-control-large-icon-crop-height)}.qds-icon[data-size=large]{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}";
|
|
11
11
|
|
|
12
12
|
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
13
13
|
//
|
|
@@ -19,7 +19,16 @@ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) ||
|
|
|
19
19
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
20
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
23
|
+
if (kind === "m")
|
|
24
|
+
throw new TypeError("Private method is not writable");
|
|
25
|
+
if (kind === "a" && !f)
|
|
26
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
27
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
28
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
|
+
};
|
|
31
|
+
var _StandaloneLink_instances, _StandaloneLink_savedTabIndex, _StandaloneLink_link, _StandaloneLink_computedImportance_get, _StandaloneLink_computedSize_get, _StandaloneLink_openInNewTab_get, _StandaloneLink_updateAriaLabelElements, _StandaloneLink_linkRef, _StandaloneLink_onBlur, _StandaloneLink_onFocus, _StandaloneLink_onSlotchange;
|
|
23
32
|
const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink extends H {
|
|
24
33
|
constructor(registerHost) {
|
|
25
34
|
super();
|
|
@@ -52,9 +61,14 @@ const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink ext
|
|
|
52
61
|
* Defines if the standalone link will display the visited state.
|
|
53
62
|
*/
|
|
54
63
|
this.visitable = false;
|
|
64
|
+
_StandaloneLink_savedTabIndex.set(this, 0);
|
|
65
|
+
_StandaloneLink_link.set(this, void 0);
|
|
55
66
|
_StandaloneLink_updateAriaLabelElements.set(this, () => {
|
|
56
67
|
this.internals.ariaLabel = `${this.host.textContent} ${__classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_openInNewTab_get) ? 'Opens in a new tab' : ''}`.trim();
|
|
57
68
|
});
|
|
69
|
+
_StandaloneLink_linkRef.set(this, (link) => {
|
|
70
|
+
__classPrivateFieldSet(this, _StandaloneLink_link, link, "f");
|
|
71
|
+
});
|
|
58
72
|
_StandaloneLink_onBlur.set(this, (event) => {
|
|
59
73
|
this.blurEmitter.emit(pickFocusEventAttributes(event));
|
|
60
74
|
});
|
|
@@ -66,18 +80,36 @@ const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink ext
|
|
|
66
80
|
});
|
|
67
81
|
}
|
|
68
82
|
onClick(event) {
|
|
83
|
+
invariant(__classPrivateFieldGet(this, _StandaloneLink_link, "f"));
|
|
69
84
|
if (this.disabled)
|
|
70
85
|
event.stopImmediatePropagation();
|
|
86
|
+
else
|
|
87
|
+
__classPrivateFieldGet(this, _StandaloneLink_link, "f").click();
|
|
88
|
+
}
|
|
89
|
+
onKeydown(event) {
|
|
90
|
+
invariant(__classPrivateFieldGet(this, _StandaloneLink_link, "f"));
|
|
91
|
+
if (this.disabled)
|
|
92
|
+
return;
|
|
93
|
+
if (event.key === 'Enter')
|
|
94
|
+
__classPrivateFieldGet(this, _StandaloneLink_link, "f").click();
|
|
71
95
|
}
|
|
72
96
|
disabledChanged() {
|
|
73
97
|
this.internals.ariaDisabled = this.disabled.toString();
|
|
98
|
+
if (this.disabled)
|
|
99
|
+
this.host.removeAttribute('tabindex');
|
|
100
|
+
else
|
|
101
|
+
this.host.tabIndex = __classPrivateFieldGet(this, _StandaloneLink_savedTabIndex, "f");
|
|
74
102
|
}
|
|
75
103
|
tabindexChanged(newValue) {
|
|
76
104
|
const parsedValue = Number.parseInt(newValue, 10);
|
|
77
105
|
// FIXME: `undefined` instead of `0` causes `qdsFocus/qdsBlur` E2E tests
|
|
78
106
|
// to fail, but it's not clear why this is the case since it works for
|
|
79
107
|
// other components.
|
|
80
|
-
this
|
|
108
|
+
__classPrivateFieldSet(this, _StandaloneLink_savedTabIndex, Number.isNaN(parsedValue) ? 0 : parsedValue, "f");
|
|
109
|
+
if (this.disabled)
|
|
110
|
+
this.host.removeAttribute('tabindex');
|
|
111
|
+
else
|
|
112
|
+
this.host.tabIndex = __classPrivateFieldGet(this, _StandaloneLink_savedTabIndex, "f");
|
|
81
113
|
}
|
|
82
114
|
hrefTargetChanged() {
|
|
83
115
|
this.linkIcon = determineLinkIcon(this.target, this.rel);
|
|
@@ -93,13 +125,12 @@ const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink ext
|
|
|
93
125
|
__classPrivateFieldGet(this, _StandaloneLink_updateAriaLabelElements, "f").call(this);
|
|
94
126
|
}
|
|
95
127
|
render() {
|
|
96
|
-
return (h("a", { key: '
|
|
128
|
+
return (h("a", { key: 'a6f2f71f977a39583ba07a2997ea785b17effec6', "aria-hidden": "true", class: {
|
|
97
129
|
'qds-standalone-link': true,
|
|
98
130
|
'qds-disabled': this.disabled,
|
|
99
131
|
'qds-visitable': this.visitable,
|
|
100
|
-
}, "data-importance": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedImportance_get), "data-size": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedSize_get), download: this.download, href: this.href?.toString(), hrefLang: this.hreflang, onBlur: __classPrivateFieldGet(this, _StandaloneLink_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _StandaloneLink_onFocus, "f"), referrerPolicy: this.referrerPolicy, rel: this.rel, tabIndex:
|
|
132
|
+
}, "data-importance": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedImportance_get), "data-size": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedSize_get), download: this.download, href: this.href?.toString(), hrefLang: this.hreflang, onBlur: __classPrivateFieldGet(this, _StandaloneLink_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _StandaloneLink_onFocus, "f"), referrerPolicy: this.referrerPolicy, rel: this.rel, tabIndex: -1, target: this.target, ref: __classPrivateFieldGet(this, _StandaloneLink_linkRef, "f") }, this.iconName !== undefined && this.iconName !== '' && (h("span", { key: '2bfcea42c26d65fd1a6344592f0a369d16eac6cd', class: "qds-icon-crop", "data-size": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedSize_get) }, h("qds-icon", { key: '97aa272653c0fb9dcd79991999765254ce5df9fd', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedSize_get), library: this.iconLibrary, name: this.iconName }))), h("span", { key: 'a32bf8d15ffb4432d974da0c3293ab7e88418c31', class: "qds-text" }, h("slot", { key: '67af5a4d98368bfe9fa461fc70f4edde50d0a315', onSlotchange: __classPrivateFieldGet(this, _StandaloneLink_onSlotchange, "f") })), this.linkIcon && (h("span", { key: '18393dee44a347ed7412e353caad13e58f90080f', class: "qds-icon-crop", "data-size": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedSize_get) }, h("qds-icon", { key: 'd701870e516ca437bdad771c70577a73c36990f3', "aria-hidden": "true", class: "qds-icon", library: "core", "data-size": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedSize_get), name: this.linkIcon }))), this.importance === 'emphasized' && (h("span", { key: 'f0f49b2d8b2dd6d23e758677a8f9a86af6923837', class: "qds-icon-crop", "data-size": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedSize_get) }, h("qds-icon", { key: '4dfeb4355b5ed78158439893a5e077b9cc665de9', class: "qds-icon", "aria-hidden": "true", "data-size": __classPrivateFieldGet(this, _StandaloneLink_instances, "a", _StandaloneLink_computedSize_get), library: "core", name: "next" })))));
|
|
101
133
|
}
|
|
102
|
-
static get delegatesFocus() { return true; }
|
|
103
134
|
get host() { return this; }
|
|
104
135
|
static get watchers() { return {
|
|
105
136
|
"disabled": ["disabledChanged"],
|
|
@@ -108,7 +139,7 @@ const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink ext
|
|
|
108
139
|
"target": ["hrefTargetChanged"]
|
|
109
140
|
}; }
|
|
110
141
|
static get style() { return standaloneLinkCss; }
|
|
111
|
-
}, [
|
|
142
|
+
}, [257, "qds-standalone-link", {
|
|
112
143
|
"disabled": [4],
|
|
113
144
|
"iconName": [1, "icon-name"],
|
|
114
145
|
"iconLibrary": [1, "icon-library"],
|
|
@@ -121,15 +152,14 @@ const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink ext
|
|
|
121
152
|
"referrerPolicy": [1, "referrerpolicy"],
|
|
122
153
|
"rel": [1],
|
|
123
154
|
"target": [1],
|
|
124
|
-
"linkIcon": [32]
|
|
125
|
-
|
|
126
|
-
}, [[0, "click", "onClick"]], {
|
|
155
|
+
"linkIcon": [32]
|
|
156
|
+
}, [[0, "click", "onClick"], [0, "keydown", "onKeydown"]], {
|
|
127
157
|
"disabled": ["disabledChanged"],
|
|
128
158
|
"tabindex": ["tabindexChanged"],
|
|
129
159
|
"rel": ["hrefTargetChanged"],
|
|
130
160
|
"target": ["hrefTargetChanged"]
|
|
131
161
|
}]);
|
|
132
|
-
_StandaloneLink_updateAriaLabelElements = new WeakMap(), _StandaloneLink_onBlur = new WeakMap(), _StandaloneLink_onFocus = new WeakMap(), _StandaloneLink_onSlotchange = new WeakMap(), _StandaloneLink_instances = new WeakSet(), _StandaloneLink_computedImportance_get = function _StandaloneLink_computedImportance_get() {
|
|
162
|
+
_StandaloneLink_savedTabIndex = new WeakMap(), _StandaloneLink_link = new WeakMap(), _StandaloneLink_updateAriaLabelElements = new WeakMap(), _StandaloneLink_linkRef = new WeakMap(), _StandaloneLink_onBlur = new WeakMap(), _StandaloneLink_onFocus = new WeakMap(), _StandaloneLink_onSlotchange = new WeakMap(), _StandaloneLink_instances = new WeakSet(), _StandaloneLink_computedImportance_get = function _StandaloneLink_computedImportance_get() {
|
|
133
163
|
switch (this.importance) {
|
|
134
164
|
case 'subdued':
|
|
135
165
|
case 'emphasized': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-standalone-link.js","mappings":";;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,22HAA22H;;ACAr4H;AACA;AACA;;;;;;;;;MAqCa,cAAc,iBAAAA,kBAAA,CAAA,MAAA,cAAA,SAAAC,CAAA,CAAA;AAL3B,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAME;;;AAG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AAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,gCAAA,GAAA,SAAA,gCAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;AACjC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/standalone-link/standalone-link.css?tag=qds-standalone-link&encapsulation=shadow","src/components/standalone-link/standalone-link.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 display: inline-block;\n}\n\n.qds-icon-crop {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.qds-icon {\n flex-shrink: 0;\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-standalone-link {\n border-radius: var(--qds-focus-border-radius);\n box-sizing: border-box;\n display: inline-flex;\n justify-content: center;\n print-color-adjust: exact;\n text-decoration: none;\n width: 100%;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n\n &:hover,\n &:active {\n text-decoration: underline;\n }\n}\n\n.qds-text {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited.qds-visitable {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-link-standard-default);\n\n &:visited.qds-visitable {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited.qds-visitable {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-standalone-link {\n font: var(--qds-control-small-link);\n gap: var(--qds-control-small-gap-internal);\n padding-block: var(--qds-control-small-padding-auto-height);\n min-height: var(--qds-control-small-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-small-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-small-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-standalone-link {\n font: var(--qds-control-standard-link);\n gap: var(--qds-control-standard-gap-internal);\n padding-block: var(--qds-control-standard-padding-auto-height);\n min-height: var(--qds-control-standard-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-standard-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-standard-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-standalone-link {\n font: var(--qds-control-large-link);\n gap: var(--qds-control-large-gap-internal);\n padding-block: var(--qds-control-large-padding-auto-height);\n min-height: var(--qds-control-large-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-large-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-large-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { determineLinkIcon, pickFocusEventAttributes } from '../../helpers'\nimport type { Importance, LinkIcon, Size, Target } from '../shared'\n\n/**\n * `<qds-standalone-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-standalone-link>` *should* indicate the standalone link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-standalone-link>` element will activate it.\n *\n * @slot Content to display for the standalone link.\n * @see https://quartz.se.com/build/components/standalone-link\n */\n@Component({\n tag: 'qds-standalone-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'standalone-link.css',\n})\nexport class StandaloneLink implements ComponentInterface {\n /**\n * Prevents the standalone link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The standalone link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The standalone link's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Defines if the standalone link will display the visited state.\n */\n @Prop() public readonly visitable: boolean = false\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the standalone link points to. Standalone links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: URL | string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the standalone link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<Target, string>\n\n /**\n * Emitted when the standalone link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the standalone link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private linkIcon?: LinkIcon\n\n @State() private tabIndex?: number\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): Size | undefined {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #openInNewTab(): boolean {\n return this.target === '_blank'\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) event.stopImmediatePropagation()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n // FIXME: `undefined` instead of `0` causes `qdsFocus/qdsBlur` E2E tests\n // to fail, but it's not clear why this is the case since it works for\n // other components.\n this.tabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Watch('rel')\n @Watch('target')\n protected hrefTargetChanged(): void {\n this.linkIcon = determineLinkIcon(this.target, this.rel)\n this.#updateAriaLabelElements()\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'link'\n\n this.disabledChanged()\n this.hrefTargetChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.#updateAriaLabelElements()\n }\n\n public render() {\n return (\n <a\n aria-hidden=\"true\"\n class={{\n 'qds-standalone-link': true,\n 'qds-disabled': this.disabled,\n 'qds-visitable': this.visitable,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n download={this.download}\n href={this.href?.toString()}\n hrefLang={this.hreflang}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n tabIndex={this.disabled ? -1 : this.tabIndex}\n target={this.target}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n </span>\n )}\n <span class=\"qds-text\">\n <slot onSlotchange={this.#onSlotchange} />\n </span>\n {this.linkIcon && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n library=\"core\"\n data-size={this.#computedSize}\n name={this.linkIcon}\n />\n </span>\n )}\n {this.importance === 'emphasized' && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n class=\"qds-icon\"\n aria-hidden=\"true\"\n data-size={this.#computedSize}\n library=\"core\"\n name=\"next\"\n />\n </span>\n )}\n </a>\n )\n }\n\n readonly #updateAriaLabelElements = (): void => {\n this.internals.ariaLabel = `${this.host.textContent} ${\n this.#openInNewTab ? 'Opens in a new tab' : ''\n }`.trim()\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onSlotchange = (): void => {\n this.#updateAriaLabelElements()\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-standalone-link.js","mappings":";;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,81HAA81H;;ACAx3H;AACA;AACA;;;;;;;;;;;;;;;;;;MAyCa,cAAc,iBAAAA,kBAAA,CAAA,MAAA,cAAA,SAAAC,CAAA,CAAA;AAL3B,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAME;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AASjD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAEvD;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAAgB,UAAU;AAE5D;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAU,UAAU;AAEhD;;AAEG;AACqB,QAAA,IAAS,CAAA,SAAA,GAAY,KAAK;AAoMlD,QAAA,6BAAA,CAAA,GAAA,CAAA,IAAA,EAAiB,CAAC,CAAA;QAElB,oBAAyB,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AA+IhB,QAAA,uCAAA,CAAA,GAAA,CAAA,IAAA,EAA2B,MAAW;AAC7C,YAAA,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,CAAG,EAAA,IAAI,CAAC,IAAI,CAAC,WAAW,CAAA,CAAA,EACjD,sBAAA,CAAA,IAAI,EAAA,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,gCAAA,CAAc,EAC7B,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,MAAM,GACX,CACG,CACR,CACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAxIN,IAAA,QAAQ,IAAI,CAAC,UAAU;AACrB,QAAA,KAAK,SAAS;QACd,KAAK,YAAY,EAAE;YACjB,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,gCAAA,GAAA,SAAA,gCAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,UAAU;AACf,QAAA,KAAK,OAAO;QACZ,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,gCAAA,GAAA,SAAA,gCAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;AACjC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/standalone-link/standalone-link.css?tag=qds-standalone-link&encapsulation=shadow","src/components/standalone-link/standalone-link.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 display: inline-block;\n border-radius: var(--qds-focus-border-radius);\n}\n\n:host(:focus-visible) {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n}\n\n.qds-icon-crop {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.qds-icon {\n flex-shrink: 0;\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-standalone-link {\n box-sizing: border-box;\n display: inline-flex;\n justify-content: center;\n print-color-adjust: exact;\n text-decoration: none;\n width: 100%;\n\n &:hover,\n &:active {\n text-decoration: underline;\n }\n}\n\n.qds-text {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited.qds-visitable {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-link-standard-default);\n\n &:visited.qds-visitable {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited.qds-visitable {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover.qds-visitable {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active.qds-visitable {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-standalone-link {\n font: var(--qds-control-small-link);\n gap: var(--qds-control-small-gap-internal);\n padding-block: var(--qds-control-small-padding-auto-height);\n min-height: var(--qds-control-small-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-small-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-small-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-small-icon-size);\n width: var(--qds-control-small-icon-size);\n }\n}\n\n[data-size='standard'] {\n &.qds-standalone-link {\n font: var(--qds-control-standard-link);\n gap: var(--qds-control-standard-gap-internal);\n padding-block: var(--qds-control-standard-padding-auto-height);\n min-height: var(--qds-control-standard-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-standard-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-standard-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n }\n}\n\n[data-size='large'] {\n &.qds-standalone-link {\n font: var(--qds-control-large-link);\n gap: var(--qds-control-large-gap-internal);\n padding-block: var(--qds-control-large-padding-auto-height);\n min-height: var(--qds-control-large-height);\n }\n\n &[data-importance='subdued'] {\n font: var(--qds-control-large-text);\n }\n\n &.qds-icon-crop {\n height: var(--qds-control-large-icon-crop-height);\n }\n\n &.qds-icon {\n height: var(--qds-control-large-icon-size);\n width: var(--qds-control-large-icon-size);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n determineLinkIcon,\n invariant,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, LinkIcon, Size, Target } from '../shared'\n\n/**\n * `<qds-standalone-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-standalone-link>` *should* indicate the standalone link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-standalone-link>` element will activate it.\n *\n * @slot Content to display for the standalone link.\n * @see https://quartz.se.com/build/components/standalone-link\n */\n@Component({\n tag: 'qds-standalone-link',\n shadow: true,\n styleUrl: 'standalone-link.css',\n})\nexport class StandaloneLink implements ComponentInterface {\n /**\n * Prevents the standalone link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The standalone link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The standalone link's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Defines if the standalone link will display the visited state.\n */\n @Prop() public readonly visitable: boolean = false\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the standalone link points to. Standalone links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: URL | string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the standalone link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target?: LiteralUnion<Target, string>\n\n /**\n * Emitted when the standalone link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the standalone link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private linkIcon?: LinkIcon\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #savedTabIndex = 0\n\n #link?: HTMLAnchorElement\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedSize(): Size | undefined {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #openInNewTab(): boolean {\n return this.target === '_blank'\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n invariant(this.#link)\n if (this.disabled) event.stopImmediatePropagation()\n else this.#link.click()\n }\n\n @Listen('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n invariant(this.#link)\n if (this.disabled) return\n if (event.key === 'Enter') this.#link.click()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\n if (this.disabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n // FIXME: `undefined` instead of `0` causes `qdsFocus/qdsBlur` E2E tests\n // to fail, but it's not clear why this is the case since it works for\n // other components.\n this.#savedTabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n if (this.disabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('rel')\n @Watch('target')\n protected hrefTargetChanged(): void {\n this.linkIcon = determineLinkIcon(this.target, this.rel)\n this.#updateAriaLabelElements()\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'link'\n this.disabledChanged()\n this.hrefTargetChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.#updateAriaLabelElements()\n }\n\n public render() {\n return (\n <a\n aria-hidden=\"true\"\n class={{\n 'qds-standalone-link': true,\n 'qds-disabled': this.disabled,\n 'qds-visitable': this.visitable,\n }}\n data-importance={this.#computedImportance}\n data-size={this.#computedSize}\n download={this.download}\n href={this.href?.toString()}\n hrefLang={this.hreflang}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n tabIndex={-1}\n target={this.target}\n ref={this.#linkRef}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n </span>\n )}\n <span class=\"qds-text\">\n <slot onSlotchange={this.#onSlotchange} />\n </span>\n {this.linkIcon && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n library=\"core\"\n data-size={this.#computedSize}\n name={this.linkIcon}\n />\n </span>\n )}\n {this.importance === 'emphasized' && (\n <span class=\"qds-icon-crop\" data-size={this.#computedSize}>\n <qds-icon\n class=\"qds-icon\"\n aria-hidden=\"true\"\n data-size={this.#computedSize}\n library=\"core\"\n name=\"next\"\n />\n </span>\n )}\n </a>\n )\n }\n\n readonly #updateAriaLabelElements = (): void => {\n this.internals.ariaLabel = `${this.host.textContent} ${\n this.#openInNewTab ? 'Opens in a new tab' : ''\n }`.trim()\n }\n\n readonly #linkRef = (link?: HTMLAnchorElement): void => {\n this.#link = link\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onSlotchange = (): void => {\n this.#updateAriaLabelElements()\n }\n}\n"],"version":3}
|
package/components/qds-switch.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, c as createEvent, h } from './p-BEWDu8_P.js';
|
|
7
|
-
import { p as pickFocusEventAttributes } from './p-
|
|
7
|
+
import { p as pickFocusEventAttributes } from './p-Bs-thw7N.js';
|
|
8
8
|
import { V as VALID_STATE, C as CUSTOM_ERROR_FLAGS, N as NO_ERROR_FLAGS } from './p-DQLjJn7-.js';
|
|
9
|
-
import { d as defineCustomElement$2 } from './p-
|
|
9
|
+
import { d as defineCustomElement$2 } from './p-D6kEwmWw.js';
|
|
10
10
|
|
|
11
11
|
const switchCss = ":host([hidden]){display:none!important}:host{display:inline-block;outline:none}.qds-knob,.qds-track{-webkit-print-color-adjust:exact;print-color-adjust:exact}.qds-track{align-items:center;background-color:var(--qds-theme-control-toggle-track-default);box-sizing:border-box;display:flex;flex-shrink:0;padding-inline:var(--qds-control-toggle-track-padding)}.qds-track:hover{background-color:var(--qds-theme-control-toggle-track-hover)}.qds-track:active{background-color:var(--qds-theme-control-toggle-track-pressed)}.qds-knob{background-color:var(--qds-theme-control-input-background);box-sizing:border-box;margin:0}.qds-indicator{align-items:center;color:var(--qds-theme-control-input-background);display:flex;flex-grow:1;justify-content:center}.qds-container{box-sizing:border-box;cursor:pointer;display:flex}.qds-switch{clip-path:inset(50%);height:1px;margin:0;position:absolute;white-space:nowrap;width:1px}.qds-switch:checked~.qds-track{background-color:var(--qds-theme-signature-color-default);justify-content:flex-end}.qds-switch:checked~.qds-track:hover{background-color:var(--qds-theme-signature-color-hover)}.qds-switch:checked~.qds-track:active{background-color:var(--qds-theme-signature-color-pressed)}:host(:focus-visible) .qds-switch~.qds-track{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-container[data-size=small]{min-height:var(--qds-control-toggle-small-track-height)}.qds-inline[data-size=small]{margin-block:var(--qds-control-small-padding-auto-height);min-height:var(--qds-control-small-height)}.qds-track[data-size=small]{border-radius:var(--qds-control-toggle-small-track-border-radius);height:var(--qds-control-toggle-small-track-height);width:var(--qds-control-toggle-small-track-width)}.qds-knob[data-size=small]{border-radius:var(--qds-control-toggle-small-knob-border-radius);height:var(--qds-control-toggle-small-knob-height);width:var(--qds-control-toggle-small-knob-width)}.qds-indicator[data-size=small]{height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}.qds-container[data-size=standard]{min-height:var(--qds-control-toggle-standard-track-height)}.qds-inline[data-size=standard]{margin-block:var(--qds-control-standard-padding-auto-height);min-height:var(--qds-control-standard-height)}.qds-track[data-size=standard]{border-radius:var(--qds-control-toggle-standard-track-border-radius);height:var(--qds-control-toggle-standard-track-height);width:var(--qds-control-toggle-standard-track-width)}.qds-knob[data-size=standard]{border-radius:var(--qds-control-toggle-standard-knob-border-radius);height:var(--qds-control-toggle-standard-knob-height);width:var(--qds-control-toggle-standard-knob-width)}.qds-indicator[data-size=standard]{height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.qds-container[data-size=large]{min-height:var(--qds-control-toggle-large-track-height)}.qds-inline[data-size=large]{margin-block:var(--qds-control-large-padding-auto-height);min-height:var(--qds-control-large-height)}.qds-track[data-size=large]{border-radius:var(--qds-control-toggle-large-track-border-radius);height:var(--qds-control-toggle-large-track-height);width:var(--qds-control-toggle-large-track-width)}.qds-knob[data-size=large]{border-radius:var(--qds-control-toggle-large-knob-border-radius);height:var(--qds-control-toggle-large-knob-height);width:var(--qds-control-toggle-large-knob-width)}.qds-indicator[data-size=large]{height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}";
|
|
12
12
|
|
|
@@ -180,13 +180,13 @@ const Switch = /*@__PURE__*/ proxyCustomElement(class Switch extends H {
|
|
|
180
180
|
this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0');
|
|
181
181
|
}
|
|
182
182
|
render() {
|
|
183
|
-
return (h("div", { key: '
|
|
183
|
+
return (h("div", { key: 'b156b2f7e345943e167b1b09e70ac1b03269ca4a', class: {
|
|
184
184
|
'qds-container': true,
|
|
185
185
|
'qds-disabled': __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedDisabled_get),
|
|
186
186
|
'qds-inline': this.inline,
|
|
187
|
-
}, "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get), "aria-hidden": "true" }, h("input", { key: '
|
|
187
|
+
}, "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get), "aria-hidden": "true" }, h("input", { key: 'f75d1fe33287e75ab58685cee7aff596a9597bfa', "aria-hidden": "true",
|
|
188
188
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
189
|
-
autoFocus: this.host.autofocus, checked: this.checked, class: "qds-switch", disabled: this.disabled, type: "checkbox", value: this.value ?? undefined, tabIndex: -1 }), h("div", { key: '
|
|
189
|
+
autoFocus: this.host.autofocus, checked: this.checked, class: "qds-switch", disabled: this.disabled, type: "checkbox", value: this.value ?? undefined, tabIndex: -1 }), h("div", { key: 'a7bfc9741173779aabe30c699c8d9530f065ae4b', class: "qds-track", "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get) }, !this.noIndicator && __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedChecked_get) && (h("div", { key: '507bb4692846f245467b9aea7e318f83924dbf84', class: "qds-indicator", "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get) }, h("qds-icon", { key: '387dc8e7f98ed37a9c7325187b433d0bf5c2f72b', class: "qds-icon", name: "toggle-on", library: "core" }))), h("div", { key: '06ed50db97c69ff8f2442358ce0a6149311a86cf', class: "qds-knob", "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get) }), !this.noIndicator && !__classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedChecked_get) && (h("div", { key: 'bee181087663d6ba855043e3fd8bd216b2bef949', class: "qds-indicator", "data-size": __classPrivateFieldGet(this, _Switch_instances, "a", _Switch_computedSize_get) }, h("qds-icon", { key: 'b60cf09b8cedf8f609c88c9ee09410e8e806906e', class: "qds-icon", name: "toggle-off", library: "core" }))))));
|
|
190
190
|
}
|
|
191
191
|
static get formAssociated() { return true; }
|
|
192
192
|
get host() { return this; }
|