@mineadmin/table 1.0.31 → 1.0.33
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.
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -41,7 +41,7 @@ const D = $({ name: "MaTable", props: { options: { type: Object, default: () =>
|
|
|
41
41
|
return (u = e == null ? void 0 : e.filterIcon) == null ? void 0 : u.call(e, s);
|
|
42
42
|
} };
|
|
43
43
|
const { label: O, prop: _, children: c, cellRender: aa, headerRender: ea, ...S } = a;
|
|
44
|
-
return c && c.length > 0 && (l = c == null ? void 0 : c.map(T)), i(Z, L({ key: n }, S, { label: typeof O == "function" ? O() : O, prop: o, align: (a == null ? void 0 : a.align) ?? ((M = t.value) == null ? void 0 : M.columnAlign) ?? "center", headerAlign: (a == null ? void 0 : a.align) ?? ((A = t.value) == null ? void 0 : A.columnAlign) ?? (a == null ? void 0 : a.headerAlign) ?? ((B = t.value) == null ? void 0 : B.headerAlign) ?? "center", showOverflowTooltip: (a == null ? void 0 : a.showOverflowTooltip) ?? ((z = t.value) == null ? void 0 : z.showOverflowTooltip) ?? !0 }), typeof (C = l) == "function" || Object.prototype.toString.call(C) === "[object Object]" && !J(C) ? l : { default: () => [l] });
|
|
44
|
+
return c && c.length > 0 && (l.default = () => c == null ? void 0 : c.map(T)), i(Z, L({ key: n }, S, { label: typeof O == "function" ? O() : O, prop: o, align: (a == null ? void 0 : a.align) ?? ((M = t.value) == null ? void 0 : M.columnAlign) ?? "center", headerAlign: (a == null ? void 0 : a.align) ?? ((A = t.value) == null ? void 0 : A.columnAlign) ?? (a == null ? void 0 : a.headerAlign) ?? ((B = t.value) == null ? void 0 : B.headerAlign) ?? "center", showOverflowTooltip: (a == null ? void 0 : a.showOverflowTooltip) ?? ((z = t.value) == null ? void 0 : z.showOverflowTooltip) ?? !0 }), typeof (C = l) == "function" || Object.prototype.toString.call(C) === "[object Object]" && !J(C) ? l : { default: () => [l] });
|
|
45
45
|
var C;
|
|
46
46
|
}, I = () => {
|
|
47
47
|
const { on: a, pagination: n, ...o } = t.value;
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],o):o((r=typeof globalThis<"u"?globalThis:r||self).MaTable={},r.Vue,r.ElementPlus)})(this,function(r,o,m){"use strict";const C=o.defineComponent({name:"MaTable",props:{options:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]}},directives:{Loading:m.ElLoadingDirective},emits:["set-data-callback"],setup(u,{slots:t,attrs:d,emit:g,expose:w}){const l=o.ref(u.options),c=o.ref(u.columns),B=o.inject("MaTableOptions"),y=o.ref(!1),x=o.ref(),b=()=>{const{adaptionOffsetBottom:e}=l.value,a=window.innerHeight-(e??70);l.value.height=`${a}px`};o.onMounted(async()=>{y.value=!0}),o.watch(()=>{var e;return(e=l.value)==null?void 0:e.adaption},e=>{e&&(window.addEventListener("resize",b),b())},{immediate:!0}),o.watch(()=>{var e;return(e=l.value)==null?void 0:e.adaptionOffsetBottom},()=>{var e;(e=l.value)!=null&&e.adaption&&b()},{immediate:!0}),o.onBeforeUnmount(()=>{y.value=!1,window.removeEventListener("resize",b)});const z=o.computed(()=>{var a,n;const{pagination:e}=l.value;return o.withDirectives(o.createVNode("div",{className:"mineadmin-pagination"},[o.createVNode("div",{class:"mineadmin-pagination-left"},[(a=t==null?void 0:t.pageLeft)==null?void 0:a.call(t)]),(((n=l.value)==null?void 0:n.showPagination)??!1)&&e&&o.createVNode("div",{class:"mineadmin-el-page"},[o.createVNode(m.ElPagination,o.mergeProps({total:0,onChange:()=>{}},e,{size:(e==null?void 0:e.size)??"default",pagerCount:(e==null?void 0:e.pagerCount)??5,layout:(e==null?void 0:e.layout)??"total, prev, pager, next, sizes, jumper"}),null)])]),[[o.vShow,t.pageLeft||e]])}),L=(e,a)=>{var M,E,P,A;if(e!=null&&e.hide&&(e==null?void 0:e.hide)instanceof Function&&e.hide(d)||e!=null&&e.hide&&typeof(e==null?void 0:e.hide)=="boolean"&&e.hide)return;const n=typeof e.prop=="function"?e.prop(a):e.prop;let i={default:s=>{var p,f,h;return((p=e==null?void 0:e.cellRender)==null?void 0:p.call(e,Object.assign(s,{options:l.value,attrs:d})))??((f=t==null?void 0:t[`column-${n}`])==null?void 0:f.call(t,s))??((h=t==null?void 0:t.default)==null?void 0:h.call(t,s))},header:s=>{var p,f,h;return((p=e==null?void 0:e.headerRender)==null?void 0:p.call(e,Object.assign(s,{options:l.value,attrs:d})))??((f=t==null?void 0:t[`header-${n}`])==null?void 0:f.call(t,s))??((h=t==null?void 0:t.header)==null?void 0:h.call(t,s))},filterIcon:s=>{var p;return(p=t==null?void 0:t.filterIcon)==null?void 0:p.call(t,s)}};const{label:O,prop:S,children:v,cellRender:k,headerRender:H,...R}=e;return v&&v.length>0&&(i=v==null?void 0:v.map(L)),o.createVNode(m.ElTableColumn,o.mergeProps({key:a},R,{label:typeof O=="function"?O():O,prop:n,align:(e==null?void 0:e.align)??((M=l.value)==null?void 0:M.columnAlign)??"center",headerAlign:(e==null?void 0:e.align)??((E=l.value)==null?void 0:E.columnAlign)??(e==null?void 0:e.headerAlign)??((P=l.value)==null?void 0:P.headerAlign)??"center",showOverflowTooltip:(e==null?void 0:e.showOverflowTooltip)??((A=l.value)==null?void 0:A.showOverflowTooltip)??!0}),typeof(T=i)=="function"||Object.prototype.toString.call(T)==="[object Object]"&&!o.isVNode(T)?i:{default:()=>[i]});var T},D=()=>{const{on:e,pagination:a,...n}=l.value;return o.createVNode(o.Fragment,null,[o.createVNode(m.ElTable,o.mergeProps({ref:x},e,n,d),{default:()=>{var i;return[o.createVNode(o.Fragment,null,[(i=c.value)==null?void 0:i.map(L)])]},append:()=>{var i;return(i=t.append)==null?void 0:i.call(t)},empty:()=>{var i;return((i=t.empty)==null?void 0:i.call(t))??o.createVNode(m.ElEmpty,null,null)}}),z.value])},N=()=>{const{loading:e,loadingConfig:a,height:n,maxHeight:i}=l.value;return o.withDirectives(o.createVNode("div",{className:"mineadmin-table","element-loading-svg":(a==null?void 0:a.svg)??'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"/></svg>',"element-loading-svg-view-box":(a==null?void 0:a.viewBox)??"-9, -9, 50, 50","element-loading-text":(a==null?void 0:a.text)??null,"element-loading-spinner":(a==null?void 0:a.spinner)??null,"element-loading-background":(a==null?void 0:a.spinner)??null,"element-loading-custom-class":(a==null?void 0:a.customClass)??null},[D()]),[[o.resolveDirective("loading"),e]])},j=e=>c.value=e;return w({setData:e=>{l.value.data=e,g("set-data-callback",e)},setPagination:e=>{var a;return l.value.pagination=Object.assign(((a=l.value)==null?void 0:a.pagination)??{},e)},setLoadingState:e=>l.value.loading=e,setOptions:e=>l.value=Object.assign(l.value,e),getOptions:()=>l.value,setColumns:j,getColumns:()=>c.value,appendColumn:e=>c.value.push(e),removeColumn:e=>j(c.value.filter((a,n)=>(typeof a.prop=="function"?a.prop(n):a.prop)!==e)),getColumnByProp:e=>{var a;return((a=c.value.filter((n,i)=>(typeof n.prop=="function"?n.prop(i):n.prop)===e))==null?void 0:a[0])??null},getElTableRef:()=>x.value}),()=>B.ssr?y.value&&N():N()}}),V={install(u,t){u.component(C.name,C),u.provide("MaTableOptions",t??{ssr:!1})}};r.MaTable=V,r.default=V,r.useTable=function(u){return new Promise(async(t,d)=>{const g=o.getCurrentInstance();o.onMounted(async()=>{if(g&&g.refs[u]){const w=g.refs[u];t({...w})}else d("[@mineadmin/table]: not found ref for ma-table component")})})},Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(r,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],o):o((r=typeof globalThis<"u"?globalThis:r||self).MaTable={},r.Vue,r.ElementPlus)})(this,function(r,o,m){"use strict";const C=o.defineComponent({name:"MaTable",props:{options:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]}},directives:{Loading:m.ElLoadingDirective},emits:["set-data-callback"],setup(u,{slots:t,attrs:d,emit:g,expose:w}){const l=o.ref(u.options),c=o.ref(u.columns),B=o.inject("MaTableOptions"),y=o.ref(!1),x=o.ref(),b=()=>{const{adaptionOffsetBottom:e}=l.value,a=window.innerHeight-(e??70);l.value.height=`${a}px`};o.onMounted(async()=>{y.value=!0}),o.watch(()=>{var e;return(e=l.value)==null?void 0:e.adaption},e=>{e&&(window.addEventListener("resize",b),b())},{immediate:!0}),o.watch(()=>{var e;return(e=l.value)==null?void 0:e.adaptionOffsetBottom},()=>{var e;(e=l.value)!=null&&e.adaption&&b()},{immediate:!0}),o.onBeforeUnmount(()=>{y.value=!1,window.removeEventListener("resize",b)});const z=o.computed(()=>{var a,n;const{pagination:e}=l.value;return o.withDirectives(o.createVNode("div",{className:"mineadmin-pagination"},[o.createVNode("div",{class:"mineadmin-pagination-left"},[(a=t==null?void 0:t.pageLeft)==null?void 0:a.call(t)]),(((n=l.value)==null?void 0:n.showPagination)??!1)&&e&&o.createVNode("div",{class:"mineadmin-el-page"},[o.createVNode(m.ElPagination,o.mergeProps({total:0,onChange:()=>{}},e,{size:(e==null?void 0:e.size)??"default",pagerCount:(e==null?void 0:e.pagerCount)??5,layout:(e==null?void 0:e.layout)??"total, prev, pager, next, sizes, jumper"}),null)])]),[[o.vShow,t.pageLeft||e]])}),L=(e,a)=>{var M,E,P,A;if(e!=null&&e.hide&&(e==null?void 0:e.hide)instanceof Function&&e.hide(d)||e!=null&&e.hide&&typeof(e==null?void 0:e.hide)=="boolean"&&e.hide)return;const n=typeof e.prop=="function"?e.prop(a):e.prop;let i={default:s=>{var p,f,h;return((p=e==null?void 0:e.cellRender)==null?void 0:p.call(e,Object.assign(s,{options:l.value,attrs:d})))??((f=t==null?void 0:t[`column-${n}`])==null?void 0:f.call(t,s))??((h=t==null?void 0:t.default)==null?void 0:h.call(t,s))},header:s=>{var p,f,h;return((p=e==null?void 0:e.headerRender)==null?void 0:p.call(e,Object.assign(s,{options:l.value,attrs:d})))??((f=t==null?void 0:t[`header-${n}`])==null?void 0:f.call(t,s))??((h=t==null?void 0:t.header)==null?void 0:h.call(t,s))},filterIcon:s=>{var p;return(p=t==null?void 0:t.filterIcon)==null?void 0:p.call(t,s)}};const{label:O,prop:S,children:v,cellRender:k,headerRender:H,...R}=e;return v&&v.length>0&&(i.default=()=>v==null?void 0:v.map(L)),o.createVNode(m.ElTableColumn,o.mergeProps({key:a},R,{label:typeof O=="function"?O():O,prop:n,align:(e==null?void 0:e.align)??((M=l.value)==null?void 0:M.columnAlign)??"center",headerAlign:(e==null?void 0:e.align)??((E=l.value)==null?void 0:E.columnAlign)??(e==null?void 0:e.headerAlign)??((P=l.value)==null?void 0:P.headerAlign)??"center",showOverflowTooltip:(e==null?void 0:e.showOverflowTooltip)??((A=l.value)==null?void 0:A.showOverflowTooltip)??!0}),typeof(T=i)=="function"||Object.prototype.toString.call(T)==="[object Object]"&&!o.isVNode(T)?i:{default:()=>[i]});var T},D=()=>{const{on:e,pagination:a,...n}=l.value;return o.createVNode(o.Fragment,null,[o.createVNode(m.ElTable,o.mergeProps({ref:x},e,n,d),{default:()=>{var i;return[o.createVNode(o.Fragment,null,[(i=c.value)==null?void 0:i.map(L)])]},append:()=>{var i;return(i=t.append)==null?void 0:i.call(t)},empty:()=>{var i;return((i=t.empty)==null?void 0:i.call(t))??o.createVNode(m.ElEmpty,null,null)}}),z.value])},N=()=>{const{loading:e,loadingConfig:a,height:n,maxHeight:i}=l.value;return o.withDirectives(o.createVNode("div",{className:"mineadmin-table","element-loading-svg":(a==null?void 0:a.svg)??'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"/></svg>',"element-loading-svg-view-box":(a==null?void 0:a.viewBox)??"-9, -9, 50, 50","element-loading-text":(a==null?void 0:a.text)??null,"element-loading-spinner":(a==null?void 0:a.spinner)??null,"element-loading-background":(a==null?void 0:a.spinner)??null,"element-loading-custom-class":(a==null?void 0:a.customClass)??null},[D()]),[[o.resolveDirective("loading"),e]])},j=e=>c.value=e;return w({setData:e=>{l.value.data=e,g("set-data-callback",e)},setPagination:e=>{var a;return l.value.pagination=Object.assign(((a=l.value)==null?void 0:a.pagination)??{},e)},setLoadingState:e=>l.value.loading=e,setOptions:e=>l.value=Object.assign(l.value,e),getOptions:()=>l.value,setColumns:j,getColumns:()=>c.value,appendColumn:e=>c.value.push(e),removeColumn:e=>j(c.value.filter((a,n)=>(typeof a.prop=="function"?a.prop(n):a.prop)!==e)),getColumnByProp:e=>{var a;return((a=c.value.filter((n,i)=>(typeof n.prop=="function"?n.prop(i):n.prop)===e))==null?void 0:a[0])??null},getElTableRef:()=>x.value}),()=>B.ssr?y.value&&N():N()}}),V={install(u,t){u.component(C.name,C),u.provide("MaTableOptions",t??{ssr:!1})}};r.MaTable=V,r.default=V,r.useTable=function(u){return new Promise(async(t,d)=>{const g=o.getCurrentInstance();o.onMounted(async()=>{if(g&&g.refs[u]){const w=g.refs[u];t({...w})}else d("[@mineadmin/table]: not found ref for ma-table component")})})},Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|