@gct-paas/v-ben 0.1.6-dev.24 → 0.1.6-dev.25
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/loader.esm.min.js +1 -1
- package/package.json +5 -5
package/dist/loader.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @gct-paas/v-ben v0.1.6-dev.
|
|
1
|
+
/*! @gct-paas/v-ben v0.1.6-dev.25 */
|
|
2
2
|
import{cssLoader as e,permission as t,t as n,useNamespace as o}from"@gct-paas/core";import{Fragment as l,computed as a,createBlock as r,createCommentVNode as i,createElementBlock as s,createElementVNode as u,createSlots as c,createTextVNode as d,createVNode as f,defineComponent as p,guardReactiveProps as m,h as g,mergeProps as y,nextTick as h,normalizeClass as v,normalizeProps as b,onActivated as C,onMounted as w,onUnmounted as S,openBlock as x,ref as k,renderList as T,renderSlot as B,resolveComponent as A,toDisplayString as P,toRaw as R,toValue as _,unref as z,useAttrs as O,vShow as $,watch as I,withCtx as F,withDirectives as N,withModifiers as D}from"vue";import{cloneDeep as E,omit as H}from"lodash-es";import{LeftOutlined as j,MoreOutlined as L,RightOutlined as M}from"@ant-design/icons-vue";import{Button as W,Divider as K,Dropdown as U,Menu as V,Popconfirm as q,Tooltip as G}from"ant-design-vue";var X=Object.defineProperty,Y=(e,t)=>{let n={};for(var o in e)X(n,o,{get:e[o],enumerable:!0});return t||X(n,Symbol.toStringTag,{value:"Module"}),n},J=Object.prototype.toString;function Q(e,t){return J.call(e)===`[object ${t}]`}function Z(e){return void 0!==e}function ee(e){return!Z(e)}function te(e){return null!==e&&Q(e,"Object")}function ne(e){return pe(e)||ue(e)?0===e.length:e instanceof Map||e instanceof Set?0===e.size:!!te(e)&&0===Object.keys(e).length}function oe(e){return Q(e,"Date")}function le(e){return null===e}function ae(e){return ee(e)&&le(e)}function re(e){return ee(e)||le(e)}function ie(e){return Q(e,"Number")}function se(e){return Q(e,"Promise")&&te(e)&&ce(e.then)&&ce(e.then)}function ue(e){return Q(e,"String")}function ce(e){return"function"==typeof e}function de(e){return Q(e,"Boolean")}function fe(e){return Q(e,"RegExp")}function pe(e){return!!e&&Array.isArray(e)}function me(e){return"undefined"!=typeof window&&Q(e,"Window")}function ge(e){return te(e)&&!!e.tagName}function ye(e){return Q(e,"Map")}function he(e){return/^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(e)}function ve(e){return void 0===e||!e&&0!==e&&"0"!==e||!/[^\s]/.test(e+"")}var be=(e,t)=>{const n=e.__vccOpts||e;for(const[o,l]of t)n[o]=l;return n},Ce=/* @__PURE__ */be(p({name:"TableHeaderCell",components:{},props:{column:{type:Object,default:()=>({})}},setup:e=>({getTitle:a(()=>{var t,n;return(null===(t=e.column)||void 0===t?void 0:t.customTitle)||(null===(n=e.column)||void 0===n?void 0:n.title)})})}),[["render",function(e,t,n,o,l,a){return x(),s("span",null,P(e.getTitle),1)}]]),we={clickToRowSelect:{type:Boolean,default:!0},isTreeTable:Boolean,tableSetting:{type:Object,default:{}},inset:Boolean,showTableSetting:Boolean,autoCreateKey:{type:Boolean,default:!0},striped:{type:Boolean,default:!0},showSummary:Boolean,summaryFunc:{type:[Function,Array],default:null},summaryData:{type:Array,default:null},indentSize:{type:Number,default:24},canColDrag:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},api:{type:Function,default:null},beforeFetch:{type:Function,default:null},afterFetch:{type:Function,default:null},handleSearchInfoFn:{type:Function,default:null},immediate:{type:Boolean,default:!0},emptyDataIsShowTable:{type:Boolean,default:!0},searchInfo:{type:Object,default:null},defSort:{type:Object,default:null},useSearchForm:Boolean,columns:{type:Array,default:()=>[]},showIndexColumn:{type:Boolean,default:!0},indexColumnProps:{type:Object,default:null},actionColumn:{type:Object,default:null},ellipsis:{type:Boolean,default:!0},isCanResizeParent:{type:Boolean,default:!1},canResize:{type:Boolean,default:!0},clearSelectOnPageChange:Boolean,resizeHeightOffset:{type:Number,default:0},rowSelection:{type:Object,default:null},title:{type:[String,Function],default:null},titleHelpMessage:{type:[String,Array]},maxHeight:Number,dataSource:{type:Array,default:null},rowKey:{type:[String,Function],default:""},bordered:Boolean,pagination:{type:[Object,Boolean],default:null},loading:Boolean,rowClassName:{type:Function},scroll:{type:Object,default:null},beforeEditSubmit:{type:Function},rowDraggable:{type:Boolean,default:!1},supportSameLevel:{type:Boolean,default:!1},rowDragApi:{type:Function,default:null},expandedRowKeys:{type:Array,default:()=>[]},emptyFull:{type:Boolean,default:!1}},Se=["clickToRowSelect","isTreeTable","tableSetting","inset","showTableSetting","autoCreateKey","striped","showSummary","summaryFunc","summaryData","indentSize","canColDrag","resizable","api","beforeFetch","afterFetch","handleSearchInfoFn","immediate","emptyDataIsShowTable","searchInfo","defSort","useSearchForm","showIndexColumn","indexColumnProps","actionColumn","ellipsis","isCanResizeParent","canResize","clearSelectOnPageChange","resizeHeightOffset","titleHelpMessage","beforeEditSubmit","rowDraggable","supportSameLevel","rowDragApi","emptyFull"],xe="INDEX",ke="ACTION",Te=["20","50","80","100"];function Be(e,t,n){const{key:o,dataIndex:l,children:a}=e;e.align=e.align||"left",t&&(o||void 0===l||(e.key=Array.isArray(l)?l.join("."):String(l)),de(e.ellipsis)||Object.assign(e,{ellipsis:{showTitle:!1}})),a&&a.length&&Ae(a,!!t,n),function(e,t){if(!t||!1===e.resizable)return;if("string"==typeof e.width&&e.width.includes("%"))return;e.resizable=!0;const n=function(e){if(null!=e&&""!==e){if("number"==typeof e&&!Number.isNaN(e))return e;if("string"==typeof e){const t=Number.parseInt(e,10);if(!Number.isNaN(t))return t}}}(e.width);e.width=void 0===n?150:n}(e,n);const r=e.customCell;e.customCell=(t,n)=>({...r&&r(t,n),onMouseenter(t){if(!e.ellipsis)return;const n=t.target;n.scrollWidth>n.clientWidth&&n.setAttribute("title",n.textContent??"")}})}function Ae(e,t,n){e&&e.forEach(e=>{const{children:o}=e;Be(e,t,n),Ae(o,t,n)})}function Pe(e,t,n){const{dataIndex:o,key:l}=t;for(const r of e){var a;if(void 0!==o&&r.dataIndex===o||void 0!==l&&r.key===l)return r.width=n,!0;if((null===(a=r.children)||void 0===a?void 0:a.length)&&Pe(r.children,t,n))return!0}return!1}function Re(e,o){const l=k(z(e).columns),r=a(()=>{const t=E(z(l));if(function(e,t,o){const{showIndexColumn:l,indexColumnProps:a,isTreeTable:r}=z(e);let i=!1;if(z(r))return;if(o.forEach(()=>{const e=o.findIndex(e=>e.flag===xe);l?i=-1===e:l||-1===e||o.splice(e,1)}),!i)return;const s=o.some(e=>"left"===e.fixed);o.unshift({flag:xe,width:70,title:n("sys.component.table.index"),align:"center",customRender:({index:e})=>{const n=z(t);if(de(n))return`${e+1}`;const{current:o=1,pageSize:l=20}=n;return((o<1?1:o)-1)*l+e+1},...s?{fixed:"left"}:{},...a})}(e,o,t),function(e,t){const{actionColumn:n}=z(e);if(!n)return;const o=t.findIndex(e=>e.flag===ke);-1===o&&t.push({...t[o],fixed:"right",...n,flag:ke})}(e,t),!t)return[];const{ellipsis:a,resizable:r=!0}=z(e);return t.forEach(e=>{const{customRender:t,slots:n}=e;Be(e,Reflect.has(e,"ellipsis")?!!e.ellipsis:!!a&&!t&&!n,r)}),t}),i=a(()=>{const e=function(e){const t=[],n=[],o=[];for(const l of e)"left"!==l.fixed?"right"!==l.fixed?o.push(l):n.push(l):t.push(l);return[...t,...o,...n].filter(e=>!e.defaultHidden)}(z(r)),n=e=>{const{slots:t}=e;return t&&(null==t?void 0:t.title)||(e.customTitle=e.title,Reflect.deleteProperty(e,"title")),e};return E(e).filter(e=>{return(!(n=e.auth)||(Array.isArray(n)?n.some(e=>t.has(String(e))):t.has(String(n))))&&function(e){const t=e.ifShow;return de(t)?t:!ce(t)||t(e)}(e);var n}).map(e=>{var t;return(null===(t=e.children)||void 0===t?void 0:t.length)&&(e.children=e.children.map(n)),n(e)})});return I(()=>z(e).columns,e=>{l.value=e}),{getColumnsRef:r,getViewColumns:i,handleResizeColumn:function(e,t){t.width=e;const n=z(l);Pe(n,t,e)&&(l.value=[...n])}}}function _e({page:e,type:t,originalElement:n}){return"prev"===t?0===e?null:g(j):"next"===t?1===e?null:g(M):n}var ze="undefined"!=typeof window&&"undefined"!=typeof document,Oe=("undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),Object.prototype.toString),$e=()=>{};function Ie(e){return Array.isArray(e)?e:[e]}function Fe(e){const t=Object.create(null);return n=>t[n]||(t[n]=e(n))}var Ne=/\B([A-Z])/g,De=(Fe(e=>e.replace(Ne,"-$1").toLowerCase()),/-(\w)/g);function Ee(e,t=200,n={}){return function(e,t){return function(...n){return new Promise((o,l)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(o).catch(l)})}}(function(e,t={}){let n,o,l=$e;const a=e=>{clearTimeout(e),l(),l=$e};let r;return i=>{const s=_(e),u=_(t.maxWait);return n&&a(n),s<=0||void 0!==u&&u<=0?(o&&(a(o),o=void 0),Promise.resolve(i())):new Promise((e,c)=>{l=t.rejectOnCancel?c:e,r=i,u&&!o&&(o=setTimeout(()=>{n&&a(n),o=void 0,e(r())},u)),n=setTimeout(()=>{o&&a(o),o=void 0,e(i())},s)})}}(t,n),e)}Fe(e=>e.replace(De,(e,t)=>t?t.toUpperCase():""));var He=ze?window:void 0;function je(e,t,n,o,l,r,i,s){const u=k(215),c=Ee(f,100),d=a(()=>{const{canResize:t,scroll:n}=z(e);return t&&!(n||{}).y});function f(){h(()=>{y()})}I(()=>{var e;return[z(d),null===(e=z(r))||void 0===e?void 0:e.length]},()=>{c()},{flush:"post"});let p=null,m=null,g=null;async function y(){const{resizeHeightOffset:n,maxHeight:o,isCanResizeParent:a,useSearchForm:c}=z(e),f=z(l),y=z(r),v=z(t);if(!v)return;const b=v.$el;if(!b)return;if(!g&&(g=b.querySelector(".ant-table-body"),!g))return;const C=g.scrollHeight>g.clientHeight,w=g.scrollWidth>g.clientWidth;if(C?b.classList.contains("hide-scrollbar-y")&&b.classList.remove("hide-scrollbar-y"):b.classList.contains("hide-scrollbar-y")||b.classList.add("hide-scrollbar-y"),w?b.classList.contains("hide-scrollbar-x")&&b.classList.remove("hide-scrollbar-x"):b.classList.contains("hide-scrollbar-x")||b.classList.add("hide-scrollbar-x"),g.style.height="unset",!z(d)||!z(y)||0===y.length)return;await h();const S=b.querySelector(".ant-table-thead ");if(!S)return;let x=32,k=12;de(f)?k=-8:(p=b.querySelector(".ant-pagination"),k+=p?p.offsetHeight||0:24);let T=0;de(f)||(m?T+=m.offsetHeight||0:m=b.querySelector(".ant-table-footer"));let B=0;S&&(B=S.offsetHeight);let A=0;if(z(i)&&a){var P,R,_;const e=12,t=16;let n=10;const o=(null===(P=z(i))||void 0===P?void 0:P.offsetHeight)??0;let l=(null===(R=z(s))||void 0===R?void 0:R.$el.offsetHeight)??0;l&&(l+=t),de(f)&&!f&&(n=0),de(c)&&!c&&(x=0),A=o-l-((null===(_=b.querySelector(".ant-table-title"))||void 0===_?void 0:_.offsetHeight)??0)-e-n}else A=function(e){const t=document.documentElement,n=t.scrollLeft,o=t.scrollTop,l=t.clientLeft,a=t.clientTop,r=window.pageXOffset,i=window.pageYOffset,{left:s,top:u,width:c,height:d}=function(e){return e&&e.getBoundingClientRect?e.getBoundingClientRect():0}(e),f=s+r-((r||n)-(l||0)),p=u+i-((i||o)-(a||0)),m=window.document.documentElement.clientWidth,g=window.document.documentElement.clientHeight;return{left:f,top:p,right:m-c-f,bottom:g-d-p,rightIncludeBody:m-f,bottomIncludeBody:g-p}}(S).bottomIncludeBody;let O=A-(n||0)-x-k-T-B;if(O=(O>o?o:O)??O,function(e){u.value=e}(O),f&&!de(f)){const e=b.querySelector(".ant-table-body");e&&(e.style.height=`${O}px`)}}function v(){y(),h(()=>{c()})}(function(...e){const t=a(()=>{const t=Ie(_(e[0])).filter(e=>null!=e);return t.every(e=>"string"!=typeof e)?t:void 0});return n=([e,t,n,o],l,a)=>{if(!(null==e?void 0:e.length)||!(null==t?void 0:t.length)||!(null==n?void 0:n.length))return;const r=(i=o,"[object Object]"===Oe.call(i)?{...o}:o);var i;const s=e.flatMap(e=>t.flatMap(t=>n.map(n=>((e,t,n,o)=>(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)))(e,t,n,r))));a(()=>{s.forEach(e=>e())})},o={flush:"post"},I(()=>{var n,o;return[null!==(n=null===(o=t.value)||void 0===o?void 0:o.map(e=>function(e){var t;const n=_(e);return null!==(t=null==n?void 0:n.$el)&&void 0!==t?t:n}(e)))&&void 0!==n?n:[He].filter(e=>null!=e),Ie(_(t.value?e[1]:e[0])),Ie(z(t.value?e[2]:e[1])),_(t.value?e[3]:e[2])]},n,{...o,immediate:!0});var n,o})(window,"resize",Ee(y,280)),w(v),C(v);const b=a(()=>{var e;let l=0;z(o)&&(l+=60);const a=z(n).filter(e=>!e.defaultHidden);a.forEach(e=>{l+=Number.parseFloat(String(e.width))||0});const r=a.filter(e=>!Reflect.has(e,"width")).length;0!==r&&(l+=150*r);const i=z(t);return((null==i||null===(e=i.$el)||void 0===e?void 0:e.offsetWidth)??0)>l?void 0:l});return{getScrollRef:a(()=>{const t=z(u),{canResize:n,scroll:o}=z(e);return{x:z(b),y:n?t:null,scrollToFirstRowOnChange:!1,...o}}),redoHeight:f}}function Le(e,t,n){const{expandedRowKeys:o=[]}=z(e),l=k([...o]),r=a(()=>z(e).autoCreateKey&&!z(e).rowKey),i=a(()=>{const{rowKey:t}=z(e);return z(r)?"key":t});function s(n){const o=[],{childrenColumnName:l}=z(e),a=l||"children";return R(n||z(t)).forEach(e=>{o.push(String(e[z(i)]));const t=e[a];(null==t?void 0:t.length)&&o.push(...s(t))}),o}return{getExpandOption:a(()=>{const{isTreeTable:t}=z(e);return t?{expandedRowKeys:z(l),onExpandedRowsChange:e=>{l.value=e,n("expanded-rows-change",e)}}:{}}),expandAll:function(){l.value=s()},expandRows:function(t){const{isTreeTable:n}=z(e);n&&(l.value=[...l.value,...t])},collapseAll:function(){l.value=[]}}}ze&&window.document,ze&&window.navigator,ze&&window.location,Number.POSITIVE_INFINITY;var Me="vben";function We(e){return{prefixCls:`${Me}-${e}`,prefixVar:Me}}var Ke=["headerCell","bodyCell"],Ue=p({name:"BasicTable",components:{HeaderCell:Ce},props:we,emits:["change","register","expanded-rows-change","resizeColumn"],setup(e,{attrs:t,emit:o,slots:l,expose:r}){const i=k(null),s=k(null),u=k(null),{prefixCls:c}=We("basic-table"),d=a(()=>({...e,...t})),{getPaginationInfo:f,setPagination:p,getPagination:m,getShowPagination:g,setShowPagination:y}=function(e){const t=k({}),o=k(!0);I(()=>z(e).pagination,e=>{!de(e)&&e&&(t.value={...z(t),...e})},{deep:!0});const l=a(()=>{const{pagination:l}=z(e);return!(!z(o)||de(l)&&!l)&&{current:1,pageSize:20,size:"small",defaultPageSize:20,showTotal:e=>n("sys.component.table.total",{total:e}),showSizeChanger:!0,pageSizeOptions:Te,itemRender:_e,showQuickJumper:!0,...de(l)?{}:l??{},...z(t)}});return{getPagination:function(){return z(l)},getPaginationInfo:l,setShowPagination:async function(e){o.value=e},getShowPagination:function(){return z(o)},setPagination:function(e){const n=z(l);t.value={...de(n)?{}:n,...e}}}}(d),h=a(()=>z(f)),v=a(()=>z(d).rowSelection??null),b=a(()=>z(d).dataSource??[]),{getViewColumns:C,getColumnsRef:w,handleResizeColumn:S}=Re(d,h),{getScrollRef:x,redoHeight:T}=je(d,i,w,v,h,b,s,u),{getExpandOption:B,expandAll:A}=Le(d,b,o),P=a(()=>{let e={...t,...z(d),scroll:z(x),tableLayout:"fixed",columns:R(z(C)),pagination:R(z(f)),rowSelection:z(v),dataSource:z(b),...z(B)};return e=H(e,[...Se,"class","onChange"]),e}),_=a(()=>{const e=z(P);return[c,t.class,{[`${c}-form-container`]:e.useSearchForm,[`${c}--inset`]:e.inset}]}),O=a(()=>{const{emptyDataIsShowTable:t,useSearchForm:n,dataSource:o}=e;return!(!t&&n&&!(null==o?void 0:o.length))}),$=a(()=>Object.keys(l).filter(e=>!Ke.includes(e)));return r({expandAll:A,redoHeight:T,setPagination:p,getPagination:m,getShowPagination:g,setShowPagination:y}),o("register",{expandAll:A}),{formRef:u,tableElRef:i,wrapRef:s,getBindValues:P,getWrapperClass:_,handleTableChange:function(...e){o("change",...e);const{onChange:t}=z(d);t&&"function"==typeof t&&t(...e)},handleResizeColumn:function(e,t){S(e,t),o("resizeColumn",e,t)},getEmptyDataIsShowTable:O,slotNames:$,emptyFull:e.emptyFull,redoHeight:T}},mounted(){this.redoHeight()}}),Ve=/* @__PURE__ */be(Ue,[["render",function(e,t,n,o,l,a){const r=A("HeaderCell"),i=A("a-table");return x(),s("div",{ref:"wrapRef",class:v(e.getWrapperClass)},[B(e.$slots,"beforeTable"),N(f(i,y({ref:"tableElRef"},e.getBindValues,{class:e.emptyFull?"empty-basic-table-wrapper":"",onChange:e.handleTableChange,onResizeColumn:e.handleResizeColumn}),c({headerCell:F(({column:e})=>[f(r,{column:e},null,8,["column"])]),bodyCell:F(t=>[B(e.$slots,"bodyCell",b(m(t||{})))]),_:2},[T(e.slotNames,t=>({name:t,fn:F(n=>[B(e.$slots,t,b(m(n||{})))])}))]),1040,["class","onChange","onResizeColumn"]),[[$,e.getEmptyDataIsShowTable]])],2)}]]),qe={key:0},Ge={key:0},Xe=/* @__PURE__ */p({__name:"TableAction",props:{actions:{type:Array,default:null},dropDownActions:{type:Array,default:null},divider:{type:Boolean,default:!0},outside:Boolean,stopButtonPropagation:{type:Boolean,default:!1}},setup(e){const n=e,u=o("basic-table-action"),c=t.has;function d(e){const t=e.ifShow;let n=!0;return de(t)&&(n=t),ce(t)&&(n=t(e)),n}const p=a(()=>(R(n.actions)||[]).filter(e=>c(e.auth)&&d(e)).map(e=>{const{popConfirm:t}=e;return{getPopupContainer:()=>document.body,type:"link",size:"small",...e,...t||{},onConfirm:null==t?void 0:t.confirm,onCancel:null==t?void 0:t.cancel,enable:!!t}})),m=a(()=>{const e=(R(n.dropDownActions)||[]).filter(e=>c(e.auth)&&d(e));return e.map((t,o)=>{const{label:l,popConfirm:a}=t;return{...t,...a,onConfirm:null==a?void 0:a.confirm,onCancel:null==a?void 0:a.cancel,text:l,divider:o<e.length-1&&n.divider}})}),g=a(()=>"left");function h(e){n.stopButtonPropagation&&e.composedPath().find(e=>{var t;return"BUTTON"===(null===(t=e.tagName)||void 0===t?void 0:t.toUpperCase())})&&e.stopPropagation()}return(t,n)=>{const o=A("a-button");return x(),s("div",{class:v([z(u).b(),g.value]),onClick:h},[(x(!0),s(l,null,T(p.value,(t,n)=>{return x(),s(l,{key:`${n}-${t.label}`},[t.tooltip?(x(),r(z(G),y({key:0,placement:"bottom"},{ref_for:!0},(o=t.tooltip,{getPopupContainer:()=>document.body,...ue(o)?{title:o}:o})),{default:F(()=>[f(z(ut),y({ref_for:!0},t),{default:F(()=>[t.label?(x(),s("span",qe,P(t.label),1)):i("",!0)]),_:2},1040)]),_:2},1040)):(x(),r(z(ut),y({key:1,ref_for:!0},t),{default:F(()=>[t.label?(x(),s("span",Ge,P(t.label),1)):i("",!0)]),_:2},1040)),e.divider&&n<p.value.length-1?(x(),r(z(K),{key:2,type:"vertical",class:"action-divider"})):i("",!0)],64);var o}),128)),e.dropDownActions&&m.value.length>0?(x(),r(z(ft),{key:0,trigger:["hover"],"drop-menu-list":m.value,popconfirm:""},{default:F(()=>[B(t.$slots,"more"),t.$slots.more?i("",!0):(x(),r(o,{key:0,type:"link",size:"small"},{default:F(()=>[f(z(L),{class:"icon-more"})]),_:1}))]),_:3},8,["drop-menu-list"])):i("",!0)],2)}}}),Ye={key:0},Je={key:0},Qe=/* @__PURE__ */p({__name:"TableActionAuto",props:{actions:{type:Array,default:null},divider:{type:Boolean,default:!0},outside:Boolean,stopButtonPropagation:{type:Boolean,default:!1},maxDispalyCount:{type:Number,default:4}},setup(e){const n=e,u=o("basic-table-action"),c=t.has,d=a(()=>[...R(n.actions)||[]].filter(e=>c(e.auth)&&function(e){const t=e.ifShow??!0;return ce(t)?t(e):!!t}(e))),p=a(()=>{let e=[];return e=n.maxDispalyCount>=d.value.length?[...d.value]:d.value.slice(0,n.maxDispalyCount),e.map(e=>{const{popConfirm:t}=e;return{getPopupContainer:()=>document.body,type:"link",size:"small",...e,...t||{},onConfirm:null==t?void 0:t.confirm,onCancel:null==t?void 0:t.cancel,enable:!!t}})}),m=a(()=>{let e=[];return n.maxDispalyCount>=d.value.length?[]:(e=d.value.slice(n.maxDispalyCount),e.map((t,o)=>{const{label:l,popConfirm:a}=t;return{...t,...a,onConfirm:null==a?void 0:a.confirm,onCancel:null==a?void 0:a.cancel,text:l,divider:o<e.length-1&&n.divider}}))}),g=a(()=>"left");function h(e){n.stopButtonPropagation&&e.composedPath().find(e=>{var t;return"BUTTON"===(null===(t=e.tagName)||void 0===t?void 0:t.toUpperCase())})&&e.stopPropagation()}return(t,n)=>{const o=A("a-button");return x(),s("div",{class:v([z(u).b(),g.value]),onClick:D(h,["stop"])},[(x(!0),s(l,null,T(p.value,(t,n)=>{return x(),s(l,{key:`${n}-${t.label}`},[t.tooltip?(x(),r(z(G),y({key:0,ref_for:!0},(o=t.tooltip,{getPopupContainer:()=>document.body,placement:"bottom",...ue(o)?{title:o}:o})),{default:F(()=>[f(z(ut),y({ref_for:!0},t),{default:F(()=>[t.label?(x(),s("span",Ye,P(t.label),1)):i("",!0)]),_:2},1040)]),_:2},1040)):(x(),r(z(ut),y({key:1,ref_for:!0},t),{default:F(()=>[t.label?(x(),s("span",Je,P(t.label),1)):i("",!0)]),_:2},1040)),e.divider&&n<p.value.length-1?(x(),r(z(K),{key:2,type:"vertical",class:"action-divider"})):i("",!0)],64);var o}),128)),m.value.length>0?(x(),r(z(ft),{key:0,trigger:["hover"],"drop-menu-list":m.value,popconfirm:""},{default:F(()=>[B(t.$slots,"more"),t.$slots.more?i("",!0):(x(),r(o,{key:0,type:"link",size:"small"},{default:F(()=>[f(z(L),{class:"icon-more"})]),_:1}))]),_:3},8,["drop-menu-list"])):i("",!0)],2)}}});function Ze(){const e=k(null);return[function(t,n){S(()=>{e.value=null}),e.value=t},{expandAll:()=>{(function(){const t=z(e);return t||console.error("The table instance has not been obtained yet, please make sure the table is presented when performing the table operation!"),t})().expandAll()}}]}var et=["primary","error","warning","success",""],tt={color:{type:String,validator:e=>et.includes(e),default:""},loading:{type:Boolean},disabled:{type:Boolean},preIcon:{type:String},postIcon:{type:String},iconSize:{type:Number,default:14},onClick:{type:Function,default:null}},nt=/* @__PURE__ */p({name:"AButton",extends:W,inheritAttrs:!1,__name:"BasicButton",props:tt,setup(e){const t=e,n=O(),o=a(()=>{const{color:e,disabled:n}=t;return[{[`ant-btn-${e}`]:!!e,"is-disabled":n}]}),l=a(()=>({...z(n),...t}));return(e,t)=>(x(),r(z(W),y(l.value,{class:o.value,onClick:e.onClick}),{default:F(t=>[B(e.$slots,"default",b(m(t||{})))]),_:3},16,["class","onClick"]))}}),ot=p({name:"PopButton",inheritAttrs:!1,props:{enable:{type:Boolean,default:!0}},setup(e,{slots:t}){const o=O(),l=a(()=>Object.assign({okText:n("sys.okText"),cancelText:n("sys.cancelText"),overlayStyle:{}},{...e,...z(o)}));return()=>{const n=H(z(l),"icon"),o=H(n,"title");o.disabled&&(o.color="");const a=g(nt,o,t);return e.enable?g(q,n,{default:()=>a}):a}}}),lt=ot,at={class:"custom-btn-container"},rt={class:"btn-left-title"},it=/* @__PURE__ */be(/* @__PURE__ */p({__name:"custom-button",props:{title:{}},emits:["btn-left-click","btn-right-click"],setup:e=>(t,n)=>(x(),s("div",at,[u("div",{class:"btn-left",onClick:n[0]||(n[0]=D(e=>t.$emit("btn-left-click"),["stop"]))},[B(t.$slots,"left-icon",{},void 0,!0),u("div",rt,P(e.title),1)]),u("div",{class:"btn-right",onClick:n[1]||(n[1]=D(e=>t.$emit("btn-right-click"),["stop"]))},[B(t.$slots,"right-icon",{},void 0,!0)])]))}),[["__scopeId","data-v-305f4090"]]),st=nt,ut=lt,ct={class:"ml-1"},dt={key:1,class:"ml-1"},ft=/* @__PURE__ */p({name:"VDropdown",__name:"Dropdown",props:{popconfirm:Boolean,trigger:{type:Array,default:()=>["contextmenu"]},dropMenuList:{type:Array,default:()=>[]},selectedKeys:{type:Array,default:()=>[]}},emits:["menuEvent"],setup(e,{emit:t}){const n=U,o=V,a=V.Item,c=V.Divider,p=q,m=e,g=t;function h(e){const t=H(e,["confirm","cancel","icon"]);return!e.onConfirm&&e.confirm&&ce(e.confirm)&&(t.onConfirm=e.confirm),!e.onCancel&&e.cancel&&ce(e.cancel)&&(t.onCancel=e.cancel),t}return(t,v)=>(x(),r(z(n),y({trigger:e.trigger},t.$attrs),{overlay:F(()=>[f(z(o),{"selected-keys":e.selectedKeys},{default:F(()=>[(x(!0),s(l,null,T(e.dropMenuList,t=>{return x(),s(l,{key:`${t.event}`},[f(z(a),y({class:t.class},{ref_for:!0},(n=t.event,{key:n}),{disabled:t.disabled,onClick:e=>function(e){var t;const{event:n}=e;g("menuEvent",m.dropMenuList.find(e=>`${e.event}`==`${n}`)),null===(t=e.onClick)||void 0===t||t.call(e)}(t)}),{default:F(()=>[e.popconfirm&&t.popConfirm?(x(),r(z(p),y({key:0,ref_for:!0},h(t.popConfirm)),{default:F(()=>[u("div",null,[u("span",ct,P(t.text),1)])]),_:2},1040)):(x(),s("span",dt,P(t.text),1))]),_:2},1040,["class","disabled","onClick"]),t.divider?(x(),r(z(c),{key:`d-${t.event}`})):i("",!0)],64);var n}),128))]),_:1},8,["selected-keys"])]),default:F(()=>[u("span",null,[B(t.$slots,"default")]),d(" "+P(e.dropMenuList)+" ",1)]),_:3},16,["trigger"]))}}),pt=/* @__PURE__ */Y({default:()=>mt}),mt={table:{index:"序号"}},gt=/* @__PURE__ */Y({default:()=>yt}),yt={okText:"确认",cancelText:"取消"},ht=/* @__PURE__ */Object.assign({"./sys/component.ts":pt,"./sys.ts":gt});async function vt(e){_gct.i18nUtil.autoRegisterLocale(ht)}function bt(){}var Ct=new URL("./index.min.css",import.meta.url);e.load(Ct.href);export{Ve as BasicTable,st as Button,it as CustomButton,ft as Dropdown,ut as PopConfirmButton,Xe as TableAction,Qe as TableActionAuto,Q as is,pe as isArray,de as isBoolean,oe as isDate,Z as isDef,ge as isElement,ne as isEmpty,ve as isEmptyStr,ce as isFunction,ye as isMap,le as isNull,ae as isNullAndUnDef,re as isNullOrUnDef,ie as isNumber,te as isObject,se as isPromise,fe as isRegExp,ue as isString,ee as isUnDef,he as isUrl,me as isWindow,bt as run,Ze as useTable,vt as vBenSetupApp};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/v-ben",
|
|
3
|
-
"version": "0.1.6-dev.
|
|
3
|
+
"version": "0.1.6-dev.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台历史 v-ben 内容",
|
|
6
6
|
"loader": "dist/loader.esm.min.js",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"sortablejs": "^1.15.7",
|
|
42
42
|
"vue": "^3.5.30",
|
|
43
43
|
"vue-types": "^6.0.0",
|
|
44
|
-
"@gct-paas/core": "0.1.6-dev.
|
|
45
|
-
"@gct-paas/scss": "0.1.6-dev.
|
|
44
|
+
"@gct-paas/core": "0.1.6-dev.25",
|
|
45
|
+
"@gct-paas/scss": "0.1.6-dev.25"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@gct-paas/api": "^0.1.6-dev.14",
|
|
49
49
|
"vue": ">=3",
|
|
50
|
-
"@gct-paas/core": "0.1.6-dev.
|
|
51
|
-
"@gct-paas/scss": "0.1.6-dev.
|
|
50
|
+
"@gct-paas/core": "0.1.6-dev.25",
|
|
51
|
+
"@gct-paas/scss": "0.1.6-dev.25"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|