From 79f534e014b2303905591ee498eca1a59dc96c66 Mon Sep 17 00:00:00 2001 From: alvin Date: Fri, 19 Mar 2021 15:17:08 +0900 Subject: [PATCH] =?UTF-8?q?juijs-grid=20=EB=B2=84=EC=A0=84=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundles/index.js | 2 +- dist/vue-sheets.base.js | 2 +- dist/vue-sheets.classic.js | 2 +- dist/vue-sheets.css | 2 +- dist/vue-sheets.dark.js | 2 +- package-lock.json | 28 +++++++++++++++++++++------- package.json | 6 +++--- src/base/methods.js | 8 ++++---- src/components/table.classic.vue | 2 -- src/components/table.dark.vue | 2 -- src/components/xtable.classic.vue | 2 -- src/components/xtable.dark.vue | 2 -- 12 files changed, 33 insertions(+), 27 deletions(-) diff --git a/bundles/index.js b/bundles/index.js index eba7116..de71610 100644 --- a/bundles/index.js +++ b/bundles/index.js @@ -15,7 +15,7 @@ window.vm = new Vue({ activeIndex: 0, columns: [ { key: null, name: "", width: "30px" }, - { key: "name", name: "이름", width: "200px" }, + { key: "name", name: "이름", width: "200px", sort: true }, { key: "age", name: "나이", edit: true, active: true }, { key: "location", name: "지역", active: false }, ], diff --git a/dist/vue-sheets.base.js b/dist/vue-sheets.base.js index c2365cd..0949bee 100644 --- a/dist/vue-sheets.base.js +++ b/dist/vue-sheets.base.js @@ -1 +1 @@ -!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},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=35)}([function(t,e,n){"use strict";function i(t,e,n,i,o,r,l,u){var s,a="function"==typeof t?t.options:t;if(e&&(a.render=e,a.staticRenderFns=n,a._compiled=!0),i&&(a.functional=!0),r&&(a._scopeId="data-v-"+r),l?(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__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(l)},a._ssrRegister=s):o&&(s=u?function(){o.call(this,this.$root.$options.shadowRoot)}:o),s)if(a.functional){a._injectStyles=s;var c=a.render;a.render=function(t,e){return s.call(e),c(t,e)}}else{var f=a.beforeCreate;a.beforeCreate=f?[].concat(f,s):[s]}return{exports:t,options:a}}n.d(e,"a",function(){return i})},function(t,e){t.exports=jQuery},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(n(32));e.default=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{tableType:{type:String,required:!1,default:"classic"},tableSize:{type:String,required:!1,default:"normal"},tableEffect:{type:String,required:!1,default:"hover"},tableWidth:{type:[Number,String],required:!1,default:"100%"},columns:{type:Array,required:!0},data:{type:Array,required:!1,default:null},scroll:{type:String,required:!1,default:"vscroll"},scrollHeight:{type:Number,required:!1,default:200},resize:{type:Boolean,required:!1,default:!1},sortKey:{type:String,required:!1,default:null},sortOrder:{type:String,required:!1,default:"asc"},selectRowEffect:{type:Boolean,required:!1,default:!1},selectRowIndex:{type:Number|String,required:!1,default:-1},activeMenu:{type:Boolean,required:!1,default:!1},menuLeft:{type:Number,required:!1,default:0},menuTop:{type:Number,required:!1,default:0},templateRow:{type:String,required:!1,default:null},templateNone:{type:String,required:!1,default:null},templateExpand:{type:String,required:!1,default:null},templateMenu:{type:String,required:!1,default:null}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={computed:{columnKeys:function(){return this.columns.map(function(t){return t.key?t.key:null})},columnNames:function(){return this.columns.map(function(t){return t.name})},columnWidths:function(){return this.columns.map(function(t){return t.width?t.width:"auto"})},columnSorts:function(){return this.columns.map(function(t){return t.sort?t.key:null}).filter(function(t){return null!=t})},columnActives:function(){var t=[];return this.columns.forEach(function(e,n){!1!==e.active&&t.push(n)}),t}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={watch:{data:function(t,e){null!=t&&(0==t.length?this.sheet.reset():this.sheet.update(this.data),this.$emit("update",this.sheet.list()))},activeMenu:function(t,e){t!=e&&(t?this.sheet.showColumnMenu(this.menuLeft,this.menuTop):this.sheet.hideColumnMenu())},templateRow:function(t,e){t!=e&&this.sheet.setTpl("row",t)},templateNone:function(t,e){t!=e&&this.sheet.setTpl("none",t)},selectRowIndex:function(t,e){t!=e&&this.sheet.select(t)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){return t&&t.__esModule?t:{default:t}}(n(1));e.default={methods:{parsingTpl:function(t){var e=this.$options._scopeId,n=t||"";return void 0!==e&&(n=(n=(n=n.split("");"desc"==t.order&&(e=(0,i.default)("")),e.attr(this.$options._scopeId,!0),e.css({position:"static",float:"right","margin-left":"-20px"}),(0,i.default)(t.element).find("i").remove(),(0,i.default)(t.element).append(e)},setMultiSortEffect:function(t){(0,i.default)(t.element).find("i").remove();var e=null;"desc"==t.order?e=(0,i.default)(""):"asc"==t.order&&(e=(0,i.default)("")),null!=e&&(e.attr(this.$options._scopeId,!0),e.css({position:"static",float:"right","margin-left":"-20px"}),(0,i.default)(t.element).append(e))}}}},function(t,e,n){"use strict";n.r(e);var i=n(8),o=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(n(23)),o=s(n(3)),r=s(n(4)),l=s(n(5)),u=s(n(6));function s(t){return t&&t.__esModule?t:{default:t}}i.default.mixins=[o.default,r.default,l.default,u.default],e.default=i.default},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var i=n(11),o=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(n(23)),o=s(n(3)),r=s(n(4)),l=s(n(5)),u=s(n(6));function s(t){return t&&t.__esModule?t:{default:t}}i.default.mixins=[o.default,r.default,l.default,u.default],e.default=i.default},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var i=n(14),o=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(n(23)),o=s(n(3)),r=s(n(4)),l=s(n(5)),u=s(n(6));function s(t){return t&&t.__esModule?t:{default:t}}i.default.mixins=[o.default,r.default,l.default,u.default],e.default=i.default},function(t,e,n){"use strict";n.r(e);var i=n(16),o=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(n(25)),o=s(n(3)),r=s(n(4)),l=s(n(5)),u=s(n(6));function s(t){return t&&t.__esModule?t:{default:t}}i.default.mixins=[o.default,r.default,l.default,u.default],e.default=i.default},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var i=n(19),o=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(n(25)),o=s(n(3)),r=s(n(4)),l=s(n(5)),u=s(n(6));function s(t){return t&&t.__esModule?t:{default:t}}i.default.mixins=[o.default,r.default,l.default,u.default],e.default=i.default},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var i=n(22),o=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);e.default=o.a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s(n(25)),o=s(n(3)),r=s(n(4)),l=s(n(5)),u=s(n(6));function s(t){return t&&t.__esModule?t:{default:t}}i.default.mixins=[o.default,r.default,l.default,u.default],e.default=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(2)),o=r(n(24));function r(t){return t&&t.__esModule?t:{default:t}}i.default.use(o.default),e.default={name:"sheets-table",props:{dragRow:{type:Boolean,required:!1,default:!1}},computed:{tableStyle:function(){return{width:"number"==typeof this.tableWidth?this.tableWidth+"px":this.tableWidth}},columnEdits:function(){return this.columns.map(function(t){return t.edit?t.key:null}).filter(function(t){return null!=t})}},mounted:function(){var t=this,e={fields:this.columnKeys,colshow:this.columnActives,scroll:"scroll"==this.scroll,scrollHeight:this.scrollHeight,resize:this.resize,sort:this.columnSorts,sortIndex:this.sortKey,sortOrder:this.sortOrder,moveRow:this.dragRow,editRow:this.columnEdits.length>0&&this.columnEdits,expand:null!==this.templateExpand,tpl:this.createTplOptions(),event:{click:function(e,n){n&&(t.selectRowEffect&&this.select(e.index),t.$emit("click",e,n))},rowmenu:function(e,n){n&&(t.selectRowEffect&&this.select(e.index),t.$emit("rclick",e,n))},dblclick:function(e,n){n&&t.$emit("dblclick",e,n)},sort:function(e,n){n&&(t.setSortEffect(e),t.$emit("sort",{column:e,data:this.list()},n))},expand:function(e,n){n&&t.$emit("expand",e,n)},expandend:function(e,n){n&&t.$emit("expandend",e,n)},move:function(e,n){n&&t.$emit("drag",e,n)},moveend:function(e,n){n&&t.$emit("dragend",e,n)},editstart:function(e,n){n&&(t.$emit("edit",e,n),t.replaceScopedHash(".edit"))},editend:function(e,n){n&&t.$emit("editend",e,n)},colshow:function(e,n){n&&t.$emit("showcolumn",e,n)},colhide:function(e,n){n&&t.$emit("hidecolumn",e,n)},colmenu:function(e,n){n&&t.$emit("columnmenu",e,n)}}};this.sheet=i.default.create("grid.table",this.$el,e),null!=this.data&&(this.sheet.update(this.data),this.$emit("update",this.sheet.list()))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=a(n(1)),r=a(n(2)),l=a(n(39)),u=a(n(40)),s=a(n(33));function a(t){return t&&t.__esModule?t:{default:t}}r.default.use(u.default,s.default),o.default.fn.jbinder=function(t){var e=[],n=o.default.extend({target:null,attr:"data-bind"},t);return(0,o.default)(this).each(function(t){var i=new l.default(this,n);e[t]=null!=n.target?o.default.extend(n.target,i):i}),1==e.length?e[0]:e},e.default={name:"grid.table",extend:"event",component:function(){var t=r.default.include("util.base"),e=r.default.include("ui.dropdown"),n=r.default.include("grid.base"),l=r.default.include("grid.row");t.resize(function(){for(var t=r.default.get("grid.table"),e=0;e