analog-clock-components 0.1.276 → 0.1.277
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-97a8952d.entry.js +1 -0
- package/dist/cjs/analog-clock.cjs.entry.js +2 -1
- package/dist/cjs/analog-clock.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/analog-clock/analog-clock.js +20 -1
- package/dist/components/analog-clock.js +3 -1
- package/dist/esm/analog-clock.entry.js +2 -1
- package/dist/esm/analog-clock.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/analog-clock/analog-clock.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- package/dist/analog-clock/p-d1606aca.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as e,b as o}from"./p-c54c9f6a.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-97a8952d",[[1,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e}from"./p-c54c9f6a.js";const r=class{constructor(e){t(this,e),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 t=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*t}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return e("svg",{class:"clock",viewBox:"0 0 200 200",width:this.size,height:this.size},e("circle",{id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),e("line",{id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),e("line",{id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),e("line",{id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}};r.style=".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)}";export{r as analog_clock}
|
|
@@ -9,6 +9,7 @@ const analogClockCss = ".clock #circle{stroke:var(--clock-circle-color, black)}.
|
|
|
9
9
|
const AnalogClock = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
|
+
this.size = undefined;
|
|
12
13
|
this.timeZone = 0;
|
|
13
14
|
this.time = Date.now();
|
|
14
15
|
}
|
|
@@ -40,7 +41,7 @@ const AnalogClock = class {
|
|
|
40
41
|
return this.second * 6;
|
|
41
42
|
}
|
|
42
43
|
render() {
|
|
43
|
-
return (index.h("svg", { class: "clock", viewBox: "0 0 200 200",
|
|
44
|
+
return (index.h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, index.h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), index.h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), index.h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), index.h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
47
|
AnalogClock.style = analogClockCss;
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["analog-clock.cjs",[[1,"analog-clock",{"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
18
|
+
return index.bootstrapLazy([["analog-clock.cjs",[[1,"analog-clock",{"size":[2],"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
19
19
|
});
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["analog-clock.cjs",[[1,"analog-clock",{"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["analog-clock.cjs",[[1,"analog-clock",{"size":[2],"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, Prop, State, h } from '@stencil/core';
|
|
2
2
|
export class AnalogClock {
|
|
3
3
|
constructor() {
|
|
4
|
+
this.size = undefined;
|
|
4
5
|
this.timeZone = 0;
|
|
5
6
|
this.time = Date.now();
|
|
6
7
|
}
|
|
@@ -32,7 +33,7 @@ export class AnalogClock {
|
|
|
32
33
|
return this.second * 6;
|
|
33
34
|
}
|
|
34
35
|
render() {
|
|
35
|
-
return (h("svg", { class: "clock", viewBox: "0 0 200 200",
|
|
36
|
+
return (h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size },
|
|
36
37
|
h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }),
|
|
37
38
|
h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }),
|
|
38
39
|
h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }),
|
|
@@ -47,6 +48,24 @@ export class AnalogClock {
|
|
|
47
48
|
"$": ["analog-clock.css"]
|
|
48
49
|
}; }
|
|
49
50
|
static get properties() { return {
|
|
51
|
+
"size": {
|
|
52
|
+
"type": "number",
|
|
53
|
+
"mutable": false,
|
|
54
|
+
"complexType": {
|
|
55
|
+
"original": "number",
|
|
56
|
+
"resolved": "number",
|
|
57
|
+
"references": {}
|
|
58
|
+
},
|
|
59
|
+
"required": false,
|
|
60
|
+
"optional": false,
|
|
61
|
+
"docs": {
|
|
62
|
+
"tags": [],
|
|
63
|
+
"text": ""
|
|
64
|
+
},
|
|
65
|
+
"attribute": "size",
|
|
66
|
+
"reflect": false,
|
|
67
|
+
"defaultValue": "undefined"
|
|
68
|
+
},
|
|
50
69
|
"timeZone": {
|
|
51
70
|
"type": "number",
|
|
52
71
|
"mutable": false,
|
|
@@ -7,6 +7,7 @@ const AnalogClock$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|
|
9
9
|
this.__attachShadow();
|
|
10
|
+
this.size = undefined;
|
|
10
11
|
this.timeZone = 0;
|
|
11
12
|
this.time = Date.now();
|
|
12
13
|
}
|
|
@@ -38,10 +39,11 @@ const AnalogClock$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
38
39
|
return this.second * 6;
|
|
39
40
|
}
|
|
40
41
|
render() {
|
|
41
|
-
return (h("svg", { class: "clock", viewBox: "0 0 200 200",
|
|
42
|
+
return (h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
|
|
42
43
|
}
|
|
43
44
|
static get style() { return analogClockCss; }
|
|
44
45
|
}, [1, "analog-clock", {
|
|
46
|
+
"size": [2],
|
|
45
47
|
"timeZone": [2, "time-zone"],
|
|
46
48
|
"time": [32]
|
|
47
49
|
}]);
|
|
@@ -5,6 +5,7 @@ const analogClockCss = ".clock #circle{stroke:var(--clock-circle-color, black)}.
|
|
|
5
5
|
const AnalogClock = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
|
+
this.size = undefined;
|
|
8
9
|
this.timeZone = 0;
|
|
9
10
|
this.time = Date.now();
|
|
10
11
|
}
|
|
@@ -36,7 +37,7 @@ const AnalogClock = class {
|
|
|
36
37
|
return this.second * 6;
|
|
37
38
|
}
|
|
38
39
|
render() {
|
|
39
|
-
return (h("svg", { class: "clock", viewBox: "0 0 200 200",
|
|
40
|
+
return (h("svg", { class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
AnalogClock.style = analogClockCss;
|
package/dist/esm/analog-clock.js
CHANGED
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["analog-clock",[[1,"analog-clock",{"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
16
|
+
return bootstrapLazy([["analog-clock",[[1,"analog-clock",{"size":[2],"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
17
17
|
});
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["analog-clock",[[1,"analog-clock",{"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
13
|
+
return bootstrapLazy([["analog-clock",[[1,"analog-clock",{"size":[2],"timeZone":[2,"time-zone"],"time":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
export namespace Components {
|
|
9
9
|
interface AnalogClock {
|
|
10
|
+
"size": number;
|
|
10
11
|
"timeZone": number;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -23,6 +24,7 @@ declare global {
|
|
|
23
24
|
}
|
|
24
25
|
declare namespace LocalJSX {
|
|
25
26
|
interface AnalogClock {
|
|
27
|
+
"size"?: number;
|
|
26
28
|
"timeZone"?: number;
|
|
27
29
|
}
|
|
28
30
|
interface IntrinsicElements {
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-c54c9f6a.js";const r=class{constructor(e){t(this,e),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 t=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*t}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return e("svg",{class:"clock",viewBox:"0 0 200 200",xmlns:"http://www.w3.org/2000/svg"},e("circle",{id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),e("line",{id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),e("line",{id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),e("line",{id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}};r.style=".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)}";export{r as analog_clock}
|