@sbb-esta/lyne-elements-dev 5.0.0-next.3-dev.1780381732 → 5.0.0-next.3-dev.1780406485
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/calendar/_calendar.global.scss +25 -26
- package/calendar/calendar/calendar.component.js +1 -1
- package/calendar/calendar-day/calendar-day.component.js +1 -1
- package/calendar/calendar-month/calendar-month.component.js +1 -1
- package/calendar/calendar-year/calendar-year.component.js +1 -1
- package/calendar/common/calendar-cell-base-element.js +1 -1
- package/calendar-cell-base-element-DHCKK3bU.js +23 -0
- package/{calendar-day.component-Caf2w9lS.js → calendar-day.component-DrMWf6-w.js} +2 -2
- package/calendar.component-BM4L9oyb.js +987 -0
- package/calendar.js +3 -3
- package/calendar.pure.js +3 -3
- package/core/i18n/i18n.js +4 -4
- package/core/styles/_theme.scss +1 -0
- package/custom-elements.json +401 -233
- package/datepicker/datepicker/datepicker.component.js +45 -27
- package/development/calendar/calendar/calendar.component.d.ts +27 -42
- package/development/calendar/calendar/calendar.component.d.ts.map +1 -1
- package/development/calendar/calendar/calendar.component.js +1 -1
- package/development/calendar/calendar-day/calendar-day.component.js +1 -1
- package/development/calendar/calendar-month/calendar-month.component.js +2 -2
- package/development/calendar/calendar-year/calendar-year.component.js +2 -2
- package/development/calendar/common/calendar-cell-base-element.js +1 -1
- package/development/calendar-cell-base-element-D9XadTz1.js +38 -0
- package/development/calendar-day.component-Zky9Z-Fq.js +139 -0
- package/development/calendar.component-C_Yc2PNV.js +1367 -0
- package/development/calendar.js +3 -3
- package/development/calendar.pure.js +3 -3
- package/development/core/decorators/id-reference.d.ts.map +1 -1
- package/development/core/decorators/id-reference.js +1 -1
- package/development/core/i18n/i18n.js +5 -5
- package/development/datepicker/datepicker/datepicker.component.d.ts +2 -0
- package/development/datepicker/datepicker/datepicker.component.d.ts.map +1 -1
- package/development/datepicker/datepicker/datepicker.component.js +37 -11
- package/lean-off-brand-theme.css +14 -22
- package/lean-safety-theme.css +14 -22
- package/lean-theme.css +14 -22
- package/off-brand-theme.css +14 -22
- package/package.json +2 -2
- package/safety-theme.css +14 -22
- package/standard-theme.css +14 -22
- package/calendar-cell-base-element-Dq7Ap5n-.js +0 -23
- package/calendar.component-DKKptbyy.js +0 -1082
- package/development/calendar-cell-base-element-D_CTwDn9.js +0 -38
- package/development/calendar-day.component-Bux4ezpg.js +0 -139
- package/development/calendar.component-NvMN01yi.js +0 -1478
|
@@ -3,45 +3,44 @@
|
|
|
3
3
|
$theme: 'standard' !default;
|
|
4
4
|
|
|
5
5
|
@mixin base {
|
|
6
|
-
--sbb-calendar-cell-background-color: transparent;
|
|
7
6
|
--sbb-calendar-cell-background-color-hover: var(--sbb-background-color-3);
|
|
8
7
|
--sbb-calendar-cell-background-color-active: var(--sbb-background-color-4);
|
|
9
8
|
--sbb-calendar-cell-padding: #{sbb.px-to-rem-build(2)};
|
|
10
9
|
--sbb-calendar-cell-border-width: var(--sbb-border-width-2x);
|
|
10
|
+
--sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
|
|
11
11
|
--sbb-calendar-cell-disabled-height: #{sbb.px-to-rem-build(1.5)};
|
|
12
12
|
--sbb-calendar-cell-disabled-width: #{sbb.px-to-rem-build(25.5)};
|
|
13
13
|
--sbb-calendar-cell-disabled-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));
|
|
14
14
|
--sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
|
|
15
|
-
--sbb-calendar-cell-border: var(--sbb-calendar-cell-border-width) solid
|
|
16
|
-
var(--sbb-border-color-1-inverted);
|
|
17
15
|
--sbb-calendar-cell-color: var(--sbb-color-2);
|
|
18
16
|
--sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
|
|
19
|
-
--sbb-calendar-cell-justify-content: normal;
|
|
20
|
-
--sbb-calendar-cell-inset: #{sbb.px-to-rem-build(1)};
|
|
21
17
|
--sbb-calendar-cell-font-size: var(--sbb-text-font-size-s);
|
|
22
|
-
--sbb-calendar-cell-
|
|
23
|
-
--sbb-calendar-cell-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
--sbb-calendar-
|
|
27
|
-
|
|
18
|
+
--sbb-calendar-cell-margin: #{sbb.px-to-rem-build(1)};
|
|
19
|
+
--sbb-calendar-cell-size: #{sbb.px-to-rem-build(44)};
|
|
20
|
+
|
|
21
|
+
// Actual full height is 73, but with margin this comes down to 71
|
|
22
|
+
--sbb-calendar-cell-year-month-width: #{sbb.px-to-rem-build(71)};
|
|
23
|
+
|
|
24
|
+
// Actual full height is 40, but with margin this comes down to 38
|
|
25
|
+
--sbb-calendar-cell-year-month-height: #{sbb.px-to-rem-build(38)};
|
|
26
|
+
--sbb-calendar-control-gap: var(--sbb-spacing-fixed-1x);
|
|
28
27
|
--sbb-calendar-control-view-change-color: var(--sbb-color-3);
|
|
29
|
-
--sbb-calendar-control-view-change-background: var(--sbb-background-color-1);
|
|
30
|
-
--sbb-calendar-control-view-change-padding-inline: var(--sbb-spacing-fixed-5x)
|
|
31
|
-
var(--sbb-spacing-fixed-2x);
|
|
32
28
|
--sbb-calendar-header-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));
|
|
33
|
-
|
|
34
|
-
// While changing views, there would be a few frames where the height of the calendar collapses to just
|
|
35
|
-
// the height of the controls and then grow back to the height of the next view.
|
|
36
|
-
// By using 0.1ms this can be avoided.
|
|
37
|
-
--sbb-calendar-table-animation-duration: 0.1ms;
|
|
38
|
-
--sbb-calendar-table-animation-shift: #{sbb.px-to-rem-build(0.1)};
|
|
39
|
-
--sbb-calendar-table-column-spaces: 12;
|
|
40
29
|
--sbb-calendar-tables-gap: var(--sbb-spacing-fixed-10x);
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
|
|
31
|
+
// Actual full width is 44, but with margin this comes down to 42
|
|
32
|
+
--sbb-calendar-day-size: #{sbb.px-to-rem-build(42)};
|
|
33
|
+
--sbb-calendar-day-width: var(--sbb-calendar-day-size);
|
|
34
|
+
|
|
35
|
+
// Actual full height is 48, but with margin this comes down to 46
|
|
36
|
+
--sbb-calendar-day-height: #{sbb.px-to-rem-build(46)};
|
|
37
|
+
--sbb-calendar-day-justify-content: start;
|
|
38
|
+
--sbb-calendar-day-value-height: var(--sbb-spacing-fixed-6x);
|
|
43
39
|
--sbb-calendar-day-extra-display: block;
|
|
44
|
-
--sbb-calendar-day-extra-height:
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
--sbb-calendar-day-extra-height: #{sbb.px-to-rem-build(18)};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@mixin forced-colors {
|
|
44
|
+
--sbb-calendar-cell-background-color-hover: transparent;
|
|
45
|
+
--sbb-calendar-cell-background-color-active: transparent;
|
|
47
46
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "../../calendar.component-
|
|
1
|
+
import { n as e, r as t, t as n } from "../../calendar.component-BM4L9oyb.js";
|
|
2
2
|
export { n as SbbCalendarElement, e as SbbDateSelectedEvent, t as SbbMonthChangeEvent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../calendar-day.component-
|
|
1
|
+
import { t as e } from "../../calendar-day.component-DrMWf6-w.js";
|
|
2
2
|
export { e as SbbCalendarDayElement };
|
|
@@ -53,7 +53,7 @@ var a = (() => {
|
|
|
53
53
|
super.connectedCallback(), this.tabIndex = -1;
|
|
54
54
|
}
|
|
55
55
|
setSelectedState(e) {
|
|
56
|
-
let t = e.multiple ? e.
|
|
56
|
+
let t = e.multiple ? e.value?.some((e) => this._yearValue === this.dateAdapter.getYear(e) && this._monthValue === this.dateAdapter.getMonth(e)) ?? !1 : !!e.value && this.dateAdapter.getYear(e.value) === this._yearValue && this.dateAdapter.getMonth(e.value) === this._monthValue;
|
|
57
57
|
this.toggleState("selected", t), this.internals.ariaPressed = String(t);
|
|
58
58
|
}
|
|
59
59
|
setDisabledFilteredState(e) {
|
|
@@ -49,7 +49,7 @@ var a = (() => {
|
|
|
49
49
|
super.connectedCallback(), this.tabIndex = -1;
|
|
50
50
|
}
|
|
51
51
|
setSelectedState(e) {
|
|
52
|
-
let t = e.multiple ? e.
|
|
52
|
+
let t = e.multiple ? e.value?.some((e) => Number(this.value) === this.dateAdapter.getYear(e)) ?? !1 : !!e.value && this.dateAdapter.getYear(e.value) === Number(this.value);
|
|
53
53
|
this.toggleState("selected", t), this.internals.ariaPressed = String(t);
|
|
54
54
|
}
|
|
55
55
|
setDisabledFilteredState(e) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../calendar-cell-base-element-
|
|
1
|
+
import { t as e } from "../../calendar-cell-base-element-DHCKK3bU.js";
|
|
2
2
|
export { e as SbbCalendarCellBaseElement };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { unsafeCSS as e } from "lit";
|
|
2
|
+
import { SbbButtonLikeBaseElement as t, SbbDisabledMixin as n, SbbPropertyWatcherController as r, defaultDateAdapter as i, readConfig as a } from "./core.js";
|
|
3
|
+
//#region src/elements/calendar/common/calendar-cell-base-element.scss?inline
|
|
4
|
+
var o = ":host{--sbb-focus-outline-offset: .125rem;--sbb-calendar-cell-transition-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );display:block;font-size:var(--sbb-calendar-cell-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);cursor:var(--sbb-calendar-cell-cursor);color:var(--sbb-calendar-cell-color);border-radius:calc(var(--sbb-border-radius-4x) + var(--sbb-calendar-cell-border-width));margin:var(--sbb-calendar-cell-margin);padding:var(--sbb-calendar-cell-border-width);background-clip:content-box;transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);transition-property:background-color}:host(:is(sbb-calendar-weekday,sbb-calendar-weeknumber)){--sbb-calendar-cell-font-size: var(--sbb-text-font-size-xs);--sbb-calendar-day-height: var(--sbb-calendar-day-size);color:var(--sbb-calendar-header-color)}:host(:is(sbb-calendar-day,sbb-calendar-weekday,sbb-calendar-weeknumber)){height:var(--sbb-calendar-day-height);width:var(--sbb-calendar-day-width)}:host(:is(:state(current),[state--current])){font-weight:700}:host(:is(:state(selected),[state--selected])){border:var(--sbb-calendar-cell-border-width) solid var(--sbb-calendar-cell-border-color-selected);padding:0}:host(:disabled){--sbb-calendar-cell-color: var(--sbb-calendar-cell-disabled-color);--sbb-calendar-cell-cursor: unset}:host(: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)}@media(any-hover:hover){:host(:not(:disabled,:where(:is(:state(active),[state--active]),:active)):hover){background-color:var(--sbb-calendar-cell-background-color-hover)}}@media(any-hover:hover)and (forced-colors:active){:host(:not(:disabled):hover){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}}:host(:not(:disabled):where(:is(:state(active),[state--active]),:active)){background-color:var(--sbb-calendar-cell-background-color-active)}.sbb-action-base{display:flex;flex-direction:column;justify-content:center;height:100%;width:100%}.sbb-calendar-year,.sbb-calendar-month{height:var(--sbb-calendar-cell-year-month-height);width:var(--sbb-calendar-cell-year-month-width)}:host(:is(:state(crossed-out),[state--crossed-out])) :is(.sbb-calendar-year,.sbb-calendar-month,.sbb-calendar-day__value):after{position:absolute;top:50%;left:50%;translate:-50% -50%;content:\"\";height:var(--sbb-calendar-cell-disabled-height);width:var(--sbb-calendar-cell-disabled-width);background-color:var(--sbb-calendar-cell-disabled-color);rotate:-45deg}", s = class extends n(t) {
|
|
5
|
+
static {
|
|
6
|
+
this.styles = [e(o)];
|
|
7
|
+
}
|
|
8
|
+
constructor() {
|
|
9
|
+
super(), this.dateAdapter = a().datetime?.dateAdapter ?? i, this.addController(new r(this, () => this.getParent(), {
|
|
10
|
+
dateFilter: (e) => this.setDisabledFilteredState(e),
|
|
11
|
+
min: (e) => this.setDisabledFilteredState(e),
|
|
12
|
+
max: (e) => this.setDisabledFilteredState(e),
|
|
13
|
+
value: (e) => this.setSelectedState(e)
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
getParent() {
|
|
17
|
+
return this.getRootNode?.()?.host?.closest("sbb-calendar");
|
|
18
|
+
}
|
|
19
|
+
formResetCallback() {}
|
|
20
|
+
formStateRestoreCallback(e, t) {}
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { s as t };
|
|
@@ -3,7 +3,7 @@ import { html as n, unsafeCSS as r } from "lit";
|
|
|
3
3
|
import { property as i, state as a } from "lit/decorators.js";
|
|
4
4
|
import { SbbCalendarCellBaseElement as o } from "./calendar/common/calendar-cell-base-element.js";
|
|
5
5
|
//#region src/elements/calendar/calendar-day/calendar-day.scss?inline
|
|
6
|
-
var s = "
|
|
6
|
+
var s = ".sbb-calendar-day{justify-content:var(--sbb-calendar-day-justify-content)}.sbb-calendar-day__value{display:flex;height:var(--sbb-calendar-day-value-height);align-items:center;justify-content:center;position:relative}.sbb-calendar-day__extra{display:var(--sbb-calendar-day-extra-display);height:var(--sbb-calendar-day-extra-height)}::slotted(*){height:var(--sbb-calendar-day-extra-height)}", c = (() => {
|
|
7
7
|
let c = o, l = [], u, d;
|
|
8
8
|
return class extends c {
|
|
9
9
|
constructor() {
|
|
@@ -74,7 +74,7 @@ var s = ":host{--sbb-calendar-day-value-height: var(--sbb-spacing-fixed-6x)}.sbb
|
|
|
74
74
|
return this.closest?.("sbb-calendar") ?? this.getRootNode?.()?.host?.closest("sbb-calendar");
|
|
75
75
|
}
|
|
76
76
|
setSelectedState(e) {
|
|
77
|
-
let t = e.multiple ? e.
|
|
77
|
+
let t = e.multiple ? e.value.some((e) => this.dateAdapter.sameDate(this.value, e)) : !!e.value && this.dateAdapter.compareDate(this.value, e.value) === 0;
|
|
78
78
|
this.toggleState("selected", t), this.internals.ariaPressed = String(t);
|
|
79
79
|
}
|
|
80
80
|
setDisabledFilteredState(e) {
|