analog-clock-components 0.1.437 → 0.1.438
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-0b754207.js → p-d42c2abd.js} +1 -1
- package/dist/analog-clock/{p-800f3a35.entry.js → p-fa8b2fd2.entry.js} +1 -1
- package/dist/cjs/analog-clock.cjs.entry.js +37 -37
- package/dist/cjs/analog-clock.cjs.js +2 -2
- package/dist/cjs/{index-ecb43150.js → index-699c95ef.js} +15 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/analog-clock/analog-clock.js +92 -92
- package/dist/components/analog-clock.d.ts +2 -2
- package/dist/components/analog-clock.js +54 -54
- package/dist/esm/analog-clock.entry.js +37 -37
- package/dist/esm/analog-clock.js +3 -3
- package/dist/esm/{index-bd835014.js → index-32d5627e.js} +15 -4
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/analog-clock/analog-clock.d.ts +13 -13
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-
|
|
1
|
+
import{p as e,b as o}from"./p-d42c2abd.js";export{s as setNonce}from"./p-d42c2abd.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-fa8b2fd2",[[1,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],e)));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let n,t,e=!1,l=!1;const o="slot-fb{display:contents}slot-fb[hidden]{display:none}",s={},i=n=>"object"==(n=typeof n)||"function"===n;function c(n){var t,e,l;return null!==(l=null===(e=null===(t=n.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.getAttribute("content"))&&void 0!==l?l:void 0}const r=(n,t,...e)=>{let l=null,o=!1,s=!1;const c=[],r=t=>{for(let e=0;e<t.length;e++)l=t[e],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof n&&!i(l))&&(l+=""),o&&s?c[c.length-1].t+=l:c.push(o?u(null,l):l),s=o)};if(r(e),t){const n=t.className||t.class;n&&(t.class="object"!=typeof n?n:Object.keys(n).filter((t=>n[t])).join(" "))}const a=u(n,null);return a.l=t,c.length>0&&(a.o=c),a},u=(n,t)=>({i:0,u:n,t,h:null,o:null,l:null}),a={},f=new WeakMap,d=n=>"sc-"+n.p,y=(n,t,e,l,o,s)=>{if(e!==l){let c=H(n,t);if(t.toLowerCase(),"class"===t){const t=n.classList,o=p(e),s=p(l);t.remove(...o.filter((n=>n&&!s.includes(n)))),t.add(...s.filter((n=>n&&!o.includes(n))))}else{const r=i(l);if((c||r&&null!==l)&&!o)try{if(n.tagName.includes("-"))n[t]=l;else{const o=null==l?"":l;"list"===t?c=!1:null!=e&&n[t]==o||(n[t]=o)}}catch(n){}null==l||!1===l?!1===l&&""!==n.getAttribute(t)||n.removeAttribute(t):(!c||4&s||o)&&!r&&n.setAttribute(t,l=!0===l?"":l)}}},h=/\s/,p=n=>n?n.split(h):[],v=(n,t,e,l)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,i=n&&n.l||s,c=t.l||s;for(l in i)l in c||y(o,l,i[l],void 0,e,t.i);for(l in c)y(o,l,i[l],c[l],e,t.i)},$=(t,l,o)=>{const s=l.o[o];let i,c,r=0;if(e||(e="svg"===s.u),i=s.h=I.createElementNS(e?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.u),e&&"foreignObject"===s.u&&(e=!1),v(null,s,e),null!=n&&i["s-si"]!==n&&i.classList.add(i["s-si"]=n),s.o)for(r=0;r<s.o.length;++r)c=$(t,s,r),c&&i.appendChild(c);return"svg"===s.u?e=!1:"foreignObject"===i.tagName&&(e=!0),i},m=(n,e,l,o,s,i)=>{let c,r=n;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=$(null,l,s),c&&(o[s].h=c,r.insertBefore(c,e)))},b=(n,t,e)=>{for(let l=t;l<=e;++l){const t=n[l];if(t){const n=t.h;n&&n.remove()}}},w=(n,t)=>n.u===t.u,g=(n,t)=>{const l=t.h=n.h,o=n.o,s=t.o,i=t.u;e="svg"===i||"foreignObject"!==i&&e,v(n,t,e),null!==o&&null!==s?((n,t,e,l)=>{let o,s=0,i=0,c=t.length-1,r=t[0],u=t[c],a=l.length-1,f=l[0],d=l[a];for(;s<=c&&i<=a;)null==r?r=t[++s]:null==u?u=t[--c]:null==f?f=l[++i]:null==d?d=l[--a]:w(r,f)?(g(r,f),r=t[++s],f=l[++i]):w(u,d)?(g(u,d),u=t[--c],d=l[--a]):w(r,d)?(g(r,d),n.insertBefore(r.h,u.h.nextSibling),r=t[++s],d=l[--a]):w(u,f)?(g(u,f),n.insertBefore(u.h,r.h),u=t[--c],f=l[++i]):(o=$(t&&t[i],e,i),f=l[++i],o&&r.h.parentNode.insertBefore(o,r.h));s>c?m(n,null==l[a+1]?null:l[a+1].h,e,l,i,a):i>a&&b(t,s,c)})(l,o,t,s):null!==s?m(l,null,t,s,0,s.length-1):null!==o&&b(o,0,o.length-1),e&&"svg"===i&&(e=!1)},j=(n,t)=>{t&&!n.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>n.v=t)))},S=(n,t)=>{if(n.i|=16,!(4&n.i))return j(n,n.$),ln((()=>O(n,t)));n.i|=512},O=(n,t)=>{const e=n.m;return k(void 0,(()=>C(n,e,t)))},k=(n,t)=>M(n)?n.then(t):t(),M=n=>n instanceof Promise||n&&n.then&&"function"==typeof n.then,C=async(n,t,e)=>{var l;const s=n.$hostElement$,i=s["s-rc"];e&&(n=>{const t=n.j,e=n.$hostElement$,l=t.i,s=((n,t)=>{var e;const l=d(t),s=B.get(l);if(n=11===n.nodeType?n:I,s)if("string"==typeof s){let i,r=f.get(n=n.head||n);if(r||f.set(n,r=new Set),!r.has(l)){{i=I.createElement("style"),i.innerHTML=s;const t=null!==(e=J.S)&&void 0!==e?e:c(I);null!=t&&i.setAttribute("nonce",t),n.insertBefore(i,n.querySelector("link"))}4&t.i&&(i.innerHTML+=o),r&&r.add(l)}}else n.adoptedStyleSheets.includes(s)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,s]);return l})(e.shadowRoot?e.shadowRoot:e.getRootNode(),t);10&l&&(e["s-sc"]=s,e.classList.add(s+"-h"))})(n);P(n,t,s,e),i&&(i.map((n=>n())),s["s-rc"]=void 0);{const t=null!==(l=s["s-p"])&&void 0!==l?l:[],e=()=>x(n);0===t.length?e():(Promise.all(t).then(e),n.i|=4,t.length=0)}},P=(e,l,o,s)=>{try{l=l.render(),e.i&=-17,e.i|=2,((e,l,o=!1)=>{const s=e.$hostElement$,i=e.O||u(null,null),c=(n=>n&&n.u===a)(l)?l:r(null,null,l);if(t=s.tagName,o&&c.l)for(const n of Object.keys(c.l))s.hasAttribute(n)&&!["key","ref","style","class"].includes(n)&&(c.l[n]=s[n]);c.u=null,c.i|=4,e.O=c,c.h=i.h=s.shadowRoot||s,n=s["s-sc"],g(i,c)})(e,l,s)}catch(n){V(n,e.$hostElement$)}return null},x=n=>{const t=n.$hostElement$,e=n.m,l=n.$;64&n.i||(n.i|=64,L(t),E(e,"componentDidLoad"),n.k(t),l||A()),n.v&&(n.v(),n.v=void 0),512&n.i&&en((()=>S(n,!1))),n.i&=-517},A=()=>{L(I.documentElement),en((()=>(n=>{const t=J.ce("appload",{detail:{namespace:"analog-clock"}});return n.dispatchEvent(t),t})(G)))},E=(n,t,e)=>{if(n&&n[t])try{return n[t](e)}catch(n){V(n)}},L=n=>n.classList.add("hydrated"),N=(n,t,e)=>{var l;if(t.M){const
|
|
1
|
+
let n,t,e=!1,l=!1;const o="slot-fb{display:contents}slot-fb[hidden]{display:none}",s={},i=n=>"object"==(n=typeof n)||"function"===n;function c(n){var t,e,l;return null!==(l=null===(e=null===(t=n.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.getAttribute("content"))&&void 0!==l?l:void 0}const r=(n,t,...e)=>{let l=null,o=!1,s=!1;const c=[],r=t=>{for(let e=0;e<t.length;e++)l=t[e],Array.isArray(l)?r(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof n&&!i(l))&&(l+=""),o&&s?c[c.length-1].t+=l:c.push(o?u(null,l):l),s=o)};if(r(e),t){const n=t.className||t.class;n&&(t.class="object"!=typeof n?n:Object.keys(n).filter((t=>n[t])).join(" "))}const a=u(n,null);return a.l=t,c.length>0&&(a.o=c),a},u=(n,t)=>({i:0,u:n,t,h:null,o:null,l:null}),a={},f=new WeakMap,d=n=>"sc-"+n.p,y=(n,t,e,l,o,s)=>{if(e!==l){let c=H(n,t);if(t.toLowerCase(),"class"===t){const t=n.classList,o=p(e),s=p(l);t.remove(...o.filter((n=>n&&!s.includes(n)))),t.add(...s.filter((n=>n&&!o.includes(n))))}else{const r=i(l);if((c||r&&null!==l)&&!o)try{if(n.tagName.includes("-"))n[t]=l;else{const o=null==l?"":l;"list"===t?c=!1:null!=e&&n[t]==o||(n[t]=o)}}catch(n){}null==l||!1===l?!1===l&&""!==n.getAttribute(t)||n.removeAttribute(t):(!c||4&s||o)&&!r&&n.setAttribute(t,l=!0===l?"":l)}}},h=/\s/,p=n=>n?n.split(h):[],v=(n,t,e,l)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,i=n&&n.l||s,c=t.l||s;for(l in i)l in c||y(o,l,i[l],void 0,e,t.i);for(l in c)y(o,l,i[l],c[l],e,t.i)},$=(t,l,o)=>{const s=l.o[o];let i,c,r=0;if(e||(e="svg"===s.u),i=s.h=I.createElementNS(e?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.u),e&&"foreignObject"===s.u&&(e=!1),v(null,s,e),null!=n&&i["s-si"]!==n&&i.classList.add(i["s-si"]=n),s.o)for(r=0;r<s.o.length;++r)c=$(t,s,r),c&&i.appendChild(c);return"svg"===s.u?e=!1:"foreignObject"===i.tagName&&(e=!0),i},m=(n,e,l,o,s,i)=>{let c,r=n;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=$(null,l,s),c&&(o[s].h=c,r.insertBefore(c,e)))},b=(n,t,e)=>{for(let l=t;l<=e;++l){const t=n[l];if(t){const n=t.h;n&&n.remove()}}},w=(n,t)=>n.u===t.u,g=(n,t)=>{const l=t.h=n.h,o=n.o,s=t.o,i=t.u;e="svg"===i||"foreignObject"!==i&&e,v(n,t,e),null!==o&&null!==s?((n,t,e,l)=>{let o,s=0,i=0,c=t.length-1,r=t[0],u=t[c],a=l.length-1,f=l[0],d=l[a];for(;s<=c&&i<=a;)null==r?r=t[++s]:null==u?u=t[--c]:null==f?f=l[++i]:null==d?d=l[--a]:w(r,f)?(g(r,f),r=t[++s],f=l[++i]):w(u,d)?(g(u,d),u=t[--c],d=l[--a]):w(r,d)?(g(r,d),n.insertBefore(r.h,u.h.nextSibling),r=t[++s],d=l[--a]):w(u,f)?(g(u,f),n.insertBefore(u.h,r.h),u=t[--c],f=l[++i]):(o=$(t&&t[i],e,i),f=l[++i],o&&r.h.parentNode.insertBefore(o,r.h));s>c?m(n,null==l[a+1]?null:l[a+1].h,e,l,i,a):i>a&&b(t,s,c)})(l,o,t,s):null!==s?m(l,null,t,s,0,s.length-1):null!==o&&b(o,0,o.length-1),e&&"svg"===i&&(e=!1)},j=(n,t)=>{t&&!n.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>n.v=t)))},S=(n,t)=>{if(n.i|=16,!(4&n.i))return j(n,n.$),ln((()=>O(n,t)));n.i|=512},O=(n,t)=>{const e=n.m;return k(void 0,(()=>C(n,e,t)))},k=(n,t)=>M(n)?n.then(t):t(),M=n=>n instanceof Promise||n&&n.then&&"function"==typeof n.then,C=async(n,t,e)=>{var l;const s=n.$hostElement$,i=s["s-rc"];e&&(n=>{const t=n.j,e=n.$hostElement$,l=t.i,s=((n,t)=>{var e;const l=d(t),s=B.get(l);if(n=11===n.nodeType?n:I,s)if("string"==typeof s){let i,r=f.get(n=n.head||n);if(r||f.set(n,r=new Set),!r.has(l)){{i=I.createElement("style"),i.innerHTML=s;const t=null!==(e=J.S)&&void 0!==e?e:c(I);null!=t&&i.setAttribute("nonce",t),n.insertBefore(i,n.querySelector("link"))}4&t.i&&(i.innerHTML+=o),r&&r.add(l)}}else n.adoptedStyleSheets.includes(s)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,s]);return l})(e.shadowRoot?e.shadowRoot:e.getRootNode(),t);10&l&&(e["s-sc"]=s,e.classList.add(s+"-h"))})(n);P(n,t,s,e),i&&(i.map((n=>n())),s["s-rc"]=void 0);{const t=null!==(l=s["s-p"])&&void 0!==l?l:[],e=()=>x(n);0===t.length?e():(Promise.all(t).then(e),n.i|=4,t.length=0)}},P=(e,l,o,s)=>{try{l=l.render(),e.i&=-17,e.i|=2,((e,l,o=!1)=>{const s=e.$hostElement$,i=e.O||u(null,null),c=(n=>n&&n.u===a)(l)?l:r(null,null,l);if(t=s.tagName,o&&c.l)for(const n of Object.keys(c.l))s.hasAttribute(n)&&!["key","ref","style","class"].includes(n)&&(c.l[n]=s[n]);c.u=null,c.i|=4,e.O=c,c.h=i.h=s.shadowRoot||s,n=s["s-sc"],g(i,c)})(e,l,s)}catch(n){V(n,e.$hostElement$)}return null},x=n=>{const t=n.$hostElement$,e=n.m,l=n.$;64&n.i||(n.i|=64,L(t),E(e,"componentDidLoad"),n.k(t),l||A()),n.v&&(n.v(),n.v=void 0),512&n.i&&en((()=>S(n,!1))),n.i&=-517},A=()=>{L(I.documentElement),en((()=>(n=>{const t=J.ce("appload",{detail:{namespace:"analog-clock"}});return n.dispatchEvent(t),t})(G)))},E=(n,t,e)=>{if(n&&n[t])try{return n[t](e)}catch(n){V(n)}},L=n=>n.classList.add("hydrated"),N=(n,t,e)=>{var l;const o=n.prototype;if(t.M){const s=Object.entries(t.M);if(s.map((([n,[l]])=>{(31&l||2&e&&32&l)&&Object.defineProperty(o,n,{get(){return((n,t)=>W(this).C.get(t))(0,n)},set(e){((n,t,e,l)=>{const o=W(n),s=o.C.get(t),c=o.i,r=o.m;e=((n,t)=>null==n||i(n)?n:2&t?parseFloat(n):n)(e,l.M[t][0]),8&c&&void 0!==s||e===s||Number.isNaN(s)&&Number.isNaN(e)||(o.C.set(t,e),r&&2==(18&c)&&S(o,!1))})(this,n,e,t)},configurable:!0,enumerable:!0})})),1&e){const e=new Map;o.attributeChangedCallback=function(n,l,s){J.jmp((()=>{var i;const c=e.get(n);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(o.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const e=W(this),o=null==e?void 0:e.i;if(o&&!(8&o)&&128&o&&s!==l){const o=e.m,c=null===(i=t.P)||void 0===i?void 0:i[n];null==c||c.forEach((t=>{null!=o[t]&&o[t].call(o,s,l,n)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},n.observedAttributes=Array.from(new Set([...Object.keys(null!==(l=t.P)&&void 0!==l?l:{}),...s.filter((([n,t])=>15&t[0])).map((([n,t])=>{const l=t[1]||n;return e.set(l,n),l}))]))}}return n},T=n=>{E(n,"disconnectedCallback")},F=(n,t={})=>{var e;const l=[],s=t.exclude||[],i=G.customElements,r=I.head,u=r.querySelector("meta[charset]"),a=I.createElement("style"),f=[];let y,h=!0;Object.assign(J,t),J.A=new URL(t.resourcesUrl||"./",I.baseURI).href;let p=!1;if(n.map((n=>{n[1].map((t=>{const e={i:t[0],p:t[1],M:t[2],L:t[3]};4&e.i&&(p=!0),e.M=t[2];const o=e.p,c=class extends HTMLElement{constructor(n){super(n),D(n=this,e),1&e.i&&n.attachShadow({mode:"open"})}connectedCallback(){y&&(clearTimeout(y),y=null),h?f.push(this):J.jmp((()=>(n=>{if(0==(1&J.i)){const t=W(n),e=t.j,l=()=>{};if(1&t.i)(null==t?void 0:t.m)||(null==t?void 0:t.N)&&t.N.then((()=>{}));else{t.i|=1;{let e=n;for(;e=e.parentNode||e.host;)if(e["s-p"]){j(t,t.$=e);break}}e.M&&Object.entries(e.M).map((([t,[e]])=>{if(31&e&&n.hasOwnProperty(t)){const e=n[t];delete n[t],n[t]=e}})),(async(n,t,e)=>{let l;if(0==(32&t.i)){t.i|=32;{if(l=z(e),l.then){const n=()=>{};l=await l,n()}l.isProxied||(N(l,e,2),l.isProxied=!0);const n=()=>{};t.i|=8;try{new l(t)}catch(n){V(n)}t.i&=-9,n()}if(l.style){let n=l.style;const t=d(e);if(!B.has(t)){const l=()=>{};((n,t,e)=>{let l=B.get(n);Q&&e?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,B.set(n,l)})(t,n,!!(1&e.i)),l()}}}const o=t.$,s=()=>S(t,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()})(0,t,e)}l()}})(this)))}disconnectedCallback(){J.jmp((()=>(async()=>{if(0==(1&J.i)){const n=W(this);(null==n?void 0:n.m)?T(n.m):(null==n?void 0:n.N)&&n.N.then((()=>T(n.m)))}})()))}componentOnReady(){return W(this).N}};e.T=n[0],s.includes(o)||i.get(o)||(l.push(o),i.define(o,N(c,e,1)))}))})),p&&(a.innerHTML+=o),a.innerHTML+=l+"{visibility:hidden}.hydrated{visibility:inherit}",a.innerHTML.length){a.setAttribute("data-styles",""),r.insertBefore(a,u?u.nextSibling:r.firstChild);const n=null!==(e=J.S)&&void 0!==e?e:c(I);null!=n&&a.setAttribute("nonce",n)}h=!1,f.length?f.map((n=>n.connectedCallback())):J.jmp((()=>y=setTimeout(A,30)))},R=n=>J.S=n,U=new WeakMap,W=n=>U.get(n),q=(n,t)=>U.set(t.m=n,t),D=(n,t)=>{const e={i:0,$hostElement$:n,j:t,C:new Map};return e.N=new Promise((n=>e.k=n)),n["s-p"]=[],n["s-rc"]=[],U.set(n,e)},H=(n,t)=>t in n,V=(n,t)=>(0,console.error)(n,t),_=new Map,z=n=>{const t=n.p.replace(/-/g,"_"),e=n.T,l=_.get(e);return l?l[t]:import(`./${e}.entry.js`).then((n=>(_.set(e,n),n[t])),V)
|
|
2
2
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},B=new Map,G="undefined"!=typeof window?window:{},I=G.document||{head:{}},J={i:0,A:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,t,e,l)=>n.addEventListener(t,e,l),rel:(n,t,e,l)=>n.removeEventListener(t,e,l),ce:(n,t)=>new CustomEvent(n,t)},K=n=>Promise.resolve(n),Q=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(n){}return!1})(),X=[],Y=[],Z=(n,t)=>e=>{n.push(e),l||(l=!0,t&&4&J.i?en(tn):J.raf(tn))},nn=n=>{for(let t=0;t<n.length;t++)try{n[t](performance.now())}catch(n){V(n)}n.length=0},tn=()=>{nn(X),nn(Y),(l=X.length>0)&&J.raf(tn)},en=n=>K().then(n),ln=Z(Y,!0);export{F as b,r as h,K as p,q as r,R as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-
|
|
1
|
+
import{r as t,h as e}from"./p-d42c2abd.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}
|
|
@@ -2,47 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-699c95ef.js');
|
|
6
6
|
|
|
7
7
|
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)}";
|
|
8
8
|
|
|
9
9
|
const AnalogClock = class {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
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 (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" })));
|
|
45
|
+
}
|
|
46
46
|
};
|
|
47
47
|
AnalogClock.style = analogClockCss;
|
|
48
48
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-699c95ef.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.
|
|
8
|
+
Stencil Client Patch Browser v4.8.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchBrowser = () => {
|
|
11
11
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('analog-clock.cjs.js', document.baseURI).href));
|
|
@@ -362,7 +362,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
362
362
|
elm[memberName] = newValue;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
catch (e) {
|
|
365
|
+
catch (e) {
|
|
366
|
+
/**
|
|
367
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
368
|
+
*/
|
|
369
|
+
}
|
|
366
370
|
}
|
|
367
371
|
if (newValue == null || newValue === false) {
|
|
368
372
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
@@ -381,6 +385,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
381
385
|
}
|
|
382
386
|
};
|
|
383
387
|
const parseClassListRegex = /\s/;
|
|
388
|
+
/**
|
|
389
|
+
* Parsed a string of classnames into an array
|
|
390
|
+
* @param value className string, e.g. "foo bar baz"
|
|
391
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
392
|
+
*/
|
|
384
393
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
385
394
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
386
395
|
// if the element passed in is a shadow root, which is a document fragment
|
|
@@ -1088,10 +1097,10 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1088
1097
|
*/
|
|
1089
1098
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1090
1099
|
var _a;
|
|
1100
|
+
const prototype = Cstr.prototype;
|
|
1091
1101
|
if (cmpMeta.$members$) {
|
|
1092
1102
|
// It's better to have a const than two Object.entries()
|
|
1093
1103
|
const members = Object.entries(cmpMeta.$members$);
|
|
1094
|
-
const prototype = Cstr.prototype;
|
|
1095
1104
|
members.map(([memberName, [memberFlags]]) => {
|
|
1096
1105
|
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1097
1106
|
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
@@ -1114,6 +1123,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1114
1123
|
const attrNameToPropName = new Map();
|
|
1115
1124
|
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1116
1125
|
plt.jmp(() => {
|
|
1126
|
+
var _a;
|
|
1117
1127
|
const propName = attrNameToPropName.get(attrName);
|
|
1118
1128
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1119
1129
|
// in the case where an attribute was set inline.
|
|
@@ -1169,11 +1179,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1169
1179
|
// 1. The instance is ready
|
|
1170
1180
|
// 2. The watchers are ready
|
|
1171
1181
|
// 3. The value has changed
|
|
1172
|
-
if (
|
|
1182
|
+
if (flags &&
|
|
1183
|
+
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1173
1184
|
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1174
1185
|
newValue !== oldValue) {
|
|
1175
1186
|
const instance = hostRef.$lazyInstance$ ;
|
|
1176
|
-
const entry = cmpMeta.$watchers$[attrName];
|
|
1187
|
+
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
1177
1188
|
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1178
1189
|
if (instance[callbackName] != null) {
|
|
1179
1190
|
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-699c95ef.js');
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
@@ -1,95 +1,95 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export class AnalogClock {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
3
|
+
constructor() {
|
|
4
|
+
this.size = undefined;
|
|
5
|
+
this.timeZone = 0;
|
|
6
|
+
this.time = Date.now();
|
|
7
|
+
}
|
|
8
|
+
componentDidLoad() {
|
|
9
|
+
this.timer = window.setInterval(() => {
|
|
10
|
+
this.time = Date.now();
|
|
11
|
+
}, 250);
|
|
12
|
+
}
|
|
13
|
+
disconnectedCallback() {
|
|
14
|
+
clearInterval(this.timer);
|
|
15
|
+
}
|
|
16
|
+
get hour() {
|
|
17
|
+
return new Date(this.time).getHours();
|
|
18
|
+
}
|
|
19
|
+
get minute() {
|
|
20
|
+
return new Date(this.time).getMinutes();
|
|
21
|
+
}
|
|
22
|
+
get second() {
|
|
23
|
+
return new Date(this.time).getSeconds();
|
|
24
|
+
}
|
|
25
|
+
hourToDegrees() {
|
|
26
|
+
const hour = this.hour + this.timeZone;
|
|
27
|
+
return Math.floor(this.minute / 2) + hour * 30;
|
|
28
|
+
}
|
|
29
|
+
minuteToDegrees() {
|
|
30
|
+
return Math.floor(this.second / 10) + this.minute * 6;
|
|
31
|
+
}
|
|
32
|
+
secondToDegrees() {
|
|
33
|
+
return this.second * 6;
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
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" })));
|
|
37
|
+
}
|
|
38
|
+
static get is() { return "analog-clock"; }
|
|
39
|
+
static get encapsulation() { return "shadow"; }
|
|
40
|
+
static get originalStyleUrls() {
|
|
41
|
+
return {
|
|
42
|
+
"$": ["analog-clock.css"]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static get styleUrls() {
|
|
46
|
+
return {
|
|
47
|
+
"$": ["analog-clock.css"]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
static get properties() {
|
|
51
|
+
return {
|
|
52
|
+
"size": {
|
|
53
|
+
"type": "number",
|
|
54
|
+
"mutable": false,
|
|
55
|
+
"complexType": {
|
|
56
|
+
"original": "number",
|
|
57
|
+
"resolved": "number",
|
|
58
|
+
"references": {}
|
|
59
|
+
},
|
|
60
|
+
"required": false,
|
|
61
|
+
"optional": false,
|
|
62
|
+
"docs": {
|
|
63
|
+
"tags": [],
|
|
64
|
+
"text": ""
|
|
65
|
+
},
|
|
66
|
+
"attribute": "size",
|
|
67
|
+
"reflect": false,
|
|
68
|
+
"defaultValue": "undefined"
|
|
69
|
+
},
|
|
70
|
+
"timeZone": {
|
|
71
|
+
"type": "number",
|
|
72
|
+
"mutable": false,
|
|
73
|
+
"complexType": {
|
|
74
|
+
"original": "number",
|
|
75
|
+
"resolved": "number",
|
|
76
|
+
"references": {}
|
|
77
|
+
},
|
|
78
|
+
"required": false,
|
|
79
|
+
"optional": false,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": ""
|
|
83
|
+
},
|
|
84
|
+
"attribute": "time-zone",
|
|
85
|
+
"reflect": false,
|
|
86
|
+
"defaultValue": "0"
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static get states() {
|
|
91
|
+
return {
|
|
92
|
+
"time": {}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
95
|
}
|
|
@@ -2,8 +2,8 @@ import type { Components, JSX } from "../types/components";
|
|
|
2
2
|
|
|
3
3
|
interface AnalogClock extends Components.AnalogClock, HTMLElement {}
|
|
4
4
|
export const AnalogClock: {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
prototype: AnalogClock;
|
|
6
|
+
new (): AnalogClock;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -3,62 +3,62 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
|
|
|
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
|
|
|
5
5
|
const AnalogClock$1 = /*@__PURE__*/ proxyCustomElement(class AnalogClock extends HTMLElement {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.size = undefined;
|
|
11
|
+
this.timeZone = 0;
|
|
12
|
+
this.time = Date.now();
|
|
13
|
+
}
|
|
14
|
+
componentDidLoad() {
|
|
15
|
+
this.timer = window.setInterval(() => {
|
|
16
|
+
this.time = Date.now();
|
|
17
|
+
}, 250);
|
|
18
|
+
}
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
clearInterval(this.timer);
|
|
21
|
+
}
|
|
22
|
+
get hour() {
|
|
23
|
+
return new Date(this.time).getHours();
|
|
24
|
+
}
|
|
25
|
+
get minute() {
|
|
26
|
+
return new Date(this.time).getMinutes();
|
|
27
|
+
}
|
|
28
|
+
get second() {
|
|
29
|
+
return new Date(this.time).getSeconds();
|
|
30
|
+
}
|
|
31
|
+
hourToDegrees() {
|
|
32
|
+
const hour = this.hour + this.timeZone;
|
|
33
|
+
return Math.floor(this.minute / 2) + hour * 30;
|
|
34
|
+
}
|
|
35
|
+
minuteToDegrees() {
|
|
36
|
+
return Math.floor(this.second / 10) + this.minute * 6;
|
|
37
|
+
}
|
|
38
|
+
secondToDegrees() {
|
|
39
|
+
return this.second * 6;
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
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" })));
|
|
43
|
+
}
|
|
44
|
+
static get style() { return analogClockCss; }
|
|
45
45
|
}, [1, "analog-clock", {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
"size": [2],
|
|
47
|
+
"timeZone": [2, "time-zone"],
|
|
48
|
+
"time": [32]
|
|
49
|
+
}]);
|
|
50
50
|
function defineCustomElement$1() {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
if (typeof customElements === "undefined") {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const components = ["analog-clock"];
|
|
55
|
+
components.forEach(tagName => { switch (tagName) {
|
|
56
|
+
case "analog-clock":
|
|
57
|
+
if (!customElements.get(tagName)) {
|
|
58
|
+
customElements.define(tagName, AnalogClock$1);
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
} });
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
const AnalogClock = AnalogClock$1;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-32d5627e.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
|
|
|
5
5
|
const AnalogClock = class {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.size = undefined;
|
|
9
|
+
this.timeZone = 0;
|
|
10
|
+
this.time = Date.now();
|
|
11
|
+
}
|
|
12
|
+
componentDidLoad() {
|
|
13
|
+
this.timer = window.setInterval(() => {
|
|
14
|
+
this.time = Date.now();
|
|
15
|
+
}, 250);
|
|
16
|
+
}
|
|
17
|
+
disconnectedCallback() {
|
|
18
|
+
clearInterval(this.timer);
|
|
19
|
+
}
|
|
20
|
+
get hour() {
|
|
21
|
+
return new Date(this.time).getHours();
|
|
22
|
+
}
|
|
23
|
+
get minute() {
|
|
24
|
+
return new Date(this.time).getMinutes();
|
|
25
|
+
}
|
|
26
|
+
get second() {
|
|
27
|
+
return new Date(this.time).getSeconds();
|
|
28
|
+
}
|
|
29
|
+
hourToDegrees() {
|
|
30
|
+
const hour = this.hour + this.timeZone;
|
|
31
|
+
return Math.floor(this.minute / 2) + hour * 30;
|
|
32
|
+
}
|
|
33
|
+
minuteToDegrees() {
|
|
34
|
+
return Math.floor(this.second / 10) + this.minute * 6;
|
|
35
|
+
}
|
|
36
|
+
secondToDegrees() {
|
|
37
|
+
return this.second * 6;
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
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" })));
|
|
41
|
+
}
|
|
42
42
|
};
|
|
43
43
|
AnalogClock.style = analogClockCss;
|
|
44
44
|
|
package/dist/esm/analog-clock.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-32d5627e.js';
|
|
2
|
+
export { s as setNonce } from './index-32d5627e.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Patch Browser v4.
|
|
5
|
+
Stencil Client Patch Browser v4.8.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
const patchBrowser = () => {
|
|
8
8
|
const importMeta = import.meta.url;
|
|
@@ -340,7 +340,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
340
340
|
elm[memberName] = newValue;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
catch (e) {
|
|
343
|
+
catch (e) {
|
|
344
|
+
/**
|
|
345
|
+
* in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
|
|
346
|
+
*/
|
|
347
|
+
}
|
|
344
348
|
}
|
|
345
349
|
if (newValue == null || newValue === false) {
|
|
346
350
|
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
|
@@ -359,6 +363,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
359
363
|
}
|
|
360
364
|
};
|
|
361
365
|
const parseClassListRegex = /\s/;
|
|
366
|
+
/**
|
|
367
|
+
* Parsed a string of classnames into an array
|
|
368
|
+
* @param value className string, e.g. "foo bar baz"
|
|
369
|
+
* @returns list of classes, e.g. ["foo", "bar", "baz"]
|
|
370
|
+
*/
|
|
362
371
|
const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
|
|
363
372
|
const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
364
373
|
// if the element passed in is a shadow root, which is a document fragment
|
|
@@ -1066,10 +1075,10 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1066
1075
|
*/
|
|
1067
1076
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1068
1077
|
var _a;
|
|
1078
|
+
const prototype = Cstr.prototype;
|
|
1069
1079
|
if (cmpMeta.$members$) {
|
|
1070
1080
|
// It's better to have a const than two Object.entries()
|
|
1071
1081
|
const members = Object.entries(cmpMeta.$members$);
|
|
1072
|
-
const prototype = Cstr.prototype;
|
|
1073
1082
|
members.map(([memberName, [memberFlags]]) => {
|
|
1074
1083
|
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1075
1084
|
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
@@ -1092,6 +1101,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1092
1101
|
const attrNameToPropName = new Map();
|
|
1093
1102
|
prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
|
|
1094
1103
|
plt.jmp(() => {
|
|
1104
|
+
var _a;
|
|
1095
1105
|
const propName = attrNameToPropName.get(attrName);
|
|
1096
1106
|
// In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
|
|
1097
1107
|
// in the case where an attribute was set inline.
|
|
@@ -1147,11 +1157,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1147
1157
|
// 1. The instance is ready
|
|
1148
1158
|
// 2. The watchers are ready
|
|
1149
1159
|
// 3. The value has changed
|
|
1150
|
-
if (
|
|
1160
|
+
if (flags &&
|
|
1161
|
+
!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
|
|
1151
1162
|
flags & 128 /* HOST_FLAGS.isWatchReady */ &&
|
|
1152
1163
|
newValue !== oldValue) {
|
|
1153
1164
|
const instance = hostRef.$lazyInstance$ ;
|
|
1154
|
-
const entry = cmpMeta.$watchers$[attrName];
|
|
1165
|
+
const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
|
|
1155
1166
|
entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
|
|
1156
1167
|
if (instance[callbackName] != null) {
|
|
1157
1168
|
instance[callbackName].call(instance, newValue, oldValue, attrName);
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-32d5627e.js';
|
|
2
|
+
export { s as setNonce } from './index-32d5627e.js';
|
|
3
3
|
|
|
4
4
|
const defineCustomElements = (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare class AnalogClock {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
size: number;
|
|
3
|
+
timeZone: number;
|
|
4
|
+
timer: number;
|
|
5
|
+
time: number;
|
|
6
|
+
componentDidLoad(): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
get hour(): number;
|
|
9
|
+
get minute(): number;
|
|
10
|
+
get second(): number;
|
|
11
|
+
hourToDegrees(): number;
|
|
12
|
+
minuteToDegrees(): number;
|
|
13
|
+
secondToDegrees(): number;
|
|
14
|
+
render(): any;
|
|
15
15
|
}
|
|
@@ -810,6 +810,9 @@ export declare namespace JSXBase {
|
|
|
810
810
|
name?: string;
|
|
811
811
|
type?: string;
|
|
812
812
|
value?: string | string[] | number;
|
|
813
|
+
popoverTargetAction?: string;
|
|
814
|
+
popoverTargetElement?: Element | null;
|
|
815
|
+
popoverTarget?: string;
|
|
813
816
|
}
|
|
814
817
|
interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
815
818
|
height?: number | string;
|
|
@@ -971,6 +974,9 @@ export declare namespace JSXBase {
|
|
|
971
974
|
webkitdirectory?: boolean;
|
|
972
975
|
webkitEntries?: any;
|
|
973
976
|
width?: number | string;
|
|
977
|
+
popoverTargetAction?: string;
|
|
978
|
+
popoverTargetElement?: Element | null;
|
|
979
|
+
popoverTarget?: string;
|
|
974
980
|
}
|
|
975
981
|
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
976
982
|
autoFocus?: boolean;
|
|
@@ -1223,6 +1229,7 @@ export declare namespace JSXBase {
|
|
|
1223
1229
|
draggable?: boolean;
|
|
1224
1230
|
hidden?: boolean;
|
|
1225
1231
|
id?: string;
|
|
1232
|
+
inert?: boolean;
|
|
1226
1233
|
lang?: string;
|
|
1227
1234
|
spellcheck?: 'true' | 'false' | any;
|
|
1228
1235
|
style?: {
|
|
@@ -1231,6 +1238,7 @@ export declare namespace JSXBase {
|
|
|
1231
1238
|
tabIndex?: number;
|
|
1232
1239
|
tabindex?: number | string;
|
|
1233
1240
|
title?: string;
|
|
1241
|
+
popover?: string | null;
|
|
1234
1242
|
inputMode?: string;
|
|
1235
1243
|
inputmode?: string;
|
|
1236
1244
|
enterKeyHint?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "analog-clock-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.438",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"format": "prettier --write src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@stencil/core": "4.
|
|
28
|
+
"@stencil/core": "4.8.0"
|
|
29
29
|
},
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"cspell": "8.0.0",
|
|
33
|
-
"eslint": "8.
|
|
33
|
+
"eslint": "8.54.0",
|
|
34
34
|
"prettier": "3.1.0",
|
|
35
35
|
"tslint": "6.1.3",
|
|
36
|
-
"typescript": "5.
|
|
36
|
+
"typescript": "5.3.2"
|
|
37
37
|
}
|
|
38
38
|
}
|