@skf-design-system/ui-components 1.0.2-beta.26 → 1.0.2-beta.28
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/datepicker/datepicker.component.d.ts +4 -0
- package/dist/components/datepicker/datepicker.component.js +38 -33
- package/dist/components/select/select.controllers.js +1 -1
- package/dist/components/textarea/textarea.component.d.ts +3 -0
- package/dist/components/tooltip/tooltip.component.js +2 -2
- package/dist/custom-elements.json +19 -21
- package/dist/internal/base-classes/popover/popover.base.d.ts +1 -1
- package/dist/internal/base-classes/popover/popover.base.js +48 -50
- package/dist/types/jsx/custom-element-jsx.d.ts +5 -8
- package/dist/types/vue/index.d.ts +2 -0
- package/dist/vscode.html-custom-data.json +5 -0
- package/dist/web-types.json +10 -0
- package/package.json +1 -1
|
@@ -46,6 +46,8 @@ export declare class SkfDatepicker extends FormBase {
|
|
|
46
46
|
/** If defined, adds name to the input-element */
|
|
47
47
|
name?: string;
|
|
48
48
|
placeholder: string;
|
|
49
|
+
/** Placeholder for the end date input in range mode */
|
|
50
|
+
placeholderEnd: string;
|
|
49
51
|
range: boolean;
|
|
50
52
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
|
51
53
|
readonly?: boolean;
|
|
@@ -101,6 +103,8 @@ export declare class SkfDatepicker extends FormBase {
|
|
|
101
103
|
_handleValueChange(): void;
|
|
102
104
|
private _handleDateSelected;
|
|
103
105
|
/** @internal */
|
|
106
|
+
private _handleDatepickerClose;
|
|
107
|
+
/** @internal */
|
|
104
108
|
_handleKeyboardEvents: (e: KeyboardEvent) => void;
|
|
105
109
|
/** @internal */
|
|
106
110
|
private _handleFocus;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var P = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var P = (l) => {
|
|
2
|
+
throw TypeError(l);
|
|
3
3
|
};
|
|
4
|
-
var S = (
|
|
5
|
-
var k = (
|
|
4
|
+
var S = (l, d, e) => d.has(l) || P("Cannot " + e);
|
|
5
|
+
var k = (l, d, e) => (S(l, d, "read from private field"), e ? e.call(l) : d.get(l)), E = (l, d, e) => d.has(l) ? P("Cannot add the same private member more than once") : d instanceof WeakSet ? d.add(l) : d.set(l, e), C = (l, d, e, t) => (S(l, d, "write to private field"), t ? t.call(l, e) : d.set(l, e), e);
|
|
6
6
|
import "../icon/icon.js";
|
|
7
7
|
import { computePosition as T, flip as B, offset as x } from "@floating-ui/dom";
|
|
8
8
|
import { FormBase as R } from "../../internal/components/formBase.js";
|
|
@@ -15,30 +15,32 @@ import { Temporal as I } from "@js-temporal/polyfill";
|
|
|
15
15
|
import { componentStyles as q } from "../../styles/component.styles.js";
|
|
16
16
|
import { LocalizeController as U } from "../../utilities/localize.js";
|
|
17
17
|
import { nothing as f, html as b } from "lit";
|
|
18
|
-
import { property as
|
|
18
|
+
import { property as o, state as D, query as $, queryAssignedNodes as N } from "lit/decorators.js";
|
|
19
19
|
import { ifDefined as u } from "lit/directives/if-defined.js";
|
|
20
20
|
import { live as O } from "lit/directives/live.js";
|
|
21
21
|
import "./datepicker-popup.js";
|
|
22
22
|
import { dateFormatter as v, is as m, isPopoverOpen as Y, debounce as z } from "./datepicker.helpers.js";
|
|
23
23
|
import { styles as W } from "./datepicker.styles.js";
|
|
24
|
-
var H = Object.defineProperty, K = Object.getOwnPropertyDescriptor, r = (
|
|
25
|
-
for (var i = t > 1 ? void 0 : t ? K(
|
|
26
|
-
(p =
|
|
27
|
-
return t && i && H(
|
|
24
|
+
var H = Object.defineProperty, K = Object.getOwnPropertyDescriptor, r = (l, d, e, t) => {
|
|
25
|
+
for (var i = t > 1 ? void 0 : t ? K(d, e) : d, h = l.length - 1, p; h >= 0; h--)
|
|
26
|
+
(p = l[h]) && (i = (t ? p(d, e, i) : p(i)) || i);
|
|
27
|
+
return t && i && H(d, e, i), i;
|
|
28
28
|
}, g;
|
|
29
29
|
const w = class w extends R {
|
|
30
30
|
constructor() {
|
|
31
31
|
super();
|
|
32
32
|
E(this, g);
|
|
33
|
-
C(this, g, new U(this)), this.popoverController = new A(this), this.id = "skf-datepicker-input", this.lang = "en", this.placeholder = "YYYY-MM-DD", this.range = !1, this.size = "md", this.validateOn = "change", this.invalid = !1, this.selectedRangeDates = { start: null, end: null }, this.showClearbutton = !1, this.abortController = new AbortController(), this.abortSignal = this.abortController.signal, this._handleSelectedDate = () => {
|
|
33
|
+
C(this, g, new U(this)), this.popoverController = new A(this), this.id = "skf-datepicker-input", this.lang = "en", this.placeholder = "YYYY-MM-DD", this.placeholderEnd = "", this.range = !1, this.size = "md", this.validateOn = "change", this.invalid = !1, this.selectedRangeDates = { start: null, end: null }, this.showClearbutton = !1, this.abortController = new AbortController(), this.abortSignal = this.abortController.signal, this._handleSelectedDate = () => {
|
|
34
34
|
this.pristine = !1, this._internals.setFormValue(this.value ?? ""), this.validateInput();
|
|
35
35
|
}, this._handleDateSelected = (e) => {
|
|
36
36
|
if (this.range && "start" in e.detail.date && "end" in e.detail.date) {
|
|
37
37
|
const t = e.detail.date.start, i = e.detail.date.end;
|
|
38
|
-
this.value = `${v(t)},${v(i)}`, this.selectedRangeDates = { start: t, end: i };
|
|
39
|
-
} else !this.range && e.detail.date instanceof Date && (this.value = v(e.detail.date), this.
|
|
38
|
+
this.value = `${v(t)},${v(i)}`, this.selectedRangeDates = { start: t, end: i }, t && i && this._handleDatepickerClose();
|
|
39
|
+
} else !this.range && e.detail.date instanceof Date && (this.value = v(e.detail.date), this._handleDatepickerClose());
|
|
40
|
+
}, this._handleDatepickerClose = () => {
|
|
41
|
+
this._animatePopover({ el: this.$popover, show: !1 }).then(() => {
|
|
40
42
|
this.$popover.hidePopover();
|
|
41
|
-
})
|
|
43
|
+
});
|
|
42
44
|
}, this._handleKeyboardEvents = (e) => {
|
|
43
45
|
const t = e.target.closest("input");
|
|
44
46
|
if (t) {
|
|
@@ -47,7 +49,7 @@ const w = class w extends R {
|
|
|
47
49
|
t.value = p.join("");
|
|
48
50
|
}
|
|
49
51
|
if (t.name.endsWith("-end") && (e.key === "Backspace" && t.value.length === 0 || t.selectionStart === 0 && e.key === "ArrowLeft") && (e.preventDefault(), this.$input.focus()), e.key === "Tab" && !e.shiftKey && t.name.endsWith("-end") && (e.preventDefault(), this.$popover.childNodes[1].shadowRoot?.querySelector("skf-datepicker-calendar")?.shadowRoot?.querySelector("button")?.focus()), (t.value.length === 4 || t.value.length === 7) && /[[0-9]/.test(e.key) && (t.value = `${t.value}-${e.key}`, e.preventDefault()), e.key === "Escape")
|
|
50
|
-
if (t.blur(), this.$popover.hidePopover(), this.range) {
|
|
52
|
+
if (e.stopPropagation(), t.blur(), this.$popover.hidePopover(), this.range) {
|
|
51
53
|
const i = this.$input.value, h = this.$input_range_end.value;
|
|
52
54
|
if (!m(i, h).date()) return;
|
|
53
55
|
this.$datepickerPopup.selectedDateRange = {
|
|
@@ -323,7 +325,7 @@ const w = class w extends R {
|
|
|
323
325
|
inputmode=${u(this.inputMode)}
|
|
324
326
|
maxlength="10"
|
|
325
327
|
name=${(this.name ?? "calendar") + "-end"}
|
|
326
|
-
placeholder=${
|
|
328
|
+
placeholder=${this.placeholderEnd || this.placeholder}
|
|
327
329
|
type="text"
|
|
328
330
|
/>
|
|
329
331
|
` : f}
|
|
@@ -370,61 +372,64 @@ const w = class w extends R {
|
|
|
370
372
|
g = new WeakMap(), w.styles = [q, W];
|
|
371
373
|
let s = w;
|
|
372
374
|
r([
|
|
373
|
-
|
|
375
|
+
o({ attribute: "custom-invalid", reflect: !0 })
|
|
374
376
|
], s.prototype, "customInvalid", 1);
|
|
375
377
|
r([
|
|
376
|
-
|
|
378
|
+
o({ type: String })
|
|
377
379
|
], s.prototype, "id", 2);
|
|
378
380
|
r([
|
|
379
|
-
|
|
381
|
+
o()
|
|
380
382
|
], s.prototype, "label", 2);
|
|
381
383
|
r([
|
|
382
|
-
|
|
384
|
+
o({ type: String })
|
|
383
385
|
], s.prototype, "lang", 2);
|
|
384
386
|
r([
|
|
385
|
-
|
|
387
|
+
o({ type: Boolean, attribute: "hide-label" })
|
|
386
388
|
], s.prototype, "hideLabel", 2);
|
|
387
389
|
r([
|
|
388
|
-
|
|
390
|
+
o()
|
|
389
391
|
], s.prototype, "hint", 2);
|
|
390
392
|
r([
|
|
391
|
-
|
|
393
|
+
o({ attribute: "invalid-dates" })
|
|
392
394
|
], s.prototype, "invalidDates", 2);
|
|
393
395
|
r([
|
|
394
|
-
|
|
396
|
+
o({ reflect: !0 })
|
|
395
397
|
], s.prototype, "name", 2);
|
|
396
398
|
r([
|
|
397
|
-
|
|
399
|
+
o()
|
|
398
400
|
], s.prototype, "placeholder", 2);
|
|
399
401
|
r([
|
|
400
|
-
|
|
402
|
+
o({ attribute: "placeholder-end" })
|
|
403
|
+
], s.prototype, "placeholderEnd", 2);
|
|
404
|
+
r([
|
|
405
|
+
o({ type: Boolean })
|
|
401
406
|
], s.prototype, "range", 2);
|
|
402
407
|
r([
|
|
403
|
-
|
|
408
|
+
o({ type: Boolean })
|
|
404
409
|
], s.prototype, "readonly", 2);
|
|
405
410
|
r([
|
|
406
|
-
|
|
411
|
+
o({ attribute: "selectable-from" })
|
|
407
412
|
], s.prototype, "selectableFrom", 2);
|
|
408
413
|
r([
|
|
409
|
-
|
|
414
|
+
o({ attribute: "selectable-to" })
|
|
410
415
|
], s.prototype, "selectableTo", 2);
|
|
411
416
|
r([
|
|
412
|
-
|
|
417
|
+
o({ reflect: !0 })
|
|
413
418
|
], s.prototype, "severity", 2);
|
|
414
419
|
r([
|
|
415
|
-
|
|
420
|
+
o({ reflect: !0 })
|
|
416
421
|
], s.prototype, "size", 2);
|
|
417
422
|
r([
|
|
418
|
-
|
|
423
|
+
o({ type: String, attribute: "validate-on" })
|
|
419
424
|
], s.prototype, "validateOn", 2);
|
|
420
425
|
r([
|
|
421
|
-
|
|
426
|
+
o()
|
|
422
427
|
], s.prototype, "value", 2);
|
|
423
428
|
r([
|
|
424
429
|
D()
|
|
425
430
|
], s.prototype, "_init_date", 2);
|
|
426
431
|
r([
|
|
427
|
-
|
|
432
|
+
o({ type: Boolean, reflect: !0 })
|
|
428
433
|
], s.prototype, "invalid", 2);
|
|
429
434
|
r([
|
|
430
435
|
D()
|
|
@@ -35,7 +35,7 @@ class p {
|
|
|
35
35
|
e.preventDefault(), this._selectFocusedOption(e.target);
|
|
36
36
|
break;
|
|
37
37
|
case "Escape":
|
|
38
|
-
e.preventDefault(), this.host && (this.host._expanded = !1), setTimeout(() => {
|
|
38
|
+
e.stopPropagation(), e.preventDefault(), this.host && (this.host._expanded = !1), setTimeout(() => {
|
|
39
39
|
this.host.focus();
|
|
40
40
|
});
|
|
41
41
|
break;
|
|
@@ -74,8 +74,11 @@ export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
|
|
|
74
74
|
private $input?;
|
|
75
75
|
firstUpdated(): void;
|
|
76
76
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
77
|
+
/** @internal */
|
|
77
78
|
_invalidChanged(): void;
|
|
79
|
+
/** @internal */
|
|
78
80
|
_hintChanged(): void;
|
|
81
|
+
/** @internal */
|
|
79
82
|
_valueChanged(): void;
|
|
80
83
|
/** @internal */
|
|
81
84
|
_resetValue: (event: Event) => void;
|
|
@@ -12,13 +12,13 @@ const e = class e extends t {
|
|
|
12
12
|
s.addEventListener(
|
|
13
13
|
"blur",
|
|
14
14
|
() => {
|
|
15
|
-
this.close(
|
|
15
|
+
this.close();
|
|
16
16
|
},
|
|
17
17
|
{ signal: this._signal }
|
|
18
18
|
), s.addEventListener("focus", this.open, { signal: this._signal }), s.addEventListener("mouseenter", this.open, { signal: this._signal }), s.addEventListener(
|
|
19
19
|
"mouseleave",
|
|
20
20
|
() => {
|
|
21
|
-
this.close(
|
|
21
|
+
this.close();
|
|
22
22
|
},
|
|
23
23
|
{ signal: this._signal }
|
|
24
24
|
);
|
|
@@ -2181,6 +2181,16 @@
|
|
|
2181
2181
|
"default": "'YYYY-MM-DD'",
|
|
2182
2182
|
"attribute": "placeholder"
|
|
2183
2183
|
},
|
|
2184
|
+
{
|
|
2185
|
+
"kind": "field",
|
|
2186
|
+
"name": "placeholderEnd",
|
|
2187
|
+
"type": {
|
|
2188
|
+
"text": "string"
|
|
2189
|
+
},
|
|
2190
|
+
"default": "''",
|
|
2191
|
+
"description": "Placeholder for the end date input in range mode",
|
|
2192
|
+
"attribute": "placeholder-end"
|
|
2193
|
+
},
|
|
2184
2194
|
{
|
|
2185
2195
|
"kind": "field",
|
|
2186
2196
|
"name": "range",
|
|
@@ -2409,6 +2419,15 @@
|
|
|
2409
2419
|
"default": "'YYYY-MM-DD'",
|
|
2410
2420
|
"fieldName": "placeholder"
|
|
2411
2421
|
},
|
|
2422
|
+
{
|
|
2423
|
+
"name": "placeholder-end",
|
|
2424
|
+
"type": {
|
|
2425
|
+
"text": "string"
|
|
2426
|
+
},
|
|
2427
|
+
"default": "''",
|
|
2428
|
+
"description": "Placeholder for the end date input in range mode",
|
|
2429
|
+
"fieldName": "placeholderEnd"
|
|
2430
|
+
},
|
|
2412
2431
|
{
|
|
2413
2432
|
"name": "range",
|
|
2414
2433
|
"type": {
|
|
@@ -7627,27 +7646,6 @@
|
|
|
7627
7646
|
"default": "''",
|
|
7628
7647
|
"description": "The current value of the text area",
|
|
7629
7648
|
"attribute": "value"
|
|
7630
|
-
},
|
|
7631
|
-
{
|
|
7632
|
-
"kind": "method",
|
|
7633
|
-
"name": "_invalidChanged",
|
|
7634
|
-
"type": {
|
|
7635
|
-
"text": "_invalidChanged() => void"
|
|
7636
|
-
}
|
|
7637
|
-
},
|
|
7638
|
-
{
|
|
7639
|
-
"kind": "method",
|
|
7640
|
-
"name": "_hintChanged",
|
|
7641
|
-
"type": {
|
|
7642
|
-
"text": "_hintChanged() => void"
|
|
7643
|
-
}
|
|
7644
|
-
},
|
|
7645
|
-
{
|
|
7646
|
-
"kind": "method",
|
|
7647
|
-
"name": "_valueChanged",
|
|
7648
|
-
"type": {
|
|
7649
|
-
"text": "_valueChanged() => void"
|
|
7650
|
-
}
|
|
7651
7649
|
}
|
|
7652
7650
|
],
|
|
7653
7651
|
"events": [
|
|
@@ -53,7 +53,7 @@ export declare class SkfPopoverBase extends SkfElement {
|
|
|
53
53
|
reposition: () => Promise<void>;
|
|
54
54
|
handleEscapeKey: (e: KeyboardEvent) => void;
|
|
55
55
|
open: (e: Event) => void;
|
|
56
|
-
close: (
|
|
56
|
+
close: () => void;
|
|
57
57
|
/** @internal eventlisteners here should implement abort signal */
|
|
58
58
|
addEventListeners($element: HTMLElement | Element): void;
|
|
59
59
|
/** @internal */
|
|
@@ -8,18 +8,18 @@ import { nothing as P, html as m } from "lit";
|
|
|
8
8
|
import { property as u, state as c, query as S } from "lit/decorators.js";
|
|
9
9
|
import { classMap as A } from "lit/directives/class-map.js";
|
|
10
10
|
import { styles as L } from "./popover.styles.js";
|
|
11
|
-
var x = Object.defineProperty, F = Object.getOwnPropertyDescriptor,
|
|
12
|
-
for (var e = o > 1 ? void 0 : o ? F(t,
|
|
13
|
-
(a = g[n]) && (e = (o ? a(t,
|
|
14
|
-
return o && e && x(t,
|
|
15
|
-
},
|
|
16
|
-
const
|
|
11
|
+
var x = Object.defineProperty, F = Object.getOwnPropertyDescriptor, i = (g, t, r, o) => {
|
|
12
|
+
for (var e = o > 1 ? void 0 : o ? F(t, r) : t, n = g.length - 1, a; n >= 0; n--)
|
|
13
|
+
(a = g[n]) && (e = (o ? a(t, r, e) : a(e)) || e);
|
|
14
|
+
return o && e && x(t, r, e), e;
|
|
15
|
+
}, l;
|
|
16
|
+
const s = (l = class extends C {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments), this._skipClosingThisTick = !1, this._abortCtrl = new AbortController(), this._signal = this._abortCtrl.signal, this.$popover = this, this.placement = "top", this.variant = "popup", this.isOpen = !1, this.offset = 0, this.arrow = !1, this.triggerEvent = "mouseenter", this.popoverController = new E(this), this._toggleOpen = (t) => {
|
|
19
19
|
this.isOpen = t ?? !this.isOpen;
|
|
20
20
|
}, this._handleToggle = (t) => {
|
|
21
|
-
const
|
|
22
|
-
this.isOpen =
|
|
21
|
+
const r = t.newState === "open";
|
|
22
|
+
this.isOpen = r, this.emit(r ? "skf-opened" : "skf-closed");
|
|
23
23
|
}, this.handleToggleOpen = async () => {
|
|
24
24
|
this.$anchor && (this.isOpen ? (this.$popover.togglePopover(!0), this.$popover.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 250, fill: "forwards" })) : (await this.$popover.animate([{ opacity: 0 }], { duration: 150, fill: "forwards" }).finished, this.$popover && this.$popover.togglePopover(this.isOpen)));
|
|
25
25
|
}, this.handleAnchorChange = async () => {
|
|
@@ -31,16 +31,16 @@ const i = (h = class extends C {
|
|
|
31
31
|
if (!this.$anchor) return;
|
|
32
32
|
const t = [y(), $(this.offset)];
|
|
33
33
|
this.arrow && t.push(O({ element: this.$arrow }));
|
|
34
|
-
const { x:
|
|
34
|
+
const { x: r, y: o, middlewareData: e } = await _(this.$anchor, this.$popover, {
|
|
35
35
|
placement: this.placement,
|
|
36
36
|
middleware: t,
|
|
37
37
|
strategy: "fixed"
|
|
38
38
|
});
|
|
39
39
|
if (Object.assign(this.$popover.style, {
|
|
40
|
-
left: `${String(
|
|
40
|
+
left: `${String(r)}px`,
|
|
41
41
|
top: `${String(o)}px`
|
|
42
42
|
}), this.arrow) {
|
|
43
|
-
const n = this.placement.split("-")[0], a = { top: "bottom", right: "left", bottom: "top", left: "right" }[n] ?? "", p = e.flip?.index, d = e.arrow?.x,
|
|
43
|
+
const n = this.placement.split("-")[0], a = { top: "bottom", right: "left", bottom: "top", left: "right" }[n] ?? "", p = e.flip?.index, d = e.arrow?.x, h = e.arrow?.y, v = typeof d == "number" ? `${String(d)}px` : "", b = typeof h == "number" ? `${String(h)}px` : "", w = {
|
|
44
44
|
bottom: 45,
|
|
45
45
|
right: 135,
|
|
46
46
|
top: 225,
|
|
@@ -59,8 +59,8 @@ const i = (h = class extends C {
|
|
|
59
59
|
t.stopPropagation(), this.tagName === "SKF-TOOLTIP" && this.isOpen && this.close();
|
|
60
60
|
const o = this.tagName === "SKF-MENU" ? void 0 : !0;
|
|
61
61
|
this._toggleOpen(o), this._abortCtrl = new AbortController(), this._signal = this._abortCtrl.signal, document.addEventListener("keydown", this.handleEscapeKey, { signal: this._signal }), this.tagName === "SKF-TOOLTIP" && this.$anchor?.setAttribute("aria-describedby", this.id);
|
|
62
|
-
}, this.close = (
|
|
63
|
-
|
|
62
|
+
}, this.close = () => {
|
|
63
|
+
this._toggleOpen(!1), this._abortCtrl.abort(), this.tagName === "SKF-TOOLTIP" && this.$anchor?.removeAttribute("aria-describedby");
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
connectedCallback() {
|
|
@@ -78,25 +78,23 @@ const i = (h = class extends C {
|
|
|
78
78
|
"focusout",
|
|
79
79
|
(o) => {
|
|
80
80
|
const e = this.contains(o.relatedTarget);
|
|
81
|
-
t && e || this._skipClosingThisTick || this.close(
|
|
81
|
+
t && e || this._skipClosingThisTick || this.close();
|
|
82
82
|
},
|
|
83
83
|
{ signal: this._signal }
|
|
84
84
|
), this.addEventListener(
|
|
85
85
|
"focusout",
|
|
86
86
|
(o) => {
|
|
87
87
|
const e = this.contains(o.relatedTarget);
|
|
88
|
-
t && e || this.close(
|
|
88
|
+
t && e || this.contains(o.target) || this.close();
|
|
89
89
|
},
|
|
90
90
|
{ signal: this._signal }
|
|
91
91
|
), this._skfPopoverOutsideClickListener ??= (o) => {
|
|
92
|
-
this.isOpen && this.$anchor && !this.contains(o.target) && !this.$anchor.contains(o.target) ? this.close(
|
|
92
|
+
this.isOpen && this.$anchor && !this.contains(o.target) && !this.$anchor.contains(o.target) ? this.close() : (this._skipClosingThisTick = !0, setTimeout(() => {
|
|
93
93
|
this._skipClosingThisTick = !1;
|
|
94
94
|
}, 0));
|
|
95
95
|
}, document.addEventListener("mousedown", this._skfPopoverOutsideClickListener, {
|
|
96
96
|
signal: this._signal
|
|
97
|
-
})
|
|
98
|
-
const s = window.top && window.self !== window.top;
|
|
99
|
-
console.log("contains frames", s), s && window.top && !this._skipClosingThisTick && window.top.addEventListener("mousedown", this._skfPopoverOutsideClickListener, {
|
|
97
|
+
}), window.top && window.self !== window.top && window.top && !this._skipClosingThisTick && window.top.addEventListener("mousedown", this._skfPopoverOutsideClickListener, {
|
|
100
98
|
signal: this._signal
|
|
101
99
|
}), this.$popover.id = await T(this.$anchor.id), ["popup", "menu"].includes(this.variant) && (this.$anchor.setAttribute("aria-haspopup", "true"), this.setAttribute("aria-labelledby", this.$anchor.id)), ["menu"].includes(this.variant) && this.$anchor.setAttribute("aria-controls", this.$popover.id), ["popup"].includes(this.variant) && t && (this.role = "dialog"), ["tooltip"].includes(this.variant) && this.$anchor.addEventListener("focusin", this.open, { signal: this._signal });
|
|
102
100
|
}
|
|
@@ -110,7 +108,7 @@ const i = (h = class extends C {
|
|
|
110
108
|
}
|
|
111
109
|
render() {
|
|
112
110
|
return ["popup", "menu"].includes(this.variant) && this.$anchor?.setAttribute("aria-expanded", this.isOpen ? "true" : "false"), m`
|
|
113
|
-
<div class=${A({ popover: !0, ...
|
|
111
|
+
<div class=${A({ popover: !0, ...l.classMap })} id="root">
|
|
114
112
|
<slot></slot>
|
|
115
113
|
${this.arrow ? m`<div id="arrow"></div>` : P}
|
|
116
114
|
</div>
|
|
@@ -129,52 +127,52 @@ const i = (h = class extends C {
|
|
|
129
127
|
function e(n, a) {
|
|
130
128
|
const p = Array.from(
|
|
131
129
|
n.querySelectorAll(a.join(", "))
|
|
132
|
-
), d = Array.from(n.querySelectorAll("*")).map((
|
|
133
|
-
for (const
|
|
130
|
+
), d = Array.from(n.querySelectorAll("*")).map((h) => h.shadowRoot).filter((h) => h !== null);
|
|
131
|
+
for (const h of d)
|
|
134
132
|
p.push(
|
|
135
|
-
...e(
|
|
133
|
+
...e(h, a)
|
|
136
134
|
);
|
|
137
135
|
return p;
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
|
-
},
|
|
141
|
-
|
|
138
|
+
}, l.styles = [k, L], l.classMap = {}, l);
|
|
139
|
+
i([
|
|
142
140
|
u()
|
|
143
|
-
],
|
|
144
|
-
|
|
141
|
+
], s.prototype, "placement", 2);
|
|
142
|
+
i([
|
|
145
143
|
u()
|
|
146
|
-
],
|
|
147
|
-
|
|
144
|
+
], s.prototype, "variant", 2);
|
|
145
|
+
i([
|
|
148
146
|
u()
|
|
149
|
-
],
|
|
150
|
-
|
|
147
|
+
], s.prototype, "anchor", 2);
|
|
148
|
+
i([
|
|
151
149
|
c()
|
|
152
|
-
],
|
|
153
|
-
|
|
150
|
+
], s.prototype, "isOpen", 2);
|
|
151
|
+
i([
|
|
154
152
|
c()
|
|
155
|
-
],
|
|
156
|
-
|
|
153
|
+
], s.prototype, "offset", 2);
|
|
154
|
+
i([
|
|
157
155
|
c()
|
|
158
|
-
],
|
|
159
|
-
|
|
156
|
+
], s.prototype, "$anchor", 2);
|
|
157
|
+
i([
|
|
160
158
|
c()
|
|
161
|
-
],
|
|
162
|
-
|
|
159
|
+
], s.prototype, "arrow", 2);
|
|
160
|
+
i([
|
|
163
161
|
c()
|
|
164
|
-
],
|
|
165
|
-
|
|
162
|
+
], s.prototype, "triggerEvent", 2);
|
|
163
|
+
i([
|
|
166
164
|
S("#arrow")
|
|
167
|
-
],
|
|
168
|
-
|
|
165
|
+
], s.prototype, "$arrow", 2);
|
|
166
|
+
i([
|
|
169
167
|
f("isOpen", { afterUpdate: !0 })
|
|
170
|
-
],
|
|
171
|
-
|
|
168
|
+
], s.prototype, "handleToggleOpen", 2);
|
|
169
|
+
i([
|
|
172
170
|
f("$anchor")
|
|
173
|
-
],
|
|
174
|
-
|
|
171
|
+
], s.prototype, "handleAnchorEl", 1);
|
|
172
|
+
i([
|
|
175
173
|
f("anchor")
|
|
176
|
-
],
|
|
177
|
-
let
|
|
174
|
+
], s.prototype, "handleAnchorChange", 2);
|
|
175
|
+
let W = s;
|
|
178
176
|
export {
|
|
179
|
-
|
|
177
|
+
W as SkfPopoverBase
|
|
180
178
|
};
|
|
@@ -481,6 +481,10 @@ export type SkfDatepickerProps = {
|
|
|
481
481
|
"name"?: SkfDatepicker['name'];
|
|
482
482
|
/** */
|
|
483
483
|
"placeholder"?: SkfDatepicker['placeholder'];
|
|
484
|
+
/** Placeholder for the end date input in range mode */
|
|
485
|
+
"placeholder-end"?: SkfDatepicker['placeholderEnd'];
|
|
486
|
+
/** Placeholder for the end date input in range mode */
|
|
487
|
+
"placeholderEnd"?: SkfDatepicker['placeholderEnd'];
|
|
484
488
|
/** */
|
|
485
489
|
"range"?: SkfDatepicker['range'];
|
|
486
490
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
|
@@ -1590,6 +1594,7 @@ export type SkfTooltipProps = {
|
|
|
1590
1594
|
* - `invalid-dates`/`invalidDates`: A comma-separated list of dates (yyyy-mm-dd format) that are not selectable.
|
|
1591
1595
|
* - `name`: If defined, adds name to the input-element
|
|
1592
1596
|
* - `placeholder`: undefined
|
|
1597
|
+
* - `placeholder-end`/`placeholderEnd`: Placeholder for the end date input in range mode
|
|
1593
1598
|
* - `range`: undefined
|
|
1594
1599
|
* - `readonly`: If true, makes the element not mutable, meaning the user can not edit the control
|
|
1595
1600
|
* - `selectable-from`/`selectableFrom`: Earliest selectable date. (yyyy-mm-dd format)
|
|
@@ -2491,14 +2496,6 @@ export type SkfTooltipProps = {
|
|
|
2491
2496
|
* Areas where markup can be added to the component.
|
|
2492
2497
|
*
|
|
2493
2498
|
* - `(default)`: The textareas label. Alternatively, you can use the `label` attribute.
|
|
2494
|
-
*
|
|
2495
|
-
* ## Methods
|
|
2496
|
-
*
|
|
2497
|
-
* Methods that can be called to access component functionality.
|
|
2498
|
-
*
|
|
2499
|
-
* - `_invalidChanged() => void`: undefined
|
|
2500
|
-
* - `_hintChanged() => void`: undefined
|
|
2501
|
-
* - `_valueChanged() => void`: undefined
|
|
2502
2499
|
*/
|
|
2503
2500
|
"skf-textarea": Partial<SkfTextAreaProps & BaseProps<SkfTextArea> & BaseEvents>;
|
|
2504
2501
|
|
|
@@ -243,6 +243,8 @@ type SkfDatepickerProps = {
|
|
|
243
243
|
name?: SkfDatepicker["name"];
|
|
244
244
|
/** */
|
|
245
245
|
placeholder?: SkfDatepicker["placeholder"];
|
|
246
|
+
/** Placeholder for the end date input in range mode */
|
|
247
|
+
"placeholder-end"?: SkfDatepicker["placeholderEnd"];
|
|
246
248
|
/** */
|
|
247
249
|
range?: SkfDatepicker["range"];
|
|
248
250
|
/** If true, makes the element not mutable, meaning the user can not edit the control */
|
|
@@ -403,6 +403,11 @@
|
|
|
403
403
|
"values": []
|
|
404
404
|
},
|
|
405
405
|
{ "name": "placeholder", "values": [] },
|
|
406
|
+
{
|
|
407
|
+
"name": "placeholder-end",
|
|
408
|
+
"description": "Placeholder for the end date input in range mode",
|
|
409
|
+
"values": []
|
|
410
|
+
},
|
|
406
411
|
{ "name": "range", "values": [] },
|
|
407
412
|
{
|
|
408
413
|
"name": "readonly",
|
package/dist/web-types.json
CHANGED
|
@@ -863,6 +863,11 @@
|
|
|
863
863
|
"name": "placeholder",
|
|
864
864
|
"value": { "type": "string", "default": "'YYYY-MM-DD'" }
|
|
865
865
|
},
|
|
866
|
+
{
|
|
867
|
+
"name": "placeholder-end",
|
|
868
|
+
"description": "Placeholder for the end date input in range mode",
|
|
869
|
+
"value": { "type": "string", "default": "''" }
|
|
870
|
+
},
|
|
866
871
|
{
|
|
867
872
|
"name": "range",
|
|
868
873
|
"value": { "type": "boolean", "default": "false" }
|
|
@@ -972,6 +977,11 @@
|
|
|
972
977
|
"type": "string | undefined"
|
|
973
978
|
},
|
|
974
979
|
{ "name": "placeholder", "type": "string" },
|
|
980
|
+
{
|
|
981
|
+
"name": "placeholderEnd",
|
|
982
|
+
"description": "Placeholder for the end date input in range mode",
|
|
983
|
+
"type": "string"
|
|
984
|
+
},
|
|
975
985
|
{ "name": "range", "type": "boolean" },
|
|
976
986
|
{
|
|
977
987
|
"name": "readonly",
|
package/package.json
CHANGED