@calibur/sakura
Advanced tools
Comparing version 1.5.10 to 1.6.0
/*! For license information please see index.js.LICENSE.txt */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@calibur/sakura"]=e():t["@calibur/sakura"]=e()}(this,(function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=29)}({0:function(t,e,o){"use strict";function n(t,e,o,n,r,i,s,a){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=o,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),s?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=c):r&&(c=a?function(){r.call(this,this.$root.$options.shadowRoot)}:r),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:l}}o.d(e,"a",(function(){return n}))},15:function(t,e,o){"use strict";var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"v-drawer",class:["v-drawer--"+t.from,{"v-drawer--offset":!t.offset&&!t.offsetVal}],style:t.drawerStyle},[o("transition",{attrs:{name:"v-drawer--transition"}},[t.show?o("div",{ref:"wrap",staticClass:"v-drawer__wrap",style:t.wrapStyle,on:{touchstart:function(t){t.stopPropagation()},touchmove:function(t){t.stopPropagation()},touchend:function(t){t.stopPropagation()}}},[t.count?t._l(t.count,(function(e,n){return o("div",{key:e,staticClass:"v-drawer__item",class:{strict:t.strict}},[t._t(""+n)],2)})):t._t("default"),t._v(" "),t.cancel?[o("div",{staticClass:"v-drawer__line"}),t._v(" "),o("div",{staticClass:"v-drawer__footer",domProps:{textContent:t._s(t.cancel)},on:{click:function(e){t.show=!1}}})]:t._e()],2):t._e()])],1)};n._withStripped=!0;o(23);var r=o(5),i={name:"VDrawer",props:{value:{type:Boolean,required:!0},count:{type:Number,default:0,validator:function(t){return t>=0}},strict:{type:Boolean,default:!1},cancel:{type:String,default:""},from:{type:String,default:"bottom",validator:function(t){return~["left","right","top","bottom"].indexOf(t)}},size:{type:String,default:"60%"},mask:{type:Boolean,default:!0},lock:{type:Boolean,default:!0},dropdown:{type:Boolean,default:!1},offset:{type:Number,default:0}},data:function(){return{show:!1,offsetVal:0,overlayId:""}},computed:{drawerStyle:function(){var t={},e=this.offsetVal,o=this.from,n=this.offset||e;switch(o){case"top":t.top="".concat(n,"px");break;case"bottom":t.bottom="".concat(n,"px");break;case"left":t.left="".concat(n,"px");break;case"right":t.right="".concat(n,"px")}return t},wrapStyle:function(){var t={},e=this.from,o=this.strict;if(~["top","bottom"].indexOf(e)){if(t.width="100%",t.left=0,"top"===e?t.top=0:t.bottom=0,o)return t;t.height=this.size}else{if(t.height="100%",t.bottom=0,"left"===e?t.left=0:t.right=0,o)return t;t.width=this.size}return t}},watch:{value:function(t){this.dropdown&&t?this.calcParentRect():(this.toggle(t),this.show=t)},show:function(t){this.toggle(t),this.$emit("input",t)}},mounted:function(){this.show=this.value},methods:{calcParentRect:function(){if(this.offset)return this.toggle(!0),void(this.show=!0);var t=this.$el.parentNode.getBoundingClientRect();switch(this.from){case"top":this.offsetVal=t.top+t.height;break;case"bottom":this.offsetVal=document.documentElement.clientHeight-t.top;break;case"left":this.offsetVal=t.left+t.width;break;case"right":this.offsetVal=document.documentElement.clientWidth-t.left}this.toggle(!0),this.show=!0},toggle:function(t){var e=this;this.$nextTick((function(){if(t){if(e.overlayId)return;e.overlayId=r.default.show({el:e.$refs.wrap,show:e.mask,lock:e.lock,style:e.drawerStyle,unlock:e.$refs.wrap,click:function(){e.show=!1}})}else r.default.hide(e.overlayId),e.overlayId=""}))}}},s=o(0),a=Object(s.a)(i,n,[],!1,null,null,null);a.options.__file="src/components/drawer/drawer.vue";e.a=a.exports},23:function(t,e,o){},29:function(t,e,o){"use strict";o.r(e);var n=o(15);e.default=n.a},5:function(t,e,o){"use strict";o.r(e);o(9);var n=function(){return"undefined"==typeof window},r=function(t){return document.querySelector(t)},i=function(t){t=t||navigator.userAgent;var e=/(iPad).*OS\s([\d_]+)/.test(t);return{ios:!e&&/(iPhone\sOS)\s([\d_]+)/.test(t)||e,android:/(Android);?[\s/]+([\d.]+)?/.test(t)}};var s=0,a=0,c=0,l=null,u=!1,d=[],f=function(t){if(n())return!1;if(!t)throw new Error("options must be provided");var e=!1,o={get passive(){e=!0}},r=function(){};window.addEventListener("__TUA_BSL_TEST_PASSIVE__",r,o),window.removeEventListener("__TUA_BSL_TEST_PASSIVE__",r,o);var i=t.capture;return e?t:void 0!==i&&i}({passive:!1}),h=function(t){t.cancelable&&t.preventDefault()},p=function(t){var e,o,p,v,y;n()||(i().ios?(t&&-1===d.indexOf(t)&&(t.ontouchstart=function(t){a=t.targetTouches[0].clientY,c=t.targetTouches[0].clientX},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){if(e){var o=e.scrollTop,n=e.scrollLeft,r=e.scrollWidth,i=e.scrollHeight,s=e.clientWidth,l=e.clientHeight,u=t.targetTouches[0].clientX-c,d=t.targetTouches[0].clientY-a,f=Math.abs(d)>Math.abs(u);if(f&&(d>0&&0===o||d<0&&o+l+1>=i)||!f&&(u>0&&0===n||u<0&&n+s+1>=r))return h(t)}t.stopPropagation()}(e,t)},d.push(t)),u||(document.addEventListener("touchmove",h,f),u=!0)):s<=0&&(l=i().android?(e=r("html"),o=r("body"),p=e.scrollTop||o.scrollTop,v=Object.assign({},e.style),y=Object.assign({},o.style),e.style.height="100%",e.style.overflow="hidden",o.style.top="-".concat(p,"px"),o.style.width="100%",o.style.height="auto",o.style.position="fixed",o.style.overflow="hidden",function(){e.style.height=v.height||"",e.style.overflow=v.overflow||"",["top","width","height","overflow","position"].forEach((function(t){o.style[t]=y[t]||""})),window.scrollTo(0,p)}):function(){var t=r("body"),e=Object.assign({},t.style),o=window.innerWidth-document.body.clientWidth;return t.style.overflow="hidden",t.style.boxSizing="border-box",t.style.paddingRight="".concat(o,"px"),function(){["overflow","boxSizing","paddingRight"].forEach((function(o){t.style[o]=e[o]||""}))}}()),s+=1)};e.default={show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="v-overlay-".concat(Math.random().toString(36).substring(3,6)),o=document.createElement("div"),n=void 0===t.md?/android/.test(window.navigator.userAgent.toLocaleLowerCase()):t.md;if(o.id=e,o.classList.add("v-overlay",n?"v-overlay--md":"v-overlay--ios"),t.click&&o.addEventListener("click",(function(){t.click()})),t.zIndex&&(o.style.zIndex=t.zIndex),!1!==t.lock&&(t.unlock?p(t.unlock):p()),t.style){var r="";Object.keys(t.style).forEach((function(e){r+="".concat(e,":").concat(t.style[e],";")})),o.setAttribute("style",r)}return t.el?t.el.parentNode.insertBefore(o,t.el):document.body.appendChild(o),!1===t.show?e:(setTimeout((function(){o.classList.add("v-overlay--show")}),0),e)},hide:function(t){var e=t?document.getElementById(t):document.querySelector(".v-overlay");e&&(e.classList.remove("v-overlay--show"),function(t){if(!(n()||(s-=1)>0))if(i().ios||"function"!=typeof l){if(t){var e=d.indexOf(t);-1!==e&&(t.ontouchmove=null,t.ontouchstart=null,d.splice(e,1))}u&&(document.removeEventListener("touchmove",h,f),u=!1)}else l()}(),setTimeout((function(){e&&e.parentNode&&e.parentNode.removeChild(e)}),200))}}},9:function(t,e,o){}})})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@calibur/sakura"]=e():t["@calibur/sakura"]=e()}(this,(function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=29)}({0:function(t,e,o){"use strict";function n(t,e,o,n,r,i,s,a){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=o,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),s?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=c):r&&(c=a?function(){r.call(this,this.$root.$options.shadowRoot)}:r),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:l}}o.d(e,"a",(function(){return n}))},15:function(t,e,o){"use strict";var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"v-drawer",class:["v-drawer--"+t.from,{"v-drawer--offset":!t.offset&&!t.offsetVal}],style:t.drawerStyle},[o("transition",{attrs:{name:"v-drawer--transition"}},[t.show?o("div",{ref:"wrap",staticClass:"v-drawer__wrap",style:t.wrapStyle,on:{touchstart:function(t){t.stopPropagation()},touchmove:function(t){t.stopPropagation()},touchend:function(t){t.stopPropagation()}}},[t.count?t._l(t.count,(function(e,n){return o("div",{key:e,staticClass:"v-drawer__item",class:{strict:t.strict}},[t._t(""+n)],2)})):t._t("default"),t._v(" "),t.cancel?[o("div",{staticClass:"v-drawer__line"}),t._v(" "),o("div",{staticClass:"v-drawer__footer",domProps:{textContent:t._s(t.cancel)},on:{click:function(e){t.show=!1}}})]:t._e()],2):t._e()])],1)};n._withStripped=!0;o(23);var r=o(5),i={name:"VDrawer",props:{value:{type:Boolean,required:!0},count:{type:Number,default:0,validator:function(t){return t>=0}},strict:{type:Boolean,default:!1},cancel:{type:String,default:""},from:{type:String,default:"bottom",validator:function(t){return~["left","right","top","bottom"].indexOf(t)}},size:{type:String,default:"60%"},mask:{type:Boolean,default:!0},lock:{type:Boolean,default:!0},dropdown:{type:Boolean,default:!1},offset:{type:Number,default:0}},data:function(){return{show:!1,offsetVal:0,overlayId:""}},computed:{drawerStyle:function(){var t={},e=this.offsetVal,o=this.from,n=this.offset||e;switch(o){case"top":t.top="".concat(n,"px");break;case"bottom":t.bottom="".concat(n,"px");break;case"left":t.left="".concat(n,"px");break;case"right":t.right="".concat(n,"px")}return t},wrapStyle:function(){var t={},e=this.from,o=this.strict;if(~["top","bottom"].indexOf(e)){if(t.width="100%",t.left=0,"top"===e?t.top=0:t.bottom=0,o)return t;t.height=this.size}else{if(t.height="100%",t.bottom=0,"left"===e?t.left=0:t.right=0,o)return t;t.width=this.size}return t}},watch:{value:function(t){this.dropdown&&t?this.calcParentRect():(this.toggle(t),this.show=t)},show:function(t){this.$emit("input",t)}},mounted:function(){this.value&&(this.show=!0,this.toggle(!0))},methods:{calcParentRect:function(){if(this.offset)return this.toggle(!0),void(this.show=!0);var t=this.$el.parentNode.getBoundingClientRect();switch(this.from){case"top":this.offsetVal=t.top+t.height;break;case"bottom":this.offsetVal=document.documentElement.clientHeight-t.top;break;case"left":this.offsetVal=t.left+t.width;break;case"right":this.offsetVal=document.documentElement.clientWidth-t.left}this.toggle(!0),this.show=!0},toggle:function(t){var e=this;this.$nextTick((function(){if(t){if(e.overlayId)return;e.overlayId=r.default.show({el:e.$refs.wrap,show:e.mask,lock:e.lock,style:e.drawerStyle,unlock:e.$refs.wrap,click:function(){e.show=!1}})}else r.default.hide(e.overlayId),e.overlayId=""}))}}},s=o(0),a=Object(s.a)(i,n,[],!1,null,null,null);a.options.__file="src/components/drawer/drawer.vue";e.a=a.exports},23:function(t,e,o){},29:function(t,e,o){"use strict";o.r(e);var n=o(15);e.default=n.a},5:function(t,e,o){"use strict";o.r(e);o(9);var n=function(){return"undefined"==typeof window},r=function(t){return document.querySelector(t)},i=function(t){t=t||navigator.userAgent;var e=/(iPad).*OS\s([\d_]+)/.test(t);return{ios:!e&&/(iPhone\sOS)\s([\d_]+)/.test(t)||e,android:/(Android);?[\s/]+([\d.]+)?/.test(t)}};var s=0,a=0,c=0,l=null,u=!1,d=[],f=function(t){if(n())return!1;if(!t)throw new Error("options must be provided");var e=!1,o={get passive(){e=!0}},r=function(){};window.addEventListener("__TUA_BSL_TEST_PASSIVE__",r,o),window.removeEventListener("__TUA_BSL_TEST_PASSIVE__",r,o);var i=t.capture;return e?t:void 0!==i&&i}({passive:!1}),h=function(t){t.cancelable&&t.preventDefault()},p=function(t){var e,o,p,v,y;n()||(i().ios?(t&&-1===d.indexOf(t)&&(t.ontouchstart=function(t){a=t.targetTouches[0].clientY,c=t.targetTouches[0].clientX},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){if(e){var o=e.scrollTop,n=e.scrollLeft,r=e.scrollWidth,i=e.scrollHeight,s=e.clientWidth,l=e.clientHeight,u=t.targetTouches[0].clientX-c,d=t.targetTouches[0].clientY-a,f=Math.abs(d)>Math.abs(u);if(f&&(d>0&&0===o||d<0&&o+l+1>=i)||!f&&(u>0&&0===n||u<0&&n+s+1>=r))return h(t)}t.stopPropagation()}(e,t)},d.push(t)),u||(document.addEventListener("touchmove",h,f),u=!0)):s<=0&&(l=i().android?(e=r("html"),o=r("body"),p=e.scrollTop||o.scrollTop,v=Object.assign({},e.style),y=Object.assign({},o.style),e.style.height="100%",e.style.overflow="hidden",o.style.top="-".concat(p,"px"),o.style.width="100%",o.style.height="auto",o.style.position="fixed",o.style.overflow="hidden",function(){e.style.height=v.height||"",e.style.overflow=v.overflow||"",["top","width","height","overflow","position"].forEach((function(t){o.style[t]=y[t]||""})),window.scrollTo(0,p)}):function(){var t=r("body"),e=Object.assign({},t.style),o=window.innerWidth-document.body.clientWidth;return t.style.overflow="hidden",t.style.boxSizing="border-box",t.style.paddingRight="".concat(o,"px"),function(){["overflow","boxSizing","paddingRight"].forEach((function(o){t.style[o]=e[o]||""}))}}()),s+=1)};e.default={show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="v-overlay-".concat(Math.random().toString(36).substring(3,6)),o=document.createElement("div"),n=void 0===t.md?/android/.test(window.navigator.userAgent.toLocaleLowerCase()):t.md;if(o.id=e,o.classList.add("v-overlay",n?"v-overlay--md":"v-overlay--ios"),t.click&&o.addEventListener("click",(function(){t.click()})),t.zIndex&&(o.style.zIndex=t.zIndex),!1!==t.lock&&(t.unlock?p(t.unlock):p()),t.style){var r="";Object.keys(t.style).forEach((function(e){r+="".concat(e,":").concat(t.style[e],";")})),o.setAttribute("style",r)}return t.el?t.el.parentNode.insertBefore(o,t.el):document.body.appendChild(o),!1===t.show?e:(setTimeout((function(){o.classList.add("v-overlay--show")}),0),e)},hide:function(t){var e=t?document.getElementById(t):document.querySelector(".v-overlay");e&&(e.classList.remove("v-overlay--show"),function(t){if(!(n()||(s-=1)>0))if(i().ios||"function"!=typeof l){if(t){var e=d.indexOf(t);-1!==e&&(t.ontouchmove=null,t.ontouchstart=null,d.splice(e,1))}u&&(document.removeEventListener("touchmove",h,f),u=!1)}else l()}(),setTimeout((function(){e&&e.parentNode&&e.parentNode.removeChild(e)}),200))}}},9:function(t,e,o){}})})); |
/*! For license information please see index.js.LICENSE.txt */ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@calibur/sakura"]=e():t["@calibur/sakura"]=e()}(this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=50)}([function(t,e,n){"use strict";function o(t,e,n,o,i,r,a,l){var s,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(s=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=s):i&&(s=l?function(){i.call(this,this.$root.$options.shadowRoot)}:i),s)if(c.functional){c._injectStyles=s;var u=c.render;c.render=function(t,e){return s.call(e),u(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,s):[s]}return{exports:t,options:c}}n.d(e,"a",(function(){return o}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(t){return"[object Array]"===Object.prototype.toString.call(t)}},,,function(t,e,n){"use strict";n.r(e);n(9);var o=function(){return"undefined"==typeof window},i=function(t){return document.querySelector(t)},r=function(t){t=t||navigator.userAgent;var e=/(iPad).*OS\s([\d_]+)/.test(t);return{ios:!e&&/(iPhone\sOS)\s([\d_]+)/.test(t)||e,android:/(Android);?[\s/]+([\d.]+)?/.test(t)}};var a=0,l=0,s=0,c=null,u=!1,d=[],h=function(t){if(o())return!1;if(!t)throw new Error("options must be provided");var e=!1,n={get passive(){e=!0}},i=function(){};window.addEventListener("__TUA_BSL_TEST_PASSIVE__",i,n),window.removeEventListener("__TUA_BSL_TEST_PASSIVE__",i,n);var r=t.capture;return e?t:void 0!==r&&r}({passive:!1}),f=function(t){t.cancelable&&t.preventDefault()},v=function(t){var e,n,v,p,m;o()||(r().ios?(t&&-1===d.indexOf(t)&&(t.ontouchstart=function(t){l=t.targetTouches[0].clientY,s=t.targetTouches[0].clientX},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){if(e){var n=e.scrollTop,o=e.scrollLeft,i=e.scrollWidth,r=e.scrollHeight,a=e.clientWidth,c=e.clientHeight,u=t.targetTouches[0].clientX-s,d=t.targetTouches[0].clientY-l,h=Math.abs(d)>Math.abs(u);if(h&&(d>0&&0===n||d<0&&n+c+1>=r)||!h&&(u>0&&0===o||u<0&&o+a+1>=i))return f(t)}t.stopPropagation()}(e,t)},d.push(t)),u||(document.addEventListener("touchmove",f,h),u=!0)):a<=0&&(c=r().android?(e=i("html"),n=i("body"),v=e.scrollTop||n.scrollTop,p=Object.assign({},e.style),m=Object.assign({},n.style),e.style.height="100%",e.style.overflow="hidden",n.style.top="-".concat(v,"px"),n.style.width="100%",n.style.height="auto",n.style.position="fixed",n.style.overflow="hidden",function(){e.style.height=p.height||"",e.style.overflow=p.overflow||"",["top","width","height","overflow","position"].forEach((function(t){n.style[t]=m[t]||""})),window.scrollTo(0,v)}):function(){var t=i("body"),e=Object.assign({},t.style),n=window.innerWidth-document.body.clientWidth;return t.style.overflow="hidden",t.style.boxSizing="border-box",t.style.paddingRight="".concat(n,"px"),function(){["overflow","boxSizing","paddingRight"].forEach((function(n){t.style[n]=e[n]||""}))}}()),a+=1)};e.default={show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="v-overlay-".concat(Math.random().toString(36).substring(3,6)),n=document.createElement("div"),o=void 0===t.md?/android/.test(window.navigator.userAgent.toLocaleLowerCase()):t.md;if(n.id=e,n.classList.add("v-overlay",o?"v-overlay--md":"v-overlay--ios"),t.click&&n.addEventListener("click",(function(){t.click()})),t.zIndex&&(n.style.zIndex=t.zIndex),!1!==t.lock&&(t.unlock?v(t.unlock):v()),t.style){var i="";Object.keys(t.style).forEach((function(e){i+="".concat(e,":").concat(t.style[e],";")})),n.setAttribute("style",i)}return t.el?t.el.parentNode.insertBefore(n,t.el):document.body.appendChild(n),!1===t.show?e:(setTimeout((function(){n.classList.add("v-overlay--show")}),0),e)},hide:function(t){var e=t?document.getElementById(t):document.querySelector(".v-overlay");e&&(e.classList.remove("v-overlay--show"),function(t){if(!(o()||(a-=1)>0))if(r().ios||"function"!=typeof c){if(t){var e=d.indexOf(t);-1!==e&&(t.ontouchmove=null,t.ontouchstart=null,d.splice(e,1))}u&&(document.removeEventListener("touchmove",f,h),u=!1)}else c()}(),setTimeout((function(){e&&e.parentNode&&e.parentNode.removeChild(e)}),200))}}},function(t,e,n){"use strict";function o(t,e,n,o){var i,r=!1,a=0;function l(){i&&clearTimeout(i)}function s(){var s=this,c=Date.now()-a,u=arguments;function d(){a=Date.now(),n.apply(s,u)}r||(o&&!i&&d(),l(),void 0===o&&c>t?d():!0!==e&&(i=setTimeout(o?function(){i=void 0}:d,void 0===o?t-c:t)))}return"boolean"!=typeof e&&(o=n,n=e,e=void 0),s.cancel=function(){l(),r=!0},s}function i(t,e,n){return void 0===n?o(t,e,!1):o(t,n,!1!==e)}n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.r(e);n(19);e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dom,o=e.time,i=0,r=n||window,a=n?n.scrollTop||n.scrollY:window.scrollY,l=t||0,s=o||400,c=(l-a)/(s/1e3)/60,u=s/1e3*60|0;function d(){(i+=1)<u?(r.requestAnimFrame(d),r.scrollTo(0,a+c*i)):r.scrollTo(0,l)}r.requestAnimFrame||(r.requestAnimFrame=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}).bind(window)),s?d():r.scrollTo(0,l)}},function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"v-picker",style:{height:t.pickerHeight+"px"}},t._l(t.columnData,(function(e,o){return n("div",{key:o,ref:"column",refInFor:!0,staticClass:"v-picker__column",on:{scroll:function(e){return t.handleScroll(e,o)}}},[n("div",{staticClass:"v-picker__list",style:{height:e.length*t.itemHeight+"px"}},t._l(e,(function(e,i){return n("div",{key:e[t.valueName],staticClass:"v-picker__item",class:[{"is-active":t.columnCount>1?e[t.valueName]===t.selected[o]:e[t.valueName]===t.selected},{"is-disabled":!!e.disabled}],domProps:{textContent:t._s(e[t.labelName])},on:{click:function(n){return t.handleClick(e,o,i)}}})})),0)])})),0)};o._withStripped=!0;n(20);var i=n(6),r=n(2),a=n(7),l=n(10);function s(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c=function(t,e,n){var o=0;if(!n)return o;for(var i=0;i<t.length;i++)if(t[i][e]===n){o=i;break}return o},u={name:"PickerCore",mixins:[l.a],props:{valueData:{required:!0,type:[String,Number,Array]}},data:function(){var t,e=function t(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e.map((function(e){return e&&e[n]&&Object(r.a)(e[n])&&e[n].length?t(e[n],n,o+1):o}));return Math.max.apply(Math,s(i))}(this.list,this.childName),n=e>1?new Array(e).fill([]):[this.list],o=this.valueData;return e>1?(t=Object(r.a)(o)&&o.length?o:function t(e,n,o,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return i[a]=e[0][n],e[0][o]&&Object(r.a)(e[0][o])&&e[0][o].length&&t(e[0][o],n,o,i,a+1),i}(this.list,this.valueName,this.childName,new Array(e).fill(""))).length<e&&(t=t.concat(new Array(e-t.length).fill(""))):t=o||this.list[0][this.valueName],{columnCount:e,columnData:n,selected:t,changeIndex:0,initCount:0}},computed:{pickerHeight:function(){return this.itemHeight*this.itemCount},condition:function(){return this.itemCount%2?this.itemHeight:this.itemHeight/2},jumpCount:function(){return(this.itemCount-1)/2|0}},watch:{selected:{handler:function(t){this.refreshColumnData(t),this.$emit("update:valueData",t)},immediate:!0,deep:!0},valueData:function(t){this.selected=t}},mounted:function(){var t=this;this.$nextTick((function(){t.initValue()}))},methods:{initValue:function(){var t=this;if(Object(r.a)(this.selected))this.columnData.forEach((function(e,n){var o=c(t.columnData[n],t.valueName,t.selected[n]);setTimeout((function(){t.autoScrollColumn(t.columnData[n][o],n,o,0)}),20*n)}));else{var e=c(this.columnData[0],this.valueName,this.selected);this.autoScrollColumn(this.columnData[0][e],0,e,0)}},handleScroll:Object(i.b)(100,(function(t,e){var n,o=this,i=this.itemHeight,r=this.jumpCount,a=this.condition,l=t.target.scrollTop,s=this.columnData[e].length,c=s*i-this.pickerHeight;n=l<=0?0:l<=a?Math.ceil(l/(a/(r+1))):l>=c?s-1:l>=c-a?s-1-Math.ceil(r*((c-l)/a)):Math.ceil((l-a)/i+(l-a)/(c-2*a))+r+1;var u=this.columnData[e][n];u&&!u.disabled&&(this.changeIndex=e,this.columnCount>1?this.$set(this.selected,e,u[this.valueName]):this.selected=u[this.valueName],this.$nextTick((function(){o.updateDefSelected()})))})),handleClick:function(t,e,n){t&&t.disabled||(this.updateCurSelected(t,e),this.autoScrollColumn(t,e,n))},autoScrollColumn:function(t,e,n){var o,i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:400,l=this.itemHeight,s=this.condition,c=this.jumpCount,u=this.columnData[e].length,d=u*l-this.pickerHeight;o=n<=0?0:n<=c+1?s/(c+1)*n:n>=u-1?d:n>=u-1-c?d-s/c*(u-1-n)+1:s+(n-(c+1))*(1-1/(u-2-2*c))*l,Object(a.default)(o,{dom:this.$refs.column[e],time:r}),this.$nextTick((function(){i.initCount++}))},updateCurSelected:function(t,e){var n=t?t[this.valueName]:"";this.columnCount>1?this.$set(this.selected,e,n):this.selected=n,this.changeIndex=e},updateDefSelected:function(){var t=this.changeIndex,e=this.columnCount,n=this.valueName;if(!(t>=e-1||this.initCount<e)){var o=this.selected[t];-1===this.columnData[t+1].findIndex((function(t){return t[n]===o}))&&this.updateCurSelected(this.columnData[t+1][0],t+1)}},refreshColumnData:function(t){var e=this;if(Object(r.a)(t)){var n=[];t.forEach((function(o,i){i?n.push(function(t,e,n,o){for(var i=[],r=0;r<t.length;r++)if(t[r][n]===e){i=t[r][o]||[];break}return i}(n[i-1],t[i-1],e.valueName,e.childName)):n.push(e.list)})),this.columnData=n}}}},d=n(0),h=Object(d.a)(u,o,[],!1,null,null,null);h.options.__file="src/components/picker/pickerCore.vue";e.a=h.exports},function(t,e,n){},function(t,e,n){"use strict";e.a={props:{value:{type:[String,Number,Array],default:function(){return[]}},list:{required:!0,type:Array,default:function(){return[]}},labelName:{type:String,default:"text"},valueName:{type:String,default:"value"},childName:{type:String,default:"children"},itemHeight:{type:Number,default:44},itemCount:{type:Number,default:5}}}},,,,,function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"v-drawer",class:["v-drawer--"+t.from,{"v-drawer--offset":!t.offset&&!t.offsetVal}],style:t.drawerStyle},[n("transition",{attrs:{name:"v-drawer--transition"}},[t.show?n("div",{ref:"wrap",staticClass:"v-drawer__wrap",style:t.wrapStyle,on:{touchstart:function(t){t.stopPropagation()},touchmove:function(t){t.stopPropagation()},touchend:function(t){t.stopPropagation()}}},[t.count?t._l(t.count,(function(e,o){return n("div",{key:e,staticClass:"v-drawer__item",class:{strict:t.strict}},[t._t(""+o)],2)})):t._t("default"),t._v(" "),t.cancel?[n("div",{staticClass:"v-drawer__line"}),t._v(" "),n("div",{staticClass:"v-drawer__footer",domProps:{textContent:t._s(t.cancel)},on:{click:function(e){t.show=!1}}})]:t._e()],2):t._e()])],1)};o._withStripped=!0;n(23);var i=n(5),r={name:"VDrawer",props:{value:{type:Boolean,required:!0},count:{type:Number,default:0,validator:function(t){return t>=0}},strict:{type:Boolean,default:!1},cancel:{type:String,default:""},from:{type:String,default:"bottom",validator:function(t){return~["left","right","top","bottom"].indexOf(t)}},size:{type:String,default:"60%"},mask:{type:Boolean,default:!0},lock:{type:Boolean,default:!0},dropdown:{type:Boolean,default:!1},offset:{type:Number,default:0}},data:function(){return{show:!1,offsetVal:0,overlayId:""}},computed:{drawerStyle:function(){var t={},e=this.offsetVal,n=this.from,o=this.offset||e;switch(n){case"top":t.top="".concat(o,"px");break;case"bottom":t.bottom="".concat(o,"px");break;case"left":t.left="".concat(o,"px");break;case"right":t.right="".concat(o,"px")}return t},wrapStyle:function(){var t={},e=this.from,n=this.strict;if(~["top","bottom"].indexOf(e)){if(t.width="100%",t.left=0,"top"===e?t.top=0:t.bottom=0,n)return t;t.height=this.size}else{if(t.height="100%",t.bottom=0,"left"===e?t.left=0:t.right=0,n)return t;t.width=this.size}return t}},watch:{value:function(t){this.dropdown&&t?this.calcParentRect():(this.toggle(t),this.show=t)},show:function(t){this.toggle(t),this.$emit("input",t)}},mounted:function(){this.show=this.value},methods:{calcParentRect:function(){if(this.offset)return this.toggle(!0),void(this.show=!0);var t=this.$el.parentNode.getBoundingClientRect();switch(this.from){case"top":this.offsetVal=t.top+t.height;break;case"bottom":this.offsetVal=document.documentElement.clientHeight-t.top;break;case"left":this.offsetVal=t.left+t.width;break;case"right":this.offsetVal=document.documentElement.clientWidth-t.left}this.toggle(!0),this.show=!0},toggle:function(t){var e=this;this.$nextTick((function(){if(t){if(e.overlayId)return;e.overlayId=i.default.show({el:e.$refs.wrap,show:e.mask,lock:e.lock,style:e.drawerStyle,unlock:e.$refs.wrap,click:function(){e.show=!1}})}else i.default.hide(e.overlayId),e.overlayId=""}))}}},a=n(0),l=Object(a.a)(r,o,[],!1,null,null,null);l.options.__file="src/components/drawer/drawer.vue";e.a=l.exports},,,function(t,e,n){"use strict";n(24);var o=n(6),i=n(7),r=function(){var t={open:function(){},close:function(){}};if("undefined"==typeof window)return t;var e=document.createElement("div");document.documentElement.appendChild(e),e.style.WebkitOverflowScrolling="touch";var n="getComputedStyle"in window&&"touch"===window.getComputedStyle(e)["-webkit-overflow-scrolling"];if(document.documentElement.removeChild(e),!n)return t;var o=0,i=!1;try{var r=Object.defineProperty({},"passive",{get:function(){return i=!0,null}});window.addEventListener("test",null,r)}catch(c){}var a=window.innerWidth/window.document.documentElement.clientWidth,l=function(t){if(1===a&&!(t.touches.length>1)){for(var e=t.target;e!==document.body&&e!==document;){var n=window.getComputedStyle(e);if(!n)break;if("INPUT"===e.nodeName&&"range"===e.getAttribute("type"))return;var i=n.getPropertyValue("overflow-y"),r=n.getPropertyValue("overflow-x");if(("auto"===r||"scroll"===r)&&"hidden"===i)return;var l=n.getPropertyValue("-webkit-overflow-scrolling"),s=parseInt(n.getPropertyValue("height"),10),c="touch"===l&&("auto"===i||"scroll"===i),u=e.scrollHeight>e.offsetHeight;if(c&&u){var d=t.touches?t.touches[0].screenY:t.screenY,h=o<=d&&0===e.scrollTop,f=o>=d&&e.scrollHeight-e.scrollTop===s;return void((h||f)&&t.preventDefault())}e=e.parentNode}t.preventDefault()}},s=function(t){o=t.touches?t.touches[0].screenY:t.screenY};return{open:function(){window.__ios_scroll_fixed__||(window.addEventListener("touchstart",s,!!i&&{passive:!1}),window.addEventListener("touchmove",l,!!i&&{passive:!1}),window.__ios_scroll_fixed__=!0)},close:function(){window.removeEventListener("touchstart",s,!1),window.removeEventListener("touchmove",l,!1),window.__ios_scroll_fixed__=!1}}}(),a={name:"VScroller",props:{preloadTop:{type:Number,default:50},preloadBottom:{type:Number,default:50},eventStep:{type:Number,default:1},throttle:{type:Number,default:-1},tag:{type:String,default:"div"},height:{type:String,default:"100%"}},data:function(){return{lastScrollTop:0,lastTouchY:0,refreshing:!1}},beforeMount:function(){r.open()},beforeDestroy:function(){r.close()},methods:{scrollY:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400;this.$el&&Object(i.default)(t,{dom:this.$el,time:e})},_handleStart:function(t){this.lastTouchY=t.touches[0].clientY},_handleMove:function(t){var e=t.touches[0].clientY-this.lastTouchY;if(e>0&&this.lastScrollTop<=0){if(!this.refreshing&&e<this.eventStep)return;this.refreshing=!0,this.$emit("refresh",{event:t,offset:e})}},_handleEnd:function(){this.refreshing&&(this.$emit("refresh-end"),this.refreshing=!1)},_handleScroll:function(t){var e=t.target.scrollTop,n=this.lastScrollTop-e,o=n>0;if(o)e>=0&&e<=this.preloadTop&&n>=this.eventStep&&this.$emit("top");else{var i=this.$el;i.scrollHeight-i.clientHeight-e<=this.preloadBottom&&this.$emit("bottom")}this.lastScrollTop=e,this.$emit("scroll",{offsetTop:e,isUp:o})}},render:function(t){var e={},n=this.throttle;return n>=0&&(e["&scroll"]=n>0?Object(o.b)(n,this._handleScroll):this._handleScroll,e["&touchstart"]=this._handleStart,e["&touchmove"]=this._handleMove,e["&touchend"]=this._handleEnd),t(this.tag,{style:{height:this.height,"overflow-y":"auto","-webkit-overflow-scrolling":"touch"},class:"v-scroller",on:e},this.$slots.default)}},l=n(0),s=Object(l.a)(a,void 0,void 0,!1,null,null,null);s.options.__file="src/components/scroller/scroller.vue";e.a=s.exports},function(t,e,n){},function(t,e,n){},,,function(t,e,n){},function(t,e,n){},,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("VDrawer",{attrs:{from:"bottom",size:t.itemHeight*t.itemCount+(t.hasHeader?t.headerHeight:0)+"px",lock:!1},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},[n("VScroller",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.hasHeader,expression:"hasHeader"}],staticClass:"v-picker__header",style:{height:t.headerHeight+"px"}},[t._t("header")],2),t._v(" "),n("PickerCore",{attrs:{list:t.list,"value-data":t.valueData,"label-name":t.labelName,"value-name":t.valueName,"child-name":t.childName,"item-height":t.itemHeight,"item-count":t.itemCount},on:{"update:valueData":function(e){t.valueData=e},"update:value-data":function(e){t.valueData=e}}})],1)],1)};o._withStripped=!0;n(20);var i=n(15),r=n(18),a=n(8),l=n(10),s={name:"VPicker",components:{VDrawer:i.a,VScroller:r.a,PickerCore:a.a},mixins:[l.a],props:{show:{type:Boolean,default:!1},headerHeight:{type:Number,default:44}},data:function(){return{visible:this.show,valueData:this.value}},computed:{hasHeader:function(){return this.$slots.header}},watch:{show:function(t){this.visible=t},value:function(t){this.valueData=t},visible:function(t){this.$emit("update:show",t)},valueData:function(t){this.$emit("input",t)}}},c=n(0),u=Object(c.a)(s,o,[],!1,null,null,null);u.options.__file="src/components/picker/picker.vue";var d=u.exports;e.default=d}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["@calibur/sakura"]=e():t["@calibur/sakura"]=e()}(this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=50)}([function(t,e,n){"use strict";function o(t,e,n,o,i,r,a,l){var s,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(s=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=s):i&&(s=l?function(){i.call(this,this.$root.$options.shadowRoot)}:i),s)if(c.functional){c._injectStyles=s;var u=c.render;c.render=function(t,e){return s.call(e),u(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,s):[s]}return{exports:t,options:c}}n.d(e,"a",(function(){return o}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var o=function(t){return"[object Array]"===Object.prototype.toString.call(t)}},,,function(t,e,n){"use strict";n.r(e);n(9);var o=function(){return"undefined"==typeof window},i=function(t){return document.querySelector(t)},r=function(t){t=t||navigator.userAgent;var e=/(iPad).*OS\s([\d_]+)/.test(t);return{ios:!e&&/(iPhone\sOS)\s([\d_]+)/.test(t)||e,android:/(Android);?[\s/]+([\d.]+)?/.test(t)}};var a=0,l=0,s=0,c=null,u=!1,d=[],h=function(t){if(o())return!1;if(!t)throw new Error("options must be provided");var e=!1,n={get passive(){e=!0}},i=function(){};window.addEventListener("__TUA_BSL_TEST_PASSIVE__",i,n),window.removeEventListener("__TUA_BSL_TEST_PASSIVE__",i,n);var r=t.capture;return e?t:void 0!==r&&r}({passive:!1}),f=function(t){t.cancelable&&t.preventDefault()},v=function(t){var e,n,v,p,m;o()||(r().ios?(t&&-1===d.indexOf(t)&&(t.ontouchstart=function(t){l=t.targetTouches[0].clientY,s=t.targetTouches[0].clientX},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){if(e){var n=e.scrollTop,o=e.scrollLeft,i=e.scrollWidth,r=e.scrollHeight,a=e.clientWidth,c=e.clientHeight,u=t.targetTouches[0].clientX-s,d=t.targetTouches[0].clientY-l,h=Math.abs(d)>Math.abs(u);if(h&&(d>0&&0===n||d<0&&n+c+1>=r)||!h&&(u>0&&0===o||u<0&&o+a+1>=i))return f(t)}t.stopPropagation()}(e,t)},d.push(t)),u||(document.addEventListener("touchmove",f,h),u=!0)):a<=0&&(c=r().android?(e=i("html"),n=i("body"),v=e.scrollTop||n.scrollTop,p=Object.assign({},e.style),m=Object.assign({},n.style),e.style.height="100%",e.style.overflow="hidden",n.style.top="-".concat(v,"px"),n.style.width="100%",n.style.height="auto",n.style.position="fixed",n.style.overflow="hidden",function(){e.style.height=p.height||"",e.style.overflow=p.overflow||"",["top","width","height","overflow","position"].forEach((function(t){n.style[t]=m[t]||""})),window.scrollTo(0,v)}):function(){var t=i("body"),e=Object.assign({},t.style),n=window.innerWidth-document.body.clientWidth;return t.style.overflow="hidden",t.style.boxSizing="border-box",t.style.paddingRight="".concat(n,"px"),function(){["overflow","boxSizing","paddingRight"].forEach((function(n){t.style[n]=e[n]||""}))}}()),a+=1)};e.default={show:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="v-overlay-".concat(Math.random().toString(36).substring(3,6)),n=document.createElement("div"),o=void 0===t.md?/android/.test(window.navigator.userAgent.toLocaleLowerCase()):t.md;if(n.id=e,n.classList.add("v-overlay",o?"v-overlay--md":"v-overlay--ios"),t.click&&n.addEventListener("click",(function(){t.click()})),t.zIndex&&(n.style.zIndex=t.zIndex),!1!==t.lock&&(t.unlock?v(t.unlock):v()),t.style){var i="";Object.keys(t.style).forEach((function(e){i+="".concat(e,":").concat(t.style[e],";")})),n.setAttribute("style",i)}return t.el?t.el.parentNode.insertBefore(n,t.el):document.body.appendChild(n),!1===t.show?e:(setTimeout((function(){n.classList.add("v-overlay--show")}),0),e)},hide:function(t){var e=t?document.getElementById(t):document.querySelector(".v-overlay");e&&(e.classList.remove("v-overlay--show"),function(t){if(!(o()||(a-=1)>0))if(r().ios||"function"!=typeof c){if(t){var e=d.indexOf(t);-1!==e&&(t.ontouchmove=null,t.ontouchstart=null,d.splice(e,1))}u&&(document.removeEventListener("touchmove",f,h),u=!1)}else c()}(),setTimeout((function(){e&&e.parentNode&&e.parentNode.removeChild(e)}),200))}}},function(t,e,n){"use strict";function o(t,e,n,o){var i,r=!1,a=0;function l(){i&&clearTimeout(i)}function s(){var s=this,c=Date.now()-a,u=arguments;function d(){a=Date.now(),n.apply(s,u)}r||(o&&!i&&d(),l(),void 0===o&&c>t?d():!0!==e&&(i=setTimeout(o?function(){i=void 0}:d,void 0===o?t-c:t)))}return"boolean"!=typeof e&&(o=n,n=e,e=void 0),s.cancel=function(){l(),r=!0},s}function i(t,e,n){return void 0===n?o(t,e,!1):o(t,n,!1!==e)}n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.r(e);n(19);e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dom,o=e.time,i=0,r=n||window,a=n?n.scrollTop||n.scrollY:window.scrollY,l=t||0,s=o||400,c=(l-a)/(s/1e3)/60,u=s/1e3*60|0;function d(){(i+=1)<u?(r.requestAnimFrame(d),r.scrollTo(0,a+c*i)):r.scrollTo(0,l)}r.requestAnimFrame||(r.requestAnimFrame=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}).bind(window)),s?d():r.scrollTo(0,l)}},function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"v-picker",style:{height:t.pickerHeight+"px"}},t._l(t.columnData,(function(e,o){return n("div",{key:o,ref:"column",refInFor:!0,staticClass:"v-picker__column",on:{scroll:function(e){return t.handleScroll(e,o)}}},[n("div",{staticClass:"v-picker__list",style:{height:e.length*t.itemHeight+"px"}},t._l(e,(function(e,i){return n("div",{key:e[t.valueName],staticClass:"v-picker__item",class:[{"is-active":t.columnCount>1?e[t.valueName]===t.selected[o]:e[t.valueName]===t.selected},{"is-disabled":!!e.disabled}],domProps:{textContent:t._s(e[t.labelName])},on:{click:function(n){return t.handleClick(e,o,i)}}})})),0)])})),0)};o._withStripped=!0;n(20);var i=n(6),r=n(2),a=n(7),l=n(10);function s(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c=function(t,e,n){var o=0;if(!n)return o;for(var i=0;i<t.length;i++)if(t[i][e]===n){o=i;break}return o},u={name:"PickerCore",mixins:[l.a],props:{valueData:{required:!0,type:[String,Number,Array]}},data:function(){var t,e=function t(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e.map((function(e){return e&&e[n]&&Object(r.a)(e[n])&&e[n].length?t(e[n],n,o+1):o}));return Math.max.apply(Math,s(i))}(this.list,this.childName),n=e>1?new Array(e).fill([]):[this.list],o=this.valueData;return e>1?(t=Object(r.a)(o)&&o.length?o:function t(e,n,o,i){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return i[a]=e[0][n],e[0][o]&&Object(r.a)(e[0][o])&&e[0][o].length&&t(e[0][o],n,o,i,a+1),i}(this.list,this.valueName,this.childName,new Array(e).fill(""))).length<e&&(t=t.concat(new Array(e-t.length).fill(""))):t=o||this.list[0][this.valueName],{columnCount:e,columnData:n,selected:t,changeIndex:0,initCount:0}},computed:{pickerHeight:function(){return this.itemHeight*this.itemCount},condition:function(){return this.itemCount%2?this.itemHeight:this.itemHeight/2},jumpCount:function(){return(this.itemCount-1)/2|0}},watch:{selected:{handler:function(t){this.refreshColumnData(t),this.$emit("update:valueData",t)},immediate:!0,deep:!0},valueData:function(t){this.selected=t}},mounted:function(){var t=this;this.$nextTick((function(){t.initValue()}))},methods:{initValue:function(){var t=this;if(Object(r.a)(this.selected))this.columnData.forEach((function(e,n){var o=c(t.columnData[n],t.valueName,t.selected[n]);setTimeout((function(){t.autoScrollColumn(t.columnData[n][o],n,o,0)}),20*n)}));else{var e=c(this.columnData[0],this.valueName,this.selected);this.autoScrollColumn(this.columnData[0][e],0,e,0)}},handleScroll:Object(i.b)(100,(function(t,e){var n,o=this,i=this.itemHeight,r=this.jumpCount,a=this.condition,l=t.target.scrollTop,s=this.columnData[e].length,c=s*i-this.pickerHeight;n=l<=0?0:l<=a?Math.ceil(l/(a/(r+1))):l>=c?s-1:l>=c-a?s-1-Math.ceil(r*((c-l)/a)):Math.ceil((l-a)/i+(l-a)/(c-2*a))+r+1;var u=this.columnData[e][n];u&&!u.disabled&&(this.changeIndex=e,this.columnCount>1?this.$set(this.selected,e,u[this.valueName]):this.selected=u[this.valueName],this.$nextTick((function(){o.updateDefSelected()})))})),handleClick:function(t,e,n){t&&t.disabled||(this.updateCurSelected(t,e),this.autoScrollColumn(t,e,n))},autoScrollColumn:function(t,e,n){var o,i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:400,l=this.itemHeight,s=this.condition,c=this.jumpCount,u=this.columnData[e].length,d=u*l-this.pickerHeight;o=n<=0?0:n<=c+1?s/(c+1)*n:n>=u-1?d:n>=u-1-c?d-s/c*(u-1-n)+1:s+(n-(c+1))*(1-1/(u-2-2*c))*l,Object(a.default)(o,{dom:this.$refs.column[e],time:r}),this.$nextTick((function(){i.initCount++}))},updateCurSelected:function(t,e){var n=t?t[this.valueName]:"";this.columnCount>1?this.$set(this.selected,e,n):this.selected=n,this.changeIndex=e},updateDefSelected:function(){var t=this.changeIndex,e=this.columnCount,n=this.valueName;if(!(t>=e-1||this.initCount<e)){var o=this.selected[t];-1===this.columnData[t+1].findIndex((function(t){return t[n]===o}))&&this.updateCurSelected(this.columnData[t+1][0],t+1)}},refreshColumnData:function(t){var e=this;if(Object(r.a)(t)){var n=[];t.forEach((function(o,i){i?n.push(function(t,e,n,o){for(var i=[],r=0;r<t.length;r++)if(t[r][n]===e){i=t[r][o]||[];break}return i}(n[i-1],t[i-1],e.valueName,e.childName)):n.push(e.list)})),this.columnData=n}}}},d=n(0),h=Object(d.a)(u,o,[],!1,null,null,null);h.options.__file="src/components/picker/pickerCore.vue";e.a=h.exports},function(t,e,n){},function(t,e,n){"use strict";e.a={props:{value:{type:[String,Number,Array],default:function(){return[]}},list:{required:!0,type:Array,default:function(){return[]}},labelName:{type:String,default:"text"},valueName:{type:String,default:"value"},childName:{type:String,default:"children"},itemHeight:{type:Number,default:44},itemCount:{type:Number,default:5}}}},,,,,function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"v-drawer",class:["v-drawer--"+t.from,{"v-drawer--offset":!t.offset&&!t.offsetVal}],style:t.drawerStyle},[n("transition",{attrs:{name:"v-drawer--transition"}},[t.show?n("div",{ref:"wrap",staticClass:"v-drawer__wrap",style:t.wrapStyle,on:{touchstart:function(t){t.stopPropagation()},touchmove:function(t){t.stopPropagation()},touchend:function(t){t.stopPropagation()}}},[t.count?t._l(t.count,(function(e,o){return n("div",{key:e,staticClass:"v-drawer__item",class:{strict:t.strict}},[t._t(""+o)],2)})):t._t("default"),t._v(" "),t.cancel?[n("div",{staticClass:"v-drawer__line"}),t._v(" "),n("div",{staticClass:"v-drawer__footer",domProps:{textContent:t._s(t.cancel)},on:{click:function(e){t.show=!1}}})]:t._e()],2):t._e()])],1)};o._withStripped=!0;n(23);var i=n(5),r={name:"VDrawer",props:{value:{type:Boolean,required:!0},count:{type:Number,default:0,validator:function(t){return t>=0}},strict:{type:Boolean,default:!1},cancel:{type:String,default:""},from:{type:String,default:"bottom",validator:function(t){return~["left","right","top","bottom"].indexOf(t)}},size:{type:String,default:"60%"},mask:{type:Boolean,default:!0},lock:{type:Boolean,default:!0},dropdown:{type:Boolean,default:!1},offset:{type:Number,default:0}},data:function(){return{show:!1,offsetVal:0,overlayId:""}},computed:{drawerStyle:function(){var t={},e=this.offsetVal,n=this.from,o=this.offset||e;switch(n){case"top":t.top="".concat(o,"px");break;case"bottom":t.bottom="".concat(o,"px");break;case"left":t.left="".concat(o,"px");break;case"right":t.right="".concat(o,"px")}return t},wrapStyle:function(){var t={},e=this.from,n=this.strict;if(~["top","bottom"].indexOf(e)){if(t.width="100%",t.left=0,"top"===e?t.top=0:t.bottom=0,n)return t;t.height=this.size}else{if(t.height="100%",t.bottom=0,"left"===e?t.left=0:t.right=0,n)return t;t.width=this.size}return t}},watch:{value:function(t){this.dropdown&&t?this.calcParentRect():(this.toggle(t),this.show=t)},show:function(t){this.$emit("input",t)}},mounted:function(){this.value&&(this.show=!0,this.toggle(!0))},methods:{calcParentRect:function(){if(this.offset)return this.toggle(!0),void(this.show=!0);var t=this.$el.parentNode.getBoundingClientRect();switch(this.from){case"top":this.offsetVal=t.top+t.height;break;case"bottom":this.offsetVal=document.documentElement.clientHeight-t.top;break;case"left":this.offsetVal=t.left+t.width;break;case"right":this.offsetVal=document.documentElement.clientWidth-t.left}this.toggle(!0),this.show=!0},toggle:function(t){var e=this;this.$nextTick((function(){if(t){if(e.overlayId)return;e.overlayId=i.default.show({el:e.$refs.wrap,show:e.mask,lock:e.lock,style:e.drawerStyle,unlock:e.$refs.wrap,click:function(){e.show=!1}})}else i.default.hide(e.overlayId),e.overlayId=""}))}}},a=n(0),l=Object(a.a)(r,o,[],!1,null,null,null);l.options.__file="src/components/drawer/drawer.vue";e.a=l.exports},,,function(t,e,n){"use strict";n(24);var o=n(6),i=n(7),r=function(){var t={open:function(){},close:function(){}};if("undefined"==typeof window)return t;var e=document.createElement("div");document.documentElement.appendChild(e),e.style.WebkitOverflowScrolling="touch";var n="getComputedStyle"in window&&"touch"===window.getComputedStyle(e)["-webkit-overflow-scrolling"];if(document.documentElement.removeChild(e),!n)return t;var o=0,i=!1;try{var r=Object.defineProperty({},"passive",{get:function(){return i=!0,null}});window.addEventListener("test",null,r)}catch(c){}var a=window.innerWidth/window.document.documentElement.clientWidth,l=function(t){if(1===a&&!(t.touches.length>1)){for(var e=t.target;e!==document.body&&e!==document;){var n=window.getComputedStyle(e);if(!n)break;if("INPUT"===e.nodeName&&"range"===e.getAttribute("type"))return;var i=n.getPropertyValue("overflow-y"),r=n.getPropertyValue("overflow-x");if(("auto"===r||"scroll"===r)&&"hidden"===i)return;var l=n.getPropertyValue("-webkit-overflow-scrolling"),s=parseInt(n.getPropertyValue("height"),10),c="touch"===l&&("auto"===i||"scroll"===i),u=e.scrollHeight>e.offsetHeight;if(c&&u){var d=t.touches?t.touches[0].screenY:t.screenY,h=o<=d&&0===e.scrollTop,f=o>=d&&e.scrollHeight-e.scrollTop===s;return void((h||f)&&t.preventDefault())}e=e.parentNode}t.preventDefault()}},s=function(t){o=t.touches?t.touches[0].screenY:t.screenY};return{open:function(){window.__ios_scroll_fixed__||(window.addEventListener("touchstart",s,!!i&&{passive:!1}),window.addEventListener("touchmove",l,!!i&&{passive:!1}),window.__ios_scroll_fixed__=!0)},close:function(){window.removeEventListener("touchstart",s,!1),window.removeEventListener("touchmove",l,!1),window.__ios_scroll_fixed__=!1}}}(),a={name:"VScroller",props:{preloadTop:{type:Number,default:50},preloadBottom:{type:Number,default:50},eventStep:{type:Number,default:1},throttle:{type:Number,default:-1},tag:{type:String,default:"div"},height:{type:String,default:"100%"}},data:function(){return{lastScrollTop:0,lastTouchY:0,refreshing:!1}},beforeMount:function(){r.open()},beforeDestroy:function(){r.close()},methods:{scrollY:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400;this.$el&&Object(i.default)(t,{dom:this.$el,time:e})},_handleStart:function(t){this.lastTouchY=t.touches[0].clientY},_handleMove:function(t){var e=t.touches[0].clientY-this.lastTouchY;if(e>0&&this.lastScrollTop<=0){if(!this.refreshing&&e<this.eventStep)return;this.refreshing=!0,this.$emit("refresh",{event:t,offset:e})}},_handleEnd:function(){this.refreshing&&(this.$emit("refresh-end"),this.refreshing=!1)},_handleScroll:function(t){var e=t.target.scrollTop,n=this.lastScrollTop-e,o=n>0;if(o)e>=0&&e<=this.preloadTop&&n>=this.eventStep&&this.$emit("top");else{var i=this.$el;i.scrollHeight-i.clientHeight-e<=this.preloadBottom&&this.$emit("bottom")}this.lastScrollTop=e,this.$emit("scroll",{offsetTop:e,isUp:o})}},render:function(t){var e={},n=this.throttle;return n>=0&&(e["&scroll"]=n>0?Object(o.b)(n,this._handleScroll):this._handleScroll,e["&touchstart"]=this._handleStart,e["&touchmove"]=this._handleMove,e["&touchend"]=this._handleEnd),t(this.tag,{style:{height:this.height,"overflow-y":"auto","-webkit-overflow-scrolling":"touch"},class:"v-scroller",on:e},this.$slots.default)}},l=n(0),s=Object(l.a)(a,void 0,void 0,!1,null,null,null);s.options.__file="src/components/scroller/scroller.vue";e.a=s.exports},function(t,e,n){},function(t,e,n){},,,function(t,e,n){},function(t,e,n){},,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("VDrawer",{attrs:{from:"bottom",size:t.itemHeight*t.itemCount+(t.hasHeader?t.headerHeight:0)+"px",lock:!1},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},[n("VScroller",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.hasHeader,expression:"hasHeader"}],staticClass:"v-picker__header",style:{height:t.headerHeight+"px"}},[t._t("header")],2),t._v(" "),n("PickerCore",{attrs:{list:t.list,"value-data":t.valueData,"label-name":t.labelName,"value-name":t.valueName,"child-name":t.childName,"item-height":t.itemHeight,"item-count":t.itemCount},on:{"update:valueData":function(e){t.valueData=e},"update:value-data":function(e){t.valueData=e}}})],1)],1)};o._withStripped=!0;n(20);var i=n(15),r=n(18),a=n(8),l=n(10),s={name:"VPicker",components:{VDrawer:i.a,VScroller:r.a,PickerCore:a.a},mixins:[l.a],props:{show:{type:Boolean,default:!1},headerHeight:{type:Number,default:44}},data:function(){return{visible:this.show,valueData:this.value}},computed:{hasHeader:function(){return this.$slots.header}},watch:{show:function(t){this.visible=t},value:function(t){this.valueData=t},visible:function(t){this.$emit("update:show",t)},valueData:function(t){this.$emit("input",t)}}},c=n(0),u=Object(c.a)(s,o,[],!1,null,null,null);u.options.__file="src/components/picker/picker.vue";var d=u.exports;e.default=d}])})); |
{ | ||
"name": "@calibur/sakura", | ||
"version": "1.5.10", | ||
"version": "1.6.0", | ||
"description": "bilibili h5 vue components", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
857272
6