@dubai-design-system/components-js 3.12.16 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/dist/cjs/dda-accordion.cjs.entry.js +4 -4
- package/dist/cjs/dda-alert.cjs.entry.js +11 -4
- package/dist/cjs/dda-attach-file.cjs.entry.js +19 -4
- package/dist/cjs/dda-avatar.cjs.entry.js +12 -6
- package/dist/cjs/dda-banner.cjs.entry.js +2 -2
- package/dist/cjs/dda-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/dda-button.cjs.entry.js +3 -3
- package/dist/cjs/dda-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/dda-chip.cjs.entry.js +4 -4
- package/dist/cjs/dda-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/dda-creditcard-field.cjs.entry.js +22 -4
- package/dist/cjs/dda-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/dda-footer.cjs.entry.js +5 -3
- package/dist/cjs/dda-header.cjs.entry.js +3 -3
- package/dist/cjs/dda-home-banner.cjs.entry.js +172 -13
- package/dist/cjs/dda-horizontal-stepper.cjs.entry.js +4 -4
- package/dist/cjs/dda-input.cjs.entry.js +21 -4
- package/dist/cjs/dda-link-button_2.cjs.entry.js +7 -7
- package/dist/cjs/dda-number-field.cjs.entry.js +19 -4
- package/dist/cjs/dda-pagination.cjs.entry.js +4 -4
- package/dist/cjs/dda-phonefield.cjs.entry.js +22 -4
- package/dist/cjs/dda-progressbar.cjs.entry.js +5 -4
- package/dist/cjs/dda-range-slider.cjs.entry.js +4 -4
- package/dist/cjs/dda-search-input.cjs.entry.js +23 -6
- package/dist/cjs/dda-segmented-tabs.cjs.entry.js +30 -5
- package/dist/cjs/dda-select.cjs.entry.js +114 -5
- package/dist/cjs/dda-sticky-footer.cjs.entry.js +5 -3
- package/dist/cjs/dda-tabs.cjs.entry.js +3 -3
- package/dist/cjs/dda-textarea.cjs.entry.js +74 -5
- package/dist/cjs/dda-toggle.cjs.entry.js +3 -3
- package/dist/cjs/dda-tooltip.cjs.entry.js +29 -4
- package/dist/cjs/dda-ui-card.cjs.entry.js +2 -2
- package/dist/cjs/dda-vertical-stepper.cjs.entry.js +2 -2
- package/dist/cjs/dda.cjs.js +3 -4
- package/dist/cjs/index-DGHrEPBX.js +1986 -0
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/collection/components/dda-accordion/dda-accordion.css +10 -0
- package/dist/collection/components/dda-accordion/dda-accordion.js +1 -1
- package/dist/collection/components/dda-alert/dda-alert.js +8 -1
- package/dist/collection/components/dda-attach-file/dda-attach-file.js +16 -1
- package/dist/collection/components/dda-avatar/dda-avatar.css +25 -1
- package/dist/collection/components/dda-avatar/dda-avatar.js +8 -2
- package/dist/collection/components/dda-chip/dda-chip.css +14 -1
- package/dist/collection/components/dda-chip/dda-chip.js +1 -1
- package/dist/collection/components/dda-credit-card/dda-credit-card.css +8 -2
- package/dist/collection/components/dda-creditcard-field/dda-creditcard-field.js +39 -1
- package/dist/collection/components/dda-creditcard-field/dda-creditcard-field.stories.js +9 -0
- package/dist/collection/components/dda-footer/dda-footer.js +3 -4
- package/dist/collection/components/dda-header/dda-header.css +36 -0
- package/dist/collection/components/dda-header/dda-header.js +1 -1
- package/dist/collection/components/dda-home-banner/dda-home-banner.js +358 -11
- package/dist/collection/components/dda-home-banner/dda-home-banner.stories.js +79 -49
- package/dist/collection/components/dda-home-banner/home-banner.css +45 -4
- package/dist/collection/components/dda-input/dda-input.js +18 -1
- package/dist/collection/components/dda-link-button/dda-link-button.js +2 -2
- package/dist/collection/components/dda-number-field/dda-number-field.js +16 -1
- package/dist/collection/components/dda-pagination/dda-pagination.css +9 -1
- package/dist/collection/components/dda-pagination/dda-pagination.js +1 -1
- package/dist/collection/components/dda-phonefield/dda-phonefield.js +39 -1
- package/dist/collection/components/dda-phonefield/dda-phonefield.stories.js +11 -1
- package/dist/collection/components/dda-progressbar/dda-progressbar.css +4 -0
- package/dist/collection/components/dda-progressbar/dda-progressbar.js +22 -1
- package/dist/collection/components/dda-progressbar/dda-progressbar.stories.js +6 -0
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.css +26 -2
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.js +1 -1
- package/dist/collection/components/dda-range-slider/dda-range-slider.css +18 -2
- package/dist/collection/components/dda-range-slider/dda-range-slider.js +2 -2
- package/dist/collection/components/dda-search-input/dda-search-input.js +38 -2
- package/dist/collection/components/dda-search-input/dda-search-input.stories.js +9 -0
- package/dist/collection/components/dda-select/dda-select.js +113 -2
- package/dist/collection/components/dda-sticky-footer/dda-sticky-footer.js +3 -4
- package/dist/collection/components/dda-tabs/dda-tabs.js +1 -1
- package/dist/collection/components/dda-textarea/dda-textarea.js +71 -2
- package/dist/collection/components/dda-toggle/dda-toggle.js +1 -1
- package/dist/collection/components/dda-tooltip/dda-tooltip.css +17 -1
- package/dist/collection/components/dda-tooltip/dda-tooltip.js +31 -1
- package/dist/collection/components/dda-ui-card/dda-ui-card.js +1 -1
- package/dist/collection/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.js +89 -3
- package/dist/collection/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.stories.js +21 -1
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.css +15 -3
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.js +1 -1
- package/dist/collection/components/stepper/dda-vertical-stepper/dda-vertical-stepper.js +1 -1
- package/dist/collection/global/dda-button.css +49 -18
- package/dist/collection/global/global.css +26 -2
- package/dist/collection/global/input.css +69 -8
- package/dist/collection/utils/contrast.js +38 -0
- package/dist/components/dda-accordion.js +1 -1
- package/dist/components/dda-alert.js +1 -1
- package/dist/components/dda-attach-file.js +1 -1
- package/dist/components/dda-avatar.js +1 -1
- package/dist/components/dda-banner.js +1 -1
- package/dist/components/dda-breadcrumb.js +1 -1
- package/dist/components/dda-button.js +1 -1
- package/dist/components/dda-checkbox.js +1 -1
- package/dist/components/dda-chip.js +1 -1
- package/dist/components/dda-credit-card.js +1 -1
- package/dist/components/dda-creditcard-field.js +1 -1
- package/dist/components/dda-dropdown.js +1 -1
- package/dist/components/dda-footer.js +1 -1
- package/dist/components/dda-header.js +1 -1
- package/dist/components/dda-home-banner.js +1 -1
- package/dist/components/dda-horizontal-stepper.js +1 -1
- package/dist/components/dda-input.js +1 -1
- package/dist/components/dda-link-button.js +1 -1
- package/dist/components/dda-number-field.js +1 -1
- package/dist/components/dda-pagination.js +1 -1
- package/dist/components/dda-phonefield.js +1 -1
- package/dist/components/dda-progressbar.js +1 -1
- package/dist/components/dda-radiobutton.js +1 -1
- package/dist/components/dda-range-slider.js +1 -1
- package/dist/components/dda-search-input.js +1 -1
- package/dist/components/dda-segmented-tabs.js +1 -1
- package/dist/components/dda-select.js +1 -1
- package/dist/components/dda-sticky-footer.js +1 -1
- package/dist/components/dda-tabs.js +1 -1
- package/dist/components/dda-textarea.js +1 -1
- package/dist/components/dda-toggle.js +1 -1
- package/dist/components/dda-tooltip.js +1 -1
- package/dist/components/dda-ui-card.js +1 -1
- package/dist/components/dda-vertical-stepper.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-BaW1ewxd.js +1 -0
- package/dist/components/p-C2ufT7tL.js +1 -0
- package/dist/components/p-CbUih1OY.js +1 -0
- package/dist/components/p-Cgvws3Uk.js +1 -0
- package/dist/components/p-HakkUtRK.js +1 -0
- package/dist/dda/dda.css +20 -0
- package/dist/dda/dda.esm.js +1 -1
- package/dist/dda/p-0b56fbcb.entry.js +1 -0
- package/dist/dda/p-1df4494d.entry.js +1 -0
- package/dist/dda/p-207c4034.entry.js +1 -0
- package/dist/dda/p-23c6a709.entry.js +1 -0
- package/dist/dda/p-2c0f4e9e.entry.js +1 -0
- package/dist/dda/p-2e4e47ec.entry.js +1 -0
- package/dist/dda/p-3b9a784a.entry.js +1 -0
- package/dist/dda/p-4400194a.entry.js +1 -0
- package/dist/dda/p-48f14688.entry.js +1 -0
- package/dist/dda/p-4aef15b0.entry.js +1 -0
- package/dist/dda/{p-0db613dc.entry.js → p-5d0b1fea.entry.js} +1 -1
- package/dist/dda/p-6150d6ca.entry.js +1 -0
- package/dist/dda/p-6def14a1.entry.js +1 -0
- package/dist/dda/p-7c8b1191.entry.js +1 -0
- package/dist/dda/p-7eb8942f.entry.js +1 -0
- package/dist/dda/p-82dc3344.entry.js +1 -0
- package/dist/dda/p-88c5aa03.entry.js +1 -0
- package/dist/dda/{p-872e0f49.entry.js → p-8bbd3b3b.entry.js} +1 -1
- package/dist/dda/p-96aaf2c6.entry.js +1 -0
- package/dist/dda/p-99e59635.entry.js +1 -0
- package/dist/dda/p-CfK_KUZU.js +2 -0
- package/dist/dda/p-b6096645.entry.js +1 -0
- package/dist/dda/p-b68b2d3a.entry.js +1 -0
- package/dist/dda/p-c39fc443.entry.js +1 -0
- package/dist/dda/p-cf6c7bc5.entry.js +1 -0
- package/dist/dda/p-d096ea61.entry.js +1 -0
- package/dist/dda/p-d5274874.entry.js +1 -0
- package/dist/dda/p-d606adfc.entry.js +1 -0
- package/dist/dda/p-da82dc4c.entry.js +1 -0
- package/dist/dda/p-dc72bfd8.entry.js +1 -0
- package/dist/dda/p-dec1b61c.entry.js +1 -0
- package/dist/dda/p-eb2d0c46.entry.js +1 -0
- package/dist/dda/p-f9c681e4.entry.js +1 -0
- package/dist/dda/p-fd637136.entry.js +1 -0
- package/dist/esm/dda-accordion.entry.js +4 -4
- package/dist/esm/dda-alert.entry.js +11 -4
- package/dist/esm/dda-attach-file.entry.js +19 -4
- package/dist/esm/dda-avatar.entry.js +12 -6
- package/dist/esm/dda-banner.entry.js +2 -2
- package/dist/esm/dda-breadcrumb.entry.js +2 -2
- package/dist/esm/dda-button.entry.js +3 -3
- package/dist/esm/dda-checkbox.entry.js +2 -2
- package/dist/esm/dda-chip.entry.js +4 -4
- package/dist/esm/dda-credit-card.entry.js +3 -3
- package/dist/esm/dda-creditcard-field.entry.js +22 -4
- package/dist/esm/dda-dropdown.entry.js +3 -3
- package/dist/esm/dda-footer.entry.js +5 -3
- package/dist/esm/dda-header.entry.js +3 -3
- package/dist/esm/dda-home-banner.entry.js +172 -13
- package/dist/esm/dda-horizontal-stepper.entry.js +4 -4
- package/dist/esm/dda-input.entry.js +21 -4
- package/dist/esm/dda-link-button_2.entry.js +7 -7
- package/dist/esm/dda-number-field.entry.js +19 -4
- package/dist/esm/dda-pagination.entry.js +4 -4
- package/dist/esm/dda-phonefield.entry.js +22 -4
- package/dist/esm/dda-progressbar.entry.js +5 -4
- package/dist/esm/dda-range-slider.entry.js +4 -4
- package/dist/esm/dda-search-input.entry.js +23 -6
- package/dist/esm/dda-segmented-tabs.entry.js +30 -5
- package/dist/esm/dda-select.entry.js +114 -5
- package/dist/esm/dda-sticky-footer.entry.js +5 -3
- package/dist/esm/dda-tabs.entry.js +3 -3
- package/dist/esm/dda-textarea.entry.js +74 -5
- package/dist/esm/dda-toggle.entry.js +3 -3
- package/dist/esm/dda-tooltip.entry.js +29 -4
- package/dist/esm/dda-ui-card.entry.js +2 -2
- package/dist/esm/dda-vertical-stepper.entry.js +2 -2
- package/dist/esm/dda.js +3 -4
- package/dist/esm/index-CfK_KUZU.js +1976 -0
- package/dist/esm/loader.js +3 -4
- package/dist/types/components/dda-alert/dda-alert.d.ts +1 -0
- package/dist/types/components/dda-attach-file/dda-attach-file.d.ts +3 -0
- package/dist/types/components/dda-creditcard-field/dda-creditcard-field.d.ts +4 -0
- package/dist/types/components/dda-creditcard-field/dda-creditcard-field.stories.d.ts +6 -0
- package/dist/types/components/dda-home-banner/dda-home-banner.d.ts +46 -1
- package/dist/types/components/dda-home-banner/dda-home-banner.stories.d.ts +27 -3
- package/dist/types/components/dda-input/dda-input.d.ts +3 -0
- package/dist/types/components/dda-number-field/dda-number-field.d.ts +3 -0
- package/dist/types/components/dda-phonefield/dda-phonefield.d.ts +4 -0
- package/dist/types/components/dda-phonefield/dda-phonefield.stories.d.ts +6 -0
- package/dist/types/components/dda-progressbar/dda-progressbar.d.ts +1 -0
- package/dist/types/components/dda-progressbar/dda-progressbar.stories.d.ts +7 -0
- package/dist/types/components/dda-search-input/dda-search-input.d.ts +4 -0
- package/dist/types/components/dda-search-input/dda-search-input.stories.d.ts +6 -0
- package/dist/types/components/dda-select/dda-select.d.ts +13 -0
- package/dist/types/components/dda-textarea/dda-textarea.d.ts +6 -0
- package/dist/types/components/dda-tooltip/dda-tooltip.d.ts +6 -0
- package/dist/types/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.d.ts +12 -0
- package/dist/types/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.stories.d.ts +12 -0
- package/dist/types/components.d.ts +171 -1
- package/dist/types/utils/contrast.d.ts +19 -0
- package/package.json +23 -6
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
- package/dist/cjs/index-B79qki6G.js +0 -1975
- package/dist/components/p-BId7flZ3.js +0 -1
- package/dist/components/p-BvP8lGT3.js +0 -1
- package/dist/components/p-CAZwi69K.js +0 -1
- package/dist/components/p-DlU_OvNg.js +0 -1
- package/dist/components/p-DywjKcXy.js +0 -1
- package/dist/dda/p-01b5288e.entry.js +0 -1
- package/dist/dda/p-05909550.entry.js +0 -1
- package/dist/dda/p-290878ba.entry.js +0 -1
- package/dist/dda/p-2a027297.entry.js +0 -1
- package/dist/dda/p-2be2258d.entry.js +0 -1
- package/dist/dda/p-320daf89.entry.js +0 -1
- package/dist/dda/p-3b5501d5.entry.js +0 -1
- package/dist/dda/p-41d48ef1.entry.js +0 -1
- package/dist/dda/p-49efa7b5.entry.js +0 -1
- package/dist/dda/p-4d544d34.entry.js +0 -1
- package/dist/dda/p-5a8d0718.entry.js +0 -1
- package/dist/dda/p-687993df.entry.js +0 -1
- package/dist/dda/p-72cf45ff.entry.js +0 -1
- package/dist/dda/p-74136148.entry.js +0 -1
- package/dist/dda/p-7b9a03b8.entry.js +0 -1
- package/dist/dda/p-813378ca.entry.js +0 -1
- package/dist/dda/p-81e2a31e.entry.js +0 -1
- package/dist/dda/p-9ada3a28.entry.js +0 -1
- package/dist/dda/p-9bb057e8.entry.js +0 -1
- package/dist/dda/p-9eb37a5b.entry.js +0 -1
- package/dist/dda/p-CnOk80gh.js +0 -2
- package/dist/dda/p-DQuL1Twl.js +0 -1
- package/dist/dda/p-ad2eb016.entry.js +0 -1
- package/dist/dda/p-bd34eb45.entry.js +0 -1
- package/dist/dda/p-d8b2f59d.entry.js +0 -1
- package/dist/dda/p-da8e1d19.entry.js +0 -1
- package/dist/dda/p-dd16275a.entry.js +0 -1
- package/dist/dda/p-de5a5f95.entry.js +0 -1
- package/dist/dda/p-e3c3c3c8.entry.js +0 -1
- package/dist/dda/p-ebaf8588.entry.js +0 -1
- package/dist/dda/p-efdf9aba.entry.js +0 -1
- package/dist/dda/p-f135fada.entry.js +0 -1
- package/dist/dda/p-f3a93726.entry.js +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/index-CnOk80gh.js +0 -1966
|
@@ -12,10 +12,23 @@
|
|
|
12
12
|
border-radius: 5px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/*
|
|
16
|
+
* F-022 (WCAG 2.5.8 target size, minimum): the sweep's checker measures
|
|
17
|
+
* the <input>'s own box (its INTERACTIVE selector matches `input`
|
|
18
|
+
* generically, not the UA-styled ::-webkit-slider-thumb/::-moz-range-thumb
|
|
19
|
+
* pseudo-elements it can't select) - previously 100% wide but only 6px
|
|
20
|
+
* tall, the same height as the visible track. Growing the input's own
|
|
21
|
+
* height to 24px and re-centring it over the track fixes what the checker
|
|
22
|
+
* (and any pointer/touch user, since pointer-events below still route
|
|
23
|
+
* clicks to the thumb) actually measures, without changing the visible
|
|
24
|
+
* 6px track or the track fill drawn by .dda-range-slider/.dda-range-slider-track.
|
|
25
|
+
*/
|
|
15
26
|
.dda-range-slider-input {
|
|
16
27
|
position: absolute;
|
|
28
|
+
top: 50%;
|
|
29
|
+
transform: translateY(-50%);
|
|
17
30
|
width: 100%;
|
|
18
|
-
height:
|
|
31
|
+
height: 24px;
|
|
19
32
|
background: transparent;
|
|
20
33
|
-webkit-appearance: none;
|
|
21
34
|
appearance: none;
|
|
@@ -61,7 +74,10 @@
|
|
|
61
74
|
}
|
|
62
75
|
|
|
63
76
|
.dda-range-slider-track span {
|
|
64
|
-
|
|
77
|
+
/* F-023 B3: was raw, theme-invariant --dda-neutral-100, paired with the
|
|
78
|
+
theme-flipping text alias --dda-on-surface-variant-30. Swap to the
|
|
79
|
+
theme-aware surface alias so the background flips with the text. */
|
|
80
|
+
background: var(--dda-surface-100);
|
|
65
81
|
width: 55px;
|
|
66
82
|
height: 35px;
|
|
67
83
|
font-size: 16px;
|
|
@@ -28,10 +28,10 @@ export class DdaRangeSlider {
|
|
|
28
28
|
return ((value - this.min) / (this.max - this.min)) * 100;
|
|
29
29
|
}
|
|
30
30
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: '80a768ff1c3149aa7e863bbe8fe4936f6c39ff43' }, h("div", { key: 'ec21fa68c81ef52b6d41a2dd73232f2da367b59a', class: `dda-range-slider-container dda-tooltip-${this.tooltip_position} ${this.custom_class} ${this.component_mode}` }, h("div", { key: '01837c6961c25dae8dd22722ccffb88dc6740c48', class: "dda-range-slider" }, h("div", { key: '21e0c50619dff33b4552a1b2cfaacd6d5ee4259a', class: "dda-range-slider-track", style: {
|
|
32
32
|
left: `${this.getPercentage(this.min_value)}%`,
|
|
33
33
|
right: `${100 - this.getPercentage(this.max_value)}%`,
|
|
34
|
-
} }, h("span", { key: '
|
|
34
|
+
} }, h("span", { key: '697d15494be5b1b2223c6994f5757449b8137d0a', class: "min-label" }, this.min_value, "%"), h("span", { key: 'cf9fb2c9a32acadf8aa39ba3bfe81eb669c3d5b6', class: "max-label" }, this.max_value, "%")), h("label", { key: '11d8300e01852e9ea304489a60611ad311318a8a', htmlFor: this.left_input_id }, h("input", { key: '11d5bf0e71ad6c1e6486baf367cc77b82b487a15', id: this.left_input_id, name: this.left_input_name, "aria-label": this.left_aria_label, type: "range", min: this.min, max: this.max, step: this.step, value: this.min_value, onInput: (event) => this.handleMinChange(event), class: "dda-range-slider-input", style: { zIndex: `${this.min_value > this.max - this.min_value ? 5 : 3}` } })), h("label", { key: 'c0985baf70eba826197503254da107693d7a21bc', htmlFor: this.right_input_id }, h("input", { key: '2b3c8aed413ef9615dca183c089c4840fdf83ab6', id: this.right_input_id, name: this.right_input_name, "aria-label": this.right_aria_label, type: "range", min: this.min, max: this.max, step: this.step, value: this.max_value, onInput: (event) => this.handleMaxChange(event), class: "dda-range-slider-input", style: { zIndex: `${this.max_value < this.max - this.min_value ? 5 : 3}` } }))))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "dda-range-slider"; }
|
|
37
37
|
static get originalStyleUrls() {
|
|
@@ -7,14 +7,31 @@ export class DdaSearchInput {
|
|
|
7
7
|
this.has_error = false; // control error state
|
|
8
8
|
this.custom_class = '';
|
|
9
9
|
}
|
|
10
|
+
// F-016: ids derived from the consumer-supplied input_id, same pattern as
|
|
11
|
+
// dda-input/dda-select.
|
|
12
|
+
get helperId() {
|
|
13
|
+
return this.input_id ? `${this.input_id}-helper` : undefined;
|
|
14
|
+
}
|
|
15
|
+
get errorId() {
|
|
16
|
+
return this.input_id ? `${this.input_id}-error` : undefined;
|
|
17
|
+
}
|
|
18
|
+
get describedBy() {
|
|
19
|
+
const ids = [
|
|
20
|
+
this.helper_text ? this.helperId : undefined,
|
|
21
|
+
this.error_message ? this.errorId : undefined,
|
|
22
|
+
].filter(Boolean);
|
|
23
|
+
return ids.length ? ids.join(' ') : undefined;
|
|
24
|
+
}
|
|
10
25
|
clearInput() {
|
|
11
|
-
|
|
26
|
+
// Was `#search` — the search input's id is now the consumer-supplied
|
|
27
|
+
// input_id (possibly undefined), so target the stable class instead.
|
|
28
|
+
const input = this.el.querySelector('.dda-search-field');
|
|
12
29
|
if (input) {
|
|
13
30
|
input.value = '';
|
|
14
31
|
}
|
|
15
32
|
}
|
|
16
33
|
render() {
|
|
17
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: 'defadb63674c2c2a74ff001a33c46e1b70884362' }, h("div", { key: '6b485070024fe6138c6964aafd30ac31f76add42', class: `dda-input-container dda-input-size-${this.size} ${this.component_mode} ${this.custom_class} ${this.input_status ? `dda-input-${this.input_status}` : ''} ${this.has_error ? 'dda-validation-error' : ''}` }, this.label && h("label", { key: '71564d0889be28002cedf12d11159be2c0fc6ad8', htmlFor: this.input_id, class: "dda-input-label" }, this.label), h("div", { key: 'edd31c93a5098642a98952e9e786a1f52cef5f57', class: "dda-search-area dda-search-action" }, h("i", { key: '708fbf189d534e27c1a26c9491389c6caae0826d', class: "material-icons icon-left" }, "search"), h("input", { key: '8e1a5df3baf8c894a474047ff041db15191bc874', name: this.search_input_name, "aria-label": this.aria_label, id: this.input_id, type: "text", class: "dda-input-field dda-search-field", placeholder: this.placeholder, "aria-describedby": this.describedBy, "aria-invalid": this.error_message ? 'true' : undefined }), h("div", { key: '622e7a0ee2b0659ced993f533369e27bab553d6b', class: "dda-search-btngroup" }, h("button", { key: 'f508784161c13624b4cc30baaa05c031c6dbbbe4', name: this.close_button_name, "aria-label": this.button_aria_label, id: this.button_id, type: "button", class: "icon-close", onClick: () => this.clearInput() }, h("i", { key: '6680303fc0fe51810eaf1e2f2f509ac894fc0a8a', class: "material-icons material-symbols-outlined" }, "close")), this.show_button && (h("button", { key: '37c5dce6caff03bca2b018f2a789b5de2614aded', name: this.search_button_name, type: "button", class: "dda-btn btn-color-default-primary dda-btn-sm" }, "Search")))), this.helper_text && h("span", { key: 'ca5d52ea2953f2de298b6dbbca209697b006220f', id: this.helperId, class: "dda-helper-text" }, this.helper_text), this.error_message && h("span", { key: '2c7e0710441d65ed6a4652fc3962629c4a644b05', id: this.errorId, class: "dda-error-message" }, this.error_message))));
|
|
18
35
|
}
|
|
19
36
|
static get is() { return "dda-search-input"; }
|
|
20
37
|
static get originalStyleUrls() {
|
|
@@ -243,6 +260,25 @@ export class DdaSearchInput {
|
|
|
243
260
|
"reflect": false,
|
|
244
261
|
"attribute": "button_id"
|
|
245
262
|
},
|
|
263
|
+
"input_id": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "string",
|
|
268
|
+
"resolved": "string",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": true,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [],
|
|
275
|
+
"text": ""
|
|
276
|
+
},
|
|
277
|
+
"getter": false,
|
|
278
|
+
"setter": false,
|
|
279
|
+
"reflect": false,
|
|
280
|
+
"attribute": "input_id"
|
|
281
|
+
},
|
|
246
282
|
"aria_label": {
|
|
247
283
|
"type": "string",
|
|
248
284
|
"mutable": false,
|
|
@@ -49,6 +49,10 @@ export default {
|
|
|
49
49
|
control: { type: 'text' },
|
|
50
50
|
description: 'default',
|
|
51
51
|
},
|
|
52
|
+
input_id: {
|
|
53
|
+
control: { type: 'text' },
|
|
54
|
+
description: 'Id for the search input field. The visible label targets this, not button_id (F-017).',
|
|
55
|
+
},
|
|
52
56
|
aria_label: {
|
|
53
57
|
control: { type: 'text' },
|
|
54
58
|
description: 'Aria label for the search input',
|
|
@@ -92,6 +96,7 @@ export default {
|
|
|
92
96
|
custom_class=""
|
|
93
97
|
component_mode=""
|
|
94
98
|
button_id="button"
|
|
99
|
+
input_id="search"
|
|
95
100
|
aria_label="search-input"
|
|
96
101
|
button_aria_label="clear-search"
|
|
97
102
|
onchange="console.log('changed')"
|
|
@@ -124,6 +129,7 @@ Default.args = {
|
|
|
124
129
|
custom_class: '',
|
|
125
130
|
component_mode: '',
|
|
126
131
|
button_id: 'button',
|
|
132
|
+
input_id: 'search',
|
|
127
133
|
aria_label: 'search-input',
|
|
128
134
|
button_aria_label: 'clear-search',
|
|
129
135
|
onchange: '',
|
|
@@ -143,6 +149,7 @@ WithButton.args = {
|
|
|
143
149
|
custom_class: '',
|
|
144
150
|
component_mode: '',
|
|
145
151
|
button_id: 'button',
|
|
152
|
+
input_id: 'search',
|
|
146
153
|
aria_label: 'search-input',
|
|
147
154
|
button_aria_label: 'clear-search',
|
|
148
155
|
onchange: '',
|
|
@@ -161,6 +168,7 @@ WithError.args = {
|
|
|
161
168
|
custom_class: '',
|
|
162
169
|
component_mode: '',
|
|
163
170
|
button_id: 'button',
|
|
171
|
+
input_id: 'search',
|
|
164
172
|
aria_label: 'search-input',
|
|
165
173
|
button_aria_label: 'clear-search',
|
|
166
174
|
onchange: '',
|
|
@@ -180,6 +188,7 @@ Disabled.args = {
|
|
|
180
188
|
custom_class: '',
|
|
181
189
|
component_mode: '',
|
|
182
190
|
button_id: 'button',
|
|
191
|
+
input_id: 'search',
|
|
183
192
|
aria_label: 'search-input',
|
|
184
193
|
button_aria_label: 'clear-search',
|
|
185
194
|
onchange: '',
|
|
@@ -5,6 +5,85 @@ export class Ddaselect {
|
|
|
5
5
|
this.is_open = false;
|
|
6
6
|
//@Prop() validationtype?: string;
|
|
7
7
|
this.custom_class = '';
|
|
8
|
+
// F-014: focus target requested by a keyboard interaction (ArrowDown/Up
|
|
9
|
+
// from the trigger) that fires before the listbox exists in the DOM.
|
|
10
|
+
// Consumed by componentDidRender, then cleared.
|
|
11
|
+
this.pendingFocusIndex = null;
|
|
12
|
+
this.onTriggerKeyDown = (event) => {
|
|
13
|
+
if (this.disabled) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
const wasOpen = this.is_open;
|
|
19
|
+
this.is_open = true;
|
|
20
|
+
const target = this.initialOptionIndex();
|
|
21
|
+
if (wasOpen) {
|
|
22
|
+
this.focusOption(target);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.pendingFocusIndex = target;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else if (event.key === 'Escape' && this.is_open) {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
this.is_open = false;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.onOptionKeyDown = (event, option) => {
|
|
34
|
+
const currentIndex = this.currentFocusedOptionIndex();
|
|
35
|
+
switch (event.key) {
|
|
36
|
+
case 'ArrowDown':
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
this.focusOption(currentIndex + 1);
|
|
39
|
+
break;
|
|
40
|
+
case 'ArrowUp':
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
this.focusOption(currentIndex - 1);
|
|
43
|
+
break;
|
|
44
|
+
case 'Home':
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
this.focusOption(0);
|
|
47
|
+
break;
|
|
48
|
+
case 'End':
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
this.focusOption(this.parsedOptions.length - 1);
|
|
51
|
+
break;
|
|
52
|
+
case 'Enter':
|
|
53
|
+
case ' ':
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
this.selectOption(option);
|
|
56
|
+
break;
|
|
57
|
+
case 'Escape':
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
this.closeAndReturnFocus();
|
|
60
|
+
break;
|
|
61
|
+
case 'Tab':
|
|
62
|
+
// Let focus leave naturally; don't trap it, but the popup should
|
|
63
|
+
// not stay open once it does.
|
|
64
|
+
this.is_open = false;
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
get listboxId() {
|
|
72
|
+
return `${this.button_id}-listbox`;
|
|
73
|
+
}
|
|
74
|
+
// F-016: same button_id-derived uniqueness pattern as listboxId above.
|
|
75
|
+
get helperId() {
|
|
76
|
+
return this.button_id ? `${this.button_id}-helper` : undefined;
|
|
77
|
+
}
|
|
78
|
+
get errorId() {
|
|
79
|
+
return this.button_id ? `${this.button_id}-error` : undefined;
|
|
80
|
+
}
|
|
81
|
+
get describedBy() {
|
|
82
|
+
const ids = [
|
|
83
|
+
this.helper_text ? this.helperId : undefined,
|
|
84
|
+
this.error_message ? this.errorId : undefined,
|
|
85
|
+
].filter(Boolean);
|
|
86
|
+
return ids.length ? ids.join(' ') : undefined;
|
|
8
87
|
}
|
|
9
88
|
get parsedOptions() {
|
|
10
89
|
try {
|
|
@@ -14,19 +93,50 @@ export class Ddaselect {
|
|
|
14
93
|
return [];
|
|
15
94
|
}
|
|
16
95
|
}
|
|
96
|
+
focusOption(index) {
|
|
97
|
+
const options = Array.from(this.el.querySelectorAll('.dda-input-dropdown-item[role="option"]'));
|
|
98
|
+
if (options.length === 0) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const clamped = Math.max(0, Math.min(index, options.length - 1));
|
|
102
|
+
options[clamped].focus();
|
|
103
|
+
}
|
|
104
|
+
currentFocusedOptionIndex() {
|
|
105
|
+
const options = Array.from(this.el.querySelectorAll('.dda-input-dropdown-item[role="option"]'));
|
|
106
|
+
return options.indexOf(document.activeElement);
|
|
107
|
+
}
|
|
108
|
+
initialOptionIndex() {
|
|
109
|
+
const options = this.parsedOptions;
|
|
110
|
+
const selectedIndex = options.indexOf(this.selected);
|
|
111
|
+
return selectedIndex >= 0 ? selectedIndex : 0;
|
|
112
|
+
}
|
|
17
113
|
toggleSelect() {
|
|
18
114
|
if (!this.disabled) {
|
|
19
115
|
this.is_open = !this.is_open;
|
|
20
116
|
}
|
|
21
117
|
}
|
|
118
|
+
closeAndReturnFocus() {
|
|
119
|
+
this.is_open = false;
|
|
120
|
+
const trigger = this.el.querySelector('.dda-select-header');
|
|
121
|
+
if (trigger) {
|
|
122
|
+
trigger.focus();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
22
125
|
selectOption(option) {
|
|
23
126
|
if (!this.disabled) {
|
|
24
127
|
this.selected = option;
|
|
25
|
-
this.
|
|
128
|
+
this.closeAndReturnFocus();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
componentDidRender() {
|
|
132
|
+
if (this.is_open && this.pendingFocusIndex !== null) {
|
|
133
|
+
const target = this.pendingFocusIndex;
|
|
134
|
+
this.pendingFocusIndex = null;
|
|
135
|
+
this.focusOption(target);
|
|
26
136
|
}
|
|
27
137
|
}
|
|
28
138
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
139
|
+
return (h(Host, { key: '24112cb3263994d6e4b7c87a5a1ec75d010c6ee0' }, h("div", { key: '9d49fc8c1905079e83a8949ca8c1f46fa3255401', class: `dda-input-container ${this.custom_class} ${this.component_mode} ${this.disabled ? 'dda-input-disabled' : ''} ${this.is_open ? 'show' : 'hide'} dda-input-size-${this.size} dda-validation-${this.error} ` }, this.label && h("label", { key: '96d14ea8c1174032261945b9bef49f23e6ff55b6', htmlFor: this.button_id, class: "dda-input-label" }, this.label), h("div", { key: '0896838d28313f76b1938c225bdf5df1fdbc7849', class: "dda-dropdown-container" }, h("button", { key: 'a224ad80778a6e315735e806a0afbb4fc7c57e93', name: this.toggle_button_name, "aria-label": this.aria_label, id: this.button_id, type: "button", class: "dda-input-field dda-select-header", "aria-haspopup": "listbox", "aria-expanded": this.is_open ? 'true' : 'false', "aria-controls": this.is_open ? this.listboxId : undefined, "aria-describedby": this.describedBy, "aria-invalid": this.error_message ? 'true' : undefined, onClick: () => { this.toggleSelect(); }, onKeyDown: this.onTriggerKeyDown }, this.selected || 'Select an option', h("i", { key: '7ed3bdb440c0a892795af32b1b2f9105633d5af7', class: `material-icons` }, this.is_open ? 'keyboard_arrow_up' : 'keyboard_arrow_down')), this.is_open && (h("div", { key: '266c9fc8de36433de06bf289a854c22ab499f0ca', id: this.listboxId, role: "listbox", "aria-label": this.aria_label || this.label, class: "dda-input-dropdown-list dda-select-list" }, this.parsedOptions.length > 0 ? (this.parsedOptions.map((option, index) => (h("button", { name: this.option_select_button_name, type: "button", role: "option", "aria-selected": this.selected === option ? 'true' : 'false', tabIndex: index === this.initialOptionIndex() ? 0 : -1, class: `dda-input-dropdown-item ${this.selected === option ? 'selected' : ''}`, onClick: () => this.selectOption(option), onKeyDown: (event) => this.onOptionKeyDown(event, option) }, option)))) : (h("div", { class: "dda-input-dropdown-item" }, "No options available"))))), this.helper_text && h("span", { key: '62028ea0d45943d0728f71ec58122ab58a554ec7', id: this.helperId, class: "dda-helper-text" }, this.helper_text), this.error_message && h("span", { key: '30f11a0804b15424e0ca7a8769477f5f4547b191', id: this.errorId, class: "dda-error-message" }, this.error_message))));
|
|
30
140
|
}
|
|
31
141
|
static get is() { return "dda-select"; }
|
|
32
142
|
static get originalStyleUrls() {
|
|
@@ -316,4 +426,5 @@ export class Ddaselect {
|
|
|
316
426
|
"is_open": {}
|
|
317
427
|
};
|
|
318
428
|
}
|
|
429
|
+
static get elementRef() { return "el"; }
|
|
319
430
|
}
|
|
@@ -19,18 +19,17 @@ export class DdaStickyFooter {
|
|
|
19
19
|
this.lastScrollY = currentScrollY;
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h("footer", { key: '
|
|
22
|
+
return (h("footer", { key: 'fd7226001887d4d3858578373ccd508fdd49930f', class: { 'dda-footer': true, 'hidden': this.isHidden }, "aria-hidden": this.isHidden ? 'true' : 'false', inert: this.isHidden }, h("div", { key: '89cc0c1083f9c62fcf26dda4f875651453ad2475', class: "footer-content" }, h("div", { key: '9abfbaa61512a0aae8e657ef1d28fc39f8d426ab', class: "dda-footer-item dda-footer-left" }, h("ul", { key: 'eea21ceadfd9da17be4de929641c7ec504a6cc77' }, h("li", { key: '24067be504158bdc00e53c94138ccb5a9bc35208', class: "foot-icon-btn" }, h("dda-tooltip", { key: 'f3e7346694c4cb6cc45f2a5f1805f4d802bf4055', title_text: this.happinessIconTooltip, description: "", position: "top" }, h("a", { key: 'd80000d0a8a1868f5828fd3fb50cc25c25fd06b3', href: this.happinessIconHref }, h("img", { key: 'a9362b7f44359616b26a02b95595ef6a179aa5d6', src: this.happinessIconSrc, alt: this.happinessIconAlt })))), h("li", { key: '930abc7f878cbf3221a54d049c3e26fd739b0926', class: "foot-icon-btn" }, h("dda-tooltip", { key: 'fe0dc3bf8d9a4df08117be508eef931b349fbfff', title_text: this.accessibilityIconTooltip, description: "", position: "top" }, h("a", { key: '821b9804f0245bdca422e7c64dd2f10cdd4538db', href: this.accessibilityIconHref }, h("img", { key: '30bc68689a41034be5ec513019352704b5623a6b', src: this.accessibilityIconSrc, alt: this.accessibilityIconAlt })))), h("li", { key: '35dd18e0015ddd6f5e0cdbca4464847404ddcbf2', class: "foot-icon-btn" }, h("dda-tooltip", { key: '1ea7a03b9fdbf4f286960dd6a0b187dd5b6e6f82', title_text: this.servicesIconTooltip, description: "", position: "top" }, h("a", { key: '0f7927bab9ed88a1f82df40f4306be1b66857933', href: this.servicesIconHref }, h("img", { key: 'b63f633473c90d2a9ec99a7e72afc097fd0af3ce', src: this.servicesIconSrc, alt: this.servicesIconAlt }), this.servicesIconText && h("span", { key: 'a5199ba77182215cc04b860843180e9dc3abe8a6' }, this.servicesIconText)))))), this.hideMiddleSection == false && (h("div", { key: 'a5af22f17c41b5905186202feb12ecbe3a26b9e5', class: "dda-footer-item dda-footer-middle" }, h("ul", { key: '62b94e14be370d1f05d086e83ffda17c87296d23', class: "foot-logo" }, h("li", { key: '096a17c1eb4f2f3e868a1f3611b6b14f1fa44ac7' }, h("dda-tooltip", { key: 'ba61d166efc5408584a55b4a58afd01c1490a828', title_text: this.firstLogoTooltip, description: "", position: "top" }, h("a", { key: '592a84b05afb1d5160bcd551aaa05dccd960278b', href: this.firstLogoHref }, h("img", { key: 'cab3be3fbcc0fd9d32ff30fae7957dc240cc0bfa', src: this.firstLogoSrc, alt: this.firstLogoAlt })))), h("li", { key: '79057d3e29622036a9b71caa2e7da13b41b19731' }, h("dda-tooltip", { key: 'c83b49320aa022f3ebad082e8d18a62a963a1711', title_text: this.secondLogoTooltip, description: "", position: "top" }, h("a", { key: '1a89079bcbe11ad4e8fcdd39f1b704d1ae1e7b25', href: this.secondLogoHref }, h("img", { key: '77ebaa747753185fcb689fcaed0d3e0e13ba91d1', src: this.secondLogoSrc, alt: this.secondLogoAlt })))), h("li", { key: 'a1a50feedc0cdcd8dd9af3b89558cc4a2a1d722a' }, h("dda-tooltip", { key: '11f99b9db6e15decb70799eaa9f017a6ac9bbf31', title_text: this.thirdLogoTooltip, description: "", position: "top" }, h("a", { key: '417d6a7503c6ce246a0a840a81f9e75cf5977684', href: this.thirdLogoHref }, h("img", { key: 'f9d5076d234fc8e8ff0a14f9cb7bc69e032b89d8', src: this.thirdLogoSrc, alt: this.thirdLogoAlt }))))))), h("div", { key: '313d93488da41b604dded66f761fc8f19e20d020', class: "dda-footer-item dda-footer-right" }, h("ul", { key: 'bbdd2b067021f53a8f1dd80e2272590ea30852fe' }, h("li", { key: 'b752348eb94eae0eef4cd3246fb7c3b83d1ffcd0', class: "foot-icon-btn" }, h("dda-tooltip", { key: '9c1ab1b4bfd5a9f89666dac8432fe56fac30f631', title_text: this.locationButtonText, description: "", position: "top" }, h("a", { key: 'b2da2f550cfadf18bd41a2e56e68dd104546223a', href: this.locationButtonHref }, h("img", { key: '8733dddcb3d7235942a1379cac0cf24684e4ce04', src: this.locationLogoSrc, alt: this.locationButtonText })))), h("li", { key: '16ceed63fd9b5ece0bbccaf7f911aedc1bffd5dc', class: "foot-icon-btn" }, h("dda-tooltip", { key: 'a803f2f70393a77e80b0d3ec60e9f595ed8be389', title_text: this.newsButtonText, description: "", position: "top" }, h("a", { key: '86fccef86c2f25d2defa9fb67ab4b7f05bc8f2e2', href: this.newsButtonHref }, h("img", { key: '603f9c78d0912af532e048a12914e3bac595c7a2', src: this.newsButtonSrc, alt: this.newsButtonText })))), h("li", { key: '271d85b2626ac375d53f1efc633c8995c7068577', class: "foot-icon-btn" }, h("dda-tooltip", { key: '0890b47eb92c645a0e3f912b15d38884a19ae1c1', title_text: this.aiIconTooltip, description: "", position: "top" }, h("a", { key: 'b05716e05e64eddc8ce6f32f5f9515b6f2232c78', href: this.aiIconHref }, h("img", { key: '0a7ba43622ff187a27181e42a28b787271247360', src: this.aiIconSrc, alt: this.aiIconAlt })))), h("li", { key: 'cff6b72ac2a026639ec9a04379fb4b25519cd406', class: "foot-icon-btn" }, h("dda-tooltip", { key: '892c1bffee0b2d5bab42ace9de77dc5fbb344e74', title_text: this.chatIconTooltip, description: "", position: "top" }, h("a", { key: 'bcb66f25dc2cf79215e4b7819a860ef42ac9aa22', href: this.chatIconHref }, h("img", { key: '9bb6f5d176df4558c80b8e5d8a264de1e16b0eae', src: this.chatIconSrc, alt: this.chatIconAlt })))))))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "dda-sticky-footer"; }
|
|
25
|
-
static get encapsulation() { return "shadow"; }
|
|
26
25
|
static get originalStyleUrls() {
|
|
27
26
|
return {
|
|
28
|
-
"$": ["dda-sticky-footer.css"]
|
|
27
|
+
"$": ["dda-sticky-footer.css", "../../global/global.css"]
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
static get styleUrls() {
|
|
32
31
|
return {
|
|
33
|
-
"$": ["dda-sticky-footer.css"]
|
|
32
|
+
"$": ["dda-sticky-footer.css", "../../global/global.css"]
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
static get properties() {
|
|
@@ -38,7 +38,7 @@ export class DdaTabs {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
return (h(Host, { key: '
|
|
41
|
+
return (h(Host, { key: '64c80c8f7d18c478dbbbe2ffe9209bbf4f186747' }, h("div", { key: '677b141249edd4ec826c83a83c523b271b078d31', role: "group", "aria-label": this.aria_label, class: `dda-tabs-container ${this.hover_style} ${this.custom_class} ${this.component_mode}` }, this.parsedTabs.map((title, index) => (h("button", { id: this.button_id, name: this.button_name, type: "button", "aria-pressed": this.active_tab === index ? 'true' : 'false', class: `dda-tab-item ${this.active_tab === index ? 'active' : ''}`, onClick: () => this.setActiveTab(index) }, this.type === 'text-icon' && h("i", { class: `material-icons` }, this.parsedIcons[index] || ""), h("span", null, title)))))));
|
|
42
42
|
}
|
|
43
43
|
static get is() { return "dda-tabs"; }
|
|
44
44
|
static get originalStyleUrls() {
|
|
@@ -6,9 +6,64 @@ export class DdaTextarea {
|
|
|
6
6
|
this.value = '';
|
|
7
7
|
this.characterCount = 0; // State to track the character count
|
|
8
8
|
}
|
|
9
|
+
// F-016: ids derived from the consumer-supplied input_id (same pattern as
|
|
10
|
+
// dda-input/dda-select). F-015: the rich-editor container also needs a
|
|
11
|
+
// stable label id to point aria-labelledby at.
|
|
12
|
+
get labelId() {
|
|
13
|
+
return this.input_id ? `${this.input_id}-label` : undefined;
|
|
14
|
+
}
|
|
15
|
+
get helperId() {
|
|
16
|
+
return this.input_id ? `${this.input_id}-helper` : undefined;
|
|
17
|
+
}
|
|
18
|
+
get errorId() {
|
|
19
|
+
return this.input_id ? `${this.input_id}-error` : undefined;
|
|
20
|
+
}
|
|
21
|
+
get describedBy() {
|
|
22
|
+
const ids = [
|
|
23
|
+
this.helper_text ? this.helperId : undefined,
|
|
24
|
+
this.error_message ? this.errorId : undefined,
|
|
25
|
+
].filter(Boolean);
|
|
26
|
+
return ids.length ? ids.join(' ') : undefined;
|
|
27
|
+
}
|
|
28
|
+
// F-015: Quill does not make the container passed to `new Quill(...)`
|
|
29
|
+
// editable — it mounts its real editable surface as a child `.ql-editor`
|
|
30
|
+
// div with contenteditable="true" (that's what Tab actually lands on, per
|
|
31
|
+
// the pre-existing focus-ring e2e test below). aria-labelledby/role/etc.
|
|
32
|
+
// on the container never reach an AT's accessible-name computation for a
|
|
33
|
+
// descendant, so the label/description/invalid-state must be applied
|
|
34
|
+
// directly to quill.root (the `.ql-editor` element) after mount, and kept
|
|
35
|
+
// in sync whenever the driving props change.
|
|
36
|
+
syncRichEditorA11y() {
|
|
37
|
+
if (!this.quill) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const editorEl = this.quill.root;
|
|
41
|
+
editorEl.setAttribute('role', 'textbox');
|
|
42
|
+
editorEl.setAttribute('aria-multiline', 'true');
|
|
43
|
+
if (this.labelId) {
|
|
44
|
+
editorEl.setAttribute('aria-labelledby', this.labelId);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
editorEl.removeAttribute('aria-labelledby');
|
|
48
|
+
}
|
|
49
|
+
if (this.describedBy) {
|
|
50
|
+
editorEl.setAttribute('aria-describedby', this.describedBy);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
editorEl.removeAttribute('aria-describedby');
|
|
54
|
+
}
|
|
55
|
+
if (this.error_message) {
|
|
56
|
+
editorEl.setAttribute('aria-invalid', 'true');
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
editorEl.removeAttribute('aria-invalid');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
9
62
|
componentDidLoad() {
|
|
10
63
|
if (this.enable_rich_editor) {
|
|
11
|
-
|
|
64
|
+
// F-015: was `#editor` — the id is now the consumer-supplied
|
|
65
|
+
// input_id (possibly undefined), so target the stable class instead.
|
|
66
|
+
const editor = this.el.querySelector('.dda-richeditor-field');
|
|
12
67
|
this.quill = new Quill(editor, {
|
|
13
68
|
modules: {
|
|
14
69
|
toolbar: [
|
|
@@ -33,6 +88,12 @@ export class DdaTextarea {
|
|
|
33
88
|
this.value = this.quill.root.innerHTML;
|
|
34
89
|
this.characterCount = this.quill.getText().length - 1; // Update character count
|
|
35
90
|
});
|
|
91
|
+
this.syncRichEditorA11y();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
componentDidUpdate() {
|
|
95
|
+
if (this.enable_rich_editor) {
|
|
96
|
+
this.syncRichEditorA11y();
|
|
36
97
|
}
|
|
37
98
|
}
|
|
38
99
|
handleInput(event) {
|
|
@@ -48,7 +109,15 @@ export class DdaTextarea {
|
|
|
48
109
|
this.input_status ? `dda-input-${this.input_status}` : '',
|
|
49
110
|
this.custom_class, this.component_mode, this.textarea_name,
|
|
50
111
|
].filter(Boolean).join(' ');
|
|
51
|
-
return (h(Host, { key: '
|
|
112
|
+
return (h(Host, { key: '622c5d071b6bc1a27d98bcce0b2e1103c2cd56b8' }, h("div", { key: '48c2d05b77ef1d8badd31382cb6669d8cc23e46d', class: textareaClass }, this.label && h("label", { key: '6d659cd684ff5afa46ceee22cc33dcdf0995f722', id: this.labelId, htmlFor: this.input_id, class: "dda-input-label" }, this.label), this.enable_rich_editor ? (
|
|
113
|
+
// F-015: previously a bare `<div id="editor">` — the visible
|
|
114
|
+
// label's `for` cannot target a non-labelable <div>, and even
|
|
115
|
+
// aria-labelledby here would be wrong: Quill turns this
|
|
116
|
+
// container into a wrapper and mounts the real editable surface
|
|
117
|
+
// as a child `.ql-editor`, which is what AT and Tab actually
|
|
118
|
+
// land on. The ARIA lives on quill.root (.ql-editor), applied
|
|
119
|
+
// imperatively in syncRichEditorA11y() after mount.
|
|
120
|
+
h("div", { id: this.input_id, class: "dda-richeditor-field" })) : (h("textarea", { id: this.input_id, name: this.textarea_name, "aria-label": this.aria_label, placeholder: this.placeholder, value: this.value, onInput: (event) => this.handleInput(event), class: "dda-input-field dda-input-textarea", maxLength: this.max_characters, "aria-describedby": this.describedBy, "aria-invalid": this.error_message ? 'true' : undefined })), this.helper_text && (h("div", { key: '6d6733d1b96b26acd713f2bdb230a6ecc93e746d', id: this.helperId, class: "dda-helper-text" }, h("span", { key: '6e11cfb6dcc23a17fce5723d3a5e3b6cc8aef3b4', class: "dda-flex dda-align-center dda-gap-2" }, h("i", { key: '0946a74fbf33efb08ce50810b932595341f11b0c', class: "material-icons material-symbols-outlined" }, "info"), " ", this.helper_text), h("span", { key: 'ef8e61d7fae106951d802253afa962ed82096022', class: "dda-letter-count" }, this.characterCount, " / ", this.max_characters))), this.error_message && (h("div", { key: '539ade6c788aa436587936ccf60a55e025752f18', id: this.errorId, class: "dda-error-message" }, h("span", { key: '25ec27d18994c0a83deb589bb5e407734a03526b', class: "dda-flex dda-align-center dda-gap-2" }, h("i", { key: '40d501e7d690a5525f17c36a7ea7b4114a8515e3', class: "material-icons material-symbols-outlined" }, "info"), " ", this.error_message), h("span", { key: '191a2521e12bebe37d874f501bfe21d40d183487', class: "dda-letter-count" }, this.characterCount, " / ", this.max_characters))))));
|
|
52
121
|
}
|
|
53
122
|
static get is() { return "dda-textarea"; }
|
|
54
123
|
static get originalStyleUrls() {
|
|
@@ -10,7 +10,7 @@ export class DdaToggle {
|
|
|
10
10
|
this.custom_class ? `${this.custom_class}` : '',
|
|
11
11
|
this.component_mode,
|
|
12
12
|
].filter(Boolean).join(' ');
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: 'f01e62cab63407de5a460bea59d60be7baef9b96' }, h("label", { key: '42494c1ace83b7b0af66116e6fa263f2abe4a647', class: toggleClass, htmlFor: this.input_id }, h("input", { key: '77e61b283527b562bbac7b1577bb27aaab285913', "aria-label": this.aria_label, type: "checkbox", id: this.input_id, name: this.group_name, checked: this.checked }), h("span", { key: '469818087720955164d61897c2d9e31a5d2f082c', class: "toggle" }), h("p", { key: 'a2866cc3ebfde7f3216b0713e725b085099be974' }, h("span", { key: 'd19a8c1a9cc7b252326dce41b0a3dd1577457825', class: "toggle-title" }, "Radio Button Title"), h("span", { key: '667b7febf89ff08e3749dbd95478120c3b4ff091', class: "toggle-supporting" }, "Supporting Text")))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "dda-toggle"; }
|
|
16
16
|
static get originalStyleUrls() {
|
|
@@ -16,10 +16,26 @@
|
|
|
16
16
|
opacity: 0;
|
|
17
17
|
transition: opacity 0.3s;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
/*
|
|
20
|
+
* F-011 (WCAG 1.4.13, 2.1.1): showing the tooltip only on :hover left it
|
|
21
|
+
* entirely unreachable by keyboard. :focus-within reveals it as soon as the
|
|
22
|
+
* slotted trigger (or anything inside the tooltip) is focused - matching
|
|
23
|
+
* `:hover`'s existing "hoverable" and "persistent" behaviour for free,
|
|
24
|
+
* since the box is a DOM descendant of this same container either way.
|
|
25
|
+
* Escape-driven dismissal (the third 1.4.13 sub-criterion, and the one
|
|
26
|
+
* this selector alone can't satisfy) is handled in dda-tooltip.tsx via the
|
|
27
|
+
* .dismissed class below.
|
|
28
|
+
*/
|
|
29
|
+
.dda-tooltip-container:hover .dda-tooltip-box,
|
|
30
|
+
.dda-tooltip-container:focus-within .dda-tooltip-box {
|
|
20
31
|
visibility: visible;
|
|
21
32
|
opacity: 1;
|
|
22
33
|
}
|
|
34
|
+
|
|
35
|
+
.dda-tooltip-container.dismissed .dda-tooltip-box {
|
|
36
|
+
visibility: hidden !important;
|
|
37
|
+
opacity: 0 !important;
|
|
38
|
+
}
|
|
23
39
|
.dda-tooltip-box strong{
|
|
24
40
|
font-size: 16px;
|
|
25
41
|
color: var(--dda-neutral-0);
|
|
@@ -3,9 +3,33 @@ export class DdaTooltip {
|
|
|
3
3
|
constructor() {
|
|
4
4
|
this.position = 'top'; // Default to top position
|
|
5
5
|
this.custom_class = '';
|
|
6
|
+
// F-011 (WCAG 1.4.13 dismissible): Escape hides the tooltip without
|
|
7
|
+
// moving the pointer or focus. Losing hover/focus (mouseleave/focusout)
|
|
8
|
+
// resets it so the next hover or focus shows it again, instead of
|
|
9
|
+
// suppressing it permanently.
|
|
10
|
+
this.dismissed = false;
|
|
11
|
+
this.handleKeyDown = (event) => {
|
|
12
|
+
if (event.key === 'Escape' || event.key === 'Esc') {
|
|
13
|
+
this.dismissed = true;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
this.resetDismissed = () => {
|
|
17
|
+
if (this.dismissed)
|
|
18
|
+
this.dismissed = false;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
this.el.addEventListener('keydown', this.handleKeyDown);
|
|
23
|
+
this.el.addEventListener('focusout', this.resetDismissed);
|
|
24
|
+
this.el.addEventListener('mouseleave', this.resetDismissed);
|
|
25
|
+
}
|
|
26
|
+
disconnectedCallback() {
|
|
27
|
+
this.el.removeEventListener('keydown', this.handleKeyDown);
|
|
28
|
+
this.el.removeEventListener('focusout', this.resetDismissed);
|
|
29
|
+
this.el.removeEventListener('mouseleave', this.resetDismissed);
|
|
6
30
|
}
|
|
7
31
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: '1cdf4f709c81572379fffdfb63832ce42345aceb' }, h("div", { key: '4a02d6eda15fd3e97b56b6eb6e58566164f250ec', class: `dda-tooltip-container ${this.custom_class} ${this.component_mode} ${this.dismissed ? 'dismissed' : ''}` }, h("slot", { key: 'f18f7b1d729b310b8c5467c4766f675dfedaaea9' }), h("div", { key: 'b21175526d8510415920b09a0993b3bd92387046', class: `dda-tooltip-box ${this.position}` }, h("strong", { key: '2571076616dcd823da28a14a9aa3c39b42ef6b1c' }, this.title_text), h("p", { key: '8d1c7abbc7fb5a2d66df13b5abb1a9280495ab07' }, this.description)))));
|
|
9
33
|
}
|
|
10
34
|
static get is() { return "dda-tooltip"; }
|
|
11
35
|
static get originalStyleUrls() {
|
|
@@ -119,4 +143,10 @@ export class DdaTooltip {
|
|
|
119
143
|
}
|
|
120
144
|
};
|
|
121
145
|
}
|
|
146
|
+
static get states() {
|
|
147
|
+
return {
|
|
148
|
+
"dismissed": {}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
static get elementRef() { return "el"; }
|
|
122
152
|
}
|
|
@@ -11,7 +11,7 @@ export class DdaUiCard {
|
|
|
11
11
|
this.linkicon = 'arrow_forward';
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '23b67e77b8cb78795a684ad15030ac31918853e7' }, h("div", { key: 'abee006879a59559d7154c95c4d88ad1513c75b5', class: 'dda-card' }, h("div", { key: '33732334dafbc7bcaa4a0e24f972e8f04e62c46e', class: 'dda-card-body' }, this.type !== 'custom' && (h("div", { key: '626c85266899eeef3690113f51ff06f330f3cf60' }, !!this.icon && (h("span", { key: 'e6a6ddb2ba041b3942f63967b6cce2d618e1a4ba', class: 'dda-card-icon' }, h("i", { key: '340c651b6fbf945d22b9b6405d2077996dcea0e5', class: 'material-icons' }, this.icon))), !!this.image && (h("span", { key: 'aa79e723ca9995cf8e71d33e480418a77ab44e9d', class: 'dda-card-icon' }, h("img", { key: 'c366fdb9f184680b0f94f0f05e7c102f5cf5daeb', src: this.image, alt: this.maintitle }))), !!this.maintitle && h("h1", { key: 'ad686e57e270a8bd12bdb5a98e49e0918a460dfc', class: 'dda-card-title' }, this.maintitle), !!this.subtitle && h("p", { key: '57dcc9ea2918b7075cd329d8a37ef87ada70fd31', class: 'dda-card-text-muted' }, this.subtitle), !!this.link && (h("a", { key: 'f823984df47c3e48570e76c1cd67804d622626ae', href: this.link, class: 'dda-card-link' }, this.linktext, ' ', this.linkicon && (h("span", { key: '5a41b73f4c7b40d15bfeb47e756eabe70ccd49a4' }, h("i", { key: '6be0795bcde440b7274b7bb1d2314f7d453b403c', class: 'material-icons' }, this.linkicon))))))), h("slot", { key: '83e3e779ff67cadae63c41f36f1862a68093d24c' })))));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "dda-ui-card"; }
|
|
17
17
|
static get originalStyleUrls() {
|