@solid-design-system/components 1.8.0 → 1.9.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/drawer.js +1 -0
- package/dist/components/es/dropdown.js +1 -1
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/es/solid-element.js +4 -4
- package/dist/components/es/tabbable.js +1 -0
- package/dist/components/umd/solid-components.js +15 -15
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/drawer/drawer.d.ts +34 -0
- package/dist/package/components/drawer/drawer.js +283 -0
- package/dist/package/components/icon/library.system.d.ts +1 -0
- package/dist/package/components/icon/library.system.js +6 -1
- package/dist/package/internal/modal.d.ts +12 -0
- package/dist/package/internal/modal.js +52 -0
- package/dist/package/internal/scroll.js +23 -1
- package/dist/package/internal/string.d.ts +1 -0
- package/dist/package/internal/string.js +6 -0
- package/dist/package/solid-components.d.ts +1 -0
- package/dist/package/solid-components.js +16 -14
- 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 +2 -2
- package/dist/versioned-components/es/divider.js +1 -1
- package/dist/versioned-components/es/drawer.js +1 -0
- package/dist/versioned-components/es/dropdown.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/link.js +1 -1
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/solid-components2.js +1 -1
- package/dist/versioned-components/es/solid-element.js +4 -4
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/tabbable.js +1 -0
- package/dist/versioned-components/es/teaser.js +1 -1
- 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/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 +34 -0
- package/dist/versioned-package/components/drawer/drawer.js +283 -0
- 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 +1 -0
- package/dist/versioned-package/components/icon/library.system.js +6 -1
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/internal/form.js +1 -1
- package/dist/versioned-package/internal/modal.d.ts +12 -0
- package/dist/versioned-package/internal/modal.js +52 -0
- package/dist/versioned-package/internal/scroll.js +23 -1
- package/dist/versioned-package/internal/string.d.ts +1 -0
- package/dist/versioned-package/internal/string.js +6 -0
- package/dist/versioned-package/solid-components.d.ts +1 -0
- package/dist/versioned-package/solid-components.js +16 -14
- package/dist/versioned-package/styles/tailwind.css.js +1 -1
- package/dist/vscode.html-custom-data.json +91 -13
- package/dist/web-types.json +320 -14
- package/package.json +3 -3
|
@@ -47,16 +47,16 @@ let SdAccordionGroup = class extends SolidElement {
|
|
|
47
47
|
SdAccordionGroup.styles = [
|
|
48
48
|
componentStyles,
|
|
49
49
|
SolidElement.styles,
|
|
50
|
-
css`:host{display:block}::slotted(sd-1-
|
|
50
|
+
css`:host{display:block}::slotted(sd-1-9-0-accordion:not(:first-of-type)){margin-top:-1px}`
|
|
51
51
|
];
|
|
52
52
|
__decorateClass([
|
|
53
|
-
queryAssignedElements({ selector: "sd-1-
|
|
53
|
+
queryAssignedElements({ selector: "sd-1-9-0-accordion" })
|
|
54
54
|
], SdAccordionGroup.prototype, "_accordionsInDefaultSlot", 2);
|
|
55
55
|
__decorateClass([
|
|
56
56
|
property({ attribute: "close-others", type: Boolean })
|
|
57
57
|
], SdAccordionGroup.prototype, "closeOthers", 2);
|
|
58
58
|
SdAccordionGroup = __decorateClass([
|
|
59
|
-
customElement("sd-1-
|
|
59
|
+
customElement("sd-1-9-0-accordion-group")
|
|
60
60
|
], SdAccordionGroup);
|
|
61
61
|
export {
|
|
62
62
|
SdAccordionGroup as default
|
|
@@ -122,7 +122,7 @@ __decorateClass([
|
|
|
122
122
|
state()
|
|
123
123
|
], SdBrandshape.prototype, "componentBreakpoint", 2);
|
|
124
124
|
SdBrandshape = __decorateClass([
|
|
125
|
-
customElement("sd-1-
|
|
125
|
+
customElement("sd-1-9-0-brandshape")
|
|
126
126
|
], SdBrandshape);
|
|
127
127
|
export {
|
|
128
128
|
SdBrandshape as default
|
|
@@ -190,19 +190,19 @@ let SdButton = class extends SolidElement {
|
|
|
190
190
|
md: "ml-2",
|
|
191
191
|
lg: "ml-2"
|
|
192
192
|
}[this.size]
|
|
193
|
-
)}"></slot>${this.loading ? html`<sd-1-
|
|
193
|
+
)}"></slot>${this.loading ? html`<sd-1-9-0-spinner class="${cx("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-1-9-0-spinner>` : ""}</${tag}>`;
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
SdButton.styles = [
|
|
197
197
|
componentStyles,
|
|
198
198
|
SolidElement.styles,
|
|
199
|
-
css`:host{display:inline-block;position:relative;width:auto;cursor:pointer}sd-1-
|
|
199
|
+
css`:host{display:inline-block;position:relative;width:auto;cursor:pointer}sd-1-9-0-spinner{--indicator-color:currentColor;--track-color:var(--tw-varcolor-200)}::slotted(sd-1-9-0-badge){position:absolute;top:0;right:0;translate:50% -50%;pointer-events:none}::slotted(sd-1-9-0-icon),sd-1-9-0-spinner{font-size:calc(var(--tw-varspacing)/ 2)}`
|
|
200
200
|
];
|
|
201
201
|
__decorateClass([
|
|
202
202
|
query("a, button")
|
|
203
203
|
], SdButton.prototype, "button", 2);
|
|
204
204
|
__decorateClass([
|
|
205
|
-
queryAssignedElements({ selector: "sd-1-
|
|
205
|
+
queryAssignedElements({ selector: "sd-1-9-0-icon" })
|
|
206
206
|
], SdButton.prototype, "_iconsInDefaultSlot", 2);
|
|
207
207
|
__decorateClass([
|
|
208
208
|
state()
|
|
@@ -265,7 +265,7 @@ __decorateClass([
|
|
|
265
265
|
watch("disabled", { waitUntilFirstUpdate: true })
|
|
266
266
|
], SdButton.prototype, "handleDisabledChange", 1);
|
|
267
267
|
SdButton = __decorateClass([
|
|
268
|
-
customElement("sd-1-
|
|
268
|
+
customElement("sd-1-9-0-button")
|
|
269
269
|
], SdButton);
|
|
270
270
|
export {
|
|
271
271
|
SdButton as default
|
|
@@ -34,7 +34,7 @@ let SdDivider = class extends SolidElement {
|
|
|
34
34
|
SdDivider.styles = [
|
|
35
35
|
componentStyles,
|
|
36
36
|
SolidElement.styles,
|
|
37
|
-
css`:host{margin:0}:host(sd-1-
|
|
37
|
+
css`:host{margin:0}:host(sd-1-9-0-divider[orientation=horizontal]){display:block}:host(sd-1-9-0-divider[orientation=vertical]){display:inline-block}`
|
|
38
38
|
];
|
|
39
39
|
__decorateClass([
|
|
40
40
|
property({ reflect: true })
|
|
@@ -43,7 +43,7 @@ __decorateClass([
|
|
|
43
43
|
property({ type: Boolean, reflect: true })
|
|
44
44
|
], SdDivider.prototype, "inverted", 2);
|
|
45
45
|
SdDivider = __decorateClass([
|
|
46
|
-
customElement("sd-1-
|
|
46
|
+
customElement("sd-1-9-0-divider")
|
|
47
47
|
], SdDivider);
|
|
48
48
|
export {
|
|
49
49
|
SdDivider as default
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import '../button/button';
|
|
2
|
+
import '../icon/icon';
|
|
3
|
+
import SolidElement from '../../internal/solid-element';
|
|
4
|
+
export default class SdDrawer extends SolidElement {
|
|
5
|
+
private readonly hasSlotController;
|
|
6
|
+
private readonly localize;
|
|
7
|
+
private modal;
|
|
8
|
+
private originalTrigger;
|
|
9
|
+
drawer: HTMLElement;
|
|
10
|
+
panel: HTMLElement;
|
|
11
|
+
overlay: HTMLElement;
|
|
12
|
+
open: boolean;
|
|
13
|
+
label: string;
|
|
14
|
+
placement: 'end' | 'start';
|
|
15
|
+
contained: boolean;
|
|
16
|
+
noHeader: boolean;
|
|
17
|
+
firstUpdated(): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
19
|
+
private requestClose;
|
|
20
|
+
private addOpenListeners;
|
|
21
|
+
private removeOpenListeners;
|
|
22
|
+
private handleDocumentKeyDown;
|
|
23
|
+
handleOpenChange(): Promise<void>;
|
|
24
|
+
handleNoModalChange(): void;
|
|
25
|
+
show(): Promise<void>;
|
|
26
|
+
hide(): Promise<void>;
|
|
27
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
28
|
+
static styles: import("lit").CSSResultGroup[];
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'sd-1-9-0-drawer': SdDrawer;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import "../button/button.js";
|
|
2
|
+
import "../icon/icon.js";
|
|
3
|
+
import { animateTo, stopAnimations } from "../../internal/animate.js";
|
|
4
|
+
import { css, html } from "lit";
|
|
5
|
+
import { query, property, customElement } from "lit/decorators.js";
|
|
6
|
+
import { setDefaultAnimation, getAnimation } from "../../utilities/animation-registry.js";
|
|
7
|
+
import { HasSlotController } from "../../internal/slot.js";
|
|
8
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
9
|
+
import { LocalizeController } from "../../utilities/localize.js";
|
|
10
|
+
import { lockBodyScrolling, unlockBodyScrolling } from "../../internal/scroll.js";
|
|
11
|
+
import { uppercaseFirstLetter } from "../../internal/string.js";
|
|
12
|
+
import { waitForEvent } from "../../internal/event.js";
|
|
13
|
+
import { watch } from "../../internal/watch.js";
|
|
14
|
+
import componentStyles from "../../styles/component.styles.js";
|
|
15
|
+
import cx from "classix";
|
|
16
|
+
import Modal from "../../internal/modal.js";
|
|
17
|
+
import SolidElement from "../../internal/solid-element.js";
|
|
18
|
+
var __defProp = Object.defineProperty;
|
|
19
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
21
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
22
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23
|
+
if (decorator = decorators[i])
|
|
24
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
25
|
+
if (kind && result)
|
|
26
|
+
__defProp(target, key, result);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
let SdDrawer = class extends SolidElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.hasSlotController = new HasSlotController(this, "footer");
|
|
33
|
+
this.localize = new LocalizeController(this);
|
|
34
|
+
this.modal = new Modal(this);
|
|
35
|
+
this.open = false;
|
|
36
|
+
this.label = "";
|
|
37
|
+
this.placement = "end";
|
|
38
|
+
this.contained = false;
|
|
39
|
+
this.noHeader = false;
|
|
40
|
+
this.handleDocumentKeyDown = (event) => {
|
|
41
|
+
if (this.open && event.key === "Escape") {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
this.requestClose("keyboard");
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
firstUpdated() {
|
|
48
|
+
this.drawer.hidden = !this.open;
|
|
49
|
+
if (this.open) {
|
|
50
|
+
this.addOpenListeners();
|
|
51
|
+
if (!this.contained) {
|
|
52
|
+
this.modal.activate();
|
|
53
|
+
lockBodyScrolling(this);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
super.disconnectedCallback();
|
|
59
|
+
unlockBodyScrolling(this);
|
|
60
|
+
}
|
|
61
|
+
requestClose(source) {
|
|
62
|
+
const slRequestClose = this.emit("sd-request-close", {
|
|
63
|
+
cancelable: true,
|
|
64
|
+
detail: { source }
|
|
65
|
+
});
|
|
66
|
+
if (slRequestClose.defaultPrevented) {
|
|
67
|
+
const animation = getAnimation(this, "drawer.denyClose", { dir: this.localize.dir() });
|
|
68
|
+
animateTo(this.panel, animation.keyframes, animation.options);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.hide();
|
|
72
|
+
}
|
|
73
|
+
addOpenListeners() {
|
|
74
|
+
document.addEventListener("keydown", this.handleDocumentKeyDown);
|
|
75
|
+
}
|
|
76
|
+
removeOpenListeners() {
|
|
77
|
+
document.removeEventListener("keydown", this.handleDocumentKeyDown);
|
|
78
|
+
}
|
|
79
|
+
async handleOpenChange() {
|
|
80
|
+
if (this.open) {
|
|
81
|
+
this.emit("sd-show");
|
|
82
|
+
this.addOpenListeners();
|
|
83
|
+
this.originalTrigger = document.activeElement;
|
|
84
|
+
if (!this.contained) {
|
|
85
|
+
this.modal.activate();
|
|
86
|
+
lockBodyScrolling(this);
|
|
87
|
+
}
|
|
88
|
+
const autoFocusTarget = this.querySelector("[autofocus]");
|
|
89
|
+
if (autoFocusTarget) {
|
|
90
|
+
autoFocusTarget.removeAttribute("autofocus");
|
|
91
|
+
}
|
|
92
|
+
await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);
|
|
93
|
+
this.drawer.hidden = false;
|
|
94
|
+
requestAnimationFrame(() => {
|
|
95
|
+
const sdInitialFocus = this.emit("sd-initial-focus", { cancelable: true });
|
|
96
|
+
if (!sdInitialFocus.defaultPrevented) {
|
|
97
|
+
if (autoFocusTarget) {
|
|
98
|
+
autoFocusTarget.focus({ preventScroll: true });
|
|
99
|
+
} else {
|
|
100
|
+
this.panel.focus({ preventScroll: true });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (autoFocusTarget) {
|
|
104
|
+
autoFocusTarget.setAttribute("autofocus", "");
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const panelAnimation = getAnimation(this, `drawer.show${uppercaseFirstLetter(this.placement)}`, {
|
|
108
|
+
dir: this.localize.dir()
|
|
109
|
+
});
|
|
110
|
+
const overlayAnimation = getAnimation(this, "drawer.overlay.show", { dir: this.localize.dir() });
|
|
111
|
+
await Promise.all([
|
|
112
|
+
animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),
|
|
113
|
+
animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)
|
|
114
|
+
]);
|
|
115
|
+
this.emit("sd-after-show");
|
|
116
|
+
} else {
|
|
117
|
+
this.emit("sd-hide");
|
|
118
|
+
this.removeOpenListeners();
|
|
119
|
+
if (!this.contained) {
|
|
120
|
+
this.modal.deactivate();
|
|
121
|
+
unlockBodyScrolling(this);
|
|
122
|
+
}
|
|
123
|
+
await Promise.all([stopAnimations(this.drawer), stopAnimations(this.overlay)]);
|
|
124
|
+
const panelAnimation = getAnimation(this, `drawer.hide${uppercaseFirstLetter(this.placement)}`, {
|
|
125
|
+
dir: this.localize.dir()
|
|
126
|
+
});
|
|
127
|
+
const overlayAnimation = getAnimation(this, "drawer.overlay.hide", { dir: this.localize.dir() });
|
|
128
|
+
await Promise.all([
|
|
129
|
+
animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {
|
|
130
|
+
this.overlay.hidden = true;
|
|
131
|
+
}),
|
|
132
|
+
animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {
|
|
133
|
+
this.panel.hidden = true;
|
|
134
|
+
})
|
|
135
|
+
]);
|
|
136
|
+
this.drawer.hidden = true;
|
|
137
|
+
this.overlay.hidden = false;
|
|
138
|
+
this.panel.hidden = false;
|
|
139
|
+
const trigger = this.originalTrigger;
|
|
140
|
+
if (typeof (trigger == null ? void 0 : trigger.focus) === "function") {
|
|
141
|
+
setTimeout(() => trigger.focus());
|
|
142
|
+
}
|
|
143
|
+
this.emit("sd-after-hide");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
handleNoModalChange() {
|
|
147
|
+
if (this.open && !this.contained) {
|
|
148
|
+
this.modal.activate();
|
|
149
|
+
lockBodyScrolling(this);
|
|
150
|
+
}
|
|
151
|
+
if (this.open && this.contained) {
|
|
152
|
+
this.modal.deactivate();
|
|
153
|
+
unlockBodyScrolling(this);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/** Shows the drawer. */
|
|
157
|
+
async show() {
|
|
158
|
+
if (this.open) {
|
|
159
|
+
return void 0;
|
|
160
|
+
}
|
|
161
|
+
this.open = true;
|
|
162
|
+
return waitForEvent(this, "sd-after-show");
|
|
163
|
+
}
|
|
164
|
+
/** Hides the drawer */
|
|
165
|
+
async hide() {
|
|
166
|
+
if (!this.open) {
|
|
167
|
+
return void 0;
|
|
168
|
+
}
|
|
169
|
+
this.open = false;
|
|
170
|
+
return waitForEvent(this, "sd-after-hide");
|
|
171
|
+
}
|
|
172
|
+
render() {
|
|
173
|
+
return html`<div part="base" class="${cx(
|
|
174
|
+
"top-0 start-0 w-full h-full pointer-events-none overflow-hidden",
|
|
175
|
+
this.contained ? "absolute" : "fixed"
|
|
176
|
+
)}"><div part="overlay" class="${cx(
|
|
177
|
+
"block top-0 left-0 right-0 bottom-0 bg-neutral-800/75 pointer-events-auto",
|
|
178
|
+
this.contained ? "absolute" : "fixed"
|
|
179
|
+
)}" @click="${() => this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${cx(
|
|
180
|
+
"absolute flex flex-col z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",
|
|
181
|
+
{
|
|
182
|
+
end: "top-0 end-0 bottom-auto start-auto w-[--width] h-full",
|
|
183
|
+
start: "top-0 end-auto bottom-auto start-0 w-[--width] h-full"
|
|
184
|
+
}[this.placement]
|
|
185
|
+
)}" role="dialog" aria-modal="true" aria-hidden="${this.open ? "false" : "true"}" aria-label="${this.label}" aria-labelledby="${ifDefined(!this.noHeader ? "title" : void 0)}" tabindex="0">${!this.noHeader ? html`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-1-9-0-button variant="tertiary" size="lg" part="close-button" @click="${() => this.requestClose("close-button")}"><sd-1-9-0-icon name="close" library="system"></sd-1-9-0-icon></sd-1-9-0-button></div></header>` : ""}<div part="body" class="flex-auto block px-4"><slot></slot></div><footer part="footer" class="${cx(this.hasSlotController.test("footer") ? "text-left p-4" : "hidden")}"><slot name="footer"></slot></footer></div></div>`;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
SdDrawer.styles = [
|
|
189
|
+
SolidElement.styles,
|
|
190
|
+
css`${componentStyles}:host{--width:25rem;display:contents}:host([contained]){z-index:initial}:host(:not([contained])){z-index:var(--sd-z-index-drawer)}[part=body]{-webkit-overflow-scrolling:touch;overflow-y:scroll;scrollbar-width:none}[part=body]::-webkit-scrollbar{width:0;height:0}`
|
|
191
|
+
];
|
|
192
|
+
__decorateClass([
|
|
193
|
+
query("[part=base]")
|
|
194
|
+
], SdDrawer.prototype, "drawer", 2);
|
|
195
|
+
__decorateClass([
|
|
196
|
+
query("[part=panel]")
|
|
197
|
+
], SdDrawer.prototype, "panel", 2);
|
|
198
|
+
__decorateClass([
|
|
199
|
+
query("[part=overlay]")
|
|
200
|
+
], SdDrawer.prototype, "overlay", 2);
|
|
201
|
+
__decorateClass([
|
|
202
|
+
property({ type: Boolean, reflect: true })
|
|
203
|
+
], SdDrawer.prototype, "open", 2);
|
|
204
|
+
__decorateClass([
|
|
205
|
+
property({ attribute: "label", reflect: true })
|
|
206
|
+
], SdDrawer.prototype, "label", 2);
|
|
207
|
+
__decorateClass([
|
|
208
|
+
property({ reflect: true })
|
|
209
|
+
], SdDrawer.prototype, "placement", 2);
|
|
210
|
+
__decorateClass([
|
|
211
|
+
property({ type: Boolean, reflect: true })
|
|
212
|
+
], SdDrawer.prototype, "contained", 2);
|
|
213
|
+
__decorateClass([
|
|
214
|
+
property({ attribute: "no-header", type: Boolean })
|
|
215
|
+
], SdDrawer.prototype, "noHeader", 2);
|
|
216
|
+
__decorateClass([
|
|
217
|
+
watch("open", { waitUntilFirstUpdate: true })
|
|
218
|
+
], SdDrawer.prototype, "handleOpenChange", 1);
|
|
219
|
+
__decorateClass([
|
|
220
|
+
watch("contained", { waitUntilFirstUpdate: true })
|
|
221
|
+
], SdDrawer.prototype, "handleNoModalChange", 1);
|
|
222
|
+
SdDrawer = __decorateClass([
|
|
223
|
+
customElement("sd-1-9-0-drawer")
|
|
224
|
+
], SdDrawer);
|
|
225
|
+
setDefaultAnimation("drawer.showStart", {
|
|
226
|
+
keyframes: [
|
|
227
|
+
{ opacity: 0, translate: "-100%" },
|
|
228
|
+
{ opacity: 1, translate: "0" }
|
|
229
|
+
],
|
|
230
|
+
rtlKeyframes: [
|
|
231
|
+
{ opacity: 0, translate: "100%" },
|
|
232
|
+
{ opacity: 1, translate: "0" }
|
|
233
|
+
],
|
|
234
|
+
options: { duration: 250, easing: "ease" }
|
|
235
|
+
});
|
|
236
|
+
setDefaultAnimation("drawer.hideStart", {
|
|
237
|
+
keyframes: [
|
|
238
|
+
{ opacity: 1, translate: "0" },
|
|
239
|
+
{ opacity: 0, translate: "-100%" }
|
|
240
|
+
],
|
|
241
|
+
rtlKeyframes: [
|
|
242
|
+
{ opacity: 1, translate: "0" },
|
|
243
|
+
{ opacity: 0, translate: "100%" }
|
|
244
|
+
],
|
|
245
|
+
options: { duration: 250, easing: "ease" }
|
|
246
|
+
});
|
|
247
|
+
setDefaultAnimation("drawer.showEnd", {
|
|
248
|
+
keyframes: [
|
|
249
|
+
{ opacity: 0, translate: "100%" },
|
|
250
|
+
{ opacity: 1, translate: "0" }
|
|
251
|
+
],
|
|
252
|
+
rtlKeyframes: [
|
|
253
|
+
{ opacity: 0, translate: "-100%" },
|
|
254
|
+
{ opacity: 1, translate: "0" }
|
|
255
|
+
],
|
|
256
|
+
options: { duration: 250, easing: "ease" }
|
|
257
|
+
});
|
|
258
|
+
setDefaultAnimation("drawer.hideEnd", {
|
|
259
|
+
keyframes: [
|
|
260
|
+
{ opacity: 1, translate: "0" },
|
|
261
|
+
{ opacity: 0, translate: "100%" }
|
|
262
|
+
],
|
|
263
|
+
rtlKeyframes: [
|
|
264
|
+
{ opacity: 1, translate: "0" },
|
|
265
|
+
{ opacity: 0, translate: "-100%" }
|
|
266
|
+
],
|
|
267
|
+
options: { duration: 250, easing: "ease" }
|
|
268
|
+
});
|
|
269
|
+
setDefaultAnimation("drawer.denyClose", {
|
|
270
|
+
keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],
|
|
271
|
+
options: { duration: 250 }
|
|
272
|
+
});
|
|
273
|
+
setDefaultAnimation("drawer.overlay.show", {
|
|
274
|
+
keyframes: [{ opacity: 0 }, { opacity: 1 }],
|
|
275
|
+
options: { duration: 250 }
|
|
276
|
+
});
|
|
277
|
+
setDefaultAnimation("drawer.overlay.hide", {
|
|
278
|
+
keyframes: [{ opacity: 1 }, { opacity: 0 }],
|
|
279
|
+
options: { duration: 250 }
|
|
280
|
+
});
|
|
281
|
+
export {
|
|
282
|
+
SdDrawer as default
|
|
283
|
+
};
|
|
@@ -169,7 +169,7 @@ let SdDropdown = class extends SolidElement {
|
|
|
169
169
|
// that gets slotted in) so screen readers will understand them. The accessible trigger could be the slotted element,
|
|
170
170
|
// a child of the slotted element, or an element in the slotted element's shadow root.
|
|
171
171
|
//
|
|
172
|
-
// For example, the accessible trigger of an <sd-1-
|
|
172
|
+
// For example, the accessible trigger of an <sd-1-9-0-button> is a <button> located inside its shadow root.
|
|
173
173
|
//
|
|
174
174
|
// To determine this, we assume the first tabbable element in the trigger slot is the "accessible trigger."
|
|
175
175
|
//
|
|
@@ -179,8 +179,8 @@ let SdDropdown = class extends SolidElement {
|
|
|
179
179
|
let target;
|
|
180
180
|
if (accessibleTrigger) {
|
|
181
181
|
switch (accessibleTrigger.tagName.toLowerCase()) {
|
|
182
|
-
case "sd-1-
|
|
183
|
-
case "sd-1-
|
|
182
|
+
case "sd-1-9-0-button":
|
|
183
|
+
case "sd-1-9-0-icon-button":
|
|
184
184
|
target = accessibleTrigger.button;
|
|
185
185
|
break;
|
|
186
186
|
default:
|
|
@@ -256,11 +256,11 @@ let SdDropdown = class extends SolidElement {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
render() {
|
|
259
|
-
return html`<sd-1-
|
|
259
|
+
return html`<sd-1-9-0-popup part="base" id="dropdown" placement="${this.placement}" distance="${this.rounded && this.distance < 1 ? 1 : this.distance}" skidding="${this.skidding}" strategy="${this.hoist ? "fixed" : "absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10" ?active="${this.open}"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${cx(
|
|
260
260
|
"shadow bg-white",
|
|
261
261
|
this.open ? "block pointer-events-auto" : "pointer-events-none",
|
|
262
262
|
this.rounded && "rounded-md"
|
|
263
|
-
)}" aria-hidden="${this.open ? "false" : "true"}" aria-labelledby="dropdown"></slot></sd-1-
|
|
263
|
+
)}" aria-hidden="${this.open ? "false" : "true"}" aria-labelledby="dropdown"></slot></sd-1-9-0-popup>`;
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
266
|
SdDropdown.styles = [
|
|
@@ -314,7 +314,7 @@ __decorateClass([
|
|
|
314
314
|
watch("open", { waitUntilFirstUpdate: true })
|
|
315
315
|
], SdDropdown.prototype, "handleOpenChange", 1);
|
|
316
316
|
SdDropdown = __decorateClass([
|
|
317
|
-
customElement("sd-1-
|
|
317
|
+
customElement("sd-1-9-0-dropdown")
|
|
318
318
|
], SdDropdown);
|
|
319
319
|
setDefaultAnimation("dropdown.show", {
|
|
320
320
|
keyframes: [
|
|
@@ -8,7 +8,12 @@ const icons = {
|
|
|
8
8
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
9
9
|
<path d="M12.743 6.333c-0.188-0.195-0.452-0.316-0.743-0.316s-0.555 0.121-0.743 0.315l-0 0-9 10c-0.137 0.17-0.22 0.388-0.22 0.626 0 0.552 0.448 1 1 1 0.276 0 0.526-0.112 0.707-0.293v0l8.257-9.173 8.257 9.173c0.181 0.181 0.431 0.292 0.707 0.292 0.552 0 1-0.448 1-1 0-0.238-0.083-0.456-0.222-0.628l0.001 0.002z"></path>
|
|
10
10
|
</svg>
|
|
11
|
-
|
|
11
|
+
`,
|
|
12
|
+
close: `
|
|
13
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
14
|
+
<path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>
|
|
15
|
+
</svg>
|
|
16
|
+
`
|
|
12
17
|
};
|
|
13
18
|
const systemLibrary = {
|
|
14
19
|
name: "system",
|
|
@@ -76,7 +76,7 @@ let SdLink = class extends SolidElement {
|
|
|
76
76
|
};
|
|
77
77
|
SdLink.styles = [
|
|
78
78
|
SolidElement.styles,
|
|
79
|
-
css`::slotted(sd-1-
|
|
79
|
+
css`::slotted(sd-1-9-0-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-1-9-0-icon){font-size:1rem}:host([size=lg][standalone]) ::slotted(sd-1-9-0-icon){font-size:1.5rem}`
|
|
80
80
|
];
|
|
81
81
|
__decorateClass([
|
|
82
82
|
query("a")
|
|
@@ -100,7 +100,7 @@ __decorateClass([
|
|
|
100
100
|
property()
|
|
101
101
|
], SdLink.prototype, "download", 2);
|
|
102
102
|
SdLink = __decorateClass([
|
|
103
|
-
customElement("sd-1-
|
|
103
|
+
customElement("sd-1-9-0-link")
|
|
104
104
|
], SdLink);
|
|
105
105
|
export {
|
|
106
106
|
SdLink as default
|
|
@@ -311,7 +311,7 @@ __decorateClass([
|
|
|
311
311
|
property({ attribute: "auto-size-padding", type: Number })
|
|
312
312
|
], SdPopup.prototype, "autoSizePadding", 2);
|
|
313
313
|
SdPopup = __decorateClass([
|
|
314
|
-
customElement("sd-1-
|
|
314
|
+
customElement("sd-1-9-0-popup")
|
|
315
315
|
], SdPopup);
|
|
316
316
|
export {
|
|
317
317
|
SdPopup as default
|
|
@@ -90,7 +90,7 @@ class FormControlController {
|
|
|
90
90
|
const disabled = this.options.disabled(this.host);
|
|
91
91
|
const name = this.options.name(this.host);
|
|
92
92
|
const value = this.options.value(this.host);
|
|
93
|
-
const isButton = this.host.tagName.toLowerCase() === "sd-1-
|
|
93
|
+
const isButton = this.host.tagName.toLowerCase() === "sd-1-9-0-button";
|
|
94
94
|
if (!disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
|
|
95
95
|
if (Array.isArray(value)) {
|
|
96
96
|
value.forEach((val) => {
|