@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,8 +4,8 @@
|
|
|
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-
|
|
8
|
-
import { d as defineCustomElement$1 } from './p-
|
|
7
|
+
import { p as pickFocusEventAttributes } from './p-Bs-thw7N.js';
|
|
8
|
+
import { d as defineCustomElement$1 } from './p-D6kEwmWw.js';
|
|
9
9
|
|
|
10
10
|
const miniButtonCss = ":host{display:block}:host(:focus-visible){border-radius:var(--qds-focus-rounded-border-radius);outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-mini-button{align-items:center;background-color:initial;border:none;border-radius:var(--qds-control-rounded-border-radius);color:var(--qds-theme-control-text-standard);cursor:pointer;display:flex;justify-content:center;min-height:var(--qds-control-mini-button-standard-size);padding:0;width:var(--qds-control-mini-button-standard-size)}.qds-mini-button:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-mini-button:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-mini-button:focus-visible{outline:none}.qds-mini-button:disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-icon{align-content:center;font-size:var(--qds-control-standard-icon-size);line-height:normal}";
|
|
11
11
|
|
|
@@ -157,6 +157,6 @@ function defineCustomElement() {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
export { MiniButton as M, defineCustomElement as d };
|
|
160
|
-
//# sourceMappingURL=p-
|
|
160
|
+
//# sourceMappingURL=p-I5PkZmy8.js.map
|
|
161
161
|
|
|
162
|
-
//# sourceMappingURL=p-
|
|
162
|
+
//# sourceMappingURL=p-I5PkZmy8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-CSR3ZAEX.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,64BAA64B;;ACAn6B;AACA;AACA;;;;;;;;;;;;;;;;;;AAmBA,MAAM,cAAc,GAAG,CAAC,KAAiC,KAAU;IACjE,KAAK,CAAC,cAAc,EAAE;AACxB,CAAC;MAWY,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAAC,CAAA,CAAA;AANvB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAuBE;;AAEG;AACqB,QAAA,IAAO,CAAA,OAAA,GAAW,SAAS;AA4BnD;;;;AAIG;AACqB,QAAA,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G,GAAG,IAAI,CAAC,GAAG,GAAG,SAAS,EACvC,QAAQ,EAAE,sBAAA,CAAA,IAAI,EAAkB,qBAAA,EAAA,GAAA,EAAA,gCAAA,CAAA,EAAA,aAAA,EACpB,MAAM,EAClB,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,EAAE,EAAA,EAEZ,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAI,CAAA,CACjE;;;;;;;;;;;;;;;;;;;;;;;;;;IAxFR,QACE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;AAC9B,SAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC;AAErD,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/mini-button/mini-button.css?tag=qds-mini-button&encapsulation=shadow","src/components/mini-button/mini-button.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\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-rounded-border-radius);\n}\n\n.qds-mini-button {\n display: flex;\n width: var(--qds-control-mini-button-standard-size);\n min-height: var(--qds-control-mini-button-standard-size);\n align-items: center;\n border-radius: var(--qds-control-rounded-border-radius);\n border: none;\n justify-content: center;\n color: var(--qds-theme-control-text-standard);\n background-color: transparent;\n padding: 0;\n cursor: pointer;\n\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 &:focus-visible {\n outline: none;\n }\n}\n\n.qds-mini-button:disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n align-content: center;\n line-height: normal;\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 Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { pickFocusEventAttributes } from '../../helpers'\nimport type { ButtonTarget } from '../button/button'\n\nconst preventDefault = (event: KeyboardEvent | MouseEvent): void => {\n event.preventDefault()\n}\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-mini-button',\n formAssociated: true,\n styleUrl: 'mini-button.css',\n shadow: true,\n})\nexport class MiniButton implements ComponentInterface {\n /**\n * Prevents the mini button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled?: boolean\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 name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\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<ButtonTarget, string>\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * When href is define and the button act as a link (`<a>`), the `rel` will be added to the element.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string = 'noopener'\n\n /**\n * The mini button's accessible name.\n */\n @Prop() public readonly text!: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button 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 @AttachInternals() private readonly internals!: ElementInternals\n\n #savedTabIndex = 0\n\n get #computedDisabled(): boolean {\n return (\n this.host.matches(':disabled') ||\n (this.host.hasAttribute('disabled') &&\n this.host.getAttribute('disabled') !== 'false')\n )\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.#computedDisabled.toString()\n if (this.#computedDisabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('href')\n protected hrefChanged(): void {\n this.internals.role = this.href === undefined ? 'button' : 'link'\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string | null): void {\n if (newValue !== null) {\n const parsedValue = Number.parseInt(newValue, 10)\n this.#savedTabIndex =\n Number.isNaN(parsedValue) || !Number.isFinite(parsedValue)\n ? 0\n : parsedValue\n }\n if (this.#computedDisabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('text')\n protected textChanged(): void {\n this.internals.ariaLabel = this.text\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n }\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('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter') this.host.click()\n }\n\n @Listen('keyup')\n protected onKeyup(event: KeyboardEvent): void {\n if (event.key === ' ') this.host.click()\n }\n\n public componentWillLoad(): void {\n this.hrefChanged()\n this.textChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n this.disabledChanged()\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n\n return (\n <Tag\n type={Tag === 'a' ? undefined : 'button'}\n class=\"qds-mini-button\"\n href={Tag === 'a' ? this.href : undefined}\n rel={Tag === 'a' ? this.rel : undefined}\n disabled={this.#computedDisabled}\n aria-hidden=\"true\"\n onKeyDown={preventDefault}\n onKeyUp={preventDefault}\n onKeyPress={preventDefault}\n tabIndex={-1}\n >\n <qds-icon class=\"qds-icon\" library={this.library} name={this.name} />\n </Tag>\n )\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-I5PkZmy8.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,64BAA64B;;ACAn6B;AACA;AACA;;;;;;;;;;;;;;;;;;AAmBA,MAAM,cAAc,GAAG,CAAC,KAAiC,KAAU;IACjE,KAAK,CAAC,cAAc,EAAE;AACxB,CAAC;MAWY,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAAC,CAAA,CAAA;AANvB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAuBE;;AAEG;AACqB,QAAA,IAAO,CAAA,OAAA,GAAW,SAAS;AA4BnD;;;;AAIG;AACqB,QAAA,IAAG,CAAA,GAAA,GAAY,UAAU;AAuBjD,QAAA,yBAAA,CAAA,GAAA,CAAA,IAAA,EAAiB,CAAC,CAAA;AA8FnB;IAnFW,eAAe,GAAA;AACvB,QAAA,IAAI,CAAC,SAAS,CAAC,YAAY,GAAG,sBAAA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OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,EAAE,EAAA,EAEZ,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,KAAK,EAAC,UAAU,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAI,CAAA,CACjE;;;;;;;;;;;;;;;;;;;;;;;;;;IAxFR,QACE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;AAC9B,SAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC;AAErD,CAAC;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/mini-button/mini-button.css?tag=qds-mini-button&encapsulation=shadow","src/components/mini-button/mini-button.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2025 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\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-rounded-border-radius);\n}\n\n.qds-mini-button {\n display: flex;\n width: var(--qds-control-mini-button-standard-size);\n min-height: var(--qds-control-mini-button-standard-size);\n align-items: center;\n border-radius: var(--qds-control-rounded-border-radius);\n border: none;\n justify-content: center;\n color: var(--qds-theme-control-text-standard);\n background-color: transparent;\n padding: 0;\n cursor: pointer;\n\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 &:focus-visible {\n outline: none;\n }\n}\n\n.qds-mini-button:disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n align-content: center;\n line-height: normal;\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 Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport { pickFocusEventAttributes } from '../../helpers'\nimport type { ButtonTarget } from '../button/button'\n\nconst preventDefault = (event: KeyboardEvent | MouseEvent): void => {\n event.preventDefault()\n}\n\n/**\n * @experimental\n */\n@Component({\n tag: 'qds-mini-button',\n formAssociated: true,\n styleUrl: 'mini-button.css',\n shadow: true,\n})\nexport class MiniButton implements ComponentInterface {\n /**\n * Prevents the mini button from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop()\n public readonly disabled?: boolean\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 name!: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly library: string = 'default'\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<ButtonTarget, string>\n\n /**\n * When set, the underlying button will be rendered as an `<a>` with this\n * `href` instead of a `<button>`.\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * When href is define and the button act as a link (`<a>`), the `rel` will be added to the element.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string = 'noopener'\n\n /**\n * The mini button's accessible name.\n */\n @Prop() public readonly text!: string\n\n /**\n * Emitted when the button loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the button 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 @AttachInternals() private readonly internals!: ElementInternals\n\n #savedTabIndex = 0\n\n get #computedDisabled(): boolean {\n return (\n this.host.matches(':disabled') ||\n (this.host.hasAttribute('disabled') &&\n this.host.getAttribute('disabled') !== 'false')\n )\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.#computedDisabled.toString()\n if (this.#computedDisabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('href')\n protected hrefChanged(): void {\n this.internals.role = this.href === undefined ? 'button' : 'link'\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string | null): void {\n if (newValue !== null) {\n const parsedValue = Number.parseInt(newValue, 10)\n this.#savedTabIndex =\n Number.isNaN(parsedValue) || !Number.isFinite(parsedValue)\n ? 0\n : parsedValue\n }\n if (this.#computedDisabled) this.host.removeAttribute('tabindex')\n else this.host.tabIndex = this.#savedTabIndex\n }\n\n @Watch('text')\n protected textChanged(): void {\n this.internals.ariaLabel = this.text\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n }\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('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter') this.host.click()\n }\n\n @Listen('keyup')\n protected onKeyup(event: KeyboardEvent): void {\n if (event.key === ' ') this.host.click()\n }\n\n public componentWillLoad(): void {\n this.hrefChanged()\n this.textChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n this.disabledChanged()\n }\n\n public render() {\n const Tag = this.href === undefined ? 'button' : 'a'\n\n return (\n <Tag\n type={Tag === 'a' ? undefined : 'button'}\n class=\"qds-mini-button\"\n href={Tag === 'a' ? this.href : undefined}\n rel={Tag === 'a' ? this.rel : undefined}\n disabled={this.#computedDisabled}\n aria-hidden=\"true\"\n onKeyDown={preventDefault}\n onKeyUp={preventDefault}\n onKeyPress={preventDefault}\n tabIndex={-1}\n >\n <qds-icon class=\"qds-icon\" library={this.library} name={this.name} />\n </Tag>\n )\n }\n}\n"],"version":3}
|
|
@@ -4,9 +4,9 @@
|
|
|
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$3 } from './p-
|
|
9
|
-
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$3 } from './p-D6kEwmWw.js';
|
|
9
|
+
import { d as defineCustomElement$2 } from './p--vOFwWP9.js';
|
|
10
10
|
|
|
11
11
|
const actionItemCss = ":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-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-icon{flex-shrink:0}.qds-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-action-item{align-items:center;border:none;border-radius:var(--qds-control-border-radius);box-sizing:border-box;cursor:pointer;display:flex}.qds-action-item:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-action-item:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-action-item[data-size=small]{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] .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)}.qds-action-item[data-size=standard]{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] .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)}.qds-action-item[data-size=large]{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] .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)}[data-importance=standard] .qds-text{color:var(--qds-theme-text-standard)}[data-importance=standard] .qds-icon{color:var(--qds-theme-control-text-standard)}.qds-action-item[data-importance=emphasized] .qds-icon,.qds-action-item[data-importance=emphasized] .qds-text{color:var(--qds-theme-signature-color-default)}.qds-action-item[data-importance=emphasized]:hover .qds-icon,.qds-action-item[data-importance=emphasized]:hover .qds-text{color:var(--qds-theme-signature-color-hover)}.qds-action-item[data-importance=emphasized]:active .qds-icon,.qds-action-item[data-importance=emphasized]:active .qds-text{color:var(--qds-theme-signature-color-pressed)}.qds-action-item[data-importance=subdued] .qds-icon,.qds-action-item[data-importance=subdued] .qds-text{color:var(--qds-theme-link-standard-default)}.qds-action-item[data-importance=subdued]:hover .qds-icon,.qds-action-item[data-importance=subdued]:hover .qds-text{color:var(--qds-theme-link-standard-hover)}.qds-action-item[data-importance=subdued]:active .qds-icon,.qds-action-item[data-importance=subdued]:active .qds-text{color:var(--qds-theme-link-standard-pressed)}.qds-action-item[data-importance=destructive] .qds-icon,.qds-action-item[data-importance=destructive] .qds-text{color:var(--qds-theme-feedback-action-destructive-default)}.qds-action-item[data-importance=destructive]:hover .qds-icon,.qds-action-item[data-importance=destructive]:hover .qds-text{color:var(--qds-theme-feedback-action-destructive-hover)}.qds-action-item[data-importance=destructive]:active .qds-icon,.qds-action-item[data-importance=destructive]:active .qds-text{color:var(--qds-theme-feedback-action-destructive-pressed)}";
|
|
12
12
|
|
|
@@ -95,18 +95,18 @@ const ActionItem = /*@__PURE__*/ proxyCustomElement(class ActionItem extends H {
|
|
|
95
95
|
invariant(__classPrivateFieldGet(this, _ActionItem_span, "f"));
|
|
96
96
|
const span = __classPrivateFieldGet(this, _ActionItem_span, "f");
|
|
97
97
|
readTask(() => {
|
|
98
|
-
this.tooltip =
|
|
98
|
+
this.tooltip = isEllipsisActive(span);
|
|
99
99
|
});
|
|
100
100
|
__classPrivateFieldSet(this, _ActionItem_ro, new ResizeObserver(([spanEntry]) => {
|
|
101
|
-
this.tooltip =
|
|
101
|
+
this.tooltip = isEllipsisActive(spanEntry.target);
|
|
102
102
|
}), "f");
|
|
103
103
|
__classPrivateFieldGet(this, _ActionItem_ro, "f").observe(__classPrivateFieldGet(this, _ActionItem_span, "f"));
|
|
104
104
|
}
|
|
105
105
|
render() {
|
|
106
|
-
return (h("div", { key: '
|
|
106
|
+
return (h("div", { key: 'c5761b24a5de2f0784850e2c05a35a4ff0d50540', class: {
|
|
107
107
|
'qds-action-item': true,
|
|
108
108
|
'qds-disabled': this.disabled,
|
|
109
|
-
}, ref: __classPrivateFieldGet(this, _ActionItem_actionDivRef, "f"), "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), "data-importance": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedImportance_get) }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '
|
|
109
|
+
}, ref: __classPrivateFieldGet(this, _ActionItem_actionDivRef, "f"), "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), "data-importance": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedImportance_get) }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: 'f9c3a23ffeace5cbe558b15a50da5fdc95c58806', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), library: this.iconLibrary, name: this.iconName })), h("span", { key: '3100774715c9057232a91ff5103016c5dea61922', class: "qds-text", "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), ref: __classPrivateFieldGet(this, _ActionItem_spanRef, "f") }, this.text), this.action !== undefined && (h("qds-icon", { key: '128edb074db17bd31c1467a1857f9c9473cda8ff', class: "qds-icon", "data-size": __classPrivateFieldGet(this, _ActionItem_instances, "a", _ActionItem_computedSize_get), name: this.action, library: "core", "aria-label": this.actionDescription, role: "img" })), this.tooltip && (h("qds-tooltip", { key: 'a28ef16e7941795bcf9241a367130e8b2f63b7d5', "aria-hidden": "true", ref: __classPrivateFieldGet(this, _ActionItem_tooltipRef, "f") }, this.text))));
|
|
110
110
|
}
|
|
111
111
|
static get watchers() { return {
|
|
112
112
|
"disabled": ["disabledChanged"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-action-item.js","mappings":";;;;;;;;;;AAAA,MAAM,aAAa,GAAG,s8GAAs8G;;ACA59G;AACA;AACA;;;;;;;;;;;;;;;;;;MAmCa,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAAC,CAAA,CAAA;AALvB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAME;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAA0B,UAAU;AAEtE;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AASjD;;AAEG;AACqB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,SAAS;QACd,KAAK,aAAa,EAAE;YAClB,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,gCAAA,GAAA,SAAA,gCAAA,GAAA;IAGC,OAAO,IAAI,CAAC,QAAQ;AACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/action-item/action-item.css?tag=qds-action-item&encapsulation=shadow","src/components/action-item/action-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-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-action-item {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n border: none;\n cursor: pointer;\n border-radius: var(--qds-control-border-radius);\n\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[data-size='small'] {\n &.qds-action-item {\n gap: var(--qds-list-item-small-gap-internal);\n min-height: var(--qds-list-item-small-height);\n padding-inline: var(--qds-list-item-small-padding-horizontal);\n }\n\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-action-item {\n gap: var(--qds-list-item-standard-gap-internal);\n min-height: var(--qds-list-item-standard-height);\n padding-inline: var(--qds-list-item-standard-padding-horizontal);\n }\n\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-action-item {\n gap: var(--qds-list-item-large-gap-internal);\n min-height: var(--qds-list-item-large-height);\n padding-inline: var(--qds-list-item-large-padding-horizontal);\n }\n\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[data-importance='standard'] {\n .qds-text {\n color: var(--qds-theme-text-standard);\n }\n\n .qds-icon {\n color: var(--qds-theme-control-text-standard);\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-pressed);\n }\n }\n }\n}\n\n[data-importance='subdued'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-pressed);\n }\n }\n }\n}\n\n[data-importance='destructive'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\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 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 { Importance, Size } from '../shared'\n\nexport type ActionItemImportance = Importance | 'destructive'\n\n/**\n *\n *\n * @see https://quartz.se.com/build/components/action-item\n */\n@Component({\n tag: 'qds-action-item',\n shadow: true,\n styleUrl: 'action-item.css',\n})\nexport class ActionItem implements ComponentInterface {\n /**\n * The action item's importance.\n */\n @Prop() public readonly importance?: ActionItemImportance = 'standard'\n\n /**\n * Prevents the action 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 name of the action icon to render.\n *\n * Available names exist on the core icon library.\n */\n @Prop() public readonly action?: string\n\n /**\n * The action icon's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly actionDescription?: string\n\n /**\n * The action items's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The action item's text.\n */\n @Prop() public readonly text!: string\n\n @State() private tooltip = false\n\n /**\n * Emitted when the action item loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the action item gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #ro?: ResizeObserver\n\n #actionItem?: 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 #computedImportance(): ActionItemImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'subdued':\n case 'destructive': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedDisabled(): boolean {\n return this.disabled\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\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) event.stopImmediatePropagation()\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'menuitem'\n this.disabledChanged()\n }\n\n public componentDidLoad(): void {\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 render() {\n return (\n <div\n class={{\n 'qds-action-item': true,\n 'qds-disabled': this.disabled,\n }}\n ref={this.#actionDivRef}\n data-size={this.#computedSize}\n data-importance={this.#computedImportance}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\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 )}\n <span\n class=\"qds-text\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n\n {this.action !== undefined && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n name={this.action}\n library=\"core\"\n aria-label={this.actionDescription}\n role=\"img\"\n />\n )}\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </div>\n )\n }\n\n readonly #actionDivRef = (actionItem?: HTMLDivElement): void => {\n this.#actionItem = actionItem\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.#actionItem\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-action-item.js","mappings":";;;;;;;;;;AAAA,MAAM,aAAa,GAAG,s8GAAs8G;;ACA59G;AACA;AACA;;;;;;;;;;;;;;;;;;MAmCa,UAAU,iBAAAA,kBAAA,CAAA,MAAA,UAAA,SAAAC,CAAA,CAAA;AALvB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;AAME;;AAEG;AACqB,QAAA,IAAU,CAAA,UAAA,GAA0B,UAAU;AAEtE;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AASjD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAevD;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAU,UAAU;AAO/B,QAAA,IAAO,CAAA,OAAA,GAAG,KAAK;QAgBhC,cAAoB,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAEpB,sBAA4B,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAE5B,gBAAuB,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAqHd,wBAAgB,CAAA,GAAA,CAAA,IAAA,EAAA,CAAC,UAA2B,KAAU;YAC7D,sBAAA,CAAA,IAAI,EAAA,sBAAA,EAAe,UAAU,EAAA,GAAA,CAAA;AAC/B,SAAC,CAAA;QAEQ,mBAAW,CAAA,GAAA,CAAA,IAAA,EAAA,CAAC,IAAsB,KAAU;YACnD,sBAAA,CAAA,IAAI,EAAA,gBAAA,EAAS,IAAI,EAAA,GAAA,CAAA;AACnB,SAAC,CAAA;QAEQ,sBAAc,CAAA,GAAA,CAAA,IAAA,EAAA,CAAC,OAA+B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EAAC,MAAM,EAAA,YAAA,EACF,IAAI,CAAC,iBAAiB,EAClC,IAAI,EAAC,KAAK,GACV,CACH,EACA,IAAI,CAAC,OAAO,KACX,mFAAyB,MAAM,EAAC,GAAG,EAAE,sBAAA,CAAA,IAAI,EAAY,sBAAA,EAAA,GAAA,CAAA,EAAA,EAClD,IAAI,CAAC,IAAI,CACE,CACf,CACG;;;;;;;;;;;;;;;;;;;;AA9GR,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,kCAAA,GAAA,SAAA,kCAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,UAAU;AACrB,QAAA,KAAK,YAAY;AACjB,QAAA,KAAK,SAAS;QACd,KAAK,aAAa,EAAE;YAClB,OAAO,IAAI,CAAC,UAAU;;QAExB,SAAS;AACP,YAAA,OAAO,UAAU;;;AAGvB,CAAC,EAAA,gCAAA,GAAA,SAAA,gCAAA,GAAA;IAGC,OAAO,IAAI,CAAC,QAAQ;AACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/action-item/action-item.css?tag=qds-action-item&encapsulation=shadow","src/components/action-item/action-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-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-action-item {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n border: none;\n cursor: pointer;\n border-radius: var(--qds-control-border-radius);\n\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[data-size='small'] {\n &.qds-action-item {\n gap: var(--qds-list-item-small-gap-internal);\n min-height: var(--qds-list-item-small-height);\n padding-inline: var(--qds-list-item-small-padding-horizontal);\n }\n\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-action-item {\n gap: var(--qds-list-item-standard-gap-internal);\n min-height: var(--qds-list-item-standard-height);\n padding-inline: var(--qds-list-item-standard-padding-horizontal);\n }\n\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-action-item {\n gap: var(--qds-list-item-large-gap-internal);\n min-height: var(--qds-list-item-large-height);\n padding-inline: var(--qds-list-item-large-padding-horizontal);\n }\n\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[data-importance='standard'] {\n .qds-text {\n color: var(--qds-theme-text-standard);\n }\n\n .qds-icon {\n color: var(--qds-theme-control-text-standard);\n }\n}\n\n[data-importance='emphasized'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-signature-color-pressed);\n }\n }\n }\n}\n\n[data-importance='subdued'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-link-standard-pressed);\n }\n }\n }\n}\n\n[data-importance='destructive'] {\n &.qds-action-item {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-default);\n }\n\n &:hover {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-hover);\n }\n }\n\n &:active {\n .qds-text,\n .qds-icon {\n color: var(--qds-theme-feedback-action-destructive-pressed);\n }\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 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 { Importance, Size } from '../shared'\n\nexport type ActionItemImportance = Importance | 'destructive'\n\n/**\n *\n *\n * @see https://quartz.se.com/build/components/action-item\n */\n@Component({\n tag: 'qds-action-item',\n shadow: true,\n styleUrl: 'action-item.css',\n})\nexport class ActionItem implements ComponentInterface {\n /**\n * The action item's importance.\n */\n @Prop() public readonly importance?: ActionItemImportance = 'standard'\n\n /**\n * Prevents the action 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 name of the action icon to render.\n *\n * Available names exist on the core icon library.\n */\n @Prop() public readonly action?: string\n\n /**\n * The action icon's accessible text that will be used by\n * screen readers.\n */\n @Prop() public readonly actionDescription?: string\n\n /**\n * The action items's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The action item's text.\n */\n @Prop() public readonly text!: string\n\n @State() private tooltip = false\n\n /**\n * Emitted when the action item loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the action item gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #ro?: ResizeObserver\n\n #actionItem?: 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 #computedImportance(): ActionItemImportance {\n switch (this.importance) {\n case 'emphasized':\n case 'subdued':\n case 'destructive': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedDisabled(): boolean {\n return this.disabled\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\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) event.stopImmediatePropagation()\n }\n\n public componentWillLoad(): void {\n this.internals.role = 'menuitem'\n this.disabledChanged()\n }\n\n public componentDidLoad(): void {\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 render() {\n return (\n <div\n class={{\n 'qds-action-item': true,\n 'qds-disabled': this.disabled,\n }}\n ref={this.#actionDivRef}\n data-size={this.#computedSize}\n data-importance={this.#computedImportance}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\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 )}\n <span\n class=\"qds-text\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n\n {this.action !== undefined && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.#computedSize}\n name={this.action}\n library=\"core\"\n aria-label={this.actionDescription}\n role=\"img\"\n />\n )}\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </div>\n )\n }\n\n readonly #actionDivRef = (actionItem?: HTMLDivElement): void => {\n this.#actionItem = actionItem\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.#actionItem\n }\n}\n"],"version":3}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../dist/types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface QdsAvatarMedia extends Components.QdsAvatarMedia, HTMLElement {}
|
|
4
|
+
export const QdsAvatarMedia: {
|
|
5
|
+
prototype: QdsAvatarMedia;
|
|
6
|
+
new (): QdsAvatarMedia;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: © 2025 Schneider Electric
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { A as AvatarMedia, d as defineCustomElement$1 } from './p-DabDNFFa.js';
|
|
7
|
+
|
|
8
|
+
const QdsAvatarMedia = AvatarMedia;
|
|
9
|
+
const defineCustomElement = defineCustomElement$1;
|
|
10
|
+
|
|
11
|
+
export { QdsAvatarMedia, defineCustomElement };
|
|
12
|
+
//# sourceMappingURL=qds-avatar-media.js.map
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=qds-avatar-media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"qds-avatar-media.js","mappings":";;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { p as proxyCustomElement, H, d as readTask, h, F as Fragment } from './p-BEWDu8_P.js';
|
|
7
|
-
import { a as
|
|
8
|
-
import { d as defineCustomElement$3 } from './p-
|
|
9
|
-
import { d as defineCustomElement$2 } from './p
|
|
7
|
+
import { a as isEllipsisActive } from './p-Bs-thw7N.js';
|
|
8
|
+
import { d as defineCustomElement$3 } from './p-D6kEwmWw.js';
|
|
9
|
+
import { d as defineCustomElement$2 } from './p--vOFwWP9.js';
|
|
10
10
|
|
|
11
11
|
const breadcrumbItemCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-anchor{-webkit-text-decoration:none;text-decoration:none}.qds-anchor:hover{-webkit-text-decoration:underline;text-decoration:underline}.qds-breadcrumb-item{align-items:center;display:inline-flex;font:var(--qds-control-standard-text);gap:var(--qds-control-standard-gap-siblings-related);min-height:var(--qds-control-standard-height);width:inherit}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-icon{flex-shrink:0;height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.qds-divider{margin-inline:auto}.qds-overflow{line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-anchor,.qds-breadcrumb-item{color:var(--qds-theme-control-text-standard)}.qds-anchor:focus-visible,.qds-breadcrumb-item:focus-visible{border-radius:var(--qds-focus-border-radius);outline:var(--qds-focus-border-width) solid var(--qds-theme-focus-border);outline-offset:var(--qds-focus-border-offset)}";
|
|
12
12
|
|
|
@@ -78,10 +78,10 @@ const QdsBreadcrumbItem$1 = /*@__PURE__*/ proxyCustomElement(class QdsBreadcrumb
|
|
|
78
78
|
return;
|
|
79
79
|
const span = __classPrivateFieldGet(this, _QdsBreadcrumbItem_span, "f");
|
|
80
80
|
readTask(() => {
|
|
81
|
-
this.tooltip =
|
|
81
|
+
this.tooltip = isEllipsisActive(span);
|
|
82
82
|
});
|
|
83
83
|
__classPrivateFieldSet(this, _QdsBreadcrumbItem_ro, new ResizeObserver(([spanEntry]) => {
|
|
84
|
-
this.tooltip =
|
|
84
|
+
this.tooltip = isEllipsisActive(spanEntry.target);
|
|
85
85
|
}), "f");
|
|
86
86
|
__classPrivateFieldGet(this, _QdsBreadcrumbItem_ro, "f").observe(__classPrivateFieldGet(this, _QdsBreadcrumbItem_span, "f"));
|
|
87
87
|
}
|
|
@@ -97,10 +97,10 @@ const QdsBreadcrumbItem$1 = /*@__PURE__*/ proxyCustomElement(class QdsBreadcrumb
|
|
|
97
97
|
__classPrivateFieldGet(this, _QdsBreadcrumbItem_ro, "f").disconnect();
|
|
98
98
|
}
|
|
99
99
|
render() {
|
|
100
|
-
return (h("div", { key: '
|
|
100
|
+
return (h("div", { key: '5ab2c38cc31d65f9986040d347e17f2fa74faeb3', class: {
|
|
101
101
|
'qds-breadcrumb-item': true,
|
|
102
102
|
'qds-disabled': __classPrivateFieldGet(this, _QdsBreadcrumbItem_instances, "a", _QdsBreadcrumbItem_computedDisabled_get),
|
|
103
|
-
}, ref: this.href === undefined ? __classPrivateFieldGet(this, _QdsBreadcrumbItem_breadcrumbItemRef, "f") : undefined, tabIndex: this.tooltip && this.href === undefined ? 0 : undefined }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '
|
|
103
|
+
}, ref: this.href === undefined ? __classPrivateFieldGet(this, _QdsBreadcrumbItem_breadcrumbItemRef, "f") : undefined, tabIndex: this.tooltip && this.href === undefined ? 0 : undefined }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '37b1612d8ae4d1e790efdbfd06092fcdc70e39ee', "aria-hidden": "true", class: "qds-icon", library: this.iconLibrary, name: this.iconName })), this.href === undefined ? __classPrivateFieldGet(this, _QdsBreadcrumbItem_instances, "m", _QdsBreadcrumbItem_renderText).call(this) : __classPrivateFieldGet(this, _QdsBreadcrumbItem_instances, "m", _QdsBreadcrumbItem_renderAnchor).call(this), this.tooltip && (h("qds-tooltip", { key: 'e9de18197347f2e5fe5a56a85ca62546bd08ea9a', "aria-hidden": "true", ref: __classPrivateFieldGet(this, _QdsBreadcrumbItem_tooltipRef, "f") }, this.text))));
|
|
104
104
|
}
|
|
105
105
|
static get delegatesFocus() { return true; }
|
|
106
106
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-breadcrumb-item.js","mappings":";;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,mgCAAmgC;;ACA7hC;AACA;AACA;;;;;;;;;;;;;;;;;;MAkCaA,mBAAiB,iBAAAC,kBAAA,CAAA,MAAA,iBAAA,SAAAC,CAAA,CAAA;AAL9B,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;AAWE;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AASjD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AA8ItC,QAAA,IAAO,CAAA,OAAA,GAAG,KAAK;QAIhC,iCAAoD,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAEpD,qBAAoB,CAAA,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;QAEpB,uBAAuB,CAAA,GAAA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BAAA,CAAA,IAAI,kCAAS,EAC1C,EAAA,IAAI,CAAC,IAAI,CACL;AAEX,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["QdsBreadcrumbItem","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/breadcrumb-item/breadcrumb-item.css?tag=qds-breadcrumb-item&encapsulation=shadow","src/components/breadcrumb-item/breadcrumb-item.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-anchor {\n text-decoration: none;\n\n &:hover {\n text-decoration: underline;\n }\n}\n\n.qds-breadcrumb-item {\n align-items: center;\n display: inline-flex;\n font: var(--qds-control-standard-text);\n gap: var(--qds-control-standard-gap-siblings-related);\n min-height: var(--qds-control-standard-height);\n width: inherit;\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-icon {\n flex-shrink: 0;\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n}\n\n.qds-divider {\n margin-inline: auto;\n}\n\n.qds-overflow {\n line-height: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-anchor,\n.qds-breadcrumb-item {\n color: var(--qds-theme-control-text-standard);\n\n &:focus-visible {\n outline: var(--qds-focus-border-width) solid var(--qds-theme-focus-border);\n outline-offset: var(--qds-focus-border-offset);\n border-radius: var(--qds-focus-border-radius);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, JSX } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Fragment,\n h,\n Listen,\n Prop,\n readTask,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport { isOverflowing } from '../../helpers'\n\nexport type BreadcrumbTarget = '_blank' | '_parent' | '_self' | '_top'\n\n/**\n * The `<qds-breadcrumb-item>` element is used as a navigational aid that is\n * typically placed between a site's header and the main content, displaying\n * either a hierarchy of the current page in relation to the site's structure,\n * from top level to current page, or a list of the links the user followed to\n * get to the current page, in the order visited.\n *\n * @see https://quartz.se.com/build/components/breadcrumb\n */\n@Component({\n tag: 'qds-breadcrumb-item',\n styleUrl: 'breadcrumb-item.css',\n shadow: { delegatesFocus: true },\n})\nexport class QdsBreadcrumbItem implements ComponentInterface {\n /**\n * The breadcrumb item's text.\n */\n @Prop() public readonly text!: string\n\n /**\n * Prevents the breadcrumb item 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 URL that the inline link points to. Inline 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 * - 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?: 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 inline 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<BreadcrumbTarget, string>\n\n @State() private tooltip = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #breadcrumbItem?: HTMLAnchorElement | HTMLDivElement\n\n #ro?: ResizeObserver\n\n #span?: HTMLSpanElement\n\n get #computedDisabled(): boolean {\n return this.disabled\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\n }\n\n @Watch('text')\n protected textChanged(): void {\n if (this.#ro) this.#ro.disconnect()\n\n if (!this.#span) return\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.internals.role = 'listitem'\n this.disabledChanged()\n }\n\n public componentDidLoad(): void {\n this.textChanged()\n }\n\n public disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n return (\n <div\n class={{\n 'qds-breadcrumb-item': true,\n 'qds-disabled': this.#computedDisabled,\n }}\n ref={this.href === undefined ? this.#breadcrumbItemRef : undefined}\n tabIndex={this.tooltip && this.href === undefined ? 0 : undefined}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n {this.href === undefined ? this.#renderText() : this.#renderAnchor()}\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </div>\n )\n }\n\n #renderAnchor(): JSX.Element {\n return (\n <>\n <span class=\"qds-overflow\" ref={this.#spanRef}>\n <a\n class=\"qds-anchor\"\n href={this.href}\n hrefLang={this.hreflang}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n ref={this.href === undefined ? undefined : this.#breadcrumbItemRef}\n target={this.target}\n >\n {this.text}\n </a>\n </span>\n <span aria-hidden=\"true\" class=\"qds-divider\">\n /\n </span>\n </>\n )\n }\n\n #renderText(): JSX.Element {\n return (\n <span class=\"qds-overflow\" ref={this.#spanRef}>\n {this.text}\n </span>\n )\n }\n\n readonly #breadcrumbItemRef = (\n breadcrumbItem?: HTMLAnchorElement | HTMLDivElement,\n ): void => {\n this.#breadcrumbItem = breadcrumbItem\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.#breadcrumbItem\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-breadcrumb-item.js","mappings":";;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,mgCAAmgC;;ACA7hC;AACA;AACA;;;;;;;;;;;;;;;;;;MAkCaA,mBAAiB,iBAAAC,kBAAA,CAAA,MAAA,iBAAA,SAAAC,CAAA,CAAA;AAL9B,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;AAWE;;;AAGG;AACqB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AASjD;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AA8ItC,QAAA,IAA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AAK,EAAC,aAAa,EAErC,EAAA,GAAA,CAAA,CACN;AAEP,CAAC,EAAA,6BAAA,GAAA,SAAA,6BAAA,GAAA;IAGC,QACE,CAAM,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,cAAc,EAAC,GAAG,EAAE,sBAAA,CAAA,IAAI,kCAAS,EAC1C,EAAA,IAAI,CAAC,IAAI,CACL;AAEX,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["QdsBreadcrumbItem","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/breadcrumb-item/breadcrumb-item.css?tag=qds-breadcrumb-item&encapsulation=shadow","src/components/breadcrumb-item/breadcrumb-item.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-anchor {\n text-decoration: none;\n\n &:hover {\n text-decoration: underline;\n }\n}\n\n.qds-breadcrumb-item {\n align-items: center;\n display: inline-flex;\n font: var(--qds-control-standard-text);\n gap: var(--qds-control-standard-gap-siblings-related);\n min-height: var(--qds-control-standard-height);\n width: inherit;\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-icon {\n flex-shrink: 0;\n height: var(--qds-control-standard-icon-size);\n width: var(--qds-control-standard-icon-size);\n}\n\n.qds-divider {\n margin-inline: auto;\n}\n\n.qds-overflow {\n line-height: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-anchor,\n.qds-breadcrumb-item {\n color: var(--qds-theme-control-text-standard);\n\n &:focus-visible {\n outline: var(--qds-focus-border-width) solid var(--qds-theme-focus-border);\n outline-offset: var(--qds-focus-border-offset);\n border-radius: var(--qds-focus-border-radius);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, JSX } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Fragment,\n h,\n Listen,\n Prop,\n readTask,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport { isEllipsisActive } from '../../helpers'\n\nexport type BreadcrumbTarget = '_blank' | '_parent' | '_self' | '_top'\n\n/**\n * The `<qds-breadcrumb-item>` element is used as a navigational aid that is\n * typically placed between a site's header and the main content, displaying\n * either a hierarchy of the current page in relation to the site's structure,\n * from top level to current page, or a list of the links the user followed to\n * get to the current page, in the order visited.\n *\n * @see https://quartz.se.com/build/components/breadcrumb\n */\n@Component({\n tag: 'qds-breadcrumb-item',\n styleUrl: 'breadcrumb-item.css',\n shadow: { delegatesFocus: true },\n})\nexport class QdsBreadcrumbItem implements ComponentInterface {\n /**\n * The breadcrumb item's text.\n */\n @Prop() public readonly text!: string\n\n /**\n * Prevents the breadcrumb item 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 URL that the inline link points to. Inline 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 * - 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?: 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 inline 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<BreadcrumbTarget, string>\n\n @State() private tooltip = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n #breadcrumbItem?: HTMLAnchorElement | HTMLDivElement\n\n #ro?: ResizeObserver\n\n #span?: HTMLSpanElement\n\n get #computedDisabled(): boolean {\n return this.disabled\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.internals.ariaDisabled = this.disabled.toString()\n }\n\n @Watch('text')\n protected textChanged(): void {\n if (this.#ro) this.#ro.disconnect()\n\n if (!this.#span) return\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.internals.role = 'listitem'\n this.disabledChanged()\n }\n\n public componentDidLoad(): void {\n this.textChanged()\n }\n\n public disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n return (\n <div\n class={{\n 'qds-breadcrumb-item': true,\n 'qds-disabled': this.#computedDisabled,\n }}\n ref={this.href === undefined ? this.#breadcrumbItemRef : undefined}\n tabIndex={this.tooltip && this.href === undefined ? 0 : undefined}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n {this.href === undefined ? this.#renderText() : this.#renderAnchor()}\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </div>\n )\n }\n\n #renderAnchor(): JSX.Element {\n return (\n <>\n <span class=\"qds-overflow\" ref={this.#spanRef}>\n <a\n class=\"qds-anchor\"\n href={this.href}\n hrefLang={this.hreflang}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n ref={this.href === undefined ? undefined : this.#breadcrumbItemRef}\n target={this.target}\n >\n {this.text}\n </a>\n </span>\n <span aria-hidden=\"true\" class=\"qds-divider\">\n /\n </span>\n </>\n )\n }\n\n #renderText(): JSX.Element {\n return (\n <span class=\"qds-overflow\" ref={this.#spanRef}>\n {this.text}\n </span>\n )\n }\n\n readonly #breadcrumbItemRef = (\n breadcrumbItem?: HTMLAnchorElement | HTMLDivElement,\n ): void => {\n this.#breadcrumbItem = breadcrumbItem\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.#breadcrumbItem\n }\n}\n"],"version":3}
|
package/components/qds-button.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { B as Button, d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { B as Button, d as defineCustomElement$1 } from './p-DQ0iArwG.js';
|
|
7
7
|
|
|
8
8
|
const QdsButton = Button;
|
|
9
9
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { C as Checkbox, d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { C as Checkbox, d as defineCustomElement$1 } from './p-DeLdhUte.js';
|
|
7
7
|
|
|
8
8
|
const QdsCheckbox = Checkbox;
|
|
9
9
|
const defineCustomElement = defineCustomElement$1;
|
package/components/qds-chip.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
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, b as inheritAriaAttributes, 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, b as inheritAriaAttributes, i as invariant, a as isEllipsisActive } from './p-Bs-thw7N.js';
|
|
8
|
+
import { d as defineCustomElement$4 } from './p-D6kEwmWw.js';
|
|
9
|
+
import { d as defineCustomElement$3 } from './p-I5PkZmy8.js';
|
|
10
|
+
import { d as defineCustomElement$2 } from './p--vOFwWP9.js';
|
|
11
11
|
|
|
12
12
|
const chipCss = ":host([hidden]){display:none!important}:host{display:block}[aria-disabled=true]{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.qds-label{display:flex}.qds-container{min-width:0}.qds-target{-webkit-appearance:none;appearance:none;background-color:initial;border:none;color:inherit;cursor:pointer;display:flex;outline:none;padding:0;pointer-events:auto}.qds-target:disabled{pointer-events:none}.qds-alignment{align-items:center;display:flex}.qds-cursor{cursor:pointer}.qds-icon{flex-shrink:0}.qds-closable-chip,.qds-container{align-items:center;-webkit-appearance:none;appearance:none;background-color:initial;border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-rounded-border-radius);box-sizing:border-box;color:var(--qds-theme-control-text-standard);display:inline-flex;justify-content:center;padding-block:0;-webkit-user-select:none;user-select:none}.qds-checkbox:active~.qds-container,.qds-closable-chip:has(.qds-target:active),.qds-container.qds-pressed-state{background-color:var(--qds-theme-interactive-background-pressed)}.qds-container.qds-selected-state{background-color:var(--qds-theme-interactive-background-selected)}.qds-container.qds-selected-state:hover{background-color:var(--qds-theme-interactive-background-selected-hover)}.qds-container.qds-selected-state:active{background-color:var(--qds-theme-interactive-background-selected-pressed)}.qds-checkbox{clip-path:inset(50%);margin:0;position:absolute}.qds-checkbox:focus-visible~.qds-container{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-closable-chip[data-size=small],.qds-container[data-size=small]{gap:var(--qds-control-small-gap-internal);min-height:var(--qds-control-chip-small-height);padding-inline:var(--qds-control-chip-small-padding-horizontal)}.qds-closable-chip[data-size=small]{padding-inline-end:var(--qds-ontrol-chip-closable-small-padding-right)}.qds-icon[data-size=small]{--qds-experimental-icon-click-target-size:var(--qds-control-small-height);height:var(--qds-control-small-icon-size);width:var(--qds-control-small-icon-size)}.qds-text[data-size=small]{font:var(--qds-control-small-text);line-height:normal}.qds-closable-chip[data-size=standard],.qds-container[data-size=standard]{gap:var(--qds-control-standard-gap-internal);min-height:var(--qds-control-chip-standard-height);padding-inline:var(--qds-control-chip-standard-padding-horizontal)}.qds-closable-chip[data-size=standard]{padding-inline-end:var(--qds-control-chip-closable-standard-padding-right)}.qds-icon[data-size=standard]{--qds-experimental-icon-click-target-size:var(\n --qds-control-standard-height\n );height:var(--qds-control-standard-icon-size);width:var(--qds-control-standard-icon-size)}.qds-text[data-size=standard]{font:var(--qds-control-standard-text);line-height:normal}.qds-closable-chip[data-size=large],.qds-container[data-size=large]{gap:var(--qds-control-large-gap-internal);min-height:var(--qds-control-chip-large-height);padding-inline:var(--qds-control-chip-large-padding-horizontal)}.qds-closable-chip[data-size=large]{padding-inline-end:var(--qds-control-chip-closable-large-padding-right)}.qds-icon[data-size=large]{--qds-experimental-icon-click-target-size:var(--qds-control-large-height);height:var(--qds-control-large-icon-size);width:var(--qds-control-large-icon-size)}.qds-text[data-size=large]{font:var(--qds-control-large-text);line-height:normal}";
|
|
13
13
|
|
|
@@ -177,10 +177,10 @@ const Chip = /*@__PURE__*/ proxyCustomElement(class Chip extends H {
|
|
|
177
177
|
invariant(__classPrivateFieldGet(this, _Chip_span, "f"));
|
|
178
178
|
const span = __classPrivateFieldGet(this, _Chip_span, "f");
|
|
179
179
|
readTask(() => {
|
|
180
|
-
this.tooltip =
|
|
180
|
+
this.tooltip = isEllipsisActive(span);
|
|
181
181
|
});
|
|
182
182
|
__classPrivateFieldSet(this, _Chip_ro, new ResizeObserver(([spanEntry]) => {
|
|
183
|
-
this.tooltip =
|
|
183
|
+
this.tooltip = isEllipsisActive(spanEntry.target);
|
|
184
184
|
}), "f");
|
|
185
185
|
__classPrivateFieldGet(this, _Chip_ro, "f").observe(__classPrivateFieldGet(this, _Chip_span, "f"));
|
|
186
186
|
}
|
|
@@ -189,20 +189,20 @@ const Chip = /*@__PURE__*/ proxyCustomElement(class Chip extends H {
|
|
|
189
189
|
__classPrivateFieldGet(this, _Chip_ro, "f").disconnect();
|
|
190
190
|
}
|
|
191
191
|
render() {
|
|
192
|
-
return (h("div", { key: '
|
|
192
|
+
return (h("div", { key: 'bcc34bdc302e3507dbfc330766602a56b385ebb0', class: "qds-chip", ref: __classPrivateFieldGet(this, _Chip_chipRef, "f") }, __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedType_get) === 'closable' && (h("div", { key: '8bbbaa13dadd5169da7020566e27b714d6dee90d', "aria-disabled": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedDisabled_get) ? 'true' : undefined, class: {
|
|
193
193
|
'qds-container': true,
|
|
194
194
|
'qds-closable-chip': true,
|
|
195
|
-
}, "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get) }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '
|
|
195
|
+
}, "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get) }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '2ae352f12ce6157b9257278c8cb435292bc84d27', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get), library: this.iconLibrary, name: this.iconName })), h("span", { key: '94b7769f238fe01b6cdb1343a0191eab89fcccb6', class: "qds-text", "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get), ref: __classPrivateFieldGet(this, _Chip_spanRef, "f") }, this.text), h("qds-mini-button", { key: '5c5304b762576f483c8694352c39cc1f4d5548fa', name: "clear", text: __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_closableText_get), library: "core", class: "qds-cursor", "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get), disabled: __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedDisabled_get), onClick: __classPrivateFieldGet(this, _Chip_onIconClick, "f"), tabIndex: __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedDisabled_get) ? undefined : this.tabIndex, ...__classPrivateFieldGet(this, _Chip_inheritedAttributes, "f") }))), __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedType_get) === 'selectable' && (
|
|
196
196
|
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
197
|
-
h("label", { key: '
|
|
197
|
+
h("label", { key: 'f50ca1f2369ab1ff8d823c8ce22865950126eb18', "aria-disabled": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedDisabled_get) ? 'true' : undefined, class: "qds-label" }, h("input", { key: '9ef4d6e771113a1bc84a91091e963d2f24dc677c',
|
|
198
198
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
199
|
-
autoFocus: this.host.autofocus, checked: this.checked, class: "qds-checkbox", "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get), disabled: __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedDisabled_get), name: this.name, onBlur: __classPrivateFieldGet(this, _Chip_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _Chip_onFocus, "f"), tabIndex: __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedDisabled_get) ? undefined : this.tabIndex, type: "checkbox", value: this.value ?? undefined, ...__classPrivateFieldGet(this, _Chip_inheritedAttributes, "f") }), h("div", { key: '
|
|
199
|
+
autoFocus: this.host.autofocus, checked: this.checked, class: "qds-checkbox", "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get), disabled: __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedDisabled_get), name: this.name, onBlur: __classPrivateFieldGet(this, _Chip_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _Chip_onFocus, "f"), tabIndex: __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedDisabled_get) ? undefined : this.tabIndex, type: "checkbox", value: this.value ?? undefined, ...__classPrivateFieldGet(this, _Chip_inheritedAttributes, "f") }), h("div", { key: '6471d8928c0a302ae6226857a92e85984757e66f', class: {
|
|
200
200
|
'qds-container': true,
|
|
201
201
|
'qds-pressed-state': this.isPressed,
|
|
202
202
|
'qds-selected-state': this.isSelected,
|
|
203
203
|
'qds-padding-end': true,
|
|
204
204
|
'qds-cursor': true,
|
|
205
|
-
}, "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get) }, (this.checked ?? false) && (h("qds-icon", { key: '
|
|
205
|
+
}, "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get) }, (this.checked ?? false) && (h("qds-icon", { key: 'dcb2c36b020d0968c1bcdc2620c8bce2aceb5a05', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get), library: "core", name: "checked" })), this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '8bd629d4b13fc12a1510860a2728a935b78d5740', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get), library: this.iconLibrary, name: this.iconName })), h("span", { key: '21012b833280655c9ad6ebb7b1f75870a3ff0d97', class: "qds-text", "data-size": __classPrivateFieldGet(this, _Chip_instances, "a", _Chip_computedSize_get), ref: __classPrivateFieldGet(this, _Chip_spanRef, "f") }, this.text)))), this.tooltip && (h("qds-tooltip", { key: 'decb809fab63928ec8e7f8069b04b88fd7d1117e', "aria-hidden": "true", ref: __classPrivateFieldGet(this, _Chip_tooltipRef, "f"), trigger: "pointerenter focusin" }, this.text))));
|
|
206
206
|
}
|
|
207
207
|
static get delegatesFocus() { return true; }
|
|
208
208
|
static get formAssociated() { return true; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-chip.js","mappings":";;;;;;;;;;;AAAA,MAAM,OAAO,GAAG,g+GAAg+G;;ACAh/G;AACA;AACA;;;;;;;;;;;;;;;;;;MAyCa,IAAI,iBAAAA,kBAAA,CAAA,MAAA,IAAA,SAAAC,CAAA,CAAA;AANjB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;;;;;;AAcE;;AAEG;AACqB,QAAA,IAAW,CAAA,WAAA,GAAW,SAAS;AAEvD;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAU,UAAU;AAEhD;;AAEG;AACqB,QAAA,IAAI,CAAA,IAAA,GAAc,YAAY;AActD;;;;;;;;;;;;;AAaG;;AAEqB,QAAA,IAAI,CAAA,IAAA,GAAsC,IAAI;AAgBtE;;;;AAIG;AACqB,QAAA,IAAK,CAAA,KAAA,GAAW,IAAI;AA8B3B,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,CAAC,EAAA,yBAAA,GAAA,SAAA,yBAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,OAAO,IAAI,KAAK;AAC9B,CAAC,EAAA,uBAAA,GAAA,SAAA,uBAAA,GAAA;;AAIC,IAAA,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;AAC1D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/chip/chip.css?tag=qds-chip&encapsulation=shadow","src/components/chip/chip.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: block;\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-label {\n display: flex;\n}\n\n.qds-container {\n /* Avoid automatic minimum size on flex element: https://www.w3.org/TR/css-flexbox-1/#min-size-auto */\n min-width: 0;\n}\n\n.qds-target {\n appearance: none;\n display: flex;\n border: none;\n padding: 0;\n background-color: transparent;\n color: inherit;\n cursor: pointer;\n pointer-events: auto;\n outline: none;\n\n &:disabled {\n pointer-events: none;\n }\n}\n\n.qds-alignment {\n display: flex;\n align-items: center;\n}\n\n.qds-cursor {\n cursor: pointer;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-closable-chip,\n.qds-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding-block: 0;\n user-select: none;\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n border-radius: var(--qds-control-rounded-border-radius);\n color: var(--qds-theme-control-text-standard);\n background-color: initial;\n appearance: none;\n box-sizing: border-box;\n}\n\n.qds-checkbox:active ~ .qds-container,\n.qds-closable-chip:has(.qds-target:active),\n.qds-container.qds-pressed-state {\n background-color: var(--qds-theme-interactive-background-pressed);\n}\n\n.qds-container.qds-selected-state {\n background-color: var(--qds-theme-interactive-background-selected);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-selected-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-selected-pressed);\n }\n}\n\n.qds-checkbox {\n clip-path: inset(50%);\n margin: 0;\n position: absolute;\n\n &:focus-visible ~ .qds-container {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n[data-size='small'] {\n &.qds-closable-chip,\n &.qds-container {\n min-height: var(--qds-control-chip-small-height);\n padding-inline: var(--qds-control-chip-small-padding-horizontal);\n gap: var(--qds-control-small-gap-internal);\n }\n\n &.qds-closable-chip {\n padding-inline-end: var(--qds-ontrol-chip-closable-small-padding-right);\n }\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(--qds-control-small-height);\n\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-control-small-text);\n line-height: normal;\n }\n}\n\n[data-size='standard'] {\n &.qds-closable-chip,\n &.qds-container {\n min-height: var(--qds-control-chip-standard-height);\n padding-inline: var(--qds-control-chip-standard-padding-horizontal);\n gap: var(--qds-control-standard-gap-internal);\n }\n\n &.qds-closable-chip {\n padding-inline-end: var(--qds-control-chip-closable-standard-padding-right);\n }\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(\n --qds-control-standard-height\n );\n\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-control-standard-text);\n line-height: normal;\n }\n}\n\n[data-size='large'] {\n &.qds-closable-chip,\n &.qds-container {\n min-height: var(--qds-control-chip-large-height);\n padding-inline: var(--qds-control-chip-large-padding-horizontal);\n gap: var(--qds-control-large-gap-internal);\n }\n\n &.qds-closable-chip {\n padding-inline-end: var(--qds-control-chip-closable-large-padding-right);\n }\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(--qds-control-large-height);\n\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-control-large-text);\n line-height: normal;\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 readTask,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n invariant,\n isOverflowing,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Value } from '../controls'\nimport type { Size } from '../shared'\n\nexport type ChipType = 'closable' | 'selectable'\n\n/**\n * `<qds-chip>` elements are interactive elements that represent selections.\n * Chips allow users to make a selection from a list of options or display\n * items like filters or tags.\n *\n * @see https://quartz.se.com/build/components/chip\n */\n@Component({\n tag: 'qds-chip',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'chip.css',\n})\nexport class Chip implements ComponentInterface {\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 chip's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The chip's type.\n */\n @Prop() public readonly type?: ChipType = 'selectable'\n\n /**\n * The chip's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Sets the selectable chip's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the chip with (its form owner).\n *\n * The value of this property must be the id of a `<form>` in the same\n * document. If this property is not set, the `<qds-chip>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This property lets you associate `<qds-chip>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n *an ancestor `<form>` element.\n *\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Prevents the chip from being interacted with: it cannot be pressed or\n * focused.\n *\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The name of the chip, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * The value of the chip, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop() public readonly value?: Value = 'on'\n\n /**\n * Emitted when the chip loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the chip gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the chip is closed.\n */\n @Event({ eventName: 'qdsClose', cancelable: false })\n private readonly closeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when a change to the selectable chip's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n @State() private isPressed = false\n\n @State() private isSelected = false\n\n @State() private tabIndex?: number\n\n @State() private tooltip = false\n\n #chip?: HTMLDivElement\n\n #span?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n #inheritedAttributes: Attributes = {}\n\n get #closableText(): string {\n return `Delete ${this.text} selection`\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\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(): ChipType {\n switch (this.type) {\n case 'selectable':\n case 'closable': {\n return this.type\n }\n default: {\n return 'selectable'\n }\n }\n }\n\n get #computedChecked(): boolean {\n return this.checked ?? false\n }\n\n get #computedValue(): string | null {\n // eslint-disable-next-line unicorn/no-null\n return this.value == null ? null : this.value.toString()\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n event.preventDefault()\n\n if (this.#computedType === 'selectable') {\n this.checked = !this.#computedChecked\n this.changeEmitter.emit()\n }\n }\n\n @Listen('keydown')\n protected handleKeyDown(event: KeyboardEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (event.key === ' ') {\n this.isPressed = true\n event.preventDefault()\n } else if (event.key === 'Enter' && this.internals.form) {\n this.internals.form.requestSubmit()\n event.preventDefault()\n }\n }\n\n @Listen('keyup')\n protected handleKeyUp(event: KeyboardEvent): void {\n if (event.key !== ' ') return\n this.isPressed = false\n if (this.#computedType === 'selectable') {\n this.checked = !this.#computedChecked\n this.changeEmitter.emit()\n }\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.isSelected = this.#computedChecked\n this.internals.setFormValue(\n this.#computedChecked && !this.#computedDisabled\n ? this.#computedValue\n : // eslint-disable-next-line unicorn/no-null\n null,\n )\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n // eslint-disable-next-line unicorn/no-null\n else this.internals.setFormValue(null)\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('value')\n protected valueChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.valueChanged()\n\n Object.defineProperty(this.host, 'form', {\n enumerable: true,\n get: () => this.internals.form,\n })\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\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 disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n return (\n <div class=\"qds-chip\" ref={this.#chipRef}>\n {this.#computedType === 'closable' && (\n <div\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-container': true,\n 'qds-closable-chip': true,\n }}\n data-size={this.#computedSize}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\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 )}\n <span\n class=\"qds-text\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n <qds-mini-button\n name=\"clear\"\n text={this.#closableText}\n library=\"core\"\n class=\"qds-cursor\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n onClick={this.#onIconClick}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n </div>\n )}\n {this.#computedType === 'selectable' && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class=\"qds-label\"\n >\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.checked}\n class=\"qds-checkbox\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n name={this.name}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n value={this.value ?? undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <div\n class={{\n 'qds-container': true,\n 'qds-pressed-state': this.isPressed,\n 'qds-selected-state': this.isSelected,\n 'qds-padding-end': true,\n 'qds-cursor': true,\n }}\n data-size={this.#computedSize}\n >\n {(this.checked ?? false) && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library=\"core\"\n name=\"checked\"\n />\n )}\n {this.iconName !== undefined && this.iconName !== '' && (\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 )}\n\n <span\n class=\"qds-text\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n </div>\n </label>\n )}\n {this.tooltip && (\n <qds-tooltip\n aria-hidden=\"true\"\n ref={this.#tooltipRef}\n trigger=\"pointerenter focusin\"\n >\n {this.text}\n </qds-tooltip>\n )}\n </div>\n )\n }\n\n readonly #onIconClick = (event: MouseEvent): void => {\n if (!event.defaultPrevented && this.#computedType === 'closable')\n this.closeEmitter.emit()\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #chipRef = (chip?: HTMLDivElement): void => {\n this.#chip = chip\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.#chip\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-chip.js","mappings":";;;;;;;;;;;AAAA,MAAM,OAAO,GAAG,g+GAAg+G;;ACAh/G;AACA;AACA;;;;;;;;;;;;;;;;;;MAyCa,IAAI,iBAAAA,kBAAA,CAAA,MAA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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,sBAAA,GAAA,SAAA,sBAAA,GAAA;AAGC,IAAA,QAAQ,IAAI,CAAC,IAAI;AACf,QAAA,KAAK,YAAY;QACjB,KAAK,UAAU,EAAE;YACf,OAAO,IAAI,CAAC,IAAI;;QAElB,SAAS;AACP,YAAA,OAAO,YAAY;;;AAGzB,CAAC,EAAA,yBAAA,GAAA,SAAA,yBAAA,GAAA;AAGC,IAAA,OAAO,IAAI,CAAC,OAAO,IAAI,KAAK;AAC9B,CAAC,EAAA,uBAAA,GAAA,SAAA,uBAAA,GAAA;;AAIC,IAAA,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;AAC1D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/chip/chip.css?tag=qds-chip&encapsulation=shadow","src/components/chip/chip.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: block;\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.qds-label {\n display: flex;\n}\n\n.qds-container {\n /* Avoid automatic minimum size on flex element: https://www.w3.org/TR/css-flexbox-1/#min-size-auto */\n min-width: 0;\n}\n\n.qds-target {\n appearance: none;\n display: flex;\n border: none;\n padding: 0;\n background-color: transparent;\n color: inherit;\n cursor: pointer;\n pointer-events: auto;\n outline: none;\n\n &:disabled {\n pointer-events: none;\n }\n}\n\n.qds-alignment {\n display: flex;\n align-items: center;\n}\n\n.qds-cursor {\n cursor: pointer;\n}\n\n.qds-icon {\n flex-shrink: 0;\n}\n\n.qds-closable-chip,\n.qds-container {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding-block: 0;\n user-select: none;\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n border-radius: var(--qds-control-rounded-border-radius);\n color: var(--qds-theme-control-text-standard);\n background-color: initial;\n appearance: none;\n box-sizing: border-box;\n}\n\n.qds-checkbox:active ~ .qds-container,\n.qds-closable-chip:has(.qds-target:active),\n.qds-container.qds-pressed-state {\n background-color: var(--qds-theme-interactive-background-pressed);\n}\n\n.qds-container.qds-selected-state {\n background-color: var(--qds-theme-interactive-background-selected);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-selected-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-selected-pressed);\n }\n}\n\n.qds-checkbox {\n clip-path: inset(50%);\n margin: 0;\n position: absolute;\n\n &:focus-visible ~ .qds-container {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n[data-size='small'] {\n &.qds-closable-chip,\n &.qds-container {\n min-height: var(--qds-control-chip-small-height);\n padding-inline: var(--qds-control-chip-small-padding-horizontal);\n gap: var(--qds-control-small-gap-internal);\n }\n\n &.qds-closable-chip {\n padding-inline-end: var(--qds-ontrol-chip-closable-small-padding-right);\n }\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(--qds-control-small-height);\n\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-control-small-text);\n line-height: normal;\n }\n}\n\n[data-size='standard'] {\n &.qds-closable-chip,\n &.qds-container {\n min-height: var(--qds-control-chip-standard-height);\n padding-inline: var(--qds-control-chip-standard-padding-horizontal);\n gap: var(--qds-control-standard-gap-internal);\n }\n\n &.qds-closable-chip {\n padding-inline-end: var(--qds-control-chip-closable-standard-padding-right);\n }\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(\n --qds-control-standard-height\n );\n\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-control-standard-text);\n line-height: normal;\n }\n}\n\n[data-size='large'] {\n &.qds-closable-chip,\n &.qds-container {\n min-height: var(--qds-control-chip-large-height);\n padding-inline: var(--qds-control-chip-large-padding-horizontal);\n gap: var(--qds-control-large-gap-internal);\n }\n\n &.qds-closable-chip {\n padding-inline-end: var(--qds-control-chip-closable-large-padding-right);\n }\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(--qds-control-large-height);\n\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-control-large-text);\n line-height: normal;\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 readTask,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n invariant,\n isEllipsisActive,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Value } from '../controls'\nimport type { Size } from '../shared'\n\nexport type ChipType = 'closable' | 'selectable'\n\n/**\n * `<qds-chip>` elements are interactive elements that represent selections.\n * Chips allow users to make a selection from a list of options or display\n * items like filters or tags.\n *\n * @see https://quartz.se.com/build/components/chip\n */\n@Component({\n tag: 'qds-chip',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'chip.css',\n})\nexport class Chip implements ComponentInterface {\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 chip's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The chip's type.\n */\n @Prop() public readonly type?: ChipType = 'selectable'\n\n /**\n * The chip's text.\n */\n @Prop() public readonly text?: string\n\n /**\n * Sets the selectable chip's state.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the chip with (its form owner).\n *\n * The value of this property must be the id of a `<form>` in the same\n * document. If this property is not set, the `<qds-chip>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This property lets you associate `<qds-chip>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n *an ancestor `<form>` element.\n *\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Prevents the chip from being interacted with: it cannot be pressed or\n * focused.\n *\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * The name of the chip, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * The value of the chip, submitted as a name/value pair with form data.\n *\n * @webnative\n */\n @Prop() public readonly value?: Value = 'on'\n\n /**\n * Emitted when the chip loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the chip gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the chip is closed.\n */\n @Event({ eventName: 'qdsClose', cancelable: false })\n private readonly closeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when a change to the selectable chip's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n @Element() private readonly host!: HTMLElement\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n @State() private isPressed = false\n\n @State() private isSelected = false\n\n @State() private tabIndex?: number\n\n @State() private tooltip = false\n\n #chip?: HTMLDivElement\n\n #span?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n #inheritedAttributes: Attributes = {}\n\n get #closableText(): string {\n return `Delete ${this.text} selection`\n }\n\n get #computedDisabled(): boolean {\n return this.disabled ?? false\n }\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(): ChipType {\n switch (this.type) {\n case 'selectable':\n case 'closable': {\n return this.type\n }\n default: {\n return 'selectable'\n }\n }\n }\n\n get #computedChecked(): boolean {\n return this.checked ?? false\n }\n\n get #computedValue(): string | null {\n // eslint-disable-next-line unicorn/no-null\n return this.value == null ? null : this.value.toString()\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n event.preventDefault()\n\n if (this.#computedType === 'selectable') {\n this.checked = !this.#computedChecked\n this.changeEmitter.emit()\n }\n }\n\n @Listen('keydown')\n protected handleKeyDown(event: KeyboardEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (event.key === ' ') {\n this.isPressed = true\n event.preventDefault()\n } else if (event.key === 'Enter' && this.internals.form) {\n this.internals.form.requestSubmit()\n event.preventDefault()\n }\n }\n\n @Listen('keyup')\n protected handleKeyUp(event: KeyboardEvent): void {\n if (event.key !== ' ') return\n this.isPressed = false\n if (this.#computedType === 'selectable') {\n this.checked = !this.#computedChecked\n this.changeEmitter.emit()\n }\n }\n\n @Watch('checked')\n protected checkedChanged(): void {\n this.isSelected = this.#computedChecked\n this.internals.setFormValue(\n this.#computedChecked && !this.#computedDisabled\n ? this.#computedValue\n : // eslint-disable-next-line unicorn/no-null\n null,\n )\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n // eslint-disable-next-line unicorn/no-null\n else this.internals.setFormValue(null)\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('value')\n protected valueChanged(): void {\n if (this.#computedChecked && !this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.valueChanged()\n\n Object.defineProperty(this.host, 'form', {\n enumerable: true,\n get: () => this.internals.form,\n })\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\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 disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n return (\n <div class=\"qds-chip\" ref={this.#chipRef}>\n {this.#computedType === 'closable' && (\n <div\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class={{\n 'qds-container': true,\n 'qds-closable-chip': true,\n }}\n data-size={this.#computedSize}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\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 )}\n <span\n class=\"qds-text\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n <qds-mini-button\n name=\"clear\"\n text={this.#closableText}\n library=\"core\"\n class=\"qds-cursor\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n onClick={this.#onIconClick}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n </div>\n )}\n {this.#computedType === 'selectable' && (\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n <label\n aria-disabled={this.#computedDisabled ? 'true' : undefined}\n class=\"qds-label\"\n >\n <input\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n checked={this.checked}\n class=\"qds-checkbox\"\n data-size={this.#computedSize}\n disabled={this.#computedDisabled}\n name={this.name}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n value={this.value ?? undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <div\n class={{\n 'qds-container': true,\n 'qds-pressed-state': this.isPressed,\n 'qds-selected-state': this.isSelected,\n 'qds-padding-end': true,\n 'qds-cursor': true,\n }}\n data-size={this.#computedSize}\n >\n {(this.checked ?? false) && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library=\"core\"\n name=\"checked\"\n />\n )}\n {this.iconName !== undefined && this.iconName !== '' && (\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 )}\n\n <span\n class=\"qds-text\"\n data-size={this.#computedSize}\n ref={this.#spanRef}\n >\n {this.text}\n </span>\n </div>\n </label>\n )}\n {this.tooltip && (\n <qds-tooltip\n aria-hidden=\"true\"\n ref={this.#tooltipRef}\n trigger=\"pointerenter focusin\"\n >\n {this.text}\n </qds-tooltip>\n )}\n </div>\n )\n }\n\n readonly #onIconClick = (event: MouseEvent): void => {\n if (!event.defaultPrevented && this.#computedType === 'closable')\n this.closeEmitter.emit()\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #chipRef = (chip?: HTMLDivElement): void => {\n this.#chip = chip\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.#chip\n }\n}\n"],"version":3}
|