@skf-design-system/ui-components 1.0.0-beta.3 → 1.0.0-beta.4
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/accordion/accordion.component.d.ts +5 -9
- package/dist/components/accordion/accordion.component.js +19 -22
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordion.styles.js +3 -3
- package/dist/components/alert/alert.component.d.ts +4 -7
- package/dist/components/alert/alert.component.js +1 -1
- package/dist/components/alert/alert.styles.js +1 -1
- package/dist/components/button/button.component.js +1 -1
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/card/card.component.d.ts +3 -3
- package/dist/components/card/card.component.js +19 -16
- package/dist/components/card/card.styles.js +3 -11
- package/dist/components/checkbox/checkbox.component.d.ts +6 -9
- package/dist/components/checkbox/checkbox.component.js +7 -7
- package/dist/components/checkbox/checkbox.styles.js +1 -1
- package/dist/components/collapse/collapse.component.d.ts +6 -9
- package/dist/components/collapse/collapse.component.js +36 -39
- package/dist/components/collapse/collapse.styles.js +3 -3
- package/dist/components/divider/divider.component.d.ts +10 -13
- package/dist/components/divider/divider.component.js +29 -34
- package/dist/components/divider/divider.styles.js +5 -1
- package/dist/components/heading/heading.component.d.ts +2 -12
- package/dist/components/heading/heading.component.js +14 -14
- package/dist/components/heading/heading.styles.js +1 -1
- package/dist/components/icon/icon.component.d.ts +8 -14
- package/dist/components/icon/icon.component.js +6 -6
- package/dist/components/icon/icon.styles.js +1 -1
- package/dist/components/input/input.component.d.ts +29 -34
- package/dist/components/input/input.component.js +16 -18
- package/dist/components/link/link.component.d.ts +12 -15
- package/dist/components/link/link.component.js +7 -7
- package/dist/components/link/link.styles.js +1 -1
- package/dist/components/loader/loader.component.d.ts +7 -7
- package/dist/components/loader/loader.component.js +61 -35
- package/dist/components/loader/loader.styles.js +10 -42
- package/dist/components/logo/logo.component.d.ts +3 -5
- package/dist/components/logo/logo.component.js +8 -8
- package/dist/components/logo/logo.styles.js +2 -2
- package/dist/components/radio/radio.component.d.ts +13 -15
- package/dist/components/radio/radio.component.js +3 -3
- package/dist/components/radio/radio.styles.js +3 -3
- package/dist/components/select/select.component.d.ts +8 -7
- package/dist/components/select/select.component.js +20 -20
- package/dist/components/select/select.styles.js +3 -3
- package/dist/components/switch/switch.component.d.ts +3 -2
- package/dist/components/switch/switch.component.js +1 -1
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/tag/tag.component.d.ts +7 -12
- package/dist/components/tag/tag.component.js +24 -24
- package/dist/components/tag/tag.styles.js +1 -6
- package/dist/components/textarea/textarea.component.d.ts +23 -26
- package/dist/components/textarea/textarea.component.js +12 -15
- package/dist/custom-elements.json +221 -221
- package/dist/internal/storybook/shadowRootTraverser.d.ts +8 -16
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +3 -3
- package/dist/styles/form-field.styles.js +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +47 -47
- package/dist/types/vue/index.d.ts +49 -49
- package/dist/vscode.html-custom-data.json +61 -61
- package/dist/web-types.json +118 -118
- package/package.json +1 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- package/dist/components/collapse/collapse.test.d.ts +0 -1
- package/dist/components/switch/switch.test.d.ts +0 -1
@@ -1,45 +1,71 @@
|
|
1
|
-
var m = (t) => {
|
2
|
-
throw TypeError(t);
|
3
|
-
};
|
4
|
-
var f = (t, r, e) => r.has(t) || m("Cannot " + e);
|
5
|
-
var p = (t, r, e) => (f(t, r, "read from private field"), e ? e.call(t) : r.get(t)), h = (t, r, e) => r.has(t) ? m("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), y = (t, r, e, l) => (f(t, r, "write to private field"), l ? l.call(t, e) : r.set(t, e), e);
|
6
1
|
import { SkfElement as u } from "../../internal/components/skf-element.js";
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import {
|
10
|
-
import
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
2
|
+
import { COLORS as c } from "@skf-design-system/ui-assets";
|
3
|
+
import m from "../../styles/component.styles.js";
|
4
|
+
import { svg as d, html as h } from "lit";
|
5
|
+
import { property as a } from "lit/decorators.js";
|
6
|
+
import v from "./loader.styles.js";
|
7
|
+
var f = Object.defineProperty, o = (l, t, i, g) => {
|
8
|
+
for (var e = void 0, s = l.length - 1, p; s >= 0; s--)
|
9
|
+
(p = l[s]) && (e = p(t, i, e) || e);
|
10
|
+
return e && f(t, i, e), e;
|
11
|
+
};
|
12
|
+
const n = class n extends u {
|
17
13
|
constructor() {
|
18
|
-
super();
|
19
|
-
|
20
|
-
|
14
|
+
super(...arguments), this.ariaLabel = "Loading...", this.invert = !1, this.size = "md";
|
15
|
+
}
|
16
|
+
connectedCallback() {
|
17
|
+
super.connectedCallback(), this.setAttribute("role", "progressbar"), this.setAttribute("aria-live", "polite");
|
18
|
+
}
|
19
|
+
/** @internal */
|
20
|
+
getCircle(t, i) {
|
21
|
+
return d`
|
22
|
+
<circle
|
23
|
+
cx=${t}
|
24
|
+
cy="26"
|
25
|
+
fill=${this.invert ? c.neutralWhite : c.brandBase}
|
26
|
+
key=${t}
|
27
|
+
r="6"
|
28
|
+
stroke="none"
|
29
|
+
>
|
30
|
+
<animate
|
31
|
+
attributeName="opacity"
|
32
|
+
begin=${i}
|
33
|
+
dur="1s"
|
34
|
+
repeatCount="indefinite"
|
35
|
+
values="0;1;0"
|
36
|
+
/>
|
37
|
+
</circle>
|
38
|
+
`;
|
21
39
|
}
|
22
40
|
render() {
|
23
|
-
return
|
24
|
-
<div id="
|
25
|
-
<
|
26
|
-
|
27
|
-
|
41
|
+
return h`
|
42
|
+
<div aria-hidden="true" id="loader">
|
43
|
+
<svg
|
44
|
+
enableBackground="new 0 0 0 0"
|
45
|
+
height="100%"
|
46
|
+
version="1.1"
|
47
|
+
viewBox="0 0 52 52"
|
48
|
+
width="100%"
|
49
|
+
x="0px"
|
50
|
+
y="0px"
|
51
|
+
>
|
52
|
+
${[this.getCircle(6, 0.1), this.getCircle(26, 0.2), this.getCircle(46, 0.3)]}
|
53
|
+
</svg>
|
28
54
|
</div>
|
29
55
|
`;
|
30
56
|
}
|
31
57
|
};
|
32
|
-
|
33
|
-
let
|
34
|
-
|
35
|
-
|
36
|
-
],
|
37
|
-
|
38
|
-
|
39
|
-
],
|
40
|
-
|
41
|
-
|
42
|
-
],
|
58
|
+
n.styles = [m, v];
|
59
|
+
let r = n;
|
60
|
+
o([
|
61
|
+
a({ type: String, reflect: !0, attribute: "aria-label" })
|
62
|
+
], r.prototype, "ariaLabel");
|
63
|
+
o([
|
64
|
+
a({ type: Boolean })
|
65
|
+
], r.prototype, "invert");
|
66
|
+
o([
|
67
|
+
a({ type: String, reflect: !0 })
|
68
|
+
], r.prototype, "size");
|
43
69
|
export {
|
44
|
-
|
70
|
+
r as SkfLoader
|
45
71
|
};
|
@@ -1,50 +1,18 @@
|
|
1
1
|
import { css as s } from "lit";
|
2
|
-
const
|
3
|
-
|
4
|
-
:
|
5
|
-
|
6
|
-
}
|
7
|
-
|
8
|
-
#root {
|
9
|
-
display: flex;
|
10
|
-
gap: var(--_skf-loader-gap, var(--skf-spacing-50));
|
11
|
-
|
12
|
-
:host([size='sm']) & {
|
13
|
-
--_skf-loader-gap: var(--skf-spacing-25);
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
.circle {
|
18
|
-
animation: skf-loader 0.5s infinite ease-in alternate;
|
19
|
-
aspect-ratio: 1;
|
20
|
-
background-color: var(--_skf-loader-color, var(--skf-bg-color-emphasised));
|
21
|
-
border-radius: 50%;
|
22
|
-
inline-size: var(--_skf-loader-size, var(--skf-size-12));
|
23
|
-
|
24
|
-
&:nth-child(2) {
|
25
|
-
animation-delay: 0.1s;
|
26
|
-
}
|
27
|
-
|
28
|
-
&:nth-child(3) {
|
29
|
-
animation-delay: 0.2s;
|
30
|
-
}
|
31
|
-
|
32
|
-
:host([invert]) & {
|
33
|
-
--_skf-loader-color: var(--skf-bg-color-neutral-1);
|
34
|
-
}
|
2
|
+
const a = s`
|
3
|
+
:host {
|
4
|
+
display: inline-flex;
|
5
|
+
}
|
35
6
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
}
|
7
|
+
#loader {
|
8
|
+
aspect-ratio: 1;
|
9
|
+
block-size: var(--_skf-loader-size, var(--skf-size-48));
|
40
10
|
|
41
|
-
|
42
|
-
|
43
|
-
opacity: 0;
|
44
|
-
}
|
11
|
+
:host([size='sm']) & {
|
12
|
+
--_skf-loader-size: var(--skf-size-24);
|
45
13
|
}
|
46
14
|
}
|
47
15
|
`;
|
48
16
|
export {
|
49
|
-
|
17
|
+
a as default
|
50
18
|
};
|
@@ -10,12 +10,10 @@ import { type CSSResultGroup } from 'lit';
|
|
10
10
|
*/
|
11
11
|
export declare class SkfLogo extends SkfElement {
|
12
12
|
static styles: CSSResultGroup;
|
13
|
-
/**
|
13
|
+
/** The title of the logo */
|
14
14
|
title: string;
|
15
|
-
/**
|
16
|
-
|
17
|
-
* @type { "primary" | "secondary" | "inverse" }
|
18
|
-
*/
|
15
|
+
/** If provided, sets color of the logo */
|
16
|
+
/** @type { "primary" | "secondary" | "inverse" } */
|
19
17
|
color?: Logo;
|
20
18
|
render(): import("lit").TemplateResult<1>;
|
21
19
|
}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { SkfElement as i } from "../../internal/components/skf-element.js";
|
2
2
|
import m from "../../styles/component.styles.js";
|
3
3
|
import { html as n } from "lit";
|
4
|
-
import { property as
|
4
|
+
import { property as v } from "lit/decorators.js";
|
5
5
|
import a from "./logo.styles.js";
|
6
|
-
var d = Object.defineProperty, s = (h, o,
|
7
|
-
for (var c = void 0, r = h.length - 1,
|
8
|
-
(
|
9
|
-
return c && d(o,
|
6
|
+
var d = Object.defineProperty, s = (h, o, l, f) => {
|
7
|
+
for (var c = void 0, r = h.length - 1, p; r >= 0; r--)
|
8
|
+
(p = h[r]) && (c = p(o, l, c) || c);
|
9
|
+
return c && d(o, l, c), c;
|
10
10
|
};
|
11
11
|
const e = class e extends i {
|
12
12
|
constructor() {
|
@@ -14,7 +14,7 @@ const e = class e extends i {
|
|
14
14
|
}
|
15
15
|
render() {
|
16
16
|
return n`
|
17
|
-
<svg id="
|
17
|
+
<svg id="logo" viewBox="0 0 1300 300" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px">
|
18
18
|
<title>${this.title}</title>
|
19
19
|
<g>
|
20
20
|
<g>
|
@@ -58,10 +58,10 @@ c0,5.8-4.3,6.1-9.1,6.1H1230.9z"
|
|
58
58
|
e.styles = [m, a];
|
59
59
|
let t = e;
|
60
60
|
s([
|
61
|
-
|
61
|
+
v()
|
62
62
|
], t.prototype, "title");
|
63
63
|
s([
|
64
|
-
|
64
|
+
v()
|
65
65
|
], t.prototype, "color");
|
66
66
|
export {
|
67
67
|
t as SkfLogo
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { css as o } from "lit";
|
2
2
|
const r = o`
|
3
3
|
:host {
|
4
|
-
display:
|
4
|
+
display: contents;
|
5
5
|
}
|
6
6
|
|
7
|
-
#
|
7
|
+
#logo {
|
8
8
|
aspect-ratio: 13 / 3;
|
9
9
|
block-size: var(--skf-logo-height, var(--skf-size-32));
|
10
10
|
fill: var(--_skf-logo-color, var(--skf-logo-primary));
|
@@ -5,42 +5,40 @@ import { type CSSResultGroup } from 'lit';
|
|
5
5
|
/**
|
6
6
|
* The `<skf-radio>` component is used to create a radio input
|
7
7
|
*
|
8
|
-
* @documentation See [
|
8
|
+
* @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
|
9
9
|
*
|
10
10
|
* @attribute {boolean} disabled - If true, sets disabled state
|
11
11
|
* @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
|
12
12
|
*
|
13
13
|
* @event change {object} - When the value of the input changes
|
14
14
|
*
|
15
|
-
* @slot -
|
15
|
+
* @slot Default - Alternatively, you can use the `label` attribute
|
16
16
|
*
|
17
17
|
* @tagname skf-radio
|
18
18
|
*/
|
19
19
|
export declare class SkfRadio extends FormBase implements FormFieldBaseProps {
|
20
20
|
static styles: CSSResultGroup;
|
21
|
+
/** @internal */
|
21
22
|
private _initialChecked;
|
22
|
-
/** If
|
23
|
-
debug?: boolean;
|
23
|
+
/** If provided, outputs helping hints in console */
|
24
|
+
debug?: boolean | undefined;
|
24
25
|
/** If true, outputs helping hints in console */
|
25
26
|
checked?: boolean;
|
26
27
|
/** If true, forces component to invalid state until removed */
|
27
28
|
customInvalid?: boolean;
|
28
29
|
/** If true, hides the label visually */
|
29
|
-
hideLabel
|
30
|
-
/**
|
30
|
+
hideLabel: boolean;
|
31
|
+
/** The input's label. Alternatively, you can use the `label` attribute. */
|
31
32
|
label?: string;
|
32
|
-
/** If
|
33
|
+
/** If provided, adds name to the input-element */
|
33
34
|
name?: string;
|
34
|
-
/** If
|
35
|
+
/** If provided, renders an alternative A11y text for the asterisk */
|
35
36
|
requiredLabel?: string;
|
36
|
-
/**
|
37
|
-
size
|
38
|
-
/**
|
39
|
-
* If defined, displays provided severity state
|
40
|
-
* @type {"success" | "info" | "warning" | "alert"}
|
41
|
-
*/
|
37
|
+
/** If provided, displays an alternative size */
|
38
|
+
size?: 'sm' | 'md';
|
39
|
+
/** If provided, displays provided severity state */
|
42
40
|
severity?: FormFieldBaseProps['severity'];
|
43
|
-
/** If
|
41
|
+
/** If provided, displays valid state after interaction */
|
44
42
|
showValid?: boolean;
|
45
43
|
/** The current value of the input field */
|
46
44
|
value: string;
|
@@ -14,7 +14,7 @@ var k = Object.defineProperty, i = (n, t, r, l) => {
|
|
14
14
|
};
|
15
15
|
const d = class d extends u {
|
16
16
|
constructor() {
|
17
|
-
super(...arguments), this._initialChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (t) => {
|
17
|
+
super(...arguments), this._initialChecked = !1, this.debug = !1, this.hideLabel = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (t) => {
|
18
18
|
t.stopPropagation(), this.checked = this._initialChecked, this.$input && (this.$input.checked = !!this._initialChecked), this.setFormValue(this.checked ? this.value : "");
|
19
19
|
};
|
20
20
|
}
|
@@ -70,7 +70,7 @@ const d = class d extends u {
|
|
70
70
|
}
|
71
71
|
render() {
|
72
72
|
return m`
|
73
|
-
<label id="
|
73
|
+
<label id="radio">
|
74
74
|
<input
|
75
75
|
?disabled=${this.disabled}
|
76
76
|
?required=${this.required}
|
@@ -115,7 +115,7 @@ i([
|
|
115
115
|
a({ reflect: !0 })
|
116
116
|
], e.prototype, "size");
|
117
117
|
i([
|
118
|
-
a()
|
118
|
+
a({ reflect: !0 })
|
119
119
|
], e.prototype, "severity");
|
120
120
|
i([
|
121
121
|
a({ type: Boolean, attribute: "show-valid" })
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { visuallyHidden as r } from "../../styles/util.styles.js";
|
2
2
|
import { css as o } from "lit";
|
3
|
-
const
|
3
|
+
const e = [
|
4
4
|
r,
|
5
5
|
o`
|
6
6
|
@layer components {
|
@@ -8,7 +8,7 @@ const i = [
|
|
8
8
|
contain: initial;
|
9
9
|
}
|
10
10
|
|
11
|
-
#
|
11
|
+
#radio {
|
12
12
|
align-items: center;
|
13
13
|
display: flex;
|
14
14
|
grid-gap: var(--skf-spacing-50);
|
@@ -94,5 +94,5 @@ const i = [
|
|
94
94
|
`
|
95
95
|
];
|
96
96
|
export {
|
97
|
-
|
97
|
+
e as default
|
98
98
|
};
|
@@ -15,9 +15,10 @@ import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationC
|
|
15
15
|
*
|
16
16
|
* @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
|
17
17
|
*
|
18
|
-
* @attribute {
|
18
|
+
* @attribute {Boolean} [disabled] - If true, the select is disabled `default: false`
|
19
19
|
*
|
20
20
|
* @slot - The select's placeholder content
|
21
|
+
* @slot icon - The select's slot for custom meta information
|
21
22
|
*
|
22
23
|
* @event change - Fired when the selected option(s) changes
|
23
24
|
* @event invalid - Fired when the select is invalid
|
@@ -47,28 +48,28 @@ export declare class SkfSelect extends FormBase {
|
|
47
48
|
get getSelectedValues(): string[];
|
48
49
|
/** A readonly property that returns the selected slot(s) text content in a array */
|
49
50
|
get getSelectedOptionsText(): (string | null)[];
|
50
|
-
/**
|
51
|
-
label
|
51
|
+
/** Sets the visible label of the select in the form */
|
52
|
+
label: string;
|
52
53
|
/** If defined, limits the number of selectable options */
|
53
54
|
max?: number;
|
54
55
|
/** If defined, sets the minimum number of required options */
|
55
56
|
min?: number;
|
56
|
-
/** If
|
57
|
+
/** If provided, allows for multiple options to be selected */
|
57
58
|
multiple?: boolean;
|
58
|
-
/** If
|
59
|
+
/** If provided, set name of the component */
|
59
60
|
name?: string;
|
60
61
|
/** If defined, renders an alternative A11y text for the asterisk */
|
61
62
|
requiredLabel?: string;
|
62
63
|
/** If defined, displays provided severity state */
|
63
64
|
severity?: FormFieldBaseProps['severity'];
|
64
|
-
/** If
|
65
|
+
/** If provided, displays valid state after interaction */
|
65
66
|
showValid?: boolean;
|
66
67
|
/** Size of the Select */
|
67
68
|
size: 'sm' | 'md';
|
68
69
|
/** Read only, returns the selected value. (if multiple: in a comma separated string) */
|
69
70
|
get value(): string;
|
70
|
-
/** Stores the selected SkfSelectOption tag(s) in a array. Is the source of truth for the internal state. */
|
71
71
|
/** @internal */
|
72
|
+
/** Stores the selected SkfSelectOption tag(s) in a array. Is the source of truth for the internal state. */
|
72
73
|
private _selectedOptions;
|
73
74
|
/** @internal */
|
74
75
|
/** The selected options in an array. Treat it as a read only property. See selectedValues, slectedSlots for computed value arrays. */
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { computePosition as f, flip as
|
1
|
+
import { computePosition as f, flip as _, shift as v, offset as g } from "@floating-ui/dom";
|
2
2
|
import { FormBase as b } from "../../internal/components/formBase.js";
|
3
3
|
import { findMatchingTags as y } from "../../internal/helpers/findMatchingTags.js";
|
4
4
|
import { hintSeverity as O } from "../../internal/helpers/hintSeverity.js";
|
@@ -14,13 +14,13 @@ import "../tag/tag.js";
|
|
14
14
|
import { ScrollController as C, ResizeController as A, GlobalClickController as E, KeyboardNavigationController as k, DeveloperFeedbackController as L } from "./select.controllers.js";
|
15
15
|
import { styles as P } from "./select.styles.js";
|
16
16
|
var D = Object.defineProperty, M = Object.getOwnPropertyDescriptor, l = (u, t, e, s) => {
|
17
|
-
for (var o = s > 1 ? void 0 : s ? M(t, e) : t,
|
18
|
-
(
|
17
|
+
for (var o = s > 1 ? void 0 : s ? M(t, e) : t, a = u.length - 1, n; a >= 0; a--)
|
18
|
+
(n = u[a]) && (o = (s ? n(t, e, o) : n(o)) || o);
|
19
19
|
return s && o && D(t, e, o), o;
|
20
20
|
};
|
21
21
|
const c = class c extends b {
|
22
22
|
constructor() {
|
23
|
-
super(), this.selectDelay =
|
23
|
+
super(), this.selectDelay = 50, this._optionsList = [], this.buttonLabel = "Select an option", this.label = "Default label", this.size = "md", this._expanded = !1, this._invalid = !1, this.scrollController = new C(this), this.resizeController = new A(this), this.globalClickController = new E(this), this.keyboardNavController = new k(this), this.developerFeedbackController = new L(this), this._handleOptionSelected = (t) => {
|
24
24
|
this._pristine = !1;
|
25
25
|
const e = this._selectedOptions.length > 0;
|
26
26
|
this.setFormValue(e ? this.getSelectedValues.join(",") : null), this._updateState(t);
|
@@ -38,14 +38,14 @@ const c = class c extends b {
|
|
38
38
|
const s = this.$selectBtn, o = this.$dropdown;
|
39
39
|
!s || !o || (o.showPopover(), f(s, o, {
|
40
40
|
placement: "bottom",
|
41
|
-
middleware: [
|
42
|
-
}).then(({ x:
|
41
|
+
middleware: [_(), v({ padding: 5 }), g(2)]
|
42
|
+
}).then(({ x: a, y: n }) => {
|
43
43
|
Object.assign(o.style, {
|
44
|
-
left: `${String(
|
45
|
-
top: `${String(Math.round(
|
44
|
+
left: `${String(a)}px`,
|
45
|
+
top: `${String(Math.round(n - window.scrollY))}px`
|
46
46
|
});
|
47
|
-
}).catch((
|
48
|
-
console.error(
|
47
|
+
}).catch((a) => {
|
48
|
+
console.error(a);
|
49
49
|
}));
|
50
50
|
} }), this._handleDropdownToggle = (t) => {
|
51
51
|
t.stopPropagation(), this._expanded = !this._expanded;
|
@@ -126,8 +126,8 @@ const c = class c extends b {
|
|
126
126
|
attributeChangedCallback(t, e, s) {
|
127
127
|
if (super.attributeChangedCallback(t, e, s), t === "custom-invalid")
|
128
128
|
if (typeof s == "string") {
|
129
|
-
const
|
130
|
-
this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 },
|
129
|
+
const a = String(s).trim() || "Custom error";
|
130
|
+
this._pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, a), this.checkValidity();
|
131
131
|
} else
|
132
132
|
this.setValidity({}), this._validateInput();
|
133
133
|
}
|
@@ -168,20 +168,20 @@ const c = class c extends b {
|
|
168
168
|
this._invalid = !0;
|
169
169
|
return;
|
170
170
|
} else if (t) {
|
171
|
-
const
|
172
|
-
this.setValidity({ valueMissing: !0 }, String(
|
171
|
+
const a = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : "Please select an option";
|
172
|
+
this.setValidity({ valueMissing: !0 }, String(a)), this._pristine || (this._invalid = !0);
|
173
173
|
} else if (e) {
|
174
|
-
const
|
175
|
-
this.setValidity({ rangeUnderflow: !0 }, String(
|
174
|
+
const a = this.hasAttribute("data-rangeunderflow") ? this.getAttribute("data-rangeunderflow") : `Please select minimum ${String(this.min)} options`;
|
175
|
+
this.setValidity({ rangeUnderflow: !0 }, String(a)), this._pristine || (this._invalid = !0);
|
176
176
|
} else if (s) {
|
177
|
-
const
|
178
|
-
this.setValidity({ rangeOverflow: !0 }, String(
|
177
|
+
const a = this.hasAttribute("data-rangeoverflow") ? this.getAttribute("data-rangeoverflow") : `Please select maximum ${String(this.max)} options`;
|
178
|
+
this.setValidity({ rangeOverflow: !0 }, String(a)), this._pristine || (this._invalid = !0);
|
179
179
|
} else
|
180
180
|
this.setValidity({}), !this._pristine && this.showValid && this.setAttribute("valid", "true");
|
181
181
|
}
|
182
182
|
render() {
|
183
183
|
return h`
|
184
|
-
<div id="
|
184
|
+
<div id="select">
|
185
185
|
<label>
|
186
186
|
<div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
|
187
187
|
${this.label}
|
@@ -227,7 +227,7 @@ const c = class c extends b {
|
|
227
227
|
id="hint"
|
228
228
|
severity=${m(O(this.severity, this._invalid))}
|
229
229
|
>
|
230
|
-
${this.
|
230
|
+
${this.hint}
|
231
231
|
</skf-hint>
|
232
232
|
`}
|
233
233
|
</div>
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { visuallyHidden as r } from "../../styles/util.styles.js";
|
2
|
-
import { css as
|
2
|
+
import { css as e } from "lit";
|
3
3
|
const t = [
|
4
4
|
r,
|
5
|
-
|
5
|
+
e`
|
6
6
|
@layer components {
|
7
7
|
:host {
|
8
8
|
contain: initial;
|
9
9
|
}
|
10
10
|
|
11
|
-
#
|
11
|
+
#select {
|
12
12
|
color: var(--_skf-select-color, var(--skf-text-color-primary));
|
13
13
|
display: flex;
|
14
14
|
flex-direction: column;
|
@@ -9,12 +9,13 @@ import { type CSSResultGroup } from 'lit';
|
|
9
9
|
* @attribute {boolean} disabled - If true, sets disabled state
|
10
10
|
* @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
|
11
11
|
*
|
12
|
-
* @slot - The
|
12
|
+
* @slot - The component's placeholder content
|
13
13
|
*
|
14
14
|
* @tagname skf-switch
|
15
15
|
*/
|
16
16
|
export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
|
17
17
|
static styles: CSSResultGroup;
|
18
|
+
/** @internal */
|
18
19
|
private _initialChecked;
|
19
20
|
/** If true, outputs helping hints in console */
|
20
21
|
debug?: boolean;
|
@@ -22,7 +23,7 @@ export declare class SkfSwitch extends FormBase implements FormFieldBaseProps {
|
|
22
23
|
checked?: boolean;
|
23
24
|
/** If true, hides the label visually */
|
24
25
|
hideLabel?: boolean;
|
25
|
-
/** If defined, sets the input's label
|
26
|
+
/** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
|
26
27
|
label?: string;
|
27
28
|
/** If defined, adds name to the input-element */
|
28
29
|
name?: string;
|
@@ -13,29 +13,24 @@ import { type CSSResultGroup } from 'lit';
|
|
13
13
|
*/
|
14
14
|
export declare class SkfTag extends SkfElement {
|
15
15
|
static styles: CSSResultGroup;
|
16
|
+
/** @internal */
|
16
17
|
private _onClick?;
|
18
|
+
/** @internal */
|
17
19
|
protected _onRemove?: (event: Event) => void;
|
18
|
-
/** Specifies Tag size */
|
20
|
+
/** Specifies Tag size - @default "md" */
|
19
21
|
size: 'sm' | 'md' | 'lg';
|
20
|
-
/**
|
21
|
-
* If defined, displays leading/provided icon
|
22
|
-
* @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" }
|
23
|
-
*/
|
22
|
+
/** If defined, displays leading/provided icon - @type { "arrowDown" | "arrowDownUp" | "arrowLeft" | "arrowRight" | "arrowUp" | "article" | "artificialIntelligence" | "asset" | "attachment" | "bandCursor" | "bands" | "batteryEmpty" | "batteryFull" | "batteryLow" | "bearingFault" | "book" | "bulb" | "burger" | "cPM" | "calendar" | "calendarBooked" | "calendarEmpty" | "calendarNotBooked" | "calendarRecurring" | "caretDown" | "caretUp" | "caretUpDown" | "chat" | "check" | "checkCircle" | "checkSmall" | "chevronDown" | "chevronLeft" | "chevronRight" | "chevronUp" | "chevronUpDown" | "close" | "closeAllFaults" | "closeFault" | "closeSmall" | "columnGraph" | "comment" | "connection1" | "connection2" | "connection3" | "connection4" | "danger" | "defectFrequencies" | "defectFrequenciesAlternative" | "doubleChevronLeft" | "doubleChevronRight" | "download" | "draft" | "draftFilled" | "draftOutlined" | "dragNDrop" | "drop" | "duplicate" | "edit" | "emailFilled" | "emailOutlined" | "exclamation" | "eye" | "eyeHidden" | "eyeVisible" | "filter" | "forbidden" | "fullScreen" | "fullScreenExit" | "functionalLocation" | "harmonicCursor" | "heatmap" | "hierarchy" | "history" | "historyAlt" | "hourglassFramedFilled" | "hourglassFramedOutlined" | "hourglassOutlined" | "hz" | "iMX" | "image" | "infoCircleFilled" | "infoCircleOutlined" | "integration" | "kebab" | "link" | "listGroup" | "listItem" | "locationPin" | "lock" | "logOut" | "meatballs" | "microphone" | "minus" | "minusSmall" | "noData" | "o" | "openInNew" | "overlayBaseline" | "pDF" | "paper" | "pause" | "pieChart" | "pin" | "play" | "plus" | "powerOff" | "printer" | "proCollect" | "recAction" | "received" | "refresh" | "reorder" | "replace" | "reply" | "rewalkableRoute" | "routes" | "search" | "send" | "sensorA" | "sensorB" | "settings" | "sidebandCursor" | "singleCursor" | "spectrum" | "starFilled" | "starOutlined" | "statusCircle" | "stop" | "structuralVibration" | "sync" | "timewave" | "trash" | "trend" | "trendingUp" | "undo" | "unknownCircle" | "unknownDiamond" | "unlink" | "unlock" | "unscheduledAction" | "upload" | "user" | "viewFull" | "viewHorizontal" | "viewVertical" | "warning" | "warningCircle" | "warningDiamond" | "zoomIn" | "zoomOut" } */
|
24
23
|
icon?: Icon;
|
25
|
-
/**
|
26
|
-
* If defined, gives the supplied appearance
|
27
|
-
* @type { "warning" | "success" | "info" | "error" | "alert" }
|
28
|
-
*/
|
24
|
+
/** If defined, gives the supplied appearance - @type { "warning" | "success" | "info" | "error" | "alert" } */
|
29
25
|
color?: SeverityBgColor;
|
30
|
-
/** If
|
26
|
+
/** If provided, accepts a function that runs on click. */
|
31
27
|
set onClick(onClickFn: ((event: Event) => void) | undefined);
|
32
28
|
get onClick(): ((event: Event) => void) | undefined;
|
33
|
-
/** If
|
29
|
+
/** If provided, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
|
34
30
|
set onRemove(onRemoveFn: ((event: Event) => void) | undefined);
|
35
31
|
get onRemove(): ((event: Event) => void) | undefined;
|
36
32
|
/** If true, adds trailing button to remove tag */
|
37
33
|
removable?: boolean;
|
38
|
-
/** @internal */
|
39
34
|
$removeButton: HTMLButtonElement;
|
40
35
|
connectedCallback(): void;
|
41
36
|
disconnectedCallback(): void;
|