@skf-design-system/ui-components 1.0.1-beta.0 → 1.0.2-beta.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/README.md +1 -18
- package/dist/components/accordion/accordion.component.d.ts +4 -4
- package/dist/components/accordion/accordion.component.js +8 -8
- package/dist/components/alert/alert.component.d.ts +8 -9
- package/dist/components/alert/alert.component.js +14 -14
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +1 -1
- package/dist/components/button/button.component.d.ts +3 -3
- package/dist/components/button/button.component.js +59 -55
- package/dist/components/card/card.component.js +18 -30
- package/dist/components/card/card.styles.js +25 -28
- package/dist/components/checkbox/checkbox.component.d.ts +9 -7
- package/dist/components/checkbox/checkbox.component.js +71 -58
- package/dist/components/collapse/collapse.component.js +1 -1
- package/dist/components/date-picker/datepicker.calendar.component.d.ts +77 -0
- package/dist/components/date-picker/datepicker.calendar.component.js +415 -0
- package/dist/components/date-picker/datepicker.calendar.styles.d.ts +1 -0
- package/dist/components/date-picker/datepicker.calendar.styles.js +202 -0
- package/dist/components/date-picker/datepicker.component.d.ts +79 -0
- package/dist/components/date-picker/datepicker.component.js +261 -0
- package/dist/components/date-picker/datepicker.d.ts +10 -0
- package/dist/components/date-picker/datepicker.helpers.d.ts +41 -0
- package/dist/components/date-picker/datepicker.helpers.js +76 -0
- package/dist/components/date-picker/datepicker.js +8 -0
- package/dist/components/date-picker/datepicker.styles.d.ts +1 -0
- package/dist/components/date-picker/datepicker.styles.js +87 -0
- package/dist/components/date-picker-input/datepicker-input.component.d.ts +115 -0
- package/dist/components/date-picker-input/datepicker-input.component.js +441 -0
- package/dist/components/date-picker-input/datepicker-input.d.ts +8 -0
- package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +38 -0
- package/dist/components/date-picker-input/datepicker-input.helpers.js +31 -0
- package/dist/components/date-picker-input/datepicker-input.js +6 -0
- package/dist/components/date-picker-input/datepicker-input.styles.d.ts +1 -0
- package/dist/components/date-picker-input/datepicker-input.styles.js +18 -0
- package/dist/components/dialog/dialog.component.d.ts +18 -28
- package/dist/components/dialog/dialog.component.js +94 -84
- package/dist/components/divider/divider.component.d.ts +4 -8
- package/dist/components/divider/divider.component.js +24 -46
- package/dist/components/divider/divider.styles.js +34 -30
- package/dist/components/drawer/drawer.component.d.ts +57 -0
- package/dist/components/drawer/drawer.component.js +124 -0
- package/dist/components/drawer/drawer.d.ts +8 -0
- package/dist/components/drawer/drawer.js +6 -0
- package/dist/components/drawer/drawer.styles.d.ts +1 -0
- package/dist/components/drawer/drawer.styles.js +71 -0
- package/dist/components/header/header.component.d.ts +45 -0
- package/dist/components/header/header.component.js +110 -0
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/header.js +6 -0
- package/dist/components/header/header.styles.d.ts +1 -0
- package/dist/components/header/header.styles.js +68 -0
- package/dist/components/heading/heading.component.d.ts +6 -12
- package/dist/components/heading/heading.component.js +17 -17
- package/dist/components/heading/heading.styles.d.ts +1 -2
- package/dist/components/heading/heading.styles.js +1 -1
- package/dist/components/icon/icon.component.d.ts +1 -1
- package/dist/components/icon/icon.component.js +19 -19
- package/dist/components/input/input.component.d.ts +3 -2
- package/dist/components/input/input.component.js +89 -82
- package/dist/components/input/input.controllers.d.ts +20 -6
- package/dist/components/input/input.controllers.js +14 -10
- package/dist/components/link/link.component.js +29 -28
- package/dist/components/link/link.styles.js +24 -20
- package/dist/components/loader/loader.component.js +19 -19
- package/dist/components/logo/logo.component.js +6 -6
- package/dist/components/menu/menu.component.d.ts +4 -5
- package/dist/components/menu/menu.component.js +1 -1
- package/dist/components/nav/nav.component.d.ts +17 -0
- package/dist/components/nav/nav.component.js +34 -0
- package/dist/components/nav/nav.d.ts +8 -0
- package/dist/components/nav/nav.js +6 -0
- package/dist/components/nav/nav.styles.d.ts +1 -0
- package/dist/components/nav/nav.styles.js +17 -0
- package/dist/components/nav-item/nav-item.component.d.ts +20 -0
- package/dist/components/nav-item/nav-item.component.js +38 -0
- package/dist/components/nav-item/nav-item.d.ts +8 -0
- package/dist/components/nav-item/nav-item.js +6 -0
- package/dist/components/nav-item/nav-item.styles.d.ts +1 -0
- package/dist/components/nav-item/nav-item.styles.js +39 -0
- package/dist/components/popover/popover.component.d.ts +5 -6
- package/dist/components/popover/popover.component.js +24 -24
- package/dist/components/progress/progress.component.js +7 -7
- package/dist/components/radio/radio.component.d.ts +10 -6
- package/dist/components/radio/radio.component.js +14 -14
- package/dist/components/radio/radio.styles.d.ts +1 -2
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button.component.d.ts +32 -0
- package/dist/components/segmented-button/segmented-button.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
- package/dist/components/segmented-button-item/segmented-button-item.component.d.ts +36 -0
- package/dist/components/segmented-button-item/segmented-button-item.d.ts +8 -0
- package/dist/components/segmented-button-item/segmented-button-item.styles.d.ts +1 -0
- package/dist/components/select/select.component.js +2 -2
- package/dist/components/select/select.controllers.d.ts +20 -9
- package/dist/components/select/select.controllers.js +27 -22
- package/dist/components/select-option/select-option.controllers.d.ts +11 -5
- package/dist/components/select-option-group/select-option-group.component.js +9 -9
- package/dist/components/stepper/stepper.component.d.ts +2 -1
- package/dist/components/stepper/stepper.component.js +9 -9
- package/dist/components/stepper/stepper.helpers.js +5 -5
- package/dist/components/stepper-item/stepper-item.component.js +25 -25
- package/dist/components/switch/switch.component.d.ts +7 -6
- package/dist/components/switch/switch.component.js +7 -7
- package/dist/components/tab/tab.component.js +4 -4
- package/dist/components/tab-panel/tab-panel.component.js +12 -12
- package/dist/components/tag/tag.component.d.ts +4 -2
- package/dist/components/tag/tag.component.js +14 -14
- package/dist/components/textarea/textarea.component.js +10 -10
- package/dist/components/toast/toast.component.d.ts +1 -1
- package/dist/components/toast/toast.component.js +13 -13
- package/dist/components/toast-wrapper/toast-wrapper.component.js +10 -10
- package/dist/components/tooltip/tooltip.component.d.ts +5 -6
- package/dist/components/tooltip/tooltip.component.js +11 -11
- package/dist/custom-elements.json +3702 -2190
- package/dist/index.d.ts +6 -0
- package/dist/index.js +84 -66
- package/dist/internal/base-classes/popover/popover.base.d.ts +17 -7
- package/dist/internal/base-classes/popover/popover.base.js +119 -75
- package/dist/internal/base-classes/popover/popover.styles.js +14 -1
- package/dist/internal/components/hint/hint.component.js +13 -13
- package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
- package/dist/internal/controllers/popover.controller.d.ts +12 -6
- package/dist/internal/controllers/popover.controller.js +9 -14
- package/dist/internal/helpers/dateFormatter.d.ts +2 -0
- package/dist/internal/helpers/utilityTypes.d.ts +22 -0
- package/dist/internal/helpers/uuid.d.ts +15 -0
- package/dist/internal/helpers/uuid.js +14 -0
- package/dist/internal/storybook/styles.d.ts +1 -0
- package/dist/styles/form-field.styles.js +11 -6
- package/dist/styles/global.css +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +663 -1240
- package/dist/types/vue/index.d.ts +453 -255
- package/dist/vscode.html-custom-data.json +821 -503
- package/dist/web-types.json +1005 -633
- package/package.json +43 -52
- package/dist/react/index.d.ts +0 -35
- package/dist/react/index.js +0 -35
- package/dist/react/skf-accordion/index.d.ts +0 -3
- package/dist/react/skf-accordion/index.js +0 -13
- package/dist/react/skf-alert/index.d.ts +0 -9
- package/dist/react/skf-alert/index.js +0 -17
- package/dist/react/skf-breadcrumb/index.d.ts +0 -9
- package/dist/react/skf-breadcrumb/index.js +0 -17
- package/dist/react/skf-breadcrumb-item/index.d.ts +0 -3
- package/dist/react/skf-breadcrumb-item/index.js +0 -13
- package/dist/react/skf-button/index.d.ts +0 -9
- package/dist/react/skf-button/index.js +0 -17
- package/dist/react/skf-card/index.d.ts +0 -3
- package/dist/react/skf-card/index.js +0 -13
- package/dist/react/skf-checkbox/index.d.ts +0 -9
- package/dist/react/skf-checkbox/index.js +0 -17
- package/dist/react/skf-collapse/index.d.ts +0 -9
- package/dist/react/skf-collapse/index.js +0 -17
- package/dist/react/skf-dialog/index.d.ts +0 -15
- package/dist/react/skf-dialog/index.js +0 -19
- package/dist/react/skf-divider/index.d.ts +0 -3
- package/dist/react/skf-divider/index.js +0 -13
- package/dist/react/skf-heading/index.d.ts +0 -3
- package/dist/react/skf-heading/index.js +0 -13
- package/dist/react/skf-icon/index.d.ts +0 -3
- package/dist/react/skf-icon/index.js +0 -13
- package/dist/react/skf-input/index.d.ts +0 -12
- package/dist/react/skf-input/index.js +0 -18
- package/dist/react/skf-link/index.d.ts +0 -3
- package/dist/react/skf-link/index.js +0 -13
- package/dist/react/skf-loader/index.d.ts +0 -3
- package/dist/react/skf-loader/index.js +0 -13
- package/dist/react/skf-logo/index.d.ts +0 -3
- package/dist/react/skf-logo/index.js +0 -13
- package/dist/react/skf-menu/index.d.ts +0 -12
- package/dist/react/skf-menu/index.js +0 -18
- package/dist/react/skf-menu-item/index.d.ts +0 -27
- package/dist/react/skf-menu-item/index.js +0 -23
- package/dist/react/skf-popover/index.d.ts +0 -12
- package/dist/react/skf-popover/index.js +0 -18
- package/dist/react/skf-progress/index.d.ts +0 -3
- package/dist/react/skf-progress/index.js +0 -13
- package/dist/react/skf-radio/index.d.ts +0 -9
- package/dist/react/skf-radio/index.js +0 -17
- package/dist/react/skf-select/index.d.ts +0 -21
- package/dist/react/skf-select/index.js +0 -21
- package/dist/react/skf-select-option/index.d.ts +0 -9
- package/dist/react/skf-select-option/index.js +0 -17
- package/dist/react/skf-select-option-group/index.d.ts +0 -3
- package/dist/react/skf-select-option-group/index.js +0 -13
- package/dist/react/skf-stepper/index.d.ts +0 -9
- package/dist/react/skf-stepper/index.js +0 -17
- package/dist/react/skf-stepper-item/index.d.ts +0 -9
- package/dist/react/skf-stepper-item/index.js +0 -17
- package/dist/react/skf-switch/index.d.ts +0 -3
- package/dist/react/skf-switch/index.js +0 -13
- package/dist/react/skf-tab/index.d.ts +0 -12
- package/dist/react/skf-tab/index.js +0 -18
- package/dist/react/skf-tab-group/index.d.ts +0 -3
- package/dist/react/skf-tab-group/index.js +0 -13
- package/dist/react/skf-tab-panel/index.d.ts +0 -3
- package/dist/react/skf-tab-panel/index.js +0 -13
- package/dist/react/skf-tag/index.d.ts +0 -3
- package/dist/react/skf-tag/index.js +0 -13
- package/dist/react/skf-textarea/index.d.ts +0 -12
- package/dist/react/skf-textarea/index.js +0 -18
- package/dist/react/skf-toast/index.d.ts +0 -3
- package/dist/react/skf-toast/index.js +0 -13
- package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
- package/dist/react/skf-toast-wrapper/index.js +0 -13
- package/dist/react/skf-tooltip/index.d.ts +0 -12
- package/dist/react/skf-tooltip/index.js +0 -18
@@ -1,10 +1,21 @@
|
|
1
1
|
import type { SkfSelectOption } from '../select-option/select-option.component.js';
|
2
|
-
import type { ReactiveController } from 'lit';
|
3
|
-
|
4
|
-
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
|
+
/**
|
4
|
+
* Workaround for storybook helper not being able to import types
|
5
|
+
* E.g type ControllerHost = SkfSelect;
|
6
|
+
*/
|
7
|
+
interface ControllerHostProps {
|
8
|
+
_expanded: boolean;
|
9
|
+
_optionsList: SkfSelectOption[];
|
10
|
+
localName: keyof HTMLElementTagNameMap;
|
11
|
+
min: number;
|
12
|
+
max: number;
|
13
|
+
multiple: boolean;
|
14
|
+
hideTags: boolean;
|
15
|
+
}
|
5
16
|
export declare class GlobalClickController implements ReactiveController {
|
6
|
-
host
|
7
|
-
constructor(host:
|
17
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
18
|
+
constructor(host: ReactiveControllerHost);
|
8
19
|
hostDisconnected(): void;
|
9
20
|
hostUpdated(): void;
|
10
21
|
_globalClickHandler: (event: MouseEvent) => void;
|
@@ -12,9 +23,9 @@ export declare class GlobalClickController implements ReactiveController {
|
|
12
23
|
disableGlobalClickDetection(): void;
|
13
24
|
}
|
14
25
|
export declare class KeyboardNavigationController implements ReactiveController {
|
15
|
-
host
|
26
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
16
27
|
_listenerActivated: boolean;
|
17
|
-
constructor(host:
|
28
|
+
constructor(host: ReactiveControllerHost);
|
18
29
|
hostDisconnected(): void;
|
19
30
|
hostUpdated(): void;
|
20
31
|
setupKeyboardListener(): void;
|
@@ -26,8 +37,8 @@ export declare class KeyboardNavigationController implements ReactiveController
|
|
26
37
|
get _selectableOptions(): SkfSelectOption[];
|
27
38
|
}
|
28
39
|
export declare class DeveloperFeedbackController implements ReactiveController {
|
29
|
-
host
|
30
|
-
constructor(host:
|
40
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
41
|
+
constructor(host: ReactiveControllerHost);
|
31
42
|
hostConnected(): void;
|
32
43
|
_badAttributeCombinationWarning(): void;
|
33
44
|
}
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { raiseError as
|
1
|
+
import { raiseError as a } from "../../internal/helpers/raiseError.js";
|
2
2
|
class d {
|
3
3
|
constructor(t) {
|
4
4
|
this._globalClickHandler = (e) => {
|
5
|
-
|
6
|
-
|
5
|
+
var s;
|
6
|
+
!((s = this.host) != null && s.localName) || e.target.closest(this.host.localName) || (this.host._expanded = !1);
|
7
|
+
}, (this.host = t).addController(this);
|
7
8
|
}
|
8
9
|
// hostConnected() {
|
9
10
|
// this.enableGlobalClickDetection();
|
@@ -12,7 +13,8 @@ class d {
|
|
12
13
|
this.disableGlobalClickDetection();
|
13
14
|
}
|
14
15
|
hostUpdated() {
|
15
|
-
|
16
|
+
var t;
|
17
|
+
(t = this.host) != null && t._expanded ? this.enableGlobalClickDetection() : this.disableGlobalClickDetection();
|
16
18
|
}
|
17
19
|
enableGlobalClickDetection() {
|
18
20
|
document.addEventListener("click", this._globalClickHandler);
|
@@ -35,18 +37,19 @@ class p {
|
|
35
37
|
e.preventDefault(), this._selectFocusedOption(e.target);
|
36
38
|
break;
|
37
39
|
case "Escape":
|
38
|
-
e.preventDefault(), this.host._expanded = !1, setTimeout(() => {
|
40
|
+
e.preventDefault(), this.host && (this.host._expanded = !1), setTimeout(() => {
|
39
41
|
this.host.focus();
|
40
42
|
});
|
41
43
|
break;
|
42
44
|
}
|
43
|
-
}, this.host = t
|
45
|
+
}, (this.host = t).addController(this), this._listenerActivated = !1;
|
44
46
|
}
|
45
47
|
hostDisconnected() {
|
46
48
|
this.removeKeyboardListener();
|
47
49
|
}
|
48
50
|
hostUpdated() {
|
49
|
-
|
51
|
+
var t, e;
|
52
|
+
(t = this.host) != null && t._expanded && !this._listenerActivated && this.setupKeyboardListener(), !((e = this.host) != null && e._expanded) && this._listenerActivated && this.removeKeyboardListener();
|
50
53
|
}
|
51
54
|
setupKeyboardListener() {
|
52
55
|
this._listenerActivated = !0, this.host.addEventListener("keydown", this._handleKeyDown);
|
@@ -61,47 +64,49 @@ class p {
|
|
61
64
|
});
|
62
65
|
}
|
63
66
|
_focusSiblingOption(t) {
|
64
|
-
const e = (
|
65
|
-
if (!
|
67
|
+
const e = (l) => l === document.activeElement, i = this._selectableOptions.find((l) => e(l));
|
68
|
+
if (!i) {
|
66
69
|
this._focusFirstOption();
|
67
70
|
return;
|
68
71
|
}
|
69
|
-
const
|
70
|
-
let
|
71
|
-
|
72
|
-
const h = this._selectableOptions[t === "next" ?
|
73
|
-
|
72
|
+
const s = this._selectableOptions.indexOf(i);
|
73
|
+
let o = s - 1, n = s + 1;
|
74
|
+
o < 0 && (o = this._selectableOptions.length - 1), n >= this._selectableOptions.length && (n = 0);
|
75
|
+
const h = this._selectableOptions[t === "next" ? n : o];
|
76
|
+
i.blur(), h.focus();
|
74
77
|
}
|
75
78
|
_selectFocusedOption(t) {
|
76
79
|
t.selected = !0;
|
77
80
|
}
|
78
81
|
get _selectableOptions() {
|
79
|
-
return this.host._optionsList.filter((t) => !t.disabled);
|
82
|
+
return !this.host || !this.host._optionsList ? [] : this.host._optionsList.filter((t) => !t.disabled);
|
80
83
|
}
|
81
84
|
}
|
82
85
|
class b {
|
83
86
|
constructor(t) {
|
84
|
-
this.host = t
|
87
|
+
(this.host = t).addController(this);
|
85
88
|
}
|
86
89
|
hostConnected() {
|
87
90
|
this._badAttributeCombinationWarning();
|
88
91
|
}
|
89
92
|
_badAttributeCombinationWarning() {
|
90
|
-
|
93
|
+
if (!this.host) return;
|
94
|
+
const t = this.host.localName ?? "never";
|
95
|
+
a({
|
91
96
|
assert: (this.host.min ?? 0) <= (this.host.max ?? 1 / 0),
|
92
97
|
reason: "attribute-mismatch",
|
93
|
-
replaceStrings: [
|
94
|
-
}),
|
98
|
+
replaceStrings: [t, "min", "smaller than max"]
|
99
|
+
}), a({
|
95
100
|
assert: (
|
96
101
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
97
102
|
(this.host.min || this.host.max) && this.host.multiple || !(this.host.min && this.host.max)
|
98
103
|
),
|
99
104
|
reason: "attribute-mismatch",
|
100
|
-
replaceStrings: [
|
101
|
-
}),
|
105
|
+
replaceStrings: [t, "min or max", "together with multiple"]
|
106
|
+
}), a({
|
102
107
|
assert: (this.host.hideTags && this.host.multiple) ?? !this.host.hideTags,
|
103
108
|
reason: "attribute-mismatch",
|
104
|
-
replaceStrings: [
|
109
|
+
replaceStrings: [t, "hide-tags", "together with multiple"]
|
105
110
|
});
|
106
111
|
}
|
107
112
|
}
|
@@ -1,9 +1,15 @@
|
|
1
|
-
import type {
|
2
|
-
|
3
|
-
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
2
|
+
/**
|
3
|
+
* Workaround for storybook helper not being able to import types
|
4
|
+
* E.g type ControllerHost = SkfSelectOption;
|
5
|
+
*/
|
6
|
+
interface ControllerHostProps {
|
7
|
+
localName: keyof HTMLElementTagNameMap;
|
8
|
+
_parent: HTMLElement | null;
|
9
|
+
}
|
4
10
|
export declare class DeveloperFeedbackController implements ReactiveController {
|
5
|
-
host
|
6
|
-
constructor(host:
|
11
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
12
|
+
constructor(host: ReactiveControllerHost);
|
7
13
|
hostUpdated(): void;
|
8
14
|
}
|
9
15
|
export {};
|
@@ -1,19 +1,19 @@
|
|
1
1
|
import { SkfElement as a } from "../../internal/components/skf-element.js";
|
2
2
|
import f from "../../styles/component.styles.js";
|
3
|
-
import { html as
|
3
|
+
import { html as p } from "lit";
|
4
4
|
import { property as d } from "lit/decorators.js";
|
5
|
-
import { styles as
|
6
|
-
var
|
7
|
-
for (var r = void 0, e =
|
8
|
-
(m =
|
9
|
-
return r &&
|
5
|
+
import { styles as n } from "./select-option-group.style.js";
|
6
|
+
var v = Object.defineProperty, u = (o, s, i, b) => {
|
7
|
+
for (var r = void 0, e = o.length - 1, m; e >= 0; e--)
|
8
|
+
(m = o[e]) && (r = m(s, i, r) || r);
|
9
|
+
return r && v(s, i, r), r;
|
10
10
|
};
|
11
11
|
const l = class l extends a {
|
12
12
|
constructor() {
|
13
13
|
super(...arguments), this.label = "Default label";
|
14
14
|
}
|
15
15
|
render() {
|
16
|
-
return
|
16
|
+
return p`
|
17
17
|
<div role="group">
|
18
18
|
<div id="label">${this.label}</div>
|
19
19
|
<slot></slot>
|
@@ -21,9 +21,9 @@ const l = class l extends a {
|
|
21
21
|
`;
|
22
22
|
}
|
23
23
|
};
|
24
|
-
l.styles = [f,
|
24
|
+
l.styles = [f, n];
|
25
25
|
let t = l;
|
26
|
-
|
26
|
+
u([
|
27
27
|
d({ reflect: !0 })
|
28
28
|
], t.prototype, "label");
|
29
29
|
export {
|
@@ -4,7 +4,7 @@ import { type CSSResultGroup } from 'lit';
|
|
4
4
|
/**
|
5
5
|
* The `<skf-stepper>` is a component that displays a list of actions or options.
|
6
6
|
*
|
7
|
-
* @documentation See [zeroheight](https://zeroheight.com
|
7
|
+
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/842a0a-stepper) for design principles
|
8
8
|
*
|
9
9
|
* @slot - One or more `<skf-stepper-item>`
|
10
10
|
*
|
@@ -27,6 +27,7 @@ export declare class SkfStepper extends SkfElement {
|
|
27
27
|
_handleActiveIndexChanged(): void;
|
28
28
|
/** @internal */
|
29
29
|
_handleLinearMode(): void;
|
30
|
+
/** @internal */
|
30
31
|
private _handleSelected;
|
31
32
|
/** @internal */
|
32
33
|
private _resetActive;
|
@@ -12,20 +12,20 @@ import { classMap as A } from "lit/directives/class-map.js";
|
|
12
12
|
import { stepperState as C } from "./stepper.helpers.js";
|
13
13
|
import { styles as b } from "./stepper.styles.js";
|
14
14
|
var E = Object.defineProperty, S = Object.getOwnPropertyDescriptor, h = (t, i, e, s) => {
|
15
|
-
for (var n = s > 1 ? void 0 : s ? S(i, e) : i, r = t.length - 1,
|
16
|
-
(
|
15
|
+
for (var n = s > 1 ? void 0 : s ? S(i, e) : i, r = t.length - 1, d; r >= 0; r--)
|
16
|
+
(d = t[r]) && (n = (s ? d(i, e, n) : d(n)) || n);
|
17
17
|
return s && n && E(i, e, n), n;
|
18
|
-
},
|
18
|
+
}, o;
|
19
19
|
const c = class c extends I {
|
20
20
|
constructor() {
|
21
21
|
super();
|
22
|
-
f(this,
|
23
|
-
l(this,
|
24
|
-
if (!_(this,
|
25
|
-
const { item: s, triggerActiveIndexUpdate: n } = e.detail, r = [...this._items ?? []].findIndex((
|
22
|
+
f(this, o);
|
23
|
+
l(this, o, !1), this.activeIndex = -1, this.linear = !1, this._handleSelected = (e) => {
|
24
|
+
if (!_(this, o)) return;
|
25
|
+
const { item: s, triggerActiveIndexUpdate: n } = e.detail, r = [...this._items ?? []].findIndex((d) => d === s);
|
26
26
|
r === this.activeIndex ? this._handleActiveIndexChanged() : (n && this._resetActive(r), this.activeIndex = r);
|
27
27
|
}, this._handleSlotChanged = () => {
|
28
|
-
l(this,
|
28
|
+
l(this, o, !0), this.activeIndex = this._getCurrentActiveIndex();
|
29
29
|
}, this.addEventListener("skf-stepper-item-select", this._handleSelected);
|
30
30
|
}
|
31
31
|
firstUpdated() {
|
@@ -69,7 +69,7 @@ const c = class c extends I {
|
|
69
69
|
`;
|
70
70
|
}
|
71
71
|
};
|
72
|
-
|
72
|
+
o = new WeakMap(), c.styles = [u, b];
|
73
73
|
let a = c;
|
74
74
|
h([
|
75
75
|
x({ type: Number })
|
@@ -1,17 +1,17 @@
|
|
1
1
|
const A = ({
|
2
2
|
activeIndex: c,
|
3
3
|
items: r,
|
4
|
-
linear:
|
4
|
+
linear: i,
|
5
5
|
state: o,
|
6
|
-
index:
|
6
|
+
index: e
|
7
7
|
}) => {
|
8
8
|
var l;
|
9
|
-
const
|
10
|
-
isCurrentStep:
|
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 = {
|
10
|
+
isCurrentStep: a,
|
11
11
|
isDisabled: d,
|
12
12
|
isSpan: s
|
13
13
|
};
|
14
|
-
return
|
14
|
+
return u ? { stateLabel: "enabled", ...t } : v ? { stateLabel: "active", ...t } : m ? { stateLabel: "activeCompleted", ...t } : f ? { stateLabel: "completed", ...t } : { stateLabel: void 0, ...t };
|
15
15
|
};
|
16
16
|
export {
|
17
17
|
A as stepperState
|
@@ -1,8 +1,8 @@
|
|
1
|
-
var
|
1
|
+
var v = (e) => {
|
2
2
|
throw TypeError(e);
|
3
3
|
};
|
4
|
-
var
|
5
|
-
var
|
4
|
+
var u = (e, i, t) => i.has(e) || v("Cannot " + t);
|
5
|
+
var d = (e, i, t) => (u(e, i, "read from private field"), t ? t.call(e) : i.get(e)), _ = (e, i, t) => i.has(e) ? v("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), r = (e, i, t, s) => (u(e, i, "write to private field"), s ? s.call(e, t) : i.set(e, t), t);
|
6
6
|
import "../icon/icon.js";
|
7
7
|
import { SkfElement as b } from "../../internal/components/skf-element.js";
|
8
8
|
import { watch as g } from "../../internal/helpers/watch.js";
|
@@ -11,25 +11,25 @@ import "lit";
|
|
11
11
|
import { property as y, state as c } from "lit/decorators.js";
|
12
12
|
import { classMap as $ } from "lit/directives/class-map.js";
|
13
13
|
import { ifDefined as x } from "lit/directives/if-defined.js";
|
14
|
-
import {
|
14
|
+
import { unsafeStatic as w, literal as U, html as S } from "lit/static-html.js";
|
15
15
|
import { styles as I } from "./stepper-item.styles.js";
|
16
|
-
var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor,
|
17
|
-
for (var p = s > 1 ? void 0 : s ? P(i, t) : i,
|
18
|
-
(
|
16
|
+
var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor, l = (e, i, t, s) => {
|
17
|
+
for (var p = s > 1 ? void 0 : s ? P(i, t) : i, h = e.length - 1, m; h >= 0; h--)
|
18
|
+
(m = e[h]) && (p = (s ? m(i, t, p) : m(p)) || p);
|
19
19
|
return s && p && O(i, t, p), p;
|
20
|
-
},
|
20
|
+
}, o, n;
|
21
21
|
const f = class f extends b {
|
22
22
|
constructor() {
|
23
23
|
super();
|
24
|
-
_(this,
|
24
|
+
_(this, o);
|
25
25
|
_(this, n);
|
26
|
-
r(this,
|
26
|
+
r(this, o, !1), r(this, n, !1), this.completed = !1, this._index = 0, this._linear = !1, this._handleClick = () => {
|
27
27
|
this._linear || (this.state = "active");
|
28
28
|
}, this.role = "listitem";
|
29
29
|
}
|
30
30
|
set _setInternalState(t) {
|
31
|
-
r(this,
|
32
|
-
r(this,
|
31
|
+
r(this, o, !0), this._uiState = t, t === "active" || t === "activeCompleted" ? this.state = t === "active" ? "active" : "completed" : this.state = void 0, setTimeout(() => {
|
32
|
+
r(this, o, !1);
|
33
33
|
});
|
34
34
|
}
|
35
35
|
get _setInternalState() {
|
@@ -44,8 +44,8 @@ const f = class f extends b {
|
|
44
44
|
this._setInternalState = "activeCompleted";
|
45
45
|
return;
|
46
46
|
}
|
47
|
-
if (
|
48
|
-
r(this,
|
47
|
+
if (d(this, o)) {
|
48
|
+
r(this, o, !1);
|
49
49
|
return;
|
50
50
|
}
|
51
51
|
r(this, n, ["active", "completed"].includes(String(this.state)) && !["active", "activeCompleted"].includes(String(this._uiState))), this._emitUpdate();
|
@@ -55,12 +55,12 @@ const f = class f extends b {
|
|
55
55
|
this.emit("skf-stepper-item-select", {
|
56
56
|
detail: {
|
57
57
|
item: this,
|
58
|
-
triggerActiveIndexUpdate:
|
58
|
+
triggerActiveIndexUpdate: d(this, n)
|
59
59
|
}
|
60
60
|
}), r(this, n, !1);
|
61
61
|
}
|
62
62
|
render() {
|
63
|
-
const t = this._linear ? "div" : "button", s =
|
63
|
+
const t = this._linear ? "div" : "button", s = U`${w(t)}`;
|
64
64
|
return S`
|
65
65
|
<${s}
|
66
66
|
@click=${this._handleClick}
|
@@ -82,30 +82,30 @@ const f = class f extends b {
|
|
82
82
|
`;
|
83
83
|
}
|
84
84
|
};
|
85
|
-
|
85
|
+
o = new WeakMap(), n = new WeakMap(), f.styles = [C, I];
|
86
86
|
let a = f;
|
87
|
-
|
87
|
+
l([
|
88
88
|
y({ reflect: !0 })
|
89
89
|
], a.prototype, "state", 2);
|
90
|
-
|
90
|
+
l([
|
91
91
|
y({ type: Boolean })
|
92
92
|
], a.prototype, "completed", 2);
|
93
|
-
|
93
|
+
l([
|
94
94
|
c()
|
95
95
|
], a.prototype, "_disabled", 2);
|
96
|
-
|
96
|
+
l([
|
97
97
|
c()
|
98
98
|
], a.prototype, "_index", 2);
|
99
|
-
|
99
|
+
l([
|
100
100
|
c()
|
101
101
|
], a.prototype, "_linear", 2);
|
102
|
-
|
102
|
+
l([
|
103
103
|
c()
|
104
104
|
], a.prototype, "_uiState", 2);
|
105
|
-
|
105
|
+
l([
|
106
106
|
c()
|
107
107
|
], a.prototype, "_setInternalState", 1);
|
108
|
-
|
108
|
+
l([
|
109
109
|
g("state")
|
110
110
|
], a.prototype, "_handleState", 1);
|
111
111
|
export {
|
@@ -4,10 +4,10 @@ import { type CSSResultGroup } from 'lit';
|
|
4
4
|
/**
|
5
5
|
* The `<skf-switch>` is a component that displays a list of actions or options
|
6
6
|
*
|
7
|
-
*
|
7
|
+
* See [zeroheight](https://zeroheight.com/853e936c9/p/7282a2-switch) for design principle
|
8
8
|
*
|
9
|
-
* @attribute {boolean} disabled - If true, sets disabled state
|
10
|
-
* @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
|
9
|
+
* @attribute {boolean} [disabled=false] - If true, sets disabled state
|
10
|
+
* @attribute {boolean} [required=false] - If true, value is required or must be checked for the form to be submittable
|
11
11
|
*
|
12
12
|
* @slot - The Switchs label. Alternatively, you can use the `label` attribute.
|
13
13
|
*
|
@@ -15,13 +15,14 @@ import { type CSSResultGroup } from 'lit';
|
|
15
15
|
*/
|
16
16
|
export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
|
17
17
|
static styles: CSSResultGroup;
|
18
|
+
/** @internal */
|
18
19
|
private _initialChecked;
|
19
20
|
/** If true, outputs helping hints in console */
|
20
|
-
debug
|
21
|
+
debug: boolean;
|
21
22
|
/** If true, outputs helping hints in console */
|
22
|
-
checked
|
23
|
+
checked: boolean;
|
23
24
|
/** If true, hides the label visually */
|
24
|
-
hideLabel
|
25
|
+
hideLabel: boolean;
|
25
26
|
/** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
|
26
27
|
label?: string;
|
27
28
|
/** If defined, adds name to the input-element */
|
@@ -7,15 +7,15 @@ import { classMap as m } from "lit/directives/class-map.js";
|
|
7
7
|
import { ifDefined as _ } from "lit/directives/if-defined.js";
|
8
8
|
import { styles as b } from "./switch.styles.js";
|
9
9
|
var y = Object.defineProperty, i = (d, e, a, g) => {
|
10
|
-
for (var l = void 0,
|
11
|
-
(n = d[
|
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
12
|
return l && y(e, a, l), l;
|
13
13
|
};
|
14
|
-
const
|
14
|
+
const r = class r extends o {
|
15
15
|
constructor() {
|
16
|
-
super(...arguments), this._initialChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._handleChange = (e) => {
|
16
|
+
super(...arguments), this._initialChecked = !1, this.debug = !1, this.checked = !1, this.hideLabel = !1, this.size = "md", this.value = "", this._invalid = !1, this._handleChange = (e) => {
|
17
17
|
var a;
|
18
|
-
e.stopPropagation(), this.pristine = !1, this.checked = (a = this.$input) == null ? void 0 : a.checked, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(null), this.emitEvent("change");
|
18
|
+
e.stopPropagation(), this.pristine = !1, this.checked = ((a = this.$input) == null ? void 0 : a.checked) ?? !1, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(null), this.emitEvent("change");
|
19
19
|
}, this._handleInvalid = (e) => {
|
20
20
|
this.pristine = !1, this._invalid = !0, this.customErrorDisplay && e.preventDefault();
|
21
21
|
}, this._resetValue = (e) => {
|
@@ -79,8 +79,8 @@ const h = class h extends o {
|
|
79
79
|
`;
|
80
80
|
}
|
81
81
|
};
|
82
|
-
|
83
|
-
let t =
|
82
|
+
r.styles = [p, b];
|
83
|
+
let t = r;
|
84
84
|
i([
|
85
85
|
s({ type: Boolean })
|
86
86
|
], t.prototype, "debug");
|
@@ -4,11 +4,11 @@ import m from "../../styles/component.styles.js";
|
|
4
4
|
import { html as f } from "lit";
|
5
5
|
import { property as v, state as d } from "lit/decorators.js";
|
6
6
|
import { classMap as b } from "lit/directives/class-map.js";
|
7
|
-
import { styles as
|
8
|
-
var
|
7
|
+
import { styles as _ } from "./tab.styles.js";
|
8
|
+
var u = Object.defineProperty, y = Object.getOwnPropertyDescriptor, a = (c, s, l, r) => {
|
9
9
|
for (var e = r > 1 ? void 0 : r ? y(s, l) : s, i = c.length - 1, o; i >= 0; i--)
|
10
10
|
(o = c[i]) && (e = (r ? o(s, l, e) : o(e)) || e);
|
11
|
-
return r && e &&
|
11
|
+
return r && e && u(s, l, e), e;
|
12
12
|
};
|
13
13
|
const p = class p extends n {
|
14
14
|
constructor() {
|
@@ -38,7 +38,7 @@ const p = class p extends n {
|
|
38
38
|
`;
|
39
39
|
}
|
40
40
|
};
|
41
|
-
p.styles = [m,
|
41
|
+
p.styles = [m, _];
|
42
42
|
let t = p;
|
43
43
|
a([
|
44
44
|
v({ reflect: !0 })
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { SkfElement as c } from "../../internal/components/skf-element.js";
|
2
2
|
import { watch as h } from "../../internal/helpers/watch.js";
|
3
3
|
import l from "../../styles/component.styles.js";
|
4
|
-
import { html as
|
5
|
-
import { property as
|
6
|
-
import { styles as
|
7
|
-
var
|
8
|
-
for (var t = o > 1 ? void 0 : o ? _(r, s) : r, i =
|
9
|
-
(p =
|
10
|
-
return o && t &&
|
4
|
+
import { html as v } from "lit";
|
5
|
+
import { property as f, state as d } from "lit/decorators.js";
|
6
|
+
import { styles as y } from "./tab-panel.styles.js";
|
7
|
+
var u = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, a = (n, r, s, o) => {
|
8
|
+
for (var t = o > 1 ? void 0 : o ? _(r, s) : r, i = n.length - 1, p; i >= 0; i--)
|
9
|
+
(p = n[i]) && (t = (o ? p(r, s, t) : p(t)) || t);
|
10
|
+
return o && t && u(r, s, t), t;
|
11
11
|
};
|
12
|
-
const
|
12
|
+
const m = class m extends c {
|
13
13
|
constructor() {
|
14
14
|
super(), this.name = "", this.active = !1, this.role = "tabpanel";
|
15
15
|
}
|
@@ -17,13 +17,13 @@ const n = class n extends c {
|
|
17
17
|
this.ariaHidden = this.active ? "false" : "true", this.tabIndex = this.active ? 0 : -1;
|
18
18
|
}
|
19
19
|
render() {
|
20
|
-
return
|
20
|
+
return v`<slot></slot>`;
|
21
21
|
}
|
22
22
|
};
|
23
|
-
|
24
|
-
let e =
|
23
|
+
m.styles = [l, y];
|
24
|
+
let e = m;
|
25
25
|
a([
|
26
|
-
|
26
|
+
f()
|
27
27
|
], e.prototype, "name", 2);
|
28
28
|
a([
|
29
29
|
d()
|
@@ -13,10 +13,12 @@ import { type CSSResultGroup } from 'lit';
|
|
13
13
|
*/
|
14
14
|
export declare class SkfTag extends SkfElement {
|
15
15
|
static styles: CSSResultGroup;
|
16
|
+
/** @internal */
|
16
17
|
private _onClick?;
|
18
|
+
/** @internal */
|
17
19
|
protected _onRemove?: (event: Event) => void;
|
18
20
|
/** Specifies Tag size */
|
19
|
-
size: 'sm' | 'md'
|
21
|
+
size: 'sm' | 'md';
|
20
22
|
/**
|
21
23
|
* If defined, displays leading/provided icon
|
22
24
|
* @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" }
|
@@ -34,7 +36,7 @@ export declare class SkfTag extends SkfElement {
|
|
34
36
|
set onRemove(onRemoveFn: ((event: Event) => void) | undefined);
|
35
37
|
get onRemove(): ((event: Event) => void) | undefined;
|
36
38
|
/** If true, adds trailing button to remove tag */
|
37
|
-
removable
|
39
|
+
removable: boolean;
|
38
40
|
/** @internal */
|
39
41
|
$removeButton: HTMLButtonElement;
|
40
42
|
connectedCallback(): void;
|
@@ -1,19 +1,19 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
2
|
import { SkfElement as u } from "../../internal/components/skf-element.js";
|
3
3
|
import f from "../../styles/component.styles.js";
|
4
|
-
import {
|
5
|
-
import { property as
|
6
|
-
import { classMap as
|
4
|
+
import { nothing as p, html as a } from "lit";
|
5
|
+
import { property as l, query as v } from "lit/decorators.js";
|
6
|
+
import { classMap as d } from "lit/directives/class-map.js";
|
7
7
|
import { ifDefined as _ } from "lit/directives/if-defined.js";
|
8
8
|
import { styles as k } from "./tag.styles.js";
|
9
9
|
var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (m, t, s, r) => {
|
10
|
-
for (var e = r > 1 ? void 0 : r ? y(t, s) : t,
|
11
|
-
(c = m[
|
10
|
+
for (var e = r > 1 ? void 0 : r ? y(t, s) : t, n = m.length - 1, c; n >= 0; n--)
|
11
|
+
(c = m[n]) && (e = (r ? c(t, s, e) : c(e)) || e);
|
12
12
|
return r && e && b(t, s, e), e;
|
13
13
|
};
|
14
14
|
const h = class h extends u {
|
15
15
|
constructor() {
|
16
|
-
super(...arguments), this.size = "md", this._handleKeyDown = (t) => {
|
16
|
+
super(...arguments), this.size = "md", this.removable = !1, this._handleKeyDown = (t) => {
|
17
17
|
(t.key === "Enter" || t.key === " ") && this.$removeButton.click();
|
18
18
|
}, this._handleRemove = (t) => {
|
19
19
|
this._onRemove && this._onRemove(t);
|
@@ -48,7 +48,7 @@ const h = class h extends u {
|
|
48
48
|
render() {
|
49
49
|
return a`
|
50
50
|
<div
|
51
|
-
class=${
|
51
|
+
class=${d({
|
52
52
|
tag: !0,
|
53
53
|
"tag--color-alert": this.color === "alert",
|
54
54
|
"tag--color-error": this.color === "error",
|
@@ -79,25 +79,25 @@ const h = class h extends u {
|
|
79
79
|
h.styles = [f, k];
|
80
80
|
let o = h;
|
81
81
|
i([
|
82
|
-
|
82
|
+
l({ reflect: !0 })
|
83
83
|
], o.prototype, "size", 2);
|
84
84
|
i([
|
85
|
-
|
85
|
+
l()
|
86
86
|
], o.prototype, "icon", 2);
|
87
87
|
i([
|
88
|
-
|
88
|
+
l({ reflect: !0 })
|
89
89
|
], o.prototype, "color", 2);
|
90
90
|
i([
|
91
|
-
|
91
|
+
l({ attribute: !1 })
|
92
92
|
], o.prototype, "onClick", 1);
|
93
93
|
i([
|
94
|
-
|
94
|
+
l({ attribute: !1 })
|
95
95
|
], o.prototype, "onRemove", 1);
|
96
96
|
i([
|
97
|
-
|
97
|
+
l({ type: Boolean, reflect: !0 })
|
98
98
|
], o.prototype, "removable", 2);
|
99
99
|
i([
|
100
|
-
|
100
|
+
v("button")
|
101
101
|
], o.prototype, "$removeButton", 2);
|
102
102
|
export {
|
103
103
|
o as SkfTag
|