Skip to content

Commit

Permalink
Update build component
Browse files Browse the repository at this point in the history
  • Loading branch information
dangvanthanh committed Dec 10, 2020
1 parent c6af546 commit e5086e4
Show file tree
Hide file tree
Showing 6 changed files with 2,820 additions and 37 deletions.
14 changes: 6 additions & 8 deletions dist/vue-clock.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,27 +170,25 @@ __vue_render__._withStripped = true;
);

// Declare install function excuted by Vue.use()
function install(Vue) {
if (install.installed) {
return;
}
const install = function(Vue) {
if (install.installed) return
install.installed = true;
Vue.component('VueClock', __vue_component__);
}
};

// Create module definition for Vue.use
const plugin = { install };

let GlobalVue = null;

if (typeof window !== 'undefined') {
GlobalVue = window.Vue;
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue;
}

if (GlobalVue) {
GlobalVue.use(plugin);
}

__vue_component__.install = install;

export default __vue_component__;
export { install };
10 changes: 5 additions & 5 deletions dist/vue-clock.min.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var VueClock=function(l){"use strict";const f=1e3,h=12;function E(e){return e>=12?"PM":"AM"}function p(e){return(parseInt(e,10)>=10?"":"0")+e}var y={data(){return{hours:0,minutes:0,seconds:0,hourtime:""}},mounted(){this.$options.timer=window.setTimeout(this.updateDateTime,f)},beforeDestroy(){window.clearTimeout(this.$options.timer)},methods:{updateDateTime(){const e=new Date;this.hours=e.getHours(),this.minutes=p(e.getMinutes()),this.seconds=p(e.getSeconds()),this.hourtime=E(this.hours),this.hours=this.hours%h||h,this.$options.timer=window.setTimeout(this.updateDateTime,f)}}};function w(e,t,i,n,u,c,a,r,b,P){typeof a!="boolean"&&(b=r,r=a,a=!1);const s=typeof i=="function"?i.options:i;e&&e.render&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns,s._compiled=!0,u&&(s.functional=!0)),n&&(s._scopeId=n);let d;if(c?(d=function(o){o=o||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!o&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(o=__VUE_SSR_CONTEXT__),t&&t.call(this,b(o)),o&&o._registeredComponents&&o._registeredComponents.add(c)},s._ssrRegister=d):t&&(d=a?function(o){t.call(this,P(o,this.$root.$options.shadowRoot))}:function(o){t.call(this,r(o))}),d)if(s.functional){const o=s.render;s.render=function(U,k){return d.call(k),o(U,k)}}else{const o=s.beforeCreate;s.beforeCreate=o?[].concat(o,d):[d]}return i}const T=typeof navigator!="undefined"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function S(e){return(t,i)=>D(t,i)}let _;const C={};function D(e,t){const i=T?t.media||"default":e,n=C[i]||(C[i]={ids:new Set,styles:[]});if(!n.ids.has(e)){n.ids.add(e);let u=t.source;if(t.map&&(u+=`
/*# sourceURL=`+t.map.sources[0]+" */",u+=`
/*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",t.media&&n.element.setAttribute("media",t.media),_===void 0&&(_=document.head||document.getElementsByTagName("head")[0]),_.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(u),n.element.styleSheet.cssText=n.styles.filter(Boolean).join(`
`);else{const c=n.ids.size-1,a=document.createTextNode(u),r=n.element.childNodes;r[c]&&n.element.removeChild(r[c]),r.length?n.element.insertBefore(a,r[c]):n.element.appendChild(a)}}}const R=y;var v=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.hourtime!=""?i("div",{staticClass:"clock"},[i("div",{staticClass:"clock__hours"},[i("span",{staticClass:"clock__hourtime",domProps:{textContent:e._s(e.hourtime)}}),e._v(" "),i("span",{domProps:{textContent:e._s(e.hours)}})]),e._v(" "),i("div",{staticClass:"clock__minutes",domProps:{textContent:e._s(e.minutes)}}),e._v(" "),i("div",{staticClass:"clock__seconds",domProps:{textContent:e._s(e.seconds)}})]):e._e()},B=[];v._withStripped=!0;const x=function(e){if(!e)return;e("data-v-91068ba8_0",{source:`
var VueClock=function(m){"use strict";const h=1e3,p=12;function E(e){return e>=12?"PM":"AM"}function C(e){return(parseInt(e,10)>=10?"":"0")+e}var y={data(){return{hours:0,minutes:0,seconds:0,hourtime:""}},mounted(){this.$options.timer=window.setTimeout(this.updateDateTime,h)},beforeDestroy(){window.clearTimeout(this.$options.timer)},methods:{updateDateTime(){const e=new Date;this.hours=e.getHours(),this.minutes=C(e.getMinutes()),this.seconds=C(e.getSeconds()),this.hourtime=E(this.hours),this.hours=this.hours%p||p,this.$options.timer=window.setTimeout(this.updateDateTime,h)}}};function w(e,t,i,n,c,u,a,r,b,P){typeof a!="boolean"&&(b=r,r=a,a=!1);const s=typeof i=="function"?i.options:i;e&&e.render&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns,s._compiled=!0,c&&(s.functional=!0)),n&&(s._scopeId=n);let d;if(u?(d=function(o){o=o||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!o&&typeof __VUE_SSR_CONTEXT__!="undefined"&&(o=__VUE_SSR_CONTEXT__),t&&t.call(this,b(o)),o&&o._registeredComponents&&o._registeredComponents.add(u)},s._ssrRegister=d):t&&(d=a?function(o){t.call(this,P(o,this.$root.$options.shadowRoot))}:function(o){t.call(this,r(o))}),d)if(s.functional){const o=s.render;s.render=function(U,k){return d.call(k),o(U,k)}}else{const o=s.beforeCreate;s.beforeCreate=o?[].concat(o,d):[d]}return i}const T=typeof navigator!="undefined"&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function S(e){return(t,i)=>D(t,i)}let _;const v={};function D(e,t){const i=T?t.media||"default":e,n=v[i]||(v[i]={ids:new Set,styles:[]});if(!n.ids.has(e)){n.ids.add(e);let c=t.source;if(t.map&&(c+=`
/*# sourceURL=`+t.map.sources[0]+" */",c+=`
/*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",t.media&&n.element.setAttribute("media",t.media),_===void 0&&(_=document.head||document.getElementsByTagName("head")[0]),_.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(c),n.element.styleSheet.cssText=n.styles.filter(Boolean).join(`
`);else{const u=n.ids.size-1,a=document.createTextNode(c),r=n.element.childNodes;r[u]&&n.element.removeChild(r[u]),r.length?n.element.insertBefore(a,r[u]):n.element.appendChild(a)}}}const R=y;var g=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.hourtime!=""?i("div",{staticClass:"clock"},[i("div",{staticClass:"clock__hours"},[i("span",{staticClass:"clock__hourtime",domProps:{textContent:e._s(e.hourtime)}}),e._v(" "),i("span",{domProps:{textContent:e._s(e.hours)}})]),e._v(" "),i("div",{staticClass:"clock__minutes",domProps:{textContent:e._s(e.minutes)}}),e._v(" "),i("div",{staticClass:"clock__seconds",domProps:{textContent:e._s(e.seconds)}})]):e._e()},x=[];g._withStripped=!0;const B=function(e){if(!e)return;e("data-v-91068ba8_0",{source:`
.clock[data-v-91068ba8] {
background: #fff;
border: 0.3rem solid #fff;
Expand Down Expand Up @@ -124,4 +124,4 @@ export default {
left: 8px;
}
</style>
`]},media:void 0})},N="data-v-91068ba8",O=void 0,$=!1,g=w({render:v,staticRenderFns:B},x,R,N,$,O,!1,S,void 0,void 0);function A(e){if(A.installed)return;A.installed=!0,e.component("VueClock",g)}const H={install:A};let m=null;return typeof window!="undefined"?m=window.Vue:typeof global!="undefined"&&(m=global.Vue),m&&m.use(H),l.default=g,l.install=A,Object.defineProperty(l,"__esModule",{value:!0}),l}({});
`]},media:void 0})},N="data-v-91068ba8",O=void 0,$=!1,f=w({render:g,staticRenderFns:x},B,R,N,$,O,!1,S,void 0,void 0),l=function(e){if(l.installed)return;l.installed=!0,e.component("VueClock",f)},H={install:l};let A=null;return typeof window!="undefined"?A=window.Vue:typeof global!="undefined"&&(A=global.Vue),A&&A.use(H),f.install=l,m.default=f,Object.defineProperty(m,"__esModule",{value:!0}),m}({});
14 changes: 6 additions & 8 deletions dist/vue-clock.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,30 +239,28 @@
);

// Declare install function excuted by Vue.use()
function install(Vue) {
if (install.installed) {
return;
}
const install = function(Vue) {
if (install.installed) return
install.installed = true;
Vue.component('VueClock', __vue_component__);
}
};

// Create module definition for Vue.use
const plugin = { install };

let GlobalVue = null;

if (typeof window !== 'undefined') {
GlobalVue = window.Vue;
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue;
}

if (GlobalVue) {
GlobalVue.use(plugin);
}

__vue_component__.install = install;

exports.default = __vue_component__;
exports.install = install;

Object.defineProperty(exports, '__esModule', { value: true });

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dangvanthanh/vue-clock",
"version": "0.1.9",
"version": "0.2.0",
"description": "Simple clock using Vue.js",
"author": "Dang Van Thanh <[email protected]>",
"main": "dist/vue-clock.umd.js",
Expand Down
Loading

0 comments on commit e5086e4

Please sign in to comment.