@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,42 +1,37 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { SkfElement as h } from "../../internal/components/skf-element.js";
|
2
|
+
import m from "../../styles/component.styles.js";
|
3
|
+
import { html as c } from "lit";
|
4
|
+
import { property as o } from "lit/decorators.js";
|
5
|
+
import { when as d } from "lit/directives/when.js";
|
6
|
+
import f from "./divider.styles.js";
|
7
|
+
var v = Object.defineProperty, i = (s, l, n, u) => {
|
8
|
+
for (var r = void 0, t = s.length - 1, p; t >= 0; t--)
|
9
|
+
(p = s[t]) && (r = p(l, n, r) || r);
|
10
|
+
return r && v(l, n, r), r;
|
3
11
|
};
|
4
|
-
|
5
|
-
var s = (t, r, e) => (d(t, r, "read from private field"), e ? e.call(t) : r.get(t)), v = (t, r, e) => r.has(t) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), y = (t, r, e, l) => (d(t, r, "write to private field"), l ? l.call(t, e) : r.set(t, e), e);
|
6
|
-
import { SkfElement as u } from "../../internal/components/skf-element.js";
|
7
|
-
import b from "../../styles/component.styles.js";
|
8
|
-
import { html as C } from "lit";
|
9
|
-
import { property as p } from "lit/decorators.js";
|
10
|
-
import _ from "./divider.styles.js";
|
11
|
-
var x = Object.defineProperty, c = (t, r, e, l) => {
|
12
|
-
for (var o = void 0, n = t.length - 1, h; n >= 0; n--)
|
13
|
-
(h = t[n]) && (o = h(r, e, o) || o);
|
14
|
-
return o && x(r, e, o), o;
|
15
|
-
}, i;
|
16
|
-
const m = class m extends u {
|
12
|
+
const a = class a extends h {
|
17
13
|
constructor() {
|
18
|
-
super()
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
super.connectedCallback(), s(this, i).role = this.decorative ? "generic" : "separator", s(this, i).ariaOrientation = this.vertical ? "vertical" : "horizontal";
|
14
|
+
super(...arguments), this.color = "primary", this.decorative = !1, this.vertical = !1, this.renderDecorative = () => c`
|
15
|
+
<span aria-orientation=${this.vertical ? "vertical" : "horizontal"} id="divider"></span>
|
16
|
+
`, this.renderDefault = () => c`
|
17
|
+
<hr aria-orientation=${this.vertical ? "vertical" : "horizontal"} id="divider" />
|
18
|
+
`;
|
24
19
|
}
|
25
20
|
render() {
|
26
|
-
return
|
21
|
+
return d(this.decorative, this.renderDecorative, this.renderDefault);
|
27
22
|
}
|
28
23
|
};
|
29
|
-
|
30
|
-
let
|
31
|
-
|
32
|
-
|
33
|
-
],
|
34
|
-
|
35
|
-
|
36
|
-
],
|
37
|
-
|
38
|
-
|
39
|
-
],
|
24
|
+
a.styles = [m, f];
|
25
|
+
let e = a;
|
26
|
+
i([
|
27
|
+
o({ reflect: !0 })
|
28
|
+
], e.prototype, "color");
|
29
|
+
i([
|
30
|
+
o({ type: Boolean })
|
31
|
+
], e.prototype, "decorative");
|
32
|
+
i([
|
33
|
+
o({ type: Boolean, reflect: !0 })
|
34
|
+
], e.prototype, "vertical");
|
40
35
|
export {
|
41
|
-
|
36
|
+
e as SkfDivider
|
42
37
|
};
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
2
|
const i = r`
|
3
|
-
|
3
|
+
:host {
|
4
|
+
display: contents;
|
5
|
+
}
|
6
|
+
|
7
|
+
#divider {
|
4
8
|
--_skf-divider-border-color: var(--skf-border-color-primary);
|
5
9
|
--_skf-divider-border: var(--skf-border-width-sm) solid var(--_skf-divider-border-color);
|
6
10
|
|
@@ -5,23 +5,13 @@ import { type CSSResultGroup } from 'lit';
|
|
5
5
|
* The `<Heading>` component is to deliniate content on a page. When using, take note not to skip heading levels.<br>
|
6
6
|
* It extends the interface of native html `<h1>` to `<h4>` elements.
|
7
7
|
*
|
8
|
-
* @slot - The headings content
|
9
|
-
*
|
10
8
|
* @tagname skf-heading
|
11
9
|
*/
|
12
10
|
export declare class SkfHeading extends SkfElement {
|
13
11
|
static styles: CSSResultGroup;
|
14
|
-
/**
|
15
|
-
* Controls which heading element will be rendered. Should not be used to affect appearance
|
16
|
-
*
|
17
|
-
* @type { "h1" | "h2" | "h3" | "h4" }
|
18
|
-
*/
|
12
|
+
/** Controls which heading element will be rendered. Should not be used to affect appearance. */
|
19
13
|
as: HeadingType;
|
20
|
-
/**
|
21
|
-
* If provided, changes the appearance of the heading
|
22
|
-
*
|
23
|
-
* @type { "h1" | "h2" | "h3" | "h4" }
|
24
|
-
*/
|
14
|
+
/** If provided, changes the appearance of the heading */
|
25
15
|
styledAs?: HeadingType;
|
26
16
|
render(): import("lit").TemplateResult;
|
27
17
|
}
|
@@ -1,32 +1,32 @@
|
|
1
|
-
import { SkfElement as
|
1
|
+
import { SkfElement as f } from "../../internal/components/skf-element.js";
|
2
2
|
import u from "../../styles/component.styles.js";
|
3
3
|
import "lit";
|
4
4
|
import { property as a } from "lit/decorators.js";
|
5
|
-
import { html as
|
6
|
-
import
|
7
|
-
var
|
8
|
-
for (var t = void 0,
|
9
|
-
(m = o[
|
10
|
-
return t &&
|
5
|
+
import { html as h, unsafeStatic as l } from "lit/static-html.js";
|
6
|
+
import y from "./heading.styles.js";
|
7
|
+
var c = Object.defineProperty, n = (o, p, i, d) => {
|
8
|
+
for (var t = void 0, e = o.length - 1, m; e >= 0; e--)
|
9
|
+
(m = o[e]) && (t = m(p, i, t) || t);
|
10
|
+
return t && c(p, i, t), t;
|
11
11
|
};
|
12
|
-
const
|
12
|
+
const s = class s extends f {
|
13
13
|
constructor() {
|
14
14
|
super(...arguments), this.as = "h1";
|
15
15
|
}
|
16
16
|
render() {
|
17
|
-
return
|
18
|
-
<${l(this.as)} id="
|
17
|
+
return h`
|
18
|
+
<${l(this.as)} id="heading">
|
19
19
|
<slot></slot>
|
20
20
|
</${l(this.as)}>
|
21
21
|
`;
|
22
22
|
}
|
23
23
|
};
|
24
|
-
|
25
|
-
let r =
|
26
|
-
|
24
|
+
s.styles = [u, y];
|
25
|
+
let r = s;
|
26
|
+
n([
|
27
27
|
a({ reflect: !0 })
|
28
28
|
], r.prototype, "as");
|
29
|
-
|
29
|
+
n([
|
30
30
|
a({ attribute: "styled-as" })
|
31
31
|
], r.prototype, "styledAs");
|
32
32
|
export {
|
@@ -10,25 +10,19 @@ import { type CSSResultGroup } from 'lit';
|
|
10
10
|
*/
|
11
11
|
export declare class SkfIcon extends SkfElement {
|
12
12
|
static styles: CSSResultGroup;
|
13
|
+
/** @internal */
|
13
14
|
private _rootId;
|
14
|
-
/**
|
15
|
-
|
16
|
-
|
17
|
-
*/
|
18
|
-
color: IconColor | SeverityFgColor;
|
19
|
-
/** If defined, adds an alternate description to use for assistive devices */
|
15
|
+
/** @type { "primary" | "inverse" | "emphasised" | "secondary" | "success" | "info" | "warning" | "error" | "alert" } */
|
16
|
+
color?: IconColor | SeverityFgColor;
|
17
|
+
/** If provided, adds an alternate description to use for assistive devices */
|
20
18
|
label?: string;
|
21
|
-
/**
|
22
|
-
* Name of the icon to display
|
23
|
-
* @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
|
-
*/
|
19
|
+
/** @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" } */
|
25
20
|
name: Icon;
|
26
|
-
/**
|
27
|
-
* Size of the icon
|
28
|
-
* @type { "xs" | "sm" | "md" | "lg" }
|
29
|
-
*/
|
21
|
+
/** @type { "xs" | "sm" | "md" | "lg" } */
|
30
22
|
size?: IconSize;
|
23
|
+
/** @internal */
|
31
24
|
private renderDecorativeIcon;
|
25
|
+
/** @internal */
|
32
26
|
private renderInformativeIcon;
|
33
27
|
render(): import("lit").TemplateResult<1>;
|
34
28
|
}
|
@@ -5,15 +5,15 @@ import { html as l } from "lit";
|
|
5
5
|
import { property as t } from "lit/decorators.js";
|
6
6
|
import { ifDefined as c } from "lit/directives/if-defined.js";
|
7
7
|
import { when as v } from "lit/directives/when.js";
|
8
|
-
import
|
9
|
-
var
|
8
|
+
import y from "./icon.styles.js";
|
9
|
+
var u = Object.defineProperty, o = (m, n, p, I) => {
|
10
10
|
for (var r = void 0, i = m.length - 1, a; i >= 0; i--)
|
11
11
|
(a = m[i]) && (r = a(n, p, r) || r);
|
12
|
-
return r &&
|
12
|
+
return r && u(n, p, r), r;
|
13
13
|
};
|
14
14
|
const s = class s extends f {
|
15
15
|
constructor() {
|
16
|
-
super(...arguments), this._rootId = "
|
16
|
+
super(...arguments), this._rootId = "icon", this.color = "primary", this.size = "md", this.renderDecorativeIcon = () => l`
|
17
17
|
<div aria-hidden="true" id=${this._rootId}>${d[this.name]}</div>
|
18
18
|
`, this.renderInformativeIcon = () => l`
|
19
19
|
<div aria-label=${c(this.label)} id=${this._rootId} role="img">${d[this.name]}</div>
|
@@ -23,7 +23,7 @@ const s = class s extends f {
|
|
23
23
|
return v(!!this.label, this.renderInformativeIcon, this.renderDecorativeIcon);
|
24
24
|
}
|
25
25
|
};
|
26
|
-
s.styles = [h,
|
26
|
+
s.styles = [h, y];
|
27
27
|
let e = s;
|
28
28
|
o([
|
29
29
|
t({ reflect: !0 })
|
@@ -32,7 +32,7 @@ o([
|
|
32
32
|
t()
|
33
33
|
], e.prototype, "label");
|
34
34
|
o([
|
35
|
-
t()
|
35
|
+
t({ type: String })
|
36
36
|
], e.prototype, "name");
|
37
37
|
o([
|
38
38
|
t({ reflect: !0 })
|
@@ -14,7 +14,7 @@ import { type CSSResultGroup } from 'lit';
|
|
14
14
|
* @event change - Fires when the value of the input changes
|
15
15
|
* @event invalid - Fires when the input is invalid
|
16
16
|
*
|
17
|
-
* @slot -
|
17
|
+
* @slot Default - Alternatively, you can use the `label` attribute
|
18
18
|
*
|
19
19
|
* @tagname skf-input
|
20
20
|
*
|
@@ -24,63 +24,57 @@ import { type CSSResultGroup } from 'lit';
|
|
24
24
|
export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
25
25
|
static styles: CSSResultGroup;
|
26
26
|
private customError;
|
27
|
-
/**
|
27
|
+
/** If provided, renders a custom aria-label for the clear button **Notice!** Only applicable to type=search. */
|
28
28
|
buttonAriaLabelClear: string;
|
29
|
-
/**
|
29
|
+
/** If provided, renders a custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
|
30
30
|
buttonAriaLabelHide: string;
|
31
|
-
/**
|
31
|
+
/** If provided, renders a custom aria-label for the visibility button **Notice!** Only applicable to type=password. */
|
32
32
|
buttonAriaLabelShow: string;
|
33
|
-
/** If
|
33
|
+
/** If provided, forces component to invalid state until removed. Its value is used as hint text. */
|
34
34
|
set customInvalid(value: string | undefined);
|
35
35
|
get customInvalid(): string | undefined;
|
36
|
-
/** If
|
37
|
-
debug
|
36
|
+
/** If provided, outputs helping hints in console */
|
37
|
+
debug: boolean;
|
38
38
|
/** If true, hides the label visually */
|
39
|
-
hideLabel
|
40
|
-
/** If
|
39
|
+
hideLabel: boolean;
|
40
|
+
/** If provided, displays informational text below the field */
|
41
41
|
hint?: string;
|
42
|
-
/**
|
42
|
+
/** If provided, tells what keyboard to use if applicable */
|
43
43
|
inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
44
|
-
/**
|
44
|
+
/** The input's label. Alternatively, you can use the `label` attribute. */
|
45
45
|
label?: string;
|
46
|
-
/** If
|
46
|
+
/** If provided, displays a prefix/adornment before the input-element */
|
47
47
|
leading?: string;
|
48
|
-
/** If
|
48
|
+
/** If provided, sets the maximum value to accept for this input */
|
49
49
|
max?: number | string;
|
50
|
-
/** If
|
50
|
+
/** If provided, sets the maximum character length to accept for this input */
|
51
51
|
maxLength?: number;
|
52
|
-
/** If
|
52
|
+
/** If provided, sets the minimum value to accept for this input */
|
53
53
|
min?: number | string;
|
54
|
-
/** If
|
54
|
+
/** If provided, sets the minimum character length to accept for this input */
|
55
55
|
minLength?: number;
|
56
|
-
/** If
|
56
|
+
/** If provided, adds name to the input-element */
|
57
57
|
name?: string;
|
58
|
-
/** If
|
58
|
+
/** If provided, adds name to the input-element */
|
59
59
|
pattern?: string;
|
60
|
-
/** If
|
60
|
+
/** If provided, displays placeholder text */
|
61
61
|
placeholder?: string;
|
62
62
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
63
63
|
readonly?: boolean;
|
64
|
-
/** If
|
64
|
+
/** If provided, renders an alternative A11y text for the asterisk */
|
65
65
|
requiredLabel?: string;
|
66
|
-
/**
|
67
|
-
* If defined, displays provided severity state
|
68
|
-
* @type { "alert" | "success" | "info" | "warning" }
|
69
|
-
*/
|
66
|
+
/** If provided, displays provided severity state */
|
70
67
|
severity?: FormFieldBaseProps['severity'];
|
71
|
-
/** If
|
68
|
+
/** If provided, displays provided severity state */
|
72
69
|
showValid?: boolean;
|
73
|
-
/**
|
74
|
-
size
|
75
|
-
/** If
|
70
|
+
/** If provided, displays an alternative size */
|
71
|
+
size?: 'sm' | 'md';
|
72
|
+
/** If provided, displays a suffix/adornment after the input-element */
|
76
73
|
trailing?: string;
|
77
|
-
/**
|
78
|
-
* Type of input control
|
79
|
-
* @type { 'button' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' }
|
80
|
-
*/
|
74
|
+
/** If provided, changes the type of form control */
|
81
75
|
type?: Exclude<FormFieldBaseProps['type'], 'checkbox' | 'radio'>;
|
82
|
-
/**
|
83
|
-
validateOn
|
76
|
+
/** If provided, sets validation start, "input", "change" or "submit" */
|
77
|
+
validateOn?: 'input' | 'change' | 'submit';
|
84
78
|
/** The current value of the input field */
|
85
79
|
value: string;
|
86
80
|
/** @internal */
|
@@ -94,6 +88,7 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
94
88
|
private _numberController;
|
95
89
|
/** @internal */
|
96
90
|
private _passwordController;
|
91
|
+
constructor();
|
97
92
|
protected firstUpdated(): void;
|
98
93
|
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
99
94
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { FormBase as
|
2
|
+
import { FormBase as v } from "../../internal/components/formBase.js";
|
3
3
|
import "../../internal/components/hint/hint.js";
|
4
|
-
import { hintSeverity as
|
4
|
+
import { hintSeverity as c } from "../../internal/helpers/hintSeverity.js";
|
5
5
|
import { Asterisk as y } from "../../internal/templates/asterisk.js";
|
6
6
|
import f from "../../styles/component.styles.js";
|
7
7
|
import { html as h, nothing as d } from "lit";
|
@@ -15,9 +15,9 @@ var A = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (m, e, r
|
|
15
15
|
(u = m[l]) && (o = (n ? u(e, r, o) : u(o)) || o);
|
16
16
|
return n && o && A(e, r, o), o;
|
17
17
|
};
|
18
|
-
const p = class p extends
|
18
|
+
const p = class p extends v {
|
19
19
|
constructor() {
|
20
|
-
super(
|
20
|
+
super(), this.buttonAriaLabelClear = "Clear input", this.buttonAriaLabelHide = "Hide password", this.buttonAriaLabelShow = "Show password", this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.size = "md", this.type = "text", this.validateOn = "change", this.value = "", this.invalid = !1, this._buttonDown = !1, this._handleInput = () => {
|
21
21
|
this.value = this.$input.value || "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
22
22
|
}, this._resetValue = (e) => {
|
23
23
|
var r;
|
@@ -67,10 +67,10 @@ const p = class p extends c {
|
|
67
67
|
</button>
|
68
68
|
`, this._onBlur = () => {
|
69
69
|
this._buttonDown && this.$input.focus();
|
70
|
-
};
|
70
|
+
}, this._numberController = new g(this), this._passwordController = new w(this);
|
71
71
|
}
|
72
72
|
set customInvalid(e) {
|
73
|
-
this.customError = e
|
73
|
+
this.customError = String(e);
|
74
74
|
}
|
75
75
|
get customInvalid() {
|
76
76
|
return this.customError;
|
@@ -126,7 +126,7 @@ const p = class p extends c {
|
|
126
126
|
render() {
|
127
127
|
var e, r;
|
128
128
|
return h`
|
129
|
-
<div id="
|
129
|
+
<div id="field">
|
130
130
|
<label>
|
131
131
|
<div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
|
132
132
|
<slot>${this.label}</slot>
|
@@ -140,16 +140,17 @@ const p = class p extends c {
|
|
140
140
|
id="affix"
|
141
141
|
>
|
142
142
|
<input
|
143
|
+
autocomplete="off"
|
144
|
+
title=""
|
143
145
|
?disabled=${this.disabled}
|
144
146
|
?readonly=${this.readonly}
|
145
147
|
?required=${this.required}
|
146
148
|
.value=${$(this.value)}
|
147
|
-
@blur=${this._onBlur}
|
148
149
|
@input=${this._handleInput}
|
150
|
+
@blur=${this._onBlur}
|
149
151
|
aria-describedby=${a((e = this.hint) != null && e.trim() ? "hint" : d)}
|
150
152
|
aria-errormessage=${a((r = this.hint) != null && r.trim() ? "hint" : d)}
|
151
153
|
aria-invalid=${!!this.invalid}
|
152
|
-
autocomplete="off"
|
153
154
|
data-testid="field-input"
|
154
155
|
inputmode=${a(this.inputMode)}
|
155
156
|
max=${a(this.max)}
|
@@ -159,17 +160,14 @@ const p = class p extends c {
|
|
159
160
|
name=${a(this.name)}
|
160
161
|
pattern=${a(this.pattern)}
|
161
162
|
placeholder=${a(this.placeholder)}
|
162
|
-
title=""
|
163
163
|
type=${a(
|
164
164
|
this.type === "password" ? this._passwordController._type : this.type
|
165
165
|
)}
|
166
166
|
/>
|
167
167
|
</div>
|
168
|
-
${this.type === "number" ? h
|
169
|
-
|
170
|
-
|
171
|
-
</div>
|
172
|
-
` : d}
|
168
|
+
${this.type === "number" ? h`<div id="action">
|
169
|
+
${this._renderNumberButton("inc")} ${this._renderNumberButton("dec")}
|
170
|
+
</div>` : d}
|
173
171
|
${this.type === "password" ? this._renderPasswordButton() : d}
|
174
172
|
${this.type === "search" && this.value.length > 0 ? this._renderSearchButton() : d}
|
175
173
|
</div>
|
@@ -178,8 +176,8 @@ const p = class p extends c {
|
|
178
176
|
<skf-hint
|
179
177
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
180
178
|
id="hint"
|
181
|
-
severity=${a(
|
182
|
-
>${this.
|
179
|
+
severity=${a(c(this.severity, this.invalid))}
|
180
|
+
>${this.hint}
|
183
181
|
</skf-hint>
|
184
182
|
`}
|
185
183
|
</div>
|
@@ -246,7 +244,7 @@ i([
|
|
246
244
|
s({ attribute: "required-label" })
|
247
245
|
], t.prototype, "requiredLabel", 2);
|
248
246
|
i([
|
249
|
-
s(
|
247
|
+
s()
|
250
248
|
], t.prototype, "severity", 2);
|
251
249
|
i([
|
252
250
|
s({ type: Boolean, attribute: "show-valid" })
|
@@ -9,41 +9,38 @@ import { type CSSResultGroup } from 'lit';
|
|
9
9
|
*
|
10
10
|
* @property {function} onClick - If provided, custom function triggered by click where the second return parameter enables custom routing.
|
11
11
|
*
|
12
|
-
* @slot - The links' main content
|
12
|
+
* @slot {string} - The links' main content
|
13
13
|
*
|
14
14
|
* @tagname skf-link
|
15
15
|
*/
|
16
16
|
export declare class SkfLink extends SkfElement {
|
17
17
|
static styles: CSSResultGroup;
|
18
18
|
private _onClick?;
|
19
|
-
/**
|
19
|
+
/** Specifies semantic element to render - @default "a" */
|
20
20
|
as: 'button' | 'a';
|
21
|
-
/**
|
21
|
+
/** @default "primary" */
|
22
22
|
color: 'primary' | 'inverse';
|
23
23
|
/** If true, disables the link */
|
24
24
|
disabled?: boolean;
|
25
|
-
/** If
|
25
|
+
/** If provided, downloads the url */
|
26
26
|
download?: string;
|
27
|
-
/** If
|
27
|
+
/** If provided, loads url on click */
|
28
28
|
href?: string;
|
29
|
-
/**
|
30
|
-
* If defined, renders an icon before or after the text
|
31
|
-
* @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" }
|
32
|
-
*/
|
29
|
+
/** If provided, renders an icon before or after the text @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" } */
|
33
30
|
icon?: SkfIcon['name'];
|
34
|
-
/**
|
31
|
+
/** Position of the icon in relation to the text - @default "left" */
|
35
32
|
iconPlacement: 'left' | 'right';
|
36
|
-
/**
|
33
|
+
/** Specifies the relationship of the target object to the link object - @default "noreferrer noopener" */
|
37
34
|
rel: string;
|
38
|
-
/** If
|
35
|
+
/** If provided, used on conjunction with onClick property, second argument */
|
39
36
|
route?: string;
|
40
37
|
/** If true, fills the parents horizontal axis */
|
41
38
|
stretch?: boolean;
|
42
|
-
/** If
|
39
|
+
/** If provided, specifies where to open the linked document */
|
43
40
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
44
|
-
/**
|
41
|
+
/** Type of button - @default "button" */
|
45
42
|
type: 'button' | 'submit' | 'reset';
|
46
|
-
/** If
|
43
|
+
/** If provided, accepts a function that runs on click. Forwards optional route as second argument. */
|
47
44
|
set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
|
48
45
|
get onClick(): ((event: Event, route?: string) => void) | undefined;
|
49
46
|
connectedCallback(): void;
|
@@ -6,10 +6,10 @@ import "lit";
|
|
6
6
|
import { property as r } from "lit/decorators.js";
|
7
7
|
import { ifDefined as n } from "lit/directives/if-defined.js";
|
8
8
|
import { html as f, literal as d } from "lit/static-html.js";
|
9
|
-
var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (h, t, i,
|
10
|
-
for (var s =
|
11
|
-
(c = h[
|
12
|
-
return
|
9
|
+
var k = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (h, t, i, l) => {
|
10
|
+
for (var s = l > 1 ? void 0 : l ? v(t, i) : t, p = h.length - 1, c; p >= 0; p--)
|
11
|
+
(c = h[p]) && (s = (l ? c(t, i, s) : c(s)) || s);
|
12
|
+
return l && s && k(t, i, s), s;
|
13
13
|
};
|
14
14
|
const a = class a extends m {
|
15
15
|
constructor() {
|
@@ -20,8 +20,8 @@ const a = class a extends m {
|
|
20
20
|
set onClick(t) {
|
21
21
|
if (!t) return;
|
22
22
|
this._onClick = t;
|
23
|
-
const i = (
|
24
|
-
t(
|
23
|
+
const i = (l) => {
|
24
|
+
t(l, this.href ?? this.route);
|
25
25
|
};
|
26
26
|
this._assertValidOnClick(t), this.removeEventListener("click", i), this.addEventListener("click", i);
|
27
27
|
}
|
@@ -58,7 +58,7 @@ const a = class a extends m {
|
|
58
58
|
@click=${this._preprocessOnClick}
|
59
59
|
download=${n(t ? this.download : void 0)}
|
60
60
|
href=${n(t ? this.href : void 0)}
|
61
|
-
id="
|
61
|
+
id="link"
|
62
62
|
rel=${n(t ? this.rel : void 0)}
|
63
63
|
target=${n(t ? this.target : void 0)}
|
64
64
|
title=${this.title}
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { SkfElement } from '@internal/components/skf-element.js';
|
2
2
|
import { type CSSResultGroup } from 'lit';
|
3
3
|
/**
|
4
|
-
* The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
|
4
|
+
* The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities.
|
5
5
|
*
|
6
|
-
* @documentation See [
|
6
|
+
* @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/619e4125b3d2147c0c584b11) for design principles.
|
7
7
|
*
|
8
8
|
* @tagname skf-loader
|
9
9
|
*/
|
10
10
|
export declare class SkfLoader extends SkfElement {
|
11
|
-
#private;
|
12
11
|
static styles: CSSResultGroup;
|
13
|
-
/** Defines the aria-label */
|
14
12
|
ariaLabel: string;
|
15
13
|
/** If true, inverts the color (to be used on colored backgrounds) */
|
16
|
-
invert
|
17
|
-
/**
|
14
|
+
invert: boolean;
|
15
|
+
/** If provided, displays an alternative size */
|
18
16
|
size?: 'md' | 'sm';
|
19
|
-
|
17
|
+
connectedCallback(): void;
|
18
|
+
/** @internal */
|
19
|
+
private getCircle;
|
20
20
|
render(): import("lit").TemplateResult<1>;
|
21
21
|
}
|