@skf-design-system/ui-components 1.0.0-alpha.27 → 1.0.0-alpha.29
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 +26 -6
- package/custom-elements.json +18265 -0
- package/dist/components/alert/alert.component.js +20 -18
- package/dist/components/alert/alert.styles.js +50 -47
- package/dist/components/button/button.component.d.ts +24 -0
- package/dist/components/button/button.component.js +79 -55
- package/dist/components/button/button.styles.js +1 -0
- package/dist/components/checkbox/checkbox.component.d.ts +3 -8
- package/dist/components/checkbox/checkbox.component.js +95 -90
- package/dist/components/checkbox/checkbox.styles.js +2 -2
- package/dist/components/input/input.component.d.ts +10 -0
- package/dist/components/input/input.component.js +89 -82
- package/dist/components/progress/progress.component.d.ts +22 -0
- package/dist/components/progress/progress.component.js +40 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +6 -0
- package/dist/components/progress/progress.styles.d.ts +1 -0
- package/dist/components/progress/progress.styles.js +47 -0
- package/dist/components/radio/radio.component.d.ts +4 -6
- package/dist/components/radio/radio.component.js +93 -77
- package/dist/components/select/select.component.d.ts +5 -2
- package/dist/components/select/select.component.js +103 -88
- package/dist/components/select/select.controllers.js +5 -2
- package/dist/components/switch/switch.component.js +4 -1
- package/dist/components/tab/tab.component.d.ts +29 -0
- package/dist/components/tab/tab.component.js +57 -0
- package/dist/components/tab/tab.d.ts +8 -0
- package/dist/components/tab/tab.js +6 -0
- package/dist/components/tab/tab.styles.d.ts +1 -0
- package/dist/components/tab/tab.styles.js +123 -0
- package/dist/components/tab-group/tab-group.component.d.ts +43 -0
- package/dist/components/tab-group/tab-group.component.js +98 -0
- package/dist/components/tab-group/tab-group.d.ts +8 -0
- package/dist/components/tab-group/tab-group.js +6 -0
- package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
- package/dist/components/tab-group/tab-group.styles.js +75 -0
- package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
- package/dist/components/tab-panel/tab-panel.component.js +36 -0
- package/dist/components/tab-panel/tab-panel.d.ts +8 -0
- package/dist/components/tab-panel/tab-panel.js +6 -0
- package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
- package/dist/components/tab-panel/tab-panel.styles.js +13 -0
- package/dist/components/textarea/textarea.component.js +5 -5
- package/dist/components/toast/toast.component.d.ts +35 -0
- package/dist/components/toast/toast.component.js +52 -0
- package/dist/components/toast/toast.d.ts +8 -0
- package/dist/components/toast/toast.js +6 -0
- package/dist/components/toast/toast.singleton.d.ts +26 -0
- package/dist/components/toast/toast.singleton.js +53 -0
- package/dist/components/toast/toast.styles.d.ts +1 -0
- package/dist/components/toast/toast.styles.js +9 -0
- package/dist/components/toast-item/toast-item.component.d.ts +21 -0
- package/dist/components/toast-item/toast-item.component.js +65 -0
- package/dist/components/toast-item/toast-item.d.ts +6 -0
- package/dist/components/toast-item/toast-item.js +2 -0
- package/dist/components/toast-item/toast-item.styles.d.ts +2 -0
- package/dist/components/toast-item/toast-item.styles.js +16 -0
- package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
- package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
- package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
- package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
- package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
- package/dist/components/toast-wrapper/toast-wrapper.styles.js +20 -0
- package/dist/custom-elements.json +1167 -311
- package/dist/index.d.ts +5 -0
- package/dist/index.js +57 -42
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -11
- package/dist/internal/helpers/watch.d.ts +27 -0
- package/dist/internal/helpers/watch.js +28 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.js +6 -0
- package/dist/react/skf-button/index.d.ts +7 -1
- package/dist/react/skf-button/index.js +5 -1
- package/dist/react/skf-progress/index.d.ts +3 -0
- package/dist/react/skf-progress/index.js +13 -0
- package/dist/react/skf-tab/index.d.ts +12 -0
- package/dist/react/skf-tab/index.js +18 -0
- package/dist/react/skf-tab-group/index.d.ts +3 -0
- package/dist/react/skf-tab-group/index.js +13 -0
- package/dist/react/skf-tab-panel/index.d.ts +3 -0
- package/dist/react/skf-tab-panel/index.js +13 -0
- package/dist/react/skf-toast/index.d.ts +3 -0
- package/dist/react/skf-toast/index.js +13 -0
- package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
- package/dist/react/skf-toast-wrapper/index.js +13 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +342 -806
- package/dist/types/vue/index.d.ts +147 -8
- package/dist/vscode.html-custom-data.json +116 -16
- package/dist/web-types.json +304 -35
- package/package.json +27 -27
@@ -1,65 +1,67 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { FormBase as
|
3
|
-
import {
|
4
|
-
import v from "../../
|
5
|
-
import
|
6
|
-
import {
|
2
|
+
import { FormBase as c } from "../../internal/components/formBase.js";
|
3
|
+
import { watch as h } from "../../internal/helpers/watch.js";
|
4
|
+
import { Asterisk as v } from "../../internal/templates/asterisk.js";
|
5
|
+
import m from "../../styles/component.styles.js";
|
6
|
+
import { html as p, nothing as y } from "lit";
|
7
|
+
import { property as r, state as f, query as _ } from "lit/decorators.js";
|
7
8
|
import { ifDefined as b } from "lit/directives/if-defined.js";
|
8
|
-
import
|
9
|
-
var
|
10
|
-
for (var
|
11
|
-
(
|
12
|
-
return
|
9
|
+
import g from "./checkbox.styles.js";
|
10
|
+
var $ = Object.defineProperty, I = Object.getOwnPropertyDescriptor, e = (u, i, s, a) => {
|
11
|
+
for (var l = a > 1 ? void 0 : a ? I(i, s) : i, o = u.length - 1, n; o >= 0; o--)
|
12
|
+
(n = u[o]) && (l = (a ? n(i, s, l) : n(l)) || l);
|
13
|
+
return a && l && $(i, s, l), l;
|
13
14
|
};
|
14
|
-
const
|
15
|
+
const d = class d extends c {
|
15
16
|
constructor() {
|
16
|
-
super(...arguments), this._initiallyChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (
|
17
|
-
|
18
|
-
}, this._renderIcon = (
|
19
|
-
<skf-icon color="inverse" name=${
|
17
|
+
super(...arguments), this._initiallyChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (i) => {
|
18
|
+
i.stopPropagation(), this.checked = this._initiallyChecked, this.$input && (this.$input.checked = !!this._initiallyChecked), this.setFormValue(this.checked ? this.value : null);
|
19
|
+
}, this._renderIcon = (i) => p`
|
20
|
+
<skf-icon color="inverse" name=${i} size=${this.size === "sm" ? "sm" : "md"}></skf-icon>
|
20
21
|
`;
|
21
22
|
}
|
22
|
-
|
23
|
-
|
23
|
+
handleInvalidChange() {
|
24
|
+
this._invalid ? (this.setAttribute("invalid", ""), this.showValid && this.removeAttribute("valid"), this.checkValidity()) : (this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"));
|
24
25
|
}
|
25
|
-
|
26
|
-
|
27
|
-
if (this.customInvalid) {
|
28
|
-
const a = this.getAttribute("data-customerror") ?? "Custom error";
|
29
|
-
this.pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, a), this.showValid && this.removeAttribute("valid"), this.checkValidity();
|
30
|
-
} else
|
31
|
-
console.log("remove invalid"), this.invalid = !1, !this.pristine && this.showValid && this.setAttribute("valid", "true"), this.setValidity({}), this._validateInput();
|
32
|
-
t.has("_invalid") && (this.invalid = this._invalid);
|
26
|
+
handleDebugInvalid() {
|
27
|
+
this._invalid && this.debug && !this.validity.valid && console.log(`Checkbox invalidity reason: ${this.validationMessage}`);
|
33
28
|
}
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
this.pristine = !1, this._invalid = !0, this.
|
41
|
-
}
|
42
|
-
|
43
|
-
updated(t) {
|
44
|
-
super.updated(t), t.has("_invalid") && this._invalid && this.debug && this.debugOutput();
|
29
|
+
handleCustomInvalidChange() {
|
30
|
+
if (this.customInvalid) {
|
31
|
+
const s = (
|
32
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
33
|
+
this.getAttribute("data-customerror") || "Set a custom error message using the data-customerror attribute"
|
34
|
+
);
|
35
|
+
this.pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, s), this.checkValidity();
|
36
|
+
} else
|
37
|
+
this.setValidity({}), this._validateInput();
|
45
38
|
}
|
46
|
-
|
47
|
-
|
39
|
+
firstUpdated() {
|
40
|
+
var i;
|
41
|
+
(i = this.$input) == null || i.addEventListener("change", (s) => {
|
42
|
+
var a;
|
43
|
+
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
|
+
}), this.addEventListener("invalid", (s) => {
|
45
|
+
this.pristine = !1, this._invalid = !0, this.customErrorDisplay && s.preventDefault();
|
46
|
+
}), this._initiallyChecked = this.checked, this.addEventListener("reset", this._resetValue), this._validateInput();
|
48
47
|
}
|
49
48
|
/** @internal */
|
50
49
|
_validateInput() {
|
51
|
-
var
|
50
|
+
var i;
|
52
51
|
if (this._invalid = !1, this.customInvalid)
|
53
52
|
this.setValidity({ customError: !0 }, "Custom error"), this._invalid = !0;
|
54
53
|
else if (this.required && !this.checked) {
|
55
54
|
this.pristine || (this._invalid = !0);
|
56
|
-
const
|
57
|
-
|
55
|
+
const s = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : (
|
56
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
57
|
+
((i = this.$input) == null ? void 0 : i.validationMessage) || "Please check this box if you want to proceed"
|
58
|
+
);
|
59
|
+
this.setValidity({ valueMissing: !0 }, String(s));
|
58
60
|
} else
|
59
61
|
this.setValidity({});
|
60
62
|
}
|
61
63
|
render() {
|
62
|
-
return
|
64
|
+
return p`
|
63
65
|
<label id="root">
|
64
66
|
<input
|
65
67
|
?checked=${this.checked}
|
@@ -74,59 +76,62 @@ const n = class n extends p {
|
|
74
76
|
${this._renderIcon("check")} ${this._renderIcon("removeMinus")}
|
75
77
|
<div id="label">
|
76
78
|
<slot>${this.label}</slot>
|
77
|
-
${this.required ?
|
79
|
+
${this.required ? v(this.requiredLabel) : y}
|
78
80
|
</div>
|
79
81
|
</label>
|
80
82
|
`;
|
81
83
|
}
|
82
84
|
};
|
83
|
-
|
84
|
-
let
|
85
|
-
|
86
|
-
|
87
|
-
],
|
88
|
-
|
89
|
-
|
90
|
-
],
|
91
|
-
|
92
|
-
|
93
|
-
],
|
94
|
-
|
95
|
-
|
96
|
-
],
|
97
|
-
|
98
|
-
|
99
|
-
],
|
100
|
-
|
101
|
-
|
102
|
-
],
|
103
|
-
|
104
|
-
|
105
|
-
],
|
106
|
-
|
107
|
-
|
108
|
-
],
|
109
|
-
|
110
|
-
|
111
|
-
],
|
112
|
-
|
113
|
-
|
114
|
-
],
|
115
|
-
|
116
|
-
|
117
|
-
],
|
118
|
-
|
119
|
-
s({ reflect: !0 })
|
120
|
-
], e.prototype, "size");
|
121
|
-
i([
|
122
|
-
s()
|
123
|
-
], e.prototype, "value");
|
124
|
-
i([
|
85
|
+
d.styles = [m, g];
|
86
|
+
let t = d;
|
87
|
+
e([
|
88
|
+
r({ type: Boolean })
|
89
|
+
], t.prototype, "debug", 2);
|
90
|
+
e([
|
91
|
+
r({ type: Boolean, reflect: !0 })
|
92
|
+
], t.prototype, "checked", 2);
|
93
|
+
e([
|
94
|
+
r({ type: Boolean, attribute: "custom-invalid", reflect: !0 })
|
95
|
+
], t.prototype, "customInvalid", 2);
|
96
|
+
e([
|
97
|
+
r({ type: Boolean, reflect: !0 })
|
98
|
+
], t.prototype, "indeterminate", 2);
|
99
|
+
e([
|
100
|
+
r()
|
101
|
+
], t.prototype, "label", 2);
|
102
|
+
e([
|
103
|
+
r()
|
104
|
+
], t.prototype, "name", 2);
|
105
|
+
e([
|
106
|
+
r({ attribute: "required-label" })
|
107
|
+
], t.prototype, "requiredLabel", 2);
|
108
|
+
e([
|
109
|
+
r({ reflect: !0 })
|
110
|
+
], t.prototype, "severity", 2);
|
111
|
+
e([
|
112
|
+
r({ type: Boolean, attribute: "show-valid" })
|
113
|
+
], t.prototype, "showValid", 2);
|
114
|
+
e([
|
115
|
+
r({ reflect: !0 })
|
116
|
+
], t.prototype, "size", 2);
|
117
|
+
e([
|
118
|
+
r()
|
119
|
+
], t.prototype, "value", 2);
|
120
|
+
e([
|
125
121
|
f()
|
126
|
-
],
|
127
|
-
|
128
|
-
|
129
|
-
],
|
122
|
+
], t.prototype, "_invalid", 2);
|
123
|
+
e([
|
124
|
+
_("input")
|
125
|
+
], t.prototype, "$input", 2);
|
126
|
+
e([
|
127
|
+
h("_invalid")
|
128
|
+
], t.prototype, "handleInvalidChange", 1);
|
129
|
+
e([
|
130
|
+
h("_invalid", { afterUpdate: !0 })
|
131
|
+
], t.prototype, "handleDebugInvalid", 1);
|
132
|
+
e([
|
133
|
+
h("customInvalid")
|
134
|
+
], t.prototype, "handleCustomInvalidChange", 1);
|
130
135
|
export {
|
131
|
-
|
136
|
+
t as SkfCheckbox
|
132
137
|
};
|
@@ -57,12 +57,12 @@ const i = [
|
|
57
57
|
--_skf-checkbox-border-color: var(--skf-interactive-border-color-disabled);
|
58
58
|
}
|
59
59
|
|
60
|
-
|
60
|
+
:host([invalid]) & {
|
61
61
|
--_skf-checkbox-border-color: var(--skf-severity-fg-color-error);
|
62
62
|
}
|
63
63
|
|
64
64
|
:host([valid]) & {
|
65
|
-
--_skf-checkbox-border-color: var(--skf-severity-fg-color-
|
65
|
+
--_skf-checkbox-border-color: var(--skf-severity-fg-color-success);
|
66
66
|
}
|
67
67
|
|
68
68
|
:host([severity='alert']:not([invalid], [valid])) & {
|
@@ -3,6 +3,7 @@ import { FormBase } from '@internal/components/formBase.js';
|
|
3
3
|
import '@internal/components/hint/hint';
|
4
4
|
import type { FormFieldBaseProps } from '@internal/types/formField.js';
|
5
5
|
import { type CSSResultGroup } from 'lit';
|
6
|
+
type AutocompleteValues = 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-amount' | 'transaction-currency' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'url' | 'photo' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'email' | 'impp' | 'password' | 'webauthn' | 'work' | (string & {});
|
6
7
|
/**
|
7
8
|
* The skf-text-field is used to create a text input field. It can be used inside a form element or standalone.
|
8
9
|
*
|
@@ -24,6 +25,12 @@ import { type CSSResultGroup } from 'lit';
|
|
24
25
|
export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
25
26
|
static styles: CSSResultGroup;
|
26
27
|
private customError;
|
28
|
+
/**
|
29
|
+
* Specifies what permission the browser has to provide assistance in filling out form field values. Refer to
|
30
|
+
* [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.
|
31
|
+
* @type { -m }
|
32
|
+
*/
|
33
|
+
autocomplete?: AutocompleteValues;
|
27
34
|
/** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
|
28
35
|
buttonAriaLabelClear: string;
|
29
36
|
/** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
|
@@ -91,6 +98,8 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
91
98
|
/** @internal */
|
92
99
|
$input: HTMLInputElement;
|
93
100
|
/** @internal */
|
101
|
+
_defaultSlot: Node[];
|
102
|
+
/** @internal */
|
94
103
|
private _numberController;
|
95
104
|
/** @internal */
|
96
105
|
private _passwordController;
|
@@ -126,3 +135,4 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
126
135
|
private _onBlur;
|
127
136
|
render(): import("lit").TemplateResult<1>;
|
128
137
|
}
|
138
|
+
export {};
|
@@ -5,46 +5,46 @@ import { hintSeverity as v } from "../../internal/helpers/hintSeverity.js";
|
|
5
5
|
import { Asterisk as y } from "../../internal/templates/asterisk.js";
|
6
6
|
import f from "../../styles/component.styles.js";
|
7
7
|
import { html as h, nothing as d } from "lit";
|
8
|
-
import { property as
|
9
|
-
import { ifDefined as
|
10
|
-
import { live as
|
11
|
-
import { InputNumberController as
|
12
|
-
import
|
13
|
-
var
|
14
|
-
for (var o =
|
15
|
-
(u = m[l]) && (o = (
|
16
|
-
return
|
8
|
+
import { property as e, state as c, query as _, queryAssignedNodes as $ } from "lit/decorators.js";
|
9
|
+
import { ifDefined as n } from "lit/directives/if-defined.js";
|
10
|
+
import { live as g } from "lit/directives/live.js";
|
11
|
+
import { InputNumberController as w, InputPasswordController as E } from "./input.controllers.js";
|
12
|
+
import A from "./input.styles.js";
|
13
|
+
var C = Object.defineProperty, S = Object.getOwnPropertyDescriptor, i = (m, s, r, a) => {
|
14
|
+
for (var o = a > 1 ? void 0 : a ? S(s, r) : s, l = m.length - 1, u; l >= 0; l--)
|
15
|
+
(u = m[l]) && (o = (a ? u(s, r, o) : u(o)) || o);
|
16
|
+
return a && o && C(s, r, o), o;
|
17
17
|
};
|
18
18
|
const p = class p extends b {
|
19
19
|
constructor() {
|
20
|
-
super(...arguments), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._numberController = new
|
20
|
+
super(...arguments), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._numberController = new w(this), this._passwordController = new E(this), this._handleInput = () => {
|
21
21
|
this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
22
|
-
}, this._resetValue = (
|
22
|
+
}, this._resetValue = (s) => {
|
23
23
|
var r;
|
24
|
-
|
25
|
-
}, this._handlePressStart = (
|
26
|
-
this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(
|
24
|
+
s.stopPropagation(), this.value = ((r = this.getAttribute("value")) == null ? void 0 : r.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
|
25
|
+
}, this._handlePressStart = (s) => {
|
26
|
+
this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(s);
|
27
27
|
}, this._handlePressEnd = () => {
|
28
28
|
this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
|
29
|
-
}, this._renderNumberButton = (
|
29
|
+
}, this._renderNumberButton = (s) => h`
|
30
30
|
<button
|
31
31
|
?disabled=${this.disabled}
|
32
32
|
@click=${(r) => {
|
33
|
-
this._numberController.handleActionBtnClick(r,
|
33
|
+
this._numberController.handleActionBtnClick(r, s);
|
34
34
|
}}
|
35
35
|
@mousedown=${this._handlePressStart}
|
36
36
|
@mouseup=${this._handlePressEnd}
|
37
37
|
@mouseleave=${this._handlePressEnd}
|
38
|
-
aria-label="${
|
38
|
+
aria-label="${s === "inc" ? "Increment" : "Decrement"}"
|
39
39
|
class="number skf-icon-host"
|
40
40
|
type="button"
|
41
41
|
>
|
42
|
-
<skf-icon name="${
|
42
|
+
<skf-icon name="${s === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
|
43
43
|
</button>
|
44
44
|
`, this._renderPasswordButton = () => h`
|
45
45
|
<button
|
46
46
|
@click=${this._passwordController.toggleVisibility}
|
47
|
-
aria-label=${
|
47
|
+
aria-label=${n(this._passwordController._buttonAriaLabel)}
|
48
48
|
class="password skf-icon-host"
|
49
49
|
type="button"
|
50
50
|
@mousedown="${this._handlePressStart}"
|
@@ -59,7 +59,7 @@ const p = class p extends b {
|
|
59
59
|
@mousedown=${this._handlePressStart}
|
60
60
|
@mouseup=${this._handlePressEnd}
|
61
61
|
@mouseleave=${this._handlePressEnd}
|
62
|
-
aria-label=${
|
62
|
+
aria-label=${n(this.buttonAriaLabelClear)}
|
63
63
|
class="search skf-icon-host"
|
64
64
|
type="button"
|
65
65
|
>
|
@@ -69,8 +69,8 @@ const p = class p extends b {
|
|
69
69
|
this._buttonDown && this.$input.focus();
|
70
70
|
};
|
71
71
|
}
|
72
|
-
set customInvalid(
|
73
|
-
this.customError =
|
72
|
+
set customInvalid(s) {
|
73
|
+
this.customError = s || "";
|
74
74
|
}
|
75
75
|
get customInvalid() {
|
76
76
|
return this.customError;
|
@@ -78,12 +78,12 @@ const p = class p extends b {
|
|
78
78
|
firstUpdated() {
|
79
79
|
this.$input.addEventListener("change", () => {
|
80
80
|
this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input.value || ""), this.emitEvent("change"), this.validateInput();
|
81
|
-
}), this.addEventListener("invalid", (
|
82
|
-
this._pristine = !1, this.invalid = !0, this.customErrorDisplay &&
|
81
|
+
}), this.addEventListener("invalid", (s) => {
|
82
|
+
this._pristine = !1, this.invalid = !0, this.customErrorDisplay && s.preventDefault();
|
83
83
|
}), this.addEventListener("reset", this._resetValue), this.validateInput();
|
84
84
|
}
|
85
|
-
willUpdate(
|
86
|
-
if (
|
85
|
+
willUpdate(s) {
|
86
|
+
if (s.has("invalid"))
|
87
87
|
if (this.invalid) {
|
88
88
|
this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
|
89
89
|
const r = this._internals.validationMessage;
|
@@ -91,10 +91,10 @@ const p = class p extends b {
|
|
91
91
|
} else
|
92
92
|
this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
|
93
93
|
}
|
94
|
-
attributeChangedCallback(
|
95
|
-
if (super.attributeChangedCallback(
|
96
|
-
if (typeof
|
97
|
-
const l =
|
94
|
+
attributeChangedCallback(s, r, a) {
|
95
|
+
if (super.attributeChangedCallback(s, r, a), s === "value" && this._internals.setFormValue(a), s === "custom-invalid")
|
96
|
+
if (typeof a == "string") {
|
97
|
+
const l = this.withFallback(a);
|
98
98
|
this._pristine = !1, this._internals.setValidity({ customError: !0 }, l), this.invalid = !0, this.hint = l, this.checkValidity();
|
99
99
|
} else
|
100
100
|
this._internals.setValidity({}), this.validateInput();
|
@@ -107,60 +107,61 @@ const p = class p extends b {
|
|
107
107
|
this._internals.setValidity({ customError: this._internals.validity.customError });
|
108
108
|
else {
|
109
109
|
this.invalid = !this._pristine && !r.valid;
|
110
|
-
let
|
111
|
-
for (
|
112
|
-
const o = `data-${
|
113
|
-
if (r[
|
110
|
+
let a;
|
111
|
+
for (a in r) {
|
112
|
+
const o = `data-${a.toString()}`;
|
113
|
+
if (r[a] && !this.hasAttribute(o) && this.debug && console.log(
|
114
114
|
`Add custom message on ${this.localName} using attribute: ${o.toUpperCase()}="Your custom message"`
|
115
|
-
), r[
|
116
|
-
this.validationError =
|
115
|
+
), r[a]) {
|
116
|
+
this.validationError = a.toString();
|
117
117
|
const l = this.hasAttribute(o) ? this.getAttribute(o) : this.$input.validationMessage;
|
118
118
|
this._internals.setValidity(
|
119
119
|
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
120
|
-
l
|
120
|
+
this.withFallback(l)
|
121
121
|
), this.invalid && this.customErrorDisplay && this.checkValidity();
|
122
122
|
}
|
123
123
|
}
|
124
124
|
}
|
125
125
|
}
|
126
126
|
render() {
|
127
|
-
var
|
127
|
+
var r, a, o, l;
|
128
|
+
const s = (this._defaultSlot.length === 0 || !((a = (r = this._defaultSlot[0]) == null ? void 0 : r.textContent) != null && a.trim())) && !this.label;
|
128
129
|
return h`
|
129
130
|
<div id="root">
|
130
131
|
<label>
|
131
|
-
<div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
|
132
|
+
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${s} id="label">
|
132
133
|
<slot>${this.label}</slot>
|
133
134
|
${this.required ? y(this.requiredLabel) : null}
|
134
135
|
</div>
|
135
136
|
<div id="input">
|
136
137
|
${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : d}
|
137
138
|
<div
|
138
|
-
data-leading=${
|
139
|
-
data-trailing=${
|
139
|
+
data-leading=${n(this.leading)}
|
140
|
+
data-trailing=${n(this.trailing)}
|
140
141
|
id="affix"
|
141
142
|
>
|
142
143
|
<input
|
143
144
|
?disabled=${this.disabled}
|
144
145
|
?readonly=${this.readonly}
|
145
146
|
?required=${this.required}
|
146
|
-
.value=${
|
147
|
+
.value=${g(this.value)}
|
147
148
|
@blur=${this._onBlur}
|
148
149
|
@input=${this._handleInput}
|
149
|
-
|
150
|
-
aria-
|
150
|
+
autocomplete=${this.autocomplete}
|
151
|
+
aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : d)}
|
152
|
+
aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : d)}
|
151
153
|
aria-invalid=${!!this.invalid}
|
152
154
|
autocomplete="off"
|
153
155
|
data-testid="field-input"
|
154
|
-
inputmode=${
|
155
|
-
max=${
|
156
|
-
maxlength=${
|
157
|
-
min=${
|
158
|
-
minlength=${
|
159
|
-
name=${
|
160
|
-
pattern=${
|
161
|
-
placeholder=${
|
162
|
-
|
163
|
-
type=${a(
|
156
|
+
inputmode=${n(this.inputMode)}
|
157
|
+
max=${n(this.max)}
|
158
|
+
maxlength=${n(this.maxLength)}
|
159
|
+
min=${n(this.min)}
|
160
|
+
minlength=${n(this.minLength)}
|
161
|
+
name=${n(this.name)}
|
162
|
+
pattern=${n(this.pattern)}
|
163
|
+
placeholder=${n(this.placeholder)}
|
164
|
+
type=${n(
|
164
165
|
this.type === "password" ? this._passwordController._type : this.type
|
165
166
|
)}
|
166
167
|
/>
|
@@ -178,7 +179,7 @@ const p = class p extends b {
|
|
178
179
|
<skf-hint
|
179
180
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
180
181
|
id="hint"
|
181
|
-
severity=${
|
182
|
+
severity=${n(v(this.severity, this.invalid))}
|
182
183
|
>${this.customInvalid ? this.customInvalid : this.hint}
|
183
184
|
</skf-hint>
|
184
185
|
`}
|
@@ -186,85 +187,88 @@ const p = class p extends b {
|
|
186
187
|
`;
|
187
188
|
}
|
188
189
|
};
|
189
|
-
p.styles = [f,
|
190
|
+
p.styles = [f, A];
|
190
191
|
let t = p;
|
191
192
|
i([
|
192
|
-
|
193
|
+
e({ type: String })
|
194
|
+
], t.prototype, "autocomplete", 2);
|
195
|
+
i([
|
196
|
+
e({ attribute: "button-aria-label-clear" })
|
193
197
|
], t.prototype, "buttonAriaLabelClear", 2);
|
194
198
|
i([
|
195
|
-
|
199
|
+
e({ attribute: "button-aria-label-hide" })
|
196
200
|
], t.prototype, "buttonAriaLabelHide", 2);
|
197
201
|
i([
|
198
|
-
|
202
|
+
e({ attribute: "button-aria-label-show" })
|
199
203
|
], t.prototype, "buttonAriaLabelShow", 2);
|
200
204
|
i([
|
201
|
-
|
205
|
+
e({ attribute: "custom-invalid", reflect: !0 })
|
202
206
|
], t.prototype, "customInvalid", 1);
|
203
207
|
i([
|
204
|
-
|
208
|
+
e({ type: Boolean })
|
205
209
|
], t.prototype, "debug", 2);
|
206
210
|
i([
|
207
|
-
|
211
|
+
e({ type: Boolean, attribute: "hide-label" })
|
208
212
|
], t.prototype, "hideLabel", 2);
|
209
213
|
i([
|
210
|
-
|
214
|
+
e()
|
211
215
|
], t.prototype, "hint", 2);
|
212
216
|
i([
|
213
|
-
|
217
|
+
e({ type: String })
|
214
218
|
], t.prototype, "inputmode", 2);
|
215
219
|
i([
|
216
|
-
|
220
|
+
e()
|
217
221
|
], t.prototype, "label", 2);
|
218
222
|
i([
|
219
|
-
|
223
|
+
e()
|
220
224
|
], t.prototype, "leading", 2);
|
221
225
|
i([
|
222
|
-
|
226
|
+
e()
|
223
227
|
], t.prototype, "max", 2);
|
224
228
|
i([
|
225
|
-
|
229
|
+
e({ type: Number, attribute: "maxlength" })
|
226
230
|
], t.prototype, "maxLength", 2);
|
227
231
|
i([
|
228
|
-
|
232
|
+
e()
|
229
233
|
], t.prototype, "min", 2);
|
230
234
|
i([
|
231
|
-
|
235
|
+
e({ type: Number, attribute: "minlength" })
|
232
236
|
], t.prototype, "minLength", 2);
|
233
237
|
i([
|
234
|
-
|
238
|
+
e()
|
235
239
|
], t.prototype, "name", 2);
|
236
240
|
i([
|
237
|
-
|
241
|
+
e()
|
238
242
|
], t.prototype, "pattern", 2);
|
239
243
|
i([
|
240
|
-
|
244
|
+
e()
|
241
245
|
], t.prototype, "placeholder", 2);
|
242
246
|
i([
|
243
|
-
|
247
|
+
e({ type: Boolean })
|
244
248
|
], t.prototype, "readonly", 2);
|
245
249
|
i([
|
246
|
-
|
250
|
+
e({ attribute: "required-label" })
|
247
251
|
], t.prototype, "requiredLabel", 2);
|
248
252
|
i([
|
249
|
-
|
253
|
+
e({ reflect: !0 })
|
250
254
|
], t.prototype, "severity", 2);
|
251
255
|
i([
|
252
|
-
|
256
|
+
e({ type: Boolean, attribute: "show-valid" })
|
253
257
|
], t.prototype, "showValid", 2);
|
254
258
|
i([
|
255
|
-
|
259
|
+
e({ reflect: !0 })
|
256
260
|
], t.prototype, "size", 2);
|
257
261
|
i([
|
258
|
-
|
262
|
+
e()
|
259
263
|
], t.prototype, "trailing", 2);
|
260
264
|
i([
|
261
|
-
|
265
|
+
e()
|
262
266
|
], t.prototype, "type", 2);
|
263
267
|
i([
|
264
|
-
|
268
|
+
e({ type: String, attribute: "validate-on" })
|
265
269
|
], t.prototype, "validateOn", 2);
|
266
270
|
i([
|
267
|
-
|
271
|
+
e()
|
268
272
|
], t.prototype, "value", 2);
|
269
273
|
i([
|
270
274
|
c()
|
@@ -275,6 +279,9 @@ i([
|
|
275
279
|
i([
|
276
280
|
_("input")
|
277
281
|
], t.prototype, "$input", 2);
|
282
|
+
i([
|
283
|
+
$({ flatten: !0 })
|
284
|
+
], t.prototype, "_defaultSlot", 2);
|
278
285
|
export {
|
279
286
|
t as SkfInput
|
280
287
|
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { SkfElement } from '@internal/components/skf-element';
|
2
|
+
import { type CSSResultGroup } from 'lit';
|
3
|
+
/**
|
4
|
+
* The `<skf-progress>` element displays an indicator showing the completion progress of a task, typically displayed as a progress bar
|
5
|
+
*
|
6
|
+
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
7
|
+
*
|
8
|
+
* @tagname skf-progress
|
9
|
+
*/
|
10
|
+
export declare class SkfProgress extends SkfElement {
|
11
|
+
#private;
|
12
|
+
static styles: CSSResultGroup;
|
13
|
+
static formAssociated: boolean;
|
14
|
+
/** If true, the progress-bar's fill value is animated */
|
15
|
+
animated?: boolean;
|
16
|
+
/** Describes how much work the task indicated by the progress element requires */
|
17
|
+
max: number;
|
18
|
+
/** Specifies how much of the task that has been completed */
|
19
|
+
value: number;
|
20
|
+
constructor();
|
21
|
+
render(): import("lit").TemplateResult<1>;
|
22
|
+
}
|