@skf-design-system/ui-components 1.0.2-beta.1 → 1.0.2-beta.11
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/README.md +25 -1
- package/dist/components/accordion/accordion-item.component.js +49 -38
- package/dist/components/accordion/accordion.component.d.ts +2 -2
- package/dist/components/accordion/accordion.component.js +12 -12
- package/dist/components/alert/alert.component.d.ts +8 -3
- package/dist/components/alert/alert.component.js +59 -50
- package/dist/components/alert/alert.styles.js +51 -47
- package/dist/components/breadcrumb/breadcrumb-item.component.js +30 -32
- package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
- package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
- package/dist/components/button/button.component.js +63 -67
- package/dist/components/button/button.styles.js +5 -4
- package/dist/components/card/card.component.d.ts +5 -0
- package/dist/components/card/card.component.js +46 -24
- package/dist/components/card/card.styles.js +31 -14
- package/dist/components/checkbox/checkbox.component.d.ts +6 -5
- package/dist/components/checkbox/checkbox.component.js +67 -69
- package/dist/components/checkbox/checkbox.styles.js +1 -1
- package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +8 -1
- package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +109 -115
- package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
- package/dist/components/datepicker/datepicker-calendar.js +6 -0
- package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +9 -20
- package/dist/components/datepicker/datepicker-popup.component.js +272 -0
- package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
- package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
- package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
- package/dist/components/datepicker/datepicker-popup.js +6 -0
- package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
- package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +21 -14
- package/dist/components/datepicker/datepicker.component.js +455 -0
- package/dist/components/datepicker/datepicker.d.ts +8 -0
- package/dist/components/datepicker/datepicker.js +6 -0
- package/dist/components/dialog/dialog.component.d.ts +3 -2
- package/dist/components/dialog/dialog.component.js +49 -49
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/divider/divider.component.d.ts +3 -0
- package/dist/components/divider/divider.component.js +43 -22
- package/dist/components/divider/divider.styles.js +9 -9
- package/dist/components/drawer/drawer.component.d.ts +12 -4
- package/dist/components/drawer/drawer.component.js +84 -61
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.styles.js +47 -40
- package/dist/components/header/header.component.d.ts +4 -2
- package/dist/components/header/header.component.js +64 -57
- package/dist/components/header/header.d.ts +2 -2
- package/dist/components/header/header.styles.js +2 -2
- package/dist/components/heading/heading.component.d.ts +5 -1
- package/dist/components/heading/heading.component.js +54 -27
- package/dist/components/heading/heading.styles.js +34 -36
- package/dist/components/icon/icon.component.d.ts +4 -0
- package/dist/components/icon/icon.component.js +62 -43
- package/dist/components/icon/icon.styles.js +60 -60
- package/dist/components/input/input.component.d.ts +4 -8
- package/dist/components/input/input.component.js +90 -97
- package/dist/components/input/input.controllers.d.ts +0 -1
- package/dist/components/input/input.controllers.js +14 -19
- package/dist/components/link/link.component.d.ts +16 -18
- package/dist/components/link/link.component.js +109 -106
- package/dist/components/link/link.styles.js +49 -45
- package/dist/components/loader/loader.component.d.ts +5 -3
- package/dist/components/loader/loader.component.js +39 -28
- package/dist/components/loader/loader.styles.js +6 -10
- package/dist/components/logo/logo.component.d.ts +4 -1
- package/dist/components/logo/logo.component.js +55 -51
- package/dist/components/logo/logo.styles.js +26 -16
- package/dist/components/menu/menu-item.component.d.ts +1 -1
- package/dist/components/menu/menu-item.component.js +8 -8
- package/dist/components/menu/menu-item.d.ts +2 -2
- package/dist/components/menu/menu-item.styles.js +13 -9
- package/dist/components/menu/menu.component.d.ts +5 -2
- package/dist/components/menu/menu.component.js +8 -8
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/nav/nav-item.component.d.ts +6 -2
- package/dist/components/nav/nav-item.component.js +44 -25
- package/dist/components/nav/nav-item.styles.js +29 -25
- package/dist/components/nav/nav.component.d.ts +9 -0
- package/dist/components/nav/nav.component.js +47 -21
- package/dist/components/nav/nav.d.ts +2 -2
- package/dist/components/nav/nav.styles.js +15 -9
- package/dist/components/popover/popover.component.d.ts +10 -3
- package/dist/components/popover/popover.component.js +30 -22
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/progress.component.d.ts +2 -0
- package/dist/components/progress/progress.component.js +38 -29
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.styles.js +10 -8
- package/dist/components/radio/radio.component.d.ts +4 -2
- package/dist/components/radio/radio.component.js +96 -91
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
- package/dist/components/segmented-button/segmented-button-item.d.ts +2 -2
- package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button.component.js +22 -24
- package/dist/components/segmented-button/segmented-button.d.ts +2 -2
- package/dist/components/select/select-option-group.component.d.ts +4 -0
- package/dist/components/select/select-option-group.component.js +37 -18
- package/dist/components/select/select-option-group.d.ts +2 -2
- package/dist/components/select/select-option-group.style.js +12 -6
- package/dist/components/select/select-option.component.d.ts +9 -4
- package/dist/components/select/select-option.component.js +70 -58
- package/dist/components/select/select-option.styles.js +43 -31
- package/dist/components/select/select.component.d.ts +21 -12
- package/dist/components/select/select.component.js +125 -87
- package/dist/components/select/select.controllers.js +15 -20
- package/dist/components/select/select.styles.js +8 -2
- package/dist/components/stepper/stepper-item.component.d.ts +1 -1
- package/dist/components/stepper/stepper-item.component.js +59 -56
- package/dist/components/stepper/stepper-item.d.ts +2 -2
- package/dist/components/stepper/stepper-item.styles.js +4 -4
- package/dist/components/stepper/stepper.component.js +2 -3
- package/dist/components/stepper/stepper.d.ts +2 -2
- package/dist/components/stepper/stepper.helpers.js +6 -7
- package/dist/components/switch/switch.component.d.ts +4 -2
- package/dist/components/switch/switch.component.js +64 -58
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +39 -0
- package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.component.d.ts +3 -3
- package/dist/components/{tab → tabs}/tab.component.js +17 -14
- package/dist/components/{tab → tabs}/tab.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.styles.js +2 -2
- package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
- package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +35 -36
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
- package/dist/components/tag/tag.component.d.ts +10 -2
- package/dist/components/tag/tag.component.js +77 -65
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.styles.js +63 -50
- package/dist/components/textarea/textarea.component.d.ts +4 -2
- package/dist/components/textarea/textarea.component.js +102 -95
- package/dist/components/toast/toast-item.styles.js +13 -10
- package/dist/components/toast/toast.component.js +9 -9
- package/dist/components/toast/toast.singleton.d.ts +1 -1
- package/dist/components/toast/toast.singleton.js +19 -20
- package/dist/components/tooltip/tooltip.component.d.ts +9 -2
- package/dist/components/tooltip/tooltip.component.js +15 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/custom-elements.json +1699 -1112
- package/dist/index.d.ts +8 -7
- package/dist/index.js +96 -93
- package/dist/internal/base-classes/popover/popover.base.d.ts +24 -5
- package/dist/internal/base-classes/popover/popover.base.js +41 -44
- package/dist/internal/base-classes/popover/popover.styles.js +4 -5
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -19
- package/dist/internal/components/hint/hint.component.d.ts +4 -0
- package/dist/internal/components/hint/hint.component.js +47 -20
- package/dist/internal/components/hint/hint.styles.js +29 -25
- package/dist/internal/components/skf-element.d.ts +1 -3
- package/dist/internal/components/skf-element.js +4 -9
- package/dist/internal/controllers/popover.controller.d.ts +2 -0
- package/dist/internal/controllers/popover.controller.js +11 -14
- package/dist/internal/helpers/stateMap.d.ts +14 -0
- package/dist/internal/helpers/stateMap.js +68 -0
- package/dist/internal/helpers/uuid.d.ts +8 -10
- package/dist/internal/helpers/uuid.js +4 -11
- package/dist/internal/helpers/watch.d.ts +1 -1
- package/dist/internal/helpers/watch.js +12 -12
- package/dist/internal/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +4 -4
- package/dist/internal/types.d.ts +4 -0
- package/dist/styles/component.styles.js +37 -36
- package/dist/styles/global-alt.css +1 -0
- package/dist/styles/global.css +1 -1
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +27 -0
- package/dist/translations/es.d.ts +3 -0
- package/dist/translations/es.js +27 -0
- package/dist/translations/index.d.ts +4 -0
- package/dist/translations/pt.d.ts +3 -0
- package/dist/translations/pt.js +27 -0
- package/dist/translations/sv.d.ts +3 -0
- package/dist/translations/sv.js +27 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +1990 -866
- package/dist/types/vue/index.d.ts +220 -169
- package/dist/utilities/localize.d.ts +28 -0
- package/dist/utilities/localize.js +13 -0
- package/dist/vscode.html-custom-data.json +265 -188
- package/dist/web-types.json +731 -548
- package/package.json +39 -51
- package/dist/components/accordion/accordion-item.test.d.ts +0 -1
- package/dist/components/accordion/accordion.test.d.ts +0 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- package/dist/components/date-picker/datepicker.component.js +0 -261
- package/dist/components/date-picker/datepicker.d.ts +0 -10
- package/dist/components/date-picker/datepicker.helpers.js +0 -76
- package/dist/components/date-picker/datepicker.js +0 -8
- package/dist/components/date-picker-input/datepicker-input.component.js +0 -442
- package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
- package/dist/components/date-picker-input/datepicker-input.js +0 -6
- package/dist/components/input/input.test.d.ts +0 -1
- package/dist/components/radio/radio.test.d.ts +0 -1
- package/dist/components/switch/switch.test.d.ts +0 -1
- package/dist/components/tab-group/tab-group.d.ts +0 -8
- package/dist/components/tab-group/tab-group.js +0 -6
- package/dist/components/tab-panel/tab-panel.component.js +0 -36
- package/dist/internal/playwright/index.d.ts +0 -1
- /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
- /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
- /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
- /package/dist/components/select/{select.stories.icons.d.ts → stories/select.stories.icons.d.ts} +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
- /package/dist/components/{tab → tabs}/tab.js +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
- /package/dist/components/{tab-group/tab-group.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
@@ -1,50 +1,51 @@
|
|
1
|
-
var
|
1
|
+
var _ = (e) => {
|
2
2
|
throw TypeError(e);
|
3
3
|
};
|
4
|
-
var
|
5
|
-
var
|
4
|
+
var $ = (e, i, t) => i.has(e) || _("Cannot " + t);
|
5
|
+
var c = (e, i, t) => ($(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (e, i, t) => i.has(e) ? _("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), d = (e, i, t, o) => ($(e, i, "write to private field"), o ? o.call(e, t) : i.set(e, t), t);
|
6
6
|
import "../button/button.js";
|
7
7
|
import "../heading/heading.js";
|
8
8
|
import "../icon/icon.js";
|
9
|
-
import { SkfElement as
|
10
|
-
import { watch as
|
9
|
+
import { SkfElement as b } from "../../internal/components/skf-element.js";
|
10
|
+
import { watch as k } from "../../internal/helpers/watch.js";
|
11
11
|
import { componentStyles as B } from "../../styles/component.styles.js";
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import {
|
16
|
-
|
17
|
-
|
12
|
+
import { LocalizeController as P } from "../../utilities/localize.js";
|
13
|
+
import { nothing as E, html as w } from "lit";
|
14
|
+
import { property as h, state as v, query as O, queryAssignedElements as x } from "lit/decorators.js";
|
15
|
+
import { classMap as C } from "lit/directives/class-map.js";
|
16
|
+
import { styles as D } from "./dialog.styles.js";
|
17
|
+
var F = Object.defineProperty, M = Object.getOwnPropertyDescriptor, n = (e, i, t, o) => {
|
18
|
+
for (var l = o > 1 ? void 0 : o ? M(i, t) : i, a = e.length - 1, r; a >= 0; a--)
|
18
19
|
(r = e[a]) && (l = (o ? r(i, t, l) : r(l)) || l);
|
19
|
-
return o && l &&
|
20
|
-
},
|
21
|
-
const
|
20
|
+
return o && l && F(i, t, l), l;
|
21
|
+
}, g, u, y, p;
|
22
|
+
const m = class m extends b {
|
22
23
|
constructor() {
|
23
24
|
super(...arguments);
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
f(this, g);
|
26
|
+
f(this, u);
|
27
|
+
f(this, y);
|
28
|
+
f(this, p);
|
29
|
+
d(this, g, new P(this)), d(this, u, 0), d(this, y, 20), d(this, p, !1), this.fullscreen = !1, this.lang = "en", this.noCloseButton = !1, this.noPadding = !1, this.open = !1, this.onClose = null, this.renderFoot = !1, this._handleBackdropClick = (t) => {
|
28
30
|
t.target === this.$dialog && this.close();
|
29
31
|
}, this._handleClose = (t) => {
|
30
32
|
this.onClose && this.onClose(t), this.close();
|
31
33
|
}, this._handleKeyDown = (t) => {
|
32
|
-
t.
|
34
|
+
t.key === "Escape" && (t.preventDefault(), this.close());
|
33
35
|
};
|
34
36
|
}
|
35
37
|
handleOpenChange() {
|
36
|
-
|
37
|
-
this.open ? this.showModal() : this.close(), this.open && (this.renderFoot = !!((t = this.footerEls) != null && t.length));
|
38
|
+
this.open ? this.showModal() : this.close(), this.open && (this.renderFoot = !!this.footerEls?.length);
|
38
39
|
}
|
39
40
|
firstUpdated() {
|
40
|
-
this.$dialog && this.$dialog.addEventListener("close", (t) => {
|
41
|
+
this.$dialog && (this.open && this.handleOpenChange(), this.$dialog.addEventListener("close", (t) => {
|
41
42
|
t.stopPropagation(), this.emit("skf-dialog-closed");
|
42
|
-
});
|
43
|
+
}));
|
43
44
|
}
|
44
45
|
/** @internal */
|
45
46
|
_transition() {
|
46
47
|
const t = this.fullscreen ? {} : {
|
47
|
-
translate: `${String(
|
48
|
+
translate: `${String(c(this, u))} ${String(c(this, y))}px`
|
48
49
|
};
|
49
50
|
return { entry: () => new Promise((a) => {
|
50
51
|
if (!this.$dialog) {
|
@@ -103,29 +104,28 @@ const y = class y extends C {
|
|
103
104
|
/** Method that opens the dialog in modal state */
|
104
105
|
async showModal() {
|
105
106
|
async function t(o) {
|
106
|
-
return o.$dialog ? (o.$dialog.showModal(), await o._transition().entry(), o.emit("skf-dialog-opened"), !0) : !1;
|
107
|
+
return o.$dialog ? (o.open = !0, o.$dialog.showModal(), await o._transition().entry(), o.emit("skf-dialog-opened"), !0) : !1;
|
107
108
|
}
|
108
109
|
return await t(this);
|
109
110
|
}
|
110
111
|
/** Method that closes the dialog */
|
111
112
|
async close() {
|
112
|
-
if (
|
113
|
-
|
113
|
+
if (c(this, p) || !this.open) return;
|
114
|
+
d(this, p, !0);
|
114
115
|
async function t(o) {
|
115
|
-
return o.$dialog ? (o.emit("skf-dialog-closing"), await o._transition().exit(), o.$dialog.close(), o.open = !1,
|
116
|
+
return o.$dialog ? (o.emit("skf-dialog-closing"), await o._transition().exit(), o.$dialog.close(), o.open = !1, d(o, p, !1), !0) : !1;
|
116
117
|
}
|
117
118
|
return await t(this);
|
118
119
|
}
|
119
120
|
render() {
|
120
|
-
return
|
121
|
+
return w`
|
121
122
|
<dialog
|
122
123
|
@close=${this._handleClose}
|
123
124
|
@mousedown=${this._handleBackdropClick}
|
124
125
|
@touchstart=${this._handleBackdropClick}
|
125
126
|
@keydown=${this._handleKeyDown}
|
126
127
|
aria-modal="true"
|
127
|
-
|
128
|
-
class=${w({
|
128
|
+
class=${C({
|
129
129
|
dialog: !0,
|
130
130
|
"dialog--fullscreen": this.fullscreen,
|
131
131
|
"dialog--no-padding": this.noPadding
|
@@ -133,10 +133,10 @@ const y = class y extends C {
|
|
133
133
|
>
|
134
134
|
<div class="dialog__head">
|
135
135
|
<h2 class="dialog__heading">${this.heading}</h2>
|
136
|
-
${this.noCloseButton ?
|
136
|
+
${this.noCloseButton ? E : w`
|
137
137
|
<button
|
138
138
|
@click=${this._handleClose}
|
139
|
-
aria-label=${this.
|
139
|
+
aria-label=${c(this, g).term("close")}
|
140
140
|
class="dialog__close-btn"
|
141
141
|
>
|
142
142
|
<skf-icon name="close" color="inverse"></skf-icon>
|
@@ -146,7 +146,7 @@ const y = class y extends C {
|
|
146
146
|
<div class="dialog__body">
|
147
147
|
<slot class="dialog__main"></slot>
|
148
148
|
<slot
|
149
|
-
class=${
|
149
|
+
class=${C({
|
150
150
|
dialog__foot: !0,
|
151
151
|
"dialog__foot--hidden": !this.renderFoot
|
152
152
|
})}
|
@@ -157,40 +157,40 @@ const y = class y extends C {
|
|
157
157
|
`;
|
158
158
|
}
|
159
159
|
};
|
160
|
-
|
161
|
-
let s =
|
160
|
+
g = new WeakMap(), u = new WeakMap(), y = new WeakMap(), p = new WeakMap(), m.styles = [B, D];
|
161
|
+
let s = m;
|
162
162
|
n([
|
163
|
-
|
164
|
-
], s.prototype, "closeButtonAriaLabel", 2);
|
165
|
-
n([
|
166
|
-
c()
|
163
|
+
h()
|
167
164
|
], s.prototype, "heading", 2);
|
168
165
|
n([
|
169
|
-
|
166
|
+
h({ type: Boolean })
|
170
167
|
], s.prototype, "fullscreen", 2);
|
171
168
|
n([
|
172
|
-
|
169
|
+
h({ type: String })
|
170
|
+
], s.prototype, "lang", 2);
|
171
|
+
n([
|
172
|
+
h({ type: Boolean, attribute: "no-close-button" })
|
173
173
|
], s.prototype, "noCloseButton", 2);
|
174
174
|
n([
|
175
|
-
|
175
|
+
h({ type: Boolean, attribute: "no-padding" })
|
176
176
|
], s.prototype, "noPadding", 2);
|
177
177
|
n([
|
178
|
-
|
178
|
+
h({ type: Boolean, reflect: !0 })
|
179
179
|
], s.prototype, "open", 2);
|
180
180
|
n([
|
181
|
-
|
181
|
+
v()
|
182
182
|
], s.prototype, "onClose", 2);
|
183
183
|
n([
|
184
|
-
|
184
|
+
v()
|
185
185
|
], s.prototype, "renderFoot", 2);
|
186
186
|
n([
|
187
|
-
|
187
|
+
O("dialog")
|
188
188
|
], s.prototype, "$dialog", 2);
|
189
189
|
n([
|
190
|
-
|
190
|
+
x({ slot: "footer" })
|
191
191
|
], s.prototype, "footerEls", 2);
|
192
192
|
n([
|
193
|
-
|
193
|
+
k("open")
|
194
194
|
], s.prototype, "handleOpenChange", 1);
|
195
195
|
export {
|
196
196
|
s as SkfDialog
|
@@ -13,6 +13,7 @@ type SkfDividerColor = BorderColor;
|
|
13
13
|
* @tagname skf-divider
|
14
14
|
*/
|
15
15
|
export declare class SkfDivider extends SkfElement {
|
16
|
+
#private;
|
16
17
|
static styles: CSSResultGroup;
|
17
18
|
/** Defines the Divider color */
|
18
19
|
color: SkfDividerColor;
|
@@ -21,5 +22,7 @@ export declare class SkfDivider extends SkfElement {
|
|
21
22
|
/** If true, renders the divider vertically */
|
22
23
|
vertical: boolean;
|
23
24
|
connectedCallback(): void;
|
25
|
+
/** @internal */
|
26
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
24
27
|
}
|
25
28
|
export {};
|
@@ -1,32 +1,53 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
var _ = (t) => {
|
2
|
+
throw TypeError(t);
|
3
|
+
};
|
4
|
+
var d = (t, e, r) => e.has(t) || _("Cannot " + r);
|
5
|
+
var h = (t, e, r) => (d(t, e, "read from private field"), r ? r.call(t) : e.get(t)), m = (t, e, r) => e.has(t) ? _("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), y = (t, e, r, a) => (d(t, e, "write to private field"), a ? a.call(t, r) : e.set(t, r), r);
|
6
|
+
import { SkfElement as O } from "../../internal/components/skf-element.js";
|
7
|
+
import { stateMap as b } from "../../internal/helpers/stateMap.js";
|
8
|
+
import { watch as g } from "../../internal/helpers/watch.js";
|
9
|
+
import { componentStyles as C } from "../../styles/component.styles.js";
|
3
10
|
import "lit";
|
4
|
-
import { property as
|
5
|
-
import { styles as
|
6
|
-
var
|
7
|
-
for (var
|
8
|
-
(
|
9
|
-
return
|
11
|
+
import { property as v } from "lit/decorators.js";
|
12
|
+
import { styles as P } from "./divider.styles.js";
|
13
|
+
var j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, c = (t, e, r, a) => {
|
14
|
+
for (var o = a > 1 ? void 0 : a ? w(e, r) : e, l = t.length - 1, n; l >= 0; l--)
|
15
|
+
(n = t[l]) && (o = (a ? n(e, r, o) : n(o)) || o);
|
16
|
+
return a && o && j(e, r, o), o;
|
17
|
+
};
|
18
|
+
const u = {
|
19
|
+
color: ["emphasized", "inverse", "primary", "secondary", "tertiary"],
|
20
|
+
vertical: "vertical"
|
10
21
|
};
|
11
|
-
|
22
|
+
var i, p;
|
23
|
+
const f = class f extends O {
|
12
24
|
constructor() {
|
13
|
-
super(...arguments)
|
25
|
+
super(...arguments);
|
26
|
+
m(this, i);
|
27
|
+
m(this, p);
|
28
|
+
y(this, i, this.attachInternals()), y(this, p, h(this, i).states), this.color = "primary", this.decorative = !1, this.vertical = !1;
|
14
29
|
}
|
15
30
|
connectedCallback() {
|
16
31
|
super.connectedCallback(), this.role = this.decorative ? "generic" : "separator", this.ariaOrientation = this.vertical ? "vertical" : "horizontal";
|
17
32
|
}
|
33
|
+
_handleStateChange(r, a, o) {
|
34
|
+
b(h(this, p), u[r]).set(o);
|
35
|
+
}
|
18
36
|
};
|
19
|
-
i.styles = [
|
20
|
-
let
|
21
|
-
|
22
|
-
|
23
|
-
],
|
24
|
-
|
25
|
-
|
26
|
-
],
|
27
|
-
|
28
|
-
|
29
|
-
],
|
37
|
+
i = new WeakMap(), p = new WeakMap(), f.styles = [C, P];
|
38
|
+
let s = f;
|
39
|
+
c([
|
40
|
+
v({ type: String })
|
41
|
+
], s.prototype, "color", 2);
|
42
|
+
c([
|
43
|
+
v({ type: Boolean })
|
44
|
+
], s.prototype, "decorative", 2);
|
45
|
+
c([
|
46
|
+
v({ type: Boolean })
|
47
|
+
], s.prototype, "vertical", 2);
|
48
|
+
c([
|
49
|
+
g(Object.keys(u))
|
50
|
+
], s.prototype, "_handleStateChange", 1);
|
30
51
|
export {
|
31
|
-
|
52
|
+
s as SkfDivider
|
32
53
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
2
|
+
const o = r`
|
3
3
|
@layer components {
|
4
4
|
@layer base {
|
5
5
|
:host {
|
@@ -9,7 +9,7 @@ const e = r`
|
|
9
9
|
display: block;
|
10
10
|
}
|
11
11
|
|
12
|
-
:host(:not(
|
12
|
+
:host(:not(:state(vertical))) {
|
13
13
|
border-top: var(--_skf-divider-border);
|
14
14
|
margin-block: var(--skf-divider-spacing, var(--skf-spacing-100));
|
15
15
|
margin-inline: var(--skf-divider-inset, 0);
|
@@ -17,31 +17,31 @@ const e = r`
|
|
17
17
|
}
|
18
18
|
|
19
19
|
@layer mods {
|
20
|
-
:host(
|
20
|
+
:host(:state(vertical)) {
|
21
21
|
block-size: 100%;
|
22
22
|
border-left: var(--_skf-divider-border);
|
23
23
|
margin-block: var(--skf-divider-inset, 0);
|
24
24
|
margin-inline: var(--skf-divider-spacing, var(--skf-spacing-100));
|
25
25
|
}
|
26
26
|
|
27
|
-
:host(
|
28
|
-
--_skf-divider-border-color: var(--skf-border-color-
|
27
|
+
:host(:state(emphasized)) {
|
28
|
+
--_skf-divider-border-color: var(--skf-border-color-emphasized);
|
29
29
|
}
|
30
30
|
|
31
|
-
:host(
|
31
|
+
:host(:state(inverse)) {
|
32
32
|
--_skf-divider-border-color: var(--skf-border-color-inverse);
|
33
33
|
}
|
34
34
|
|
35
|
-
:host(
|
35
|
+
:host(:state(secondary)) {
|
36
36
|
--_skf-divider-border-color: var(--skf-border-color-secondary);
|
37
37
|
}
|
38
38
|
|
39
|
-
:host(
|
39
|
+
:host(:state(tertiary)) {
|
40
40
|
--_skf-divider-border-color: var(--skf-border-color-tertiary);
|
41
41
|
}
|
42
42
|
}
|
43
43
|
}
|
44
44
|
`;
|
45
45
|
export {
|
46
|
-
|
46
|
+
o as styles
|
47
47
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import '../icon/icon.js';
|
2
2
|
import { SkfElement } from '../../internal/components/skf-element';
|
3
|
+
import { type Language } from '../../utilities/localize.js';
|
3
4
|
import { type CSSResultGroup } from 'lit';
|
4
5
|
/**
|
5
6
|
* TODO:
|
@@ -8,6 +9,8 @@ import { type CSSResultGroup } from 'lit';
|
|
8
9
|
* - add tests
|
9
10
|
* - add documentation
|
10
11
|
*/
|
12
|
+
type Placement = 'left' | 'right';
|
13
|
+
type Size = 'sm' | 'md' | 'lg';
|
11
14
|
/**
|
12
15
|
* The `<skf-drawer>` is a modal component that displays content and toggle by sliding from left/right viewport edge
|
13
16
|
*
|
@@ -22,25 +25,29 @@ import { type CSSResultGroup } from 'lit';
|
|
22
25
|
* @tagname skf-drawer
|
23
26
|
*/
|
24
27
|
export declare class SkfDrawer extends SkfElement {
|
28
|
+
#private;
|
25
29
|
static styles: CSSResultGroup;
|
26
30
|
/** @internal */
|
27
31
|
private _abortController?;
|
28
32
|
/** @internal */
|
29
33
|
private _signal?;
|
30
|
-
/** If defined, sets the aria-label for the close button */
|
31
|
-
closeButtonAriaLabel: string;
|
32
34
|
/** Heading for the Drawer */
|
33
35
|
heading?: string;
|
36
|
+
/** Sets the internal language of the component */
|
37
|
+
lang: Language;
|
34
38
|
/** Sets the max-width */
|
35
|
-
size:
|
39
|
+
size: Size;
|
36
40
|
/** If true, Drawer is open */
|
37
41
|
open: boolean;
|
38
42
|
/** Placement of the Drawer */
|
39
|
-
placement:
|
43
|
+
placement: Placement;
|
40
44
|
/** @internal */
|
41
45
|
$dialog: HTMLDialogElement;
|
46
|
+
protected firstUpdated(): void;
|
42
47
|
disconnectedCallback(): void;
|
43
48
|
/** @internal */
|
49
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
50
|
+
/** @internal */
|
44
51
|
_placementChanged: () => void;
|
45
52
|
/** @internal */
|
46
53
|
_openChanged(): Promise<void>;
|
@@ -59,3 +66,4 @@ export declare class SkfDrawer extends SkfElement {
|
|
59
66
|
close(): void;
|
60
67
|
render(): import("lit").TemplateResult<1>;
|
61
68
|
}
|
69
|
+
export {};
|
@@ -1,21 +1,37 @@
|
|
1
|
+
var y = (e) => {
|
2
|
+
throw TypeError(e);
|
3
|
+
};
|
4
|
+
var w = (e, i, t) => i.has(e) || y("Cannot " + t);
|
5
|
+
var m = (e, i, t) => (w(e, i, "read from private field"), t ? t.call(e) : i.get(e)), g = (e, i, t) => i.has(e) ? y("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), f = (e, i, t, o) => (w(e, i, "write to private field"), o ? o.call(e, t) : i.set(e, t), t);
|
1
6
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
import { SkfElement as D } from "../../internal/components/skf-element.js";
|
8
|
+
import { stateMap as k } from "../../internal/helpers/stateMap.js";
|
9
|
+
import { watch as u } from "../../internal/helpers/watch.js";
|
10
|
+
import { MOTION_DURATIONS as b } from "@skf-design-system/ui-assets";
|
11
|
+
import { componentStyles as C } from "../../styles/component.styles.js";
|
12
|
+
import { LocalizeController as $ } from "../../utilities/localize.js";
|
13
|
+
import { html as E } from "lit";
|
14
|
+
import { property as d, query as v } from "lit/decorators.js";
|
15
|
+
import { styles as U } from "./drawer.styles.js";
|
16
|
+
var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor, n = (e, i, t, o) => {
|
17
|
+
for (var s = o > 1 ? void 0 : o ? P(i, t) : i, r = e.length - 1, l; r >= 0; r--)
|
18
|
+
(l = e[r]) && (s = (o ? l(i, t, s) : l(s)) || s);
|
19
|
+
return o && s && O(i, t, s), s;
|
20
|
+
};
|
21
|
+
const I = {
|
22
|
+
placement: ["left", "right"],
|
23
|
+
size: ["sm", "md", "lg"]
|
13
24
|
};
|
14
|
-
|
25
|
+
var h, c, p;
|
26
|
+
const _ = class _ extends D {
|
15
27
|
constructor() {
|
16
|
-
super(...arguments)
|
17
|
-
|
18
|
-
|
28
|
+
super(...arguments);
|
29
|
+
g(this, h);
|
30
|
+
g(this, c);
|
31
|
+
g(this, p);
|
32
|
+
f(this, h, new $(this)), f(this, c, this.attachInternals()), f(this, p, m(this, c).states), this.lang = "en", this.size = "md", this.open = !1, this.placement = "right", this._placementChanged = () => {
|
33
|
+
this.$dialog.getAnimations().forEach((o) => {
|
34
|
+
o.cancel();
|
19
35
|
});
|
20
36
|
}, this._clickstartInDialog = !1, this._handleMouseDown = (t) => {
|
21
37
|
this._clickIsInsideElement(t, this.$dialog) && (this._clickstartInDialog = !0);
|
@@ -26,13 +42,17 @@ const c = class c extends m {
|
|
26
42
|
}
|
27
43
|
};
|
28
44
|
}
|
45
|
+
firstUpdated() {
|
46
|
+
this.open && this._openChanged();
|
47
|
+
}
|
29
48
|
disconnectedCallback() {
|
30
|
-
|
31
|
-
|
49
|
+
super.disconnectedCallback(), this._abortController?.abort();
|
50
|
+
}
|
51
|
+
_handleStateChange(t, o, s) {
|
52
|
+
k(m(this, p), I[t]).set(s);
|
32
53
|
}
|
33
54
|
async _openChanged() {
|
34
|
-
|
35
|
-
this.open ? (this._abortController = new AbortController(), this._signal = this._abortController.signal, this.$dialog.showModal(), this._startListeners(), await this._animateDrawer(), this.emit("skf-drawer-opened")) : ((t = this._abortController) == null || t.abort(), this.emit("skf-drawer-closing"), await this._animateDrawer(), this.emit("skf-drawer-closed"), this.$dialog.close());
|
55
|
+
this.open ? (this._abortController = new AbortController(), this._signal = this._abortController.signal, this.$dialog.showModal(), this._startListeners(), await this._animateDrawer(), this.emit("skf-drawer-opened")) : (this._abortController?.abort(), this.emit("skf-drawer-closing"), await this._animateDrawer(), this.emit("skf-drawer-closed"), this.$dialog.close());
|
36
56
|
}
|
37
57
|
/** @internal */
|
38
58
|
_startListeners() {
|
@@ -47,26 +67,26 @@ const c = class c extends m {
|
|
47
67
|
});
|
48
68
|
}
|
49
69
|
/** @internal */
|
50
|
-
_clickIsInsideElement(t,
|
51
|
-
const
|
52
|
-
return
|
70
|
+
_clickIsInsideElement(t, o) {
|
71
|
+
const s = o.getBoundingClientRect();
|
72
|
+
return s.top <= t.clientY && t.clientY <= s.top + s.height && s.left <= t.clientX && t.clientX <= s.left + s.width;
|
53
73
|
}
|
54
74
|
/** @internal */
|
55
75
|
_animateDrawer() {
|
56
|
-
const t = this.open ? [{ opacity: 0 }, { opacity: 0.4 }] : [{ opacity: 0 }],
|
57
|
-
return new Promise((
|
76
|
+
const t = this.open ? [{ opacity: 0 }, { opacity: 0.4 }] : [{ opacity: 0 }], o = this.open ? [{ translate: "0" }] : [{ translate: this.placement === "right" ? "100%" : "-100%" }];
|
77
|
+
return new Promise((s) => {
|
58
78
|
requestAnimationFrame(() => {
|
59
|
-
const
|
60
|
-
duration:
|
79
|
+
const r = this.$dialog.animate(t, {
|
80
|
+
duration: b.normal,
|
61
81
|
fill: "forwards",
|
62
82
|
pseudoElement: "::backdrop"
|
63
|
-
}),
|
64
|
-
duration:
|
83
|
+
}), l = this.$dialog.animate(o, {
|
84
|
+
duration: b.normal,
|
65
85
|
easing: "ease-out",
|
66
86
|
fill: "forwards"
|
67
87
|
});
|
68
|
-
Promise.all([
|
69
|
-
|
88
|
+
Promise.all([r.finished, l.finished]).then(() => {
|
89
|
+
s("Animations finished");
|
70
90
|
}).catch(() => {
|
71
91
|
throw new Error("Animation failed");
|
72
92
|
});
|
@@ -77,14 +97,14 @@ const c = class c extends m {
|
|
77
97
|
this.open = !1;
|
78
98
|
}
|
79
99
|
render() {
|
80
|
-
return
|
81
|
-
<dialog @mousedown
|
100
|
+
return E`
|
101
|
+
<dialog @mousedown=${this._handleMouseDown} @mouseup=${this._handleMouseUp} aria-modal="true">
|
82
102
|
<header>
|
83
103
|
<h2>${this.heading}</h2>
|
84
104
|
<button
|
85
|
-
|
105
|
+
@click=${() => this.open = !1}
|
106
|
+
aria-label=${m(this, h).term("close")}
|
86
107
|
id="close-button"
|
87
|
-
@click="${() => this.open = !1}"
|
88
108
|
>
|
89
109
|
<skf-icon name="close" color="inverse"></skf-icon>
|
90
110
|
</button>
|
@@ -94,32 +114,35 @@ const c = class c extends m {
|
|
94
114
|
`;
|
95
115
|
}
|
96
116
|
};
|
97
|
-
c.styles = [
|
98
|
-
let
|
99
|
-
|
100
|
-
|
101
|
-
],
|
102
|
-
|
103
|
-
|
104
|
-
],
|
105
|
-
|
106
|
-
|
107
|
-
],
|
108
|
-
|
109
|
-
|
110
|
-
],
|
111
|
-
|
112
|
-
|
113
|
-
],
|
114
|
-
|
115
|
-
|
116
|
-
],
|
117
|
-
|
118
|
-
|
119
|
-
],
|
120
|
-
|
121
|
-
|
122
|
-
],
|
117
|
+
h = new WeakMap(), c = new WeakMap(), p = new WeakMap(), _.styles = [C, U];
|
118
|
+
let a = _;
|
119
|
+
n([
|
120
|
+
d({ type: String })
|
121
|
+
], a.prototype, "heading", 2);
|
122
|
+
n([
|
123
|
+
d({ type: String })
|
124
|
+
], a.prototype, "lang", 2);
|
125
|
+
n([
|
126
|
+
d({ type: String })
|
127
|
+
], a.prototype, "size", 2);
|
128
|
+
n([
|
129
|
+
d({ type: Boolean, reflect: !0, useDefault: !0 })
|
130
|
+
], a.prototype, "open", 2);
|
131
|
+
n([
|
132
|
+
d({ type: String })
|
133
|
+
], a.prototype, "placement", 2);
|
134
|
+
n([
|
135
|
+
v("dialog")
|
136
|
+
], a.prototype, "$dialog", 2);
|
137
|
+
n([
|
138
|
+
u(Object.keys(I))
|
139
|
+
], a.prototype, "_handleStateChange", 1);
|
140
|
+
n([
|
141
|
+
u("placement", { waitUntilFirstUpdate: !0 })
|
142
|
+
], a.prototype, "_placementChanged", 2);
|
143
|
+
n([
|
144
|
+
u("open", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
145
|
+
], a.prototype, "_openChanged", 1);
|
123
146
|
export {
|
124
|
-
|
147
|
+
a as SkfDrawer
|
125
148
|
};
|