sparta-ui 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("table",[],e):"object"==typeof exports?exports.table=e():t.table=e()}(this,(function(){return 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}return 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=421)}({0:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n(42))},1:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},10:function(t,e,n){var i=n(14);t.exports=function(t){return Object(i(t))}},109:function(t,e,n){var i=n(110);t.exports=i},11:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},110:function(t,e,n){var i=n(111);t.exports=i},111:function(t,e,n){var i=n(112),o=Array.prototype;t.exports=function(t){var e=t.filter;return t===o||t instanceof Array&&e===o.filter?i:e}},112:function(t,e,n){n(113);var i=n(18);t.exports=i("Array").filter},113:function(t,e,n){"use strict";var i=n(7),o=n(70).filter;i({target:"Array",proto:!0,forced:!n(31)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},12:function(t,e,n){var i=n(47),o=n(17);t.exports=function(t){var e=i(t,"string");return o(e)?e:String(e)}},13:function(t,e,n){var i=n(28),o=n(14);t.exports=function(t){return i(o(t))}},14:function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},15:function(t,e,n){var i=n(5),o=n(27),r=n(21),a=n(12),s=Object.defineProperty;e.f=i?s:function(t,e,n){if(r(t),e=a(e),r(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},16:function(t,e,n){var i=n(8),o=n(0),r=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?r(i[t])||r(o[t]):i[t]&&i[t][e]||o[t]&&o[t][e]}},17:function(t,e,n){var i=n(16),o=n(26);t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return"function"==typeof e&&Object(t)instanceof e}},178:function(t,e,n){},18:function(t,e,n){var i=n(8);t.exports=function(t){return i[t+"Prototype"]}},19:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},2:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},20:function(t,e,n){var i=n(5),o=n(15),r=n(11);t.exports=i?function(t,e,n){return o.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},206:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"sp-checkbox__wrap"},[n("span",{staticClass:"sp-checkbox",class:[{"is--disabled":t.isDisabled},{"is--checked":t.isChecked}]},[t.trueLabel||t.falseLabel?n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"sp-checkbox__input",attrs:{type:"checkbox","true-value":t.trueLabel,"false-value":t.falseLabel,disabled:t.isDisabled},domProps:{value:t.label,checked:Array.isArray(t.model)?t._i(t.model,t.label)>-1:t._q(t.model,t.trueLabel)},on:{change:[function(e){var n=t.model,i=e.target,o=i.checked?t.trueLabel:t.falseLabel;if(Array.isArray(n)){var r=t.label,a=t._i(n,r);i.checked?a<0&&(t.model=n.concat([r])):a>-1&&(t.model=n.slice(0,a).concat(n.slice(a+1)))}else t.model=o},t.handleChange]}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"sp-checkbox__input",attrs:{type:"checkbox",disabled:t.isDisabled},domProps:{value:t.label,checked:Array.isArray(t.model)?t._i(t.model,t.label)>-1:t.model},on:{change:[function(e){var n=t.model,i=e.target,o=!!i.checked;if(Array.isArray(n)){var r=t.label,a=t._i(n,r);i.checked?a<0&&(t.model=n.concat([r])):a>-1&&(t.model=n.slice(0,a).concat(n.slice(a+1)))}else t.model=o},t.handleChange]}}),t._v(" "),n("span",{staticClass:"sp-checkbox__icon",class:{"sp-icon-check":t.isChecked,"is--indeterminate":t.indeterminate}})]),t._v(" "),t.$slots.default||t.label?n("span",{staticClass:"sp-checkbox__text"},[t.$slots.default?t._e():[t._v(t._s(t.label))],t._v(" "),t._t("default")],2):t._e()])};i._withStripped=!0;var o={name:"SpCheckbox",mixins:[n(33).a],inject:{SpForm:{default:""},SpFormItem:{default:""}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,trueLabel:[String,Number],falseLabel:[String,Number]},data:function(){return{selfModel:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(t){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&t.length<this._checkboxGroup.min&&(this.isLimitExceeded=!0),void 0!==this._checkboxGroup.max&&t.length>this._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("SpCheckboxGroup","input",[t])):(this.$emit("input",t),this.selfModel=t)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model&&this.model===this.trueLabel},isGroup:function(){for(var t=this.$parent;t;){if("SpCheckboxGroup"===t.$options.name)return this._checkboxGroup=t,!0;t=t.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.spForm||{}).disabled:this.disabled||(this.spForm||{}).disabled}},watch:{value:function(t){this.dispatch("SpFormItem","sp.form.change",t)}},mounted:function(){this.checked&&this.addToStore()},methods:{addToStore:function(){Array.isArray(this.model)?-1===this.model.indexOf(this.label)&&this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(t){var e,n=this;this.isLimitExceeded||(e=t.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",e,t),this.$nextTick((function(){n.isGroup&&n.dispatch("SpCheckboxGroup","change",[n._checkboxGroup.value])})))}}},r=(n(214),n(4)),a=Object(r.a)(o,i,[],!1,null,null,null);a.options.__file="sparta/components/base/checkbox/src/index.vue";var s=a.exports;s.install=function(t){t.component(s.name,s)};e.a=s},21:function(t,e,n){var i=n(2);t.exports=function(t){if(!i(t))throw TypeError(String(t)+" is not an object");return t}},214:function(t,e,n){"use strict";n(178)},22:function(t,e,n){var i=n(25),o=Math.min;t.exports=function(t){return t>0?o(i(t),9007199254740991):0}},23:function(t,e,n){var i,o,r=n(0),a=n(40),s=r.process,c=r.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u?o=(i=u.split("."))[0]<4?1:i[0]+i[1]:a&&(!(i=a.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/))&&(o=i[1]),t.exports=o&&+o},24:function(t,e,n){var i=n(23),o=n(1);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},25:function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},26:function(t,e,n){var i=n(24);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},27:function(t,e,n){var i=n(5),o=n(1),r=n(41);t.exports=!i&&!o((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},28:function(t,e,n){var i=n(1),o=n(19),r="".split;t.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?r.call(t,""):Object(t)}:Object},29:function(t,e){t.exports=!0},3:function(t,e,n){var i=n(0),o=n(37),r=n(6),a=n(38),s=n(24),c=n(26),l=o("wks"),u=i.Symbol,h=c?u:u&&u.withoutSetter||a;t.exports=function(t){return r(l,t)&&(s||"string"==typeof l[t])||(s&&r(u,t)?l[t]=u[t]:l[t]=h("Symbol."+t)),l[t]}},30:function(t,e,n){var i=n(43);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}}},31:function(t,e,n){var i=n(1),o=n(3),r=n(23),a=o("species");t.exports=function(t){return r>=51||!i((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},312:function(t,e,n){},313:function(t,e,n){},32:function(t,e,n){var i=n(19);t.exports=Array.isArray||function(t){return"Array"==i(t)}},33:function(t,e,n){"use strict";var i=n(9),o=n.n(i);function r(t,e,n){this.$children.forEach((function(i){var a,s;i.$options.name===t?i.$emit.apply(i,o()(a=[e]).call(a,n)):r.apply(i,o()(s=[t,e]).call(s,[n]))}))}e.a={methods:{dispatch:function(t,e,n){for(var i,r=this.$parent||this.$root,a=r.$options.name;r&&(!a||a!==t);)(r=r.$parent)&&(a=r.$options.name);r&&r.$emit.apply(r,o()(i=[e]).call(i,n))},broadcast:function(t,e,n){r.call(this,t,e,n)}}}},34:function(t,e,n){var i=n(0),o=n(49),r=i["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=r},35:function(t,e,n){"use strict";var i={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,r=o&&!i.call({1:2},1);e.f=r?function(t){var e=o(this,t);return!!e&&e.enumerable}:i},36:function(t,e,n){var i=n(5),o=n(35),r=n(11),a=n(13),s=n(12),c=n(6),l=n(27),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(t,e){if(t=a(t),e=s(e),l)try{return u(t,e)}catch(t){}if(c(t,e))return r(!o.f.call(t,e),t[e])}},37:function(t,e,n){var i=n(29),o=n(34);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.1",mode:i?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},38:function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+i).toString(36)}},39:function(t,e,n){"use strict";var i=n(12),o=n(15),r=n(11);t.exports=function(t,e,n){var a=i(e);a in t?o.f(t,a,r(0,n)):t[a]=n}},399:function(t,e,n){"use strict";n(312)},4:function(t,e,n){"use strict";function i(t,e,n,i,o,r,a,s){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),a?(c=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(a)},l._ssrRegister=c):o&&(c=s?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:l}}n.d(e,"a",(function(){return i}))},40:function(t,e,n){var i=n(16);t.exports=i("navigator","userAgent")||""},400:function(t,e,n){"use strict";n(313)},41:function(t,e,n){var i=n(0),o=n(2),r=i.document,a=o(r)&&o(r.createElement);t.exports=function(t){return a?r.createElement(t):{}}},42:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},421:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement;return(t._self._c||e)("Table",t._g(t._b({ref:"table",class:{"is--has-border":t.border},attrs:{border:t.border}},"Table",t.$attrs,!1),t.$listeners),[t._l(t.$slots,(function(e,n){return t._t(n,null,{slot:n})}))],2)};i._withStripped=!0;var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"sp-table",class:{"is--no-footer":!t.hasFooter&&!t.hasMore&&!t.$slots.append,"is--disabled":t.disabled,"is--selection":t.selection,"need--scroll":t.needScroll}},[n("div",{staticClass:"sp-table__head",class:{borderBox:!t.showVScroll},style:"width: "+t.tableWidth},[n("table",{style:"width: "+t.tableWidth},[n("colgroup",[t.selection?n("col",{attrs:{width:t.selectionWidth}}):t._e(),t._v(" "),t._l(t.children,(function(t,e){return n("col",{key:e,attrs:{width:t.componentOptions.propsData.width}})}))],2),t._v(" "),n("thead",[n("tr",[t.selection?n("th",[n("div")]):t._e(),t._v(" "),t._l(t.children,(function(e,i){return n("th",{key:i},[t._t(e.data.attrs["slot-name"],(function(){return[t._v("\n "+t._s(e.componentOptions.propsData.label)+"\n ")]}))],2)}))],2)])])]),t._v(" "),n("div",{staticClass:"sp-table__body",style:"width: "+t.tableWidth},[n("table",{directives:[{name:"show",rawName:"v-show",value:t.hasData,expression:"hasData"}],style:"width: "+t.tableWidth},[n("colgroup",[t.selection?n("col",{attrs:{width:t.selectionWidth}}):t._e(),t._v(" "),t._l(t.children,(function(t,e){return n("col",{key:e,attrs:{width:t.componentOptions.propsData.width}})}))],2),t._v(" "),n("tbody",t._l(t.list,(function(e,i){return n("tr",{key:i,class:{"is--striped":i%2!=0}},[t.selection?n("td",[n("div",{staticClass:"sp-table-cell"},[t.checkedList[i]?n("sp-checkbox",{attrs:{disabled:t.isSelectDisable(e,i)},on:{change:function(e){return t.handleCheck(i,e)}},model:{value:t.checkedList[i].isChecked,callback:function(e){t.$set(t.checkedList[i],"isChecked",e)},expression:"checkedList[rIndex].isChecked"}}):t._e()],1)]):t._e(),t._v(" "),t._l(t.children,(function(e,o){return n("td",{key:o},[n("sp-table-cell",{key:o+t.tableKey,attrs:{column:e,list:t.list,"c-index":o,"r-index":i}})],1)}))],2)})),0)]),t._v(" "),t.hasMore||t.$slots.append?n("div",{staticClass:"sp-table__append"},[t._t("append",(function(){return[n("div",{staticClass:"sp-table__append-show-more"},[n("sp-button",{attrs:{type:"text",disabled:t.disabled},on:{click:t.handleViewMore}},[t._v("\n 查看更多\n "),n("i",{staticClass:"sp-icon-arrow-down-bold"})])],1)]}))],2):t._e(),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasData&&!t.loading,expression:"!hasData && !loading"}],staticClass:"sp-table__empty"},[t._t("empty",(function(){return[n("div",{staticClass:"sp-table__empty-text"},[t._v("\n "+t._s(t.emptyText)+"\n ")])]}))],2),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.loading,expression:"loading"}],staticClass:"sp-table__loading-wrap"},[n("div",{staticClass:"sp-table__loading"},[t.isIE9?t._e():n("i",{staticClass:"sp-icon-loading"}),t._v("加载中\n ")])])]),t._v(" "),t.hasFooter?n("div",{staticClass:"sp-table__footer",style:"width: "+t.tableWidth},[t.hasData?n("div",{staticClass:"sp-table__footer-left"},[n("div",{staticClass:"sp-table__footer-left-content"},[t.selection&&t.showAllSelect?n("sp-checkbox",{attrs:{disabled:t.disabled||t.loading,indeterminate:t.isIndeterminate,label:t.selectionAllLabel},on:{change:t.handleCheckAllChange},model:{value:t.checkAll,callback:function(e){t.checkAll=e},expression:"checkAll"}}):t._e(),t._v(" "),n("div",{staticClass:"sp-table__footer-left-operation"},[t._t("footerLeftContent")],2)],1)]):t._e(),t._v(" "),t.pagination&&t.paginationTotal>t.paginationPageSize?n("div",{staticClass:"sp-table__footer-center"},[n("sp-pagination",{attrs:{align:t.paginationAlign,"per-pages":t.paginationPerPages,"page-index":t.paginationPageIndex,disabled:t.loading,total:t.paginationTotal,"page-size":t.paginationPageSize},on:{change:t.handlePageChange}})],1):t._e(),t._v(" "),n("div",{staticClass:"sp-table__footer-right"},[n("div",{staticClass:"sp-table__footer-right-content"},[t._t("footerRightContent")],2)])]):t._e()])};o._withStripped=!0;var r=n(71),a=n.n(r);var s={name:"SpTable",components:{SpCheckbox:n(206).a},props:{list:{type:Array,default:function(){return[]}},emptyText:{type:String,default:"暂无搜索结果"},loading:{type:Boolean,default:!1},cellEmptyText:{type:String,default:"--"},disabled:{type:Boolean,default:!1},selection:{type:Boolean,default:!1},selectable:Function,selectionWidth:{type:String,default:"33"},pagination:{type:Boolean,default:!1},paginationOption:{type:Object,default:function(){return{}}},hasMore:{type:Boolean,default:!1},selectionAllLabel:{type:String,default:"全选"},enableUpdate:{type:Boolean,default:!1},showAllSelect:{type:Boolean,default:!0},needScroll:{type:Boolean,default:!1}},data:function(){return{checkAll:!1,isIndeterminate:!1,checkedList:[],tableWidth:"100%",showVScroll:!1,children:[],tableKey:0}},computed:{isIE9:function(){return navigator.appVersion.indexOf("MSIE 9.0")>-1},paginationPerPages:function(){return this.paginationOption&&this.paginationOption.perPages||7},paginationPageIndex:function(){return this.paginationOption&&this.paginationOption.queryPageNo||1},paginationPageSize:function(){return this.paginationOption&&this.paginationOption.pageSize||10},paginationTotal:function(){return this.paginationOption&&this.paginationOption.totalSize||1},paginationAlign:function(){return this.paginationOption&&this.paginationOption.align||"middle"},hasFooter:function(){return this.selection&&this.showAllSelect||this.pagination&&this.paginationTotal>this.paginationPageSize||this.$slots.footerRightContent||this.$slots.footerLeftContent},hasData:function(){return this.list&&this.list.length}},watch:{list:function(){this.checkAll=!1,this.isIndeterminate=!1,this.checkedList=[],this._initCheckedList(),this._emitChange(),this.tableKey=+new Date}},created:function(){this.init()},mounted:function(){this.selection&&this._initCheckedList(),this._initTableWidth()},beforeUpdate:function(){this.enableUpdate&&this.init()},methods:{init:function(){var t;this.children=a()(t=this.$slots.default).call(t,(function(t){return/SpTableColumn/.test(t.tag)}))},clearSelection:function(){this.disabled||(this.checkAll=!1,this._setCheckState(!1))},toggleAllSelection:function(){this.disabled||(this.checkAll=!this.checkAll,this._setCheckState(this.checkAll))},toggleRowSelection:function(t,e){this.disabled||"number"!=typeof t||"boolean"!=typeof e||this.handleCheck(t,e)},_initTableWidth:function(){for(var t=0,e=0,n=this.children.length;e<n;e++){var i=this.children[e].componentOptions.propsData.width;i&&(t+=+i)}var o=parseInt(window.getComputedStyle(this.$el).width);this.selection&&(t+=+this.selectionWidth),t<=o?(t="100%",this.showVScroll=!1):this.showVScroll=!0,this.tableWidth=t+"px"},_initCheckedList:function(){for(var t=this.list.length;t;)t--,this.$set(this.checkedList,t,{isChecked:!1,disabled:this.isSelectDisable(this.list[t],t)})},_emitChange:function(){var t,e,n=this,i=[],o=[];this.checkedList.forEach((function(t,e){t.isChecked&&(o.push(e),i.push(n.list[e]))})),t=o,e=this.oldIsCheckedIndexList||[],t.length===e.length&&t.every((function(t,n){return t===e[n]}))||(this.oldIsCheckedIndexList=o,this.$emit("selection-change",i))},_processCheckBoxRelation:function(){var t,e=a()(t=this.checkedList).call(t,(function(t){return t.isChecked})).length;e===this.list.length?(this.checkAll=!0,this.isIndeterminate=!1):0<e&&e<this.list.length?(this.isIndeterminate=!0,this.checkAll=!1):(this.isIndeterminate=!1,this.checkAll=!1)},_setCheckState:function(t){for(var e=this.list.length,n=!1;e;)e--,this.checkedList[e].disabled||(n=!0,this.$set(this.checkedList,e,{disabled:this.checkedList[e].disabled,isChecked:t}));n&&(this.isIndeterminate=!1,this._emitChange())},handleCheckAllChange:function(t){this._setCheckState(t)},handleCheck:function(t,e){this.checkedList[t].disabled||(this.$set(this.checkedList,t,{disabled:this.checkedList[t].disabled,isChecked:e}),this._processCheckBoxRelation(),this._emitChange())},handlePageChange:function(t,e){this.$emit("pagination-change",t,e)},handleViewMore:function(){this.$emit("table-view-more")},isSelectDisable:function(t,e){return!!this.disabled||"function"==typeof this.selectable&&!this.selectable(t,e)}}},c=(n(399),n(4)),l=Object(c.a)(s,o,[],!1,null,null,null);l.options.__file="sparta/components/base/Table/src/index.vue";var u=l.exports;u.install=function(t){t.component(u.name,u)};var h={name:"SpTable",components:{Table:u},props:{border:{type:Boolean,default:!0}},methods:{clearSelection:function(){this.$refs.table.clearSelection()},toggleAllSelection:function(){this.$refs.table.toggleAllSelection()},toggleRowSelection:function(t,e){this.$refs.table.toggleRowSelection(t,e)}}},d=(n(400),Object(c.a)(h,i,[],!1,null,null,null));d.options.__file="sparta/components/abroad/table/src/table.vue";var f=d.exports;e.default=f},43:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},44:function(t,e,n){var i=n(54);t.exports=function(t,e){return new(i(t))(0===e?0:e)}},46:function(t,e,n){var i=n(1),o=/#|\.prototype\./,r=function(t,e){var n=s[a(t)];return n==l||n!=c&&("function"==typeof e?i(e):!!e)},a=r.normalize=function(t){return String(t).replace(o,".").toLowerCase()},s=r.data={},c=r.NATIVE="N",l=r.POLYFILL="P";t.exports=r},47:function(t,e,n){var i=n(2),o=n(17),r=n(48),a=n(3)("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,s=t[a];if(void 0!==s){if(void 0===e&&(e="default"),n=s.call(t,e),!i(n)||o(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),r(t,e)}},48:function(t,e,n){var i=n(2);t.exports=function(t,e){var n,o;if("string"===e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!i(o=n.call(t)))return o;if("string"!==e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},49:function(t,e,n){var i=n(0);t.exports=function(t,e){try{Object.defineProperty(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e}},5:function(t,e,n){var i=n(1);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},54:function(t,e,n){var i=n(2),o=n(32),r=n(3)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)?i(e)&&null===(e=e[r])&&(e=void 0):e=void 0),void 0===e?Array:e}},6:function(t,e,n){var i=n(10),o={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return o.call(i(t),e)}},63:function(t,e,n){"use strict";var i=n(7),o=n(1),r=n(32),a=n(2),s=n(10),c=n(22),l=n(39),u=n(44),h=n(31),d=n(3),f=n(23),p=d("isConcatSpreadable"),b=f>=51||!o((function(){var t=[];return t[p]=!1,t.concat()[0]!==t})),v=h("concat"),m=function(t){if(!a(t))return!1;var e=t[p];return void 0!==e?!!e:r(t)};i({target:"Array",proto:!0,forced:!b||!v},{concat:function(t){var e,n,i,o,r,a=s(this),h=u(a,0),d=0;for(e=-1,i=arguments.length;e<i;e++)if(m(r=-1===e?a:arguments[e])){if(d+(o=c(r.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,d++)n in r&&l(h,d,r[n])}else{if(d>=9007199254740991)throw TypeError("Maximum allowed index exceeded");l(h,d++,r)}return h.length=d,h}})},66:function(t,e,n){var i=n(67);t.exports=i},67:function(t,e,n){var i=n(68);t.exports=i},68:function(t,e,n){var i=n(69),o=Array.prototype;t.exports=function(t){var e=t.concat;return t===o||t instanceof Array&&e===o.concat?i:e}},69:function(t,e,n){n(63);var i=n(18);t.exports=i("Array").concat},7:function(t,e,n){"use strict";var i=n(0),o=n(36).f,r=n(46),a=n(8),s=n(30),c=n(20),l=n(6),u=function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e};t.exports=function(t,e){var n,h,d,f,p,b,v,m,g=t.target,_=t.global,y=t.stat,x=t.proto,k=_?i:y?i[g]:(i[g]||{}).prototype,w=_?a:a[g]||(a[g]={}),S=w.prototype;for(d in e)n=!r(_?d:g+(y?".":"#")+d,t.forced)&&k&&l(k,d),p=w[d],n&&(b=t.noTargetGet?(m=o(k,d))&&m.value:k[d]),f=n&&b?b:e[d],n&&typeof p==typeof f||(v=t.bind&&n?s(f,i):t.wrap&&n?u(f):x&&"function"==typeof f?s(Function.call,f):f,(t.sham||f&&f.sham||p&&p.sham)&&c(v,"sham",!0),w[d]=v,x&&(l(a,h=g+"Prototype")||c(a,h,{}),a[h][d]=f,t.real&&S&&!S[d]&&c(S,d,f)))}},70:function(t,e,n){var i=n(30),o=n(28),r=n(10),a=n(22),s=n(44),c=[].push,l=function(t){var e=1==t,n=2==t,l=3==t,u=4==t,h=6==t,d=7==t,f=5==t||h;return function(p,b,v,m){for(var g,_,y=r(p),x=o(y),k=i(b,v,3),w=a(x.length),S=0,C=m||s,A=e?C(p,w):n||d?C(p,0):void 0;w>S;S++)if((f||S in x)&&(_=k(g=x[S],S,y),t))if(e)A[S]=_;else if(_)switch(t){case 3:return!0;case 5:return g;case 6:return S;case 2:c.call(A,g)}else switch(t){case 4:return!1;case 7:c.call(A,g)}return h?-1:l||u?u:A}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},71:function(t,e,n){t.exports=n(109)},8:function(t,e){t.exports={}},9:function(t,e,n){t.exports=n(66)}})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("table",[],e):"object"==typeof exports?exports.table=e():t.table=e()}(this,(function(){return 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}return 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=421)}({0:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n(42))},1:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},10:function(t,e,n){var i=n(14);t.exports=function(t){return Object(i(t))}},109:function(t,e,n){var i=n(110);t.exports=i},11:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},110:function(t,e,n){var i=n(111);t.exports=i},111:function(t,e,n){var i=n(112),o=Array.prototype;t.exports=function(t){var e=t.filter;return t===o||t instanceof Array&&e===o.filter?i:e}},112:function(t,e,n){n(113);var i=n(18);t.exports=i("Array").filter},113:function(t,e,n){"use strict";var i=n(7),o=n(70).filter;i({target:"Array",proto:!0,forced:!n(31)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},12:function(t,e,n){var i=n(47),o=n(17);t.exports=function(t){var e=i(t,"string");return o(e)?e:String(e)}},13:function(t,e,n){var i=n(28),o=n(14);t.exports=function(t){return i(o(t))}},14:function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},15:function(t,e,n){var i=n(5),o=n(27),r=n(21),a=n(12),s=Object.defineProperty;e.f=i?s:function(t,e,n){if(r(t),e=a(e),r(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},16:function(t,e,n){var i=n(8),o=n(0),r=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?r(i[t])||r(o[t]):i[t]&&i[t][e]||o[t]&&o[t][e]}},17:function(t,e,n){var i=n(16),o=n(26);t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return"function"==typeof e&&Object(t)instanceof e}},178:function(t,e,n){},18:function(t,e,n){var i=n(8);t.exports=function(t){return i[t+"Prototype"]}},19:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},2:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},20:function(t,e,n){var i=n(5),o=n(15),r=n(11);t.exports=i?function(t,e,n){return o.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},206:function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("label",{staticClass:"sp-checkbox__wrap"},[n("span",{staticClass:"sp-checkbox",class:[{"is--disabled":t.isDisabled},{"is--checked":t.isChecked}]},[t.trueLabel||t.falseLabel?n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"sp-checkbox__input",attrs:{type:"checkbox","true-value":t.trueLabel,"false-value":t.falseLabel,disabled:t.isDisabled},domProps:{value:t.label,checked:Array.isArray(t.model)?t._i(t.model,t.label)>-1:t._q(t.model,t.trueLabel)},on:{change:[function(e){var n=t.model,i=e.target,o=i.checked?t.trueLabel:t.falseLabel;if(Array.isArray(n)){var r=t.label,a=t._i(n,r);i.checked?a<0&&(t.model=n.concat([r])):a>-1&&(t.model=n.slice(0,a).concat(n.slice(a+1)))}else t.model=o},t.handleChange]}}):n("input",{directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"sp-checkbox__input",attrs:{type:"checkbox",disabled:t.isDisabled},domProps:{value:t.label,checked:Array.isArray(t.model)?t._i(t.model,t.label)>-1:t.model},on:{change:[function(e){var n=t.model,i=e.target,o=!!i.checked;if(Array.isArray(n)){var r=t.label,a=t._i(n,r);i.checked?a<0&&(t.model=n.concat([r])):a>-1&&(t.model=n.slice(0,a).concat(n.slice(a+1)))}else t.model=o},t.handleChange]}}),t._v(" "),n("span",{staticClass:"sp-checkbox__icon",class:{"sp-icon-check":t.isChecked,"is--indeterminate":t.indeterminate}})]),t._v(" "),t.$slots.default||t.label?n("span",{staticClass:"sp-checkbox__text"},[t.$slots.default?t._e():[t._v(t._s(t.label))],t._v(" "),t._t("default")],2):t._e()])};i._withStripped=!0;var o={name:"SpCheckbox",mixins:[n(33).a],inject:{SpForm:{default:""},SpFormItem:{default:""}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,trueLabel:[String,Number],falseLabel:[String,Number]},data:function(){return{selfModel:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(t){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&t.length<this._checkboxGroup.min&&(this.isLimitExceeded=!0),void 0!==this._checkboxGroup.max&&t.length>this._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("SpCheckboxGroup","input",[t])):(this.$emit("input",t),this.selfModel=t)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model&&this.model===this.trueLabel},isGroup:function(){for(var t=this.$parent;t;){if("SpCheckboxGroup"===t.$options.name)return this._checkboxGroup=t,!0;t=t.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.spForm||{}).disabled:this.disabled||(this.spForm||{}).disabled}},watch:{value:function(t){this.dispatch("SpFormItem","sp.form.change",t)}},mounted:function(){this.checked&&this.addToStore()},methods:{addToStore:function(){Array.isArray(this.model)?-1===this.model.indexOf(this.label)&&this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(t){var e,n=this;this.isLimitExceeded||(e=t.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",e,t),this.$nextTick((function(){n.isGroup&&n.dispatch("SpCheckboxGroup","change",[n._checkboxGroup.value])})))}}},r=(n(214),n(4)),a=Object(r.a)(o,i,[],!1,null,null,null);a.options.__file="sparta/components/base/checkbox/src/index.vue";var s=a.exports;s.install=function(t){t.component(s.name,s)};e.a=s},21:function(t,e,n){var i=n(2);t.exports=function(t){if(!i(t))throw TypeError(String(t)+" is not an object");return t}},214:function(t,e,n){"use strict";n(178)},22:function(t,e,n){var i=n(25),o=Math.min;t.exports=function(t){return t>0?o(i(t),9007199254740991):0}},23:function(t,e,n){var i,o,r=n(0),a=n(40),s=r.process,c=r.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u?o=(i=u.split("."))[0]<4?1:i[0]+i[1]:a&&(!(i=a.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/))&&(o=i[1]),t.exports=o&&+o},24:function(t,e,n){var i=n(23),o=n(1);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},25:function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},26:function(t,e,n){var i=n(24);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},27:function(t,e,n){var i=n(5),o=n(1),r=n(41);t.exports=!i&&!o((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},28:function(t,e,n){var i=n(1),o=n(19),r="".split;t.exports=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?r.call(t,""):Object(t)}:Object},29:function(t,e){t.exports=!0},3:function(t,e,n){var i=n(0),o=n(37),r=n(6),a=n(38),s=n(24),c=n(26),l=o("wks"),u=i.Symbol,h=c?u:u&&u.withoutSetter||a;t.exports=function(t){return r(l,t)&&(s||"string"==typeof l[t])||(s&&r(u,t)?l[t]=u[t]:l[t]=h("Symbol."+t)),l[t]}},30:function(t,e,n){var i=n(43);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}}},31:function(t,e,n){var i=n(1),o=n(3),r=n(23),a=o("species");t.exports=function(t){return r>=51||!i((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},312:function(t,e,n){},313:function(t,e,n){},32:function(t,e,n){var i=n(19);t.exports=Array.isArray||function(t){return"Array"==i(t)}},33:function(t,e,n){"use strict";var i=n(9),o=n.n(i);function r(t,e,n){this.$children.forEach((function(i){var a,s;i.$options.name===t?i.$emit.apply(i,o()(a=[e]).call(a,n)):r.apply(i,o()(s=[t,e]).call(s,[n]))}))}e.a={methods:{dispatch:function(t,e,n){for(var i,r=this.$parent||this.$root,a=r.$options.name;r&&(!a||a!==t);)(r=r.$parent)&&(a=r.$options.name);r&&r.$emit.apply(r,o()(i=[e]).call(i,n))},broadcast:function(t,e,n){r.call(this,t,e,n)}}}},34:function(t,e,n){var i=n(0),o=n(49),r=i["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=r},35:function(t,e,n){"use strict";var i={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,r=o&&!i.call({1:2},1);e.f=r?function(t){var e=o(this,t);return!!e&&e.enumerable}:i},36:function(t,e,n){var i=n(5),o=n(35),r=n(11),a=n(13),s=n(12),c=n(6),l=n(27),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(t,e){if(t=a(t),e=s(e),l)try{return u(t,e)}catch(t){}if(c(t,e))return r(!o.f.call(t,e),t[e])}},37:function(t,e,n){var i=n(29),o=n(34);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.1",mode:i?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},38:function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+i).toString(36)}},39:function(t,e,n){"use strict";var i=n(12),o=n(15),r=n(11);t.exports=function(t,e,n){var a=i(e);a in t?o.f(t,a,r(0,n)):t[a]=n}},399:function(t,e,n){"use strict";n(312)},4:function(t,e,n){"use strict";function i(t,e,n,i,o,r,a,s){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),a?(c=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(a)},l._ssrRegister=c):o&&(c=s?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:l}}n.d(e,"a",(function(){return i}))},40:function(t,e,n){var i=n(16);t.exports=i("navigator","userAgent")||""},400:function(t,e,n){"use strict";n(313)},41:function(t,e,n){var i=n(0),o=n(2),r=i.document,a=o(r)&&o(r.createElement);t.exports=function(t){return a?r.createElement(t):{}}},42:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},421:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement;return(t._self._c||e)("Table",t._g(t._b({ref:"table",class:{"is--has-border":t.border},attrs:{border:t.border}},"Table",t.$attrs,!1),t.$listeners),[t._l(t.$slots,(function(e,n){return t._t(n,null,{slot:n})}))],2)};i._withStripped=!0;var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"sp-table",class:{"is--no-footer":!t.hasFooter&&!t.hasMore&&!t.$slots.append,"is--disabled":t.disabled,"is--selection":t.selection,"need--scroll":t.needScroll}},[n("div",{staticClass:"sp-table__head",class:{borderBox:!t.showVScroll},style:"width: "+t.tableWidth},[n("table",{style:"width: "+t.tableWidth},[n("colgroup",[t.selection?n("col",{attrs:{width:t.selectionWidth}}):t._e(),t._v(" "),t._l(t.children,(function(t,e){return n("col",{key:e,attrs:{width:t.componentOptions.propsData.width}})}))],2),t._v(" "),n("thead",[n("tr",[t.selection?n("th",[n("div")]):t._e(),t._v(" "),t._l(t.children,(function(e,i){return n("th",{key:i},[t._t(e.data.attrs["slot-name"],(function(){return[t._v("\n "+t._s(e.componentOptions.propsData.label)+"\n ")]}))],2)}))],2)])])]),t._v(" "),n("div",{staticClass:"sp-table__body",style:"width: "+t.tableWidth},[n("table",{directives:[{name:"show",rawName:"v-show",value:t.hasData,expression:"hasData"}],style:"width: "+t.tableWidth},[n("colgroup",[t.selection?n("col",{attrs:{width:t.selectionWidth}}):t._e(),t._v(" "),t._l(t.children,(function(t,e){return n("col",{key:e,attrs:{width:t.componentOptions.propsData.width}})}))],2),t._v(" "),n("tbody",t._l(t.list,(function(e,i){return n("tr",{key:i,class:{"is--striped":i%2!=0}},[t.selection?n("td",[n("div",{staticClass:"sp-table-cell"},[t.checkedList[i]?n("sp-checkbox",{attrs:{disabled:t.isSelectDisable(e,i)},on:{change:function(e){return t.handleCheck(i,e)}},model:{value:t.checkedList[i].isChecked,callback:function(e){t.$set(t.checkedList[i],"isChecked",e)},expression:"checkedList[rIndex].isChecked"}}):t._e()],1)]):t._e(),t._v(" "),t._l(t.children,(function(e,o){return n("td",{key:o},[n("sp-table-cell",{key:o+t.tableKey,attrs:{column:e,list:t.list,"c-index":o,"r-index":i}})],1)}))],2)})),0)]),t._v(" "),t.hasMore||t.$slots.append?n("div",{staticClass:"sp-table__append"},[t._t("append",(function(){return[n("div",{staticClass:"sp-table__append-show-more"},[n("sp-button",{attrs:{type:"text",disabled:t.disabled},on:{click:t.handleViewMore}},[t._v("\n 查看更多\n "),n("i",{staticClass:"sp-icon-arrow-down-bold"})])],1)]}))],2):t._e(),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasData&&!t.loading,expression:"!hasData && !loading"}],staticClass:"sp-table__empty"},[t._t("empty",(function(){return[n("div",{staticClass:"sp-table__empty-text"},[t._v("\n "+t._s(t.emptyText)+"\n ")])]}))],2),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.loading,expression:"loading"}],staticClass:"sp-table__loading-wrap"},[n("div",{staticClass:"sp-table__loading"},[t.isIE9?t._e():n("i",{staticClass:"sp-icon-loading"}),t._v("加载中\n ")])])]),t._v(" "),t.hasFooter?n("div",{staticClass:"sp-table__footer",style:"width: "+t.tableWidth},[t.hasData?n("div",{staticClass:"sp-table__footer-left"},[n("div",{staticClass:"sp-table__footer-left-content"},[t.selection&&t.showAllSelect?n("sp-checkbox",{attrs:{disabled:t.disabled||t.loading,indeterminate:t.isIndeterminate,label:t.selectionAllLabel},on:{change:t.handleCheckAllChange},model:{value:t.checkAll,callback:function(e){t.checkAll=e},expression:"checkAll"}}):t._e(),t._v(" "),n("div",{staticClass:"sp-table__footer-left-operation"},[t._t("footerLeftContent")],2)],1)]):t._e(),t._v(" "),t.pagination&&t.paginationTotal>t.paginationPageSize?n("div",{staticClass:"sp-table__footer-center"},[n("sp-pagination",{attrs:{align:t.paginationAlign,"per-pages":t.paginationPerPages,"page-index":t.paginationPageIndex,disabled:t.loading,total:t.paginationTotal,"page-size":t.paginationPageSize},on:{change:t.handlePageChange}})],1):t._e(),t._v(" "),n("div",{staticClass:"sp-table__footer-right"},[n("div",{staticClass:"sp-table__footer-right-content"},[t._t("footerRightContent")],2)])]):t._e()])};o._withStripped=!0;var r=n(71),a=n.n(r);var s={name:"SpTable",components:{SpCheckbox:n(206).a},props:{list:{type:Array,default:function(){return[]}},emptyText:{type:String,default:"暂无搜索结果"},loading:{type:Boolean,default:!1},cellEmptyText:{type:String,default:"--"},disabled:{type:Boolean,default:!1},selection:{type:Boolean,default:!1},selectable:Function,selectionWidth:{type:String,default:"33"},pagination:{type:Boolean,default:!1},paginationOption:{type:Object,default:function(){return{}}},hasMore:{type:Boolean,default:!1},selectionAllLabel:{type:String,default:"全选"},enableUpdate:{type:Boolean,default:!1},showAllSelect:{type:Boolean,default:!0},needScroll:{type:Boolean,default:!1}},data:function(){return{checkAll:!1,isIndeterminate:!1,checkedList:[],tableWidth:"100%",showVScroll:!1,children:[],tableKey:0}},computed:{isIE9:function(){return navigator.appVersion.indexOf("MSIE 9.0")>-1},paginationPerPages:function(){return this.paginationOption&&this.paginationOption.perPages||7},paginationPageIndex:function(){return this.paginationOption&&this.paginationOption.queryPageNo||1},paginationPageSize:function(){return this.paginationOption&&this.paginationOption.pageSize||10},paginationTotal:function(){return this.paginationOption&&this.paginationOption.totalSize||1},paginationAlign:function(){return this.paginationOption&&this.paginationOption.align||"middle"},hasFooter:function(){return this.selection&&this.showAllSelect||this.pagination&&this.paginationTotal>this.paginationPageSize||this.$slots.footerRightContent||this.$slots.footerLeftContent},hasData:function(){return this.list&&this.list.length}},watch:{list:function(){this.checkAll=!1,this.isIndeterminate=!1,this.checkedList=[],this._initCheckedList(),this._emitChange(),this.tableKey=+new Date}},created:function(){this.init()},mounted:function(){this.selection&&this._initCheckedList(),this._initTableWidth()},beforeUpdate:function(){this.enableUpdate&&this.init()},methods:{init:function(){var t;this.children=a()(t=this.$slots.default).call(t,(function(t){return/SpTableColumn/.test(t.tag)}))},clearSelection:function(){this.disabled||(this.checkAll=!1,this._setCheckState(!1))},toggleAllSelection:function(){this.disabled||(this.checkAll=!this.checkAll,this._setCheckState(this.checkAll))},toggleRowSelection:function(t,e){this.disabled||"number"!=typeof t||"boolean"!=typeof e||this.handleCheck(t,e)},_initTableWidth:function(){for(var t=0,e=0,n=this.children.length;e<n;e++){var i=this.children[e].componentOptions.propsData.width;i&&(t+=+i)}var o=parseInt(window.getComputedStyle(this.$el).width);this.selection&&(t+=+this.selectionWidth),t<=o?(t="100%",this.showVScroll=!1):this.showVScroll=!0,this.tableWidth=t+"px"},_initCheckedList:function(){for(var t=this.list.length;t;)t--,this.$set(this.checkedList,t,{isChecked:!1,disabled:this.isSelectDisable(this.list[t],t)})},_emitChange:function(){var t,e,n=this,i=[],o=[];this.checkedList.forEach((function(t,e){t.isChecked&&(o.push(e),i.push(n.list[e]))})),t=o,e=this.oldIsCheckedIndexList||[],t.length===e.length&&t.every((function(t,n){return t===e[n]}))||(this.oldIsCheckedIndexList=o,this.$emit("selection-change",i))},_processCheckBoxRelation:function(){var t,e=a()(t=this.checkedList).call(t,(function(t){return t.isChecked})).length;e===this.list.length?(this.checkAll=!0,this.isIndeterminate=!1):0<e&&e<this.list.length?(this.isIndeterminate=!0,this.checkAll=!1):(this.isIndeterminate=!1,this.checkAll=!1)},_setCheckState:function(t){for(var e=this.list.length,n=!1;e;)e--,this.checkedList[e].disabled||(n=!0,this.$set(this.checkedList,e,{disabled:this.checkedList[e].disabled,isChecked:t}));n&&(this.isIndeterminate=!1,this._emitChange())},handleCheckAllChange:function(t){this._setCheckState(t)},handleCheck:function(t,e){this.checkedList[t].disabled||(this.$set(this.checkedList,t,{disabled:this.checkedList[t].disabled,isChecked:e}),this._processCheckBoxRelation(),this._emitChange())},handlePageChange:function(t,e){this.$emit("pagination-change",t,e)},handleViewMore:function(){this.$emit("table-view-more")},isSelectDisable:function(t,e){return!!this.disabled||"function"==typeof this.selectable&&!this.selectable(t,e)}}},c=(n(399),n(4)),l=Object(c.a)(s,o,[],!1,null,null,null);l.options.__file="sparta/components/base/table/src/index.vue";var u=l.exports;u.install=function(t){t.component(u.name,u)};var h={name:"SpTable",components:{Table:u},props:{border:{type:Boolean,default:!0}},methods:{clearSelection:function(){this.$refs.table.clearSelection()},toggleAllSelection:function(){this.$refs.table.toggleAllSelection()},toggleRowSelection:function(t,e){this.$refs.table.toggleRowSelection(t,e)}}},d=(n(400),Object(c.a)(h,i,[],!1,null,null,null));d.options.__file="sparta/components/abroad/table/src/table.vue";var f=d.exports;f.install=function(t){t.component(f.name,f)};e.default=f},43:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},44:function(t,e,n){var i=n(54);t.exports=function(t,e){return new(i(t))(0===e?0:e)}},46:function(t,e,n){var i=n(1),o=/#|\.prototype\./,r=function(t,e){var n=s[a(t)];return n==l||n!=c&&("function"==typeof e?i(e):!!e)},a=r.normalize=function(t){return String(t).replace(o,".").toLowerCase()},s=r.data={},c=r.NATIVE="N",l=r.POLYFILL="P";t.exports=r},47:function(t,e,n){var i=n(2),o=n(17),r=n(48),a=n(3)("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,s=t[a];if(void 0!==s){if(void 0===e&&(e="default"),n=s.call(t,e),!i(n)||o(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),r(t,e)}},48:function(t,e,n){var i=n(2);t.exports=function(t,e){var n,o;if("string"===e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!i(o=n.call(t)))return o;if("string"!==e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},49:function(t,e,n){var i=n(0);t.exports=function(t,e){try{Object.defineProperty(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e}},5:function(t,e,n){var i=n(1);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},54:function(t,e,n){var i=n(2),o=n(32),r=n(3)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)?i(e)&&null===(e=e[r])&&(e=void 0):e=void 0),void 0===e?Array:e}},6:function(t,e,n){var i=n(10),o={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return o.call(i(t),e)}},63:function(t,e,n){"use strict";var i=n(7),o=n(1),r=n(32),a=n(2),s=n(10),c=n(22),l=n(39),u=n(44),h=n(31),d=n(3),f=n(23),p=d("isConcatSpreadable"),b=f>=51||!o((function(){var t=[];return t[p]=!1,t.concat()[0]!==t})),v=h("concat"),m=function(t){if(!a(t))return!1;var e=t[p];return void 0!==e?!!e:r(t)};i({target:"Array",proto:!0,forced:!b||!v},{concat:function(t){var e,n,i,o,r,a=s(this),h=u(a,0),d=0;for(e=-1,i=arguments.length;e<i;e++)if(m(r=-1===e?a:arguments[e])){if(d+(o=c(r.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,d++)n in r&&l(h,d,r[n])}else{if(d>=9007199254740991)throw TypeError("Maximum allowed index exceeded");l(h,d++,r)}return h.length=d,h}})},66:function(t,e,n){var i=n(67);t.exports=i},67:function(t,e,n){var i=n(68);t.exports=i},68:function(t,e,n){var i=n(69),o=Array.prototype;t.exports=function(t){var e=t.concat;return t===o||t instanceof Array&&e===o.concat?i:e}},69:function(t,e,n){n(63);var i=n(18);t.exports=i("Array").concat},7:function(t,e,n){"use strict";var i=n(0),o=n(36).f,r=n(46),a=n(8),s=n(30),c=n(20),l=n(6),u=function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e};t.exports=function(t,e){var n,h,d,f,p,b,v,m,g=t.target,_=t.global,y=t.stat,x=t.proto,k=_?i:y?i[g]:(i[g]||{}).prototype,w=_?a:a[g]||(a[g]={}),S=w.prototype;for(d in e)n=!r(_?d:g+(y?".":"#")+d,t.forced)&&k&&l(k,d),p=w[d],n&&(b=t.noTargetGet?(m=o(k,d))&&m.value:k[d]),f=n&&b?b:e[d],n&&typeof p==typeof f||(v=t.bind&&n?s(f,i):t.wrap&&n?u(f):x&&"function"==typeof f?s(Function.call,f):f,(t.sham||f&&f.sham||p&&p.sham)&&c(v,"sham",!0),w[d]=v,x&&(l(a,h=g+"Prototype")||c(a,h,{}),a[h][d]=f,t.real&&S&&!S[d]&&c(S,d,f)))}},70:function(t,e,n){var i=n(30),o=n(28),r=n(10),a=n(22),s=n(44),c=[].push,l=function(t){var e=1==t,n=2==t,l=3==t,u=4==t,h=6==t,d=7==t,f=5==t||h;return function(p,b,v,m){for(var g,_,y=r(p),x=o(y),k=i(b,v,3),w=a(x.length),S=0,C=m||s,A=e?C(p,w):n||d?C(p,0):void 0;w>S;S++)if((f||S in x)&&(_=k(g=x[S],S,y),t))if(e)A[S]=_;else if(_)switch(t){case 3:return!0;case 5:return g;case 6:return S;case 2:c.call(A,g)}else switch(t){case 4:return!1;case 7:c.call(A,g)}return h?-1:l||u?u:A}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},71:function(t,e,n){t.exports=n(109)},8:function(t,e){t.exports={}},9:function(t,e,n){t.exports=n(66)}})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sparta-ui",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "网易支付PC组件库",
|
|
5
5
|
"homepage": "https://github.com/CodeLittlePrince/sparta-ui",
|
|
6
6
|
"repository": "https://github.com/CodeLittlePrince/sparta-ui.git",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"babel-plugin-istanbul": "^6.1.1",
|
|
66
66
|
"babel-plugin-transform-vue-jsx": "^4.0.1",
|
|
67
67
|
"boom": "^7.3.0",
|
|
68
|
+
"case-sensitive-paths-webpack-plugin": "^1.1.4",
|
|
68
69
|
"chai": "^4.2.0",
|
|
69
70
|
"chalk": "^2.4.1",
|
|
70
71
|
"clean-webpack-plugin": "^0.1.19",
|