@dubai-design-system/components-js 5.3.0 → 5.3.2
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 +32 -0
- package/MIGRATION.md +16 -1
- package/dist/cjs/dda-accordion.cjs.entry.js +3 -3
- package/dist/cjs/dda-alert.cjs.entry.js +3 -3
- package/dist/cjs/dda-attach-file.cjs.entry.js +3 -3
- package/dist/cjs/dda-avatar.cjs.entry.js +7 -7
- package/dist/cjs/dda-banner-card.cjs.entry.js +5 -5
- package/dist/cjs/dda-banner.cjs.entry.js +3 -3
- 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 +3 -3
- package/dist/cjs/dda-chip.cjs.entry.js +3 -3
- package/dist/cjs/dda-credit-card.cjs.entry.js +3 -3
- package/dist/cjs/dda-creditcard-field.cjs.entry.js +3 -3
- package/dist/cjs/dda-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/dda-footer.cjs.entry.js +3 -3
- package/dist/cjs/dda-header.cjs.entry.js +33 -6
- package/dist/cjs/dda-home-banner.cjs.entry.js +9 -5
- package/dist/cjs/dda-home-carousel.cjs.entry.js +2 -2
- package/dist/cjs/dda-horizontal-stepper.cjs.entry.js +3 -3
- package/dist/cjs/dda-input.cjs.entry.js +3 -3
- package/dist/cjs/dda-link-button_2.cjs.entry.js +6 -6
- package/dist/cjs/dda-number-field.cjs.entry.js +3 -3
- package/dist/cjs/dda-pagination.cjs.entry.js +3 -3
- package/dist/cjs/dda-phonefield.cjs.entry.js +3 -3
- package/dist/cjs/dda-progressbar.cjs.entry.js +3 -3
- package/dist/cjs/dda-range-slider.cjs.entry.js +3 -3
- package/dist/cjs/dda-scroll-icon.cjs.entry.js +32 -0
- package/dist/cjs/dda-search-input.cjs.entry.js +3 -3
- package/dist/cjs/dda-segmented-tabs.cjs.entry.js +3 -3
- package/dist/cjs/dda-select.cjs.entry.js +83 -12
- package/dist/cjs/dda-sticky-footer.cjs.entry.js +4 -4
- package/dist/cjs/dda-tabs.cjs.entry.js +3 -3
- package/dist/cjs/dda-textarea.cjs.entry.js +4 -4
- package/dist/cjs/dda-toggle.cjs.entry.js +3 -3
- package/dist/cjs/dda-tooltip.cjs.entry.js +3 -3
- 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 +2 -2
- package/dist/cjs/{index-DD8fdSxb.js → index-dmQf0qrn.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/dda-accordion/dda-accordion.js +1 -1
- package/dist/collection/components/dda-alert/dda-alert.js +1 -1
- package/dist/collection/components/dda-attach-file/dda-attach-file.js +1 -1
- package/dist/collection/components/dda-avatar/dda-avatar.js +5 -5
- package/dist/collection/components/dda-banner/dda-banner.js +1 -1
- package/dist/collection/components/dda-banner-card/dda-banner-card.js +3 -3
- package/dist/collection/components/dda-button/dda-button.js +1 -1
- package/dist/collection/components/dda-checkbox/dda-checkbox.js +1 -1
- package/dist/collection/components/dda-chip/dda-chip.js +1 -1
- package/dist/collection/components/dda-credit-card/dda-credit-card.js +1 -1
- package/dist/collection/components/dda-creditcard-field/dda-creditcard-field.js +1 -1
- package/dist/collection/components/dda-dropdown/dda-dropdown.js +1 -1
- package/dist/collection/components/dda-footer/dda-footer.js +1 -1
- package/dist/collection/components/dda-header/dda-header.js +32 -5
- package/dist/collection/components/dda-home-banner/dda-home-banner.js +46 -2
- package/dist/collection/components/dda-home-banner/dda-home-banner.stories.js +6 -0
- package/dist/collection/components/dda-home-banner/home-banner.css +10 -0
- package/dist/collection/components/dda-input/dda-input.js +1 -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 +1 -1
- package/dist/collection/components/dda-pagination/dda-pagination.js +1 -1
- package/dist/collection/components/dda-phonefield/dda-phonefield.js +1 -1
- package/dist/collection/components/dda-progressbar/dda-progressbar.js +1 -1
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.css +31 -6
- package/dist/collection/components/dda-radiobutton/dda-radiobutton.js +1 -1
- package/dist/collection/components/dda-range-slider/dda-range-slider.js +2 -2
- package/dist/collection/components/dda-scroll-icon/dda-scroll-icon.css +72 -0
- package/dist/collection/components/dda-scroll-icon/dda-scroll-icon.js +120 -0
- package/dist/collection/components/dda-scroll-icon/dda-scroll-icon.stories.js +17 -0
- package/dist/collection/components/dda-search-input/dda-search-input.js +1 -1
- package/dist/collection/components/dda-select/dda-select.js +209 -18
- package/dist/collection/components/dda-select/dda-select.stories.js +68 -10
- package/dist/collection/components/dda-sticky-footer/dda-sticky-footer.js +2 -2
- package/dist/collection/components/dda-tabs/dda-tabs.js +1 -1
- package/dist/collection/components/dda-textarea/dda-textarea.js +2 -2
- package/dist/collection/components/dda-toggle/dda-toggle.js +1 -1
- package/dist/collection/components/dda-tooltip/dda-tooltip.js +1 -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 +1 -1
- 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/global.css +31 -6
- 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-card.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-home-carousel.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-scroll-icon.d.ts +11 -0
- package/dist/components/dda-scroll-icon.js +1 -0
- 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-D3e_hki9.js → p-515Iolds.js} +1 -1
- package/dist/components/p-BoRFp_3l.js +1 -0
- package/dist/components/{p-BCtBptNq.js → p-BsuxUhYp.js} +1 -1
- package/dist/components/{p-BZzFtOHg.js → p-CdwbDBBx.js} +1 -1
- package/dist/components/{p-DCwxgkNU.js → p-D6rCOerj.js} +1 -1
- package/dist/components/{p-BP6BxgDV.js → p-DCJtRqay.js} +1 -1
- package/dist/components/{p-R9p4F9Pi.js → p-DW6Q9LDq.js} +1 -1
- package/dist/dda/dda.css +53 -1
- package/dist/dda/dda.esm.js +1 -1
- package/dist/dda/{p-06188c4c.entry.js → p-024607f9.entry.js} +1 -1
- package/dist/dda/{p-faed59dd.entry.js → p-08e196c8.entry.js} +1 -1
- package/dist/dda/p-11264464.entry.js +1 -0
- package/dist/dda/p-1ae9ad19.entry.js +1 -0
- package/dist/dda/{p-10c5a752.entry.js → p-1d7eadd0.entry.js} +1 -1
- package/dist/dda/p-29d227c2.entry.js +1 -0
- package/dist/dda/{p-95100f73.entry.js → p-3220de7f.entry.js} +1 -1
- package/dist/dda/{p-4e717a2e.entry.js → p-3a130316.entry.js} +1 -1
- package/dist/dda/{p-8852dafb.entry.js → p-4d16c67a.entry.js} +1 -1
- package/dist/dda/{p-0480f0a9.entry.js → p-55033258.entry.js} +1 -1
- package/dist/dda/{p-7ffce954.entry.js → p-5fe4825e.entry.js} +1 -1
- package/dist/dda/{p-6d4f5672.entry.js → p-60a61479.entry.js} +1 -1
- package/dist/dda/{p-47322b02.entry.js → p-67ce47e5.entry.js} +1 -1
- package/dist/dda/{p-8108c4ed.entry.js → p-6cb8fead.entry.js} +1 -1
- package/dist/dda/{p-9ff8dc84.entry.js → p-6d1699c0.entry.js} +1 -1
- package/dist/dda/{p-b37f40a9.entry.js → p-6f2aebb1.entry.js} +1 -1
- package/dist/dda/{p-333205aa.entry.js → p-7df6794e.entry.js} +1 -1
- package/dist/dda/{p-9f01cb56.entry.js → p-854fd7d4.entry.js} +1 -1
- package/dist/dda/{p-8dbbc0ca.entry.js → p-8c1f5a63.entry.js} +1 -1
- package/dist/dda/{p-46df4933.entry.js → p-8d7f6793.entry.js} +1 -1
- package/dist/dda/{p-a8a1ee5d.entry.js → p-9062f90c.entry.js} +1 -1
- package/dist/dda/p-91f8c78c.entry.js +1 -0
- package/dist/dda/p-92d77aa7.entry.js +1 -0
- package/dist/dda/p-96080710.entry.js +1 -0
- package/dist/dda/{p-BnrqwGTj.js → p-BJtZ8AZm.js} +1 -1
- package/dist/dda/{p-76859bf8.entry.js → p-abae3f8a.entry.js} +1 -1
- package/dist/dda/{p-32a7c588.entry.js → p-af5d9ca7.entry.js} +1 -1
- package/dist/dda/{p-25058697.entry.js → p-b0eaaa1a.entry.js} +1 -1
- package/dist/dda/p-b29a3530.entry.js +1 -0
- package/dist/dda/{p-7c1abbd2.entry.js → p-b367e773.entry.js} +1 -1
- package/dist/dda/{p-f2efc121.entry.js → p-b3af8eec.entry.js} +1 -1
- package/dist/dda/{p-08e1892a.entry.js → p-b6c5c050.entry.js} +1 -1
- package/dist/dda/{p-169ba650.entry.js → p-bf1cd0fd.entry.js} +1 -1
- package/dist/dda/{p-6430c363.entry.js → p-c0f0d5e5.entry.js} +1 -1
- package/dist/dda/{p-fb00dec4.entry.js → p-cfffa1b4.entry.js} +1 -1
- package/dist/dda/{p-6db5588a.entry.js → p-e545b6ff.entry.js} +1 -1
- package/dist/dda/{p-9d9834ff.entry.js → p-f649bd48.entry.js} +1 -1
- package/dist/esm/dda-accordion.entry.js +3 -3
- package/dist/esm/dda-alert.entry.js +3 -3
- package/dist/esm/dda-attach-file.entry.js +3 -3
- package/dist/esm/dda-avatar.entry.js +7 -7
- package/dist/esm/dda-banner-card.entry.js +5 -5
- package/dist/esm/dda-banner.entry.js +3 -3
- 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 +3 -3
- package/dist/esm/dda-chip.entry.js +3 -3
- package/dist/esm/dda-credit-card.entry.js +3 -3
- package/dist/esm/dda-creditcard-field.entry.js +3 -3
- package/dist/esm/dda-dropdown.entry.js +3 -3
- package/dist/esm/dda-footer.entry.js +3 -3
- package/dist/esm/dda-header.entry.js +33 -6
- package/dist/esm/dda-home-banner.entry.js +9 -5
- package/dist/esm/dda-home-carousel.entry.js +2 -2
- package/dist/esm/dda-horizontal-stepper.entry.js +3 -3
- package/dist/esm/dda-input.entry.js +3 -3
- package/dist/esm/dda-link-button_2.entry.js +6 -6
- package/dist/esm/dda-number-field.entry.js +3 -3
- package/dist/esm/dda-pagination.entry.js +3 -3
- package/dist/esm/dda-phonefield.entry.js +3 -3
- package/dist/esm/dda-progressbar.entry.js +3 -3
- package/dist/esm/dda-range-slider.entry.js +3 -3
- package/dist/esm/dda-scroll-icon.entry.js +30 -0
- package/dist/esm/dda-search-input.entry.js +3 -3
- package/dist/esm/dda-segmented-tabs.entry.js +3 -3
- package/dist/esm/dda-select.entry.js +83 -12
- package/dist/esm/dda-sticky-footer.entry.js +4 -4
- package/dist/esm/dda-tabs.entry.js +3 -3
- package/dist/esm/dda-textarea.entry.js +4 -4
- package/dist/esm/dda-toggle.entry.js +3 -3
- package/dist/esm/dda-tooltip.entry.js +3 -3
- 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 -3
- package/dist/esm/{index-BnrqwGTj.js → index-BJtZ8AZm.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/dda-header/dda-header.d.ts +2 -0
- package/dist/types/components/dda-home-banner/dda-home-banner.d.ts +4 -0
- package/dist/types/components/dda-home-banner/dda-home-banner.stories.d.ts +8 -0
- package/dist/types/components/dda-scroll-icon/dda-scroll-icon.d.ts +11 -0
- package/dist/types/components/dda-scroll-icon/dda-scroll-icon.stories.d.ts +20 -0
- package/dist/types/components/dda-select/dda-select.d.ts +40 -5
- package/dist/types/components/dda-select/dda-select.stories.d.ts +25 -0
- package/dist/types/components.d.ts +137 -10
- package/package.json +1 -1
- package/dist/dda/p-5840fad9.entry.js +0 -1
- package/dist/dda/p-5bb62ef7.entry.js +0 -1
- package/dist/dda/p-5e757702.entry.js +0 -1
- package/dist/dda/p-9a4e34d1.entry.js +0 -1
- package/dist/dda/p-9b234635.entry.js +0 -1
- package/dist/dda/p-eaffd32d.entry.js +0 -1
|
@@ -15,6 +15,19 @@ export class Ddaselect {
|
|
|
15
15
|
// Fallback id so the label, list and messages are wired when no button_id
|
|
16
16
|
// is passed (otherwise ids became "undefined-listbox" and the label had for="").
|
|
17
17
|
this.fallbackId = uniqueId('dda-select');
|
|
18
|
+
this.onTriggerBlur = (event) => {
|
|
19
|
+
var _a;
|
|
20
|
+
// A keyboard ArrowDown/Up on the trigger opens the list and moves focus into it — that is
|
|
21
|
+
// not the user leaving the field, so skip the event when focus lands back inside this.el.
|
|
22
|
+
const related = event.relatedTarget;
|
|
23
|
+
if (related && this.el.contains(related)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.selectBlurred.emit({
|
|
27
|
+
name: this.input_name || this.button_id || this.triggerId,
|
|
28
|
+
value: ((_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.text) || '',
|
|
29
|
+
});
|
|
30
|
+
};
|
|
18
31
|
this.onTriggerKeyDown = (event) => {
|
|
19
32
|
if (this.disabled) {
|
|
20
33
|
return;
|
|
@@ -98,12 +111,51 @@ export class Ddaselect {
|
|
|
98
111
|
return ids.length ? ids.join(' ') : undefined;
|
|
99
112
|
}
|
|
100
113
|
get parsedOptions() {
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
let raw = this.options;
|
|
115
|
+
if (typeof raw === 'string') {
|
|
116
|
+
try {
|
|
117
|
+
raw = JSON.parse(raw);
|
|
118
|
+
}
|
|
119
|
+
catch (_a) {
|
|
120
|
+
return [];
|
|
121
|
+
}
|
|
103
122
|
}
|
|
104
|
-
|
|
123
|
+
if (!Array.isArray(raw))
|
|
105
124
|
return [];
|
|
106
|
-
|
|
125
|
+
return raw
|
|
126
|
+
.map((entry) => {
|
|
127
|
+
var _a;
|
|
128
|
+
if (typeof entry === 'string')
|
|
129
|
+
return { id: entry, text: entry };
|
|
130
|
+
if (entry && typeof entry === 'object' && typeof entry.text === 'string') {
|
|
131
|
+
const option = entry;
|
|
132
|
+
// Keep the original entry as `source` so selectChanged can emit it with any extra
|
|
133
|
+
// fields (e.g. `code`) the page passed in, as 3.x did.
|
|
134
|
+
return { id: (_a = option.id) !== null && _a !== void 0 ? _a : option.text, text: option.text, source: option };
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
})
|
|
138
|
+
.filter((option) => option !== null);
|
|
139
|
+
}
|
|
140
|
+
// 3.x matched `selected` against the id (as a string) or the text. An id match wins over a
|
|
141
|
+
// text match, so two options with the same text but different ids stay apart.
|
|
142
|
+
findSelected(options) {
|
|
143
|
+
var _a;
|
|
144
|
+
if (this.selected === undefined || this.selected === null)
|
|
145
|
+
return undefined;
|
|
146
|
+
const value = String(this.selected);
|
|
147
|
+
return (_a = options.find(option => String(option.id) === value)) !== null && _a !== void 0 ? _a : options.find(option => option.text === value);
|
|
148
|
+
}
|
|
149
|
+
get selectedOption() {
|
|
150
|
+
return this.findSelected(this.parsedOptions);
|
|
151
|
+
}
|
|
152
|
+
get triggerLabel() {
|
|
153
|
+
if (this.aria_label)
|
|
154
|
+
return this.aria_label;
|
|
155
|
+
// main_aria_label sets aria-label, which replaces aria-labelledby. Only use it when there is
|
|
156
|
+
// no label to keep aria-labelledby for; otherwise the label and the selected value would stop
|
|
157
|
+
// being announced.
|
|
158
|
+
return this.label ? undefined : this.main_aria_label || undefined;
|
|
107
159
|
}
|
|
108
160
|
focusOption(index) {
|
|
109
161
|
const options = Array.from(this.el.querySelectorAll('.dda-input-dropdown-item[role="option"]'));
|
|
@@ -119,8 +171,9 @@ export class Ddaselect {
|
|
|
119
171
|
}
|
|
120
172
|
initialOptionIndex() {
|
|
121
173
|
const options = this.parsedOptions;
|
|
122
|
-
const
|
|
123
|
-
|
|
174
|
+
const selected = this.findSelected(options);
|
|
175
|
+
const index = selected ? options.indexOf(selected) : -1;
|
|
176
|
+
return index >= 0 ? index : 0;
|
|
124
177
|
}
|
|
125
178
|
toggleSelect() {
|
|
126
179
|
if (!this.disabled) {
|
|
@@ -149,12 +202,19 @@ export class Ddaselect {
|
|
|
149
202
|
this.toggleSelect();
|
|
150
203
|
}
|
|
151
204
|
selectOption(option) {
|
|
205
|
+
var _a;
|
|
152
206
|
if (!this.disabled) {
|
|
153
|
-
const
|
|
154
|
-
|
|
207
|
+
const value = String(option.id);
|
|
208
|
+
// Compare against the currently *matched* option's id, not the raw `selected` prop: when
|
|
209
|
+
// `selected` holds text or a differently-typed id (e.g. a number), comparing it to
|
|
210
|
+
// `value` directly reported a change that had not happened.
|
|
211
|
+
const currentSelected = this.findSelected(this.parsedOptions);
|
|
212
|
+
const changed = String(currentSelected === null || currentSelected === void 0 ? void 0 : currentSelected.id) !== value;
|
|
213
|
+
this.selected = value;
|
|
155
214
|
this.closeAndReturnFocus();
|
|
215
|
+
this.selectChanged.emit((_a = option.source) !== null && _a !== void 0 ? _a : { id: option.id, text: option.text });
|
|
156
216
|
if (changed) {
|
|
157
|
-
this.selectionChange.emit({ value: option });
|
|
217
|
+
this.selectionChange.emit({ value, id: option.id, text: option.text });
|
|
158
218
|
}
|
|
159
219
|
}
|
|
160
220
|
}
|
|
@@ -166,8 +226,17 @@ export class Ddaselect {
|
|
|
166
226
|
}
|
|
167
227
|
}
|
|
168
228
|
render() {
|
|
229
|
+
var _a;
|
|
169
230
|
const id = this.triggerId;
|
|
170
|
-
|
|
231
|
+
const options = this.parsedOptions;
|
|
232
|
+
const current = this.findSelected(options);
|
|
233
|
+
// Computed once here (not per option below) to keep the list render O(n) instead of O(n^2).
|
|
234
|
+
const activeIndex = current ? options.indexOf(current) : 0;
|
|
235
|
+
const validation = this.error || this.validation_type;
|
|
236
|
+
return (h(Host, { key: '79b4f368bdab0911dde6303d33ab79c8ea093399' }, h("div", { key: '8f9d7984043832d14d72ed6770b5ea384b3e4015', 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-${validation} ` }, this.label && h("label", { key: 'c3e73bc801980fe409dde6078b5763edbc249292', id: this.labelId, class: "dda-input-label" }, this.label), h("div", { key: '2572ef664b2aafcefd62c7361337d2aa9a649438', class: "dda-dropdown-container" }, h("button", { key: 'cda07037871e133d06a54c4da37abee49db11f59', name: this.toggle_button_name, "aria-label": this.triggerLabel, "aria-labelledby": this.label && !this.triggerLabel ? `${this.labelId} ${id}` : undefined, id: 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, onBlur: this.onTriggerBlur }, current ? current.text : ((_a = this.placeholder) !== null && _a !== void 0 ? _a : 'Select an option'), h("i", { key: '3d8f579d35ad0516e78530b548d61858d0721831', class: `material-icons`, "aria-hidden": "true" }, this.is_open ? 'keyboard_arrow_up' : 'keyboard_arrow_down')), this.is_open && (h("div", { key: '66eb4b2edd1f716a95be787e4cfd9185936bc62f', id: this.listboxId, role: "listbox", "aria-label": this.triggerLabel || this.label, class: "dda-input-dropdown-list dda-select-list" }, options.length > 0 ? (options.map((option, index) => {
|
|
237
|
+
const isCurrent = current !== undefined && String(current.id) === String(option.id);
|
|
238
|
+
return (h("button", { name: this.option_select_button_name, type: "button", role: "option", "aria-selected": isCurrent ? 'true' : 'false', tabIndex: index === activeIndex ? 0 : -1, class: `dda-input-dropdown-item ${isCurrent ? 'selected' : ''}`, onClick: () => this.selectOption(option), onKeyDown: (event) => this.onOptionKeyDown(event, option), key: `${index}-${option.id}` }, option.text));
|
|
239
|
+
})) : (h("div", { class: "dda-input-dropdown-item" }, "No options available"))))), this.helper_text && h("span", { key: '31d9c4afb879454e109e7d6fb406b5467ef5c495', id: this.helperId, class: "dda-helper-text" }, this.helper_text), this.error_message && h("span", { key: '2b6ab09e5477120046fbacf530c514c8421a4aaa', id: this.errorId, class: "dda-error-message" }, this.error_message))));
|
|
171
240
|
}
|
|
172
241
|
static get is() { return "dda-select"; }
|
|
173
242
|
static get originalStyleUrls() {
|
|
@@ -205,15 +274,25 @@ export class Ddaselect {
|
|
|
205
274
|
"type": "string",
|
|
206
275
|
"mutable": false,
|
|
207
276
|
"complexType": {
|
|
208
|
-
"original": "string",
|
|
209
|
-
"resolved": "string",
|
|
210
|
-
"references": {
|
|
277
|
+
"original": "string | Array<string | SelectOption>",
|
|
278
|
+
"resolved": "(string | SelectOption)[] | string",
|
|
279
|
+
"references": {
|
|
280
|
+
"Array": {
|
|
281
|
+
"location": "global",
|
|
282
|
+
"id": "global::Array"
|
|
283
|
+
},
|
|
284
|
+
"SelectOption": {
|
|
285
|
+
"location": "local",
|
|
286
|
+
"path": "/root/Coding/dubai-design-system/packages/stencil/src/components/dda-select/dda-select.tsx",
|
|
287
|
+
"id": "src/components/dda-select/dda-select.tsx::SelectOption"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
211
290
|
},
|
|
212
291
|
"required": false,
|
|
213
292
|
"optional": false,
|
|
214
293
|
"docs": {
|
|
215
294
|
"tags": [],
|
|
216
|
-
"text": "Options
|
|
295
|
+
"text": "Options: a JSON array, or an array property, of strings (`[\"Dubai\",\"Sharjah\"]`) or 3.x `{ id, text }` objects (`[{\"id\":1,\"text\":\"Dubai\"}]`). Other entries are ignored. Invalid JSON shows \"No options available\"."
|
|
217
296
|
},
|
|
218
297
|
"getter": false,
|
|
219
298
|
"setter": false,
|
|
@@ -232,7 +311,7 @@ export class Ddaselect {
|
|
|
232
311
|
"optional": false,
|
|
233
312
|
"docs": {
|
|
234
313
|
"tags": [],
|
|
235
|
-
"text": "The selected option
|
|
314
|
+
"text": "The selected option: its id, or its text. For string options the id is the text. Updated to the picked option's id (as a string) when the user picks one. Mutable: the component assigns it."
|
|
236
315
|
},
|
|
237
316
|
"getter": false,
|
|
238
317
|
"setter": false,
|
|
@@ -449,6 +528,82 @@ export class Ddaselect {
|
|
|
449
528
|
"setter": false,
|
|
450
529
|
"reflect": false,
|
|
451
530
|
"attribute": "option_select_button_name"
|
|
531
|
+
},
|
|
532
|
+
"placeholder": {
|
|
533
|
+
"type": "string",
|
|
534
|
+
"mutable": false,
|
|
535
|
+
"complexType": {
|
|
536
|
+
"original": "string",
|
|
537
|
+
"resolved": "string",
|
|
538
|
+
"references": {}
|
|
539
|
+
},
|
|
540
|
+
"required": false,
|
|
541
|
+
"optional": false,
|
|
542
|
+
"docs": {
|
|
543
|
+
"tags": [],
|
|
544
|
+
"text": "Text in the trigger when nothing is selected. Default: `Select an option`."
|
|
545
|
+
},
|
|
546
|
+
"getter": false,
|
|
547
|
+
"setter": false,
|
|
548
|
+
"reflect": false,
|
|
549
|
+
"attribute": "placeholder"
|
|
550
|
+
},
|
|
551
|
+
"input_name": {
|
|
552
|
+
"type": "string",
|
|
553
|
+
"mutable": false,
|
|
554
|
+
"complexType": {
|
|
555
|
+
"original": "string",
|
|
556
|
+
"resolved": "string",
|
|
557
|
+
"references": {}
|
|
558
|
+
},
|
|
559
|
+
"required": false,
|
|
560
|
+
"optional": false,
|
|
561
|
+
"docs": {
|
|
562
|
+
"tags": [],
|
|
563
|
+
"text": "`name` sent in `selectBlurred`. Falls back to `button_id`."
|
|
564
|
+
},
|
|
565
|
+
"getter": false,
|
|
566
|
+
"setter": false,
|
|
567
|
+
"reflect": false,
|
|
568
|
+
"attribute": "input_name"
|
|
569
|
+
},
|
|
570
|
+
"main_aria_label": {
|
|
571
|
+
"type": "string",
|
|
572
|
+
"mutable": false,
|
|
573
|
+
"complexType": {
|
|
574
|
+
"original": "string",
|
|
575
|
+
"resolved": "string",
|
|
576
|
+
"references": {}
|
|
577
|
+
},
|
|
578
|
+
"required": false,
|
|
579
|
+
"optional": false,
|
|
580
|
+
"docs": {
|
|
581
|
+
"tags": [],
|
|
582
|
+
"text": "3.x name of `aria_label`, used as the trigger's aria-label only when `label` is not set. `aria_label` wins when both are set; when `label` is set, `main_aria_label` is ignored and the trigger keeps its `aria-labelledby`."
|
|
583
|
+
},
|
|
584
|
+
"getter": false,
|
|
585
|
+
"setter": false,
|
|
586
|
+
"reflect": false,
|
|
587
|
+
"attribute": "main_aria_label"
|
|
588
|
+
},
|
|
589
|
+
"validation_type": {
|
|
590
|
+
"type": "string",
|
|
591
|
+
"mutable": false,
|
|
592
|
+
"complexType": {
|
|
593
|
+
"original": "string",
|
|
594
|
+
"resolved": "string",
|
|
595
|
+
"references": {}
|
|
596
|
+
},
|
|
597
|
+
"required": false,
|
|
598
|
+
"optional": false,
|
|
599
|
+
"docs": {
|
|
600
|
+
"tags": [],
|
|
601
|
+
"text": "3.x name of `error` (the validation state class). `error` wins when both are set."
|
|
602
|
+
},
|
|
603
|
+
"getter": false,
|
|
604
|
+
"setter": false,
|
|
605
|
+
"reflect": false,
|
|
606
|
+
"attribute": "validation_type"
|
|
452
607
|
}
|
|
453
608
|
};
|
|
454
609
|
}
|
|
@@ -466,11 +621,47 @@ export class Ddaselect {
|
|
|
466
621
|
"composed": true,
|
|
467
622
|
"docs": {
|
|
468
623
|
"tags": [],
|
|
469
|
-
"text": "Emitted when the user picks an option other than the selected one, by mouse or keyboard. `detail.value` is the new option."
|
|
624
|
+
"text": "Emitted when the user picks an option other than the selected one, by mouse or keyboard. `detail.value` is the new `selected` value (the option id as a string); `detail.id` and `detail.text` are the option."
|
|
625
|
+
},
|
|
626
|
+
"complexType": {
|
|
627
|
+
"original": "{ value: string; id: string | number; text: string }",
|
|
628
|
+
"resolved": "{ value: string; id: string | number; text: string; }",
|
|
629
|
+
"references": {}
|
|
630
|
+
}
|
|
631
|
+
}, {
|
|
632
|
+
"method": "selectChanged",
|
|
633
|
+
"name": "selectChanged",
|
|
634
|
+
"bubbles": true,
|
|
635
|
+
"cancelable": true,
|
|
636
|
+
"composed": true,
|
|
637
|
+
"docs": {
|
|
638
|
+
"tags": [],
|
|
639
|
+
"text": "3.x event: emitted each time the user picks one, even if it is already selected. For a string\noption this is `{ id, text }`; for an object option this is the original option object, extra\nfields included, as 3.x did."
|
|
640
|
+
},
|
|
641
|
+
"complexType": {
|
|
642
|
+
"original": "SelectOption",
|
|
643
|
+
"resolved": "SelectOption",
|
|
644
|
+
"references": {
|
|
645
|
+
"SelectOption": {
|
|
646
|
+
"location": "local",
|
|
647
|
+
"path": "/root/Coding/dubai-design-system/packages/stencil/src/components/dda-select/dda-select.tsx",
|
|
648
|
+
"id": "src/components/dda-select/dda-select.tsx::SelectOption"
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
}, {
|
|
653
|
+
"method": "selectBlurred",
|
|
654
|
+
"name": "selectBlurred",
|
|
655
|
+
"bubbles": true,
|
|
656
|
+
"cancelable": true,
|
|
657
|
+
"composed": true,
|
|
658
|
+
"docs": {
|
|
659
|
+
"tags": [],
|
|
660
|
+
"text": "3.x event: emitted when the trigger loses focus, with `{ name, value }` \u2014 `input_name` (or `button_id`) and the selected text."
|
|
470
661
|
},
|
|
471
662
|
"complexType": {
|
|
472
|
-
"original": "{ value: string }",
|
|
473
|
-
"resolved": "{ value: string; }",
|
|
663
|
+
"original": "{ name: string; value: string }",
|
|
664
|
+
"resolved": "{ name: string; value: string; }",
|
|
474
665
|
"references": {}
|
|
475
666
|
}
|
|
476
667
|
}];
|
|
@@ -61,6 +61,22 @@ export default {
|
|
|
61
61
|
control: { type: 'text' },
|
|
62
62
|
description: 'Name for the option select button',
|
|
63
63
|
},
|
|
64
|
+
placeholder: {
|
|
65
|
+
control: { type: 'text' },
|
|
66
|
+
description: 'Text in the trigger when nothing is selected',
|
|
67
|
+
},
|
|
68
|
+
input_name: {
|
|
69
|
+
control: { type: 'text' },
|
|
70
|
+
description: '3.x: name sent in the selectBlurred event',
|
|
71
|
+
},
|
|
72
|
+
main_aria_label: {
|
|
73
|
+
control: { type: 'text' },
|
|
74
|
+
description: '3.x name of aria_label; used only when there is no label',
|
|
75
|
+
},
|
|
76
|
+
validation_type: {
|
|
77
|
+
control: { type: 'text' },
|
|
78
|
+
description: '3.x name of the error/validation state',
|
|
79
|
+
},
|
|
64
80
|
},
|
|
65
81
|
parameters: {
|
|
66
82
|
docs: {
|
|
@@ -85,17 +101,38 @@ export default {
|
|
|
85
101
|
option_select_button_name="option_select_button_name"
|
|
86
102
|
></dda-select>
|
|
87
103
|
\`\`\`
|
|
104
|
+
|
|
105
|
+
\`options\` also takes 3.x \`{ id, text }\` objects, and \`selected\` then takes the id:
|
|
106
|
+
|
|
107
|
+
\`\`\`html
|
|
108
|
+
<dda-select
|
|
109
|
+
label="Emirate"
|
|
110
|
+
placeholder="Select an emirate"
|
|
111
|
+
selected="2"
|
|
112
|
+
options='[{"id":1,"text":"Dubai"},{"id":2,"text":"Abu Dhabi"},{"id":3,"text":"Sharjah"}]'
|
|
113
|
+
></dda-select>
|
|
114
|
+
|
|
115
|
+
<script>
|
|
116
|
+
const select = document.querySelector('dda-select');
|
|
117
|
+
select.addEventListener('selectChanged', e => {
|
|
118
|
+
console.log('selectChanged:', e.detail);
|
|
119
|
+
});
|
|
120
|
+
select.addEventListener('selectionChange', e => {
|
|
121
|
+
console.log('selectionChange:', e.detail);
|
|
122
|
+
});
|
|
123
|
+
</script>
|
|
124
|
+
\`\`\`
|
|
88
125
|
`,
|
|
89
126
|
},
|
|
90
127
|
},
|
|
91
128
|
},
|
|
92
129
|
};
|
|
93
|
-
const Template =
|
|
130
|
+
const Template = args => {
|
|
94
131
|
const attributes = Object.entries(args)
|
|
95
132
|
.filter(([key, value]) => value !== undefined && key !== 'text' && key !== 'options')
|
|
96
133
|
.map(([key, value]) => `${key}="${value}"`)
|
|
97
134
|
.join(' ');
|
|
98
|
-
const optionsAttribute = `options='${JSON.stringify(args.options)}'`;
|
|
135
|
+
const optionsAttribute = `options='${typeof args.options === 'string' ? args.options : JSON.stringify(args.options)}'`;
|
|
99
136
|
return `<dda-select ${attributes} ${optionsAttribute}></dda-select>`;
|
|
100
137
|
};
|
|
101
138
|
export const Default = Template.bind({});
|
|
@@ -111,8 +148,8 @@ Default.args = {
|
|
|
111
148
|
component_mode: '',
|
|
112
149
|
button_id: 'button',
|
|
113
150
|
aria_label: 'select',
|
|
114
|
-
toggle_button_name:
|
|
115
|
-
option_select_button_name:
|
|
151
|
+
toggle_button_name: 'toggle_button_name',
|
|
152
|
+
option_select_button_name: 'option_select_button_name',
|
|
116
153
|
};
|
|
117
154
|
export const Small = Template.bind({});
|
|
118
155
|
Small.args = {
|
|
@@ -127,8 +164,8 @@ Small.args = {
|
|
|
127
164
|
component_mode: '',
|
|
128
165
|
button_id: 'button',
|
|
129
166
|
aria_label: 'select',
|
|
130
|
-
toggle_button_name:
|
|
131
|
-
option_select_button_name:
|
|
167
|
+
toggle_button_name: 'toggle_button_name',
|
|
168
|
+
option_select_button_name: 'option_select_button_name',
|
|
132
169
|
};
|
|
133
170
|
export const WithError = Template.bind({});
|
|
134
171
|
WithError.args = {
|
|
@@ -143,8 +180,8 @@ WithError.args = {
|
|
|
143
180
|
component_mode: '',
|
|
144
181
|
button_id: 'button',
|
|
145
182
|
aria_label: 'select',
|
|
146
|
-
toggle_button_name:
|
|
147
|
-
option_select_button_name:
|
|
183
|
+
toggle_button_name: 'toggle_button_name',
|
|
184
|
+
option_select_button_name: 'option_select_button_name',
|
|
148
185
|
};
|
|
149
186
|
export const Disabled = Template.bind({});
|
|
150
187
|
Disabled.args = {
|
|
@@ -158,6 +195,27 @@ Disabled.args = {
|
|
|
158
195
|
component_mode: '',
|
|
159
196
|
button_id: 'button',
|
|
160
197
|
aria_label: 'select',
|
|
161
|
-
toggle_button_name:
|
|
162
|
-
option_select_button_name:
|
|
198
|
+
toggle_button_name: 'toggle_button_name',
|
|
199
|
+
option_select_button_name: 'option_select_button_name',
|
|
200
|
+
};
|
|
201
|
+
export const IdAndText = Template.bind({});
|
|
202
|
+
IdAndText.args = {
|
|
203
|
+
label: 'Emirate',
|
|
204
|
+
options: JSON.stringify([
|
|
205
|
+
{ id: 1, text: 'Dubai' },
|
|
206
|
+
{ id: 2, text: 'Abu Dhabi' },
|
|
207
|
+
{ id: 3, text: 'Sharjah' },
|
|
208
|
+
]),
|
|
209
|
+
selected: '2',
|
|
210
|
+
placeholder: 'Select an emirate',
|
|
211
|
+
disabled: false,
|
|
212
|
+
helper_text: '',
|
|
213
|
+
error_message: '',
|
|
214
|
+
size: 'default',
|
|
215
|
+
custom_class: '',
|
|
216
|
+
component_mode: '',
|
|
217
|
+
button_id: 'button',
|
|
218
|
+
aria_label: 'select',
|
|
219
|
+
toggle_button_name: 'toggle_button_name',
|
|
220
|
+
option_select_button_name: 'option_select_button_name',
|
|
163
221
|
};
|
|
@@ -78,12 +78,12 @@ export class DdaStickyFooter {
|
|
|
78
78
|
const rightItems = parseJsonProp(this.rightLink, 'right-link');
|
|
79
79
|
return (
|
|
80
80
|
// An <aside>, not a <footer>: the page footer (dda-footer) is the only contentinfo landmark.
|
|
81
|
-
h("aside", { key: '
|
|
81
|
+
h("aside", { key: '3646462dd78e1e15798cbde5a74d75191cdd1086', class: { 'dda-footer': true, hidden: this.isHidden, 'has-more-button': !!this.moreIcon }, "aria-label": this.aria_label, "aria-hidden": this.isHidden ? 'true' : 'false', inert: this.isHidden }, h("div", { key: 'cef204100853f69250b15c7e71ef2d6b97df7fce', class: "footer-content" }, h("div", { key: '0bc5c97a4406ff13f240becca20212f78d2e96fc', class: "dda-footer-item dda-footer-left" }, h("ul", { key: '70d02e19f02c4dd54cf533351dd70e28f9b9d00f' }, this.happinessIconSrc && (h("li", { key: 'e0202043b9b94772dec0ecce445ab1fff71545a2', class: "foot-icon-btn" }, h("dda-tooltip", { key: '0d3fb7aa55adca64a1b2cd5adb7c6d323ab358fd', title_text: this.happinessIconTooltip, description: "", position: "top" }, h("a", { key: 'b6617f12a5834e8c2edd86addc03416f19ea7af3', href: this.happinessIconHref, id: this.happinessIconId }, h("img", { key: '1689a7b0fa925862d7083870c1d90b6e2dbbc4ba', src: this.img(this.happinessIconSrc, this.happinessIconSrcDark), alt: this.happinessIconAlt }))))), this.accessibilityIconSrc && (h("li", { key: 'b2abd53e38316dffba4081fbdc2f32e2733e0f65', class: "foot-icon-btn" }, h("dda-tooltip", { key: 'd59ddfeac093c7e213e5847a645a98cae907efbc', title_text: this.accessibilityIconTooltip, description: "", position: "top" }, h("a", { key: '81fcac6b35eed1caf49017d18aa0960871ada04c', href: this.accessibilityIconHref, id: this.accessibilityIconId }, h("img", { key: '1fbec3dc783c99e16a66aec2edf6e09bf68e64aa', src: this.img(this.accessibilityIconSrc, this.accessibilityIconSrcDark), alt: this.accessibilityIconAlt }))))), (this.servicesIconSrc || this.servicesIconText) && (h("li", { key: '4a8bfc4edf865cab5d0dfd271d537a2bd889a170', class: "foot-icon-btn" }, h("dda-tooltip", { key: '48bccd2fc8736481a8446c9db30a014ac63d6ad8', title_text: this.servicesIconTooltip, description: "", position: "top" }, h("a", { key: '15c07ad10e9b29434ed40e1a0db429bb90e9531d', href: this.servicesIconHref, id: this.servicesIconId }, h("img", { key: '3ec96b68cd44f4468e219e46764a84d967ed3989', src: this.img(this.servicesIconSrc, this.servicesIconSrcDark), alt: this.servicesIconText ? '' : this.servicesIconAlt }), this.servicesIconText && h("span", { key: 'c8ebfa04088a46d883e920900ecb8f6880042be4' }, this.servicesIconText))))))), !this.hideMiddleSection && middleLogos.length > 0 && (h("div", { key: 'ffbce0f6070b63588bdf52b5660bdafd02937dc4', class: "dda-footer-item dda-footer-middle" }, h("ul", { key: '7b1ffaa87a43a549d5ff7c09acc7eedda8289776', class: "foot-logo" }, middleLogos.map(logo => (h("li", null, h("dda-tooltip", { title_text: logo.tooltip, description: "", position: "top" }, h("a", { href: logo.href }, h("img", { src: logo.src, alt: logo.alt }))))))))), h("div", { key: '1177349fa3617cc0a60cc36569e2005bd8d161b4', class: "dda-footer-item dda-footer-right" }, h("ul", { key: '28cf955988ea1a1b4897015dbeddbcd19913c523', id: this.rightListId, class: { 'foot-right_links': true, 'show-dda-icon': this.rightOpen }, inert: !!this.moreIcon && !this.rightOpen && this.isMobile }, rightItems.length > 0
|
|
82
82
|
? rightItems.map(item => (h("li", { class: "foot-icon-btn" }, h("dda-tooltip", { title_text: item.RightLinkTooltip || item.LinkText, description: "", position: "top" }, h("a", { href: item.href, id: item.itemId, title: item.title }, item.IconName && (h("i", { class: item.IconFamily || 'material-icons', "aria-hidden": "true" }, item.IconName)), h("span", null, item.LinkText))))))
|
|
83
83
|
: [
|
|
84
84
|
(this.locationLogoSrc || this.locationButtonIcon) && (h("li", { class: "foot-icon-btn" }, h("dda-tooltip", { title_text: this.locationButtonText, description: "", position: "top" }, h("a", { href: this.locationButtonHref }, this.renderLinkGraphic(this.locationLogoSrc, this.locationButtonIcon, this.locationButtonText))))),
|
|
85
85
|
(this.newsButtonSrc || this.newsButtonIcon) && (h("li", { class: "foot-icon-btn" }, h("dda-tooltip", { title_text: this.newsButtonText, description: "", position: "top" }, h("a", { href: this.newsButtonHref }, this.renderLinkGraphic(this.newsButtonSrc, this.newsButtonIcon, this.newsButtonText))))),
|
|
86
|
-
], this.dubaiaeIconSrc && this.dubaiaeIconSmallSrc && (h("li", { key: '
|
|
86
|
+
], this.dubaiaeIconSrc && this.dubaiaeIconSmallSrc && (h("li", { key: 'edc740c6c800ef96bc14f5543923f82a041d446c', class: "foot-icon-btn" }, h("dda-tooltip", { key: '827b9a1300bde258043c55733fd3547a9390abda', title_text: this.dubaiaeIconTooltip, description: "", position: "top" }, h("a", { key: '5d8e8ed55f43e3615722365b9d26ec8f6e1c4b2f', href: this.dubaiaeIconHref, id: this.dubaiaeIconId }, h("img", { key: '4a1f27125a148e86f50f53afa1b930e0de090dd9', class: "dubaiae-text-icon", src: this.img(this.dubaiaeIconSrc, this.dubaiaeIconSrcDark), alt: this.dubaiaeIconAlt }), h("img", { key: '665af1359538e8355621f813a138f0eb9d7bd84b', class: "dubaiae-small-icon", src: this.dubaiaeIconSmallSrc, alt: this.dubaiaeIconAlt }))))), this.aiIconSrc && (h("li", { key: '01fee43f185be8bf1294aecbe52b055398b7b543', class: "foot-icon-btn" }, h("dda-tooltip", { key: '820c78282e14472ca990b12041db4ec4e642083e', title_text: this.aiIconTooltip, description: "", position: "top" }, h("a", { key: '54eb1224021a028677e9b8d23006fbd9beb11fbf', href: this.aiIconHref, id: this.aiIconId }, h("img", { key: '6d1feb742d0ca78e690351535bbd9cbeebe0d5f5', src: this.img(this.aiIconSrc, this.aiIconSrcDark), alt: this.aiIconAlt }))))), this.chatIconSrc && (h("li", { key: 'af4d7ad217827506e99407da3a8101f32d7bde78', class: "foot-icon-btn" }, h("dda-tooltip", { key: '7478d66901785ce407d0a51ab8e80fa538f67768', title_text: this.chatIconTooltip, description: "", position: "top" }, h("a", { key: '4c8b819b05e00738e6b6a2a2c5361ba3480ec956', href: this.chatIconHref, id: this.chatIconId }, h("img", { key: '316c1e6691521684e21ca55ee6199a959f20528a', src: this.img(this.chatIconSrc, this.chatIconSrcDark), alt: this.chatIconAlt })))))), this.moreIcon && (h("button", { key: '2fc1d6684a5c59a364edf3cd3e7a7c1c03e097a9', type: "button", class: "show-right-icon", "aria-label": this.more_button_label || 'More', "aria-expanded": this.rightOpen ? 'true' : 'false', "aria-controls": this.rightListId, onClick: () => (this.rightOpen = !this.rightOpen) }, h("i", { key: 'e7b3e9c6ba9dec1af710039255832e5a2242b8bd', class: this.moreIconFamily || 'material-icons', "aria-hidden": "true" }, this.moreIcon)))))));
|
|
87
87
|
}
|
|
88
88
|
static get is() { return "dda-sticky-footer"; }
|
|
89
89
|
static get originalStyleUrls() {
|
|
@@ -44,7 +44,7 @@ export class DdaTabs {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: 'cd618ae51b42c4b3537c9d79f9d0722c6fedcdf3' }, h("div", { key: '6c5ce0c1e8742ad322d845da606224b0caa9286c', 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`, "aria-hidden": "true" }, this.parsedIcons[index] || ""), h("span", null, title)))))));
|
|
48
48
|
}
|
|
49
49
|
static get is() { return "dda-tabs"; }
|
|
50
50
|
static get originalStyleUrls() {
|
|
@@ -119,7 +119,7 @@ export class DdaTextarea {
|
|
|
119
119
|
this.custom_class, this.component_mode, this.textarea_name,
|
|
120
120
|
].filter(Boolean).join(' ');
|
|
121
121
|
const id = this.inputId;
|
|
122
|
-
return (h(Host, { key: '
|
|
122
|
+
return (h(Host, { key: '22ab5c9ede23feedead5b61e2ed4963c1851ecbc' }, h("div", { key: 'cef06c4a45c19a9ae0eefddd2609b9e9e9f1e48c', class: textareaClass }, this.label && h("label", { key: '76fb6bce4a0510aab2a79209f450d201a24ef9a6', id: this.labelId, htmlFor: this.enable_rich_editor ? undefined : id, class: "dda-input-label" }, this.label), this.enable_rich_editor ? (
|
|
123
123
|
// F-015: previously a bare `<div id="editor">` — the visible
|
|
124
124
|
// label's `for` cannot target a non-labelable <div>, and even
|
|
125
125
|
// aria-labelledby here would be wrong: Quill turns this
|
|
@@ -127,7 +127,7 @@ export class DdaTextarea {
|
|
|
127
127
|
// as a child `.ql-editor`, which is what AT and Tab actually
|
|
128
128
|
// land on. The ARIA lives on quill.root (.ql-editor), applied
|
|
129
129
|
// imperatively in syncRichEditorA11y() after mount.
|
|
130
|
-
h("div", { id: id, class: "dda-richeditor-field" })) : (h("textarea", { id: 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: '
|
|
130
|
+
h("div", { id: id, class: "dda-richeditor-field" })) : (h("textarea", { id: 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: '382ba6b5dc9755bf262adb033a118c1be6941bd8', id: this.helperId, class: "dda-helper-text" }, h("span", { key: '5d07ab9a7f7698528fc731778bc668c69fa0e5ec', class: "dda-flex dda-align-center dda-gap-2" }, h("i", { key: '33236593cdafdf4ed5694e272f5c4fcf85ca2f68', class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "info"), " ", this.helper_text), h("span", { key: '2845bd3bface431badd534f44f12faa748c1a718', class: "dda-letter-count" }, this.characterCount, " / ", this.max_characters))), this.error_message && (h("div", { key: 'cc1fabc27cd1bf0f87cfe6e3194c68a0d43ac7f7', id: this.errorId, class: "dda-error-message" }, h("span", { key: '731658aad2027ae1ae107ad58962acb6bbf40eb2', class: "dda-flex dda-align-center dda-gap-2" }, h("i", { key: '80c26defc477ed47439939cbb23875e0373c9598', class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, "info"), " ", this.error_message), h("span", { key: 'e4f4ca076692226881b259322af66f87b18ccc38', class: "dda-letter-count" }, this.characterCount, " / ", this.max_characters))))));
|
|
131
131
|
}
|
|
132
132
|
static get is() { return "dda-textarea"; }
|
|
133
133
|
static get originalStyleUrls() {
|
|
@@ -11,7 +11,7 @@ export class DdaToggle {
|
|
|
11
11
|
this.custom_class ? `${this.custom_class}` : '',
|
|
12
12
|
this.component_mode,
|
|
13
13
|
].filter(Boolean).join(' ');
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '034a0d08e3c605fe38f0f0b3244e1d5cc7442472' }, h("label", { key: '93539da2d2ccfa1e51d0eebf4cc1b234e1e03606', class: toggleClass, htmlFor: this.input_id }, h("input", { key: '21c0ca32b52ed5cb69da4339f1fce9c26dcaf1fa', "aria-label": this.aria_label, type: "checkbox", id: this.input_id, name: this.group_name, checked: this.checked }), h("span", { key: '8d2def2951a2566625276ba4d350d2407c19af77', class: "toggle" }), (this.title_text || this.supporting) && (h("p", { key: 'e56ce02068c3e3c87f3b7452a81b741560297274' }, this.title_text && h("span", { key: 'faeea2f00ee0c50f0b96b5e24c09da088a98f183', class: "toggle-title" }, this.title_text), this.supporting && h("span", { key: '7999b6126c0fefb6cb09ac67930e311dad18d2b2', class: "toggle-supporting" }, this.supporting))))));
|
|
15
15
|
}
|
|
16
16
|
static get is() { return "dda-toggle"; }
|
|
17
17
|
static get originalStyleUrls() {
|
|
@@ -31,7 +31,7 @@ export class DdaTooltip {
|
|
|
31
31
|
this.el.removeEventListener('mouseleave', this.resetDismissed);
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: 'e77ebb12700ccbbef52e2d2138e0950d65127778' }, h("div", { key: 'ea64d67136e615b33138a61f1f1a4ba804db5eea', class: `dda-tooltip-container ${this.custom_class} ${this.component_mode} ${this.dismissed ? 'dismissed' : ''}` }, h("slot", { key: 'c191a8ff9be73014c2da7b1a4fdbcce57e94ba4d' }), h("div", { key: 'c6733ebddb99c659db89027384a50ba9c7836341', class: `dda-tooltip-box ${this.position}` }, h("strong", { key: '47c45f8411f5803c4ba59d0b9b4ac5c830b403c7' }, this.title_text), h("p", { key: '4f08ecda01307162262d7c79aa26e795ff03251b' }, this.description)))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "dda-tooltip"; }
|
|
37
37
|
static get originalStyleUrls() {
|
|
@@ -28,7 +28,7 @@ export class DdaUiCard {
|
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
30
|
const HeadingTag = this.headingTag;
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: 'd82fda87340a70612440a60808a854297d749883' }, h("div", { key: '8cb77a42b82ed7121af29a234e4c065a416887d5', class: 'dda-card' }, h("div", { key: 'e25298c9dbb2d9247bdc238f9c505180aae45b67', class: 'dda-card-body' }, this.type !== 'custom' && (h("div", { key: '3d6d6e4b66a787270593fc53ecb9432ef87cd144' }, !!this.icon && (h("span", { key: '17d02a755a1a6345961ba4c922d2c5205ca79dcd', class: 'dda-card-icon' }, h("i", { key: 'a4eea58a0b1511548c2d60b12bc05068326ce339', class: 'material-icons', "aria-hidden": "true" }, this.icon))), !!this.image && (h("span", { key: 'fe5b33c447adb2a06c20495b576d185258a98bca', class: 'dda-card-icon' }, h("img", { key: '7db29168e53eebe578fb8241795a47862d732d13', src: this.image, alt: this.maintitle }))), !!this.maintitle && h(HeadingTag, { key: 'c2c0a5bd81432dad7b5400c9011998f30823adbf', class: 'dda-card-title' }, this.maintitle), !!this.subtitle && h("p", { key: '9620bfa353acba31cb43d4a818c11d17bb58ea6d', class: 'dda-card-text-muted' }, this.subtitle), !!this.link && (h("a", { key: 'd81101699701091f7d952c6f38637a621fb27324', href: this.link, class: 'dda-card-link', onClick: (event) => this.linkClick.emit(event) }, this.linktext, ' ', this.linkicon && (h("span", { key: 'e7304fca873531077bb4cafda43e462b8d3403d4' }, h("i", { key: 'd13a118077f9a11b76ba06f5cb4f1ab20f9b5472', class: 'material-icons', "aria-hidden": "true" }, this.linkicon))))))), h("slot", { key: '995bf90013e00498354bfb9a3bfd6950032dd924' })))));
|
|
32
32
|
}
|
|
33
33
|
static get is() { return "dda-ui-card"; }
|
|
34
34
|
static get originalStyleUrls() {
|
package/dist/collection/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.js
CHANGED
|
@@ -69,7 +69,7 @@ export class DdaSegmentedTabs {
|
|
|
69
69
|
this.segmentChange.emit(index);
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
|
-
return (h("div", { key: '
|
|
72
|
+
return (h("div", { key: '4a72982d49270f6c04cee7fdeaafcba7cccc6d3c', role: "group", "aria-label": this.aria_label, class: `dda-segmented-group ${this.custom_class} ${this.radius_type} ${this.component_mode}` }, this.parsedItems.map((item, index) => {
|
|
73
73
|
const isSelected = index === this.active_index;
|
|
74
74
|
const className = `dda-segmented-item${isSelected ? ' active' : ''}`;
|
|
75
75
|
return item.startsWith('fo') ? (h("button", { name: this.button_name, type: "button", class: className, "aria-pressed": isSelected ? 'true' : 'false', "aria-label": this.iconLabel(item, index), onClick: () => this.selectSegment(index) }, h("i", { class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, item))) : (h("button", { name: this.button_name, type: "button", class: className, "aria-pressed": isSelected ? 'true' : 'false', onClick: () => this.selectSegment(index) }, item));
|
|
@@ -20,7 +20,7 @@ export class DdaHorizontalStepper {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: '30afa97eccb87ee8595802f451f2ca2f0624da2a' }, h("div", { key: '70d6126c99005e54565473c574bde94545584b58', class: `${this.custom_class} ${this.component_mode} h-stepper-container` }, this.parsedSteps.map((step, index) => (h("div", { class: `h-step ${index === this.current_step ? 'active' : ''} ${index < this.current_step ? 'completed' : ''}` }, h("div", { class: "h-step-indicator" }, h("div", { class: "circle" })), h("div", { class: "h-step-content" }, h("div", { class: "h-step-title" }, step.title), h("div", { class: "h-step-subtitle" }, step.subtitle), h("div", { class: "h-step-description" }, step.description))))))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "dda-horizontal-stepper"; }
|
|
26
26
|
static get originalStyleUrls() {
|
|
@@ -24,7 +24,7 @@ export class DdaVerticalStepper {
|
|
|
24
24
|
render() {
|
|
25
25
|
var _a;
|
|
26
26
|
const current = (_a = this.current_step) !== null && _a !== void 0 ? _a : this.current_Step;
|
|
27
|
-
return (h(Host, { key: '
|
|
27
|
+
return (h(Host, { key: '9aefae11819e6581b65a39af851806fb2c4cfd75' }, h("div", { key: 'b9f812a1626f99993e07a3cf07c0a0a15ed42f11', class: `${this.custom_class} ${this.component_mode} v-stepper-container` }, this.parsedSteps.map((step, index) => (h("div", { class: `v-step ${index <= current ? 'active' : ''}` }, h("div", { class: "v-step-indicator" }, h("div", { class: "icon" }, h("i", { class: `material-icons` }, step.icon))), h("div", { class: "v-step-content" }, h("div", { class: "v-step-title" }, step.title), h("div", { class: "v-step-subtitle" }, step.subtitle), h("div", { class: "v-step-description" }, step.description)), h("div", { class: "v-step-arrow" }, h("i", { class: "material-icons material-symbols-outlined" }, "chevron_right"))))))));
|
|
28
28
|
}
|
|
29
29
|
static get is() { return "dda-vertical-stepper"; }
|
|
30
30
|
static get originalStyleUrls() {
|