@skf-design-system/ui-components 1.0.1-beta.0 → 1.0.1-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/dist/components/accordion/accordion.component.js +3 -3
- package/dist/components/alert/alert.component.js +8 -8
- 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 +4 -4
- package/dist/components/checkbox/checkbox.component.d.ts +3 -1
- package/dist/components/checkbox/checkbox.component.js +69 -56
- package/dist/components/date-picker/datepicker.calendar.component.d.ts +72 -0
- package/dist/components/date-picker/datepicker.calendar.component.js +382 -0
- package/dist/components/date-picker/datepicker.calendar.styles.d.ts +1 -0
- package/dist/components/date-picker/datepicker.calendar.styles.js +192 -0
- package/dist/components/date-picker/datepicker.component.d.ts +74 -0
- package/dist/components/date-picker/datepicker.component.js +241 -0
- package/dist/components/date-picker/datepicker.d.ts +10 -0
- package/dist/components/date-picker/datepicker.helpers.d.ts +40 -0
- package/dist/components/date-picker/datepicker.helpers.js +69 -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 +99 -0
- package/dist/components/date-picker-input/datepicker-input.component.d.ts +107 -0
- package/dist/components/date-picker-input/datepicker-input.component.js +397 -0
- package/dist/components/date-picker-input/datepicker-input.d.ts +8 -0
- package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +4 -0
- package/dist/components/date-picker-input/datepicker-input.helpers.js +29 -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 +22 -0
- package/dist/components/dialog/dialog.component.js +19 -19
- package/dist/components/divider/divider.component.js +12 -12
- package/dist/components/heading/heading.component.js +13 -13
- package/dist/components/icon/icon.component.js +19 -19
- package/dist/components/input/input.component.d.ts +1 -0
- package/dist/components/input/input.component.js +87 -80
- package/dist/components/link/link.component.js +28 -28
- package/dist/components/loader/loader.component.js +19 -19
- package/dist/components/logo/logo.component.js +6 -6
- package/dist/components/popover/popover.component.js +12 -12
- package/dist/components/progress/progress.component.js +7 -7
- package/dist/components/radio/radio.component.js +4 -4
- package/dist/components/select-option-group/select-option-group.component.js +9 -9
- 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 +23 -23
- 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.js +9 -9
- package/dist/components/textarea/textarea.component.js +3 -3
- 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.js +2 -2
- package/dist/custom-elements.json +941 -161
- package/dist/index.d.ts +2 -0
- package/dist/index.js +72 -66
- package/dist/internal/components/hint/hint.component.js +13 -13
- package/dist/internal/controllers/popover.controller.d.ts +2 -1
- package/dist/internal/controllers/popover.controller.js +2 -2
- package/dist/internal/helpers/dateFormatter.d.ts +2 -0
- package/dist/internal/helpers/utilityTypes.d.ts +22 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +1 -0
- package/dist/react/skf-datepicker/index.d.ts +12 -0
- package/dist/react/skf-datepicker/index.js +18 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +45 -3
- package/dist/types/vue/index.d.ts +44 -1
- package/dist/vscode.html-custom-data.json +39 -1
- package/dist/web-types.json +107 -10
- package/package.json +3 -2
|
@@ -5,9 +5,9 @@ import { html as f } from "lit";
|
|
|
5
5
|
import { property as a, queryAssignedNodes as d } from "lit/decorators.js";
|
|
6
6
|
import { classMap as c } from "lit/directives/class-map.js";
|
|
7
7
|
import { styles as g } from "./accordion.styles.js";
|
|
8
|
-
var y = Object.defineProperty, s = (
|
|
9
|
-
for (var r = void 0, l =
|
|
10
|
-
(
|
|
8
|
+
var y = Object.defineProperty, s = (p, t, i, o) => {
|
|
9
|
+
for (var r = void 0, l = p.length - 1, u; l >= 0; l--)
|
|
10
|
+
(u = p[l]) && (r = u(t, i, r) || r);
|
|
11
11
|
return r && y(t, i, r), r;
|
|
12
12
|
};
|
|
13
13
|
const n = class n extends h {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import "../icon/icon.js";
|
|
2
2
|
import { SkfElement as y } from "../../internal/components/skf-element.js";
|
|
3
3
|
import f from "../../styles/component.styles.js";
|
|
4
|
-
import { html as m, nothing as
|
|
4
|
+
import { html as m, nothing as h } from "lit";
|
|
5
5
|
import { property as s } from "lit/decorators.js";
|
|
6
|
-
import { classMap as
|
|
6
|
+
import { classMap as u } from "lit/directives/class-map.js";
|
|
7
7
|
import { ifDefined as p } from "lit/directives/if-defined.js";
|
|
8
8
|
import { styles as v } from "./alert.styles.js";
|
|
9
|
-
var b = Object.defineProperty, r = (
|
|
10
|
-
for (var t = void 0, i =
|
|
11
|
-
(c =
|
|
12
|
-
return t && b(
|
|
9
|
+
var b = Object.defineProperty, r = (l, a, n, d) => {
|
|
10
|
+
for (var t = void 0, i = l.length - 1, c; i >= 0; i--)
|
|
11
|
+
(c = l[i]) && (t = c(a, n, t) || t);
|
|
12
|
+
return t && b(a, n, t), t;
|
|
13
13
|
};
|
|
14
14
|
const o = class o extends y {
|
|
15
15
|
constructor() {
|
|
@@ -21,7 +21,7 @@ const o = class o extends y {
|
|
|
21
21
|
return m`
|
|
22
22
|
<div
|
|
23
23
|
aria-describedby="main"
|
|
24
|
-
class=${
|
|
24
|
+
class=${u({
|
|
25
25
|
alert: !0,
|
|
26
26
|
"alert--severity-alert": this.severity === "alert",
|
|
27
27
|
"alert--severity-error": this.severity === "error",
|
|
@@ -50,7 +50,7 @@ const o = class o extends y {
|
|
|
50
50
|
>
|
|
51
51
|
<skf-icon name="close" size="sm"></skf-icon>
|
|
52
52
|
</button>
|
|
53
|
-
` :
|
|
53
|
+
` : h}
|
|
54
54
|
</div>
|
|
55
55
|
`;
|
|
56
56
|
}
|
|
@@ -33,8 +33,8 @@ export declare class SkfButton extends SkfElement {
|
|
|
33
33
|
icon?: SkfIcon['name'];
|
|
34
34
|
/** If true, removes border */
|
|
35
35
|
iconOnly: boolean;
|
|
36
|
-
/**
|
|
37
|
-
iconPosition
|
|
36
|
+
/** Determines the positioning of the icon in relation to the text */
|
|
37
|
+
iconPosition: 'left' | 'right';
|
|
38
38
|
/** If true, hides text & icon and shows loading indicator. **Notice!** Only applicable if `variant` is `primary`. */
|
|
39
39
|
loading: boolean;
|
|
40
40
|
noValidate: boolean;
|
|
@@ -55,7 +55,7 @@ export declare class SkfButton extends SkfElement {
|
|
|
55
55
|
private $button?;
|
|
56
56
|
constructor();
|
|
57
57
|
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
58
|
-
|
|
58
|
+
_handleLoadingChange(): void;
|
|
59
59
|
/** @internal */
|
|
60
60
|
_handleClick: (e: MouseEvent) => void;
|
|
61
61
|
/** @internal */
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import "../icon/icon.js";
|
|
2
2
|
import "../loader/loader.js";
|
|
3
|
-
import { SkfElement as
|
|
4
|
-
import f from "../../
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
import { SkfElement as m } from "../../internal/components/skf-element.js";
|
|
4
|
+
import { watch as f } from "../../internal/helpers/watch.js";
|
|
5
|
+
import u from "../../styles/component.styles.js";
|
|
6
|
+
import { html as d, LitElement as _, nothing as p } from "lit";
|
|
7
|
+
import { property as o, state as v, query as c } from "lit/decorators.js";
|
|
8
|
+
import { classMap as $ } from "lit/directives/class-map.js";
|
|
9
|
+
import { ifDefined as b } from "lit/directives/if-defined.js";
|
|
10
|
+
import g from "./button.styles.js";
|
|
11
|
+
var O = Object.defineProperty, V = Object.getOwnPropertyDescriptor, s = (y, t, l, r) => {
|
|
12
|
+
for (var e = r > 1 ? void 0 : r ? V(t, l) : t, a = y.length - 1, n; a >= 0; a--)
|
|
13
|
+
(n = y[a]) && (e = (r ? n(t, l, e) : n(e)) || e);
|
|
14
|
+
return r && e && O(t, l, e), e;
|
|
14
15
|
};
|
|
15
|
-
const
|
|
16
|
+
const h = class h extends m {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(), this._transitionOptions = {
|
|
18
19
|
duration: 200,
|
|
@@ -20,13 +21,13 @@ const d = class d extends b {
|
|
|
20
21
|
}, this.destructive = !1, this.disabled = !1, this.iconOnly = !1, this.iconPosition = "left", this.loading = !1, this.noValidate = !1, this.size = "md", this.type = "button", this.variant = "primary", this._loaderVisible = !1, this._handleClick = (t) => {
|
|
21
22
|
t.preventDefault(), t.stopPropagation(), !(this.disabled || this.loading) && (this.dispatchEvent(new CustomEvent("click", { bubbles: !0, composed: !0, detail: t })), this.type === "submit" && this._submitForm(), this.type === "reset" && this._resetForm());
|
|
22
23
|
}, this._submitForm = () => {
|
|
23
|
-
var
|
|
24
|
-
const t = !((
|
|
25
|
-
(
|
|
24
|
+
var e, a, n;
|
|
25
|
+
const t = !((e = this._internals.form) != null && e.reportValidity()), l = !this.noValidate, r = !((a = this._internals.form) != null && a.hasAttribute("no-validate"));
|
|
26
|
+
(l || r) && t || (n = this._internals.form) == null || n.requestSubmit();
|
|
26
27
|
}, this._resetForm = () => {
|
|
27
28
|
var t;
|
|
28
29
|
(t = this._internals.form) == null || t.reset();
|
|
29
|
-
}, this._renderIcon = () =>
|
|
30
|
+
}, this._renderIcon = () => d`<skf-icon class="skf-icon-host" name=${b(this.icon)}></skf-icon>`, this._internals = this.attachInternals();
|
|
30
31
|
}
|
|
31
32
|
firstUpdated(t) {
|
|
32
33
|
if (t.has("loading") && this.loading) {
|
|
@@ -34,8 +35,8 @@ const d = class d extends b {
|
|
|
34
35
|
this._loaderVisible = !0, this.$body.style.opacity = "0", this.$loader.style.opacity = "1";
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
_handleLoadingChange() {
|
|
39
|
+
this.loading ? this._showLoader() : this._hideLoader();
|
|
39
40
|
}
|
|
40
41
|
/** Simulates a click on the button. */
|
|
41
42
|
click() {
|
|
@@ -52,11 +53,11 @@ const d = class d extends b {
|
|
|
52
53
|
!this.$body || !this.$loader || (await this.$loader.animate({ opacity: 0 }, this._transitionOptions).finished, this._loaderVisible = !1, this.$body.animate({ opacity: 1 }, this._transitionOptions));
|
|
53
54
|
}
|
|
54
55
|
render() {
|
|
55
|
-
return
|
|
56
|
+
return d`
|
|
56
57
|
<button
|
|
57
58
|
?disabled=${this.disabled || this.loading}
|
|
58
59
|
aria-busy=${this.loading}
|
|
59
|
-
class=${
|
|
60
|
+
class=${$({
|
|
60
61
|
btn: !0,
|
|
61
62
|
"btn--destructive": this.destructive,
|
|
62
63
|
"btn--icon-only": this.iconOnly,
|
|
@@ -67,65 +68,68 @@ const d = class d extends b {
|
|
|
67
68
|
"btn--variant-secondary": this.variant === "secondary",
|
|
68
69
|
"btn--variant-tertiary": this.variant === "tertiary"
|
|
69
70
|
})}
|
|
70
|
-
type=${
|
|
71
|
+
type=${b(this.type)}
|
|
71
72
|
@click=${this._handleClick}
|
|
72
73
|
title=${/* An empty title prevents browser validation tooltips from appearing on hover */
|
|
73
74
|
this.title}
|
|
74
75
|
>
|
|
75
|
-
${this.variant === "primary" && this._loaderVisible ?
|
|
76
|
+
${this.variant === "primary" && this._loaderVisible ? d`<skf-loader class="btn__loader" invert size="sm"></skf-loader>` : ""}
|
|
76
77
|
<div class="btn__body" id="body">
|
|
77
|
-
${this.icon && this.iconPosition === "left" ? this._renderIcon() :
|
|
78
|
-
${this.iconOnly ?
|
|
79
|
-
${this.icon && this.iconPosition === "right" ? this._renderIcon() :
|
|
78
|
+
${this.icon && this.iconPosition === "left" ? this._renderIcon() : p}
|
|
79
|
+
${this.iconOnly ? p : d`<slot class="btn__label"></slot>`}
|
|
80
|
+
${this.icon && this.iconPosition === "right" ? this._renderIcon() : p}
|
|
80
81
|
</div>
|
|
81
82
|
</button>
|
|
82
83
|
`;
|
|
83
84
|
}
|
|
84
85
|
};
|
|
85
|
-
|
|
86
|
-
let i =
|
|
86
|
+
h.formAssociated = !0, h.shadowRootOptions = { ..._.shadowRootOptions, delegatesFocus: !0 }, h.styles = [u, g];
|
|
87
|
+
let i = h;
|
|
87
88
|
s([
|
|
88
|
-
|
|
89
|
-
], i.prototype, "destructive");
|
|
89
|
+
o({ type: Boolean })
|
|
90
|
+
], i.prototype, "destructive", 2);
|
|
90
91
|
s([
|
|
91
|
-
|
|
92
|
-
], i.prototype, "disabled");
|
|
92
|
+
o({ type: Boolean })
|
|
93
|
+
], i.prototype, "disabled", 2);
|
|
93
94
|
s([
|
|
94
|
-
|
|
95
|
-
], i.prototype, "icon");
|
|
95
|
+
o()
|
|
96
|
+
], i.prototype, "icon", 2);
|
|
96
97
|
s([
|
|
97
|
-
|
|
98
|
-
], i.prototype, "iconOnly");
|
|
98
|
+
o({ type: Boolean })
|
|
99
|
+
], i.prototype, "iconOnly", 2);
|
|
99
100
|
s([
|
|
100
|
-
|
|
101
|
-
], i.prototype, "iconPosition");
|
|
101
|
+
o({ attribute: "icon-position" })
|
|
102
|
+
], i.prototype, "iconPosition", 2);
|
|
102
103
|
s([
|
|
103
|
-
|
|
104
|
-
], i.prototype, "loading");
|
|
104
|
+
o({ type: Boolean, reflect: !0 })
|
|
105
|
+
], i.prototype, "loading", 2);
|
|
105
106
|
s([
|
|
106
|
-
|
|
107
|
-
], i.prototype, "noValidate");
|
|
107
|
+
o({ type: Boolean, attribute: "no-validate" })
|
|
108
|
+
], i.prototype, "noValidate", 2);
|
|
108
109
|
s([
|
|
109
|
-
|
|
110
|
-
], i.prototype, "size");
|
|
110
|
+
o({ reflect: !0 })
|
|
111
|
+
], i.prototype, "size", 2);
|
|
111
112
|
s([
|
|
112
|
-
|
|
113
|
-
], i.prototype, "type");
|
|
113
|
+
o()
|
|
114
|
+
], i.prototype, "type", 2);
|
|
114
115
|
s([
|
|
115
|
-
|
|
116
|
-
], i.prototype, "variant");
|
|
116
|
+
o({ reflect: !0 })
|
|
117
|
+
], i.prototype, "variant", 2);
|
|
117
118
|
s([
|
|
118
|
-
|
|
119
|
-
], i.prototype, "_loaderVisible");
|
|
119
|
+
v()
|
|
120
|
+
], i.prototype, "_loaderVisible", 2);
|
|
120
121
|
s([
|
|
121
|
-
|
|
122
|
-
], i.prototype, "$loader");
|
|
122
|
+
c("skf-loader")
|
|
123
|
+
], i.prototype, "$loader", 2);
|
|
123
124
|
s([
|
|
124
|
-
|
|
125
|
-
], i.prototype, "$body");
|
|
125
|
+
c("#body")
|
|
126
|
+
], i.prototype, "$body", 2);
|
|
126
127
|
s([
|
|
127
|
-
|
|
128
|
-
], i.prototype, "$button");
|
|
128
|
+
c("button")
|
|
129
|
+
], i.prototype, "$button", 2);
|
|
130
|
+
s([
|
|
131
|
+
f("loading", { afterUpdate: !0 })
|
|
132
|
+
], i.prototype, "_handleLoadingChange", 1);
|
|
129
133
|
export {
|
|
130
134
|
i as SkfButton
|
|
131
135
|
};
|
|
@@ -4,10 +4,10 @@ import { html as m } from "lit";
|
|
|
4
4
|
import { property as o } from "lit/decorators.js";
|
|
5
5
|
import { classMap as f } from "lit/directives/class-map.js";
|
|
6
6
|
import { styles as h } from "./card.styles.js";
|
|
7
|
-
var u = Object.defineProperty, s = (i,
|
|
8
|
-
for (var t = void 0, e = i.length - 1,
|
|
9
|
-
(
|
|
10
|
-
return t && u(
|
|
7
|
+
var u = Object.defineProperty, s = (i, p, a, y) => {
|
|
8
|
+
for (var t = void 0, e = i.length - 1, d; e >= 0; e--)
|
|
9
|
+
(d = i[e]) && (t = d(p, a, t) || t);
|
|
10
|
+
return t && u(p, a, t), t;
|
|
11
11
|
};
|
|
12
12
|
const n = class n extends l {
|
|
13
13
|
constructor() {
|
|
@@ -26,7 +26,8 @@ export declare class SkfCheckbox extends FormBase implements FormFieldBaseProps
|
|
|
26
26
|
/** If defined, outputs helping hints in console */
|
|
27
27
|
debug?: boolean;
|
|
28
28
|
/** If true, outputs helping hints in console */
|
|
29
|
-
checked
|
|
29
|
+
get checked(): boolean | undefined;
|
|
30
|
+
set checked(value: boolean | undefined);
|
|
30
31
|
/** If true, forces component to invalid state until removed */
|
|
31
32
|
customInvalid?: boolean;
|
|
32
33
|
/** If true and the checkbox is unchecked, the checkbox will appear indeterminate */
|
|
@@ -53,6 +54,7 @@ export declare class SkfCheckbox extends FormBase implements FormFieldBaseProps
|
|
|
53
54
|
private _invalid;
|
|
54
55
|
/** @internal */
|
|
55
56
|
private $input?;
|
|
57
|
+
handleCheckedChange(): void;
|
|
56
58
|
handleInvalidChange(): void;
|
|
57
59
|
handleDebugInvalid(): void;
|
|
58
60
|
handleCustomInvalidChange(): void;
|
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
import "../icon/icon.js";
|
|
2
|
-
import { FormBase as
|
|
2
|
+
import { FormBase as p } from "../../internal/components/formBase.js";
|
|
3
3
|
import { watch as h } from "../../internal/helpers/watch.js";
|
|
4
4
|
import { Asterisk as v } from "../../internal/templates/asterisk.js";
|
|
5
5
|
import m from "../../styles/component.styles.js";
|
|
6
|
-
import { html as
|
|
7
|
-
import { property as r, state as y, query as
|
|
8
|
-
import { ifDefined as
|
|
9
|
-
import
|
|
10
|
-
var
|
|
11
|
-
for (var l = a > 1 ? void 0 : a ?
|
|
12
|
-
(
|
|
13
|
-
return a && l &&
|
|
6
|
+
import { html as c, nothing as f } from "lit";
|
|
7
|
+
import { property as r, state as y, query as g } from "lit/decorators.js";
|
|
8
|
+
import { ifDefined as _ } from "lit/directives/if-defined.js";
|
|
9
|
+
import b from "./checkbox.styles.js";
|
|
10
|
+
var k = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, i = (u, t, s, a) => {
|
|
11
|
+
for (var l = a > 1 ? void 0 : a ? $(t, s) : t, n = u.length - 1, o; n >= 0; n--)
|
|
12
|
+
(o = u[n]) && (l = (a ? o(t, s, l) : o(l)) || l);
|
|
13
|
+
return a && l && k(t, s, l), l;
|
|
14
14
|
};
|
|
15
|
-
const d = class d extends
|
|
15
|
+
const d = class d extends p {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(...arguments), this._initiallyChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (
|
|
18
|
-
|
|
19
|
-
}, this._renderIcon = (
|
|
20
|
-
<skf-icon color="inverse" name=${
|
|
17
|
+
super(...arguments), this._initiallyChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (t) => {
|
|
18
|
+
t.stopPropagation(), this.checked = this._initiallyChecked, this.$input && (this.$input.checked = !!this._initiallyChecked), this.setFormValue(this.checked ? this.value : null);
|
|
19
|
+
}, this._renderIcon = (t) => c`
|
|
20
|
+
<skf-icon color="inverse" name=${t} size=${this.size === "sm" ? "sm" : "md"}></skf-icon>
|
|
21
21
|
`;
|
|
22
22
|
}
|
|
23
|
+
get checked() {
|
|
24
|
+
var t;
|
|
25
|
+
return ((t = this.$input) == null ? void 0 : t.checked) ?? !1;
|
|
26
|
+
}
|
|
27
|
+
set checked(t) {
|
|
28
|
+
this.setAttribute("checked", String(!!t)), this.$input && (this.$input.checked = !!t);
|
|
29
|
+
}
|
|
30
|
+
handleCheckedChange() {
|
|
31
|
+
this.setFormValue(this.checked ? this.value : null), this._validateInput();
|
|
32
|
+
}
|
|
23
33
|
handleInvalidChange() {
|
|
24
34
|
this._invalid ? (this.setAttribute("invalid", ""), this.showValid && this.removeAttribute("valid"), this.checkValidity()) : (this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"));
|
|
25
35
|
}
|
|
@@ -37,8 +47,8 @@ const d = class d extends c {
|
|
|
37
47
|
this.setValidity({}), this._validateInput();
|
|
38
48
|
}
|
|
39
49
|
firstUpdated() {
|
|
40
|
-
var
|
|
41
|
-
(
|
|
50
|
+
var t;
|
|
51
|
+
(t = this.$input) == null || t.addEventListener("change", (s) => {
|
|
42
52
|
var a;
|
|
43
53
|
s.stopPropagation(), this.pristine = !1, this.checked = (a = this.$input) == null ? void 0 : a.checked, this._validateInput(), this.checked ? (this.indeterminate = !1, this.setFormValue(this.value)) : this.setFormValue(null), this.emitEvent("change");
|
|
44
54
|
}), this.addEventListener("invalid", (s) => {
|
|
@@ -47,21 +57,21 @@ const d = class d extends c {
|
|
|
47
57
|
}
|
|
48
58
|
/** @internal */
|
|
49
59
|
_validateInput() {
|
|
50
|
-
var
|
|
60
|
+
var t;
|
|
51
61
|
if (this._invalid = !1, this.customInvalid)
|
|
52
62
|
this.setValidity({ customError: !0 }, "Custom error"), this._invalid = !0;
|
|
53
63
|
else if (this.required && !this.checked) {
|
|
54
64
|
this.pristine || (this._invalid = !0);
|
|
55
65
|
const s = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : (
|
|
56
66
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
57
|
-
((
|
|
67
|
+
((t = this.$input) == null ? void 0 : t.validationMessage) || "Please check this box if you want to proceed"
|
|
58
68
|
);
|
|
59
69
|
this.setValidity({ valueMissing: !0 }, String(s));
|
|
60
70
|
} else
|
|
61
71
|
this.setValidity({});
|
|
62
72
|
}
|
|
63
73
|
render() {
|
|
64
|
-
return
|
|
74
|
+
return c`
|
|
65
75
|
<label id="root">
|
|
66
76
|
<input
|
|
67
77
|
?checked=${this.checked}
|
|
@@ -69,7 +79,7 @@ const d = class d extends c {
|
|
|
69
79
|
?required=${this.required}
|
|
70
80
|
.indeterminate=${this.indeterminate ?? !1}
|
|
71
81
|
aria-invalid=${!!this._invalid}
|
|
72
|
-
name=${
|
|
82
|
+
name=${_(this.name)}
|
|
73
83
|
type="checkbox"
|
|
74
84
|
value=${this.value}
|
|
75
85
|
/>
|
|
@@ -82,56 +92,59 @@ const d = class d extends c {
|
|
|
82
92
|
`;
|
|
83
93
|
}
|
|
84
94
|
};
|
|
85
|
-
d.styles = [m,
|
|
86
|
-
let
|
|
87
|
-
|
|
95
|
+
d.styles = [m, b];
|
|
96
|
+
let e = d;
|
|
97
|
+
i([
|
|
88
98
|
r({ type: Boolean })
|
|
89
|
-
],
|
|
90
|
-
|
|
99
|
+
], e.prototype, "debug", 2);
|
|
100
|
+
i([
|
|
91
101
|
r({ type: Boolean, reflect: !0 })
|
|
92
|
-
],
|
|
93
|
-
|
|
102
|
+
], e.prototype, "checked", 1);
|
|
103
|
+
i([
|
|
94
104
|
r({ type: Boolean, attribute: "custom-invalid", reflect: !0 })
|
|
95
|
-
],
|
|
96
|
-
|
|
105
|
+
], e.prototype, "customInvalid", 2);
|
|
106
|
+
i([
|
|
97
107
|
r({ type: Boolean, reflect: !0 })
|
|
98
|
-
],
|
|
99
|
-
|
|
108
|
+
], e.prototype, "indeterminate", 2);
|
|
109
|
+
i([
|
|
100
110
|
r()
|
|
101
|
-
],
|
|
102
|
-
|
|
111
|
+
], e.prototype, "label", 2);
|
|
112
|
+
i([
|
|
103
113
|
r()
|
|
104
|
-
],
|
|
105
|
-
|
|
114
|
+
], e.prototype, "name", 2);
|
|
115
|
+
i([
|
|
106
116
|
r({ attribute: "required-label" })
|
|
107
|
-
],
|
|
108
|
-
|
|
117
|
+
], e.prototype, "requiredLabel", 2);
|
|
118
|
+
i([
|
|
109
119
|
r({ reflect: !0 })
|
|
110
|
-
],
|
|
111
|
-
|
|
120
|
+
], e.prototype, "severity", 2);
|
|
121
|
+
i([
|
|
112
122
|
r({ type: Boolean, attribute: "show-valid" })
|
|
113
|
-
],
|
|
114
|
-
|
|
123
|
+
], e.prototype, "showValid", 2);
|
|
124
|
+
i([
|
|
115
125
|
r({ reflect: !0 })
|
|
116
|
-
],
|
|
117
|
-
|
|
126
|
+
], e.prototype, "size", 2);
|
|
127
|
+
i([
|
|
118
128
|
r()
|
|
119
|
-
],
|
|
120
|
-
|
|
129
|
+
], e.prototype, "value", 2);
|
|
130
|
+
i([
|
|
121
131
|
y()
|
|
122
|
-
],
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
],
|
|
126
|
-
|
|
132
|
+
], e.prototype, "_invalid", 2);
|
|
133
|
+
i([
|
|
134
|
+
g("input")
|
|
135
|
+
], e.prototype, "$input", 2);
|
|
136
|
+
i([
|
|
137
|
+
h("checked", { afterUpdate: !0 })
|
|
138
|
+
], e.prototype, "handleCheckedChange", 1);
|
|
139
|
+
i([
|
|
127
140
|
h("_invalid")
|
|
128
|
-
],
|
|
129
|
-
|
|
141
|
+
], e.prototype, "handleInvalidChange", 1);
|
|
142
|
+
i([
|
|
130
143
|
h("_invalid", { afterUpdate: !0 })
|
|
131
|
-
],
|
|
132
|
-
|
|
144
|
+
], e.prototype, "handleDebugInvalid", 1);
|
|
145
|
+
i([
|
|
133
146
|
h("customInvalid")
|
|
134
|
-
],
|
|
147
|
+
], e.prototype, "handleCustomInvalidChange", 1);
|
|
135
148
|
export {
|
|
136
|
-
|
|
149
|
+
e as SkfCheckbox
|
|
137
150
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
|
2
|
+
import { Temporal } from '@js-temporal/polyfill';
|
|
3
|
+
import { type CSSResultGroup } from 'lit';
|
|
4
|
+
interface DateParts {
|
|
5
|
+
year?: number;
|
|
6
|
+
month?: number;
|
|
7
|
+
day?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class SkfDatePickerCalendar extends SkfElement {
|
|
10
|
+
static styles: CSSResultGroup;
|
|
11
|
+
/** @internal */
|
|
12
|
+
_secondCalendarOffset: number;
|
|
13
|
+
/** @internal calendar month to display */
|
|
14
|
+
date: Date;
|
|
15
|
+
eventid: string;
|
|
16
|
+
firstDayOfWeek: number;
|
|
17
|
+
/**
|
|
18
|
+
* A comma-separated list of dates (yyyy-mm-dd format) that are not selectable.
|
|
19
|
+
*/
|
|
20
|
+
invalidDates?: string;
|
|
21
|
+
locale: string;
|
|
22
|
+
range: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Earliest selectable date. (yyyy-mm-dd format)
|
|
25
|
+
*/
|
|
26
|
+
selectableFrom?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Latest selectable date. (yyyy-mm-dd format)
|
|
29
|
+
*/
|
|
30
|
+
selectableTo?: string;
|
|
31
|
+
selectedDate?: Date;
|
|
32
|
+
selectedDateRange: {
|
|
33
|
+
start: Date | null;
|
|
34
|
+
end: Date | null;
|
|
35
|
+
};
|
|
36
|
+
/** @internal */
|
|
37
|
+
_numberOfDays: number;
|
|
38
|
+
/** @internal */
|
|
39
|
+
_numberOfDaysLastMonth: number;
|
|
40
|
+
firstUpdated(): void;
|
|
41
|
+
/** For single select, the selected date */
|
|
42
|
+
attributeChangedCallback(name: string, oldVal: unknown, newVal: unknown): void;
|
|
43
|
+
/** @internal */
|
|
44
|
+
handleDateChange(): void;
|
|
45
|
+
/** @internal */
|
|
46
|
+
_createDate({ year, month, day }: DateParts, useTemporalApi: true): Temporal.PlainDate;
|
|
47
|
+
_createDate({ year, month, day }: DateParts, useTemporalApi?: false): Date;
|
|
48
|
+
/** @internal Converts a new Date object to PlainDate type. If no argument sent, uses 'this.date' */
|
|
49
|
+
_plainDate(date?: Date | null): Temporal.PlainDate | null;
|
|
50
|
+
/** @internal Check if a day is between two dates */
|
|
51
|
+
_isDateBetween(dateToCheck: Temporal.PlainDate, startDate?: Temporal.PlainDate, endDate?: Temporal.PlainDate): boolean;
|
|
52
|
+
render(): import("lit").TemplateResult<1>;
|
|
53
|
+
/** @internal */
|
|
54
|
+
private returnDayClasses;
|
|
55
|
+
/** @internal */
|
|
56
|
+
private handleSelectDay;
|
|
57
|
+
/** @internal */
|
|
58
|
+
private getCalendarPreMonthDays;
|
|
59
|
+
/** @internal */
|
|
60
|
+
private getCalendarRemaningDays;
|
|
61
|
+
/** @internal */
|
|
62
|
+
private calendarMonthStartsOn;
|
|
63
|
+
/** @internal */
|
|
64
|
+
private getCalendarStartDay;
|
|
65
|
+
dateSelectable: (dateString: string) => {
|
|
66
|
+
matchesInvalidDates: boolean | undefined;
|
|
67
|
+
dateWithinRange: boolean;
|
|
68
|
+
};
|
|
69
|
+
/** @internal */
|
|
70
|
+
private getCalendarHead;
|
|
71
|
+
}
|
|
72
|
+
export {};
|