@skf-design-system/ui-components 0.0.1-beta.4 → 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/checkbox/checkbox.component.js +1 -1
- package/dist/components/input/input.component.js +24 -26
- package/dist/components/select/select.component.d.ts +138 -0
- package/dist/components/select/select.component.js +311 -0
- package/dist/components/select/select.controllers.d.ts +59 -0
- package/dist/components/select/select.controllers.js +169 -0
- package/dist/components/select/select.d.ts +8 -0
- package/dist/components/select/select.js +6 -0
- package/dist/components/select/select.styles.d.ts +1 -0
- package/dist/components/select/select.styles.js +116 -0
- package/dist/components/select-option/select-option.component.d.ts +77 -0
- package/dist/components/select-option/select-option.component.js +117 -0
- package/dist/components/select-option/select-option.controllers.d.ts +9 -0
- package/dist/components/select-option/select-option.d.ts +8 -0
- package/dist/components/select-option/select-option.js +6 -0
- package/dist/components/select-option/select-option.styles.d.ts +1 -0
- package/dist/components/select-option/select-option.styles.js +53 -0
- package/dist/components/select-option-group/select-option-group.component.d.ts +16 -0
- package/dist/components/select-option-group/select-option-group.component.js +31 -0
- package/dist/components/select-option-group/select-option-group.d.ts +8 -0
- package/dist/components/select-option-group/select-option-group.js +6 -0
- package/dist/components/select-option-group/select-option-group.style.d.ts +1 -0
- package/dist/components/select-option-group/select-option-group.style.js +18 -0
- package/dist/components/tag/tag.component.d.ts +18 -2
- package/dist/components/tag/tag.component.js +69 -32
- package/dist/components/tag/tag.styles.js +0 -4
- package/dist/custom-elements.json +1279 -624
- package/dist/index.d.ts +3 -0
- package/dist/index.js +39 -30
- package/dist/internal/components/formBase.d.ts +18 -1
- package/dist/internal/components/formBase.js +25 -13
- package/dist/internal/components/skf-element.d.ts +4 -4
- package/dist/internal/components/skf-element.js +15 -19
- package/dist/internal/helpers/array.d.ts +4 -0
- package/dist/internal/helpers/findMatchingTags.d.ts +2 -0
- package/dist/internal/helpers/findMatchingTags.js +12 -0
- package/dist/internal/helpers/hintSeverity.d.ts +2 -0
- package/dist/internal/helpers/hintSeverity.js +6 -0
- package/dist/internal/helpers/raiseError.d.ts +28 -0
- package/dist/internal/helpers/raiseError.js +29 -0
- package/dist/internal/storybook/shadowRootTraverser.d.ts +2 -0
- package/dist/react/index.d.ts +6 -3
- package/dist/react/index.js +6 -3
- package/dist/react/skf-select/index.d.ts +21 -0
- package/dist/react/skf-select/index.js +21 -0
- package/dist/react/skf-select-option/index.d.ts +9 -0
- package/dist/react/skf-select-option/index.js +17 -0
- package/dist/react/skf-select-option-group/index.d.ts +3 -0
- package/dist/react/skf-select-option-group/index.js +13 -0
- package/dist/styles/form-field.styles.js +6 -6
- package/dist/types/jsx/custom-element-jsx.d.ts +326 -176
- package/dist/types/vue/index.d.ts +268 -135
- package/dist/vscode.html-custom-data.json +344 -147
- package/dist/web-types.json +755 -383
- package/package.json +34 -30
@@ -13,15 +13,31 @@ import { type CSSResultGroup } from 'lit';
|
|
13
13
|
*/
|
14
14
|
export declare class SkfTag extends SkfElement {
|
15
15
|
static styles: CSSResultGroup;
|
16
|
+
/** @internal */
|
17
|
+
private _onClick?;
|
18
|
+
/** @internal */
|
19
|
+
protected _onRemove?: (event: Event) => void;
|
16
20
|
/** Specifies Tag size - @default "md" */
|
17
21
|
size: 'sm' | 'md' | 'lg';
|
18
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" } */
|
19
23
|
icon?: Icon;
|
20
24
|
/** If defined, gives the supplied appearance - @type { "warning" | "success" | "info" | "error" | "alert" } */
|
21
25
|
color?: SeverityBgColor;
|
26
|
+
/** If provided, accepts a function that runs on click. */
|
27
|
+
set onClick(onClickFn: ((event: Event) => void) | undefined);
|
28
|
+
get onClick(): ((event: Event) => void) | undefined;
|
29
|
+
/** If provided, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
|
30
|
+
set onRemove(onRemoveFn: ((event: Event) => void) | undefined);
|
31
|
+
get onRemove(): ((event: Event) => void) | undefined;
|
22
32
|
/** If true, adds trailing button to remove tag */
|
23
33
|
removable?: boolean;
|
24
|
-
|
25
|
-
|
34
|
+
$removeButton: HTMLButtonElement;
|
35
|
+
connectedCallback(): void;
|
36
|
+
disconnectedCallback(): void;
|
37
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
38
|
+
protected _handleKeyDown: (e: KeyboardEvent) => void;
|
39
|
+
/** run externally provided callback (if any) first. Let click propagate to handleClick. */
|
40
|
+
protected _handleRemove: (e: Event) => void;
|
41
|
+
protected _handleClick: (e: Event) => void;
|
26
42
|
render(): import("lit").TemplateResult<1>;
|
27
43
|
}
|
@@ -1,51 +1,88 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import
|
4
|
-
import { html as
|
5
|
-
import { property as
|
2
|
+
import { SkfElement as d } from "../../internal/components/skf-element.js";
|
3
|
+
import u from "../../styles/component.styles.js";
|
4
|
+
import { html as a, nothing as m } from "lit";
|
5
|
+
import { property as r, query as f } from "lit/decorators.js";
|
6
6
|
import { ifDefined as v } from "lit/directives/if-defined.js";
|
7
|
-
import { styles as
|
8
|
-
var
|
9
|
-
for (var t = void 0, i =
|
10
|
-
(c =
|
11
|
-
return t &&
|
7
|
+
import { styles as k } from "./tag.styles.js";
|
8
|
+
var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, s = (p, e, i, n) => {
|
9
|
+
for (var t = n > 1 ? void 0 : n ? y(e, i) : e, l = p.length - 1, c; l >= 0; l--)
|
10
|
+
(c = p[l]) && (t = (n ? c(e, i, t) : c(t)) || t);
|
11
|
+
return n && t && b(e, i, t), t;
|
12
12
|
};
|
13
|
-
const
|
13
|
+
const h = class h extends d {
|
14
14
|
constructor() {
|
15
|
-
super(...arguments), this.size = "md", this.
|
16
|
-
this.
|
15
|
+
super(...arguments), this.size = "md", this._handleKeyDown = (e) => {
|
16
|
+
(e.key === "Enter" || e.key === " ") && this.$removeButton.click();
|
17
|
+
}, this._handleRemove = (e) => {
|
18
|
+
this._onRemove && this._onRemove(e);
|
19
|
+
}, this._handleClick = (e) => {
|
20
|
+
var t;
|
21
|
+
e.stopPropagation();
|
22
|
+
const i = e.composedPath()[0];
|
23
|
+
i.localName === "skf-icon" && i.getAttribute("name") === "close" ? this.remove() : (t = this.onClick) == null || t.call(this, e);
|
17
24
|
};
|
18
25
|
}
|
26
|
+
set onClick(e) {
|
27
|
+
e && (this._onClick = e);
|
28
|
+
}
|
29
|
+
get onClick() {
|
30
|
+
return this._onClick;
|
31
|
+
}
|
32
|
+
set onRemove(e) {
|
33
|
+
e && (this._onRemove = e);
|
34
|
+
}
|
35
|
+
get onRemove() {
|
36
|
+
return this._onRemove;
|
37
|
+
}
|
38
|
+
connectedCallback() {
|
39
|
+
super.connectedCallback(), this.addEventListener("click", this._handleClick);
|
40
|
+
}
|
41
|
+
disconnectedCallback() {
|
42
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick);
|
43
|
+
}
|
44
|
+
attributeChangedCallback(e, i, n) {
|
45
|
+
super.attributeChangedCallback(e, i, n), e === "removable" && n !== null ? (this.tabIndex = 0, this.addEventListener("keydown", this._handleKeyDown)) : (this.tabIndex = -1, this.removeEventListener("keydown", this._handleKeyDown));
|
46
|
+
}
|
19
47
|
render() {
|
20
|
-
return
|
48
|
+
return a`
|
21
49
|
<div id="tag">
|
22
|
-
${this.icon ?
|
50
|
+
${this.icon ? a`<skf-icon color=${v(this.color)} name=${this.icon} size="sm"></skf-icon>` : m}
|
23
51
|
<span>
|
24
52
|
<slot></slot>
|
25
53
|
</span>
|
26
|
-
${this.removable ?
|
27
|
-
<button @click=${this.
|
28
|
-
<skf-icon name="close" size="
|
54
|
+
${this.removable ? a`
|
55
|
+
<button @click=${this._handleRemove} type="button">
|
56
|
+
<skf-icon name="close" size="xs"></skf-icon>
|
29
57
|
</button>
|
30
|
-
` :
|
58
|
+
` : m}
|
31
59
|
</div>
|
32
60
|
`;
|
33
61
|
}
|
34
62
|
};
|
35
|
-
|
36
|
-
let o =
|
37
|
-
|
38
|
-
|
39
|
-
], o.prototype, "size");
|
40
|
-
|
41
|
-
|
42
|
-
], o.prototype, "icon");
|
43
|
-
|
44
|
-
|
45
|
-
], o.prototype, "color");
|
46
|
-
|
47
|
-
|
48
|
-
], o.prototype, "
|
63
|
+
h.styles = [u, k];
|
64
|
+
let o = h;
|
65
|
+
s([
|
66
|
+
r({ reflect: !0 })
|
67
|
+
], o.prototype, "size", 2);
|
68
|
+
s([
|
69
|
+
r()
|
70
|
+
], o.prototype, "icon", 2);
|
71
|
+
s([
|
72
|
+
r({ reflect: !0 })
|
73
|
+
], o.prototype, "color", 2);
|
74
|
+
s([
|
75
|
+
r({ attribute: !1 })
|
76
|
+
], o.prototype, "onClick", 1);
|
77
|
+
s([
|
78
|
+
r({ attribute: !1 })
|
79
|
+
], o.prototype, "onRemove", 1);
|
80
|
+
s([
|
81
|
+
r({ type: Boolean, reflect: !0 })
|
82
|
+
], o.prototype, "removable", 2);
|
83
|
+
s([
|
84
|
+
f("button")
|
85
|
+
], o.prototype, "$removeButton", 2);
|
49
86
|
export {
|
50
87
|
o as SkfTag
|
51
88
|
};
|