@quartzds/core 1.0.0-beta.9 → 1.0.0-beta.91
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/README.md +5 -5
- package/components/index.d.ts +48 -0
- package/components/index.js +60 -28
- package/components/index.js.map +1 -1
- package/components/p-2806fee1.js +1887 -0
- package/components/p-2806fee1.js.map +1 -0
- package/components/p-2bf0797c.js +272 -0
- package/components/p-2bf0797c.js.map +1 -0
- package/components/p-3baf75f4.js +111 -0
- package/components/p-3baf75f4.js.map +1 -0
- package/components/p-3c48ff53.js +103 -0
- package/components/p-3c48ff53.js.map +1 -0
- package/components/p-8abba29b.js +204 -0
- package/components/p-8abba29b.js.map +1 -0
- package/components/p-a020ece3.js +142 -0
- package/components/p-a020ece3.js.map +1 -0
- package/components/p-a6310886.js +144 -0
- package/components/p-a6310886.js.map +1 -0
- package/components/p-b4c302d4.js +91 -0
- package/components/p-b4c302d4.js.map +1 -0
- package/components/p-ba880369.js +256 -0
- package/components/p-ba880369.js.map +1 -0
- package/components/p-c80f112a.js +408 -0
- package/components/p-c80f112a.js.map +1 -0
- package/components/p-d107c90c.js +27 -0
- package/components/p-d107c90c.js.map +1 -0
- package/components/p-d6e52d0b.js +404 -0
- package/components/p-d6e52d0b.js.map +1 -0
- package/components/{floating-ui.dom.esm.js → p-fdd0abae.js} +468 -416
- package/components/p-fdd0abae.js.map +1 -0
- package/components/p-fed0d11f.js +94 -0
- package/components/p-fed0d11f.js.map +1 -0
- package/components/qds-badge-counter.d.ts +11 -0
- package/components/qds-badge-counter.js +13 -0
- package/components/qds-badge-counter.js.map +1 -0
- package/components/qds-badge-indicator.d.ts +11 -0
- package/components/qds-badge-indicator.js +13 -0
- package/components/qds-badge-indicator.js.map +1 -0
- package/components/qds-breadcrumb-item.d.ts +11 -0
- package/components/qds-breadcrumb-item.js +126 -0
- package/components/qds-breadcrumb-item.js.map +1 -0
- package/components/qds-button.d.ts +2 -2
- package/components/qds-button.js +3 -138
- package/components/qds-button.js.map +1 -1
- package/components/qds-checkbox.d.ts +2 -2
- package/components/qds-checkbox.js +3 -146
- package/components/qds-checkbox.js.map +1 -1
- package/components/qds-chip.d.ts +11 -0
- package/components/qds-chip.js +296 -0
- package/components/qds-chip.js.map +1 -0
- package/components/qds-dialog.d.ts +11 -0
- package/components/qds-dialog.js +126 -0
- package/components/qds-dialog.js.map +1 -0
- package/components/qds-divider.d.ts +2 -2
- package/components/qds-divider.js +3 -39
- package/components/qds-divider.js.map +1 -1
- package/components/qds-dropdown.d.ts +2 -2
- package/components/qds-dropdown.js +273 -239
- package/components/qds-dropdown.js.map +1 -1
- package/components/qds-form-message.d.ts +11 -0
- package/components/qds-form-message.js +112 -0
- package/components/qds-form-message.js.map +1 -0
- package/components/qds-icon.d.ts +2 -2
- package/components/qds-icon.js +3 -3
- package/components/qds-inline-link.d.ts +2 -2
- package/components/qds-inline-link.js +136 -73
- package/components/qds-inline-link.js.map +1 -1
- package/components/qds-input.d.ts +2 -2
- package/components/qds-input.js +489 -230
- package/components/qds-input.js.map +1 -1
- package/components/qds-label.d.ts +2 -2
- package/components/qds-label.js +3 -3
- package/components/qds-list-item.d.ts +11 -0
- package/components/qds-list-item.js +212 -0
- package/components/qds-list-item.js.map +1 -0
- package/components/qds-loader.d.ts +11 -0
- package/components/qds-loader.js +113 -0
- package/components/qds-loader.js.map +1 -0
- package/components/qds-nav-list-item.d.ts +11 -0
- package/components/qds-nav-list-item.js +162 -0
- package/components/qds-nav-list-item.js.map +1 -0
- package/components/qds-progress-bar.d.ts +11 -0
- package/components/qds-progress-bar.js +153 -0
- package/components/qds-progress-bar.js.map +1 -0
- package/components/qds-radio.d.ts +2 -2
- package/components/qds-radio.js +147 -93
- package/components/qds-radio.js.map +1 -1
- package/components/qds-select.d.ts +11 -0
- package/components/qds-select.js +361 -0
- package/components/qds-select.js.map +1 -0
- package/components/qds-standalone-link.d.ts +11 -0
- package/components/qds-standalone-link.js +174 -0
- package/components/qds-standalone-link.js.map +1 -0
- package/components/qds-switch.d.ts +2 -2
- package/components/qds-switch.js +221 -105
- package/components/qds-switch.js.map +1 -1
- package/components/qds-tab.d.ts +11 -0
- package/components/qds-tab.js +379 -0
- package/components/qds-tab.js.map +1 -0
- package/components/qds-tabbar.d.ts +11 -0
- package/components/qds-tabbar.js +407 -0
- package/components/qds-tabbar.js.map +1 -0
- package/components/qds-table-body.d.ts +11 -0
- package/components/qds-table-body.js +68 -0
- package/components/qds-table-body.js.map +1 -0
- package/components/qds-table-cell.d.ts +11 -0
- package/components/qds-table-cell.js +71 -0
- package/components/qds-table-cell.js.map +1 -0
- package/components/qds-table-head-cell.d.ts +11 -0
- package/components/qds-table-head-cell.js +73 -0
- package/components/qds-table-head-cell.js.map +1 -0
- package/components/qds-table-head.d.ts +11 -0
- package/components/qds-table-head.js +68 -0
- package/components/qds-table-head.js.map +1 -0
- package/components/qds-table-row.d.ts +11 -0
- package/components/qds-table-row.js +68 -0
- package/components/qds-table-row.js.map +1 -0
- package/components/qds-table.d.ts +11 -0
- package/components/qds-table.js +68 -0
- package/components/qds-table.js.map +1 -0
- package/components/qds-tag.d.ts +11 -0
- package/components/qds-tag.js +13 -0
- package/components/qds-tag.js.map +1 -0
- package/components/qds-textarea.d.ts +2 -2
- package/components/qds-textarea.js +331 -193
- package/components/qds-textarea.js.map +1 -1
- package/components/qds-title.d.ts +2 -2
- package/components/qds-title.js +3 -84
- package/components/qds-title.js.map +1 -1
- package/components/qds-tooltip.d.ts +2 -2
- package/components/qds-tooltip.js +3 -315
- package/components/qds-tooltip.js.map +1 -1
- package/dist/cjs/app-globals-c4cf08df.js +12 -0
- package/dist/cjs/app-globals-c4cf08df.js.map +1 -0
- package/dist/cjs/controls-ee3d2ec8.js +31 -0
- package/dist/cjs/controls-ee3d2ec8.js.map +1 -0
- package/dist/cjs/{floating-ui.dom.esm-71fa96af.js → floating-ui.dom.esm-19b2b933.js} +468 -416
- package/dist/cjs/floating-ui.dom.esm-19b2b933.js.map +1 -0
- package/dist/cjs/helpers-10154521.js +217 -0
- package/dist/cjs/helpers-10154521.js.map +1 -0
- package/dist/cjs/index-523dd2e0.js +2149 -0
- package/dist/cjs/index-523dd2e0.js.map +1 -0
- package/dist/cjs/index.cjs.js +39 -27
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/library-41b19b9e.js +117 -0
- package/dist/cjs/library-41b19b9e.js.map +1 -0
- package/dist/cjs/loader.cjs.js +8 -6
- package/dist/cjs/loader.cjs.js.map +1 -1
- 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 +96 -0
- package/dist/cjs/qds-breadcrumb-item.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-button.cjs.entry.js +321 -90
- package/dist/cjs/qds-button.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-checkbox.cjs.entry.js +212 -100
- package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-chip.cjs.entry.js +256 -0
- package/dist/cjs/qds-chip.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-dialog.cjs.entry.js +108 -0
- package/dist/cjs/qds-dialog.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-divider.cjs.entry.js +60 -18
- package/dist/cjs/qds-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-dropdown.cjs.entry.js +232 -206
- package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-form-message.cjs.entry.js +86 -0
- package/dist/cjs/qds-form-message.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-icon.cjs.entry.js +113 -90
- package/dist/cjs/qds-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-inline-link.cjs.entry.js +99 -46
- package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-input.cjs.entry.js +404 -185
- package/dist/cjs/qds-input.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-label.cjs.entry.js +102 -24
- package/dist/cjs/qds-label.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-list-item.cjs.entry.js +157 -0
- package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-loader.cjs.entry.js +94 -0
- package/dist/cjs/qds-loader.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-nav-list-item.cjs.entry.js +124 -0
- package/dist/cjs/qds-nav-list-item.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-progress-bar.cjs.entry.js +135 -0
- package/dist/cjs/qds-progress-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-radio.cjs.entry.js +102 -57
- package/dist/cjs/qds-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-select.cjs.entry.js +323 -0
- package/dist/cjs/qds-select.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-standalone-link.cjs.entry.js +134 -0
- package/dist/cjs/qds-standalone-link.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-switch.cjs.entry.js +193 -64
- package/dist/cjs/qds-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tab.cjs.entry.js +299 -0
- package/dist/cjs/qds-tab.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-tabbar.cjs.entry.js +349 -0
- package/dist/cjs/qds-tabbar.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-table-body.cjs.entry.js +54 -0
- package/dist/cjs/qds-table-body.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-table-cell.cjs.entry.js +54 -0
- package/dist/cjs/qds-table-cell.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-table-head-cell.cjs.entry.js +54 -0
- package/dist/cjs/qds-table-head-cell.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-table-head.cjs.entry.js +54 -0
- package/dist/cjs/qds-table-head.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-table-row.cjs.entry.js +54 -0
- package/dist/cjs/qds-table-row.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-table.cjs.entry.js +54 -0
- package/dist/cjs/qds-table.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-tag_2.cjs.entry.js +181 -0
- package/dist/cjs/qds-tag_2.cjs.entry.js.map +1 -0
- package/dist/cjs/qds-textarea.cjs.entry.js +288 -153
- package/dist/cjs/qds-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/qds-tooltip.cjs.entry.js +332 -260
- package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/qds.cjs.js +15 -13
- package/dist/cjs/qds.cjs.js.map +1 -1
- package/dist/custom-elements.json +8727 -2151
- package/dist/docs.d.ts +344 -240
- package/dist/docs.json +9364 -2903
- package/dist/esm/app-globals-8ced3a41.js +10 -0
- package/dist/esm/app-globals-8ced3a41.js.map +1 -0
- package/dist/esm/controls-a4768aaf.js +27 -0
- package/dist/esm/controls-a4768aaf.js.map +1 -0
- package/dist/esm/{floating-ui.dom.esm-f96ac766.js → floating-ui.dom.esm-61986f35.js} +468 -416
- package/dist/esm/floating-ui.dom.esm-61986f35.js.map +1 -0
- package/dist/esm/helpers-2e4ca34d.js +204 -0
- package/dist/esm/helpers-2e4ca34d.js.map +1 -0
- package/dist/esm/index-b1d6acd2.js +2118 -0
- package/dist/esm/index-b1d6acd2.js.map +1 -0
- package/dist/esm/index.js +39 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/library-2e5458af.js +113 -0
- package/dist/esm/library-2e5458af.js.map +1 -0
- package/dist/esm/loader.js +9 -7
- package/dist/esm/loader.js.map +1 -1
- 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 +92 -0
- package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -0
- package/dist/esm/qds-button.entry.js +321 -90
- package/dist/esm/qds-button.entry.js.map +1 -1
- package/dist/esm/qds-checkbox.entry.js +212 -100
- package/dist/esm/qds-checkbox.entry.js.map +1 -1
- package/dist/esm/qds-chip.entry.js +252 -0
- package/dist/esm/qds-chip.entry.js.map +1 -0
- package/dist/esm/qds-dialog.entry.js +104 -0
- package/dist/esm/qds-dialog.entry.js.map +1 -0
- package/dist/esm/qds-divider.entry.js +60 -18
- package/dist/esm/qds-divider.entry.js.map +1 -1
- package/dist/esm/qds-dropdown.entry.js +232 -206
- package/dist/esm/qds-dropdown.entry.js.map +1 -1
- package/dist/esm/qds-form-message.entry.js +82 -0
- package/dist/esm/qds-form-message.entry.js.map +1 -0
- package/dist/esm/qds-icon.entry.js +113 -90
- package/dist/esm/qds-icon.entry.js.map +1 -1
- package/dist/esm/qds-inline-link.entry.js +99 -46
- package/dist/esm/qds-inline-link.entry.js.map +1 -1
- package/dist/esm/qds-input.entry.js +404 -185
- package/dist/esm/qds-input.entry.js.map +1 -1
- package/dist/esm/qds-label.entry.js +102 -24
- package/dist/esm/qds-label.entry.js.map +1 -1
- package/dist/esm/qds-list-item.entry.js +153 -0
- package/dist/esm/qds-list-item.entry.js.map +1 -0
- package/dist/esm/qds-loader.entry.js +90 -0
- package/dist/esm/qds-loader.entry.js.map +1 -0
- package/dist/esm/qds-nav-list-item.entry.js +120 -0
- package/dist/esm/qds-nav-list-item.entry.js.map +1 -0
- package/dist/esm/qds-progress-bar.entry.js +131 -0
- package/dist/esm/qds-progress-bar.entry.js.map +1 -0
- package/dist/esm/qds-radio.entry.js +102 -57
- package/dist/esm/qds-radio.entry.js.map +1 -1
- package/dist/esm/qds-select.entry.js +319 -0
- package/dist/esm/qds-select.entry.js.map +1 -0
- package/dist/esm/qds-standalone-link.entry.js +130 -0
- package/dist/esm/qds-standalone-link.entry.js.map +1 -0
- package/dist/esm/qds-switch.entry.js +193 -64
- package/dist/esm/qds-switch.entry.js.map +1 -1
- package/dist/esm/qds-tab.entry.js +295 -0
- package/dist/esm/qds-tab.entry.js.map +1 -0
- package/dist/esm/qds-tabbar.entry.js +345 -0
- package/dist/esm/qds-tabbar.entry.js.map +1 -0
- package/dist/esm/qds-table-body.entry.js +50 -0
- package/dist/esm/qds-table-body.entry.js.map +1 -0
- package/dist/esm/qds-table-cell.entry.js +50 -0
- package/dist/esm/qds-table-cell.entry.js.map +1 -0
- package/dist/esm/qds-table-head-cell.entry.js +50 -0
- package/dist/esm/qds-table-head-cell.entry.js.map +1 -0
- package/dist/esm/qds-table-head.entry.js +50 -0
- package/dist/esm/qds-table-head.entry.js.map +1 -0
- package/dist/esm/qds-table-row.entry.js +50 -0
- package/dist/esm/qds-table-row.entry.js.map +1 -0
- package/dist/esm/qds-table.entry.js +50 -0
- package/dist/esm/qds-table.entry.js.map +1 -0
- package/dist/esm/qds-tag_2.entry.js +176 -0
- package/dist/esm/qds-tag_2.entry.js.map +1 -0
- package/dist/esm/qds-textarea.entry.js +288 -153
- package/dist/esm/qds-textarea.entry.js.map +1 -1
- package/dist/esm/qds-tooltip.entry.js +332 -260
- package/dist/esm/qds-tooltip.entry.js.map +1 -1
- package/dist/esm/qds.js +16 -14
- package/dist/esm/qds.js.map +1 -1
- package/dist/types/components/badge-counter/badge-counter.d.ts +40 -0
- package/dist/types/components/badge-indicator/badge-indicator.d.ts +36 -0
- package/dist/types/components/breadcrumb-item/breadcrumb-item.d.ts +160 -0
- package/dist/types/components/button/button.d.ts +272 -194
- package/dist/types/components/checkbox/checkbox.d.ts +137 -124
- package/dist/types/components/chip/chip.d.ts +109 -0
- package/dist/types/components/controls.d.ts +4 -1
- package/dist/types/components/dialog/dialog.d.ts +35 -0
- package/dist/types/components/divider/divider.d.ts +13 -9
- package/dist/types/components/dropdown/dropdown.d.ts +107 -125
- package/dist/types/components/form-message/form-message.d.ts +42 -0
- package/dist/types/components/icon/icon.d.ts +24 -24
- package/dist/types/components/icon/library.d.ts +3 -3
- package/dist/types/components/icon/request.d.ts +5 -9
- package/dist/types/components/inline-link/inline-link.d.ts +208 -191
- package/dist/types/components/input/input.d.ts +415 -368
- package/dist/types/components/label/label.d.ts +26 -24
- package/dist/types/components/list-item/list-item.d.ts +100 -0
- package/dist/types/components/loader/loader.d.ts +27 -0
- package/dist/types/components/nav-list-item/nav-list-item.d.ts +67 -0
- package/dist/types/components/progress-bar/progress-bar.d.ts +60 -0
- package/dist/types/components/radio/radio.d.ts +90 -95
- package/dist/types/components/select/select.d.ts +203 -0
- package/dist/types/components/shared.d.ts +6 -0
- package/dist/types/components/standalone-link/standalone-link.d.ts +233 -0
- package/dist/types/components/switch/switch.d.ts +114 -107
- package/dist/types/components/tab/tab.d.ts +160 -0
- package/dist/types/components/tabbar/tabbar.d.ts +47 -0
- package/dist/types/components/table/table.d.ts +15 -0
- package/dist/types/components/table-body/table-body.d.ts +15 -0
- package/dist/types/components/table-cell/table-cell.d.ts +32 -0
- package/dist/types/components/table-head/table-head.d.ts +15 -0
- package/dist/types/components/table-head-cell/table-head-cell.d.ts +56 -0
- package/dist/types/components/table-row/table-row.d.ts +15 -0
- package/dist/types/components/tag/tag.d.ts +55 -0
- package/dist/types/components/textarea/textarea.d.ts +285 -300
- package/dist/types/components/title/title.d.ts +39 -32
- package/dist/types/components/tooltip/tooltip.d.ts +123 -137
- package/dist/types/components.d.ts +3957 -833
- package/dist/types/helpers.d.ts +15 -16
- package/dist/types/index.d.ts +2 -1
- package/dist/types/interface-overrides.d.ts +211 -0
- package/dist/types/qds-test.d.ts +22 -11
- package/dist/types/stencil-public-runtime.d.ts +55 -15
- package/dist/types/utils.d.ts +11 -4
- package/dist/vscode.html-custom-data.json +1528 -210
- package/hydrate/index.d.ts +59 -18
- package/hydrate/index.js +25724 -9014
- package/hydrate/index.mjs +26627 -0
- package/hydrate/package.json +7 -1
- package/loader/cdn.js +3 -4
- package/loader/index.cjs.js +3 -4
- package/loader/index.d.ts +4 -1
- package/loader/index.es2017.js +3 -4
- package/loader/index.js +3 -4
- package/package.json +53 -89
- package/styles/core.css +137 -14
- package/components/floating-ui.dom.esm.js.map +0 -1
- package/components/helpers.js +0 -175
- package/components/helpers.js.map +0 -1
- package/components/icon.js +0 -175
- package/components/icon.js.map +0 -1
- package/components/label.js +0 -55
- package/components/label.js.map +0 -1
- package/dist/cjs/floating-ui.dom.esm-71fa96af.js.map +0 -1
- package/dist/cjs/helpers-452256e8.js +0 -185
- package/dist/cjs/helpers-452256e8.js.map +0 -1
- package/dist/cjs/index-d181f952.js +0 -2039
- package/dist/cjs/index-d181f952.js.map +0 -1
- package/dist/cjs/library-0a619eeb.js +0 -62
- package/dist/cjs/library-0a619eeb.js.map +0 -1
- package/dist/cjs/qds-title.cjs.entry.js +0 -66
- package/dist/cjs/qds-title.cjs.entry.js.map +0 -1
- package/dist/esm/floating-ui.dom.esm-f96ac766.js.map +0 -1
- package/dist/esm/helpers-76b84f45.js +0 -175
- package/dist/esm/helpers-76b84f45.js.map +0 -1
- package/dist/esm/index-d7183092.js +0 -2009
- package/dist/esm/index-d7183092.js.map +0 -1
- package/dist/esm/library-021aca11.js +0 -58
- package/dist/esm/library-021aca11.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/qds-title.entry.js +0 -62
- package/dist/esm/qds-title.entry.js.map +0 -1
- package/dist/types/components/create-story.d.ts +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"qds-textarea.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,u9CAAu9C;;ACuC3+C,IAAI,kBAAkB,GAAG,CAAC,CAAA;MAcb,QAAQ;;;;;;;;IAsRX,wBAAmB,GAAe,EAAE,CAAA;IA4J3B,QAAG,GAAG,CAAC,QAA8B;MACpD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;KACzB,CAAA;IAEgB,WAAM,GAAG,CAAC,KAAiB;MAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,w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AAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,EAC9B,IAAI,EAAE,IAAI,CAAC,IAAI,KAEX,IAAI,CAAC,mBAAmB,GAC5B,EACH;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/textarea/textarea.css?tag=qds-textarea&encapsulation=scoped","src/components/textarea/textarea.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2023 Schneider Electric\n *\n * SPDX-License-Identifier: LGPL-2.1-only\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n resize: both;\n}\n\n.textarea {\n background-color: var(--qds-theme-control-input-background);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n border-radius: var(--qds-control-border-radius);\n color: var(--qds-theme-control-text-standard);\n padding-inline: var(--qds-control-input-padding-horizontal);\n resize: inherit;\n width: 100%;\n height: 100%;\n\n &:not(:focus)[aria-invalid='true'] {\n border-color: var(--qds-theme-feedback-result-failure);\n }\n\n &:disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n }\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 &:placeholder-shown {\n color: var(--qds-theme-control-text-placeholder);\n }\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n padding-block: var(--qds-control-small-padding-auto-height);\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n padding-block: var(--qds-control-standard-padding-auto-height);\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n padding-block: var(--qds-control-large-padding-auto-height);\n}\n","// SPDX-FileCopyrightText: © 2023 Schneider Electric\n//\n// SPDX-License-Identifier: LGPL-2.1-only\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n Component,\n Element,\n Event,\n h,\n Method,\n Prop,\n Watch,\n} from '@stencil/core'\n\nimport type {\n Attributes,\n QdsFocusEventDetail,\n QdsInputEventDetail,\n} from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n invariant,\n pickFocusEventAttributes,\n pickInputEventAttributes,\n} from '../../helpers'\nimport type {\n AutoCapitalize,\n EnterKeyHint,\n InputMode,\n SelectDirection,\n Value,\n} from '../controls'\n\nexport type TextAreaAutoComplete = 'off' | 'on'\nexport type TextAreaSize = 'large' | 'small' | 'standard'\nexport type Wrap = 'hard' | 'off' | 'soft'\n\nlet autoIncrementingId = 1\n\n/**\n * The `<qds-textarea>` element represents a multi-line plain-text editing\n * control, useful when you want to allow users to enter a sizeable amount of\n * free-form text, for example a comment on a review or feedback form.\n *\n * @see https://quartz.se.com/build/components/textarea\n */\n@Component({\n tag: 'qds-textarea',\n scoped: true,\n styleUrl: 'textarea.css',\n})\nexport class TextArea implements ComponentInterface {\n /**\n * Defines if the textarea is in an invalid state. Validity is determined by\n * attributes such as `required`, `minlength`, and `maxlength` using\n * [constraint validation][].\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n */\n @Prop({ mutable: true, reflect: true }) public invalid?: boolean\n\n /**\n * The textarea's size.\n *\n * > **_NOTE:_** The native [`size` HTML attribute][] is not supported. CSS\n * `width` should be used instead if this functionality is needed.\n *\n * [`size` HTML attribute]: https://developer.mozilla.org/docs/Web/HTML/Attributes/size\n */\n @Prop({ reflect: true }) public readonly size: TextAreaSize = 'standard'\n\n /**\n * Controls whether and how input is automatically capitalized as it is\n * entered/edited by the user. Possible values:\n *\n * - `\"off\"` or `\"none\"`: No auto-capitalization is applied (all letters\n * default to lowercase).\n * - `\"on\"` or `\"sentences\"`: The first letter of each sentence defaults to a\n * capital letter; all other letters default to lowercase.\n * - `\"words\"`: The first letter of each word defaults to a capital letter;\n * all other letters default to lowercase.\n * - `\"characters\"`: All letters default to uppercase.\n *\n * @webnative\n */\n @Prop({ attribute: 'autocapitalize' })\n public readonly autoCapitalize?: AutoCapitalize\n\n /**\n * Indicates whether the value of the textarea can be automatically completed\n * by the browser. Possible values:\n *\n * `off`: The user must explicitly enter a value into this field for every\n * use, or the document provides its own auto-completion method; the browser\n * does not automatically complete the entry.\n * `on`: The browser can automatically complete the value based on values\n * that the user has entered during previous uses.\n *\n * If the `autocomplete` attribute is not specified on a `<qds-textarea>`\n * element, then the browser uses the `autocomplete` attribute value of the\n * `<qds-textarea>` element's form owner. The form owner is either the\n * [`<form>`][] element that this `<qds-textarea>` element is a descendant of\n * or the form element whose `id` is specified by the `form` attribute of the\n * `qds-textarea` element. For more information, see the [`autocomplete`]\n * attribute in [`<form>`][].\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n * [`autocomplete`]: https://developer.mozilla.org/docs/Web/HTML/Element/form#autocomplete\n *\n * @webnative\n */\n @Prop({ attribute: 'autocomplete' })\n public readonly autoComplete?: TextAreaAutoComplete\n\n /**\n * Specify whether the input should have focus when the page loads.\n *\n * @webnative\n */\n @Prop({ attribute: 'autofocus' }) public readonly autoFocus?: boolean\n\n /**\n * The visible width of the text control, in average character widths. If it\n * is specified, it must be a positive integer. If it is not specified, the\n * default value is `20`.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public readonly cols?: number\n\n /**\n * Prevents the input from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop({ mutable: true, reflect: true }) public disabled?: boolean\n\n /**\n * What action label (or icon) to present for the enter key on virtual\n * keyboards. Possible values:\n *\n * - `\"done\"`: Typically meaning there is nothing more to input and the input\n * method editor (IME) will be closed.\n * - `\"enter\"`:\tTypically inserting a new line.\n * - `\"go\"`: \tTypically meaning to take the user to the target of the text\n * they typed.\n * - `\"next\"`: \tTypically taking the user to the next field that will accept\n * text.\n * - `\"previous\"`: Typically taking the user to the previous field that will\n * accept text.\n * - `\"search\"`: Typically taking the user to the results of searching for\n * the text they have typed.\n * - `\"send\"`: Typically delivering the text to its target.\n *\n * @webnative\n */\n // FIXME: Can't use `attribute` option here to name this `enterKeyHint` instead.\n @Prop() public readonly enterkeyhint?: EnterKeyHint\n\n /**\n * The [`<form>`][] element to associate the input with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-textarea>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-textarea>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @webnative\n */\n @Prop() public readonly form?: string\n\n /**\n * Provide a hint to browsers as to the type of virtual keyboard\n * configuration to use when editing this element or its contents.\n *\n * @webnative\n */\n // FIXME: Can't use `attribute` option here to name this `inputMode` instead.\n @Prop() public readonly inputmode?: InputMode\n\n /**\n * The maximum number of characters (as UTF-16 code units) the user can enter\n * into the textarea. This must be an non-negative integer value. If no\n * `maxlength` is specified, or an invalid value is specified, the textarea\n * has no maximum length.\n *\n * The textarea will fail [constraint validation][] if the length of the text\n * entered into the field is greater than `maxlength` UTF-16 code units long.\n * By default, browsers prevent users from entering more characters than\n * allowed by the `maxlength` attribute. See [Client-side validation][] for\n * more information.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n *\n * @webnative\n */\n @Prop({ attribute: 'maxlength' }) public readonly maxLength?: number\n\n /**\n * The minimum number of characters (as UTF-16 code units) the user can enter\n * into the textarea. This must be an non-negative integer value smaller than\n * or equal to the value specified by `maxlength`. If no `minlength` is\n * specified, or an invalid value is specified, the textarea has no minimum\n * length.\n *\n * The textarea will fail [constraint validation][] if the length of the text\n * entered into the field is fewer than `minlength` UTF-16 code units long,\n * preventing form submission. See [Client-side validation][] for more\n * information.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n *\n * @webnative\n */\n @Prop({ attribute: 'minlength' }) public readonly minLength?: number\n\n /**\n * The name of the control, which is submitted with the form data. An\n * incrementing textarea ID is used by default.\n *\n * @webnative\n */\n @Prop() public readonly name = `qds-textarea-${autoIncrementingId}`\n\n /**\n * Text that appears in the textarea when it has no value set.\n *\n * @webnative\n */\n @Prop() public readonly placeholder?: string\n\n /**\n * The value of the textarea cannot be edited.\n *\n * @webnative\n */\n @Prop({ attribute: 'readonly' }) public readonly readOnly?: boolean\n\n /**\n * A value must be specified for the textarea before the owning form can be\n * submitted.\n *\n * See [Client-side validation][] and the [HTML attribute: `required`][] for\n * more information.\n *\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n * [HTML attribute: `required`]: https://developer.mozilla.org/docs/Web/HTML/Attributes/required\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The number of visible text lines for the control. If it is specified, it\n * must be a positive integer. If it is not specified, the default value is\n * `2`.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public readonly rows?: number\n\n /**\n * Defines whether the textarea may be checked for spelling errors.\n *\n * @webnative\n */\n @Prop({ attribute: 'spellcheck' }) public readonly spellCheck?: boolean\n\n /**\n * The value of the textarea.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public value?: Value\n\n /**\n * Indicates how the control should wrap the value for form submission.\n * Possible values are:\n *\n * - `hard`: The browser automatically inserts line breaks (`CR+LF`) so that\n * each line is no longer than the width of the control; the `cols` attribute\n * must be specified for this to take effect\n * - `soft`: The browser ensures that all line breaks in the entered value\n * are a `CR+LF` pair, but no additional line breaks are added to the value.\n * - `off`: Like `soft` but changes appearance to `white-space: pre` so line\n * segments exceeding `cols` are not wrapped and the `<qds-textarea>` becomes\n * horizontally scrollable.\n *\n * If this attribute is not specified, `soft` is its default value.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public wrap?: Wrap\n\n /**\n * Emitted when the textarea loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when an alteration to the textarea's value is committed by the\n * user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the textarea gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the textarea's value changes.\n */\n @Event({ eventName: 'qdsInput', cancelable: false })\n private readonly inputEmitter!: EventEmitter<QdsInputEventDetail>\n\n @Element() private readonly element!: HTMLQdsTextareaElement\n\n private inheritedAttributes: Attributes = {}\n\n private textarea?: HTMLTextAreaElement\n\n private get computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n /**\n * Returns true if the element's value passes validity checks; otherwise,\n * returns false, fires an invalid event at the element, and (if the event\n * isn't canceled) reports the problem to the user.\n */\n @Method()\n public async reportValidity(): Promise<boolean> {\n invariant(this.textarea)\n\n return this.textarea.reportValidity()\n }\n\n /**\n * Selects the entire content of the `<qds-textarea>` element if the\n * element's content is selectable.\n */\n @Method()\n public async select(): Promise<void> {\n invariant(this.textarea)\n\n this.textarea.select()\n }\n\n /**\n * Sets a custom validity message for the textarea. If this message is not\n * the empty string, then the element is considered invalid.\n */\n @Method()\n public async setCustomValidity(message: string): Promise<void> {\n invariant(this.textarea)\n\n this.textarea.setCustomValidity(message)\n this.invalid = !this.textarea.checkValidity()\n }\n\n /**\n * Sets the contents of the specified range of characters in the textarea\n * element to a given string.\n *\n * @param replacement The string to insert.\n * @param start The 0-based index of the first character to replace. Defaults to the current selectionStart value (the start of the user's current selection).\n * @param end The 0-based index of the character _after_ the last character to replace. Defaults to the current selectionEnd value (the end of the user's current selection).\n * @param selectionMode A string defining how the selection should be set after the text has been replaced. Possible values:\n *\n * - `\"select\"` selects the newly inserted text.\n * - `\"start\"` moves the selection to just before the inserted text.\n * - `\"end\"` moves the selection to just after the inserted text.\n * - `\"preserve\"` attempts to preserve the selection.\n */\n @Method()\n public async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectionMode: SelectionMode = 'preserve',\n ): Promise<void> {\n invariant(this.textarea)\n\n this.textarea.setRangeText(replacement, start, end, selectionMode)\n\n if (this.value !== this.textarea.value) {\n this.value = this.textarea.value\n this.inputEmitter.emit()\n this.changeEmitter.emit()\n }\n }\n\n /**\n * Selects the specified range of characters within the textarea.\n *\n * @param start The offset into the input for the start of the selection.\n * @param end The offset into the input for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n @Method()\n public async setSelectionRange(\n start: number | null,\n end: number | null,\n direction?: SelectDirection,\n ): Promise<void> {\n invariant(this.textarea)\n\n this.textarea.setSelectionRange(start, end, direction)\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n invariant(this.textarea)\n\n // Disabled inputs are always valid, so we need to recheck validity when\n // the state changes.\n this.textarea.disabled = this.computedDisabled\n this.invalid = !this.textarea.checkValidity()\n }\n\n @Watch('value')\n protected valueChanged(): void {\n invariant(this.textarea)\n\n this.invalid = !this.textarea.checkValidity()\n }\n\n public componentWillLoad(): void {\n autoIncrementingId += 1\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.element),\n ...inheritAttributes(this.element, ['tabindex']),\n }\n }\n\n public render() {\n return (\n <textarea\n aria-invalid={this.invalid ?? false ? 'true' : 'false'}\n autoCapitalize={this.autoCapitalize}\n autoComplete={this.autoComplete}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.autoFocus}\n class=\"textarea\"\n cols={this.cols}\n data-size={this.size}\n disabled={this.disabled}\n enterKeyHint={this.enterkeyhint}\n form={this.form}\n inputMode={this.inputmode}\n maxLength={this.maxLength}\n minLength={this.minLength}\n name={this.name}\n onBlur={this.onBlur}\n onChange={this.onChange}\n onClick={this.onClick}\n onFocus={this.onFocus}\n onInput={this.onInput}\n onInvalid={this.onInvalid}\n placeholder={this.placeholder}\n readOnly={this.readOnly}\n ref={this.ref}\n required={this.required}\n rows={this.rows}\n spellcheck={this.spellCheck}\n value={this.value ?? undefined}\n wrap={this.wrap}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n />\n )\n }\n\n private readonly ref = (textarea?: HTMLTextAreaElement): void => {\n this.textarea = textarea\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onChange = (): void => {\n invariant(this.textarea)\n\n this.value = this.textarea.value\n this.changeEmitter.emit()\n }\n\n private readonly onClick = (event: MouseEvent): void => {\n if (this.computedDisabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onInput = (event: InputEvent): void => {\n invariant(this.textarea)\n\n this.value = this.textarea.value\n this.inputEmitter.emit(pickInputEventAttributes(event))\n }\n\n private readonly onInvalid = (): void => {\n this.invalid = true\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-textarea.js","mappings":";;;;;;;;;AAAA,MAAM,WAAW,GAAG,gqCAAgqC,CAAC;AACrrC,0BAAe,WAAW;;ACD1B;AACA;AACA;;;;;;;;;;;;;;;;;;MAgDa,QAAQ;IANrB;;;;;;;;;;;;;;;;;;QAe0B,SAAI,GAAU,UAAU,CAAA;;;;;;;;;;;;;;;;;;QAoFxB,SAAI,GAAsC,IAAI,CAAA;;;;;;;;;;QAoB9C,WAAM,GAC5B,EAAgC,CAAA;;;;;;;;QAuF3B,uBAAkB,GAA2C,IAAI,CAAA;;;;;;;;QAYjE,iBAAY,GAAqC,IAAI,CAAA;;;;;;;;QAYrD,mBAAc,GAAuC,IAAI,CAAA;;;;;;;;QAUhD,sBAAiB,GAA0C,EAAE,CAAA;;;;;;;;;QAUrD,a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ea.css?tag=qds-textarea&encapsulation=shadow","src/components/textarea/textarea.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 resize: both;\n}\n\nslot {\n display: none;\n}\n\n.qds-textarea {\n background-color: var(--qds-theme-control-input-background);\n border-radius: var(--qds-control-border-radius);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n box-sizing: border-box;\n color: var(--qds-theme-control-text-standard);\n height: 100%;\n padding-inline: var(--qds-control-input-padding-horizontal);\n resize: inherit;\n width: 100%;\n\n &:disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n }\n\n &:focus-visible {\n outline: var(--qds-control-input-focus-border-width) solid\n var(--qds-theme-control-input-focus-border);\n }\n\n &:placeholder-shown {\n color: var(--qds-theme-control-text-placeholder);\n }\n\n &:not(:focus):user-invalid {\n border-color: var(--qds-theme-feedback-result-failure);\n }\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n padding-block: var(--qds-control-small-padding-auto-height);\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n padding-block: var(--qds-control-standard-padding-auto-height);\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n padding-block: var(--qds-control-large-padding-auto-height);\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type {\n Attributes,\n QdsFocusEventDetail,\n QdsInputEventDetail,\n} from '../../helpers'\nimport {\n inheritAriaAttributes,\n invariant,\n pickFocusEventAttributes,\n pickInputEventAttributes,\n} from '../../helpers'\nimport type { EnterKeyHint, InputMode, Value } from '../controls'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Size } from '../shared'\n\nexport type TextAreaAutoComplete = 'off' | 'on'\n// TODO: `hard` value isn't supported by Firefox or Safari\nexport type Wrap = 'off' | 'soft'\n\n/**\n * The `<qds-textarea>` element represents a multi-line plain-text editing\n * control, useful when you want to allow users to enter a sizeable amount of\n * free-form text, for example a comment on a review or feedback form.\n *\n * @see https://quartz.se.com/build/components/textarea\n */\n@Component({\n tag: 'qds-textarea',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'textarea.css',\n})\nexport class TextArea implements ComponentInterface {\n /**\n * The textarea's size.\n *\n * > **_NOTE:_** The native [`size` HTML attribute][] is not supported. CSS\n * `width` should be used instead if this functionality is needed.\n *\n * [`size` HTML attribute]: https://developer.mozilla.org/docs/Web/HTML/Attributes/size\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Indicates whether the value of the textarea can be automatically completed\n * by the browser. Possible values:\n *\n * `off`: The user must explicitly enter a value into this field for every\n * use, or the document provides its own auto-completion method; the browser\n * does not automatically complete the entry.\n * `on`: The browser can automatically complete the value based on values\n * that the user has entered during previous uses.\n *\n * If the `autocomplete` attribute is not specified on a `<qds-textarea>`\n * element, then the browser uses the `autocomplete` attribute value of the\n * `<qds-textarea>` element's form owner. The form owner is either the\n * [`<form>`][] element that this `<qds-textarea>` element is a descendant of\n * or the form element whose `id` is specified by the `form` attribute of the\n * `qds-textarea` element. For more information, see the [`autocomplete`]\n * attribute in [`<form>`][].\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n * [`autocomplete`]: https://developer.mozilla.org/docs/Web/HTML/Element/form#autocomplete\n *\n * @webnative\n */\n @Prop({ attribute: 'autocomplete' })\n public readonly autoComplete?: TextAreaAutoComplete\n\n /**\n * The visible width of the text control, in average character widths. If it\n * is specified, it must be a positive integer. If it is not specified, the\n * default value is `20`.\n *\n * @webnative\n */\n @Prop() public readonly cols?: number\n\n /**\n * Prevents the textarea from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop() public disabled?: boolean\n\n /**\n * What action label (or icon) to present for the enter key on virtual\n * keyboards. Possible values:\n *\n * - `\"done\"`: Typically meaning there is nothing more to input and the input\n * method editor (IME) will be closed.\n * - `\"enter\"`:\tTypically inserting a new line.\n * - `\"go\"`: \tTypically meaning to take the user to the target of the text\n * they typed.\n * - `\"next\"`: \tTypically taking the user to the next field that will accept\n * text.\n * - `\"previous\"`: Typically taking the user to the previous field that will\n * accept text.\n * - `\"search\"`: Typically taking the user to the results of searching for\n * the text they have typed.\n * - `\"send\"`: Typically delivering the text to its target.\n *\n * @webnative\n */\n // FIXME: Can't use `attribute` option here to name this `enterKeyHint` instead.\n @Prop() public readonly enterkeyhint?: EnterKeyHint\n\n /**\n * The [`<form>`][] element to associate the input with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-textarea>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-textarea>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Provide a hint to browsers as to the type of virtual keyboard\n * configuration to use when editing this element or its contents.\n *\n * @webnative\n */\n // FIXME: Can't use `attribute` option here to name this `inputMode` instead.\n @Prop() public readonly inputmode?: InputMode\n\n /**\n * Returns a list of the [`<label>`][] elements associated with the\n * `qds-textarea` element.\n *\n * [`<label>`]: https://developer.mozilla.org/docs/Web/HTML/Element/label\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly labels: ElementInternals['labels'] =\n {} as ElementInternals['labels']\n\n /**\n * The maximum number of characters (as UTF-16 code units) the user can enter\n * into the textarea. This must be an non-negative integer value. If no\n * `maxlength` is specified, or an invalid value is specified, the textarea\n * has no maximum length.\n *\n * The textarea will fail [constraint validation][] if the length of the text\n * entered into the field is greater than `maxlength` UTF-16 code units long.\n * By default, browsers prevent users from entering more characters than\n * allowed by the `maxlength` attribute. See [Client-side validation][] for\n * more information.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n *\n * @webnative\n */\n @Prop({ attribute: 'maxlength' }) public readonly maxLength?: number\n\n /**\n * The minimum number of characters (as UTF-16 code units) the user can enter\n * into the textarea. This must be an non-negative integer value smaller than\n * or equal to the value specified by `maxlength`. If no `minlength` is\n * specified, or an invalid value is specified, the textarea has no minimum\n * length.\n *\n * The textarea will fail [constraint validation][] if the length of the text\n * entered into the field is fewer than `minlength` UTF-16 code units long,\n * preventing form submission. See [Client-side validation][] for more\n * information.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n *\n * @webnative\n */\n @Prop({ attribute: 'minlength' }) public readonly minLength?: number\n\n /**\n * The name of the textarea, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * Text that appears in the textarea when it has no value set.\n *\n * @webnative\n */\n @Prop() public readonly placeholder?: string\n\n /**\n * A value must be specified for the textarea before the owning form can be\n * submitted.\n *\n * See [Client-side validation][] and the [HTML attribute: `required`][] for\n * more information.\n *\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n * [HTML attribute: `required`]: https://developer.mozilla.org/docs/Web/HTML/Attributes/required\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * The number of visible text lines for the control. If it is specified, it\n * must be a positive integer. If it is not specified, the default value is\n * `2`.\n *\n * @webnative\n */\n @Prop() public readonly rows?: number\n\n /**\n * Get or set the selection direction of a text selection.\n *\n * > **_NOTE:_** This property has no effect when used as an attribute.\n *\n * @webnative\n */\n @Prop({ mutable: true })\n // FIXME: Use `HTMLTextAreaElement['selectionDirection']` instead.\n // eslint-disable-next-line unicorn/no-null\n public selectionDirection: HTMLInputElement['selectionDirection'] = null\n\n /**\n * Get or set the ending position or offset of a text selection.\n *\n * > **_NOTE:_** This property has no effect when used as an attribute.\n *\n * @webnative\n */\n @Prop({ mutable: true })\n // FIXME: Use `HTMLTextAreaElement['selectionEnd']` instead.\n // eslint-disable-next-line unicorn/no-null\n public selectionEnd: HTMLInputElement['selectionEnd'] = null\n\n /**\n * Get or set the starting position or offset of a text selection.\n *\n * > **_NOTE:_** This property has no effect when used as an attribute.\n *\n * @webnative\n */\n @Prop({ mutable: true })\n // FIXME: Use `HTMLTextAreaElement['selectionStart']` instead.\n // eslint-disable-next-line unicorn/no-null\n public selectionStart: HTMLInputElement['selectionStart'] = null\n\n /**\n * The error message that would be shown to the user if the `<qds-select>`\n * was to be checked for validity.\n *\n * @readonly\n * @webnative\n */\n @Prop()\n public readonly validationMessage: ElementInternals['validationMessage'] = ''\n\n /**\n * The [`ValidityState`][] object for this `<qds-select>`.\n *\n * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly validity: ElementInternals['validity'] = VALID_STATE\n\n /**\n * The value of the textarea.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public value?: Value\n\n /**\n * True if `<qds-textarea>` will be validated when the form is submitted;\n * false otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n /**\n * Indicates how the control should wrap the value for form submission.\n * Possible values are:\n *\n * - `hard`: The browser automatically inserts line breaks (`CR+LF`) so that\n * each line is no longer than the width of the control; the `cols` attribute\n * must be specified for this to take effect\n * - `soft`: The browser ensures that all line breaks in the entered value\n * are a `CR+LF` pair, but no additional line breaks are added to the value.\n * - `off`: Like `soft` but changes appearance to `white-space: pre` so line\n * segments exceeding `cols` are not wrapped and the `<qds-textarea>` becomes\n * horizontally scrollable.\n *\n * If this attribute is not specified, `soft` is its default value.\n *\n * @webnative\n */\n @Prop() public readonly wrap?: Wrap\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n /**\n * Emitted when the textarea loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when an alteration to the textarea's value is committed by the\n * user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the textarea gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the textarea's value changes.\n */\n @Event({ eventName: 'qdsInput', cancelable: false })\n private readonly inputEmitter!: EventEmitter<QdsInputEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private tabIndex?: number\n\n #inheritedAttributes: Attributes = {}\n\n #textarea?: HTMLTextAreaElement\n\n get #computedDisabled(): boolean {\n return (\n (this.host.matches(':disabled') || (this.disabled ?? false)) &&\n this.host.getAttribute('disabled') !== 'false'\n )\n }\n\n get #computedValue(): Parameters<ElementInternals['setFormValue']>[0] {\n if (typeof this.value === 'number') return this.value.toString()\n // eslint-disable-next-line unicorn/no-null\n return this.value === undefined ? null : this.value\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedDisabled)\n // eslint-disable-next-line unicorn/no-null\n this.internals.setFormValue(null)\n else this.internals.setFormValue(this.#computedValue)\n }\n\n @Watch('selectionDirection')\n protected selectionDirectionChanged(): void {\n invariant(this.#textarea)\n\n // @ts-expect-error: `null` is a valid value according to the HTML spec.\n this.#textarea.selectionDirection = this.selectionDirection\n }\n\n @Watch('selectionEnd')\n protected selectionEndChanged(): void {\n invariant(this.#textarea)\n\n // @ts-expect-error: `null` is a valid value according to the HTML spec.\n this.#textarea.selectionEnd = this.selectionEnd\n }\n\n @Watch('selectionStart')\n protected selectionStartChanged(): void {\n invariant(this.#textarea)\n\n // @ts-expect-error: `null` is a valid value according to the HTML spec.\n this.#textarea.selectionStart = this.selectionStart\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('maxLength')\n @Watch('minLength')\n @Watch('required')\n @Watch('value')\n protected validationChanged(): void {\n invariant(this.#textarea)\n\n if (this.maxLength !== undefined) this.#textarea.maxLength = this.maxLength\n if (this.minLength !== undefined) this.#textarea.minLength = this.minLength\n this.#textarea.required = this.required ?? false\n // eslint-disable-next-line unicorn/no-null\n if (this.value != null) this.#textarea.value = this.value.toString()\n\n const { valid } = this.#textarea.validity\n if (valid)\n this.internals.setValidity(NO_ERROR_FLAGS, undefined, this.#textarea)\n else\n this.internals.setValidity(\n this.#textarea.validity,\n this.#textarea.validationMessage,\n this.#textarea,\n )\n }\n\n @Watch('value')\n protected valueChanged(): void {\n if (!this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n this.#defineGetter('labels', () => this.internals.labels)\n\n this.#defineGetter('selectionDirection', this.#getSelectionDirection)\n this.#defineGetter('selectionStart', this.#getSelectionStart)\n this.#defineGetter('selectionEnd', this.#getSelectionEnd)\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n invariant(this.#textarea)\n\n this.validationChanged()\n this.valueChanged()\n }\n\n public render() {\n return (\n <Host>\n <textarea\n autoCapitalize={this.host.autocapitalize}\n autoComplete={this.autoComplete}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n class=\"qds-textarea\"\n cols={this.cols}\n data-size={this.size ?? 'standard'}\n disabled={this.disabled}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n maxLength={this.maxLength}\n minLength={this.minLength}\n onBlur={this.#onBlur}\n onChange={this.#onChange}\n onFocus={this.#onFocus}\n onInput={this.#onInput}\n placeholder={this.placeholder}\n ref={this.#ref}\n rows={this.rows}\n spellcheck={this.host.spellcheck}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n wrap={this.wrap}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <slot onSlotchange={this.#onSlotchange} />\n </Host>\n )\n }\n\n public checkValidity: ElementInternals['checkValidity'] = () =>\n this.internals.checkValidity()\n\n public reportValidity: ElementInternals['reportValidity'] = () =>\n this.internals.reportValidity()\n\n public setCustomValidity: HTMLTextAreaElement['setCustomValidity'] = (\n error,\n ) => {\n invariant(this.#textarea)\n\n this.#textarea.setCustomValidity(error)\n if (error)\n this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.#textarea)\n else this.internals.setValidity(NO_ERROR_FLAGS)\n }\n\n public select: HTMLTextAreaElement['select'] = () => {\n invariant(this.#textarea)\n\n this.#textarea.select()\n }\n\n public setRangeText = (\n replacement: string,\n start: number,\n end: number,\n selectionMode?: SelectionMode,\n ): void => {\n invariant(this.#textarea)\n\n this.#textarea.setRangeText(replacement, start, end, selectionMode)\n\n if (this.value !== this.#textarea.value) {\n this.value = this.#textarea.value\n this.inputEmitter.emit()\n this.changeEmitter.emit()\n }\n }\n\n public setSelectionRange: HTMLTextAreaElement['setSelectionRange'] = (\n start,\n end,\n direction,\n ) => {\n invariant(this.#textarea)\n\n this.#textarea.setSelectionRange(start, end, direction)\n }\n\n readonly #getSelectionDirection: () => HTMLTextAreaElement['selectionDirection'] =\n () => {\n invariant(this.#textarea)\n\n return this.#textarea.selectionDirection\n }\n\n readonly #getSelectionStart: () => HTMLTextAreaElement['selectionStart'] =\n () => {\n invariant(this.#textarea)\n\n return this.#textarea.selectionStart\n }\n\n readonly #getSelectionEnd: () => HTMLTextAreaElement['selectionEnd'] = () => {\n invariant(this.#textarea)\n\n return this.#textarea.selectionEnd\n }\n\n readonly #ref = (textarea?: HTMLTextAreaElement): void => {\n this.#textarea = textarea\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onChange = (): void => {\n this.changeEmitter.emit()\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onInput = (event: InputEvent): void => {\n invariant(this.#textarea)\n\n this.value = this.#textarea.value\n this.inputEmitter.emit(pickInputEventAttributes(event))\n }\n\n readonly #onSlotchange = (): void => {\n invariant(this.#textarea)\n this.#textarea.innerHTML = this.host.innerHTML\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
|
|
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../dist/types/components";
|
|
|
2
2
|
|
|
3
3
|
interface QdsTitle extends Components.QdsTitle, HTMLElement {}
|
|
4
4
|
export const QdsTitle: {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
prototype: QdsTitle;
|
|
6
|
+
new (): QdsTitle;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
package/components/qds-title.js
CHANGED
|
@@ -1,90 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SPDX-FileCopyrightText: ©
|
|
2
|
+
* SPDX-FileCopyrightText: © 2025 Schneider Electric
|
|
3
3
|
*
|
|
4
|
-
* SPDX-License-Identifier:
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { i as inheritAriaAttributes } from './helpers.js';
|
|
8
|
-
import { d as defineCustomElement$2 } from './icon.js';
|
|
9
|
-
|
|
10
|
-
const titleCss = ":host{box-sizing:border-box}:host([hidden]){display:none !important}:host([hidden]){}:host *,:host *::before,:host *::after{box-sizing:inherit}:host{display:block}.titles,.title{display:flex}.titles{flex-direction:column}.title,.subtitle,.kicker{margin-block:0}.icon{flex-shrink:0}.title{font-weight:normal;font-weight:initial;font-size:medium;font-size:initial;color:var(--qds-theme-title)}.subtitle{color:var(--qds-theme-subtitle)}.kicker{color:var(--qds-theme-kicker);order:-1}.subtitle,.kicker{word-wrap:break-word}.main.section.titles,.main.section.title{gap:var(--qds-main-section-titles-gap)}.main.section.title{font:var(--qds-main-section-title)}.main.section.title .icon{--qds-main-section-title-line-height:2rem;width:var(--qds-main-section-titles-icon-size);height:2rem;height:var(--qds-main-section-title-line-height)}.main.section.subtitle{font:var(--qds-main-section-subtitle)}.main.section.kicker{font:var(--qds-main-section-kicker)}.main.section.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-main-section-titles-icon-size, 0px) +\n var(--qds-main-section-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-main-section-titles-icon-size, 0px) +\n var(--qds-main-section-titles-gap, 0px)\n )}.main.section.has-icon-end{-webkit-padding-end:calc(\n 0px +\n 0px\n );padding-inline-end:calc(\n 0px +\n 0px\n );-webkit-padding-end:calc(\n var(--qds-main-section-titles-icon-size, 0px) +\n var(--qds-main-section-titles-gap, 0px)\n );padding-inline-end:calc(\n var(--qds-main-section-titles-icon-size, 0px) +\n var(--qds-main-section-titles-gap, 0px)\n )}.main.subsection.titles,.main.subsection.title{gap:var(--qds-main-subsection-titles-gap)}.main.subsection.title{font:var(--qds-main-subsection-title)}.main.subsection.title .icon{--qds-main-subsection-title-line-height:1.5rem;width:var(--qds-main-subsection-titles-icon-size);height:1.5rem;height:var(--qds-main-subsection-title-line-height)}.main.subsection.subtitle{font:var(--qds-main-subsection-subtitle)}.main.subsection.kicker{font:var(--qds-main-subsection-kicker)}.main.subsection.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-main-subsection-titles-icon-size, 0px) +\n var(--qds-main-subsection-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-main-subsection-titles-icon-size, 0px) +\n var(--qds-main-subsection-titles-gap, 0px)\n )}.panel.root.titles,.panel.root.title{gap:var(--qds-panel-titles-gap)}.panel.root.title{font:var(--qds-panel-title)}.panel.root.title .icon{--qds-panel-title-line-height:2rem;width:var(--qds-panel-titles-icon-size);height:2rem;height:var(--qds-panel-title-line-height)}.panel.root.subtitle{font:var(--qds-panel-subtitle)}.panel.root.kicker{font:var(--qds-panel-kicker)}.panel.root.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-panel-titles-icon-size, 0px) +\n var(--qds-panel-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-panel-titles-icon-size, 0px) +\n var(--qds-panel-titles-gap, 0px)\n )}.panel.section.titles,.panel.section.title{gap:var(--qds-panel-section-titles-gap)}.panel.section.title{font:var(--qds-panel-section-title)}.panel.section.title .icon{--qds-panel-section-title-line-height:1.5rem;width:var(--qds-panel-section-titles-icon-size);height:1.5rem;height:var(--qds-panel-section-title-line-height)}.panel.section.subtitle{font:var(--qds-panel-section-subtitle)}.panel.section.kicker{font:var(--qds-panel-section-kicker)}.panel.section.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-panel-section-titles-icon-size, 0px) +\n var(--qds-panel-section-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-panel-section-titles-icon-size, 0px) +\n var(--qds-panel-section-titles-gap, 0px)\n )}.panel.subsection.titles,.panel.subsection.title{gap:var(--qds-panel-subsection-titles-gap)}.panel.subsection.title{font:var(--qds-panel-subsection-title)}.panel.subsection.title .icon{--qds-panel-subsection-title-line-height:1.25rem;width:var(--qds-panel-subsection-titles-icon-size);height:1.25rem;height:var(--qds-panel-subsection-title-line-height)}.panel.subsection.subtitle{font:var(--qds-panel-subsection-subtitle)}.panel.subsection.kicker{font:var(--qds-panel-subsection-kicker)}.panel.subsection.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-panel-subsection-titles-icon-size, 0px) +\n var(--qds-panel-subsection-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-panel-subsection-titles-icon-size, 0px) +\n var(--qds-panel-subsection-titles-gap, 0px)\n )}.navigation.section.titles,.navigation.section.title{gap:var(--qds-navigation-section-titles-gap)}.navigation.section.title{font:var(--qds-navigation-section-title)}.navigation.section.title .icon{--qds-navigation-section-title-line-height:1.5rem;width:var(--qds-navigation-section-titles-icon-size);height:1.5rem;height:var(--qds-navigation-section-title-line-height)}.navigation.section.subtitle{font:var(--qds-navigation-section-subtitle)}.navigation.section.kicker{font:var(--qds-navigation-section-kicker)}.navigation.section.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-navigation-section-titles-icon-size, 0px) +\n var(--qds-navigation-section-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-navigation-section-titles-icon-size, 0px) +\n var(--qds-navigation-section-titles-gap, 0px)\n )}.navigation.subsection.titles,.navigation.subsection.title{gap:var(--qds-navigation-subsection-titles-gap)}.navigation.subsection.title{font:var(--qds-navigation-subsection-title)}.navigation.subsection.title .icon{--qds-navigation-subsection-title-line-height:1.25rem;width:var(--qds-navigation-subsection-titles-icon-size);height:1.25rem;height:var(--qds-navigation-subsection-title-line-height)}.navigation.subsection.subtitle{font:var(--qds-navigation-subsection-subtitle)}.navigation.subsection.kicker{font:var(--qds-navigation-subsection-kicker)}.navigation.subsection.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-navigation-subsection-titles-icon-size, 0px) +\n var(--qds-navigation-subsection-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-navigation-subsection-titles-icon-size, 0px) +\n var(--qds-navigation-subsection-titles-gap, 0px)\n )}.popup.root.titles,.popup.root.title{gap:var(--qds-popup-titles-gap)}.popup.root.title{font:var(--qds-popup-title)}.popup.root.title .icon{--qds-popup-title-line-height:1.75rem;width:var(--qds-popup-titles-icon-size);height:1.75rem;height:var(--qds-popup-title-line-height)}.popup.root.subtitle{font:var(--qds-popup-subtitle)}.popup.root.kicker{font:var(--qds-popup-kicker)}.popup.root.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-popup-titles-icon-size, 0px) +\n var(--qds-popup-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-popup-titles-icon-size, 0px) +\n var(--qds-popup-titles-gap, 0px)\n )}.popup.section.titles,.popup.section.title{gap:var(--qds-popup-section-titles-gap)}.popup.section.title{font:var(--qds-popup-section-title)}.popup.section.title .icon{--qds-popup-section-title-line-height:1.5rem;width:var(--qds-popup-section-titles-icon-size);height:1.5rem;height:var(--qds-popup-section-title-line-height)}.popup.section.subtitle{font:var(--qds-popup-section-subtitle)}.popup.section.kicker{font:var(--qds-popup-section-kicker)}.popup.section.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-popup-section-titles-icon-size, 0px) +\n var(--qds-popup-section-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-popup-section-titles-icon-size, 0px) +\n var(--qds-popup-section-titles-gap, 0px)\n )}.popup.subsection.titles,.popup.subsection.title{gap:var(--qds-popup-subsection-titles-gap)}.popup.subsection.title{font:var(--qds-popup-subsection-title)}.popup.subsection.title .icon{--qds-popup-subsection-title-line-height:1.25rem;width:var(--qds-popup-subsection-titles-icon-size);height:1.25rem;height:var(--qds-popup-subsection-title-line-height)}.popup.subsection.subtitle{font:var(--qds-popup-subsection-subtitle)}.popup.subsection.kicker{font:var(--qds-popup-subsection-kicker)}.popup.subsection.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-popup-subsection-titles-icon-size, 0px) +\n var(--qds-popup-subsection-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-popup-subsection-titles-icon-size, 0px) +\n var(--qds-popup-subsection-titles-gap, 0px)\n )}.accessory.root.titles,.accessory.root.title{gap:var(--qds-accessory-titles-gap)}.accessory.root.title{font:var(--qds-accessory-title)}.accessory.root.title .icon{--qds-accessory-title-line-height:1.5rem;width:var(--qds-accessory-titles-icon-size);height:1.5rem;height:var(--qds-accessory-title-line-height)}.accessory.root.subtitle{font:var(--qds-accessory-subtitle)}.accessory.root.kicker{font:var(--qds-accessory-kicker)}.accessory.root.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-accessory-titles-icon-size, 0px) +\n var(--qds-accessory-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-accessory-titles-icon-size, 0px) +\n var(--qds-accessory-titles-gap, 0px)\n )}.accessory.section.titles,.accessory.section.title{gap:var(--qds-accessory-section-titles-gap)}.accessory.section.title{font:var(--qds-accessory-section-title)}.accessory.section.title .icon{--qds-accessory-section-title-line-height:1.25rem;width:var(--qds-accessory-section-titles-icon-size);height:1.25rem;height:var(--qds-accessory-section-title-line-height)}.accessory.section.subtitle{font:var(--qds-accessory-section-subtitle)}.accessory.section.kicker{font:var(--qds-accessory-section-kicker)}.accessory.section.has-icon{-webkit-padding-start:calc(\n 0px +\n 0px\n );padding-inline-start:calc(\n 0px +\n 0px\n );-webkit-padding-start:calc(\n var(--qds-accessory-section-titles-icon-size, 0px) +\n var(--qds-accessory-section-titles-gap, 0px)\n );padding-inline-start:calc(\n var(--qds-accessory-section-titles-icon-size, 0px) +\n var(--qds-accessory-section-titles-gap, 0px)\n )}";
|
|
11
|
-
|
|
12
|
-
const Title = /*@__PURE__*/ proxyCustomElement(class Title extends HTMLElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
this.__registerHost();
|
|
16
|
-
this.__attachShadow();
|
|
17
|
-
this.inheritedAttributes = {};
|
|
18
|
-
this.iconName = undefined;
|
|
19
|
-
this.iconLibrary = 'default';
|
|
20
|
-
this.kicker = undefined;
|
|
21
|
-
this.layer = 'panel';
|
|
22
|
-
this.level = 'section';
|
|
23
|
-
this.subtitle = undefined;
|
|
24
|
-
this.tag = 'h2';
|
|
25
|
-
}
|
|
26
|
-
get hasSubtitle() {
|
|
27
|
-
return this.subtitle !== undefined && this.subtitle !== '';
|
|
28
|
-
}
|
|
29
|
-
get hasKicker() {
|
|
30
|
-
return this.kicker !== undefined && this.kicker !== '';
|
|
31
|
-
}
|
|
32
|
-
get hasIcon() {
|
|
33
|
-
return this.iconName !== undefined && this.iconName !== '';
|
|
34
|
-
}
|
|
35
|
-
componentWillLoad() {
|
|
36
|
-
this.inheritedAttributes = inheritAriaAttributes(this.element);
|
|
37
|
-
}
|
|
38
|
-
render() {
|
|
39
|
-
return (h("hgroup", { class: {
|
|
40
|
-
[this.layer]: true,
|
|
41
|
-
[this.level ?? 'root']: true,
|
|
42
|
-
titles: true,
|
|
43
|
-
}, ...this.inheritedAttributes }, h(this.tag, { class: {
|
|
44
|
-
[this.layer]: true,
|
|
45
|
-
[this.level ?? 'root']: true,
|
|
46
|
-
title: true,
|
|
47
|
-
} }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { class: "icon", name: this.iconName, library: this.iconLibrary })), h("div", null, h("slot", null))), this.hasSubtitle && (h("p", { class: {
|
|
48
|
-
[this.layer]: true,
|
|
49
|
-
[this.level ?? 'root']: true,
|
|
50
|
-
subtitle: true,
|
|
51
|
-
'has-icon': this.hasIcon,
|
|
52
|
-
} }, this.subtitle)), this.hasKicker && (h("p", { class: {
|
|
53
|
-
[this.layer]: true,
|
|
54
|
-
[this.level ?? 'root']: true,
|
|
55
|
-
kicker: true,
|
|
56
|
-
'has-icon': this.hasIcon,
|
|
57
|
-
} }, this.kicker))));
|
|
58
|
-
}
|
|
59
|
-
get element() { return this; }
|
|
60
|
-
static get style() { return titleCss; }
|
|
61
|
-
}, [1, "qds-title", {
|
|
62
|
-
"iconName": [513, "icon-name"],
|
|
63
|
-
"iconLibrary": [513, "icon-library"],
|
|
64
|
-
"kicker": [1],
|
|
65
|
-
"layer": [1],
|
|
66
|
-
"level": [1],
|
|
67
|
-
"subtitle": [1],
|
|
68
|
-
"tag": [1]
|
|
69
|
-
}]);
|
|
70
|
-
function defineCustomElement$1() {
|
|
71
|
-
if (typeof customElements === "undefined") {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const components = ["qds-title", "qds-icon"];
|
|
75
|
-
components.forEach(tagName => { switch (tagName) {
|
|
76
|
-
case "qds-title":
|
|
77
|
-
if (!customElements.get(tagName)) {
|
|
78
|
-
customElements.define(tagName, Title);
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
81
|
-
case "qds-icon":
|
|
82
|
-
if (!customElements.get(tagName)) {
|
|
83
|
-
defineCustomElement$2();
|
|
84
|
-
}
|
|
85
|
-
break;
|
|
86
|
-
} });
|
|
87
|
-
}
|
|
6
|
+
import { T as Title, d as defineCustomElement$1 } from './p-3baf75f4.js';
|
|
88
7
|
|
|
89
8
|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WAAW,GACzB,CACH,EACD,eACE,eAAQ,CACJ,CACG,EACV,IAAI,CAAC,WAAW,KACf,SACE,KAAK,EAAE;QACL,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI;QAClB,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,GAAG,IAAI;QAC5B,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI,CAAC,OAAO;OACzB,IAEA,IAAI,CAAC,QAAQ,CACZ,CACL,EACA,IAAI,CAAC,SAAS,KACb,SACE,KAAK,EAAE;QACL,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI;QAClB,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,GAAG,IAAI;QAC5B,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI,CAAC,OAAO;OACzB,IAEA,IAAI,CAAC,MAAM,CACV,CACL,CACM,EACV;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/title/title.css?tag=qds-title&encapsulation=shadow","src/components/title/title.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2023 Schneider Electric\n *\n * SPDX-License-Identifier: LGPL-2.1-only\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n.titles,\n.title {\n display: flex;\n}\n\n.titles {\n flex-direction: column;\n}\n\n.title,\n.subtitle,\n.kicker {\n margin-block: 0;\n}\n\n.icon {\n flex-shrink: 0;\n}\n\n.title {\n font-weight: initial;\n font-size: initial;\n color: var(--qds-theme-title);\n}\n\n.subtitle {\n color: var(--qds-theme-subtitle);\n}\n\n.kicker {\n color: var(--qds-theme-kicker);\n order: -1;\n}\n\n.subtitle,\n.kicker {\n overflow-wrap: break-word;\n}\n\n.main {\n &.section {\n &.titles,\n &.title {\n gap: var(--qds-main-section-titles-gap);\n }\n\n &.title {\n font: var(--qds-main-section-title);\n\n & .icon {\n --qds-main-section-title-line-height: 2rem;\n\n width: var(--qds-main-section-titles-icon-size);\n height: var(--qds-main-section-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-main-section-subtitle);\n }\n\n &.kicker {\n font: var(--qds-main-section-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-main-section-titles-icon-size, 0px) +\n var(--qds-main-section-titles-gap, 0px)\n );\n }\n\n &.has-icon-end {\n padding-inline-end: calc(\n var(--qds-main-section-titles-icon-size, 0px) +\n var(--qds-main-section-titles-gap, 0px)\n );\n }\n }\n\n &.subsection {\n &.titles,\n &.title {\n gap: var(--qds-main-subsection-titles-gap);\n }\n\n &.title {\n font: var(--qds-main-subsection-title);\n\n & .icon {\n --qds-main-subsection-title-line-height: 1.5rem;\n\n width: var(--qds-main-subsection-titles-icon-size);\n height: var(--qds-main-subsection-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-main-subsection-subtitle);\n }\n\n &.kicker {\n font: var(--qds-main-subsection-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-main-subsection-titles-icon-size, 0px) +\n var(--qds-main-subsection-titles-gap, 0px)\n );\n }\n }\n}\n\n.panel {\n &.root {\n &.titles,\n &.title {\n gap: var(--qds-panel-titles-gap);\n }\n\n &.title {\n font: var(--qds-panel-title);\n\n & .icon {\n --qds-panel-title-line-height: 2rem;\n\n width: var(--qds-panel-titles-icon-size);\n height: var(--qds-panel-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-panel-subtitle);\n }\n\n &.kicker {\n font: var(--qds-panel-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-panel-titles-icon-size, 0px) +\n var(--qds-panel-titles-gap, 0px)\n );\n }\n }\n\n &.section {\n &.titles,\n &.title {\n gap: var(--qds-panel-section-titles-gap);\n }\n\n &.title {\n font: var(--qds-panel-section-title);\n\n & .icon {\n --qds-panel-section-title-line-height: 1.5rem;\n\n width: var(--qds-panel-section-titles-icon-size);\n height: var(--qds-panel-section-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-panel-section-subtitle);\n }\n\n &.kicker {\n font: var(--qds-panel-section-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-panel-section-titles-icon-size, 0px) +\n var(--qds-panel-section-titles-gap, 0px)\n );\n }\n }\n\n &.subsection {\n &.titles,\n &.title {\n gap: var(--qds-panel-subsection-titles-gap);\n }\n\n &.title {\n font: var(--qds-panel-subsection-title);\n\n & .icon {\n --qds-panel-subsection-title-line-height: 1.25rem;\n\n width: var(--qds-panel-subsection-titles-icon-size);\n height: var(--qds-panel-subsection-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-panel-subsection-subtitle);\n }\n\n &.kicker {\n font: var(--qds-panel-subsection-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-panel-subsection-titles-icon-size, 0px) +\n var(--qds-panel-subsection-titles-gap, 0px)\n );\n }\n }\n}\n\n.navigation {\n &.section {\n &.titles,\n &.title {\n gap: var(--qds-navigation-section-titles-gap);\n }\n\n &.title {\n font: var(--qds-navigation-section-title);\n\n & .icon {\n --qds-navigation-section-title-line-height: 1.5rem;\n\n width: var(--qds-navigation-section-titles-icon-size);\n height: var(--qds-navigation-section-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-navigation-section-subtitle);\n }\n\n &.kicker {\n font: var(--qds-navigation-section-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-navigation-section-titles-icon-size, 0px) +\n var(--qds-navigation-section-titles-gap, 0px)\n );\n }\n }\n\n &.subsection {\n &.titles,\n &.title {\n gap: var(--qds-navigation-subsection-titles-gap);\n }\n\n &.title {\n font: var(--qds-navigation-subsection-title);\n\n & .icon {\n --qds-navigation-subsection-title-line-height: 1.25rem;\n\n width: var(--qds-navigation-subsection-titles-icon-size);\n height: var(--qds-navigation-subsection-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-navigation-subsection-subtitle);\n }\n\n &.kicker {\n font: var(--qds-navigation-subsection-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-navigation-subsection-titles-icon-size, 0px) +\n var(--qds-navigation-subsection-titles-gap, 0px)\n );\n }\n }\n}\n\n.popup {\n &.root {\n &.titles,\n &.title {\n gap: var(--qds-popup-titles-gap);\n }\n\n &.title {\n font: var(--qds-popup-title);\n\n & .icon {\n --qds-popup-title-line-height: 1.75rem;\n\n width: var(--qds-popup-titles-icon-size);\n height: var(--qds-popup-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-popup-subtitle);\n }\n\n &.kicker {\n font: var(--qds-popup-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-popup-titles-icon-size, 0px) +\n var(--qds-popup-titles-gap, 0px)\n );\n }\n }\n\n &.section {\n &.titles,\n &.title {\n gap: var(--qds-popup-section-titles-gap);\n }\n\n &.title {\n font: var(--qds-popup-section-title);\n\n & .icon {\n --qds-popup-section-title-line-height: 1.5rem;\n\n width: var(--qds-popup-section-titles-icon-size);\n height: var(--qds-popup-section-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-popup-section-subtitle);\n }\n\n &.kicker {\n font: var(--qds-popup-section-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-popup-section-titles-icon-size, 0px) +\n var(--qds-popup-section-titles-gap, 0px)\n );\n }\n }\n\n &.subsection {\n &.titles,\n &.title {\n gap: var(--qds-popup-subsection-titles-gap);\n }\n\n &.title {\n font: var(--qds-popup-subsection-title);\n\n & .icon {\n --qds-popup-subsection-title-line-height: 1.25rem;\n\n width: var(--qds-popup-subsection-titles-icon-size);\n height: var(--qds-popup-subsection-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-popup-subsection-subtitle);\n }\n\n &.kicker {\n font: var(--qds-popup-subsection-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-popup-subsection-titles-icon-size, 0px) +\n var(--qds-popup-subsection-titles-gap, 0px)\n );\n }\n }\n}\n\n.accessory {\n &.root {\n &.titles,\n &.title {\n gap: var(--qds-accessory-titles-gap);\n }\n\n &.title {\n font: var(--qds-accessory-title);\n\n & .icon {\n --qds-accessory-title-line-height: 1.5rem;\n\n width: var(--qds-accessory-titles-icon-size);\n height: var(--qds-accessory-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-accessory-subtitle);\n }\n\n &.kicker {\n font: var(--qds-accessory-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-accessory-titles-icon-size, 0px) +\n var(--qds-accessory-titles-gap, 0px)\n );\n }\n }\n\n &.section {\n &.titles,\n &.title {\n gap: var(--qds-accessory-section-titles-gap);\n }\n\n &.title {\n font: var(--qds-accessory-section-title);\n\n & .icon {\n --qds-accessory-section-title-line-height: 1.25rem;\n\n width: var(--qds-accessory-section-titles-icon-size);\n height: var(--qds-accessory-section-title-line-height);\n }\n }\n\n &.subtitle {\n font: var(--qds-accessory-section-subtitle);\n }\n\n &.kicker {\n font: var(--qds-accessory-section-kicker);\n }\n\n &.has-icon {\n padding-inline-start: calc(\n var(--qds-accessory-section-titles-icon-size, 0px) +\n var(--qds-accessory-section-titles-gap, 0px)\n );\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2023 Schneider Electric\n//\n// SPDX-License-Identifier: LGPL-2.1-only\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'\n\nexport type Layer = 'accessory' | 'main' | 'navigation' | 'panel' | 'popup'\nexport type Level = 'section' | 'subsection'\nexport type Tag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\n/**\n * @slot Content to display for the title.\n * @see https://quartz.se.com/build/components/title\n */\n@Component({\n tag: 'qds-title',\n shadow: true,\n styleUrl: 'title.css',\n})\nexport class Title implements ComponentInterface {\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop({ reflect: true }) public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop({ reflect: true }) public readonly iconLibrary: string = 'default'\n\n /**\n * Text to display for the kicker.\n */\n @Prop() public readonly kicker?: string\n\n @Prop() public readonly layer: Layer = 'panel'\n\n @Prop() public readonly level?: Level = 'section'\n\n /**\n * Text to display for the subtitle.\n */\n @Prop() public readonly subtitle?: string\n\n /**\n * HTML tag to use to render the title.\n */\n @Prop() public readonly tag: Tag = 'h2'\n\n @Element() private readonly element!: HTMLQdsTitleElement\n\n private inheritedAttributes: Attributes = {}\n\n private get hasSubtitle(): boolean {\n return this.subtitle !== undefined && this.subtitle !== ''\n }\n\n private get hasKicker(): boolean {\n return this.kicker !== undefined && this.kicker !== ''\n }\n\n private get hasIcon(): boolean {\n return this.iconName !== undefined && this.iconName !== ''\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n }\n\n public render() {\n return (\n <hgroup\n class={{\n [this.layer]: true,\n [this.level ?? 'root']: true,\n titles: true,\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n >\n <this.tag\n class={{\n [this.layer]: true,\n [this.level ?? 'root']: true,\n title: true,\n }}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"icon\"\n name={this.iconName}\n library={this.iconLibrary}\n />\n )}\n <div>\n <slot />\n </div>\n </this.tag>\n {this.hasSubtitle && (\n <p\n class={{\n [this.layer]: true,\n [this.level ?? 'root']: true,\n subtitle: true,\n 'has-icon': this.hasIcon,\n }}\n >\n {this.subtitle}\n </p>\n )}\n {this.hasKicker && (\n <p\n class={{\n [this.layer]: true,\n [this.level ?? 'root']: true,\n kicker: true,\n 'has-icon': this.hasIcon,\n }}\n >\n {this.kicker}\n </p>\n )}\n </hgroup>\n )\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"qds-title.js","mappings":";;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../dist/types/components";
|
|
|
2
2
|
|
|
3
3
|
interface QdsTooltip extends Components.QdsTooltip, HTMLElement {}
|
|
4
4
|
export const QdsTooltip: {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
prototype: QdsTooltip;
|
|
6
|
+
new (): QdsTooltip;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -1,321 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SPDX-FileCopyrightText: ©
|
|
2
|
+
* SPDX-FileCopyrightText: © 2025 Schneider Electric
|
|
3
3
|
*
|
|
4
|
-
* SPDX-License-Identifier:
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { o as offset, f as flip, s as shift, l as limitShift, b as arrow, c as computePosition, a as autoUpdate } from './floating-ui.dom.esm.js';
|
|
8
|
-
import { c as ignorePromise, d as propertyToPx, a as invariant, r as roundByDPR, f as isTouchDevice } from './helpers.js';
|
|
9
|
-
|
|
10
|
-
const tooltipCss = ":host{box-sizing:border-box}:host([hidden]){display:none !important}:host([hidden]){}:host *,:host *::before,:host *::after{box-sizing:inherit}:host{align-items:flex-start;background-color:var(--qds-theme-accessory-background);border-radius:var(--qds-accessory-border-radius);box-shadow:var(--qds-theme-accessory-elevation);color:var(--qds-theme-text-standard);display:flex;flex-direction:column;gap:var(--qds-accessory-gap-children-unrelated);left:0;padding:var(--qds-accessory-padding);top:0}:host([aria-hidden='true']){display:none}:host::before{content:'';height:100%;left:0;position:absolute;top:0;width:100%}::slotted(blockquote),::slotted(button),::slotted(dd),::slotted(dl),::slotted(fieldset),::slotted(figure),::slotted(h1),::slotted(h2),::slotted(h3),::slotted(h4),::slotted(h5),::slotted(h6),::slotted(hr),::slotted(input),::slotted(menu),::slotted(ol),::slotted(p),::slotted(pre),::slotted(select),::slotted(textarea),::slotted(ul){margin:0}:host([data-side='top'])::before,:host([data-side='bottom'])::before{height:calc(\n 0px +\n 0px\n );height:calc(\n var(--qds-accessory-gap-floating, 0px) +\n var(--qds-signature-triangle-pointer-size-height, 0px)\n );top:100%}:host([data-side='bottom'])::before{top:calc(\n -1 * (0px +\n 0px)\n );top:calc(\n -1 * (var(--qds-accessory-gap-floating, 0px) +\n var(--qds-signature-triangle-pointer-size-height, 0px))\n )}:host([data-side='left'])::before,:host([data-side='right'])::before{width:calc(\n 0px +\n 0px\n );width:calc(\n var(--qds-accessory-gap-floating, 0px) +\n var(--qds-signature-triangle-pointer-size-height, 0px)\n );left:100%}:host([data-side='right'])::before{left:calc(\n -1 * (0px +\n 0px)\n );left:calc(\n -1 * (var(--qds-accessory-gap-floating, 0px) +\n var(--qds-signature-triangle-pointer-size-height, 0px))\n )}.arrow-container{height:var(--qds-signature-triangle-pointer-size-width);position:absolute;width:var(--qds-signature-triangle-pointer-size-width)}.arrow-container[data-side='bottom']{bottom:100%;transform:rotate(180deg)}.arrow-container[data-side='left']{left:100%;transform:rotate(-90deg)}.arrow-container[data-side='right']{right:100%;transform:rotate(90deg)}.arrow-container[data-side='top']{top:100%}.arrow{fill:var(--qds-theme-accessory-background)}";
|
|
11
|
-
|
|
12
|
-
let autoIncrementingId = 1;
|
|
13
|
-
const Tooltip = /*@__PURE__*/ proxyCustomElement(class Tooltip extends HTMLElement {
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
this.__registerHost();
|
|
17
|
-
this.__attachShadow();
|
|
18
|
-
this.closeEmitter = createEvent(this, "qdsClose", 2);
|
|
19
|
-
this.clickedTooltip = false;
|
|
20
|
-
this.isTouchDevice = false;
|
|
21
|
-
this.arrowContainerRef = (svg) => {
|
|
22
|
-
this.arrowContainerElement = svg;
|
|
23
|
-
};
|
|
24
|
-
this.boundTooltipMouseDown = () => {
|
|
25
|
-
this.clickedTooltip = true;
|
|
26
|
-
};
|
|
27
|
-
this.boundFocus = () => {
|
|
28
|
-
ignorePromise(this.handleFocus());
|
|
29
|
-
};
|
|
30
|
-
this.boundMouseEnter = () => {
|
|
31
|
-
ignorePromise(this.handleMouseEnter());
|
|
32
|
-
};
|
|
33
|
-
this.boundMouseLeave = (event) => {
|
|
34
|
-
ignorePromise(this.handleMouseLeave(event));
|
|
35
|
-
};
|
|
36
|
-
this.boundFocusout = (event) => {
|
|
37
|
-
ignorePromise(this.handleFocusOut(event));
|
|
38
|
-
};
|
|
39
|
-
this.boundReferenceClick = () => {
|
|
40
|
-
ignorePromise(this.handleReferenceClick());
|
|
41
|
-
};
|
|
42
|
-
this.autoUpdateOptions = undefined;
|
|
43
|
-
this.disabled = false;
|
|
44
|
-
this.flipOptions = undefined;
|
|
45
|
-
this.noFlip = false;
|
|
46
|
-
this.noShift = false;
|
|
47
|
-
this.offsetOptions = undefined;
|
|
48
|
-
this.placement = 'top';
|
|
49
|
-
this.shiftOptions = undefined;
|
|
50
|
-
this.strategy = undefined;
|
|
51
|
-
this.target = undefined;
|
|
52
|
-
this.hostPosition = undefined;
|
|
53
|
-
this.hostTransform = undefined;
|
|
54
|
-
this.open = false;
|
|
55
|
-
this.middleware = undefined;
|
|
56
|
-
this.aDisplay = undefined;
|
|
57
|
-
this.side = 'top';
|
|
58
|
-
this.aShape = '';
|
|
59
|
-
this.aViewbox = '';
|
|
60
|
-
this.aHeight = 0;
|
|
61
|
-
this.aWidth = 0;
|
|
62
|
-
this.aGap = 0;
|
|
63
|
-
this.aX = '';
|
|
64
|
-
this.aY = '';
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Show the tooltip.
|
|
68
|
-
*/
|
|
69
|
-
async show() {
|
|
70
|
-
if (this.open)
|
|
71
|
-
return;
|
|
72
|
-
if (this.referenceElement instanceof globalThis.Element)
|
|
73
|
-
this.referenceElement.addEventListener('focusout', this.boundFocusout);
|
|
74
|
-
this.open = true;
|
|
75
|
-
this.element.setAttribute('aria-hidden', 'false');
|
|
76
|
-
this.startAutoUpdate();
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Close the tooltip.
|
|
80
|
-
*/
|
|
81
|
-
async close() {
|
|
82
|
-
if (!this.open)
|
|
83
|
-
return;
|
|
84
|
-
this.closeEmitter.emit();
|
|
85
|
-
if (this.referenceElement instanceof globalThis.Element)
|
|
86
|
-
this.referenceElement.removeEventListener('focusout', this.boundFocusout);
|
|
87
|
-
this.open = false;
|
|
88
|
-
this.clickedTooltip = false;
|
|
89
|
-
this.element.setAttribute('aria-hidden', 'true');
|
|
90
|
-
if (this.cleanup)
|
|
91
|
-
this.cleanup();
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Update the tooltip's arrow.
|
|
95
|
-
*
|
|
96
|
-
* This method should typically be called when the Quartz platform was
|
|
97
|
-
* changed.
|
|
98
|
-
*/
|
|
99
|
-
async updateArrow() {
|
|
100
|
-
this.aGap = propertyToPx(this.element, '--qds-accessory-gap-floating') ?? 0;
|
|
101
|
-
this.aHeight =
|
|
102
|
-
propertyToPx(this.element, `--qds-signature-triangle-pointer-size-height`) ?? 0;
|
|
103
|
-
this.aWidth =
|
|
104
|
-
propertyToPx(this.element, `--qds-signature-triangle-pointer-size-width`) ?? 0;
|
|
105
|
-
this.aViewbox = `0 0 ${this.aWidth} ${Math.max(this.aHeight, this.aWidth)}`;
|
|
106
|
-
const aTipRadius = propertyToPx(this.element, `--qds-signature-triangle-pointer-tip-radius`) ?? 0;
|
|
107
|
-
const svgX = (this.aWidth / 2) * (aTipRadius / -8 + 1);
|
|
108
|
-
const svgY = ((this.aHeight / 2) * aTipRadius) / 4;
|
|
109
|
-
this.aShape =
|
|
110
|
-
'M0,0' +
|
|
111
|
-
` H${this.aWidth}` +
|
|
112
|
-
` L${this.aWidth - svgX},${this.aHeight - svgY}` +
|
|
113
|
-
` Q${this.aWidth / 2},${this.aHeight} ${svgX},${this.aHeight - svgY}` +
|
|
114
|
-
' Z';
|
|
115
|
-
}
|
|
116
|
-
async handleMouseDown(event) {
|
|
117
|
-
const composedPath = event.composedPath();
|
|
118
|
-
const withinBounds = composedPath.includes(this.element) ||
|
|
119
|
-
(this.referenceElement instanceof globalThis.Element &&
|
|
120
|
-
composedPath.includes(this.referenceElement));
|
|
121
|
-
if (!withinBounds)
|
|
122
|
-
await this.close();
|
|
123
|
-
}
|
|
124
|
-
async updateMiddleware() {
|
|
125
|
-
invariant(this.arrowContainerElement);
|
|
126
|
-
this.middleware = [
|
|
127
|
-
offset({
|
|
128
|
-
...this.offsetOptions,
|
|
129
|
-
mainAxis: this.aGap + this.aHeight,
|
|
130
|
-
}),
|
|
131
|
-
!this.noFlip &&
|
|
132
|
-
flip({
|
|
133
|
-
crossAxis: this.noShift,
|
|
134
|
-
...this.flipOptions,
|
|
135
|
-
}),
|
|
136
|
-
!this.noShift &&
|
|
137
|
-
shift({
|
|
138
|
-
limiter: limitShift(),
|
|
139
|
-
...this.shiftOptions,
|
|
140
|
-
}),
|
|
141
|
-
arrow({
|
|
142
|
-
element: this.arrowContainerElement,
|
|
143
|
-
}),
|
|
144
|
-
].filter((middleware) => middleware !== false);
|
|
145
|
-
}
|
|
146
|
-
async updateReferenceElement() {
|
|
147
|
-
var _a;
|
|
148
|
-
this.disconnectReferenceElement();
|
|
149
|
-
const resolvedTarget = typeof this.target === 'function' ? this.target() : this.target;
|
|
150
|
-
if (typeof resolvedTarget === 'string') {
|
|
151
|
-
const element = document.querySelector(resolvedTarget);
|
|
152
|
-
if (element === null)
|
|
153
|
-
throw new Error('String `target` must resolve to an Element.');
|
|
154
|
-
this.referenceElement = element;
|
|
155
|
-
}
|
|
156
|
-
else
|
|
157
|
-
this.referenceElement = resolvedTarget;
|
|
158
|
-
if (!(this.referenceElement instanceof globalThis.Element))
|
|
159
|
-
return;
|
|
160
|
-
if (this.isTouchDevice)
|
|
161
|
-
this.referenceElement.addEventListener('click', this.boundReferenceClick);
|
|
162
|
-
this.referenceElement.addEventListener('focus', this.boundFocus);
|
|
163
|
-
this.referenceElement.addEventListener('mouseenter', this.boundMouseEnter);
|
|
164
|
-
this.referenceElement.addEventListener('mouseleave', this.boundMouseLeave);
|
|
165
|
-
(_a = this.element).id || (_a.id = `qds-tooltip-${autoIncrementingId}`);
|
|
166
|
-
this.referenceElement.setAttribute('aria-describedby', this.element.id);
|
|
167
|
-
}
|
|
168
|
-
async updatePosition() {
|
|
169
|
-
invariant(this.referenceElement);
|
|
170
|
-
const { x, y, middlewareData, placement, strategy } = await computePosition(this.referenceElement, this.element, {
|
|
171
|
-
middleware: this.middleware,
|
|
172
|
-
placement: this.placement,
|
|
173
|
-
strategy: this.strategy,
|
|
174
|
-
});
|
|
175
|
-
this.hostPosition = strategy;
|
|
176
|
-
this.hostTransform = `translate(${roundByDPR(x)}px,${roundByDPR(y)}px)`;
|
|
177
|
-
if (!middlewareData.arrow)
|
|
178
|
-
return;
|
|
179
|
-
invariant(this.arrowContainerElement);
|
|
180
|
-
if (middlewareData.arrow.centerOffset !== 0) {
|
|
181
|
-
this.aDisplay = 'none';
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
this.aDisplay = undefined;
|
|
185
|
-
const [side] = placement.split('-');
|
|
186
|
-
this.side = side;
|
|
187
|
-
const { x: aX, y: aY } = middlewareData.arrow;
|
|
188
|
-
this.aX = aX === undefined ? '' : `${aX}px`;
|
|
189
|
-
this.aY = aY === undefined ? '' : `${aY}px`;
|
|
190
|
-
}
|
|
191
|
-
startAutoUpdate() {
|
|
192
|
-
invariant(this.referenceElement);
|
|
193
|
-
if (this.cleanup)
|
|
194
|
-
this.cleanup();
|
|
195
|
-
this.cleanup = autoUpdate(this.referenceElement, this.element, () => {
|
|
196
|
-
ignorePromise(this.updatePosition());
|
|
197
|
-
}, this.autoUpdateOptions);
|
|
198
|
-
}
|
|
199
|
-
async componentWillLoad() {
|
|
200
|
-
this.isTouchDevice = isTouchDevice();
|
|
201
|
-
this.element.setAttribute('aria-hidden', 'true');
|
|
202
|
-
await this.updateReferenceElement();
|
|
203
|
-
autoIncrementingId += 1;
|
|
204
|
-
}
|
|
205
|
-
async componentDidLoad() {
|
|
206
|
-
await this.updateArrow();
|
|
207
|
-
}
|
|
208
|
-
disconnectedCallback() {
|
|
209
|
-
this.disconnectReferenceElement();
|
|
210
|
-
}
|
|
211
|
-
render() {
|
|
212
|
-
return (h(Host, { "data-side": this.side, onFocusout: this.boundFocusout, onMouseDown: this.boundTooltipMouseDown, onMouseLeave: this.boundMouseLeave, role: this.element.role ?? 'tooltip', style: {
|
|
213
|
-
position: this.hostPosition,
|
|
214
|
-
transform: this.hostTransform,
|
|
215
|
-
} }, h("slot", null), h("svg", { "aria-hidden": true, "data-side": this.side, class: "arrow-container", ref: this.arrowContainerRef, viewBox: this.aViewbox, style: {
|
|
216
|
-
left: this.aX,
|
|
217
|
-
top: this.aY,
|
|
218
|
-
display: this.aDisplay,
|
|
219
|
-
} }, h("path", { class: "arrow", d: this.aShape }))));
|
|
220
|
-
}
|
|
221
|
-
async handleFocus() {
|
|
222
|
-
if (!this.disabled)
|
|
223
|
-
await this.show();
|
|
224
|
-
}
|
|
225
|
-
async handleMouseEnter() {
|
|
226
|
-
if (!this.disabled)
|
|
227
|
-
await this.show();
|
|
228
|
-
}
|
|
229
|
-
async handleMouseLeave(event) {
|
|
230
|
-
if (!this.clickedTooltip &&
|
|
231
|
-
document.activeElement !== this.referenceElement &&
|
|
232
|
-
document.activeElement?.closest('qds-tooltip') !== this.element &&
|
|
233
|
-
event instanceof MouseEvent &&
|
|
234
|
-
event.relatedTarget !== this.referenceElement &&
|
|
235
|
-
event.relatedTarget !== this.element)
|
|
236
|
-
await this.close();
|
|
237
|
-
}
|
|
238
|
-
async handleFocusOut(event) {
|
|
239
|
-
if (!(event instanceof FocusEvent))
|
|
240
|
-
return;
|
|
241
|
-
const { relatedTarget } = event;
|
|
242
|
-
if (relatedTarget instanceof globalThis.Element &&
|
|
243
|
-
!this.element.contains(relatedTarget) &&
|
|
244
|
-
this.referenceElement !== relatedTarget)
|
|
245
|
-
await this.close();
|
|
246
|
-
}
|
|
247
|
-
async handleReferenceClick() {
|
|
248
|
-
if (!this.disabled)
|
|
249
|
-
await (this.open ? this.close() : this.show());
|
|
250
|
-
}
|
|
251
|
-
disconnectReferenceElement() {
|
|
252
|
-
if (!(this.referenceElement instanceof globalThis.Element))
|
|
253
|
-
return;
|
|
254
|
-
if (this.isTouchDevice)
|
|
255
|
-
this.referenceElement.removeEventListener('click', this.boundReferenceClick);
|
|
256
|
-
this.referenceElement.removeEventListener('focus', this.boundFocus);
|
|
257
|
-
this.referenceElement.removeEventListener('focusout', this.boundFocusout);
|
|
258
|
-
this.referenceElement.removeEventListener('mouseenter', this.boundMouseEnter);
|
|
259
|
-
this.referenceElement.removeEventListener('mouseleave', this.boundMouseLeave);
|
|
260
|
-
this.referenceElement.removeAttribute('aria-describedby');
|
|
261
|
-
}
|
|
262
|
-
get element() { return this; }
|
|
263
|
-
static get watchers() { return {
|
|
264
|
-
"aGap": ["updateMiddleware"],
|
|
265
|
-
"aHeight": ["updateMiddleware"],
|
|
266
|
-
"flipOptions": ["updateMiddleware"],
|
|
267
|
-
"noFlip": ["updateMiddleware"],
|
|
268
|
-
"noShift": ["updateMiddleware"],
|
|
269
|
-
"offsetOptions": ["updateMiddleware"],
|
|
270
|
-
"shiftOptions": ["updateMiddleware"],
|
|
271
|
-
"target": ["updateReferenceElement"],
|
|
272
|
-
"middleware": ["updatePosition"],
|
|
273
|
-
"placement": ["updatePosition"],
|
|
274
|
-
"strategy": ["updatePosition"],
|
|
275
|
-
"autoUpdateOptions": ["startAutoUpdate"]
|
|
276
|
-
}; }
|
|
277
|
-
static get style() { return tooltipCss; }
|
|
278
|
-
}, [1, "qds-tooltip", {
|
|
279
|
-
"autoUpdateOptions": [16],
|
|
280
|
-
"disabled": [1028],
|
|
281
|
-
"flipOptions": [16],
|
|
282
|
-
"noFlip": [4, "no-flip"],
|
|
283
|
-
"noShift": [4, "no-shift"],
|
|
284
|
-
"offsetOptions": [16],
|
|
285
|
-
"placement": [1],
|
|
286
|
-
"shiftOptions": [16],
|
|
287
|
-
"strategy": [1],
|
|
288
|
-
"target": [1],
|
|
289
|
-
"hostPosition": [32],
|
|
290
|
-
"hostTransform": [32],
|
|
291
|
-
"open": [32],
|
|
292
|
-
"middleware": [32],
|
|
293
|
-
"aDisplay": [32],
|
|
294
|
-
"side": [32],
|
|
295
|
-
"aShape": [32],
|
|
296
|
-
"aViewbox": [32],
|
|
297
|
-
"aHeight": [32],
|
|
298
|
-
"aWidth": [32],
|
|
299
|
-
"aGap": [32],
|
|
300
|
-
"aX": [32],
|
|
301
|
-
"aY": [32],
|
|
302
|
-
"show": [64],
|
|
303
|
-
"close": [64],
|
|
304
|
-
"updateArrow": [64]
|
|
305
|
-
}, [[5, "mousedown", "handleMouseDown"]]]);
|
|
306
|
-
function defineCustomElement$1() {
|
|
307
|
-
if (typeof customElements === "undefined") {
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
const components = ["qds-tooltip"];
|
|
311
|
-
components.forEach(tagName => { switch (tagName) {
|
|
312
|
-
case "qds-tooltip":
|
|
313
|
-
if (!customElements.get(tagName)) {
|
|
314
|
-
customElements.define(tagName, Tooltip);
|
|
315
|
-
}
|
|
316
|
-
break;
|
|
317
|
-
} });
|
|
318
|
-
}
|
|
6
|
+
import { T as Tooltip, d as defineCustomElement$1 } from './p-c80f112a.js';
|
|
319
7
|
|
|
320
8
|
const QdsTooltip = Tooltip;
|
|
321
9
|
const defineCustomElement = defineCustomElement$1;
|