@sbb-esta/lyne-elements 1.2.0 → 1.2.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/accordion.d.ts +1 -1
- package/accordion/accordion.d.ts.map +1 -1
- package/alert/alert/alert.d.ts +1 -1
- package/alert/alert/alert.d.ts.map +1 -1
- package/clock/clock.d.ts +19 -13
- package/clock/clock.d.ts.map +1 -1
- package/clock.js +86 -75
- package/core/mixins/hydration-mixin.d.ts.map +1 -1
- package/core/mixins.js +126 -132
- package/custom-elements.json +46 -238
- package/development/accordion/accordion.d.ts +1 -1
- package/development/accordion/accordion.d.ts.map +1 -1
- package/development/accordion.js +1 -1
- package/development/alert/alert/alert.d.ts +1 -1
- package/development/alert/alert/alert.d.ts.map +1 -1
- package/development/alert/alert.js +1 -1
- package/development/clock/clock.d.ts +19 -13
- package/development/clock/clock.d.ts.map +1 -1
- package/development/clock.js +85 -80
- package/development/core/mixins/hydration-mixin.d.ts.map +1 -1
- package/development/core/mixins.js +15 -16
- package/development/icon/icon-request.d.ts.map +1 -1
- package/development/icon.js +8 -13
- package/development/toggle-check/toggle-check.d.ts +2 -2
- package/development/toggle-check/toggle-check.d.ts.map +1 -1
- package/development/toggle-check.js +1 -1
- package/development/visual-checkbox.js +2 -2
- package/icon/icon-request.d.ts.map +1 -1
- package/icon.js +86 -86
- package/package.json +1 -1
- package/toggle-check/toggle-check.d.ts +2 -2
- package/toggle-check/toggle-check.d.ts.map +1 -1
- package/visual-checkbox.js +4 -4
package/accordion/accordion.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare class SbbAccordionElement extends SbbAccordionElement_base {
|
|
|
20
20
|
set multi(value: boolean);
|
|
21
21
|
get multi(): boolean;
|
|
22
22
|
private _multi;
|
|
23
|
-
/** Size variant, either l or s; overrides the size on any projected `sbb-expansion-panel`.
|
|
23
|
+
/** Size variant, either l or s; overrides the size on any projected `sbb-expansion-panel`. */
|
|
24
24
|
size: 's' | 'l';
|
|
25
25
|
private _abort;
|
|
26
26
|
private _closePanels;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/elements/accordion/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAMvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;;AAIjD;;;;GAIG;AACH,qBACa,mBAAoB,SAAQ,wBAA6B;IACpE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;OAGG;IACH,IACW,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,EAGhD;IACD,IAAW,UAAU,IAAI,aAAa,GAAG,IAAI,CAE5C;IACD,OAAO,CAAC,WAAW,CAA8B;IAEjD,8EAA8E;IAC9E,IACW,KAAK,CAAC,KAAK,EAAE,OAAO,EAI9B;IACD,IAAW,KAAK,IAAI,OAAO,CAE1B;IACD,OAAO,CAAC,MAAM,CAAkB;IAEhC
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/elements/accordion/accordion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAMvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;;AAIjD;;;;GAIG;AACH,qBACa,mBAAoB,SAAQ,wBAA6B;IACpE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;OAGG;IACH,IACW,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,EAGhD;IACD,IAAW,UAAU,IAAI,aAAa,GAAG,IAAI,CAE5C;IACD,OAAO,CAAC,WAAW,CAA8B;IAEjD,8EAA8E;IAC9E,IACW,KAAK,CAAC,KAAK,EAAE,OAAO,EAI9B;IACD,IAAW,KAAK,IAAI,OAAO,CAE1B;IACD,OAAO,CAAC,MAAM,CAAkB;IAEhC,8FAA8F;IAC1D,IAAI,EAAE,GAAG,GAAG,GAAG,CAAO;IAE1D,OAAO,CAAC,MAAM,CAAyC;IAEvD,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,wBAAwB;IAMhC,OAAO,KAAK,gBAAgB,GAE3B;IAEe,iBAAiB,IAAI,IAAI;cAUtB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAQ5E,OAAO,CAAC,iBAAiB;cAWN,MAAM,IAAI,cAAc;CAO5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,eAAe,EAAE,mBAAmB,CAAC;KACtC;CACF"}
|
package/alert/alert/alert.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare class SbbAlertElement extends SbbAlertElement_base {
|
|
|
25
25
|
* In readonly mode, there is no dismiss button offered to the user.
|
|
26
26
|
*/
|
|
27
27
|
readonly: boolean;
|
|
28
|
-
/** You can choose between `m` or `l` size. */
|
|
28
|
+
/** You can choose between `s`, `m` or `l` size. */
|
|
29
29
|
size: 's' | 'm' | 'l';
|
|
30
30
|
/**
|
|
31
31
|
* Name of the icon which will be forward to the nested `sbb-icon`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/elements/alert/alert/alert.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAGb,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAMlE,OAAO,KAAK,EAAE,aAAa,EAAE,MA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G,MAAM,GAAG,SAAS,CAAC;IAE/D,wEAAwE;IACrD,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3C,2EAA2E;IACpB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IAE9F,8BAA8B;IACM,SAAS,EAAE,MAAM,GAAG,MAAM,CAAU;IAExE,8BAA8B;IAC9B,OAAO,KAAK,MAAM,GAEjB;IACD,OAAO,KAAK,MAAM,QAEjB;IAED,+CAA+C;IAC/C,OAAO,CAAC,SAAS,CAA+E;IAEhG,yEAAyE;IACzE,OAAO,CAAC,QAAQ,CAA8E;IAE9F,sDAAsD;IACtD,OAAO,CAAC,mBAAmB,CAGzB;IAEF,OAAO,CAAC,SAAS,CAAmC;cAE3B,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAM7F,uCAAuC;IAChC,gBAAgB,IAAI,IAAI;IAI/B,sBAAsB;IACtB,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,eAAe;cAOJ,MAAM,IAAI,cAAc;CAqD5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF"}
|
package/clock/clock.d.ts
CHANGED
|
@@ -29,16 +29,19 @@ export declare class SbbClockElement extends LitElement {
|
|
|
29
29
|
private _moveMinutesHandFn;
|
|
30
30
|
/** Move the minutes hand every minute. */
|
|
31
31
|
private _handMovement?;
|
|
32
|
-
protected willUpdate(changedProperties: PropertyValues<this>): void
|
|
32
|
+
protected willUpdate(changedProperties: PropertyValues<this>): Promise<void>;
|
|
33
|
+
protected firstUpdated(changedProperties: PropertyValues<this>): Promise<void>;
|
|
34
|
+
disconnectedCallback(): void;
|
|
33
35
|
private _handlePageVisibilityChange;
|
|
34
|
-
private
|
|
35
|
-
|
|
36
|
-
private
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
private _assignCurrentTime;
|
|
36
|
+
private _startOrConfigureClock;
|
|
37
|
+
/** Starts the clock by defining the hands starting position then starting the animations. */
|
|
38
|
+
private _startClock;
|
|
39
|
+
/** Stops the clock by removing all the animations. */
|
|
40
|
+
private _stopClock;
|
|
40
41
|
/** Set the starting position for the three hands on the clock face. */
|
|
41
42
|
private _setHandsStartingPosition;
|
|
43
|
+
/** Given the current date, calculates the hh/mm/ss values and the hh/mm/ss left to the next midnight. */
|
|
44
|
+
private _assignCurrentTime;
|
|
42
45
|
/** Set the starting position for the minutes hand. */
|
|
43
46
|
private _setMinutesHand;
|
|
44
47
|
/** Move the hours hand to the next value. */
|
|
@@ -46,12 +49,15 @@ export declare class SbbClockElement extends LitElement {
|
|
|
46
49
|
/** Move the minutes hand to the next value. */
|
|
47
50
|
private _moveMinutesHand;
|
|
48
51
|
private _addMinutesAndSetHands;
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Removing animation by overriding with empty string,
|
|
54
|
+
* then triggering a reflow and re add original animation by removing override.
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
57
|
+
private _resetSecondsHandAnimation;
|
|
58
|
+
private _removeEventListeners;
|
|
59
|
+
private _removeHoursAnimationStyles;
|
|
60
|
+
private _removeSecondsAnimationStyles;
|
|
55
61
|
protected render(): TemplateResult;
|
|
56
62
|
}
|
|
57
63
|
declare global {
|
package/clock/clock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../../src/elements/clock/clock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAkB,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA2CrD;;GAEG;AACH,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AO,CAAC,QAAQ,CAAU;IAE1B,wCAAwC;IACxC,OAAO,CAAC,gBAAgB,CAAqC;IAE7D,0CAA0C;IAC1C,OAAO,CAAC,kBAAkB,CAAuC;IAEjE,0CAA0C;IAC1C,OAAO,CAAC,aAAa,CAAC,CAAiC;cAE9B,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;cAQlE,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAS7E,oBAAoB,IAAI,IAAI;IAK5C,OAAO,CAAC,2BAA2B,CAMjC;YAEY,sBAAsB;IAUpC,6FAA6F;YAC/E,WAAW;IAqBzB,sDAAsD;YACxC,UAAU;IAcxB,uEAAuE;IACvE,OAAO,CAAC,yBAAyB;IA4CjC,yGAAyG;IACzG,OAAO,CAAC,kBAAkB;IAW1B,sDAAsD;IACtD,OAAO,CAAC,eAAe;IAOvB,6CAA6C;IAC7C,OAAO,CAAC,cAAc;IAYtB,+CAA+C;IAC/C,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,sBAAsB;IAK9B;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAUlC,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,2BAA2B;IAMnC,OAAO,CAAC,6BAA6B;cAOlB,MAAM,IAAI,cAAc;CA4B5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF"}
|
package/clock.js
CHANGED
|
@@ -1,137 +1,148 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as p, LitElement as H, isServer as _, html as g } from "lit";
|
|
2
2
|
import { property as y, customElement as f } from "lit/decorators.js";
|
|
3
|
-
import { ref as
|
|
4
|
-
const
|
|
5
|
-
`,
|
|
6
|
-
`,
|
|
7
|
-
`,
|
|
8
|
-
`, C =
|
|
9
|
-
var
|
|
10
|
-
for (var
|
|
11
|
-
(a = t[e]) && (
|
|
12
|
-
return i &&
|
|
3
|
+
import { ref as r } from "lit/directives/ref.js";
|
|
4
|
+
const z = `<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
|
+
`, S = `<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
|
+
`, w = `<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
|
+
`, L = `<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
|
+
`, C = p`*,: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 E = Object.defineProperty, A = Object.getOwnPropertyDescriptor, k = (t, n, s, i) => {
|
|
10
|
+
for (var o = i > 1 ? void 0 : i ? A(n, s) : n, e = t.length - 1, a; e >= 0; e--)
|
|
11
|
+
(a = t[e]) && (o = (i ? a(n, s, o) : a(o)) || o);
|
|
12
|
+
return i && o && E(n, s, o), o;
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const O = 12, P = 60, u = 60, T = 50, b = 360, v = 30, N = 6, F = 360 / 58.5, I = 60, x = 3600, M = {
|
|
15
15
|
once: !0,
|
|
16
16
|
passive: !0
|
|
17
17
|
};
|
|
18
|
-
let c = class extends
|
|
18
|
+
let c = class extends H {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments), this.now = null, this._moveHoursHandFn = () => this._moveHoursHand(), this._moveMinutesHandFn = () => this._moveMinutesHand(), this._handlePageVisibilityChange = async () => {
|
|
21
21
|
document.visibilityState === "hidden" ? await this._stopClock() : this.now || await this._startClock();
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
willUpdate(t) {
|
|
25
|
-
super.willUpdate(t), !
|
|
24
|
+
async willUpdate(t) {
|
|
25
|
+
super.willUpdate(t), !_ && t.has("now") && await this._startOrConfigureClock();
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
document.addEventListener("visibilitychange", this._handlePageVisibilityChange, !1);
|
|
27
|
+
async firstUpdated(t) {
|
|
28
|
+
super.firstUpdated(t), _ || (document.addEventListener("visibilitychange", this._handlePageVisibilityChange, !1), await this._startOrConfigureClock());
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
document == null || document.removeEventListener("visibilitychange", this._handlePageVisibilityChange), (t = this._clockHandHours) == null || t.removeEventListener("animationend", this._moveHoursHandFn), (s = this._clockHandSeconds) == null || s.removeEventListener("animationend", this._moveMinutesHandFn), clearInterval(this._handMovement);
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
super.disconnectedCallback(), this._removeEventListeners();
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(t = this._clockHandHours) == 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");
|
|
33
|
+
async _startOrConfigureClock() {
|
|
34
|
+
this.now ? (await this._stopClock(), this._resetSecondsHandAnimation(), this._setHandsStartingPosition()) : await this._startClock();
|
|
37
35
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
/** Starts the clock by defining the hands starting position then starting the animations. */
|
|
37
|
+
async _startClock() {
|
|
38
|
+
var t, n;
|
|
39
|
+
(t = this._clockHandHours) == null || t.addEventListener(
|
|
40
|
+
"animationend",
|
|
41
|
+
this._moveHoursHandFn,
|
|
42
|
+
M
|
|
43
|
+
), (n = this._clockHandSeconds) == null || n.addEventListener(
|
|
44
|
+
"animationend",
|
|
45
|
+
this._moveMinutesHandFn,
|
|
46
|
+
M
|
|
47
|
+
), await new Promise(
|
|
48
|
+
() => setTimeout(() => {
|
|
49
|
+
var s;
|
|
50
|
+
this._setHandsStartingPosition(), (s = this.style) == null || s.setProperty("--sbb-clock-animation-play-state", "running");
|
|
51
|
+
}, T)
|
|
52
|
+
);
|
|
41
53
|
}
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.
|
|
54
|
+
/** Stops the clock by removing all the animations. */
|
|
55
|
+
async _stopClock() {
|
|
56
|
+
var t, n, s, i;
|
|
57
|
+
clearInterval(this._handMovement), this._removeSecondsAnimationStyles(), this._removeHoursAnimationStyles(), (t = this._clockHandHours) == null || t.removeEventListener("animationend", this._moveHoursHandFn), (n = this._clockHandSeconds) == null || n.removeEventListener("animationend", this._moveMinutesHandFn), (s = this._clockHandMinutes) == null || s.classList.add("sbb-clock__hand-minutes--no-transition"), (i = this.style) == null || i.setProperty("--sbb-clock-animation-play-state", "paused");
|
|
46
58
|
}
|
|
47
59
|
/** Set the starting position for the three hands on the clock face. */
|
|
48
60
|
_setHandsStartingPosition() {
|
|
49
|
-
var e, a,
|
|
61
|
+
var e, a, l, d, h, m;
|
|
50
62
|
this._assignCurrentTime();
|
|
51
|
-
const t =
|
|
52
|
-
let i = 0,
|
|
53
|
-
t > 0 && (i += t,
|
|
63
|
+
const t = u - this._seconds, n = P - this._minutes, s = O - this._hours;
|
|
64
|
+
let i = 0, o = 0;
|
|
65
|
+
t > 0 && (i += t, o = 1), n > 0 && (i += (n - o) * I, o = 1), s > 0 && (i += (s - o) * x), (e = this.style) == null || e.setProperty(
|
|
54
66
|
"--sbb-clock-hours-animation-start-angle",
|
|
55
|
-
`${Math.ceil(this._hours *
|
|
56
|
-
), (a = this.style) == null || a.setProperty("--sbb-clock-hours-animation-duration", `${i}s`), (
|
|
67
|
+
`${Math.ceil(this._hours * v + this._minutes / 2)}deg`
|
|
68
|
+
), (a = this.style) == null || a.setProperty("--sbb-clock-hours-animation-duration", `${i}s`), (l = this.style) == null || l.setProperty(
|
|
57
69
|
"--sbb-clock-seconds-animation-start-angle",
|
|
58
|
-
`${Math.ceil(this._seconds *
|
|
59
|
-
), (d = this.style) == null || d.setProperty("--sbb-clock-seconds-animation-duration", `${t}s`), this._setMinutesHand(), (h = this._clockHandSeconds) == null || h.classList.add("sbb-clock__hand-seconds--initial-minute"), (m = this._clockHandHours) == null || m.classList.add("sbb-clock__hand-hours--initial-hour"),
|
|
70
|
+
`${Math.ceil(this._seconds * F)}deg`
|
|
71
|
+
), (d = this.style) == null || d.setProperty("--sbb-clock-seconds-animation-duration", `${t}s`), this._setMinutesHand(), (h = this._clockHandSeconds) == null || h.classList.add("sbb-clock__hand-seconds--initial-minute"), (m = this._clockHandHours) == null || m.classList.add("sbb-clock__hand-hours--initial-hour"), this.toggleAttribute("data-initialized", !0);
|
|
72
|
+
}
|
|
73
|
+
/** Given the current date, calculates the hh/mm/ss values and the hh/mm/ss left to the next midnight. */
|
|
74
|
+
_assignCurrentTime() {
|
|
75
|
+
const t = this.now ? null : /* @__PURE__ */ new Date(), [n, s, i] = t ? [t.getHours(), t.getMinutes(), t.getSeconds()] : this.now.split(":").map((o) => +o);
|
|
76
|
+
this._hours = n % 12, this._minutes = s, this._seconds = i;
|
|
60
77
|
}
|
|
61
78
|
/** Set the starting position for the minutes hand. */
|
|
62
79
|
_setMinutesHand() {
|
|
63
80
|
var t;
|
|
64
81
|
(t = this._clockHandMinutes) == null || t.style.setProperty(
|
|
65
82
|
"transform",
|
|
66
|
-
`rotateZ(${Math.ceil(this._minutes *
|
|
83
|
+
`rotateZ(${Math.ceil(this._minutes * N)}deg)`
|
|
67
84
|
);
|
|
68
85
|
}
|
|
69
86
|
/** Move the hours hand to the next value. */
|
|
70
87
|
_moveHoursHand() {
|
|
71
|
-
var
|
|
88
|
+
var n;
|
|
72
89
|
this._removeHoursAnimationStyles();
|
|
73
|
-
let t = Math.ceil(this._hours *
|
|
74
|
-
t >=
|
|
90
|
+
let t = Math.ceil(this._hours * v + this._minutes / 2);
|
|
91
|
+
t >= b && (t -= b), (n = this._clockHandHours) == null || n.style.setProperty("transform", `rotateZ(${t}deg)`);
|
|
75
92
|
}
|
|
76
93
|
/** Move the minutes hand to the next value. */
|
|
77
94
|
_moveMinutesHand() {
|
|
78
95
|
var t;
|
|
79
96
|
(t = this._clockHandSeconds) == null || t.removeEventListener("animationend", this._moveMinutesHandFn), this._removeSecondsAnimationStyles(), this._addMinutesAndSetHands(), this._handMovement = setInterval(
|
|
80
97
|
() => this._addMinutesAndSetHands(),
|
|
81
|
-
|
|
98
|
+
u * 1e3
|
|
82
99
|
);
|
|
83
100
|
}
|
|
84
101
|
_addMinutesAndSetHands() {
|
|
85
102
|
this._minutes++, this._setMinutesHand();
|
|
86
103
|
}
|
|
87
|
-
/**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Removing animation by overriding with empty string,
|
|
106
|
+
* then triggering a reflow and re add original animation by removing override.
|
|
107
|
+
* @private
|
|
108
|
+
*/
|
|
109
|
+
_resetSecondsHandAnimation() {
|
|
110
|
+
this._clockHandSeconds && (this._clockHandSeconds.style.animation = "", this._clockHandSeconds.offsetHeight, this._clockHandSeconds.style.removeProperty("animation"));
|
|
91
111
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
(t = this._clockHandHours) == null || t.addEventListener(
|
|
96
|
-
"animationend",
|
|
97
|
-
this._moveHoursHandFn,
|
|
98
|
-
k
|
|
99
|
-
), (s = this._clockHandSeconds) == null || s.addEventListener(
|
|
100
|
-
"animationend",
|
|
101
|
-
this._moveMinutesHandFn,
|
|
102
|
-
k
|
|
103
|
-
), await new Promise(
|
|
104
|
-
() => setTimeout(() => this._setHandsStartingPosition(), N)
|
|
105
|
-
);
|
|
112
|
+
_removeEventListeners() {
|
|
113
|
+
var t, n;
|
|
114
|
+
document == null || document.removeEventListener("visibilitychange", this._handlePageVisibilityChange), (t = this._clockHandHours) == null || t.removeEventListener("animationend", this._moveHoursHandFn), (n = this._clockHandSeconds) == null || n.removeEventListener("animationend", this._moveMinutesHandFn), clearInterval(this._handMovement);
|
|
106
115
|
}
|
|
107
|
-
|
|
108
|
-
|
|
116
|
+
_removeHoursAnimationStyles() {
|
|
117
|
+
var t;
|
|
118
|
+
(t = this._clockHandHours) == 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");
|
|
109
119
|
}
|
|
110
|
-
|
|
111
|
-
|
|
120
|
+
_removeSecondsAnimationStyles() {
|
|
121
|
+
var t, n;
|
|
122
|
+
(t = this._clockHandSeconds) == null || t.classList.remove("sbb-clock__hand-seconds--initial-minute"), (n = this._clockHandMinutes) == null || n.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");
|
|
112
123
|
}
|
|
113
124
|
render() {
|
|
114
|
-
return
|
|
125
|
+
return g`
|
|
115
126
|
<div class="sbb-clock">
|
|
116
|
-
<span class="sbb-clock__face" .innerHTML=${
|
|
127
|
+
<span class="sbb-clock__face" .innerHTML=${z}></span>
|
|
117
128
|
<span
|
|
118
129
|
class="sbb-clock__hand-hours"
|
|
119
|
-
.innerHTML=${
|
|
120
|
-
${
|
|
130
|
+
.innerHTML=${S}
|
|
131
|
+
${r((t) => {
|
|
121
132
|
this._clockHandHours = t;
|
|
122
133
|
})}
|
|
123
134
|
></span>
|
|
124
135
|
<span
|
|
125
136
|
class="sbb-clock__hand-minutes sbb-clock__hand-minutes--no-transition"
|
|
126
|
-
.innerHTML=${
|
|
127
|
-
${
|
|
137
|
+
.innerHTML=${w}
|
|
138
|
+
${r((t) => {
|
|
128
139
|
this._clockHandMinutes = t;
|
|
129
140
|
})}
|
|
130
141
|
></span>
|
|
131
142
|
<span
|
|
132
143
|
class="sbb-clock__hand-seconds"
|
|
133
|
-
.innerHTML=${
|
|
134
|
-
${
|
|
144
|
+
.innerHTML=${L}
|
|
145
|
+
${r((t) => {
|
|
135
146
|
this._clockHandSeconds = t;
|
|
136
147
|
})}
|
|
137
148
|
></span>
|
|
@@ -140,10 +151,10 @@ let c = class extends g {
|
|
|
140
151
|
}
|
|
141
152
|
};
|
|
142
153
|
c.styles = C;
|
|
143
|
-
|
|
154
|
+
k([
|
|
144
155
|
y()
|
|
145
156
|
], c.prototype, "now", 2);
|
|
146
|
-
c =
|
|
157
|
+
c = k([
|
|
147
158
|
f("sbb-clock")
|
|
148
159
|
], c);
|
|
149
160
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration-mixin.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/mixins/hydration-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"hydration-mixin.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/mixins/hydration-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAEtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,qBAAqB;IACjD;;;;;;OAMG;IACH,IAAW,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjD,+DAA+D;IAC/D,SAAS,KAAK,iBAAiB,IAAI,OAAO,CAAC;CAC5C;AAED;;;;;;GAMG;AAEH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,mBAAmB,CAAC,UAAU,CAAC,QACnE,CAAC,KACN,mBAAmB,CAAC,qBAAqB,CAAC,GAAG,CAwE/C,CAAC"}
|