@skf-design-system/ui-components 1.0.2-beta.6 → 1.0.2-beta.9
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 +18 -0
- package/dist/components/alert/alert.component.d.ts +3 -2
- package/dist/components/alert/alert.component.js +39 -33
- package/dist/components/button/button.styles.js +3 -3
- package/dist/components/checkbox/checkbox.component.d.ts +6 -5
- package/dist/components/checkbox/checkbox.component.js +77 -76
- package/dist/components/checkbox/checkbox.styles.js +1 -1
- package/dist/components/datepicker/datepicker-calendar.component.d.ts +4 -0
- package/dist/components/datepicker/datepicker-calendar.component.js +134 -127
- package/dist/components/datepicker/datepicker-popup.component.d.ts +4 -0
- package/dist/components/datepicker/datepicker-popup.component.js +100 -88
- package/dist/components/datepicker/datepicker.component.d.ts +4 -2
- package/dist/components/datepicker/datepicker.component.js +150 -140
- package/dist/components/dialog/dialog.component.d.ts +3 -2
- package/dist/components/dialog/dialog.component.js +39 -37
- package/dist/components/divider/divider.component.js +13 -13
- package/dist/components/divider/divider.styles.js +2 -2
- package/dist/components/drawer/drawer.component.d.ts +3 -2
- package/dist/components/drawer/drawer.component.js +37 -35
- package/dist/components/drawer/drawer.styles.js +1 -1
- package/dist/components/header/header.component.d.ts +4 -2
- package/dist/components/header/header.component.js +66 -57
- package/dist/components/header/header.styles.js +2 -2
- package/dist/components/icon/icon.component.js +26 -16
- package/dist/components/icon/icon.styles.js +4 -4
- package/dist/components/input/input.component.d.ts +4 -8
- package/dist/components/input/input.component.js +146 -147
- package/dist/components/input/input.controllers.d.ts +0 -1
- package/dist/components/input/input.controllers.js +12 -12
- package/dist/components/link/link.component.js +19 -12
- package/dist/components/link/link.styles.js +11 -3
- package/dist/components/loader/loader.component.d.ts +0 -2
- package/dist/components/loader/loader.component.js +27 -30
- package/dist/components/loader/loader.styles.js +1 -1
- package/dist/components/menu/menu-item.styles.js +8 -7
- package/dist/components/menu/menu.component.d.ts +4 -1
- package/dist/components/nav/nav.component.d.ts +3 -0
- package/dist/components/nav/nav.component.js +38 -33
- package/dist/components/popover/popover.component.d.ts +6 -3
- package/dist/components/progress/progress.styles.js +3 -3
- package/dist/components/radio/radio.component.d.ts +4 -2
- package/dist/components/radio/radio.component.js +91 -83
- 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.styles.js +1 -1
- package/dist/components/select/select-option.component.d.ts +2 -2
- package/dist/components/select/select-option.component.js +16 -19
- package/dist/components/select/select.component.d.ts +13 -9
- package/dist/components/select/select.component.js +169 -144
- package/dist/components/stepper/stepper-item.styles.js +4 -4
- package/dist/components/switch/switch.component.d.ts +4 -2
- package/dist/components/switch/switch.component.js +64 -56
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/tabs/tab.styles.js +2 -2
- package/dist/components/tag/tag.component.d.ts +3 -0
- package/dist/components/tag/tag.component.js +50 -41
- package/dist/components/textarea/textarea.component.d.ts +4 -2
- package/dist/components/textarea/textarea.component.js +126 -118
- package/dist/components/tooltip/tooltip.component.d.ts +8 -2
- package/dist/components/tooltip/tooltip.component.js +3 -0
- package/dist/custom-elements.json +734 -372
- package/dist/internal/base-classes/popover/popover.base.d.ts +21 -2
- package/dist/internal/base-classes/popover/popover.base.js +10 -12
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -19
- package/dist/internal/controllers/popover.controller.d.ts +2 -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/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +4 -4
- package/dist/styles/global-alt.css +1 -1
- 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 +1823 -846
- package/dist/types/vue/index.d.ts +59 -47
- package/dist/utilities/localize.d.ts +28 -0
- package/dist/utilities/localize.js +13 -0
- package/dist/vscode.html-custom-data.json +75 -80
- package/dist/web-types.json +205 -169
- package/package.json +27 -34
- package/custom-elements.json +0 -25490
@@ -8,51 +8,61 @@ import { stateMap as b } from "../../internal/helpers/stateMap.js";
|
|
8
8
|
import { watch as _ } from "../../internal/helpers/watch.js";
|
9
9
|
import { ICONS as S } from "@skf-design-system/ui-assets";
|
10
10
|
import { componentStyles as C } from "../../styles/component.styles.js";
|
11
|
-
import { html as
|
11
|
+
import { html as z } from "lit";
|
12
12
|
import { property as n } from "lit/decorators.js";
|
13
|
-
import { styles as
|
14
|
-
var
|
13
|
+
import { styles as O } from "./icon.styles.js";
|
14
|
+
var w = Object.defineProperty, P = Object.getOwnPropertyDescriptor, l = (t, e, r, o) => {
|
15
15
|
for (var s = o > 1 ? void 0 : o ? P(e, r) : e, m = t.length - 1, h; m >= 0; m--)
|
16
16
|
(h = t[m]) && (s = (o ? h(e, r, s) : h(s)) || s);
|
17
|
-
return o && s &&
|
17
|
+
return o && s && w(e, r, s), s;
|
18
18
|
};
|
19
19
|
const x = {
|
20
|
-
color: [
|
20
|
+
color: [
|
21
|
+
"emphasized",
|
22
|
+
"error",
|
23
|
+
"info",
|
24
|
+
"inverse",
|
25
|
+
"primary",
|
26
|
+
"purple",
|
27
|
+
"secondary",
|
28
|
+
"success",
|
29
|
+
"warning"
|
30
|
+
],
|
21
31
|
size: ["lg", "md", "sm", "xs"]
|
22
32
|
};
|
23
|
-
var a,
|
33
|
+
var a, p;
|
24
34
|
const f = class f extends v {
|
25
35
|
constructor() {
|
26
36
|
super(...arguments);
|
27
37
|
y(this, a);
|
28
|
-
y(this,
|
29
|
-
d(this, a, this.attachInternals()), d(this,
|
38
|
+
y(this, p);
|
39
|
+
d(this, a, this.attachInternals()), d(this, p, c(this, a).states), this.color = "primary", this.size = "md";
|
30
40
|
}
|
31
41
|
connectedCallback() {
|
32
42
|
super.connectedCallback(), this.ariaHidden = this.label ? null : "true", this.ariaLabel = this.label ?? null, this.role = this.label ? "img" : null;
|
33
43
|
}
|
34
44
|
_handleStateChange(r, o, s) {
|
35
|
-
b(c(this,
|
45
|
+
b(c(this, p), x[r]).set(s);
|
36
46
|
}
|
37
47
|
render() {
|
38
|
-
return
|
48
|
+
return z`<div id="root">${S[this.name]}</div>`;
|
39
49
|
}
|
40
50
|
};
|
41
|
-
a = new WeakMap(),
|
51
|
+
a = new WeakMap(), p = new WeakMap(), f.styles = [C, O];
|
42
52
|
let i = f;
|
43
|
-
|
53
|
+
l([
|
44
54
|
n({ type: String })
|
45
55
|
], i.prototype, "color", 2);
|
46
|
-
|
56
|
+
l([
|
47
57
|
n({ type: String })
|
48
58
|
], i.prototype, "label", 2);
|
49
|
-
|
59
|
+
l([
|
50
60
|
n({ type: String })
|
51
61
|
], i.prototype, "name", 2);
|
52
|
-
|
62
|
+
l([
|
53
63
|
n({ type: String })
|
54
64
|
], i.prototype, "size", 2);
|
55
|
-
|
65
|
+
l([
|
56
66
|
_(["color", "size"])
|
57
67
|
], i.prototype, "_handleStateChange", 1);
|
58
68
|
export {
|
@@ -38,12 +38,12 @@ const r = o`
|
|
38
38
|
--_skf-icon-color: var(--skf-icon-color-inverse);
|
39
39
|
}
|
40
40
|
|
41
|
-
:host(:state(
|
42
|
-
--_skf-icon-color: var(--skf-icon-color-
|
41
|
+
:host(:state(emphasized)) #root {
|
42
|
+
--_skf-icon-color: var(--skf-icon-color-emphasized);
|
43
43
|
}
|
44
44
|
|
45
|
-
:host(:state(
|
46
|
-
--_skf-icon-color: var(--skf-
|
45
|
+
:host(:state(purple)) #root {
|
46
|
+
--_skf-icon-color: var(--skf-icon-color-purple);
|
47
47
|
}
|
48
48
|
|
49
49
|
:host(:state(error)) #root {
|
@@ -3,6 +3,7 @@ import { FormBase } from '../../internal/components/formBase.js';
|
|
3
3
|
import '../../internal/components/hint/hint';
|
4
4
|
import type { FormFieldSeverity } from '../../internal/types.js';
|
5
5
|
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
6
|
+
import { type Language } from '../../utilities/localize.js';
|
6
7
|
import { type CSSResultGroup } from 'lit';
|
7
8
|
/**
|
8
9
|
* The skf-text-field is used to create a text input field. It can be used inside a form element or standalone
|
@@ -23,6 +24,7 @@ import { type CSSResultGroup } from 'lit';
|
|
23
24
|
* behaviour: validate-on-input, validate-on-submit and native-validation
|
24
25
|
*/
|
25
26
|
export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
27
|
+
#private;
|
26
28
|
static styles: CSSResultGroup;
|
27
29
|
private customError;
|
28
30
|
/** @internal intermediary value for reset to function, e.g value attribute act as default value */
|
@@ -32,12 +34,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
32
34
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/autocomplete) for details.
|
33
35
|
*/
|
34
36
|
autocomplete?: HTMLInputElement['autocomplete'];
|
35
|
-
/** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
|
36
|
-
buttonAriaLabelClear: string;
|
37
|
-
/** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
|
38
|
-
buttonAriaLabelHide: string;
|
39
|
-
/** Custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
|
40
|
-
buttonAriaLabelShow: string;
|
41
37
|
/** If defined, forces component to invalid state until removed. Its value is used as hint text. */
|
42
38
|
set customInvalid(value: string | undefined);
|
43
39
|
get customInvalid(): string | undefined;
|
@@ -54,6 +50,8 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
54
50
|
inputmode: HTMLInputElement['inputMode'];
|
55
51
|
/** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
|
56
52
|
label?: string;
|
53
|
+
/** Sets the internal language of the component */
|
54
|
+
lang: Language;
|
57
55
|
/** If defined, displays a prefix/adornment before the input-element */
|
58
56
|
leading?: string;
|
59
57
|
/** If defined, sets the maximum value to accept for this input */
|
@@ -72,8 +70,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
72
70
|
placeholder?: string;
|
73
71
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
74
72
|
readonly: boolean;
|
75
|
-
/** If defined, renders an alternative A11y text for the asterisk */
|
76
|
-
requiredLabel?: string;
|
77
73
|
/** If defined, displays provided severity state */
|
78
74
|
severity?: FormFieldSeverity;
|
79
75
|
/** If true, displays valid state after interaction */
|
@@ -1,38 +1,46 @@
|
|
1
|
+
var f = (n) => {
|
2
|
+
throw TypeError(n);
|
3
|
+
};
|
4
|
+
var b = (n, o, t) => o.has(n) || f("Cannot " + t);
|
5
|
+
var c = (n, o, t) => (b(n, o, "read from private field"), t ? t.call(n) : o.get(n)), _ = (n, o, t) => o.has(n) ? f("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(n) : o.set(n, t), $ = (n, o, t, e) => (b(n, o, "write to private field"), e ? e.call(n, t) : o.set(n, t), t);
|
1
6
|
import "../icon/icon.js";
|
2
|
-
import { FormBase as
|
7
|
+
import { FormBase as g } from "../../internal/components/formBase.js";
|
3
8
|
import "../../internal/components/hint/hint.js";
|
4
|
-
import { hintSeverity as
|
5
|
-
import { watch as
|
6
|
-
import { Asterisk as
|
7
|
-
import { componentStyles as
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import A from "./input.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
import { hintSeverity as w } from "../../internal/helpers/hintSeverity.js";
|
10
|
+
import { watch as E } from "../../internal/helpers/watch.js";
|
11
|
+
import { Asterisk as P } from "../../internal/templates/asterisk.js";
|
12
|
+
import { componentStyles as C } from "../../styles/component.styles.js";
|
13
|
+
import { LocalizeController as k } from "../../utilities/localize.js";
|
14
|
+
import { html as p, nothing as m } from "lit";
|
15
|
+
import { state as v, property as a, query as S, queryAssignedNodes as x } from "lit/decorators.js";
|
16
|
+
import { ifDefined as l } from "lit/directives/if-defined.js";
|
17
|
+
import { live as B } from "lit/directives/live.js";
|
18
|
+
import { InputNumberController as A, InputPasswordController as V } from "./input.controllers.js";
|
19
|
+
import I from "./input.styles.js";
|
20
|
+
var L = Object.defineProperty, D = Object.getOwnPropertyDescriptor, s = (n, o, t, e) => {
|
21
|
+
for (var r = e > 1 ? void 0 : e ? D(o, t) : o, h = n.length - 1, d; h >= 0; h--)
|
22
|
+
(d = n[h]) && (r = (e ? d(o, t, r) : d(r)) || r);
|
23
|
+
return e && r && L(o, t, r), r;
|
24
|
+
}, u;
|
25
|
+
const y = class y extends g {
|
20
26
|
constructor() {
|
21
|
-
super(...arguments)
|
27
|
+
super(...arguments);
|
28
|
+
_(this, u);
|
29
|
+
$(this, u, new k(this)), this._value = "", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.invalid = !1, this._buttonDown = !1, this._numberController = new A(this), this._passwordController = new V(this), this._handleInput = () => {
|
22
30
|
var t;
|
23
31
|
this._value = ((t = this.$input) == null ? void 0 : t.value) ?? "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
24
32
|
}, this._resetValue = (t) => {
|
25
|
-
var
|
26
|
-
t.stopPropagation(), this.value = ((
|
33
|
+
var e, r;
|
34
|
+
t.stopPropagation(), this.value = ((e = this.getAttribute("value")) == null ? void 0 : e.trim()) ?? "", this._value = this.value, this._internals.setFormValue(this.value), (r = this.$input) == null || r.focus();
|
27
35
|
}, this._handlePressStart = (t) => {
|
28
36
|
this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(t);
|
29
37
|
}, this._handlePressEnd = () => {
|
30
38
|
this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
|
31
|
-
}, this._renderNumberButton = (t) =>
|
39
|
+
}, this._renderNumberButton = (t) => p`
|
32
40
|
<button
|
33
41
|
?disabled=${this.disabled}
|
34
|
-
@click=${(
|
35
|
-
this._numberController.handleActionBtnClick(
|
42
|
+
@click=${(e) => {
|
43
|
+
this._numberController.handleActionBtnClick(e, t);
|
36
44
|
}}
|
37
45
|
@mousedown=${this._handlePressStart}
|
38
46
|
@mouseup=${this._handlePressEnd}
|
@@ -43,10 +51,10 @@ const m = class m extends c {
|
|
43
51
|
>
|
44
52
|
<skf-icon name="${t === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
|
45
53
|
</button>
|
46
|
-
`, this._renderPasswordButton = () =>
|
54
|
+
`, this._renderPasswordButton = () => p`
|
47
55
|
<button
|
48
56
|
@click=${this._passwordController.toggleVisibility}
|
49
|
-
aria-label=${
|
57
|
+
aria-label=${this._passwordController._type === "password" ? c(this, u).term("showPassword") : c(this, u).term("hidePassword")}
|
50
58
|
class="password skf-icon-host"
|
51
59
|
type="button"
|
52
60
|
@mousedown="${this._handlePressStart}"
|
@@ -55,13 +63,13 @@ const m = class m extends c {
|
|
55
63
|
>
|
56
64
|
<skf-icon name=${this._passwordController._icon} size="sm"></skf-icon>
|
57
65
|
</button>
|
58
|
-
`, this._renderSearchButton = () =>
|
66
|
+
`, this._renderSearchButton = () => p`
|
59
67
|
<button
|
60
68
|
@click=${this._resetValue}
|
61
69
|
@mousedown=${this._handlePressStart}
|
62
70
|
@mouseup=${this._handlePressEnd}
|
63
71
|
@mouseleave=${this._handlePressEnd}
|
64
|
-
aria-label=${
|
72
|
+
aria-label=${c(this, u).term("clearEntry")}
|
65
73
|
class="search skf-icon-host"
|
66
74
|
type="button"
|
67
75
|
>
|
@@ -88,71 +96,71 @@ const m = class m extends c {
|
|
88
96
|
firstUpdated() {
|
89
97
|
var t;
|
90
98
|
(t = this.$input) == null || t.addEventListener("change", () => {
|
91
|
-
var
|
92
|
-
this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(((
|
93
|
-
}), this.addEventListener("invalid", (
|
94
|
-
this._pristine = !1, this.invalid = !0, this.customErrorDisplay &&
|
99
|
+
var e;
|
100
|
+
this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(((e = this.$input) == null ? void 0 : e.value) ?? ""), this.emitEvent("change"), this.validateInput();
|
101
|
+
}), this.addEventListener("invalid", (e) => {
|
102
|
+
this._pristine = !1, this.invalid = !0, this.customErrorDisplay && e.preventDefault();
|
95
103
|
}), this.addEventListener("reset", this._resetValue), this.validateInput();
|
96
104
|
}
|
97
105
|
willUpdate(t) {
|
98
106
|
if (t.has("invalid"))
|
99
107
|
if (this.invalid) {
|
100
108
|
this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
|
101
|
-
const
|
102
|
-
this.hint =
|
109
|
+
const e = this._internals.validationMessage;
|
110
|
+
this.hint = e !== "" ? this._internals.validationMessage : "", this.checkValidity();
|
103
111
|
} else
|
104
112
|
this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
|
105
113
|
}
|
106
114
|
valueChanged() {
|
107
115
|
this._internals.setFormValue(this.value), this.validateInput();
|
108
116
|
}
|
109
|
-
attributeChangedCallback(t,
|
110
|
-
if (super.attributeChangedCallback(t,
|
111
|
-
if (typeof
|
112
|
-
const
|
113
|
-
this._pristine = !1, this._internals.setValidity({ customError: !0 },
|
117
|
+
attributeChangedCallback(t, e, r) {
|
118
|
+
if (super.attributeChangedCallback(t, e, r), t === "value" && this._internals.setFormValue(r), t === "custom-invalid")
|
119
|
+
if (typeof r == "string") {
|
120
|
+
const d = this.withFallback(r);
|
121
|
+
this._pristine = !1, this._internals.setValidity({ customError: !0 }, d), this.invalid = !0, this.hint = d, this.checkValidity();
|
114
122
|
} else
|
115
123
|
this._internals.setValidity({}), this.validateInput();
|
116
124
|
}
|
117
125
|
/** @internal */
|
118
126
|
validateInput() {
|
119
127
|
if (this._internals.validity.customError || !this.$input) return;
|
120
|
-
const
|
121
|
-
if (this.invalid = !1,
|
128
|
+
const e = this.$input.validity;
|
129
|
+
if (this.invalid = !1, e.valid)
|
122
130
|
this._internals.setValidity({ customError: this._internals.validity.customError });
|
123
131
|
else {
|
124
|
-
this.invalid = !this._pristine && !
|
125
|
-
let
|
126
|
-
for (
|
127
|
-
const
|
128
|
-
if (r
|
129
|
-
`Add custom message on ${this.localName} using attribute: ${
|
130
|
-
), r
|
131
|
-
this.validationError =
|
132
|
-
const
|
132
|
+
this.invalid = !this._pristine && !e.valid;
|
133
|
+
let r;
|
134
|
+
for (r in e) {
|
135
|
+
const h = `data-${r.toString()}`;
|
136
|
+
if (e[r] && !this.hasAttribute(h) && this.debug && console.log(
|
137
|
+
`Add custom message on ${this.localName} using attribute: ${h.toUpperCase()}="Your custom message"`
|
138
|
+
), e[r]) {
|
139
|
+
this.validationError = r.toString();
|
140
|
+
const d = this.hasAttribute(h) ? this.getAttribute(h) : this.$input.validationMessage;
|
133
141
|
this._internals.setValidity(
|
134
142
|
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
135
|
-
this.withFallback(
|
143
|
+
this.withFallback(d)
|
136
144
|
), this.invalid && this.customErrorDisplay && this.checkValidity();
|
137
145
|
}
|
138
146
|
}
|
139
147
|
}
|
140
148
|
}
|
141
149
|
render() {
|
142
|
-
var
|
143
|
-
const t = (this._defaultSlot.length === 0 || !((
|
144
|
-
return
|
150
|
+
var e, r, h, d;
|
151
|
+
const t = (this._defaultSlot.length === 0 || !((r = (e = this._defaultSlot[0]) == null ? void 0 : e.textContent) != null && r.trim())) && !this.label;
|
152
|
+
return p`
|
145
153
|
<div id="root">
|
146
154
|
<label>
|
147
155
|
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${t} id="label">
|
148
156
|
<slot>${this.label}</slot>
|
149
|
-
${this.required ?
|
157
|
+
${this.required ? P(c(this, u).term("required")) : m}
|
150
158
|
</div>
|
151
159
|
<div id="input">
|
152
|
-
${this.type === "search" ?
|
160
|
+
${this.type === "search" ? p`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : m}
|
153
161
|
<div
|
154
|
-
data-leading=${
|
155
|
-
data-trailing=${
|
162
|
+
data-leading=${l(this.leading)}
|
163
|
+
data-trailing=${l(this.trailing)}
|
156
164
|
id="affix"
|
157
165
|
>
|
158
166
|
<input
|
@@ -160,41 +168,41 @@ const m = class m extends c {
|
|
160
168
|
?readonly=${this.readonly}
|
161
169
|
?required=${this.required}
|
162
170
|
.autocomplete=${this.autocomplete ?? "off"}
|
163
|
-
.value=${
|
171
|
+
.value=${B(this.value)}
|
164
172
|
@blur=${this._onBlur}
|
165
173
|
@input=${this._handleInput}
|
166
|
-
aria-describedby=${
|
167
|
-
aria-errormessage=${
|
174
|
+
aria-describedby=${l((h = this.hint) != null && h.trim() ? "hint" : m)}
|
175
|
+
aria-errormessage=${l((d = this.hint) != null && d.trim() ? "hint" : m)}
|
168
176
|
aria-invalid=${!!this.invalid}
|
169
177
|
data-testid="field-input"
|
170
|
-
inputmode=${
|
171
|
-
max=${
|
172
|
-
maxlength=${
|
173
|
-
min=${
|
174
|
-
minlength=${
|
175
|
-
name=${
|
176
|
-
pattern=${
|
177
|
-
placeholder=${
|
178
|
-
type=${
|
178
|
+
inputmode=${l(this.inputMode)}
|
179
|
+
max=${l(this.max)}
|
180
|
+
maxlength=${l(this.maxLength)}
|
181
|
+
min=${l(this.min)}
|
182
|
+
minlength=${l(this.minLength)}
|
183
|
+
name=${l(this.name)}
|
184
|
+
pattern=${l(this.pattern)}
|
185
|
+
placeholder=${l(this.placeholder)}
|
186
|
+
type=${l(
|
179
187
|
this.type === "password" ? this._passwordController._type : this.type
|
180
188
|
)}
|
181
189
|
/>
|
182
190
|
</div>
|
183
|
-
${this.type === "number" ?
|
191
|
+
${this.type === "number" ? p`
|
184
192
|
<div id="action">
|
185
193
|
${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
|
186
194
|
</div>
|
187
|
-
` :
|
188
|
-
${this.type === "password" ? this._renderPasswordButton() :
|
189
|
-
${this.type === "search" && this._value.length > 0 ? this._renderSearchButton() :
|
195
|
+
` : m}
|
196
|
+
${this.type === "password" ? this._renderPasswordButton() : m}
|
197
|
+
${this.type === "search" && this._value.length > 0 ? this._renderSearchButton() : m}
|
190
198
|
</div>
|
191
199
|
</label>
|
192
|
-
${this.hint &&
|
200
|
+
${this.hint && p`
|
193
201
|
<skf-hint
|
194
202
|
?disabled=${this.disabled}
|
195
203
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
196
204
|
id="hint"
|
197
|
-
severity=${
|
205
|
+
severity=${l(w(this.invalid, this.severity))}
|
198
206
|
>${this.customInvalid ?? this.hint}
|
199
207
|
</skf-hint>
|
200
208
|
`}
|
@@ -202,106 +210,97 @@ const m = class m extends c {
|
|
202
210
|
`;
|
203
211
|
}
|
204
212
|
};
|
205
|
-
|
206
|
-
let i =
|
207
|
-
|
208
|
-
|
213
|
+
u = new WeakMap(), y.styles = [C, I];
|
214
|
+
let i = y;
|
215
|
+
s([
|
216
|
+
v()
|
209
217
|
], i.prototype, "_value", 2);
|
210
|
-
|
211
|
-
|
218
|
+
s([
|
219
|
+
a()
|
212
220
|
], i.prototype, "autocomplete", 2);
|
213
|
-
|
214
|
-
|
215
|
-
], i.prototype, "buttonAriaLabelClear", 2);
|
216
|
-
e([
|
217
|
-
s({ attribute: "button-aria-label-hide" })
|
218
|
-
], i.prototype, "buttonAriaLabelHide", 2);
|
219
|
-
e([
|
220
|
-
s({ attribute: "button-aria-label-show" })
|
221
|
-
], i.prototype, "buttonAriaLabelShow", 2);
|
222
|
-
e([
|
223
|
-
s({ attribute: "custom-invalid", reflect: !0 })
|
221
|
+
s([
|
222
|
+
a({ attribute: "custom-invalid", reflect: !0 })
|
224
223
|
], i.prototype, "customInvalid", 1);
|
225
|
-
|
226
|
-
|
224
|
+
s([
|
225
|
+
a({ type: Boolean })
|
227
226
|
], i.prototype, "debug", 2);
|
228
|
-
|
229
|
-
|
227
|
+
s([
|
228
|
+
a({ type: Boolean, attribute: "hide-label" })
|
230
229
|
], i.prototype, "hideLabel", 2);
|
231
|
-
|
232
|
-
|
230
|
+
s([
|
231
|
+
a()
|
233
232
|
], i.prototype, "hint", 2);
|
234
|
-
|
235
|
-
|
233
|
+
s([
|
234
|
+
a()
|
236
235
|
], i.prototype, "inputmode", 2);
|
237
|
-
|
238
|
-
|
236
|
+
s([
|
237
|
+
a()
|
239
238
|
], i.prototype, "label", 2);
|
240
|
-
|
241
|
-
|
239
|
+
s([
|
240
|
+
a({ type: String })
|
241
|
+
], i.prototype, "lang", 2);
|
242
|
+
s([
|
243
|
+
a()
|
242
244
|
], i.prototype, "leading", 2);
|
243
|
-
|
244
|
-
|
245
|
+
s([
|
246
|
+
a()
|
245
247
|
], i.prototype, "max", 2);
|
246
|
-
|
247
|
-
|
248
|
+
s([
|
249
|
+
a({ type: Number, attribute: "maxlength" })
|
248
250
|
], i.prototype, "maxLength", 2);
|
249
|
-
|
250
|
-
|
251
|
+
s([
|
252
|
+
a()
|
251
253
|
], i.prototype, "min", 2);
|
252
|
-
|
253
|
-
|
254
|
+
s([
|
255
|
+
a({ type: Number, attribute: "minlength" })
|
254
256
|
], i.prototype, "minLength", 2);
|
255
|
-
|
256
|
-
|
257
|
+
s([
|
258
|
+
a({ reflect: !0 })
|
257
259
|
], i.prototype, "name", 2);
|
258
|
-
|
259
|
-
|
260
|
+
s([
|
261
|
+
a()
|
260
262
|
], i.prototype, "pattern", 2);
|
261
|
-
|
262
|
-
|
263
|
+
s([
|
264
|
+
a()
|
263
265
|
], i.prototype, "placeholder", 2);
|
264
|
-
|
265
|
-
|
266
|
+
s([
|
267
|
+
a({ type: Boolean })
|
266
268
|
], i.prototype, "readonly", 2);
|
267
|
-
|
268
|
-
|
269
|
-
], i.prototype, "requiredLabel", 2);
|
270
|
-
e([
|
271
|
-
s({ reflect: !0 })
|
269
|
+
s([
|
270
|
+
a({ reflect: !0 })
|
272
271
|
], i.prototype, "severity", 2);
|
273
|
-
|
274
|
-
|
272
|
+
s([
|
273
|
+
a({ type: Boolean, attribute: "show-valid" })
|
275
274
|
], i.prototype, "showValid", 2);
|
276
|
-
|
277
|
-
|
275
|
+
s([
|
276
|
+
a({ reflect: !0 })
|
278
277
|
], i.prototype, "size", 2);
|
279
|
-
|
280
|
-
|
278
|
+
s([
|
279
|
+
a()
|
281
280
|
], i.prototype, "trailing", 2);
|
282
|
-
|
283
|
-
|
281
|
+
s([
|
282
|
+
a()
|
284
283
|
], i.prototype, "type", 2);
|
285
|
-
|
286
|
-
|
284
|
+
s([
|
285
|
+
a({ attribute: "validate-on" })
|
287
286
|
], i.prototype, "validateOn", 2);
|
288
|
-
|
289
|
-
|
287
|
+
s([
|
288
|
+
a({})
|
290
289
|
], i.prototype, "value", 1);
|
291
|
-
|
292
|
-
|
290
|
+
s([
|
291
|
+
v()
|
293
292
|
], i.prototype, "invalid", 2);
|
294
|
-
|
295
|
-
|
293
|
+
s([
|
294
|
+
v()
|
296
295
|
], i.prototype, "_buttonDown", 2);
|
297
|
-
|
298
|
-
|
296
|
+
s([
|
297
|
+
S("input")
|
299
298
|
], i.prototype, "$input", 2);
|
300
|
-
|
301
|
-
|
299
|
+
s([
|
300
|
+
x({ flatten: !0 })
|
302
301
|
], i.prototype, "_defaultSlot", 2);
|
303
|
-
|
304
|
-
|
302
|
+
s([
|
303
|
+
E("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
305
304
|
], i.prototype, "valueChanged", 1);
|
306
305
|
export {
|
307
306
|
i as SkfInput
|
@@ -38,7 +38,6 @@ export declare class InputPasswordController implements ReactiveController {
|
|
38
38
|
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
39
39
|
_inputElement?: HTMLInputElement;
|
40
40
|
_icon: Extract<Icon, 'visibility' | 'visibilityOff'>;
|
41
|
-
_buttonAriaLabel: string;
|
42
41
|
_type: Extract<SkfInput['type'], 'password' | 'text'>;
|
43
42
|
constructor(host: ReactiveControllerHost);
|
44
43
|
hostUpdated(): void;
|
@@ -1,14 +1,14 @@
|
|
1
|
-
class
|
1
|
+
class o {
|
2
2
|
constructor(t) {
|
3
|
-
this.handleActionBtnClick = (
|
3
|
+
this.handleActionBtnClick = (s, i) => {
|
4
4
|
var h, n;
|
5
5
|
const e = this._inputElement;
|
6
|
-
!e || !this.host || (
|
7
|
-
}, this.handleActionBtnLongPressStart = (
|
8
|
-
const
|
6
|
+
!e || !this.host || (i === "inc" ? e.stepUp() : e.stepDown(), this.host.value = ((h = this._inputElement) == null ? void 0 : h.value) ?? "", (n = this.host._internals) == null || n.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
|
7
|
+
}, this.handleActionBtnLongPressStart = (s) => {
|
8
|
+
const i = s.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
|
9
9
|
this._longPressId = setTimeout(() => {
|
10
10
|
this._repeaterId = setInterval(() => {
|
11
|
-
this.handleActionBtnClick(
|
11
|
+
this.handleActionBtnClick(s, i);
|
12
12
|
}, 50);
|
13
13
|
}, 400);
|
14
14
|
}, this.handleActionBtnLongPressEnd = () => {
|
@@ -23,12 +23,12 @@ class l {
|
|
23
23
|
class a {
|
24
24
|
constructor(t) {
|
25
25
|
this._icon = "visibility", this._type = "password", this.handleFieldLoaded = () => {
|
26
|
-
var
|
27
|
-
!this._inputElement || !((
|
26
|
+
var s;
|
27
|
+
!this._inputElement || !((s = this.host) != null && s._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
|
28
28
|
}, this.toggleVisibility = () => {
|
29
|
-
var
|
30
|
-
!this._inputElement || !((
|
31
|
-
}, (this.host = t).addController(this)
|
29
|
+
var s;
|
30
|
+
!this._inputElement || !((s = this.host) != null && s._handleInput) || (this.host._handleInput(), this._type === "text" ? (this._icon = "visibility", this._type = "password") : (this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
|
31
|
+
}, (this.host = t).addController(this);
|
32
32
|
}
|
33
33
|
hostUpdated() {
|
34
34
|
var t;
|
@@ -36,6 +36,6 @@ class a {
|
|
36
36
|
}
|
37
37
|
}
|
38
38
|
export {
|
39
|
-
|
39
|
+
o as InputNumberController,
|
40
40
|
a as InputPasswordController
|
41
41
|
};
|