@pencilpix/vue2-clock-picker
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -10,3 +10,3 @@ const path = require('path'); | ||
filename: 'vue2-clock-picker.min.js', | ||
libraryTarget: 'window', | ||
libraryTarget: 'umd', | ||
library: 'VueClockPicker', | ||
@@ -13,0 +13,0 @@ }, |
@@ -1,1 +0,1 @@ | ||
window.VueClockPicker=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=7)}([function(t,e){t.exports=function(t,e,n,i,r,o){var c,s=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(c=t,s=t.default);var a="function"==typeof s?s.options:s;e&&(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0),n&&(a.functional=!0),r&&(a._scopeId=r);var l;if(o?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},a._ssrRegister=l):i&&(l=i),l){var p=a.functional,f=p?a.render:a.beforeCreate;p?(a._injectStyles=l,a.render=function(t,e){return l.call(e),f(t,e)}):a.beforeCreate=f?[].concat(f,l):[l]}return{esModule:c,exports:s,options:a}}},function(t,e,n){t.exports=!n(6)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var i=n(19),r=n(20),o=n(22),c=Object.defineProperty;e.f=n(1)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e=n(9);t.export={install:function(t){t.component("VueClockPicker",e.a)}}}.call(e,n(8)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){"use strict";function i(t){_||n(25)}function r(t){S||n(26)}function o(t){H||n(24)}function c(t){X||n(10)}var s=n(11),u=n.n(s),a={name:"ClockPickerHours",props:{value:{type:String,default:"00"}},data:function(){return{}},computed:{pm:function(){return["13","14","15","16","17","18","19","20","21","22","23","00"]},am:function(){return["01","02","03","04","05","06","07","08","09","10","11","12"]}},methods:{itemClass:function(t){var e=Number(t);return 12===e?0:e>12?e-12:e},setValue:function(t){this.$emit("set",t)}}},l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clock-picker__hours"},[n("div",{staticClass:"pm"},t._l(t.pm,function(e){return n("div",{key:e,staticClass:"pm__item",class:["pm__item--"+t.itemClass(e),e===t.value?"pm__item--selected":""]},[n("button",{staticClass:"clock-picker__button",class:{"clock-picker__button--active":e===t.value},on:{click:function(n){t.setValue(e)}}},[t._v("\n "+t._s(e)+"\n ")])])})),t._v(" "),n("div",{staticClass:"am"},t._l(t.am,function(e){return n("div",{key:e,staticClass:"am__item",class:"am__item--"+t.itemClass(e)},[n("button",{staticClass:"clock-picker__button",class:{"clock-picker__button--active":e===t.value},on:{click:function(n){t.setValue(e)}}},[t._v("\n "+t._s(e)+"\n ")])])}))])},p=[];l._withStripped=!0;var f={render:l,staticRenderFns:p},d=f,_=!1,v=n(0),m=i,h=v(a,d,!1,m,null,null);h.options.__file="src/components/ClockPickerHours.vue";var k=h.exports,y={name:"ClockPickerMinutes",props:{buttonClass:{type:String},value:{type:String}},data:function(){return{}},computed:{minutes:function(){for(var t=[],e=0;e<60;e++){var n="00"+e;t.push(n.slice(n.length-2))}return t}},methods:{isSmall:function(t){return Number(t)%5!=0},setValue:function(t){this.$emit("set",t)}}},C=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clock-picker__minutes"},[n("div",{staticClass:"minutes"},t._l(t.minutes,function(e){return n("div",{key:e,staticClass:"minutes__item",class:(i={"minutes__item--small":t.isSmall(e),"minutes__item--selected":e===t.value},i["minutes__item--"+Number(e)]=!0,i)},[n("button",{staticClass:"clock-picker__button",class:{"clock-picker__button--active":e===t.value},on:{click:function(n){t.setValue(e)}}},[t._v("\n "+t._s(e)+"\n ")])]);var i}))])},b=[];C._withStripped=!0;var g={render:C,staticRenderFns:b},x=g,S=!1,P=n(0),V=r,w=P(y,x,!1,V,null,null);w.options.__file="src/components/ClockPickerMinutes.vue";var E=w.exports,O={name:"ClockPickerDialog",components:{ClockPickerHours:k,ClockPickerMinutes:E},data:function(){return{opened:!1,hours:"00",minutes:"00",isHoursSet:!1,isMinutesSet:!1}},computed:{},methods:{open:function(){this.opened=!0},close:function(){this.opened=!1,this.isHoursSet=!1,this.isMinutesSet=!1},cancel:function(){this.$emit("cancel",this.hours+":"+this.minutes)},setHours:function(t){this.hours=t,this.isHoursSet=!0},setMinutes:function(t){this.minutes=t,this.isMinutesSet=!0},done:function(){this.$emit("done",this.hours+":"+this.minutes)}}},$=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clock-picker__dialog",class:{"clock-picker__dialog--active":t.opened}},[n("transition",{attrs:{name:"fade",mode:"out-in"}},[t.opened?n("div",{staticClass:"clock-picker__dialog-drop",on:{click:t.close}}):t._e()]),t._v(" "),n("transition",{attrs:{name:"scale",mode:"out-in"}},[t.opened?n("div",{staticClass:"clock-picker__dialog-body"},[n("div",{staticClass:"clock-picker__dialog-header"},[n("span",{on:{click:function(e){t.isHoursSet=!1}}},[t._v(t._s(t.hours))]),t._v(":"),n("span",[t._v(t._s(t.minutes))])]),t._v(" "),n("div",{staticClass:"clock-picker__dialog-content"},[n("transition",{attrs:{name:"scale",mode:"out-in"}},[t.isHoursSet?t._e():n("clock-picker-hours",{attrs:{value:t.hours},on:{set:function(e){t.setHours(e)}}})],1),t._v(" "),n("transition",{attrs:{name:"scale",mode:"out-in"}},[t.isHoursSet?n("clock-picker-minutes",{attrs:{value:t.minutes},on:{set:function(e){t.setMinutes(e)}}}):t._e()],1)],1),t._v(" "),n("div",{staticClass:"clock-picker__dialog-actions"},[n("button",{staticClass:"clock-picker__dialog-action",on:{click:t.cancel}},[t._v("CANCEL")]),t._v(" "),n("button",{staticClass:"clock-picker__dialog-action",on:{click:t.done}},[t._v("DONE")])])]):t._e()])],1)},j=[];$._withStripped=!0;var M={render:$,staticRenderFns:j},F=M,H=!1,R=n(0),T=o,N=R(O,F,!1,T,null,null);N.options.__file="src/components/ClockPickerDialog.vue";var D=N.exports,B={container:"clock-picker__input-container",focus:"clock-picker__input--focused",error:"clock-picker__input--error",value:"clock-picker__input--has-value",input:"clock-picker__input"},U={name:"VueClockPicker",props:{inputContainerClass:{type:String},inputClass:{type:String},inputFocusClass:{type:String},inputErrorClass:{type:String},inputValueClass:{type:String},placeholder:{type:String},name:{type:String},label:{type:String},required:{type:Boolean,default:!1},value:{validator:function(t){return/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(t)}}},components:{ClockPickerDialog:D},data:function(){return{isFocused:!1,hasValue:!!this.value,dialogOpen:!1,inputValue:this.value}},computed:{classes:function(){var t,e=this.inputContainerClass,n=this.inputFocusClass,i=this.inputValueClass,r=this.inputClass,o=this.inputErrorClass,c=B.container,s=B.input,a=B.focus,l=B.value,p=B.error;return{container:(t={},u()(t,e||c,!0),u()(t,n||a,this.isFocused),u()(t,i||l,this.hasValue),u()(t,o||p,this.hasError),t),input:u()({},r||s,!0)}},hasError:function(){return!(!this.required||this.inputValue)||!this.isValid()}},methods:{open:function(){var t=this;this.emitEvent("beforeOpen"),this.$refs.dialog.open(),this.$nextTick(function(){t.emitEvent("open")})},close:function(){var t=this;this.emitEvent("beforeClose"),this.$refs.dialog.close(),this.$nextTick(function(){t.emitEvent("close")})},cancel:function(t){this.emitEvent("cancel",t),this.close()},handleDone:function(t){this.inputValue=t,this.hasValue=!0,this.$emit("timeset",t),this.close()},emitEvent:function(t,e){this.$emit(t,e)},getValue:function(){return this.inputValue},setValue:function(t){this.inputValue=t,this.hasValue=!0},isValid:function(){return/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(this.inputValue)}}},q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clock-picker"},[n("div",{class:t.classes.container},[t.label?n("label",{attrs:{for:"clock_picker_input"}},[t._v(t._s(t.label))]):t._e(),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",class:t.classes.input,attrs:{type:"text",id:"clock_picker_input",name:t.name,placeholder:t.placeholder,readonly:""},domProps:{value:t.inputValue},on:{click:t.open,input:function(e){e.target.composing||(t.inputValue=e.target.value)}}}),t._v(" "),t._t("error")],2),t._v(" "),n("clock-picker-dialog",{ref:"dialog",on:{cancel:function(e){t.cancel(e)},done:function(e){t.handleDone(e)}}})],1)},A=[];q._withStripped=!0;var G={render:q,staticRenderFns:A},W=G,X=!1,I=n(0),L=c,z=I(U,W,!1,L,null,null);z.options.__file="src/components/ClockPicker.vue";e.a=z.exports},function(t,e){},function(t,e,n){"use strict";e.__esModule=!0;var i=n(12),r=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=function(t,e,n){return e in t?(0,r.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){t.exports={default:n(13),__esModule:!0}},function(t,e,n){n(14);var i=n(4).Object;t.exports=function(t,e,n){return i.defineProperty(t,e,n)}},function(t,e,n){var i=n(15);i(i.S+i.F*!n(1),"Object",{defineProperty:n(5).f})},function(t,e,n){var i=n(3),r=n(4),o=n(16),c=n(18),s=function(t,e,n){var u,a,l,p=t&s.F,f=t&s.G,d=t&s.S,_=t&s.P,v=t&s.B,m=t&s.W,h=f?r:r[e]||(r[e]={}),k=h.prototype,y=f?i:d?i[e]:(i[e]||{}).prototype;f&&(n=e);for(u in n)(a=!p&&y&&void 0!==y[u])&&u in h||(l=a?y[u]:n[u],h[u]=f&&"function"!=typeof y[u]?n[u]:v&&a?o(l,i):m&&y[u]==l?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):_&&"function"==typeof l?o(Function.call,l):l,_&&((h.virtual||(h.virtual={}))[u]=l,t&s.R&&k&&!k[u]&&c(k,u,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var i=n(17);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(5),r=n(23);t.exports=n(1)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(2);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(1)&&!n(6)(function(){return 7!=Object.defineProperty(n(21)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(2),r=n(3).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e,n){var i=n(2);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){},function(t,e){},function(t,e){}]); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueClockPicker=e():t.VueClockPicker=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=7)}([function(t,e){t.exports=function(t,e,n,i,o,r){var c,s=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(c=t,s=t.default);var a="function"==typeof s?s.options:s;e&&(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0),n&&(a.functional=!0),o&&(a._scopeId=o);var l;if(r?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},a._ssrRegister=l):i&&(l=i),l){var p=a.functional,f=p?a.render:a.beforeCreate;p?(a._injectStyles=l,a.render=function(t,e){return l.call(e),f(t,e)}):a.beforeCreate=f?[].concat(f,l):[l]}return{esModule:c,exports:s,options:a}}},function(t,e,n){t.exports=!n(6)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var i=n(19),o=n(20),r=n(22),c=Object.defineProperty;e.f=n(1)?Object.defineProperty:function(t,e,n){if(i(t),e=r(e,!0),i(n),o)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var i=n(9),o=null,r={install:function(t){t.component("VueClockPicker",i.a)}};"undefined"!=typeof window?o=window.Vue:void 0!==t&&(o=t.Vue),o&&o.use(r),e.default=r}.call(e,n(8))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";function i(t){_||n(25)}function o(t){S||n(26)}function r(t){H||n(24)}function c(t){X||n(10)}var s=n(11),u=n.n(s),a={name:"ClockPickerHours",props:{value:{type:String,default:"00"}},data:function(){return{}},computed:{pm:function(){return["13","14","15","16","17","18","19","20","21","22","23","00"]},am:function(){return["01","02","03","04","05","06","07","08","09","10","11","12"]}},methods:{itemClass:function(t){var e=Number(t);return 12===e?0:e>12?e-12:e},setValue:function(t){this.$emit("set",t)}}},l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clock-picker__hours"},[n("div",{staticClass:"pm"},t._l(t.pm,function(e){return n("div",{key:e,staticClass:"pm__item",class:["pm__item--"+t.itemClass(e),e===t.value?"pm__item--selected":""]},[n("button",{staticClass:"clock-picker__button",class:{"clock-picker__button--active":e===t.value},on:{click:function(n){t.setValue(e)}}},[t._v("\n "+t._s(e)+"\n ")])])})),t._v(" "),n("div",{staticClass:"am"},t._l(t.am,function(e){return n("div",{key:e,staticClass:"am__item",class:"am__item--"+t.itemClass(e)},[n("button",{staticClass:"clock-picker__button",class:{"clock-picker__button--active":e===t.value},on:{click:function(n){t.setValue(e)}}},[t._v("\n "+t._s(e)+"\n ")])])}))])},p=[];l._withStripped=!0;var f={render:l,staticRenderFns:p},d=f,_=!1,v=n(0),m=i,h=v(a,d,!1,m,null,null);h.options.__file="src/components/ClockPickerHours.vue";var k=h.exports,y={name:"ClockPickerMinutes",props:{buttonClass:{type:String},value:{type:String}},data:function(){return{}},computed:{minutes:function(){for(var t=[],e=0;e<60;e++){var n="00"+e;t.push(n.slice(n.length-2))}return t}},methods:{isSmall:function(t){return Number(t)%5!=0},setValue:function(t){this.$emit("set",t)}}},C=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clock-picker__minutes"},[n("div",{staticClass:"minutes"},t._l(t.minutes,function(e){return n("div",{key:e,staticClass:"minutes__item",class:(i={"minutes__item--small":t.isSmall(e),"minutes__item--selected":e===t.value},i["minutes__item--"+Number(e)]=!0,i)},[n("button",{staticClass:"clock-picker__button",class:{"clock-picker__button--active":e===t.value},on:{click:function(n){t.setValue(e)}}},[t._v("\n "+t._s(e)+"\n ")])]);var i}))])},b=[];C._withStripped=!0;var g={render:C,staticRenderFns:b},x=g,S=!1,V=n(0),w=o,E=V(y,x,!1,w,null,null);E.options.__file="src/components/ClockPickerMinutes.vue";var P=E.exports,$={name:"ClockPickerDialog",components:{ClockPickerHours:k,ClockPickerMinutes:P},data:function(){return{opened:!1,hours:"00",minutes:"00",isHoursSet:!1,isMinutesSet:!1}},computed:{},methods:{open:function(){this.opened=!0},close:function(){this.opened=!1,this.isHoursSet=!1,this.isMinutesSet=!1},cancel:function(){this.$emit("cancel",this.hours+":"+this.minutes)},setHours:function(t){this.hours=t,this.isHoursSet=!0},setMinutes:function(t){this.minutes=t,this.isMinutesSet=!0},done:function(){this.$emit("done",this.hours+":"+this.minutes)}}},j=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clock-picker__dialog",class:{"clock-picker__dialog--active":t.opened}},[n("transition",{attrs:{name:"fade",mode:"out-in"}},[t.opened?n("div",{staticClass:"clock-picker__dialog-drop",on:{click:t.close}}):t._e()]),t._v(" "),n("transition",{attrs:{name:"scale",mode:"out-in"}},[t.opened?n("div",{staticClass:"clock-picker__dialog-body"},[n("div",{staticClass:"clock-picker__dialog-header"},[n("span",{on:{click:function(e){t.isHoursSet=!1}}},[t._v(t._s(t.hours))]),t._v(":"),n("span",[t._v(t._s(t.minutes))])]),t._v(" "),n("div",{staticClass:"clock-picker__dialog-content"},[n("transition",{attrs:{name:"scale",mode:"out-in"}},[t.isHoursSet?t._e():n("clock-picker-hours",{attrs:{value:t.hours},on:{set:function(e){t.setHours(e)}}})],1),t._v(" "),n("transition",{attrs:{name:"scale",mode:"out-in"}},[t.isHoursSet?n("clock-picker-minutes",{attrs:{value:t.minutes},on:{set:function(e){t.setMinutes(e)}}}):t._e()],1)],1),t._v(" "),n("div",{staticClass:"clock-picker__dialog-actions"},[n("button",{staticClass:"clock-picker__dialog-action",on:{click:t.cancel}},[t._v("CANCEL")]),t._v(" "),n("button",{staticClass:"clock-picker__dialog-action",on:{click:t.done}},[t._v("DONE")])])]):t._e()])],1)},M=[];j._withStripped=!0;var F={render:j,staticRenderFns:M},O=F,H=!1,R=n(0),T=r,N=R($,O,!1,T,null,null);N.options.__file="src/components/ClockPickerDialog.vue";var D=N.exports,B={container:"clock-picker__input-container",focus:"clock-picker__input--focused",error:"clock-picker__input--error",value:"clock-picker__input--has-value",input:"clock-picker__input"},U={name:"VueClockPicker",props:{inputContainerClass:{type:String},inputClass:{type:String},inputFocusClass:{type:String},inputErrorClass:{type:String},inputValueClass:{type:String},placeholder:{type:String},name:{type:String},label:{type:String},required:{type:Boolean,default:!1},value:{validator:function(t){return/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(t)}}},components:{ClockPickerDialog:D},data:function(){return{isFocused:!1,hasValue:!!this.value,dialogOpen:!1,inputValue:this.value}},computed:{classes:function(){var t,e=this.inputContainerClass,n=this.inputFocusClass,i=this.inputValueClass,o=this.inputClass,r=this.inputErrorClass,c=B.container,s=B.input,a=B.focus,l=B.value,p=B.error;return{container:(t={},u()(t,e||c,!0),u()(t,n||a,this.isFocused),u()(t,i||l,this.hasValue),u()(t,r||p,this.hasError),t),input:u()({},o||s,!0)}},hasError:function(){return!(!this.required||this.inputValue)||!this.isValid()}},methods:{open:function(){var t=this;this.emitEvent("beforeOpen"),this.$refs.dialog.open(),this.$nextTick(function(){t.emitEvent("open")})},close:function(){var t=this;this.emitEvent("beforeClose"),this.$refs.dialog.close(),this.$nextTick(function(){t.emitEvent("close")})},cancel:function(t){this.emitEvent("cancel",t),this.close()},handleDone:function(t){this.inputValue=t,this.hasValue=!0,this.$emit("timeset",t),this.close()},emitEvent:function(t,e){this.$emit(t,e)},getValue:function(){return this.inputValue},setValue:function(t){this.inputValue=t,this.hasValue=!0},isValid:function(){return/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(this.inputValue)}}},q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clock-picker"},[n("div",{class:t.classes.container},[t.label?n("label",{attrs:{for:"clock_picker_input"}},[t._v(t._s(t.label))]):t._e(),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",class:t.classes.input,attrs:{type:"text",id:"clock_picker_input",name:t.name,placeholder:t.placeholder,readonly:""},domProps:{value:t.inputValue},on:{click:t.open,input:function(e){e.target.composing||(t.inputValue=e.target.value)}}}),t._v(" "),t._t("error")],2),t._v(" "),n("clock-picker-dialog",{ref:"dialog",on:{cancel:function(e){t.cancel(e)},done:function(e){t.handleDone(e)}}})],1)},A=[];q._withStripped=!0;var G={render:q,staticRenderFns:A},W=G,X=!1,I=n(0),L=c,z=I(U,W,!1,L,null,null);z.options.__file="src/components/ClockPicker.vue";e.a=z.exports},function(t,e){},function(t,e,n){"use strict";e.__esModule=!0;var i=n(12),o=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=function(t,e,n){return e in t?(0,o.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){t.exports={default:n(13),__esModule:!0}},function(t,e,n){n(14);var i=n(4).Object;t.exports=function(t,e,n){return i.defineProperty(t,e,n)}},function(t,e,n){var i=n(15);i(i.S+i.F*!n(1),"Object",{defineProperty:n(5).f})},function(t,e,n){var i=n(3),o=n(4),r=n(16),c=n(18),s=function(t,e,n){var u,a,l,p=t&s.F,f=t&s.G,d=t&s.S,_=t&s.P,v=t&s.B,m=t&s.W,h=f?o:o[e]||(o[e]={}),k=h.prototype,y=f?i:d?i[e]:(i[e]||{}).prototype;f&&(n=e);for(u in n)(a=!p&&y&&void 0!==y[u])&&u in h||(l=a?y[u]:n[u],h[u]=f&&"function"!=typeof y[u]?n[u]:v&&a?r(l,i):m&&y[u]==l?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):_&&"function"==typeof l?r(Function.call,l):l,_&&((h.virtual||(h.virtual={}))[u]=l,t&s.R&&k&&!k[u]&&c(k,u,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var i=n(17);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(5),o=n(23);t.exports=n(1)?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(2);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){t.exports=!n(1)&&!n(6)(function(){return 7!=Object.defineProperty(n(21)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(2),o=n(3).document,r=i(o)&&i(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},function(t,e,n){var i=n(2);t.exports=function(t,e){if(!i(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!i(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){},function(t,e){},function(t,e){}])}); |
{ | ||
"name": "@pencilpix/vue2-clock-picker", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "vuejs clock picker component", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue2-clock-picker.js", |
@@ -22,8 +22,7 @@ # Vue2 Clock Picker | ||
```html | ||
<link href="node_modules/@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.min.css"></link> | ||
<script src="node_modules/vuejs/dist/vue.min.js"></script> | ||
<script src="path/to/vue2-clock-picker/dist/vue2-clock-picker.min.js"> | ||
<script> | ||
Vue.use(VueClockPicker); | ||
</script> | ||
<script src="node_modules/@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.min.js"> | ||
``` | ||
@@ -30,0 +29,0 @@ |
import VueClockPicker from './components/ClockPicker.vue'; | ||
module.export = { | ||
let GlobalVue = null; | ||
const Plugin = { | ||
install(Vue) { | ||
@@ -9,1 +10,13 @@ Vue.component('VueClockPicker', VueClockPicker); | ||
if (typeof window !== 'undefined') { | ||
GlobalVue = window.Vue; | ||
} else if (typeof global !== 'undefined') { | ||
GlobalVue = global.Vue; | ||
} | ||
if (GlobalVue) { | ||
GlobalVue.use(Plugin); | ||
} | ||
export default Plugin; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
273747
681
84