@skf-design-system/ui-components 1.0.2-beta.1 → 1.0.2-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/components/accordion/accordion-item.component.js +49 -38
- package/dist/components/accordion/accordion.component.d.ts +2 -2
- package/dist/components/accordion/accordion.component.js +12 -12
- package/dist/components/alert/alert.component.d.ts +8 -3
- package/dist/components/alert/alert.component.js +59 -50
- package/dist/components/alert/alert.styles.js +51 -47
- package/dist/components/breadcrumb/breadcrumb-item.component.js +30 -32
- package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
- package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
- package/dist/components/button/button.component.js +63 -67
- package/dist/components/button/button.styles.js +5 -4
- package/dist/components/card/card.component.d.ts +5 -0
- package/dist/components/card/card.component.js +46 -24
- package/dist/components/card/card.styles.js +31 -14
- package/dist/components/checkbox/checkbox.component.d.ts +6 -5
- package/dist/components/checkbox/checkbox.component.js +67 -69
- package/dist/components/checkbox/checkbox.styles.js +1 -1
- package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +8 -1
- package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +109 -115
- package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
- package/dist/components/datepicker/datepicker-calendar.js +6 -0
- package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +9 -20
- package/dist/components/datepicker/datepicker-popup.component.js +272 -0
- package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
- package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
- package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
- package/dist/components/datepicker/datepicker-popup.js +6 -0
- package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
- package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +21 -14
- package/dist/components/datepicker/datepicker.component.js +455 -0
- package/dist/components/datepicker/datepicker.d.ts +8 -0
- package/dist/components/datepicker/datepicker.js +6 -0
- package/dist/components/dialog/dialog.component.d.ts +3 -2
- package/dist/components/dialog/dialog.component.js +49 -49
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/divider/divider.component.d.ts +3 -0
- package/dist/components/divider/divider.component.js +43 -22
- package/dist/components/divider/divider.styles.js +9 -9
- package/dist/components/drawer/drawer.component.d.ts +12 -4
- package/dist/components/drawer/drawer.component.js +84 -61
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.styles.js +47 -40
- package/dist/components/header/header.component.d.ts +4 -2
- package/dist/components/header/header.component.js +64 -57
- package/dist/components/header/header.d.ts +2 -2
- package/dist/components/header/header.styles.js +2 -2
- package/dist/components/heading/heading.component.d.ts +5 -1
- package/dist/components/heading/heading.component.js +54 -27
- package/dist/components/heading/heading.styles.js +34 -36
- package/dist/components/icon/icon.component.d.ts +4 -0
- package/dist/components/icon/icon.component.js +62 -43
- package/dist/components/icon/icon.styles.js +60 -60
- package/dist/components/input/input.component.d.ts +4 -8
- package/dist/components/input/input.component.js +90 -97
- package/dist/components/input/input.controllers.d.ts +0 -1
- package/dist/components/input/input.controllers.js +14 -19
- package/dist/components/link/link.component.d.ts +16 -18
- package/dist/components/link/link.component.js +109 -106
- package/dist/components/link/link.styles.js +49 -45
- package/dist/components/loader/loader.component.d.ts +5 -3
- package/dist/components/loader/loader.component.js +39 -28
- package/dist/components/loader/loader.styles.js +6 -10
- package/dist/components/logo/logo.component.d.ts +4 -1
- package/dist/components/logo/logo.component.js +55 -51
- package/dist/components/logo/logo.styles.js +26 -16
- package/dist/components/menu/menu-item.component.d.ts +1 -1
- package/dist/components/menu/menu-item.component.js +8 -8
- package/dist/components/menu/menu-item.d.ts +2 -2
- package/dist/components/menu/menu-item.styles.js +13 -9
- package/dist/components/menu/menu.component.d.ts +5 -2
- package/dist/components/menu/menu.component.js +8 -8
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/nav/nav-item.component.d.ts +6 -2
- package/dist/components/nav/nav-item.component.js +44 -25
- package/dist/components/nav/nav-item.styles.js +29 -25
- package/dist/components/nav/nav.component.d.ts +9 -0
- package/dist/components/nav/nav.component.js +47 -21
- package/dist/components/nav/nav.d.ts +2 -2
- package/dist/components/nav/nav.styles.js +15 -9
- package/dist/components/popover/popover.component.d.ts +10 -3
- package/dist/components/popover/popover.component.js +30 -22
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/progress.component.d.ts +2 -0
- package/dist/components/progress/progress.component.js +38 -29
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.styles.js +10 -8
- package/dist/components/radio/radio.component.d.ts +4 -2
- package/dist/components/radio/radio.component.js +96 -91
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
- package/dist/components/segmented-button/segmented-button-item.d.ts +2 -2
- package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button.component.js +22 -24
- package/dist/components/segmented-button/segmented-button.d.ts +2 -2
- package/dist/components/select/select-option-group.component.d.ts +4 -0
- package/dist/components/select/select-option-group.component.js +37 -18
- package/dist/components/select/select-option-group.d.ts +2 -2
- package/dist/components/select/select-option-group.style.js +12 -6
- package/dist/components/select/select-option.component.d.ts +9 -4
- package/dist/components/select/select-option.component.js +70 -58
- package/dist/components/select/select-option.styles.js +43 -31
- package/dist/components/select/select.component.d.ts +21 -12
- package/dist/components/select/select.component.js +125 -87
- package/dist/components/select/select.controllers.js +15 -20
- package/dist/components/select/select.styles.js +8 -2
- package/dist/components/stepper/stepper-item.component.d.ts +1 -1
- package/dist/components/stepper/stepper-item.component.js +59 -56
- package/dist/components/stepper/stepper-item.d.ts +2 -2
- package/dist/components/stepper/stepper-item.styles.js +4 -4
- package/dist/components/stepper/stepper.component.js +2 -3
- package/dist/components/stepper/stepper.d.ts +2 -2
- package/dist/components/stepper/stepper.helpers.js +6 -7
- package/dist/components/switch/switch.component.d.ts +4 -2
- package/dist/components/switch/switch.component.js +64 -58
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +39 -0
- package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.component.d.ts +3 -3
- package/dist/components/{tab → tabs}/tab.component.js +17 -14
- package/dist/components/{tab → tabs}/tab.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.styles.js +2 -2
- package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
- package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +35 -36
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
- package/dist/components/tag/tag.component.d.ts +10 -2
- package/dist/components/tag/tag.component.js +77 -65
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.styles.js +63 -50
- package/dist/components/textarea/textarea.component.d.ts +4 -2
- package/dist/components/textarea/textarea.component.js +102 -95
- package/dist/components/toast/toast-item.styles.js +13 -10
- package/dist/components/toast/toast.component.js +9 -9
- package/dist/components/toast/toast.singleton.d.ts +1 -1
- package/dist/components/toast/toast.singleton.js +19 -20
- package/dist/components/tooltip/tooltip.component.d.ts +9 -2
- package/dist/components/tooltip/tooltip.component.js +15 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/custom-elements.json +1699 -1112
- package/dist/index.d.ts +8 -7
- package/dist/index.js +96 -93
- package/dist/internal/base-classes/popover/popover.base.d.ts +24 -5
- package/dist/internal/base-classes/popover/popover.base.js +41 -44
- package/dist/internal/base-classes/popover/popover.styles.js +4 -5
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -19
- package/dist/internal/components/hint/hint.component.d.ts +4 -0
- package/dist/internal/components/hint/hint.component.js +47 -20
- package/dist/internal/components/hint/hint.styles.js +29 -25
- package/dist/internal/components/skf-element.d.ts +1 -3
- package/dist/internal/components/skf-element.js +4 -9
- package/dist/internal/controllers/popover.controller.d.ts +2 -0
- package/dist/internal/controllers/popover.controller.js +11 -14
- package/dist/internal/helpers/stateMap.d.ts +14 -0
- package/dist/internal/helpers/stateMap.js +68 -0
- package/dist/internal/helpers/uuid.d.ts +8 -10
- package/dist/internal/helpers/uuid.js +4 -11
- package/dist/internal/helpers/watch.d.ts +1 -1
- package/dist/internal/helpers/watch.js +12 -12
- package/dist/internal/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +4 -4
- package/dist/internal/types.d.ts +4 -0
- package/dist/styles/component.styles.js +37 -36
- package/dist/styles/global-alt.css +1 -0
- package/dist/styles/global.css +1 -1
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +27 -0
- package/dist/translations/es.d.ts +3 -0
- package/dist/translations/es.js +27 -0
- package/dist/translations/index.d.ts +4 -0
- package/dist/translations/pt.d.ts +3 -0
- package/dist/translations/pt.js +27 -0
- package/dist/translations/sv.d.ts +3 -0
- package/dist/translations/sv.js +27 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +1990 -866
- package/dist/types/vue/index.d.ts +220 -169
- package/dist/utilities/localize.d.ts +28 -0
- package/dist/utilities/localize.js +13 -0
- package/dist/vscode.html-custom-data.json +265 -188
- package/dist/web-types.json +731 -548
- package/package.json +39 -51
- package/dist/components/accordion/accordion-item.test.d.ts +0 -1
- package/dist/components/accordion/accordion.test.d.ts +0 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- package/dist/components/date-picker/datepicker.component.js +0 -261
- package/dist/components/date-picker/datepicker.d.ts +0 -10
- package/dist/components/date-picker/datepicker.helpers.js +0 -76
- package/dist/components/date-picker/datepicker.js +0 -8
- package/dist/components/date-picker-input/datepicker-input.component.js +0 -442
- package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
- package/dist/components/date-picker-input/datepicker-input.js +0 -6
- package/dist/components/input/input.test.d.ts +0 -1
- package/dist/components/radio/radio.test.d.ts +0 -1
- package/dist/components/switch/switch.test.d.ts +0 -1
- package/dist/components/tab-group/tab-group.d.ts +0 -8
- package/dist/components/tab-group/tab-group.js +0 -6
- package/dist/components/tab-panel/tab-panel.component.js +0 -36
- package/dist/internal/playwright/index.d.ts +0 -1
- /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
- /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
- /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
- /package/dist/components/select/{select.stories.icons.d.ts → stories/select.stories.icons.d.ts} +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
- /package/dist/components/{tab → tabs}/tab.js +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
- /package/dist/components/{tab-group/tab-group.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
@@ -1,29 +1,36 @@
|
|
1
|
+
var m = (s) => {
|
2
|
+
throw TypeError(s);
|
3
|
+
};
|
4
|
+
var c = (s, r, t) => r.has(s) || m("Cannot " + t);
|
5
|
+
var y = (s, r, t) => (c(s, r, "read from private field"), t ? t.call(s) : r.get(s)), f = (s, r, t) => r.has(s) ? m("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), b = (s, r, t, o) => (c(s, r, "write to private field"), o ? o.call(s, t) : r.set(s, t), t);
|
1
6
|
import "../icon/icon.js";
|
2
|
-
import { FormBase as
|
7
|
+
import { FormBase as $ } from "../../internal/components/formBase.js";
|
3
8
|
import "../../internal/components/hint/hint.js";
|
4
|
-
import { hintSeverity as
|
5
|
-
import { Asterisk as
|
6
|
-
import { componentStyles as
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
import { hintSeverity as E } from "../../internal/helpers/hintSeverity.js";
|
10
|
+
import { Asterisk as _ } from "../../internal/templates/asterisk.js";
|
11
|
+
import { componentStyles as V } from "../../styles/component.styles.js";
|
12
|
+
import { LocalizeController as w } from "../../utilities/localize.js";
|
13
|
+
import { nothing as u, html as g } from "lit";
|
14
|
+
import { property as l, state as x, query as I } from "lit/decorators.js";
|
15
|
+
import { ifDefined as h } from "lit/directives/if-defined.js";
|
16
|
+
import L from "./textarea.styles.js";
|
17
|
+
var A = Object.defineProperty, O = Object.getOwnPropertyDescriptor, e = (s, r, t, o) => {
|
18
|
+
for (var a = o > 1 ? void 0 : o ? O(r, t) : r, n = s.length - 1, d; n >= 0; n--)
|
19
|
+
(d = s[n]) && (a = (o ? d(r, t, a) : d(a)) || a);
|
20
|
+
return o && a && A(r, t, a), a;
|
21
|
+
}, p;
|
22
|
+
const v = class v extends $ {
|
17
23
|
constructor() {
|
18
|
-
super(...arguments)
|
19
|
-
|
20
|
-
|
24
|
+
super(...arguments);
|
25
|
+
f(this, p);
|
26
|
+
b(this, p, new w(this)), this.debug = !1, this.hideLabel = !1, this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.validateOn = "change", this.value = "", this.invalid = !1, this._resetValue = (t) => {
|
27
|
+
t.stopPropagation(), this.value = this.getAttribute("value")?.trim() ?? "", this._internals.setFormValue(this.value), this.$input.focus();
|
21
28
|
}, this._handleInput = () => {
|
22
29
|
this.value = this.$input.value || "", this.validateOn === "input" && (this.pristine = !1, this.validateInput());
|
23
30
|
};
|
24
31
|
}
|
25
|
-
set customInvalid(
|
26
|
-
this.customError =
|
32
|
+
set customInvalid(t) {
|
33
|
+
this.customError = t ?? "";
|
27
34
|
}
|
28
35
|
get customInvalid() {
|
29
36
|
return this.customError;
|
@@ -31,58 +38,57 @@ const d = class d extends m {
|
|
31
38
|
firstUpdated() {
|
32
39
|
this.$input.addEventListener("change", () => {
|
33
40
|
this.validateOn === "change" && (this.validateOn = "input", this.pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
|
34
|
-
}), this.addEventListener("invalid", (
|
35
|
-
this.pristine = !1, this.invalid = !0, this.customErrorDisplay &&
|
41
|
+
}), this.addEventListener("invalid", (t) => {
|
42
|
+
this.pristine = !1, this.invalid = !0, this.customErrorDisplay && t.preventDefault();
|
36
43
|
}), this.addEventListener("reset", this._resetValue), this.validateInput();
|
37
44
|
}
|
38
|
-
willUpdate(
|
39
|
-
if (
|
45
|
+
willUpdate(t) {
|
46
|
+
if (t.has("invalid"))
|
40
47
|
if (this.invalid) {
|
41
48
|
this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
|
42
|
-
const
|
43
|
-
this.hint =
|
49
|
+
const o = this._internals.validationMessage;
|
50
|
+
this.hint = o !== "" ? this._internals.validationMessage : "unspecified error", this.checkValidity();
|
44
51
|
} else
|
45
52
|
this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
|
46
53
|
}
|
47
|
-
attributeChangedCallback(
|
48
|
-
if (super.attributeChangedCallback(
|
54
|
+
attributeChangedCallback(t, o, a) {
|
55
|
+
if (super.attributeChangedCallback(t, o, a), t === "value" && this._internals.setFormValue(a), t === "custom-invalid")
|
49
56
|
if (typeof a == "string") {
|
50
|
-
const
|
51
|
-
this.pristine = !1, this._internals.setValidity({ customError: !0 },
|
57
|
+
const d = this.withFallback(a);
|
58
|
+
this.pristine = !1, this._internals.setValidity({ customError: !0 }, d), this.invalid = !0, this.hint = d, this.checkValidity();
|
52
59
|
} else
|
53
60
|
this._internals.setValidity({}), this.validateInput();
|
54
61
|
}
|
55
62
|
/** @internal */
|
56
63
|
validateInput() {
|
57
64
|
if (this._internals.validity.customError) return;
|
58
|
-
const
|
59
|
-
if (this.invalid = !1,
|
65
|
+
const o = this.$input.validity;
|
66
|
+
if (this.invalid = !1, o.valid)
|
60
67
|
this._internals.setValidity({ customError: this._internals.validity.customError });
|
61
68
|
else {
|
62
|
-
this.invalid = !this.pristine && !
|
69
|
+
this.invalid = !this.pristine && !o.valid;
|
63
70
|
let a;
|
64
|
-
for (a in
|
65
|
-
const
|
66
|
-
if (
|
67
|
-
`Add custom message on ${this.localName} using attribute: ${
|
68
|
-
),
|
71
|
+
for (a in o) {
|
72
|
+
const n = `data-${a.toString()}`;
|
73
|
+
if (o[a] && !this.hasAttribute(n) && this.debug && console.log(
|
74
|
+
`Add custom message on ${this.localName} using attribute: ${n.toUpperCase()}="Your custom message"`
|
75
|
+
), o[a]) {
|
69
76
|
this.validationError = a.toString();
|
70
|
-
const
|
77
|
+
const d = this.hasAttribute(n) ? this.getAttribute(n) : this.$input.validationMessage;
|
71
78
|
this._internals.setValidity(
|
72
79
|
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
73
|
-
this.withFallback(
|
80
|
+
this.withFallback(d)
|
74
81
|
), this.invalid && this.customErrorDisplay && this.checkValidity();
|
75
82
|
}
|
76
83
|
}
|
77
84
|
}
|
78
85
|
}
|
79
86
|
render() {
|
80
|
-
|
81
|
-
return v`
|
87
|
+
return g`
|
82
88
|
<div id="root">
|
83
89
|
<label>
|
84
90
|
<div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
|
85
|
-
<slot>${this.label}</slot> ${this.required ? y(this.
|
91
|
+
<slot>${this.label}</slot> ${this.required ? _(y(this, p).term("required")) : u}
|
86
92
|
</div>
|
87
93
|
<div id="input">
|
88
94
|
<textarea
|
@@ -91,24 +97,25 @@ const d = class d extends m {
|
|
91
97
|
?required=${this.required}
|
92
98
|
.value=${this.value}
|
93
99
|
@input=${this._handleInput}
|
94
|
-
aria-describedby=${
|
95
|
-
aria-errormessage=${
|
100
|
+
aria-describedby=${h(this.hint?.trim() ? "hint" : u)}
|
101
|
+
aria-errormessage=${h(this.hint?.trim() ? "hint" : u)}
|
96
102
|
aria-invalid=${!!this.invalid}
|
97
|
-
cols=${
|
98
|
-
maxlength=${
|
99
|
-
minlength=${
|
100
|
-
name=${
|
101
|
-
placeholder=${
|
102
|
-
rows=${
|
103
|
+
cols=${h(this.cols)}
|
104
|
+
maxlength=${h(this.maxLength)}
|
105
|
+
minlength=${h(this.minLength)}
|
106
|
+
name=${h(this.name)}
|
107
|
+
placeholder=${h(this.placeholder)}
|
108
|
+
rows=${h(this.rows)}
|
103
109
|
>
|
104
110
|
</textarea>
|
105
111
|
</div>
|
106
112
|
</label>
|
107
|
-
${this.hint &&
|
113
|
+
${this.hint && g`
|
108
114
|
<skf-hint
|
115
|
+
?disabled=${this.disabled}
|
109
116
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
110
117
|
id="hint"
|
111
|
-
severity=${
|
118
|
+
severity=${h(E(this.invalid, this.severity))}
|
112
119
|
>
|
113
120
|
${this.customInvalid ?? this.hint}
|
114
121
|
</skf-hint>
|
@@ -117,68 +124,68 @@ const d = class d extends m {
|
|
117
124
|
`;
|
118
125
|
}
|
119
126
|
};
|
120
|
-
|
121
|
-
let
|
127
|
+
p = new WeakMap(), v.styles = [V, L];
|
128
|
+
let i = v;
|
122
129
|
e([
|
123
|
-
|
124
|
-
],
|
130
|
+
l({ type: Number })
|
131
|
+
], i.prototype, "cols", 2);
|
125
132
|
e([
|
126
|
-
|
127
|
-
],
|
133
|
+
l({ attribute: "custom-invalid", reflect: !0 })
|
134
|
+
], i.prototype, "customInvalid", 1);
|
128
135
|
e([
|
129
|
-
|
130
|
-
],
|
136
|
+
l({ type: Boolean })
|
137
|
+
], i.prototype, "debug", 2);
|
131
138
|
e([
|
132
|
-
|
133
|
-
],
|
139
|
+
l({ type: Boolean, attribute: "hide-label" })
|
140
|
+
], i.prototype, "hideLabel", 2);
|
134
141
|
e([
|
135
|
-
|
136
|
-
],
|
142
|
+
l()
|
143
|
+
], i.prototype, "hint", 2);
|
137
144
|
e([
|
138
|
-
|
139
|
-
],
|
145
|
+
l()
|
146
|
+
], i.prototype, "label", 2);
|
140
147
|
e([
|
141
|
-
|
142
|
-
],
|
148
|
+
l({ type: String })
|
149
|
+
], i.prototype, "lang", 2);
|
143
150
|
e([
|
144
|
-
|
145
|
-
],
|
151
|
+
l()
|
152
|
+
], i.prototype, "name", 2);
|
146
153
|
e([
|
147
|
-
|
148
|
-
],
|
154
|
+
l({ type: Number, attribute: "maxlength" })
|
155
|
+
], i.prototype, "maxLength", 2);
|
149
156
|
e([
|
150
|
-
|
151
|
-
],
|
157
|
+
l({ type: Number, attribute: "minlength" })
|
158
|
+
], i.prototype, "minLength", 2);
|
152
159
|
e([
|
153
|
-
|
154
|
-
],
|
160
|
+
l()
|
161
|
+
], i.prototype, "placeholder", 2);
|
155
162
|
e([
|
156
|
-
|
157
|
-
],
|
163
|
+
l({ type: Boolean })
|
164
|
+
], i.prototype, "readonly", 2);
|
158
165
|
e([
|
159
|
-
|
160
|
-
],
|
166
|
+
l({ type: Number })
|
167
|
+
], i.prototype, "rows", 2);
|
161
168
|
e([
|
162
|
-
|
163
|
-
],
|
169
|
+
l()
|
170
|
+
], i.prototype, "severity", 2);
|
164
171
|
e([
|
165
|
-
|
166
|
-
],
|
172
|
+
l({ type: Boolean, attribute: "show-valid" })
|
173
|
+
], i.prototype, "showValid", 2);
|
167
174
|
e([
|
168
|
-
|
169
|
-
],
|
175
|
+
l({ reflect: !0 })
|
176
|
+
], i.prototype, "size", 2);
|
170
177
|
e([
|
171
|
-
|
172
|
-
],
|
178
|
+
l({ attribute: "validate-on" })
|
179
|
+
], i.prototype, "validateOn", 2);
|
173
180
|
e([
|
174
|
-
|
175
|
-
],
|
181
|
+
l()
|
182
|
+
], i.prototype, "value", 2);
|
176
183
|
e([
|
177
|
-
|
178
|
-
],
|
184
|
+
x()
|
185
|
+
], i.prototype, "invalid", 2);
|
179
186
|
e([
|
180
|
-
|
181
|
-
],
|
187
|
+
I("textarea")
|
188
|
+
], i.prototype, "$input", 2);
|
182
189
|
export {
|
183
|
-
|
190
|
+
i as SkfTextArea
|
184
191
|
};
|
@@ -1,18 +1,21 @@
|
|
1
1
|
import { css as o } from "lit";
|
2
|
-
const
|
2
|
+
const e = o`
|
3
3
|
@layer components {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
@layer overrides {
|
5
|
+
:host {
|
6
|
+
overflow: hidden; /* Enable mask transition */
|
7
|
+
padding-block-end: 3px; /* Make room for box-shadow */
|
8
|
+
}
|
9
|
+
|
10
|
+
#root {
|
11
|
+
--_skf-alert-bg-color: var(--skf-bg-color-neutral-1);
|
8
12
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
var(--_skf-alert-border-color, var(--skf-border-color-primary));
|
13
|
+
/* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
|
14
|
+
border-inline-start: var(--skf-size-8) solid var(--_skf-alert-border-color);
|
15
|
+
}
|
13
16
|
}
|
14
17
|
}
|
15
18
|
`;
|
16
19
|
export {
|
17
|
-
|
20
|
+
e as default
|
18
21
|
};
|
@@ -1,25 +1,25 @@
|
|
1
1
|
import { SkfElement as l } from "../../internal/components/skf-element.js";
|
2
2
|
import { html as f } from "lit";
|
3
|
-
import { property as i, queryAssignedNodes as
|
4
|
-
import { SkfToastSingleton as
|
3
|
+
import { property as i, queryAssignedNodes as y } from "lit/decorators.js";
|
4
|
+
import { SkfToastSingleton as d } from "./toast.singleton.js";
|
5
5
|
import { styles as a } from "./toast.styles.js";
|
6
|
-
var u = Object.defineProperty, e = (n,
|
7
|
-
for (var s = void 0,
|
8
|
-
(
|
9
|
-
return s && u(
|
6
|
+
var u = Object.defineProperty, e = (n, r, m, g) => {
|
7
|
+
for (var s = void 0, o = n.length - 1, h; o >= 0; o--)
|
8
|
+
(h = n[o]) && (s = h(r, m, s) || s);
|
9
|
+
return s && u(r, m, s), s;
|
10
10
|
};
|
11
11
|
const p = class p extends l {
|
12
12
|
constructor() {
|
13
13
|
super(), this.debug = !1, this.persistent = !1, this.severity = "info", this.timer = 5, this._singleton = void 0;
|
14
14
|
}
|
15
15
|
firstUpdated() {
|
16
|
-
this._singleton = new
|
16
|
+
this._singleton = new d(), this._singleton.addData({
|
17
17
|
debug: this.debug,
|
18
18
|
icon: this.icon,
|
19
19
|
originEl: this,
|
20
20
|
persistent: this.persistent,
|
21
21
|
severity: this.severity,
|
22
|
-
text: this._slottedText.map((
|
22
|
+
text: this._slottedText.map((r) => r.textContent).join(),
|
23
23
|
timer: this.timer = this.timer && this.timer < 5 ? 5 : this.timer,
|
24
24
|
topOffset: this.topOffset
|
25
25
|
});
|
@@ -49,7 +49,7 @@ e([
|
|
49
49
|
i({ type: Number })
|
50
50
|
], t.prototype, "topOffset");
|
51
51
|
e([
|
52
|
-
|
52
|
+
y()
|
53
53
|
], t.prototype, "_slottedText");
|
54
54
|
export {
|
55
55
|
t as SkfToast
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import "./toast-item.js";
|
2
2
|
import "./toast-wrapper.js";
|
3
3
|
class s {
|
4
|
-
constructor(
|
5
|
-
if (this.data = [], this.root =
|
4
|
+
constructor() {
|
5
|
+
if (this.data = [], this.root = globalThis.document, this.usePopover = !0, this.root.nodeType !== Node.DOCUMENT_NODE)
|
6
6
|
throw new Error("Root node must be a document node");
|
7
7
|
return s.instance || (s.instance = this), s.instance;
|
8
8
|
}
|
@@ -15,31 +15,30 @@ class s {
|
|
15
15
|
getData() {
|
16
16
|
return this.data;
|
17
17
|
}
|
18
|
-
setData(
|
19
|
-
this.data =
|
18
|
+
setData(o) {
|
19
|
+
this.data = o;
|
20
20
|
}
|
21
|
-
addData(
|
22
|
-
this.data = [...this.data,
|
21
|
+
addData(o) {
|
22
|
+
this.data = [...this.data, o], this.udpateUI();
|
23
23
|
}
|
24
24
|
udpateUI() {
|
25
|
-
const
|
26
|
-
this.usePopover &&
|
27
|
-
function
|
28
|
-
const
|
29
|
-
for (;
|
30
|
-
const t =
|
25
|
+
const o = p(this.root, this.usePopover);
|
26
|
+
this.usePopover && o.showPopover(), n();
|
27
|
+
function n() {
|
28
|
+
const i = new s();
|
29
|
+
for (; i.hasToasts(); ) {
|
30
|
+
const t = i.popToast();
|
31
31
|
if (!t) return;
|
32
|
-
t.debug && (
|
33
|
-
const
|
34
|
-
|
32
|
+
t.debug && (o.debug = !0);
|
33
|
+
const e = document.createElement("skf-toast-item");
|
34
|
+
e.className = "toast-item", e.timer = t.timer, e.severity = t.severity, e.icon = t.icon, t.persistent && e.setAttribute("persistent", "true"), e.originEl = t.originEl, e.innerText = String(t.text);
|
35
35
|
const a = document.createElement("div");
|
36
|
-
a.classList.add("toast-item-wrapper"), a.appendChild(
|
36
|
+
a.classList.add("toast-item-wrapper"), a.appendChild(e), o.prepend(a);
|
37
37
|
}
|
38
38
|
}
|
39
|
-
function
|
40
|
-
|
41
|
-
|
42
|
-
let r = i == null ? void 0 : i.querySelector("skf-toast-wrapper");
|
39
|
+
function p(i, t) {
|
40
|
+
const a = new s().getData()[0]?.topOffset ?? null;
|
41
|
+
let r = i.querySelector("body")?.querySelector("skf-toast-wrapper");
|
43
42
|
if (!r) {
|
44
43
|
if (r = document.createElement("skf-toast-wrapper"), !r) throw new Error("Could not create toast wrapper element");
|
45
44
|
t && r.setAttribute("popover", "auto"), a && r.setAttribute("top-offset", a.toString()), document.body.appendChild(r);
|
@@ -8,8 +8,11 @@ import type { CSSResultGroup } from 'lit';
|
|
8
8
|
* @attribute {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the dropdown
|
9
9
|
* @attribute {string} [anchor] - The id of the element the dropdown will be anchored to
|
10
10
|
*
|
11
|
-
* @
|
12
|
-
* @
|
11
|
+
* @property {(void) => void} open() - Method that opens the tooltip
|
12
|
+
* @property {(void) => void} close() - Method that closes the tooltip
|
13
|
+
*
|
14
|
+
* @event {CustomEvent} skf-opened - Fired when the tooltip is opened
|
15
|
+
* @event {CustomEvent} skf-closed - Fired when the tooltip is closed
|
13
16
|
*
|
14
17
|
* @slot - The tooltip popover content
|
15
18
|
*
|
@@ -18,7 +21,11 @@ import type { CSSResultGroup } from 'lit';
|
|
18
21
|
export declare class SkfTooltip extends SkfPopoverBase {
|
19
22
|
static styles: CSSResultGroup;
|
20
23
|
constructor();
|
24
|
+
connectedCallback(): void;
|
25
|
+
/** @internal */
|
21
26
|
openExtended(): void;
|
27
|
+
/** @internal */
|
22
28
|
closeExtended(): void;
|
29
|
+
/** @internal */
|
23
30
|
addEventListeners($element: HTMLElement | Element): void;
|
24
31
|
}
|
@@ -1,23 +1,27 @@
|
|
1
|
-
import { styles as
|
1
|
+
import { styles as a } from "./tooltip.styles.js";
|
2
2
|
import { SkfPopoverBase as t } from "../../internal/base-classes/popover/popover.base.js";
|
3
|
-
const
|
3
|
+
const e = class e extends t {
|
4
4
|
constructor() {
|
5
|
-
super(), this.
|
5
|
+
super(), this.arrow = !0, this.offset = 8, this.placement = "top", this.variant = "tooltip", t.classMap = { tooltip: !0 };
|
6
6
|
}
|
7
|
+
connectedCallback() {
|
8
|
+
super.connectedCallback(), this.role = "tooltip";
|
9
|
+
}
|
10
|
+
/** @internal */
|
7
11
|
openExtended() {
|
8
|
-
|
9
|
-
(s = this.$anchor) == null || s.setAttribute("aria-describedby", this.id);
|
12
|
+
this.$anchor?.setAttribute("aria-describedby", this.id);
|
10
13
|
}
|
14
|
+
/** @internal */
|
11
15
|
closeExtended() {
|
12
|
-
|
13
|
-
(s = this.$anchor) == null || s.removeAttribute("aria-describedby");
|
16
|
+
this.$anchor?.removeAttribute("aria-describedby");
|
14
17
|
}
|
18
|
+
/** @internal */
|
15
19
|
addEventListeners(s) {
|
16
|
-
s.addEventListener("blur", this.close
|
20
|
+
s.addEventListener("blur", this.close, { signal: this.signal }), s.addEventListener("focus", this.open, { signal: this.signal }), s.addEventListener("mouseenter", this.open, { signal: this.signal }), s.addEventListener("mouseleave", this.close, { signal: this.signal });
|
17
21
|
}
|
18
22
|
};
|
19
|
-
|
20
|
-
let
|
23
|
+
e.styles = [t.styles, a];
|
24
|
+
let i = e;
|
21
25
|
export {
|
22
|
-
|
26
|
+
i as SkfTooltip
|
23
27
|
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { SkfTooltip } from './tooltip.component';
|
2
|
-
export * from './tooltip.component';
|
1
|
+
import { SkfTooltip } from './tooltip.component.js';
|
2
|
+
export * from './tooltip.component.js';
|
3
3
|
export default SkfTooltip;
|
4
4
|
declare global {
|
5
5
|
interface HTMLElementTagNameMap {
|