analog-clock-components 0.1.369 → 0.1.370
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 -2
- package/dist/analog-clock/index.esm.js +0 -2
- package/dist/analog-clock/p-70e2f846.entry.js +1 -0
- package/dist/analog-clock/p-d5ea3495.js +2 -3
- package/dist/cjs/analog-clock.cjs.entry.js +0 -2
- package/dist/cjs/analog-clock.cjs.js +0 -2
- package/dist/cjs/index-f043ca97.js +0 -2
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -2
- package/dist/collection/components/analog-clock/analog-clock.js +0 -1
- package/dist/collection/index.js +0 -1
- package/dist/components/analog-clock.js +0 -2
- package/dist/components/index.js +0 -2
- package/dist/esm/analog-clock.entry.js +0 -2
- package/dist/esm/analog-clock.js +0 -2
- package/dist/esm/index-ea114e78.js +0 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/loader.js +0 -2
- package/package.json +1 -1
- package/dist/analog-clock/analog-clock.esm.js.map +0 -1
- package/dist/analog-clock/index.esm.js.map +0 -1
- package/dist/analog-clock/p-2690ab1a.entry.js +0 -2
- package/dist/analog-clock/p-2690ab1a.entry.js.map +0 -1
- package/dist/analog-clock/p-d5ea3495.js.map +0 -1
- package/dist/cjs/analog-clock.cjs.entry.js.map +0 -1
- package/dist/cjs/analog-clock.cjs.js.map +0 -1
- package/dist/cjs/index-f043ca97.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/collection/components/analog-clock/analog-clock.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/components/analog-clock.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/esm/analog-clock.entry.js.map +0 -1
- package/dist/esm/analog-clock.js.map +0 -1
- package/dist/esm/index-ea114e78.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-d5ea3495.js";export{s as setNonce}from"./p-d5ea3495.js";
|
|
2
|
-
//# sourceMappingURL=analog-clock.esm.js.map
|
|
1
|
+
import{p as e,b as o}from"./p-d5ea3495.js";export{s as setNonce}from"./p-d5ea3495.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),e(s)})().then((e=>o([["p-70e2f846",[[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-d5ea3495.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}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
3
|
-
//# sourceMappingURL=p-d5ea3495.js.map
|
|
1
|
+
let t,n,e=!1,l=!1;const o={},s=t=>"object"==(t=typeof t)||"function"===t;function c(t){var n,e,l;return null!==(l=null===(e=null===(n=t.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.getAttribute("content"))&&void 0!==l?l:void 0}const r=(t,n,...e)=>{let l=null,o=!1,c=!1;const r=[],u=n=>{for(let e=0;e<n.length;e++)l=n[e],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof t&&!s(l))&&(l+=""),o&&c?r[r.length-1].t+=l:r.push(o?i(null,l):l),c=o)};if(u(e),n){const t=n.className||n.class;t&&(n.class="object"!=typeof t?t:Object.keys(t).filter((n=>t[n])).join(" "))}const a=i(t,null);return a.l=n,r.length>0&&(a.o=r),a},i=(t,n)=>({i:0,u:t,t:n,h:null,o:null,l:null}),u={},a=new WeakMap,f=t=>"sc-"+t.p,d=(t,n,e,l,o,c)=>{if(e!==l){let r=W(t,n);if(n.toLowerCase(),"class"===n){const n=t.classList,o=p(e),s=p(l);n.remove(...o.filter((t=>t&&!s.includes(t)))),n.add(...s.filter((t=>t&&!o.includes(t))))}else{const i=s(l);if((r||i&&null!==l)&&!o)try{if(t.tagName.includes("-"))t[n]=l;else{const o=null==l?"":l;"list"===n?r=!1:null!=e&&t[n]==o||(t[n]=o)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(n)||t.removeAttribute(n):(!r||4&c||o)&&!i&&t.setAttribute(n,l=!0===l?"":l)}}},h=/\s/,p=t=>t?t.split(h):[],$=(t,n,e,l)=>{const s=11===n.h.nodeType&&n.h.host?n.h.host:n.h,c=t&&t.l||o,r=n.l||o;for(l in c)l in r||d(s,l,c[l],void 0,e,n.i);for(l in r)d(s,l,c[l],r[l],e,n.i)},m=(n,l,o)=>{const s=l.o[o];let c,r,i=0;if(e||(e="svg"===s.u),c=s.h=z.createElementNS(e?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.u),e&&"foreignObject"===s.u&&(e=!1),$(null,s,e),null!=t&&c["s-si"]!==t&&c.classList.add(c["s-si"]=t),s.o)for(i=0;i<s.o.length;++i)r=m(n,s,i),r&&c.appendChild(r);return"svg"===s.u?e=!1:"foreignObject"===c.tagName&&(e=!0),c},y=(t,e,l,o,s,c)=>{let r,i=t;for(i.shadowRoot&&i.tagName===n&&(i=i.shadowRoot);s<=c;++s)o[s]&&(r=m(null,l,s),r&&(o[s].h=r,i.insertBefore(r,e)))},w=(t,n,e,l)=>{for(;n<=e;++n)(l=t[n])&&l.h.remove()},b=(t,n)=>t.u===n.u,v=(t,n)=>{const l=n.h=t.h,o=t.o,s=n.o,c=n.u;e="svg"===c||"foreignObject"!==c&&e,$(t,n,e),null!==o&&null!==s?((t,n,e,l)=>{let o,s=0,c=0,r=n.length-1,i=n[0],u=n[r],a=l.length-1,f=l[0],d=l[a];for(;s<=r&&c<=a;)null==i?i=n[++s]:null==u?u=n[--r]:null==f?f=l[++c]:null==d?d=l[--a]:b(i,f)?(v(i,f),i=n[++s],f=l[++c]):b(u,d)?(v(u,d),u=n[--r],d=l[--a]):b(i,d)?(v(i,d),t.insertBefore(i.h,u.h.nextSibling),i=n[++s],d=l[--a]):b(u,f)?(v(u,f),t.insertBefore(u.h,i.h),u=n[--r],f=l[++c]):(o=m(n&&n[c],e,c),f=l[++c],o&&i.h.parentNode.insertBefore(o,i.h));s>r?y(t,null==l[a+1]?null:l[a+1].h,e,l,c,a):c>a&&w(n,s,r)})(l,o,n,s):null!==s?y(l,null,n,s,0,s.length-1):null!==o&&w(o,0,o.length-1),e&&"svg"===c&&(e=!1)},g=(t,n)=>{n&&!t.$&&n["s-p"]&&n["s-p"].push(new Promise((n=>t.$=n)))},S=(t,n)=>{if(t.i|=16,!(4&t.i))return g(t,t.m),tt((()=>j(t,n)));t.i|=512},j=(t,n)=>{const e=t.v;return P(void 0,(()=>O(t,e,n)))},O=async(t,n,e)=>{const l=t.g,o=l["s-rc"];e&&(t=>{const n=t.S,e=t.g,l=n.i,o=((t,n)=>{var e;let l=f(n);const o=V.get(l);if(t=11===t.nodeType?t:z,o)if("string"==typeof o){let n,s=a.get(t=t.head||t);if(s||a.set(t,s=new Set),!s.has(l)){{n=z.createElement("style"),n.innerHTML=o;const l=null!==(e=B.j)&&void 0!==e?e:c(z);null!=l&&n.setAttribute("nonce",l),t.insertBefore(n,t.querySelector("link"))}s&&s.add(l)}}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,o]);return l})(e.shadowRoot?e.shadowRoot:e.getRootNode(),n);10&l&&(e["s-sc"]=o,e.classList.add(o+"-h"))})(t);k(t,n),o&&(o.map((t=>t())),l["s-rc"]=void 0);{const n=l["s-p"],e=()=>M(t);0===n.length?e():(Promise.all(n).then(e),t.i|=4,n.length=0)}},k=(e,l)=>{try{l=l.render(),e.i&=-17,e.i|=2,((e,l)=>{const o=e.g,s=e.O||i(null,null),c=(t=>t&&t.u===u)(l)?l:r(null,null,l);n=o.tagName,c.u=null,c.i|=4,e.O=c,c.h=s.h=o.shadowRoot||o,t=o["s-sc"],v(s,c)})(e,l)}catch(t){q(t,e.g)}return null},M=t=>{const n=t.g,e=t.v,l=t.m;64&t.i||(t.i|=64,E(n),x(e,"componentDidLoad"),t.k(n),l||C()),t.$&&(t.$(),t.$=void 0),512&t.i&&Z((()=>S(t,!1))),t.i&=-517},C=()=>{E(z.documentElement),Z((()=>(t=>{const n=B.ce("appload",{detail:{namespace:"analog-clock"}});return t.dispatchEvent(n),n})(_)))},x=(t,n,e)=>{if(t&&t[n])try{return t[n](e)}catch(t){q(t)}},P=(t,n)=>t&&t.then?t.then(n):n(),E=t=>t.classList.add("hydrated"),L=(t,n,e)=>{if(n.M){const l=Object.entries(n.M),o=t.prototype;if(l.map((([t,[l]])=>{(31&l||2&e&&32&l)&&Object.defineProperty(o,t,{get(){return((t,n)=>F(this).C.get(n))(0,t)},set(e){((t,n,e,l)=>{const o=F(t),c=o.C.get(n),r=o.i,i=o.v;e=((t,n)=>null==t||s(t)?t:2&n?parseFloat(t):t)(e,l.M[n][0]),8&r&&void 0!==c||e===c||Number.isNaN(c)&&Number.isNaN(e)||(o.C.set(n,e),i&&2==(18&r)&&S(o,!1))})(this,t,e,n)},configurable:!0,enumerable:!0})})),1&e){const n=new Map;o.attributeChangedCallback=function(t,e,l){B.jmp((()=>{const e=n.get(t);if(this.hasOwnProperty(e))l=this[e],delete this[e];else if(o.hasOwnProperty(e)&&"number"==typeof this[e]&&this[e]==l)return;this[e]=(null!==l||"boolean"!=typeof this[e])&&l}))},t.observedAttributes=l.filter((([t,n])=>15&n[0])).map((([t,e])=>{const l=e[1]||t;return n.set(l,t),l}))}}return t},N=(t,n={})=>{var e;const l=[],o=n.exclude||[],s=_.customElements,r=z.head,i=r.querySelector("meta[charset]"),u=z.createElement("style"),a=[];let d,h=!0;Object.assign(B,n),B.P=new URL(n.resourcesUrl||"./",z.baseURI).href,t.map((t=>{t[1].map((n=>{const e={i:n[0],p:n[1],M:n[2],L:n[3]};e.M=n[2];const c=e.p,r=class extends HTMLElement{constructor(t){super(t),U(t=this,e),1&e.i&&t.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),h?a.push(this):B.jmp((()=>(t=>{if(0==(1&B.i)){const n=F(t),e=n.S,l=()=>{};if(!(1&n.i)){n.i|=1;{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){g(n,n.m=e);break}}e.M&&Object.entries(e.M).map((([n,[e]])=>{if(31&e&&t.hasOwnProperty(n)){const e=t[n];delete t[n],t[n]=e}})),(async(t,n,e,l,o)=>{if(0==(32&n.i)){{if(n.i|=32,(o=H(e)).then){const t=()=>{};o=await o,t()}o.isProxied||(L(o,e,2),o.isProxied=!0);const t=()=>{};n.i|=8;try{new o(n)}catch(t){q(t)}n.i&=-9,t()}if(o.style){let t=o.style;const n=f(e);if(!V.has(n)){const l=()=>{};((t,n,e)=>{let l=V.get(t);I&&e?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,V.set(t,l)})(n,t,!!(1&e.i)),l()}}}const s=n.m,c=()=>S(n,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,n,e)}l()}})(this)))}disconnectedCallback(){B.jmp((()=>(()=>{0==(1&B.i)&&x(F(this).v,"disconnectedCallback")})()))}componentOnReady(){return F(this).N}};e.T=t[0],o.includes(c)||s.get(c)||(l.push(c),s.define(c,L(r,e,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const t=null!==(e=B.j)&&void 0!==e?e:c(z);null!=t&&u.setAttribute("nonce",t),r.insertBefore(u,i?i.nextSibling:r.firstChild)}h=!1,a.length?a.map((t=>t.connectedCallback())):B.jmp((()=>d=setTimeout(C,30)))},T=t=>B.j=t,A=new WeakMap,F=t=>A.get(t),R=(t,n)=>A.set(n.v=t,n),U=(t,n)=>{const e={i:0,g:t,S:n,C:new Map};return e.N=new Promise((t=>e.k=t)),t["s-p"]=[],t["s-rc"]=[],A.set(t,e)},W=(t,n)=>n in t,q=(t,n)=>(0,console.error)(t,n),D=new Map,H=t=>{const n=t.p.replace(/-/g,"_"),e=t.T,l=D.get(e);return l?l[n]:import(`./${e}.entry.js`).then((t=>(D.set(e,t),t[n])),q)
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},V=new Map,_="undefined"!=typeof window?window:{},z=_.document||{head:{}},B={i:0,P:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,l)=>t.addEventListener(n,e,l),rel:(t,n,e,l)=>t.removeEventListener(n,e,l),ce:(t,n)=>new CustomEvent(t,n)},G=t=>Promise.resolve(t),I=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),J=[],K=[],Q=(t,n)=>e=>{t.push(e),l||(l=!0,n&&4&B.i?Z(Y):B.raf(Y))},X=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(t){q(t)}t.length=0},Y=()=>{X(J),X(K),(l=J.length>0)&&B.raf(Y)},Z=t=>G().then(t),tt=Q(K,!0);export{N as b,r as h,G as p,R as r,T as s}
|
package/dist/cjs/index.cjs.js
CHANGED
package/dist/cjs/loader.cjs.js
CHANGED
package/dist/collection/index.js
CHANGED
package/dist/components/index.js
CHANGED
package/dist/esm/analog-clock.js
CHANGED
|
@@ -1339,5 +1339,3 @@ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
|
1339
1339
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1340
1340
|
|
|
1341
1341
|
export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1342
|
-
|
|
1343
|
-
//# sourceMappingURL=index-ea114e78.js.map
|
package/dist/esm/index.js
CHANGED
package/dist/esm/loader.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","import","meta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","size","timeZone","time"],"sources":["./node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.0.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAmBA,MAAMA,EAAe,KAkCjB,MAAMC,EAAaC,OAAOC,KAAKC,IAC/B,MAAMC,EAA6D,GAiBnE,GAAuBJ,IAAe,GAAI,CACtCI,EAAKC,aAAe,IAAIC,IAAI,IAAKN,GAAYO,IAGrD,CAcI,OAAOC,EAAeJ,EAAK,ECrF/BL,IAAeU,MAAKC,GAEXC,EAAc,kCAA8B,CAAAC,KAAS,IAAAC,SAAA,gBAAAC,KAAA,UAAAJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-d5ea3495.js";const r=".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)}";const o=class{constructor(e){t(this,e);this.size=undefined;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)+t*30}minuteToDegrees(){return Math.floor(this.second/10)+this.minute*6}secondToDegrees(){return this.second*6}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"}))}};o.style=r;export{o as analog_clock};
|
|
2
|
-
//# sourceMappingURL=p-2690ab1a.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["analogClockCss","AnalogClock","undefined","Date","now","componentDidLoad","this","timer","window","setInterval","time","disconnectedCallback","clearInterval","hour","getHours","minute","getMinutes","second","getSeconds","hourToDegrees","timeZone","Math","floor","minuteToDegrees","secondToDegrees","render","h","class","viewBox","width","size","height","id","cx","cy","r","fill","transform","x1","y1","x2","y2"],"sources":["./src/components/analog-clock/analog-clock.css?tag=analog-clock&encapsulation=shadow","./src/components/analog-clock/analog-clock.tsx"],"sourcesContent":[".clock #circle {\n stroke: var(--clock-circle-color, black);\n}\n.clock #hour {\n stroke: var(--clock-hour-color, black);\n}\n.clock #minute {\n stroke: var(--clock-minute-color, black);\n}\n.clock #second {\n stroke: var(--clock-second-color, black);\n}\n","import { Component, Prop, State, h } from '@stencil/core';\n\n@Component({\n tag: 'analog-clock',\n styleUrl: 'analog-clock.css',\n shadow: true,\n})\nexport class AnalogClock {\n @Prop() size: number = undefined;\n @Prop({ attribute: 'time-zone' }) timeZone: number = 0;\n\n timer: number;\n\n @State() time: number = Date.now();\n\n componentDidLoad() {\n this.timer = window.setInterval(() => {\n this.time = Date.now();\n }, 250);\n }\n\n disconnectedCallback() {\n clearInterval(this.timer);\n }\n\n get hour(): number {\n return new Date(this.time).getHours();\n }\n\n get minute(): number {\n return new Date(this.time).getMinutes();\n }\n\n get second(): number {\n return new Date(this.time).getSeconds();\n }\n\n hourToDegrees(): number {\n const hour = this.hour + this.timeZone;\n return Math.floor(this.minute / 2) + hour * 30;\n }\n\n minuteToDegrees(): number {\n return Math.floor(this.second / 10) + this.minute * 6;\n }\n\n secondToDegrees(): number {\n return this.second * 6;\n }\n\n render() {\n return (\n <svg class=\"clock\" viewBox=\"0 0 200 200\" width={this.size} height={this.size}>\n <circle id=\"circle\" cx=\"100\" cy=\"100\" r=\"95\" stroke-width=\"10\" fill=\"transparent\" />\n <line id=\"hour\" transform={`rotate(${this.hourToDegrees()}, 100, 100)`} x1=\"100\" y1=\"100\" x2=\"100\" y2=\"60\" stroke-width=\"10\" stroke-linecap=\"round\" />\n <line id=\"minute\" transform={`rotate(${this.minuteToDegrees()}, 100, 100)`} x1=\"100\" y1=\"100\" x2=\"100\" y2=\"30\" stroke-width=\"8\" stroke-linecap=\"round\" />\n <line id=\"second\" transform={`rotate(${this.secondToDegrees()}, 100, 100)`} x1=\"100\" y1=\"100\" x2=\"100\" y2=\"20\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n );\n }\n}\n"],"mappings":"2CAAA,MAAMA,EAAiB,2N,MCOVC,EAAW,M,mCACCC,U,cAC8B,E,UAI7BC,KAAKC,K,CAE7BC,mBACEC,KAAKC,MAAQC,OAAOC,aAAY,KAC9BH,KAAKI,KAAOP,KAAKC,KAAK,GACrB,I,CAGLO,uBACEC,cAAcN,KAAKC,M,CAGjBM,WACF,OAAO,IAAIV,KAAKG,KAAKI,MAAMI,U,CAGzBC,aACF,OAAO,IAAIZ,KAAKG,KAAKI,MAAMM,Y,CAGzBC,aACF,OAAO,IAAId,KAAKG,KAAKI,MAAMQ,Y,CAG7BC,gBACE,MAAMN,EAAOP,KAAKO,KAAOP,KAAKc,SAC9B,OAAOC,KAAKC,MAAMhB,KAAKS,OAAS,GAAKF,EAAO,E,CAG9CU,kBACE,OAAOF,KAAKC,MAAMhB,KAAKW,OAAS,IAAMX,KAAKS,OAAS,C,CAGtDS,kBACE,OAAOlB,KAAKW,OAAS,C,CAGvBQ,SACE,OACEC,EAAA,OAAKC,MAAM,QAAQC,QAAQ,cAAcC,MAAOvB,KAAKwB,KAAMC,OAAQzB,KAAKwB,MACtEJ,EAAA,UAAQM,GAAG,SAASC,GAAG,MAAMC,GAAG,MAAMC,EAAE,KAAI,eAAc,KAAKC,KAAK,gBACpEV,EAAA,QAAMM,GAAG,OAAOK,UAAW,UAAU/B,KAAKa,6BAA8BmB,GAAG,MAAMC,GAAG,MAAMC,GAAG,MAAMC,GAAG,KAAI,eAAc,KAAI,iBAAgB,UAC5If,EAAA,QAAMM,GAAG,SAASK,UAAW,UAAU/B,KAAKiB,+BAAgCe,GAAG,MAAMC,GAAG,MAAMC,GAAG,MAAMC,GAAG,KAAI,eAAc,IAAG,iBAAgB,UAC/If,EAAA,QAAMM,GAAG,SAASK,UAAW,UAAU/B,KAAKkB,+BAAgCc,GAAG,MAAMC,GAAG,MAAMC,GAAG,MAAMC,GAAG,KAAI,eAAc,IAAG,iBAAgB,U"}
|