@skf-design-system/ui-components 1.0.1-beta.1 → 1.0.2-beta.1
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 +13 -26
- package/dist/components/accordion/accordion-item.component.d.ts +36 -0
- package/dist/components/accordion/accordion-item.component.js +87 -0
- package/dist/components/accordion/accordion-item.d.ts +3 -3
- package/dist/components/accordion/accordion-item.js +4 -5
- package/dist/components/accordion/accordion-item.styles.js +77 -0
- package/dist/components/accordion/accordion.component.d.ts +9 -13
- package/dist/components/accordion/accordion.component.js +12 -13
- package/dist/components/accordion/accordion.d.ts +0 -1
- package/dist/components/accordion/accordion.js +0 -2
- package/dist/components/alert/alert.component.d.ts +6 -10
- package/dist/components/alert/alert.component.js +15 -16
- package/dist/components/alert/alert.styles.js +0 -5
- package/dist/components/breadcrumb/breadcrumb-item.component.js +61 -0
- package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +62 -0
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.component.js +60 -0
- package/dist/components/breadcrumb/breadcrumb.js +6 -0
- package/dist/components/breadcrumb/breadcrumb.styles.js +22 -0
- package/dist/components/button/button.component.d.ts +13 -10
- package/dist/components/button/button.component.js +83 -76
- package/dist/components/button/button.styles.d.ts +1 -2
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/card/card.component.d.ts +1 -1
- 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 +16 -14
- package/dist/components/checkbox/checkbox.component.js +5 -5
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
- package/dist/components/checkbox/checkbox.styles.js +1 -5
- package/dist/components/date-picker/datepicker.calendar.component.d.ts +5 -0
- package/dist/components/date-picker/datepicker.calendar.component.js +128 -95
- package/dist/components/date-picker/datepicker.calendar.styles.js +35 -25
- package/dist/components/date-picker/datepicker.component.d.ts +5 -0
- package/dist/components/date-picker/datepicker.component.js +117 -97
- package/dist/components/date-picker/datepicker.helpers.d.ts +3 -2
- package/dist/components/date-picker/datepicker.helpers.js +46 -39
- package/dist/components/date-picker/datepicker.styles.js +14 -26
- package/dist/components/date-picker-input/datepicker-input.component.d.ts +14 -5
- package/dist/components/date-picker-input/datepicker-input.component.js +264 -219
- package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +36 -2
- package/dist/components/date-picker-input/datepicker-input.helpers.js +25 -23
- package/dist/components/date-picker-input/datepicker-input.styles.js +6 -10
- package/dist/components/dialog/dialog.component.d.ts +20 -29
- package/dist/components/dialog/dialog.component.js +85 -75
- package/dist/components/dialog/dialog.styles.js +4 -4
- 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 +61 -0
- package/dist/components/drawer/drawer.component.js +125 -0
- package/dist/components/drawer/drawer.d.ts +8 -0
- package/dist/components/drawer/drawer.js +6 -0
- package/dist/components/drawer/drawer.styles.js +71 -0
- package/dist/components/header/header.component.d.ts +46 -0
- package/dist/components/header/header.component.js +116 -0
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/header.js +6 -0
- package/dist/components/header/header.styles.js +68 -0
- package/dist/components/heading/heading.component.d.ts +3 -11
- package/dist/components/heading/heading.component.js +24 -23
- 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 +11 -17
- package/dist/components/icon/icon.component.js +2 -2
- package/dist/components/icon/icon.styles.d.ts +1 -2
- package/dist/components/icon/icon.styles.js +1 -1
- package/dist/components/input/input.component.d.ts +30 -31
- package/dist/components/input/input.component.js +138 -125
- 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.d.ts +12 -14
- package/dist/components/link/link.component.js +35 -34
- package/dist/components/link/link.styles.d.ts +1 -2
- package/dist/components/link/link.styles.js +24 -20
- package/dist/components/loader/loader.component.d.ts +1 -1
- package/dist/components/loader/loader.component.js +36 -40
- package/dist/components/loader/loader.styles.d.ts +1 -2
- package/dist/components/loader/loader.styles.js +40 -32
- package/dist/components/logo/logo.component.d.ts +4 -5
- package/dist/components/logo/logo.component.js +1 -1
- package/dist/components/menu/menu-item.component.d.ts +13 -0
- package/dist/components/{menu-item → menu}/menu-item.component.js +3 -3
- package/dist/components/menu/menu.component.d.ts +10 -8
- package/dist/components/menu/menu.component.js +8 -10
- package/dist/components/nav/nav-item.component.d.ts +18 -0
- package/dist/components/nav/nav-item.component.js +38 -0
- package/dist/components/nav/nav-item.d.ts +8 -0
- package/dist/components/nav/nav-item.js +6 -0
- package/dist/components/nav/nav-item.styles.js +39 -0
- 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/popover/popover.component.d.ts +11 -8
- package/dist/components/popover/popover.component.js +24 -26
- package/dist/components/progress/progress.component.d.ts +2 -2
- package/dist/components/progress/progress.component.js +31 -37
- package/dist/components/progress/progress.styles.js +40 -35
- package/dist/components/radio/radio.component.d.ts +19 -13
- package/dist/components/radio/radio.component.js +12 -12
- 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-item.component.d.ts +36 -0
- package/dist/components/segmented-button/segmented-button-item.component.js +56 -0
- package/dist/components/segmented-button/segmented-button-item.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button-item.js +6 -0
- package/dist/components/segmented-button/segmented-button-item.styles.d.ts +1 -0
- package/dist/components/segmented-button/segmented-button-item.styles.js +62 -0
- package/dist/components/segmented-button/segmented-button.component.d.ts +30 -0
- package/dist/components/segmented-button/segmented-button.component.js +73 -0
- package/dist/components/segmented-button/segmented-button.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button.js +6 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
- package/dist/components/segmented-button/segmented-button.styles.js +16 -0
- package/dist/components/{select-option-group → select}/select-option-group.component.js +1 -1
- package/dist/components/select/select-option-group.style.d.ts +1 -0
- package/dist/components/{select-option → select}/select-option.component.d.ts +7 -8
- package/dist/components/{select-option → select}/select-option.component.js +15 -15
- package/dist/components/select/select-option.controllers.d.ts +15 -0
- package/dist/components/select/select-option.styles.d.ts +1 -0
- package/dist/components/select/select.component.d.ts +16 -15
- package/dist/components/select/select.component.js +19 -19
- package/dist/components/select/select.controllers.d.ts +21 -10
- package/dist/components/select/select.controllers.js +31 -23
- package/dist/components/select/select.stories.icons.d.ts +7 -0
- package/dist/components/{stepper-item → stepper}/stepper-item.component.js +8 -8
- package/dist/components/stepper/stepper-item.styles.d.ts +1 -0
- package/dist/components/stepper/stepper.component.d.ts +4 -3
- package/dist/components/stepper/stepper.component.js +15 -15
- package/dist/components/stepper/stepper.helpers.d.ts +1 -1
- package/dist/components/switch/switch.component.d.ts +7 -6
- package/dist/components/switch/switch.component.js +21 -21
- package/dist/components/tab/tab.component.js +1 -1
- package/dist/components/tab-group/tab-group.component.js +1 -1
- package/dist/components/tab-panel/tab-panel.component.js +1 -1
- package/dist/components/tag/tag.component.d.ts +14 -16
- package/dist/components/tag/tag.component.js +36 -39
- package/dist/components/textarea/textarea.component.d.ts +10 -11
- package/dist/components/textarea/textarea.component.js +65 -67
- package/dist/components/{toast-item → toast}/toast-item.d.ts +2 -0
- package/dist/components/{toast-item → toast}/toast-item.js +4 -0
- package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.js +1 -1
- package/dist/components/toast/toast-wrapper.styles.d.ts +1 -0
- package/dist/components/toast/toast.component.d.ts +6 -5
- package/dist/components/toast/toast.component.js +15 -15
- package/dist/components/toast/toast.singleton.d.ts +4 -4
- package/dist/components/toast/toast.singleton.js +12 -12
- package/dist/components/tooltip/tooltip.component.d.ts +7 -7
- package/dist/components/tooltip/tooltip.component.js +16 -11
- package/dist/custom-elements.json +2718 -2073
- package/dist/index.d.ts +16 -6
- package/dist/index.js +103 -75
- package/dist/internal/base-classes/popover/popover.base.d.ts +24 -9
- package/dist/internal/base-classes/popover/popover.base.js +138 -77
- package/dist/internal/base-classes/popover/popover.styles.js +14 -1
- package/dist/internal/components/hint/hint.component.d.ts +2 -2
- package/dist/internal/components/hint/hint.component.js +2 -2
- package/dist/internal/components/hint/hint.styles.d.ts +1 -2
- package/dist/internal/components/hint/hint.styles.js +1 -1
- package/dist/internal/constants/iconSeverity.d.ts +3 -2
- package/dist/internal/constants/iconSeverity.js +2 -3
- package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
- package/dist/internal/controllers/popover.controller.d.ts +12 -7
- package/dist/internal/controllers/popover.controller.js +9 -14
- package/dist/internal/helpers/hintSeverity.d.ts +2 -2
- package/dist/internal/helpers/hintSeverity.js +1 -1
- package/dist/internal/helpers/utilityTypes.d.ts +1 -1
- 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/internal/types/formField.d.ts +1 -1
- package/dist/internal/types.d.ts +18 -0
- package/dist/styles/component.styles.d.ts +1 -2
- package/dist/styles/component.styles.js +1 -1
- 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 +673 -1310
- package/dist/types/vue/index.d.ts +456 -319
- package/dist/vscode.html-custom-data.json +402 -1080
- package/dist/web-types.json +986 -767
- package/package.json +44 -55
- package/dist/components/collapse/collapse.component.d.ts +0 -40
- package/dist/components/collapse/collapse.component.js +0 -86
- package/dist/components/collapse/collapse.d.ts +0 -8
- package/dist/components/collapse/collapse.js +0 -6
- package/dist/components/collapse/collapse.styles.d.ts +0 -2
- package/dist/components/collapse/collapse.styles.js +0 -77
- package/dist/components/menu-item/menu-item.component.d.ts +0 -25
- package/dist/components/select-option/select-option.controllers.d.ts +0 -9
- package/dist/internal/constants/heading.d.ts +0 -2
- package/dist/react/index.d.ts +0 -36
- package/dist/react/index.js +0 -36
- 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-datepicker/index.d.ts +0 -12
- package/dist/react/skf-datepicker/index.js +0 -18
- 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
- /package/dist/components/{breadcrumb-item/breadcrumb-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
- /package/dist/components/{collapse/collapse.test.d.ts → accordion/accordion-item.test.d.ts} +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.component.d.ts +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.d.ts +0 -0
- /package/dist/components/{menu-item/menu-item.styles.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group/select-option-group.style.d.ts → drawer/drawer.styles.d.ts} +0 -0
- /package/dist/components/{select-option/select-option.styles.d.ts → header/header.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.d.ts +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.js +0 -0
- /package/dist/components/{stepper-item/stepper-item.styles.d.ts → menu/menu-item.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.styles.js +0 -0
- /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → nav/nav-item.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.component.d.ts +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.d.ts +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.js +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.style.js +0 -0
- /package/dist/components/{select-option → select}/select-option.d.ts +0 -0
- /package/dist/components/{select-option → select}/select-option.js +0 -0
- /package/dist/components/{select-option → select}/select-option.styles.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.component.d.ts +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.component.js +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.styles.d.ts +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.styles.js +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.js +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.styles.js +0 -0
@@ -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 i;
|
6
|
+
!((i = this.host) != null && i.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,52 +64,57 @@ class p {
|
|
61
64
|
});
|
62
65
|
}
|
63
66
|
_focusSiblingOption(t) {
|
64
|
-
const e = (
|
67
|
+
const e = (l) => l === document.activeElement, s = this._selectableOptions.find((l) => e(l));
|
65
68
|
if (!s) {
|
66
69
|
this._focusFirstOption();
|
67
70
|
return;
|
68
71
|
}
|
69
|
-
const
|
70
|
-
let
|
71
|
-
|
72
|
-
const h = this._selectableOptions[t === "next" ?
|
72
|
+
const i = this._selectableOptions.indexOf(s);
|
73
|
+
let o = i - 1, n = i + 1;
|
74
|
+
o < 0 && (o = this._selectableOptions.length - 1), n >= this._selectableOptions.length && (n = 0);
|
75
|
+
const h = this._selectableOptions[t === "next" ? n : o];
|
73
76
|
s.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
|
-
class
|
85
|
+
class u {
|
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
|
-
})
|
102
|
-
|
105
|
+
replaceStrings: [t, "min or max", "together with multiple"]
|
106
|
+
});
|
107
|
+
const e = this.host.hideTags && this.host.multiple, s = !this.host.hideTags;
|
108
|
+
a({
|
109
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
110
|
+
assert: e || s,
|
103
111
|
reason: "attribute-mismatch",
|
104
|
-
replaceStrings: [
|
112
|
+
replaceStrings: [t, "hide-tags", "together with multiple"]
|
105
113
|
});
|
106
114
|
}
|
107
115
|
}
|
108
116
|
export {
|
109
|
-
|
117
|
+
u as DeveloperFeedbackController,
|
110
118
|
d as GlobalClickController,
|
111
119
|
p as KeyboardNavigationController
|
112
120
|
};
|
@@ -6,17 +6,17 @@ var d = (e, i, t) => (u(e, i, "read from private field"), t ? t.call(e) : i.get(
|
|
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";
|
9
|
-
import C from "../../styles/component.styles.js";
|
9
|
+
import { componentStyles as C } from "../../styles/component.styles.js";
|
10
10
|
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 { literal as w,
|
15
|
-
import { styles as
|
16
|
-
var
|
17
|
-
for (var p = s > 1 ? void 0 : s ?
|
14
|
+
import { literal as w, html as S } from "lit/static-html.js";
|
15
|
+
import { styles as U } from "./stepper-item.styles.js";
|
16
|
+
var I = Object.defineProperty, O = Object.getOwnPropertyDescriptor, l = (e, i, t, s) => {
|
17
|
+
for (var p = s > 1 ? void 0 : s ? O(i, t) : i, h = e.length - 1, m; h >= 0; h--)
|
18
18
|
(m = e[h]) && (p = (s ? m(i, t, p) : m(p)) || p);
|
19
|
-
return s && p &&
|
19
|
+
return s && p && I(i, t, p), p;
|
20
20
|
}, o, n;
|
21
21
|
const f = class f extends b {
|
22
22
|
constructor() {
|
@@ -60,7 +60,7 @@ const f = class f extends b {
|
|
60
60
|
}), r(this, n, !1);
|
61
61
|
}
|
62
62
|
render() {
|
63
|
-
const t = this._linear ? "div" : "button", s = w`${
|
63
|
+
const t = this._linear ? "div" : "button", s = w`${t}`;
|
64
64
|
return S`
|
65
65
|
<${s}
|
66
66
|
@click=${this._handleClick}
|
@@ -82,7 +82,7 @@ const f = class f extends b {
|
|
82
82
|
`;
|
83
83
|
}
|
84
84
|
};
|
85
|
-
o = new WeakMap(), n = new WeakMap(), f.styles = [C,
|
85
|
+
o = new WeakMap(), n = new WeakMap(), f.styles = [C, U];
|
86
86
|
let a = f;
|
87
87
|
l([
|
88
88
|
y({ reflect: !0 })
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import type { SkfStepperItem } from '../stepper-item/stepper-item.component.js';
|
2
1
|
import { SkfElement } from '../../internal/components/skf-element';
|
3
2
|
import { type CSSResultGroup } from 'lit';
|
3
|
+
import type { SkfStepperItem } from './stepper-item.component.js';
|
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
|
*
|
11
|
-
* @event skf-stepper-item-select - Dispatched when the stepper item is selected
|
11
|
+
* @event {CustomEvent} skf-stepper-item-select - Dispatched when the stepper item is selected
|
12
12
|
*
|
13
13
|
* @tagname skf-stepper
|
14
14
|
*/
|
@@ -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;
|
@@ -2,30 +2,30 @@ var p = (t) => {
|
|
2
2
|
throw TypeError(t);
|
3
3
|
};
|
4
4
|
var m = (t, i, e) => i.has(t) || p("Cannot " + e);
|
5
|
-
var _ = (t, i, e) => (m(t, i, "read from private field"), e ? e.call(t) : i.get(t)),
|
5
|
+
var _ = (t, i, e) => (m(t, i, "read from private field"), e ? e.call(t) : i.get(t)), v = (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), l = (t, i, e, s) => (m(t, i, "write to private field"), s ? s.call(t, e) : i.set(t, e), e);
|
6
6
|
import { SkfElement as I } from "../../internal/components/skf-element.js";
|
7
|
-
import { watch as
|
8
|
-
import u from "../../styles/component.styles.js";
|
7
|
+
import { watch as f } from "../../internal/helpers/watch.js";
|
8
|
+
import { componentStyles as u } from "../../styles/component.styles.js";
|
9
9
|
import { html as g } from "lit";
|
10
10
|
import { property as x, queryAssignedElements as y } from "lit/decorators.js";
|
11
11
|
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, o; r >= 0; r--)
|
16
|
+
(o = t[r]) && (n = (s ? o(i, e, n) : o(n)) || n);
|
17
17
|
return s && n && E(i, e, n), n;
|
18
|
-
},
|
18
|
+
}, d;
|
19
19
|
const c = class c extends I {
|
20
20
|
constructor() {
|
21
21
|
super();
|
22
|
-
|
23
|
-
l(this,
|
24
|
-
if (!_(this,
|
25
|
-
const { item: s, triggerActiveIndexUpdate: n } = e.detail, r = [...this._items ?? []].findIndex((
|
22
|
+
v(this, d);
|
23
|
+
l(this, d, !1), this.activeIndex = -1, this.linear = !1, this._handleSelected = (e) => {
|
24
|
+
if (!_(this, d)) return;
|
25
|
+
const { item: s, triggerActiveIndexUpdate: n } = e.detail, r = [...this._items ?? []].findIndex((o) => o === 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, d, !0), this.activeIndex = this._getCurrentActiveIndex();
|
29
29
|
}, this.addEventListener("skf-stepper-item-select", this._handleSelected);
|
30
30
|
}
|
31
31
|
firstUpdated() {
|
@@ -69,10 +69,10 @@ const c = class c extends I {
|
|
69
69
|
`;
|
70
70
|
}
|
71
71
|
};
|
72
|
-
|
72
|
+
d = new WeakMap(), c.styles = [u, b];
|
73
73
|
let a = c;
|
74
74
|
h([
|
75
|
-
x({ type: Number })
|
75
|
+
x({ type: Number, attribute: "active-index" })
|
76
76
|
], a.prototype, "activeIndex", 2);
|
77
77
|
h([
|
78
78
|
x({ type: Boolean })
|
@@ -81,10 +81,10 @@ h([
|
|
81
81
|
y()
|
82
82
|
], a.prototype, "_items", 2);
|
83
83
|
h([
|
84
|
-
|
84
|
+
f("activeIndex")
|
85
85
|
], a.prototype, "_handleActiveIndexChanged", 1);
|
86
86
|
h([
|
87
|
-
|
87
|
+
f("linear")
|
88
88
|
], a.prototype, "_handleLinearMode", 1);
|
89
89
|
export {
|
90
90
|
a as SkfStepper
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { SkfStepperItem, SkfStepperItemState } from '
|
1
|
+
import type { SkfStepperItem, SkfStepperItemState } from './stepper-item.component.js';
|
2
2
|
import type { SkfStepper } from './stepper.component.js';
|
3
3
|
interface StepperStateProps extends Pick<SkfStepper, '_items' | 'linear'>, Pick<SkfStepperItem, 'state'> {
|
4
4
|
items: SkfStepperItem[];
|
@@ -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 */
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { FormBase as o } from "../../internal/components/formBase.js";
|
2
2
|
import { Asterisk as u } from "../../internal/templates/asterisk.js";
|
3
|
-
import p from "../../styles/component.styles.js";
|
4
|
-
import {
|
5
|
-
import { property as s, state as
|
6
|
-
import { classMap as
|
7
|
-
import { ifDefined as
|
8
|
-
import { styles as
|
9
|
-
var
|
10
|
-
for (var l = void 0,
|
11
|
-
(n = d[
|
12
|
-
return l &&
|
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;
|
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) => {
|
@@ -51,9 +51,9 @@ const h = class h extends o {
|
|
51
51
|
this.setValidity({});
|
52
52
|
}
|
53
53
|
render() {
|
54
|
-
return
|
54
|
+
return v`
|
55
55
|
<label
|
56
|
-
class=${
|
56
|
+
class=${_({
|
57
57
|
switch: !0,
|
58
58
|
"switch--small": this.size === "sm"
|
59
59
|
})}
|
@@ -67,11 +67,11 @@ const h = class h extends o {
|
|
67
67
|
@reset=${this._resetValue}
|
68
68
|
aria-invalid=${!!this._invalid}
|
69
69
|
class="switch__input"
|
70
|
-
name=${
|
70
|
+
name=${b(this.name)}
|
71
71
|
type="checkbox"
|
72
72
|
value=${this.value}
|
73
73
|
/>
|
74
|
-
<div class="switch__label">
|
74
|
+
<div class="switch__label ${this.hideLabel ? "visually-hidden" : c}">
|
75
75
|
<slot>${this.label}</slot>
|
76
76
|
${this.required ? u(this.requiredLabel, "switch__asterisk") : null}
|
77
77
|
</div>
|
@@ -79,8 +79,8 @@ const h = class h extends o {
|
|
79
79
|
`;
|
80
80
|
}
|
81
81
|
};
|
82
|
-
|
83
|
-
let t =
|
82
|
+
r.styles = [p, y];
|
83
|
+
let t = r;
|
84
84
|
i([
|
85
85
|
s({ type: Boolean })
|
86
86
|
], t.prototype, "debug");
|
@@ -106,10 +106,10 @@ i([
|
|
106
106
|
s()
|
107
107
|
], t.prototype, "value");
|
108
108
|
i([
|
109
|
-
|
109
|
+
f()
|
110
110
|
], t.prototype, "_invalid");
|
111
111
|
i([
|
112
|
-
|
112
|
+
m("input")
|
113
113
|
], t.prototype, "$input");
|
114
114
|
export {
|
115
115
|
t as SkfSwitch
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { SkfElement as n } from "../../internal/components/skf-element.js";
|
2
2
|
import { watch as h } from "../../internal/helpers/watch.js";
|
3
|
-
import m from "../../styles/component.styles.js";
|
3
|
+
import { componentStyles as 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";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import "../card/card.js";
|
2
2
|
import { SkfElement as c } from "../../internal/components/skf-element.js";
|
3
|
-
import b from "../../styles/component.styles.js";
|
3
|
+
import { componentStyles as b } from "../../styles/component.styles.js";
|
4
4
|
import { html as f } from "lit";
|
5
5
|
import { property as o, queryAssignedElements as p } from "lit/decorators.js";
|
6
6
|
import { classMap as u } from "lit/directives/class-map.js";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { SkfElement as c } from "../../internal/components/skf-element.js";
|
2
2
|
import { watch as h } from "../../internal/helpers/watch.js";
|
3
|
-
import l from "../../styles/component.styles.js";
|
3
|
+
import { componentStyles as l } 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
6
|
import { styles as y } from "./tab-panel.styles.js";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import '../icon/icon.js';
|
2
2
|
import { SkfElement } from '../../internal/components/skf-element';
|
3
|
-
import type { Icon,
|
3
|
+
import type { Icon, Severity } from '../../internal/types.js';
|
4
4
|
import { type CSSResultGroup } from 'lit';
|
5
5
|
/**
|
6
6
|
* The `<skf-tag>` is a component that displays a list of actions or options
|
@@ -13,20 +13,16 @@ 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'
|
20
|
-
/**
|
21
|
-
* If defined, displays leading/provided icon
|
22
|
-
* @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" }
|
23
|
-
*/
|
21
|
+
size: 'sm' | 'md';
|
22
|
+
/** If defined, displays leading/provided icon */
|
24
23
|
icon?: Icon;
|
25
|
-
/**
|
26
|
-
|
27
|
-
* @type { "warning" | "success" | "info" | "error" | "alert" }
|
28
|
-
*/
|
29
|
-
color?: SeverityBgColor;
|
24
|
+
/** If defined, gives the supplied appearance */
|
25
|
+
color?: Severity;
|
30
26
|
/** If defined, accepts a function that runs on click */
|
31
27
|
set onClick(onClickFn: ((event: Event) => void) | undefined);
|
32
28
|
get onClick(): ((event: Event) => void) | undefined;
|
@@ -34,15 +30,17 @@ export declare class SkfTag extends SkfElement {
|
|
34
30
|
set onRemove(onRemoveFn: ((event: Event) => void) | undefined);
|
35
31
|
get onRemove(): ((event: Event) => void) | undefined;
|
36
32
|
/** If true, adds trailing button to remove tag */
|
37
|
-
removable
|
33
|
+
removable: boolean;
|
38
34
|
/** @internal */
|
39
35
|
$removeButton: HTMLButtonElement;
|
40
36
|
connectedCallback(): void;
|
41
37
|
disconnectedCallback(): void;
|
42
38
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
39
|
+
/** @internal */
|
40
|
+
private _handleKeyDown;
|
41
|
+
/** @internal run externally provided callback (if any) first. Let click propagate to handleClick. */
|
42
|
+
private _handleRemove;
|
43
|
+
/** @internal */
|
44
|
+
private _handleClick;
|
47
45
|
render(): import("lit").TemplateResult<1>;
|
48
46
|
}
|
@@ -1,37 +1,35 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
2
|
import { SkfElement as u } from "../../internal/components/skf-element.js";
|
3
|
-
import f from "../../styles/component.styles.js";
|
4
|
-
import {
|
5
|
-
import { property as
|
6
|
-
import { classMap as
|
3
|
+
import { componentStyles as f } from "../../styles/component.styles.js";
|
4
|
+
import { nothing as p, html as a } from "lit";
|
5
|
+
import { property as n, 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
|
-
var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor,
|
10
|
-
for (var
|
11
|
-
(c = m[
|
12
|
-
return
|
9
|
+
var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (m, e, i, s) => {
|
10
|
+
for (var t = s > 1 ? void 0 : s ? y(e, i) : e, l = m.length - 1, c; l >= 0; l--)
|
11
|
+
(c = m[l]) && (t = (s ? c(e, i, t) : c(t)) || t);
|
12
|
+
return s && t && b(e, i, t), t;
|
13
13
|
};
|
14
14
|
const h = class h extends u {
|
15
15
|
constructor() {
|
16
|
-
super(...arguments), this.size = "md", this._handleKeyDown = (
|
17
|
-
(
|
18
|
-
}, this._handleRemove = (
|
19
|
-
this._onRemove && this._onRemove(
|
20
|
-
}, this._handleClick = (
|
21
|
-
var
|
22
|
-
|
23
|
-
const s = t.composedPath()[0];
|
24
|
-
console.log("$clickTarget", s), s.localName === "button" ? this.remove() : (e = this.onClick) == null || e.call(this, t);
|
16
|
+
super(...arguments), this.size = "md", this.removable = !1, this._handleKeyDown = (e) => {
|
17
|
+
(e.key === "Enter" || e.key === " ") && this.$removeButton.click();
|
18
|
+
}, this._handleRemove = (e) => {
|
19
|
+
this._onRemove && this._onRemove(e);
|
20
|
+
}, this._handleClick = (e) => {
|
21
|
+
var t;
|
22
|
+
e.stopPropagation(), e.composedPath()[0].localName === "button" ? this.remove() : (t = this.onClick) == null || t.call(this, e);
|
25
23
|
};
|
26
24
|
}
|
27
|
-
set onClick(
|
28
|
-
|
25
|
+
set onClick(e) {
|
26
|
+
e && (this._onClick = e);
|
29
27
|
}
|
30
28
|
get onClick() {
|
31
29
|
return this._onClick;
|
32
30
|
}
|
33
|
-
set onRemove(
|
34
|
-
|
31
|
+
set onRemove(e) {
|
32
|
+
e && (this._onRemove = e);
|
35
33
|
}
|
36
34
|
get onRemove() {
|
37
35
|
return this._onRemove;
|
@@ -42,15 +40,14 @@ const h = class h extends u {
|
|
42
40
|
disconnectedCallback() {
|
43
41
|
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick);
|
44
42
|
}
|
45
|
-
attributeChangedCallback(
|
46
|
-
super.attributeChangedCallback(
|
43
|
+
attributeChangedCallback(e, i, s) {
|
44
|
+
super.attributeChangedCallback(e, i, s), e === "removable" && s !== null ? this.addEventListener("keydown", this._handleKeyDown) : this.removeEventListener("keydown", this._handleKeyDown);
|
47
45
|
}
|
48
46
|
render() {
|
49
47
|
return a`
|
50
48
|
<div
|
51
|
-
class=${
|
49
|
+
class=${d({
|
52
50
|
tag: !0,
|
53
|
-
"tag--color-alert": this.color === "alert",
|
54
51
|
"tag--color-error": this.color === "error",
|
55
52
|
"tag--color-info": this.color === "info",
|
56
53
|
"tag--color-success": this.color === "success",
|
@@ -78,26 +75,26 @@ const h = class h extends u {
|
|
78
75
|
};
|
79
76
|
h.styles = [f, k];
|
80
77
|
let o = h;
|
81
|
-
|
82
|
-
|
78
|
+
r([
|
79
|
+
n({ reflect: !0 })
|
83
80
|
], o.prototype, "size", 2);
|
84
|
-
|
85
|
-
|
81
|
+
r([
|
82
|
+
n()
|
86
83
|
], o.prototype, "icon", 2);
|
87
|
-
|
88
|
-
|
84
|
+
r([
|
85
|
+
n({ reflect: !0 })
|
89
86
|
], o.prototype, "color", 2);
|
90
|
-
|
91
|
-
|
87
|
+
r([
|
88
|
+
n({ attribute: !1 })
|
92
89
|
], o.prototype, "onClick", 1);
|
93
|
-
|
94
|
-
|
90
|
+
r([
|
91
|
+
n({ attribute: !1 })
|
95
92
|
], o.prototype, "onRemove", 1);
|
96
|
-
|
97
|
-
|
93
|
+
r([
|
94
|
+
n({ type: Boolean, reflect: !0 })
|
98
95
|
], o.prototype, "removable", 2);
|
99
|
-
|
100
|
-
|
96
|
+
r([
|
97
|
+
v("button")
|
101
98
|
], o.prototype, "$removeButton", 2);
|
102
99
|
export {
|
103
100
|
o as SkfTag
|