@skf-design-system/ui-components 1.0.2-beta.13 → 1.0.2-beta.15
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/input/input.component.d.ts +1 -0
- package/dist/components/input/input.component.js +45 -45
- package/dist/components/tag/tag.component.d.ts +6 -6
- package/dist/components/tag/tag.component.js +65 -65
- package/dist/components/tag/tag.styles.js +5 -0
- package/dist/custom-elements.json +9 -2
- package/dist/types/jsx/custom-element-jsx.d.ts +7 -4
- package/dist/types/vue/index.d.ts +5 -2
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/web-types.json +13 -3
- package/package.json +1 -1
@@ -15,6 +15,7 @@ import { type CSSResultGroup } from 'lit';
|
|
15
15
|
*
|
16
16
|
* @event {CustomEvent} change - Fires when the value of the input changes
|
17
17
|
* @event {CustomEvent} invalid - Fires when the input is invalid
|
18
|
+
* @event {CustomEvent} cleared - Fires when the input is cleared
|
18
19
|
*
|
19
20
|
* @slot - The Inputs label. Alternatively, you can use the `label` attribute.
|
20
21
|
*
|
@@ -1,35 +1,35 @@
|
|
1
|
-
var
|
1
|
+
var f = (a) => {
|
2
2
|
throw TypeError(a);
|
3
3
|
};
|
4
|
-
var b = (a,
|
5
|
-
var c = (a,
|
4
|
+
var b = (a, n, t) => n.has(a) || f("Cannot " + t);
|
5
|
+
var c = (a, n, t) => (b(a, n, "read from private field"), t ? t.call(a) : n.get(a)), _ = (a, n, t) => n.has(a) ? f("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, t), g = (a, n, t, r) => (b(a, n, "write to private field"), r ? r.call(a, t) : n.set(a, t), t);
|
6
6
|
import "../icon/icon.js";
|
7
|
-
import { FormBase as
|
7
|
+
import { FormBase as $ } from "../../internal/components/formBase.js";
|
8
8
|
import "../../internal/components/hint/hint.js";
|
9
9
|
import { hintSeverity as w } from "../../internal/helpers/hintSeverity.js";
|
10
10
|
import { watch as E } from "../../internal/helpers/watch.js";
|
11
|
-
import { Asterisk as
|
12
|
-
import { componentStyles as
|
13
|
-
import { LocalizeController as
|
11
|
+
import { Asterisk as S } from "../../internal/templates/asterisk.js";
|
12
|
+
import { componentStyles as P } from "../../styles/component.styles.js";
|
13
|
+
import { LocalizeController as C } from "../../utilities/localize.js";
|
14
14
|
import { html as p, nothing as m } from "lit";
|
15
|
-
import { state as v, property as s, query as
|
15
|
+
import { state as v, property as s, query as k, queryAssignedNodes as B } from "lit/decorators.js";
|
16
16
|
import { ifDefined as l } from "lit/directives/if-defined.js";
|
17
17
|
import { live as x } from "lit/directives/live.js";
|
18
18
|
import { InputNumberController as A, InputPasswordController as V } from "./input.controllers.js";
|
19
19
|
import I from "./input.styles.js";
|
20
|
-
var L = Object.defineProperty, D = Object.getOwnPropertyDescriptor, e = (a,
|
21
|
-
for (var
|
22
|
-
(u = a[h]) && (
|
23
|
-
return r &&
|
20
|
+
var L = Object.defineProperty, D = Object.getOwnPropertyDescriptor, e = (a, n, t, r) => {
|
21
|
+
for (var o = r > 1 ? void 0 : r ? D(n, t) : n, h = a.length - 1, u; h >= 0; h--)
|
22
|
+
(u = a[h]) && (o = (r ? u(n, t, o) : u(o)) || o);
|
23
|
+
return r && o && L(n, t, o), o;
|
24
24
|
}, d;
|
25
|
-
const
|
25
|
+
const y = class y extends $ {
|
26
26
|
constructor() {
|
27
27
|
super(...arguments);
|
28
28
|
_(this, d);
|
29
|
-
|
29
|
+
g(this, d, new C(this)), this._value = "", this.autofocus = !1, this.debug = !1, this.hideLabel = !1, this.inputmode = "text", this.lang = "en", this.readonly = !1, this.showValid = !1, this.size = "md", this.type = "text", this.validateOn = "change", this.invalid = !1, this._buttonDown = !1, this._numberController = new A(this), this._passwordController = new V(this), this._handleInput = () => {
|
30
30
|
this._value = this.$input?.value ?? "", this.validateOn === "input" && (this._pristine = !1, this.validateInput());
|
31
31
|
}, this._resetValue = (t) => {
|
32
|
-
t.stopPropagation(), this.value = this.getAttribute("value")?.trim() ?? "", this._value = this.value, this._internals.setFormValue(this.value), this.$input?.focus();
|
32
|
+
t.stopPropagation(), this.value = this.getAttribute("value")?.trim() ?? "", this._value = this.value, this._internals.setFormValue(this.value), this.$input?.focus(), this.emitEvent("cleared");
|
33
33
|
}, this._handlePressStart = (t) => {
|
34
34
|
this._buttonDown = !0, this.type === "number" && this._numberController.handleActionBtnLongPressStart(t);
|
35
35
|
}, this._handlePressEnd = () => {
|
@@ -108,10 +108,10 @@ const f = class f extends g {
|
|
108
108
|
valueChanged() {
|
109
109
|
this._internals.setFormValue(this.value), this.validateInput();
|
110
110
|
}
|
111
|
-
attributeChangedCallback(t, r,
|
112
|
-
if (super.attributeChangedCallback(t, r,
|
113
|
-
if (typeof
|
114
|
-
const u = this.withFallback(
|
111
|
+
attributeChangedCallback(t, r, o) {
|
112
|
+
if (super.attributeChangedCallback(t, r, o), t === "value" && this._internals.setFormValue(o), t === "custom-invalid")
|
113
|
+
if (typeof o == "string") {
|
114
|
+
const u = this.withFallback(o);
|
115
115
|
this._pristine = !1, this._internals.setValidity({ customError: !0 }, u), this.invalid = !0, this.hint = u, this.checkValidity();
|
116
116
|
} else
|
117
117
|
this._internals.setValidity({}), this.validateInput();
|
@@ -133,13 +133,13 @@ const f = class f extends g {
|
|
133
133
|
this._internals.setValidity({ customError: this._internals.validity.customError });
|
134
134
|
else {
|
135
135
|
this.invalid = !this._pristine && !r.valid;
|
136
|
-
let
|
137
|
-
for (
|
138
|
-
const h = `data-${
|
139
|
-
if (r[
|
136
|
+
let o;
|
137
|
+
for (o in r) {
|
138
|
+
const h = `data-${o.toString()}`;
|
139
|
+
if (r[o] && !this.hasAttribute(h) && this.debug && console.log(
|
140
140
|
`Add custom message on ${this.localName} using attribute: ${h.toUpperCase()}="Your custom message"`
|
141
|
-
), r[
|
142
|
-
this.validationError =
|
141
|
+
), r[o]) {
|
142
|
+
this.validationError = o.toString();
|
143
143
|
const u = this.hasAttribute(h) ? this.getAttribute(h) : this.$input.validationMessage;
|
144
144
|
this._internals.setValidity(
|
145
145
|
{ [this.validationError]: !0, customError: this._internals.validity.customError },
|
@@ -156,7 +156,7 @@ const f = class f extends g {
|
|
156
156
|
<label>
|
157
157
|
<div class=${this.hideLabel ? "visually-hidden" : ""} ?hidden=${t} id="label">
|
158
158
|
<slot>${this.label}</slot>
|
159
|
-
${this.required ?
|
159
|
+
${this.required ? S(c(this, d).term("required")) : m}
|
160
160
|
</div>
|
161
161
|
<div id="input">
|
162
162
|
${this.type === "search" ? p`<skf-icon class="skf-icon-host" name="search" size="sm"></skf-icon>` : m}
|
@@ -212,8 +212,8 @@ const f = class f extends g {
|
|
212
212
|
`;
|
213
213
|
}
|
214
214
|
};
|
215
|
-
d = new WeakMap(),
|
216
|
-
let i =
|
215
|
+
d = new WeakMap(), y.styles = [P, I];
|
216
|
+
let i = y;
|
217
217
|
e([
|
218
218
|
v()
|
219
219
|
], i.prototype, "_value", 2);
|
@@ -233,64 +233,64 @@ e([
|
|
233
233
|
s({ type: Boolean, attribute: "hide-label" })
|
234
234
|
], i.prototype, "hideLabel", 2);
|
235
235
|
e([
|
236
|
-
s()
|
236
|
+
s({ type: String })
|
237
237
|
], i.prototype, "hint", 2);
|
238
238
|
e([
|
239
|
-
s()
|
239
|
+
s({ type: String })
|
240
240
|
], i.prototype, "inputmode", 2);
|
241
241
|
e([
|
242
|
-
s()
|
242
|
+
s({ type: String })
|
243
243
|
], i.prototype, "label", 2);
|
244
244
|
e([
|
245
245
|
s({ type: String })
|
246
246
|
], i.prototype, "lang", 2);
|
247
247
|
e([
|
248
|
-
s()
|
248
|
+
s({ type: String })
|
249
249
|
], i.prototype, "leading", 2);
|
250
250
|
e([
|
251
|
-
s()
|
251
|
+
s({ type: String })
|
252
252
|
], i.prototype, "max", 2);
|
253
253
|
e([
|
254
254
|
s({ type: Number, attribute: "maxlength" })
|
255
255
|
], i.prototype, "maxLength", 2);
|
256
256
|
e([
|
257
|
-
s()
|
257
|
+
s({ type: String })
|
258
258
|
], i.prototype, "min", 2);
|
259
259
|
e([
|
260
260
|
s({ type: Number, attribute: "minlength" })
|
261
261
|
], i.prototype, "minLength", 2);
|
262
262
|
e([
|
263
|
-
s({ reflect: !0 })
|
263
|
+
s({ type: String, reflect: !0 })
|
264
264
|
], i.prototype, "name", 2);
|
265
265
|
e([
|
266
|
-
s()
|
266
|
+
s({ type: String })
|
267
267
|
], i.prototype, "pattern", 2);
|
268
268
|
e([
|
269
|
-
s()
|
269
|
+
s({ type: String })
|
270
270
|
], i.prototype, "placeholder", 2);
|
271
271
|
e([
|
272
272
|
s({ type: Boolean })
|
273
273
|
], i.prototype, "readonly", 2);
|
274
274
|
e([
|
275
|
-
s({ reflect: !0 })
|
275
|
+
s({ type: String, reflect: !0 })
|
276
276
|
], i.prototype, "severity", 2);
|
277
277
|
e([
|
278
278
|
s({ type: Boolean, attribute: "show-valid" })
|
279
279
|
], i.prototype, "showValid", 2);
|
280
280
|
e([
|
281
|
-
s({ reflect: !0 })
|
281
|
+
s({ type: String, reflect: !0 })
|
282
282
|
], i.prototype, "size", 2);
|
283
283
|
e([
|
284
|
-
s()
|
284
|
+
s({ type: String })
|
285
285
|
], i.prototype, "trailing", 2);
|
286
286
|
e([
|
287
|
-
s()
|
287
|
+
s({ type: String })
|
288
288
|
], i.prototype, "type", 2);
|
289
289
|
e([
|
290
|
-
s({ attribute: "validate-on" })
|
290
|
+
s({ type: String, attribute: "validate-on" })
|
291
291
|
], i.prototype, "validateOn", 2);
|
292
292
|
e([
|
293
|
-
s({})
|
293
|
+
s({ type: String })
|
294
294
|
], i.prototype, "value", 1);
|
295
295
|
e([
|
296
296
|
v()
|
@@ -299,10 +299,10 @@ e([
|
|
299
299
|
v()
|
300
300
|
], i.prototype, "_buttonDown", 2);
|
301
301
|
e([
|
302
|
-
|
302
|
+
k("input")
|
303
303
|
], i.prototype, "$input", 2);
|
304
304
|
e([
|
305
|
-
|
305
|
+
B({ flatten: !0 })
|
306
306
|
], i.prototype, "_defaultSlot", 2);
|
307
307
|
e([
|
308
308
|
E("value", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
@@ -17,9 +17,9 @@ export declare class SkfTag extends SkfElement {
|
|
17
17
|
#private;
|
18
18
|
static styles: CSSResultGroup;
|
19
19
|
/** @internal */
|
20
|
-
private
|
20
|
+
private _clickCallback?;
|
21
21
|
/** @internal */
|
22
|
-
private
|
22
|
+
private _preRemoveCallback?;
|
23
23
|
/** Specifies Tag size */
|
24
24
|
size: Size;
|
25
25
|
/** If defined, displays leading/provided icon */
|
@@ -29,11 +29,11 @@ export declare class SkfTag extends SkfElement {
|
|
29
29
|
/** Sets the internal language of the component */
|
30
30
|
lang: Language;
|
31
31
|
/** If defined, accepts a function that runs on click */
|
32
|
-
set
|
33
|
-
get
|
32
|
+
set clickCallback(clickCallbackFn: ((event: Event) => void) | undefined);
|
33
|
+
get clickCallback(): ((event: Event) => void) | undefined;
|
34
34
|
/** If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
|
35
|
-
set
|
36
|
-
get
|
35
|
+
set preRemoveCallback(preRemoveCallbackFn: ((event: Event) => void) | undefined);
|
36
|
+
get preRemoveCallback(): ((event: Event) => void) | undefined;
|
37
37
|
/** If true, adds trailing button to remove tag */
|
38
38
|
removable: boolean;
|
39
39
|
/** @internal */
|
@@ -1,53 +1,53 @@
|
|
1
|
-
var
|
2
|
-
throw TypeError(
|
1
|
+
var v = (t) => {
|
2
|
+
throw TypeError(t);
|
3
3
|
};
|
4
|
-
var
|
5
|
-
var
|
4
|
+
var u = (t, o, e) => o.has(t) || v("Cannot " + e);
|
5
|
+
var h = (t, o, e) => (u(t, o, "read from private field"), e ? e.call(t) : o.get(t)), m = (t, o, e) => o.has(t) ? v("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(t) : o.set(t, e), k = (t, o, e, s) => (u(t, o, "write to private field"), s ? s.call(t, e) : o.set(t, e), e);
|
6
6
|
import "../icon/icon.js";
|
7
7
|
import { SkfElement as g } from "../../internal/components/skf-element.js";
|
8
8
|
import { stateMap as w } from "../../internal/helpers/stateMap.js";
|
9
9
|
import { watch as $ } from "../../internal/helpers/watch.js";
|
10
10
|
import { componentStyles as R } from "../../styles/component.styles.js";
|
11
11
|
import { LocalizeController as z } from "../../utilities/localize.js";
|
12
|
-
import { nothing as
|
13
|
-
import { property as
|
12
|
+
import { nothing as y, html as C } from "lit";
|
13
|
+
import { property as a, query as D } from "lit/decorators.js";
|
14
14
|
import { ifDefined as E } from "lit/directives/if-defined.js";
|
15
15
|
import { styles as P } from "./tag.styles.js";
|
16
|
-
var S = Object.defineProperty, B = Object.getOwnPropertyDescriptor,
|
17
|
-
for (var i = s > 1 ? void 0 : s ? B(o,
|
18
|
-
(
|
19
|
-
return s && i && S(o,
|
16
|
+
var S = Object.defineProperty, B = Object.getOwnPropertyDescriptor, l = (t, o, e, s) => {
|
17
|
+
for (var i = s > 1 ? void 0 : s ? B(o, e) : o, b = t.length - 1, d; b >= 0; b--)
|
18
|
+
(d = t[b]) && (i = (s ? d(o, e, i) : d(i)) || i);
|
19
|
+
return s && i && S(o, e, i), i;
|
20
20
|
};
|
21
21
|
const _ = {
|
22
22
|
size: ["sm", "md"],
|
23
23
|
color: ["error", "info", "success", "warning"]
|
24
24
|
};
|
25
|
-
var
|
26
|
-
const
|
25
|
+
var n, c, p;
|
26
|
+
const f = class f extends g {
|
27
27
|
constructor() {
|
28
28
|
super(...arguments);
|
29
|
-
m(this,
|
29
|
+
m(this, n);
|
30
30
|
m(this, c);
|
31
|
-
m(this,
|
32
|
-
|
33
|
-
(
|
34
|
-
}, this._handleRemove = (
|
35
|
-
this.
|
36
|
-
}, this._handleClick = (
|
37
|
-
|
31
|
+
m(this, p);
|
32
|
+
k(this, n, new z(this)), k(this, c, this.attachInternals()), k(this, p, h(this, c).states), this.size = "md", this.lang = "en", this.removable = !1, this._handleKeyDown = (e) => {
|
33
|
+
(e.key === "Enter" || e.key === " ") && this.$removeButton.click();
|
34
|
+
}, this._handleRemove = (e) => {
|
35
|
+
this._preRemoveCallback && this._preRemoveCallback(e);
|
36
|
+
}, this._handleClick = (e) => {
|
37
|
+
e.stopPropagation(), e.composedPath()[0].localName === "button" ? this.remove() : this.clickCallback?.(e);
|
38
38
|
};
|
39
39
|
}
|
40
|
-
set
|
41
|
-
|
40
|
+
set clickCallback(e) {
|
41
|
+
e && (this._clickCallback = e);
|
42
42
|
}
|
43
|
-
get
|
44
|
-
return this.
|
43
|
+
get clickCallback() {
|
44
|
+
return this._clickCallback;
|
45
45
|
}
|
46
|
-
set
|
47
|
-
|
46
|
+
set preRemoveCallback(e) {
|
47
|
+
e && (this._preRemoveCallback = e);
|
48
48
|
}
|
49
|
-
get
|
50
|
-
return this.
|
49
|
+
get preRemoveCallback() {
|
50
|
+
return this._preRemoveCallback;
|
51
51
|
}
|
52
52
|
connectedCallback() {
|
53
53
|
super.connectedCallback(), this.addEventListener("click", this._handleClick);
|
@@ -55,59 +55,59 @@ const y = class y extends g {
|
|
55
55
|
disconnectedCallback() {
|
56
56
|
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick);
|
57
57
|
}
|
58
|
-
attributeChangedCallback(
|
59
|
-
super.attributeChangedCallback(
|
58
|
+
attributeChangedCallback(e, s, i) {
|
59
|
+
super.attributeChangedCallback(e, s, i), e === "removable" && i !== null ? this.addEventListener("keydown", this._handleKeyDown) : this.removeEventListener("keydown", this._handleKeyDown);
|
60
60
|
}
|
61
|
-
_handleStateChange(
|
62
|
-
w(
|
61
|
+
_handleStateChange(e, s, i) {
|
62
|
+
w(h(this, p), _[e]).set(i);
|
63
63
|
}
|
64
64
|
render() {
|
65
|
-
return
|
65
|
+
return C`
|
66
66
|
<div id="root">
|
67
|
-
${this.icon ?
|
67
|
+
${this.icon ? C`<skf-icon color=${E(this.color)} name=${this.icon} size="sm"></skf-icon>` : y}
|
68
68
|
<slot></slot>
|
69
|
-
${this.removable ?
|
69
|
+
${this.removable ? C`
|
70
70
|
<button
|
71
71
|
@click=${this._handleRemove}
|
72
|
-
aria-label=${
|
72
|
+
aria-label=${h(this, n).term("close")}
|
73
73
|
type="button"
|
74
74
|
>
|
75
75
|
<skf-icon name="close" size="xs"></skf-icon>
|
76
76
|
</button>
|
77
|
-
` :
|
77
|
+
` : y}
|
78
78
|
</div>
|
79
79
|
`;
|
80
80
|
}
|
81
81
|
};
|
82
|
-
|
83
|
-
let
|
84
|
-
|
85
|
-
|
86
|
-
],
|
87
|
-
|
88
|
-
|
89
|
-
],
|
90
|
-
|
91
|
-
|
92
|
-
],
|
93
|
-
|
94
|
-
|
95
|
-
],
|
96
|
-
|
97
|
-
|
98
|
-
],
|
99
|
-
|
100
|
-
|
101
|
-
],
|
102
|
-
|
103
|
-
|
104
|
-
],
|
105
|
-
|
82
|
+
n = new WeakMap(), c = new WeakMap(), p = new WeakMap(), f.styles = [R, P];
|
83
|
+
let r = f;
|
84
|
+
l([
|
85
|
+
a({ type: String })
|
86
|
+
], r.prototype, "size", 2);
|
87
|
+
l([
|
88
|
+
a({ type: String })
|
89
|
+
], r.prototype, "icon", 2);
|
90
|
+
l([
|
91
|
+
a({ type: String })
|
92
|
+
], r.prototype, "color", 2);
|
93
|
+
l([
|
94
|
+
a({ type: String })
|
95
|
+
], r.prototype, "lang", 2);
|
96
|
+
l([
|
97
|
+
a({ attribute: !1 })
|
98
|
+
], r.prototype, "clickCallback", 1);
|
99
|
+
l([
|
100
|
+
a({ attribute: !1 })
|
101
|
+
], r.prototype, "preRemoveCallback", 1);
|
102
|
+
l([
|
103
|
+
a({ type: Boolean })
|
104
|
+
], r.prototype, "removable", 2);
|
105
|
+
l([
|
106
106
|
D("button")
|
107
|
-
],
|
108
|
-
|
107
|
+
], r.prototype, "$removeButton", 2);
|
108
|
+
l([
|
109
109
|
$(Object.keys(_))
|
110
|
-
],
|
110
|
+
], r.prototype, "_handleStateChange", 1);
|
111
111
|
export {
|
112
|
-
|
112
|
+
r as SkfTag
|
113
113
|
};
|
@@ -41,6 +41,11 @@ const s = r`
|
|
41
41
|
border-radius: var(--skf-border-radius-sm);
|
42
42
|
outline: var(--skf-border-width-md) solid var(--skf-interactive-border-color-focus);
|
43
43
|
}
|
44
|
+
|
45
|
+
/* let button be first item in composedPath array */
|
46
|
+
& > * {
|
47
|
+
pointer-events: none;
|
48
|
+
}
|
44
49
|
}
|
45
50
|
}
|
46
51
|
|
@@ -4115,6 +4115,13 @@
|
|
4115
4115
|
},
|
4116
4116
|
"description": "Fires when the input is invalid",
|
4117
4117
|
"name": "invalid"
|
4118
|
+
},
|
4119
|
+
{
|
4120
|
+
"type": {
|
4121
|
+
"text": "CustomEvent"
|
4122
|
+
},
|
4123
|
+
"description": "Fires when the input is cleared",
|
4124
|
+
"name": "cleared"
|
4118
4125
|
}
|
4119
4126
|
],
|
4120
4127
|
"attributes": [
|
@@ -5697,12 +5704,12 @@
|
|
5697
5704
|
},
|
5698
5705
|
{
|
5699
5706
|
"kind": "field",
|
5700
|
-
"name": "
|
5707
|
+
"name": "clickCallback",
|
5701
5708
|
"description": "If defined, accepts a function that runs on click"
|
5702
5709
|
},
|
5703
5710
|
{
|
5704
5711
|
"kind": "field",
|
5705
|
-
"name": "
|
5712
|
+
"name": "preRemoveCallback",
|
5706
5713
|
"description": "If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`."
|
5707
5714
|
},
|
5708
5715
|
{
|
@@ -738,6 +738,8 @@ export type SkfInputProps = {
|
|
738
738
|
"onchange"?: (e: CustomEvent<CustomEvent>) => void;
|
739
739
|
/** Fires when the input is invalid */
|
740
740
|
"oninvalid"?: (e: CustomEvent<CustomEvent>) => void;
|
741
|
+
/** Fires when the input is cleared */
|
742
|
+
"oncleared"?: (e: CustomEvent<CustomEvent>) => void;
|
741
743
|
}
|
742
744
|
|
743
745
|
|
@@ -906,9 +908,9 @@ export type SkfTagProps = {
|
|
906
908
|
/** If true, adds trailing button to remove tag */
|
907
909
|
"removable"?: SkfTag['removable'];
|
908
910
|
/** If defined, accepts a function that runs on click */
|
909
|
-
"
|
911
|
+
"clickCallback"?: SkfTag['clickCallback'];
|
910
912
|
/** If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
|
911
|
-
"
|
913
|
+
"preRemoveCallback"?: SkfTag['preRemoveCallback'];
|
912
914
|
|
913
915
|
|
914
916
|
}
|
@@ -1860,6 +1862,7 @@ export type SkfTooltipProps = {
|
|
1860
1862
|
*
|
1861
1863
|
* - `change`: Fires when the value of the input changes
|
1862
1864
|
* - `invalid`: Fires when the input is invalid
|
1865
|
+
* - `cleared`: Fires when the input is cleared
|
1863
1866
|
*
|
1864
1867
|
* #### Slots
|
1865
1868
|
*
|
@@ -2109,8 +2112,8 @@ export type SkfTooltipProps = {
|
|
2109
2112
|
* - `color`: If defined, gives the supplied appearance
|
2110
2113
|
* - `lang`: Sets the internal language of the component
|
2111
2114
|
* - `removable`: If true, adds trailing button to remove tag
|
2112
|
-
* - `
|
2113
|
-
* - `
|
2115
|
+
* - `clickCallback`: If defined, accepts a function that runs on click (property only)
|
2116
|
+
* - `preRemoveCallback`: If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. (property only)
|
2114
2117
|
*
|
2115
2118
|
* #### Slots
|
2116
2119
|
*
|
@@ -444,6 +444,8 @@ type SkfInputProps = {
|
|
444
444
|
onchange?: (e: CustomEvent<CustomEvent>) => void;
|
445
445
|
/** Fires when the input is invalid */
|
446
446
|
oninvalid?: (e: CustomEvent<CustomEvent>) => void;
|
447
|
+
/** Fires when the input is cleared */
|
448
|
+
oncleared?: (e: CustomEvent<CustomEvent>) => void;
|
447
449
|
};
|
448
450
|
|
449
451
|
type SkfMenuItemProps = {
|
@@ -583,9 +585,9 @@ type SkfTagProps = {
|
|
583
585
|
/** If true, adds trailing button to remove tag */
|
584
586
|
removable?: SkfTag["removable"];
|
585
587
|
/** If defined, accepts a function that runs on click */
|
586
|
-
|
588
|
+
clickCallback?: SkfTag["clickCallback"];
|
587
589
|
/** If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`. */
|
588
|
-
|
590
|
+
preRemoveCallback?: SkfTag["preRemoveCallback"];
|
589
591
|
};
|
590
592
|
|
591
593
|
type SkfSelectProps = {
|
@@ -1107,6 +1109,7 @@ export type CustomElements = {
|
|
1107
1109
|
* ### **Events:**
|
1108
1110
|
* - **change** - Fires when the value of the input changes
|
1109
1111
|
* - **invalid** - Fires when the input is invalid
|
1112
|
+
* - **cleared** - Fires when the input is cleared
|
1110
1113
|
*
|
1111
1114
|
* ### **Slots:**
|
1112
1115
|
* - _default_ - The Inputs label. Alternatively, you can use the `label` attribute.
|
@@ -698,7 +698,7 @@
|
|
698
698
|
},
|
699
699
|
{
|
700
700
|
"name": "skf-input",
|
701
|
-
"description": "The skf-text-field is used to create a text input field. It can be used inside a form element or standalone\n\nSee [zeroheight](https://zeroheight.com/853e936c9/p/9481fa-input-field) for design principles\n---\n\n\n### **Events:**\n - **change** - Fires when the value of the input changes\n- **invalid** - Fires when the input is invalid\n\n### **Slots:**\n - _default_ - The Inputs label. Alternatively, you can use the `label` attribute.",
|
701
|
+
"description": "The skf-text-field is used to create a text input field. It can be used inside a form element or standalone\n\nSee [zeroheight](https://zeroheight.com/853e936c9/p/9481fa-input-field) for design principles\n---\n\n\n### **Events:**\n - **change** - Fires when the value of the input changes\n- **invalid** - Fires when the input is invalid\n- **cleared** - Fires when the input is cleared\n\n### **Slots:**\n - _default_ - The Inputs label. Alternatively, you can use the `label` attribute.",
|
702
702
|
"attributes": [
|
703
703
|
{
|
704
704
|
"name": "disabled",
|
package/dist/web-types.json
CHANGED
@@ -1553,7 +1553,7 @@
|
|
1553
1553
|
},
|
1554
1554
|
{
|
1555
1555
|
"name": "skf-input",
|
1556
|
-
"description": "The skf-text-field is used to create a text input field. It can be used inside a form element or standalone\n\nSee [zeroheight](https://zeroheight.com/853e936c9/p/9481fa-input-field) for design principles\n---\n\n\n### **Events:**\n - **change** - Fires when the value of the input changes\n- **invalid** - Fires when the input is invalid\n\n### **Slots:**\n - _default_ - The Inputs label. Alternatively, you can use the `label` attribute.",
|
1556
|
+
"description": "The skf-text-field is used to create a text input field. It can be used inside a form element or standalone\n\nSee [zeroheight](https://zeroheight.com/853e936c9/p/9481fa-input-field) for design principles\n---\n\n\n### **Events:**\n - **change** - Fires when the value of the input changes\n- **invalid** - Fires when the input is invalid\n- **cleared** - Fires when the input is cleared\n\n### **Slots:**\n - _default_ - The Inputs label. Alternatively, you can use the `label` attribute.",
|
1557
1557
|
"doc-url": "",
|
1558
1558
|
"attributes": [
|
1559
1559
|
{
|
@@ -1718,6 +1718,11 @@
|
|
1718
1718
|
"name": "invalid",
|
1719
1719
|
"type": "CustomEvent",
|
1720
1720
|
"description": "Fires when the input is invalid"
|
1721
|
+
},
|
1722
|
+
{
|
1723
|
+
"name": "cleared",
|
1724
|
+
"type": "CustomEvent",
|
1725
|
+
"description": "Fires when the input is cleared"
|
1721
1726
|
}
|
1722
1727
|
],
|
1723
1728
|
"js": {
|
@@ -1852,6 +1857,11 @@
|
|
1852
1857
|
"name": "invalid",
|
1853
1858
|
"type": "CustomEvent",
|
1854
1859
|
"description": "Fires when the input is invalid"
|
1860
|
+
},
|
1861
|
+
{
|
1862
|
+
"name": "cleared",
|
1863
|
+
"type": "CustomEvent",
|
1864
|
+
"description": "Fires when the input is cleared"
|
1855
1865
|
}
|
1856
1866
|
]
|
1857
1867
|
}
|
@@ -2483,11 +2493,11 @@
|
|
2483
2493
|
"type": "Language"
|
2484
2494
|
},
|
2485
2495
|
{
|
2486
|
-
"name": "
|
2496
|
+
"name": "clickCallback",
|
2487
2497
|
"description": "If defined, accepts a function that runs on click"
|
2488
2498
|
},
|
2489
2499
|
{
|
2490
|
-
"name": "
|
2500
|
+
"name": "preRemoveCallback",
|
2491
2501
|
"description": "If defined, accepts a function that runs on click. Self removal can be overridden by using `event.stopPropagation()`."
|
2492
2502
|
},
|
2493
2503
|
{
|
package/package.json
CHANGED