@skf-design-system/ui-components 1.0.2-beta.5 → 1.0.2-beta.7
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/accordion/accordion.component.d.ts +1 -1
- package/dist/components/accordion/accordion.component.js +2 -2
- 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 +4 -2
- package/dist/components/checkbox/checkbox.component.js +73 -65
- 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 +151 -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.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 +11 -4
- package/dist/components/drawer/drawer.component.js +77 -55
- 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 +66 -57
- package/dist/components/header/header.styles.js +2 -2
- package/dist/components/icon/icon.component.js +7 -7
- package/dist/components/icon/icon.styles.js +2 -2
- package/dist/components/input/input.component.d.ts +4 -8
- package/dist/components/input/input.component.js +147 -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.d.ts +15 -18
- package/dist/components/link/link.component.js +105 -107
- package/dist/components/link/link.styles.js +53 -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/menu/menu-item.component.d.ts +1 -1
- package/dist/components/menu/menu-item.component.js +8 -8
- 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/nav/nav-item.component.d.ts +4 -0
- 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.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/progress/progress.component.d.ts +2 -0
- package/dist/components/progress/progress.component.js +38 -29
- package/dist/components/progress/progress.styles.js +4 -4
- 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-group.component.d.ts +4 -0
- package/dist/components/select/select-option-group.component.js +37 -18
- package/dist/components/select/select-option-group.style.js +12 -6
- package/dist/components/select/select-option.component.d.ts +7 -2
- package/dist/components/select/select-option.component.js +70 -53
- package/dist/components/select/select-option.styles.js +43 -31
- package/dist/components/select/select.component.d.ts +18 -10
- package/dist/components/select/select.component.js +175 -132
- package/dist/components/select/select.controllers.js +2 -1
- 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 +26 -23
- 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-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +19 -16
- package/dist/components/tabs/tab.component.d.ts +1 -1
- package/dist/components/tabs/tab.component.js +17 -14
- 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 +127 -118
- 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 +18 -18
- package/dist/components/tooltip/tooltip.component.d.ts +9 -2
- package/dist/components/tooltip/tooltip.component.js +13 -7
- package/dist/custom-elements.json +1305 -946
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -20
- package/dist/internal/base-classes/popover/popover.base.d.ts +24 -5
- package/dist/internal/base-classes/popover/popover.base.js +28 -29
- package/dist/internal/base-classes/popover/popover.styles.js +4 -5
- 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/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/internal/types.d.ts +4 -0
- 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 +243 -128
- package/dist/types/vue/index.d.ts +136 -127
- package/dist/utilities/localize.d.ts +28 -0
- package/dist/utilities/localize.js +13 -0
- package/dist/vscode.html-custom-data.json +168 -177
- package/dist/web-types.json +411 -381
- package/package.json +34 -41
@@ -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,40 +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
|
202
|
+
?disabled=${this.disabled}
|
194
203
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
195
204
|
id="hint"
|
196
|
-
severity=${
|
205
|
+
severity=${l(w(this.invalid, this.severity))}
|
197
206
|
>${this.customInvalid ?? this.hint}
|
198
207
|
</skf-hint>
|
199
208
|
`}
|
@@ -201,106 +210,97 @@ const m = class m extends c {
|
|
201
210
|
`;
|
202
211
|
}
|
203
212
|
};
|
204
|
-
|
205
|
-
let i =
|
206
|
-
|
207
|
-
|
213
|
+
u = new WeakMap(), y.styles = [C, I];
|
214
|
+
let i = y;
|
215
|
+
s([
|
216
|
+
v()
|
208
217
|
], i.prototype, "_value", 2);
|
209
|
-
|
210
|
-
|
218
|
+
s([
|
219
|
+
a()
|
211
220
|
], i.prototype, "autocomplete", 2);
|
212
|
-
|
213
|
-
|
214
|
-
], i.prototype, "buttonAriaLabelClear", 2);
|
215
|
-
e([
|
216
|
-
s({ attribute: "button-aria-label-hide" })
|
217
|
-
], i.prototype, "buttonAriaLabelHide", 2);
|
218
|
-
e([
|
219
|
-
s({ attribute: "button-aria-label-show" })
|
220
|
-
], i.prototype, "buttonAriaLabelShow", 2);
|
221
|
-
e([
|
222
|
-
s({ attribute: "custom-invalid", reflect: !0 })
|
221
|
+
s([
|
222
|
+
a({ attribute: "custom-invalid", reflect: !0 })
|
223
223
|
], i.prototype, "customInvalid", 1);
|
224
|
-
|
225
|
-
|
224
|
+
s([
|
225
|
+
a({ type: Boolean })
|
226
226
|
], i.prototype, "debug", 2);
|
227
|
-
|
228
|
-
|
227
|
+
s([
|
228
|
+
a({ type: Boolean, attribute: "hide-label" })
|
229
229
|
], i.prototype, "hideLabel", 2);
|
230
|
-
|
231
|
-
|
230
|
+
s([
|
231
|
+
a()
|
232
232
|
], i.prototype, "hint", 2);
|
233
|
-
|
234
|
-
|
233
|
+
s([
|
234
|
+
a()
|
235
235
|
], i.prototype, "inputmode", 2);
|
236
|
-
|
237
|
-
|
236
|
+
s([
|
237
|
+
a()
|
238
238
|
], i.prototype, "label", 2);
|
239
|
-
|
240
|
-
|
239
|
+
s([
|
240
|
+
a({ type: String })
|
241
|
+
], i.prototype, "lang", 2);
|
242
|
+
s([
|
243
|
+
a()
|
241
244
|
], i.prototype, "leading", 2);
|
242
|
-
|
243
|
-
|
245
|
+
s([
|
246
|
+
a()
|
244
247
|
], i.prototype, "max", 2);
|
245
|
-
|
246
|
-
|
248
|
+
s([
|
249
|
+
a({ type: Number, attribute: "maxlength" })
|
247
250
|
], i.prototype, "maxLength", 2);
|
248
|
-
|
249
|
-
|
251
|
+
s([
|
252
|
+
a()
|
250
253
|
], i.prototype, "min", 2);
|
251
|
-
|
252
|
-
|
254
|
+
s([
|
255
|
+
a({ type: Number, attribute: "minlength" })
|
253
256
|
], i.prototype, "minLength", 2);
|
254
|
-
|
255
|
-
|
257
|
+
s([
|
258
|
+
a({ reflect: !0 })
|
256
259
|
], i.prototype, "name", 2);
|
257
|
-
|
258
|
-
|
260
|
+
s([
|
261
|
+
a()
|
259
262
|
], i.prototype, "pattern", 2);
|
260
|
-
|
261
|
-
|
263
|
+
s([
|
264
|
+
a()
|
262
265
|
], i.prototype, "placeholder", 2);
|
263
|
-
|
264
|
-
|
266
|
+
s([
|
267
|
+
a({ type: Boolean })
|
265
268
|
], i.prototype, "readonly", 2);
|
266
|
-
|
267
|
-
|
268
|
-
], i.prototype, "requiredLabel", 2);
|
269
|
-
e([
|
270
|
-
s({ reflect: !0 })
|
269
|
+
s([
|
270
|
+
a({ reflect: !0 })
|
271
271
|
], i.prototype, "severity", 2);
|
272
|
-
|
273
|
-
|
272
|
+
s([
|
273
|
+
a({ type: Boolean, attribute: "show-valid" })
|
274
274
|
], i.prototype, "showValid", 2);
|
275
|
-
|
276
|
-
|
275
|
+
s([
|
276
|
+
a({ reflect: !0 })
|
277
277
|
], i.prototype, "size", 2);
|
278
|
-
|
279
|
-
|
278
|
+
s([
|
279
|
+
a()
|
280
280
|
], i.prototype, "trailing", 2);
|
281
|
-
|
282
|
-
|
281
|
+
s([
|
282
|
+
a()
|
283
283
|
], i.prototype, "type", 2);
|
284
|
-
|
285
|
-
|
284
|
+
s([
|
285
|
+
a({ attribute: "validate-on" })
|
286
286
|
], i.prototype, "validateOn", 2);
|
287
|
-
|
288
|
-
|
287
|
+
s([
|
288
|
+
a({})
|
289
289
|
], i.prototype, "value", 1);
|
290
|
-
|
291
|
-
|
290
|
+
s([
|
291
|
+
v()
|
292
292
|
], i.prototype, "invalid", 2);
|
293
|
-
|
294
|
-
|
293
|
+
s([
|
294
|
+
v()
|
295
295
|
], i.prototype, "_buttonDown", 2);
|
296
|
-
|
297
|
-
|
296
|
+
s([
|
297
|
+
S("input")
|
298
298
|
], i.prototype, "$input", 2);
|
299
|
-
|
300
|
-
|
299
|
+
s([
|
300
|
+
x({ flatten: !0 })
|
301
301
|
], i.prototype, "_defaultSlot", 2);
|
302
|
-
|
303
|
-
|
302
|
+
s([
|
303
|
+
E("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
304
304
|
], i.prototype, "valueChanged", 1);
|
305
305
|
export {
|
306
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
|
};
|
@@ -2,54 +2,51 @@ import '../icon/icon.js';
|
|
2
2
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
3
3
|
import type { Icon } from '../../internal/types.js';
|
4
4
|
import { type CSSResultGroup } from 'lit';
|
5
|
-
type
|
5
|
+
type Color = 'primary' | 'inverse';
|
6
6
|
/**
|
7
|
-
* The `<skf-link>` can be used as either a regular link or a
|
7
|
+
* The `<skf-link>` can be used as either a regular link or a semantic button. The button variant is
|
8
|
+
* intended to be used for triggering javascript functions, not handling forms.
|
8
9
|
*
|
9
10
|
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
10
11
|
*
|
12
|
+
* @event {CustomEvent} skf-link-click - Fired when the link is clicked
|
13
|
+
*
|
11
14
|
* @slot - The links' main content
|
12
15
|
*
|
13
16
|
* @tagname skf-link
|
14
17
|
*/
|
15
18
|
export declare class SkfLink extends SkfElement {
|
19
|
+
#private;
|
16
20
|
static styles: CSSResultGroup;
|
17
|
-
static classMap: {};
|
18
|
-
/** @internal */
|
19
|
-
private _onClick?;
|
20
21
|
/** Defines the semantic element to render */
|
21
|
-
as: 'button' | '
|
22
|
+
as: 'button' | 'link';
|
22
23
|
/** Defines the text-color */
|
23
|
-
color:
|
24
|
+
color: Color;
|
24
25
|
/** If true, disables the link */
|
25
26
|
disabled: boolean;
|
26
27
|
/** If defined, downloads the url */
|
27
|
-
download
|
28
|
+
download: boolean;
|
28
29
|
/** If defined, loads url on click */
|
29
30
|
href?: string;
|
30
31
|
/** If defined, renders an icon before or after the text */
|
31
32
|
icon?: Icon;
|
32
|
-
/**
|
33
|
-
|
34
|
-
/** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
|
35
|
-
set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
|
36
|
-
get onClick(): ((event: Event, route?: string) => void) | undefined;
|
33
|
+
/** If true, the icon is placed to the right in relation to the text */
|
34
|
+
iconRight: boolean;
|
37
35
|
/** If defined, describes the relationship between a linked resource and the current document */
|
38
36
|
rel?: string;
|
39
|
-
/** If defined, used on conjunction with onClick property
|
37
|
+
/** If defined, used on conjunction with onClick property. **Notice!** Only applicable to as=button. */
|
40
38
|
route?: string;
|
41
39
|
/** If true, fills the parents horizontal axis */
|
42
40
|
stretch: boolean;
|
43
41
|
/** If defined, specifies where to open the linked document */
|
44
42
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
45
|
-
/** Defines the type of button */
|
46
|
-
type: SkfLinkType;
|
47
43
|
connectedCallback(): void;
|
44
|
+
_handleAsChange(): void;
|
48
45
|
/** @internal */
|
49
|
-
|
46
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
50
47
|
/** @internal */
|
51
48
|
/** retargets click event to host */
|
52
|
-
private
|
49
|
+
private _handleClick;
|
53
50
|
/** @internal */
|
54
51
|
private _renderIcon;
|
55
52
|
render(): import("lit").TemplateResult;
|