diff --git a/dist/v-selectpage.js b/dist/v-selectpage.js index 8a289a0..60df792 100644 --- a/dist/v-selectpage.js +++ b/dist/v-selectpage.js @@ -1,2 +1,2 @@ -!function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("vSelectPage",[],e):"object"==typeof exports?exports.vSelectPage=e():A.vSelectPage=e()}("undefined"!=typeof self?self:this,function(){return function(A){function e(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return A[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var t={};return e.m=A,e.c=t,e.d=function(A,t,i){e.o(A,t)||Object.defineProperty(A,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(A){var t=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(t,"a",t),t},e.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},e.p="dist/",e(e.s=10)}([function(A,e){A.exports=function(A,e,t,i,s,n){var o,a=A=A||{},r=typeof A.default;"object"!==r&&"function"!==r||(o=A,a=A.default);var l="function"==typeof a?a.options:a;e&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0),t&&(l.functional=!0),s&&(l._scopeId=s);var c;if(n?(c=function(A){A=A||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,A||"undefined"==typeof __VUE_SSR_CONTEXT__||(A=__VUE_SSR_CONTEXT__),i&&i.call(this,A),A&&A._registeredComponents&&A._registeredComponents.add(n)},l._ssrRegister=c):i&&(c=i),c){var u=l.functional,g=u?l.render:l.beforeCreate;u?(l._injectStyles=c,l.render=function(A,e){return c.call(e),g(A,e)}):l.beforeCreate=g?[].concat(g,c):[c]}return{esModule:o,exports:a,options:l}}},function(A,e){function t(A,e){var t=A[1]||"",s=A[3];if(!s)return t;if(e&&"function"==typeof btoa){var n=i(s);return[t].concat(s.sources.map(function(A){return"/*# sourceURL="+s.sourceRoot+A+" */"})).concat([n]).join("\n")}return[t].join("\n")}function i(A){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(A))))+" */"}A.exports=function(A){var e=[];return e.toString=function(){return this.map(function(e){var i=t(e,A);return e[2]?"@media "+e[2]+"{"+i+"}":i}).join("")},e.i=function(A,t){"string"==typeof A&&(A=[[null,A,""]]);for(var i={},s=0;st.parts.length&&(i.parts.length=t.parts.length)}else{for(var o=[],s=0;s"+e+"")}(this.picked.length):this.getResults():this.title},results:function(){return this.getResults()},placeholderString:function(){return this.placeholder?this.placeholder:this.i18n.placeholder},inputClasses:function(){return{"sp-input-container":!0,"sp-open":this.show,"sp-disabled":this.disabled}}},mounted:function(){this.scrollPolyfill(),this.searchField?this.searchColumn=this.searchField:"string"==typeof this.showField?this.searchColumn=this.showField:Array.isArray(this.showField)&&this.showField.length&&(this.searchColumn=this.showField[0].data),this.sortList(),this.$on("clear",this.remove)},destroyed:function(){this.$off("clear",this.remove)}}},function(A,e,t){"use strict";e.a={name:"SelectPageTag",props:{picked:Array,disabled:Boolean,placeholder:String},inject:["renderCell"],methods:{remove:function(A){this.$emit("remove",A)}}}},function(A,e,t){"use strict";e.a={name:"SelectPageSelect",props:{results:String,disabled:Boolean,placeholder:String},inject:["i18n"],methods:{remove:function(){this.$emit("remove")}}}},function(A,e,t){"use strict";e.a={name:"SelectPagePagination",props:{value:{type:Number,default:1},pageSize:Number,totalRow:Number},inject:["i18n"],computed:{pageInfo:function(){return this.i18n.page_info.replace("page_num",this.value).replace("page_count",this.totalPage).replace("row_count",this.totalRow)},totalPage:function(){return Math.ceil(this.totalRow/this.pageSize)}},methods:{switchPage:function(A){var e=0;if("string"==typeof A)switch(A){case"first":1!==this.value&&(e=1);break;case"previous":1!==this.value&&(e=this.value-1);break;case"next":this.value!==this.totalPage&&(e=this.value+1);break;case"last":this.value!==this.totalPage&&(e=this.totalPage)}else"number"==typeof A&&(e=A);0!==e&&this.$emit("input",e)}},mounted:function(){this.$on("go",this.switchPage)},destroyed:function(){this.$off("go",this.switchPage)}}},function(A,e,t){"use strict";var i=t(8);e.a={name:"SelectPageList",mixins:[i.a]}},function(A,e,t){"use strict";e.a={inject:["keyField","showField","renderCell","rtl"],props:{list:Array,picked:Array,value:Number},methods:{click:function(A){this.$emit("select",A)},rowClass:function(A,e){var t=this;return{"sp-over":this.value===e,"sp-selected":-1!==this.picked.findIndex(function(e){return e[t.keyField]===A[t.keyField]}),"sp-rtl":this.rtl}},highlight:function(A){this.$emit("input",A)}}}},function(A,e,t){"use strict";var i=t(8);e.a={name:"SelectPageTable",mixins:[i.a],props:{tbColumns:Array}}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t(11),s={install:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Object.keys(e).length){var t=i.a.mixins[0].props;"string"==typeof e.title&&(t.title.default=e.title),"string"==typeof e.language&&(t.language.default=e.language),"string"==typeof e.placeholder&&(t.placeholder.default=e.placeholder),"number"==typeof e.pageSize&&(t.pageSize.default=e.pageSize),"boolean"==typeof e.rtl&&(t.rtl.default=e.rtl),e.dataLoad&&"function"==typeof e.dataLoad&&(i.a.extends={methods:{dataLoad:e.dataLoad}})}A.component(i.a.name,i.a)}};e.default=s},function(A,e,t){"use strict";function i(A){t(12),t(15)}var s=t(3),n=t(31),o=t(0),a=i,r=o(s.a,n.a,!1,a,null,null);e.a=r.exports},function(A,e,t){var i=t(13);"string"==typeof i&&(i=[[A.i,i,""]]),i.locals&&(A.exports=i.locals);t(2)("c1525704",i,!0,{})},function(A,e,t){e=A.exports=t(1)(!1),e.push([A.i,"div.v-selectpage{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;box-sizing:border-box}div.v-selectpage div.sp-input-container{position:relative}div.v-selectpage div.sp-input-container span.sp-placeholder{color:#aaa}div.v-selectpage div.sp-input-container.sp-open div.sp-input,div.v-selectpage div.sp-input-container.sp-open div.sp-inputs{border:1px solid #999;color:#000;border-radius:2px}div.v-selectpage div.sp-input-container.sp-open div.sp-input{background-color:#f9f9f9}div.v-selectpage div.sp-input-container.sp-disabled div.sp-input,div.v-selectpage div.sp-input-container.sp-disabled div.sp-inputs{cursor:not-allowed;color:#555;background-color:#eee}div.v-selectpage div.sp-input-container.sp-disabled div.sp-button{cursor:not-allowed}div.v-selectpage div.sp-input-container div.sp-base{display:block;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;will-change:border-color,box-shadow,background-color;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out,background-color .3s ease-in-out;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s,background-color ease-in-out .3s;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,background-color .3s ease-in-out;box-sizing:border-box}div.v-selectpage div.sp-input-container div.sp-input{background-color:#fff;cursor:pointer;color:#333;opacity:1}div.v-selectpage div.sp-input-container div.sp-inputs{padding:3px 24px 0 3px;position:relative;overflow:hidden;clear:both;cursor:pointer;list-style:none;height:auto;min-height:34px;font-size:14px}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-placeholder{margin-left:9px;margin-top:3px;display:inline-block}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-selected-tag{list-style:none;padding:0 5px;margin:0 3px 3px 0;float:left;position:relative;box-sizing:content-box;border:1px solid #aaa;border-radius:3px;background-color:#e4eaee;cursor:pointer;max-width:100%;box-shadow:inset 0 0 2px #fff,0 1px 0 rgba(0,0,0,.05);height:24px;line-height:24px;-webkit-transition:all .5s cubic-bezier(.175,.885,.32,1);transition:all .5s cubic-bezier(.175,.885,.32,1)}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-selected-tag:hover{background-color:#fff;border:1px solid #d0d0d0;box-shadow:0 2px 7px rgba(0,0,0,.1)}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-selected-tag i{font-size:14px;color:#aaa}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-selected-tag i:hover{color:#000}div.v-selectpage div.sp-input-container div.sp-clear{position:absolute;top:0;right:25px;display:block;width:auto;height:100%;cursor:pointer;font-size:20px;color:#999;font-weight:600;margin:0;padding:4px 0 0;box-sizing:border-box;line-height:1}div.v-selectpage div.sp-input-container div.sp-clear i{font-size:12px}div.v-selectpage div.sp-input-container div.sp-clear:hover{color:#000;font-weight:700}div.v-selectpage div.sp-input-container div.sp-button{display:inline-block;border-bottom-right-radius:0;border-top-right-radius:0;cursor:pointer;text-align:center;box-sizing:border-box;border:0;width:24px;height:100%;padding:0;vertical-align:middle;line-height:100%;position:absolute;top:0;right:0}div.v-selectpage div.sp-input-container div.sp-button span.sp-caret{position:absolute;top:50%;right:12px;margin-top:-1px;vertical-align:middle;display:inline-block;width:0;height:0;margin-left:2px;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent;transition:transform .2s ease}div.v-selectpage div.sp-input-container div.sp-button.open span.sp-caret{transform:rotate(180deg)}div.sp-header{background-color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}div.sp-header>h3{margin:6px 100px 0 10px;text-align:left;height:18px;color:#24292e;font-size:16px;font-weight:500;white-space:nowrap}div.sp-header button{position:absolute;padding:0;cursor:pointer;background:0 0;border:0;outline:none;line-height:100%;color:#999;top:3px;font-size:21px}div.sp-header button.sp-close-btn{right:9px}div.sp-header button.sp-remove-all-btn{right:55px}div.sp-header button.sp-select-all-btn{right:81px}div.sp-header button.sp-clear-all-btn{right:31px}div.sp-header button:hover{color:#000}.sp-search{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:10px;background-color:#fff;border-top-left-radius:2px;border-top-right-radius:2px}.sp-search .sp-search-input{display:block;background-color:#f6f6f6;margin:0!important;width:100%;font-size:14px;line-height:20px;min-height:20px;padding:4px 6px;vertical-align:middle;box-sizing:border-box;outline:none!important;height:30px;border-radius:2px;border:1px solid #ddd;will-change:border-color,box-shadow,background-color;transition:border-color .3s ease-in-out,box-shadow .3s ease-in-out,background-color .3s ease-in-out}.sp-search .sp-search-input:focus{border:1px solid #aaa;box-shadow:0 0 0 3px hsla(0,0%,59%,.2);background-color:#fff}div.sp-result-area{background-color:#fff;min-width:298px;max-height:320px;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}div.sp-result-area ul.sp-results{background-color:#fff;list-style:none;margin:0;padding:0}div.sp-result-area ul.sp-results li{height:auto!important;line-height:1;margin:0;overflow:hidden;padding:4px 8px;position:relative;text-align:left;white-space:nowrap;font-size:14px;color:#333;cursor:pointer}div.sp-result-area ul.sp-results li.sp-over{background-color:#2196f3!important;color:#fff!important;cursor:pointer}div.sp-result-area ul.sp-results li.sp-selected{color:#ccc;cursor:default}div.sp-result-area ul.sp-results li.sp-rtl{direction:rtl;text-align:right}div.sp-result-area div.sp-result-message{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:10px;text-align:center}div.sp-result-area table.sp-table{width:100%}div.sp-result-area table.sp-table td,div.sp-result-area table.sp-table th{font-size:14px;border:0!important}div.sp-result-area table.sp-table th{background-color:#f5f5f5;padding:5px 8px}div.sp-result-area table.sp-table td{padding:4px 8px}div.sp-result-area table.sp-table tbody tr.sp-over td{background-color:#53a4ea!important;color:#fff!important;cursor:pointer}div.sp-result-area table.sp-table tbody tr.sp-selected{color:#ccc;cursor:default}div.sp-result-area table.sp-table tbody tr.sp-rtl td,div.sp-result-area table.sp-table thead tr.sp-rtl th{direction:rtl;text-align:right}div.sp-pagination{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:0;background-color:#fff;position:relative;border-bottom-left-radius:2px;border-bottom-right-radius:2px;text-align:center;font-size:14px}div.sp-pagination div.sp-page-info{height:28px;line-height:29px;font-weight:400}div.sp-pagination ul{position:absolute;top:0;padding:0;margin:0;text-align:left;border-bottom-left-radius:2px;border-bottom-right-radius:2px;width:100%}div.sp-pagination ul li{display:inline-block;text-align:center}div.sp-pagination ul li a{display:inline-block;padding:7px 7px 5px;font-size:14px;color:#6a737d;text-decoration:none;cursor:pointer;height:28px;line-height:100%;background:transparent}div.sp-pagination ul li a:hover{color:#000;font-weight:700}div.sp-pagination ul li.sp-right{float:right}div.sp-pagination ul li:first-child{border-bottom-left-radius:2px}div.sp-pagination ul li:last-child{border-bottom-right-radius:2px}div.sp-pagination ul li.sp-disabled a{color:#ddd;font-weight:400}div.sp-message{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:10px;position:relative;background-color:#e4eaee;color:#000}div.sp-message i{position:absolute;top:6px;font-size:22px}div.sp-message span{margin-left:30px;font-size:16px}.sp-message-slide-enter-active,.sp-message-slide-leave-active{transition:opacity .5s}.sp-message-slide-enter,.sp-message-slide-leave-to{opacity:0}",""])},function(A,e){A.exports=function(A,e){for(var t=[],i={},s=0;s0&&this.list.length){var e=this.list.filter(function(e,t){return tA.highlight&&!A.picked.includes(e)});-1!==e&&(this.highlight=e)}},renderCell:function(A){if(A&&Object.keys(A).length){if("string"==typeof this.showField)return A[this.showField];if("function"==typeof this.showField)return this.showField(A)}},selectItem:function(A){var e=this;this.picked.includes(A)||(this.multiple?(this.maxSelectLimit&&this.picked.length"+this.maxSelectLimit+""),setTimeout(function(){e.message=""},3e3)),this.$nextTick(function(){e.adjustList(),e.inputFocus()})):(this.picked=[A],this.close()),this.highlight=-1)},sortList:function(){if(this.data&&Array.isArray(this.data)&&this.sort){var A=this.sort.split(" "),e={};2===A.length&&(e.field=A[0],e.order=A[1],this.sortedList=this.data.concat().sort(function(A,t){var i=A[e.field],s=t[e.field],n=e.order?e.order.toLowerCase():"asc";return"asc"===n?"number"==typeof i?i-s:String(i).localeCompare(String(s)):"desc"===n?"number"==typeof i?s-i:String(s).localeCompare(String(i)):void 0}))}},populate:function(){var A=this;if(this.data){if(this.search&&this.search!==this.lastSearch&&(this.pageNumber=1),Array.isArray(this.data)){var e=this.sortedList?this.sortedList.concat():this.data.concat();if(this.search&&(e=e.filter(function(e){return e[A.searchColumn].toLowerCase().includes(A.search.toLowerCase())})),this.totalRows=e.length,this.pagination){var t=(this.pageNumber-1)*this.pageSize,i=t+this.pageSize-1;this.list=e.filter(function(A,e){return e>=t&&e<=i})}else this.list=e}else"string"==typeof this.data&&this.remote(!1);this.search&&(this.lastSearch=this.search),this.highlight=-1}this.inputFocus()},remote:function(A){var e=this;if("string"==typeof this.data&&this.dataLoad&&"function"==typeof this.dataLoad){var t=this.params&&Object.keys(this.params).length?JSON.parse(JSON.stringify(this.params)):{};if(t.pageSize=this.pageSize,t.pageNumber=this.pageNumber,this.sort&&(t.orderBy=this.sort),A&&this.value&&(t.searchKey=this.keyField,t.searchValue=this.value),this.search)if(this.searchField||"function"!=typeof this.showField){var i=this.searchField?this.searchField:this.showField;t[i]=this.search}else console.error('Your "showField" was a function, in server side mode, your need specified "searchField" to search content.');this.dataLoad(this,this.data,t).then(function(t){if(t)if(e.resultFormat&&"function"==typeof e.resultFormat){var i=e.resultFormat(t);i&&Object.keys(i).length&&(A?e.picked=i.list:(e.list=i.list,e.totalRows=i.totalRow))}else console.error('In server side mode, you need specified "result-format" option(function type) to format server side response result.')})}},pageChange:function(A){this.pageNumber=A,this.populate()},initSelection:function(){var A=this;if(this.value)if(Array.isArray(this.data)){var e=this.value.split(",");if(e.length){var t=this.data.filter(function(t){return e.includes(String(t[A.keyField]))});t.length&&(this.picked=this.multiple?t:[t[0]])}this.findSelectionPage()}else"string"==typeof this.data&&this.remote(!0);this.populate()},findSelectionPage:function(){var A=this;if(!this.multiple&&this.pagination){var e=this.sortedList?this.sortedList.concat():this.data.concat(),t=e.findIndex(function(e){return String(e[A.keyField])===A.value});t>=0&&(this.pageNumber=Math.ceil((t+1)/this.pageSize))}},scrollPolyfill:function(){var A=void 0!==window.pageXOffset,e="CSS1Compat"===(document.compatMode||"");A?window.pageXOffset:e?document.documentElement.scrollLeft:document.body.scrollLeft,A?window.pageYOffset:e?document.documentElement.scrollTop:document.body.scrollTop},isChrome:function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Google")},isEdge:function(){return navigator.userAgent.indexOf("Edge")>=0}}}},function(A,e,t){!function(e,t){A.exports=t()}("undefined"!=typeof self&&self,function(){return function(A){function e(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return A[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var t={};return e.m=A,e.c=t,e.d=function(A,t,i){e.o(A,t)||Object.defineProperty(A,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(A){var t=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(t,"a",t),t},e.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},e.p="dist/",e(e.s=1)}([function(A,e,t){"use strict";e.a={name:"v-dropdown",props:{align:{type:String,default:"left"},embed:{type:Boolean,default:!1},rightClick:{type:Boolean,default:!1},reOpen:{type:Boolean,default:!1},animated:{type:[String,Boolean],default:!0},width:Number,x:Number,y:Number},data:function(){return{show:!1,styleSheet:{top:"",left:""},dropdownClass:"v-dropdown-container",dropUp:!1,lastCaller:null}},computed:{animate:function(){var A="";return!this.embed&&this.animated&&(A=this.dropUp?"animate-up":"animate-down"),"string"==typeof this.animated&&(A=this.animated),A}},methods:{visible:function(A){var e=this,t=null;this.$nextTick(function(){e.show||e.embed||!A||(t=e.getDir(A),e.dropUp=t.up),e.show=!e.show,e.$nextTick(function(){e.show&&!e.embed&&A&&(e.adjust(A,t),e.lastCaller=A)}),e.$emit("show-change",e.show)})},getDir:function(A){var e=A.getBoundingClientRect(),t=0,i=!1,s=null;this.show?s=this.$el.getBoundingClientRect():(this.$el.style.visibility="hidden",this.$el.style.display="inline-block",s=this.$el.getBoundingClientRect(),this.$el.style.visibility="visible",this.$el.style.display="none");var n=window.pageYOffset,o=document.documentElement.clientHeight,a=this.rightClick?this.y:e.top+n;t=this.rightClick?this.y:e.top+e.height+5+n;var r=!1,l=!1;return t+s.height>n+o&&(r=!0),a-5-s.height<0&&(l=!0),!l&&r&&(t=a-5-s.height,i=!0),{top:t,up:i}},adjust:function(A,e){var t=A.getBoundingClientRect(),i=0,s=0,n=this.$el.getBoundingClientRect(),o=e&&Object.keys(e).length?e:this.getDir(A);this.dropUp=o.up,i=o.top;var a=window.pageXOffset,r=document.documentElement.clientWidth,l=this.rightClick?0:t.width,c=this.rightClick?this.x:t.left+a,u=c+l/2-n.width/2,g=c+l-n.width;switch(this.align){case"left":s=c+n.width>a+r?g:c;break;case"center":s=u+n.width>a+r?g:gt.parts.length&&(i.parts.length=t.parts.length)}else{for(var o=[],s=0;st.parts.length&&(i.parts.length=t.parts.length)}else{for(var o=[],s=0;s"+e+"")}(this.picked.length):this.getResults():this.title},results:function(){return this.getResults()},placeholderString:function(){return this.placeholder?this.placeholder:this.i18n.placeholder},inputClasses:function(){return{"sp-input-container":!0,"sp-open":this.show,"sp-disabled":this.disabled}}},mounted:function(){this.scrollPolyfill(),this.searchField?this.searchColumn=this.searchField:"string"==typeof this.showField?this.searchColumn=this.showField:Array.isArray(this.showField)&&this.showField.length&&(this.searchColumn=this.showField[0].data),this.sortList(),this.$on("clear",this.remove)},destroyed:function(){this.$off("clear",this.remove)}}},function(A,e,t){"use strict";e.a={name:"SelectPageTag",props:{picked:Array,disabled:Boolean,placeholder:String},inject:["renderCell"],methods:{remove:function(A){this.$emit("remove",A)}}}},function(A,e,t){"use strict";e.a={name:"SelectPageSelect",props:{results:String,disabled:Boolean,placeholder:String},inject:["i18n"],methods:{remove:function(){this.$emit("remove")}}}},function(A,e,t){"use strict";e.a={name:"SelectPagePagination",props:{value:{type:Number,default:1},pageSize:Number,totalRow:Number},inject:["i18n"],computed:{pageInfo:function(){return this.i18n.page_info.replace("page_num",this.value).replace("page_count",this.totalPage).replace("row_count",this.totalRow)},totalPage:function(){return Math.ceil(this.totalRow/this.pageSize)}},methods:{switchPage:function(A){var e=0;if("string"==typeof A)switch(A){case"first":1!==this.value&&(e=1);break;case"previous":1!==this.value&&(e=this.value-1);break;case"next":this.value!==this.totalPage&&(e=this.value+1);break;case"last":this.value!==this.totalPage&&(e=this.totalPage)}else"number"==typeof A&&(e=A);0!==e&&this.$emit("input",e)}},mounted:function(){this.$on("go",this.switchPage)},destroyed:function(){this.$off("go",this.switchPage)}}},function(A,e,t){"use strict";var i=t(8);e.a={name:"SelectPageList",mixins:[i.a]}},function(A,e,t){"use strict";e.a={inject:["keyField","showField","renderCell","rtl"],props:{list:Array,picked:Array,value:Number},methods:{click:function(A){this.$emit("select",A)},rowClass:function(A,e){var t=this;return{"sp-over":this.value===e,"sp-selected":-1!==this.picked.findIndex(function(e){return e[t.keyField]===A[t.keyField]}),"sp-rtl":this.rtl}},highlight:function(A){this.$emit("input",A)}}}},function(A,e,t){"use strict";var i=t(8);e.a={name:"SelectPageTable",mixins:[i.a],props:{tbColumns:Array},methods:{renderColumn:function(A,e){return"string"==typeof e.data?A[e.data]:"function"==typeof e.data?e.data(A):void 0}}}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t(11),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},n={install:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Object.keys(e).length){var t=i.a.mixins[0].props;"string"==typeof e.title&&(t.title.default=e.title),"string"==typeof e.language&&(t.language.default=e.language),"string"==typeof e.placeholder&&(t.placeholder.default=e.placeholder),"number"==typeof e.pageSize&&(t.pageSize.default=e.pageSize),"boolean"==typeof e.rtl&&(t.rtl.default=e.rtl),"object"===s(e.languages)&&(t.languages.default=function(){return e.languages}),e.dataLoad&&"function"==typeof e.dataLoad&&(i.a.extends={methods:{dataLoad:e.dataLoad}})}A.component(i.a.name,i.a)}};e.default=n},function(A,e,t){"use strict";function i(A){t(12),t(15)}var s=t(3),n=t(31),o=t(0),a=i,r=o(s.a,n.a,!1,a,null,null);e.a=r.exports},function(A,e,t){var i=t(13);"string"==typeof i&&(i=[[A.i,i,""]]),i.locals&&(A.exports=i.locals);t(2)("821290ae",i,!0,{})},function(A,e,t){e=A.exports=t(1)(!1),e.push([A.i,"div.v-selectpage{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;box-sizing:border-box}div.v-selectpage div.sp-input-container{position:relative}div.v-selectpage div.sp-input-container span.sp-placeholder{color:#aaa}div.v-selectpage div.sp-input-container.sp-open div.sp-input,div.v-selectpage div.sp-input-container.sp-open div.sp-inputs{border:1px solid #999;color:#000;border-radius:2px}div.v-selectpage div.sp-input-container.sp-open div.sp-input{background-color:#f9f9f9}div.v-selectpage div.sp-input-container.sp-disabled div.sp-input,div.v-selectpage div.sp-input-container.sp-disabled div.sp-inputs{cursor:not-allowed;color:#555;background-color:#eee}div.v-selectpage div.sp-input-container.sp-disabled div.sp-button{cursor:not-allowed}div.v-selectpage div.sp-input-container div.sp-base{display:block;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;will-change:border-color,box-shadow,background-color;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out,background-color .3s ease-in-out;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s,background-color ease-in-out .3s;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,background-color .3s ease-in-out;box-sizing:border-box}div.v-selectpage div.sp-input-container div.sp-input{background-color:#fff;cursor:pointer;color:#333;opacity:1}div.v-selectpage div.sp-input-container div.sp-inputs{padding:3px 24px 0 3px;position:relative;overflow:hidden;clear:both;cursor:pointer;list-style:none;height:auto;min-height:34px;font-size:14px}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-placeholder{margin-left:9px;margin-top:3px;display:inline-block}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-selected-tag{list-style:none;padding:0 5px;margin:0 3px 3px 0;float:left;position:relative;box-sizing:content-box;border:1px solid #aaa;border-radius:3px;background-color:#e4eaee;cursor:pointer;max-width:100%;box-shadow:inset 0 0 2px #fff,0 1px 0 rgba(0,0,0,.05);height:24px;line-height:24px;-webkit-transition:all .5s cubic-bezier(.175,.885,.32,1);transition:all .5s cubic-bezier(.175,.885,.32,1)}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-selected-tag:hover{background-color:#fff;border:1px solid #d0d0d0;box-shadow:0 2px 7px rgba(0,0,0,.1)}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-selected-tag i{font-size:14px;color:#aaa}div.v-selectpage div.sp-input-container div.sp-inputs span.sp-selected-tag i:hover{color:#000}div.v-selectpage div.sp-input-container div.sp-clear{position:absolute;top:0;right:25px;display:block;width:auto;height:100%;cursor:pointer;font-size:20px;color:#999;font-weight:600;margin:0;padding:4px 0 0;box-sizing:border-box;line-height:1}div.v-selectpage div.sp-input-container div.sp-clear i{font-size:12px}div.v-selectpage div.sp-input-container div.sp-clear:hover{color:#000;font-weight:700}div.v-selectpage div.sp-input-container div.sp-button{display:inline-block;border-bottom-right-radius:0;border-top-right-radius:0;cursor:pointer;text-align:center;box-sizing:border-box;border:0;width:24px;height:100%;padding:0;vertical-align:middle;line-height:100%;position:absolute;top:0;right:0}div.v-selectpage div.sp-input-container div.sp-button span.sp-caret{position:absolute;top:50%;right:12px;margin-top:-1px;vertical-align:middle;display:inline-block;width:0;height:0;margin-left:2px;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent;transition:transform .2s ease}div.v-selectpage div.sp-input-container div.sp-button.open span.sp-caret{transform:rotate(180deg)}div.sp-header{background-color:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}div.sp-header>h3{margin:6px 100px 0 10px;text-align:left;height:18px;color:#24292e;font-size:16px;font-weight:500;white-space:nowrap}div.sp-header button{position:absolute;padding:0;cursor:pointer;background:0 0;border:0;outline:none;line-height:100%;color:#999;top:3px;font-size:21px}div.sp-header button.sp-close-btn{right:9px}div.sp-header button.sp-remove-all-btn{right:55px}div.sp-header button.sp-select-all-btn{right:81px}div.sp-header button.sp-clear-all-btn{right:31px}div.sp-header button:hover{color:#000}.sp-search{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:10px;background-color:#fff;border-top-left-radius:2px;border-top-right-radius:2px}.sp-search .sp-search-input{display:block;background-color:#f6f6f6;margin:0!important;width:100%;font-size:14px;line-height:20px;min-height:20px;padding:4px 6px;vertical-align:middle;box-sizing:border-box;outline:none!important;height:30px;border-radius:2px;border:1px solid #ddd;will-change:border-color,box-shadow,background-color;transition:border-color .3s ease-in-out,box-shadow .3s ease-in-out,background-color .3s ease-in-out}.sp-search .sp-search-input:focus{border:1px solid #aaa;box-shadow:0 0 0 3px hsla(0,0%,59%,.2);background-color:#fff}div.sp-result-area{background-color:#fff;min-width:298px;max-height:320px;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}div.sp-result-area ul.sp-results{background-color:#fff;list-style:none;margin:0;padding:0}div.sp-result-area ul.sp-results li{height:auto!important;line-height:1;margin:0;overflow:hidden;padding:4px 8px;position:relative;text-align:left;white-space:nowrap;font-size:14px;color:#333;cursor:pointer}div.sp-result-area ul.sp-results li.sp-over{background-color:#2196f3!important;color:#fff!important;cursor:pointer}div.sp-result-area ul.sp-results li.sp-selected{color:#ccc;cursor:default}div.sp-result-area ul.sp-results li.sp-rtl{direction:rtl;text-align:right}div.sp-result-area div.sp-result-message{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:10px;text-align:center}div.sp-result-area table.sp-table{width:100%}div.sp-result-area table.sp-table td,div.sp-result-area table.sp-table th{font-size:14px;border:0!important}div.sp-result-area table.sp-table th{background-color:#f5f5f5;padding:5px 8px}div.sp-result-area table.sp-table td{padding:4px 8px}div.sp-result-area table.sp-table tbody tr.sp-over td{background-color:#53a4ea!important;color:#fff!important;cursor:pointer}div.sp-result-area table.sp-table tbody tr.sp-selected{color:#ccc;cursor:default}div.sp-result-area table.sp-table tbody tr.sp-rtl td,div.sp-result-area table.sp-table thead tr.sp-rtl th{direction:rtl;text-align:right}div.sp-pagination{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:0;background-color:#fff;position:relative;border-bottom-left-radius:2px;border-bottom-right-radius:2px;text-align:center;font-size:14px}div.sp-pagination div.sp-page-info{height:28px;line-height:29px;font-weight:400}div.sp-pagination ul{position:absolute;top:0;padding:0;margin:0;text-align:left;border-bottom-left-radius:2px;border-bottom-right-radius:2px;width:100%}div.sp-pagination ul li{display:inline-block;text-align:center}div.sp-pagination ul li a{display:inline-block;padding:7px 7px 5px;font-size:14px;color:#6a737d;text-decoration:none;cursor:pointer;height:28px;line-height:100%;background:transparent}div.sp-pagination ul li a:hover{color:#000;font-weight:700}div.sp-pagination ul li.sp-right{float:right}div.sp-pagination ul li:first-child{border-bottom-left-radius:2px}div.sp-pagination ul li:last-child{border-bottom-right-radius:2px}div.sp-pagination ul li.sp-disabled a{color:#ddd;font-weight:400}div.sp-message{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;padding:10px;position:relative;background-color:#e4eaee;color:#000}div.sp-message i{position:absolute;top:6px;font-size:22px}div.sp-message span{margin-left:30px;font-size:16px}.sp-message-slide-enter-active,.sp-message-slide-leave-active{transition:opacity .5s}.sp-message-slide-enter,.sp-message-slide-leave-to{opacity:0}",""])},function(A,e){A.exports=function(A,e){for(var t=[],i={},s=0;s0&&this.list.length){var e=this.list.filter(function(e,t){return tA.highlight&&!A.picked.includes(e)});-1!==e&&(this.highlight=e)}},renderCell:function(A){if(A&&Object.keys(A).length){if("string"==typeof this.showField)return A[this.showField];if("function"==typeof this.showField)return this.showField(A)}},selectItem:function(A){var e=this;this.picked.includes(A)||(this.multiple?(this.maxSelectLimit&&this.picked.length"+this.maxSelectLimit+""),setTimeout(function(){e.message=""},3e3)),this.$nextTick(function(){e.adjustList(),e.inputFocus()})):(this.picked=[A],this.close()),this.highlight=-1)},sortList:function(){if(this.data&&Array.isArray(this.data)&&this.sort){var A=this.sort.split(" "),e={};2===A.length&&(e.field=A[0],e.order=A[1],this.sortedList=this.data.concat().sort(function(A,t){var i=A[e.field],s=t[e.field],n=e.order?e.order.toLowerCase():"asc";return"asc"===n?"number"==typeof i?i-s:String(i).localeCompare(String(s)):"desc"===n?"number"==typeof i?s-i:String(s).localeCompare(String(i)):void 0}))}},populate:function(){var A=this;if(this.data){if(this.search&&this.search!==this.lastSearch&&(this.pageNumber=1),Array.isArray(this.data)){var e=this.sortedList?this.sortedList.concat():this.data.concat();if(this.search&&(e=e.filter(function(e){return A.searchFilterCallback?A.searchFilterCallback(e,A.search.toLowerCase(),A.searchColumn):e[A.searchColumn].toLowerCase().includes(A.search.toLowerCase())})),this.totalRows=e.length,this.pagination){var t=(this.pageNumber-1)*this.pageSize,i=t+this.pageSize-1;this.list=e.filter(function(A,e){return e>=t&&e<=i})}else this.list=e}else"string"==typeof this.data&&this.remote(!1);this.search&&(this.lastSearch=this.search),this.highlight=-1}this.inputFocus()},remote:function(A){var e=this;if("string"==typeof this.data&&this.dataLoad&&"function"==typeof this.dataLoad){var t=this.params&&Object.keys(this.params).length?JSON.parse(JSON.stringify(this.params)):{};if(t.pageSize=this.pageSize,t.pageNumber=this.pageNumber,this.sort&&(t.orderBy=this.sort),A&&this.value&&(t.searchKey=this.keyField,t.searchValue=this.value),this.search)if(this.searchField||"function"!=typeof this.showField){var i=this.searchField?this.searchField:this.showField;t[i]=this.search}else console.error('Your "showField" was a function, in server side mode, your need specified "searchField" to search content.');this.dataLoad(this,this.data,t).then(function(t){if(t)if(e.resultFormat&&"function"==typeof e.resultFormat){var i=e.resultFormat(t);i&&Object.keys(i).length&&(A?e.picked=i.list:(e.list=i.list,e.totalRows=i.totalRow))}else console.error('In server side mode, you need specified "result-format" option(function type) to format server side response result.')})}},pageChange:function(A){this.pageNumber=A,this.populate()},initSelection:function(){var A=this;if(this.value)if(Array.isArray(this.data)){var e=this.value.split(",");if(e.length){var t=this.data.filter(function(t){return e.includes(String(t[A.keyField]))});t.length&&(this.picked=this.multiple?t:[t[0]])}this.findSelectionPage()}else"string"==typeof this.data&&this.remote(!0);this.populate()},findSelectionPage:function(){var A=this;if(!this.multiple&&this.pagination){var e=this.sortedList?this.sortedList.concat():this.data.concat(),t=e.findIndex(function(e){return String(e[A.keyField])===A.value});t>=0&&(this.pageNumber=Math.ceil((t+1)/this.pageSize))}},scrollPolyfill:function(){var A=void 0!==window.pageXOffset,e="CSS1Compat"===(document.compatMode||"");A?window.pageXOffset:e?document.documentElement.scrollLeft:document.body.scrollLeft,A?window.pageYOffset:e?document.documentElement.scrollTop:document.body.scrollTop},isChrome:function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Google")},isEdge:function(){return navigator.userAgent.indexOf("Edge")>=0},getTranslation:function(){var A=this.language,e=this.fallbackLocale,t=i.a;return this.languages&&(t=this.languages),t[A]?t[A]:t[e]}}}},function(A,e,t){"use strict";e.a={cn:{next:"下一页",prev:"上一页",first:"首页",last:"尾页",close_btn:"关闭 (Esc键)",loading:"读取中...",page_info:"第 page_num/page_count 页( 共 row_count 条记录 )",not_found:"无查询结果",server_error:"连接到服务器时发生错误!",clear:"清除内容",select_all:"选择当前页项目",unselect_all:"取消选择当前页项目",clear_all:"清除全部已选择项目",max_selected:"最多只能选择 max_selected_limit 个项目",placeholder:"请选择一个项目",items_selected:"已选择 selected_count 个项目"},en:{next:"Next page",prev:"Previous page",first:"First page",last:"Last page",close_btn:"Close (Esc key)",loading:"loading...",page_info:"Page page_num/page_count ( row_count records )",not_found:"not found",server_error:"An error occurred while connecting to server.",clear:"Clear content",select_all:"Select current page",unselect_all:"Clear current page",clear_all:"Clear all selected",max_selected:"You can only select up to max_selected_limit items",placeholder:"Select an option",items_selected:"selected_count items selected"},ja:{next:"次へ",prev:"前へ",first:"最初のページへ",last:"最後のページへ",close_btn:"閉じる (Esc キー)",loading:"読み込み中...",page_info:"page_num/page_count 件 ( 全 row_count つ記録 )",not_found:"(0 件)",server_error:"サーバとの通信でエラーが発生しました。",clear:"コンテンツをクリアする",select_all:"当ページを選びます",unselect_all:"移して当ページを割ります",clear_all:"選択した項目をクリアする",max_selected:"最多で max_selected_limit のプロジェクトを選ぶことしかできません",placeholder:"プロジェクトを選択してください",items_selected:"selected_count アイテムが選択されました"},ar:{next:"التالي",prev:"السابق",first:"الاول",last:"الأخير",close_btn:"إغلاق عند الضغط على زر (Esc)",loading:"جاري التحميل ...",page_info:"صفحة page_num/page_count ( row_count سجلات )",not_found:"لا يوجد نتائج",server_error:"لقد حدث خطأ أثناء الإتصال بالخادم.",clear:"محو المحتوى",select_all:"تحديد الصفحة الحالية",unselect_all:"إلغاء تحديد الصفحة الحالية",clear_all:"إلغاء التحديد",max_selected:"يمكنك فقط تحديد (max_selected_limit) عناصر",placeholder:"رجاء حدد الخيار",items_selected:"تم تحديد (selected_count) عناصر"},es:{next:"Siguiente página",prev:"Pagina anterior",first:"Primera página",last:"última página",close_btn:"Cerrar (tecla Esc)",loading:"Cargando ...",page_info:"Página page_num/page_count ( row_count registros )",not_found:"no encontrado",server_error:"Ocurrió un error al conectarse al servidor.",clear:"Borrar contenido",select_all:"Seleccionar página actual",unselect_all:"Borrar la página actual",clear_all:"Borrar todo lo seleccionado",max_selected:"Solo puedes seleccionar hasta max_selected_limit items",placeholder:"Seleccione una opción",items_selected:"selected_count items Seleccionado"},de:{next:"Nächste Seite",prev:"Vorherige Seite",first:"Erste Seite",last:"Letzte Seite",close_btn:"Schließen (Esc)",loading:"Lädt...",page_info:"Seite page_num/page_count ( row_count Einträge )",not_found:"Nicht gefunden",server_error:"Bei der Verbindung zum Server ist ein Fehler aufgetreten.",clear:"Inhalt löschen",select_all:"Aktuelle Seite auswählen",unselect_all:"Auswahl der aktuellen Seite aufheben",clear_all:"Alle ausgewählten löschen",max_selected:"Sie können nur bis zu max_selected_limit Elemente auswählen",placeholder:"Wählen",items_selected:"selected_count Elemente ausgewählt"}}},function(A,e,t){!function(e,t){A.exports=t()}("undefined"!=typeof self&&self,function(){return function(A){function e(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return A[i].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var t={};return e.m=A,e.c=t,e.d=function(A,t,i){e.o(A,t)||Object.defineProperty(A,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(A){var t=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(t,"a",t),t},e.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},e.p="dist/",e(e.s=1)}([function(A,e,t){"use strict";e.a={name:"v-dropdown",props:{align:{type:String,default:"left"},embed:{type:Boolean,default:!1},rightClick:{type:Boolean,default:!1},reOpen:{type:Boolean,default:!1},animated:{type:[String,Boolean],default:!0},width:Number,x:Number,y:Number},data:function(){return{show:!1,styleSheet:{top:"",left:""},dropdownClass:"v-dropdown-container",dropUp:!1,lastCaller:null}},computed:{animate:function(){var A="";return!this.embed&&this.animated&&(A=this.dropUp?"animate-up":"animate-down"),"string"==typeof this.animated&&(A=this.animated),A}},methods:{visible:function(A){var e=this;this.$nextTick(function(){e.show||e.embed||!A||e.adjust(A),e.show=!e.show,e.lastCaller=A,e.$emit("show-change",e.show)})},adjust:function(A){var e=A.getBoundingClientRect(),t=null;this.show?t=this.$el.getBoundingClientRect():(this.$el.style.visibility="hidden",this.$el.style.display="inline-block",t=this.$el.getBoundingClientRect(),this.$el.style.visibility="visible",this.$el.style.display="none"),this.adjustTop(e,t),this.adjustLeft(e,t)},adjustTop:function(A,e){var t=window.pageYOffset,i=document.documentElement.clientHeight,s=this.rightClick?this.y:A.top+t,n=0,o=!1;n=this.rightClick?this.y:A.top+A.height+5+t;var a=!1,r=!1;n+e.height>t+i&&(a=!0),s-5-e.height<0&&(r=!0),!r&&a&&(n=s-5-e.height,o=!0),this.dropUp=o,this.styleSheet.top=n+"px"},adjustLeft:function(A,e){var t=window.pageXOffset,i=document.documentElement.clientWidth,s=0,n=this.rightClick?0:A.width,o=this.rightClick?this.x:A.left+t,a=o+n/2-e.width/2,r=o+n-e.width;switch(this.align){case"left":s=o+e.width>t+i?r:o;break;case"center":s=a+e.width>t+i?r:rt.parts.length&&(i.parts.length=t.parts.length)}else{for(var o=[],s=0;s\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nvar stylesInDom = {/*\n [id: number]: {\n id: number,\n refs: number,\n parts: Array<(obj?: StyleObjectPart) => void>\n }\n*/}\n\nvar head = hasDocument && (document.head || document.getElementsByTagName('head')[0])\nvar singletonElement = null\nvar singletonCounter = 0\nvar isProduction = false\nvar noop = function () {}\nvar options = null\nvar ssrIdKey = 'data-vue-ssr-id'\n\n// Force single-tag solution on IE6-9, which has a hard limit on the # of \r\n\n\n\n// WEBPACK FOOTER //\n// src/SelectPage.vue","\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/Tag.vue","\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/Select.vue","\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/Pagination.vue","\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/List.vue","export default {\r\n inject: ['keyField', 'showField', 'renderCell', 'rtl'],\r\n props: {\r\n list: Array,\r\n picked: Array,\r\n value: Number\r\n },\r\n methods: {\r\n click(row){\r\n this.$emit('select', row);\r\n },\r\n\t\trowClass(row, index){\r\n\t\t\treturn {\r\n\t\t\t\t'sp-over': this.value === index,\r\n\t\t\t\t'sp-selected': this.picked.findIndex(val => val[this.keyField] === row[this.keyField]) !== -1,\r\n\t\t\t\t'sp-rtl': this.rtl\r\n\t\t\t};\r\n\t\t},\r\n highlight(index){\r\n this.$emit('input', index);\r\n }\r\n }\r\n};\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/view.js","\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// src/components/Table.vue","import selectPage from './SelectPage.vue';\r\n\r\nconst Plugin = {\r\n install(Vue, option = {}){\r\n if(Object.keys(option).length){\r\n \tconst props = selectPage.mixins[0].props;\r\n if(typeof option.title === 'string') props.title.default = option.title;\r\n if(typeof option.language === 'string') props.language.default = option.language;\r\n if(typeof option.placeholder === 'string') props.placeholder.default = option.placeholder;\r\n if(typeof option.pageSize === 'number') props.pageSize.default = option.pageSize;\r\n\t\t\tif(typeof option.rtl === 'boolean') props.rtl.default = option.rtl;\r\n\r\n if(option.dataLoad && typeof option.dataLoad === 'function'){\r\n selectPage.extends = {\r\n methods:{\r\n dataLoad: option.dataLoad\r\n }\r\n };\r\n }\r\n }\r\n Vue.component(selectPage.name, selectPage);\r\n }\r\n};\r\n\r\nexport default Plugin;\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","function injectStyle (ssrContext) {\n require(\"!!vue-style-loader!css-loader!../node_modules/_vue-loader@13.7.3@vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-28eeb54e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector?type=styles&index=0!./SelectPage.vue\")\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../node_modules/_vue-loader@13.7.3@vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-28eeb54e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector?type=styles&index=1!./SelectPage.vue\")\n}\nvar normalizeComponent = require(\"!../node_modules/_vue-loader@13.7.3@vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector?type=script&index=0!./SelectPage.vue\"\nimport __vue_script__ from \"!!babel-loader!../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector?type=script&index=0!./SelectPage.vue\"\n/* template */\nimport __vue_template__ from \"!!../node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-28eeb54e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector?type=template&index=0!./SelectPage.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/SelectPage.vue\n// module id = 11\n// module chunks = 0","// style-loader: Adds some css to the DOM by adding a \n\n\n\n\n// WEBPACK FOOTER //\n// src/SelectPage.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/Tag.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/Select.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/Pagination.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/List.vue","export default {\n inject: ['keyField', 'showField', 'renderCell', 'rtl'],\n props: {\n list: Array,\n picked: Array,\n value: Number\n },\n methods: {\n click(row){\n this.$emit('select', row);\n },\n\t\trowClass(row, index){\n\t\t\treturn {\n\t\t\t\t'sp-over': this.value === index,\n\t\t\t\t'sp-selected': this.picked.findIndex(val => val[this.keyField] === row[this.keyField]) !== -1,\n\t\t\t\t'sp-rtl': this.rtl\n\t\t\t};\n\t\t},\n highlight(index){\n this.$emit('input', index);\n }\n }\n};\n\n\n// WEBPACK FOOTER //\n// ./src/mixins/view.js","\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/Table.vue","import selectPage from './SelectPage.vue';\n\nconst Plugin = {\n install(Vue, option = {}){\n if(Object.keys(option).length){\n \tconst props = selectPage.mixins[0].props;\n if(typeof option.title === 'string') props.title.default = option.title;\n if(typeof option.language === 'string') props.language.default = option.language;\n if(typeof option.placeholder === 'string') props.placeholder.default = option.placeholder;\n if(typeof option.pageSize === 'number') props.pageSize.default = option.pageSize;\n\t\t\tif(typeof option.rtl === 'boolean') props.rtl.default = option.rtl;\n\t\t\tif(typeof option.languages === 'object') props.languages.default = () => option.languages;\n\n if(option.dataLoad && typeof option.dataLoad === 'function'){\n selectPage.extends = {\n methods:{\n dataLoad: option.dataLoad\n }\n };\n }\n }\n Vue.component(selectPage.name, selectPage);\n }\n};\n\nexport default Plugin;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","function injectStyle (ssrContext) {\n require(\"!!vue-style-loader!css-loader!../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-4ad4d98d\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../node_modules/vue-loader/lib/selector?type=styles&index=0!./SelectPage.vue\")\n require(\"!!vue-style-loader!css-loader?minimize!../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-4ad4d98d\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../node_modules/vue-loader/lib/selector?type=styles&index=1!./SelectPage.vue\")\n}\nvar normalizeComponent = require(\"!../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./SelectPage.vue\"\nimport __vue_script__ from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./SelectPage.vue\"\n/* template */\nimport __vue_template__ from \"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-4ad4d98d\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../node_modules/vue-loader/lib/selector?type=template&index=0!./SelectPage.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/SelectPage.vue\n// module id = 11\n// module chunks = 0","// style-loader: Adds some css to the DOM by adding a \ No newline at end of file + diff --git a/src/components/Table.vue b/src/components/Table.vue index d2bc171..ee4c5c4 100644 --- a/src/components/Table.vue +++ b/src/components/Table.vue @@ -8,7 +8,7 @@ - + @@ -21,6 +21,12 @@ mixins: [view], props: { tbColumns: Array + }, + methods: { + renderColumn(row, col) { + if(typeof col.data === 'string') return row[col.data]; + else if(typeof col.data === 'function') return col.data(row); + } } } - \ No newline at end of file + diff --git a/src/index.js b/src/index.js index 441534a..43ae285 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,7 @@ const Plugin = { if(typeof option.placeholder === 'string') props.placeholder.default = option.placeholder; if(typeof option.pageSize === 'number') props.pageSize.default = option.pageSize; if(typeof option.rtl === 'boolean') props.rtl.default = option.rtl; + if(typeof option.languages === 'object') props.languages.default = () => option.languages; if(option.dataLoad && typeof option.dataLoad === 'function'){ selectPage.extends = { @@ -22,4 +23,4 @@ const Plugin = { } }; -export default Plugin; \ No newline at end of file +export default Plugin; diff --git a/src/language.js b/src/language.js index e3225d1..ea38820 100644 --- a/src/language.js +++ b/src/language.js @@ -89,4 +89,22 @@ export default { placeholder: 'Seleccione una opción', items_selected: 'selected_count items Seleccionado' }, + de: {// German + next: 'Nächste Seite', + prev: 'Vorherige Seite', + first: 'Erste Seite', + last: 'Letzte Seite', + close_btn: 'Schließen (Esc)', + loading: 'Lädt...', + page_info: 'Seite page_num/page_count ( row_count Einträge )', + not_found: 'Nicht gefunden', + server_error: 'Bei der Verbindung zum Server ist ein Fehler aufgetreten.', + clear: 'Inhalt löschen', + select_all: 'Aktuelle Seite auswählen', + unselect_all: 'Auswahl der aktuellen Seite aufheben', + clear_all: 'Alle ausgewählten löschen', + max_selected: 'Sie können nur bis zu max_selected_limit Elemente auswählen', + placeholder: 'Wählen', + items_selected: 'selected_count Elemente ausgewählt' + }, }; diff --git a/src/mixins/methods.js b/src/mixins/methods.js index 58add81..a429abe 100644 --- a/src/mixins/methods.js +++ b/src/mixins/methods.js @@ -1,3 +1,5 @@ +import language from "../language"; + export default { methods: { showChange(val){ @@ -171,7 +173,11 @@ export default { if(Array.isArray(this.data)){ let list = this.sortedList?this.sortedList.concat():this.data.concat(); if(this.search) - list = list.filter(val => val[this.searchColumn].toLowerCase().includes(this.search.toLowerCase())); + list = list.filter(val => { + if (!this.searchFilterCallback) return val[this.searchColumn].toLowerCase().includes(this.search.toLowerCase()); + + return this.searchFilterCallback(val, this.search.toLowerCase(), this.searchColumn); + }); this.totalRows = list.length; if(this.pagination){ @@ -269,6 +275,15 @@ export default { }, isEdge(){ return navigator.userAgent.indexOf("Edge") >= 0; + }, + getTranslation() { + const locale = this.language; + const fallback = this.fallbackLocale; + let languages = language; + + if (this.languages) languages = this.languages; + + return languages[locale] ? languages[locale] : languages[fallback]; } } -}; \ No newline at end of file +}; diff --git a/src/mixins/props.js b/src/mixins/props.js index 40687a8..0a99502 100644 --- a/src/mixins/props.js +++ b/src/mixins/props.js @@ -38,6 +38,18 @@ export default { type: String, default: 'cn' }, + languages: { + type: Object, + default: null + }, + /** + * specify which language should be used + * when a translation is undefined + */ + fallbackLocale: { + type: String, + default: 'cn' + }, keyField: { type: String, default: 'id' @@ -66,6 +78,11 @@ export default { */ sort: String, searchField: String, + /** + * Callback params (item, search, searchColumn) => boolean + * A function invoked per iteration on search + */ + searchFilterCallback: Function, pageSize:{ type: Number, default: 10 @@ -97,4 +114,4 @@ export default { default: false } } -}; \ No newline at end of file +};