11 lines
3.9 KiB
JavaScript
11 lines
3.9 KiB
JavaScript
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/u-waterfall/u-waterfall"],{"48fd":function(t,e,i){"use strict";i.r(e);var n=i("52f2"),s=i("612c");for(var r in s)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(r);i("abaf");var u=i("828b"),a=Object(u["a"])(s["default"],n["b"],n["c"],!1,null,"46116c64",null,!1,n["a"],void 0);e["default"]=a.exports},"52f2":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement;this._self._c;this.$initSSP(),"augmented"===this.$scope.data.scopedSlotsCompiler&&(this.$setSSP("left",{leftList:this.leftList}),this.$setSSP("right",{rightList:this.rightList})),this.$callSSP()},s=[]},"612c":function(t,e,i){"use strict";i.r(e);var n=i("88b3"),s=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);e["default"]=s.a},"88b3":function(t,e,i){"use strict";(function(t){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=n(i("7eb4")),r=n(i("ee10")),u={name:"u-waterfall",props:{value:{type:Array,required:!0,default:function(){return[]}},addTime:{type:[Number,String],default:200},idKey:{type:String,default:"id"}},data:function(){return{leftList:[],rightList:[],tempList:[],children:[]}},watch:{copyFlowList:function(t,e){var i=Array.isArray(e)&&e.length>0?e.length:0;this.tempList=this.tempList.concat(this.cloneData(t.slice(i))),this.splitData()}},mounted:function(){this.tempList=this.cloneData(this.copyFlowList),this.splitData()},computed:{copyFlowList:function(){return this.cloneData(this.value)}},methods:{splitData:function(){var t=this;return(0,r.default)(s.default.mark((function e(){var i,n,r;return s.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.tempList.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.$uGetRect("#u-left-column");case 4:return i=e.sent,e.next=7,t.$uGetRect("#u-right-column");case 7:if(n=e.sent,r=t.tempList[0],r){e.next=11;break}return e.abrupt("return");case 11:i.height<n.height?t.leftList.push(r):i.height>n.height?t.rightList.push(r):t.leftList.length<=t.rightList.length?t.leftList.push(r):t.rightList.push(r),t.tempList.splice(0,1),t.tempList.length&&setTimeout((function(){t.splitData()}),t.addTime);case 14:case"end":return e.stop()}}),e)})))()},$uGetRect:function(e,i){var n=this;return new Promise((function(s){t.createSelectorQuery().in(n)[i?"selectAll":"select"](e).boundingClientRect((function(t){i&&Array.isArray(t)&&t.length&&s(t),!i&&t&&s(t)})).exec()}))},cloneData:function(t){return JSON.parse(JSON.stringify(t))},clear:function(){this.leftList=[],this.rightList=[],this.$emit("input",[]),this.tempList=[]},remove:function(t){var e=this,i=-1;i=this.leftList.findIndex((function(i){return i[e.idKey]==t})),-1!=i?this.leftList.splice(i,1):(i=this.rightList.findIndex((function(i){return i[e.idKey]==t})),-1!=i&&this.rightList.splice(i,1)),i=this.value.findIndex((function(i){return i[e.idKey]==t})),-1!=i&&this.$emit("input",this.value.splice(i,1))},modify:function(t,e,i){var n=this,s=-1;if(s=this.leftList.findIndex((function(e){return e[n.idKey]==t})),-1!=s?this.leftList[s][e]=i:(s=this.rightList.findIndex((function(e){return e[n.idKey]==t})),-1!=s&&(this.rightList[s][e]=i)),s=this.value.findIndex((function(e){return e[n.idKey]==t})),-1!=s){var r=this.cloneData(this.value);r[s][e]=i,this.$emit("input",r)}}}};e.default=u}).call(this,i("df3c")["default"])},"9da4":function(t,e,i){},abaf:function(t,e,i){"use strict";var n=i("9da4"),s=i.n(n);s.a}}]);
|
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
|
'components/u-waterfall/u-waterfall-create-component',
|
|
{
|
|
'components/u-waterfall/u-waterfall-create-component':(function(module, exports, __webpack_require__){
|
|
__webpack_require__('df3c')['createComponent'](__webpack_require__("48fd"))
|
|
})
|
|
},
|
|
[['components/u-waterfall/u-waterfall-create-component']]
|
|
]);
|