@solid-design-system/components 5.9.0 → 5.10.1
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/cdn/chunks/chunk.45UEUNN5.js +3 -0
- package/cdn/chunks/chunk.6X4TLHUJ.js +4 -0
- package/cdn/components/switch/switch.d.ts +1 -0
- package/cdn/components/switch/switch.js +1 -1
- package/cdn/components/tooltip/tooltip.d.ts +1 -0
- package/cdn/components/tooltip/tooltip.js +1 -1
- package/cdn/custom-elements.json +5 -1
- package/cdn/solid-components.bundle.js +10 -10
- package/cdn/solid-components.iife.js +10 -10
- package/cdn/solid-components.js +1 -1
- package/cdn/vscode.html-custom-data.json +1 -1
- package/cdn/web-types.json +9 -3
- package/cdn-versioned/chunks/chunk.2JZXQAEH.js +1 -1
- package/cdn-versioned/chunks/chunk.2S6PSHGR.js +1 -1
- package/cdn-versioned/chunks/chunk.2YPPKILR.js +1 -1
- package/cdn-versioned/chunks/chunk.3I7Z2ZGA.js +1 -1
- package/cdn-versioned/chunks/chunk.3VSEXUCN.js +1 -1
- package/cdn-versioned/chunks/chunk.45UEUNN5.js +3 -0
- package/cdn-versioned/chunks/chunk.4GU7BCCI.js +1 -1
- package/cdn-versioned/chunks/chunk.6HLS5XU2.js +1 -1
- package/cdn-versioned/chunks/chunk.6NART7VP.js +1 -1
- package/cdn-versioned/chunks/chunk.6X4TLHUJ.js +4 -0
- package/cdn-versioned/chunks/chunk.7F4BLDO5.js +1 -1
- package/cdn-versioned/chunks/chunk.AD3RLPIJ.js +1 -1
- package/cdn-versioned/chunks/chunk.AOLFDR44.js +1 -1
- package/cdn-versioned/chunks/chunk.AWLGV3BD.js +1 -1
- package/cdn-versioned/chunks/chunk.AXOCHBBU.js +1 -1
- package/cdn-versioned/chunks/chunk.BBD6RMZH.js +1 -1
- package/cdn-versioned/chunks/chunk.BGEMBVJV.js +1 -1
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.CMIXQ7JH.js +1 -1
- package/cdn-versioned/chunks/chunk.CMMWC4RI.js +1 -1
- package/cdn-versioned/chunks/chunk.EADKGOFJ.js +1 -1
- package/cdn-versioned/chunks/chunk.ELCOIK5P.js +1 -1
- package/cdn-versioned/chunks/chunk.FA5R7CKW.js +1 -1
- package/cdn-versioned/chunks/chunk.FCFA3AM7.js +1 -1
- package/cdn-versioned/chunks/chunk.GGXUEKTA.js +4 -4
- package/cdn-versioned/chunks/chunk.GYKZUJLA.js +1 -1
- package/cdn-versioned/chunks/chunk.H3RLFSFE.js +4 -4
- package/cdn-versioned/chunks/chunk.HAFUAYZZ.js +1 -1
- package/cdn-versioned/chunks/chunk.HDPQFCGV.js +1 -1
- package/cdn-versioned/chunks/chunk.IFNRX7KW.js +1 -1
- package/cdn-versioned/chunks/chunk.IHA7PGG2.js +1 -1
- package/cdn-versioned/chunks/chunk.IRWE4TYN.js +1 -1
- package/cdn-versioned/chunks/chunk.JUPXHQZ3.js +1 -1
- package/cdn-versioned/chunks/chunk.KWDCB5GN.js +1 -1
- package/cdn-versioned/chunks/chunk.LAFGNWFC.js +1 -1
- package/cdn-versioned/chunks/chunk.LDAMQCO2.js +1 -1
- package/cdn-versioned/chunks/chunk.LNX7ZKW3.js +1 -1
- package/cdn-versioned/chunks/chunk.MGVRJCCE.js +1 -1
- package/cdn-versioned/chunks/chunk.NFHVSI66.js +1 -1
- package/cdn-versioned/chunks/chunk.PQFPJ45Y.js +1 -1
- package/cdn-versioned/chunks/chunk.R2G6FMES.js +1 -1
- package/cdn-versioned/chunks/chunk.R4DOCTBU.js +1 -1
- package/cdn-versioned/chunks/chunk.RISDA2AI.js +1 -1
- package/cdn-versioned/chunks/chunk.S53XPYBW.js +1 -1
- package/cdn-versioned/chunks/chunk.SBIDVQ2E.js +1 -1
- package/cdn-versioned/chunks/chunk.SBU6FGLK.js +1 -1
- package/cdn-versioned/chunks/chunk.SHKBYZWU.js +1 -1
- package/cdn-versioned/chunks/chunk.U6FV3MPT.js +3 -3
- package/cdn-versioned/chunks/chunk.V4CRJJ5B.js +1 -1
- package/cdn-versioned/chunks/chunk.V7ZZFRHA.js +1 -1
- package/cdn-versioned/chunks/chunk.VPGQTCNG.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.WXLNA4GN.js +1 -1
- package/cdn-versioned/chunks/chunk.XMUDHBRG.js +1 -1
- package/cdn-versioned/chunks/chunk.XRBNH2NJ.js +1 -1
- package/cdn-versioned/chunks/chunk.YOYAMVUH.js +1 -1
- package/cdn-versioned/chunks/chunk.YVTCC5NZ.js +1 -1
- package/cdn-versioned/chunks/chunk.Z4UTG2XJ.js +1 -1
- package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
- package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/cdn-versioned/components/animation/animation.d.ts +1 -1
- package/cdn-versioned/components/audio/audio.d.ts +1 -1
- package/cdn-versioned/components/badge/badge.d.ts +1 -1
- package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/cdn-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/cdn-versioned/components/button/button.d.ts +1 -1
- package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
- package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
- package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
- package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
- package/cdn-versioned/components/divider/divider.d.ts +1 -1
- package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
- package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
- package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/cdn-versioned/components/header/header.d.ts +1 -1
- package/cdn-versioned/components/icon/icon.d.ts +1 -1
- package/cdn-versioned/components/include/include.d.ts +1 -1
- package/cdn-versioned/components/input/input.d.ts +1 -1
- package/cdn-versioned/components/link/link.d.ts +1 -1
- package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/cdn-versioned/components/menu/menu.d.ts +1 -1
- package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
- package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/cdn-versioned/components/notification/notification.d.ts +1 -1
- package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
- package/cdn-versioned/components/option/option.d.ts +1 -1
- package/cdn-versioned/components/popup/popup.d.ts +1 -1
- package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/cdn-versioned/components/radio/radio.d.ts +1 -1
- package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/select/select.d.ts +1 -1
- package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
- package/cdn-versioned/components/step/step.d.ts +1 -1
- package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
- package/cdn-versioned/components/switch/switch.d.ts +2 -1
- package/cdn-versioned/components/switch/switch.js +1 -1
- package/cdn-versioned/components/tab/tab.d.ts +1 -1
- package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/cdn-versioned/components/tag/tag.d.ts +1 -1
- package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
- package/cdn-versioned/components/tooltip/tooltip.d.ts +2 -1
- package/cdn-versioned/components/tooltip/tooltip.js +1 -1
- package/cdn-versioned/components/video/video.d.ts +1 -1
- package/cdn-versioned/custom-elements.json +233 -229
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +16 -16
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +16 -16
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +87 -87
- package/cdn-versioned/web-types.json +154 -148
- package/dist/chunks/{chunk.J5E5UTG2.js → chunk.FDQQDXKD.js} +6 -2
- package/dist/chunks/{chunk.SGJGJL45.js → chunk.UDULBIWD.js} +5 -1
- package/dist/components/switch/switch.d.ts +1 -0
- package/dist/components/switch/switch.js +2 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -0
- package/dist/components/tooltip/tooltip.js +2 -1
- package/dist/custom-elements.json +5 -1
- package/dist/solid-components.js +2 -2
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/web-types.json +9 -3
- package/dist-versioned/chunks/chunk.2VDSJ75Q.js +2 -2
- package/dist-versioned/chunks/chunk.3JIBD4DC.js +4 -4
- package/dist-versioned/chunks/chunk.3PUMOBIO.js +1 -1
- package/dist-versioned/chunks/chunk.47VXT6XF.js +2 -2
- package/dist-versioned/chunks/chunk.4Z5MLLDU.js +2 -2
- package/dist-versioned/chunks/chunk.5UQ6EJAW.js +1 -1
- package/dist-versioned/chunks/chunk.5XKGAQGU.js +26 -26
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.6ID5BKH5.js +2 -2
- package/dist-versioned/chunks/chunk.6SZYSES2.js +1 -1
- package/dist-versioned/chunks/chunk.7EMNYFIP.js +1 -1
- package/dist-versioned/chunks/chunk.7VIYCZ4Z.js +14 -14
- package/dist-versioned/chunks/chunk.7ZISZOWN.js +2 -2
- package/dist-versioned/chunks/chunk.AQKWXHIC.js +2 -2
- package/dist-versioned/chunks/chunk.BK4CYVLA.js +2 -2
- package/dist-versioned/chunks/chunk.EIUEZZ5G.js +12 -12
- package/dist-versioned/chunks/chunk.EO5MCLIR.js +2 -2
- package/dist-versioned/chunks/{chunk.J5E5UTG2.js → chunk.FDQQDXKD.js} +7 -3
- package/dist-versioned/chunks/chunk.FDUVN4I6.js +6 -6
- package/dist-versioned/chunks/chunk.FFAUGMVF.js +3 -3
- package/dist-versioned/chunks/chunk.FUGGYSQF.js +6 -6
- package/dist-versioned/chunks/chunk.I6NQOQEO.js +3 -3
- package/dist-versioned/chunks/chunk.JJTGSFOV.js +3 -3
- package/dist-versioned/chunks/chunk.JUUDZ47Q.js +1 -1
- package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
- package/dist-versioned/chunks/chunk.KFVC6XFD.js +2 -2
- package/dist-versioned/chunks/chunk.KVKRZJS7.js +3 -3
- package/dist-versioned/chunks/chunk.MEDUZPGV.js +4 -4
- package/dist-versioned/chunks/chunk.MEHX7EVL.js +3 -3
- package/dist-versioned/chunks/chunk.MQ5VT5VP.js +2 -2
- package/dist-versioned/chunks/chunk.N3MU3643.js +1 -1
- package/dist-versioned/chunks/chunk.N7WBIQUG.js +5 -5
- package/dist-versioned/chunks/chunk.P4UKJXBL.js +3 -3
- package/dist-versioned/chunks/chunk.PP5IDYES.js +1 -1
- package/dist-versioned/chunks/chunk.QS7N47CI.js +6 -6
- package/dist-versioned/chunks/chunk.R2XG3O7O.js +1 -1
- package/dist-versioned/chunks/chunk.RGFFEJMJ.js +3 -3
- package/dist-versioned/chunks/chunk.SW6AKO54.js +12 -12
- package/dist-versioned/chunks/chunk.TQMYNSM4.js +1 -1
- package/dist-versioned/chunks/chunk.TWDHTS5K.js +1 -1
- package/dist-versioned/chunks/chunk.TX6S5UVP.js +11 -11
- package/dist-versioned/chunks/chunk.UAADOLK5.js +1 -1
- package/dist-versioned/chunks/{chunk.SGJGJL45.js → chunk.UDULBIWD.js} +10 -6
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.UJHYOR23.js +5 -5
- package/dist-versioned/chunks/chunk.UJHYUCHT.js +2 -2
- package/dist-versioned/chunks/chunk.UQ55GFI3.js +3 -3
- package/dist-versioned/chunks/chunk.VFG2SXVE.js +8 -8
- package/dist-versioned/chunks/chunk.WEUFN5UU.js +24 -24
- package/dist-versioned/chunks/chunk.WL7EGHGP.js +2 -2
- package/dist-versioned/chunks/chunk.WSEY3LJE.js +4 -4
- package/dist-versioned/chunks/chunk.XKFVXICF.js +3 -3
- package/dist-versioned/chunks/chunk.YGVCQCO4.js +2 -2
- package/dist-versioned/chunks/chunk.YRFRBXRK.js +1 -1
- package/dist-versioned/chunks/chunk.ZCI47J45.js +1 -1
- package/dist-versioned/chunks/chunk.ZF7CPAC2.js +5 -5
- package/dist-versioned/chunks/chunk.ZSZ2IB2L.js +2 -2
- package/dist-versioned/chunks/chunk.ZVLZ6XOK.js +2 -2
- package/dist-versioned/components/accordion/accordion.d.ts +1 -1
- package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist-versioned/components/animation/animation.d.ts +1 -1
- package/dist-versioned/components/audio/audio.d.ts +1 -1
- package/dist-versioned/components/badge/badge.d.ts +1 -1
- package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/dist-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/dist-versioned/components/button/button.d.ts +1 -1
- package/dist-versioned/components/button-group/button-group.d.ts +1 -1
- package/dist-versioned/components/carousel/carousel.d.ts +1 -1
- package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist-versioned/components/combobox/combobox.d.ts +1 -1
- package/dist-versioned/components/dialog/dialog.d.ts +1 -1
- package/dist-versioned/components/divider/divider.d.ts +1 -1
- package/dist-versioned/components/drawer/drawer.d.ts +1 -1
- package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/dist-versioned/components/expandable/expandable.d.ts +1 -1
- package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
- package/dist-versioned/components/header/header.d.ts +1 -1
- package/dist-versioned/components/icon/icon.d.ts +1 -1
- package/dist-versioned/components/include/include.d.ts +1 -1
- package/dist-versioned/components/input/input.d.ts +1 -1
- package/dist-versioned/components/link/link.d.ts +1 -1
- package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/dist-versioned/components/menu/menu.d.ts +1 -1
- package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
- package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist-versioned/components/notification/notification.d.ts +1 -1
- package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
- package/dist-versioned/components/option/option.d.ts +1 -1
- package/dist-versioned/components/popup/popup.d.ts +1 -1
- package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/dist-versioned/components/radio/radio.d.ts +1 -1
- package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/select/select.d.ts +1 -1
- package/dist-versioned/components/spinner/spinner.d.ts +1 -1
- package/dist-versioned/components/step/step.d.ts +1 -1
- package/dist-versioned/components/step-group/step-group.d.ts +1 -1
- package/dist-versioned/components/switch/switch.d.ts +2 -1
- package/dist-versioned/components/switch/switch.js +2 -1
- package/dist-versioned/components/tab/tab.d.ts +1 -1
- package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist-versioned/components/tag/tag.d.ts +1 -1
- package/dist-versioned/components/textarea/textarea.d.ts +1 -1
- package/dist-versioned/components/tooltip/tooltip.d.ts +2 -1
- package/dist-versioned/components/tooltip/tooltip.js +2 -1
- package/dist-versioned/components/video/video.d.ts +1 -1
- package/dist-versioned/custom-elements.json +233 -229
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +2 -2
- package/dist-versioned/vscode.html-custom-data.json +87 -87
- package/dist-versioned/web-types.json +154 -148
- package/package.json +1 -1
- package/cdn/chunks/chunk.FCYUK5NR.js +0 -4
- package/cdn/chunks/chunk.ZOFXN52V.js +0 -3
- package/cdn-versioned/chunks/chunk.FCYUK5NR.js +0 -4
- package/cdn-versioned/chunks/chunk.ZOFXN52V.js +0 -3
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
FormControlController
|
|
6
6
|
} from "./chunk.KVKRZJS7.js";
|
|
7
|
+
import {
|
|
8
|
+
HasSlotController
|
|
9
|
+
} from "./chunk.IVMQWO2L.js";
|
|
7
10
|
import {
|
|
8
11
|
watch
|
|
9
12
|
} from "./chunk.X2OQMWGY.js";
|
|
@@ -24,6 +27,7 @@ import cx from "classix";
|
|
|
24
27
|
var SdSwitch = class extends SolidElement {
|
|
25
28
|
constructor() {
|
|
26
29
|
super(...arguments);
|
|
30
|
+
this.hasSlotController = new HasSlotController(this, "tooltip");
|
|
27
31
|
this.formControlController = new FormControlController(this, {
|
|
28
32
|
value: (control) => control.checked ? control.value || "on" : void 0,
|
|
29
33
|
defaultValue: (control) => control.defaultChecked,
|
|
@@ -104,7 +108,7 @@ var SdSwitch = class extends SolidElement {
|
|
|
104
108
|
this.formControlController.updateValidity();
|
|
105
109
|
}
|
|
106
110
|
render() {
|
|
107
|
-
return html`<label part="base" class="${cx(
|
|
111
|
+
return html`<div class="flex flex-row items-center gap-2"><label part="base" class="${cx(
|
|
108
112
|
"group flex items-center text-base leading-normal text-black cursor-pointer",
|
|
109
113
|
this.disabled && "hover:cursor-not-allowed"
|
|
110
114
|
)}"><input id="input" class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" role="switch" title="${this.title}" name="${this.name}" value="${ifDefined(this.value)}" .checked="${live(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked ? "true" : "false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="invalid-message" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked ? " control--checked" : "control--unchecked"}" class="${cx(
|
|
@@ -118,7 +122,7 @@ var SdSwitch = class extends SolidElement {
|
|
|
118
122
|
)}"></span> </span><span part="label" id="label" class="${cx(
|
|
119
123
|
"select-none inline-block ml-2",
|
|
120
124
|
this.disabled ? "text-neutral-500" : this.showInvalidStyle ? "text-error" : "text-black"
|
|
121
|
-
)}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`;
|
|
125
|
+
)}"><slot></slot></span></label> ${this.hasSlotController.test("tooltip") ? html`<slot name="tooltip"></slot>` : null}</div>${this.formControlController.renderInvalidMessage()}`;
|
|
122
126
|
}
|
|
123
127
|
};
|
|
124
128
|
/**
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HasSlotController
|
|
3
|
+
} from "./chunk.IVMQWO2L.js";
|
|
1
4
|
import {
|
|
2
5
|
getAnimation,
|
|
3
6
|
setDefaultAnimation
|
|
@@ -32,6 +35,7 @@ var SdTooltip = class extends SolidElement {
|
|
|
32
35
|
constructor() {
|
|
33
36
|
super(...arguments);
|
|
34
37
|
this.localize = new LocalizeController(this);
|
|
38
|
+
this.hasSlotController = new HasSlotController(this, "[default]", "content");
|
|
35
39
|
this.size = "lg";
|
|
36
40
|
this.content = "";
|
|
37
41
|
this.placement = "top";
|
|
@@ -85,7 +89,7 @@ var SdTooltip = class extends SolidElement {
|
|
|
85
89
|
document.removeEventListener("keydown", this.handleKeyboardInteraction);
|
|
86
90
|
}
|
|
87
91
|
get hasCustomTrigger() {
|
|
88
|
-
return
|
|
92
|
+
return this.hasSlotController.test("[default]");
|
|
89
93
|
}
|
|
90
94
|
// removes empty text nodes from the default slot
|
|
91
95
|
formatDefaultSlot(slot) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import SolidElement from '../../internal/solid-element';
|
|
2
2
|
import type { SolidFormControl } from '../../internal/solid-element';
|
|
3
3
|
export default class SdSwitch extends SolidElement implements SolidFormControl {
|
|
4
|
+
private readonly hasSlotController;
|
|
4
5
|
private readonly formControlController;
|
|
5
6
|
input: HTMLInputElement;
|
|
6
7
|
invalidMessage: HTMLDivElement;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SdSwitch
|
|
3
|
-
} from "../../chunks/chunk.
|
|
3
|
+
} from "../../chunks/chunk.FDQQDXKD.js";
|
|
4
4
|
import "../../chunks/chunk.GI7VDIWX.js";
|
|
5
5
|
import "../../chunks/chunk.KVKRZJS7.js";
|
|
6
|
+
import "../../chunks/chunk.IVMQWO2L.js";
|
|
6
7
|
import "../../chunks/chunk.X2OQMWGY.js";
|
|
7
8
|
import "../../chunks/chunk.PP5IDYES.js";
|
|
8
9
|
import "../../chunks/chunk.HQWAKJBV.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SdTooltip
|
|
3
|
-
} from "../../chunks/chunk.
|
|
3
|
+
} from "../../chunks/chunk.UDULBIWD.js";
|
|
4
4
|
import "../../chunks/chunk.UAADOLK5.js";
|
|
5
|
+
import "../../chunks/chunk.IVMQWO2L.js";
|
|
5
6
|
import "../../chunks/chunk.N4LHE3QK.js";
|
|
6
7
|
import "../../chunks/chunk.B4BZKR24.js";
|
|
7
8
|
import "../../chunks/chunk.YRFRBXRK.js";
|
|
@@ -16164,6 +16164,10 @@
|
|
|
16164
16164
|
{
|
|
16165
16165
|
"description": "The switch's label.",
|
|
16166
16166
|
"name": ""
|
|
16167
|
+
},
|
|
16168
|
+
{
|
|
16169
|
+
"description": "An optional tooltip that helps describe the switch. Use this slot with the `sd-tooltip` component.",
|
|
16170
|
+
"name": "tooltip"
|
|
16167
16171
|
}
|
|
16168
16172
|
],
|
|
16169
16173
|
"members": [
|
|
@@ -19583,7 +19587,7 @@
|
|
|
19583
19587
|
"package": {
|
|
19584
19588
|
"name": "@solid-design-system/components",
|
|
19585
19589
|
"description": "Solid Design System: Components",
|
|
19586
|
-
"version": "5.
|
|
19590
|
+
"version": "5.10.1",
|
|
19587
19591
|
"author": "Union Investment",
|
|
19588
19592
|
"homepage": "https://solid-design-system.fe.union-investment.de/docs/",
|
|
19589
19593
|
"license": "MIT"
|
package/dist/solid-components.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunks/chunk.I6NQOQEO.js";
|
|
14
14
|
import {
|
|
15
15
|
SdTooltip
|
|
16
|
-
} from "./chunks/chunk.
|
|
16
|
+
} from "./chunks/chunk.UDULBIWD.js";
|
|
17
17
|
import {
|
|
18
18
|
SdVideo
|
|
19
19
|
} from "./chunks/chunk.MQ5VT5VP.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./chunks/chunk.YGVCQCO4.js";
|
|
26
26
|
import {
|
|
27
27
|
SdSwitch
|
|
28
|
-
} from "./chunks/chunk.
|
|
28
|
+
} from "./chunks/chunk.FDQQDXKD.js";
|
|
29
29
|
import {
|
|
30
30
|
SdTab
|
|
31
31
|
} from "./chunks/chunk.ZSZ2IB2L.js";
|
|
@@ -2549,7 +2549,7 @@
|
|
|
2549
2549
|
},
|
|
2550
2550
|
{
|
|
2551
2551
|
"name": "sd-switch",
|
|
2552
|
-
"description": "Switches allow the user to toggle an option on or off.\n---\n\n\n### **Events:**\n - **sd-blur** - Emitted when the switch loses focus.\n- **sd-change** - Emitted when the checked state changes.\n- **sd-focus** - Emitted when the switch gains focus.\n- **sd-input** - Emitted when the switch receives input.\n\n### **Methods:**\n - **click()** - Simulates a click on the switch.\n- **focus(options: _FocusOptions_)** - Sets focus on the switch.\n- **blur()** - Removes focus from the switch.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns true when valid and false when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows a validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear\nthe custom validation message, call this method with an empty string.\n- **emit(name: _string_, options: _CustomEventInit_)** - Emits a custom event with more convenient defaults.\n- **token(name: _string_, fallback: _T_): _T_** - Retrieves the value of a css variable token.\n\n### **Slots:**\n - _default_ - The switch's label.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **control** - The square container that wraps the switch's state.\n- **control--checked** - Matches the control part when the switch is on.\n- **control--unchecked** - Matches the control part when the switch is off.\n- **thumb** - The circle that marks the switch's state.\n- **label** - The container that wraps the switch's label.",
|
|
2552
|
+
"description": "Switches allow the user to toggle an option on or off.\n---\n\n\n### **Events:**\n - **sd-blur** - Emitted when the switch loses focus.\n- **sd-change** - Emitted when the checked state changes.\n- **sd-focus** - Emitted when the switch gains focus.\n- **sd-input** - Emitted when the switch receives input.\n\n### **Methods:**\n - **click()** - Simulates a click on the switch.\n- **focus(options: _FocusOptions_)** - Sets focus on the switch.\n- **blur()** - Removes focus from the switch.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns true when valid and false when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows a validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear\nthe custom validation message, call this method with an empty string.\n- **emit(name: _string_, options: _CustomEventInit_)** - Emits a custom event with more convenient defaults.\n- **token(name: _string_, fallback: _T_): _T_** - Retrieves the value of a css variable token.\n\n### **Slots:**\n - _default_ - The switch's label.\n- **tooltip** - An optional tooltip that helps describe the switch. Use this slot with the `sd-tooltip` component.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **control** - The square container that wraps the switch's state.\n- **control--checked** - Matches the control part when the switch is on.\n- **control--unchecked** - Matches the control part when the switch is off.\n- **thumb** - The circle that marks the switch's state.\n- **label** - The container that wraps the switch's label.",
|
|
2553
2553
|
"attributes": [
|
|
2554
2554
|
{
|
|
2555
2555
|
"name": "title",
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@solid-design-system/components",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.10.1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -5813,7 +5813,7 @@
|
|
|
5813
5813
|
},
|
|
5814
5814
|
{
|
|
5815
5815
|
"name": "sd-switch",
|
|
5816
|
-
"description": "Switches allow the user to toggle an option on or off.\n---\n\n\n### **Events:**\n - **sd-blur** - Emitted when the switch loses focus.\n- **sd-change** - Emitted when the checked state changes.\n- **sd-focus** - Emitted when the switch gains focus.\n- **sd-input** - Emitted when the switch receives input.\n\n### **Methods:**\n - **click()** - Simulates a click on the switch.\n- **focus(options: _FocusOptions_)** - Sets focus on the switch.\n- **blur()** - Removes focus from the switch.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns true when valid and false when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows a validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear\nthe custom validation message, call this method with an empty string.\n- **emit(name: _string_, options: _CustomEventInit_)** - Emits a custom event with more convenient defaults.\n- **token(name: _string_, fallback: _T_): _T_** - Retrieves the value of a css variable token.\n\n### **Slots:**\n - _default_ - The switch's label.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **control** - The square container that wraps the switch's state.\n- **control--checked** - Matches the control part when the switch is on.\n- **control--unchecked** - Matches the control part when the switch is off.\n- **thumb** - The circle that marks the switch's state.\n- **label** - The container that wraps the switch's label.",
|
|
5816
|
+
"description": "Switches allow the user to toggle an option on or off.\n---\n\n\n### **Events:**\n - **sd-blur** - Emitted when the switch loses focus.\n- **sd-change** - Emitted when the checked state changes.\n- **sd-focus** - Emitted when the switch gains focus.\n- **sd-input** - Emitted when the switch receives input.\n\n### **Methods:**\n - **click()** - Simulates a click on the switch.\n- **focus(options: _FocusOptions_)** - Sets focus on the switch.\n- **blur()** - Removes focus from the switch.\n- **checkValidity()** - Checks for validity but does not show a validation message. Returns true when valid and false when invalid.\n- **getForm(): _HTMLFormElement | null_** - Gets the associated form, if one exists.\n- **reportValidity()** - Checks for validity and shows a validation message if the control is invalid.\n- **setCustomValidity(message: _string_)** - Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear\nthe custom validation message, call this method with an empty string.\n- **emit(name: _string_, options: _CustomEventInit_)** - Emits a custom event with more convenient defaults.\n- **token(name: _string_, fallback: _T_): _T_** - Retrieves the value of a css variable token.\n\n### **Slots:**\n - _default_ - The switch's label.\n- **tooltip** - An optional tooltip that helps describe the switch. Use this slot with the `sd-tooltip` component.\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.\n- **control** - The square container that wraps the switch's state.\n- **control--checked** - Matches the control part when the switch is on.\n- **control--unchecked** - Matches the control part when the switch is off.\n- **thumb** - The circle that marks the switch's state.\n- **label** - The container that wraps the switch's label.",
|
|
5817
5817
|
"doc-url": "",
|
|
5818
5818
|
"attributes": [
|
|
5819
5819
|
{
|
|
@@ -5862,7 +5862,13 @@
|
|
|
5862
5862
|
"value": { "type": "string" }
|
|
5863
5863
|
}
|
|
5864
5864
|
],
|
|
5865
|
-
"slots": [
|
|
5865
|
+
"slots": [
|
|
5866
|
+
{ "name": "", "description": "The switch's label." },
|
|
5867
|
+
{
|
|
5868
|
+
"name": "tooltip",
|
|
5869
|
+
"description": "An optional tooltip that helps describe the switch. Use this slot with the `sd-tooltip` component."
|
|
5870
|
+
}
|
|
5871
|
+
],
|
|
5866
5872
|
"events": [
|
|
5867
5873
|
{
|
|
5868
5874
|
"name": "sd-blur",
|
|
@@ -84,7 +84,7 @@ var SdRadioButton = class extends SolidElement {
|
|
|
84
84
|
};
|
|
85
85
|
SdRadioButton.styles = [
|
|
86
86
|
...SolidElement.styles,
|
|
87
|
-
css`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;inset:var(--sd-spacing-0,0);opacity:var(--sd-opacity-0,0);outline-color:rgb(var(--sd-color-error,204 25 55)/1);outline-style:dotted;outline-width:1px;position:absolute;z-index:-10}.lg-label,.lg-no-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{width:var(--sd-spacing-12,3rem)}.md-label,.md-no-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{width:var(--sd-spacing-10,2.5rem)}.sm-label,.sm-no-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{width:var(--sd-spacing-8,2rem)}:host(.sd-5-
|
|
87
|
+
css`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;inset:var(--sd-spacing-0,0);opacity:var(--sd-opacity-0,0);outline-color:rgb(var(--sd-color-error,204 25 55)/1);outline-style:dotted;outline-width:1px;position:absolute;z-index:-10}.lg-label,.lg-no-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{width:var(--sd-spacing-12,3rem)}.md-label,.md-no-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{width:var(--sd-spacing-10,2.5rem)}.sm-label,.sm-no-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{width:var(--sd-spacing-8,2rem)}:host(.sd-5-10-1-button-group__button--first:not(.sd-5-10-1-button-group__button--last)) button{border-bottom-right-radius:var(--sd-border-radius-none,0);border-top-right-radius:var(--sd-border-radius-none,0)}:host(.sd-5-10-1-button-group__button--inner) button{border-radius:var(--sd-border-radius-none,0)}:host(.sd-5-10-1-button-group__button--last:not(.sd-5-10-1-button-group__button--first)) button{border-bottom-left-radius:var(--sd-border-radius-none,0);border-top-left-radius:var(--sd-border-radius-none,0)}:host(.sd-5-10-1-button-group__button:not(.sd-5-10-1-button-group__button--first)){margin-inline-start:-1px}:host(.sd-5-10-1-button-group__button--hover){z-index:10}:host(.sd-5-10-1-button-group__button--focus),:host(.sd-5-10-1-button-group__button[checked]){z-index:20}`
|
|
88
88
|
];
|
|
89
89
|
__decorateClass([
|
|
90
90
|
query(".button")
|
|
@@ -114,7 +114,7 @@ __decorateClass([
|
|
|
114
114
|
watch(["disabled", "visually-disabled"], { waitUntilFirstUpdate: true })
|
|
115
115
|
], SdRadioButton.prototype, "handleDisabledChange", 1);
|
|
116
116
|
SdRadioButton = __decorateClass([
|
|
117
|
-
customElement("sd-5-
|
|
117
|
+
customElement("sd-5-10-1-radio-button")
|
|
118
118
|
], SdRadioButton);
|
|
119
119
|
|
|
120
120
|
export {
|
|
@@ -25,11 +25,11 @@ var SdOptgroup = class extends SolidElement {
|
|
|
25
25
|
this.label = "";
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Syncs the disabled prop for all slotted sd-5-
|
|
28
|
+
* Syncs the disabled prop for all slotted sd-5-10-1-options when it is triggered
|
|
29
29
|
*/
|
|
30
30
|
handleDisableOptions() {
|
|
31
31
|
const { disabled } = this;
|
|
32
|
-
this.defaultSlot.assignedElements().filter((opt) => opt.tagName.toLowerCase() === "sd-5-
|
|
32
|
+
this.defaultSlot.assignedElements().filter((opt) => opt.tagName.toLowerCase() === "sd-5-10-1-option").forEach((opt) => {
|
|
33
33
|
opt.disabled = disabled;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -38,7 +38,7 @@ var SdOptgroup = class extends SolidElement {
|
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
40
|
const { disabled } = this;
|
|
41
|
-
return html`<div role="${disabled ? "presentation" : "group"}" class="${cx(this.disabled ? "text-neutral-500" : "")}" part="base" aria-labelledby="group-label"><sd-5-
|
|
41
|
+
return html`<div role="${disabled ? "presentation" : "group"}" class="${cx(this.disabled ? "text-neutral-500" : "")}" part="base" aria-labelledby="group-label"><sd-5-10-1-divider id="divider" class="pt-2 pb-4" part="divider"></sd-5-10-1-divider><div part="label-container" class="${cx(this.disabled ? "text-neutral-500" : "text-black")} px-4 font-bold text-left" role="presentation" id="group-label"><slot name="label"><span>${this.label}</span></slot></div><div role="listbox" part="options" aria-label="${this.localize.term("optionGroup")}"><slot @slotchange="${this.handleDisableOptions}"></slot></div></div>`;
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
SdOptgroup.styles = [
|
|
@@ -58,7 +58,7 @@ __decorateClass([
|
|
|
58
58
|
watch("disabled", { waitUntilFirstUpdate: true })
|
|
59
59
|
], SdOptgroup.prototype, "handleDisabledChange", 1);
|
|
60
60
|
SdOptgroup = __decorateClass([
|
|
61
|
-
customElement("sd-5-
|
|
61
|
+
customElement("sd-5-10-1-optgroup")
|
|
62
62
|
], SdOptgroup);
|
|
63
63
|
|
|
64
64
|
export {
|
|
@@ -71,7 +71,7 @@ var SdRadio = class extends SolidElement {
|
|
|
71
71
|
}
|
|
72
72
|
render() {
|
|
73
73
|
return html`<span part="base" class="${cx(
|
|
74
|
-
"sd-5-
|
|
74
|
+
"sd-5-10-1-radio group inline-flex items-start items-center text-base leading-normal text-black cursor-pointer align-middle",
|
|
75
75
|
(this.disabled || this.visuallyDisabled) && "hover:cursor-not-allowed",
|
|
76
76
|
{
|
|
77
77
|
/* sizes, fonts */
|
|
@@ -127,7 +127,7 @@ __decorateClass([
|
|
|
127
127
|
watch(["disabled", "visually-disabled"], { waitUntilFirstUpdate: true })
|
|
128
128
|
], SdRadio.prototype, "handleDisabledChange", 1);
|
|
129
129
|
SdRadio = __decorateClass([
|
|
130
|
-
customElement("sd-5-
|
|
130
|
+
customElement("sd-5-10-1-radio")
|
|
131
131
|
], SdRadio);
|
|
132
132
|
|
|
133
133
|
export {
|
|
@@ -94,7 +94,7 @@ var SdExpandable = class extends SolidElement {
|
|
|
94
94
|
)}" @click="${this.onToggleClick}" aria-expanded="${this.open}"><div class="${cx("h-full justify-center w-full text-base flex items-center toggle")}"><span part="toggle-icon" class="${cx(
|
|
95
95
|
"flex items-center mr-2 transition-transform duration-medium ease-in-out",
|
|
96
96
|
this.open && "rotate-180"
|
|
97
|
-
)}"><slot name="expand-icon" class="${cx(this.open && "hidden")}"><sd-5-
|
|
97
|
+
)}"><slot name="expand-icon" class="${cx(this.open && "hidden")}"><sd-5-10-1-icon library="_internal" name="chevron-down" class="text-xl"></sd-5-10-1-icon></slot><slot name="collapse-icon" class="${cx(!this.open && "hidden")}"><sd-5-10-1-icon library="_internal" name="chevron-down" class="text-xl"></sd-5-10-1-icon></slot></span><slot name="toggle-closed" class="${cx(this.open && "hidden")}">${this.localize.term("showMore")}</slot><slot name="toggle-open" class="${cx(!this.open && "hidden")}">${this.localize.term("showLess")}</slot></div></button><details part="details" ?inert="${ifDefined(!this.open)}"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details></div>`;
|
|
98
98
|
}
|
|
99
99
|
firstUpdated() {
|
|
100
100
|
this.cloneContentToLightDOM();
|
|
@@ -134,7 +134,7 @@ __decorateClass([
|
|
|
134
134
|
watch("open", { waitUntilFirstUpdate: true })
|
|
135
135
|
], SdExpandable.prototype, "onOpenChange", 1);
|
|
136
136
|
SdExpandable = __decorateClass([
|
|
137
|
-
customElement("sd-5-
|
|
137
|
+
customElement("sd-5-10-1-expandable")
|
|
138
138
|
], SdExpandable);
|
|
139
139
|
setDefaultAnimation("expandable.show", {
|
|
140
140
|
keyframes: [{ height: "var(--component-expandable-max-block-size, 90px)" }, { height: "auto" }],
|
|
@@ -44,7 +44,7 @@ var SdSelect = class extends SolidElement {
|
|
|
44
44
|
constructor() {
|
|
45
45
|
super(...arguments);
|
|
46
46
|
this.formControlController = new FormControlController(this, {
|
|
47
|
-
assumeInteractionOn: ["sd-blur", "sd-5-
|
|
47
|
+
assumeInteractionOn: ["sd-blur", "sd-5-10-1-input"]
|
|
48
48
|
});
|
|
49
49
|
this.hasSlotController = new HasSlotController(this, "help-text", "label");
|
|
50
50
|
this.localize = new LocalizeController(this);
|
|
@@ -77,11 +77,11 @@ var SdSelect = class extends SolidElement {
|
|
|
77
77
|
this.styleOnValid = false;
|
|
78
78
|
this.hoist = false;
|
|
79
79
|
this.getTag = (option) => {
|
|
80
|
-
return html`<sd-5-
|
|
80
|
+
return html`<sd-5-10-1-tag class="relative z-10" ?disabled="${this.disabled}" part="tag" exportparts="
|
|
81
81
|
base:tag__base,
|
|
82
82
|
content:tag__content,
|
|
83
83
|
removable-indicator:tag__removable-indicator,
|
|
84
|
-
" size="${this.size === "sm" ? "sm" : "lg"}" removable @keydown="${(event) => this.handleTagKeyDown(event, option)}" @sd-remove="${(event) => this.handleTagRemove(event, option)}">${option.getTextLabel()}</sd-5-
|
|
84
|
+
" size="${this.size === "sm" ? "sm" : "lg"}" removable @keydown="${(event) => this.handleTagKeyDown(event, option)}" @sd-remove="${(event) => this.handleTagRemove(event, option)}">${option.getTextLabel()}</sd-5-10-1-tag>`;
|
|
85
85
|
};
|
|
86
86
|
this.handleDocumentFocusIn = (event) => {
|
|
87
87
|
const path = event.composedPath();
|
|
@@ -92,7 +92,7 @@ var SdSelect = class extends SolidElement {
|
|
|
92
92
|
this.handleDocumentKeyDown = (event) => {
|
|
93
93
|
const target = event.target;
|
|
94
94
|
const isClearButton = target.closest(".select__clear") !== null;
|
|
95
|
-
const isIconButton = target.closest("sd-5-
|
|
95
|
+
const isIconButton = target.closest("sd-5-10-1-icon-button") !== null;
|
|
96
96
|
if (isClearButton || isIconButton) {
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
@@ -227,8 +227,8 @@ var SdSelect = class extends SolidElement {
|
|
|
227
227
|
event.preventDefault();
|
|
228
228
|
event.stopPropagation();
|
|
229
229
|
const tagParent = (_a = event.currentTarget) == null ? void 0 : _a.parentElement;
|
|
230
|
-
const previousTag = (_b = tagParent == null ? void 0 : tagParent.previousElementSibling) == null ? void 0 : _b.querySelector("sd-5-
|
|
231
|
-
const nextTag = (_c = tagParent == null ? void 0 : tagParent.nextElementSibling) == null ? void 0 : _c.querySelector("sd-5-
|
|
230
|
+
const previousTag = (_b = tagParent == null ? void 0 : tagParent.previousElementSibling) == null ? void 0 : _b.querySelector("sd-5-10-1-tag");
|
|
231
|
+
const nextTag = (_c = tagParent == null ? void 0 : tagParent.nextElementSibling) == null ? void 0 : _c.querySelector("sd-5-10-1-tag");
|
|
232
232
|
this.handleTagRemove(new CustomEvent("sd-remove"), option);
|
|
233
233
|
this.updateComplete.then(() => {
|
|
234
234
|
if (nextTag) {
|
|
@@ -248,7 +248,7 @@ var SdSelect = class extends SolidElement {
|
|
|
248
248
|
this.handleTagRemove(new CustomEvent("sd-remove"), this.selectedOptions[this.selectedOptions.length - 1]);
|
|
249
249
|
this.updateComplete.then(() => {
|
|
250
250
|
var _a;
|
|
251
|
-
const tags = (_a = this.shadowRoot) == null ? void 0 : _a.querySelectorAll("sd-5-
|
|
251
|
+
const tags = (_a = this.shadowRoot) == null ? void 0 : _a.querySelectorAll("sd-5-10-1-tag");
|
|
252
252
|
if (tags && tags.length > 0) {
|
|
253
253
|
tags == null ? void 0 : tags[(tags == null ? void 0 : tags.length) - 1].focus();
|
|
254
254
|
} else {
|
|
@@ -294,7 +294,7 @@ var SdSelect = class extends SolidElement {
|
|
|
294
294
|
}
|
|
295
295
|
handleOptionClick(event) {
|
|
296
296
|
const target = event.target;
|
|
297
|
-
const option = target.closest("sd-5-
|
|
297
|
+
const option = target.closest("sd-5-10-1-option");
|
|
298
298
|
const oldValue = this.value;
|
|
299
299
|
if (option && !option.disabled) {
|
|
300
300
|
if (this.multiple) {
|
|
@@ -319,7 +319,7 @@ var SdSelect = class extends SolidElement {
|
|
|
319
319
|
const allOptions = this.getAllOptions();
|
|
320
320
|
const value = Array.isArray(this.value) ? this.value : [this.value];
|
|
321
321
|
const values = [];
|
|
322
|
-
if (customElements.get("sd-5-
|
|
322
|
+
if (customElements.get("sd-5-10-1-option")) {
|
|
323
323
|
allOptions.forEach((option) => {
|
|
324
324
|
if (this.multiple) {
|
|
325
325
|
option.checkbox = true;
|
|
@@ -328,7 +328,7 @@ var SdSelect = class extends SolidElement {
|
|
|
328
328
|
});
|
|
329
329
|
this.setSelectedOptions(allOptions.filter((el) => value.includes(el.value)));
|
|
330
330
|
} else {
|
|
331
|
-
customElements.whenDefined("sd-5-
|
|
331
|
+
customElements.whenDefined("sd-5-10-1-option").then(() => this.handleDefaultSlotChange());
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
handleTagRemove(event, option) {
|
|
@@ -345,13 +345,13 @@ var SdSelect = class extends SolidElement {
|
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
// Gets an array of all <sd-5-
|
|
348
|
+
// Gets an array of all <sd-5-10-1-option> elements
|
|
349
349
|
getAllOptions() {
|
|
350
|
-
return [...this.querySelectorAll("sd-5-
|
|
350
|
+
return [...this.querySelectorAll("sd-5-10-1-option")];
|
|
351
351
|
}
|
|
352
|
-
// Gets the first <sd-5-
|
|
352
|
+
// Gets the first <sd-5-10-1-option> element
|
|
353
353
|
getFirstOption() {
|
|
354
|
-
return this.querySelector("sd-5-
|
|
354
|
+
return this.querySelector("sd-5-10-1-option");
|
|
355
355
|
}
|
|
356
356
|
// Sets the current option, which is the option the user is currently interacting with (e.g. via keyboard). Only one
|
|
357
357
|
// option may be "current" at a time.
|
|
@@ -440,11 +440,11 @@ var SdSelect = class extends SolidElement {
|
|
|
440
440
|
});
|
|
441
441
|
} else {
|
|
442
442
|
return [
|
|
443
|
-
html`<sd-5-
|
|
443
|
+
html`<sd-5-10-1-tag class="z-10" ?disabled="${this.disabled}" part="tag" exportparts="
|
|
444
444
|
base:tag__base,
|
|
445
445
|
content:tag__content,
|
|
446
446
|
removable-indicator:tag__removable-indicator,
|
|
447
|
-
" size="${this.size === "sm" ? "sm" : "lg"}" removable @keydown="${(event) => this.handleTagMaxOptionsKeyDown(event)}" @sd-remove="${(event) => this.handleTagRemove(event)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-
|
|
447
|
+
" size="${this.size === "sm" ? "sm" : "lg"}" removable @keydown="${(event) => this.handleTagMaxOptionsKeyDown(event)}" @sd-remove="${(event) => this.handleTagRemove(event)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-10-1-tag>`
|
|
448
448
|
];
|
|
449
449
|
}
|
|
450
450
|
}
|
|
@@ -453,7 +453,7 @@ var SdSelect = class extends SolidElement {
|
|
|
453
453
|
this.formControlController.emitInvalidEvent(event);
|
|
454
454
|
this.invalidMessage.textContent = event.target.validationMessage;
|
|
455
455
|
}
|
|
456
|
-
/** Receives incoming event detail from sd-5-
|
|
456
|
+
/** Receives incoming event detail from sd-5-10-1-popup and updates local state for conditional styling. */
|
|
457
457
|
handleCurrentPlacement(e) {
|
|
458
458
|
const incomingPlacement = e.detail;
|
|
459
459
|
if (incomingPlacement) {
|
|
@@ -462,7 +462,7 @@ var SdSelect = class extends SolidElement {
|
|
|
462
462
|
}
|
|
463
463
|
handleUseTagsChange() {
|
|
464
464
|
const allOptions = this.getAllOptions();
|
|
465
|
-
if (customElements.get("sd-5-
|
|
465
|
+
if (customElements.get("sd-5-10-1-option")) {
|
|
466
466
|
allOptions.forEach((option) => {
|
|
467
467
|
option.checkbox = this.multiple;
|
|
468
468
|
});
|
|
@@ -598,7 +598,7 @@ var SdSelect = class extends SolidElement {
|
|
|
598
598
|
default: "border-neutral-800"
|
|
599
599
|
}[selectState],
|
|
600
600
|
this.open && (this.currentPlacement === "bottom" ? "rounded-bl-none rounded-br-none" : "rounded-tl-none rounded-tr-none")
|
|
601
|
-
)}"></div><sd-5-
|
|
601
|
+
)}"></div><sd-5-10-1-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${cx(
|
|
602
602
|
"inline-flex relative w-full",
|
|
603
603
|
this.currentPlacement === "bottom" ? "origin-top" : "origin-bottom"
|
|
604
604
|
)}" placement="${this.placement}" strategy="${this.hoist ? "fixed" : "absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
|
@@ -621,12 +621,12 @@ var SdSelect = class extends SolidElement {
|
|
|
621
621
|
"select__clear flex justify-center",
|
|
622
622
|
iconMarginLeft,
|
|
623
623
|
this.value.length > 0 ? "visible" : "invisible"
|
|
624
|
-
)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-
|
|
624
|
+
)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-10-1-icon class="${cx("text-neutral-700 z-10", iconSize)}" library="_internal" name="closing-round"></sd-5-10-1-icon></slot></button>` : ""} ${this.showInvalidStyle ? html`<sd-5-10-1-icon part="invalid-icon" class="${cx(iconMarginLeft, iconSize, "text-error")}" library="_internal" name="risk"></sd-5-10-1-icon>` : ""} ${this.styleOnValid && this.showValidStyle ? html`<sd-5-10-1-icon part="valid-icon" class="${cx("flex-shrink-0 text-success", iconMarginLeft, iconSize)}" library="_internal" name="status-check"></sd-5-10-1-icon>` : ""}<slot name="expand-icon" part="expand-icon" class="${cx(
|
|
625
625
|
"inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",
|
|
626
626
|
this.open ? "rotate-180" : "rotate-0",
|
|
627
627
|
this.disabled || this.visuallyDisabled ? "text-neutral-500" : "text-primary",
|
|
628
628
|
iconSize
|
|
629
|
-
)}"><sd-5-
|
|
629
|
+
)}"><sd-5-10-1-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-5-10-1-icon></slot></div><button part="combobox" class="${cx(
|
|
630
630
|
"relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",
|
|
631
631
|
cursorStyles,
|
|
632
632
|
this.open && "shadow transition-shadow duration-medium ease-in-out",
|
|
@@ -639,7 +639,7 @@ var SdSelect = class extends SolidElement {
|
|
|
639
639
|
"bg-white px-2 py-3 relative border-primary overflow-y-auto",
|
|
640
640
|
this.open && "shadow transition-shadow duration-medium ease-in-out",
|
|
641
641
|
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"
|
|
642
|
-
)}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-5-
|
|
642
|
+
)}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-5-10-1-popup></div><div class="text-sm text-neutral-700 mt-2" 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()}`;
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
645
|
/**
|
|
@@ -647,13 +647,13 @@ var SdSelect = class extends SolidElement {
|
|
|
647
647
|
*/
|
|
648
648
|
SdSelect.styles = [
|
|
649
649
|
...SolidElement.styles,
|
|
650
|
-
css`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-
|
|
650
|
+
css`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-10-1-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-10-1-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-5-10-1-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-10-1-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-10-1-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,1))}`
|
|
651
651
|
];
|
|
652
652
|
__decorateClass([
|
|
653
|
-
queryAssignedElements({ selector: "sd-5-
|
|
653
|
+
queryAssignedElements({ selector: "sd-5-10-1-option" })
|
|
654
654
|
], SdSelect.prototype, "_optionsInDefaultSlot", 2);
|
|
655
655
|
__decorateClass([
|
|
656
|
-
query("sd-5-
|
|
656
|
+
query("sd-5-10-1-popup")
|
|
657
657
|
], SdSelect.prototype, "popup", 2);
|
|
658
658
|
__decorateClass([
|
|
659
659
|
query('[part="combobox"]')
|
|
@@ -778,7 +778,7 @@ __decorateClass([
|
|
|
778
778
|
watch("value", { waitUntilFirstUpdate: true })
|
|
779
779
|
], SdSelect.prototype, "handleValueChange", 1);
|
|
780
780
|
SdSelect = __decorateClass([
|
|
781
|
-
customElement("sd-5-
|
|
781
|
+
customElement("sd-5-10-1-select")
|
|
782
782
|
], SdSelect);
|
|
783
783
|
setDefaultAnimation("select.show", {
|
|
784
784
|
keyframes: [{ opacity: 0 }, { opacity: 1 }],
|
|
@@ -10,7 +10,7 @@ function setupAutocomplete(selector, { setValueOnSelection, scrollSelectionIntoV
|
|
|
10
10
|
var _a, _b;
|
|
11
11
|
const ul = (_a = sdInput.shadowRoot) == null ? void 0 : _a.querySelector("ul");
|
|
12
12
|
ul == null ? void 0 : ul.setAttribute("part", "listbox");
|
|
13
|
-
const popup = document.createElement("sd-5-
|
|
13
|
+
const popup = document.createElement("sd-5-10-1-popup");
|
|
14
14
|
popup.appendChild(ul);
|
|
15
15
|
(_b = sdInput.shadowRoot) == null ? void 0 : _b.appendChild(popup);
|
|
16
16
|
popup == null ? void 0 : popup.setAttribute("exportparts", "popup__content");
|
|
@@ -22,7 +22,7 @@ function setupAutocomplete(selector, { setValueOnSelection, scrollSelectionIntoV
|
|
|
22
22
|
popup.anchor = sdInput;
|
|
23
23
|
popup.sync = "width";
|
|
24
24
|
}
|
|
25
|
-
const styles = css`sd-5-
|
|
25
|
+
const styles = css`sd-5-10-1-popup::part(popup){border-bottom-left-radius:var(--sd-border-radius-default,.25rem);border-bottom-right-radius:var(--sd-border-radius-default,.25rem);border-width:0 2px 2px;overflow-y:scroll;z-index:var(--sd-z-index-dropdown,900);--tw-border-opacity:1;border-color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-2,.5rem);--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(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-5-10-1-popup li{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}sd-5-10-1-popup li:hover:not([disabled]){--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-100,246 246 246)/var(--tw-bg-opacity,1))}sd-5-10-1-popup li{list-style-type:""}sd-5-10-1-popup li mark{background-color:transparent;font-weight:700}sd-5-10-1-popup li:not(:has(sd-5-10-1-option)){cursor:pointer;font-size:var(--sd-font-size-base,1rem);padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-4,1rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity,1))}sd-5-10-1-popup li:not(:has(sd-5-10-1-option)):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}sd-5-10-1-popup li[aria-selected=true]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1))}`;
|
|
26
26
|
const styleSheet = new CSSStyleSheet();
|
|
27
27
|
styleSheet.replaceSync(styles);
|
|
28
28
|
sdInput.shadowRoot.adoptedStyleSheets = [...sdInput.shadowRoot.adoptedStyleSheets, styleSheet];
|
|
@@ -35,13 +35,13 @@ function setupAutocomplete(selector, { setValueOnSelection, scrollSelectionIntoV
|
|
|
35
35
|
}
|
|
36
36
|
input.addEventListener("open", () => {
|
|
37
37
|
var _a, _b, _c, _d, _e, _f;
|
|
38
|
-
(_b = (_a = sdInput.shadowRoot) == null ? void 0 : _a.querySelector("sd-5-
|
|
38
|
+
(_b = (_a = sdInput.shadowRoot) == null ? void 0 : _a.querySelector("sd-5-10-1-popup")) == null ? void 0 : _b.setAttribute("active", "true");
|
|
39
39
|
(_d = (_c = sdInput.shadowRoot) == null ? void 0 : _c.querySelector('[part="border"]')) == null ? void 0 : _d.classList.add("rounded-b-none");
|
|
40
40
|
(_f = (_e = sdInput.shadowRoot) == null ? void 0 : _e.querySelector('[part="form-control"]')) == null ? void 0 : _f.classList.add("z-50");
|
|
41
41
|
});
|
|
42
42
|
input.addEventListener("close", () => {
|
|
43
43
|
var _a, _b, _c, _d, _e, _f;
|
|
44
|
-
(_b = (_a = sdInput.shadowRoot) == null ? void 0 : _a.querySelector("sd-5-
|
|
44
|
+
(_b = (_a = sdInput.shadowRoot) == null ? void 0 : _a.querySelector("sd-5-10-1-popup")) == null ? void 0 : _b.removeAttribute("active");
|
|
45
45
|
(_d = (_c = sdInput.shadowRoot) == null ? void 0 : _c.querySelector('[part="border"]')) == null ? void 0 : _d.classList.remove("rounded-b-none");
|
|
46
46
|
(_f = (_e = sdInput.shadowRoot) == null ? void 0 : _e.querySelector('[part="form-control"]')) == null ? void 0 : _f.classList.remove("z-50");
|
|
47
47
|
});
|
|
@@ -32,7 +32,7 @@ var SdDivider = class extends SolidElement {
|
|
|
32
32
|
*/
|
|
33
33
|
SdDivider.styles = [
|
|
34
34
|
...SolidElement.styles,
|
|
35
|
-
css`:host{margin:var(--sd-spacing-0,0)}:host(sd-5-
|
|
35
|
+
css`:host{margin:var(--sd-spacing-0,0)}:host(sd-5-10-1-divider[orientation=horizontal]){display:block}:host(sd-5-10-1-divider[orientation=vertical]){display:inline-block}`
|
|
36
36
|
];
|
|
37
37
|
__decorateClass([
|
|
38
38
|
property({ type: String, reflect: true })
|
|
@@ -41,7 +41,7 @@ __decorateClass([
|
|
|
41
41
|
property({ type: Boolean, reflect: true })
|
|
42
42
|
], SdDivider.prototype, "inverted", 2);
|
|
43
43
|
SdDivider = __decorateClass([
|
|
44
|
-
customElement("sd-5-
|
|
44
|
+
customElement("sd-5-10-1-divider")
|
|
45
45
|
], SdDivider);
|
|
46
46
|
|
|
47
47
|
export {
|