@sbb-esta/lyne-elements 0.52.0 → 0.52.1
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/accordion.js +54 -54
- package/action-group.js +3 -3
- package/alert/alert-group.js +22 -22
- package/alert/alert.js +22 -22
- package/autocomplete.js +126 -126
- package/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/breadcrumb/breadcrumb-group.js +70 -69
- package/breadcrumb/breadcrumb.js +17 -17
- package/calendar.js +423 -423
- package/card/card-badge.js +17 -17
- package/card/card.js +2 -2
- package/card/common.js +30 -30
- package/checkbox/checkbox-group.js +17 -17
- package/checkbox/checkbox.js +34 -34
- package/clock.js +83 -83
- package/container/sticky-bar.js +16 -16
- package/core/a11y.js +91 -91
- package/core/base-elements.js +87 -88
- package/core/controllers.js +40 -40
- package/core/datetime.js +34 -36
- package/core/dom.js +26 -26
- package/core/eventing.js +33 -33
- package/core/mixins.js +122 -122
- package/core/overlay/overlay.d.ts.map +1 -1
- package/core/overlay.js +55 -50
- package/core/testing/event-spy.d.ts +1 -1
- package/core/testing/wait-for-image-ready.d.ts +4 -0
- package/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/core/testing.d.ts +1 -0
- package/core/testing.d.ts.map +1 -1
- package/core/testing.js +42 -31
- package/custom-elements.json +70 -4
- package/datepicker/common.js +55 -55
- package/datepicker/datepicker-toggle.js +94 -94
- package/datepicker/datepicker.js +144 -144
- package/development/accordion.js +2 -3
- package/development/action-group.js +2 -3
- package/development/alert/alert-group.js +2 -3
- package/development/alert/alert.js +2 -3
- package/development/autocomplete.js +2 -3
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/development/breadcrumb/breadcrumb-group.js +5 -5
- package/development/breadcrumb/breadcrumb.js +2 -3
- package/development/button/button-link.js +2 -3
- package/development/button/button-static.js +2 -3
- package/development/button/button.js +2 -3
- package/development/button/common.js +2 -3
- package/development/button/mini-button.js +2 -3
- package/development/button/secondary-button-link.js +2 -3
- package/development/button/secondary-button-static.js +2 -3
- package/development/button/secondary-button.js +2 -3
- package/development/button/tertiary-button-link.js +2 -3
- package/development/button/tertiary-button-static.js +2 -3
- package/development/button/tertiary-button.js +2 -3
- package/development/button/transparent-button-link.js +2 -3
- package/development/button/transparent-button-static.js +2 -3
- package/development/button/transparent-button.js +2 -3
- package/development/calendar.js +2 -3
- package/development/card/card-badge.js +2 -3
- package/development/card/card-button.js +2 -3
- package/development/card/card-link.js +2 -3
- package/development/card/card.js +2 -3
- package/development/card/common.js +2 -3
- package/development/checkbox/checkbox-group.js +2 -3
- package/development/checkbox/checkbox.js +2 -3
- package/development/chip.js +2 -3
- package/development/clock.js +2 -3
- package/development/container/container.js +2 -3
- package/development/container/sticky-bar.js +2 -3
- package/development/core/base-elements.js +4 -7
- package/development/core/mixins.js +7 -13
- package/development/core/overlay/overlay.d.ts.map +1 -1
- package/development/core/overlay.js +9 -3
- package/development/core/testing/event-spy.d.ts +1 -1
- package/development/core/testing/wait-for-image-ready.d.ts +4 -0
- package/development/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/development/core/testing.d.ts +1 -0
- package/development/core/testing.d.ts.map +1 -1
- package/development/core/testing.js +17 -1
- package/development/datepicker/common.js +2 -3
- package/development/datepicker/datepicker-next-day.js +2 -3
- package/development/datepicker/datepicker-previous-day.js +2 -3
- package/development/datepicker/datepicker-toggle.js +2 -3
- package/development/datepicker/datepicker.js +2 -3
- package/development/dialog/dialog-actions.js +2 -3
- package/development/dialog/dialog-content.js +2 -3
- package/development/dialog/dialog-title.js +2 -3
- package/development/dialog/dialog.js +2 -3
- package/development/divider.js +2 -3
- package/development/expansion-panel/expansion-panel-content.js +2 -3
- package/development/expansion-panel/expansion-panel-header.js +2 -3
- package/development/expansion-panel/expansion-panel.js +2 -3
- package/development/file-selector.js +2 -3
- package/development/footer.js +2 -3
- package/development/form-error.js +2 -3
- package/development/form-field/form-field-clear.js +2 -3
- package/development/form-field/form-field.js +2 -3
- package/development/header/common.js +2 -3
- package/development/header/header-button.js +2 -3
- package/development/header/header-link.js +2 -3
- package/development/header/header.js +2 -3
- package/development/icon.js +4 -7
- package/development/image/image.d.ts +12 -3
- package/development/image/image.d.ts.map +1 -1
- package/development/image.js +41 -24
- package/development/journey-header.js +2 -3
- package/development/lead-container.js +2 -3
- package/development/link/block-link-button.js +2 -3
- package/development/link/block-link-static.js +2 -3
- package/development/link/block-link.js +2 -3
- package/development/link/common.js +3 -5
- package/development/link/link-button.js +2 -3
- package/development/link/link-static.js +2 -3
- package/development/link/link.js +2 -3
- package/development/link-list.js +2 -3
- package/development/loading-indicator.js +2 -3
- package/development/logo.js +2 -3
- package/development/map-container.js +2 -3
- package/development/menu/common.js +2 -3
- package/development/menu/menu-button.js +2 -3
- package/development/menu/menu-link.js +2 -3
- package/development/menu/menu.js +2 -3
- package/development/message.js +2 -3
- package/development/navigation/common.js +2 -3
- package/development/navigation/navigation-button.js +2 -3
- package/development/navigation/navigation-link.js +2 -3
- package/development/navigation/navigation-list.js +2 -3
- package/development/navigation/navigation-marker.js +2 -3
- package/development/navigation/navigation-section.js +2 -3
- package/development/navigation/navigation.js +2 -3
- package/development/notification.js +2 -3
- package/development/option/optgroup.js +2 -3
- package/development/option/option.js +2 -3
- package/development/overlay.js +3 -5
- package/development/popover/popover-trigger.js +2 -3
- package/development/popover/popover.js +2 -3
- package/development/radio-button/radio-button-group.js +2 -3
- package/development/radio-button/radio-button.js +2 -3
- package/development/screen-reader-only.js +2 -3
- package/development/select.js +2 -3
- package/development/selection-panel.js +2 -3
- package/development/signet.js +2 -3
- package/development/skiplink-list.js +2 -3
- package/development/slider.js +2 -3
- package/development/status.js +2 -3
- package/development/stepper/step-label.js +2 -3
- package/development/stepper/step.js +2 -3
- package/development/stepper/stepper/stepper.d.ts +1 -1
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +5 -6
- package/development/tabs/tab-group.js +2 -3
- package/development/tabs/tab-title.js +2 -3
- package/development/tag/tag-group.js +2 -3
- package/development/tag/tag.js +2 -3
- package/development/teaser-hero.js +2 -3
- package/development/teaser-paid.js +2 -3
- package/development/teaser.js +2 -3
- package/development/time-input.js +2 -3
- package/development/timetable-occupancy-icon.js +2 -3
- package/development/timetable-occupancy.js +2 -3
- package/development/title.js +3 -5
- package/development/toast.js +2 -3
- package/development/toggle/toggle-option.js +3 -5
- package/development/toggle/toggle.js +2 -3
- package/development/toggle-check.js +10 -3
- package/development/train/train-blocked-passage.js +2 -3
- package/development/train/train-formation.js +2 -3
- package/development/train/train-wagon.js +2 -3
- package/development/train/train.js +2 -3
- package/development/visual-checkbox.js +2 -3
- package/dialog/dialog-title.js +20 -20
- package/dialog/dialog.js +66 -66
- package/expansion-panel/expansion-panel-header.js +20 -20
- package/expansion-panel/expansion-panel.js +60 -60
- package/file-selector.js +91 -91
- package/form-field/form-field-clear.js +12 -12
- package/form-field/form-field.js +111 -111
- package/header/header.js +53 -53
- package/icon.js +107 -107
- package/image/image.d.ts +12 -3
- package/image/image.d.ts.map +1 -1
- package/image.js +118 -105
- package/journey-header.js +29 -29
- package/map-container.js +23 -23
- package/menu/menu.js +91 -91
- package/navigation/common.js +16 -16
- package/navigation/navigation-marker.js +34 -34
- package/navigation/navigation-section.js +83 -83
- package/navigation/navigation.js +87 -87
- package/notification.js +52 -52
- package/option/optgroup.js +45 -45
- package/option/option.js +108 -108
- package/overlay.js +5 -5
- package/package.json +1 -1
- package/popover/popover.js +110 -110
- package/radio-button/radio-button-group.js +93 -93
- package/radio-button/radio-button.js +84 -84
- package/select.js +178 -178
- package/selection-panel.js +44 -44
- package/slider.js +58 -58
- package/status.js +6 -6
- package/stepper/step-label.js +19 -19
- package/stepper/step.js +31 -31
- package/stepper/stepper/stepper.d.ts +1 -1
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +48 -48
- package/tabs/tab-group.js +67 -67
- package/tag/tag-group.js +8 -8
- package/tag/tag.js +27 -27
- package/teaser-paid.js +12 -12
- package/time-input.js +73 -73
- package/timetable-occupancy-icon.js +26 -26
- package/timetable-occupancy.js +9 -9
- package/toast.js +38 -38
- package/toggle/toggle-option.js +33 -33
- package/toggle/toggle.js +46 -46
- package/toggle-check.js +14 -14
- package/train/train-formation.js +36 -37
- package/train/train-wagon.js +30 -30
- package/train/train.js +13 -13
package/core/testing.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
class u {
|
|
2
|
-
constructor(
|
|
3
|
-
this.
|
|
2
|
+
constructor(i, e = null) {
|
|
3
|
+
this.e = i, this.a = e, this.b = 0, this.c = [], this.a || (this.a = document), this.d();
|
|
4
4
|
}
|
|
5
5
|
get count() {
|
|
6
|
-
return this.
|
|
6
|
+
return this.b;
|
|
7
7
|
}
|
|
8
8
|
get events() {
|
|
9
|
-
return this.
|
|
9
|
+
return this.c;
|
|
10
10
|
}
|
|
11
11
|
get firstEvent() {
|
|
12
12
|
return this.events.length ? this.events[0] : null;
|
|
@@ -14,49 +14,60 @@ class u {
|
|
|
14
14
|
get lastEvent() {
|
|
15
15
|
return this.events.length ? this.events[this.events.length - 1] : null;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
(
|
|
20
|
-
this.
|
|
17
|
+
d() {
|
|
18
|
+
var i;
|
|
19
|
+
(i = this.a) == null || i.addEventListener(this.e, (e) => {
|
|
20
|
+
this.c.push(e), this.b++;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const m = (t, i, e) => {
|
|
25
25
|
if (t)
|
|
26
|
-
return Mocha.describe(
|
|
27
|
-
},
|
|
26
|
+
return Mocha.describe(i, e);
|
|
27
|
+
}, h = (t, i, e) => {
|
|
28
28
|
if (t)
|
|
29
|
-
return Mocha.test(
|
|
29
|
+
return Mocha.test(i, e);
|
|
30
30
|
};
|
|
31
|
-
function
|
|
31
|
+
function d(t) {
|
|
32
32
|
window.scrollTo(t), document.dispatchEvent(new Event("scroll"));
|
|
33
33
|
}
|
|
34
|
-
async function g(t,
|
|
35
|
-
const
|
|
36
|
-
let
|
|
37
|
-
function
|
|
38
|
-
return
|
|
34
|
+
async function g(t, i = 30, e = 2 * 1e3) {
|
|
35
|
+
const n = /* @__PURE__ */ new Date();
|
|
36
|
+
let o = 0;
|
|
37
|
+
function s() {
|
|
38
|
+
return o++, t();
|
|
39
39
|
}
|
|
40
|
-
for (; !await
|
|
41
|
-
await new Promise((
|
|
42
|
-
return
|
|
43
|
-
`waitForCondition timeout: ${t.toString()}, attempts: ${
|
|
40
|
+
for (; !await s() && n.getTime() + e >= (/* @__PURE__ */ new Date()).getTime(); )
|
|
41
|
+
await new Promise((r) => setTimeout(r, i));
|
|
42
|
+
return n.getTime() + e < (/* @__PURE__ */ new Date()).getTime() ? Promise.reject(
|
|
43
|
+
`waitForCondition timeout: ${t.toString()}, attempts: ${o}, start: ${n.getTime()}, end: ${(/* @__PURE__ */ new Date()).getTime()}`
|
|
44
44
|
) : Promise.resolve(!0);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
async function w(t, i = 2 * 1e3) {
|
|
47
|
+
t.complete || await new Promise((e, n) => {
|
|
48
|
+
const o = setTimeout(() => n("image loading timeout"), i);
|
|
49
|
+
t.addEventListener("load", () => {
|
|
50
|
+
clearTimeout(o), e();
|
|
51
|
+
}), t.addEventListener("error", () => {
|
|
52
|
+
clearTimeout(o), n("image error");
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const a = (t) => !!t.updateComplete, c = Promise.resolve(), l = async (t) => {
|
|
57
|
+
const i = [t, ...t.querySelectorAll("*")].filter(a).map((e) => [
|
|
48
58
|
e.updateComplete,
|
|
49
|
-
e.hydrationComplete ??
|
|
50
|
-
|
|
59
|
+
e.hydrationComplete ?? c,
|
|
60
|
+
l(e.renderRoot)
|
|
51
61
|
]).flat(1 / 0);
|
|
52
|
-
await Promise.all(
|
|
62
|
+
await Promise.all(i);
|
|
53
63
|
};
|
|
54
64
|
export {
|
|
55
65
|
u as EventSpy,
|
|
56
|
-
|
|
66
|
+
m as describeIf,
|
|
57
67
|
a as isReactiveElement,
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
d as mockScrollTo,
|
|
69
|
+
h as testIf,
|
|
60
70
|
g as waitForCondition,
|
|
61
|
-
|
|
71
|
+
w as waitForImageReady,
|
|
72
|
+
l as waitForLitRender
|
|
62
73
|
};
|
package/custom-elements.json
CHANGED
|
@@ -5059,6 +5059,17 @@
|
|
|
5059
5059
|
}
|
|
5060
5060
|
],
|
|
5061
5061
|
"members": [
|
|
5062
|
+
{
|
|
5063
|
+
"kind": "field",
|
|
5064
|
+
"name": "events",
|
|
5065
|
+
"privacy": "public",
|
|
5066
|
+
"static": true,
|
|
5067
|
+
"readonly": true,
|
|
5068
|
+
"default": "{ error: 'error', load: 'load', }",
|
|
5069
|
+
"type": {
|
|
5070
|
+
"text": "{\n error: 'error',\n load: 'load',\n }"
|
|
5071
|
+
}
|
|
5072
|
+
},
|
|
5062
5073
|
{
|
|
5063
5074
|
"kind": "field",
|
|
5064
5075
|
"name": "_captionElement",
|
|
@@ -5267,6 +5278,16 @@
|
|
|
5267
5278
|
"attribute": "aspect-ratio",
|
|
5268
5279
|
"reflects": true
|
|
5269
5280
|
},
|
|
5281
|
+
{
|
|
5282
|
+
"kind": "field",
|
|
5283
|
+
"name": "complete",
|
|
5284
|
+
"type": {
|
|
5285
|
+
"text": "boolean"
|
|
5286
|
+
},
|
|
5287
|
+
"privacy": "public",
|
|
5288
|
+
"description": "Whether the image is finished loading or failed to load.",
|
|
5289
|
+
"readonly": true
|
|
5290
|
+
},
|
|
5270
5291
|
{
|
|
5271
5292
|
"kind": "method",
|
|
5272
5293
|
"name": "_logPerformanceMarks",
|
|
@@ -5366,6 +5387,22 @@
|
|
|
5366
5387
|
}
|
|
5367
5388
|
}
|
|
5368
5389
|
],
|
|
5390
|
+
"events": [
|
|
5391
|
+
{
|
|
5392
|
+
"name": "load",
|
|
5393
|
+
"type": {
|
|
5394
|
+
"text": "Event"
|
|
5395
|
+
},
|
|
5396
|
+
"description": "Emits when the image has been loaded."
|
|
5397
|
+
},
|
|
5398
|
+
{
|
|
5399
|
+
"name": "error",
|
|
5400
|
+
"type": {
|
|
5401
|
+
"text": "Event"
|
|
5402
|
+
},
|
|
5403
|
+
"description": "Emits when the image loading ended in an error."
|
|
5404
|
+
}
|
|
5405
|
+
],
|
|
5369
5406
|
"attributes": [
|
|
5370
5407
|
{
|
|
5371
5408
|
"name": "alt",
|
|
@@ -29897,7 +29934,7 @@
|
|
|
29897
29934
|
"declarations": [
|
|
29898
29935
|
{
|
|
29899
29936
|
"kind": "class",
|
|
29900
|
-
"description": "This class exists to facilitate the
|
|
29937
|
+
"description": "This class exists to facilitate the test migration from stencil to lit.\nIt mimics the API that stencil provided to test events.\n\nTODO: Document me",
|
|
29901
29938
|
"name": "EventSpy",
|
|
29902
29939
|
"members": [
|
|
29903
29940
|
{
|
|
@@ -30073,6 +30110,27 @@
|
|
|
30073
30110
|
}
|
|
30074
30111
|
]
|
|
30075
30112
|
},
|
|
30113
|
+
{
|
|
30114
|
+
"kind": "function",
|
|
30115
|
+
"name": "waitForImageReady",
|
|
30116
|
+
"return": {
|
|
30117
|
+
"type": {
|
|
30118
|
+
"text": "Promise<void>"
|
|
30119
|
+
}
|
|
30120
|
+
},
|
|
30121
|
+
"parameters": [
|
|
30122
|
+
{
|
|
30123
|
+
"name": "element",
|
|
30124
|
+
"type": {
|
|
30125
|
+
"text": "HTMLImageElement | SbbImageElement"
|
|
30126
|
+
}
|
|
30127
|
+
},
|
|
30128
|
+
{
|
|
30129
|
+
"name": "timeoutInMilliseconds",
|
|
30130
|
+
"default": "2 * 1000"
|
|
30131
|
+
}
|
|
30132
|
+
]
|
|
30133
|
+
},
|
|
30076
30134
|
{
|
|
30077
30135
|
"kind": "function",
|
|
30078
30136
|
"name": "isReactiveElement",
|
|
@@ -30153,6 +30211,14 @@
|
|
|
30153
30211
|
"module": "core/testing.js"
|
|
30154
30212
|
}
|
|
30155
30213
|
},
|
|
30214
|
+
{
|
|
30215
|
+
"kind": "js",
|
|
30216
|
+
"name": "waitForImageReady",
|
|
30217
|
+
"declaration": {
|
|
30218
|
+
"name": "waitForImageReady",
|
|
30219
|
+
"module": "core/testing.js"
|
|
30220
|
+
}
|
|
30221
|
+
},
|
|
30156
30222
|
{
|
|
30157
30223
|
"kind": "js",
|
|
30158
30224
|
"name": "isReactiveElement",
|
|
@@ -47749,11 +47815,11 @@
|
|
|
47749
47815
|
{
|
|
47750
47816
|
"kind": "field",
|
|
47751
47817
|
"name": "horizontalFrom",
|
|
47818
|
+
"privacy": "public",
|
|
47819
|
+
"description": "Overrides the behaviour of `orientation` property.",
|
|
47752
47820
|
"type": {
|
|
47753
47821
|
"text": "SbbHorizontalFrom | undefined"
|
|
47754
47822
|
},
|
|
47755
|
-
"privacy": "public",
|
|
47756
|
-
"description": "Overrides the behaviour of `orientation` property.",
|
|
47757
47823
|
"attribute": "horizontal-from",
|
|
47758
47824
|
"reflects": true
|
|
47759
47825
|
},
|
|
@@ -48009,10 +48075,10 @@
|
|
|
48009
48075
|
},
|
|
48010
48076
|
{
|
|
48011
48077
|
"name": "horizontal-from",
|
|
48078
|
+
"description": "Overrides the behaviour of `orientation` property.",
|
|
48012
48079
|
"type": {
|
|
48013
48080
|
"text": "SbbHorizontalFrom | undefined"
|
|
48014
48081
|
},
|
|
48015
|
-
"description": "Overrides the behaviour of `orientation` property.",
|
|
48016
48082
|
"fieldName": "horizontalFrom"
|
|
48017
48083
|
},
|
|
48018
48084
|
{
|
package/datepicker/common.js
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import { html as
|
|
2
|
-
import { property as
|
|
3
|
-
import { SbbButtonBaseElement as
|
|
4
|
-
import { SbbConnectedAbortController as
|
|
5
|
-
import { defaultDateAdapter as
|
|
6
|
-
import { i18nToday as
|
|
7
|
-
import { SbbNegativeMixin as
|
|
8
|
-
import { getDatePicker as
|
|
1
|
+
import { html as d } from "lit";
|
|
2
|
+
import { property as o, state as b } from "lit/decorators.js";
|
|
3
|
+
import { SbbButtonBaseElement as c } from "../core/base-elements.js";
|
|
4
|
+
import { SbbConnectedAbortController as u, SbbLanguageController as m } from "../core/controllers.js";
|
|
5
|
+
import { defaultDateAdapter as f } from "../core/datetime.js";
|
|
6
|
+
import { i18nToday as g } from "../core/i18n.js";
|
|
7
|
+
import { SbbNegativeMixin as p } from "../core/mixins.js";
|
|
8
|
+
import { getDatePicker as E, datepickerControlRegisteredEventFactory as D } from "./datepicker.js";
|
|
9
9
|
import "../icon.js";
|
|
10
|
-
var
|
|
11
|
-
for (var e = void 0,
|
|
12
|
-
(n = r[
|
|
13
|
-
return e &&
|
|
10
|
+
var A = Object.defineProperty, l = (r, t, i, s) => {
|
|
11
|
+
for (var e = void 0, a = r.length - 1, n; a >= 0; a--)
|
|
12
|
+
(n = r[a]) && (e = n(t, i, e) || e);
|
|
13
|
+
return e && A(t, i, e), e;
|
|
14
14
|
};
|
|
15
|
-
class
|
|
15
|
+
class h extends p(c) {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(...arguments), this.boundary = null, this.
|
|
17
|
+
super(...arguments), this.boundary = null, this.e = !1, this.f = !1, this.datePickerElement = null, this.b = f, this.i = new u(this), this.g = new m(this).withHandler(() => this.c());
|
|
18
18
|
}
|
|
19
19
|
connectedCallback() {
|
|
20
|
-
super.connectedCallback(), this.addEventListener("click", () => this.
|
|
20
|
+
super.connectedCallback(), this.addEventListener("click", () => this.j(), { signal: this.i.signal }), this.k(), this.datePicker || this.h();
|
|
21
21
|
}
|
|
22
22
|
willUpdate(t) {
|
|
23
|
-
super.willUpdate(t), t.has("datePicker") && this.
|
|
23
|
+
super.willUpdate(t), t.has("datePicker") && this.h(this.datePicker);
|
|
24
24
|
}
|
|
25
25
|
disconnectedCallback() {
|
|
26
26
|
var t;
|
|
27
|
-
super.disconnectedCallback(), (t = this.
|
|
27
|
+
super.disconnectedCallback(), (t = this.a) == null || t.abort();
|
|
28
28
|
}
|
|
29
29
|
setDisabledState(t) {
|
|
30
30
|
var e;
|
|
31
31
|
const i = (e = t == null ? void 0 : t.getValueAsDate) == null ? void 0 : e.call(t);
|
|
32
32
|
if (!i) {
|
|
33
|
-
this.
|
|
33
|
+
this.e = !0, this.d(!0);
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const s = this.findAvailableDate(
|
|
37
37
|
i,
|
|
38
38
|
(t == null ? void 0 : t.dateFilter) || null,
|
|
39
|
-
this.
|
|
39
|
+
this.b,
|
|
40
40
|
this.boundary
|
|
41
41
|
);
|
|
42
|
-
this.
|
|
42
|
+
this.e = this.b.compareDate(s, i) === 0, this.d();
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
j() {
|
|
45
45
|
if (!this.datePickerElement || this.hasAttribute("data-disabled"))
|
|
46
46
|
return;
|
|
47
47
|
const t = this.datePickerElement.getValueAsDate() ?? this.datePickerElement.now, i = this.findAvailableDate(
|
|
48
48
|
t,
|
|
49
49
|
this.datePickerElement.dateFilter,
|
|
50
|
-
this.
|
|
50
|
+
this.b,
|
|
51
51
|
this.boundary
|
|
52
52
|
);
|
|
53
|
-
this.
|
|
53
|
+
this.b.compareDate(i, t) !== 0 && this.datePickerElement.setValueAsDate(i);
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
var i,
|
|
57
|
-
const t = ((i = this.closest) == null ? void 0 : i.call(this, "sbb-form-field")) ?? ((
|
|
55
|
+
k() {
|
|
56
|
+
var i, s;
|
|
57
|
+
const t = ((i = this.closest) == null ? void 0 : i.call(this, "sbb-form-field")) ?? ((s = this.closest) == null ? void 0 : s.call(this, "[data-form-field]"));
|
|
58
58
|
if (t) {
|
|
59
59
|
this.negative = t.hasAttribute("negative");
|
|
60
60
|
const e = t.querySelector("input");
|
|
61
|
-
e && (this.
|
|
61
|
+
e && (this.f = e.hasAttribute("disabled") || e.hasAttribute("readonly"), this.d());
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
var i,
|
|
66
|
-
if ((i = this.
|
|
67
|
-
(
|
|
64
|
+
h(t) {
|
|
65
|
+
var i, s;
|
|
66
|
+
if ((i = this.a) == null || i.abort(), this.a = new AbortController(), this.datePickerElement = E(this, t), this.setDisabledState(this.datePickerElement), !this.datePickerElement) {
|
|
67
|
+
(s = this.parentElement) == null || s.addEventListener(
|
|
68
68
|
"inputUpdated",
|
|
69
|
-
(e) => this.
|
|
70
|
-
{ once: !0, signal: this.
|
|
69
|
+
(e) => this.h(e.target),
|
|
70
|
+
{ once: !0, signal: this.a.signal }
|
|
71
71
|
);
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
this.
|
|
74
|
+
this.c(), this.datePickerElement.addEventListener(
|
|
75
75
|
"change",
|
|
76
76
|
(e) => {
|
|
77
|
-
this.setDisabledState(e.target), this.
|
|
77
|
+
this.setDisabledState(e.target), this.c();
|
|
78
78
|
},
|
|
79
|
-
{ signal: this.
|
|
79
|
+
{ signal: this.a.signal }
|
|
80
80
|
), this.datePickerElement.addEventListener(
|
|
81
81
|
"datePickerUpdated",
|
|
82
82
|
(e) => {
|
|
83
|
-
this.setDisabledState(e.target), this.
|
|
83
|
+
this.setDisabledState(e.target), this.c();
|
|
84
84
|
},
|
|
85
|
-
{ signal: this.
|
|
85
|
+
{ signal: this.a.signal }
|
|
86
86
|
), this.datePickerElement.addEventListener(
|
|
87
87
|
"inputUpdated",
|
|
88
88
|
(e) => {
|
|
89
|
-
this.
|
|
89
|
+
this.f = !!(e.detail.disabled || e.detail.readonly), this.d(), this.c(), this.onInputUpdated(e);
|
|
90
90
|
},
|
|
91
|
-
{ signal: this.
|
|
92
|
-
), this.datePickerElement.dispatchEvent(
|
|
91
|
+
{ signal: this.a.signal }
|
|
92
|
+
), this.datePickerElement.dispatchEvent(D());
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
var
|
|
96
|
-
const t = (e = (
|
|
97
|
-
if (!t || !this.
|
|
98
|
-
this.setAttribute("aria-label", this.i18nOffBoundaryDay[this.
|
|
94
|
+
c() {
|
|
95
|
+
var s, e, a;
|
|
96
|
+
const t = (e = (s = this.datePickerElement) == null ? void 0 : s.getValueAsDate) == null ? void 0 : e.call(s);
|
|
97
|
+
if (!t || !this.b.isValid(t)) {
|
|
98
|
+
this.setAttribute("aria-label", this.i18nOffBoundaryDay[this.g.current]);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
const i = ((
|
|
101
|
+
const i = ((a = this.datePickerElement) == null ? void 0 : a.now.toDateString()) === t.toDateString() ? g[this.g.current].toLowerCase() : this.b.getAccessibilityFormatDate(t);
|
|
102
102
|
this.setAttribute(
|
|
103
103
|
"aria-label",
|
|
104
|
-
this.i18nSelectOffBoundaryDay(i)[this.
|
|
104
|
+
this.i18nSelectOffBoundaryDay(i)[this.g.current]
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
d(t = this.e || this.f) {
|
|
108
108
|
this.toggleAttribute("data-disabled", t), t ? (this.setAttribute("aria-disabled", "true"), this.removeAttribute("tabindex")) : (this.removeAttribute("aria-disabled"), this.setAttribute("tabindex", "0"));
|
|
109
109
|
}
|
|
110
110
|
renderTemplate() {
|
|
111
|
-
return
|
|
111
|
+
return d` <sbb-icon name=${this.iconName}></sbb-icon> `;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
l([
|
|
115
|
-
|
|
116
|
-
],
|
|
115
|
+
o({ attribute: "date-picker" })
|
|
116
|
+
], h.prototype, "datePicker");
|
|
117
117
|
l([
|
|
118
118
|
b()
|
|
119
|
-
],
|
|
119
|
+
], h.prototype, "boundary");
|
|
120
120
|
export {
|
|
121
|
-
|
|
121
|
+
h as SbbDatepickerButton
|
|
122
122
|
};
|