From 75d1f63d030e2af00cc594b25ea0f4bdbfd4ef39 Mon Sep 17 00:00:00 2001 From: robin Date: Mon, 6 Jan 2020 20:18:10 +0800 Subject: [PATCH] doc: upgrade version to 0.2.6 --- dist/index.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index b43e3f3..cb172db 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("FlexTable",[],t):"object"==typeof exports?exports.FlexTable=t():e.FlexTable=t()}(window,function(){return n={},e.m=t=[function(e,t,n){"use strict";function o(e,t,n,o,i,r,a,l){var s,d="function"==typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),o&&(d.functional=!0),r&&(d._scopeId="data-v-"+r),a?(s=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=s):i&&(s=l?function(){i.call(this,this.$root.$options.shadowRoot)}:i),s)if(d.functional){d._injectStyles=s;var u=d.render;d.render=function(e,t){return s.call(t),u(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,s):[s]}return{exports:e,options:d}}n.d(t,"a",function(){return o})},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={props:{calWidth:{type:Object,required:!0}},computed:{owner:function(){for(var e=this.$parent;e&&!e.tableId;)e=e.$parent;return e}},methods:{setCellStyle:function(e){var t=this.calWidth[e.key],n={};return t&&(n.width="".concat(t,"px"),n.flex="none"),e.align&&(n["text-align"]=e.align),n}}};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={name:"TableExpand",functional:!(t.default=void 0),props:{class:String,row:Object,render:Function,index:Number,column:{type:Object,default:null}},render:function(e,t){var n={row:t.props.row,index:t.props.index};return t.props.column&&(n.column=t.props.column),t.props.render(e,n)}};t.default=o},function(e,t,n){"use strict";n.r(t);var o=n(5),i=n.n(o);for(var r in o)"default"!==r&&function(e){n.d(t,e,function(){return o[e]})}(r);t.default=i.a},function(e,t,n){"use strict";var o=n(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(36)),r=o(n(37)),a=o(n(41)),l=o(n(42)),s=o(n(43)),d=o(n(47)),u=o(n(48)),c=o(n(49)),f=n(54),h="flex-table",p=1,b={name:"flexTable",components:{tableHead:i.default,tableBody:r.default,tableFoot:a.default,tableScrollBar:l.default,Spinner:s.default},props:{data:{type:Array,default:function(){return[]}},sum:{type:[Object,Boolean]},columns:{type:Array,default:function(){return[]}},loading:{type:Boolean,default:!1},height:{type:Number},resizable:{type:Boolean,default:!1},noData:{type:String,default:"No Data"},size:{type:String,default:"default"},theme:{type:String,default:"light"},asyncRender:{type:Number,default:0},minWidth:{type:Number,default:f.MIN_WIDTH},maxWidth:{type:Number}},data:function(){return{tableId:p++,rowHeight:{header:0,footer:0},dataList:[],style:{},calWidth:{},tableColumns:[],headerH:38,bodyH:0,footH:54,maxHeight:0,scrollTop:0,shouldEachRenderQueue:!1,hasFixedLeft:!1,hasFixedRight:!1,scrollYScrolling:!1,hoverIndex:void 0,colResize:{onColResizing:!1,originX:0,currentX:0,resizeIndex:-1,minX:0,maxX:1/0}}},computed:{wrapClasses:function(){var e=["".concat(h,"-wrap")];return"big"===this.size?e.push("".concat(h,"-big")):"small"===this.size&&e.push("".concat(h,"-small")),"dark"===this.theme&&e.push("".concat(h,"-dark")),this.showScrollBar&&e.push("has-scroll-bar"),e},fixedLeftWidth:function(){var e=this;return this.tableColumns.reduce(function(t,n){return"left"===n.fixed&&(t+=e.calWidth[n.key]),t},0)},fixedRightWidth:function(){var e=this;return this.tableColumns.reduce(function(t,n){return"right"===n.fixed&&(t+=e.calWidth[n.key]),t},0)},showScrollBar:function(){return this.bodyH>this.maxHeight}},mounted:function(){this.doLayout(),window.addEventListener("resize",this.doLayout),this.resizable&&(window.addEventListener("mouseup",this.onColResizeEnd),this.$el.addEventListener("mousemove",this.onColResizeMove))},watch:{data:{handler:function(){this.initData(),this.doLayout()},deep:!0,immediate:!0},height:function(e){this.calHeight()},columns:{handler:function(e){var t=[],n=[],o=[];e.forEach(function(e){"left"===e.fixed?t.push(e):"right"===e.fixed?n.push(e):o.push(e)}),this.tableColumns=[].concat(t,o,n)},immediate:!0},tableColumns:{handler:function(e){var t=this;this.doLayout(),this.$nextTick(function(){t.hasFixedLeft=t.computedFixedLeft(),t.hasFixedRight=t.computedFixedRight()}),this.$emit("update:columns",e)},deep:!0,immediate:!0},sum:function(){this.calHeight()},showScrollBar:function(){this.resize()}},updated:function(){},beforeDestroy:function(){this.shouldEachRenderQueue=!1,this._queueId=null,window.removeEventListener("resize",this.doLayout),window.removeEventListener("mouseup",this.onColResizeEnd),this.$el.removeEventListener("mousemove",this.onColResizeMove)},methods:{syncScroll:(0,u.default)(function(e){var t=e.target.scrollTop;this.scrollTop=t},20),updateHoverIndex:(0,d.default)(function(e){this.hoverIndex=e},50),handleMousewheel:function(e){var t=(0,c.default)(e);if(0o;(i||r)&&(e.preventDefault(),this.scrollTop+=Math.ceil(t.pixelY),this.scrollTop=Math.max(this.scrollTop,0))}},doLayout:(0,d.default)(function(){this.resize(),this.calHeight()},50,{leading:!0}),computedFixedLeft:function(){return this.tableColumns.some(function(e){return"left"===e.fixed})},computedFixedRight:function(){return this.tableColumns.some(function(e){return"right"===e.fixed})},initData:function(){var e=this;this._queueId=(new Date).getTime(),this.rowHeight={header:0,footer:0},this.dataList=[],0this.asyncRender?(this.shouldEachRenderQueue=!0,this.eachQueue(this.data,this.asyncRender,this._queueId)):this.$emit("on-render-done")):this.data.forEach(function(t,n){e.copyItem(t,n)})},copyItem:function(e,t){var n=JSON.parse(JSON.stringify(e));n._isChecked=!!n._checked,n._isDisabled=!!n._disabled,n._expanded=n.expandStatus||!!n._expanded,n._disableExpand=!!n._disableExpand,this.$set(this.rowHeight,t,0),this.dataList.push(n)},eachQueue:function(e,t,n){var o=this;if(this.shouldEachRenderQueue)return new Promise(function(i,r){requestAnimationFrame(function(){o._queueId!==n?r():(o.copyItem(e[t],t++),i())})}).then(function(){e.length<=t?(o.doLayout(),o.$emit("on-render-done"),o.shouldEachRenderQueue=!1):o.eachQueue(e,t,n)}).catch(function(){})},toggleSelect:function(e){var t=this.dataList[e];t._isDisabled||(t._isChecked=!t._isChecked);var n=this.getSelection(),o=JSON.parse(JSON.stringify(t));t._isChecked||this.$emit("on-selection-cancel",o),this.$emit("on-selection-change",n,o)},getSelection:function(){var e=[];return this.dataList.forEach(function(t){t._isChecked&&e.push(t)}),JSON.parse(JSON.stringify(e))},selectAll:function(e){var t=this.getSelection();this.dataList.forEach(function(t){t._isDisabled||(t._isChecked=e)});var n=this.getSelection();e?this.$emit("on-selection-change",n):this.$emit("on-all-cancel",t)},onColResizeMove:function(e){var t=this.colResize;if(t.onColResizing){var n=e.clientX-t.nTableLeft,o=n-t.originX;o<0&&o>=t.minX?t.currentX=n:0n.parts.length&&(o.parts.length=n.parts.length)}else{var a=[];for(i=0;iinput{opacity:0;position:absolute}.radio-component>input+label>.input-box{display:inline-block;border:1px solid #000;border-radius:50%;margin:0;padding:0;width:1em;height:1em;background:#fff;overflow:hidden;vertical-align:-5%;user-select:none}.radio-component>input+label>.input-box>.input-box-circle{display:block;margin:50%;width:0;height:0%;background:#000;border-radius:50%;opacity:0;transition:width .15s ease-in,height .15s ease-in,margin .15s ease-in}.radio-component>input:checked+label>.input-box>.input-box-circle{opacity:1;margin:22%;width:56%;height:56%}.radio-component>input:focus+label>.input-box{box-shadow:0 0 2px 3px #73b9ff}.radio-component>input:disabled+label{opacity:.7}",""])},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".checkbox-component>input{opacity:0;position:absolute}.checkbox-component>input+label>.input-box{display:inline-block;border:1px solid #000;border-radius:14%;margin:0;padding:0;width:1em;height:1em;background:#fff;overflow:hidden;vertical-align:-5%;user-select:none}.checkbox-component>input+label>.input-box>.input-box-tick{width:100%;height:100%}.checkbox-component>input+label>.input-box>.input-box-tick>path{opacity:0;stroke:#000;stroke-width:2.3px;stroke-dashoffset:20;stroke-dasharray:20;transition:stroke-dashoffset .15s ease-in}.checkbox-component>input:checked+label>.input-box>.input-box-tick>path{opacity:1;stroke-dashoffset:0}.checkbox-component>input:focus+label>.input-box{box-shadow:0 0 2px 3px rgba(115,185,255,.69)}.checkbox-component>input:disabled+label{opacity:.7}",""])},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"radio-component"},[n("input",{class:e.className,attrs:{type:"radio",id:e.id,name:e.name,required:e.required,disabled:e.disabled},domProps:{value:e.value,checked:e.state},on:{change:e.onChange}}),e._v(" "),n("label",{attrs:{for:e.id}},[e._t("input-box",[e._m(0)]),e._v(" "),e._t("default")],2)])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"input-box"},[t("span",{staticClass:"input-box-circle"})])}]}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"checkbox-component"},[n("input",{class:e.className,attrs:{type:"checkbox",id:e.id,name:e.name,required:e.required,disabled:e.disabled},domProps:{value:e.value,checked:e.state},on:{change:e.onChange}}),e._v(" "),n("label",{attrs:{for:e.id}},[e._t("input-box",[n("span",{staticClass:"input-box"},[n("svg",{staticClass:"input-box-tick",attrs:{viewBox:"0 0 16 16"}},[n("path",{attrs:{fill:"none",d:"M1.7,7.8l3.8,3.4l9-8.8"}})])])]),e._v(" "),e._t("default")],2)])},staticRenderFns:[]}},function(e,t,n){var o=n(8);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals),n(2)("141dde0d",o,!0)},function(e,t,n){var o=n(9);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals),n(2)("0734c2c4",o,!0)},function(e,t){e.exports=function(e,t){for(var n=[],o={},i=0;ithis.maxHeight}},mounted:function(){this.doLayout(),window.addEventListener("resize",this.doLayout),this.resizable&&(window.addEventListener("mouseup",this.onColResizeEnd),this.$el.addEventListener("mousemove",this.onColResizeMove))},watch:{data:{handler:function(){this.initData(),this.doLayout()},deep:!0,immediate:!0},height:function(e){this.calHeight()},columns:{handler:function(e){var t=[],n=[],o=[];e.forEach(function(e){"left"===e.fixed?t.push(e):"right"===e.fixed?n.push(e):o.push(e)}),this.tableColumns=[].concat(t,o,n)},immediate:!0},tableColumns:{handler:function(e){var t=this;this.doLayout(),this.$nextTick(function(){t.hasFixedLeft=t.computedFixedLeft(),t.hasFixedRight=t.computedFixedRight()}),this.$emit("update:columns",e)},deep:!0,immediate:!0},sum:function(){this.calHeight()},showScrollBar:function(){this.resize()}},updated:function(){},beforeDestroy:function(){this.shouldEachRenderQueue=!1,this._queueId=null,window.removeEventListener("resize",this.doLayout),window.removeEventListener("mouseup",this.onColResizeEnd),this.$el.removeEventListener("mousemove",this.onColResizeMove)},methods:{syncScroll:(0,u.default)(function(e){var t=e.target.scrollTop;this.scrollTop=t},20),updateHoverIndex:(0,d.default)(function(e){this.hoverIndex=e},50),handleMousewheel:function(e){var t=(0,c.default)(e);if(0o;(i||r)&&(e.preventDefault(),this.scrollTop+=Math.ceil(t.pixelY),this.scrollTop=Math.max(this.scrollTop,0))}},doLayout:(0,d.default)(function(){this.resize(),this.calHeight()},50,{leading:!0}),computedFixedLeft:function(){return this.tableColumns.some(function(e){return"left"===e.fixed})},computedFixedRight:function(){return this.tableColumns.some(function(e){return"right"===e.fixed})},initData:function(){var e=this;this._queueId=(new Date).getTime(),this.rowHeight={header:0,footer:0},this.dataList=[],0this.asyncRender?(this.shouldEachRenderQueue=!0,this.eachQueue(this.data,this.asyncRender,this._queueId)):this.$emit("on-render-done")):this.data.forEach(function(t,n){e.copyItem(t,n)})},copyItem:function(e,t){var n=JSON.parse(JSON.stringify(e));n._isChecked=!!n._checked,n._isDisabled=!!n._disabled,n._expanded=n.expandStatus||!!n._expanded,n._disableExpand=!!n._disableExpand,this.$set(this.rowHeight,t,0),this.dataList.push(n)},eachQueue:function(e,t,n){var o=this;if(this.shouldEachRenderQueue)return new Promise(function(i,r){requestAnimationFrame(function(){o._queueId!==n?r():(o.copyItem(e[t],t++),i())})}).then(function(){e.length<=t?(o.doLayout(),o.$emit("on-render-done"),o.shouldEachRenderQueue=!1):o.eachQueue(e,t,n)}).catch(function(){})},toggleSelect:function(e){var t=this.dataList[e];t._isDisabled||(t._isChecked=!t._isChecked);var n=this.getSelection(),o=JSON.parse(JSON.stringify(t));t._isChecked||this.$emit("on-selection-cancel",o),this.$emit("on-selection-change",n,o)},getSelection:function(){var e=[];return this.dataList.forEach(function(t){t._isChecked&&e.push(t)}),JSON.parse(JSON.stringify(e))},selectAll:function(e){var t=this.getSelection();this.dataList.forEach(function(t){t._isDisabled||(t._isChecked=e)});var n=this.getSelection();e?this.$emit("on-selection-change",n):this.$emit("on-all-cancel",t)},onColResizeMove:function(e){var t=this.colResize;if(t.onColResizing){var n=e.clientX-t.nTableLeft,o=n-t.originX;o<0&&o>=t.minX?t.currentX=n:0n.parts.length&&(o.parts.length=n.parts.length)}else{var a=[];for(i=0;iinput{opacity:0;position:absolute}.radio-component>input+label>.input-box{display:inline-block;border:1px solid #000;border-radius:50%;margin:0;padding:0;width:1em;height:1em;background:#fff;overflow:hidden;vertical-align:-5%;user-select:none}.radio-component>input+label>.input-box>.input-box-circle{display:block;margin:50%;width:0;height:0%;background:#000;border-radius:50%;opacity:0;transition:width .15s ease-in,height .15s ease-in,margin .15s ease-in}.radio-component>input:checked+label>.input-box>.input-box-circle{opacity:1;margin:22%;width:56%;height:56%}.radio-component>input:focus+label>.input-box{box-shadow:0 0 2px 3px #73b9ff}.radio-component>input:disabled+label{opacity:.7}",""])},function(e,t,n){(e.exports=n(0)(void 0)).push([e.i,".checkbox-component>input{opacity:0;position:absolute}.checkbox-component>input+label>.input-box{display:inline-block;border:1px solid #000;border-radius:14%;margin:0;padding:0;width:1em;height:1em;background:#fff;overflow:hidden;vertical-align:-5%;user-select:none}.checkbox-component>input+label>.input-box>.input-box-tick{width:100%;height:100%}.checkbox-component>input+label>.input-box>.input-box-tick>path{opacity:0;stroke:#000;stroke-width:2.3px;stroke-dashoffset:20;stroke-dasharray:20;transition:stroke-dashoffset .15s ease-in}.checkbox-component>input:checked+label>.input-box>.input-box-tick>path{opacity:1;stroke-dashoffset:0}.checkbox-component>input:focus+label>.input-box{box-shadow:0 0 2px 3px rgba(115,185,255,.69)}.checkbox-component>input:disabled+label{opacity:.7}",""])},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"radio-component"},[n("input",{class:e.className,attrs:{type:"radio",id:e.id,name:e.name,required:e.required,disabled:e.disabled},domProps:{value:e.value,checked:e.state},on:{change:e.onChange}}),e._v(" "),n("label",{attrs:{for:e.id}},[e._t("input-box",[e._m(0)]),e._v(" "),e._t("default")],2)])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"input-box"},[t("span",{staticClass:"input-box-circle"})])}]}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"checkbox-component"},[n("input",{class:e.className,attrs:{type:"checkbox",id:e.id,name:e.name,required:e.required,disabled:e.disabled},domProps:{value:e.value,checked:e.state},on:{change:e.onChange}}),e._v(" "),n("label",{attrs:{for:e.id}},[e._t("input-box",[n("span",{staticClass:"input-box"},[n("svg",{staticClass:"input-box-tick",attrs:{viewBox:"0 0 16 16"}},[n("path",{attrs:{fill:"none",d:"M1.7,7.8l3.8,3.4l9-8.8"}})])])]),e._v(" "),e._t("default")],2)])},staticRenderFns:[]}},function(e,t,n){var o=n(8);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals),n(2)("141dde0d",o,!0)},function(e,t,n){var o=n(9);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals),n(2)("0734c2c4",o,!0)},function(e,t){e.exports=function(e,t){for(var n=[],o={},i=0;i