@solid-design-system/components 1.37.2 → 1.38.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/dist/components/es/checkbox.js +1 -1
- package/dist/components/es/form.js +1 -1
- package/dist/components/es/input.js +1 -1
- package/dist/components/es/radio-group.js +1 -1
- package/dist/components/es/select.js +1 -1
- package/dist/components/umd/solid-components.js +7 -7
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/button/button.d.ts +1 -1
- package/dist/package/components/checkbox/checkbox.js +1 -0
- package/dist/package/components/input/input.js +2 -1
- package/dist/package/components/radio-group/radio-group.js +1 -0
- package/dist/package/components/select/select.js +2 -1
- package/dist/package/internal/form.d.ts +1 -0
- package/dist/package/internal/form.js +4 -1
- package/dist/versioned-components/es/accordion-group.js +1 -1
- package/dist/versioned-components/es/accordion.js +1 -1
- package/dist/versioned-components/es/badge.js +1 -1
- package/dist/versioned-components/es/brandshape.js +1 -1
- package/dist/versioned-components/es/button.js +1 -1
- package/dist/versioned-components/es/carousel-item.js +1 -1
- package/dist/versioned-components/es/carousel.js +3 -3
- package/dist/versioned-components/es/checkbox-group.js +1 -1
- package/dist/versioned-components/es/checkbox.js +1 -1
- package/dist/versioned-components/es/divider.js +1 -1
- package/dist/versioned-components/es/drawer.js +1 -1
- package/dist/versioned-components/es/dropdown.js +1 -1
- package/dist/versioned-components/es/form.js +1 -1
- package/dist/versioned-components/es/header.js +1 -1
- package/dist/versioned-components/es/icon.js +1 -1
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/input.js +1 -1
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/notification.js +1 -1
- package/dist/versioned-components/es/option.js +1 -1
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/radio-button.js +1 -1
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/select.js +2 -2
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/switch.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/textarea.js +1 -1
- package/dist/versioned-components/es/tooltip.js +2 -2
- package/dist/versioned-components/es/video.js +1 -1
- package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
- package/dist/versioned-package/_components/button-group/button-group.js +11 -11
- package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
- package/dist/versioned-package/components/accordion/accordion.js +2 -2
- package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
- package/dist/versioned-package/components/badge/badge.d.ts +1 -1
- package/dist/versioned-package/components/badge/badge.js +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
- package/dist/versioned-package/components/button/button.d.ts +2 -2
- package/dist/versioned-package/components/button/button.js +4 -4
- package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
- package/dist/versioned-package/components/carousel/carousel.js +6 -6
- package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.d.ts +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.js +5 -4
- package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
- package/dist/versioned-package/components/divider/divider.d.ts +1 -1
- package/dist/versioned-package/components/divider/divider.js +2 -2
- package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
- package/dist/versioned-package/components/drawer/drawer.js +2 -2
- package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
- package/dist/versioned-package/components/dropdown/dropdown.js +8 -8
- package/dist/versioned-package/components/header/header.d.ts +1 -1
- package/dist/versioned-package/components/header/header.js +4 -4
- package/dist/versioned-package/components/icon/icon.d.ts +1 -1
- package/dist/versioned-package/components/icon/icon.js +1 -1
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/input/input.d.ts +1 -1
- package/dist/versioned-package/components/input/input.js +5 -4
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +3 -3
- package/dist/versioned-package/components/notification/notification.d.ts +1 -1
- package/dist/versioned-package/components/notification/notification.js +5 -5
- package/dist/versioned-package/components/option/option.d.ts +1 -1
- package/dist/versioned-package/components/option/option.js +2 -2
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
- package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +16 -15
- package/dist/versioned-package/components/select/select.d.ts +4 -4
- package/dist/versioned-package/components/select/select.js +29 -28
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/switch/switch.d.ts +1 -1
- package/dist/versioned-package/components/switch/switch.js +2 -2
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/textarea/textarea.d.ts +1 -1
- package/dist/versioned-package/components/textarea/textarea.js +3 -3
- package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
- package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.d.ts +1 -0
- package/dist/versioned-package/internal/form.js +7 -4
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +34 -34
- package/dist/web-types.json +1 -1
- package/package.json +3 -2
|
@@ -68,10 +68,10 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
68
68
|
this.formControlController.updateValidity();
|
|
69
69
|
}
|
|
70
70
|
getAllRadios() {
|
|
71
|
-
return [...this.querySelectorAll("sd-1-
|
|
71
|
+
return [...this.querySelectorAll("sd-1-38-0-radio, sd-1-38-0-radio-button")];
|
|
72
72
|
}
|
|
73
73
|
handleRadioClick(event) {
|
|
74
|
-
const target = event.target.closest("sd-1-
|
|
74
|
+
const target = event.target.closest("sd-1-38-0-radio, sd-1-38-0-radio-button");
|
|
75
75
|
const radios = this.getAllRadios();
|
|
76
76
|
const oldValue = this.value;
|
|
77
77
|
if (target.disabled) {
|
|
@@ -81,7 +81,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
81
81
|
radios.forEach((radio) => radio.checked = radio === target);
|
|
82
82
|
if (this.value !== oldValue) {
|
|
83
83
|
this.emit("sd-change");
|
|
84
|
-
this.emit("sd-1-
|
|
84
|
+
this.emit("sd-1-38-0-input");
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
handleKeyDown(event) {
|
|
@@ -115,7 +115,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
115
115
|
}
|
|
116
116
|
if (this.value !== oldValue) {
|
|
117
117
|
this.emit("sd-change");
|
|
118
|
-
this.emit("sd-1-
|
|
118
|
+
this.emit("sd-1-38-0-input");
|
|
119
119
|
}
|
|
120
120
|
event.preventDefault();
|
|
121
121
|
}
|
|
@@ -147,7 +147,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
147
147
|
}
|
|
148
148
|
})
|
|
149
149
|
);
|
|
150
|
-
this.hasButtonGroup = radios.some((radio) => radio.tagName.toLowerCase() === "sd-1-
|
|
150
|
+
this.hasButtonGroup = radios.some((radio) => radio.tagName.toLowerCase() === "sd-1-38-0-radio-button");
|
|
151
151
|
if (!radios.some((radio) => radio.checked)) {
|
|
152
152
|
if (this.hasButtonGroup) {
|
|
153
153
|
const buttonRadio = (_a = radios[0].shadowRoot) == null ? void 0 : _a.querySelector("button");
|
|
@@ -159,26 +159,26 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
if (this.hasButtonGroup) {
|
|
162
|
-
const buttonGroup = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector("sd-1-
|
|
162
|
+
const buttonGroup = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector("sd-1-38-0-button-group");
|
|
163
163
|
if (buttonGroup) {
|
|
164
164
|
buttonGroup.disableRole = true;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
syncRadios() {
|
|
169
|
-
if (customElements.get("sd-1-
|
|
169
|
+
if (customElements.get("sd-1-38-0-radio") && customElements.get("sd-1-38-0-radio-button")) {
|
|
170
170
|
this.syncRadioElements();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
if (customElements.get("sd-1-
|
|
173
|
+
if (customElements.get("sd-1-38-0-radio")) {
|
|
174
174
|
this.syncRadioElements();
|
|
175
175
|
} else {
|
|
176
|
-
customElements.whenDefined("sd-1-
|
|
176
|
+
customElements.whenDefined("sd-1-38-0-radio").then(() => this.syncRadios());
|
|
177
177
|
}
|
|
178
|
-
if (customElements.get("sd-1-
|
|
178
|
+
if (customElements.get("sd-1-38-0-radio-button")) {
|
|
179
179
|
this.syncRadioElements();
|
|
180
180
|
} else {
|
|
181
|
-
customElements.whenDefined("sd-1-
|
|
181
|
+
customElements.whenDefined("sd-1-38-0-radio-button").then(() => this.syncRadios());
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
updateCheckedRadio() {
|
|
@@ -218,6 +218,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
218
218
|
this.formControlController.setValidity(isValid);
|
|
219
219
|
this.validationInput.hidden = true;
|
|
220
220
|
clearTimeout(this.validationTimeout);
|
|
221
|
+
this.formControlController.fakeUserInteraction();
|
|
221
222
|
if (!isValid) {
|
|
222
223
|
this.validationInput.hidden = false;
|
|
223
224
|
this.validationInput.reportValidity();
|
|
@@ -252,14 +253,14 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
252
253
|
vertical: "flex-col",
|
|
253
254
|
horizontal: "flex-row"
|
|
254
255
|
}[this.orientation]
|
|
255
|
-
)}"><div class="sr-only"><label><input id="validation-input" type="text" ?required="${this.required}" tabindex="-1" hidden @invalid="${this.handleInvalid}"></label></div>${this.hasButtonGroup ? html`<sd-1-
|
|
256
|
+
)}"><div class="sr-only"><label><input id="validation-input" type="text" ?required="${this.required}" tabindex="-1" hidden @invalid="${this.handleInvalid}"></label></div>${this.hasButtonGroup ? html`<sd-1-38-0-button-group part="button-group" exportparts="base:button-group__base" role="presentation">${defaultSlot}</sd-1-38-0-button-group>` : defaultSlot}</div></fieldset>${this.formControlController.renderInvalidMessage()}`;
|
|
256
257
|
}
|
|
257
258
|
};
|
|
258
|
-
SdRadioGroup.dependencies = { "sd-1-
|
|
259
|
+
SdRadioGroup.dependencies = { "sd-1-38-0-button-group": SdButtonGroup };
|
|
259
260
|
SdRadioGroup.styles = [
|
|
260
261
|
componentStyles,
|
|
261
262
|
SolidElement.styles,
|
|
262
|
-
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-1-
|
|
263
|
+
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-1-38-0-radio){margin-bottom:var(--sd-spacing-2,.5rem);display:flex}:host([orientation=vertical]) ::slotted(sd-1-38-0-radio:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-1-38-0-radio){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-1-38-0-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-1-38-0-radio){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-1-38-0-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([required]) #label::after{content:' *'}`
|
|
263
264
|
];
|
|
264
265
|
__decorateClass([
|
|
265
266
|
query("slot:not([name])")
|
|
@@ -313,7 +314,7 @@ __decorateClass([
|
|
|
313
314
|
watch("value")
|
|
314
315
|
], SdRadioGroup.prototype, "handleValueChange", 1);
|
|
315
316
|
SdRadioGroup = __decorateClass([
|
|
316
|
-
customElement("sd-1-
|
|
317
|
+
customElement("sd-1-38-0-radio-group")
|
|
317
318
|
], SdRadioGroup);
|
|
318
319
|
export {
|
|
319
320
|
SdRadioGroup as default
|
|
@@ -7,9 +7,9 @@ import type { TemplateResult } from 'lit';
|
|
|
7
7
|
import type SdOption from '../option/option';
|
|
8
8
|
export default class SdSelect extends SolidElement implements SolidFormControl {
|
|
9
9
|
static dependencies: {
|
|
10
|
-
'sd-1-
|
|
11
|
-
'sd-1-
|
|
12
|
-
'sd-1-
|
|
10
|
+
'sd-1-38-0-icon': typeof SdIcon;
|
|
11
|
+
'sd-1-38-0-popup': typeof SdPopup;
|
|
12
|
+
'sd-1-38-0-tag': typeof SdTag;
|
|
13
13
|
};
|
|
14
14
|
private readonly formControlController;
|
|
15
15
|
private readonly hasSlotController;
|
|
@@ -96,6 +96,6 @@ export default class SdSelect extends SolidElement implements SolidFormControl {
|
|
|
96
96
|
}
|
|
97
97
|
declare global {
|
|
98
98
|
interface HTMLElementTagNameMap {
|
|
99
|
-
'sd-1-
|
|
99
|
+
'sd-1-38-0-select': SdSelect;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -32,7 +32,7 @@ let SdSelect = class extends SolidElement {
|
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
34
34
|
this.formControlController = new FormControlController(this, {
|
|
35
|
-
assumeInteractionOn: ["sd-blur", "sd-1-
|
|
35
|
+
assumeInteractionOn: ["sd-blur", "sd-1-38-0-input"]
|
|
36
36
|
});
|
|
37
37
|
this.hasSlotController = new HasSlotController(this, "help-text", "label");
|
|
38
38
|
this.localize = new LocalizeController(this);
|
|
@@ -62,11 +62,11 @@ let SdSelect = class extends SolidElement {
|
|
|
62
62
|
this.required = false;
|
|
63
63
|
this.hoist = false;
|
|
64
64
|
this.getTag = (option) => {
|
|
65
|
-
return html`<sd-1-
|
|
65
|
+
return html`<sd-1-38-0-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
66
66
|
base:tag__base,
|
|
67
67
|
content:tag__content,
|
|
68
68
|
removable-indicator:tag__removable-indicator,
|
|
69
|
-
" size="${this.size === "sm" ? "sm" : "lg"}" removable @sd-remove="${(event) => this.handleTagRemove(event, option)}">${option.getTextLabel()}</sd-1-
|
|
69
|
+
" size="${this.size === "sm" ? "sm" : "lg"}" removable @sd-remove="${(event) => this.handleTagRemove(event, option)}">${option.getTextLabel()}</sd-1-38-0-tag>`;
|
|
70
70
|
};
|
|
71
71
|
this.handleDocumentFocusIn = (event) => {
|
|
72
72
|
const path = event.composedPath();
|
|
@@ -77,7 +77,7 @@ let SdSelect = class extends SolidElement {
|
|
|
77
77
|
this.handleDocumentKeyDown = (event) => {
|
|
78
78
|
const target = event.target;
|
|
79
79
|
const isClearButton = target.closest(".select__clear") !== null;
|
|
80
|
-
const isIconButton = target.closest("sd-1-
|
|
80
|
+
const isIconButton = target.closest("sd-1-38-0-icon-button") !== null;
|
|
81
81
|
if (isClearButton || isIconButton) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
@@ -101,7 +101,7 @@ let SdSelect = class extends SolidElement {
|
|
|
101
101
|
this.setSelectedOptions(this.currentOption);
|
|
102
102
|
}
|
|
103
103
|
this.updateComplete.then(() => {
|
|
104
|
-
this.emit("sd-1-
|
|
104
|
+
this.emit("sd-1-38-0-input");
|
|
105
105
|
this.emit("sd-change");
|
|
106
106
|
});
|
|
107
107
|
if (!this.multiple) {
|
|
@@ -229,7 +229,7 @@ let SdSelect = class extends SolidElement {
|
|
|
229
229
|
this.displayInput.focus({ preventScroll: true });
|
|
230
230
|
this.updateComplete.then(() => {
|
|
231
231
|
this.emit("sd-clear");
|
|
232
|
-
this.emit("sd-1-
|
|
232
|
+
this.emit("sd-1-38-0-input");
|
|
233
233
|
this.emit("sd-change");
|
|
234
234
|
});
|
|
235
235
|
}
|
|
@@ -240,7 +240,7 @@ let SdSelect = class extends SolidElement {
|
|
|
240
240
|
}
|
|
241
241
|
handleOptionClick(event) {
|
|
242
242
|
const target = event.target;
|
|
243
|
-
const option = target.closest("sd-1-
|
|
243
|
+
const option = target.closest("sd-1-38-0-option");
|
|
244
244
|
const oldValue = this.value;
|
|
245
245
|
if (option && !option.disabled) {
|
|
246
246
|
if (this.multiple) {
|
|
@@ -251,7 +251,7 @@ let SdSelect = class extends SolidElement {
|
|
|
251
251
|
this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true }));
|
|
252
252
|
if (this.value !== oldValue) {
|
|
253
253
|
this.updateComplete.then(() => {
|
|
254
|
-
this.emit("sd-1-
|
|
254
|
+
this.emit("sd-1-38-0-input");
|
|
255
255
|
this.emit("sd-change");
|
|
256
256
|
});
|
|
257
257
|
}
|
|
@@ -265,7 +265,7 @@ let SdSelect = class extends SolidElement {
|
|
|
265
265
|
const allOptions = this.getAllOptions();
|
|
266
266
|
const value = Array.isArray(this.value) ? this.value : [this.value];
|
|
267
267
|
const values = [];
|
|
268
|
-
if (customElements.get("sd-1-
|
|
268
|
+
if (customElements.get("sd-1-38-0-option")) {
|
|
269
269
|
allOptions.forEach((option) => {
|
|
270
270
|
if (this.multiple) {
|
|
271
271
|
option.checkbox = true;
|
|
@@ -274,7 +274,7 @@ let SdSelect = class extends SolidElement {
|
|
|
274
274
|
});
|
|
275
275
|
this.setSelectedOptions(allOptions.filter((el) => value.includes(el.value)));
|
|
276
276
|
} else {
|
|
277
|
-
customElements.whenDefined("sd-1-
|
|
277
|
+
customElements.whenDefined("sd-1-38-0-option").then(() => this.handleDefaultSlotChange());
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
handleTagRemove(event, option) {
|
|
@@ -282,18 +282,18 @@ let SdSelect = class extends SolidElement {
|
|
|
282
282
|
if (!this.disabled) {
|
|
283
283
|
this.toggleOptionSelection(option, false);
|
|
284
284
|
this.updateComplete.then(() => {
|
|
285
|
-
this.emit("sd-1-
|
|
285
|
+
this.emit("sd-1-38-0-input");
|
|
286
286
|
this.emit("sd-change");
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
// Gets an array of all <sd-1-
|
|
290
|
+
// Gets an array of all <sd-1-38-0-option> elements
|
|
291
291
|
getAllOptions() {
|
|
292
|
-
return [...this.querySelectorAll("sd-1-
|
|
292
|
+
return [...this.querySelectorAll("sd-1-38-0-option")];
|
|
293
293
|
}
|
|
294
|
-
// Gets the first <sd-1-
|
|
294
|
+
// Gets the first <sd-1-38-0-option> element
|
|
295
295
|
getFirstOption() {
|
|
296
|
-
return this.querySelector("sd-1-
|
|
296
|
+
return this.querySelector("sd-1-38-0-option");
|
|
297
297
|
}
|
|
298
298
|
// Sets the current option, which is the option the user is currently interacting with (e.g. via keyboard). Only one
|
|
299
299
|
// option may be "current" at a time.
|
|
@@ -355,7 +355,7 @@ let SdSelect = class extends SolidElement {
|
|
|
355
355
|
const tag = this.getTag(option, index);
|
|
356
356
|
return html`<div @sd-remove="${(e) => this.handleTagRemove(e, option)}">${typeof tag === "string" ? unsafeHTML(tag) : tag}</div>`;
|
|
357
357
|
} else if (index === this.maxOptionsVisible) {
|
|
358
|
-
return html`<sd-1-
|
|
358
|
+
return html`<sd-1-38-0-tag size="${this.size === "sm" ? "sm" : "lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length - index}</sd-1-38-0-tag>`;
|
|
359
359
|
}
|
|
360
360
|
return html``;
|
|
361
361
|
});
|
|
@@ -371,7 +371,7 @@ let SdSelect = class extends SolidElement {
|
|
|
371
371
|
handleMouseLeave() {
|
|
372
372
|
this.hasHover = false;
|
|
373
373
|
}
|
|
374
|
-
/** Receives incoming event detail from sd-1-
|
|
374
|
+
/** Receives incoming event detail from sd-1-38-0-popup and updates local state for conditional styling. */
|
|
375
375
|
handleCurrentPlacement(e) {
|
|
376
376
|
const incomingPlacement = e.detail;
|
|
377
377
|
if (incomingPlacement) {
|
|
@@ -380,7 +380,7 @@ let SdSelect = class extends SolidElement {
|
|
|
380
380
|
}
|
|
381
381
|
handleUseTagsChange() {
|
|
382
382
|
const allOptions = this.getAllOptions();
|
|
383
|
-
if (customElements.get("sd-1-
|
|
383
|
+
if (customElements.get("sd-1-38-0-option")) {
|
|
384
384
|
allOptions.forEach((option) => {
|
|
385
385
|
option.checkbox = this.multiple;
|
|
386
386
|
});
|
|
@@ -459,6 +459,7 @@ let SdSelect = class extends SolidElement {
|
|
|
459
459
|
}
|
|
460
460
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
461
461
|
reportValidity() {
|
|
462
|
+
this.formControlController.fakeUserInteraction();
|
|
462
463
|
return this.valueInput.reportValidity();
|
|
463
464
|
}
|
|
464
465
|
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
|
@@ -524,7 +525,7 @@ let SdSelect = class extends SolidElement {
|
|
|
524
525
|
default: "border-neutral-800"
|
|
525
526
|
}[selectState],
|
|
526
527
|
this.open && (this.currentPlacement === "bottom" ? "rounded-bl-none rounded-br-none" : "rounded-tl-none rounded-tr-none")
|
|
527
|
-
)}"></div><sd-1-
|
|
528
|
+
)}"></div><sd-1-38-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${cx(
|
|
528
529
|
"inline-flex relative w-full",
|
|
529
530
|
this.currentPlacement === "bottom" ? "origin-top" : "origin-bottom"
|
|
530
531
|
)}" placement="${this.placement}" strategy="${this.hoist ? "fixed" : "absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10"><div part="combobox" class="${cx(
|
|
@@ -538,27 +539,27 @@ let SdSelect = class extends SolidElement {
|
|
|
538
539
|
"appearance-none outline-none flex-grow bg-transparent",
|
|
539
540
|
cursorStyles,
|
|
540
541
|
this.multiple && this.useTags && this.value.length > 0 ? "hidden" : ""
|
|
541
|
-
)}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open ? "true" : "false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled ? "true" : "false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple && this.useTags ? html`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>` : ""} <input class="${cx("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10", cursorStyles)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value) ? this.value.join(", ") : this.value}" tabindex="-1" aria-hidden="true" @focus="${() => this.focus()}" @invalid="${this.handleInvalid}"> ${hasClearIcon ? html`<button part="clear-button" class="${cx("select__clear flex justify-center", iconMarginLeft)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-1-
|
|
542
|
+
)}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open ? "true" : "false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled ? "true" : "false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple && this.useTags ? html`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>` : ""} <input class="${cx("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10", cursorStyles)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value) ? this.value.join(", ") : this.value}" tabindex="-1" aria-hidden="true" @focus="${() => this.focus()}" @invalid="${this.handleInvalid}"> ${hasClearIcon ? html`<button part="clear-button" class="${cx("select__clear flex justify-center", iconMarginLeft)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-1-38-0-icon class="${cx("text-neutral-500", iconSize)}" library="system" name="closing-round"></sd-1-38-0-icon></slot></button>` : ""} ${this.showInvalidStyle ? html`<sd-1-38-0-icon part="invalid-icon" class="${cx("text-error", iconMarginLeft, iconSize)}" library="system" name="risk"></sd-1-38-0-icon>` : ""} ${this.showValidStyle ? html`<sd-1-38-0-icon part="valid-icon" class="${cx("text-success", iconMarginLeft, iconSize)}" library="system" name="confirm"></sd-1-38-0-icon>` : ""}<slot name="expand-icon" part="expand-icon" class="${cx("inline-flex ml-2 transition-all", this.open ? "rotate-180" : "rotate-0", iconSize)}"><sd-1-38-0-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-1-38-0-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open ? "true" : "false"}" aria-multiselectable="${this.multiple ? "true" : "false"}" aria-labelledby="label" part="listbox" class="${cx(
|
|
542
543
|
"bg-white px-2 py-3 relative",
|
|
543
544
|
this.currentPlacement === "bottom" ? "border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default" : "border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default"
|
|
544
|
-
)}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-1-
|
|
545
|
+
)}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-1-38-0-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${hasHelpText ? "false" : "true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`;
|
|
545
546
|
}
|
|
546
547
|
};
|
|
547
548
|
SdSelect.dependencies = {
|
|
548
|
-
"sd-1-
|
|
549
|
-
"sd-1-
|
|
550
|
-
"sd-1-
|
|
549
|
+
"sd-1-38-0-icon": SdIcon,
|
|
550
|
+
"sd-1-38-0-popup": SdPopup,
|
|
551
|
+
"sd-1-38-0-tag": SdTag
|
|
551
552
|
};
|
|
552
553
|
SdSelect.styles = [
|
|
553
554
|
componentStyles,
|
|
554
555
|
SolidElement.styles,
|
|
555
|
-
css`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-1-
|
|
556
|
+
css`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-1-38-0-popup::part(popup){overflow-y:scroll}sd-1-38-0-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-1-38-0-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-1-38-0-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}`
|
|
556
557
|
];
|
|
557
558
|
__decorateClass([
|
|
558
|
-
queryAssignedElements({ selector: "sd-1-
|
|
559
|
+
queryAssignedElements({ selector: "sd-1-38-0-option" })
|
|
559
560
|
], SdSelect.prototype, "_optionsInDefaultSlot", 2);
|
|
560
561
|
__decorateClass([
|
|
561
|
-
query("sd-1-
|
|
562
|
+
query("sd-1-38-0-popup")
|
|
562
563
|
], SdSelect.prototype, "popup", 2);
|
|
563
564
|
__decorateClass([
|
|
564
565
|
query('[part="combobox"]')
|
|
@@ -674,7 +675,7 @@ __decorateClass([
|
|
|
674
675
|
watch("value", { waitUntilFirstUpdate: true })
|
|
675
676
|
], SdSelect.prototype, "handleValueChange", 1);
|
|
676
677
|
SdSelect = __decorateClass([
|
|
677
|
-
customElement("sd-1-
|
|
678
|
+
customElement("sd-1-38-0-select")
|
|
678
679
|
], SdSelect);
|
|
679
680
|
setDefaultAnimation("select.show", {
|
|
680
681
|
keyframes: [
|
|
@@ -51,7 +51,7 @@ let SdSwitch = class extends SolidElement {
|
|
|
51
51
|
this.emit("sd-blur");
|
|
52
52
|
}
|
|
53
53
|
handleInput() {
|
|
54
|
-
this.emit("sd-1-
|
|
54
|
+
this.emit("sd-1-38-0-input");
|
|
55
55
|
}
|
|
56
56
|
handleInvalid(event) {
|
|
57
57
|
this.formControlController.setValidity(false);
|
|
@@ -163,7 +163,7 @@ __decorateClass([
|
|
|
163
163
|
watch(["checked"], { waitUntilFirstUpdate: true })
|
|
164
164
|
], SdSwitch.prototype, "handleStateChange", 1);
|
|
165
165
|
SdSwitch = __decorateClass([
|
|
166
|
-
customElement("sd-1-
|
|
166
|
+
customElement("sd-1-38-0-switch")
|
|
167
167
|
], SdSwitch);
|
|
168
168
|
export {
|
|
169
169
|
SdSwitch as default
|
|
@@ -74,7 +74,7 @@ let SdTag = class extends SolidElement {
|
|
|
74
74
|
lg: "text-base",
|
|
75
75
|
sm: "text-[12px]"
|
|
76
76
|
}[this.size]
|
|
77
|
-
)}"><sd-1-
|
|
77
|
+
)}"><sd-1-38-0-icon library="system" name="close" label="remove"></sd-1-38-0-icon></slot>` : ""}</${tag}>`;
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
SdTag.styles = [
|
|
@@ -106,7 +106,7 @@ __decorateClass([
|
|
|
106
106
|
property()
|
|
107
107
|
], SdTag.prototype, "download", 2);
|
|
108
108
|
SdTag = __decorateClass([
|
|
109
|
-
customElement("sd-1-
|
|
109
|
+
customElement("sd-1-38-0-tag")
|
|
110
110
|
], SdTag);
|
|
111
111
|
export {
|
|
112
112
|
SdTag as default
|
|
@@ -80,7 +80,7 @@ let SdTextarea = class extends SolidElement {
|
|
|
80
80
|
handleInput() {
|
|
81
81
|
this.value = this.textarea.value;
|
|
82
82
|
this.formControlController.updateValidity();
|
|
83
|
-
this.emit("sd-1-
|
|
83
|
+
this.emit("sd-1-38-0-input");
|
|
84
84
|
}
|
|
85
85
|
handleInvalid(event) {
|
|
86
86
|
this.formControlController.setValidity(false);
|
|
@@ -209,7 +209,7 @@ let SdTextarea = class extends SolidElement {
|
|
|
209
209
|
"flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",
|
|
210
210
|
this.disabled && "cursor-not-allowed",
|
|
211
211
|
textSize
|
|
212
|
-
)}" title="${this.title}" name="${ifDefined(this.name)}" .value="${live(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${ifDefined(this.placeholder)}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" rows="${ifDefined(this.rows)}" autocapitalize="${ifDefined(this.autocapitalize)}" autocorrect="${ifDefined(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${ifDefined(this.spellcheck)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle ? html`<sd-1-
|
|
212
|
+
)}" title="${this.title}" name="${ifDefined(this.name)}" .value="${live(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${ifDefined(this.placeholder)}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" rows="${ifDefined(this.rows)}" autocapitalize="${ifDefined(this.autocapitalize)}" autocorrect="${ifDefined(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${ifDefined(this.spellcheck)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle ? html`<sd-1-38-0-icon class="${cx("text-error absolute right-4 bg-white group-hover:bg-neutral-200", iconSizeMarginLeft)}" library="system" name="risk"></sd-1-38-0-icon>` : ""} ${this.showValidStyle ? html`<sd-1-38-0-icon class="${cx("text-success absolute right-4 bg-white group-hover:bg-neutral-200", iconSizeMarginLeft)}" library="system" name="confirm"></sd-1-38-0-icon>` : ""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${cx("text-sm text-neutral-700", hasHelpText ? "block" : "hidden")}" aria-hidden="${hasHelpText ? "false" : "true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`;
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
215
|
SdTextarea.styles = [
|
|
@@ -315,7 +315,7 @@ __decorateClass([
|
|
|
315
315
|
watch("value", { waitUntilFirstUpdate: true })
|
|
316
316
|
], SdTextarea.prototype, "handleValueChange", 1);
|
|
317
317
|
SdTextarea = __decorateClass([
|
|
318
|
-
customElement("sd-1-
|
|
318
|
+
customElement("sd-1-38-0-textarea")
|
|
319
319
|
], SdTextarea);
|
|
320
320
|
export {
|
|
321
321
|
SdTextarea as default
|
|
@@ -161,16 +161,16 @@ let SdTooltip = class extends SolidElement {
|
|
|
161
161
|
render() {
|
|
162
162
|
const isStart = this.placement.endsWith("-start");
|
|
163
163
|
const isEnd = this.placement.endsWith("-end");
|
|
164
|
-
return html`<sd-1-
|
|
164
|
+
return html`<sd-1-38-0-popup part="base" exportparts="
|
|
165
165
|
popup:base__popup,
|
|
166
166
|
arrow:base__arrow
|
|
167
|
-
" class="${cx(this.open && "tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{ start: 2, end: -2, default: 0 }[isStart ? "start" : isEnd ? "end" : "default"] * (this.size === "sm" ? -1 : 1)}" strategy="${this.hoist ? "fixed" : "absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${cx(this.size === "lg" ? "text-xl" : "text-base")}"><button class="flex sd-interactive rounded-full"><sd-1-
|
|
167
|
+
" class="${cx(this.open && "tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{ start: 2, end: -2, default: 0 }[isStart ? "start" : isEnd ? "end" : "default"] * (this.size === "sm" ? -1 : 1)}" strategy="${this.hoist ? "fixed" : "absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${cx(this.size === "lg" ? "text-xl" : "text-base")}"><button class="flex sd-interactive rounded-full"><sd-1-38-0-icon library="system" name="info-circle" class="${cx(this.disabled && "sd-interactive--disabled")}"></sd-1-38-0-icon></button></slot><slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="Tooltip" aria-live="${this.open ? "polite" : "off"}">${this.content}</slot></sd-1-38-0-popup>`;
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
SdTooltip.styles = [
|
|
171
171
|
SolidElement.styles,
|
|
172
172
|
unsafeCSS(InteractiveStyles),
|
|
173
|
-
css`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-1-
|
|
173
|
+
css`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-1-38-0-popup{--arrow-color:rgb(var(--sd-color-primary, 0 53 142) / 1);--arrow-size:10px}sd-1-38-0-popup::part(popup){pointer-events:none;z-index:10;--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-1-38-0-popup::part(arrow){--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-1-38-0-popup[placement^=top]::part(popup){transform-origin:bottom}sd-1-38-0-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`
|
|
174
174
|
];
|
|
175
175
|
__decorateClass([
|
|
176
176
|
query("slot:not([name])")
|
|
@@ -179,7 +179,7 @@ __decorateClass([
|
|
|
179
179
|
query("#tooltip")
|
|
180
180
|
], SdTooltip.prototype, "body", 2);
|
|
181
181
|
__decorateClass([
|
|
182
|
-
query("sd-1-
|
|
182
|
+
query("sd-1-38-0-popup")
|
|
183
183
|
], SdTooltip.prototype, "popup", 2);
|
|
184
184
|
__decorateClass([
|
|
185
185
|
property()
|
|
@@ -212,7 +212,7 @@ __decorateClass([
|
|
|
212
212
|
watch("disabled")
|
|
213
213
|
], SdTooltip.prototype, "handleDisabledChange", 1);
|
|
214
214
|
SdTooltip = __decorateClass([
|
|
215
|
-
customElement("sd-1-
|
|
215
|
+
customElement("sd-1-38-0-tooltip")
|
|
216
216
|
], SdTooltip);
|
|
217
217
|
setDefaultAnimation("tooltip.show", {
|
|
218
218
|
keyframes: [
|
|
@@ -87,7 +87,7 @@ let SdVideo = class extends SolidElement {
|
|
|
87
87
|
this.playing ? "opacity-0" : "opacity-100",
|
|
88
88
|
this.isBelowBreakpoint ? "w-[48px] h-[48px]" : "w-[96px] h-[96px]",
|
|
89
89
|
"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition"
|
|
90
|
-
)}"><slot name="play-icon" part="play-icon" class="${cx(this.isBelowBreakpoint ? "text-[2rem]" : "text-[4rem]")}"><sd-1-
|
|
90
|
+
)}"><slot name="play-icon" part="play-icon" class="${cx(this.isBelowBreakpoint ? "text-[2rem]" : "text-[4rem]")}"><sd-1-38-0-icon id="default-play-icon" library="system" name="start"></sd-1-38-0-icon></slot></div></button> ${this.hasSlotController.test("poster") ? html`<slot name="poster" role="presentation" @transitionend="${this.hidePoster}"></slot>` : null}<div part="overlay" id="overlay" role="presentation" class="${cx(
|
|
91
91
|
this.overlay && !this.playing ? "opacity-100" : "opacity-0",
|
|
92
92
|
"bg-[rgba(0,0,0,0.65)] w-full h-full absolute top-0 left-0 pointer-events-none z-20 play-pause-transition"
|
|
93
93
|
)}"></div><slot></slot></div>`;
|
|
@@ -110,7 +110,7 @@ __decorateClass([
|
|
|
110
110
|
property({ type: Boolean })
|
|
111
111
|
], SdVideo.prototype, "isBelowBreakpoint", 2);
|
|
112
112
|
SdVideo = __decorateClass([
|
|
113
|
-
customElement("sd-1-
|
|
113
|
+
customElement("sd-1-38-0-video")
|
|
114
114
|
], SdVideo);
|
|
115
115
|
export {
|
|
116
116
|
SdVideo as default
|
|
@@ -26,6 +26,7 @@ export declare class FormControlController implements ReactiveController {
|
|
|
26
26
|
private handleFormSubmit;
|
|
27
27
|
private handleFormReset;
|
|
28
28
|
private handleInteraction;
|
|
29
|
+
fakeUserInteraction: () => void;
|
|
29
30
|
private reportFormValidity;
|
|
30
31
|
private setUserInteracted;
|
|
31
32
|
private doAction;
|
|
@@ -9,7 +9,7 @@ class FormControlController {
|
|
|
9
9
|
const disabled = this.options.disabled(this.host);
|
|
10
10
|
const name = this.options.name(this.host);
|
|
11
11
|
const value = this.options.value(this.host);
|
|
12
|
-
const isButton = this.host.tagName.toLowerCase() === "sd-1-
|
|
12
|
+
const isButton = this.host.tagName.toLowerCase() === "sd-1-38-0-button";
|
|
13
13
|
if (!disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
|
|
14
14
|
if (Array.isArray(value)) {
|
|
15
15
|
value.forEach((val) => {
|
|
@@ -34,7 +34,7 @@ class FormControlController {
|
|
|
34
34
|
event.stopImmediatePropagation();
|
|
35
35
|
const invalidElements = (_b = this.form) == null ? void 0 : _b.querySelectorAll("[data-invalid]");
|
|
36
36
|
const sdRadioGroups = Array.from(invalidElements).filter(
|
|
37
|
-
(element) => element.tagName.toLowerCase() === "sd-1-
|
|
37
|
+
(element) => element.tagName.toLowerCase() === "sd-1-38-0-radio-group"
|
|
38
38
|
);
|
|
39
39
|
sdRadioGroups.forEach((radioGroup) => {
|
|
40
40
|
var _a2, _b2;
|
|
@@ -58,6 +58,9 @@ class FormControlController {
|
|
|
58
58
|
this.setUserInteracted(this.host, true);
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
+
this.fakeUserInteraction = () => {
|
|
62
|
+
this.setUserInteracted(this.host, true);
|
|
63
|
+
};
|
|
61
64
|
(this.host = host).addController(this);
|
|
62
65
|
this.options = {
|
|
63
66
|
form: (input) => {
|
|
@@ -76,7 +79,7 @@ class FormControlController {
|
|
|
76
79
|
disabled: (input) => input.disabled ?? false,
|
|
77
80
|
reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true,
|
|
78
81
|
setValue: (input, value) => input.value = value,
|
|
79
|
-
assumeInteractionOn: ["sd-1-
|
|
82
|
+
assumeInteractionOn: ["sd-1-38-0-input"],
|
|
80
83
|
...options
|
|
81
84
|
};
|
|
82
85
|
}
|
|
@@ -208,7 +211,7 @@ class FormControlController {
|
|
|
208
211
|
}
|
|
209
212
|
/** Returns a styled `<div>` element to display inline validation messages via its `textContent` property when a form element is invalid. */
|
|
210
213
|
renderInvalidMessage() {
|
|
211
|
-
return html`<div id="invalid-message" class="text-error text-sm mt-2 text-left" part="
|
|
214
|
+
return html`<div id="invalid-message" class="text-error text-sm mt-2 text-left" part="invalid-message" aria-live="polite" ?hidden="${!this.host.showInvalidStyle}"></div>`;
|
|
212
215
|
}
|
|
213
216
|
/** Resets the form, restoring all the control to their default value */
|
|
214
217
|
reset(invoker) {
|