@solid-design-system/components 2.11.7 → 2.11.8
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/custom-elements.json +1 -1
- package/dist/styles/solid-styles.css +1 -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/dialog.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 +3 -3
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/switch.js +1 -1
- package/dist/versioned-components/es/tab-group.js +1 -1
- package/dist/versioned-components/es/tab-panel.js +1 -1
- package/dist/versioned-components/es/tab.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser-media.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 +1 -1
- 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 +4 -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/dialog/dialog.d.ts +1 -1
- package/dist/versioned-package/components/dialog/dialog.js +2 -2
- 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 +4 -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 +15 -15
- package/dist/versioned-package/components/select/select.d.ts +4 -4
- package/dist/versioned-package/components/select/select.js +28 -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/tab/tab.d.ts +1 -1
- package/dist/versioned-package/components/tab/tab.js +2 -2
- package/dist/versioned-package/components/tab-group/tab-group.d.ts +1 -1
- package/dist/versioned-package/components/tab-group/tab-group.js +15 -15
- package/dist/versioned-package/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist/versioned-package/components/tab-panel/tab-panel.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/teaser-media/teaser-media.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.js +3 -3
- package/dist/versioned-package/styles/headline/headline.css.js +1 -1
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +37 -37
- package/dist/web-types.json +38 -38
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import SolidElement from '../../internal/solid-element';
|
|
|
4
4
|
import type { SolidFormControl } from '../../internal/solid-element';
|
|
5
5
|
export default class SdRadioGroup extends SolidElement implements SolidFormControl {
|
|
6
6
|
static dependencies: {
|
|
7
|
-
'sd-2-11-
|
|
7
|
+
'sd-2-11-8-button-group': typeof SdButtonGroup;
|
|
8
8
|
};
|
|
9
9
|
protected readonly formControlController: FormControlController;
|
|
10
10
|
private readonly hasSlotController;
|
|
@@ -48,6 +48,6 @@ export default class SdRadioGroup extends SolidElement implements SolidFormContr
|
|
|
48
48
|
}
|
|
49
49
|
declare global {
|
|
50
50
|
interface HTMLElementTagNameMap {
|
|
51
|
-
'sd-2-11-
|
|
51
|
+
'sd-2-11-8-radio-group': SdRadioGroup;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -68,10 +68,10 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
68
68
|
this.formControlController.updateValidity();
|
|
69
69
|
}
|
|
70
70
|
getAllRadios() {
|
|
71
|
-
return [...this.querySelectorAll("sd-2-11-
|
|
71
|
+
return [...this.querySelectorAll("sd-2-11-8-radio, sd-2-11-8-radio-button")];
|
|
72
72
|
}
|
|
73
73
|
handleRadioClick(event) {
|
|
74
|
-
const target = event.target.closest("sd-2-11-
|
|
74
|
+
const target = event.target.closest("sd-2-11-8-radio, sd-2-11-8-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-2-11-
|
|
84
|
+
this.emit("sd-2-11-8-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-2-11-
|
|
118
|
+
this.emit("sd-2-11-8-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-2-11-
|
|
150
|
+
this.hasButtonGroup = radios.some((radio) => radio.tagName.toLowerCase() === "sd-2-11-8-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-2-11-
|
|
162
|
+
const buttonGroup = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector("sd-2-11-8-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-2-11-
|
|
169
|
+
if (customElements.get("sd-2-11-8-radio") && customElements.get("sd-2-11-8-radio-button")) {
|
|
170
170
|
this.syncRadioElements();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
if (customElements.get("sd-2-11-
|
|
173
|
+
if (customElements.get("sd-2-11-8-radio")) {
|
|
174
174
|
this.syncRadioElements();
|
|
175
175
|
} else {
|
|
176
|
-
customElements.whenDefined("sd-2-11-
|
|
176
|
+
customElements.whenDefined("sd-2-11-8-radio").then(() => this.syncRadios());
|
|
177
177
|
}
|
|
178
|
-
if (customElements.get("sd-2-11-
|
|
178
|
+
if (customElements.get("sd-2-11-8-radio-button")) {
|
|
179
179
|
this.syncRadioElements();
|
|
180
180
|
} else {
|
|
181
|
-
customElements.whenDefined("sd-2-11-
|
|
181
|
+
customElements.whenDefined("sd-2-11-8-radio-button").then(() => this.syncRadios());
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
updateCheckedRadio() {
|
|
@@ -253,14 +253,14 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
253
253
|
vertical: "flex-col",
|
|
254
254
|
horizontal: "flex-row"
|
|
255
255
|
}[this.orientation]
|
|
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-2-11-
|
|
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-2-11-8-button-group part="button-group" exportparts="base:button-group__base" role="presentation">${defaultSlot}</sd-2-11-8-button-group>` : defaultSlot}</div></fieldset>${this.formControlController.renderInvalidMessage()}`;
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
SdRadioGroup.dependencies = { "sd-2-11-
|
|
259
|
+
SdRadioGroup.dependencies = { "sd-2-11-8-button-group": SdButtonGroup };
|
|
260
260
|
SdRadioGroup.styles = [
|
|
261
261
|
componentStyles,
|
|
262
262
|
SolidElement.styles,
|
|
263
|
-
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-2-11-
|
|
263
|
+
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-2-11-8-radio){margin-bottom:var(--sd-spacing-2,.5rem);display:flex}:host([orientation=vertical]) ::slotted(sd-2-11-8-radio:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-2-11-8-radio){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-2-11-8-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-2-11-8-radio){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-2-11-8-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([required]) #label::after{content:' *'}`
|
|
264
264
|
];
|
|
265
265
|
__decorateClass([
|
|
266
266
|
query("slot:not([name])")
|
|
@@ -314,7 +314,7 @@ __decorateClass([
|
|
|
314
314
|
watch("value")
|
|
315
315
|
], SdRadioGroup.prototype, "handleValueChange", 1);
|
|
316
316
|
SdRadioGroup = __decorateClass([
|
|
317
|
-
customElement("sd-2-11-
|
|
317
|
+
customElement("sd-2-11-8-radio-group")
|
|
318
318
|
], SdRadioGroup);
|
|
319
319
|
export {
|
|
320
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-2-11-
|
|
11
|
-
'sd-2-11-
|
|
12
|
-
'sd-2-11-
|
|
10
|
+
'sd-2-11-8-icon': typeof SdIcon;
|
|
11
|
+
'sd-2-11-8-popup': typeof SdPopup;
|
|
12
|
+
'sd-2-11-8-tag': typeof SdTag;
|
|
13
13
|
};
|
|
14
14
|
private readonly formControlController;
|
|
15
15
|
private readonly hasSlotController;
|
|
@@ -97,6 +97,6 @@ export default class SdSelect extends SolidElement implements SolidFormControl {
|
|
|
97
97
|
}
|
|
98
98
|
declare global {
|
|
99
99
|
interface HTMLElementTagNameMap {
|
|
100
|
-
'sd-2-11-
|
|
100
|
+
'sd-2-11-8-select': SdSelect;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -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-2-11-
|
|
35
|
+
assumeInteractionOn: ["sd-blur", "sd-2-11-8-input"]
|
|
36
36
|
});
|
|
37
37
|
this.hasSlotController = new HasSlotController(this, "help-text", "label");
|
|
38
38
|
this.localize = new LocalizeController(this);
|
|
@@ -63,11 +63,11 @@ let SdSelect = class extends SolidElement {
|
|
|
63
63
|
this.styleOnValid = false;
|
|
64
64
|
this.hoist = false;
|
|
65
65
|
this.getTag = (option) => {
|
|
66
|
-
return html`<sd-2-11-
|
|
66
|
+
return html`<sd-2-11-8-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
67
67
|
base:tag__base,
|
|
68
68
|
content:tag__content,
|
|
69
69
|
removable-indicator:tag__removable-indicator,
|
|
70
|
-
" size="${this.size === "sm" ? "sm" : "lg"}" removable @sd-remove="${(event) => this.handleTagRemove(event, option)}">${option.getTextLabel()}</sd-2-11-
|
|
70
|
+
" size="${this.size === "sm" ? "sm" : "lg"}" removable @sd-remove="${(event) => this.handleTagRemove(event, option)}">${option.getTextLabel()}</sd-2-11-8-tag>`;
|
|
71
71
|
};
|
|
72
72
|
this.handleDocumentFocusIn = (event) => {
|
|
73
73
|
const path = event.composedPath();
|
|
@@ -78,7 +78,7 @@ let SdSelect = class extends SolidElement {
|
|
|
78
78
|
this.handleDocumentKeyDown = (event) => {
|
|
79
79
|
const target = event.target;
|
|
80
80
|
const isClearButton = target.closest(".select__clear") !== null;
|
|
81
|
-
const isIconButton = target.closest("sd-2-11-
|
|
81
|
+
const isIconButton = target.closest("sd-2-11-8-icon-button") !== null;
|
|
82
82
|
if (isClearButton || isIconButton) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
@@ -102,7 +102,7 @@ let SdSelect = class extends SolidElement {
|
|
|
102
102
|
this.setSelectedOptions(this.currentOption);
|
|
103
103
|
}
|
|
104
104
|
this.updateComplete.then(() => {
|
|
105
|
-
this.emit("sd-2-11-
|
|
105
|
+
this.emit("sd-2-11-8-input");
|
|
106
106
|
this.emit("sd-change");
|
|
107
107
|
});
|
|
108
108
|
if (!this.multiple) {
|
|
@@ -230,7 +230,7 @@ let SdSelect = class extends SolidElement {
|
|
|
230
230
|
this.displayInput.focus({ preventScroll: true });
|
|
231
231
|
this.updateComplete.then(() => {
|
|
232
232
|
this.emit("sd-clear");
|
|
233
|
-
this.emit("sd-2-11-
|
|
233
|
+
this.emit("sd-2-11-8-input");
|
|
234
234
|
this.emit("sd-change");
|
|
235
235
|
});
|
|
236
236
|
}
|
|
@@ -241,7 +241,7 @@ let SdSelect = class extends SolidElement {
|
|
|
241
241
|
}
|
|
242
242
|
handleOptionClick(event) {
|
|
243
243
|
const target = event.target;
|
|
244
|
-
const option = target.closest("sd-2-11-
|
|
244
|
+
const option = target.closest("sd-2-11-8-option");
|
|
245
245
|
const oldValue = this.value;
|
|
246
246
|
if (option && !option.disabled) {
|
|
247
247
|
if (this.multiple) {
|
|
@@ -252,7 +252,7 @@ let SdSelect = class extends SolidElement {
|
|
|
252
252
|
this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true }));
|
|
253
253
|
if (this.value !== oldValue) {
|
|
254
254
|
this.updateComplete.then(() => {
|
|
255
|
-
this.emit("sd-2-11-
|
|
255
|
+
this.emit("sd-2-11-8-input");
|
|
256
256
|
this.emit("sd-change");
|
|
257
257
|
});
|
|
258
258
|
}
|
|
@@ -266,7 +266,7 @@ let SdSelect = class extends SolidElement {
|
|
|
266
266
|
const allOptions = this.getAllOptions();
|
|
267
267
|
const value = Array.isArray(this.value) ? this.value : [this.value];
|
|
268
268
|
const values = [];
|
|
269
|
-
if (customElements.get("sd-2-11-
|
|
269
|
+
if (customElements.get("sd-2-11-8-option")) {
|
|
270
270
|
allOptions.forEach((option) => {
|
|
271
271
|
if (this.multiple) {
|
|
272
272
|
option.checkbox = true;
|
|
@@ -275,7 +275,7 @@ let SdSelect = class extends SolidElement {
|
|
|
275
275
|
});
|
|
276
276
|
this.setSelectedOptions(allOptions.filter((el) => value.includes(el.value)));
|
|
277
277
|
} else {
|
|
278
|
-
customElements.whenDefined("sd-2-11-
|
|
278
|
+
customElements.whenDefined("sd-2-11-8-option").then(() => this.handleDefaultSlotChange());
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
handleTagRemove(event, option) {
|
|
@@ -283,18 +283,18 @@ let SdSelect = class extends SolidElement {
|
|
|
283
283
|
if (!this.disabled) {
|
|
284
284
|
this.toggleOptionSelection(option, false);
|
|
285
285
|
this.updateComplete.then(() => {
|
|
286
|
-
this.emit("sd-2-11-
|
|
286
|
+
this.emit("sd-2-11-8-input");
|
|
287
287
|
this.emit("sd-change");
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
// Gets an array of all <sd-2-11-
|
|
291
|
+
// Gets an array of all <sd-2-11-8-option> elements
|
|
292
292
|
getAllOptions() {
|
|
293
|
-
return [...this.querySelectorAll("sd-2-11-
|
|
293
|
+
return [...this.querySelectorAll("sd-2-11-8-option")];
|
|
294
294
|
}
|
|
295
|
-
// Gets the first <sd-2-11-
|
|
295
|
+
// Gets the first <sd-2-11-8-option> element
|
|
296
296
|
getFirstOption() {
|
|
297
|
-
return this.querySelector("sd-2-11-
|
|
297
|
+
return this.querySelector("sd-2-11-8-option");
|
|
298
298
|
}
|
|
299
299
|
// Sets the current option, which is the option the user is currently interacting with (e.g. via keyboard). Only one
|
|
300
300
|
// option may be "current" at a time.
|
|
@@ -356,7 +356,7 @@ let SdSelect = class extends SolidElement {
|
|
|
356
356
|
const tag = this.getTag(option, index);
|
|
357
357
|
return html`<div @sd-remove="${(e) => this.handleTagRemove(e, option)}">${typeof tag === "string" ? unsafeHTML(tag) : tag}</div>`;
|
|
358
358
|
} else if (index === this.maxOptionsVisible) {
|
|
359
|
-
return html`<sd-2-11-
|
|
359
|
+
return html`<sd-2-11-8-tag size="${this.size === "sm" ? "sm" : "lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length - index}</sd-2-11-8-tag>`;
|
|
360
360
|
}
|
|
361
361
|
return html``;
|
|
362
362
|
});
|
|
@@ -372,7 +372,7 @@ let SdSelect = class extends SolidElement {
|
|
|
372
372
|
handleMouseLeave() {
|
|
373
373
|
this.hasHover = false;
|
|
374
374
|
}
|
|
375
|
-
/** Receives incoming event detail from sd-2-11-
|
|
375
|
+
/** Receives incoming event detail from sd-2-11-8-popup and updates local state for conditional styling. */
|
|
376
376
|
handleCurrentPlacement(e) {
|
|
377
377
|
const incomingPlacement = e.detail;
|
|
378
378
|
if (incomingPlacement) {
|
|
@@ -381,7 +381,7 @@ let SdSelect = class extends SolidElement {
|
|
|
381
381
|
}
|
|
382
382
|
handleUseTagsChange() {
|
|
383
383
|
const allOptions = this.getAllOptions();
|
|
384
|
-
if (customElements.get("sd-2-11-
|
|
384
|
+
if (customElements.get("sd-2-11-8-option")) {
|
|
385
385
|
allOptions.forEach((option) => {
|
|
386
386
|
option.checkbox = this.multiple;
|
|
387
387
|
});
|
|
@@ -526,7 +526,7 @@ let SdSelect = class extends SolidElement {
|
|
|
526
526
|
default: "border-neutral-800"
|
|
527
527
|
}[selectState],
|
|
528
528
|
this.open && (this.currentPlacement === "bottom" ? "rounded-bl-none rounded-br-none" : "rounded-tl-none rounded-tr-none")
|
|
529
|
-
)}"></div><sd-2-11-
|
|
529
|
+
)}"></div><sd-2-11-8-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${cx(
|
|
530
530
|
"inline-flex relative w-full",
|
|
531
531
|
this.currentPlacement === "bottom" ? "origin-top" : "origin-bottom"
|
|
532
532
|
)}" placement="${this.placement}" strategy="${this.hoist ? "fixed" : "absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
@@ -542,27 +542,27 @@ let SdSelect = class extends SolidElement {
|
|
|
542
542
|
"appearance-none outline-none flex-grow bg-transparent w-full",
|
|
543
543
|
cursorStyles,
|
|
544
544
|
this.multiple && this.useTags && this.value.length > 0 ? "hidden" : ""
|
|
545
|
-
)}" 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-2-11-
|
|
545
|
+
)}" 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-2-11-8-icon class="${cx("text-neutral-500", iconSize)}" library="system" name="closing-round"></sd-2-11-8-icon></slot></button>` : ""} ${this.showInvalidStyle ? html`<sd-2-11-8-icon part="invalid-icon" class="${cx("text-error", iconMarginLeft, iconSize)}" library="system" name="risk"></sd-2-11-8-icon>` : ""} ${this.styleOnValid && this.showValidStyle ? html`<sd-2-11-8-icon part="valid-icon" class="${cx("text-success flex-shrink-0", iconMarginLeft, iconSize)}" library="system" name="confirm"></sd-2-11-8-icon>` : ""}<slot name="expand-icon" part="expand-icon" class="${cx("inline-flex ml-2 transition-all", this.open ? "rotate-180" : "rotate-0", iconSize)}"><sd-2-11-8-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-2-11-8-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(
|
|
546
546
|
"bg-white px-2 py-3 relative",
|
|
547
547
|
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"
|
|
548
|
-
)}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-2-11-
|
|
548
|
+
)}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-2-11-8-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()}`;
|
|
549
549
|
}
|
|
550
550
|
};
|
|
551
551
|
SdSelect.dependencies = {
|
|
552
|
-
"sd-2-11-
|
|
553
|
-
"sd-2-11-
|
|
554
|
-
"sd-2-11-
|
|
552
|
+
"sd-2-11-8-icon": SdIcon,
|
|
553
|
+
"sd-2-11-8-popup": SdPopup,
|
|
554
|
+
"sd-2-11-8-tag": SdTag
|
|
555
555
|
};
|
|
556
556
|
SdSelect.styles = [
|
|
557
557
|
componentStyles,
|
|
558
558
|
SolidElement.styles,
|
|
559
|
-
css`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-2-11-
|
|
559
|
+
css`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-2-11-8-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);overflow-y:scroll}sd-2-11-8-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-2-11-8-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-2-11-8-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))}`
|
|
560
560
|
];
|
|
561
561
|
__decorateClass([
|
|
562
|
-
queryAssignedElements({ selector: "sd-2-11-
|
|
562
|
+
queryAssignedElements({ selector: "sd-2-11-8-option" })
|
|
563
563
|
], SdSelect.prototype, "_optionsInDefaultSlot", 2);
|
|
564
564
|
__decorateClass([
|
|
565
|
-
query("sd-2-11-
|
|
565
|
+
query("sd-2-11-8-popup")
|
|
566
566
|
], SdSelect.prototype, "popup", 2);
|
|
567
567
|
__decorateClass([
|
|
568
568
|
query('[part="combobox"]')
|
|
@@ -681,7 +681,7 @@ __decorateClass([
|
|
|
681
681
|
watch("value", { waitUntilFirstUpdate: true })
|
|
682
682
|
], SdSelect.prototype, "handleValueChange", 1);
|
|
683
683
|
SdSelect = __decorateClass([
|
|
684
|
-
customElement("sd-2-11-
|
|
684
|
+
customElement("sd-2-11-8-select")
|
|
685
685
|
], SdSelect);
|
|
686
686
|
setDefaultAnimation("select.show", {
|
|
687
687
|
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-2-11-
|
|
54
|
+
this.emit("sd-2-11-8-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-2-11-
|
|
166
|
+
customElement("sd-2-11-8-switch")
|
|
167
167
|
], SdSwitch);
|
|
168
168
|
export {
|
|
169
169
|
SdSwitch as default
|
|
@@ -21,7 +21,7 @@ let SdTab = class extends SolidElement {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
23
|
this.attrId = ++id;
|
|
24
|
-
this.componentId = `sd-2-11-
|
|
24
|
+
this.componentId = `sd-2-11-8-tab-${this.attrId}`;
|
|
25
25
|
this.panel = "";
|
|
26
26
|
this.variant = "default";
|
|
27
27
|
this.active = false;
|
|
@@ -88,7 +88,7 @@ __decorateClass([
|
|
|
88
88
|
watch("disabled")
|
|
89
89
|
], SdTab.prototype, "handleDisabledChange", 1);
|
|
90
90
|
SdTab = __decorateClass([
|
|
91
|
-
customElement("sd-2-11-
|
|
91
|
+
customElement("sd-2-11-8-tab")
|
|
92
92
|
], SdTab);
|
|
93
93
|
export {
|
|
94
94
|
SdTab as default
|
|
@@ -30,8 +30,8 @@ let SdTabGroup = class extends SolidElement {
|
|
|
30
30
|
}
|
|
31
31
|
connectedCallback() {
|
|
32
32
|
const whenAllDefined = Promise.all([
|
|
33
|
-
customElements.whenDefined("sd-2-11-
|
|
34
|
-
customElements.whenDefined("sd-2-11-
|
|
33
|
+
customElements.whenDefined("sd-2-11-8-tab"),
|
|
34
|
+
customElements.whenDefined("sd-2-11-8-tab-panel")
|
|
35
35
|
]);
|
|
36
36
|
super.connectedCallback();
|
|
37
37
|
this.resizeObserver = new ResizeObserver(() => {
|
|
@@ -68,19 +68,19 @@ let SdTabGroup = class extends SolidElement {
|
|
|
68
68
|
getAllTabs(options = { includeDisabled: true }) {
|
|
69
69
|
const slot = this.shadowRoot.querySelector('slot[name="nav"]');
|
|
70
70
|
return [...slot.assignedElements()].filter((el) => {
|
|
71
|
-
return options.includeDisabled ? el.tagName.toLowerCase() === "sd-2-11-
|
|
71
|
+
return options.includeDisabled ? el.tagName.toLowerCase() === "sd-2-11-8-tab" : el.tagName.toLowerCase() === "sd-2-11-8-tab" && !el.disabled;
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
getAllPanels() {
|
|
75
|
-
return [...this.body.assignedElements()].filter((el) => el.tagName.toLowerCase() === "sd-2-11-
|
|
75
|
+
return [...this.body.assignedElements()].filter((el) => el.tagName.toLowerCase() === "sd-2-11-8-tab-panel");
|
|
76
76
|
}
|
|
77
77
|
getActiveTab() {
|
|
78
78
|
return this.tabs.find((t) => t.matches(":focus"));
|
|
79
79
|
}
|
|
80
80
|
handleClick(event) {
|
|
81
81
|
const target = event.target;
|
|
82
|
-
const tab = target.closest("sd-2-11-
|
|
83
|
-
const tabGroup = tab == null ? void 0 : tab.closest("sd-2-11-
|
|
82
|
+
const tab = target.closest("sd-2-11-8-tab");
|
|
83
|
+
const tabGroup = tab == null ? void 0 : tab.closest("sd-2-11-8-tab-group");
|
|
84
84
|
if (tabGroup !== this) {
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
@@ -90,8 +90,8 @@ let SdTabGroup = class extends SolidElement {
|
|
|
90
90
|
}
|
|
91
91
|
handleKeyDown(event) {
|
|
92
92
|
const target = event.target;
|
|
93
|
-
const tab = target.closest("sd-2-11-
|
|
94
|
-
const tabGroup = tab == null ? void 0 : tab.closest("sd-2-11-
|
|
93
|
+
const tab = target.closest("sd-2-11-8-tab");
|
|
94
|
+
const tabGroup = tab == null ? void 0 : tab.closest("sd-2-11-8-tab-group");
|
|
95
95
|
if (tabGroup !== this) {
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
@@ -116,7 +116,7 @@ let SdTabGroup = class extends SolidElement {
|
|
|
116
116
|
if (["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) {
|
|
117
117
|
const activeEl = this.tabs.find((t) => t.matches(":focus"));
|
|
118
118
|
const isRtl = this.localize.dir() === "rtl";
|
|
119
|
-
if ((activeEl == null ? void 0 : activeEl.tagName.toLowerCase()) === "sd-2-11-
|
|
119
|
+
if ((activeEl == null ? void 0 : activeEl.tagName.toLowerCase()) === "sd-2-11-8-tab") {
|
|
120
120
|
let index = this.tabs.indexOf(activeEl);
|
|
121
121
|
if (event.key === "Home") {
|
|
122
122
|
index = 0;
|
|
@@ -172,9 +172,9 @@ let SdTabGroup = class extends SolidElement {
|
|
|
172
172
|
scrollIntoView(this.activeTab, this.nav, "horizontal", options.scrollBehavior);
|
|
173
173
|
if (options.emitEvents) {
|
|
174
174
|
if (previousTab) {
|
|
175
|
-
this.emit("sd-2-11-
|
|
175
|
+
this.emit("sd-2-11-8-tab-hide", { detail: { name: previousTab.panel } });
|
|
176
176
|
}
|
|
177
|
-
this.emit("sd-2-11-
|
|
177
|
+
this.emit("sd-2-11-8-tab-show", { detail: { name: this.activeTab.panel } });
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -211,17 +211,17 @@ let SdTabGroup = class extends SolidElement {
|
|
|
211
211
|
return html`<div part="base" class="${cx("flex flex-col rounded-none")}" @click="${this.handleClick}" @keydown="${this.handleKeyDown}"><div part="nav" class="${cx(this.hasScrollControls && "relative py-0 px-12")}">${this.hasScrollControls ? html`<button part="scroll-button--start" exportparts="base:scroll-button__base" class="${cx(
|
|
212
212
|
"sd-interactive flex items-center justify-center absolute top-0 bottom-0 left-0 !outline-offset-0 border-b border-neutral-400 z-10",
|
|
213
213
|
this.localize.dir() === "rtl" && "left-auto right-0"
|
|
214
|
-
)}" @click="${this.handleScrollToStart}"><sd-2-11-
|
|
214
|
+
)}" @click="${this.handleScrollToStart}"><sd-2-11-8-icon library="system" name="${isRtl ? "chevron-up" : "chevron-down"}" class="${cx("h-6 w-12 rotate-90 grid place-items-center")}"></sd-2-11-8-icon></button>` : ""}<div part="scroll-container" class="flex overflow-x-auto focus-visible:focus-outline !outline-offset-0"><div part="tabs" class="${cx("flex flex-auto relative flex-row")}" role="tablist"><div part="separation" class="w-full h-[1px] bg-neutral-400 absolute bottom-0"></div><slot name="nav" @slotchange="${this.syncTabsAndPanels}"></slot></div></div>${this.hasScrollControls ? html`<button part="scroll-button--end" exportparts="base:scroll-button__base" class="${cx(
|
|
215
215
|
"sd-interactive flex items-center justify-center absolute top-0 bottom-0 right-0 !outline-offset-0 border-b border-neutral-400 z-10",
|
|
216
216
|
this.localize.dir() === "rtl" && "right-auto left-0"
|
|
217
|
-
)}" @click="${this.handleScrollToEnd}"><sd-2-11-
|
|
217
|
+
)}" @click="${this.handleScrollToEnd}"><sd-2-11-8-icon library="system" name="${isRtl ? "chevron-down" : "chevron-up"}" class="${cx("h-6 w-12 rotate-90 grid place-items-center")}"></sd-2-11-8-icon></button>` : ""}</div><slot part="body" class="${cx("block auto py-8 px-6", this.variant === "container" && "border border-neutral-400 border-t-0")}" @slotchange="${this.syncTabsAndPanels}"></slot></div>`;
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
SdTabGroup.styles = [
|
|
221
221
|
SolidElement.styles,
|
|
222
222
|
unsafeCSS(InteractiveStyles),
|
|
223
223
|
componentStyles,
|
|
224
|
-
css`:host{box-sizing:border-box;display:block}[part=scroll-container]{scrollbar-width:none}[part=scroll-container]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}::slotted(sd-2-11-
|
|
224
|
+
css`:host{box-sizing:border-box;display:block}[part=scroll-container]{scrollbar-width:none}[part=scroll-container]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}::slotted(sd-2-11-8-tab-panel){--padding:1rem 0}`
|
|
225
225
|
];
|
|
226
226
|
__decorateClass([
|
|
227
227
|
query("[part=base]")
|
|
@@ -242,7 +242,7 @@ __decorateClass([
|
|
|
242
242
|
property()
|
|
243
243
|
], SdTabGroup.prototype, "activation", 2);
|
|
244
244
|
SdTabGroup = __decorateClass([
|
|
245
|
-
customElement("sd-2-11-
|
|
245
|
+
customElement("sd-2-11-8-tab-group")
|
|
246
246
|
], SdTabGroup);
|
|
247
247
|
export {
|
|
248
248
|
SdTabGroup as default
|
|
@@ -21,7 +21,7 @@ let SdTabPanel = class extends SolidElement {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
23
|
this.attrId = ++id;
|
|
24
|
-
this.componentId = `sd-2-11-
|
|
24
|
+
this.componentId = `sd-2-11-8-tab-panel-${this.attrId}`;
|
|
25
25
|
this.name = "";
|
|
26
26
|
this.active = false;
|
|
27
27
|
}
|
|
@@ -52,7 +52,7 @@ __decorateClass([
|
|
|
52
52
|
watch("active")
|
|
53
53
|
], SdTabPanel.prototype, "handleActiveChange", 1);
|
|
54
54
|
SdTabPanel = __decorateClass([
|
|
55
|
-
customElement("sd-2-11-
|
|
55
|
+
customElement("sd-2-11-8-tab-panel")
|
|
56
56
|
], SdTabPanel);
|
|
57
57
|
export {
|
|
58
58
|
SdTabPanel 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-2-11-
|
|
77
|
+
)}"><sd-2-11-8-icon library="system" name="close" label="remove"></sd-2-11-8-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-2-11-
|
|
109
|
+
customElement("sd-2-11-8-tag")
|
|
110
110
|
], SdTag);
|
|
111
111
|
export {
|
|
112
112
|
SdTag as default
|
|
@@ -66,7 +66,7 @@ __decorateClass([
|
|
|
66
66
|
query('[part="base"]')
|
|
67
67
|
], SdTeaserMedia.prototype, "teaserMedia", 2);
|
|
68
68
|
SdTeaserMedia = __decorateClass([
|
|
69
|
-
customElement("sd-2-11-
|
|
69
|
+
customElement("sd-2-11-8-teaser-media")
|
|
70
70
|
], SdTeaserMedia);
|
|
71
71
|
export {
|
|
72
72
|
SdTeaserMedia as default
|