@skf-design-system/ui-components 1.0.1-beta.0 → 1.0.2-beta.0
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 +1 -18
- package/dist/components/accordion/accordion.component.d.ts +4 -4
- package/dist/components/accordion/accordion.component.js +8 -8
- package/dist/components/alert/alert.component.d.ts +8 -9
- package/dist/components/alert/alert.component.js +14 -14
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +1 -1
- 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 +18 -30
- package/dist/components/card/card.styles.js +25 -28
- package/dist/components/checkbox/checkbox.component.d.ts +9 -7
- package/dist/components/checkbox/checkbox.component.js +71 -58
- package/dist/components/collapse/collapse.component.js +1 -1
- package/dist/components/date-picker/datepicker.calendar.component.d.ts +77 -0
- package/dist/components/date-picker/datepicker.calendar.component.js +415 -0
- package/dist/components/date-picker/datepicker.calendar.styles.d.ts +1 -0
- package/dist/components/date-picker/datepicker.calendar.styles.js +202 -0
- package/dist/components/date-picker/datepicker.component.d.ts +79 -0
- package/dist/components/date-picker/datepicker.component.js +261 -0
- package/dist/components/date-picker/datepicker.d.ts +10 -0
- package/dist/components/date-picker/datepicker.helpers.d.ts +41 -0
- package/dist/components/date-picker/datepicker.helpers.js +76 -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 +87 -0
- package/dist/components/date-picker-input/datepicker-input.component.d.ts +115 -0
- package/dist/components/date-picker-input/datepicker-input.component.js +441 -0
- package/dist/components/date-picker-input/datepicker-input.d.ts +8 -0
- package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +38 -0
- package/dist/components/date-picker-input/datepicker-input.helpers.js +31 -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 +18 -0
- package/dist/components/dialog/dialog.component.d.ts +18 -28
- package/dist/components/dialog/dialog.component.js +94 -84
- package/dist/components/divider/divider.component.d.ts +4 -8
- package/dist/components/divider/divider.component.js +24 -46
- package/dist/components/divider/divider.styles.js +34 -30
- package/dist/components/drawer/drawer.component.d.ts +57 -0
- package/dist/components/drawer/drawer.component.js +124 -0
- package/dist/components/drawer/drawer.d.ts +8 -0
- package/dist/components/drawer/drawer.js +6 -0
- package/dist/components/drawer/drawer.styles.d.ts +1 -0
- package/dist/components/drawer/drawer.styles.js +71 -0
- package/dist/components/header/header.component.d.ts +45 -0
- package/dist/components/header/header.component.js +110 -0
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/header.js +6 -0
- package/dist/components/header/header.styles.d.ts +1 -0
- package/dist/components/header/header.styles.js +68 -0
- package/dist/components/heading/heading.component.d.ts +6 -12
- package/dist/components/heading/heading.component.js +17 -17
- package/dist/components/heading/heading.styles.d.ts +1 -2
- package/dist/components/heading/heading.styles.js +1 -1
- package/dist/components/icon/icon.component.d.ts +1 -1
- package/dist/components/icon/icon.component.js +19 -19
- package/dist/components/input/input.component.d.ts +3 -2
- package/dist/components/input/input.component.js +89 -82
- package/dist/components/input/input.controllers.d.ts +20 -6
- package/dist/components/input/input.controllers.js +14 -10
- package/dist/components/link/link.component.js +29 -28
- package/dist/components/link/link.styles.js +24 -20
- package/dist/components/loader/loader.component.js +19 -19
- package/dist/components/logo/logo.component.js +6 -6
- package/dist/components/menu/menu.component.d.ts +4 -5
- package/dist/components/menu/menu.component.js +1 -1
- package/dist/components/nav/nav.component.d.ts +17 -0
- package/dist/components/nav/nav.component.js +34 -0
- package/dist/components/nav/nav.d.ts +8 -0
- package/dist/components/nav/nav.js +6 -0
- package/dist/components/nav/nav.styles.d.ts +1 -0
- package/dist/components/nav/nav.styles.js +17 -0
- package/dist/components/nav-item/nav-item.component.d.ts +20 -0
- package/dist/components/nav-item/nav-item.component.js +38 -0
- package/dist/components/nav-item/nav-item.d.ts +8 -0
- package/dist/components/nav-item/nav-item.js +6 -0
- package/dist/components/nav-item/nav-item.styles.d.ts +1 -0
- package/dist/components/nav-item/nav-item.styles.js +39 -0
- package/dist/components/popover/popover.component.d.ts +5 -6
- package/dist/components/popover/popover.component.js +24 -24
- package/dist/components/progress/progress.component.js +7 -7
- package/dist/components/radio/radio.component.d.ts +10 -6
- package/dist/components/radio/radio.component.js +14 -14
- package/dist/components/radio/radio.styles.d.ts +1 -2
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button.component.d.ts +32 -0
- package/dist/components/segmented-button/segmented-button.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
- package/dist/components/segmented-button-item/segmented-button-item.component.d.ts +36 -0
- package/dist/components/segmented-button-item/segmented-button-item.d.ts +8 -0
- package/dist/components/segmented-button-item/segmented-button-item.styles.d.ts +1 -0
- package/dist/components/select/select.component.js +2 -2
- package/dist/components/select/select.controllers.d.ts +20 -9
- package/dist/components/select/select.controllers.js +27 -22
- package/dist/components/select-option/select-option.controllers.d.ts +11 -5
- package/dist/components/select-option-group/select-option-group.component.js +9 -9
- package/dist/components/stepper/stepper.component.d.ts +2 -1
- 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 +25 -25
- package/dist/components/switch/switch.component.d.ts +7 -6
- package/dist/components/switch/switch.component.js +7 -7
- 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.d.ts +4 -2
- package/dist/components/tag/tag.component.js +14 -14
- package/dist/components/textarea/textarea.component.js +10 -10
- package/dist/components/toast/toast.component.d.ts +1 -1
- 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.d.ts +5 -6
- package/dist/components/tooltip/tooltip.component.js +11 -11
- package/dist/custom-elements.json +3702 -2190
- package/dist/index.d.ts +6 -0
- package/dist/index.js +84 -66
- package/dist/internal/base-classes/popover/popover.base.d.ts +17 -7
- package/dist/internal/base-classes/popover/popover.base.js +119 -75
- package/dist/internal/base-classes/popover/popover.styles.js +14 -1
- package/dist/internal/components/hint/hint.component.js +13 -13
- package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
- package/dist/internal/controllers/popover.controller.d.ts +12 -6
- package/dist/internal/controllers/popover.controller.js +9 -14
- package/dist/internal/helpers/dateFormatter.d.ts +2 -0
- package/dist/internal/helpers/utilityTypes.d.ts +22 -0
- package/dist/internal/helpers/uuid.d.ts +15 -0
- package/dist/internal/helpers/uuid.js +14 -0
- package/dist/internal/storybook/styles.d.ts +1 -0
- package/dist/styles/form-field.styles.js +11 -6
- package/dist/styles/global.css +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +663 -1240
- package/dist/types/vue/index.d.ts +453 -255
- package/dist/vscode.html-custom-data.json +821 -503
- package/dist/web-types.json +1005 -633
- package/package.json +43 -52
- package/dist/react/index.d.ts +0 -35
- package/dist/react/index.js +0 -35
- package/dist/react/skf-accordion/index.d.ts +0 -3
- package/dist/react/skf-accordion/index.js +0 -13
- package/dist/react/skf-alert/index.d.ts +0 -9
- package/dist/react/skf-alert/index.js +0 -17
- package/dist/react/skf-breadcrumb/index.d.ts +0 -9
- package/dist/react/skf-breadcrumb/index.js +0 -17
- package/dist/react/skf-breadcrumb-item/index.d.ts +0 -3
- package/dist/react/skf-breadcrumb-item/index.js +0 -13
- package/dist/react/skf-button/index.d.ts +0 -9
- package/dist/react/skf-button/index.js +0 -17
- package/dist/react/skf-card/index.d.ts +0 -3
- package/dist/react/skf-card/index.js +0 -13
- package/dist/react/skf-checkbox/index.d.ts +0 -9
- package/dist/react/skf-checkbox/index.js +0 -17
- package/dist/react/skf-collapse/index.d.ts +0 -9
- package/dist/react/skf-collapse/index.js +0 -17
- package/dist/react/skf-dialog/index.d.ts +0 -15
- package/dist/react/skf-dialog/index.js +0 -19
- package/dist/react/skf-divider/index.d.ts +0 -3
- package/dist/react/skf-divider/index.js +0 -13
- package/dist/react/skf-heading/index.d.ts +0 -3
- package/dist/react/skf-heading/index.js +0 -13
- package/dist/react/skf-icon/index.d.ts +0 -3
- package/dist/react/skf-icon/index.js +0 -13
- package/dist/react/skf-input/index.d.ts +0 -12
- package/dist/react/skf-input/index.js +0 -18
- package/dist/react/skf-link/index.d.ts +0 -3
- package/dist/react/skf-link/index.js +0 -13
- package/dist/react/skf-loader/index.d.ts +0 -3
- package/dist/react/skf-loader/index.js +0 -13
- package/dist/react/skf-logo/index.d.ts +0 -3
- package/dist/react/skf-logo/index.js +0 -13
- package/dist/react/skf-menu/index.d.ts +0 -12
- package/dist/react/skf-menu/index.js +0 -18
- package/dist/react/skf-menu-item/index.d.ts +0 -27
- package/dist/react/skf-menu-item/index.js +0 -23
- package/dist/react/skf-popover/index.d.ts +0 -12
- package/dist/react/skf-popover/index.js +0 -18
- package/dist/react/skf-progress/index.d.ts +0 -3
- package/dist/react/skf-progress/index.js +0 -13
- package/dist/react/skf-radio/index.d.ts +0 -9
- package/dist/react/skf-radio/index.js +0 -17
- package/dist/react/skf-select/index.d.ts +0 -21
- package/dist/react/skf-select/index.js +0 -21
- package/dist/react/skf-select-option/index.d.ts +0 -9
- package/dist/react/skf-select-option/index.js +0 -17
- package/dist/react/skf-select-option-group/index.d.ts +0 -3
- package/dist/react/skf-select-option-group/index.js +0 -13
- package/dist/react/skf-stepper/index.d.ts +0 -9
- package/dist/react/skf-stepper/index.js +0 -17
- package/dist/react/skf-stepper-item/index.d.ts +0 -9
- package/dist/react/skf-stepper-item/index.js +0 -17
- package/dist/react/skf-switch/index.d.ts +0 -3
- package/dist/react/skf-switch/index.js +0 -13
- package/dist/react/skf-tab/index.d.ts +0 -12
- package/dist/react/skf-tab/index.js +0 -18
- package/dist/react/skf-tab-group/index.d.ts +0 -3
- package/dist/react/skf-tab-group/index.js +0 -13
- package/dist/react/skf-tab-panel/index.d.ts +0 -3
- package/dist/react/skf-tab-panel/index.js +0 -13
- package/dist/react/skf-tag/index.d.ts +0 -3
- package/dist/react/skf-tag/index.js +0 -13
- package/dist/react/skf-textarea/index.d.ts +0 -12
- package/dist/react/skf-textarea/index.js +0 -18
- package/dist/react/skf-toast/index.d.ts +0 -3
- package/dist/react/skf-toast/index.js +0 -13
- package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
- package/dist/react/skf-toast-wrapper/index.js +0 -13
- package/dist/react/skf-tooltip/index.d.ts +0 -12
- package/dist/react/skf-tooltip/index.js +0 -18
@@ -2,22 +2,23 @@ import "../icon/icon.js";
|
|
2
2
|
import { FormBase as b } from "../../internal/components/formBase.js";
|
3
3
|
import "../../internal/components/hint/hint.js";
|
4
4
|
import { hintSeverity as v } from "../../internal/helpers/hintSeverity.js";
|
5
|
-
import {
|
6
|
-
import f from "../../
|
7
|
-
import
|
8
|
-
import {
|
5
|
+
import { watch as y } from "../../internal/helpers/watch.js";
|
6
|
+
import { Asterisk as f } from "../../internal/templates/asterisk.js";
|
7
|
+
import _ from "../../styles/component.styles.js";
|
8
|
+
import { html as h, nothing as u } from "lit";
|
9
|
+
import { property as i, state as c, query as $, queryAssignedNodes as g } from "lit/decorators.js";
|
9
10
|
import { ifDefined as n } from "lit/directives/if-defined.js";
|
10
|
-
import { live as
|
11
|
-
import { InputNumberController as
|
11
|
+
import { live as w } from "lit/directives/live.js";
|
12
|
+
import { InputNumberController as E, InputPasswordController as C } from "./input.controllers.js";
|
12
13
|
import A from "./input.styles.js";
|
13
|
-
var
|
14
|
-
for (var o = a > 1 ? void 0 : a ?
|
15
|
-
(
|
16
|
-
return a && o &&
|
14
|
+
var S = Object.defineProperty, L = Object.getOwnPropertyDescriptor, e = (m, s, r, a) => {
|
15
|
+
for (var o = a > 1 ? void 0 : a ? L(s, r) : s, l = m.length - 1, d; l >= 0; l--)
|
16
|
+
(d = m[l]) && (o = (a ? d(s, r, o) : d(o)) || o);
|
17
|
+
return a && o && S(s, r, o), o;
|
17
18
|
};
|
18
19
|
const p = class p extends b {
|
19
20
|
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
|
21
|
+
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 E(this), this._passwordController = new C(this), this._handleInput = () => {
|
21
22
|
this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
22
23
|
}, this._resetValue = (s) => {
|
23
24
|
var r;
|
@@ -70,7 +71,7 @@ const p = class p extends b {
|
|
70
71
|
};
|
71
72
|
}
|
72
73
|
set customInvalid(s) {
|
73
|
-
this.customError = s
|
74
|
+
this.customError = s ?? "";
|
74
75
|
}
|
75
76
|
get customInvalid() {
|
76
77
|
return this.customError;
|
@@ -91,6 +92,9 @@ const p = class p extends b {
|
|
91
92
|
} else
|
92
93
|
this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
|
93
94
|
}
|
95
|
+
valueChanged() {
|
96
|
+
this._internals.setFormValue(this.value), this.validateInput();
|
97
|
+
}
|
94
98
|
attributeChangedCallback(s, r, a) {
|
95
99
|
if (super.attributeChangedCallback(s, r, a), s === "value" && this._internals.setFormValue(a), s === "custom-invalid")
|
96
100
|
if (typeof a == "string") {
|
@@ -131,10 +135,10 @@ const p = class p extends b {
|
|
131
135
|
<label>
|
132
136
|
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${s} id="label">
|
133
137
|
<slot>${this.label}</slot>
|
134
|
-
${this.required ?
|
138
|
+
${this.required ? f(this.requiredLabel) : null}
|
135
139
|
</div>
|
136
140
|
<div id="input">
|
137
|
-
${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` :
|
141
|
+
${this.type === "search" ? h`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : u}
|
138
142
|
<div
|
139
143
|
data-leading=${n(this.leading)}
|
140
144
|
data-trailing=${n(this.trailing)}
|
@@ -144,12 +148,12 @@ const p = class p extends b {
|
|
144
148
|
?disabled=${this.disabled}
|
145
149
|
?readonly=${this.readonly}
|
146
150
|
?required=${this.required}
|
147
|
-
.value=${
|
151
|
+
.value=${w(this.value)}
|
148
152
|
@blur=${this._onBlur}
|
149
153
|
@input=${this._handleInput}
|
150
154
|
autocomplete=${this.autocomplete}
|
151
|
-
aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" :
|
152
|
-
aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" :
|
155
|
+
aria-describedby=${n((o = this.hint) != null && o.trim() ? "hint" : u)}
|
156
|
+
aria-errormessage=${n((l = this.hint) != null && l.trim() ? "hint" : u)}
|
153
157
|
aria-invalid=${!!this.invalid}
|
154
158
|
autocomplete="off"
|
155
159
|
data-testid="field-input"
|
@@ -170,9 +174,9 @@ const p = class p extends b {
|
|
170
174
|
<div id="action">
|
171
175
|
${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
|
172
176
|
</div>
|
173
|
-
` :
|
174
|
-
${this.type === "password" ? this._renderPasswordButton() :
|
175
|
-
${this.type === "search" && this.value.length > 0 ? this._renderSearchButton() :
|
177
|
+
` : u}
|
178
|
+
${this.type === "password" ? this._renderPasswordButton() : u}
|
179
|
+
${this.type === "search" && this.value.length > 0 ? this._renderSearchButton() : u}
|
176
180
|
</div>
|
177
181
|
</label>
|
178
182
|
${this.hint && h`
|
@@ -180,108 +184,111 @@ const p = class p extends b {
|
|
180
184
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
181
185
|
id="hint"
|
182
186
|
severity=${n(v(this.severity, this.invalid))}
|
183
|
-
>${this.customInvalid
|
187
|
+
>${this.customInvalid ?? this.hint}
|
184
188
|
</skf-hint>
|
185
189
|
`}
|
186
190
|
</div>
|
187
191
|
`;
|
188
192
|
}
|
189
193
|
};
|
190
|
-
p.styles = [
|
194
|
+
p.styles = [_, A];
|
191
195
|
let t = p;
|
192
|
-
|
193
|
-
|
196
|
+
e([
|
197
|
+
i({ type: String })
|
194
198
|
], t.prototype, "autocomplete", 2);
|
195
|
-
|
196
|
-
|
199
|
+
e([
|
200
|
+
i({ attribute: "button-aria-label-clear" })
|
197
201
|
], t.prototype, "buttonAriaLabelClear", 2);
|
198
|
-
|
199
|
-
|
202
|
+
e([
|
203
|
+
i({ attribute: "button-aria-label-hide" })
|
200
204
|
], t.prototype, "buttonAriaLabelHide", 2);
|
201
|
-
|
202
|
-
|
205
|
+
e([
|
206
|
+
i({ attribute: "button-aria-label-show" })
|
203
207
|
], t.prototype, "buttonAriaLabelShow", 2);
|
204
|
-
|
205
|
-
|
208
|
+
e([
|
209
|
+
i({ attribute: "custom-invalid", reflect: !0 })
|
206
210
|
], t.prototype, "customInvalid", 1);
|
207
|
-
|
208
|
-
|
211
|
+
e([
|
212
|
+
i({ type: Boolean })
|
209
213
|
], t.prototype, "debug", 2);
|
210
|
-
|
211
|
-
|
214
|
+
e([
|
215
|
+
i({ type: Boolean, attribute: "hide-label" })
|
212
216
|
], t.prototype, "hideLabel", 2);
|
213
|
-
|
214
|
-
|
217
|
+
e([
|
218
|
+
i()
|
215
219
|
], t.prototype, "hint", 2);
|
216
|
-
|
217
|
-
|
220
|
+
e([
|
221
|
+
i({ type: String })
|
218
222
|
], t.prototype, "inputmode", 2);
|
219
|
-
|
220
|
-
|
223
|
+
e([
|
224
|
+
i()
|
221
225
|
], t.prototype, "label", 2);
|
222
|
-
|
223
|
-
|
226
|
+
e([
|
227
|
+
i()
|
224
228
|
], t.prototype, "leading", 2);
|
225
|
-
|
226
|
-
|
229
|
+
e([
|
230
|
+
i()
|
227
231
|
], t.prototype, "max", 2);
|
228
|
-
|
229
|
-
|
232
|
+
e([
|
233
|
+
i({ type: Number, attribute: "maxlength" })
|
230
234
|
], t.prototype, "maxLength", 2);
|
231
|
-
|
232
|
-
|
235
|
+
e([
|
236
|
+
i()
|
233
237
|
], t.prototype, "min", 2);
|
234
|
-
|
235
|
-
|
238
|
+
e([
|
239
|
+
i({ type: Number, attribute: "minlength" })
|
236
240
|
], t.prototype, "minLength", 2);
|
237
|
-
|
238
|
-
|
241
|
+
e([
|
242
|
+
i({ reflect: !0 })
|
239
243
|
], t.prototype, "name", 2);
|
240
|
-
|
241
|
-
|
244
|
+
e([
|
245
|
+
i()
|
242
246
|
], t.prototype, "pattern", 2);
|
243
|
-
|
244
|
-
|
247
|
+
e([
|
248
|
+
i()
|
245
249
|
], t.prototype, "placeholder", 2);
|
246
|
-
|
247
|
-
|
250
|
+
e([
|
251
|
+
i({ type: Boolean })
|
248
252
|
], t.prototype, "readonly", 2);
|
249
|
-
|
250
|
-
|
253
|
+
e([
|
254
|
+
i({ attribute: "required-label" })
|
251
255
|
], t.prototype, "requiredLabel", 2);
|
252
|
-
|
253
|
-
|
256
|
+
e([
|
257
|
+
i({ reflect: !0 })
|
254
258
|
], t.prototype, "severity", 2);
|
255
|
-
|
256
|
-
|
259
|
+
e([
|
260
|
+
i({ type: Boolean, attribute: "show-valid" })
|
257
261
|
], t.prototype, "showValid", 2);
|
258
|
-
|
259
|
-
|
262
|
+
e([
|
263
|
+
i({ reflect: !0 })
|
260
264
|
], t.prototype, "size", 2);
|
261
|
-
|
262
|
-
|
265
|
+
e([
|
266
|
+
i()
|
263
267
|
], t.prototype, "trailing", 2);
|
264
|
-
|
265
|
-
|
268
|
+
e([
|
269
|
+
i()
|
266
270
|
], t.prototype, "type", 2);
|
267
|
-
|
268
|
-
|
271
|
+
e([
|
272
|
+
i({ type: String, attribute: "validate-on" })
|
269
273
|
], t.prototype, "validateOn", 2);
|
270
|
-
|
271
|
-
|
274
|
+
e([
|
275
|
+
i({ reflect: !0 })
|
272
276
|
], t.prototype, "value", 2);
|
273
|
-
|
277
|
+
e([
|
274
278
|
c()
|
275
279
|
], t.prototype, "invalid", 2);
|
276
|
-
|
280
|
+
e([
|
277
281
|
c()
|
278
282
|
], t.prototype, "_buttonDown", 2);
|
279
|
-
|
280
|
-
|
283
|
+
e([
|
284
|
+
$("input")
|
281
285
|
], t.prototype, "$input", 2);
|
282
|
-
|
283
|
-
|
286
|
+
e([
|
287
|
+
g({ flatten: !0 })
|
284
288
|
], t.prototype, "_defaultSlot", 2);
|
289
|
+
e([
|
290
|
+
y("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
291
|
+
], t.prototype, "valueChanged", 1);
|
285
292
|
export {
|
286
293
|
t as SkfInput
|
287
294
|
};
|
@@ -1,17 +1,31 @@
|
|
1
1
|
import type { Icon } from '@skf-design-system/ui-assets';
|
2
|
-
import type { ReactiveController } from 'lit';
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
3
|
import type { SkfInput } from './input.component.js';
|
4
|
-
|
4
|
+
/**
|
5
|
+
* Workaround for storybook helper not being able to import types
|
6
|
+
* E.g type ControllerHost = SkfInput;
|
7
|
+
*/
|
8
|
+
interface ControllerHostProps {
|
9
|
+
$input?: HTMLInputElement;
|
10
|
+
_internals: ElementInternals;
|
11
|
+
value: string;
|
12
|
+
validateInput: () => void;
|
13
|
+
buttonAriaLabelShow: string;
|
14
|
+
buttonAriaLabelHide: string;
|
15
|
+
_handleInput: () => void;
|
16
|
+
_manageRequired: () => void;
|
17
|
+
_setFormValue: (value: string) => void;
|
18
|
+
}
|
5
19
|
/**
|
6
20
|
* Number
|
7
21
|
*/
|
8
22
|
export type IncrementDecrement = 'inc' | 'dec';
|
9
23
|
export declare class InputNumberController implements ReactiveController {
|
10
|
-
host
|
24
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
11
25
|
private _longPressId?;
|
12
26
|
private _repeaterId?;
|
13
27
|
private _inputElement?;
|
14
|
-
constructor(host:
|
28
|
+
constructor(host: ReactiveControllerHost);
|
15
29
|
hostUpdated(): void;
|
16
30
|
handleActionBtnClick: (_: Event, type: IncrementDecrement) => void;
|
17
31
|
handleActionBtnLongPressStart: (e: Event) => void;
|
@@ -21,12 +35,12 @@ export declare class InputNumberController implements ReactiveController {
|
|
21
35
|
* password
|
22
36
|
*/
|
23
37
|
export declare class InputPasswordController implements ReactiveController {
|
24
|
-
host
|
38
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
25
39
|
_inputElement?: HTMLInputElement;
|
26
40
|
_icon: Extract<Icon, 'visibility' | 'visibilityOff'>;
|
27
41
|
_buttonAriaLabel: string;
|
28
42
|
_type: Extract<SkfInput['type'], 'password' | 'text'>;
|
29
|
-
constructor(host:
|
43
|
+
constructor(host: ReactiveControllerHost);
|
30
44
|
hostUpdated(): void;
|
31
45
|
handleFieldLoaded: () => void;
|
32
46
|
toggleVisibility: () => void;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class l {
|
2
2
|
constructor(t) {
|
3
3
|
this.handleActionBtnClick = (i, s) => {
|
4
|
-
var n;
|
4
|
+
var h, n;
|
5
5
|
const e = this._inputElement;
|
6
|
-
e
|
6
|
+
!e || !this.host || (s === "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
7
|
}, this.handleActionBtnLongPressStart = (i) => {
|
8
8
|
const s = i.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
|
9
9
|
this._longPressId = setTimeout(() => {
|
@@ -13,25 +13,29 @@ class l {
|
|
13
13
|
}, 400);
|
14
14
|
}, this.handleActionBtnLongPressEnd = () => {
|
15
15
|
clearTimeout(this._longPressId), clearInterval(this._repeaterId);
|
16
|
-
}, this.host = t
|
16
|
+
}, (this.host = t).addController(this);
|
17
17
|
}
|
18
18
|
hostUpdated() {
|
19
|
-
|
19
|
+
var t;
|
20
|
+
this._inputElement = (t = this.host) == null ? void 0 : t.$input;
|
20
21
|
}
|
21
22
|
}
|
22
|
-
class
|
23
|
+
class a {
|
23
24
|
constructor(t) {
|
24
25
|
this._icon = "visibility", this._type = "password", this.handleFieldLoaded = () => {
|
25
|
-
|
26
|
+
var i;
|
27
|
+
!this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
|
26
28
|
}, this.toggleVisibility = () => {
|
27
|
-
|
28
|
-
|
29
|
+
var i;
|
30
|
+
!this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host._handleInput(), this._type === "text" ? (this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "", this._icon = "visibility", this._type = "password") : (this._buttonAriaLabel = this.host.buttonAriaLabelHide ?? "", this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
|
31
|
+
}, (this.host = t).addController(this), this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "";
|
29
32
|
}
|
30
33
|
hostUpdated() {
|
31
|
-
|
34
|
+
var t;
|
35
|
+
this._inputElement = (t = this.host) == null ? void 0 : t.$input;
|
32
36
|
}
|
33
37
|
}
|
34
38
|
export {
|
35
39
|
l as InputNumberController,
|
36
|
-
|
40
|
+
a as InputPasswordController
|
37
41
|
};
|
@@ -1,18 +1,18 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import
|
3
|
-
import { SkfElement as
|
4
|
-
import
|
2
|
+
import y from "./link.styles.js";
|
3
|
+
import { SkfElement as d } from "../../internal/components/skf-element.js";
|
4
|
+
import u from "../../styles/component.styles.js";
|
5
5
|
import "lit";
|
6
6
|
import { property as r } from "lit/decorators.js";
|
7
7
|
import { classMap as k } from "lit/directives/class-map.js";
|
8
8
|
import { ifDefined as c } from "lit/directives/if-defined.js";
|
9
|
-
import { html as f, literal as
|
10
|
-
var
|
11
|
-
for (var n = l > 1 ? void 0 : l ?
|
12
|
-
(a = h[p]) && (n = (l ? a(t,
|
13
|
-
return l && n &&
|
9
|
+
import { html as f, literal as m } from "lit/static-html.js";
|
10
|
+
var v = Object.defineProperty, g = Object.getOwnPropertyDescriptor, o = (h, t, i, l) => {
|
11
|
+
for (var n = l > 1 ? void 0 : l ? g(t, i) : t, p = h.length - 1, a; p >= 0; p--)
|
12
|
+
(a = h[p]) && (n = (l ? a(t, i, n) : a(n)) || n);
|
13
|
+
return l && n && v(t, i, n), n;
|
14
14
|
}, s;
|
15
|
-
const e = (s = class extends
|
15
|
+
const e = (s = class extends d {
|
16
16
|
constructor() {
|
17
17
|
super(...arguments), this.as = "a", this.color = "primary", this.iconPlacement = "left", this.stretch = !1, this.type = "button", this._preprocessOnClick = (t) => {
|
18
18
|
this.as === "a" && this.onClick && t.preventDefault(), t.stopPropagation(), this.emit("click");
|
@@ -21,10 +21,10 @@ const e = (s = class extends m {
|
|
21
21
|
set onClick(t) {
|
22
22
|
if (!t) return;
|
23
23
|
this._onClick = t;
|
24
|
-
const
|
24
|
+
const i = (l) => {
|
25
25
|
t(l, this.href ?? this.route);
|
26
26
|
};
|
27
|
-
this._assertValidOnClick(t), this.removeEventListener("click",
|
27
|
+
this._assertValidOnClick(t), this.removeEventListener("click", i), this.addEventListener("click", i);
|
28
28
|
}
|
29
29
|
get onClick() {
|
30
30
|
return this._onClick;
|
@@ -52,9 +52,9 @@ const e = (s = class extends m {
|
|
52
52
|
`;
|
53
53
|
}
|
54
54
|
render() {
|
55
|
-
const t = this.as === "a",
|
55
|
+
const t = this.as === "a", i = t ? m`a` : m`button`;
|
56
56
|
return f`
|
57
|
-
<${
|
57
|
+
<${i}
|
58
58
|
?disabled=${c(t ? void 0 : this.disabled)}
|
59
59
|
@click=${this._preprocessOnClick}
|
60
60
|
class=${k({
|
@@ -67,53 +67,54 @@ const e = (s = class extends m {
|
|
67
67
|
})}
|
68
68
|
download=${c(t ? this.download : void 0)}
|
69
69
|
href=${c(t ? this.href : void 0)}
|
70
|
+
part="root"
|
70
71
|
rel=${c(t ? this.rel : void 0)}
|
71
72
|
target=${c(t ? this.target : void 0)}
|
72
73
|
type=${c(t ? void 0 : this.type)}
|
73
74
|
>
|
74
75
|
${this.icon && this._renderIcon()}
|
75
76
|
<slot>Default link text</slot>
|
76
|
-
</${
|
77
|
+
</${i}>
|
77
78
|
`;
|
78
79
|
}
|
79
|
-
}, s.styles = [
|
80
|
-
|
80
|
+
}, s.styles = [u, y], s.classMap = {}, s);
|
81
|
+
o([
|
81
82
|
r({ type: String, reflect: !0 })
|
82
83
|
], e.prototype, "as", 2);
|
83
|
-
|
84
|
+
o([
|
84
85
|
r({ type: String, reflect: !0 })
|
85
86
|
], e.prototype, "color", 2);
|
86
|
-
|
87
|
+
o([
|
87
88
|
r({ type: Boolean, reflect: !0 })
|
88
89
|
], e.prototype, "disabled", 2);
|
89
|
-
|
90
|
+
o([
|
90
91
|
r({ type: String })
|
91
92
|
], e.prototype, "download", 2);
|
92
|
-
|
93
|
+
o([
|
93
94
|
r({ type: String })
|
94
95
|
], e.prototype, "href", 2);
|
95
|
-
|
96
|
+
o([
|
96
97
|
r({ type: String })
|
97
98
|
], e.prototype, "icon", 2);
|
98
|
-
|
99
|
+
o([
|
99
100
|
r({ attribute: "icon-placement", reflect: !0 })
|
100
101
|
], e.prototype, "iconPlacement", 2);
|
101
|
-
|
102
|
+
o([
|
102
103
|
r()
|
103
104
|
], e.prototype, "rel", 2);
|
104
|
-
|
105
|
+
o([
|
105
106
|
r({ reflect: !0 })
|
106
107
|
], e.prototype, "route", 2);
|
107
|
-
|
108
|
+
o([
|
108
109
|
r({ type: Boolean, reflect: !0 })
|
109
110
|
], e.prototype, "stretch", 2);
|
110
|
-
|
111
|
+
o([
|
111
112
|
r()
|
112
113
|
], e.prototype, "target", 2);
|
113
|
-
|
114
|
+
o([
|
114
115
|
r()
|
115
116
|
], e.prototype, "type", 2);
|
116
|
-
|
117
|
+
o([
|
117
118
|
r({ attribute: !1 })
|
118
119
|
], e.prototype, "onClick", 1);
|
119
120
|
let E = e;
|
@@ -1,53 +1,57 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
2
|
+
const i = r`
|
3
3
|
/* stylelint-disable selector-class-pattern */
|
4
4
|
@layer components {
|
5
|
+
:host {
|
6
|
+
contain: layout;
|
7
|
+
display: inline;
|
8
|
+
}
|
9
|
+
|
5
10
|
.link {
|
6
11
|
align-items: center;
|
7
|
-
color: var(--state-color, var(--color));
|
12
|
+
color: var(--_skf-link-state-color, var(--_skf-link-color));
|
8
13
|
display: inline-flex;
|
9
|
-
flex-direction: var(--flex-direction, rows);
|
10
14
|
font-weight: var(--skf-font-weight-bold);
|
11
|
-
gap: var(--skf-spacing-
|
12
|
-
|
15
|
+
gap: 0 var(--skf-spacing-25);
|
16
|
+
vertical-align: top;
|
13
17
|
|
14
18
|
&:is(a) {
|
15
19
|
text-decoration: none;
|
16
20
|
}
|
17
21
|
|
18
22
|
&:disabled {
|
19
|
-
--state-color: var(--color-disabled);
|
23
|
+
--_skf-link-state-color: var(--_skf-link-color-disabled);
|
20
24
|
}
|
21
25
|
|
22
26
|
&:hover {
|
23
|
-
--state-color: var(--color-hover);
|
27
|
+
--_skf-link-state-color: var(--_skf-link-color-hover);
|
24
28
|
}
|
25
29
|
|
26
30
|
&:focus-visible {
|
27
31
|
border-radius: var(--skf-border-radius-sm);
|
28
|
-
outline: var(--skf-border-width-md) solid var(--outline-color);
|
32
|
+
outline: var(--skf-border-width-md) solid var(--_skf-link-outline-color);
|
29
33
|
outline-offset: var(--skf-size-2);
|
30
34
|
}
|
31
35
|
}
|
32
36
|
|
33
37
|
.link--color-primary {
|
34
|
-
--color: var(--skf-interactive-text-color-primary);
|
35
|
-
--color-active: var(--skf-interactive-text-color-primary-active);
|
36
|
-
--color-disabled: var(--skf-interactive-text-color-disabled);
|
37
|
-
--color-hover: var(--skf-interactive-text-color-primary-hover);
|
38
|
-
--outline-color: var(--skf-interactive-text-color-primary);
|
38
|
+
--_skf-link-color: var(--skf-interactive-text-color-primary);
|
39
|
+
--_skf-link-color-active: var(--skf-interactive-text-color-primary-active);
|
40
|
+
--_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
|
41
|
+
--_skf-link-color-hover: var(--skf-interactive-text-color-primary-hover);
|
42
|
+
--_skf-link-outline-color: var(--skf-interactive-text-color-primary);
|
39
43
|
}
|
40
44
|
|
41
45
|
.link--color-inverse {
|
42
|
-
--color: var(--skf-interactive-text-color-inverse);
|
43
|
-
--color-active: var(--skf-interactive-text-color-inverse-active);
|
44
|
-
--color-disabled: var(--skf-interactive-text-color-disabled);
|
45
|
-
--color-hover: var(--skf-interactive-text-color-inverse-hover);
|
46
|
-
--outline-color: var(--skf-interactive-text-color-inverse);
|
46
|
+
--_skf-link-color: var(--skf-interactive-text-color-inverse);
|
47
|
+
--_skf-link-color-active: var(--skf-interactive-text-color-inverse-active);
|
48
|
+
--_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
|
49
|
+
--_skf-link-color-hover: var(--skf-interactive-text-color-inverse-hover);
|
50
|
+
--_skf-link-outline-color: var(--skf-interactive-text-color-inverse);
|
47
51
|
}
|
48
52
|
|
49
53
|
.link--icon-right {
|
50
|
-
|
54
|
+
flex-direction: row-reverse;
|
51
55
|
}
|
52
56
|
|
53
57
|
.link--stretch {
|
@@ -56,5 +60,5 @@ const o = r`
|
|
56
60
|
}
|
57
61
|
`;
|
58
62
|
export {
|
59
|
-
|
63
|
+
i as default
|
60
64
|
};
|
@@ -1,24 +1,24 @@
|
|
1
|
-
var v = (
|
2
|
-
throw TypeError(
|
1
|
+
var v = (r) => {
|
2
|
+
throw TypeError(r);
|
3
3
|
};
|
4
|
-
var f = (
|
5
|
-
var
|
4
|
+
var f = (r, e, t) => e.has(r) || v("Cannot " + t);
|
5
|
+
var p = (r, e, t) => (f(r, e, "read from private field"), t ? t.call(r) : e.get(r)), h = (r, e, t) => e.has(r) ? v("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), u = (r, e, t, a) => (f(r, e, "write to private field"), a ? a.call(r, t) : e.set(r, t), t);
|
6
6
|
import { SkfElement as y } from "../../internal/components/skf-element.js";
|
7
7
|
import _ from "../../styles/component.styles.js";
|
8
8
|
import { html as b } from "lit";
|
9
|
-
import { property as
|
9
|
+
import { property as n } from "lit/decorators.js";
|
10
10
|
import { classMap as g } from "lit/directives/class-map.js";
|
11
11
|
import z from "./loader.styles.js";
|
12
|
-
var x = Object.defineProperty,
|
13
|
-
for (var i = void 0, o =
|
14
|
-
(m =
|
15
|
-
return i && x(
|
12
|
+
var x = Object.defineProperty, c = (r, e, t, a) => {
|
13
|
+
for (var i = void 0, o = r.length - 1, m; o >= 0; o--)
|
14
|
+
(m = r[o]) && (i = m(e, t, i) || i);
|
15
|
+
return i && x(e, t, i), i;
|
16
16
|
}, s;
|
17
|
-
const
|
17
|
+
const d = class d extends y {
|
18
18
|
constructor() {
|
19
19
|
super();
|
20
20
|
h(this, s);
|
21
|
-
this.ariaLabel = "Loading...", this.invert = !1, this.size = "md", u(this, s, this.attachInternals()),
|
21
|
+
this.ariaLabel = "Loading...", this.invert = !1, this.size = "md", u(this, s, this.attachInternals()), p(this, s).role = "progressbar", p(this, s).ariaLive = "polite";
|
22
22
|
}
|
23
23
|
render() {
|
24
24
|
return b`
|
@@ -36,16 +36,16 @@ const c = class c extends y {
|
|
36
36
|
`;
|
37
37
|
}
|
38
38
|
};
|
39
|
-
s = new WeakMap(),
|
40
|
-
let l =
|
41
|
-
|
42
|
-
|
39
|
+
s = new WeakMap(), d.styles = [_, z];
|
40
|
+
let l = d;
|
41
|
+
c([
|
42
|
+
n({ reflect: !0, attribute: "aria-label" })
|
43
43
|
], l.prototype, "ariaLabel");
|
44
|
-
|
45
|
-
|
44
|
+
c([
|
45
|
+
n({ type: Boolean })
|
46
46
|
], l.prototype, "invert");
|
47
|
-
|
48
|
-
|
47
|
+
c([
|
48
|
+
n({ type: String, reflect: !0 })
|
49
49
|
], l.prototype, "size");
|
50
50
|
export {
|
51
51
|
l as SkfLoader
|