@solid-design-system/components 1.22.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/es/carousel.js +3 -3
- package/dist/components/es/checkbox.js +1 -11
- package/dist/components/es/event.js +1 -1
- package/dist/components/es/input.js +1 -0
- package/dist/components/es/interactive.js +1 -0
- package/dist/components/es/live.js +11 -0
- package/dist/components/es/radio-group.js +1 -1
- package/dist/components/es/radio.js +1 -1
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/es/solid-element.js +1 -1
- package/dist/components/es/tooltip.js +4 -0
- package/dist/components/umd/solid-components.js +23 -20
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/icon/library.system.d.ts +9 -1
- package/dist/package/components/icon/library.system.js +52 -9
- package/dist/package/components/input/input.d.ts +76 -0
- package/dist/package/components/input/input.js +390 -0
- package/dist/package/components/radio/radio.js +1 -3
- package/dist/package/components/radio-group/radio-group.js +7 -8
- package/dist/package/components/tooltip/tooltip.d.ts +39 -0
- package/dist/package/components/tooltip/tooltip.js +233 -0
- package/dist/package/internal/animate.js +11 -0
- package/dist/package/solid-components.d.ts +2 -0
- package/dist/package/solid-components.js +22 -18
- package/dist/package/styles/form-control.styles.d.ts +2 -0
- package/dist/package/styles/form-control.styles.js +5 -0
- package/dist/package/styles/tailwind.css.js +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 -11
- 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/event.js +1 -1
- package/dist/versioned-components/es/form.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 -0
- package/dist/versioned-components/es/interactive.js +1 -0
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/live.js +11 -0
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/popup.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/solid-components2.js +1 -1
- package/dist/versioned-components/es/solid-element.js +1 -1
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/tooltip.js +4 -0
- 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/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 +6 -6
- 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/icon/library.system.d.ts +9 -1
- package/dist/versioned-package/components/icon/library.system.js +52 -9
- 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 +76 -0
- package/dist/versioned-package/components/input/input.js +390 -0
- 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/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 +3 -5
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +20 -21
- 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/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/tooltip/tooltip.d.ts +39 -0
- package/dist/versioned-package/components/tooltip/tooltip.js +233 -0
- 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/animate.js +11 -0
- package/dist/versioned-package/internal/form.js +2 -2
- package/dist/versioned-package/solid-components.d.ts +2 -0
- package/dist/versioned-package/solid-components.js +22 -18
- package/dist/versioned-package/styles/form-control.styles.d.ts +2 -0
- package/dist/versioned-package/styles/form-control.styles.js +5 -0
- package/dist/versioned-package/styles/tailwind.css.js +1 -1
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +705 -23
- package/dist/web-types.json +772 -1
- package/package.json +5 -5
|
@@ -72,10 +72,10 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
72
72
|
this.formControlController.updateValidity();
|
|
73
73
|
}
|
|
74
74
|
getAllRadios() {
|
|
75
|
-
return [...this.querySelectorAll("sd-1-
|
|
75
|
+
return [...this.querySelectorAll("sd-1-24-0-radio, sd-1-24-0-radio-button")];
|
|
76
76
|
}
|
|
77
77
|
handleRadioClick(event) {
|
|
78
|
-
const target = event.target.closest("sd-1-
|
|
78
|
+
const target = event.target.closest("sd-1-24-0-radio, sd-1-24-0-radio-button");
|
|
79
79
|
const radios = this.getAllRadios();
|
|
80
80
|
const oldValue = this.value;
|
|
81
81
|
if (target.disabled) {
|
|
@@ -85,7 +85,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
85
85
|
radios.forEach((radio) => radio.checked = radio === target);
|
|
86
86
|
if (this.value !== oldValue) {
|
|
87
87
|
this.emit("sd-change");
|
|
88
|
-
this.emit("sd-input");
|
|
88
|
+
this.emit("sd-1-24-0-input");
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
handleKeyDown(event) {
|
|
@@ -119,7 +119,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
119
119
|
}
|
|
120
120
|
if (this.value !== oldValue) {
|
|
121
121
|
this.emit("sd-change");
|
|
122
|
-
this.emit("sd-input");
|
|
122
|
+
this.emit("sd-1-24-0-input");
|
|
123
123
|
}
|
|
124
124
|
event.preventDefault();
|
|
125
125
|
}
|
|
@@ -147,7 +147,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
147
147
|
radio.invalid = this.invalid;
|
|
148
148
|
})
|
|
149
149
|
);
|
|
150
|
-
this.hasButtonGroup = radios.some((radio) => radio.tagName.toLowerCase() === "sd-1-
|
|
150
|
+
this.hasButtonGroup = radios.some((radio) => radio.tagName.toLowerCase() === "sd-1-24-0-radio-button");
|
|
151
151
|
if (!radios.some((radio) => radio.checked)) {
|
|
152
152
|
if (this.hasButtonGroup) {
|
|
153
153
|
const buttonRadio = (_a = radios[0].shadowRoot) == null ? void 0 : _a.querySelector("button");
|
|
@@ -159,26 +159,26 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
if (this.hasButtonGroup) {
|
|
162
|
-
const buttonGroup = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector("sd-1-
|
|
162
|
+
const buttonGroup = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector("sd-1-24-0-button-group");
|
|
163
163
|
if (buttonGroup) {
|
|
164
164
|
buttonGroup.disableRole = true;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
syncRadios() {
|
|
169
|
-
if (customElements.get("sd-1-
|
|
169
|
+
if (customElements.get("sd-1-24-0-radio") && customElements.get("sd-1-24-0-radio-button")) {
|
|
170
170
|
this.syncRadioElements();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
if (customElements.get("sd-1-
|
|
173
|
+
if (customElements.get("sd-1-24-0-radio")) {
|
|
174
174
|
this.syncRadioElements();
|
|
175
175
|
} else {
|
|
176
|
-
customElements.whenDefined("sd-1-
|
|
176
|
+
customElements.whenDefined("sd-1-24-0-radio").then(() => this.syncRadios());
|
|
177
177
|
}
|
|
178
|
-
if (customElements.get("sd-1-
|
|
178
|
+
if (customElements.get("sd-1-24-0-radio-button")) {
|
|
179
179
|
this.syncRadioElements();
|
|
180
180
|
} else {
|
|
181
|
-
customElements.whenDefined("sd-1-
|
|
181
|
+
customElements.whenDefined("sd-1-24-0-radio-button").then(() => this.syncRadios());
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
updateCheckedRadio() {
|
|
@@ -241,35 +241,34 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
241
241
|
const hasErrorText = this.errorText ? true : !!hasErrorTextSlot;
|
|
242
242
|
const defaultSlot = html`<slot @slotchange="${this.syncRadios}" @click="${this.handleRadioClick}" @keydown="${this.handleKeyDown}"></slot>`;
|
|
243
243
|
return html`<fieldset part="form-control" class="${cx(
|
|
244
|
-
"
|
|
245
|
-
hasLabel && "form-control--has-label",
|
|
244
|
+
"border-0 p-0 m-0",
|
|
246
245
|
hasErrorText && "text-error",
|
|
247
246
|
{
|
|
248
247
|
/* sizes, fonts */
|
|
249
248
|
sm: "text-sm",
|
|
250
249
|
lg: "text-base"
|
|
251
250
|
}[this.size]
|
|
252
|
-
)}" role="radiogroup" aria-labelledby="label" aria-errormessage="error-text"><label part="form-control-label" id="label" class="
|
|
251
|
+
)}" role="radiogroup" aria-labelledby="label" aria-errormessage="error-text"><label part="form-control-label" id="label" class="${cx("mb-2 p-0 font-bold leading-normal text-black", hasLabel ? "has-label flex" : "hidden")}" aria-hidden="${!hasLabel}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${cx(
|
|
253
252
|
"form-control-input flex",
|
|
254
253
|
this.invalid && "form-control-input--invalid text-error",
|
|
255
254
|
{
|
|
256
|
-
vertical: "
|
|
257
|
-
horizontal: "
|
|
255
|
+
vertical: "flex-col",
|
|
256
|
+
horizontal: "flex-row"
|
|
258
257
|
}[this.orientation]
|
|
259
|
-
)}"><div class="sr-only"><div id="error-message" aria-live="assertive">${this.errorText}</div><label
|
|
258
|
+
)}"><div class="sr-only"><div id="error-message" aria-live="assertive">${this.errorText}</div><label><input id="validation-input" type="text" ?required="${this.required}" tabindex="-1" hidden @invalid="${this.handleInvalid}"></label></div>${defaultSlot}</div></fieldset>`;
|
|
260
259
|
}
|
|
261
260
|
};
|
|
262
|
-
SdRadioGroup.dependencies = { "sd-1-
|
|
261
|
+
SdRadioGroup.dependencies = { "sd-1-24-0-button-group": SdButtonGroup };
|
|
263
262
|
SdRadioGroup.styles = [
|
|
264
263
|
componentStyles,
|
|
265
264
|
SolidElement.styles,
|
|
266
|
-
css`:host{display:block}
|
|
265
|
+
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-1-24-0-radio){margin-bottom:8px;display:flex}:host([orientation=vertical]) ::slotted(sd-1-24-0-radio:last-of-type){margin-bottom:0}:host([orientation=horizontal]) ::slotted(sd-1-24-0-radio){margin-right:24px}:host([size=sm]):host([orientation=horizontal]) ::slotted(sd-1-24-0-radio){margin-right:16px}:host([orientation=horizontal]) ::slotted(sd-1-24-0-radio:last-of-type){margin-right:0}:host([required]) #label.has-label::after{content:'*';margin-left:2px}`
|
|
267
266
|
];
|
|
268
267
|
__decorateClass([
|
|
269
268
|
query("slot:not([name])")
|
|
270
269
|
], SdRadioGroup.prototype, "defaultSlot", 2);
|
|
271
270
|
__decorateClass([
|
|
272
|
-
query("
|
|
271
|
+
query("#validation-input")
|
|
273
272
|
], SdRadioGroup.prototype, "validationInput", 2);
|
|
274
273
|
__decorateClass([
|
|
275
274
|
state()
|
|
@@ -314,7 +313,7 @@ __decorateClass([
|
|
|
314
313
|
watch("value")
|
|
315
314
|
], SdRadioGroup.prototype, "handleValueChange", 1);
|
|
316
315
|
SdRadioGroup = __decorateClass([
|
|
317
|
-
customElement("sd-1-
|
|
316
|
+
customElement("sd-1-24-0-radio-group")
|
|
318
317
|
], SdRadioGroup);
|
|
319
318
|
export {
|
|
320
319
|
SdRadioGroup as default
|
|
@@ -72,7 +72,7 @@ let SdTag = class extends SolidElement {
|
|
|
72
72
|
lg: "text-base",
|
|
73
73
|
sm: "text-[12px]"
|
|
74
74
|
}[this.size]
|
|
75
|
-
)}"><sd-1-
|
|
75
|
+
)}"><sd-1-24-0-icon library="system" name="close" label="remove"></sd-1-24-0-icon></slot></${tag}>`;
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
SdTag.styles = [
|
|
@@ -104,7 +104,7 @@ __decorateClass([
|
|
|
104
104
|
property()
|
|
105
105
|
], SdTag.prototype, "download", 2);
|
|
106
106
|
SdTag = __decorateClass([
|
|
107
|
-
customElement("sd-1-
|
|
107
|
+
customElement("sd-1-24-0-tag")
|
|
108
108
|
], SdTag);
|
|
109
109
|
export {
|
|
110
110
|
SdTag as default
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import '../popup/popup';
|
|
2
|
+
import SolidElement from '../../internal/solid-element';
|
|
3
|
+
import type SdPopup from '../popup/popup';
|
|
4
|
+
export default class SdTooltip extends SolidElement {
|
|
5
|
+
private hoverTimeout;
|
|
6
|
+
private readonly localize;
|
|
7
|
+
defaultSlot: HTMLSlotElement;
|
|
8
|
+
body: HTMLElement;
|
|
9
|
+
popup: SdPopup;
|
|
10
|
+
content: string;
|
|
11
|
+
placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
|
|
12
|
+
size: 'lg' | 'sm';
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
open: boolean;
|
|
15
|
+
trigger: string;
|
|
16
|
+
hoist: boolean;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
firstUpdated(): void;
|
|
19
|
+
disconnectedCallback(): void;
|
|
20
|
+
private handleBlur;
|
|
21
|
+
private handleClick;
|
|
22
|
+
private handleFocus;
|
|
23
|
+
private handleKeyDown;
|
|
24
|
+
private handleMouseOver;
|
|
25
|
+
private handleMouseOut;
|
|
26
|
+
private hasTrigger;
|
|
27
|
+
handleOpenChange(): Promise<void>;
|
|
28
|
+
handleOptionsChange(): Promise<void>;
|
|
29
|
+
handleDisabledChange(): void;
|
|
30
|
+
show(): Promise<void>;
|
|
31
|
+
hide(): Promise<void>;
|
|
32
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
33
|
+
static styles: import("lit").CSSResultGroup[];
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'sd-1-24-0-tooltip': SdTooltip;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import "../popup/popup.js";
|
|
2
|
+
import { parseDuration, stopAnimations, animateTo } from "../../internal/animate.js";
|
|
3
|
+
import { unsafeCSS, css, html } from "lit";
|
|
4
|
+
import { customElement } from "../../internal/register-custom-element.js";
|
|
5
|
+
import { setDefaultAnimation, getAnimation } from "../../utilities/animation-registry.js";
|
|
6
|
+
import { LocalizeController } from "../../utilities/localize.js";
|
|
7
|
+
import { query, property } from "lit/decorators.js";
|
|
8
|
+
import { waitForEvent } from "../../internal/event.js";
|
|
9
|
+
import { watch } from "../../internal/watch.js";
|
|
10
|
+
import cx from "classix";
|
|
11
|
+
import InteractiveStyles from "../../styles/interactive/interactive.css.js";
|
|
12
|
+
import SolidElement from "../../internal/solid-element.js";
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
16
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
17
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
18
|
+
if (decorator = decorators[i])
|
|
19
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20
|
+
if (kind && result)
|
|
21
|
+
__defProp(target, key, result);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
let SdTooltip = class extends SolidElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.localize = new LocalizeController(this);
|
|
28
|
+
this.content = "";
|
|
29
|
+
this.placement = "top";
|
|
30
|
+
this.size = "lg";
|
|
31
|
+
this.disabled = false;
|
|
32
|
+
this.open = false;
|
|
33
|
+
this.trigger = "click focus";
|
|
34
|
+
this.hoist = false;
|
|
35
|
+
}
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
super.connectedCallback();
|
|
38
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
39
|
+
this.handleClick = this.handleClick.bind(this);
|
|
40
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
41
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
42
|
+
this.handleMouseOver = this.handleMouseOver.bind(this);
|
|
43
|
+
this.handleMouseOut = this.handleMouseOut.bind(this);
|
|
44
|
+
this.updateComplete.then(() => {
|
|
45
|
+
this.addEventListener("blur", this.handleBlur, true);
|
|
46
|
+
this.addEventListener("focus", this.handleFocus, true);
|
|
47
|
+
this.addEventListener("click", this.handleClick);
|
|
48
|
+
this.addEventListener("keydown", this.handleKeyDown);
|
|
49
|
+
this.addEventListener("mouseover", this.handleMouseOver);
|
|
50
|
+
this.addEventListener("mouseout", this.handleMouseOut);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
firstUpdated() {
|
|
54
|
+
this.body.hidden = !this.open;
|
|
55
|
+
if (this.open) {
|
|
56
|
+
this.popup.active = true;
|
|
57
|
+
this.popup.reposition();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
disconnectedCallback() {
|
|
61
|
+
super.disconnectedCallback();
|
|
62
|
+
this.removeEventListener("blur", this.handleBlur, true);
|
|
63
|
+
this.removeEventListener("focus", this.handleFocus, true);
|
|
64
|
+
this.removeEventListener("click", this.handleClick);
|
|
65
|
+
this.removeEventListener("keydown", this.handleKeyDown);
|
|
66
|
+
this.removeEventListener("mouseover", this.handleMouseOver);
|
|
67
|
+
this.removeEventListener("mouseout", this.handleMouseOut);
|
|
68
|
+
}
|
|
69
|
+
handleBlur() {
|
|
70
|
+
if (this.hasTrigger("focus")) {
|
|
71
|
+
this.hide();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
handleClick() {
|
|
75
|
+
if (this.hasTrigger("click")) {
|
|
76
|
+
if (this.open) {
|
|
77
|
+
this.hide();
|
|
78
|
+
} else {
|
|
79
|
+
this.show();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
handleFocus() {
|
|
84
|
+
if (this.hasTrigger("focus")) {
|
|
85
|
+
this.show();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
handleKeyDown(event) {
|
|
89
|
+
if (this.open && event.key === "Escape") {
|
|
90
|
+
event.stopPropagation();
|
|
91
|
+
this.hide();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
handleMouseOver() {
|
|
95
|
+
if (this.hasTrigger("hover")) {
|
|
96
|
+
const delay = parseDuration(getComputedStyle(this).getPropertyValue("--show-delay"));
|
|
97
|
+
clearTimeout(this.hoverTimeout);
|
|
98
|
+
this.hoverTimeout = window.setTimeout(() => this.show(), delay);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
handleMouseOut() {
|
|
102
|
+
if (this.hasTrigger("hover")) {
|
|
103
|
+
const delay = parseDuration(getComputedStyle(this).getPropertyValue("--hide-delay"));
|
|
104
|
+
clearTimeout(this.hoverTimeout);
|
|
105
|
+
this.hoverTimeout = window.setTimeout(() => this.hide(), delay);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
hasTrigger(triggerType) {
|
|
109
|
+
const triggers = this.trigger.split(" ");
|
|
110
|
+
return triggers.includes(triggerType);
|
|
111
|
+
}
|
|
112
|
+
async handleOpenChange() {
|
|
113
|
+
if (this.open) {
|
|
114
|
+
if (this.disabled) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
this.emit("sd-show");
|
|
118
|
+
await stopAnimations(this.body);
|
|
119
|
+
this.body.hidden = false;
|
|
120
|
+
this.popup.active = true;
|
|
121
|
+
const { keyframes, options } = getAnimation(this, "tooltip.show", { dir: this.localize.dir() });
|
|
122
|
+
await animateTo(this.popup.popup, keyframes, options);
|
|
123
|
+
this.emit("sd-after-show");
|
|
124
|
+
} else {
|
|
125
|
+
this.emit("sd-hide");
|
|
126
|
+
await stopAnimations(this.body);
|
|
127
|
+
const { keyframes, options } = getAnimation(this, "tooltip.hide", { dir: this.localize.dir() });
|
|
128
|
+
await animateTo(this.popup.popup, keyframes, options);
|
|
129
|
+
this.popup.active = false;
|
|
130
|
+
this.body.hidden = true;
|
|
131
|
+
this.emit("sd-after-hide");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
async handleOptionsChange() {
|
|
135
|
+
if (this.hasUpdated) {
|
|
136
|
+
await this.updateComplete;
|
|
137
|
+
this.popup.reposition();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
handleDisabledChange() {
|
|
141
|
+
if (this.disabled && this.open) {
|
|
142
|
+
this.hide();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/** Shows the tooltip. */
|
|
146
|
+
async show() {
|
|
147
|
+
if (this.open) {
|
|
148
|
+
return void 0;
|
|
149
|
+
}
|
|
150
|
+
this.open = true;
|
|
151
|
+
return waitForEvent(this, "sd-after-show");
|
|
152
|
+
}
|
|
153
|
+
/** Hides the tooltip */
|
|
154
|
+
async hide() {
|
|
155
|
+
if (!this.open) {
|
|
156
|
+
return void 0;
|
|
157
|
+
}
|
|
158
|
+
this.open = false;
|
|
159
|
+
return waitForEvent(this, "sd-after-hide");
|
|
160
|
+
}
|
|
161
|
+
render() {
|
|
162
|
+
const isStart = this.placement.endsWith("-start");
|
|
163
|
+
const isEnd = this.placement.endsWith("-end");
|
|
164
|
+
return html`<sd-1-24-0-popup part="base" exportparts="
|
|
165
|
+
popup:base__popup,
|
|
166
|
+
arrow:base__arrow
|
|
167
|
+
" class="${cx(this.open && "tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{ start: 2, end: -2, default: 0 }[isStart ? "start" : isEnd ? "end" : "default"] * (this.size === "sm" ? -1 : 1)}" strategy="${this.hoist ? "fixed" : "absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${cx(this.size === "lg" ? "text-xl" : "text-base")}"><button class="flex sd-interactive rounded-full"><sd-1-24-0-icon library="system" name="info-circle" class="${cx(this.disabled && "sd-interactive--disabled")}"></sd-1-24-0-icon></button></slot><slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="Tooltip" aria-live="${this.open ? "polite" : "off"}">${this.content}</slot></sd-1-24-0-popup>`;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
SdTooltip.styles = [
|
|
171
|
+
SolidElement.styles,
|
|
172
|
+
unsafeCSS(InteractiveStyles),
|
|
173
|
+
css`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-1-24-0-popup{--arrow-color:rgb(var(--sd-color-primary, 0 53 142) / 1);--arrow-size:10px}sd-1-24-0-popup::part(popup){pointer-events:none;z-index:10;box-shadow:0 1px 3px 0 rgb(81 81 81 / 75%)}sd-1-24-0-popup::part(arrow){--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-1-24-0-popup[placement^=top]::part(popup){transform-origin:bottom}sd-1-24-0-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`
|
|
174
|
+
];
|
|
175
|
+
__decorateClass([
|
|
176
|
+
query("slot:not([name])")
|
|
177
|
+
], SdTooltip.prototype, "defaultSlot", 2);
|
|
178
|
+
__decorateClass([
|
|
179
|
+
query("#tooltip")
|
|
180
|
+
], SdTooltip.prototype, "body", 2);
|
|
181
|
+
__decorateClass([
|
|
182
|
+
query("sd-1-24-0-popup")
|
|
183
|
+
], SdTooltip.prototype, "popup", 2);
|
|
184
|
+
__decorateClass([
|
|
185
|
+
property()
|
|
186
|
+
], SdTooltip.prototype, "content", 2);
|
|
187
|
+
__decorateClass([
|
|
188
|
+
property({ reflect: true })
|
|
189
|
+
], SdTooltip.prototype, "placement", 2);
|
|
190
|
+
__decorateClass([
|
|
191
|
+
property()
|
|
192
|
+
], SdTooltip.prototype, "size", 2);
|
|
193
|
+
__decorateClass([
|
|
194
|
+
property({ type: Boolean, reflect: true })
|
|
195
|
+
], SdTooltip.prototype, "disabled", 2);
|
|
196
|
+
__decorateClass([
|
|
197
|
+
property({ type: Boolean, reflect: true })
|
|
198
|
+
], SdTooltip.prototype, "open", 2);
|
|
199
|
+
__decorateClass([
|
|
200
|
+
property()
|
|
201
|
+
], SdTooltip.prototype, "trigger", 2);
|
|
202
|
+
__decorateClass([
|
|
203
|
+
property({ type: Boolean })
|
|
204
|
+
], SdTooltip.prototype, "hoist", 2);
|
|
205
|
+
__decorateClass([
|
|
206
|
+
watch("open", { waitUntilFirstUpdate: true })
|
|
207
|
+
], SdTooltip.prototype, "handleOpenChange", 1);
|
|
208
|
+
__decorateClass([
|
|
209
|
+
watch(["content", "hoist", "placement"])
|
|
210
|
+
], SdTooltip.prototype, "handleOptionsChange", 1);
|
|
211
|
+
__decorateClass([
|
|
212
|
+
watch("disabled")
|
|
213
|
+
], SdTooltip.prototype, "handleDisabledChange", 1);
|
|
214
|
+
SdTooltip = __decorateClass([
|
|
215
|
+
customElement("sd-1-24-0-tooltip")
|
|
216
|
+
], SdTooltip);
|
|
217
|
+
setDefaultAnimation("tooltip.show", {
|
|
218
|
+
keyframes: [
|
|
219
|
+
{ opacity: 0, scale: 0.8 },
|
|
220
|
+
{ opacity: 1, scale: 1 }
|
|
221
|
+
],
|
|
222
|
+
options: { duration: 150, easing: "ease" }
|
|
223
|
+
});
|
|
224
|
+
setDefaultAnimation("tooltip.hide", {
|
|
225
|
+
keyframes: [
|
|
226
|
+
{ opacity: 1, scale: 1 },
|
|
227
|
+
{ opacity: 0, scale: 0.8 }
|
|
228
|
+
],
|
|
229
|
+
options: { duration: 150, easing: "ease" }
|
|
230
|
+
});
|
|
231
|
+
export {
|
|
232
|
+
SdTooltip as default
|
|
233
|
+
};
|
|
@@ -87,7 +87,7 @@ let SdVideo = class extends SolidElement {
|
|
|
87
87
|
this.playing ? "opacity-0" : "opacity-100",
|
|
88
88
|
this.isBelowBreakpoint ? "w-[48px] h-[48px]" : "w-[96px] h-[96px]",
|
|
89
89
|
"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition"
|
|
90
|
-
)}"><slot name="play-icon" part="play-icon" class="${cx(this.isBelowBreakpoint ? "text-[2rem]" : "text-[4rem]")}"><sd-1-
|
|
90
|
+
)}"><slot name="play-icon" part="play-icon" class="${cx(this.isBelowBreakpoint ? "text-[2rem]" : "text-[4rem]")}"><sd-1-24-0-icon id="default-play-icon" library="system" name="start"></sd-1-24-0-icon></slot></div></button> ${this.hasSlotController.test("poster") ? html`<slot name="poster" role="presentation" @transitionend="${this.hidePoster}"></slot>` : null}<div part="overlay" id="overlay" role="presentation" class="${cx(
|
|
91
91
|
this.overlay && !this.playing ? "opacity-100" : "opacity-0",
|
|
92
92
|
"bg-[rgba(0,0,0,0.65)] w-full h-full absolute top-0 left-0 pointer-events-none z-20 play-pause-transition"
|
|
93
93
|
)}"></div><slot></slot></div>`;
|
|
@@ -110,7 +110,7 @@ __decorateClass([
|
|
|
110
110
|
property({ type: Boolean })
|
|
111
111
|
], SdVideo.prototype, "isBelowBreakpoint", 2);
|
|
112
112
|
SdVideo = __decorateClass([
|
|
113
|
-
customElement("sd-1-
|
|
113
|
+
customElement("sd-1-24-0-video")
|
|
114
114
|
], SdVideo);
|
|
115
115
|
export {
|
|
116
116
|
SdVideo as default
|
|
@@ -11,6 +11,16 @@ function animateTo(el, keyframes, options) {
|
|
|
11
11
|
animation.addEventListener("finish", resolve, { once: true });
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
+
function parseDuration(delay) {
|
|
15
|
+
delay = delay.toString().toLowerCase();
|
|
16
|
+
if (delay.indexOf("ms") > -1) {
|
|
17
|
+
return parseFloat(delay);
|
|
18
|
+
}
|
|
19
|
+
if (delay.indexOf("s") > -1) {
|
|
20
|
+
return parseFloat(delay) * 1e3;
|
|
21
|
+
}
|
|
22
|
+
return parseFloat(delay);
|
|
23
|
+
}
|
|
14
24
|
function prefersReducedMotion() {
|
|
15
25
|
const query = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
16
26
|
return query.matches;
|
|
@@ -35,6 +45,7 @@ function shimKeyframesHeightAuto(keyframes, calculatedHeight) {
|
|
|
35
45
|
}
|
|
36
46
|
export {
|
|
37
47
|
animateTo,
|
|
48
|
+
parseDuration,
|
|
38
49
|
prefersReducedMotion,
|
|
39
50
|
shimKeyframesHeightAuto,
|
|
40
51
|
stopAnimations
|
|
@@ -8,7 +8,7 @@ class FormControlController {
|
|
|
8
8
|
const disabled = this.options.disabled(this.host);
|
|
9
9
|
const name = this.options.name(this.host);
|
|
10
10
|
const value = this.options.value(this.host);
|
|
11
|
-
const isButton = this.host.tagName.toLowerCase() === "sd-1-
|
|
11
|
+
const isButton = this.host.tagName.toLowerCase() === "sd-1-24-0-button";
|
|
12
12
|
if (!disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
|
|
13
13
|
if (Array.isArray(value)) {
|
|
14
14
|
value.forEach((val) => {
|
|
@@ -65,7 +65,7 @@ class FormControlController {
|
|
|
65
65
|
disabled: (input) => input.disabled ?? false,
|
|
66
66
|
reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true,
|
|
67
67
|
setValue: (input, value) => input.value = value,
|
|
68
|
-
assumeInteractionOn: ["sd-input"],
|
|
68
|
+
assumeInteractionOn: ["sd-1-24-0-input"],
|
|
69
69
|
...options
|
|
70
70
|
};
|
|
71
71
|
}
|
|
@@ -12,6 +12,7 @@ export { default as SdDrawer } from './components/drawer/drawer';
|
|
|
12
12
|
export { default as SdDropdown } from './components/dropdown/dropdown';
|
|
13
13
|
export { default as SdIcon } from './components/icon/icon';
|
|
14
14
|
export { default as SdInclude } from './components/include/include';
|
|
15
|
+
export { default as SdInput } from './components/input/input';
|
|
15
16
|
export { default as SdLink } from './components/link/link';
|
|
16
17
|
export { default as SdNavigationItem } from './components/navigation-item/navigation-item';
|
|
17
18
|
export { default as SdPopup } from './components/popup/popup';
|
|
@@ -20,6 +21,7 @@ export { default as SdRadioGroup } from './components/radio-group/radio-group';
|
|
|
20
21
|
export { default as SdSpinner } from './components/spinner/spinner';
|
|
21
22
|
export { default as SdTag } from './components/tag/tag';
|
|
22
23
|
export { default as SdTeaser } from './components/teaser/teaser';
|
|
24
|
+
export { default as SdTooltip } from './components/tooltip/tooltip';
|
|
23
25
|
export { default as SdVideo } from './components/video/video';
|
|
24
26
|
export * from './utilities/icon-library';
|
|
25
27
|
export * from './utilities/localize';
|
|
@@ -12,15 +12,17 @@ import { default as default12 } from "./components/drawer/drawer.js";
|
|
|
12
12
|
import { default as default13 } from "./components/dropdown/dropdown.js";
|
|
13
13
|
import { default as default14 } from "./components/icon/icon.js";
|
|
14
14
|
import { default as default15 } from "./components/include/include.js";
|
|
15
|
-
import { default as default16 } from "./components/
|
|
16
|
-
import { default as default17 } from "./components/
|
|
17
|
-
import { default as default18 } from "./components/
|
|
18
|
-
import { default as default19 } from "./components/
|
|
19
|
-
import { default as default20 } from "./components/radio
|
|
20
|
-
import { default as default21 } from "./components/
|
|
21
|
-
import { default as default22 } from "./components/
|
|
22
|
-
import { default as default23 } from "./components/
|
|
23
|
-
import { default as default24 } from "./components/
|
|
15
|
+
import { default as default16 } from "./components/input/input.js";
|
|
16
|
+
import { default as default17 } from "./components/link/link.js";
|
|
17
|
+
import { default as default18 } from "./components/navigation-item/navigation-item.js";
|
|
18
|
+
import { default as default19 } from "./components/popup/popup.js";
|
|
19
|
+
import { default as default20 } from "./components/radio/radio.js";
|
|
20
|
+
import { default as default21 } from "./components/radio-group/radio-group.js";
|
|
21
|
+
import { default as default22 } from "./components/spinner/spinner.js";
|
|
22
|
+
import { default as default23 } from "./components/tag/tag.js";
|
|
23
|
+
import { default as default24 } from "./components/teaser/teaser.js";
|
|
24
|
+
import { default as default25 } from "./components/tooltip/tooltip.js";
|
|
25
|
+
import { default as default26 } from "./components/video/video.js";
|
|
24
26
|
import { registerIconLibrary, unregisterIconLibrary } from "./components/icon/library.js";
|
|
25
27
|
import { LocalizeController } from "./utilities/localize.js";
|
|
26
28
|
export {
|
|
@@ -39,15 +41,17 @@ export {
|
|
|
39
41
|
default13 as SdDropdown,
|
|
40
42
|
default14 as SdIcon,
|
|
41
43
|
default15 as SdInclude,
|
|
42
|
-
default16 as
|
|
43
|
-
default17 as
|
|
44
|
-
default18 as
|
|
45
|
-
default19 as
|
|
46
|
-
default20 as
|
|
47
|
-
default21 as
|
|
48
|
-
default22 as
|
|
49
|
-
default23 as
|
|
50
|
-
default24 as
|
|
44
|
+
default16 as SdInput,
|
|
45
|
+
default17 as SdLink,
|
|
46
|
+
default18 as SdNavigationItem,
|
|
47
|
+
default19 as SdPopup,
|
|
48
|
+
default20 as SdRadio,
|
|
49
|
+
default21 as SdRadioGroup,
|
|
50
|
+
default22 as SdSpinner,
|
|
51
|
+
default23 as SdTag,
|
|
52
|
+
default24 as SdTeaser,
|
|
53
|
+
default25 as SdTooltip,
|
|
54
|
+
default26 as SdVideo,
|
|
51
55
|
registerIconLibrary,
|
|
52
56
|
unregisterIconLibrary
|
|
53
57
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
const formControlStyles = css`.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--sd-1-24-0-input-label-color);margin-bottom:var(--sd-spacing-3x-small)}.form-control--has-label.form-control--small .form-control__label{font-size:var(--sd-1-24-0-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--sd-1-24-0-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--sd-1-24-0-input-label-font-size-large)}:host([required]) .form-control--has-label .form-control__label::after{content:var(--sd-1-24-0-input-required-content);margin-inline-start:var(--sd-1-24-0-input-required-content-offset);color:var(--sd-1-24-0-input-required-content-color)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--sd-1-24-0-input-help-text-color);margin-top:var(--sd-spacing-3x-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--sd-1-24-0-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--sd-1-24-0-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--sd-1-24-0-input-help-text-font-size-large)}.form-control--has-help-text.form-control--radio-group .form-control__help-text{margin-top:var(--sd-spacing-2x-small)}`;
|
|
3
|
+
export {
|
|
4
|
+
formControlStyles as default
|
|
5
|
+
};
|