From 705ba5c74727b8f407f813aba0142da9b49bef22 Mon Sep 17 00:00:00 2001 From: cenzhende Date: Wed, 16 Nov 2016 10:21:10 +0800 Subject: [PATCH] build v1.0.4 --- lib/vue-waterfall.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vue-waterfall.min.js b/lib/vue-waterfall.min.js index 2be2bca..ae7f466 100644 --- a/lib/vue-waterfall.min.js +++ b/lib/vue-waterfall.min.js @@ -3,4 +3,4 @@ * (c) 2016 MopTym * https://github.com/MopTym/vue-waterfall */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Waterfall=e():t.Waterfall=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var r=n(1),o=i(r),a=n(8),s=i(a);t.exports={Waterfall:o.default,WaterfallSlot:s.default,waterfall:o.default,waterfallSlot:s.default}},function(t,e,n){var i,r;n(2),i=n(6);var o=n(7);r=i=i||{},"object"!=typeof i.default&&"function"!=typeof i.default||(r=i=i.default),"function"==typeof r&&(r=r.options),r.render=o.render,r.staticRenderFns=o.staticRenderFns,t.exports=i},function(t,e,n){var i=n(3);"string"==typeof i&&(i=[[t.id,i,""]]);n(5)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){e=t.exports=n(4)(),e.push([t.id,".vue-waterfall{position:relative}",""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e=0&&m.splice(e,1)}function s(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function u(t,e){var n,i,r;if(e.singleton){var o=g++;n=v||(v=s(e)),i=f.bind(null,n,o,!1),r=f.bind(null,n,o,!0)}else n=s(e),i=l.bind(null,n),r=function(){a(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}function f(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=w(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function l(t,e){var n=e.css,i=e.media,r=e.sourceMap;if(i&&t.setAttribute("media",i),r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var c={},d=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},h=d(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),p=d(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,g=0,m=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=h()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=r(t);return i(n,e),function(t){for(var o=[],a=0;a3&&void 0!==arguments[3]&&arguments[3];t.addEventListener(e,n,i)}function M(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.removeEventListener(e,n,i)}Object.defineProperty(e,"__esModule",{value:!0});var L="_wfMoveClass";e.default={props:{autoResize:{default:!0},interval:{default:200,validator:function(t){return t>=0}},align:{default:"left",validator:function(t){return~["left","right","center"].indexOf(t)}},line:{default:"v",validator:function(t){return~["v","h"].indexOf(t)}},lineGap:{required:!0,validator:function(t){return t>=0}},minLineGap:{validator:function(t){return t>=0}},maxLineGap:{validator:function(t){return t>=0}},singleMaxWidth:{validator:function(t){return t>=0}},fixedHeight:{default:!1},grow:{validator:function(t){return t instanceof Array}},watch:{default:function(){return{}}}},data:function(){return{style:{height:"",overflow:""},token:null}},methods:{reflowHandler:r,autoResizeHandler:n,reflow:o},created:function(){var t=this;this.virtualRects=[],this.$on("reflow",function(){t.reflowHandler()}),this.$watch(function(){return t.align,t.line,t.lineGap,t.minLineGap,t.maxLineGap,t.singleMaxWidth,t.fixedHeight,t.watch},this.reflowHandler),this.$watch("grow",this.reflowHandler)},mounted:function(){this.$watch("autoResize",this.autoResizeHandler),G(this.$el,g(),i,!0),this.autoResizeHandler(this.autoResize)},beforeDestroy:function(){this.autoResizeHandler(!1),M(this.$el,g(),i,!0)}};var R=function(){function t(t,i,r,o){var a=t.$el.clientWidth,s=i.grow,u=s?n(a,s):e(a,i),f=m(0,u.count);r.forEach(function(t,e){var n=f.reduce(function(t,e,n){return e=t)n=1,i=Math.max(t,e.minLineGap);else{var r=e.maxLineGap*~~n,o=e.minLineGap*~~(n+1),a=r>=t,s=o<=t;a&&s?(n=Math.round(n),i=t/n):a?(n=~~n,i=t/n):s?(n=~~(n+1),i=t/n):(n=~~n,i=e.maxLineGap),1===n&&(i=Math.min(t,e.singleMaxWidth),i=Math.max(i,e.minLineGap))}return{width:m(i,n),count:n,left:f(t,i*n,e.align)}}function n(t,e){var n=l(e);return{width:e.map(function(e){return t*e/n}),count:e.length,left:0}}return{calculate:t}}(),C=function(){function t(t,n,i,r){for(var o=t.$el.clientWidth,a=i.length,s=0,u=0;u=0;a--){var s=n[i+a];o+=s.width*e.lineGap/s.height}var u=e.lineGap*t/o,f=u<=e.maxLineGap&&u>=e.minLineGap;if(f)return{cost:Math.abs(e.lineGap-u),count:r,width:t,height:u};var l=o>t?e.minLineGap:e.maxLineGap;return{cost:1/0,count:r,width:o*l/e.lineGap,height:l}}function r(t,e,n){return t.cost===1/0&&e.cost===1/0?e.width=t.cost?t:e}return{calculate:t}}()},function(t,e){t.exports={render:function(){var t=this;return t._h("div",{staticClass:"vue-waterfall",style:t.style},[t._t("default")])},staticRenderFns:[]}},function(t,e,n){var i,r;n(9),i=n(11);var o=n(12);r=i=i||{},"object"!=typeof i.default&&"function"!=typeof i.default||(r=i=i.default),"function"==typeof r&&(r=r.options),r.render=o.render,r.staticRenderFns=o.staticRenderFns,t.exports=i},function(t,e,n){var i=n(10);"string"==typeof i&&(i=[[t.id,i,""]]);n(5)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){e=t.exports=n(4)(),e.push([t.id,".vue-waterfall-slot{position:absolute;margin:0;padding:0;box-sizing:border-box}",""])},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={data:function(){return{isShow:!1}},props:{width:{required:!0,validator:function(t){return t>=0}},height:{required:!0,validator:function(t){return t>=0}},order:{default:0},moveClass:{default:""}},methods:{notify:function(){this.$parent.$emit("reflow",this)},getMeta:function(){return{vm:this,node:this.$el,order:this.order,width:this.width,height:this.height,moveClass:this.moveClass}}},created:function(){var t=this;this.rect={top:0,left:0,width:0,height:0},this.$watch(function(){return t.width,t.height},this.notify)},mounted:function(){var t=this;this.$parent.$once("reflowed",function(){t.isShow=!0}),this.notify()},destroyed:function(){this.notify()}}},function(t,e){t.exports={render:function(){var t=this;return t._h("div",{directives:[{name:"show",rawName:"v-show",value:t.isShow,expression:"isShow"}],staticClass:"vue-waterfall-slot"},[t._t("default")])},staticRenderFns:[]}}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Waterfall=e():t.Waterfall=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var r=n(1),o=i(r),a=n(8),s=i(a);t.exports={Waterfall:o["default"],WaterfallSlot:s["default"],waterfall:o["default"],waterfallSlot:s["default"]}},function(t,e,n){var i,r;n(2),i=n(6);var o=n(7);r=i=i||{},("object"==typeof i["default"]||"function"==typeof i["default"])&&(r=i=i["default"]),"function"==typeof r&&(r=r.options),r.render=o.render,r.staticRenderFns=o.staticRenderFns,t.exports=i},function(t,e,n){var i=n(3);"string"==typeof i&&(i=[[t.id,i,""]]);n(5)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){e=t.exports=n(4)(),e.push([t.id,".vue-waterfall{position:relative}",""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e=0&&m.splice(e,1)}function s(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function u(t,e){var n,i,r;if(e.singleton){var o=g++;n=v||(v=s(e)),i=f.bind(null,n,o,!1),r=f.bind(null,n,o,!0)}else n=s(e),i=l.bind(null,n),r=function(){a(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}function f(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=w(e,r);else{var o=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function l(t,e){var n=e.css,i=e.media,r=e.sourceMap;if(i&&t.setAttribute("media",i),r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var c={},d=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},h=d(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),p=d(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,g=0,m=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=h()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=r(t);return i(n,e),function(t){for(var o=[],a=0;ar;r++)i[r]=n();return i}function w(t,e){if(!y(t,e)){var n=b(t,"class").trim(),i=(n+" "+e).trim();b(t,"class",i)}}function x(t,e){var n=new RegExp("\\s*\\b"+e+"\\b\\s*","g"),i=b(t,"class").replace(n," ").trim();b(t,"class",i)}function y(t,e){return new RegExp("\\b"+e+"\\b").test(b(t,"class"))}function b(t,e,n){return"undefined"==typeof n?t.getAttribute(e)||"":void t.setAttribute(e,n)}function G(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];t.addEventListener(e,n,i)}function M(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];t.removeEventListener(e,n,i)}Object.defineProperty(e,"__esModule",{value:!0});var L="_wfMoveClass";e["default"]={props:{autoResize:{"default":!0},interval:{"default":200,validator:function(t){return t>=0}},align:{"default":"left",validator:function(t){return~["left","right","center"].indexOf(t)}},line:{"default":"v",validator:function(t){return~["v","h"].indexOf(t)}},lineGap:{required:!0,validator:function(t){return t>=0}},minLineGap:{validator:function(t){return t>=0}},maxLineGap:{validator:function(t){return t>=0}},singleMaxWidth:{validator:function(t){return t>=0}},fixedHeight:{"default":!1},grow:{validator:function(t){return t instanceof Array}},watch:{"default":function(){return{}}}},data:function(){return{style:{height:"",overflow:""},token:null}},methods:{reflowHandler:r,autoResizeHandler:n,reflow:o},created:function(){var t=this;this.virtualRects=[],this.$on("reflow",function(){t.reflowHandler()}),this.$watch(function(){return t.align,t.line,t.lineGap,t.minLineGap,t.maxLineGap,t.singleMaxWidth,t.fixedHeight,t.watch},this.reflowHandler),this.$watch("grow",this.reflowHandler)},mounted:function(){this.$watch("autoResize",this.autoResizeHandler),G(this.$el,g(),i,!0),this.autoResizeHandler(this.autoResize)},beforeDestroy:function(){this.autoResizeHandler(!1),M(this.$el,g(),i,!0)}};var R=function(){function t(t,i,r,o){var a=t.$el.clientWidth,s=i.grow,u=s?n(a,s):e(a,i),f=m(0,u.count);r.forEach(function(t,e){var n=f.reduce(function(t,e,n){return e=t)n=1,i=Math.max(t,e.minLineGap);else{var r=e.maxLineGap*~~n,o=e.minLineGap*~~(n+1),a=r>=t,s=t>=o;a&&s?(n=Math.round(n),i=t/n):a?(n=~~n,i=t/n):s?(n=~~(n+1),i=t/n):(n=~~n,i=e.maxLineGap),1===n&&(i=Math.min(t,e.singleMaxWidth),i=Math.max(i,e.minLineGap))}return{width:m(i,n),count:n,left:f(t,i*n,e.align)}}function n(t,e){var n=l(e);return{width:e.map(function(e){return t*e/n}),count:e.length,left:0}}return{calculate:t}}(),C=function(){function t(t,n,i,r){for(var o=t.$el.clientWidth,a=i.length,s=0,u=0;a>u;){for(var f,l,c=e(o,n,i,u),d=0,h=0;d=a;o++)a+=n[o].width*e/n[o].height,r++;return r}function i(t,e,n,i,r){for(var o=0,a=r-1;a>=0;a--){var s=n[i+a];o+=s.width*e.lineGap/s.height}var u=e.lineGap*t/o,f=u<=e.maxLineGap&&u>=e.minLineGap;if(f)return{cost:Math.abs(e.lineGap-u),count:r,width:t,height:u};var l=o>t?e.minLineGap:e.maxLineGap;return{cost:1/0,count:r,width:o*l/e.lineGap,height:l}}function r(t,e,n){return t.cost===1/0&&e.cost===1/0?e.width=t.cost?t:e}return{calculate:t}}()},function(module,exports){module.exports={render:function(){with(this)return _h("div",{staticClass:"vue-waterfall",style:style},[_t("default")])},staticRenderFns:[]}},function(t,e,n){var i,r;n(9),i=n(11);var o=n(12);r=i=i||{},("object"==typeof i["default"]||"function"==typeof i["default"])&&(r=i=i["default"]),"function"==typeof r&&(r=r.options),r.render=o.render,r.staticRenderFns=o.staticRenderFns,t.exports=i},function(t,e,n){var i=n(10);"string"==typeof i&&(i=[[t.id,i,""]]);n(5)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){e=t.exports=n(4)(),e.push([t.id,".vue-waterfall-slot{position:absolute;margin:0;padding:0;box-sizing:border-box}",""])},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={data:function(){return{isShow:!1}},props:{width:{required:!0,validator:function(t){return t>=0}},height:{required:!0,validator:function(t){return t>=0}},order:{"default":0},moveClass:{"default":""}},methods:{notify:function(){this.$parent.$emit("reflow",this)},getMeta:function(){return{vm:this,node:this.$el,order:this.order,width:this.width,height:this.height,moveClass:this.moveClass}}},created:function(){var t=this;this.rect={top:0,left:0,width:0,height:0},this.$watch(function(){return t.width,t.height},this.notify)},mounted:function(){var t=this;this.$parent.$once("reflowed",function(){t.isShow=!0}),this.notify()},destroyed:function(){this.notify()}}},function(module,exports){module.exports={render:function(){with(this)return _h("div",{directives:[{name:"show",value:isShow,expression:"isShow"}],staticClass:"vue-waterfall-slot"},[_t("default")])},staticRenderFns:[]}}])}); \ No newline at end of file