analog-clock-components 0.2.68 → 0.2.69
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/dist/analog-clock/analog-clock.esm.js +1 -1
- package/dist/analog-clock/p-DVQG3jUT.js +2 -0
- package/dist/analog-clock/{p-d3086dee.entry.js → p-bc3fe117.entry.js} +1 -1
- package/dist/cjs/analog-clock.cjs.entry.js +1 -1
- package/dist/cjs/analog-clock.cjs.js +3 -3
- package/dist/cjs/index-CAsdnPQ9.js +3015 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/components/analog-clock.js +1 -69
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/esm/analog-clock.entry.js +1 -1
- package/dist/esm/analog-clock.js +4 -4
- package/dist/esm/index-DVQG3jUT.js +3009 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/stencil-public-runtime.d.ts +14 -3
- package/package.json +2 -2
- package/dist/analog-clock/p-6zWiImGa.js +0 -2
- package/dist/cjs/index-C6H0Qpg2.js +0 -1400
- package/dist/esm/index-6zWiImGa.js +0 -1394
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-CAsdnPQ9.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["analog-clock.cjs",[[
|
|
9
|
+
return index.bootstrapLazy([["analog-clock.cjs",[[1,"analog-clock",{"size":[2],"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -1,69 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const analogClockCss = () => `.clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}`;
|
|
4
|
-
|
|
5
|
-
const AnalogClock$1 = /*@__PURE__*/ proxyCustomElement(class AnalogClock extends HTMLElement {
|
|
6
|
-
constructor(registerHost) {
|
|
7
|
-
super();
|
|
8
|
-
if (registerHost !== false) {
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
}
|
|
11
|
-
this.__attachShadow();
|
|
12
|
-
this.size = undefined;
|
|
13
|
-
this.timeZone = 0;
|
|
14
|
-
this.time = Date.now();
|
|
15
|
-
}
|
|
16
|
-
componentDidLoad() {
|
|
17
|
-
this.timer = window.setInterval(() => {
|
|
18
|
-
this.time = Date.now();
|
|
19
|
-
}, 250);
|
|
20
|
-
}
|
|
21
|
-
disconnectedCallback() {
|
|
22
|
-
clearInterval(this.timer);
|
|
23
|
-
}
|
|
24
|
-
get hour() {
|
|
25
|
-
return new Date(this.time).getHours();
|
|
26
|
-
}
|
|
27
|
-
get minute() {
|
|
28
|
-
return new Date(this.time).getMinutes();
|
|
29
|
-
}
|
|
30
|
-
get second() {
|
|
31
|
-
return new Date(this.time).getSeconds();
|
|
32
|
-
}
|
|
33
|
-
hourToDegrees() {
|
|
34
|
-
const hour = this.hour + this.timeZone;
|
|
35
|
-
return Math.floor(this.minute / 2) + hour * 30;
|
|
36
|
-
}
|
|
37
|
-
minuteToDegrees() {
|
|
38
|
-
return Math.floor(this.second / 10) + this.minute * 6;
|
|
39
|
-
}
|
|
40
|
-
secondToDegrees() {
|
|
41
|
-
return this.second * 6;
|
|
42
|
-
}
|
|
43
|
-
render() {
|
|
44
|
-
return (h("svg", { key: '39e3465d3bf04035966b00bb15186d1f712163cd', class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { key: 'e4c4288aa0efc9cf98027eef1f5bd7c550c23a18', id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { key: '296fb8ac19749103439f2ce1878db5ccfb214c20', id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { key: 'acbe2c6ebdf05ff46e06144839dec43c45e8b40d', id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { key: 'f275abf7169379b2f61c9cdd185068f5e2373d4a', id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
|
|
45
|
-
}
|
|
46
|
-
static get style() { return analogClockCss(); }
|
|
47
|
-
}, [257, "analog-clock", {
|
|
48
|
-
"size": [2],
|
|
49
|
-
"timeZone": [2, "time-zone"],
|
|
50
|
-
"time": [32]
|
|
51
|
-
}]);
|
|
52
|
-
function defineCustomElement$1() {
|
|
53
|
-
if (typeof customElements === "undefined") {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const components = ["analog-clock"];
|
|
57
|
-
components.forEach(tagName => { switch (tagName) {
|
|
58
|
-
case "analog-clock":
|
|
59
|
-
if (!customElements.get(transformTag(tagName))) {
|
|
60
|
-
customElements.define(transformTag(tagName), AnalogClock$1);
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
63
|
-
} });
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const AnalogClock = AnalogClock$1;
|
|
67
|
-
const defineCustomElement = defineCustomElement$1;
|
|
68
|
-
|
|
69
|
-
export { AnalogClock, defineCustomElement };
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as c,transformTag as o}from"@stencil/core/internal/client";const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.size=void 0,this.timeZone=0,this.time=Date.now()}componentDidLoad(){this.timer=window.setInterval((()=>{this.time=Date.now()}),250)}disconnectedCallback(){clearInterval(this.timer)}get hour(){return new Date(this.time).getHours()}get minute(){return new Date(this.time).getMinutes()}get second(){return new Date(this.time).getSeconds()}hourToDegrees(){const e=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*e}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return c("svg",{key:"39e3465d3bf04035966b00bb15186d1f712163cd",class:"clock",viewBox:"0 0 200 200",width:this.size,height:this.size},c("circle",{key:"e4c4288aa0efc9cf98027eef1f5bd7c550c23a18",id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),c("line",{key:"296fb8ac19749103439f2ce1878db5ccfb214c20",id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),c("line",{key:"acbe2c6ebdf05ff46e06144839dec43c45e8b40d",id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),c("line",{key:"f275abf7169379b2f61c9cdd185068f5e2373d4a",id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}static get style(){return".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}"}},[1,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]),s=r,i=function(){"undefined"!=typeof customElements&&["analog-clock"].forEach((e=>{"analog-clock"===e&&(customElements.get(o(e))||customElements.define(o(e),r))}))};export{s as AnalogClock,i as defineCustomElement}
|
|
@@ -31,3 +31,5 @@ export interface SetPlatformOptions {
|
|
|
31
31
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
32
32
|
}
|
|
33
33
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
34
|
+
|
|
35
|
+
export * from '../types';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-DVQG3jUT.js';
|
|
2
2
|
|
|
3
3
|
const analogClockCss = () => `.clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}`;
|
|
4
4
|
|
package/dist/esm/analog-clock.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-DVQG3jUT.js';
|
|
2
|
+
export { s as setNonce } from './index-DVQG3jUT.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.
|
|
6
|
+
Stencil Client Patch Browser v4.40.0 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
var patchBrowser = () => {
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["analog-clock",[[
|
|
20
|
+
return bootstrapLazy([["analog-clock",[[1,"analog-clock",{"size":[2],"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
21
21
|
});
|