@skf-design-system/ui-components 1.0.2-beta.6 → 1.0.2-beta.9
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 +18 -0
- package/dist/components/alert/alert.component.d.ts +3 -2
- package/dist/components/alert/alert.component.js +39 -33
- package/dist/components/button/button.styles.js +3 -3
- package/dist/components/checkbox/checkbox.component.d.ts +6 -5
- package/dist/components/checkbox/checkbox.component.js +77 -76
- package/dist/components/checkbox/checkbox.styles.js +1 -1
- package/dist/components/datepicker/datepicker-calendar.component.d.ts +4 -0
- package/dist/components/datepicker/datepicker-calendar.component.js +134 -127
- package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
- package/dist/components/datepicker/datepicker-popup.component.js +100 -88
- package/dist/components/datepicker/datepicker.component.d.ts +4 -2
- package/dist/components/datepicker/datepicker.component.js +150 -140
- package/dist/components/dialog/dialog.component.d.ts +3 -2
- package/dist/components/dialog/dialog.component.js +39 -37
- package/dist/components/divider/divider.component.js +13 -13
- package/dist/components/divider/divider.styles.js +2 -2
- package/dist/components/drawer/drawer.component.d.ts +3 -2
- package/dist/components/drawer/drawer.component.js +37 -35
- package/dist/components/drawer/drawer.styles.js +1 -1
- package/dist/components/header/header.component.d.ts +4 -2
- package/dist/components/header/header.component.js +66 -57
- package/dist/components/header/header.styles.js +2 -2
- package/dist/components/icon/icon.component.js +26 -16
- package/dist/components/icon/icon.styles.js +4 -4
- package/dist/components/input/input.component.d.ts +4 -8
- package/dist/components/input/input.component.js +146 -147
- package/dist/components/input/input.controllers.d.ts +0 -1
- package/dist/components/input/input.controllers.js +12 -12
- package/dist/components/link/link.component.js +19 -12
- package/dist/components/link/link.styles.js +11 -3
- package/dist/components/loader/loader.component.d.ts +0 -2
- package/dist/components/loader/loader.component.js +27 -30
- package/dist/components/loader/loader.styles.js +1 -1
- package/dist/components/menu/menu-item.styles.js +8 -7
- package/dist/components/menu/menu.component.d.ts +4 -1
- package/dist/components/nav/nav.component.d.ts +3 -0
- package/dist/components/nav/nav.component.js +38 -33
- package/dist/components/popover/popover.component.d.ts +6 -3
- package/dist/components/progress/progress.styles.js +3 -3
- package/dist/components/radio/radio.component.d.ts +4 -2
- package/dist/components/radio/radio.component.js +91 -83
- 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.styles.js +1 -1
- package/dist/components/select/select-option.component.d.ts +2 -2
- package/dist/components/select/select-option.component.js +16 -19
- package/dist/components/select/select.component.d.ts +13 -9
- package/dist/components/select/select.component.js +169 -144
- package/dist/components/stepper/stepper-item.styles.js +4 -4
- package/dist/components/switch/switch.component.d.ts +4 -2
- package/dist/components/switch/switch.component.js +64 -56
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/tabs/tab.styles.js +2 -2
- package/dist/components/tag/tag.component.d.ts +3 -0
- package/dist/components/tag/tag.component.js +50 -41
- package/dist/components/textarea/textarea.component.d.ts +4 -2
- package/dist/components/textarea/textarea.component.js +126 -118
- package/dist/components/tooltip/tooltip.component.d.ts +8 -2
- package/dist/components/tooltip/tooltip.component.js +3 -0
- package/dist/custom-elements.json +734 -372
- package/dist/internal/base-classes/popover/popover.base.d.ts +21 -2
- package/dist/internal/base-classes/popover/popover.base.js +10 -12
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -19
- package/dist/internal/controllers/popover.controller.d.ts +2 -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/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +4 -4
- package/dist/styles/global-alt.css +1 -1
- 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 +1823 -846
- package/dist/types/vue/index.d.ts +59 -47
- package/dist/utilities/localize.d.ts +28 -0
- package/dist/utilities/localize.js +13 -0
- package/dist/vscode.html-custom-data.json +75 -80
- package/dist/web-types.json +205 -169
- package/package.json +27 -34
- package/custom-elements.json +0 -25490
@@ -1,30 +1,32 @@
|
|
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 h = (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 c, 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
|
+
}, u, g, y, p;
|
22
|
+
const m = class m extends b {
|
22
23
|
constructor() {
|
23
24
|
super(...arguments);
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
f(this, u);
|
26
|
+
f(this, g);
|
27
|
+
f(this, y);
|
28
|
+
f(this, p);
|
29
|
+
d(this, u, new P(this)), d(this, g, 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();
|
@@ -44,7 +46,7 @@ const y = class y extends C {
|
|
44
46
|
/** @internal */
|
45
47
|
_transition() {
|
46
48
|
const t = this.fullscreen ? {} : {
|
47
|
-
translate: `${String(
|
49
|
+
translate: `${String(h(this, g))} ${String(h(this, y))}px`
|
48
50
|
};
|
49
51
|
return { entry: () => new Promise((a) => {
|
50
52
|
if (!this.$dialog) {
|
@@ -109,15 +111,15 @@ const y = class y extends C {
|
|
109
111
|
}
|
110
112
|
/** Method that closes the dialog */
|
111
113
|
async close() {
|
112
|
-
if (
|
113
|
-
|
114
|
+
if (h(this, p) || !this.open) return;
|
115
|
+
d(this, p, !0);
|
114
116
|
async function t(o) {
|
115
|
-
return o.$dialog ? (o.emit("skf-dialog-closing"), await o._transition().exit(), o.$dialog.close(), o.open = !1,
|
117
|
+
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
118
|
}
|
117
119
|
return await t(this);
|
118
120
|
}
|
119
121
|
render() {
|
120
|
-
return
|
122
|
+
return w`
|
121
123
|
<dialog
|
122
124
|
@close=${this._handleClose}
|
123
125
|
@mousedown=${this._handleBackdropClick}
|
@@ -125,7 +127,7 @@ const y = class y extends C {
|
|
125
127
|
@keydown=${this._handleKeyDown}
|
126
128
|
aria-modal="true"
|
127
129
|
autofocus
|
128
|
-
class=${
|
130
|
+
class=${C({
|
129
131
|
dialog: !0,
|
130
132
|
"dialog--fullscreen": this.fullscreen,
|
131
133
|
"dialog--no-padding": this.noPadding
|
@@ -133,10 +135,10 @@ const y = class y extends C {
|
|
133
135
|
>
|
134
136
|
<div class="dialog__head">
|
135
137
|
<h2 class="dialog__heading">${this.heading}</h2>
|
136
|
-
${this.noCloseButton ?
|
138
|
+
${this.noCloseButton ? E : w`
|
137
139
|
<button
|
138
140
|
@click=${this._handleClose}
|
139
|
-
aria-label=${this.
|
141
|
+
aria-label=${h(this, u).term("close")}
|
140
142
|
class="dialog__close-btn"
|
141
143
|
>
|
142
144
|
<skf-icon name="close" color="inverse"></skf-icon>
|
@@ -146,7 +148,7 @@ const y = class y extends C {
|
|
146
148
|
<div class="dialog__body">
|
147
149
|
<slot class="dialog__main"></slot>
|
148
150
|
<slot
|
149
|
-
class=${
|
151
|
+
class=${C({
|
150
152
|
dialog__foot: !0,
|
151
153
|
"dialog__foot--hidden": !this.renderFoot
|
152
154
|
})}
|
@@ -157,17 +159,17 @@ const y = class y extends C {
|
|
157
159
|
`;
|
158
160
|
}
|
159
161
|
};
|
160
|
-
|
161
|
-
let s =
|
162
|
-
n([
|
163
|
-
c({ attribute: "close-button-aria-label" })
|
164
|
-
], s.prototype, "closeButtonAriaLabel", 2);
|
162
|
+
u = new WeakMap(), g = new WeakMap(), y = new WeakMap(), p = new WeakMap(), m.styles = [B, D];
|
163
|
+
let s = m;
|
165
164
|
n([
|
166
165
|
c()
|
167
166
|
], s.prototype, "heading", 2);
|
168
167
|
n([
|
169
168
|
c({ type: Boolean })
|
170
169
|
], s.prototype, "fullscreen", 2);
|
170
|
+
n([
|
171
|
+
c({ type: String })
|
172
|
+
], s.prototype, "lang", 2);
|
171
173
|
n([
|
172
174
|
c({ type: Boolean, attribute: "no-close-button" })
|
173
175
|
], s.prototype, "noCloseButton", 2);
|
@@ -178,19 +180,19 @@ n([
|
|
178
180
|
c({ type: Boolean, reflect: !0 })
|
179
181
|
], s.prototype, "open", 2);
|
180
182
|
n([
|
181
|
-
|
183
|
+
v()
|
182
184
|
], s.prototype, "onClose", 2);
|
183
185
|
n([
|
184
|
-
|
186
|
+
v()
|
185
187
|
], s.prototype, "renderFoot", 2);
|
186
188
|
n([
|
187
|
-
|
189
|
+
O("dialog")
|
188
190
|
], s.prototype, "$dialog", 2);
|
189
191
|
n([
|
190
|
-
|
192
|
+
x({ slot: "footer" })
|
191
193
|
], s.prototype, "footerEls", 2);
|
192
194
|
n([
|
193
|
-
|
195
|
+
k("open")
|
194
196
|
], s.prototype, "handleOpenChange", 1);
|
195
197
|
export {
|
196
198
|
s as SkfDialog
|
@@ -2,7 +2,7 @@ var _ = (t) => {
|
|
2
2
|
throw TypeError(t);
|
3
3
|
};
|
4
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,
|
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
6
|
import { SkfElement as O } from "../../internal/components/skf-element.js";
|
7
7
|
import { stateMap as b } from "../../internal/helpers/stateMap.js";
|
8
8
|
import { watch as g } from "../../internal/helpers/watch.js";
|
@@ -10,13 +10,13 @@ import { componentStyles as C } from "../../styles/component.styles.js";
|
|
10
10
|
import "lit";
|
11
11
|
import { property as v } from "lit/decorators.js";
|
12
12
|
import { styles as P } from "./divider.styles.js";
|
13
|
-
var j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, c = (t, e, r,
|
14
|
-
for (var o =
|
15
|
-
(n = t[l]) && (o = (
|
16
|
-
return
|
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
17
|
};
|
18
18
|
const u = {
|
19
|
-
color: ["
|
19
|
+
color: ["emphasized", "inverse", "primary", "secondary", "tertiary"],
|
20
20
|
vertical: "vertical"
|
21
21
|
};
|
22
22
|
var i, p;
|
@@ -30,24 +30,24 @@ const f = class f extends O {
|
|
30
30
|
connectedCallback() {
|
31
31
|
super.connectedCallback(), this.role = this.decorative ? "generic" : "separator", this.ariaOrientation = this.vertical ? "vertical" : "horizontal";
|
32
32
|
}
|
33
|
-
_handleStateChange(r,
|
33
|
+
_handleStateChange(r, a, o) {
|
34
34
|
b(h(this, p), u[r]).set(o);
|
35
35
|
}
|
36
36
|
};
|
37
37
|
i = new WeakMap(), p = new WeakMap(), f.styles = [C, P];
|
38
|
-
let
|
38
|
+
let s = f;
|
39
39
|
c([
|
40
40
|
v({ type: String })
|
41
|
-
],
|
41
|
+
], s.prototype, "color", 2);
|
42
42
|
c([
|
43
43
|
v({ type: Boolean })
|
44
|
-
],
|
44
|
+
], s.prototype, "decorative", 2);
|
45
45
|
c([
|
46
46
|
v({ type: Boolean })
|
47
|
-
],
|
47
|
+
], s.prototype, "vertical", 2);
|
48
48
|
c([
|
49
49
|
g(Object.keys(u))
|
50
|
-
],
|
50
|
+
], s.prototype, "_handleStateChange", 1);
|
51
51
|
export {
|
52
|
-
|
52
|
+
s as SkfDivider
|
53
53
|
};
|
@@ -24,8 +24,8 @@ const o = r`
|
|
24
24
|
margin-inline: var(--skf-divider-spacing, var(--skf-spacing-100));
|
25
25
|
}
|
26
26
|
|
27
|
-
:host(:state(
|
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
31
|
:host(:state(inverse)) {
|
@@ -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:
|
@@ -30,10 +31,10 @@ export declare class SkfDrawer extends SkfElement {
|
|
30
31
|
private _abortController?;
|
31
32
|
/** @internal */
|
32
33
|
private _signal?;
|
33
|
-
/** If defined, sets the aria-label for the close button */
|
34
|
-
closeButtonAriaLabel: string;
|
35
34
|
/** Heading for the Drawer */
|
36
35
|
heading?: string;
|
36
|
+
/** Sets the internal language of the component */
|
37
|
+
lang: Language;
|
37
38
|
/** Sets the max-width */
|
38
39
|
size: Size;
|
39
40
|
/** If true, Drawer is open */
|
@@ -1,33 +1,35 @@
|
|
1
|
-
var
|
1
|
+
var y = (e) => {
|
2
2
|
throw TypeError(e);
|
3
3
|
};
|
4
|
-
var
|
5
|
-
var
|
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);
|
6
6
|
import "../icon/icon.js";
|
7
|
-
import { SkfElement as
|
8
|
-
import { stateMap as
|
9
|
-
import { watch as
|
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
10
|
import { MOTION_DURATIONS as b } from "@skf-design-system/ui-assets";
|
11
|
-
import { componentStyles as
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
|
16
|
-
|
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 O } from "./drawer.styles.js";
|
16
|
+
var P = Object.defineProperty, U = Object.getOwnPropertyDescriptor, n = (e, i, t, o) => {
|
17
|
+
for (var s = o > 1 ? void 0 : o ? U(i, t) : i, r = e.length - 1, l; r >= 0; r--)
|
17
18
|
(l = e[r]) && (s = (o ? l(i, t, s) : l(s)) || s);
|
18
|
-
return o && s &&
|
19
|
+
return o && s && P(i, t, s), s;
|
19
20
|
};
|
20
|
-
const
|
21
|
+
const I = {
|
21
22
|
placement: ["left", "right"],
|
22
23
|
size: ["sm", "md", "lg"]
|
23
24
|
};
|
24
|
-
var h, c;
|
25
|
-
const
|
25
|
+
var h, c, p;
|
26
|
+
const _ = class _ extends D {
|
26
27
|
constructor() {
|
27
28
|
super(...arguments);
|
28
|
-
|
29
|
-
|
30
|
-
g(this,
|
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 = () => {
|
31
33
|
this.$dialog.getAnimations().forEach((o) => {
|
32
34
|
o.cancel();
|
33
35
|
});
|
@@ -45,7 +47,7 @@ const u = class u extends I {
|
|
45
47
|
super.disconnectedCallback(), (t = this._abortController) == null || t.abort();
|
46
48
|
}
|
47
49
|
_handleStateChange(t, o, s) {
|
48
|
-
|
50
|
+
k(m(this, p), I[t]).set(s);
|
49
51
|
}
|
50
52
|
async _openChanged() {
|
51
53
|
var t;
|
@@ -94,12 +96,12 @@ const u = class u extends I {
|
|
94
96
|
this.open = !1;
|
95
97
|
}
|
96
98
|
render() {
|
97
|
-
return
|
99
|
+
return E`
|
98
100
|
<dialog @mousedown="${this._handleMouseDown}" @mouseup="${this._handleMouseUp}">
|
99
101
|
<header>
|
100
102
|
<h2>${this.heading}</h2>
|
101
103
|
<button
|
102
|
-
aria-label=${this.
|
104
|
+
aria-label=${m(this, h).term("close")}
|
103
105
|
id="close-button"
|
104
106
|
@click="${() => this.open = !1}"
|
105
107
|
>
|
@@ -111,34 +113,34 @@ const u = class u extends I {
|
|
111
113
|
`;
|
112
114
|
}
|
113
115
|
};
|
114
|
-
h = new WeakMap(), c = new WeakMap(),
|
115
|
-
let a =
|
116
|
+
h = new WeakMap(), c = new WeakMap(), p = new WeakMap(), _.styles = [C, O];
|
117
|
+
let a = _;
|
116
118
|
n([
|
117
|
-
|
118
|
-
], a.prototype, "closeButtonAriaLabel", 2);
|
119
|
-
n([
|
120
|
-
p({ type: String })
|
119
|
+
d({ type: String })
|
121
120
|
], a.prototype, "heading", 2);
|
122
121
|
n([
|
123
|
-
|
122
|
+
d({ type: String })
|
123
|
+
], a.prototype, "lang", 2);
|
124
|
+
n([
|
125
|
+
d({ type: String })
|
124
126
|
], a.prototype, "size", 2);
|
125
127
|
n([
|
126
|
-
|
128
|
+
d({ type: Boolean, reflect: !0, useDefault: !0 })
|
127
129
|
], a.prototype, "open", 2);
|
128
130
|
n([
|
129
|
-
|
131
|
+
d({ type: String })
|
130
132
|
], a.prototype, "placement", 2);
|
131
133
|
n([
|
132
|
-
|
134
|
+
v("dialog")
|
133
135
|
], a.prototype, "$dialog", 2);
|
134
136
|
n([
|
135
|
-
|
137
|
+
u(Object.keys(I))
|
136
138
|
], a.prototype, "_handleStateChange", 1);
|
137
139
|
n([
|
138
|
-
|
140
|
+
u("placement", { waitUntilFirstUpdate: !0 })
|
139
141
|
], a.prototype, "_placementChanged", 2);
|
140
142
|
n([
|
141
|
-
|
143
|
+
u("open", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
142
144
|
], a.prototype, "_openChanged", 1);
|
143
145
|
export {
|
144
146
|
a as SkfDrawer
|
@@ -2,6 +2,7 @@ import '../button/button.js';
|
|
2
2
|
import '../drawer/drawer.js';
|
3
3
|
import '../logo/logo.js';
|
4
4
|
import { SkfElement } from '../../internal/components/skf-element';
|
5
|
+
import { type Language } from '../../utilities/localize.js';
|
5
6
|
import { type CSSResultGroup } from 'lit';
|
6
7
|
/**
|
7
8
|
* The `<skf-header>` component is to be used as the site-header in the app. The navigation will be collapsed to mobile-view if the menu items exceed the available width.
|
@@ -13,6 +14,7 @@ import { type CSSResultGroup } from 'lit';
|
|
13
14
|
* @tagname skf-header
|
14
15
|
*/
|
15
16
|
export declare class SkfHeader extends SkfElement {
|
17
|
+
#private;
|
16
18
|
static styles: CSSResultGroup;
|
17
19
|
/** @internal */
|
18
20
|
private _dynamicBreakpoint?;
|
@@ -21,8 +23,8 @@ export declare class SkfHeader extends SkfElement {
|
|
21
23
|
/** If true, sets header to display in compact mode only (hanburger menu and drawer) */
|
22
24
|
set compact(value: boolean);
|
23
25
|
get compact(): boolean;
|
24
|
-
/**
|
25
|
-
|
26
|
+
/** Sets the internal language of the component */
|
27
|
+
lang: Language;
|
26
28
|
/** If defined, sets the app or site's name */
|
27
29
|
siteName?: string;
|
28
30
|
/** If defined, sets the site's base-url for the "logo-link" */
|
@@ -1,24 +1,32 @@
|
|
1
|
+
var v = (e) => {
|
2
|
+
throw TypeError(e);
|
3
|
+
};
|
4
|
+
var d = (e, r, t) => r.has(e) || v("Cannot " + t);
|
5
|
+
var f = (e, r, t) => (d(e, r, "read from private field"), t ? t.call(e) : r.get(e)), u = (e, r, t) => r.has(e) ? v("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), b = (e, r, t, o) => (d(e, r, "write to private field"), o ? o.call(e, t) : r.set(e, t), t);
|
1
6
|
import "../button/button.js";
|
2
7
|
import "../drawer/drawer.js";
|
3
8
|
import "../logo/logo.js";
|
4
|
-
import { SkfElement as
|
5
|
-
import { componentStyles as
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
import { SkfElement as y } from "../../internal/components/skf-element.js";
|
10
|
+
import { componentStyles as $ } from "../../styles/component.styles.js";
|
11
|
+
import { LocalizeController as g } from "../../utilities/localize.js";
|
12
|
+
import { nothing as C, html as h } from "lit";
|
13
|
+
import { property as p, state as O, queryAssignedElements as W, query as D } from "lit/decorators.js";
|
14
|
+
import { ifDefined as w } from "lit/directives/if-defined.js";
|
15
|
+
import { literal as _, html as N } from "lit/static-html.js";
|
16
|
+
import { styles as k } from "./header.styles.js";
|
17
|
+
var z = Object.defineProperty, B = Object.getOwnPropertyDescriptor, s = (e, r, t, o) => {
|
18
|
+
for (var a = o > 1 ? void 0 : o ? B(r, t) : r, l = e.length - 1, c; l >= 0; l--)
|
19
|
+
(c = e[l]) && (a = (o ? c(r, t, a) : c(a)) || a);
|
20
|
+
return o && a && z(r, t, a), a;
|
21
|
+
}, n;
|
22
|
+
const m = class m extends y {
|
17
23
|
constructor() {
|
18
|
-
super(...arguments)
|
24
|
+
super(...arguments);
|
25
|
+
u(this, n);
|
26
|
+
b(this, n, new g(this)), this.lang = "en", this.isCompact = !1, this.openDrawer = !1;
|
19
27
|
}
|
20
|
-
set compact(
|
21
|
-
this.isCompact =
|
28
|
+
set compact(t) {
|
29
|
+
this.isCompact = t;
|
22
30
|
}
|
23
31
|
get compact() {
|
24
32
|
return this.isCompact;
|
@@ -35,82 +43,83 @@ const l = class l extends d {
|
|
35
43
|
/** @internal */
|
36
44
|
_observeHostWidth() {
|
37
45
|
this._widthObserver = new ResizeObserver(() => {
|
38
|
-
var
|
39
|
-
this.clientWidth > (this._dynamicBreakpoint ?? 0) && (this._dynamicBreakpoint = null, (
|
46
|
+
var t;
|
47
|
+
this.clientWidth > (this._dynamicBreakpoint ?? 0) && (this._dynamicBreakpoint = null, (t = this._widthObserver) == null || t.disconnect(), this.isCompact = !1, this.nav[0].vertical = !1, this._observeNavContainer());
|
40
48
|
}), this._widthObserver.observe(this);
|
41
49
|
}
|
42
50
|
/** @internal */
|
43
51
|
_observeNavContainer() {
|
44
52
|
this._widthObserver = new ResizeObserver(() => {
|
45
|
-
var
|
46
|
-
this.$navWrapper.clientWidth < this.$navWrapper.scrollWidth && (this._dynamicBreakpoint = this.clientWidth, (
|
53
|
+
var t;
|
54
|
+
this.$navWrapper.clientWidth < this.$navWrapper.scrollWidth && (this._dynamicBreakpoint = this.clientWidth, (t = this._widthObserver) == null || t.disconnect(), this.isCompact = !0, this.nav[0].vertical = !0, this._observeHostWidth());
|
47
55
|
}), this._widthObserver.observe(this.$navWrapper);
|
48
56
|
}
|
49
57
|
/** @internal */
|
50
58
|
_renderMeta() {
|
51
|
-
const
|
52
|
-
return
|
53
|
-
<${
|
59
|
+
const t = this.siteUrl ? _`a` : _`div`;
|
60
|
+
return N`
|
61
|
+
<${t} href=${w(this.siteUrl)} id="meta">
|
54
62
|
<skf-logo color="inverse"></skf-logo>
|
55
|
-
${this.siteName ?
|
56
|
-
</${
|
63
|
+
${this.siteName ? h`<h2>${this.siteName}</h2>` : C}
|
64
|
+
</${t}>
|
57
65
|
`;
|
58
66
|
}
|
59
67
|
render() {
|
60
|
-
return
|
68
|
+
return h`
|
61
69
|
<header role="banner">
|
62
70
|
${this._renderMeta()}
|
63
71
|
<div id="nav-wrapper">
|
64
|
-
${this.isCompact ?
|
72
|
+
${this.isCompact ? h`
|
65
73
|
<button
|
66
74
|
@click=${() => this.openDrawer = !this.openDrawer}
|
67
75
|
aria-controls="drawer"
|
68
76
|
aria-expanded=${this.openDrawer}
|
69
|
-
aria-label=${this.
|
77
|
+
aria-label=${f(this, n).term("showMenu")}
|
70
78
|
>
|
71
79
|
<skf-icon color="inverse" name="hamburgerMenu" size="lg"></skf-icon>
|
72
80
|
</button>
|
73
81
|
<skf-drawer
|
74
82
|
?open=${this.openDrawer}
|
75
83
|
@close=${() => this.openDrawer = !1}
|
76
|
-
heading=${
|
84
|
+
heading=${w(this.siteName)}
|
77
85
|
id="drawer"
|
86
|
+
lang=${this.lang}
|
78
87
|
placement="right"
|
79
88
|
>
|
80
89
|
<slot></slot>
|
81
90
|
</skf-drawer>
|
82
|
-
` :
|
91
|
+
` : h`<slot></slot>`}
|
83
92
|
</div>
|
84
93
|
</header>
|
85
94
|
`;
|
86
95
|
}
|
87
96
|
};
|
88
|
-
|
89
|
-
let
|
90
|
-
|
91
|
-
|
92
|
-
],
|
93
|
-
|
94
|
-
|
95
|
-
],
|
96
|
-
|
97
|
-
|
98
|
-
],
|
99
|
-
|
100
|
-
|
101
|
-
],
|
102
|
-
|
103
|
-
|
104
|
-
],
|
105
|
-
|
106
|
-
|
107
|
-
],
|
108
|
-
|
109
|
-
|
110
|
-
],
|
111
|
-
|
112
|
-
|
113
|
-
],
|
97
|
+
n = new WeakMap(), m.styles = [$, k];
|
98
|
+
let i = m;
|
99
|
+
s([
|
100
|
+
p({ type: Boolean, reflect: !0 })
|
101
|
+
], i.prototype, "compact", 1);
|
102
|
+
s([
|
103
|
+
p({ type: String })
|
104
|
+
], i.prototype, "lang", 2);
|
105
|
+
s([
|
106
|
+
p({ attribute: "site-name" })
|
107
|
+
], i.prototype, "siteName", 2);
|
108
|
+
s([
|
109
|
+
p({ attribute: "site-url" })
|
110
|
+
], i.prototype, "siteUrl", 2);
|
111
|
+
s([
|
112
|
+
p({ type: Boolean, reflect: !0, state: !0, attribute: "is-compact" })
|
113
|
+
], i.prototype, "isCompact", 2);
|
114
|
+
s([
|
115
|
+
O()
|
116
|
+
], i.prototype, "openDrawer", 2);
|
117
|
+
s([
|
118
|
+
W({ selector: "skf-nav" })
|
119
|
+
], i.prototype, "nav", 2);
|
120
|
+
s([
|
121
|
+
D("#nav-wrapper")
|
122
|
+
], i.prototype, "$navWrapper", 2);
|
114
123
|
export {
|
115
|
-
|
124
|
+
i as SkfHeader
|
116
125
|
};
|
@@ -7,7 +7,7 @@ const a = e`
|
|
7
7
|
|
8
8
|
header {
|
9
9
|
align-items: center;
|
10
|
-
background-color: var(--skf-bg-color-
|
10
|
+
background-color: var(--skf-bg-color-emphasized);
|
11
11
|
block-size: var(--skf-header-height);
|
12
12
|
display: flex;
|
13
13
|
gap: var(--skf-spacing-125);
|
@@ -48,7 +48,7 @@ const a = e`
|
|
48
48
|
}
|
49
49
|
|
50
50
|
skf-drawer::part(body) {
|
51
|
-
background-color: var(--skf-bg-color-
|
51
|
+
background-color: var(--skf-bg-color-emphasized);
|
52
52
|
padding: 0;
|
53
53
|
}
|
54
54
|
|