@sbb-esta/lyne-elements 0.52.0 → 0.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion.js +54 -54
- package/action-group.js +3 -3
- package/alert/alert-group.js +22 -22
- package/alert/alert.js +22 -22
- package/autocomplete.js +126 -126
- package/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/breadcrumb/breadcrumb-group.js +70 -69
- package/breadcrumb/breadcrumb.js +17 -17
- package/calendar.js +423 -423
- package/card/card-badge.js +17 -17
- package/card/card.js +2 -2
- package/card/common.js +30 -30
- package/checkbox/checkbox-group.js +17 -17
- package/checkbox/checkbox.js +34 -34
- package/clock.js +83 -83
- package/container/sticky-bar.js +16 -16
- package/core/a11y.js +91 -91
- package/core/base-elements.js +87 -88
- package/core/controllers.js +40 -40
- package/core/datetime.js +34 -36
- package/core/dom.js +26 -26
- package/core/eventing.js +33 -33
- package/core/mixins.js +122 -122
- package/core/overlay/overlay.d.ts.map +1 -1
- package/core/overlay.js +55 -50
- package/core/testing/event-spy.d.ts +1 -1
- package/core/testing/wait-for-image-ready.d.ts +4 -0
- package/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/core/testing.d.ts +1 -0
- package/core/testing.d.ts.map +1 -1
- package/core/testing.js +42 -31
- package/custom-elements.json +70 -4
- package/datepicker/common.js +55 -55
- package/datepicker/datepicker-toggle.js +94 -94
- package/datepicker/datepicker.js +144 -144
- package/development/accordion.js +2 -3
- package/development/action-group.js +2 -3
- package/development/alert/alert-group.js +2 -3
- package/development/alert/alert.js +2 -3
- package/development/autocomplete.js +2 -3
- package/development/breadcrumb/breadcrumb-group/breadcrumb-group.d.ts.map +1 -1
- package/development/breadcrumb/breadcrumb-group.js +5 -5
- package/development/breadcrumb/breadcrumb.js +2 -3
- package/development/button/button-link.js +2 -3
- package/development/button/button-static.js +2 -3
- package/development/button/button.js +2 -3
- package/development/button/common.js +2 -3
- package/development/button/mini-button.js +2 -3
- package/development/button/secondary-button-link.js +2 -3
- package/development/button/secondary-button-static.js +2 -3
- package/development/button/secondary-button.js +2 -3
- package/development/button/tertiary-button-link.js +2 -3
- package/development/button/tertiary-button-static.js +2 -3
- package/development/button/tertiary-button.js +2 -3
- package/development/button/transparent-button-link.js +2 -3
- package/development/button/transparent-button-static.js +2 -3
- package/development/button/transparent-button.js +2 -3
- package/development/calendar.js +2 -3
- package/development/card/card-badge.js +2 -3
- package/development/card/card-button.js +2 -3
- package/development/card/card-link.js +2 -3
- package/development/card/card.js +2 -3
- package/development/card/common.js +2 -3
- package/development/checkbox/checkbox-group.js +2 -3
- package/development/checkbox/checkbox.js +2 -3
- package/development/chip.js +2 -3
- package/development/clock.js +2 -3
- package/development/container/container.js +2 -3
- package/development/container/sticky-bar.js +2 -3
- package/development/core/base-elements.js +4 -7
- package/development/core/mixins.js +7 -13
- package/development/core/overlay/overlay.d.ts.map +1 -1
- package/development/core/overlay.js +9 -3
- package/development/core/testing/event-spy.d.ts +1 -1
- package/development/core/testing/wait-for-image-ready.d.ts +4 -0
- package/development/core/testing/wait-for-image-ready.d.ts.map +1 -0
- package/development/core/testing.d.ts +1 -0
- package/development/core/testing.d.ts.map +1 -1
- package/development/core/testing.js +17 -1
- package/development/datepicker/common.js +2 -3
- package/development/datepicker/datepicker-next-day.js +2 -3
- package/development/datepicker/datepicker-previous-day.js +2 -3
- package/development/datepicker/datepicker-toggle.js +2 -3
- package/development/datepicker/datepicker.js +2 -3
- package/development/dialog/dialog-actions.js +2 -3
- package/development/dialog/dialog-content.js +2 -3
- package/development/dialog/dialog-title.js +2 -3
- package/development/dialog/dialog.js +2 -3
- package/development/divider.js +2 -3
- package/development/expansion-panel/expansion-panel-content.js +2 -3
- package/development/expansion-panel/expansion-panel-header.js +2 -3
- package/development/expansion-panel/expansion-panel.js +2 -3
- package/development/file-selector.js +2 -3
- package/development/footer.js +2 -3
- package/development/form-error.js +2 -3
- package/development/form-field/form-field-clear.js +2 -3
- package/development/form-field/form-field.js +2 -3
- package/development/header/common.js +2 -3
- package/development/header/header-button.js +2 -3
- package/development/header/header-link.js +2 -3
- package/development/header/header.js +2 -3
- package/development/icon.js +4 -7
- package/development/image/image.d.ts +12 -3
- package/development/image/image.d.ts.map +1 -1
- package/development/image.js +41 -24
- package/development/journey-header.js +2 -3
- package/development/lead-container.js +2 -3
- package/development/link/block-link-button.js +2 -3
- package/development/link/block-link-static.js +2 -3
- package/development/link/block-link.js +2 -3
- package/development/link/common.js +3 -5
- package/development/link/link-button.js +2 -3
- package/development/link/link-static.js +2 -3
- package/development/link/link.js +2 -3
- package/development/link-list.js +2 -3
- package/development/loading-indicator.js +2 -3
- package/development/logo.js +2 -3
- package/development/map-container.js +2 -3
- package/development/menu/common.js +2 -3
- package/development/menu/menu-button.js +2 -3
- package/development/menu/menu-link.js +2 -3
- package/development/menu/menu.js +2 -3
- package/development/message.js +2 -3
- package/development/navigation/common.js +2 -3
- package/development/navigation/navigation-button.js +2 -3
- package/development/navigation/navigation-link.js +2 -3
- package/development/navigation/navigation-list.js +2 -3
- package/development/navigation/navigation-marker.js +2 -3
- package/development/navigation/navigation-section.js +2 -3
- package/development/navigation/navigation.js +2 -3
- package/development/notification.js +2 -3
- package/development/option/optgroup.js +2 -3
- package/development/option/option.js +2 -3
- package/development/overlay.js +3 -5
- package/development/popover/popover-trigger.js +2 -3
- package/development/popover/popover.js +2 -3
- package/development/radio-button/radio-button-group.js +2 -3
- package/development/radio-button/radio-button.js +2 -3
- package/development/screen-reader-only.js +2 -3
- package/development/select.js +2 -3
- package/development/selection-panel.js +2 -3
- package/development/signet.js +2 -3
- package/development/skiplink-list.js +2 -3
- package/development/slider.js +2 -3
- package/development/status.js +2 -3
- package/development/stepper/step-label.js +2 -3
- package/development/stepper/step.js +2 -3
- package/development/stepper/stepper/stepper.d.ts +1 -1
- package/development/stepper/stepper/stepper.d.ts.map +1 -1
- package/development/stepper/stepper.js +5 -6
- package/development/tabs/tab-group.js +2 -3
- package/development/tabs/tab-title.js +2 -3
- package/development/tag/tag-group.js +2 -3
- package/development/tag/tag.js +2 -3
- package/development/teaser-hero.js +2 -3
- package/development/teaser-paid.js +2 -3
- package/development/teaser.js +2 -3
- package/development/time-input.js +2 -3
- package/development/timetable-occupancy-icon.js +2 -3
- package/development/timetable-occupancy.js +2 -3
- package/development/title.js +3 -5
- package/development/toast.js +2 -3
- package/development/toggle/toggle-option.js +3 -5
- package/development/toggle/toggle.js +2 -3
- package/development/toggle-check.js +10 -3
- package/development/train/train-blocked-passage.js +2 -3
- package/development/train/train-formation.js +2 -3
- package/development/train/train-wagon.js +2 -3
- package/development/train/train.js +2 -3
- package/development/visual-checkbox.js +2 -3
- package/dialog/dialog-title.js +20 -20
- package/dialog/dialog.js +66 -66
- package/expansion-panel/expansion-panel-header.js +20 -20
- package/expansion-panel/expansion-panel.js +60 -60
- package/file-selector.js +91 -91
- package/form-field/form-field-clear.js +12 -12
- package/form-field/form-field.js +111 -111
- package/header/header.js +53 -53
- package/icon.js +107 -107
- package/image/image.d.ts +12 -3
- package/image/image.d.ts.map +1 -1
- package/image.js +118 -105
- package/journey-header.js +29 -29
- package/map-container.js +23 -23
- package/menu/menu.js +91 -91
- package/navigation/common.js +16 -16
- package/navigation/navigation-marker.js +34 -34
- package/navigation/navigation-section.js +83 -83
- package/navigation/navigation.js +87 -87
- package/notification.js +52 -52
- package/option/optgroup.js +45 -45
- package/option/option.js +108 -108
- package/overlay.js +5 -5
- package/package.json +1 -1
- package/popover/popover.js +110 -110
- package/radio-button/radio-button-group.js +93 -93
- package/radio-button/radio-button.js +84 -84
- package/select.js +178 -178
- package/selection-panel.js +44 -44
- package/slider.js +58 -58
- package/status.js +6 -6
- package/stepper/step-label.js +19 -19
- package/stepper/step.js +31 -31
- package/stepper/stepper/stepper.d.ts +1 -1
- package/stepper/stepper/stepper.d.ts.map +1 -1
- package/stepper/stepper.js +48 -48
- package/tabs/tab-group.js +67 -67
- package/tag/tag-group.js +8 -8
- package/tag/tag.js +27 -27
- package/teaser-paid.js +12 -12
- package/time-input.js +73 -73
- package/timetable-occupancy-icon.js +26 -26
- package/timetable-occupancy.js +9 -9
- package/toast.js +38 -38
- package/toggle/toggle-option.js +33 -33
- package/toggle/toggle.js +46 -46
- package/toggle-check.js +14 -14
- package/train/train-formation.js +36 -37
- package/train/train-wagon.js +30 -30
- package/train/train.js +13 -13
package/clock.js
CHANGED
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
import { css as u, LitElement as
|
|
2
|
-
import { property as
|
|
3
|
-
import { ref as
|
|
4
|
-
const
|
|
5
|
-
`,
|
|
6
|
-
`,
|
|
7
|
-
`,
|
|
1
|
+
import { css as u, LitElement as _, html as M } from "lit";
|
|
2
|
+
import { property as p, customElement as v } from "lit/decorators.js";
|
|
3
|
+
import { ref as c } from "lit/directives/ref.js";
|
|
4
|
+
const f = `<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><g class="face"><circle fill="#FFF" cx="52.5" cy="52.5" r="52.5"/><path d="M50.75 4h3.5v12h-3.5zM50.75 89h3.5v12h-3.5zM75.233 9.623l3.03 1.75-6 10.392-3.03-1.75zM32.734 83.233l3.03 1.75-6 10.392-3.03-1.75zM93.628 26.732l1.75 3.031-10.392 6-1.75-3.03zM20.017 69.234l1.75 3.031-10.392 6-1.75-3.03zM101 50.75v3.5H89v-3.5zM16 50.75v3.5H4v-3.5zM95.379 75.232l-1.75 3.031-10.392-6 1.75-3.03zM21.766 32.734l-1.75 3.031-10.392-6 1.75-3.03zM78.267 93.63l-3.03 1.75-6-10.393 3.03-1.75zM35.766 20.015l-3.03 1.75-6-10.392 3.03-1.75z"/><g><path d="M56.873 4.19l1.392.147-.366 3.48-1.392-.145zM47.101 97.177l1.393.146-.366 3.481-1.392-.146zM61.896 4.914l1.37.29-.728 3.424-1.37-.29zM42.458 96.366l1.37.29-.728 3.424-1.37-.291zM66.825 6.157l1.332.432-1.082 3.33-1.331-.434zM37.931 95.085l1.332.432-1.082 3.33-1.331-.433zM71.584 7.906l1.28.569-1.424 3.197-1.28-.57zM33.56 93.32l1.278.569-1.423 3.197-1.28-.57zM80.44 12.852l1.133.823-2.058 2.831-1.132-.823zM25.481 88.494l1.133.822-2.057 2.832-1.133-.823zM84.43 15.986l1.04.937-2.342 2.6-1.04-.936zM21.87 85.469l1.04.936-2.341 2.601-1.04-.937zM88.072 19.522l.937 1.04-2.6 2.343-.937-1.04zM18.593 82.088l.937 1.04-2.601 2.342-.937-1.04zM91.328 23.425l.823 1.133-2.832 2.057-.823-1.132zM15.684 78.385l.823 1.132-2.832 2.058-.822-1.133zM96.52 32.128l.57 1.279-3.198 1.423-.57-1.278zM11.109 70.161l.569 1.279-3.197 1.423-.57-1.279zM98.407 36.85l.433 1.332-3.33 1.081-.432-1.331zM9.483 65.74l.432 1.33-3.329 1.082-.432-1.331zM99.795 41.726l.291 1.37-3.423.727-.29-1.37zM8.34 61.17l.292 1.37-3.424.728-.29-1.37zM100.66 46.73l.146 1.393-3.48.366-.147-1.392zM7.674 56.506l.146 1.392-3.48.366-.147-1.392zM100.811 56.873l-.146 1.392-3.48-.365.145-1.393zM7.821 47.101l-.146 1.392-3.48-.365.145-1.393zM100.09 61.895l-.291 1.369-3.424-.728.291-1.369zM8.631 42.46l-.291 1.37-3.423-.728.29-1.37zM98.84 66.827l-.432 1.331-3.329-1.081.433-1.332zM9.918 37.93l-.433 1.331-3.329-1.082.433-1.331zM97.098 71.585l-.569 1.28-3.197-1.424.57-1.28zM11.677 33.558l-.57 1.28-3.197-1.424.57-1.279zM92.149 80.439l-.823 1.133-2.832-2.058.823-1.132zM16.506 25.482l-.823 1.133-2.831-2.057.823-1.133zM89.017 84.431l-.937 1.04-2.6-2.341.936-1.04zM19.528 21.869l-.936 1.04-2.601-2.342.936-1.04zM85.48 88.076l-1.041.936-2.342-2.6 1.04-.937zM22.91 18.59l-1.04.937-2.341-2.601 1.04-.937zM81.574 91.328l-1.133.823-2.057-2.831 1.132-.823zM26.617 15.684l-1.133.823-2.057-2.832 1.132-.823zM72.873 96.524l-1.279.57-1.423-3.198 1.278-.57zM34.838 11.105l-1.279.57-1.423-3.198 1.279-.57zM68.151 98.405l-1.331.432-1.082-3.329 1.332-.432zM39.259 9.485l-1.332.433-1.081-3.33 1.331-.432zM63.272 99.799l-1.369.29-.728-3.422 1.37-.291zM43.83 8.337l-1.369.291-.727-3.423 1.37-.291zM58.27 100.662l-1.393.146-.366-3.48 1.393-.147zM48.494 7.672l-1.392.147-.366-3.481 1.392-.147z"/></g></g></svg>
|
|
5
|
+
`, k = `<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path id="mod_clock_svg_hours" d="M55.7 64.5h-6.4l.6-44h5.2z"/></svg>
|
|
6
|
+
`, z = `<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path d="M55.1,64.5h-5.2l0.8-58h3.6L55.1,64.5z"/></svg>
|
|
7
|
+
`, g = `<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path d="M57.8,21.3c0-2.9-2.4-5.2-5.2-5.2s-5.3,2.3-5.3,5.2c0,2.7,2,4.8,4.5,5.2V69h1.5V26.5C55.8,26.2,57.8,24,57.8,21.3z"/></svg>
|
|
8
8
|
`, y = u`*,:before,:after{box-sizing:border-box}:host{--sbb-clock-hours-animation-start-angle: 0deg;--sbb-clock-seconds-animation-start-angle: 0deg;--sbb-clock-hours-animation-duration: 0s;--sbb-clock-seconds-animation-duration: 0s;--sbb-clock-animation-play-state: paused;--sbb-clock-seconds-hand-color: var(--sbb-color-red);display:block}.sbb-clock{position:relative;width:100%;height:100%;aspect-ratio:1/1;overflow:hidden;contain:content}.sbb-clock__face,.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__hand-seconds{position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:center center;transform:rotate(0);transform-style:preserve-3d;backface-visibility:hidden}.sbb-clock__hand-minutes{transition:transform .2s cubic-bezier(.4,2.08,.55,.44)}@supports not (aspect-ratio: 1/1){.sbb-clock__hand-minutes{transform-origin:50% 49.625%}}.sbb-clock__hand-hours{animation-name:rotate;animation-duration:43200s;animation-iteration-count:infinite;animation-timing-function:linear;animation-play-state:var(--sbb-clock-animation-play-state)}.sbb-clock__hand-hours--initial-hour{animation-name:hand-hours-animation-initial-hour;animation-duration:var(--sbb-clock-hours-animation-duration);animation-play-state:var(--sbb-clock-animation-play-state);animation-iteration-count:1}.sbb-clock__hand-minutes--no-transition{transition:none}.sbb-clock__hand-seconds{animation-name:hand-seconds-animation;animation-duration:60s;animation-timing-function:linear;animation-play-state:var(--sbb-clock-animation-play-state);animation-iteration-count:infinite;fill:var(--sbb-clock-seconds-hand-color)}.sbb-clock__hand-seconds--initial-minute{animation-name:hand-seconds-animation-initial-minute;animation-duration:var(--sbb-clock-seconds-animation-duration);animation-play-state:var(--sbb-clock-animation-play-state);animation-iteration-count:1}:host(:not([data-initialized])) :is(.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__hand-seconds){display:none}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes hand-hours-animation-initial-hour{0%{transform:rotate(var(--sbb-clock-hours-animation-start-angle))}to{transform:rotate(360deg)}}@keyframes hand-seconds-animation{0%{transform:rotate(0)}97.5%,to{transform:rotate(360deg)}}@keyframes hand-seconds-animation-initial-minute{0%{transform:rotate(var(--sbb-clock-seconds-animation-start-angle))}97.5%,to{transform:rotate(360deg)}}`;
|
|
9
|
-
var
|
|
10
|
-
for (var
|
|
11
|
-
(
|
|
12
|
-
return
|
|
9
|
+
var w = Object.defineProperty, L = Object.getOwnPropertyDescriptor, m = (t, s, a, n) => {
|
|
10
|
+
for (var i = n > 1 ? void 0 : n ? L(s, a) : s, o = t.length - 1, e; o >= 0; o--)
|
|
11
|
+
(e = t[o]) && (i = (n ? e(s, a, i) : e(i)) || i);
|
|
12
|
+
return n && i && w(s, a, i), i;
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const E = 12, O = 60, r = 60, S = 50, h = 360, d = 30, N = 6, T = 360 / 58.5, A = 60, C = 3600, b = {
|
|
15
15
|
once: !0,
|
|
16
16
|
passive: !0
|
|
17
17
|
};
|
|
18
|
-
let
|
|
18
|
+
let l = class extends _ {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), this.now = null, this.
|
|
20
|
+
super(...arguments), this.now = null, this.h = () => this.r(), this.f = () => this.s();
|
|
21
21
|
}
|
|
22
22
|
willUpdate(t) {
|
|
23
|
-
super.willUpdate(t), t.has("now") && (this.now ? (this.
|
|
23
|
+
super.willUpdate(t), t.has("now") && (this.now ? (this.j(), this.k(), this.l()) : this.m());
|
|
24
24
|
}
|
|
25
|
-
async
|
|
26
|
-
document.visibilityState === "hidden" ? await this.
|
|
25
|
+
async n() {
|
|
26
|
+
document.visibilityState === "hidden" ? await this.l() : this.now || await this.m();
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
document.addEventListener("visibilitychange", () => this.
|
|
28
|
+
t() {
|
|
29
|
+
document.addEventListener("visibilitychange", () => this.n(), !1);
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
u() {
|
|
32
32
|
var t, s;
|
|
33
33
|
document.removeEventListener(
|
|
34
34
|
"visibilitychange",
|
|
35
|
-
() => this.
|
|
35
|
+
() => this.n(),
|
|
36
36
|
!1
|
|
37
|
-
), (t = this.
|
|
37
|
+
), (t = this.a) == null || t.removeEventListener("animationend", this.h), (s = this.b) == null || s.removeEventListener("animationend", this.f), clearInterval(this.i);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
k() {
|
|
40
40
|
var t;
|
|
41
|
-
(t = this.
|
|
41
|
+
(t = this.a) == null || t.classList.remove("sbb-clock__hand-hours--initial-hour"), this.style.removeProperty("--sbb-clock-hours-animation-start-angle"), this.style.removeProperty("--sbb-clock-hours-animation-duration");
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
j() {
|
|
44
44
|
var t, s;
|
|
45
|
-
(t = this.
|
|
45
|
+
(t = this.b) == null || t.classList.remove("sbb-clock__hand-seconds--initial-minute"), (s = this.d) == null || s.classList.remove("sbb-clock__hand-minutes--no-transition"), this.style.removeProperty("--sbb-clock-seconds-animation-start-angle"), this.style.removeProperty("--sbb-clock-seconds-animation-duration");
|
|
46
46
|
}
|
|
47
47
|
/** Given the current date, calculates the hh/mm/ss values and the hh/mm/ss left to the next midnight. */
|
|
48
|
-
|
|
49
|
-
const t = this.now ? null : /* @__PURE__ */ new Date(), [s,
|
|
50
|
-
this.
|
|
48
|
+
v() {
|
|
49
|
+
const t = this.now ? null : /* @__PURE__ */ new Date(), [s, a, n] = t ? [t.getHours(), t.getMinutes(), t.getSeconds()] : this.now.split(":").map((i) => +i);
|
|
50
|
+
this.e = s % 12, this.c = a, this.g = n;
|
|
51
51
|
}
|
|
52
52
|
/** Set the starting position for the three hands on the clock face. */
|
|
53
|
-
|
|
54
|
-
var
|
|
55
|
-
this.
|
|
56
|
-
const t = r - this.
|
|
57
|
-
let
|
|
58
|
-
t > 0 && (
|
|
53
|
+
o() {
|
|
54
|
+
var o, e;
|
|
55
|
+
this.v();
|
|
56
|
+
const t = r - this.g, s = O - this.c, a = E - this.e;
|
|
57
|
+
let n = 0, i = 0;
|
|
58
|
+
t > 0 && (n += t, i = 1), s > 0 && (n += (s - i) * A, i = 1), a > 0 && (n += (a - i) * C), this.style.setProperty(
|
|
59
59
|
"--sbb-clock-hours-animation-start-angle",
|
|
60
|
-
`${Math.ceil(this.
|
|
61
|
-
), this.style.setProperty("--sbb-clock-hours-animation-duration", `${
|
|
60
|
+
`${Math.ceil(this.e * d + this.c / 2)}deg`
|
|
61
|
+
), this.style.setProperty("--sbb-clock-hours-animation-duration", `${n}s`), this.style.setProperty(
|
|
62
62
|
"--sbb-clock-seconds-animation-start-angle",
|
|
63
|
-
`${Math.ceil(this.
|
|
64
|
-
), this.style.setProperty("--sbb-clock-seconds-animation-duration", `${t}s`), this.
|
|
63
|
+
`${Math.ceil(this.g * T)}deg`
|
|
64
|
+
), this.style.setProperty("--sbb-clock-seconds-animation-duration", `${t}s`), this.p(), (o = this.b) == null || o.classList.add("sbb-clock__hand-seconds--initial-minute"), (e = this.a) == null || e.classList.add("sbb-clock__hand-hours--initial-hour"), this.style.setProperty("--sbb-clock-animation-play-state", "running"), this.toggleAttribute("data-initialized", !0);
|
|
65
65
|
}
|
|
66
66
|
/** Set the starting position for the minutes hand. */
|
|
67
|
-
|
|
67
|
+
p() {
|
|
68
68
|
var t;
|
|
69
|
-
(t = this.
|
|
69
|
+
(t = this.d) == null || t.style.setProperty(
|
|
70
70
|
"transform",
|
|
71
|
-
`rotateZ(${Math.ceil(this.
|
|
71
|
+
`rotateZ(${Math.ceil(this.c * N)}deg)`
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
/** Move the hours hand to the next value. */
|
|
75
|
-
|
|
75
|
+
r() {
|
|
76
76
|
var s;
|
|
77
|
-
this.
|
|
78
|
-
let t = Math.ceil(this.
|
|
79
|
-
t >=
|
|
77
|
+
this.k();
|
|
78
|
+
let t = Math.ceil(this.e * d + this.c / 2);
|
|
79
|
+
t >= h && (t -= h), (s = this.a) == null || s.style.setProperty("transform", `rotateZ(${t}deg)`);
|
|
80
80
|
}
|
|
81
81
|
/** Move the minutes hand to the next value. */
|
|
82
|
-
|
|
82
|
+
s() {
|
|
83
83
|
var t;
|
|
84
|
-
(t = this.
|
|
85
|
-
() => this.
|
|
84
|
+
(t = this.b) == null || t.removeEventListener("animationend", this.f), this.j(), this.q(), this.i = setInterval(
|
|
85
|
+
() => this.q(),
|
|
86
86
|
r * 1e3
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
this.
|
|
89
|
+
q() {
|
|
90
|
+
this.c++, this.p();
|
|
91
91
|
}
|
|
92
92
|
/** Stops the clock by removing all the animations. */
|
|
93
|
-
async
|
|
94
|
-
var t, s,
|
|
95
|
-
clearInterval(this.
|
|
93
|
+
async l() {
|
|
94
|
+
var t, s, a, n, i;
|
|
95
|
+
clearInterval(this.i), this.now ? (this.o(), await new Promise((o) => setTimeout(o)), (t = this.b) == null || t.classList.add("sbb-clock__hand-seconds--initial-minute"), (s = this.a) == null || s.classList.add("sbb-clock__hand-hours--initial-hour")) : (this.j(), this.k()), (a = this.a) == null || a.removeEventListener("animationend", this.h), (n = this.b) == null || n.removeEventListener("animationend", this.f), (i = this.d) == null || i.classList.add("sbb-clock__hand-minutes--no-transition"), this.style.setProperty("--sbb-clock-animation-play-state", "paused");
|
|
96
96
|
}
|
|
97
97
|
/** Starts the clock by defining the hands starting position then starting the animations. */
|
|
98
|
-
async
|
|
98
|
+
async m() {
|
|
99
99
|
var t, s;
|
|
100
|
-
(t = this.
|
|
100
|
+
(t = this.a) == null || t.addEventListener(
|
|
101
101
|
"animationend",
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
-
), (s = this.
|
|
102
|
+
this.h,
|
|
103
|
+
b
|
|
104
|
+
), (s = this.b) == null || s.addEventListener(
|
|
105
105
|
"animationend",
|
|
106
|
-
this.
|
|
107
|
-
|
|
106
|
+
this.f,
|
|
107
|
+
b
|
|
108
108
|
), await new Promise(
|
|
109
|
-
() => setTimeout(() => this.
|
|
109
|
+
() => setTimeout(() => this.o(), S)
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
112
|
async firstUpdated(t) {
|
|
113
|
-
super.firstUpdated(t), this.
|
|
113
|
+
super.firstUpdated(t), this.t(), this.now ? await this.l() : await this.m();
|
|
114
114
|
}
|
|
115
115
|
disconnectedCallback() {
|
|
116
|
-
super.disconnectedCallback(), this.
|
|
116
|
+
super.disconnectedCallback(), this.u();
|
|
117
117
|
}
|
|
118
118
|
render() {
|
|
119
|
-
return
|
|
119
|
+
return M`
|
|
120
120
|
<div class="sbb-clock">
|
|
121
|
-
<span class="sbb-clock__face" .innerHTML=${
|
|
121
|
+
<span class="sbb-clock__face" .innerHTML=${f}></span>
|
|
122
122
|
<span
|
|
123
123
|
class="sbb-clock__hand-hours"
|
|
124
|
-
.innerHTML=${
|
|
125
|
-
${
|
|
126
|
-
this.
|
|
124
|
+
.innerHTML=${k}
|
|
125
|
+
${c((t) => {
|
|
126
|
+
this.a = t;
|
|
127
127
|
})}
|
|
128
128
|
></span>
|
|
129
129
|
<span
|
|
130
130
|
class="sbb-clock__hand-minutes sbb-clock__hand-minutes--no-transition"
|
|
131
|
-
.innerHTML=${
|
|
132
|
-
${
|
|
133
|
-
this.
|
|
131
|
+
.innerHTML=${z}
|
|
132
|
+
${c((t) => {
|
|
133
|
+
this.d = t;
|
|
134
134
|
})}
|
|
135
135
|
></span>
|
|
136
136
|
<span
|
|
137
137
|
class="sbb-clock__hand-seconds"
|
|
138
|
-
.innerHTML=${
|
|
139
|
-
${
|
|
140
|
-
this.
|
|
138
|
+
.innerHTML=${g}
|
|
139
|
+
${c((t) => {
|
|
140
|
+
this.b = t;
|
|
141
141
|
})}
|
|
142
142
|
></span>
|
|
143
143
|
</div>
|
|
144
144
|
`;
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
],
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
],
|
|
147
|
+
l.styles = y;
|
|
148
|
+
m([
|
|
149
|
+
p()
|
|
150
|
+
], l.prototype, "now", 2);
|
|
151
|
+
l = m([
|
|
152
|
+
v("sbb-clock")
|
|
153
|
+
], l);
|
|
154
154
|
export {
|
|
155
|
-
|
|
155
|
+
l as SbbClockElement
|
|
156
156
|
};
|
package/container/sticky-bar.js
CHANGED
|
@@ -3,33 +3,33 @@ import { property as v, customElement as p } from "lit/decorators.js";
|
|
|
3
3
|
import { hostAttributes as k } from "../core/decorators.js";
|
|
4
4
|
import { AgnosticIntersectionObserver as h } from "../core/observers.js";
|
|
5
5
|
const y = d`*,:before,:after{box-sizing:border-box}:host{--sbb-sticky-bar-padding-block: var(--sbb-spacing-responsive-xs);--sbb-sticky-bar-fade-in-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-5x) );--sbb-sticky-bar-fade-out-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-2x) );--sbb-sticky-bar-animation-easing: var(--sbb-animation-easing);--sbb-sticky-bar-border-radius: var(--sbb-border-radius-8x);display:contents}:host([data-sticking]){--sbb-sticky-bar-sticky-background-color: var( --sbb-container-background-color, var(--sbb-color-white) )}:host([data-sticking][color=white]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-white)}:host([data-sticking][color=milk]){--sbb-sticky-bar-sticky-background-color: var(--sbb-color-milk)}.sbb-sticky-bar__wrapper{position:sticky;inset-block-end:0;display:block;z-index:var(--sbb-sticky-bar-z-index)}.sbb-sticky-bar__wrapper:after,.sbb-sticky-bar__wrapper:before{content:"";top:0;right:0;bottom:0;left:0;position:absolute;display:block;z-index:-1}.sbb-sticky-bar__wrapper:before{background-color:var(--sbb-container-background-color);padding:0!important}:host(:not([data-expanded])) .sbb-sticky-bar__wrapper:before{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([data-expanded])) .sbb-sticky-bar__wrapper:before{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}:host([data-expanded]) .sbb-sticky-bar__wrapper:before{padding-inline:var(--sbb-spacing-responsive-xxs)}.sbb-sticky-bar__wrapper:after{background-color:var(--sbb-sticky-bar-sticky-background-color, transparent);transition:background-color var(--sbb-sticky-bar-fade-out-animation-duration) var(--sbb-sticky-bar-animation-easing);border-start-start-radius:var(--sbb-sticky-bar-border-radius);border-start-end-radius:var(--sbb-sticky-bar-border-radius)}:host([data-sticking]) .sbb-sticky-bar__wrapper:after{transition-duration:var(--sbb-sticky-bar-fade-in-animation-duration)}@media (forced-colors: active){:host([data-sticking]) .sbb-sticky-bar__wrapper:after{border-block-start:var(--sbb-border-width-1x) solid CanvasText;border-radius:0}}.sbb-sticky-bar{display:flex;padding-block:var(--sbb-sticky-bar-padding-block);margin-block-end:-1px}.sbb-sticky-bar:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;border-start-start-radius:var(--sbb-sticky-bar-border-radius);border-start-end-radius:var(--sbb-sticky-bar-border-radius);transition:box-shadow var(--sbb-sticky-bar-fade-out-animation-duration) var(--sbb-sticky-bar-animation-easing);clip-path:polygon(-50% calc(-1 * var(--sbb-shadow-elevation-level-11-shadow-1-blur)),150% calc(-1 * var(--sbb-shadow-elevation-level-11-shadow-1-blur)),150% 50%,-50% 50%)}:host([data-sticking]) .sbb-sticky-bar:before{box-shadow:var(--sbb-shadow-elevation-level-11-shadow-2-offset-x) var(--sbb-shadow-elevation-level-11-shadow-2-offset-y) var(--sbb-shadow-elevation-level-11-shadow-2-blur) var(--sbb-shadow-elevation-level-11-shadow-2-spread) var(--sbb-shadow-elevation-level-11-soft-2-color),var(--sbb-shadow-elevation-level-11-shadow-1-offset-x) var(--sbb-shadow-elevation-level-11-shadow-1-offset-y) var(--sbb-shadow-elevation-level-11-shadow-1-blur) var(--sbb-shadow-elevation-level-11-shadow-1-spread) var(--sbb-shadow-elevation-level-11-soft-1-color);transition-duration:var(--sbb-sticky-bar-fade-in-animation-duration)}:host(:not([data-expanded])) .sbb-sticky-bar{padding-inline:var(--sbb-layout-base-offset-responsive);margin-inline:auto;width:100%}@media (min-width: 90rem){:host(:not([data-expanded])) .sbb-sticky-bar{max-width:calc(var(--sbb-layout-base-page-max-width) + 2 * var(--sbb-layout-base-offset-responsive))}}:host([data-expanded]) .sbb-sticky-bar{padding-inline:var(--sbb-spacing-responsive-xxs)}.sbb-sticky-bar__intersector{height:1px}.sbb-sticky-bar__intersector:after{content:"";display:block;position:absolute;width:100%;height:calc(var(--sbb-sticky-bar-bottom-overlapping-height, 0) + 1px);background-color:transparent;pointer-events:none;transition:background-color var(--sbb-sticky-bar-fade-out-animation-duration) var(--sbb-sticky-bar-animation-easing)}:host([data-sticking]) .sbb-sticky-bar__intersector:after{transition-duration:var(--sbb-sticky-bar-fade-in-animation-duration);background-color:var(--sbb-sticky-bar-sticky-background-color)}`;
|
|
6
|
-
var u = Object.defineProperty,
|
|
7
|
-
for (var
|
|
8
|
-
(
|
|
9
|
-
return r &&
|
|
6
|
+
var u = Object.defineProperty, f = Object.getOwnPropertyDescriptor, n = (a, t, i, r) => {
|
|
7
|
+
for (var s = r > 1 ? void 0 : r ? f(t, i) : t, o = a.length - 1, e; o >= 0; o--)
|
|
8
|
+
(e = a[o]) && (s = (r ? e(t, i, s) : e(s)) || s);
|
|
9
|
+
return r && s && u(t, i, s), s;
|
|
10
10
|
};
|
|
11
|
-
let
|
|
11
|
+
let b = class extends c {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(...arguments), this.
|
|
14
|
-
(a) => this.
|
|
13
|
+
super(...arguments), this.b = new h(
|
|
14
|
+
(a) => this.c(a[0])
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
connectedCallback() {
|
|
18
18
|
super.connectedCallback();
|
|
19
19
|
const a = this.closest("sbb-container");
|
|
20
|
-
a && this.toggleAttribute("data-expanded", a.expanded), this.
|
|
20
|
+
a && this.toggleAttribute("data-expanded", a.expanded), this.a && this.b.observe(this.a);
|
|
21
21
|
}
|
|
22
22
|
firstUpdated(a) {
|
|
23
|
-
super.firstUpdated(a), this.
|
|
23
|
+
super.firstUpdated(a), this.a || (this.a = this.shadowRoot.querySelector(".sbb-sticky-bar__intersector"), this.b.observe(this.a)), this.b.observe(this);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
c(a) {
|
|
26
26
|
this.toggleAttribute(
|
|
27
27
|
"data-sticking",
|
|
28
28
|
!a.isIntersecting && a.boundingClientRect.top > 0
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
disconnectedCallback() {
|
|
32
|
-
super.disconnectedCallback(), this.
|
|
32
|
+
super.disconnectedCallback(), this.b.disconnect();
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
35
|
return l`
|
|
@@ -42,16 +42,16 @@ let i = class extends c {
|
|
|
42
42
|
`;
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
b.styles = y;
|
|
46
46
|
n([
|
|
47
47
|
v({ reflect: !0 })
|
|
48
|
-
],
|
|
49
|
-
|
|
48
|
+
], b.prototype, "color", 2);
|
|
49
|
+
b = n([
|
|
50
50
|
p("sbb-sticky-bar"),
|
|
51
51
|
k({
|
|
52
52
|
slot: "sticky-bar"
|
|
53
53
|
})
|
|
54
|
-
],
|
|
54
|
+
], b);
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
b as SbbStickyBarElement
|
|
57
57
|
};
|