@quartzds/core 1.0.0-beta.81 → 1.0.0-beta.83
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/components/index.js +2 -2
- package/components/{p-7b04d43e.js → p-002e77af.js} +656 -328
- package/components/p-002e77af.js.map +1 -0
- package/components/{p-9df62f97.js → p-065d722e.js} +18 -7
- package/components/{p-9df62f97.js.map → p-065d722e.js.map} +1 -1
- package/components/{p-7f6e797a.js → p-252b0946.js} +17 -12
- package/components/p-252b0946.js.map +1 -0
- package/components/{p-d279ae53.js → p-2e88c3cc.js} +11 -3
- package/components/p-2e88c3cc.js.map +1 -0
- package/components/{p-698edde1.js → p-786e2b51.js} +79 -44
- package/components/p-786e2b51.js.map +1 -0
- package/components/{p-b82bac0a.js → p-84aae53b.js} +20 -11
- package/components/p-84aae53b.js.map +1 -0
- package/components/{p-028b9d2e.js → p-86a0fdf3.js} +11 -4
- package/components/p-86a0fdf3.js.map +1 -0
- package/components/{p-82461767.js → p-9a9561a8.js} +8 -80
- package/components/p-9a9561a8.js.map +1 -0
- package/components/{p-f5ba28ff.js → p-ae6eda4e.js} +41 -30
- package/components/p-ae6eda4e.js.map +1 -0
- package/components/{p-f85b490c.js → p-ed500f42.js} +72 -28
- package/components/p-ed500f42.js.map +1 -0
- package/components/{p-355efdb1.js → p-ee2621aa.js} +11 -5
- package/components/p-ee2621aa.js.map +1 -0
- package/components/{p-4141d6ed.js → p-efdb8fa2.js} +2 -2
- package/components/p-efdb8fa2.js.map +1 -0
- package/components/qds-badge-counter.js +1 -1
- package/components/qds-badge-indicator.js +1 -1
- package/components/qds-breadcrumb-item.js +65 -15
- 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 +46 -25
- package/components/qds-chip.js.map +1 -1
- package/components/qds-dialog.js +9 -4
- package/components/qds-dialog.js.map +1 -1
- package/components/qds-divider.js +1 -1
- package/components/qds-dropdown.js +25 -18
- package/components/qds-dropdown.js.map +1 -1
- package/components/qds-form-message.js +18 -8
- package/components/qds-form-message.js.map +1 -1
- package/components/qds-icon.js +1 -1
- package/components/qds-inline-link.js +18 -17
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.js +117 -54
- package/components/qds-input.js.map +1 -1
- package/components/qds-label.js +1 -1
- package/components/qds-list-item.js +21 -22
- package/components/qds-list-item.js.map +1 -1
- package/components/qds-loader.js +5 -3
- package/components/qds-loader.js.map +1 -1
- package/components/qds-nav-list-item.js +32 -16
- package/components/qds-nav-list-item.js.map +1 -1
- package/components/qds-progress-bar.js +25 -7
- package/components/qds-progress-bar.js.map +1 -1
- package/components/qds-radio.js +25 -24
- package/components/qds-radio.js.map +1 -1
- package/components/qds-select.js +119 -31
- package/components/qds-select.js.map +1 -1
- package/components/qds-standalone-link.js +26 -19
- package/components/qds-standalone-link.js.map +1 -1
- package/components/qds-switch.js +70 -21
- package/components/qds-switch.js.map +1 -1
- package/components/qds-tab.js +71 -45
- package/components/qds-tab.js.map +1 -1
- package/components/qds-tabbar.js +34 -27
- package/components/qds-tabbar.js.map +1 -1
- package/components/qds-table-body.js +3 -3
- package/components/qds-table-body.js.map +1 -1
- package/components/qds-table-cell.js +3 -5
- package/components/qds-table-cell.js.map +1 -1
- package/components/qds-table-head-cell.js +3 -7
- package/components/qds-table-head-cell.js.map +1 -1
- package/components/qds-table-head.js +3 -3
- package/components/qds-table-head.js.map +1 -1
- package/components/qds-table-row.js +3 -3
- package/components/qds-table-row.js.map +1 -1
- package/components/qds-table.js +3 -3
- package/components/qds-table.js.map +1 -1
- package/components/qds-tag.js +1 -1
- package/components/qds-textarea.js +94 -39
- package/components/qds-textarea.js.map +1 -1
- package/components/qds-title.js +1 -1
- package/components/qds-tooltip.js +1 -1
- package/dist/cjs/helpers-cdd65bd0.js.map +1 -1
- package/dist/cjs/{index-a9985af0.js → index-644fe556.js} +720 -273
- package/dist/cjs/index-644fe556.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{library-57845012.js → library-1fda56bc.js} +2 -2
- package/dist/cjs/{library-57845012.js.map → library-1fda56bc.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js +151 -0
- package/dist/cjs/qds-badge-counter_2.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +53 -12
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-button.cjs.entry.js +73 -38
- package/dist/cjs/qds-button.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-checkbox.cjs.entry.js +67 -22
- package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-chip.cjs.entry.js +43 -21
- package/dist/cjs/qds-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-dialog.cjs.entry.js +8 -3
- package/dist/cjs/qds-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-divider.cjs.entry.js +9 -3
- package/dist/cjs/qds-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-dropdown.cjs.entry.js +24 -17
- package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-form-message.cjs.entry.js +16 -6
- package/dist/cjs/qds-form-message.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-icon.cjs.entry.js +7 -5
- package/dist/cjs/qds-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-inline-link.cjs.entry.js +16 -15
- package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-input.cjs.entry.js +110 -43
- package/dist/cjs/qds-input.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-label.cjs.entry.js +16 -5
- package/dist/cjs/qds-label.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-list-item.cjs.entry.js +17 -18
- package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-loader.cjs.entry.js +4 -2
- package/dist/cjs/qds-loader.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-nav-list-item.cjs.entry.js +29 -13
- package/dist/cjs/qds-nav-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-progress-bar.cjs.entry.js +25 -7
- package/dist/cjs/qds-progress-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-radio.cjs.entry.js +22 -21
- package/dist/cjs/qds-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-select.cjs.entry.js +116 -26
- package/dist/cjs/qds-select.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-standalone-link.cjs.entry.js +24 -17
- package/dist/cjs/qds-standalone-link.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-switch.cjs.entry.js +68 -18
- package/dist/cjs/qds-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tab.cjs.entry.js +64 -38
- package/dist/cjs/qds-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tabbar.cjs.entry.js +27 -20
- package/dist/cjs/qds-tabbar.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-body.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-body.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-cell.cjs.entry.js +2 -4
- package/dist/cjs/qds-table-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +2 -6
- package/dist/cjs/qds-table-head-cell.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-head.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-head.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table-row.cjs.entry.js +2 -2
- package/dist/cjs/qds-table-row.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-table.cjs.entry.js +2 -2
- package/dist/cjs/qds-table.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tag_2.cjs.entry.js +30 -16
- package/dist/cjs/qds-tag_2.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-textarea.cjs.entry.js +92 -33
- package/dist/cjs/qds-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/{qds-badge-counter_3.cjs.entry.js → qds-tooltip.cjs.entry.js} +40 -152
- package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/qds.cjs.js +3 -3
- package/dist/cjs/qds.cjs.js.map +1 -1
- package/dist/custom-elements.json +103 -229
- package/dist/docs.d.ts +8 -0
- package/dist/docs.json +870 -630
- package/dist/esm/{helpers-4eb4fa44.js → helpers-d08540f8.js} +2 -2
- package/dist/esm/helpers-d08540f8.js.map +1 -0
- package/dist/esm/{index-5291e8ff.js → index-be1284b6.js} +720 -273
- package/dist/esm/index-be1284b6.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/{library-9edbe354.js → library-a92b7d9e.js} +2 -2
- package/dist/esm/{library-9edbe354.js.map → library-a92b7d9e.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/qds-badge-counter_2.entry.js +146 -0
- package/dist/esm/qds-badge-counter_2.entry.js.map +1 -0
- package/dist/esm/qds-breadcrumb-item.entry.js +54 -13
- package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/qds-button.entry.js +74 -39
- package/dist/esm/qds-button.entry.js.map +1 -1
- package/dist/esm/qds-checkbox.entry.js +69 -24
- package/dist/esm/qds-checkbox.entry.js.map +1 -1
- package/dist/esm/qds-chip.entry.js +44 -22
- package/dist/esm/qds-chip.entry.js.map +1 -1
- package/dist/esm/qds-dialog.entry.js +9 -4
- package/dist/esm/qds-dialog.entry.js.map +1 -1
- package/dist/esm/qds-divider.entry.js +10 -4
- package/dist/esm/qds-divider.entry.js.map +1 -1
- package/dist/esm/qds-dropdown.entry.js +25 -18
- package/dist/esm/qds-dropdown.entry.js.map +1 -1
- package/dist/esm/qds-form-message.entry.js +17 -7
- package/dist/esm/qds-form-message.entry.js.map +1 -1
- package/dist/esm/qds-icon.entry.js +8 -6
- package/dist/esm/qds-icon.entry.js.map +1 -1
- package/dist/esm/qds-inline-link.entry.js +17 -16
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +112 -45
- package/dist/esm/qds-input.entry.js.map +1 -1
- package/dist/esm/qds-label.entry.js +17 -6
- package/dist/esm/qds-label.entry.js.map +1 -1
- package/dist/esm/qds-list-item.entry.js +18 -19
- package/dist/esm/qds-list-item.entry.js.map +1 -1
- package/dist/esm/qds-loader.entry.js +4 -2
- package/dist/esm/qds-loader.entry.js.map +1 -1
- package/dist/esm/qds-nav-list-item.entry.js +30 -14
- package/dist/esm/qds-nav-list-item.entry.js.map +1 -1
- package/dist/esm/qds-progress-bar.entry.js +25 -7
- package/dist/esm/qds-progress-bar.entry.js.map +1 -1
- package/dist/esm/qds-radio.entry.js +23 -22
- package/dist/esm/qds-radio.entry.js.map +1 -1
- package/dist/esm/qds-select.entry.js +118 -28
- package/dist/esm/qds-select.entry.js.map +1 -1
- package/dist/esm/qds-standalone-link.entry.js +25 -18
- package/dist/esm/qds-standalone-link.entry.js.map +1 -1
- package/dist/esm/qds-switch.entry.js +70 -20
- package/dist/esm/qds-switch.entry.js.map +1 -1
- package/dist/esm/qds-tab.entry.js +65 -39
- package/dist/esm/qds-tab.entry.js.map +1 -1
- package/dist/esm/qds-tabbar.entry.js +28 -21
- package/dist/esm/qds-tabbar.entry.js.map +1 -1
- package/dist/esm/qds-table-body.entry.js +3 -3
- package/dist/esm/qds-table-body.entry.js.map +1 -1
- package/dist/esm/qds-table-cell.entry.js +3 -5
- package/dist/esm/qds-table-cell.entry.js.map +1 -1
- package/dist/esm/qds-table-head-cell.entry.js +3 -7
- package/dist/esm/qds-table-head-cell.entry.js.map +1 -1
- package/dist/esm/qds-table-head.entry.js +3 -3
- package/dist/esm/qds-table-head.entry.js.map +1 -1
- package/dist/esm/qds-table-row.entry.js +3 -3
- package/dist/esm/qds-table-row.entry.js.map +1 -1
- package/dist/esm/qds-table.entry.js +3 -3
- package/dist/esm/qds-table.entry.js.map +1 -1
- package/dist/esm/qds-tag_2.entry.js +31 -17
- package/dist/esm/qds-tag_2.entry.js.map +1 -1
- package/dist/esm/qds-textarea.entry.js +94 -35
- package/dist/esm/qds-textarea.entry.js.map +1 -1
- package/dist/esm/{qds-badge-counter_3.entry.js → qds-tooltip.entry.js} +42 -152
- package/dist/esm/qds-tooltip.entry.js.map +1 -0
- package/dist/esm/qds.js +4 -4
- package/dist/esm/qds.js.map +1 -1
- package/dist/types/components/breadcrumb-item/breadcrumb-item.d.ts +4 -0
- package/dist/types/components/checkbox/checkbox.d.ts +0 -6
- package/dist/types/components/chip/chip.d.ts +0 -6
- package/dist/types/components/input/input.d.ts +1 -30
- package/dist/types/components/select/select.d.ts +1 -8
- package/dist/types/components/switch/switch.d.ts +0 -6
- package/dist/types/components/tag/tag.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -29
- package/dist/types/components.d.ts +623 -91
- package/dist/types/stencil-public-runtime.d.ts +6 -0
- package/dist/vscode.html-custom-data.json +0 -80
- package/hydrate/index.d.ts +28 -5
- package/hydrate/index.js +2753 -1052
- package/hydrate/index.mjs +2753 -1052
- package/package.json +3 -3
- package/components/p-028b9d2e.js.map +0 -1
- package/components/p-355efdb1.js.map +0 -1
- package/components/p-4141d6ed.js.map +0 -1
- package/components/p-698edde1.js.map +0 -1
- package/components/p-7b04d43e.js.map +0 -1
- package/components/p-7f6e797a.js.map +0 -1
- package/components/p-82461767.js.map +0 -1
- package/components/p-b82bac0a.js.map +0 -1
- package/components/p-d279ae53.js.map +0 -1
- package/components/p-f5ba28ff.js.map +0 -1
- package/components/p-f85b490c.js.map +0 -1
- package/dist/cjs/index-a9985af0.js.map +0 -1
- package/dist/cjs/qds-badge-counter_3.cjs.entry.js.map +0 -1
- package/dist/esm/helpers-4eb4fa44.js.map +0 -1
- package/dist/esm/index-5291e8ff.js.map +0 -1
- package/dist/esm/qds-badge-counter_3.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-form-message.js","mappings":";;;;;;;;;AAAA,MAAM,cAAc,GAAG,4lEAA4lE,CAAC;AACpnE,6BAAe,cAAc;;ACD7B;AACA;AACA;;;;;;;;;;;;;;;;;;MAoBa,WAAW
|
|
1
|
+
{"file":"qds-form-message.js","mappings":";;;;;;;;;AAAA,MAAM,cAAc,GAAG,4lEAA4lE,CAAC;AACpnE,6BAAe,cAAc;;ACD7B;AACA;AACA;;;;;;;;;;;;;;;;;;MAoBa,WAAW;IALxB;;;;;;;;;;;QAY0B,WAAM,GAAY,KAAK,CAAA;;;;QAKvB,SAAI,GAAU,UAAU,CAAA;;;;QAKxB,WAAM,GAAY,OAAO,CAAA;QAkBjD,2CAAmC,EAAE,EAAA;KAwDtC;IArCQ,iBAAiB;QACtB,uBAAA,IAAI,oCAAwB,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAA,CAAA;KAC7D;IAEM,MAAM;QACX,QACE,6DACE,KAAK,EAAE;gBACL,kBAAkB,EAAE,IAAI;gBACxB,YAAY,EAAE,IAAI,CAAC,MAAM;aAC1B,eACU,uBAAA,IAAI,6DAAc,KAEzB,uBAAA,IAAI,wCAAqB,IAE7B,4DAAK,KAAK,EAAC,oBAAoB,eAAY,uBAAA,IAAI,6DAAc,IAC3D,4DACE,KAAK,EAAC,qBAAqB,eAChB,uBAAA,IAAI,6DAAc,iBAChB,IAAI,CAAC,MAAM,IAExB,gFACc,MAAM,EAClB,KAAK,EAAC,UAAU,eACL,uBAAA,IAAI,6DAAc,EAC7B,IAAI,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE,EAC7B,OAAO,EAAC,MAAM,GACd,EACF,6DAAM,KAAK,EAAC,aAAa,IAAE,IAAI,CAAC,iBAAiB,CAAQ,CACrD,CACF,EACN,6DAAM,KAAK,EAAC,UAAU,iBAAc,uBAAA,IAAI,+DAAgB,IACrD,IAAI,CAAC,IAAI,CACL,CACF,EACR;KACF;;;;;;;;;;;IApDC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;IAGC,OAAO,IAAI,CAAC,MAAM,IAAI,OAAO,CAAA;AAC/B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/form-message/form-message.css?tag=qds-form-message&encapsulation=shadow","src/components/form-message/form-message.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 line-height: 0;\n}\n\n.qds-form-message {\n color: var(--qds-theme-control-text-standard);\n display: inline-flex;\n gap: var(--qds-text-icon-gap);\n}\n\n.qds-icon-container,\n.qds-icon-background {\n display: flex;\n align-items: center;\n}\n\n.qds-icon-background {\n border-radius: var(--qds-control-rounded-border-radius);\n}\n\n.qds-icon {\n color: var(--qds-theme-feedback-action-destructive-contrast);\n}\n\n.qds-sr-only {\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-icon-container {\n height: var(--qds-control-small-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-control-small-icon-size);\n height: var(--qds-control-small-icon-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-icon-container {\n height: var(--qds-control-standard-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-control-standard-icon-size);\n height: var(--qds-control-standard-icon-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-icon-container {\n height: var(--qds-control-large-icon-crop-height);\n }\n\n &.qds-icon {\n width: var(--qds-control-large-icon-size);\n height: var(--qds-control-large-icon-size);\n }\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n}\n\n[data-status='error'] {\n &.qds-icon-background {\n background-color: var(--qds-theme-feedback-result-failure);\n }\n\n &.qds-text {\n color: var(--qds-theme-feedback-result-failure);\n }\n}\n\n[data-status='info'].qds-icon-background {\n background-color: var(--qds-theme-feedback-message-informational);\n}\n\n[data-status='success'] {\n &.qds-icon-background {\n background-color: var(--qds-theme-feedback-result-success);\n }\n\n &.qds-text {\n color: var(--qds-theme-feedback-result-success);\n }\n}\n\n[data-status='warning'].qds-icon-background {\n background-color: var(--qds-theme-feedback-result-partial-success);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, Element, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\nimport type { Size, Status } from '../shared'\n\n/**\n * `<qds-form-message>` elements represent messages for a form field in a user\n * interface.\n *\n * @see https://quartz.se.com/build/components/form-message\n */\n@Component({\n tag: 'qds-form-message',\n shadow: true,\n styleUrl: 'form-message.css',\n})\nexport class FormMessage implements ComponentInterface {\n /**\n * Adds vertical margin to the form message for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * The form message's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The form message's status.\n */\n @Prop() public readonly status?: Status = 'error'\n\n /**\n * Adds accessible text to the icon's form message that will be used by screen readers.\n *\n * @example\n * <qds-form-message status-description=\"Error\" text=\"Password is required.\"></qds-form-message>\n * // This form message will be read by screen readers as \"Error Password is required.\"\n */\n @Prop() public readonly statusDescription?: string\n\n /**\n * The form message's text.\n */\n @Prop() public readonly text?: string\n\n @Element() private readonly host!: HTMLElement\n\n #inheritedAttributes: Attributes = {}\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 #computedStatus(): Status {\n return this.status ?? 'error'\n }\n\n public componentWillLoad(): void {\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-form-message': true,\n 'qds-inline': this.inline,\n }}\n data-size={this.#computedSize}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n >\n <div class=\"qds-icon-container\" data-size={this.#computedSize}>\n <div\n class=\"qds-icon-background\"\n data-size={this.#computedSize}\n data-status={this.status}\n >\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n name={`status-${this.status}`}\n library=\"core\"\n />\n <span class=\"qds-sr-only\">{this.statusDescription}</span>\n </div>\n </div>\n <span class=\"qds-text\" data-status={this.#computedStatus}>\n {this.text}\n </span>\n </span>\n )\n }\n}\n"],"version":3}
|
package/components/qds-icon.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { I as Icon, d as defineCustomElement$1 } from './p-
|
|
6
|
+
import { I as Icon, d as defineCustomElement$1 } from './p-9a9561a8.js';
|
|
7
7
|
|
|
8
8
|
const QdsIcon = Icon;
|
|
9
9
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, c as createEvent, h } from './p-
|
|
7
|
-
import { a as attachInternals, p as pickFocusEventAttributes, g as determineLinkIcon } from './p-
|
|
8
|
-
import { d as defineCustomElement$2 } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-002e77af.js';
|
|
7
|
+
import { a as attachInternals, p as pickFocusEventAttributes, g as determineLinkIcon } from './p-efdb8fa2.js';
|
|
8
|
+
import { d as defineCustomElement$2 } from './p-9a9561a8.js';
|
|
9
9
|
|
|
10
10
|
const inlineLinkCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-start-icon{margin-inline-end:var(--qds-text-icon-gap)}.qds-icon{height:1.25em;vertical-align:text-top;width:1.25em}.qds-end-icon{margin-inline-start:var(--qds-text-icon-gap)}.qds-inline-link{border-radius:var(--qds-focus-border-radius);display:inline-block}.qds-inline-link:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}[data-importance=subdued]{color:var(--qds-theme-link-subdued-default)}[data-importance=subdued]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=subdued]:hover{color:var(--qds-theme-link-subdued-hover)}[data-importance=subdued]:active{color:var(--qds-theme-link-subdued-pressed)}[data-importance=subdued]:visited:hover{color:var(--qds-theme-link-visited-hover)}[data-importance=subdued]:visited:active{color:var(--qds-theme-link-visited-pressed)}[data-importance=standard]{color:var(--qds-theme-link-standard-default)}[data-importance=standard]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=standard]:hover{color:var(--qds-theme-link-standard-hover)}[data-importance=standard]:active{color:var(--qds-theme-link-standard-pressed)}[data-importance=standard]:visited:hover{color:var(--qds-theme-link-visited-hover)}[data-importance=standard]:visited:active{color:var(--qds-theme-link-visited-pressed)}[data-importance=emphasized]{color:var(--qds-theme-link-emphasized-default)}[data-importance=emphasized]:visited{color:var(--qds-theme-link-visited-default)}[data-importance=emphasized]:hover{color:var(--qds-theme-link-emphasized-hover)}[data-importance=emphasized]:active{color:var(--qds-theme-link-emphasized-pressed)}[data-importance=emphasized]:visited:hover{color:var(--qds-theme-link-visited-hover)}[data-importance=emphasized]:visited:active{color:var(--qds-theme-link-visited-pressed)}";
|
|
11
11
|
const QdsInlineLinkStyle0 = inlineLinkCss;
|
|
@@ -29,6 +29,19 @@ const InlineLink = /*@__PURE__*/ proxyCustomElement(class InlineLink extends H {
|
|
|
29
29
|
this.blurEmitter = createEvent(this, "qdsBlur", 2);
|
|
30
30
|
this.focusEmitter = createEvent(this, "qdsFocus", 2);
|
|
31
31
|
_InlineLink_instances.add(this);
|
|
32
|
+
/**
|
|
33
|
+
* Prevents the inline link from being interacted with: it cannot be pressed
|
|
34
|
+
* or focused.
|
|
35
|
+
*/
|
|
36
|
+
this.disabled = false;
|
|
37
|
+
/**
|
|
38
|
+
* The name of a registered icon library.
|
|
39
|
+
*/
|
|
40
|
+
this.iconLibrary = 'default';
|
|
41
|
+
/**
|
|
42
|
+
* The inline link's importance.
|
|
43
|
+
*/
|
|
44
|
+
this.importance = 'standard';
|
|
32
45
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
33
46
|
_InlineLink_internals.set(this, attachInternals.call(this));
|
|
34
47
|
_InlineLink_onBlur.set(this, (event) => {
|
|
@@ -40,18 +53,6 @@ const InlineLink = /*@__PURE__*/ proxyCustomElement(class InlineLink extends H {
|
|
|
40
53
|
_InlineLink_onSlotchange.set(this, () => {
|
|
41
54
|
__classPrivateFieldGet(this, _InlineLink_internals, "f").ariaLabel = this.host.textContent;
|
|
42
55
|
});
|
|
43
|
-
this.disabled = false;
|
|
44
|
-
this.iconName = undefined;
|
|
45
|
-
this.iconLibrary = 'default';
|
|
46
|
-
this.importance = 'standard';
|
|
47
|
-
this.download = undefined;
|
|
48
|
-
this.href = undefined;
|
|
49
|
-
this.hreflang = undefined;
|
|
50
|
-
this.referrerPolicy = undefined;
|
|
51
|
-
this.rel = undefined;
|
|
52
|
-
this.target = undefined;
|
|
53
|
-
this.linkIcon = undefined;
|
|
54
|
-
this.tabIndex = undefined;
|
|
55
56
|
}
|
|
56
57
|
onClick(event) {
|
|
57
58
|
if (this.disabled)
|
|
@@ -80,10 +81,10 @@ const InlineLink = /*@__PURE__*/ proxyCustomElement(class InlineLink extends H {
|
|
|
80
81
|
__classPrivateFieldGet(this, _InlineLink_internals, "f").ariaLabel = this.host.textContent;
|
|
81
82
|
}
|
|
82
83
|
render() {
|
|
83
|
-
return (h("a", { key: '
|
|
84
|
+
return (h("a", { key: '4ad946b79eb34a7f3f10fe5c0ad6a6d65757d3bd', "aria-hidden": "true", class: {
|
|
84
85
|
'qds-inline-link': true,
|
|
85
86
|
'qds-disabled': this.disabled,
|
|
86
|
-
}, "data-importance": __classPrivateFieldGet(this, _InlineLink_instances, "a", _InlineLink_computedImportance_get), download: this.download, href: this.href?.toString(), hrefLang: this.hreflang, onBlur: __classPrivateFieldGet(this, _InlineLink_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _InlineLink_onFocus, "f"), referrerPolicy: this.referrerPolicy, rel: this.rel, tabIndex: this.disabled ? -1 : this.tabIndex, target: this.target }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '
|
|
87
|
+
}, "data-importance": __classPrivateFieldGet(this, _InlineLink_instances, "a", _InlineLink_computedImportance_get), download: this.download, href: this.href?.toString(), hrefLang: this.hreflang, onBlur: __classPrivateFieldGet(this, _InlineLink_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _InlineLink_onFocus, "f"), referrerPolicy: this.referrerPolicy, rel: this.rel, tabIndex: this.disabled ? -1 : this.tabIndex, target: this.target }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { key: '116b8129b5fed5b24fcd4e0ffa45fd88cb7071b3', class: "qds-icon qds-start-icon", library: this.iconLibrary, name: this.iconName })), h("slot", { key: 'c52ff2fa8fccdb5307dddb072f219a8936310638', onSlotchange: __classPrivateFieldGet(this, _InlineLink_onSlotchange, "f") }), this.linkIcon && (h("qds-icon", { key: '9fed2456c0fa30c77c5734145d4ee1e27d780e06', class: "qds-icon qds-end-icon", library: "core", name: this.linkIcon }))));
|
|
87
88
|
}
|
|
88
89
|
static get delegatesFocus() { return true; }
|
|
89
90
|
get host() { return this; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-inline-link.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,+7DAA+7D,CAAC;AACt9D,4BAAe,aAAa;;ACD5B;AACA;AACA;;;;;;;;;MAwCa,UAAU;;;;;;;;;QA2NZ,gCAA+B,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAA;QAyFzD,6BAAU,CAAC,KAAiB;YACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,EAAA;QAEQ,8BAAW,CAAC,KAAiB;YACpC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,EAAA;QAEQ,mCAAgB;YACvB,uBAAA,IAAI,6BAAW,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAA;SAClD,EAAA;wBAzT2C,KAAK;;2BAYH,SAAS;0BAKL,UAAU;;;;;;;;;;IAoNlD,OAAO,CAAC,KAAiB;QACjC,IAAI,IAAI,CAAC,QAAQ;YAAE,KAAK,CAAC,wBAAwB,EAAE,CAAA;KACpD;IAGS,eAAe;QACvB,uBAAA,IAAI,6BAAW,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAA;KACxD;IAGS,eAAe,CAAC,QAAgB;QACxC,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;;;;QAIjD,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAA;KAC5D;IAIS,iBAAiB;QACzB,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;KAC1D;IAEM,iBAAiB;QACtB,uBAAA,IAAI,6BAAW,CAAC,IAAI,GAAG,MAAM,CAAA;QAE7B,IAAI,CAAC,eAAe,EAAE,CAAA;QACtB,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAA;KAChE;IAEM,gBAAgB;QACrB,uBAAA,IAAI,6BAAW,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAA;KAClD;IAEM,MAAM;QACX,QACE,yEACc,MAAM,EAClB,KAAK,EAAE;gBACL,iBAAiB,EAAE,IAAI;gBACvB,cAAc,EAAE,IAAI,CAAC,QAAQ;aAC9B,qBACgB,uBAAA,IAAI,iEAAoB,EACzC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,uBAAA,IAAI,0BAAQ,EACpB,OAAO,EAAE,uBAAA,IAAI,2BAAS,EACtB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,EAC5C,MAAM,EAAE,IAAI,CAAC,MAAM,IAElB,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,EAAE,KAClD,iEACE,KAAK,EAAC,yBAAyB,EAC/B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,IAAI,CAAC,QAAQ,GACnB,CACH,EACD,6DAAM,YAAY,EAAE,uBAAA,IAAI,gCAAc,GAAI,EACzC,IAAI,CAAC,QAAQ,KACZ,iEACE,KAAK,EAAC,uBAAuB,EAC7B,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,IAAI,CAAC,QAAQ,GACnB,CACH,CACC,EACL;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IApFC,QAAQ,IAAI,CAAC,UAAU;QACrB,KAAK,SAAS,CAAC;QACf,KAAK,YAAY,EAAE;YACjB,OAAO,IAAI,CAAC,UAAU,CAAA;SACvB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/inline-link/inline-link.css?tag=qds-inline-link&encapsulation=shadow","src/components/inline-link/inline-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-start-icon {\n margin-inline-end: var(--qds-text-icon-gap);\n}\n\n.qds-icon {\n height: 1.25em;\n vertical-align: text-top;\n width: 1.25em;\n}\n\n.qds-end-icon {\n margin-inline-start: var(--qds-text-icon-gap);\n}\n\n.qds-inline-link {\n border-radius: var(--qds-focus-border-radius);\n display: inline-block;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-link-standard-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\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 Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n attachInternals,\n determineLinkIcon,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, LinkIcon, Target } from '../shared'\n\n/**\n * `<qds-inline-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-inline-link>` *should* indicate the inline link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-inline-link>` element will activate it.\n *\n * @slot Content to display for the inline link.\n * @see https://quartz.se.com/build/components/inline-link\n */\n@Component({\n tag: 'qds-inline-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'inline-link.css',\n})\nexport class InlineLink implements ComponentInterface {\n /**\n * Prevents the inline link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The inline link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the 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 * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: URL | string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the 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<Target, string>\n\n /**\n * Emitted when the inline link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the inline link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLQdsInlineLinkElement\n\n @State() private linkIcon?: LinkIcon\n\n @State() private tabIndex?: number\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n readonly #internals: ElementInternals = attachInternals.call(this)\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) event.stopImmediatePropagation()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.#internals.ariaDisabled = this.disabled.toString()\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n // FIXME: `undefined` instead of `0` causes `qdsFocus/qdsBlur` E2E tests\n // to fail, but it's not clear why this is the case since it works for\n // other components.\n this.tabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Watch('href')\n @Watch('target')\n protected hrefTargetChanged(): void {\n this.linkIcon = determineLinkIcon(this.href, this.target)\n }\n\n public componentWillLoad(): void {\n this.#internals.role = 'link'\n\n this.disabledChanged()\n this.hrefTargetChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.#internals.ariaLabel = this.host.textContent\n }\n\n public render() {\n return (\n <a\n aria-hidden=\"true\"\n class={{\n 'qds-inline-link': true,\n 'qds-disabled': this.disabled,\n }}\n data-importance={this.#computedImportance}\n download={this.download}\n href={this.href?.toString()}\n hrefLang={this.hreflang}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n tabIndex={this.disabled ? -1 : this.tabIndex}\n target={this.target}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon qds-start-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <slot onSlotchange={this.#onSlotchange} />\n {this.linkIcon && (\n <qds-icon\n class=\"qds-icon qds-end-icon\"\n library=\"core\"\n name={this.linkIcon}\n />\n )}\n </a>\n )\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onSlotchange = (): void => {\n this.#internals.ariaLabel = this.host.textContent\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-inline-link.js","mappings":"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","names":[],"sources":["src/components/inline-link/inline-link.css?tag=qds-inline-link&encapsulation=shadow","src/components/inline-link/inline-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-start-icon {\n margin-inline-end: var(--qds-text-icon-gap);\n}\n\n.qds-icon {\n height: 1.25em;\n vertical-align: text-top;\n width: 1.25em;\n}\n\n.qds-end-icon {\n margin-inline-start: var(--qds-text-icon-gap);\n}\n\n.qds-inline-link {\n border-radius: var(--qds-focus-border-radius);\n display: inline-block;\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-importance='subdued'] {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='standard'] {\n color: var(--qds-theme-link-standard-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited {\n color: var(--qds-theme-link-visited-default);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-visited-pressed);\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 Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { QdsFocusEventDetail } from '../../helpers'\nimport {\n attachInternals,\n determineLinkIcon,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, LinkIcon, Target } from '../shared'\n\n/**\n * `<qds-inline-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-inline-link>` *should* indicate the inline link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-inline-link>` element will activate it.\n *\n * @slot Content to display for the inline link.\n * @see https://quartz.se.com/build/components/inline-link\n */\n@Component({\n tag: 'qds-inline-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'inline-link.css',\n})\nexport class InlineLink implements ComponentInterface {\n /**\n * Prevents the inline link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The inline link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the 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 * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: URL | string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the 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<Target, string>\n\n /**\n * Emitted when the inline link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the inline link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private linkIcon?: LinkIcon\n\n @State() private tabIndex?: number\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n readonly #internals: ElementInternals = attachInternals.call(this)\n\n get #computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) event.stopImmediatePropagation()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n this.#internals.ariaDisabled = this.disabled.toString()\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n // FIXME: `undefined` instead of `0` causes `qdsFocus/qdsBlur` E2E tests\n // to fail, but it's not clear why this is the case since it works for\n // other components.\n this.tabIndex = Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Watch('href')\n @Watch('target')\n protected hrefTargetChanged(): void {\n this.linkIcon = determineLinkIcon(this.href, this.target)\n }\n\n public componentWillLoad(): void {\n this.#internals.role = 'link'\n\n this.disabledChanged()\n this.hrefTargetChanged()\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n this.#internals.ariaLabel = this.host.textContent\n }\n\n public render() {\n return (\n <a\n aria-hidden=\"true\"\n class={{\n 'qds-inline-link': true,\n 'qds-disabled': this.disabled,\n }}\n data-importance={this.#computedImportance}\n download={this.download}\n href={this.href?.toString()}\n hrefLang={this.hreflang}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n tabIndex={this.disabled ? -1 : this.tabIndex}\n target={this.target}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon qds-start-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <slot onSlotchange={this.#onSlotchange} />\n {this.linkIcon && (\n <qds-icon\n class=\"qds-icon qds-end-icon\"\n library=\"core\"\n name={this.linkIcon}\n />\n )}\n </a>\n )\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onSlotchange = (): void => {\n this.#internals.ariaLabel = this.host.textContent\n }\n}\n"],"version":3}
|
package/components/qds-input.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { p as proxyCustomElement, H, c as createEvent, h } from './p-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { d as defineCustomElement$6 } from './p-
|
|
10
|
-
import { d as defineCustomElement$5 } from './p-
|
|
11
|
-
import { d as defineCustomElement$4 } from './p-
|
|
12
|
-
import { d as defineCustomElement$3 } from './p-
|
|
13
|
-
import { d as defineCustomElement$2 } from './p-
|
|
6
|
+
import { p as proxyCustomElement, H, c as createEvent, h } from './p-002e77af.js';
|
|
7
|
+
import { c as invariant, p as pickFocusEventAttributes, h as pickInputEventAttributes, i as inheritAriaAttributes } from './p-efdb8fa2.js';
|
|
8
|
+
import { V as VALID_STATE, C as CUSTOM_ERROR_FLAGS, N as NO_ERROR_FLAGS } from './p-d107c90c.js';
|
|
9
|
+
import { d as defineCustomElement$6 } from './p-86a0fdf3.js';
|
|
10
|
+
import { d as defineCustomElement$5 } from './p-2e88c3cc.js';
|
|
11
|
+
import { d as defineCustomElement$4 } from './p-786e2b51.js';
|
|
12
|
+
import { d as defineCustomElement$3 } from './p-9a9561a8.js';
|
|
13
|
+
import { d as defineCustomElement$2 } from './p-ae6eda4e.js';
|
|
14
14
|
|
|
15
|
-
const inputCss = ":host([hidden]){display:none!important}:host{display:inline-block}@-moz-document url-prefix(){[type=date]~.qds-icon-container,[type=datetime-local]~.qds-icon-container,[type=month]~.qds-icon-container,[type=time]~.qds-icon-container,[type=week]~.qds-icon-container{display:none}}.qds-container,.qds-input{width:inherit}.qds-container{align-content:flex-start;align-items:center;box-sizing:border-box;display:grid;grid-template-areas:\"g\"}.qds-icon{--qds-theme-interactive-background-hover:none;--qds-theme-interactive-background-pressed:none;--qds-control-small-height:var(--qds-control-small-icon-size);flex-shrink:0}.qds-icon-container,.qds-input{grid-area:g}.qds-icon-container{align-items:center;display:flex;justify-content:center;justify-self:end;padding-inline-end:var(--qds-control-input-padding-horizontal)}.qds-icon-container.no-padding{padding-inline-end:0}.qds-focus-ring{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n ));grid-area:g;height:calc(100% + var(--qds-control-border-width) - var(--qds-control-border-width-block-end, var(--qds-control-border-width)));isolation:isolate;outline:var(--qds-control-input-focus-border-width) solid var(--qds-theme-control-input-focus-border);pointer-events:none;visibility:hidden;width:calc(100% + var(--qds-control-border-width) - var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n ))}[data-size=small]{font:var(--qds-control-small-text);height:var(--qds-control-small-height)}.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)}[data-size=small]~.qds-icon-container{gap:var(--qds-control-small-gap-internal);margin-inline-start:var(--qds-control-small-gap-internal)}[data-size=small][type=date],[data-size=small][type=datetime-local],[data-size=small][type=email],[data-size=small][type=month],[data-size=small][type=tel],[data-size=small][type=time],[data-size=small][type=url],[data-size=small][type=week]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-input-padding-horizontal) + var(--qds-control-small-height))}[data-size=small][type=file]::file-selector-button{font:var(--qds-control-small-text);height:var(--qds-control-small-height);margin-inline-end:var(--qds-control-small-gap-siblings-related);padding-inline:var(--qds-control-button-small-padding-horizontal)}[data-size=small][type=number]::-webkit-inner-spin-button,[data-size=small][type=number]::-webkit-outer-spin-button{margin-inline-start:var(--qds-control-small-gap-internal)}[data-size=small][type=search]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-small-height) + var(--qds-control-small-icon-size) + var(--qds-control-input-padding-horizontal) + var(--qds-control-small-gap-internal))}[data-size=standard]{font:var(--qds-control-standard-text);height:var(--qds-control-standard-height)}.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)}[data-size=standard]~.qds-icon-container{gap:var(--qds-control-standard-gap-internal);margin-inline-start:var(--qds-control-standard-gap-internal)}[data-size=standard][type=date],[data-size=standard][type=datetime-local],[data-size=standard][type=email],[data-size=standard][type=month],[data-size=standard][type=tel],[data-size=standard][type=time],[data-size=standard][type=url],[data-size=standard][type=week]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-input-padding-horizontal) + var(--qds-control-standard-height))}[data-size=standard][type=file]::file-selector-button{font:var(--qds-control-standard-text);height:var(--qds-control-standard-height);margin-inline-end:var(--qds-control-standard-gap-siblings-related);padding-inline:var(--qds-control-button-standard-padding-horizontal)}[data-size=standard][type=number]::-webkit-inner-spin-button,[data-size=standard][type=number]::-webkit-outer-spin-button{margin-inline-start:var(--qds-control-standard-gap-internal)}[data-size=standard][type=search]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-small-height) + var(--qds-control-standard-icon-size) + var(--qds-control-input-padding-horizontal) + var(--qds-control-standard-gap-internal))}[data-size=large]{font:var(--qds-control-large-text);height:var(--qds-control-large-height)}.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)}[data-size=large]~.qds-icon-container{gap:var(--qds-control-large-gap-internal);margin-inline-start:var(--qds-control-large-gap-internal)}[data-size=large][type=date],[data-size=large][type=datetime-local],[data-size=large][type=email],[data-size=large][type=month],[data-size=large][type=tel],[data-size=large][type=time],[data-size=large][type=url],[data-size=large][type=week]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-input-padding-horizontal) + var(--qds-control-large-height))}[data-size=large][type=file]::file-selector-button{font:var(--qds-control-large-text);height:var(--qds-control-large-height);margin-inline-end:var(--qds-control-large-gap-siblings-related);padding-inline:var(--qds-control-button-large-padding-horizontal)}[data-size=large][type=number]::-webkit-inner-spin-button,[data-size=large][type=number]::-webkit-outer-spin-button{margin-inline-start:var(--qds-control-large-gap-internal)}[data-size=large][type=search]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-small-height) + var(--qds-control-large-icon-size) + var(--qds-control-input-padding-horizontal) + var(--qds-control-large-gap-internal))}.qds-input{-webkit-appearance:textfield;appearance:textfield;background-color:var(--qds-theme-control-input-background);border-color:var(--qds-theme-control-border);border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n ) var(--qds-control-border-radius-top-right,var(--qds-control-border-radius)) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n );border-style:solid;border-width:var(--qds-control-border-width) var(--qds-control-border-width-inline-end,var(--qds-control-border-width)) var(--qds-control-border-width-block-end,var(--qds-control-border-width)) var(--qds-control-border-width);box-sizing:border-box;color:var(--qds-theme-control-text-standard);grid-area:g;padding-block:0;padding-inline:var(--qds-control-input-padding-horizontal)}.qds-input.qds-hide~.qds-icon-container{display:none}.qds-input:disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-input:focus-visible{outline:none}.qds-input:focus-visible~.qds-focus-ring{visibility:visible}.qds-input:placeholder-shown{color:var(--qds-theme-control-text-placeholder)}.qds-input[aria-invalid=true]:not(:focus){border-color:var(--qds-theme-feedback-result-failure)}.qds-input::-webkit-search-cancel-button,.qds-input:is([type=date],[type=datetime-local],[type=month],[type=time],[type=week])::-webkit-calendar-picker-indicator{cursor:pointer;display:none}.qds-input[type=file]{padding-block:var(--qds-control-input-padding-horizontal)}.qds-input[type=file]::file-selector-button{background-color:initial;border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-border-radius);color:var(--qds-theme-control-text-standard)}.qds-input[type=file]::file-selector-button:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-input[type=file]::file-selector-button:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-input[type=color],.qds-input[type=number],.qds-input[type=password],.qds-input[type=text]{padding-inline:var(--qds-control-input-padding-horizontal)}.qds-input[type=color]{-webkit-appearance:none;appearance:none;cursor:pointer;min-width:50px;padding-block:var(--qds-control-input-padding-horizontal)}.qds-input[type=color]::-webkit-color-swatch-wrapper{padding:0}.qds-input[type=color]::-webkit-color-swatch{border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-border-radius)}.qds-input[type=color]::-moz-color-swatch{border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-border-radius)}.qds-input[type=color]:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-input[type=color]:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-input.qds-search-padding[data-size=large],.qds-input.qds-search-padding[data-size=small],.qds-input.qds-search-padding[data-size=standard]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-small-height) + var(--qds-control-input-padding-horizontal))}.qds-input[data-size=large][type=file],.qds-input[data-size=small][type=file],.qds-input[data-size=standard][type=file]{height:auto}.qds-input.qds-padding[data-size=large],.qds-input.qds-padding[data-size=small],.qds-input.qds-padding[data-size=standard]{padding-inline:var(--qds-control-input-padding-horizontal)}.qds-input[data-size=large],.qds-input[data-size=small],.qds-input[data-size=standard]{@-moz-document url-prefix(){&[type=date],&[type=datetime-local],&[type=month],&[type=time],&[type=week]{padding-inline-end:var(--qds-control-input-padding-horizontal)}}}.qds-input{@-moz-document url-prefix(){&[type=number]{appearance:none}}}";
|
|
15
|
+
const inputCss = ":host([hidden]){display:none!important}:host{display:inline-block}@-moz-document url-prefix(){[type=date]~.qds-icon-container,[type=datetime-local]~.qds-icon-container,[type=month]~.qds-icon-container,[type=time]~.qds-icon-container,[type=week]~.qds-icon-container{display:none}}.qds-container,.qds-input{width:inherit}.qds-container{align-content:flex-start;align-items:center;box-sizing:border-box;display:grid;grid-template-areas:\"c\"}.qds-icon{--qds-theme-interactive-background-hover:none;--qds-theme-interactive-background-pressed:none;--qds-control-small-height:var(--qds-control-small-icon-size);flex-shrink:0}.qds-icon-container,.qds-input{grid-area:c}.qds-icon-container{align-items:center;display:flex;justify-content:center;justify-self:end;padding-inline-end:var(--qds-control-input-padding-horizontal)}.qds-icon-container.no-padding{padding-inline-end:0}.qds-focus-ring{border-radius:max(1px,var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-top-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n )) max(1px,var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n ));grid-area:c;height:calc(100% + var(--qds-control-border-width) - var(--qds-control-border-width-block-end, var(--qds-control-border-width)));isolation:isolate;outline:var(--qds-control-input-focus-border-width) solid var(--qds-theme-control-input-focus-border);pointer-events:none;visibility:hidden;width:calc(100% + var(--qds-control-border-width) - var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n ))}[data-size=small]{font:var(--qds-control-small-text);height:var(--qds-control-small-height)}.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)}[data-size=small]~.qds-icon-container{gap:var(--qds-control-small-gap-internal);margin-inline-start:var(--qds-control-small-gap-internal)}[data-size=small][type=date],[data-size=small][type=datetime-local],[data-size=small][type=email],[data-size=small][type=month],[data-size=small][type=tel],[data-size=small][type=time],[data-size=small][type=url],[data-size=small][type=week]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-input-padding-horizontal) + var(--qds-control-small-height))}[data-size=small][type=file]::file-selector-button{font:var(--qds-control-small-text);height:var(--qds-control-small-height);margin-inline-end:var(--qds-control-small-gap-siblings-related);padding-inline:var(--qds-control-button-small-padding-horizontal)}[data-size=small][type=number]::-webkit-inner-spin-button,[data-size=small][type=number]::-webkit-outer-spin-button{margin-inline-start:var(--qds-control-small-gap-internal)}[data-size=small][type=search]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-small-height) + var(--qds-control-small-icon-size) + var(--qds-control-input-padding-horizontal) + var(--qds-control-small-gap-internal))}[data-size=standard]{font:var(--qds-control-standard-text);height:var(--qds-control-standard-height)}.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)}[data-size=standard]~.qds-icon-container{gap:var(--qds-control-standard-gap-internal);margin-inline-start:var(--qds-control-standard-gap-internal)}[data-size=standard][type=date],[data-size=standard][type=datetime-local],[data-size=standard][type=email],[data-size=standard][type=month],[data-size=standard][type=tel],[data-size=standard][type=time],[data-size=standard][type=url],[data-size=standard][type=week]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-input-padding-horizontal) + var(--qds-control-standard-height))}[data-size=standard][type=file]::file-selector-button{font:var(--qds-control-standard-text);height:var(--qds-control-standard-height);margin-inline-end:var(--qds-control-standard-gap-siblings-related);padding-inline:var(--qds-control-button-standard-padding-horizontal)}[data-size=standard][type=number]::-webkit-inner-spin-button,[data-size=standard][type=number]::-webkit-outer-spin-button{margin-inline-start:var(--qds-control-standard-gap-internal)}[data-size=standard][type=search]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-small-height) + var(--qds-control-standard-icon-size) + var(--qds-control-input-padding-horizontal) + var(--qds-control-standard-gap-internal))}[data-size=large]{font:var(--qds-control-large-text);height:var(--qds-control-large-height)}.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)}[data-size=large]~.qds-icon-container{gap:var(--qds-control-large-gap-internal);margin-inline-start:var(--qds-control-large-gap-internal)}[data-size=large][type=date],[data-size=large][type=datetime-local],[data-size=large][type=email],[data-size=large][type=month],[data-size=large][type=tel],[data-size=large][type=time],[data-size=large][type=url],[data-size=large][type=week]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-input-padding-horizontal) + var(--qds-control-large-height))}[data-size=large][type=file]::file-selector-button{font:var(--qds-control-large-text);height:var(--qds-control-large-height);margin-inline-end:var(--qds-control-large-gap-siblings-related);padding-inline:var(--qds-control-button-large-padding-horizontal)}[data-size=large][type=number]::-webkit-inner-spin-button,[data-size=large][type=number]::-webkit-outer-spin-button{margin-inline-start:var(--qds-control-large-gap-internal)}[data-size=large][type=search]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-small-height) + var(--qds-control-large-icon-size) + var(--qds-control-input-padding-horizontal) + var(--qds-control-large-gap-internal))}.qds-input{-webkit-appearance:textfield;appearance:textfield;background-color:var(--qds-theme-control-input-background);border-color:var(--qds-theme-control-border);border-radius:var(\n --qds-control-border-radius-top-left,var(--qds-control-border-radius)\n ) var(--qds-control-border-radius-top-right,var(--qds-control-border-radius)) var(\n --qds-control-border-radius-bottom-right,var(--qds-control-border-radius)\n ) var(\n --qds-control-border-radius-bottom-left,var(--qds-control-border-radius)\n );border-style:solid;border-width:var(--qds-control-border-width) var(--qds-control-border-width-inline-end,var(--qds-control-border-width)) var(--qds-control-border-width-block-end,var(--qds-control-border-width)) var(--qds-control-border-width);box-sizing:border-box;color:var(--qds-theme-control-text-standard);grid-area:c;padding-block:0;padding-inline:var(--qds-control-input-padding-horizontal)}.qds-input.qds-hide~.qds-icon-container{display:none}.qds-input:disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-input:focus-visible{outline:none}.qds-input:focus-visible~.qds-focus-ring{visibility:visible}.qds-input:placeholder-shown{color:var(--qds-theme-control-text-placeholder)}.qds-input:not(:focus):user-invalid{border-color:var(--qds-theme-feedback-result-failure)}.qds-input::-webkit-search-cancel-button,.qds-input:is([type=date],[type=datetime-local],[type=month],[type=time],[type=week])::-webkit-calendar-picker-indicator{cursor:pointer;display:none}.qds-input[type=file]{padding-block:var(--qds-control-input-padding-horizontal)}.qds-input[type=file]::file-selector-button{background-color:initial;border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-border-radius);color:var(--qds-theme-control-text-standard)}.qds-input[type=file]::file-selector-button:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-input[type=file]::file-selector-button:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-input[type=color],.qds-input[type=number],.qds-input[type=password],.qds-input[type=text]{padding-inline:var(--qds-control-input-padding-horizontal)}.qds-input[type=color]{-webkit-appearance:none;appearance:none;cursor:pointer;min-width:50px;padding-block:var(--qds-control-input-padding-horizontal)}.qds-input[type=color]::-webkit-color-swatch-wrapper{padding:0}.qds-input[type=color]::-webkit-color-swatch{border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-border-radius)}.qds-input[type=color]::-moz-color-swatch{border:var(--qds-control-border-width) solid var(--qds-theme-control-border);border-radius:var(--qds-control-border-radius)}.qds-input[type=color]:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-input[type=color]:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-input.qds-search-padding[data-size=large],.qds-input.qds-search-padding[data-size=small],.qds-input.qds-search-padding[data-size=standard]{padding-inline:var(--qds-control-input-padding-horizontal) calc(var(--qds-control-small-height) + var(--qds-control-input-padding-horizontal))}.qds-input[data-size=large][type=file],.qds-input[data-size=small][type=file],.qds-input[data-size=standard][type=file]{height:auto}.qds-input.qds-padding[data-size=large],.qds-input.qds-padding[data-size=small],.qds-input.qds-padding[data-size=standard]{padding-inline:var(--qds-control-input-padding-horizontal)}.qds-input[data-size=large],.qds-input[data-size=small],.qds-input[data-size=standard]{@-moz-document url-prefix(){&[type=date],&[type=datetime-local],&[type=month],&[type=time],&[type=week]{padding-inline-end:var(--qds-control-input-padding-horizontal)}}}.qds-input{@-moz-document url-prefix(){&[type=number]{appearance:none}}}";
|
|
16
16
|
const QdsInputStyle0 = inputCss;
|
|
17
17
|
|
|
18
18
|
// SPDX-FileCopyrightText: © 2024 Schneider Electric
|
|
@@ -47,16 +47,118 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends H {
|
|
|
47
47
|
this.inputEmitter = createEvent(this, "qdsInput", 6);
|
|
48
48
|
this.internals = this.attachInternals();
|
|
49
49
|
_Input_instances.add(this);
|
|
50
|
+
/**
|
|
51
|
+
* Hide the input type's icon.
|
|
52
|
+
*
|
|
53
|
+
* > **_NOTE:_** Due to browser limitations, the icon may not be hidden in
|
|
54
|
+
* all browsers.
|
|
55
|
+
*/
|
|
56
|
+
this.noIcon = false;
|
|
57
|
+
/**
|
|
58
|
+
* The input's size.
|
|
59
|
+
*
|
|
60
|
+
* > **_NOTE:_** The native [`size` HTML attribute][size] is not supported.
|
|
61
|
+
* CSS `width` should be used instead if this functionality is needed.
|
|
62
|
+
*
|
|
63
|
+
* [size]: https://developer.mozilla.org/docs/Web/HTML/Attributes/size
|
|
64
|
+
*/
|
|
65
|
+
this.size = 'standard';
|
|
66
|
+
/**
|
|
67
|
+
* Returns a file list for a `file` type input.
|
|
68
|
+
*
|
|
69
|
+
* @readonly
|
|
70
|
+
* @webnative
|
|
71
|
+
*/
|
|
72
|
+
// eslint-disable-next-line unicorn/no-null
|
|
73
|
+
this.files = null;
|
|
74
|
+
/**
|
|
75
|
+
* The [`<form>`][] element to associate the input with (its form owner).
|
|
76
|
+
*
|
|
77
|
+
* The value of this attribute must be the id of a `<form>` in the same
|
|
78
|
+
* document. If this attribute is not set, the `<qds-input>` is associated
|
|
79
|
+
* with its ancestor `<form>` element, if any.
|
|
80
|
+
*
|
|
81
|
+
* This attribute lets you associate `<qds-input>` elements to `<form>`s
|
|
82
|
+
* anywhere in the document, not just inside a `<form>`. It can also override
|
|
83
|
+
* an ancestor `<form>` element.
|
|
84
|
+
*
|
|
85
|
+
* [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form
|
|
86
|
+
*
|
|
87
|
+
* @readonly
|
|
88
|
+
* @webnative
|
|
89
|
+
*/
|
|
90
|
+
// eslint-disable-next-line unicorn/no-null
|
|
91
|
+
this.form = null;
|
|
92
|
+
/**
|
|
93
|
+
* Returns a list of the [`<label>`][] elements associated with the
|
|
94
|
+
* `qds-input` element.
|
|
95
|
+
*
|
|
96
|
+
* [`<label>`]: https://developer.mozilla.org/docs/Web/HTML/Element/label
|
|
97
|
+
*
|
|
98
|
+
* @readonly
|
|
99
|
+
* @webnative
|
|
100
|
+
*/
|
|
101
|
+
this.labels = {};
|
|
102
|
+
/**
|
|
103
|
+
* Get or set the selection direction of a text selection.
|
|
104
|
+
*
|
|
105
|
+
* > **_NOTE:_** This property has no effect when used as an attribute.
|
|
106
|
+
*
|
|
107
|
+
* @webnative
|
|
108
|
+
*/
|
|
109
|
+
this.selectionDirection = null;
|
|
110
|
+
/**
|
|
111
|
+
* Get or set the ending position or offset of a text selection.
|
|
112
|
+
*
|
|
113
|
+
* > **_NOTE:_** This property has no effect when used as an attribute.
|
|
114
|
+
*
|
|
115
|
+
* @webnative
|
|
116
|
+
*/
|
|
117
|
+
this.selectionEnd = null;
|
|
118
|
+
/**
|
|
119
|
+
* Get or set the starting position or offset of a text selection.
|
|
120
|
+
*
|
|
121
|
+
* > **_NOTE:_** This property has no effect when used as an attribute.
|
|
122
|
+
*
|
|
123
|
+
* @webnative
|
|
124
|
+
*/
|
|
125
|
+
this.selectionStart = null;
|
|
126
|
+
/**
|
|
127
|
+
* The error message that would be shown to the user if the `<qds-select>`
|
|
128
|
+
* was to be checked for validity.
|
|
129
|
+
*
|
|
130
|
+
* @readonly
|
|
131
|
+
* @webnative
|
|
132
|
+
*/
|
|
133
|
+
this.validationMessage = '';
|
|
134
|
+
/**
|
|
135
|
+
* The [`ValidityState`][] object for this `<qds-select>`.
|
|
136
|
+
*
|
|
137
|
+
* [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState
|
|
138
|
+
*
|
|
139
|
+
* @readonly
|
|
140
|
+
* @webnative
|
|
141
|
+
*/
|
|
142
|
+
this.validity = VALID_STATE;
|
|
143
|
+
/**
|
|
144
|
+
* True if `<qds-input>` will be validated when the form is submitted; false
|
|
145
|
+
* otherwise.
|
|
146
|
+
*
|
|
147
|
+
* @readonly
|
|
148
|
+
* @webnative
|
|
149
|
+
*/
|
|
150
|
+
this.willValidate = false;
|
|
50
151
|
_Input_inheritedAttributes.set(this, {});
|
|
51
152
|
_Input_input.set(this, void 0);
|
|
52
153
|
this.checkValidity = () => this.internals.checkValidity();
|
|
53
154
|
this.reportValidity = () => this.internals.reportValidity();
|
|
54
155
|
this.setCustomValidity = (error) => {
|
|
156
|
+
invariant(__classPrivateFieldGet(this, _Input_input, "f"));
|
|
157
|
+
__classPrivateFieldGet(this, _Input_input, "f").setCustomValidity(error);
|
|
55
158
|
if (error)
|
|
56
159
|
this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, __classPrivateFieldGet(this, _Input_input, "f"));
|
|
57
160
|
else
|
|
58
161
|
this.internals.setValidity(NO_ERROR_FLAGS);
|
|
59
|
-
this.invalid = !!error;
|
|
60
162
|
};
|
|
61
163
|
this.select = () => {
|
|
62
164
|
invariant(__classPrivateFieldGet(this, _Input_input, "f"));
|
|
@@ -128,40 +230,6 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends H {
|
|
|
128
230
|
this.value = __classPrivateFieldGet(this, _Input_input, "f").value;
|
|
129
231
|
this.inputEmitter.emit(pickInputEventAttributes(event));
|
|
130
232
|
});
|
|
131
|
-
this.noIcon = false;
|
|
132
|
-
this.size = 'standard';
|
|
133
|
-
this.accept = undefined;
|
|
134
|
-
this.autoCapitalize = undefined;
|
|
135
|
-
this.autoComplete = undefined;
|
|
136
|
-
this.autoFocus = undefined;
|
|
137
|
-
this.capture = undefined;
|
|
138
|
-
this.disabled = undefined;
|
|
139
|
-
this.enterkeyhint = undefined;
|
|
140
|
-
this.files = null;
|
|
141
|
-
this.form = null;
|
|
142
|
-
this.inputmode = undefined;
|
|
143
|
-
this.labels = {};
|
|
144
|
-
this.max = undefined;
|
|
145
|
-
this.maxLength = undefined;
|
|
146
|
-
this.min = undefined;
|
|
147
|
-
this.minLength = undefined;
|
|
148
|
-
this.multiple = undefined;
|
|
149
|
-
this.name = undefined;
|
|
150
|
-
this.pattern = undefined;
|
|
151
|
-
this.placeholder = undefined;
|
|
152
|
-
this.required = undefined;
|
|
153
|
-
this.selectionDirection = null;
|
|
154
|
-
this.selectionEnd = null;
|
|
155
|
-
this.selectionStart = null;
|
|
156
|
-
this.spellCheck = undefined;
|
|
157
|
-
this.step = undefined;
|
|
158
|
-
this.type = undefined;
|
|
159
|
-
this.validationMessage = '';
|
|
160
|
-
this.validity = VALID_STATE;
|
|
161
|
-
this.value = undefined;
|
|
162
|
-
this.willValidate = false;
|
|
163
|
-
this.invalid = false;
|
|
164
|
-
this.tabIndex = undefined;
|
|
165
233
|
}
|
|
166
234
|
onClick(event) {
|
|
167
235
|
if (__classPrivateFieldGet(this, _Input_instances, "a", _Input_computedDisabled_get))
|
|
@@ -227,7 +295,6 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends H {
|
|
|
227
295
|
this.internals.setValidity(NO_ERROR_FLAGS, undefined, __classPrivateFieldGet(this, _Input_input, "f"));
|
|
228
296
|
else
|
|
229
297
|
this.internals.setValidity(__classPrivateFieldGet(this, _Input_input, "f").validity, __classPrivateFieldGet(this, _Input_input, "f").validationMessage, __classPrivateFieldGet(this, _Input_input, "f"));
|
|
230
|
-
this.invalid = !valid;
|
|
231
298
|
}
|
|
232
299
|
valueChanged() {
|
|
233
300
|
if (!__classPrivateFieldGet(this, _Input_instances, "a", _Input_computedDisabled_get))
|
|
@@ -263,20 +330,20 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends H {
|
|
|
263
330
|
const shouldShowSearchIcon = isSearchType && this.noIcon === false;
|
|
264
331
|
const shouldHideIcon = !isSearchType && this.noIcon === true;
|
|
265
332
|
const shouldRemoveSearchPadding = isSearchType && this.noIcon === true;
|
|
266
|
-
return (h("div", { key: '
|
|
333
|
+
return (h("div", { key: 'd919d48e7457a59abb12230018839ab32e7561d5', class: "qds-container" }, h("input", { key: '33dbf1b2e1f36297b11ce09e86a86c4741499e3b', accept: this.accept, autoCapitalize: this.host.autocapitalize, autoComplete: this.autoComplete,
|
|
267
334
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
268
|
-
autoFocus: this.
|
|
335
|
+
autoFocus: this.host.autofocus, capture: this.capture, class: {
|
|
269
336
|
'qds-search-padding': shouldRemoveSearchPadding,
|
|
270
337
|
'qds-input': true,
|
|
271
338
|
'qds-hide': shouldHideIcon,
|
|
272
339
|
'qds-padding': shouldHideIcon,
|
|
273
|
-
}, "data-size": __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedSize_get), disabled: this.disabled, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, max: this.max, maxLength: this.maxLength, min: this.min, minLength: this.minLength, multiple: this.multiple, onBlur: __classPrivateFieldGet(this, _Input_onBlur, "f"), onChange: __classPrivateFieldGet(this, _Input_onChange, "f"), onFocus: __classPrivateFieldGet(this, _Input_onFocus, "f"), onInput: __classPrivateFieldGet(this, _Input_onInput, "f"), placeholder: this.placeholder, ref: __classPrivateFieldGet(this, _Input_ref, "f"), spellcheck: this.
|
|
340
|
+
}, "data-size": __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedSize_get), disabled: this.disabled, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, max: this.max, maxLength: this.maxLength, min: this.min, minLength: this.minLength, multiple: this.multiple, onBlur: __classPrivateFieldGet(this, _Input_onBlur, "f"), onChange: __classPrivateFieldGet(this, _Input_onChange, "f"), onFocus: __classPrivateFieldGet(this, _Input_onFocus, "f"), onInput: __classPrivateFieldGet(this, _Input_onInput, "f"), placeholder: this.placeholder, ref: __classPrivateFieldGet(this, _Input_ref, "f"), spellcheck: this.host.spellcheck, step: this.step, tabIndex: __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedDisabled_get) ? undefined : this.tabIndex, type: this.type, ...__classPrivateFieldGet(this, _Input_inheritedAttributes, "f") }), h("div", { key: '120369214c587e1c9e785d989159b21e95de3452', class: "qds-focus-ring" }), __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedIconName_get) && (h("div", { key: '982a623c1fe1fc88717d9401cc9c99fa297c2c50', class: {
|
|
274
341
|
'qds-icon-container': true,
|
|
275
342
|
'no-padding': shouldRemoveSearchPadding,
|
|
276
|
-
} }, shouldShowClearButton && (h("qds-button", { key: '
|
|
343
|
+
} }, shouldShowClearButton && (h("qds-button", { key: '4f8c261146474c0fbdcd49397db52db940389c1d', "aria-label": "clear input", disabled: this.disabled, importance: "subdued", "icon-library": "core", "icon-name": "clear", class: {
|
|
277
344
|
'qds-icon': true,
|
|
278
345
|
'qds-hide': !hasValue,
|
|
279
|
-
}, size: "small", onClick: __classPrivateFieldGet(this, _Input_onClear, "f") })), __classPrivateFieldGet(this, _Input_instances, "a", _Input_hasIcon_get) && (h("qds-icon", { key: '
|
|
346
|
+
}, size: "small", onClick: __classPrivateFieldGet(this, _Input_onClear, "f") })), __classPrivateFieldGet(this, _Input_instances, "a", _Input_hasIcon_get) && (h("qds-icon", { key: '697e8a6f746ae7864178ad04e6a5f16b6f0d7ccb', "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedSize_get), library: "core", name: __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedIconName_get) })), __classPrivateFieldGet(this, _Input_instances, "a", _Input_hasInteractiveIcon_get) && (h("qds-button", { key: '2df9303e4a2e6509230cb7847ce8b62a169da716', "aria-label": this.type, disabled: this.disabled, importance: "subdued", "icon-library": "core", "icon-name": __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedIconName_get), class: "qds-icon", size: "small", onClick: this.showPicker })), shouldShowSearchIcon ? (h("qds-icon", { "aria-hidden": "true", class: "qds-icon", "data-size": __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedSize_get), library: "core", name: __classPrivateFieldGet(this, _Input_instances, "a", _Input_computedIconName_get) })) : (h("div", null))))));
|
|
280
347
|
}
|
|
281
348
|
static get delegatesFocus() { return true; }
|
|
282
349
|
static get formAssociated() { return true; }
|
|
@@ -302,9 +369,7 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends H {
|
|
|
302
369
|
"noIcon": [4, "no-icon"],
|
|
303
370
|
"size": [1],
|
|
304
371
|
"accept": [1],
|
|
305
|
-
"autoCapitalize": [1, "autocapitalize"],
|
|
306
372
|
"autoComplete": [1, "autocomplete"],
|
|
307
|
-
"autoFocus": [4, "autofocus"],
|
|
308
373
|
"capture": [1],
|
|
309
374
|
"disabled": [4],
|
|
310
375
|
"enterkeyhint": [1],
|
|
@@ -324,14 +389,12 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends H {
|
|
|
324
389
|
"selectionDirection": [1025, "selection-direction"],
|
|
325
390
|
"selectionEnd": [1026, "selection-end"],
|
|
326
391
|
"selectionStart": [1026, "selection-start"],
|
|
327
|
-
"spellCheck": [4, "spellcheck"],
|
|
328
392
|
"step": [8],
|
|
329
393
|
"type": [1],
|
|
330
394
|
"validationMessage": [1, "validation-message"],
|
|
331
395
|
"validity": [16],
|
|
332
396
|
"value": [1032],
|
|
333
397
|
"willValidate": [4, "will-validate"],
|
|
334
|
-
"invalid": [32],
|
|
335
398
|
"tabIndex": [32]
|
|
336
399
|
}, [[0, "click", "onClick"], [0, "keydown", "onKeydown"]], {
|
|
337
400
|
"disabled": ["disabledChanged"],
|