@skf-design-system/ui-components 1.0.2-beta.17 → 1.0.2-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/icon/icon.component.d.ts +3 -1
- package/dist/components/icon/icon.component.js +20 -20
- package/dist/components/icon/icon.styles.js +9 -2
- package/dist/components/input/input.component.d.ts +6 -10
- package/dist/components/input/input.component.js +89 -85
- package/dist/components/logo/logo.component.js +26 -26
- package/dist/components/pagination/pagination.component.d.ts +40 -0
- package/dist/components/pagination/pagination.component.js +101 -0
- package/dist/components/pagination/pagination.d.ts +8 -0
- package/dist/components/pagination/pagination.js +6 -0
- package/dist/components/pagination/pagination.styles.d.ts +1 -0
- package/dist/components/pagination/pagination.styles.js +50 -0
- package/dist/components/segmented-button/segmented-button.component.d.ts +2 -0
- package/dist/components/segmented-button/segmented-button.component.js +22 -18
- package/dist/components/select/select.component.d.ts +3 -6
- package/dist/components/select/select.component.js +17 -20
- package/dist/components/stepper/stepper-item.component.d.ts +8 -0
- package/dist/components/stepper/stepper-item.component.js +95 -61
- package/dist/components/stepper/stepper-item.styles.d.ts +1 -1
- package/dist/components/stepper/stepper-item.styles.js +83 -79
- package/dist/components/stepper/stepper.component.d.ts +3 -0
- package/dist/components/stepper/stepper.component.js +50 -37
- package/dist/components/textarea/textarea.component.d.ts +6 -4
- package/dist/components/textarea/textarea.component.js +109 -80
- package/dist/components/toast/toast-item.component.js +6 -4
- package/dist/components/toast/toast.component.d.ts +3 -1
- package/dist/custom-elements.json +778 -520
- package/dist/index.d.ts +1 -0
- package/dist/index.js +89 -86
- package/dist/internal/components/formBase.js +5 -5
- package/dist/internal/components/skf-element.js +6 -8
- package/dist/translations/en.js +12 -3
- package/dist/translations/es.js +13 -4
- package/dist/translations/pt.js +11 -2
- package/dist/translations/sv.js +13 -4
- package/dist/types/jsx/custom-element-jsx.d.ts +150 -73
- package/dist/types/vue/index.d.ts +78 -40
- package/dist/utilities/localize.d.ts +9 -0
- package/dist/vscode.html-custom-data.json +96 -59
- package/dist/web-types.json +222 -131
- package/package.json +1 -1
|
@@ -8,6 +8,8 @@ type SkfIconSize = IconSize;
|
|
|
8
8
|
*
|
|
9
9
|
* @documentation See [zeroheight](https://zeroheight.com/*) for design principles
|
|
10
10
|
*
|
|
11
|
+
* @slot - A custom svg icon. **Notice** Make sure that viewBox is set to `0 0 24 24.
|
|
12
|
+
*
|
|
11
13
|
* @tagname skf-icon
|
|
12
14
|
*/
|
|
13
15
|
export declare class SkfIcon extends SkfElement {
|
|
@@ -18,7 +20,7 @@ export declare class SkfIcon extends SkfElement {
|
|
|
18
20
|
/** If defined, adds an alternate description to use for assistive devices */
|
|
19
21
|
label?: string;
|
|
20
22
|
/** Name of the icon to display */
|
|
21
|
-
name
|
|
23
|
+
name?: Icon;
|
|
22
24
|
/** Size of the icon */
|
|
23
25
|
size: SkfIconSize;
|
|
24
26
|
connectedCallback(): void;
|
|
@@ -3,15 +3,15 @@ var u = (t) => {
|
|
|
3
3
|
};
|
|
4
4
|
var g = (t, e, r) => e.has(t) || u("Cannot " + r);
|
|
5
5
|
var c = (t, e, r) => (g(t, e, "read from private field"), r ? r.call(t) : e.get(t)), y = (t, e, r) => e.has(t) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), d = (t, e, r, o) => (g(t, e, "write to private field"), o ? o.call(t, r) : e.set(t, r), r);
|
|
6
|
-
import { SkfElement as
|
|
7
|
-
import { stateMap as
|
|
8
|
-
import { watch as
|
|
9
|
-
import { ICONS as
|
|
10
|
-
import { componentStyles as
|
|
11
|
-
import { html as
|
|
6
|
+
import { SkfElement as b } from "../../internal/components/skf-element.js";
|
|
7
|
+
import { stateMap as _ } from "../../internal/helpers/stateMap.js";
|
|
8
|
+
import { watch as S } from "../../internal/helpers/watch.js";
|
|
9
|
+
import { ICONS as C } from "@skf-design-system/ui-assets";
|
|
10
|
+
import { componentStyles as z } from "../../styles/component.styles.js";
|
|
11
|
+
import { html as v } from "lit";
|
|
12
12
|
import { property as n } from "lit/decorators.js";
|
|
13
13
|
import { styles as O } from "./icon.styles.js";
|
|
14
|
-
var w = Object.defineProperty, P = Object.getOwnPropertyDescriptor,
|
|
14
|
+
var w = Object.defineProperty, P = Object.getOwnPropertyDescriptor, p = (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
17
|
return o && s && w(e, r, s), s;
|
|
@@ -30,40 +30,40 @@ const x = {
|
|
|
30
30
|
],
|
|
31
31
|
size: ["lg", "md", "sm", "xs"]
|
|
32
32
|
};
|
|
33
|
-
var a,
|
|
34
|
-
const f = class f extends
|
|
33
|
+
var a, l;
|
|
34
|
+
const f = class f extends b {
|
|
35
35
|
constructor() {
|
|
36
36
|
super(...arguments);
|
|
37
37
|
y(this, a);
|
|
38
|
-
y(this,
|
|
39
|
-
d(this, a, this.attachInternals()), d(this,
|
|
38
|
+
y(this, l);
|
|
39
|
+
d(this, a, this.attachInternals()), d(this, l, c(this, a).states), this.color = "primary", this.size = "md";
|
|
40
40
|
}
|
|
41
41
|
connectedCallback() {
|
|
42
42
|
super.connectedCallback(), this.ariaHidden = this.label ? null : "true", this.ariaLabel = this.label ?? null, this.role = this.label ? "img" : null;
|
|
43
43
|
}
|
|
44
44
|
_handleStateChange(r, o, s) {
|
|
45
|
-
|
|
45
|
+
_(c(this, l), x[r]).set(s);
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return
|
|
48
|
+
return v`<div id="root">${this.name ? C[this.name] : v`<slot></slot>`}</div>`;
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
a = new WeakMap(),
|
|
51
|
+
a = new WeakMap(), l = new WeakMap(), f.styles = [z, O];
|
|
52
52
|
let i = f;
|
|
53
|
-
|
|
53
|
+
p([
|
|
54
54
|
n({ type: String })
|
|
55
55
|
], i.prototype, "color", 2);
|
|
56
|
-
|
|
56
|
+
p([
|
|
57
57
|
n({ type: String })
|
|
58
58
|
], i.prototype, "label", 2);
|
|
59
|
-
|
|
59
|
+
p([
|
|
60
60
|
n({ type: String })
|
|
61
61
|
], i.prototype, "name", 2);
|
|
62
|
-
|
|
62
|
+
p([
|
|
63
63
|
n({ type: String })
|
|
64
64
|
], i.prototype, "size", 2);
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
p([
|
|
66
|
+
S(["color", "size"])
|
|
67
67
|
], i.prototype, "_handleStateChange", 1);
|
|
68
68
|
export {
|
|
69
69
|
i as SkfIcon
|
|
@@ -3,7 +3,7 @@ const r = o`
|
|
|
3
3
|
@layer components {
|
|
4
4
|
@layer base {
|
|
5
5
|
:host {
|
|
6
|
-
display: inline-
|
|
6
|
+
display: inline-block;
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
user-select: none;
|
|
9
9
|
}
|
|
@@ -13,13 +13,20 @@ const r = o`
|
|
|
13
13
|
--_skf-icon-size: var(--skf-icon-size-md);
|
|
14
14
|
|
|
15
15
|
block-size: var(--_skf-icon-size);
|
|
16
|
-
flex-shrink: 0; /* Prevents shrink when flex-child */
|
|
17
16
|
inline-size: var(--_skf-icon-size);
|
|
18
17
|
|
|
19
18
|
:host(:not([data-color='custom'])) & {
|
|
20
19
|
color: var(--_skf-icon-color);
|
|
21
20
|
}
|
|
22
21
|
}
|
|
22
|
+
|
|
23
|
+
svg,
|
|
24
|
+
::slotted(svg) {
|
|
25
|
+
block-size: 100%;
|
|
26
|
+
display: block;
|
|
27
|
+
fill: currentcolor;
|
|
28
|
+
inline-size: 100%;
|
|
29
|
+
}
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
@layer mods {
|
|
@@ -28,8 +28,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
|
28
28
|
#private;
|
|
29
29
|
static styles: CSSResultGroup;
|
|
30
30
|
private customError;
|
|
31
|
-
/** @internal intermediary value for reset to function, e.g value attribute act as default value */
|
|
32
|
-
private _value;
|
|
33
31
|
/**
|
|
34
32
|
* Indicates whether the value of the control can be automatically completed by the browser. See
|
|
35
33
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/autocomplete) for details.
|
|
@@ -45,6 +43,8 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
|
45
43
|
hideLabel: boolean;
|
|
46
44
|
/** If defined, displays informational text below the field */
|
|
47
45
|
hint?: string;
|
|
46
|
+
/** @internal - true if the internal state is invalid. Only internal use */
|
|
47
|
+
invalid: boolean;
|
|
48
48
|
/**
|
|
49
49
|
* Provides a hint about the type of data that might be entered by the user while editing the element or its contents. See
|
|
50
50
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inputMode) for details.
|
|
@@ -85,11 +85,7 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
|
85
85
|
/** Sets validation start */
|
|
86
86
|
validateOn: 'input' | 'change' | 'submit';
|
|
87
87
|
/** The current value of the input field */
|
|
88
|
-
|
|
89
|
-
get value(): string;
|
|
90
|
-
/** @internal */
|
|
91
|
-
/** true if the internal state is invalid */
|
|
92
|
-
invalid: boolean;
|
|
88
|
+
value: string;
|
|
93
89
|
/** @internal */
|
|
94
90
|
private _buttonDown;
|
|
95
91
|
/** @internal */
|
|
@@ -101,10 +97,10 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
|
101
97
|
/** @internal */
|
|
102
98
|
private _passwordController;
|
|
103
99
|
firstUpdated(): void;
|
|
104
|
-
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
105
|
-
/** @internal */
|
|
106
|
-
valueChanged(): void;
|
|
107
100
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
101
|
+
_invalidChanged(): void;
|
|
102
|
+
_valueChanged(): void;
|
|
103
|
+
_hintChanged(): void;
|
|
108
104
|
/** @internal */
|
|
109
105
|
_handleInput: () => void;
|
|
110
106
|
/** @internal */
|
|
@@ -1,44 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var $ = (r) => {
|
|
2
|
+
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var w = (r, n, t) => n.has(r) || $("Cannot " + t);
|
|
5
|
+
var d = (r, n, t) => (w(r, n, "read from private field"), t ? t.call(r) : n.get(r)), b = (r, n, t) => n.has(r) ? $("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(r) : n.set(r, t), v = (r, n, t, a) => (w(r, n, "write to private field"), a ? a.call(r, t) : n.set(r, t), t);
|
|
6
6
|
import "../icon/icon.js";
|
|
7
|
-
import { FormBase as
|
|
7
|
+
import { FormBase as E } from "../../internal/components/formBase.js";
|
|
8
8
|
import "../../internal/components/hint/hint.js";
|
|
9
|
-
import { hintSeverity as
|
|
10
|
-
import { watch as
|
|
11
|
-
import { Asterisk as
|
|
9
|
+
import { hintSeverity as S } from "../../internal/helpers/hintSeverity.js";
|
|
10
|
+
import { watch as _ } from "../../internal/helpers/watch.js";
|
|
11
|
+
import { Asterisk as C } from "../../internal/templates/asterisk.js";
|
|
12
12
|
import { componentStyles as P } from "../../styles/component.styles.js";
|
|
13
|
-
import { LocalizeController as
|
|
14
|
-
import { html as
|
|
15
|
-
import {
|
|
13
|
+
import { LocalizeController as k } from "../../utilities/localize.js";
|
|
14
|
+
import { html as c, nothing as m } from "lit";
|
|
15
|
+
import { property as s, state as B, query as x, queryAssignedNodes as V } from "lit/decorators.js";
|
|
16
16
|
import { ifDefined as l } from "lit/directives/if-defined.js";
|
|
17
|
-
import { live as
|
|
18
|
-
import { InputNumberController as
|
|
19
|
-
import
|
|
20
|
-
var
|
|
21
|
-
for (var o =
|
|
22
|
-
(
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
const
|
|
17
|
+
import { live as L } from "lit/directives/live.js";
|
|
18
|
+
import { InputNumberController as D, InputPasswordController as I } from "./input.controllers.js";
|
|
19
|
+
import A from "./input.styles.js";
|
|
20
|
+
var N = Object.defineProperty, O = Object.getOwnPropertyDescriptor, e = (r, n, t, a) => {
|
|
21
|
+
for (var o = a > 1 ? void 0 : a ? O(n, t) : n, h = r.length - 1, p; h >= 0; h--)
|
|
22
|
+
(p = r[h]) && (o = (a ? p(n, t, o) : p(o)) || o);
|
|
23
|
+
return a && o && N(n, t, o), o;
|
|
24
|
+
}, u, f, y;
|
|
25
|
+
const g = class g extends E {
|
|
26
26
|
constructor() {
|
|
27
27
|
super(...arguments);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
b(this, u);
|
|
29
|
+
/** @internal intermediary value for reset to function, e.g value attribute act as default value */
|
|
30
|
+
b(this, f);
|
|
31
|
+
/** @internal */
|
|
32
|
+
b(this, y);
|
|
33
|
+
v(this, u, new k(this)), this.autofocus = !1, this.debug = !1, this.hideLabel = !1, this.invalid = !1, this.inputmode = "text", this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this._buttonDown = !1, this._numberController = new D(this), this._passwordController = new I(this), this._handleInput = () => {
|
|
34
|
+
this.value = this.$input?.value ?? "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
|
31
35
|
}, this._resetValue = (t) => {
|
|
32
|
-
t.stopPropagation(), this.value = this
|
|
36
|
+
t.stopPropagation(), this.value = d(this, f) ?? "", this._internals.setFormValue(this.value), this.emit("cleared");
|
|
33
37
|
}, this._handlePressStart = (t) => {
|
|
34
38
|
this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(t);
|
|
35
39
|
}, this._handlePressEnd = () => {
|
|
36
40
|
this._buttonDown = !1, this.type === "number" && this._numberController.handleActionBtnLongPressEnd();
|
|
37
|
-
}, this._renderNumberButton = (t) =>
|
|
41
|
+
}, this._renderNumberButton = (t) => c`
|
|
38
42
|
<button
|
|
39
43
|
?disabled=${this.disabled}
|
|
40
|
-
@click=${(
|
|
41
|
-
this._numberController.handleActionBtnClick(
|
|
44
|
+
@click=${(a) => {
|
|
45
|
+
this._numberController.handleActionBtnClick(a, t);
|
|
42
46
|
}}
|
|
43
47
|
@mousedown=${this._handlePressStart}
|
|
44
48
|
@mouseup=${this._handlePressEnd}
|
|
@@ -49,10 +53,10 @@ const y = class y extends g {
|
|
|
49
53
|
>
|
|
50
54
|
<skf-icon name="${t === "inc" ? "chevronUp" : "chevronDown"}" size="sm"></skf-icon>
|
|
51
55
|
</button>
|
|
52
|
-
`, this._renderPasswordButton = () =>
|
|
56
|
+
`, this._renderPasswordButton = () => c`
|
|
53
57
|
<button
|
|
54
58
|
@click=${this._passwordController.toggleVisibility}
|
|
55
|
-
aria-label=${this._passwordController._type === "password" ?
|
|
59
|
+
aria-label=${this._passwordController._type === "password" ? d(this, u).term("showPassword") : d(this, u).term("hidePassword")}
|
|
56
60
|
class="password skf-icon-host"
|
|
57
61
|
type="button"
|
|
58
62
|
@mousedown="${this._handlePressStart}"
|
|
@@ -61,13 +65,13 @@ const y = class y extends g {
|
|
|
61
65
|
>
|
|
62
66
|
<skf-icon name=${this._passwordController._icon} size="sm"></skf-icon>
|
|
63
67
|
</button>
|
|
64
|
-
`, this._renderSearchButton = () =>
|
|
68
|
+
`, this._renderSearchButton = () => c`
|
|
65
69
|
<button
|
|
66
70
|
@click=${this._resetValue}
|
|
67
71
|
@mousedown=${this._handlePressStart}
|
|
68
72
|
@mouseup=${this._handlePressEnd}
|
|
69
73
|
@mouseleave=${this._handlePressEnd}
|
|
70
|
-
aria-label=${
|
|
74
|
+
aria-label=${d(this, u).term("clearEntry")}
|
|
71
75
|
class="search skf-icon-host"
|
|
72
76
|
type="button"
|
|
73
77
|
>
|
|
@@ -83,38 +87,35 @@ const y = class y extends g {
|
|
|
83
87
|
get customInvalid() {
|
|
84
88
|
return this.customError;
|
|
85
89
|
}
|
|
86
|
-
set value(t) {
|
|
87
|
-
this.$input && (this.$input.value = t, this._value = t, this._internals.setFormValue(t), this.validateInput());
|
|
88
|
-
}
|
|
89
|
-
get value() {
|
|
90
|
-
return this.$input?.value ?? "";
|
|
91
|
-
}
|
|
92
90
|
firstUpdated() {
|
|
93
91
|
this.$input?.addEventListener("change", () => {
|
|
94
92
|
this.validateOn === "change" && (this.validateOn = "input", this._pristine = !1), this._internals.setFormValue(this.$input?.value ?? ""), this.emit("change"), this.validateInput();
|
|
95
93
|
}), this.addEventListener("invalid", (t) => {
|
|
96
94
|
this._pristine = !1, this.invalid = !0, this.customErrorDisplay && t.preventDefault();
|
|
97
|
-
}), this.
|
|
98
|
-
}
|
|
99
|
-
willUpdate(t) {
|
|
100
|
-
if (t.has("invalid"))
|
|
101
|
-
if (this.invalid) {
|
|
102
|
-
this.setAttribute("invalid", ""), this.showValid || this.removeAttribute("valid");
|
|
103
|
-
const r = this._internals.validationMessage;
|
|
104
|
-
this.hint = r !== "" ? this._internals.validationMessage : "", this.checkValidity();
|
|
105
|
-
} else
|
|
106
|
-
this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
|
|
95
|
+
}), this.autofocus && this.$input?.focus(), this.addEventListener("reset", this._resetValue), this.validateInput();
|
|
107
96
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
attributeChangedCallback(t, r, o) {
|
|
112
|
-
if (super.attributeChangedCallback(t, r, o), t === "value" && this._internals.setFormValue(o), t === "custom-invalid")
|
|
97
|
+
attributeChangedCallback(t, a, o) {
|
|
98
|
+
if (super.attributeChangedCallback(t, a, o), t === "custom-invalid")
|
|
113
99
|
if (typeof o == "string") {
|
|
114
|
-
const
|
|
115
|
-
this._pristine = !1, this._internals.setValidity({ customError: !0 },
|
|
100
|
+
const p = this.withFallback(o);
|
|
101
|
+
this._pristine = !1, this._internals.setValidity({ customError: !0 }, p), this.invalid = !0, this.hint = p, this.checkValidity();
|
|
116
102
|
} else
|
|
117
103
|
this._internals.setValidity({}), this.validateInput();
|
|
104
|
+
t === "hint" && v(this, y, this.getAttribute("hint") ?? "");
|
|
105
|
+
}
|
|
106
|
+
_invalidChanged() {
|
|
107
|
+
if (this.invalid) {
|
|
108
|
+
this.showValid || this.removeAttribute("valid");
|
|
109
|
+
const t = this._internals.validationMessage;
|
|
110
|
+
this.hint = t !== "" ? this._internals.validationMessage : "", this.checkValidity();
|
|
111
|
+
} else
|
|
112
|
+
!this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = d(this, y) ?? "";
|
|
113
|
+
}
|
|
114
|
+
_valueChanged() {
|
|
115
|
+
d(this, f) ?? v(this, f, this.value), this._internals.setFormValue(this.value), this.validateInput();
|
|
116
|
+
}
|
|
117
|
+
_hintChanged() {
|
|
118
|
+
d(this, y) ?? v(this, y, this.hint);
|
|
118
119
|
}
|
|
119
120
|
focus() {
|
|
120
121
|
this.$input?.focus();
|
|
@@ -128,22 +129,22 @@ const y = class y extends g {
|
|
|
128
129
|
/** @internal */
|
|
129
130
|
validateInput() {
|
|
130
131
|
if (this._internals.validity.customError || !this.$input) return;
|
|
131
|
-
const
|
|
132
|
-
if (this.invalid = !1,
|
|
132
|
+
const a = this.$input.validity;
|
|
133
|
+
if (this.invalid = !1, a.valid)
|
|
133
134
|
this._internals.setValidity({ customError: this._internals.validity.customError });
|
|
134
135
|
else {
|
|
135
|
-
this.invalid = !this._pristine && !
|
|
136
|
+
this.invalid = !this._pristine && !a.valid;
|
|
136
137
|
let o;
|
|
137
|
-
for (o in
|
|
138
|
+
for (o in a) {
|
|
138
139
|
const h = `data-${o}`;
|
|
139
|
-
if (
|
|
140
|
+
if (a[o] && !this.hasAttribute(h) && this.debug && console.log(
|
|
140
141
|
`Add custom message on ${this.localName} using attribute: ${h.toUpperCase()}="Your custom message"`
|
|
141
|
-
),
|
|
142
|
+
), a[o]) {
|
|
142
143
|
this.validationError = o;
|
|
143
|
-
const
|
|
144
|
+
const p = this.hasAttribute(h) ? this.getAttribute(h) : this.$input.validationMessage;
|
|
144
145
|
this._internals.setValidity(
|
|
145
146
|
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
|
146
|
-
this.withFallback(
|
|
147
|
+
this.withFallback(p)
|
|
147
148
|
), this.invalid && this.customErrorDisplay && this.checkValidity();
|
|
148
149
|
}
|
|
149
150
|
}
|
|
@@ -151,15 +152,15 @@ const y = class y extends g {
|
|
|
151
152
|
}
|
|
152
153
|
render() {
|
|
153
154
|
const t = (this._defaultSlot.length === 0 || !this._defaultSlot[0]?.textContent?.trim()) && !this.label;
|
|
154
|
-
return
|
|
155
|
+
return c`
|
|
155
156
|
<div id="root">
|
|
156
157
|
<label>
|
|
157
158
|
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${t} id="label">
|
|
158
159
|
<slot>${this.label}</slot>
|
|
159
|
-
${this.required ?
|
|
160
|
+
${this.required ? C(d(this, u).term("required")) : m}
|
|
160
161
|
</div>
|
|
161
162
|
<div id="input">
|
|
162
|
-
${this.type === "search" ?
|
|
163
|
+
${this.type === "search" ? c`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : m}
|
|
163
164
|
<div
|
|
164
165
|
data-leading=${l(this.leading)}
|
|
165
166
|
data-trailing=${l(this.trailing)}
|
|
@@ -170,7 +171,7 @@ const y = class y extends g {
|
|
|
170
171
|
?readonly=${this.readonly}
|
|
171
172
|
?required=${this.required}
|
|
172
173
|
.autocomplete=${this.autocomplete ?? "off"}
|
|
173
|
-
.value=${
|
|
174
|
+
.value=${L(this.value)}
|
|
174
175
|
@blur=${this._onBlur}
|
|
175
176
|
@input=${this._handleInput}
|
|
176
177
|
aria-describedby=${l(this.hint?.trim() ? "hint" : m)}
|
|
@@ -190,21 +191,21 @@ const y = class y extends g {
|
|
|
190
191
|
)}
|
|
191
192
|
/>
|
|
192
193
|
</div>
|
|
193
|
-
${this.type === "number" ?
|
|
194
|
+
${this.type === "number" ? c`
|
|
194
195
|
<div id="action">
|
|
195
196
|
${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
|
|
196
197
|
</div>
|
|
197
198
|
` : m}
|
|
198
199
|
${this.type === "password" ? this._renderPasswordButton() : m}
|
|
199
|
-
${this.type === "search" && this.
|
|
200
|
+
${this.type === "search" && this.value.length > 0 ? this._renderSearchButton() : m}
|
|
200
201
|
</div>
|
|
201
202
|
</label>
|
|
202
|
-
${this.hint &&
|
|
203
|
+
${this.hint && c`
|
|
203
204
|
<skf-hint
|
|
204
205
|
?disabled=${this.disabled}
|
|
205
206
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
|
206
207
|
id="hint"
|
|
207
|
-
severity=${l(
|
|
208
|
+
severity=${l(S(this.invalid, this.severity))}
|
|
208
209
|
>${this.customInvalid ?? this.hint}
|
|
209
210
|
</skf-hint>
|
|
210
211
|
`}
|
|
@@ -212,11 +213,8 @@ const y = class y extends g {
|
|
|
212
213
|
`;
|
|
213
214
|
}
|
|
214
215
|
};
|
|
215
|
-
|
|
216
|
-
let i =
|
|
217
|
-
e([
|
|
218
|
-
v()
|
|
219
|
-
], i.prototype, "_value", 2);
|
|
216
|
+
u = new WeakMap(), f = new WeakMap(), y = new WeakMap(), g.styles = [P, A];
|
|
217
|
+
let i = g;
|
|
220
218
|
e([
|
|
221
219
|
s()
|
|
222
220
|
], i.prototype, "autocomplete", 2);
|
|
@@ -235,6 +233,9 @@ e([
|
|
|
235
233
|
e([
|
|
236
234
|
s({ type: String })
|
|
237
235
|
], i.prototype, "hint", 2);
|
|
236
|
+
e([
|
|
237
|
+
s({ type: Boolean, reflect: !0 })
|
|
238
|
+
], i.prototype, "invalid", 2);
|
|
238
239
|
e([
|
|
239
240
|
s({ type: String })
|
|
240
241
|
], i.prototype, "inputmode", 2);
|
|
@@ -290,23 +291,26 @@ e([
|
|
|
290
291
|
s({ type: String, attribute: "validate-on" })
|
|
291
292
|
], i.prototype, "validateOn", 2);
|
|
292
293
|
e([
|
|
293
|
-
s({ type: String })
|
|
294
|
-
], i.prototype, "value",
|
|
295
|
-
e([
|
|
296
|
-
v()
|
|
297
|
-
], i.prototype, "invalid", 2);
|
|
294
|
+
s({ type: String, reflect: !1 })
|
|
295
|
+
], i.prototype, "value", 2);
|
|
298
296
|
e([
|
|
299
|
-
|
|
297
|
+
B()
|
|
300
298
|
], i.prototype, "_buttonDown", 2);
|
|
301
299
|
e([
|
|
302
|
-
|
|
300
|
+
x("input")
|
|
303
301
|
], i.prototype, "$input", 2);
|
|
304
302
|
e([
|
|
305
|
-
|
|
303
|
+
V({ flatten: !0 })
|
|
306
304
|
], i.prototype, "_defaultSlot", 2);
|
|
307
305
|
e([
|
|
308
|
-
|
|
309
|
-
], i.prototype, "
|
|
306
|
+
_("invalid")
|
|
307
|
+
], i.prototype, "_invalidChanged", 1);
|
|
308
|
+
e([
|
|
309
|
+
_("value", { waitUntilFirstUpdate: !0 })
|
|
310
|
+
], i.prototype, "_valueChanged", 1);
|
|
311
|
+
e([
|
|
312
|
+
_("hint")
|
|
313
|
+
], i.prototype, "_hintChanged", 1);
|
|
310
314
|
export {
|
|
311
315
|
i as SkfInput
|
|
312
316
|
};
|
|
@@ -3,33 +3,33 @@ var f = (c) => {
|
|
|
3
3
|
};
|
|
4
4
|
var g = (c, t, r) => t.has(c) || f("Cannot " + r);
|
|
5
5
|
var a = (c, t, r) => (g(c, t, "read from private field"), r ? r.call(c) : t.get(c)), v = (c, t, r) => t.has(c) ? f("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(c) : t.set(c, r), n = (c, t, r, e) => (g(c, t, "write to private field"), e ? e.call(c, r) : t.set(c, r), r);
|
|
6
|
-
import { SkfElement as
|
|
7
|
-
import { stateMap as
|
|
8
|
-
import { watch as
|
|
9
|
-
import { componentStyles as
|
|
10
|
-
import { html as
|
|
11
|
-
import { property as
|
|
12
|
-
import { styles as
|
|
13
|
-
var
|
|
14
|
-
for (var s = e > 1 ? void 0 : e ?
|
|
6
|
+
import { SkfElement as H } from "../../internal/components/skf-element.js";
|
|
7
|
+
import { stateMap as M } from "../../internal/helpers/stateMap.js";
|
|
8
|
+
import { watch as V } from "../../internal/helpers/watch.js";
|
|
9
|
+
import { componentStyles as x } from "../../styles/component.styles.js";
|
|
10
|
+
import { nothing as z, html as d } from "lit";
|
|
11
|
+
import { property as w } from "lit/decorators.js";
|
|
12
|
+
import { styles as C } from "./logo.styles.js";
|
|
13
|
+
var _ = Object.defineProperty, u = Object.getOwnPropertyDescriptor, m = (c, t, r, e) => {
|
|
14
|
+
for (var s = e > 1 ? void 0 : e ? u(t, r) : t, i = c.length - 1, l; i >= 0; i--)
|
|
15
15
|
(l = c[i]) && (s = (e ? l(t, r, s) : l(s)) || s);
|
|
16
|
-
return e && s &&
|
|
17
|
-
},
|
|
18
|
-
const y = class y extends
|
|
16
|
+
return e && s && _(t, r, s), s;
|
|
17
|
+
}, o, p;
|
|
18
|
+
const y = class y extends H {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
|
-
v(this,
|
|
21
|
+
v(this, o);
|
|
22
22
|
v(this, p);
|
|
23
|
-
n(this,
|
|
23
|
+
n(this, o, this.attachInternals()), n(this, p, a(this, o).states), this.title = "", this.color = "primary";
|
|
24
24
|
}
|
|
25
25
|
_handleStateChange() {
|
|
26
26
|
const r = ["inverse", "primary", "secondary"];
|
|
27
|
-
|
|
27
|
+
M(a(this, p), r).set(this.color);
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return
|
|
30
|
+
return d`
|
|
31
31
|
<svg id="root" viewBox="0 0 1300 300" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px">
|
|
32
|
-
|
|
32
|
+
${this.title ? d`<title>${this.title}</title>` : z}
|
|
33
33
|
<g>
|
|
34
34
|
<path
|
|
35
35
|
d="M363.7,300c6.2,0,11.2-5,11.2-11.3v-165c0-6.2-5-11.3-11.3-11.2H157.5c-4.1,0-7.5-3.4-7.5-7.5V45
|
|
@@ -67,17 +67,17 @@ const y = class y extends w {
|
|
|
67
67
|
`;
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
|
|
71
|
-
let
|
|
70
|
+
o = new WeakMap(), p = new WeakMap(), y.styles = [x, C];
|
|
71
|
+
let h = y;
|
|
72
72
|
m([
|
|
73
|
-
|
|
74
|
-
],
|
|
73
|
+
w({ type: String })
|
|
74
|
+
], h.prototype, "title", 2);
|
|
75
75
|
m([
|
|
76
|
-
|
|
77
|
-
],
|
|
76
|
+
w({ type: String })
|
|
77
|
+
], h.prototype, "color", 2);
|
|
78
78
|
m([
|
|
79
|
-
|
|
80
|
-
],
|
|
79
|
+
V("color")
|
|
80
|
+
], h.prototype, "_handleStateChange", 1);
|
|
81
81
|
export {
|
|
82
|
-
|
|
82
|
+
h as SkfLogo
|
|
83
83
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import '../icon/icon.js';
|
|
2
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
|
3
|
+
import { type Language } from '../../utilities/localize.js';
|
|
4
|
+
import { type CSSResultGroup } from 'lit';
|
|
5
|
+
/**
|
|
6
|
+
* The `<skf-pagination>` is a component that displays a list of actions or options
|
|
7
|
+
*
|
|
8
|
+
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
|
9
|
+
*
|
|
10
|
+
* @tagname skf-pagination
|
|
11
|
+
*/
|
|
12
|
+
export declare class SkfPagination extends SkfElement {
|
|
13
|
+
#private;
|
|
14
|
+
static styles: CSSResultGroup;
|
|
15
|
+
/** The number of items to display on each 'page' */
|
|
16
|
+
itemsPerPage: number;
|
|
17
|
+
/** Sets the internal language of the component */
|
|
18
|
+
lang: Language;
|
|
19
|
+
/** If true, hides both the delimiter and the total value */
|
|
20
|
+
noTotal: boolean;
|
|
21
|
+
/** The active page number. */
|
|
22
|
+
page: number;
|
|
23
|
+
/** The total number of items being paginated. */
|
|
24
|
+
total: number;
|
|
25
|
+
/** @internal Event that triggers when user selects previous or next page. Fires 'change' event. */
|
|
26
|
+
_handlePageChange(page: number): void;
|
|
27
|
+
/** @internal */
|
|
28
|
+
private _getPageStart;
|
|
29
|
+
/** @internal */
|
|
30
|
+
private _getPageEnd;
|
|
31
|
+
/** @internal */
|
|
32
|
+
private get _disabledNext();
|
|
33
|
+
/** @internal */
|
|
34
|
+
private get disabledPrev();
|
|
35
|
+
/** @internal */
|
|
36
|
+
private _handlePrev;
|
|
37
|
+
/** @internal */
|
|
38
|
+
private _handleNext;
|
|
39
|
+
render(): import("lit").TemplateResult<1>;
|
|
40
|
+
}
|