@skf-design-system/ui-components 1.0.0-alpha.38 → 1.0.0-alpha.39
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/breadcrumb/breadcrumb-item.component.js +11 -12
- package/dist/components/button/button.component.js +32 -36
- 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 +67 -69
- package/dist/components/checkbox/checkbox.styles.js +1 -1
- package/dist/components/datepicker/datepicker-calendar.component.d.ts +1 -0
- package/dist/components/datepicker/datepicker-calendar.component.js +107 -116
- package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
- package/dist/components/datepicker/datepicker-popup.component.js +112 -100
- package/dist/components/datepicker/datepicker-popup.helpers.js +1 -1
- package/dist/components/datepicker/datepicker.component.d.ts +4 -2
- package/dist/components/datepicker/datepicker.component.js +159 -160
- package/dist/components/dialog/dialog.component.d.ts +3 -2
- package/dist/components/dialog/dialog.component.js +48 -48
- 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.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.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 +11 -10
- package/dist/components/input/input.component.js +115 -111
- 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 +1 -0
- package/dist/components/link/link.component.js +86 -74
- package/dist/components/link/link.styles.js +7 -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 +5 -2
- package/dist/components/menu/menu.component.js +7 -7
- 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 -7
- package/dist/components/popover/popover.component.js +23 -31
- 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 +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.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button.component.js +22 -24
- package/dist/components/select/select-option.component.d.ts +2 -1
- package/dist/components/select/select-option.component.js +31 -36
- package/dist/components/select/select.component.d.ts +20 -10
- package/dist/components/select/select.component.js +139 -104
- package/dist/components/select/select.controllers.js +14 -17
- package/dist/components/select/select.styles.js +8 -3
- package/dist/components/stepper/stepper-item.component.d.ts +1 -1
- package/dist/components/stepper/stepper-item.component.js +26 -23
- package/dist/components/stepper/stepper-item.styles.js +4 -4
- package/dist/components/stepper/stepper.component.js +2 -3
- 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.styles.js +1 -1
- package/dist/components/tabs/tab-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +19 -16
- package/dist/components/tabs/tab.component.d.ts +1 -1
- package/dist/components/tabs/tab.component.js +17 -14
- package/dist/components/tabs/tab.styles.js +2 -2
- package/dist/components/tabs/tabs.component.js +6 -6
- package/dist/components/tag/tag.component.d.ts +9 -6
- package/dist/components/tag/tag.component.js +78 -72
- package/dist/components/tag/tag.styles.js +5 -0
- package/dist/components/textarea/textarea.component.d.ts +4 -2
- package/dist/components/textarea/textarea.component.js +101 -95
- package/dist/components/toast/toast-item.styles.js +13 -10
- package/dist/components/toast/toast.singleton.js +6 -7
- package/dist/components/tooltip/tooltip.component.d.ts +7 -4
- package/dist/components/tooltip/tooltip.component.js +22 -14
- package/dist/custom-elements.json +835 -422
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -20
- package/dist/internal/base-classes/popover/popover.base.d.ts +28 -8
- package/dist/internal/base-classes/popover/popover.base.js +78 -74
- 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/controllers/popover.controller.js +11 -14
- package/dist/internal/helpers/stateMap.js +3 -3
- 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/internal/types.d.ts +4 -0
- 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 +1840 -858
- package/dist/types/vue/index.d.ts +69 -64
- package/dist/utilities/localize.d.ts +28 -0
- package/dist/utilities/localize.js +13 -0
- package/dist/vscode.html-custom-data.json +75 -83
- package/dist/web-types.json +229 -190
- package/package.json +29 -35
- package/custom-elements.json +0 -25490
@@ -50,7 +50,7 @@ const s = e`
|
|
50
50
|
}
|
51
51
|
|
52
52
|
:is(.stepper-item--active, .stepper-item--completed) {
|
53
|
-
--_skf-stepper-color: var(--skf-text-color-
|
53
|
+
--_skf-stepper-color: var(--skf-text-color-emphasized);
|
54
54
|
}
|
55
55
|
|
56
56
|
.stepper-item--enabled {
|
@@ -70,17 +70,17 @@ const s = e`
|
|
70
70
|
user-select: none;
|
71
71
|
|
72
72
|
:is(.stepper-item--active, .stepper-item--active-completed, .stepper-item--completed) & {
|
73
|
-
--_skf-stepper-circle-border-color: var(--skf-border-color-
|
73
|
+
--_skf-stepper-circle-border-color: var(--skf-border-color-emphasized);
|
74
74
|
}
|
75
75
|
|
76
76
|
:is(.stepper-item--active, .stepper-item--active-completed) & {
|
77
77
|
--_skf-stepper-circle-color: var(--skf-text-color-inverse);
|
78
|
-
--_skf-stepper-circle-bg-color: var(--skf-bg-color-
|
78
|
+
--_skf-stepper-circle-bg-color: var(--skf-bg-color-emphasized);
|
79
79
|
}
|
80
80
|
|
81
81
|
.stepper-item--enabled & {
|
82
82
|
--_skf-stepper-circle-border-color: #6292e4; /* Missing token */
|
83
|
-
--_skf-stepper-circle-color: var(--skf-text-color-
|
83
|
+
--_skf-stepper-circle-color: var(--skf-text-color-emphasized);
|
84
84
|
}
|
85
85
|
}
|
86
86
|
|
@@ -44,9 +44,8 @@ const c = class c extends I {
|
|
44
44
|
});
|
45
45
|
}
|
46
46
|
_handleLinearMode() {
|
47
|
-
|
48
|
-
|
49
|
-
this.linear && (s._linear = !0);
|
47
|
+
this._items?.forEach((e) => {
|
48
|
+
this.linear && (e._linear = !0);
|
50
49
|
});
|
51
50
|
}
|
52
51
|
/** @internal */
|
@@ -1,18 +1,17 @@
|
|
1
|
-
const
|
1
|
+
const u = ({
|
2
2
|
activeIndex: c,
|
3
|
-
items:
|
3
|
+
items: l,
|
4
4
|
linear: i,
|
5
5
|
state: o,
|
6
6
|
index: e
|
7
7
|
}) => {
|
8
|
-
|
9
|
-
const n = (l = r[e - 1]) == null ? void 0 : l.state, p = e > c + 1, b = n === "active", a = ["active", "completed"].includes(o ?? ""), s = !i && a, d = i && !s ? !1 : (p || b || a) && !s, v = o === "active", f = e < c, m = o === "completed", u = !s && n === "completed" && e === c + 1, t = {
|
8
|
+
const n = l[e - 1]?.state, r = e > c + 1, p = n === "active", a = ["active", "completed"].includes(o ?? ""), s = !i && a, b = i && !s ? !1 : (r || p || a) && !s, d = o === "active", v = e < c, f = o === "completed", m = !s && n === "completed" && e === c + 1, t = {
|
10
9
|
isCurrentStep: a,
|
11
|
-
isDisabled:
|
10
|
+
isDisabled: b,
|
12
11
|
isSpan: s
|
13
12
|
};
|
14
|
-
return
|
13
|
+
return m ? { stateLabel: "enabled", ...t } : d ? { stateLabel: "active", ...t } : f ? { stateLabel: "activeCompleted", ...t } : v ? { stateLabel: "completed", ...t } : { stateLabel: void 0, ...t };
|
15
14
|
};
|
16
15
|
export {
|
17
|
-
|
16
|
+
u as stepperState
|
18
17
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FormBase } from '../../internal/components/formBase.js';
|
2
2
|
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
3
|
+
import { type Language } from '../../utilities/localize.js';
|
3
4
|
import { type CSSResultGroup } from 'lit';
|
4
5
|
/**
|
5
6
|
* The `<skf-switch>` is a component that displays a list of actions or options
|
@@ -14,6 +15,7 @@ import { type CSSResultGroup } from 'lit';
|
|
14
15
|
* @tagname skf-switch
|
15
16
|
*/
|
16
17
|
export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
|
18
|
+
#private;
|
17
19
|
static styles: CSSResultGroup;
|
18
20
|
/** @internal */
|
19
21
|
private _initialChecked;
|
@@ -25,10 +27,10 @@ export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
|
|
25
27
|
hideLabel: boolean;
|
26
28
|
/** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
|
27
29
|
label?: string;
|
30
|
+
/** Sets the internal language of the component */
|
31
|
+
lang: Language;
|
28
32
|
/** If defined, adds name to the input-element */
|
29
33
|
name?: string;
|
30
|
-
/** If defined, renders an alternative A11y text for the asterisk */
|
31
|
-
requiredLabel?: string;
|
32
34
|
/** Size of the Switch */
|
33
35
|
size: 'sm' | 'md';
|
34
36
|
/** The current value of the input field */
|
@@ -1,21 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { componentStyles as p } from "../../styles/component.styles.js";
|
4
|
-
import { nothing as c, html as v } from "lit";
|
5
|
-
import { property as s, state as f, query as m } from "lit/decorators.js";
|
6
|
-
import { classMap as _ } from "lit/directives/class-map.js";
|
7
|
-
import { ifDefined as b } from "lit/directives/if-defined.js";
|
8
|
-
import { styles as y } from "./switch.styles.js";
|
9
|
-
var g = Object.defineProperty, i = (d, e, a, k) => {
|
10
|
-
for (var l = void 0, h = d.length - 1, n; h >= 0; h--)
|
11
|
-
(n = d[h]) && (l = n(e, a, l) || l);
|
12
|
-
return l && g(e, a, l), l;
|
1
|
+
var p = (t) => {
|
2
|
+
throw TypeError(t);
|
13
3
|
};
|
14
|
-
|
4
|
+
var c = (t, i, e) => i.has(t) || p("Cannot " + e);
|
5
|
+
var v = (t, i, e) => (c(t, i, "read from private field"), e ? e.call(t) : i.get(t)), f = (t, i, e) => i.has(t) ? p("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), m = (t, i, e, n) => (c(t, i, "write to private field"), n ? n.call(t, e) : i.set(t, e), e);
|
6
|
+
import { FormBase as _ } from "../../internal/components/formBase.js";
|
7
|
+
import { Asterisk as y } from "../../internal/templates/asterisk.js";
|
8
|
+
import { componentStyles as b } from "../../styles/component.styles.js";
|
9
|
+
import { LocalizeController as g } from "../../utilities/localize.js";
|
10
|
+
import { nothing as k, html as $ } from "lit";
|
11
|
+
import { property as l, state as C, query as V } from "lit/decorators.js";
|
12
|
+
import { classMap as w } from "lit/directives/class-map.js";
|
13
|
+
import { ifDefined as q } from "lit/directives/if-defined.js";
|
14
|
+
import { styles as z } from "./switch.styles.js";
|
15
|
+
var A = Object.defineProperty, a = (t, i, e, n) => {
|
16
|
+
for (var h = void 0, d = t.length - 1, u; d >= 0; d--)
|
17
|
+
(u = t[d]) && (h = u(i, e, h) || h);
|
18
|
+
return h && A(i, e, h), h;
|
19
|
+
}, r;
|
20
|
+
const o = class o extends _ {
|
15
21
|
constructor() {
|
16
|
-
super(...arguments)
|
17
|
-
|
18
|
-
|
22
|
+
super(...arguments);
|
23
|
+
f(this, r);
|
24
|
+
m(this, r, new g(this)), this._initialChecked = !1, this.debug = !1, this.checked = !1, this.hideLabel = !1, this.lang = "en", this.size = "md", this.value = "", this._invalid = !1, this._handleChange = (e) => {
|
25
|
+
e.stopPropagation(), this.pristine = !1, this.checked = this.$input?.checked ?? !1, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(null), this.emitEvent("change");
|
19
26
|
}, this._handleInvalid = (e) => {
|
20
27
|
this.pristine = !1, this._invalid = !0, this.customErrorDisplay && e.preventDefault();
|
21
28
|
}, this._resetValue = (e) => {
|
@@ -39,21 +46,20 @@ const r = class r extends o {
|
|
39
46
|
}
|
40
47
|
/** @internal */
|
41
48
|
_validateInput() {
|
42
|
-
var e;
|
43
49
|
if (this._invalid = !1, this.required && !this.checked) {
|
44
50
|
this.pristine || (this._invalid = !0);
|
45
|
-
const
|
51
|
+
const e = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : (
|
46
52
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
47
|
-
|
53
|
+
this.$input?.validationMessage || "Please check this box if you want to proceed"
|
48
54
|
);
|
49
|
-
this.setValidity({ valueMissing: !0 }, String(
|
55
|
+
this.setValidity({ valueMissing: !0 }, String(e));
|
50
56
|
} else
|
51
57
|
this.setValidity({});
|
52
58
|
}
|
53
59
|
render() {
|
54
|
-
return
|
60
|
+
return $`
|
55
61
|
<label
|
56
|
-
class=${
|
62
|
+
class=${w({
|
57
63
|
switch: !0,
|
58
64
|
"switch--small": this.size === "sm"
|
59
65
|
})}
|
@@ -67,50 +73,50 @@ const r = class r extends o {
|
|
67
73
|
@reset=${this._resetValue}
|
68
74
|
aria-invalid=${!!this._invalid}
|
69
75
|
class="switch__input"
|
70
|
-
name=${
|
76
|
+
name=${q(this.name)}
|
71
77
|
type="checkbox"
|
72
78
|
value=${this.value}
|
73
79
|
/>
|
74
|
-
<div class="switch__label ${this.hideLabel ? "visually-hidden" :
|
80
|
+
<div class="switch__label ${this.hideLabel ? "visually-hidden" : k}">
|
75
81
|
<slot>${this.label}</slot>
|
76
|
-
${this.required ?
|
82
|
+
${this.required ? y(v(this, r).term("required"), "switch__asterisk") : null}
|
77
83
|
</div>
|
78
84
|
</label>
|
79
85
|
`;
|
80
86
|
}
|
81
87
|
};
|
82
|
-
r.styles = [
|
83
|
-
let
|
84
|
-
|
85
|
-
|
86
|
-
],
|
87
|
-
|
88
|
-
|
89
|
-
],
|
90
|
-
|
91
|
-
|
92
|
-
],
|
93
|
-
|
94
|
-
|
95
|
-
],
|
96
|
-
|
97
|
-
|
98
|
-
],
|
99
|
-
|
100
|
-
|
101
|
-
],
|
102
|
-
|
103
|
-
|
104
|
-
],
|
105
|
-
|
106
|
-
|
107
|
-
],
|
108
|
-
|
109
|
-
|
110
|
-
],
|
111
|
-
|
112
|
-
|
113
|
-
],
|
88
|
+
r = new WeakMap(), o.styles = [b, z];
|
89
|
+
let s = o;
|
90
|
+
a([
|
91
|
+
l({ type: Boolean })
|
92
|
+
], s.prototype, "debug");
|
93
|
+
a([
|
94
|
+
l({ type: Boolean, reflect: !0 })
|
95
|
+
], s.prototype, "checked");
|
96
|
+
a([
|
97
|
+
l({ type: Boolean, attribute: "hide-label", reflect: !0 })
|
98
|
+
], s.prototype, "hideLabel");
|
99
|
+
a([
|
100
|
+
l()
|
101
|
+
], s.prototype, "label");
|
102
|
+
a([
|
103
|
+
l({ type: String })
|
104
|
+
], s.prototype, "lang");
|
105
|
+
a([
|
106
|
+
l()
|
107
|
+
], s.prototype, "name");
|
108
|
+
a([
|
109
|
+
l({ reflect: !0 })
|
110
|
+
], s.prototype, "size");
|
111
|
+
a([
|
112
|
+
l()
|
113
|
+
], s.prototype, "value");
|
114
|
+
a([
|
115
|
+
C()
|
116
|
+
], s.prototype, "_invalid");
|
117
|
+
a([
|
118
|
+
V("input")
|
119
|
+
], s.prototype, "$input");
|
114
120
|
export {
|
115
|
-
|
121
|
+
s as SkfSwitch
|
116
122
|
};
|
@@ -12,7 +12,7 @@ export declare class SkfTabPanel extends SkfElement {
|
|
12
12
|
/** The tab panel's name. */
|
13
13
|
name: string;
|
14
14
|
active: boolean;
|
15
|
-
|
15
|
+
connectedCallback(): void;
|
16
16
|
/** @internal */
|
17
17
|
handleActiveChanged(): void;
|
18
18
|
render(): import("lit").TemplateResult<1>;
|
@@ -1,17 +1,20 @@
|
|
1
|
-
import { SkfElement as
|
2
|
-
import { watch as
|
3
|
-
import { componentStyles as
|
1
|
+
import { SkfElement as l } from "../../internal/components/skf-element.js";
|
2
|
+
import { watch as m } from "../../internal/helpers/watch.js";
|
3
|
+
import { componentStyles as h } from "../../styles/component.styles.js";
|
4
4
|
import { html as v } from "lit";
|
5
5
|
import { property as f, state as d } from "lit/decorators.js";
|
6
|
-
import { styles as
|
7
|
-
var
|
8
|
-
for (var t = o > 1 ? void 0 : o ?
|
9
|
-
(
|
10
|
-
return o && t &&
|
6
|
+
import { styles as u } from "./tab-panel.styles.js";
|
7
|
+
var y = Object.defineProperty, C = Object.getOwnPropertyDescriptor, p = (n, r, s, o) => {
|
8
|
+
for (var t = o > 1 ? void 0 : o ? C(r, s) : r, a = n.length - 1, i; a >= 0; a--)
|
9
|
+
(i = n[a]) && (t = (o ? i(r, s, t) : i(t)) || t);
|
10
|
+
return o && t && y(r, s, t), t;
|
11
11
|
};
|
12
|
-
const
|
12
|
+
const c = class c extends l {
|
13
13
|
constructor() {
|
14
|
-
super(), this.name = "", this.active = !1
|
14
|
+
super(...arguments), this.name = "", this.active = !1;
|
15
|
+
}
|
16
|
+
connectedCallback() {
|
17
|
+
super.connectedCallback(), this.role = "tabpanel";
|
15
18
|
}
|
16
19
|
handleActiveChanged() {
|
17
20
|
this.ariaHidden = this.active ? "false" : "true", this.tabIndex = this.active ? 0 : -1;
|
@@ -20,16 +23,16 @@ const m = class m extends c {
|
|
20
23
|
return v`<slot></slot>`;
|
21
24
|
}
|
22
25
|
};
|
23
|
-
|
24
|
-
let e =
|
25
|
-
|
26
|
+
c.styles = [h, u];
|
27
|
+
let e = c;
|
28
|
+
p([
|
26
29
|
f()
|
27
30
|
], e.prototype, "name", 2);
|
28
|
-
|
31
|
+
p([
|
29
32
|
d()
|
30
33
|
], e.prototype, "active", 2);
|
31
|
-
|
32
|
-
|
34
|
+
p([
|
35
|
+
m("active")
|
33
36
|
], e.prototype, "handleActiveChanged", 1);
|
34
37
|
export {
|
35
38
|
e as SkfTabPanel
|
@@ -1,24 +1,27 @@
|
|
1
|
-
import { SkfElement as
|
1
|
+
import { SkfElement as d } from "../../internal/components/skf-element.js";
|
2
2
|
import { watch as h } from "../../internal/helpers/watch.js";
|
3
3
|
import { componentStyles as m } from "../../styles/component.styles.js";
|
4
4
|
import { html as f } from "lit";
|
5
|
-
import { property as v, state as
|
5
|
+
import { property as v, state as n } from "lit/decorators.js";
|
6
6
|
import { classMap as b } from "lit/directives/class-map.js";
|
7
|
-
import { styles as
|
8
|
-
var
|
9
|
-
for (var e = r > 1 ? void 0 : r ? y(s, l) : s, i =
|
10
|
-
(o =
|
11
|
-
return r && e &&
|
7
|
+
import { styles as u } from "./tab.styles.js";
|
8
|
+
var _ = Object.defineProperty, y = Object.getOwnPropertyDescriptor, a = (p, s, l, r) => {
|
9
|
+
for (var e = r > 1 ? void 0 : r ? y(s, l) : s, i = p.length - 1, o; i >= 0; i--)
|
10
|
+
(o = p[i]) && (e = (r ? o(s, l, e) : o(e)) || e);
|
11
|
+
return r && e && _(s, l, e), e;
|
12
12
|
};
|
13
|
-
const
|
13
|
+
const c = class c extends d {
|
14
14
|
constructor() {
|
15
|
-
super(), this.panel = "", this.selected = !1, this.variant = "expanded", this._handleClick = () => {
|
15
|
+
super(...arguments), this.panel = "", this.selected = !1, this.variant = "expanded", this._handleClick = () => {
|
16
16
|
this.emit("skf-tab-select", {
|
17
17
|
detail: {
|
18
18
|
tab: this
|
19
19
|
}
|
20
20
|
});
|
21
|
-
}
|
21
|
+
};
|
22
|
+
}
|
23
|
+
connectedCallback() {
|
24
|
+
super.connectedCallback(), this.role = "tab", this.addEventListener("click", this._handleClick);
|
22
25
|
}
|
23
26
|
handleSelectedChange() {
|
24
27
|
this.ariaSelected = this.selected ? "true" : "false", this.tabIndex = this.selected ? 0 : -1;
|
@@ -38,16 +41,16 @@ const p = class p extends n {
|
|
38
41
|
`;
|
39
42
|
}
|
40
43
|
};
|
41
|
-
|
42
|
-
let t =
|
44
|
+
c.styles = [m, u];
|
45
|
+
let t = c;
|
43
46
|
a([
|
44
47
|
v({ reflect: !0 })
|
45
48
|
], t.prototype, "panel", 2);
|
46
49
|
a([
|
47
|
-
|
50
|
+
n()
|
48
51
|
], t.prototype, "selected", 2);
|
49
52
|
a([
|
50
|
-
|
53
|
+
n()
|
51
54
|
], t.prototype, "variant", 2);
|
52
55
|
a([
|
53
56
|
h("selected")
|
@@ -86,7 +86,7 @@ const e = o`
|
|
86
86
|
}
|
87
87
|
|
88
88
|
&:hover {
|
89
|
-
--_skf-tab-bg-color: var(--skf-color-blue-
|
89
|
+
--_skf-tab-bg-color: var(--skf-color-blue-lightest);
|
90
90
|
}
|
91
91
|
|
92
92
|
:host(:focus-visible) & {
|
@@ -97,7 +97,7 @@ const e = o`
|
|
97
97
|
.tab--expanded.tab--selected {
|
98
98
|
--_skf-tab-bg-color: var(--skf-bg-color-neutral-1);
|
99
99
|
--_skf-tab-border-bottom-color: transparent;
|
100
|
-
--_skf-tab-color: var(--skf-text-color-
|
100
|
+
--_skf-tab-color: var(--skf-text-color-emphasized);
|
101
101
|
|
102
102
|
font-weight: var(--skf-font-weight-bold);
|
103
103
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { SkfElement as p } from "../../internal/components/skf-element.js";
|
2
2
|
import { componentStyles as b } from "../../styles/component.styles.js";
|
3
3
|
import { html as f } from "lit";
|
4
|
-
import { property as o, queryAssignedElements as
|
4
|
+
import { property as o, queryAssignedElements as h } from "lit/decorators.js";
|
5
5
|
import { classMap as y } from "lit/directives/class-map.js";
|
6
6
|
import { styles as m } from "./tabs.styles.js";
|
7
|
-
var u = Object.defineProperty, n = (
|
8
|
-
for (var e = void 0, r =
|
9
|
-
(d =
|
7
|
+
var u = Object.defineProperty, n = (c, t, s, i) => {
|
8
|
+
for (var e = void 0, r = c.length - 1, d; r >= 0; r--)
|
9
|
+
(d = c[r]) && (e = d(t, s, e) || e);
|
10
10
|
return e && u(t, s, e), e;
|
11
11
|
};
|
12
12
|
const l = class l extends p {
|
@@ -87,10 +87,10 @@ n([
|
|
87
87
|
o({ reflect: !0 })
|
88
88
|
], a.prototype, "variant");
|
89
89
|
n([
|
90
|
-
|
90
|
+
h({ slot: "tabs", selector: "skf-tab" })
|
91
91
|
], a.prototype, "tabs");
|
92
92
|
n([
|
93
|
-
|
93
|
+
h({ slot: "", selector: "skf-tab-panel" })
|
94
94
|
], a.prototype, "panels");
|
95
95
|
export {
|
96
96
|
a as SkfTabs
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import '../icon/icon.js';
|
2
2
|
import { SkfElement } from '../../internal/components/skf-element';
|
3
3
|
import type { Icon, Severity } from '../../internal/types.js';
|
4
|
+
import { type Language } from '../../utilities/localize.js';
|
4
5
|
import { type CSSResultGroup } from 'lit';
|
5
6
|
type Size = 'sm' | 'md';
|
6
7
|
/**
|
@@ -16,21 +17,23 @@ export declare class SkfTag extends SkfElement {
|
|
16
17
|
#private;
|
17
18
|
static styles: CSSResultGroup;
|
18
19
|
/** @internal */
|
19
|
-
private
|
20
|
+
private _clickCallback?;
|
20
21
|
/** @internal */
|
21
|
-
private
|
22
|
+
private _preRemoveCallback?;
|
22
23
|
/** Specifies Tag size */
|
23
24
|
size: Size;
|
24
25
|
/** If defined, displays leading/provided icon */
|
25
26
|
icon?: Icon;
|
26
27
|
/** If defined, gives the supplied appearance */
|
27
28
|
color?: Severity;
|
29
|
+
/** Sets the internal language of the component */
|
30
|
+
lang: Language;
|
28
31
|
/** If defined, accepts a function that runs on click */
|
29
|
-
set
|
30
|
-
get
|
32
|
+
set clickCallback(clickCallbackFn: ((event: Event) => void) | undefined);
|
33
|
+
get clickCallback(): ((event: Event) => void) | undefined;
|
31
34
|
/** If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
|
32
|
-
set
|
33
|
-
get
|
35
|
+
set preRemoveCallback(preRemoveCallbackFn: ((event: Event) => void) | undefined);
|
36
|
+
get preRemoveCallback(): ((event: Event) => void) | undefined;
|
34
37
|
/** If true, adds trailing button to remove tag */
|
35
38
|
removable: boolean;
|
36
39
|
/** @internal */
|