@sbb-esta/lyne-elements 3.13.3 → 3.13.6
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/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/autocomplete/autocomplete-base-element.js +9 -8
- package/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/autocomplete/autocomplete.component.js +8 -9
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
- package/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +10 -11
- package/calendar/calendar.component.d.ts +2 -0
- package/calendar/calendar.component.d.ts.map +1 -1
- package/calendar/calendar.component.js +291 -287
- package/custom-elements.json +16 -6
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete/autocomplete-base-element.js +12 -10
- package/development/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/development/autocomplete/autocomplete.component.js +13 -15
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.d.ts.map +1 -1
- package/development/autocomplete-grid/autocomplete-grid/autocomplete-grid.component.js +17 -19
- package/development/calendar/calendar.component.d.ts +2 -0
- package/development/calendar/calendar.component.d.ts.map +1 -1
- package/development/calendar/calendar.component.js +39 -32
- package/development/notification/notification.component.js +9 -11
- package/development/option/option/option-base-element.js +2 -2
- package/development/paginator/paginator/paginator.component.d.ts +1 -1
- package/development/paginator/paginator/paginator.component.d.ts.map +1 -1
- package/development/paginator/paginator/paginator.component.js +8 -14
- package/notification/notification.component.js +8 -8
- package/option/option/option-base-element.js +1 -1
- package/package.json +1 -1
- package/paginator/paginator/paginator.component.d.ts +1 -1
- package/paginator/paginator/paginator.component.d.ts.map +1 -1
- package/paginator/paginator/paginator.component.js +16 -19
|
@@ -2,97 +2,97 @@ var Ce = (o) => {
|
|
|
2
2
|
throw TypeError(o);
|
|
3
3
|
};
|
|
4
4
|
var Ie = (o, n, d) => n.has(o) || Ce("Cannot " + d);
|
|
5
|
-
var
|
|
5
|
+
var A = (o, n, d) => (Ie(o, n, "read from private field"), d ? d.call(o) : n.get(o)), x = (o, n, d) => n.has(o) ? Ce("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(o) : n.set(o, d), f = (o, n, d, h) => (Ie(o, n, "write to private field"), h ? h.call(o, d) : n.set(o, d), d);
|
|
6
6
|
import { __esDecorate as y, __runInitializers as u } from "tslib";
|
|
7
|
-
import { css as Le, LitElement as Be, isServer as Re, nothing as m, html as
|
|
7
|
+
import { css as Le, LitElement as Be, isServer as Re, nothing as m, html as b } from "lit";
|
|
8
8
|
import { customElement as He, property as Y, state as G } from "lit/decorators.js";
|
|
9
9
|
import { classMap as Q } from "lit/directives/class-map.js";
|
|
10
|
-
import {
|
|
10
|
+
import { isArrowKeyOrPageKeysPressed as Ke } from "../core/a11y.js";
|
|
11
11
|
import { readConfig as Ue } from "../core/config.js";
|
|
12
|
-
import { SbbLanguageController as
|
|
13
|
-
import { defaultDateAdapter as
|
|
14
|
-
import { forceType as Z, plainDate as Te, handleDistinctChange as
|
|
15
|
-
import { i18nPreviousMonth as
|
|
16
|
-
import { SbbHydrationMixin as
|
|
12
|
+
import { SbbLanguageController as qe, SbbMediaMatcherController as je, SbbMediaQueryBreakpointMediumAndAbove as Se } from "../core/controllers.js";
|
|
13
|
+
import { defaultDateAdapter as Ge, YEARS_PER_PAGE as V, DAYS_PER_ROW as D, MONTHS_PER_ROW as J, YEARS_PER_ROW as X, MONTHS_PER_PAGE as Qe } from "../core/datetime.js";
|
|
14
|
+
import { forceType as Z, plainDate as Te, handleDistinctChange as Je } from "../core/decorators.js";
|
|
15
|
+
import { i18nPreviousMonth as Xe, i18nNextMonth as Ze, i18nYearMonthSelection as et, i18nCalendarWeekNumber as U, i18nPreviousYear as tt, i18nNextYear as at, i18nCalendarDateSelection as Ee, i18nPreviousYearRange as st, i18nNextYearRange as it } from "../core/i18n.js";
|
|
16
|
+
import { SbbHydrationMixin as rt } from "../core/mixins.js";
|
|
17
17
|
import "../button/secondary-button.js";
|
|
18
18
|
import "../icon.js";
|
|
19
19
|
import "../screen-reader-only.js";
|
|
20
|
-
const
|
|
20
|
+
const nt = 6048e5, Pe = Symbol.for("constructDateFrom");
|
|
21
21
|
function F(o, n) {
|
|
22
22
|
return typeof o == "function" ? o(n) : o && typeof o == "object" && Pe in o ? o[Pe](n) : o instanceof Date ? new o.constructor(n) : new Date(n);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function q(o, n) {
|
|
25
25
|
return F(n || o, o);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return isNaN(n) ? F(o, NaN) : (n &&
|
|
27
|
+
function lt(o, n, d) {
|
|
28
|
+
const h = q(o, d?.in);
|
|
29
|
+
return isNaN(n) ? F(o, NaN) : (n && h.setDate(h.getDate() + n), h);
|
|
30
30
|
}
|
|
31
|
-
let
|
|
31
|
+
let ot = {};
|
|
32
32
|
function te() {
|
|
33
|
-
return
|
|
33
|
+
return ot;
|
|
34
34
|
}
|
|
35
35
|
function z(o, n) {
|
|
36
|
-
const d = te(),
|
|
37
|
-
return
|
|
36
|
+
const d = te(), h = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? d.weekStartsOn ?? d.locale?.options?.weekStartsOn ?? 0, p = q(o, n?.in), w = p.getDay(), $ = (w < h ? 7 : 0) + w - h;
|
|
37
|
+
return p.setDate(p.getDate() - $), p.setHours(0, 0, 0, 0), p;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function dt(o, ...n) {
|
|
40
40
|
const d = F.bind(
|
|
41
41
|
null,
|
|
42
|
-
o || n.find((
|
|
42
|
+
o || n.find((h) => typeof h == "object")
|
|
43
43
|
);
|
|
44
44
|
return n.map(d);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function ct(o, n, d) {
|
|
47
|
+
return lt(o, n * 7, d);
|
|
48
48
|
}
|
|
49
49
|
function bt(o, n) {
|
|
50
|
-
const d =
|
|
51
|
-
return d.setFullYear(d.getFullYear(),
|
|
50
|
+
const d = q(o, n?.in), h = d.getMonth();
|
|
51
|
+
return d.setFullYear(d.getFullYear(), h + 1, 0), d.setHours(23, 59, 59, 999), d;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const [d,
|
|
55
|
-
return { start: d, end:
|
|
53
|
+
function ht(o, n) {
|
|
54
|
+
const [d, h] = dt(o, n.start, n.end);
|
|
55
|
+
return { start: d, end: h };
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
const { start: d, end:
|
|
59
|
-
let
|
|
60
|
-
const
|
|
61
|
-
|
|
57
|
+
function _t(o, n) {
|
|
58
|
+
const { start: d, end: h } = ht(n?.in, o);
|
|
59
|
+
let p = +d > +h;
|
|
60
|
+
const w = z(p ? h : d, n), $ = z(p ? d : h, n);
|
|
61
|
+
w.setHours(15), $.setHours(15);
|
|
62
62
|
const O = +$.getTime();
|
|
63
|
-
let
|
|
63
|
+
let k = w, M = n?.step ?? 1;
|
|
64
64
|
if (!M) return [];
|
|
65
|
-
M < 0 && (M = -M,
|
|
65
|
+
M < 0 && (M = -M, p = !p);
|
|
66
66
|
const W = [];
|
|
67
|
-
for (; +
|
|
68
|
-
|
|
69
|
-
return
|
|
67
|
+
for (; +k <= O; )
|
|
68
|
+
k.setHours(0), W.push(F(d, k)), k = ct(k, M), k.setHours(15);
|
|
69
|
+
return p ? W.reverse() : W;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
const d =
|
|
71
|
+
function ut(o, n) {
|
|
72
|
+
const d = q(o, n?.in);
|
|
73
73
|
return d.setDate(1), d.setHours(0, 0, 0, 0), d;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const d =
|
|
77
|
-
$.setFullYear(
|
|
78
|
-
const O = z($, n),
|
|
79
|
-
|
|
80
|
-
const M = z(
|
|
81
|
-
return +d >= +O ?
|
|
75
|
+
function ft(o, n) {
|
|
76
|
+
const d = q(o, n?.in), h = d.getFullYear(), p = te(), w = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? p.firstWeekContainsDate ?? p.locale?.options?.firstWeekContainsDate ?? 1, $ = F(n?.in || o, 0);
|
|
77
|
+
$.setFullYear(h + 1, 0, w), $.setHours(0, 0, 0, 0);
|
|
78
|
+
const O = z($, n), k = F(n?.in || o, 0);
|
|
79
|
+
k.setFullYear(h, 0, w), k.setHours(0, 0, 0, 0);
|
|
80
|
+
const M = z(k, n);
|
|
81
|
+
return +d >= +O ? h + 1 : +d >= +M ? h : h - 1;
|
|
82
82
|
}
|
|
83
83
|
function gt(o, n) {
|
|
84
|
-
const d = te(),
|
|
85
|
-
return
|
|
84
|
+
const d = te(), h = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? d.firstWeekContainsDate ?? d.locale?.options?.firstWeekContainsDate ?? 1, p = ft(o, n), w = F(n?.in || o, 0);
|
|
85
|
+
return w.setFullYear(p, 0, h), w.setHours(0, 0, 0, 0), z(w, n);
|
|
86
86
|
}
|
|
87
87
|
function ee(o, n) {
|
|
88
|
-
const d =
|
|
89
|
-
return Math.round(
|
|
88
|
+
const d = q(o, n?.in), h = +z(d, n) - +gt(d, n);
|
|
89
|
+
return Math.round(h / nt) + 1;
|
|
90
90
|
}
|
|
91
|
-
const mt = Le`*,:before,:after{box-sizing:border-box}:host{display:block;width:max-content;--sbb-calendar-cell-size: 2.5rem;--sbb-calendar-hover-shift: .0625rem;--sbb-calendar-wide-cell-size: 4.375rem;--sbb-calendar-header-color: var(--sbb-color-granite);--sbb-calendar-header-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));--sbb-calendar-cell-background-color: transparent;--sbb-calendar-cell-padding: .125rem;--sbb-calendar-cell-color: var(--sbb-color-2);--sbb-calendar-cell-selected-color: var(--sbb-color-1-inverted);--sbb-calendar-cell-selected-background-color: var(--sbb-background-color-2-inverted);--sbb-calendar-cell-disabled-height: .09375rem;--sbb-calendar-cell-disabled-width: 1.59375rem;--sbb-calendar-cell-disabled-color: var(--sbb-color-granite);--sbb-calendar-cell-disabled-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));--sbb-calendar-cell-transition-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);--sbb-calendar-tables-gap: var(--sbb-spacing-fixed-10x);--sbb-calendar-table-animation-shift: .00625rem;--sbb-calendar-table-animation-duration: .1ms;--sbb-calendar-table-column-spaces: 12;--sbb-calendar-control-view-change-height: 2.75rem;--sbb-calendar-control-view-change-color: var(--sbb-color-3);--sbb-calendar-control-view-change-background: var(--sbb-background-color-1)}@media(min-width:22.5rem){:host{--sbb-calendar-cell-size: 2.75rem;--sbb-calendar-wide-cell-size: 4.8125rem;--sbb-calendar-control-view-change-height: 3rem}}.sbb-calendar__wrapper{width:100%;display:block;transition-duration:var(--sbb-calendar-cell-transition-duration)}.sbb-calendar__controls{width:100%;display:inline-flex;align-items:center;gap:var(--sbb-spacing-fixed-2x);margin-block-end:var(--sbb-spacing-fixed-4x)}.sbb-calendar__controls-month{width:100%;display:flex;gap:var(--sbb-calendar-tables-gap)}#sbb-calendar__controls-previous,#sbb-calendar__controls-next{-webkit-tap-highlight-color:transparent}.sbb-calendar__controls-change-date{-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;outline:none;border:none;border-radius:0;padding:0;background:none;-webkit-tap-highlight-color:transparent;color:inherit;--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:flex;align-items:center;margin:auto;height:var(--sbb-calendar-control-view-change-height);text-transform:capitalize;cursor:var(--sbb-cursor-pointer);padding-inline:var(--sbb-spacing-fixed-5x) var(--sbb-spacing-fixed-2x);border-radius:var(--sbb-border-radius-infinity);background-color:var(--sbb-calendar-control-view-change-background);color:var(--sbb-calendar-control-view-change-color);transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);transition-property:background-color,padding-block-end}.sbb-calendar__controls-change-date:disabled{--sbb-calendar-control-view-change-background: var(--sbb-color-milk);--sbb-calendar-control-view-change-background: light-dark( var(--sbb-color-milk), var(--sbb-color-anthracite) );--sbb-calendar-control-view-change-color: var(--sbb-color-granite);--sbb-calendar-control-view-change-color: light-dark( var(--sbb-color-granite), var(--sbb-color-aluminium) );cursor:unset}.sbb-calendar__controls-change-date:focus-visible{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);outline-offset:var(--sbb-spacing-fixed-1x)}@media(any-hover:hover){.sbb-calendar__controls-change-date:not(:active,:disabled):hover{padding-block-end:var(--sbb-calendar-hover-shift)}}.sbb-calendar__controls-change-date:not(:disabled):active{--sbb-calendar-control-view-change-background: var(--sbb-background-color-3)}.sbb-calendar__table-month-view,.sbb-calendar__table-year-view{--sbb-calendar-table-column-spaces: 6}.sbb-calendar__table-container{display:flex;gap:var(--sbb-calendar-tables-gap);margin-inline:var(--sbb-calendar-margin);--sbb-calendar-min-width: calc(7 * var(--sbb-calendar-cell-size));--sbb-calendar-overflow: calc(100% - var(--sbb-calendar-min-width));--sbb-calendar-start-offset: min( 0px, -1 * (var(--sbb-calendar-overflow) / var(--sbb-calendar-table-column-spaces)) );--sbb-calendar-margin: var(--sbb-calendar-start-offset)}:host([data-wide]) .sbb-calendar__table-container{--sbb-calendar-min-width: calc( 2 * 7 * var(--sbb-calendar-cell-size) + var(--sbb-calendar-tables-gap) );--sbb-calendar-margin: calc(.5 * var(--sbb-calendar-start-offset))}:host([orientation=horizontal][week-numbers]) .sbb-calendar__table-container{--sbb-calendar-min-width: calc(8 * var(--sbb-calendar-cell-size))}:host([orientation=horizontal][week-numbers][data-wide]) .sbb-calendar__table-container{--sbb-calendar-min-width: calc( 2 * 8 * var(--sbb-calendar-cell-size) + var(--sbb-calendar-tables-gap) )}:host([orientation=vertical]) .sbb-calendar__table-container{min-width:var(--sbb-calendar-min-width);--sbb-calendar-start-offset: 0}:host([orientation=vertical][data-wide]) .sbb-calendar__table-container{--sbb-calendar-min-width: calc( 13 * var(--sbb-calendar-cell-size) + var(--sbb-calendar-tables-gap) )}.sbb-calendar__table{width:100%;border-collapse:collapse;height:max-content;animation-name:show;animation-duration:var(--sbb-calendar-table-animation-duration)}.sbb-calendar__table.sbb-calendar__table-hide{--sbb-calendar-cell-transition-duration: 0ms;animation-name:hide;animation-duration:var(--sbb-calendar-table-animation-duration)}:host(:not([data-wide])) .sbb-calendar__table{min-width:100%}.sbb-calendar__table-header,.sbb-calendar__table-body{text-align:center}.sbb-calendar__table-header-cell{--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);width:var(--sbb-calendar-cell-size);color:var(--sbb-calendar-header-color);padding:0}:host(:not([multiple])) .sbb-calendar__table-header-cell{height:var(--sbb-calendar-cell-size)}.sbb-calendar__table-data{position:relative;padding:0;text-align:center}.sbb-calendar__header-cell,.sbb-calendar__cell{-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;margin:0;outline:none;border:none;border-radius:0;padding:0;background:none;-webkit-tap-highlight-color:transparent;color:inherit;--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);height:var(--sbb-calendar-cell-size);color:var(--sbb-calendar-cell-color);cursor:var(--sbb-cursor-pointer);position:relative;z-index:0}.sbb-calendar__header-cell:before,.sbb-calendar__cell:before{content:"";position:absolute;inset:var(--sbb-calendar-cell-padding);background-color:var(--sbb-calendar-cell-background-color);border-radius:50%;z-index:-1;transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);transition-property:background-color}@media(any-hover:hover){.sbb-calendar__header-cell:not(.sbb-calendar__selected,:active,:disabled):hover,.sbb-calendar__cell:not(.sbb-calendar__selected,:active,:disabled):hover{--sbb-calendar-cell-background-color: var(--sbb-background-color-3);padding-block-end:var(--sbb-calendar-hover-shift)}}@media(any-hover:hover)and (forced-colors:active){.sbb-calendar__header-cell:not(.sbb-calendar__selected,:active,:disabled):hover:before,.sbb-calendar__cell:not(.sbb-calendar__selected,:active,:disabled):hover:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);--sbb-focus-outline-style: initial}}.sbb-calendar__header-cell:disabled,.sbb-calendar__cell:disabled{--sbb-calendar-cell-color: var(--sbb-calendar-cell-disabled-color);cursor:unset}.sbb-calendar__header-cell:focus-visible:before,.sbb-calendar__cell:focus-visible:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}.sbb-calendar__header-cell:not(.sbb-calendar__selected,:disabled):active,.sbb-calendar__cell:not(.sbb-calendar__selected,:disabled):active{--sbb-calendar-cell-background-color: var(--sbb-background-color-4)}@media(forced-colors:active){.sbb-calendar__header-cell:not(.sbb-calendar__selected,:disabled):active:before,.sbb-calendar__cell:not(.sbb-calendar__selected,:disabled):active:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);--sbb-focus-outline-style: initial}}.sbb-calendar__header-cell{--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);color:var(--sbb-calendar-header-color)}.sbb-calendar__weekday,.sbb-calendar__day{border-radius:50%;width:var(--sbb-calendar-cell-size)}.sbb-calendar__weekday:before,.sbb-calendar__day:before{border-radius:50%}.sbb-calendar__pill{width:var(--sbb-calendar-wide-cell-size);border-radius:var(--sbb-border-radius-infinity)}.sbb-calendar__pill:before{border-radius:var(--sbb-border-radius-infinity)}.sbb-calendar__crossed-out:after{content:"";height:var(--sbb-calendar-cell-disabled-height);width:var(--sbb-calendar-cell-disabled-width);position:absolute;background-color:var(--sbb-calendar-cell-disabled-color);top:50%;left:50%;transform:translate(-50%,-50%) rotate(-45deg)}.sbb-calendar__cell-current{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);font-weight:700}.sbb-calendar__selected{--sbb-calendar-cell-color: var(--sbb-calendar-cell-selected-color);--sbb-calendar-cell-background-color: var(--sbb-calendar-cell-selected-background-color)}@media(forced-colors:active){.sbb-calendar__selected{--sbb-calendar-cell-background-color: ButtonText !important}}@keyframes show{0%{opacity:0;transform:translateY(var(--sbb-calendar-table-animation-shift))}to{opacity:1;transform:translateY(0)}}@keyframes hide{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(var(--sbb-calendar-table-animation-shift))}}`;
|
|
92
|
-
let
|
|
93
|
-
var N, C, I, R, S, T, E, P, L, B, H,
|
|
94
|
-
let o = [He("sbb-calendar")], n, d = [],
|
|
95
|
-
return
|
|
91
|
+
const pt = Le`*,:before,:after{box-sizing:border-box}:host{display:block;width:max-content;--sbb-calendar-cell-size: 2.5rem;--sbb-calendar-hover-shift: .0625rem;--sbb-calendar-wide-cell-size: 4.375rem;--sbb-calendar-header-color: var(--sbb-color-granite);--sbb-calendar-header-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));--sbb-calendar-cell-background-color: transparent;--sbb-calendar-cell-padding: .125rem;--sbb-calendar-cell-color: var(--sbb-color-2);--sbb-calendar-cell-selected-color: var(--sbb-color-1-inverted);--sbb-calendar-cell-selected-background-color: var(--sbb-background-color-2-inverted);--sbb-calendar-cell-disabled-height: .09375rem;--sbb-calendar-cell-disabled-width: 1.59375rem;--sbb-calendar-cell-disabled-color: var(--sbb-color-granite);--sbb-calendar-cell-disabled-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));--sbb-calendar-cell-transition-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);--sbb-calendar-tables-gap: var(--sbb-spacing-fixed-10x);--sbb-calendar-table-animation-shift: .00625rem;--sbb-calendar-table-animation-duration: .1ms;--sbb-calendar-table-column-spaces: 12;--sbb-calendar-control-view-change-height: 2.75rem;--sbb-calendar-control-view-change-color: var(--sbb-color-3);--sbb-calendar-control-view-change-background: var(--sbb-background-color-1)}@media(min-width:22.5rem){:host{--sbb-calendar-cell-size: 2.75rem;--sbb-calendar-wide-cell-size: 4.8125rem;--sbb-calendar-control-view-change-height: 3rem}}.sbb-calendar__wrapper{width:100%;display:block;transition-duration:var(--sbb-calendar-cell-transition-duration)}.sbb-calendar__controls{width:100%;display:inline-flex;align-items:center;gap:var(--sbb-spacing-fixed-2x);margin-block-end:var(--sbb-spacing-fixed-4x)}.sbb-calendar__controls-month{width:100%;display:flex;gap:var(--sbb-calendar-tables-gap)}#sbb-calendar__controls-previous,#sbb-calendar__controls-next{-webkit-tap-highlight-color:transparent}.sbb-calendar__controls-change-date{-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;outline:none;border:none;border-radius:0;padding:0;background:none;-webkit-tap-highlight-color:transparent;color:inherit;--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:flex;align-items:center;margin:auto;height:var(--sbb-calendar-control-view-change-height);text-transform:capitalize;cursor:var(--sbb-cursor-pointer);padding-inline:var(--sbb-spacing-fixed-5x) var(--sbb-spacing-fixed-2x);border-radius:var(--sbb-border-radius-infinity);background-color:var(--sbb-calendar-control-view-change-background);color:var(--sbb-calendar-control-view-change-color);transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);transition-property:background-color,padding-block-end}.sbb-calendar__controls-change-date:disabled{--sbb-calendar-control-view-change-background: var(--sbb-color-milk);--sbb-calendar-control-view-change-background: light-dark( var(--sbb-color-milk), var(--sbb-color-anthracite) );--sbb-calendar-control-view-change-color: var(--sbb-color-granite);--sbb-calendar-control-view-change-color: light-dark( var(--sbb-color-granite), var(--sbb-color-aluminium) );cursor:unset}.sbb-calendar__controls-change-date:focus-visible{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);outline-offset:var(--sbb-spacing-fixed-1x)}@media(any-hover:hover){.sbb-calendar__controls-change-date:not(:active,:disabled):hover{padding-block-end:var(--sbb-calendar-hover-shift)}}.sbb-calendar__controls-change-date:not(:disabled):active{--sbb-calendar-control-view-change-background: var(--sbb-background-color-3)}.sbb-calendar__table-month-view,.sbb-calendar__table-year-view{--sbb-calendar-table-column-spaces: 6}.sbb-calendar__table-overflow-break{contain:layout}.sbb-calendar__table-container{display:flex;gap:var(--sbb-calendar-tables-gap);margin-inline:var(--sbb-calendar-margin);--sbb-calendar-min-width: calc(7 * var(--sbb-calendar-cell-size));--sbb-calendar-overflow: calc(100% - var(--sbb-calendar-min-width));--sbb-calendar-start-offset: min( 0px, -1 * (var(--sbb-calendar-overflow) / var(--sbb-calendar-table-column-spaces)) );--sbb-calendar-margin: var(--sbb-calendar-start-offset)}:host([data-wide]) .sbb-calendar__table-container{--sbb-calendar-min-width: calc( 2 * 7 * var(--sbb-calendar-cell-size) + var(--sbb-calendar-tables-gap) );--sbb-calendar-margin: calc(.5 * var(--sbb-calendar-start-offset))}:host([orientation=horizontal][week-numbers]) .sbb-calendar__table-container{--sbb-calendar-min-width: calc(8 * var(--sbb-calendar-cell-size))}:host([orientation=horizontal][week-numbers][data-wide]) .sbb-calendar__table-container{--sbb-calendar-min-width: calc( 2 * 8 * var(--sbb-calendar-cell-size) + var(--sbb-calendar-tables-gap) )}:host([orientation=vertical]) .sbb-calendar__table-container{min-width:var(--sbb-calendar-min-width);--sbb-calendar-start-offset: 0}:host([orientation=vertical][data-wide]) .sbb-calendar__table-container{--sbb-calendar-min-width: calc( 13 * var(--sbb-calendar-cell-size) + var(--sbb-calendar-tables-gap) )}.sbb-calendar__table{width:100%;border-collapse:collapse;height:max-content;animation-name:show;animation-duration:var(--sbb-calendar-table-animation-duration)}.sbb-calendar__table.sbb-calendar__table-hide{--sbb-calendar-cell-transition-duration: 0ms;animation-name:hide;animation-duration:var(--sbb-calendar-table-animation-duration)}:host(:not([data-wide])) .sbb-calendar__table{min-width:100%}.sbb-calendar__table-header,.sbb-calendar__table-body{text-align:center}.sbb-calendar__table-header-cell{--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);width:var(--sbb-calendar-cell-size);color:var(--sbb-calendar-header-color);padding:0}:host(:not([multiple])) .sbb-calendar__table-header-cell{height:var(--sbb-calendar-cell-size)}.sbb-calendar__table-data{position:relative;padding:0;text-align:center}.sbb-calendar__header-cell,.sbb-calendar__cell{-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;margin:0;outline:none;border:none;border-radius:0;padding:0;background:none;-webkit-tap-highlight-color:transparent;color:inherit;--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);height:var(--sbb-calendar-cell-size);color:var(--sbb-calendar-cell-color);cursor:var(--sbb-cursor-pointer);position:relative;z-index:0}.sbb-calendar__header-cell:before,.sbb-calendar__cell:before{content:"";position:absolute;inset:var(--sbb-calendar-cell-padding);background-color:var(--sbb-calendar-cell-background-color);border-radius:50%;z-index:-1;transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);transition-property:background-color}@media(any-hover:hover){.sbb-calendar__header-cell:not(.sbb-calendar__selected,:active,:disabled):hover,.sbb-calendar__cell:not(.sbb-calendar__selected,:active,:disabled):hover{--sbb-calendar-cell-background-color: var(--sbb-background-color-3);padding-block-end:var(--sbb-calendar-hover-shift)}}@media(any-hover:hover)and (forced-colors:active){.sbb-calendar__header-cell:not(.sbb-calendar__selected,:active,:disabled):hover:before,.sbb-calendar__cell:not(.sbb-calendar__selected,:active,:disabled):hover:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);--sbb-focus-outline-style: initial}}.sbb-calendar__header-cell:disabled,.sbb-calendar__cell:disabled{--sbb-calendar-cell-color: var(--sbb-calendar-cell-disabled-color);cursor:unset}.sbb-calendar__header-cell:focus-visible:before,.sbb-calendar__cell:focus-visible:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}.sbb-calendar__header-cell:not(.sbb-calendar__selected,:disabled):active,.sbb-calendar__cell:not(.sbb-calendar__selected,:disabled):active{--sbb-calendar-cell-background-color: var(--sbb-background-color-4)}@media(forced-colors:active){.sbb-calendar__header-cell:not(.sbb-calendar__selected,:disabled):active:before,.sbb-calendar__cell:not(.sbb-calendar__selected,:disabled):active:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);--sbb-focus-outline-style: initial}}.sbb-calendar__header-cell{--sbb-text-font-size: var(--sbb-font-size-text-xs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);color:var(--sbb-calendar-header-color)}.sbb-calendar__weekday,.sbb-calendar__day{border-radius:50%;width:var(--sbb-calendar-cell-size)}.sbb-calendar__weekday:before,.sbb-calendar__day:before{border-radius:50%}.sbb-calendar__pill{width:var(--sbb-calendar-wide-cell-size);border-radius:var(--sbb-border-radius-infinity)}.sbb-calendar__pill:before{border-radius:var(--sbb-border-radius-infinity)}.sbb-calendar__crossed-out:after{content:"";height:var(--sbb-calendar-cell-disabled-height);width:var(--sbb-calendar-cell-disabled-width);position:absolute;background-color:var(--sbb-calendar-cell-disabled-color);top:50%;left:50%;transform:translate(-50%,-50%) rotate(-45deg)}.sbb-calendar__cell-current{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);font-weight:700}.sbb-calendar__selected{--sbb-calendar-cell-color: var(--sbb-calendar-cell-selected-color);--sbb-calendar-cell-background-color: var(--sbb-calendar-cell-selected-background-color)}@media(forced-colors:active){.sbb-calendar__selected{--sbb-calendar-cell-background-color: ButtonText !important}}@keyframes show{0%{opacity:0;transform:translateY(var(--sbb-calendar-table-animation-shift))}to{opacity:1;transform:translateY(0)}}@keyframes hide{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(var(--sbb-calendar-table-animation-shift))}}`;
|
|
92
|
+
let Nt = (() => {
|
|
93
|
+
var N, C, I, R, S, T, E, P, L, B, H, K, g;
|
|
94
|
+
let o = [He("sbb-calendar")], n, d = [], h, p = rt(Be), w = [], $, O = [], k = [], M, W = [], ae = [], se, ie = [], re = [], ne, le = [], oe = [], de, ce = [], be = [], he, _e, ue = [], fe = [], ge, pe = [], me = [], ve, we = [], ye = [], De, ke = [], Ae = [], xe, $e = [], Ve = [], Me, Ye, ze = [], Fe = [], Oe, We = [], Ne = [];
|
|
95
|
+
return g = class extends p {
|
|
96
96
|
constructor() {
|
|
97
97
|
super();
|
|
98
98
|
x(this, N);
|
|
@@ -106,29 +106,29 @@ let Ct = (() => {
|
|
|
106
106
|
x(this, L);
|
|
107
107
|
x(this, B);
|
|
108
108
|
x(this, H);
|
|
109
|
-
x(this,
|
|
110
|
-
f(this, N, (u(this,
|
|
109
|
+
x(this, K);
|
|
110
|
+
f(this, N, (u(this, w), u(this, O, !1))), f(this, C, (u(this, k), u(this, W, "day"))), f(this, I, (u(this, ae), u(this, ie, null))), f(this, R, (u(this, re), u(this, le, null))), f(this, S, (u(this, oe), u(this, ce, !1))), f(this, T, (u(this, be), u(this, ue, null))), f(this, E, (u(this, fe), u(this, pe, null))), f(this, P, (u(this, me), u(this, we, "horizontal"))), f(this, L, (u(this, ye), u(this, ke, !1))), this._dateAdapter = (u(this, Ae), Ue().datetime?.dateAdapter ?? Ge), f(this, B, u(this, $e, this._dateAdapter.today())), f(this, H, (u(this, Ve), u(this, ze, "day"))), this._nextCalendarView = (u(this, Fe), "day"), this._keyboardNavigationDayViewParameters = {
|
|
111
111
|
firstDayInView: null,
|
|
112
112
|
lastDayInView: null,
|
|
113
113
|
firstMonthOffset: 0,
|
|
114
114
|
firstMonthLength: 0,
|
|
115
115
|
secondMonthOffset: 0
|
|
116
|
-
}, this._weeks = [], this._monthNames = this._dateAdapter.getMonthNames("long"), this._resetFocus = !1, f(this,
|
|
116
|
+
}, this._weeks = [], this._monthNames = this._dateAdapter.getMonthNames("long"), this._resetFocus = !1, this._containingFocus = !1, f(this, K, u(this, We, !1)), this._language = (u(this, Ne), new qe(this).withHandler(() => {
|
|
117
117
|
this._monthNames = this._dateAdapter.getMonthNames("long"), this._createMonthRows();
|
|
118
|
-
})), this._mediaMatcher = new
|
|
118
|
+
})), this._mediaMatcher = new je(this, {
|
|
119
119
|
[Se]: () => this._init()
|
|
120
|
-
}), this._createMonthRows(), this._setWeekdays();
|
|
120
|
+
}), this._createMonthRows(), this._setWeekdays(), this.addEventListener("focusin", () => this._containingFocus = !0), this.addEventListener("focusout", () => this._containingFocus = !1);
|
|
121
121
|
}
|
|
122
122
|
/** If set to true, two months are displayed */
|
|
123
123
|
get wide() {
|
|
124
|
-
return
|
|
124
|
+
return A(this, N);
|
|
125
125
|
}
|
|
126
126
|
set wide(e) {
|
|
127
127
|
f(this, N, e);
|
|
128
128
|
}
|
|
129
129
|
/** The initial view of the calendar which should be displayed on opening. */
|
|
130
130
|
get view() {
|
|
131
|
-
return
|
|
131
|
+
return A(this, C);
|
|
132
132
|
}
|
|
133
133
|
set view(e) {
|
|
134
134
|
f(this, C, e);
|
|
@@ -138,7 +138,7 @@ let Ct = (() => {
|
|
|
138
138
|
* Accepts an ISO8601 formatted string (e.g. 2024-12-24) as attribute.
|
|
139
139
|
*/
|
|
140
140
|
get min() {
|
|
141
|
-
return
|
|
141
|
+
return A(this, I);
|
|
142
142
|
}
|
|
143
143
|
set min(e) {
|
|
144
144
|
f(this, I, e);
|
|
@@ -148,14 +148,14 @@ let Ct = (() => {
|
|
|
148
148
|
* Accepts an ISO8601 formatted string (e.g. 2024-12-24) as attribute.
|
|
149
149
|
*/
|
|
150
150
|
get max() {
|
|
151
|
-
return
|
|
151
|
+
return A(this, R);
|
|
152
152
|
}
|
|
153
153
|
set max(e) {
|
|
154
154
|
f(this, R, e);
|
|
155
155
|
}
|
|
156
156
|
/** Whether the calendar allows for multiple date selection. */
|
|
157
157
|
get multiple() {
|
|
158
|
-
return
|
|
158
|
+
return A(this, S);
|
|
159
159
|
}
|
|
160
160
|
set multiple(e) {
|
|
161
161
|
f(this, S, e);
|
|
@@ -175,35 +175,35 @@ let Ct = (() => {
|
|
|
175
175
|
return this._selected;
|
|
176
176
|
}
|
|
177
177
|
get _selected() {
|
|
178
|
-
return
|
|
178
|
+
return A(this, T);
|
|
179
179
|
}
|
|
180
180
|
set _selected(e) {
|
|
181
181
|
f(this, T, e);
|
|
182
182
|
}
|
|
183
183
|
/** A function used to filter out dates. */
|
|
184
184
|
get dateFilter() {
|
|
185
|
-
return
|
|
185
|
+
return A(this, E);
|
|
186
186
|
}
|
|
187
187
|
set dateFilter(e) {
|
|
188
188
|
f(this, E, e);
|
|
189
189
|
}
|
|
190
190
|
/** The orientation of days in the calendar. */
|
|
191
191
|
get orientation() {
|
|
192
|
-
return
|
|
192
|
+
return A(this, P);
|
|
193
193
|
}
|
|
194
194
|
set orientation(e) {
|
|
195
195
|
f(this, P, e);
|
|
196
196
|
}
|
|
197
197
|
/** Whether it has to display the week numbers in addition to week days. */
|
|
198
198
|
get weekNumbers() {
|
|
199
|
-
return
|
|
199
|
+
return A(this, L);
|
|
200
200
|
}
|
|
201
201
|
set weekNumbers(e) {
|
|
202
202
|
f(this, L, e);
|
|
203
203
|
}
|
|
204
204
|
/** The currently active date. */
|
|
205
205
|
get _activeDate() {
|
|
206
|
-
return
|
|
206
|
+
return A(this, B);
|
|
207
207
|
}
|
|
208
208
|
set _activeDate(e) {
|
|
209
209
|
f(this, B, e);
|
|
@@ -216,7 +216,7 @@ let Ct = (() => {
|
|
|
216
216
|
return this.hasAttribute("data-wide");
|
|
217
217
|
}
|
|
218
218
|
get _calendarView() {
|
|
219
|
-
return
|
|
219
|
+
return A(this, H);
|
|
220
220
|
}
|
|
221
221
|
set _calendarView(e) {
|
|
222
222
|
f(this, H, e);
|
|
@@ -226,10 +226,10 @@ let Ct = (() => {
|
|
|
226
226
|
return Array.from(this.shadowRoot.querySelectorAll(".sbb-calendar__cell") ?? []);
|
|
227
227
|
}
|
|
228
228
|
get _initialized() {
|
|
229
|
-
return
|
|
229
|
+
return A(this, K);
|
|
230
230
|
}
|
|
231
231
|
set _initialized(e) {
|
|
232
|
-
f(this,
|
|
232
|
+
f(this, K, e);
|
|
233
233
|
}
|
|
234
234
|
_dateFilter(e) {
|
|
235
235
|
return this.dateFilter?.(e) ?? !0;
|
|
@@ -249,7 +249,7 @@ let Ct = (() => {
|
|
|
249
249
|
super.willUpdate(e), this._initialized && ((e.has("wide") || e.has("orientation")) && this.resetPosition(), e.has("view") && (this._setChosenYear(), this._chosenMonth = void 0, this._nextCalendarView = this._calendarView = this.view));
|
|
250
250
|
}
|
|
251
251
|
updated(e) {
|
|
252
|
-
super.updated(e), this._setTabIndex(),
|
|
252
|
+
super.updated(e), this._setTabIndex(), this._focusCell();
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
255
255
|
* The `_selected` state should be adapted when the `multiple` property changes:
|
|
@@ -279,8 +279,8 @@ let Ct = (() => {
|
|
|
279
279
|
}
|
|
280
280
|
/** Creates the array of weekdays. */
|
|
281
281
|
_setWeekdays() {
|
|
282
|
-
const e = this._dateAdapter.getDayOfWeekNames("narrow"), a = this._dateAdapter.getDayOfWeekNames("long").map((
|
|
283
|
-
long:
|
|
282
|
+
const e = this._dateAdapter.getDayOfWeekNames("narrow"), a = this._dateAdapter.getDayOfWeekNames("long").map((i, l) => ({
|
|
283
|
+
long: i,
|
|
284
284
|
narrow: e[l]
|
|
285
285
|
})), s = this._dateAdapter.getFirstDayOfWeek();
|
|
286
286
|
this._weekdays = a.slice(s).concat(a.slice(0, s));
|
|
@@ -297,12 +297,12 @@ let Ct = (() => {
|
|
|
297
297
|
* Then, this array is mapped via the `getWeek` function, which returns the ISO week number for that date.
|
|
298
298
|
*/
|
|
299
299
|
_createWeekNumbers(e) {
|
|
300
|
-
return
|
|
300
|
+
return _t({ start: ut(e), end: bt(e) }, { weekStartsOn: 1 }).map((t) => ee(t, { weekStartsOn: 1, firstWeekContainsDate: 4 }));
|
|
301
301
|
}
|
|
302
302
|
/** Creates the rows along the horizontal direction and sets the parameters used in keyboard navigation. */
|
|
303
303
|
_createWeekRows(e, t = !1) {
|
|
304
|
-
const a = this._dateAdapter.getDateNames(), s = this._dateAdapter.getNumDaysInMonth(e),
|
|
305
|
-
return t ? (this._keyboardNavigationDayViewParameters.secondMonthOffset =
|
|
304
|
+
const a = this._dateAdapter.getDateNames(), s = this._dateAdapter.getNumDaysInMonth(e), i = this._dateAdapter.getFirstWeekOffset(e);
|
|
305
|
+
return t ? (this._keyboardNavigationDayViewParameters.secondMonthOffset = i, this._keyboardNavigationDayViewParameters.lastDayInView = this._dateAdapter.toIso8601(this._dateAdapter.createDate(this._dateAdapter.getYear(e), this._dateAdapter.getMonth(e), s))) : (this._keyboardNavigationDayViewParameters.firstMonthLength = s, this._keyboardNavigationDayViewParameters.firstMonthOffset = i, this._keyboardNavigationDayViewParameters.firstDayInView = this._dateAdapter.toIso8601(this._dateAdapter.createDate(this._dateAdapter.getYear(e), this._dateAdapter.getMonth(e), 1)), this._keyboardNavigationDayViewParameters.lastDayInView = this._dateAdapter.toIso8601(this._dateAdapter.createDate(this._dateAdapter.getYear(e), this._dateAdapter.getMonth(e), s))), this.orientation === "horizontal" ? this._createWeekRowsHorizontal(e, a, s, i) : this._createWeekRowsVertical(e, a, s, i);
|
|
306
306
|
}
|
|
307
307
|
/**
|
|
308
308
|
* Creates the rows for each week in orientation='horizontal'.
|
|
@@ -313,11 +313,11 @@ let Ct = (() => {
|
|
|
313
313
|
* The result is a matrix in which every row is a week (or part of it, considering offset).
|
|
314
314
|
*/
|
|
315
315
|
_createWeekRowsHorizontal(e, t, a, s) {
|
|
316
|
-
const
|
|
317
|
-
for (let l = 0,
|
|
318
|
-
|
|
316
|
+
const i = [[]];
|
|
317
|
+
for (let l = 0, r = s; l < a; l++, r++) {
|
|
318
|
+
r === D && (i.push([]), r = 0);
|
|
319
319
|
const c = this._dateAdapter.createDate(this._dateAdapter.getYear(e), this._dateAdapter.getMonth(e), l + 1), _ = this._dateAdapter.toIso8601(c);
|
|
320
|
-
|
|
320
|
+
i[i.length - 1].push({
|
|
321
321
|
value: _,
|
|
322
322
|
dateValue: c,
|
|
323
323
|
dayValue: t[l],
|
|
@@ -327,7 +327,7 @@ let Ct = (() => {
|
|
|
327
327
|
weekDayValue: this._dateAdapter.getDayOfWeek(c)
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
return
|
|
330
|
+
return i;
|
|
331
331
|
}
|
|
332
332
|
/**
|
|
333
333
|
* Creates the rows for each week in orientation='vertical'.
|
|
@@ -344,11 +344,11 @@ let Ct = (() => {
|
|
|
344
344
|
* - row 7: all the Sundays.
|
|
345
345
|
*/
|
|
346
346
|
_createWeekRowsVertical(e, t, a, s) {
|
|
347
|
-
const
|
|
348
|
-
for (let l = 0,
|
|
349
|
-
|
|
347
|
+
const i = Array.from({ length: D }, () => []);
|
|
348
|
+
for (let l = 0, r = s; l < a; l++, r++) {
|
|
349
|
+
r === D && (r = 0);
|
|
350
350
|
const c = this._dateAdapter.createDate(this._dateAdapter.getYear(e), this._dateAdapter.getMonth(e), l + 1), _ = this._dateAdapter.toIso8601(c);
|
|
351
|
-
r
|
|
351
|
+
i[r].push({
|
|
352
352
|
value: _,
|
|
353
353
|
dateValue: c,
|
|
354
354
|
dayValue: t[l],
|
|
@@ -358,25 +358,25 @@ let Ct = (() => {
|
|
|
358
358
|
weekDayValue: this._dateAdapter.getDayOfWeek(c)
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
|
-
return
|
|
361
|
+
return i;
|
|
362
362
|
}
|
|
363
363
|
/** Creates the rows for the month selection view. */
|
|
364
364
|
_createMonthRows() {
|
|
365
|
-
const e = this._dateAdapter.getMonthNames("short"), t = new Array(12).fill(null).map((
|
|
365
|
+
const e = this._dateAdapter.getMonthNames("short"), t = new Array(12).fill(null).map((i, l) => ({
|
|
366
366
|
value: e[l],
|
|
367
367
|
longValue: this._monthNames[l],
|
|
368
368
|
monthValue: l + 1
|
|
369
369
|
})), a = 12 / J, s = [];
|
|
370
|
-
for (let
|
|
371
|
-
s.push(t.slice(J *
|
|
370
|
+
for (let i = 0; i < a; i++)
|
|
371
|
+
s.push(t.slice(J * i, J * (i + 1)));
|
|
372
372
|
this._months = s;
|
|
373
373
|
}
|
|
374
374
|
/** Creates the rows for the year selection view. */
|
|
375
375
|
_createYearRows(e = 0) {
|
|
376
|
-
const t = this._getStartValueYearView(), a = new Array(V).fill(0).map((l,
|
|
376
|
+
const t = this._getStartValueYearView(), a = new Array(V).fill(0).map((l, r) => t + e + r), s = V / X, i = [];
|
|
377
377
|
for (let l = 0; l < s; l++)
|
|
378
|
-
|
|
379
|
-
return
|
|
378
|
+
i.push(a.slice(X * l, X * (l + 1)));
|
|
379
|
+
return i;
|
|
380
380
|
}
|
|
381
381
|
/**
|
|
382
382
|
* Calculates the first year that will be shown in the year selection panel.
|
|
@@ -455,8 +455,8 @@ let Ct = (() => {
|
|
|
455
455
|
* - if not, the selected dates are the new ones.
|
|
456
456
|
*/
|
|
457
457
|
_selectMultipleDates(e) {
|
|
458
|
-
const t = this._cells.filter((
|
|
459
|
-
this._selected = l.map((
|
|
458
|
+
const t = this._cells.filter((r) => !r.disabled).map((r) => r.value), a = e.map((r) => r.value).filter((r) => t.includes(r)), s = new Set(a), i = new Set(this._selected.map((r) => this._dateAdapter.toIso8601(r))), l = this._updateSelectedWithMultipleDates(a, s, i);
|
|
459
|
+
this._selected = l.map((r) => this._dateAdapter.deserialize(r)), this._emitDateSelectedEvent(this._selected.map((r) => this._dateAdapter.deserialize(r)));
|
|
460
460
|
}
|
|
461
461
|
/**
|
|
462
462
|
* Emits the dateselected event given the detail (as T or T[] based on the value of the multiple flag).
|
|
@@ -549,10 +549,8 @@ let Ct = (() => {
|
|
|
549
549
|
}
|
|
550
550
|
/** Get the element in the calendar to assign focus. */
|
|
551
551
|
_getFirstFocusable() {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
let t = this.shadowRoot.querySelector(".sbb-calendar__selected") ?? this.shadowRoot.querySelector(`[value="${this._dateAdapter.toIso8601(e)}"]`) ?? this.shadowRoot.querySelector(`[data-month="${this._dateAdapter.getMonth(e)}"]`) ?? this.shadowRoot.querySelector(`[data-year="${this._dateAdapter.getYear(e)}"]`);
|
|
555
|
-
return (!t || t?.disabled) && (t = this._calendarView === "day" ? this._getFirstFocusableDay() : this.shadowRoot.querySelector(".sbb-calendar__cell:not([disabled])")), t || null;
|
|
552
|
+
const e = this.shadowRoot.querySelector(".sbb-calendar__selected") ?? this.shadowRoot.querySelector(".sbb-calendar__cell-current");
|
|
553
|
+
return e && !e.disabled ? e : this._calendarView === "day" ? this._getFirstFocusableDay() : this.shadowRoot.querySelector(".sbb-calendar__cell:not([disabled])");
|
|
556
554
|
}
|
|
557
555
|
/**
|
|
558
556
|
* In `day` view in `vertical` orientation,
|
|
@@ -572,43 +570,43 @@ let Ct = (() => {
|
|
|
572
570
|
}
|
|
573
571
|
_handleKeyboardEvent(e, t) {
|
|
574
572
|
Ke(e) && e.preventDefault();
|
|
575
|
-
const a = this._cells, s = a.findIndex((
|
|
576
|
-
let
|
|
577
|
-
t ?
|
|
573
|
+
const a = this._cells, s = a.findIndex((r) => r === e.target);
|
|
574
|
+
let i;
|
|
575
|
+
t ? i = this._navigateByKeyboardDayView(e, s, a, t) : i = this._navigateByKeyboard(e, s, a);
|
|
578
576
|
const l = this.shadowRoot.activeElement;
|
|
579
|
-
|
|
577
|
+
i !== l && (i.tabIndex = 0, i?.focus(), l.tabIndex = -1);
|
|
580
578
|
}
|
|
581
579
|
_navigateByKeyboardDayView(e, t, a, s) {
|
|
582
|
-
const
|
|
580
|
+
const i = this.orientation === "horizontal" ? { leftRight: 1, upDown: D } : { leftRight: D, upDown: 1 }, l = t < this._keyboardNavigationDayViewParameters.firstMonthLength ? this._keyboardNavigationDayViewParameters.firstMonthOffset : this._keyboardNavigationDayViewParameters.secondMonthOffset;
|
|
583
581
|
switch (e.key) {
|
|
584
582
|
case "ArrowUp":
|
|
585
|
-
return this._findDayArrows(a, t, s.dateValue, -
|
|
583
|
+
return this._findDayArrows(a, t, s.dateValue, -i.upDown);
|
|
586
584
|
case "ArrowDown":
|
|
587
|
-
return this._findDayArrows(a, t, s.dateValue,
|
|
585
|
+
return this._findDayArrows(a, t, s.dateValue, i.upDown);
|
|
588
586
|
case "ArrowLeft":
|
|
589
|
-
return this._findDayArrows(a, t, s.dateValue, -
|
|
587
|
+
return this._findDayArrows(a, t, s.dateValue, -i.leftRight);
|
|
590
588
|
case "ArrowRight":
|
|
591
|
-
return this._findDayArrows(a, t, s.dateValue,
|
|
589
|
+
return this._findDayArrows(a, t, s.dateValue, i.leftRight);
|
|
592
590
|
case "PageUp":
|
|
593
591
|
if (this.orientation === "horizontal") {
|
|
594
592
|
const c = (+s.dayValue % D || D) - +s.dayValue;
|
|
595
|
-
return this._findDayPageUpDown(a, t, s, c,
|
|
593
|
+
return this._findDayPageUpDown(a, t, s, c, i.upDown);
|
|
596
594
|
} else {
|
|
597
595
|
const _ = (Math.ceil((+s.dayValue + l) / D) - 1) * D - l + 1 - +s.dayValue;
|
|
598
|
-
return this._findDayPageUpDown(a, t, s, _,
|
|
596
|
+
return this._findDayPageUpDown(a, t, s, _, i.upDown);
|
|
599
597
|
}
|
|
600
598
|
case "PageDown":
|
|
601
599
|
if (this.orientation === "horizontal") {
|
|
602
|
-
const
|
|
603
|
-
return this._findDayPageUpDown(a, t, s, j, -
|
|
600
|
+
const r = +s.monthValue + 1 > 12 ? 1 : +s.monthValue + 1, c = +s.monthValue + 1 > 12 ? +s.yearValue + 1 : +s.yearValue, _ = this._dateAdapter.createDate(c, r, 1), v = this._dateAdapter.getDate(this._dateAdapter.addCalendarDays(_, -1)), j = Math.trunc((v - +s.dayValue) / D) * D;
|
|
601
|
+
return this._findDayPageUpDown(a, t, s, j, -i.upDown);
|
|
604
602
|
} else {
|
|
605
603
|
const _ = Math.ceil((+s.dayValue + l) / D) * D - l - +s.dayValue;
|
|
606
|
-
return this._findDayPageUpDown(a, t, s, _, -
|
|
604
|
+
return this._findDayPageUpDown(a, t, s, _, -i.upDown);
|
|
607
605
|
}
|
|
608
606
|
case "Home":
|
|
609
607
|
return this._findDayFirst(a, t, s, 1);
|
|
610
608
|
case "End": {
|
|
611
|
-
const
|
|
609
|
+
const r = +s.monthValue + 1 > 12 ? 1 : +s.monthValue + 1, c = +s.monthValue + 1 > 12 ? +s.yearValue + 1 : +s.yearValue, _ = this._dateAdapter.createDate(c, r, 1);
|
|
612
610
|
return this._findDayLast(a, t, _);
|
|
613
611
|
}
|
|
614
612
|
default:
|
|
@@ -619,32 +617,32 @@ let Ct = (() => {
|
|
|
619
617
|
return e < this._keyboardNavigationDayViewParameters.firstDayInView || e > this._keyboardNavigationDayViewParameters.lastDayInView;
|
|
620
618
|
}
|
|
621
619
|
_findDayArrows(e, t, a, s) {
|
|
622
|
-
const
|
|
623
|
-
if (this._isDayOutOfView(
|
|
620
|
+
const i = this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(a, s));
|
|
621
|
+
if (this._isDayOutOfView(i))
|
|
624
622
|
return e[t];
|
|
625
|
-
const l = e.find((
|
|
626
|
-
return !l || l.disabled ? this._findDayArrows(e, t, this._dateAdapter.deserialize(
|
|
623
|
+
const l = e.find((r) => r.value === i);
|
|
624
|
+
return !l || l.disabled ? this._findDayArrows(e, t, this._dateAdapter.deserialize(i), s) : l;
|
|
627
625
|
}
|
|
628
|
-
_findDayPageUpDown(e, t, a, s,
|
|
626
|
+
_findDayPageUpDown(e, t, a, s, i) {
|
|
629
627
|
const l = this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(a.dateValue, s));
|
|
630
628
|
if (this._isDayOutOfView(l))
|
|
631
629
|
return e[t];
|
|
632
|
-
const
|
|
633
|
-
return !
|
|
630
|
+
const r = e.find((c) => c.value === l);
|
|
631
|
+
return !r || r.disabled ? this._findDayPageUpDown(e, t, a, s + i, i) : r;
|
|
634
632
|
}
|
|
635
633
|
_findDayFirst(e, t, a, s) {
|
|
636
|
-
const
|
|
637
|
-
if (this._isDayOutOfView(
|
|
634
|
+
const i = this._dateAdapter.toIso8601(this._dateAdapter.createDate(+a.yearValue, +a.monthValue, s));
|
|
635
|
+
if (this._isDayOutOfView(i))
|
|
638
636
|
return e[t];
|
|
639
|
-
const l = e.find((
|
|
637
|
+
const l = e.find((r) => r.value === i);
|
|
640
638
|
return !l || l.disabled ? this._findDayFirst(e, t, a, s + 1) : l;
|
|
641
639
|
}
|
|
642
640
|
_findDayLast(e, t, a) {
|
|
643
641
|
const s = this._dateAdapter.toIso8601(this._dateAdapter.addCalendarDays(a, -1));
|
|
644
642
|
if (this._isDayOutOfView(s))
|
|
645
643
|
return e[t];
|
|
646
|
-
const
|
|
647
|
-
return !
|
|
644
|
+
const i = e.find((l) => l.value === s);
|
|
645
|
+
return !i || i.disabled ? this._findDayLast(e, t, this._dateAdapter.deserialize(s)) : i;
|
|
648
646
|
}
|
|
649
647
|
/**
|
|
650
648
|
* Gets the index of the element to move to, based on a list of elements (which can be potentially disabled),
|
|
@@ -653,22 +651,22 @@ let Ct = (() => {
|
|
|
653
651
|
* while in month and year view it's not due to the fixed amount of rendered cells.
|
|
654
652
|
*/
|
|
655
653
|
_navigateByKeyboard(e, t, a) {
|
|
656
|
-
const { elementIndexForWideMode: s, offsetForWideMode:
|
|
654
|
+
const { elementIndexForWideMode: s, offsetForWideMode: i, lastElementIndexForWideMode: l, verticalOffset: r } = this._calculateParametersForKeyboardNavigation(t, this._calendarView === "year");
|
|
657
655
|
switch (e.key) {
|
|
658
656
|
case "ArrowUp":
|
|
659
|
-
return this._findNext(a, t, -
|
|
657
|
+
return this._findNext(a, t, -r);
|
|
660
658
|
case "ArrowDown":
|
|
661
|
-
return this._findNext(a, t,
|
|
659
|
+
return this._findNext(a, t, r);
|
|
662
660
|
case "ArrowLeft":
|
|
663
661
|
return this._findNext(a, t, -1);
|
|
664
662
|
case "ArrowRight":
|
|
665
663
|
return this._findNext(a, t, 1);
|
|
666
664
|
case "Home":
|
|
667
|
-
return this._findFirst(a,
|
|
665
|
+
return this._findFirst(a, i);
|
|
668
666
|
case "PageUp":
|
|
669
|
-
return this._findFirstOnColumn(a, s,
|
|
667
|
+
return this._findFirstOnColumn(a, s, i, r);
|
|
670
668
|
case "PageDown":
|
|
671
|
-
return this._findLastOnColumn(a, t, l,
|
|
669
|
+
return this._findLastOnColumn(a, t, l, r);
|
|
672
670
|
case "End":
|
|
673
671
|
return this._findLast(a, l - 1);
|
|
674
672
|
default:
|
|
@@ -681,11 +679,11 @@ let Ct = (() => {
|
|
|
681
679
|
* @param isYearView Whether the displayed `view` is the year one.
|
|
682
680
|
*/
|
|
683
681
|
_calculateParametersForKeyboardNavigation(e, t) {
|
|
684
|
-
const a = t ? V :
|
|
682
|
+
const a = t ? V : Qe, s = Math.trunc(e / a) * a, i = s === 0 ? e : e - a;
|
|
685
683
|
return {
|
|
686
684
|
verticalOffset: t ? X : J,
|
|
687
|
-
elementIndexForWideMode:
|
|
688
|
-
offsetForWideMode: e -
|
|
685
|
+
elementIndexForWideMode: i,
|
|
686
|
+
offsetForWideMode: e - i,
|
|
689
687
|
lastElementIndexForWideMode: s === 0 ? a : a * 2
|
|
690
688
|
};
|
|
691
689
|
}
|
|
@@ -709,23 +707,23 @@ let Ct = (() => {
|
|
|
709
707
|
}
|
|
710
708
|
/** Find the first enabled element in the same column of the provided array. */
|
|
711
709
|
_findFirstOnColumn(e, t, a, s) {
|
|
712
|
-
const
|
|
713
|
-
return e[
|
|
710
|
+
const i = t % s + a;
|
|
711
|
+
return e[i].disabled ? this._findNext(e, i, s) : e[i];
|
|
714
712
|
}
|
|
715
713
|
/** Find the last enabled element in the same column of the provided array. */
|
|
716
714
|
_findLastOnColumn(e, t, a, s) {
|
|
717
|
-
const
|
|
718
|
-
return e[
|
|
715
|
+
const i = t + Math.trunc((a - t - 1) / s) * s;
|
|
716
|
+
return e[i].disabled ? this._findNext(e, i, -s) : e[i];
|
|
719
717
|
}
|
|
720
718
|
_resetCalendarView(e = !1) {
|
|
721
|
-
this._resetFocus = !0, this._activeDate = (this.multiple ? this._selected.at(-1) : this._selected) ?? this._dateAdapter.today(), this._setChosenYear(), this._chosenMonth = void 0, this._nextCalendarView = this._calendarView = this.view, e && this._startTableTransition();
|
|
719
|
+
this._containingFocus && (this._resetFocus = !0), this._activeDate = (this.multiple ? this._selected.at(-1) : this._selected) ?? this._dateAdapter.today(), this._setChosenYear(), this._chosenMonth = void 0, this._init(), this._nextCalendarView = this._calendarView = this.view, e && this._startTableTransition();
|
|
722
720
|
}
|
|
723
721
|
/** Render the view for the day selection. */
|
|
724
722
|
_renderDayView() {
|
|
725
723
|
const e = this._wide ? this._dateAdapter.addCalendarMonths(this._activeDate, 1) : void 0;
|
|
726
|
-
return
|
|
724
|
+
return b`
|
|
727
725
|
<div class="sbb-calendar__controls">
|
|
728
|
-
${this._getArrow("left", () => this._goToDifferentMonth(-1),
|
|
726
|
+
${this._getArrow("left", () => this._goToDifferentMonth(-1), Xe[this._language.current], this._previousMonthDisabled())}
|
|
729
727
|
<div class="sbb-calendar__controls-month">
|
|
730
728
|
${this._createLabelForDayView(this._activeDate)}
|
|
731
729
|
${this._wide ? this._createLabelForDayView(e) : m}
|
|
@@ -733,27 +731,29 @@ let Ct = (() => {
|
|
|
733
731
|
${this._createAriaLabelForDayView(this._activeDate, e)}
|
|
734
732
|
</sbb-screen-reader-only>
|
|
735
733
|
</div>
|
|
736
|
-
${this._getArrow("right", () => this._goToDifferentMonth(1),
|
|
734
|
+
${this._getArrow("right", () => this._goToDifferentMonth(1), Ze[this._language.current], this._nextMonthDisabled())}
|
|
737
735
|
</div>
|
|
738
|
-
<div class="sbb-calendar__table-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
736
|
+
<div class="sbb-calendar__table-overflow-break">
|
|
737
|
+
<div class="sbb-calendar__table-container sbb-calendar__table-day-view">
|
|
738
|
+
${this.orientation === "horizontal" ? b`
|
|
739
|
+
${this._createDayTable(this._weeks, this._weekNumbers)}
|
|
740
|
+
${this._wide ? this._createDayTable(this._nextMonthWeeks, this._nextMonthWeekNumbers, !0) : m}
|
|
741
|
+
` : b`
|
|
742
|
+
${this._createDayTableVertical(this._weeks, this._weekNumbers)}
|
|
743
|
+
${this._wide ? this._createDayTableVertical(this._nextMonthWeeks, this._nextMonthWeekNumbers, e) : m}
|
|
744
|
+
`}
|
|
745
|
+
</div>
|
|
746
746
|
</div>
|
|
747
747
|
`;
|
|
748
748
|
}
|
|
749
749
|
/** Creates the label with the month for the daily view. */
|
|
750
750
|
_createLabelForDayView(e) {
|
|
751
751
|
const t = `${this._monthNames[this._dateAdapter.getMonth(e) - 1]} ${this._dateAdapter.getYear(e)}`;
|
|
752
|
-
return
|
|
752
|
+
return b`
|
|
753
753
|
<button
|
|
754
754
|
type="button"
|
|
755
755
|
class="sbb-calendar__date-selection sbb-calendar__controls-change-date"
|
|
756
|
-
aria-label="${
|
|
756
|
+
aria-label="${et[this._language.current]} ${t}"
|
|
757
757
|
@click=${() => {
|
|
758
758
|
this._resetFocus = !0, this._nextCalendarView = "year", this._startTableTransition();
|
|
759
759
|
}}
|
|
@@ -772,90 +772,90 @@ let Ct = (() => {
|
|
|
772
772
|
}
|
|
773
773
|
/** Creates the calendar table for the daily view. */
|
|
774
774
|
_createDayTable(e, t, a = !1) {
|
|
775
|
-
const s = this._dateAdapter.toIso8601(this._dateAdapter.today()),
|
|
776
|
-
return
|
|
775
|
+
const s = this._dateAdapter.toIso8601(this._dateAdapter.today()), i = (this._wide ? [...this._weeks, ...this._nextMonthWeeks] : a ? this._nextMonthWeeks : this._weeks).flat(), l = (a ? this._nextMonthWeeks : this._weeks).flat();
|
|
776
|
+
return b`
|
|
777
777
|
<table
|
|
778
778
|
class="sbb-calendar__table"
|
|
779
|
-
@focusout=${(
|
|
780
|
-
@animationend=${(
|
|
779
|
+
@focusout=${(r) => this._handleTableBlur(r.relatedTarget)}
|
|
780
|
+
@animationend=${(r) => this._tableAnimationEnd(r)}
|
|
781
781
|
>
|
|
782
782
|
<thead class="sbb-calendar__table-header">
|
|
783
783
|
<tr>
|
|
784
|
-
${this.weekNumbers ?
|
|
785
|
-
${this._weekdays.map((
|
|
784
|
+
${this.weekNumbers ? b`<th class="sbb-calendar__table-header-cell"></th>` : m}
|
|
785
|
+
${this._weekdays.map((r, c) => b`
|
|
786
786
|
<th class="sbb-calendar__table-header-cell">
|
|
787
|
-
${this.multiple ?
|
|
787
|
+
${this.multiple ? b`
|
|
788
788
|
<button
|
|
789
789
|
class="sbb-calendar__header-cell sbb-calendar__weekday"
|
|
790
|
-
aria-label=${
|
|
790
|
+
aria-label=${r.long}
|
|
791
791
|
@click=${() => {
|
|
792
|
-
const _ = l.filter((
|
|
792
|
+
const _ = l.filter((v) => v.weekDayValue === (c + 1) % 7);
|
|
793
793
|
this._selectMultipleDates(_);
|
|
794
794
|
}}
|
|
795
795
|
>
|
|
796
|
-
${
|
|
796
|
+
${r.narrow}
|
|
797
797
|
</button>
|
|
798
|
-
` :
|
|
799
|
-
<sbb-screen-reader-only>${
|
|
800
|
-
<span aria-hidden="true">${
|
|
798
|
+
` : b`
|
|
799
|
+
<sbb-screen-reader-only>${r.long}</sbb-screen-reader-only>
|
|
800
|
+
<span aria-hidden="true">${r.narrow}</span>
|
|
801
801
|
`}
|
|
802
802
|
</th>
|
|
803
803
|
`)}
|
|
804
804
|
</tr>
|
|
805
805
|
</thead>
|
|
806
806
|
<tbody class="sbb-calendar__table-body">
|
|
807
|
-
${e.map((
|
|
808
|
-
const _ = D -
|
|
809
|
-
return c === 0 && _ ?
|
|
807
|
+
${e.map((r, c) => {
|
|
808
|
+
const _ = D - r.length;
|
|
809
|
+
return c === 0 && _ ? b`
|
|
810
810
|
<tr>
|
|
811
|
-
${this.weekNumbers ?
|
|
811
|
+
${this.weekNumbers ? b`
|
|
812
812
|
<td class="sbb-calendar__table-header-cell">
|
|
813
|
-
${this.multiple ?
|
|
813
|
+
${this.multiple ? b`
|
|
814
814
|
<button
|
|
815
815
|
class="sbb-calendar__header-cell sbb-calendar__weekday"
|
|
816
|
-
aria-label=${`${
|
|
816
|
+
aria-label=${`${U[this._language.current]} ${t[0]}`}
|
|
817
817
|
@click=${() => {
|
|
818
|
-
const
|
|
819
|
-
this._selectMultipleDates(
|
|
818
|
+
const v = i.filter((j) => j.weekValue === t[0]);
|
|
819
|
+
this._selectMultipleDates(v);
|
|
820
820
|
}}
|
|
821
821
|
>
|
|
822
822
|
${t[0]}
|
|
823
823
|
</button>
|
|
824
|
-
` :
|
|
824
|
+
` : b`
|
|
825
825
|
<sbb-screen-reader-only
|
|
826
|
-
>${`${
|
|
826
|
+
>${`${U[this._language.current]} ${t[0]}`}</sbb-screen-reader-only
|
|
827
827
|
>
|
|
828
828
|
<span aria-hidden="true">${t[0]}</span>
|
|
829
829
|
`}
|
|
830
830
|
</td>
|
|
831
831
|
` : m}
|
|
832
|
-
${[...Array(_).keys()].map(() =>
|
|
833
|
-
${this._createDayCells(
|
|
832
|
+
${[...Array(_).keys()].map(() => b`<td class="sbb-calendar__table-data"></td>`)}
|
|
833
|
+
${this._createDayCells(r, s)}
|
|
834
834
|
</tr>
|
|
835
|
-
` :
|
|
835
|
+
` : b`
|
|
836
836
|
<tr>
|
|
837
|
-
${this.weekNumbers ?
|
|
837
|
+
${this.weekNumbers ? b`
|
|
838
838
|
<td class="sbb-calendar__table-header-cell">
|
|
839
|
-
${this.multiple ?
|
|
839
|
+
${this.multiple ? b`
|
|
840
840
|
<button
|
|
841
841
|
class="sbb-calendar__header-cell sbb-calendar__weekday"
|
|
842
|
-
aria-label=${`${
|
|
842
|
+
aria-label=${`${U[this._language.current]} ${t[c]}`}
|
|
843
843
|
@click=${() => {
|
|
844
|
-
const
|
|
845
|
-
this._selectMultipleDates(
|
|
844
|
+
const v = i.filter((j) => j.weekValue === t[c]);
|
|
845
|
+
this._selectMultipleDates(v);
|
|
846
846
|
}}
|
|
847
847
|
>
|
|
848
848
|
${t[c]}
|
|
849
849
|
</button>
|
|
850
|
-
` :
|
|
850
|
+
` : b`
|
|
851
851
|
<sbb-screen-reader-only
|
|
852
|
-
>${`${
|
|
852
|
+
>${`${U[this._language.current]} ${t[c]}`}</sbb-screen-reader-only
|
|
853
853
|
>
|
|
854
854
|
<span aria-hidden="true">${t[c]}</span>
|
|
855
855
|
`}
|
|
856
856
|
</td>
|
|
857
857
|
` : m}
|
|
858
|
-
${this._createDayCells(
|
|
858
|
+
${this._createDayCells(r, s)}
|
|
859
859
|
</tr>
|
|
860
860
|
`;
|
|
861
861
|
})}
|
|
@@ -865,35 +865,35 @@ let Ct = (() => {
|
|
|
865
865
|
}
|
|
866
866
|
/** Creates the table in orientation='vertical'. */
|
|
867
867
|
_createDayTableVertical(e, t, a) {
|
|
868
|
-
const s = this._dateAdapter.toIso8601(this._dateAdapter.today()),
|
|
869
|
-
return
|
|
868
|
+
const s = this._dateAdapter.toIso8601(this._dateAdapter.today()), i = this._dateAdapter.getFirstWeekOffset(a ?? this._activeDate), l = (this._wide ? [...this._weeks, ...this._nextMonthWeeks] : a ? this._nextMonthWeeks : this._weeks).flat();
|
|
869
|
+
return b`
|
|
870
870
|
<table
|
|
871
871
|
class="sbb-calendar__table"
|
|
872
|
-
@focusout=${(
|
|
873
|
-
@animationend=${(
|
|
872
|
+
@focusout=${(r) => this._handleTableBlur(r.relatedTarget)}
|
|
873
|
+
@animationend=${(r) => this._tableAnimationEnd(r)}
|
|
874
874
|
>
|
|
875
|
-
${this.weekNumbers ?
|
|
875
|
+
${this.weekNumbers ? b`
|
|
876
876
|
<thead class="sbb-calendar__table-header">
|
|
877
877
|
<tr>
|
|
878
|
-
${a ? m :
|
|
879
|
-
${t.map((
|
|
878
|
+
${a ? m : b`<th class="sbb-calendar__table-data"></th>`}
|
|
879
|
+
${t.map((r) => b`
|
|
880
880
|
<th class="sbb-calendar__table-header-cell">
|
|
881
|
-
${this.multiple ?
|
|
881
|
+
${this.multiple ? b`
|
|
882
882
|
<button
|
|
883
883
|
class="sbb-calendar__header-cell sbb-calendar__weekday"
|
|
884
|
-
aria-label=${`${
|
|
884
|
+
aria-label=${`${U[this._language.current]} ${r}`}
|
|
885
885
|
@click=${() => {
|
|
886
|
-
const c = l.filter((_) => _.weekValue ===
|
|
886
|
+
const c = l.filter((_) => _.weekValue === r);
|
|
887
887
|
this._selectMultipleDates(c);
|
|
888
888
|
}}
|
|
889
889
|
>
|
|
890
|
-
${
|
|
890
|
+
${r}
|
|
891
891
|
</button>
|
|
892
|
-
` :
|
|
892
|
+
` : b`
|
|
893
893
|
<sbb-screen-reader-only
|
|
894
|
-
>${`${
|
|
894
|
+
>${`${U[this._language.current]} ${r}`}</sbb-screen-reader-only
|
|
895
895
|
>
|
|
896
|
-
<span aria-hidden="true">${
|
|
896
|
+
<span aria-hidden="true">${r}</span>
|
|
897
897
|
`}
|
|
898
898
|
</th>
|
|
899
899
|
`)}
|
|
@@ -901,28 +901,28 @@ let Ct = (() => {
|
|
|
901
901
|
</thead>
|
|
902
902
|
` : m}
|
|
903
903
|
<tbody class="sbb-calendar__table-body">
|
|
904
|
-
${e.map((
|
|
905
|
-
const _ = this._weekdays[c],
|
|
906
|
-
return
|
|
904
|
+
${e.map((r, c) => {
|
|
905
|
+
const _ = this._weekdays[c], v = this._wide ? [...r, ...this._nextMonthWeeks[c]] : r;
|
|
906
|
+
return b`
|
|
907
907
|
<tr>
|
|
908
|
-
${a ? m :
|
|
908
|
+
${a ? m : b`
|
|
909
909
|
<td class="sbb-calendar__table-header-cell">
|
|
910
|
-
${this.multiple ?
|
|
910
|
+
${this.multiple ? b`
|
|
911
911
|
<button
|
|
912
912
|
class="sbb-calendar__header-cell sbb-calendar__weekday"
|
|
913
913
|
aria-label=${_.long}
|
|
914
|
-
@click=${() => this._selectMultipleDates(
|
|
914
|
+
@click=${() => this._selectMultipleDates(v)}
|
|
915
915
|
>
|
|
916
916
|
${_.narrow}
|
|
917
917
|
</button>
|
|
918
|
-
` :
|
|
918
|
+
` : b`
|
|
919
919
|
<sbb-screen-reader-only>${_.long}</sbb-screen-reader-only>
|
|
920
920
|
<span aria-hidden="true">${_.narrow}</span>
|
|
921
921
|
`}
|
|
922
922
|
</td>
|
|
923
923
|
`}
|
|
924
|
-
${c <
|
|
925
|
-
${this._createDayCells(
|
|
924
|
+
${c < i ? b`<td class="sbb-calendar__table-data"></td>` : m}
|
|
925
|
+
${this._createDayCells(r, s)}
|
|
926
926
|
</tr>
|
|
927
927
|
`;
|
|
928
928
|
})}
|
|
@@ -933,13 +933,13 @@ let Ct = (() => {
|
|
|
933
933
|
/** Creates the cells for the daily view. */
|
|
934
934
|
_createDayCells(e, t) {
|
|
935
935
|
return e.map((a) => {
|
|
936
|
-
const s = !this._isDayInRange(a.value),
|
|
937
|
-
let
|
|
938
|
-
return this.multiple ?
|
|
936
|
+
const s = !this._isDayInRange(a.value), i = !this._dateFilter(this._dateAdapter.deserialize(a.value)), l = a.value === t;
|
|
937
|
+
let r;
|
|
938
|
+
return this.multiple ? r = this._selected.find((c) => this._dateAdapter.compareDate(a.dateValue, c) === 0) !== void 0 : r = !!this._selected && this._dateAdapter.compareDate(a.dateValue, this._selected) === 0, b`
|
|
939
939
|
<td
|
|
940
940
|
class=${Q({
|
|
941
941
|
"sbb-calendar__table-data": !0,
|
|
942
|
-
"sbb-calendar__table-data-selected":
|
|
942
|
+
"sbb-calendar__table-data-selected": r
|
|
943
943
|
})}
|
|
944
944
|
>
|
|
945
945
|
<button
|
|
@@ -947,16 +947,16 @@ let Ct = (() => {
|
|
|
947
947
|
"sbb-calendar__cell": !0,
|
|
948
948
|
"sbb-calendar__day": !0,
|
|
949
949
|
"sbb-calendar__cell-current": l,
|
|
950
|
-
"sbb-calendar__selected":
|
|
951
|
-
"sbb-calendar__crossed-out": !s &&
|
|
950
|
+
"sbb-calendar__selected": r,
|
|
951
|
+
"sbb-calendar__crossed-out": !s && i
|
|
952
952
|
})}
|
|
953
953
|
@click=${() => this._selectDate(a.dateValue)}
|
|
954
|
-
?disabled=${s ||
|
|
954
|
+
?disabled=${s || i}
|
|
955
955
|
value=${a.value}
|
|
956
956
|
type="button"
|
|
957
957
|
aria-label=${this._dateAdapter.getAccessibilityFormatDate(a.value)}
|
|
958
|
-
aria-pressed=${
|
|
959
|
-
aria-disabled=${s ||
|
|
958
|
+
aria-pressed=${r}
|
|
959
|
+
aria-disabled=${s || i}
|
|
960
960
|
aria-current=${l ? "date" : m}
|
|
961
961
|
tabindex="-1"
|
|
962
962
|
@keydown=${(c) => this._handleKeyboardEvent(c, a)}
|
|
@@ -970,21 +970,23 @@ let Ct = (() => {
|
|
|
970
970
|
}
|
|
971
971
|
/** Render the view for the month selection. */
|
|
972
972
|
_renderMonthView() {
|
|
973
|
-
return
|
|
973
|
+
return b`
|
|
974
974
|
<div class="sbb-calendar__controls">
|
|
975
|
-
${this._getArrow("left", () => this._goToDifferentYear(-1),
|
|
975
|
+
${this._getArrow("left", () => this._goToDifferentYear(-1), tt[this._language.current], this._previousYearDisabled())}
|
|
976
976
|
<div class="sbb-calendar__controls-month">${this._createLabelForMonthView()}</div>
|
|
977
|
-
${this._getArrow("right", () => this._goToDifferentYear(1),
|
|
977
|
+
${this._getArrow("right", () => this._goToDifferentYear(1), at[this._language.current], this._nextYearDisabled())}
|
|
978
978
|
</div>
|
|
979
|
-
<div class="sbb-calendar__table-
|
|
980
|
-
|
|
981
|
-
|
|
979
|
+
<div class="sbb-calendar__table-overflow-break">
|
|
980
|
+
<div class="sbb-calendar__table-container sbb-calendar__table-month-view">
|
|
981
|
+
${this._createMonthTable(this._months, this._chosenYear)}
|
|
982
|
+
${this._wide ? this._createMonthTable(this._months, this._chosenYear + 1) : m}
|
|
983
|
+
</div>
|
|
982
984
|
</div>
|
|
983
985
|
`;
|
|
984
986
|
}
|
|
985
987
|
/** Creates the label with the year for the monthly view. */
|
|
986
988
|
_createLabelForMonthView() {
|
|
987
|
-
return
|
|
989
|
+
return b` <button
|
|
988
990
|
type="button"
|
|
989
991
|
id="sbb-calendar__month-selection"
|
|
990
992
|
class="sbb-calendar__controls-change-date"
|
|
@@ -998,29 +1000,29 @@ let Ct = (() => {
|
|
|
998
1000
|
}
|
|
999
1001
|
/** Creates the table for the month selection view. */
|
|
1000
1002
|
_createMonthTable(e, t) {
|
|
1001
|
-
return
|
|
1003
|
+
return b`
|
|
1002
1004
|
<table
|
|
1003
1005
|
class="sbb-calendar__table"
|
|
1004
1006
|
@animationend=${(a) => this._tableAnimationEnd(a)}
|
|
1005
1007
|
>
|
|
1006
|
-
${this._wide ?
|
|
1008
|
+
${this._wide ? b`<thead class="sbb-calendar__table-header" aria-hidden="true">
|
|
1007
1009
|
<tr>
|
|
1008
1010
|
<th class="sbb-calendar__table-header-cell" colspan=${J}>${t}</th>
|
|
1009
1011
|
</tr>
|
|
1010
1012
|
</thead>` : m}
|
|
1011
1013
|
<tbody class="sbb-calendar__table-body">
|
|
1012
|
-
${e.map((a) =>
|
|
1014
|
+
${e.map((a) => b`
|
|
1013
1015
|
<tr>
|
|
1014
1016
|
${a.map((s) => {
|
|
1015
|
-
let
|
|
1017
|
+
let i;
|
|
1016
1018
|
if (this.multiple)
|
|
1017
|
-
|
|
1019
|
+
i = this._selected.find((_) => t === this._dateAdapter.getYear(_) && s.monthValue === this._dateAdapter.getMonth(_)) !== void 0;
|
|
1018
1020
|
else {
|
|
1019
|
-
const _ = this._selected ? this._dateAdapter.getMonth(this._selected) : void 0,
|
|
1020
|
-
|
|
1021
|
+
const _ = this._selected ? this._dateAdapter.getMonth(this._selected) : void 0, v = this._selected ? this._dateAdapter.getYear(this._selected) : void 0;
|
|
1022
|
+
i = !!this._selected && t === v && s.monthValue === _;
|
|
1021
1023
|
}
|
|
1022
|
-
const l = !this._isMonthInRange(s.monthValue, t),
|
|
1023
|
-
return
|
|
1024
|
+
const l = !this._isMonthInRange(s.monthValue, t), r = !this._isMonthFilteredOut(s.monthValue, t), c = t === this._dateAdapter.getYear(this._dateAdapter.today()) && this._dateAdapter.getMonth(this._dateAdapter.today()) === s.monthValue;
|
|
1025
|
+
return b` <td
|
|
1024
1026
|
class=${Q({
|
|
1025
1027
|
"sbb-calendar__table-data": !0,
|
|
1026
1028
|
"sbb-calendar__table-month": !0
|
|
@@ -1031,14 +1033,14 @@ let Ct = (() => {
|
|
|
1031
1033
|
"sbb-calendar__cell": !0,
|
|
1032
1034
|
"sbb-calendar__pill": !0,
|
|
1033
1035
|
"sbb-calendar__cell-current": c,
|
|
1034
|
-
"sbb-calendar__crossed-out": !l &&
|
|
1035
|
-
"sbb-calendar__selected":
|
|
1036
|
+
"sbb-calendar__crossed-out": !l && r,
|
|
1037
|
+
"sbb-calendar__selected": i
|
|
1036
1038
|
})}
|
|
1037
1039
|
@click=${() => this._onMonthSelection(s.monthValue, t)}
|
|
1038
|
-
?disabled=${l ||
|
|
1040
|
+
?disabled=${l || r}
|
|
1039
1041
|
aria-label=${`${s.longValue} ${t}`}
|
|
1040
|
-
aria-pressed=${
|
|
1041
|
-
aria-disabled=${String(l ||
|
|
1042
|
+
aria-pressed=${i}
|
|
1043
|
+
aria-disabled=${String(l || r)}
|
|
1042
1044
|
tabindex="-1"
|
|
1043
1045
|
data-month=${s.monthValue || m}
|
|
1044
1046
|
@keydown=${(_) => this._handleKeyboardEvent(_)}
|
|
@@ -1059,21 +1061,23 @@ let Ct = (() => {
|
|
|
1059
1061
|
}
|
|
1060
1062
|
/** Render the view for the year selection. */
|
|
1061
1063
|
_renderYearView() {
|
|
1062
|
-
return
|
|
1064
|
+
return b`
|
|
1063
1065
|
<div class="sbb-calendar__controls">
|
|
1064
|
-
${this._getArrow("left", () => this._goToDifferentYearRange(-V),
|
|
1066
|
+
${this._getArrow("left", () => this._goToDifferentYearRange(-V), st(V)[this._language.current], this._previousYearRangeDisabled())}
|
|
1065
1067
|
<div class="sbb-calendar__controls-month">${this._createLabelForYearView()}</div>
|
|
1066
1068
|
${this._getArrow("right", () => this._goToDifferentYearRange(V), it(V)[this._language.current], this._nextYearRangeDisabled())}
|
|
1067
1069
|
</div>
|
|
1068
|
-
<div class="sbb-calendar__table-
|
|
1069
|
-
|
|
1070
|
-
|
|
1070
|
+
<div class="sbb-calendar__table-overflow-break">
|
|
1071
|
+
<div class="sbb-calendar__table-container sbb-calendar__table-year-view">
|
|
1072
|
+
${this._createYearTable(this._years)}
|
|
1073
|
+
${this._wide ? this._createYearTable(this._nextMonthYears, !0) : m}
|
|
1074
|
+
</div>
|
|
1071
1075
|
</div>
|
|
1072
1076
|
`;
|
|
1073
1077
|
}
|
|
1074
1078
|
/** Creates the button arrow for all the views. */
|
|
1075
1079
|
_getArrow(e, t, a, s) {
|
|
1076
|
-
return
|
|
1080
|
+
return b`<sbb-secondary-button
|
|
1077
1081
|
size="m"
|
|
1078
1082
|
icon-name="chevron-small-${e}-small"
|
|
1079
1083
|
aria-label=${a}
|
|
@@ -1085,7 +1089,7 @@ let Ct = (() => {
|
|
|
1085
1089
|
/** Creates the label with the year range for the yearly view. */
|
|
1086
1090
|
_createLabelForYearView() {
|
|
1087
1091
|
const e = this._years.flat()[0], t = (this._wide ? this._nextMonthYears : this._years).flat(), a = t[t.length - 1], s = `${e} - ${a}`;
|
|
1088
|
-
return
|
|
1092
|
+
return b`
|
|
1089
1093
|
<button
|
|
1090
1094
|
type="button"
|
|
1091
1095
|
id="sbb-calendar__year-selection"
|
|
@@ -1102,40 +1106,40 @@ let Ct = (() => {
|
|
|
1102
1106
|
/** Creates the table for the year selection view. */
|
|
1103
1107
|
_createYearTable(e, t = !1) {
|
|
1104
1108
|
const a = this._dateAdapter.today();
|
|
1105
|
-
return
|
|
1109
|
+
return b` <table
|
|
1106
1110
|
class="sbb-calendar__table"
|
|
1107
1111
|
@animationend=${(s) => this._tableAnimationEnd(s)}
|
|
1108
1112
|
>
|
|
1109
1113
|
<tbody class="sbb-calendar__table-body">
|
|
1110
|
-
${e.map((s) =>
|
|
1111
|
-
${s.map((
|
|
1114
|
+
${e.map((s) => b` <tr>
|
|
1115
|
+
${s.map((i) => {
|
|
1112
1116
|
let l;
|
|
1113
1117
|
if (this.multiple)
|
|
1114
|
-
l = this._selected.find((
|
|
1118
|
+
l = this._selected.find((v) => i === this._dateAdapter.getYear(v)) !== void 0;
|
|
1115
1119
|
else {
|
|
1116
|
-
const
|
|
1117
|
-
l = !!this._selected &&
|
|
1120
|
+
const v = this._selected ? this._dateAdapter.getYear(this._selected) : void 0;
|
|
1121
|
+
l = !!this._selected && i === v;
|
|
1118
1122
|
}
|
|
1119
|
-
const
|
|
1120
|
-
return
|
|
1123
|
+
const r = !this._isYearInRange(i), c = !this._isYearFilteredOut(i), _ = this._dateAdapter.getYear(a) === i;
|
|
1124
|
+
return b` <td class="sbb-calendar__table-data sbb-calendar__table-year">
|
|
1121
1125
|
<button
|
|
1122
1126
|
class=${Q({
|
|
1123
1127
|
"sbb-calendar__cell": !0,
|
|
1124
1128
|
"sbb-calendar__pill": !0,
|
|
1125
1129
|
"sbb-calendar__cell-current": _,
|
|
1126
|
-
"sbb-calendar__crossed-out": !
|
|
1130
|
+
"sbb-calendar__crossed-out": !r && c,
|
|
1127
1131
|
"sbb-calendar__selected": l
|
|
1128
1132
|
})}
|
|
1129
|
-
@click=${() => this._onYearSelection(
|
|
1130
|
-
?disabled=${
|
|
1131
|
-
aria-label=${
|
|
1133
|
+
@click=${() => this._onYearSelection(i, t)}
|
|
1134
|
+
?disabled=${r || c}
|
|
1135
|
+
aria-label=${i}
|
|
1132
1136
|
aria-pressed=${l}
|
|
1133
|
-
aria-disabled=${String(
|
|
1137
|
+
aria-disabled=${String(r || c)}
|
|
1134
1138
|
tabindex="-1"
|
|
1135
|
-
data-year=${
|
|
1136
|
-
@keydown=${(
|
|
1139
|
+
data-year=${i || m}
|
|
1140
|
+
@keydown=${(v) => this._handleKeyboardEvent(v)}
|
|
1137
1141
|
>
|
|
1138
|
-
${
|
|
1142
|
+
${i}
|
|
1139
1143
|
</button>
|
|
1140
1144
|
</td>`;
|
|
1141
1145
|
})}
|
|
@@ -1149,7 +1153,7 @@ let Ct = (() => {
|
|
|
1149
1153
|
}
|
|
1150
1154
|
_getView() {
|
|
1151
1155
|
if (Re || this.hydrationRequired)
|
|
1152
|
-
return
|
|
1156
|
+
return b`${m}`;
|
|
1153
1157
|
switch (this._calendarView) {
|
|
1154
1158
|
case "year":
|
|
1155
1159
|
return this._renderYearView();
|
|
@@ -1162,49 +1166,49 @@ let Ct = (() => {
|
|
|
1162
1166
|
}
|
|
1163
1167
|
_tableAnimationEnd(e) {
|
|
1164
1168
|
const t = e.target;
|
|
1165
|
-
e.animationName === "hide" ? (t.classList.remove("sbb-calendar__table-hide"), this._resetFocus = !0, this._calendarView = this._nextCalendarView) : e.animationName === "show" && this.removeAttribute("data-transition");
|
|
1169
|
+
e.animationName === "hide" ? (t.classList.remove("sbb-calendar__table-hide"), this._containingFocus && (this._resetFocus = !0), this._calendarView = this._nextCalendarView) : e.animationName === "show" && this.removeAttribute("data-transition");
|
|
1166
1170
|
}
|
|
1167
1171
|
_startTableTransition() {
|
|
1168
1172
|
this.toggleAttribute("data-transition", !0), this.shadowRoot?.querySelectorAll("table")?.forEach((e) => e.classList.toggle("sbb-calendar__table-hide"));
|
|
1169
1173
|
}
|
|
1170
1174
|
render() {
|
|
1171
|
-
return
|
|
1175
|
+
return b`<div class="sbb-calendar__wrapper">${this._getView()}</div>`;
|
|
1172
1176
|
}
|
|
1173
|
-
}, N = new WeakMap(), C = new WeakMap(), I = new WeakMap(), R = new WeakMap(), S = new WeakMap(), T = new WeakMap(), E = new WeakMap(), P = new WeakMap(), L = new WeakMap(), B = new WeakMap(), H = new WeakMap(),
|
|
1174
|
-
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
1175
|
-
$ = [Z(), Y({ type: Boolean })], M = [Y()], se = [Te(), Y()], ne = [Te(), Y()], de = [Z(),
|
|
1177
|
+
}, N = new WeakMap(), C = new WeakMap(), I = new WeakMap(), R = new WeakMap(), S = new WeakMap(), T = new WeakMap(), E = new WeakMap(), P = new WeakMap(), L = new WeakMap(), B = new WeakMap(), H = new WeakMap(), K = new WeakMap(), h = g, (() => {
|
|
1178
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(p[Symbol.metadata] ?? null) : void 0;
|
|
1179
|
+
$ = [Z(), Y({ type: Boolean })], M = [Y()], se = [Te(), Y()], ne = [Te(), Y()], de = [Z(), Je((t, a) => t._onMultipleChanged(a)), Y({ type: Boolean })], he = [Y()], _e = [G()], ge = [Y({ attribute: "date-filter" })], ve = [Y({ reflect: !0 })], De = [Z(), Y({ attribute: "week-numbers", type: Boolean })], xe = [G()], Me = [G()], Ye = [G()], Oe = [G()], y(g, null, $, { kind: "accessor", name: "wide", static: !1, private: !1, access: { has: (t) => "wide" in t, get: (t) => t.wide, set: (t, a) => {
|
|
1176
1180
|
t.wide = a;
|
|
1177
|
-
} }, metadata: e }, O,
|
|
1181
|
+
} }, metadata: e }, O, k), y(g, null, M, { kind: "accessor", name: "view", static: !1, private: !1, access: { has: (t) => "view" in t, get: (t) => t.view, set: (t, a) => {
|
|
1178
1182
|
t.view = a;
|
|
1179
|
-
} }, metadata: e }, W, ae), y(
|
|
1183
|
+
} }, metadata: e }, W, ae), y(g, null, se, { kind: "accessor", name: "min", static: !1, private: !1, access: { has: (t) => "min" in t, get: (t) => t.min, set: (t, a) => {
|
|
1180
1184
|
t.min = a;
|
|
1181
|
-
} }, metadata: e },
|
|
1185
|
+
} }, metadata: e }, ie, re), y(g, null, ne, { kind: "accessor", name: "max", static: !1, private: !1, access: { has: (t) => "max" in t, get: (t) => t.max, set: (t, a) => {
|
|
1182
1186
|
t.max = a;
|
|
1183
|
-
} }, metadata: e }, le, oe), y(
|
|
1187
|
+
} }, metadata: e }, le, oe), y(g, null, de, { kind: "accessor", name: "multiple", static: !1, private: !1, access: { has: (t) => "multiple" in t, get: (t) => t.multiple, set: (t, a) => {
|
|
1184
1188
|
t.multiple = a;
|
|
1185
|
-
} }, metadata: e }, ce,
|
|
1189
|
+
} }, metadata: e }, ce, be), y(g, null, he, { kind: "setter", name: "selected", static: !1, private: !1, access: { has: (t) => "selected" in t, set: (t, a) => {
|
|
1186
1190
|
t.selected = a;
|
|
1187
|
-
} }, metadata: e }, null,
|
|
1191
|
+
} }, metadata: e }, null, w), y(g, null, _e, { kind: "accessor", name: "_selected", static: !1, private: !1, access: { has: (t) => "_selected" in t, get: (t) => t._selected, set: (t, a) => {
|
|
1188
1192
|
t._selected = a;
|
|
1189
|
-
} }, metadata: e }, ue, fe), y(
|
|
1193
|
+
} }, metadata: e }, ue, fe), y(g, null, ge, { kind: "accessor", name: "dateFilter", static: !1, private: !1, access: { has: (t) => "dateFilter" in t, get: (t) => t.dateFilter, set: (t, a) => {
|
|
1190
1194
|
t.dateFilter = a;
|
|
1191
|
-
} }, metadata: e },
|
|
1195
|
+
} }, metadata: e }, pe, me), y(g, null, ve, { kind: "accessor", name: "orientation", static: !1, private: !1, access: { has: (t) => "orientation" in t, get: (t) => t.orientation, set: (t, a) => {
|
|
1192
1196
|
t.orientation = a;
|
|
1193
|
-
} }, metadata: e },
|
|
1197
|
+
} }, metadata: e }, we, ye), y(g, null, De, { kind: "accessor", name: "weekNumbers", static: !1, private: !1, access: { has: (t) => "weekNumbers" in t, get: (t) => t.weekNumbers, set: (t, a) => {
|
|
1194
1198
|
t.weekNumbers = a;
|
|
1195
|
-
} }, metadata: e },
|
|
1199
|
+
} }, metadata: e }, ke, Ae), y(g, null, xe, { kind: "accessor", name: "_activeDate", static: !1, private: !1, access: { has: (t) => "_activeDate" in t, get: (t) => t._activeDate, set: (t, a) => {
|
|
1196
1200
|
t._activeDate = a;
|
|
1197
|
-
} }, metadata: e }, $e, Ve), y(
|
|
1201
|
+
} }, metadata: e }, $e, Ve), y(g, null, Me, { kind: "setter", name: "_wide", static: !1, private: !1, access: { has: (t) => "_wide" in t, set: (t, a) => {
|
|
1198
1202
|
t._wide = a;
|
|
1199
|
-
} }, metadata: e }, null,
|
|
1203
|
+
} }, metadata: e }, null, w), y(g, null, Ye, { kind: "accessor", name: "_calendarView", static: !1, private: !1, access: { has: (t) => "_calendarView" in t, get: (t) => t._calendarView, set: (t, a) => {
|
|
1200
1204
|
t._calendarView = a;
|
|
1201
|
-
} }, metadata: e }, ze, Fe), y(
|
|
1205
|
+
} }, metadata: e }, ze, Fe), y(g, null, Oe, { kind: "accessor", name: "_initialized", static: !1, private: !1, access: { has: (t) => "_initialized" in t, get: (t) => t._initialized, set: (t, a) => {
|
|
1202
1206
|
t._initialized = a;
|
|
1203
|
-
} }, metadata: e }, We, Ne), y(null, n = { value:
|
|
1204
|
-
})(),
|
|
1207
|
+
} }, metadata: e }, We, Ne), y(null, n = { value: h }, o, { kind: "class", name: h.name, metadata: e }, null, d), h = n.value, e && Object.defineProperty(h, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
1208
|
+
})(), g.styles = pt, g.events = {
|
|
1205
1209
|
dateselected: "dateselected"
|
|
1206
|
-
}, u(
|
|
1210
|
+
}, u(h, d), h;
|
|
1207
1211
|
})();
|
|
1208
1212
|
export {
|
|
1209
|
-
|
|
1213
|
+
Nt as SbbCalendarElement
|
|
1210
1214
|
};
|