@gct-paas/v-ben 0.1.4-dev.10 → 0.1.4-dev.11
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.esm.min.mjs +793 -2
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.css +1 -0
- package/dist/index.system.min.js +1 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/index.d.ts +3 -0
- package/es/components/v-ben-button/index.d.ts +133 -0
- package/es/components/v-ben-button/index.mjs +9 -0
- package/es/components/v-ben-button/src/BasicButton.vue.d.ts +75 -0
- package/es/components/v-ben-button/src/BasicButton.vue.mjs +40 -0
- package/es/components/v-ben-button/src/BasicButton.vue2.mjs +5 -0
- package/es/components/v-ben-button/src/PopConfirmButton.vue.d.ts +24 -0
- package/es/components/v-ben-button/src/PopConfirmButton.vue.mjs +46 -0
- package/es/components/v-ben-button/src/PopConfirmButton.vue2.mjs +5 -0
- package/es/components/v-ben-button/src/custom-button.css +64 -0
- package/es/components/v-ben-button/src/custom-button.vue.d.ts +27 -0
- package/es/components/v-ben-button/src/custom-button.vue.mjs +7 -0
- package/es/components/v-ben-button/src/custom-button.vue3.mjs +32 -0
- package/es/components/v-ben-button/src/props.d.ts +38 -0
- package/es/components/v-ben-button/src/props.mjs +29 -0
- package/es/components/v-ben-dropdown/index.d.ts +85 -0
- package/es/components/v-ben-dropdown/index.mjs +5 -0
- package/es/components/v-ben-dropdown/src/Dropdown.vue.d.ts +66 -0
- package/es/components/v-ben-dropdown/src/Dropdown.vue.mjs +113 -0
- package/es/components/v-ben-dropdown/src/Dropdown.vue2.mjs +5 -0
- package/es/components/v-ben-dropdown/src/typing.d.ts +10 -0
- package/es/components/v-ben-table/index.d.ts +3 -0
- package/es/components/v-ben-table/src/BasicTable.vue.d.ts +410 -0
- package/es/components/v-ben-table/src/BasicTable.vue.mjs +53 -0
- package/es/components/v-ben-table/src/BasicTable.vue2.mjs +48 -0
- package/es/components/v-ben-table/src/components/HeaderCell.vue.d.ts +20 -0
- package/es/components/v-ben-table/src/components/HeaderCell.vue.mjs +10 -0
- package/es/components/v-ben-table/src/components/HeaderCell.vue2.mjs +20 -0
- package/es/components/v-ben-table/src/components/TableAction.css +37 -0
- package/es/components/v-ben-table/src/components/TableAction.vue.d.ts +61 -0
- package/es/components/v-ben-table/src/components/TableAction.vue.mjs +174 -0
- package/es/components/v-ben-table/src/components/TableAction.vue3.mjs +6 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.css +37 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.vue.d.ts +61 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.vue.mjs +181 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.vue3.mjs +6 -0
- package/es/components/v-ben-table/src/props.d.ts +186 -0
- package/es/components/v-ben-table/src/props.mjs +136 -0
- package/es/components/v-ben-table/src/types/column.d.ts +164 -0
- package/es/components/v-ben-table/src/types/componentType.d.ts +1 -0
- package/es/components/v-ben-table/src/types/pagination.d.ts +93 -0
- package/es/components/v-ben-table/src/types/table.d.ts +356 -0
- package/es/components/v-ben-table/src/types/tableAction.d.ts +24 -0
- package/es/hooks/useDesign.d.ts +5 -0
- package/es/hooks/useDesign.mjs +9 -0
- package/es/index.d.ts +2 -0
- package/es/index.mjs +10 -0
- package/es/types/index.d.ts +18 -0
- package/es/utils/is.d.ts +23 -0
- package/es/utils/is.mjs +78 -0
- package/package.json +8 -5
package/dist/index.min.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(){}exports.run=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),h=require("lodash-es"),A=require("@ant-design/icons-vue"),y=require("ant-design-vue"),w=require("@gct-paas/core"),M=Object.prototype.toString;function g(t,r){return M.call(t)===`[object ${r}]`}function N(t){return typeof t<"u"}function _(t){return!N(t)}function S(t){return t!==null&&g(t,"Object")}function I(t){return T(t)||v(t)?t.length===0:t instanceof Map||t instanceof Set?t.size===0:S(t)?Object.keys(t).length===0:!1}function R(t){return g(t,"Date")}function $(t){return t===null}function j(t){return _(t)&&$(t)}function z(t){return _(t)||$(t)}function L(t){return g(t,"Number")}function U(t){return g(t,"Promise")&&S(t)&&C(t.then)&&C(t.then)}function v(t){return g(t,"String")}function C(t){return typeof t=="function"}function E(t){return g(t,"Boolean")}function K(t){return g(t,"RegExp")}function T(t){return!!t&&Array.isArray(t)}function H(t){return typeof window<"u"&&g(t,"Window")}function q(t){return S(t)&&!!t.tagName}function W(t){return g(t,"Map")}const V=typeof window>"u",G=!V;function J(t){return/^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(t)}function Q(t){return t===void 0||!t&&t!==0&&t!=="0"||!/[^\s]/.test(t+"")}const X=e.defineComponent({name:"TableHeaderCell",components:{},props:{column:{type:Object,default:()=>({})}},setup(t){return{getTitle:e.computed(()=>t.column?.customTitle||t.column?.title)}}}),D=(t,r)=>{const c=t.__vccOpts||t;for(const[d,f]of r)c[d]=f;return c};function Y(t,r,c,d,f,i){return e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(t.getTitle),1)}const Z=D(X,[["render",Y]]),ee={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},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}},te=e.defineComponent({name:"BasicTable",components:{HeaderCell:Z},props:ee,emits:["change"],setup(t,{attrs:r,emit:c,slots:d,expose:f}){const i=e.ref(null),u=e.ref([]),m=e.ref(null),p=e.computed(()=>{let n={...r};return n=h.omit(n,["class","onChange"]),n});function B(...n){c("change",...n)}const a=e.computed(()=>{const{emptyDataIsShowTable:n,useSearchForm:o,dataSource:s}=t;return n||!o?!0:!!s.length});return{formRef:m,tableElRef:i,getBindValues:p,handleTableChange:B,expandKeysList:u,getEmptyDataIsShowTable:a}},mounted(){this.expandKeysList=this.getBindValues.expandedRowKeys}}),ne={ref:"wrapRef"},oe={key:0,class:"pr26px"},re={key:1,class:"pr8px"};function le(t,r,c,d,f,i){const u=e.resolveComponent("HeaderCell"),m=e.resolveComponent("a-table");return e.openBlock(),e.createElementBlock("div",ne,[e.renderSlot(t.$slots,"beforeTable"),e.withDirectives(e.createVNode(m,e.mergeProps({ref:"tableElRef"},t.getBindValues,{"expanded-row-keys":t.expandKeysList,"onUpdate:expandedRowKeys":r[0]||(r[0]=p=>t.expandKeysList=p),onChange:t.handleTableChange}),e.createSlots({headerCell:e.withCtx(({column:p})=>[t.rowDraggable&&p?.dataIndex===t.getBindValues.columns[0].dataIndex?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.isTreeTable?(e.openBlock(),e.createElementBlock("span",oe)):(e.openBlock(),e.createElementBlock("span",re)),e.createVNode(u,{column:p},null,8,["column"])],64)):(e.openBlock(),e.createBlock(u,{key:1,column:p},null,8,["column"]))]),bodyCell:e.withCtx(p=>[e.renderSlot(t.$slots,"bodyCell",e.normalizeProps(e.guardReactiveProps(p||{})))]),_:2},[e.renderList(Object.keys(t.$slots),p=>({name:p,fn:e.withCtx(B=>[e.renderSlot(t.$slots,p,e.normalizeProps(e.guardReactiveProps(B||{})))])}))]),1040,["expanded-row-keys","onChange"]),[[e.vShow,t.getEmptyDataIsShowTable]])],512)}const se=D(te,[["render",le]]),P="vben";function F(t){return{prefixCls:`${P}-${t}`,prefixVar:P}}const ae={key:0,class:"text-14px"},ie={key:0,class:"text-14px"},ce=e.defineComponent({__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(t){const r=t,{prefixCls:c}=F("basic-table-action"),d=w.permission.has;function f(a){const n=a.ifShow;let o=!0;return E(n)&&(o=n),C(n)&&(o=n(a)),o}const i=e.computed(()=>(e.toRaw(r.actions)||[]).filter(a=>d(a.auth)&&f(a)).map(a=>{const{popConfirm:n}=a;return{getPopupContainer:()=>document.body,type:"link",size:"small",...a,...n||{},onConfirm:n?.confirm,onCancel:n?.cancel,enable:!!n}})),u=e.computed(()=>{const a=(e.toRaw(r.dropDownActions)||[]).filter(n=>d(n.auth)&&f(n));return a.map((n,o)=>{const{label:s,popConfirm:l}=n;return{...n,...l,onConfirm:l?.confirm,onCancel:l?.cancel,text:s,divider:o<a.length-1?r.divider:!1}})}),m=e.computed(()=>"left");function p(a){return{getPopupContainer:()=>document.body,...v(a)?{title:a}:a}}function B(a){if(!r.stopButtonPropagation)return;a.composedPath().find(s=>s.tagName?.toUpperCase()==="BUTTON")&&a.stopPropagation()}return(a,n)=>{const o=e.resolveComponent("a-button");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(c),m.value]),onClick:B},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(s,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${l}-${s.label}`},[s.tooltip?(e.openBlock(),e.createBlock(e.unref(y.Tooltip),e.mergeProps({key:0,placement:"bottom"},{ref_for:!0},p(s.tooltip)),{default:e.withCtx(()=>[e.createVNode(e.unref(b),e.mergeProps({ref_for:!0},s),{default:e.withCtx(()=>[s.label?(e.openBlock(),e.createElementBlock("span",ae,e.toDisplayString(s.label),1)):e.createCommentVNode("",!0)]),_:2},1040)]),_:2},1040)):(e.openBlock(),e.createBlock(e.unref(b),e.mergeProps({key:1,ref_for:!0},s),{default:e.withCtx(()=>[s.label?(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(s.label),1)):e.createCommentVNode("",!0)]),_:2},1040)),t.divider&&l<i.value.length-1?(e.openBlock(),e.createBlock(e.unref(y.Divider),{key:2,type:"vertical",class:"action-divider"})):e.createCommentVNode("",!0)],64))),128)),t.dropDownActions&&u.value.length>0?(e.openBlock(),e.createBlock(e.unref(x),{key:0,trigger:["hover"],"drop-menu-list":u.value,popconfirm:""},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"more"),a.$slots.more?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(o,{key:0,type:"link",size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(A.MoreOutlined),{class:"icon-more"})]),_:1}))]),_:3},8,["drop-menu-list"])):e.createCommentVNode("",!0)],2)}}}),ue={key:0,class:"text-14px"},pe={key:0,class:"text-14px"},de=e.defineComponent({__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(t){const r=t,{prefixCls:c}=F("basic-table-action"),d=w.permission.has;function f(n){const o=n.ifShow??!0;return C(o)?o(n):!!o}const i=e.computed(()=>[...e.toRaw(r.actions)||[]].filter(n=>d(n.auth)&&f(n))),u=e.computed(()=>{let n=[];return r.maxDispalyCount>=i.value.length?n=[...i.value]:n=i.value.slice(0,r.maxDispalyCount),n.map(o=>{const{popConfirm:s}=o;return{getPopupContainer:()=>document.body,type:"link",size:"small",...o,...s||{},onConfirm:s?.confirm,onCancel:s?.cancel,enable:!!s}})}),m=e.computed(()=>{let n=[];return r.maxDispalyCount>=i.value.length?[]:(n=i.value.slice(r.maxDispalyCount),n.map((o,s)=>{const{label:l,popConfirm:k}=o;return{...o,...k,onConfirm:k?.confirm,onCancel:k?.cancel,text:l,divider:s<n.length-1?r.divider:!1}}))}),p=e.computed(()=>"left");function B(n){return{getPopupContainer:()=>document.body,placement:"bottom",...v(n)?{title:n}:n}}function a(n){if(!r.stopButtonPropagation)return;n.composedPath().find(l=>l.tagName?.toUpperCase()==="BUTTON")&&n.stopPropagation()}return(n,o)=>{const s=e.resolveComponent("a-button");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(c),p.value]),onClick:e.withModifiers(a,["stop"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(l,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${k}-${l.label}`},[l.tooltip?(e.openBlock(),e.createBlock(e.unref(y.Tooltip),e.mergeProps({key:0,ref_for:!0},B(l.tooltip)),{default:e.withCtx(()=>[e.createVNode(e.unref(b),e.mergeProps({ref_for:!0},l),{default:e.withCtx(()=>[l.label?(e.openBlock(),e.createElementBlock("span",ue,e.toDisplayString(l.label),1)):e.createCommentVNode("",!0)]),_:2},1040)]),_:2},1040)):(e.openBlock(),e.createBlock(e.unref(b),e.mergeProps({key:1,ref_for:!0},l),{default:e.withCtx(()=>[l.label?(e.openBlock(),e.createElementBlock("span",pe,e.toDisplayString(l.label),1)):e.createCommentVNode("",!0)]),_:2},1040)),t.divider&&k<u.value.length-1?(e.openBlock(),e.createBlock(e.unref(y.Divider),{key:2,type:"vertical",class:"action-divider"})):e.createCommentVNode("",!0)],64))),128)),m.value.length>0?(e.openBlock(),e.createBlock(e.unref(x),{key:0,trigger:["hover"],"drop-menu-list":m.value,popconfirm:""},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"more"),n.$slots.more?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s,{key:0,type:"link",size:"small"},{default:e.withCtx(()=>[e.createVNode(e.unref(A.MoreOutlined),{class:"icon-more"})]),_:1}))]),_:3},8,["drop-menu-list"])):e.createCommentVNode("",!0)],2)}}}),fe=["primary","error","warning","success",""],me={color:{type:String,validator:t=>fe.includes(t),default:""},loading:{type:Boolean},disabled:{type:Boolean},preIcon:{type:String},postIcon:{type:String},iconSize:{type:Number,default:14},onClick:{type:Function,default:null}},O=e.defineComponent({name:"AButton",extends:y.Button,inheritAttrs:!1,__name:"BasicButton",props:me,setup(t){const r=t,c=e.useAttrs(),d=e.computed(()=>{const{color:i,disabled:u}=r;return[{[`ant-btn-${i}`]:!!i,"is-disabled":u}]}),f=e.computed(()=>({...e.unref(c),...r}));return(i,u)=>(e.openBlock(),e.createBlock(e.unref(y.Button),e.mergeProps(f.value,{class:d.value,onClick:i.onClick}),{default:e.withCtx(m=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(m||{})))]),_:3},16,["class","onClick"]))}}),ye={enable:{type:Boolean,default:!0}},ge=e.defineComponent({name:"PopButton",inheritAttrs:!1,props:ye,setup(t,{slots:r}){const c=e.useAttrs(),d=e.computed(()=>Object.assign({okText:w.t("sys.okText"),cancelText:w.t("sys.cancelText"),overlayStyle:{}},{...t,...e.unref(c)}));return()=>{const f=h.omit(e.unref(d),"icon"),i=h.omit(f,"title");i.disabled&&(i.color="");const u=e.h(O,i,r);return t.enable?e.h(y.Popconfirm,f,{default:()=>u}):u}}}),Be={class:"custom-btn-container"},ke={class:"btn-left-title"},Ce=e.defineComponent({__name:"custom-button",props:{title:{}},emits:["btn-left-click","btn-right-click"],setup(t){return(r,c)=>(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",{class:"btn-left",onClick:c[0]||(c[0]=e.withModifiers(d=>r.$emit("btn-left-click"),["stop"]))},[e.renderSlot(r.$slots,"left-icon",{},void 0,!0),e.createElementVNode("div",ke,e.toDisplayString(t.title),1)]),e.createElementVNode("div",{class:"btn-right",onClick:c[1]||(c[1]=e.withModifiers(d=>r.$emit("btn-right-click"),["stop"]))},[e.renderSlot(r.$slots,"right-icon",{},void 0,!0)])]))}}),be=D(Ce,[["__scopeId","data-v-305f4090"]]),he=O,b=ge,we={class:"ml-1"},Se={key:1,class:"ml-1"},ve=e.defineComponent({name:"VDropdown",__name:"Dropdown",props:{popconfirm:Boolean,trigger:{type:Array,default:()=>["contextmenu"]},dropMenuList:{type:Array,default:()=>[]},selectedKeys:{type:Array,default:()=>[]}},emits:["menuEvent"],setup(t,{emit:r}){const c=y.Dropdown,d=y.Menu,f=y.Menu.Item,i=y.Menu.Divider,u=y.Popconfirm,m=t,p=r;function B(o){const{event:s}=o,l=m.dropMenuList.find(k=>`${k.event}`==`${s}`);p("menuEvent",l),o.onClick?.()}function a(o){const s=h.omit(o,["confirm","cancel","icon"]);return!o.onConfirm&&o.confirm&&C(o.confirm)&&(s.onConfirm=o.confirm),!o.onCancel&&o.cancel&&C(o.cancel)&&(s.onCancel=o.cancel),s}const n=o=>({key:o});return(o,s)=>(e.openBlock(),e.createBlock(e.unref(c),e.mergeProps({trigger:t.trigger},o.$attrs),{overlay:e.withCtx(()=>[e.createVNode(e.unref(d),{"selected-keys":t.selectedKeys},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dropMenuList,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`${l.event}`},[e.createVNode(e.unref(f),e.mergeProps({class:l.class},{ref_for:!0},n(l.event),{disabled:l.disabled,onClick:k=>B(l)}),{default:e.withCtx(()=>[t.popconfirm&&l.popConfirm?(e.openBlock(),e.createBlock(e.unref(u),e.mergeProps({key:0,ref_for:!0},a(l.popConfirm)),{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("span",we,e.toDisplayString(l.text),1)])]),_:2},1040)):(e.openBlock(),e.createElementBlock("span",Se,e.toDisplayString(l.text),1))]),_:2},1040,["class","disabled","onClick"]),l.divider?(e.openBlock(),e.createBlock(e.unref(i),{key:`d-${l.event}`})):e.createCommentVNode("",!0)],64))),128))]),_:1},8,["selected-keys"])]),default:e.withCtx(()=>[e.createElementVNode("span",null,[e.renderSlot(o.$slots,"default")]),e.createTextVNode(" "+e.toDisplayString(t.dropMenuList)+" ",1)]),_:3},16,["trigger"]))}}),x=ve;function _e(){}exports.BasicTable=se;exports.Button=he;exports.CustomButton=be;exports.Dropdown=x;exports.PopConfirmButton=b;exports.TableAction=ce;exports.TableActionAuto=de;exports.is=g;exports.isArray=T;exports.isBoolean=E;exports.isClient=G;exports.isDate=R;exports.isDef=N;exports.isElement=q;exports.isEmpty=I;exports.isEmptyStr=Q;exports.isFunction=C;exports.isMap=W;exports.isNull=$;exports.isNullAndUnDef=j;exports.isNullOrUnDef=z;exports.isNumber=L;exports.isObject=S;exports.isPromise=U;exports.isRegExp=K;exports.isServer=V;exports.isString=v;exports.isUnDef=_;exports.isUrl=J;exports.isWindow=H;exports.run=_e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
."vben-basic-table-action" .ant-divider,."vben-basic-table-action" .ant-divider-vertical{margin:0 2px}."vben-basic-table-action"{display:flex;align-items:center}."vben-basic-table-action" .action-divider{display:table}."vben-basic-table-action".left{justify-content:flex-start}."vben-basic-table-action".center{justify-content:center}."vben-basic-table-action".right{justify-content:flex-end}."vben-basic-table-action" button{display:flex;align-items:center}."vben-basic-table-action" button span{margin-left:0!important}."vben-basic-table-action" button.ant-btn-circle span{margin:auto!important}."vben-basic-table-action" .ant-divider,."vben-basic-table-action" .ant-divider-vertical{margin:0 10px}."vben-basic-table-action" .icon-more{transform:rotate(90deg)}."vben-basic-table-action" .icon-more svg{font-size:1.1em;font-weight:700}.custom-btn-container[data-v-305f4090]{display:inline-flex;justify-content:center;align-items:center;line-height:1.5715;position:relative;font-weight:400;white-space:nowrap;text-align:center;background-image:none;border:1px solid transparent;cursor:pointer;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;user-select:none;touch-action:manipulation;height:32px;font-size:14px;border-radius:4px;color:#fff;border-color:var(--ant-primary-color);background:var(--ant-primary-color);text-shadow:0 -1px 0 rgba(0,0,0,.12);box-shadow:0 2px #0000000b;vertical-align:top}.custom-btn-container .btn-left[data-v-305f4090]{display:flex;align-items:center;justify-content:center;height:32px;padding:4px 12px;margin-right:1px}.custom-btn-container .btn-left-title[data-v-305f4090]{margin-left:4px;line-height:22px}.custom-btn-container .btn-left[data-v-305f4090]:hover{color:#fff;border-color:var(--ant-primary-color-hover);background:var(--ant-primary-color-hover)}.custom-btn-container .btn-right[data-v-305f4090]{display:flex;align-items:center;justify-content:center;position:relative;height:32px;padding:4px 12px;margin-left:2px}.custom-btn-container .btn-right[data-v-305f4090]:before{content:"";position:absolute;width:1px;height:14px;background-color:#fff;left:-2px}.custom-btn-container .btn-right[data-v-305f4090]:hover{color:#fff;border-color:var(--ant-primary-color-hover);background:var(--ant-primary-color-hover)}
|
package/dist/index.system.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register([],(function(e,t){"use strict";return{execute:(function(){e("run",n);function n(){}})}}));
|
|
1
|
+
System.register(["vue","lodash-es","@ant-design/icons-vue","ant-design-vue","@gct-paas/core"],(function(k,Ge){"use strict";var D,C,s,f,w,M,F,$,se,A,B,le,d,j,R,N,b,I,ie,V,W,u,v,z,q,G,x,ae,E,J,Q,X,Y,Z,L,ue,ee,te;return{setters:[n=>{D=n.defineComponent,C=n.computed,s=n.openBlock,f=n.createElementBlock,w=n.toDisplayString,M=n.ref,F=n.resolveComponent,$=n.renderSlot,se=n.withDirectives,A=n.createVNode,B=n.mergeProps,le=n.createSlots,d=n.withCtx,j=n.normalizeProps,R=n.guardReactiveProps,N=n.Fragment,b=n.createBlock,I=n.renderList,ie=n.vShow,V=n.toRaw,W=n.normalizeClass,u=n.unref,v=n.createCommentVNode,z=n.withModifiers,q=n.useAttrs,G=n.h,x=n.createElementVNode,ae=n.createTextVNode},n=>{E=n.omit},n=>{J=n.MoreOutlined},n=>{Q=n.Tooltip,X=n.Divider,Y=n.Button,Z=n.Popconfirm,L=n.Menu,ue=n.Dropdown},n=>{ee=n.permission,te=n.t}],execute:(function(){k({is:S,isArray:fe,isBoolean:pe,isDate:he,isDef:ce,isElement:$e,isEmpty:be,isEmptyStr:Te,isFunction:O,isMap:Se,isNull:oe,isNullAndUnDef:Ce,isNullOrUnDef:Be,isNumber:ve,isObject:U,isPromise:_e,isRegExp:ke,isString:K,isUnDef:ne,isUrl:Ae,isWindow:we,run:qe});const n=Object.prototype.toString;function S(e,r){return n.call(e)===`[object ${r}]`}function ce(e){return typeof e<"u"}function ne(e){return!ce(e)}function U(e){return e!==null&&S(e,"Object")}function be(e){return fe(e)||K(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:U(e)?Object.keys(e).length===0:!1}function he(e){return S(e,"Date")}function oe(e){return e===null}function Ce(e){return ne(e)&&oe(e)}function Be(e){return ne(e)||oe(e)}function ve(e){return S(e,"Number")}function _e(e){return S(e,"Promise")&&U(e)&&O(e.then)&&O(e.then)}function K(e){return S(e,"String")}function O(e){return typeof e=="function"}function pe(e){return S(e,"Boolean")}function ke(e){return S(e,"RegExp")}function fe(e){return!!e&&Array.isArray(e)}function we(e){return typeof window<"u"&&S(e,"Window")}function $e(e){return U(e)&&!!e.tagName}function Se(e){return S(e,"Map")}const De=k("isServer",typeof window>"u"),Je=k("isClient",!De);function Ae(e){return/^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/.test(e)}function Te(e){return e===void 0||!e&&e!==0&&e!=="0"||!/[^\s]/.test(e+"")}const Pe=D({name:"TableHeaderCell",components:{},props:{column:{type:Object,default:()=>({})}},setup(e){return{getTitle:C(()=>e.column?.customTitle||e.column?.title)}}}),re=(e,r)=>{const p=e.__vccOpts||e;for(const[g,h]of r)p[g]=h;return p};function Ne(e,r,p,g,h,c){return s(),f("span",null,w(e.getTitle),1)}const xe=D({name:"BasicTable",components:{HeaderCell:re(Pe,[["render",Ne]])},props:{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},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}},emits:["change"],setup(e,{attrs:r,emit:p,slots:g,expose:h}){const c=M(null),y=M([]),_=M(null),m=C(()=>{let t={...r};return t=E(t,["class","onChange"]),t});function T(...t){p("change",...t)}const a=C(()=>{const{emptyDataIsShowTable:t,useSearchForm:o,dataSource:i}=e;return t||!o?!0:!!i.length});return{formRef:_,tableElRef:c,getBindValues:m,handleTableChange:T,expandKeysList:y,getEmptyDataIsShowTable:a}},mounted(){this.expandKeysList=this.getBindValues.expandedRowKeys}}),Oe={ref:"wrapRef"},Fe={key:0,class:"pr26px"},Ie={key:1,class:"pr8px"};function Ee(e,r,p,g,h,c){const y=F("HeaderCell"),_=F("a-table");return s(),f("div",Oe,[$(e.$slots,"beforeTable"),se(A(_,B({ref:"tableElRef"},e.getBindValues,{"expanded-row-keys":e.expandKeysList,"onUpdate:expandedRowKeys":r[0]||(r[0]=m=>e.expandKeysList=m),onChange:e.handleTableChange}),le({headerCell:d(({column:m})=>[e.rowDraggable&&m?.dataIndex===e.getBindValues.columns[0].dataIndex?(s(),f(N,{key:0},[e.isTreeTable?(s(),f("span",Fe)):(s(),f("span",Ie)),A(y,{column:m},null,8,["column"])],64)):(s(),b(y,{key:1,column:m},null,8,["column"]))]),bodyCell:d(m=>[$(e.$slots,"bodyCell",j(R(m||{})))]),_:2},[I(Object.keys(e.$slots),m=>({name:m,fn:d(T=>[$(e.$slots,m,j(R(T||{})))])}))]),1040,["expanded-row-keys","onChange"]),[[ie,e.getEmptyDataIsShowTable]])],512)}const Ye=k("BasicTable",re(xe,[["render",Ee]])),de="vben";function ye(e){return{prefixCls:`${de}-${e}`,prefixVar:de}}const Me={key:0,class:"text-14px"},je={key:0,class:"text-14px"},Ze=k("TableAction",D({__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 r=e,{prefixCls:p}=ye("basic-table-action"),g=ee.has;function h(a){const t=a.ifShow;let o=!0;return pe(t)&&(o=t),O(t)&&(o=t(a)),o}const c=C(()=>(V(r.actions)||[]).filter(a=>g(a.auth)&&h(a)).map(a=>{const{popConfirm:t}=a;return{getPopupContainer:()=>document.body,type:"link",size:"small",...a,...t||{},onConfirm:t?.confirm,onCancel:t?.cancel,enable:!!t}})),y=C(()=>{const a=(V(r.dropDownActions)||[]).filter(t=>g(t.auth)&&h(t));return a.map((t,o)=>{const{label:i,popConfirm:l}=t;return{...t,...l,onConfirm:l?.confirm,onCancel:l?.cancel,text:i,divider:o<a.length-1?r.divider:!1}})}),_=C(()=>"left");function m(a){return{getPopupContainer:()=>document.body,...K(a)?{title:a}:a}}function T(a){if(!r.stopButtonPropagation)return;a.composedPath().find(i=>i.tagName?.toUpperCase()==="BUTTON")&&a.stopPropagation()}return(a,t)=>{const o=F("a-button");return s(),f("div",{class:W([u(p),_.value]),onClick:T},[(s(!0),f(N,null,I(c.value,(i,l)=>(s(),f(N,{key:`${l}-${i.label}`},[i.tooltip?(s(),b(u(Q),B({key:0,placement:"bottom"},{ref_for:!0},m(i.tooltip)),{default:d(()=>[A(u(H),B({ref_for:!0},i),{default:d(()=>[i.label?(s(),f("span",Me,w(i.label),1)):v("",!0)]),_:2},1040)]),_:2},1040)):(s(),b(u(H),B({key:1,ref_for:!0},i),{default:d(()=>[i.label?(s(),f("span",je,w(i.label),1)):v("",!0)]),_:2},1040)),e.divider&&l<c.value.length-1?(s(),b(u(X),{key:2,type:"vertical",class:"action-divider"})):v("",!0)],64))),128)),e.dropDownActions&&y.value.length>0?(s(),b(u(ge),{key:0,trigger:["hover"],"drop-menu-list":y.value,popconfirm:""},{default:d(()=>[$(a.$slots,"more"),a.$slots.more?v("",!0):(s(),b(o,{key:0,type:"link",size:"small"},{default:d(()=>[A(u(J),{class:"icon-more"})]),_:1}))]),_:3},8,["drop-menu-list"])):v("",!0)],2)}}})),Re={key:0,class:"text-14px"},Ve={key:0,class:"text-14px"},et=k("TableActionAuto",D({__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 r=e,{prefixCls:p}=ye("basic-table-action"),g=ee.has;function h(t){const o=t.ifShow??!0;return O(o)?o(t):!!o}const c=C(()=>[...V(r.actions)||[]].filter(t=>g(t.auth)&&h(t))),y=C(()=>{let t=[];return r.maxDispalyCount>=c.value.length?t=[...c.value]:t=c.value.slice(0,r.maxDispalyCount),t.map(o=>{const{popConfirm:i}=o;return{getPopupContainer:()=>document.body,type:"link",size:"small",...o,...i||{},onConfirm:i?.confirm,onCancel:i?.cancel,enable:!!i}})}),_=C(()=>{let t=[];return r.maxDispalyCount>=c.value.length?[]:(t=c.value.slice(r.maxDispalyCount),t.map((o,i)=>{const{label:l,popConfirm:P}=o;return{...o,...P,onConfirm:P?.confirm,onCancel:P?.cancel,text:l,divider:i<t.length-1?r.divider:!1}}))}),m=C(()=>"left");function T(t){return{getPopupContainer:()=>document.body,placement:"bottom",...K(t)?{title:t}:t}}function a(t){if(!r.stopButtonPropagation)return;t.composedPath().find(l=>l.tagName?.toUpperCase()==="BUTTON")&&t.stopPropagation()}return(t,o)=>{const i=F("a-button");return s(),f("div",{class:W([u(p),m.value]),onClick:z(a,["stop"])},[(s(!0),f(N,null,I(y.value,(l,P)=>(s(),f(N,{key:`${P}-${l.label}`},[l.tooltip?(s(),b(u(Q),B({key:0,ref_for:!0},T(l.tooltip)),{default:d(()=>[A(u(H),B({ref_for:!0},l),{default:d(()=>[l.label?(s(),f("span",Re,w(l.label),1)):v("",!0)]),_:2},1040)]),_:2},1040)):(s(),b(u(H),B({key:1,ref_for:!0},l),{default:d(()=>[l.label?(s(),f("span",Ve,w(l.label),1)):v("",!0)]),_:2},1040)),e.divider&&P<y.value.length-1?(s(),b(u(X),{key:2,type:"vertical",class:"action-divider"})):v("",!0)],64))),128)),_.value.length>0?(s(),b(u(ge),{key:0,trigger:["hover"],"drop-menu-list":_.value,popconfirm:""},{default:d(()=>[$(t.$slots,"more"),t.$slots.more?v("",!0):(s(),b(i,{key:0,type:"link",size:"small"},{default:d(()=>[A(u(J),{class:"icon-more"})]),_:1}))]),_:3},8,["drop-menu-list"])):v("",!0)],2)}}})),ze=["primary","error","warning","success",""],me=D({name:"AButton",extends:Y,inheritAttrs:!1,__name:"BasicButton",props:{color:{type:String,validator:e=>ze.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}},setup(e){const r=e,p=q(),g=C(()=>{const{color:c,disabled:y}=r;return[{[`ant-btn-${c}`]:!!c,"is-disabled":y}]}),h=C(()=>({...u(p),...r}));return(c,y)=>(s(),b(u(Y),B(h.value,{class:g.value,onClick:c.onClick}),{default:d(_=>[$(c.$slots,"default",j(R(_||{})))]),_:3},16,["class","onClick"]))}}),Le=D({name:"PopButton",inheritAttrs:!1,props:{enable:{type:Boolean,default:!0}},setup(e,{slots:r}){const p=q(),g=C(()=>Object.assign({okText:te("sys.okText"),cancelText:te("sys.cancelText"),overlayStyle:{}},{...e,...u(p)}));return()=>{const h=E(u(g),"icon"),c=E(h,"title");c.disabled&&(c.color="");const y=G(me,c,r);return e.enable?G(Z,h,{default:()=>y}):y}}}),Ue={class:"custom-btn-container"},Ke={class:"btn-left-title"},rt=k("CustomButton",re(D({__name:"custom-button",props:{title:{}},emits:["btn-left-click","btn-right-click"],setup(e){return(r,p)=>(s(),f("div",Ue,[x("div",{class:"btn-left",onClick:p[0]||(p[0]=z(g=>r.$emit("btn-left-click"),["stop"]))},[$(r.$slots,"left-icon",{},void 0,!0),x("div",Ke,w(e.title),1)]),x("div",{class:"btn-right",onClick:p[1]||(p[1]=z(g=>r.$emit("btn-right-click"),["stop"]))},[$(r.$slots,"right-icon",{},void 0,!0)])]))}}),[["__scopeId","data-v-305f4090"]])),st=k("Button",me),H=k("PopConfirmButton",Le),He={class:"ml-1"},We={key:1,class:"ml-1"},ge=k("Dropdown",D({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:r}){const p=ue,g=L,h=L.Item,c=L.Divider,y=Z,_=e,m=r;function T(o){const{event:i}=o,l=_.dropMenuList.find(P=>`${P.event}`==`${i}`);m("menuEvent",l),o.onClick?.()}function a(o){const i=E(o,["confirm","cancel","icon"]);return!o.onConfirm&&o.confirm&&O(o.confirm)&&(i.onConfirm=o.confirm),!o.onCancel&&o.cancel&&O(o.cancel)&&(i.onCancel=o.cancel),i}const t=o=>({key:o});return(o,i)=>(s(),b(u(p),B({trigger:e.trigger},o.$attrs),{overlay:d(()=>[A(u(g),{"selected-keys":e.selectedKeys},{default:d(()=>[(s(!0),f(N,null,I(e.dropMenuList,l=>(s(),f(N,{key:`${l.event}`},[A(u(h),B({class:l.class},{ref_for:!0},t(l.event),{disabled:l.disabled,onClick:P=>T(l)}),{default:d(()=>[e.popconfirm&&l.popConfirm?(s(),b(u(y),B({key:0,ref_for:!0},a(l.popConfirm)),{default:d(()=>[x("div",null,[x("span",He,w(l.text),1)])]),_:2},1040)):(s(),f("span",We,w(l.text),1))]),_:2},1040,["class","disabled","onClick"]),l.divider?(s(),b(u(c),{key:`d-${l.event}`})):v("",!0)],64))),128))]),_:1},8,["selected-keys"])]),default:d(()=>[x("span",null,[$(o.$slots,"default")]),ae(" "+w(e.dropMenuList)+" ",1)]),_:3},16,["trigger"]))}}));function qe(){}})}}));
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { buttonProps } from './src/props';
|
|
3
|
+
import { default as CustomButton } from './src/custom-button.vue';
|
|
4
|
+
export declare const Button: {
|
|
5
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<ExtractPropTypes<{
|
|
6
|
+
color: {
|
|
7
|
+
type: import('vue').PropType<string>;
|
|
8
|
+
validator: (v: string) => boolean;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
loading: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
};
|
|
14
|
+
disabled: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
};
|
|
17
|
+
preIcon: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
};
|
|
20
|
+
postIcon: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
};
|
|
23
|
+
iconSize: {
|
|
24
|
+
type: NumberConstructor;
|
|
25
|
+
default: number;
|
|
26
|
+
};
|
|
27
|
+
onClick: {
|
|
28
|
+
type: import('vue').PropType<Fn>;
|
|
29
|
+
default: null;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
onClick: Fn<any, any>;
|
|
34
|
+
loading: boolean;
|
|
35
|
+
color: string;
|
|
36
|
+
iconSize: number;
|
|
37
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
38
|
+
P: {};
|
|
39
|
+
B: {};
|
|
40
|
+
D: {};
|
|
41
|
+
C: {};
|
|
42
|
+
M: {};
|
|
43
|
+
Defaults: {};
|
|
44
|
+
}, Readonly<ExtractPropTypes<{
|
|
45
|
+
color: {
|
|
46
|
+
type: import('vue').PropType<string>;
|
|
47
|
+
validator: (v: string) => boolean;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
loading: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
};
|
|
53
|
+
disabled: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
};
|
|
56
|
+
preIcon: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
};
|
|
59
|
+
postIcon: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
};
|
|
62
|
+
iconSize: {
|
|
63
|
+
type: NumberConstructor;
|
|
64
|
+
default: number;
|
|
65
|
+
};
|
|
66
|
+
onClick: {
|
|
67
|
+
type: import('vue').PropType<Fn>;
|
|
68
|
+
default: null;
|
|
69
|
+
};
|
|
70
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
71
|
+
disabled: boolean;
|
|
72
|
+
onClick: Fn<any, any>;
|
|
73
|
+
loading: boolean;
|
|
74
|
+
color: string;
|
|
75
|
+
iconSize: number;
|
|
76
|
+
}>;
|
|
77
|
+
__isFragment?: never;
|
|
78
|
+
__isTeleport?: never;
|
|
79
|
+
__isSuspense?: never;
|
|
80
|
+
} & import('vue').ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
81
|
+
color: {
|
|
82
|
+
type: import('vue').PropType<string>;
|
|
83
|
+
validator: (v: string) => boolean;
|
|
84
|
+
default: string;
|
|
85
|
+
};
|
|
86
|
+
loading: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
};
|
|
89
|
+
disabled: {
|
|
90
|
+
type: BooleanConstructor;
|
|
91
|
+
};
|
|
92
|
+
preIcon: {
|
|
93
|
+
type: StringConstructor;
|
|
94
|
+
};
|
|
95
|
+
postIcon: {
|
|
96
|
+
type: StringConstructor;
|
|
97
|
+
};
|
|
98
|
+
iconSize: {
|
|
99
|
+
type: NumberConstructor;
|
|
100
|
+
default: number;
|
|
101
|
+
};
|
|
102
|
+
onClick: {
|
|
103
|
+
type: import('vue').PropType<Fn>;
|
|
104
|
+
default: null;
|
|
105
|
+
};
|
|
106
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
107
|
+
disabled: boolean;
|
|
108
|
+
onClick: Fn<any, any>;
|
|
109
|
+
loading: boolean;
|
|
110
|
+
color: string;
|
|
111
|
+
iconSize: number;
|
|
112
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
113
|
+
$slots: {
|
|
114
|
+
default?(_: any): any;
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
export declare const PopConfirmButton: import('vue').DefineComponent<ExtractPropTypes<{
|
|
118
|
+
enable: {
|
|
119
|
+
type: BooleanConstructor;
|
|
120
|
+
default: boolean;
|
|
121
|
+
};
|
|
122
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
123
|
+
[key: string]: any;
|
|
124
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ExtractPropTypes<{
|
|
125
|
+
enable: {
|
|
126
|
+
type: BooleanConstructor;
|
|
127
|
+
default: boolean;
|
|
128
|
+
};
|
|
129
|
+
}>> & Readonly<{}>, {
|
|
130
|
+
enable: boolean;
|
|
131
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
132
|
+
export { CustomButton };
|
|
133
|
+
export declare type ButtonProps = Partial<ExtractPropTypes<typeof buttonProps>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _sfc_main from './src/BasicButton.vue.mjs';
|
|
2
|
+
import _sfc_main$1 from './src/PopConfirmButton.vue.mjs';
|
|
3
|
+
import 'vue';
|
|
4
|
+
import './src/custom-button.css';/* empty css */
|
|
5
|
+
|
|
6
|
+
const Button = _sfc_main;
|
|
7
|
+
const PopConfirmButton = _sfc_main$1;
|
|
8
|
+
|
|
9
|
+
export { Button, PopConfirmButton };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
default?(_: any): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: any;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
11
|
+
color: {
|
|
12
|
+
type: import('vue').PropType<string>;
|
|
13
|
+
validator: (v: string) => boolean;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
loading: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
};
|
|
19
|
+
disabled: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
};
|
|
22
|
+
preIcon: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
};
|
|
25
|
+
postIcon: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
28
|
+
iconSize: {
|
|
29
|
+
type: NumberConstructor;
|
|
30
|
+
default: number;
|
|
31
|
+
};
|
|
32
|
+
onClick: {
|
|
33
|
+
type: import('vue').PropType<Fn>;
|
|
34
|
+
default: null;
|
|
35
|
+
};
|
|
36
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
37
|
+
color: {
|
|
38
|
+
type: import('vue').PropType<string>;
|
|
39
|
+
validator: (v: string) => boolean;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
loading: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
};
|
|
45
|
+
disabled: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
};
|
|
48
|
+
preIcon: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
};
|
|
51
|
+
postIcon: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
iconSize: {
|
|
55
|
+
type: NumberConstructor;
|
|
56
|
+
default: number;
|
|
57
|
+
};
|
|
58
|
+
onClick: {
|
|
59
|
+
type: import('vue').PropType<Fn>;
|
|
60
|
+
default: null;
|
|
61
|
+
};
|
|
62
|
+
}>> & Readonly<{}>, {
|
|
63
|
+
disabled: boolean;
|
|
64
|
+
onClick: Fn<any, any>;
|
|
65
|
+
loading: boolean;
|
|
66
|
+
color: string;
|
|
67
|
+
iconSize: number;
|
|
68
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
69
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
70
|
+
export default _default;
|
|
71
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
72
|
+
new (): {
|
|
73
|
+
$slots: S;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, computed, unref, openBlock, createBlock, mergeProps, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
|
+
import { Button } from 'ant-design-vue';
|
|
3
|
+
import { buttonProps } from './props.mjs';
|
|
4
|
+
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...{
|
|
7
|
+
name: "AButton",
|
|
8
|
+
extends: Button,
|
|
9
|
+
inheritAttrs: false
|
|
10
|
+
},
|
|
11
|
+
__name: "BasicButton",
|
|
12
|
+
props: buttonProps,
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const attrs = useAttrs();
|
|
16
|
+
const getButtonClass = computed(() => {
|
|
17
|
+
const { color, disabled } = props;
|
|
18
|
+
return [
|
|
19
|
+
{
|
|
20
|
+
[`ant-btn-${color}`]: !!color,
|
|
21
|
+
[`is-disabled`]: disabled
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
});
|
|
25
|
+
const getBindValue = computed(() => ({ ...unref(attrs), ...props }));
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(), createBlock(unref(Button), mergeProps(getBindValue.value, {
|
|
28
|
+
class: getButtonClass.value,
|
|
29
|
+
onClick: _ctx.onClick
|
|
30
|
+
}), {
|
|
31
|
+
default: withCtx((data) => [
|
|
32
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(data || {})))
|
|
33
|
+
]),
|
|
34
|
+
_: 3
|
|
35
|
+
}, 16, ["class", "onClick"]);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
/**
|
|
3
|
+
* Whether to enable the drop-down menu
|
|
4
|
+
* @default: true
|
|
5
|
+
*/
|
|
6
|
+
enable: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
default: boolean;
|
|
9
|
+
};
|
|
10
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
+
/**
|
|
14
|
+
* Whether to enable the drop-down menu
|
|
15
|
+
* @default: true
|
|
16
|
+
*/
|
|
17
|
+
enable: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
enable: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent, useAttrs, computed, unref, h } from 'vue';
|
|
2
|
+
import _sfc_main$1 from './BasicButton.vue.mjs';
|
|
3
|
+
import { Popconfirm } from 'ant-design-vue';
|
|
4
|
+
import { omit } from 'lodash-es';
|
|
5
|
+
import { t } from '@gct-paas/core';
|
|
6
|
+
|
|
7
|
+
const props = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to enable the drop-down menu
|
|
10
|
+
* @default: true
|
|
11
|
+
*/
|
|
12
|
+
enable: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: true
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const _sfc_main = defineComponent({
|
|
18
|
+
name: "PopButton",
|
|
19
|
+
inheritAttrs: false,
|
|
20
|
+
props,
|
|
21
|
+
setup(props2, { slots }) {
|
|
22
|
+
const attrs = useAttrs();
|
|
23
|
+
const getBindValues = computed(() => {
|
|
24
|
+
return Object.assign(
|
|
25
|
+
{
|
|
26
|
+
okText: t("sys.okText"),
|
|
27
|
+
cancelText: t("sys.cancelText"),
|
|
28
|
+
overlayStyle: {}
|
|
29
|
+
},
|
|
30
|
+
{ ...props2, ...unref(attrs) }
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
return () => {
|
|
34
|
+
const bindValues = omit(unref(getBindValues), "icon");
|
|
35
|
+
const btnBind = omit(bindValues, "title");
|
|
36
|
+
if (btnBind.disabled) btnBind.color = "";
|
|
37
|
+
const Button = h(_sfc_main$1, btnBind, slots);
|
|
38
|
+
if (!props2.enable) {
|
|
39
|
+
return Button;
|
|
40
|
+
}
|
|
41
|
+
return h(Popconfirm, bindValues, { default: () => Button });
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.custom-btn-container[data-v-305f4090] {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
line-height: 1.5715;
|
|
6
|
+
position: relative;
|
|
7
|
+
font-weight: 400;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
text-align: center;
|
|
10
|
+
background-image: none;
|
|
11
|
+
border: 1px solid transparent;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
14
|
+
user-select: none;
|
|
15
|
+
touch-action: manipulation;
|
|
16
|
+
height: 32px;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
color: #fff;
|
|
20
|
+
border-color: var(--ant-primary-color);
|
|
21
|
+
background: var(--ant-primary-color);
|
|
22
|
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
|
|
23
|
+
box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
|
|
24
|
+
vertical-align: top;
|
|
25
|
+
}
|
|
26
|
+
.custom-btn-container .btn-left[data-v-305f4090] {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
height: 32px;
|
|
31
|
+
padding: 4px 12px;
|
|
32
|
+
margin-right: 1px;
|
|
33
|
+
}
|
|
34
|
+
.custom-btn-container .btn-left-title[data-v-305f4090] {
|
|
35
|
+
margin-left: 4px;
|
|
36
|
+
line-height: 22px;
|
|
37
|
+
}
|
|
38
|
+
.custom-btn-container .btn-left[data-v-305f4090]:hover {
|
|
39
|
+
color: #fff;
|
|
40
|
+
border-color: var(--ant-primary-color-hover);
|
|
41
|
+
background: var(--ant-primary-color-hover);
|
|
42
|
+
}
|
|
43
|
+
.custom-btn-container .btn-right[data-v-305f4090] {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
position: relative;
|
|
48
|
+
height: 32px;
|
|
49
|
+
padding: 4px 12px;
|
|
50
|
+
margin-left: 2px;
|
|
51
|
+
}
|
|
52
|
+
.custom-btn-container .btn-right[data-v-305f4090]::before {
|
|
53
|
+
content: '';
|
|
54
|
+
position: absolute;
|
|
55
|
+
width: 1px;
|
|
56
|
+
height: 14px;
|
|
57
|
+
background-color: #fff;
|
|
58
|
+
left: -2px;
|
|
59
|
+
}
|
|
60
|
+
.custom-btn-container .btn-right[data-v-305f4090]:hover {
|
|
61
|
+
color: #fff;
|
|
62
|
+
border-color: var(--ant-primary-color-hover);
|
|
63
|
+
background: var(--ant-primary-color-hover);
|
|
64
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
}
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
attrs: Partial<{}>;
|
|
6
|
+
slots: {
|
|
7
|
+
'left-icon'?(_: {}): any;
|
|
8
|
+
'right-icon'?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: HTMLDivElement;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
"btn-left-click": (...args: any[]) => void;
|
|
16
|
+
"btn-right-click": (...args: any[]) => void;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
18
|
+
"onBtn-left-click"?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
"onBtn-right-click"?: ((...args: any[]) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from './custom-button.vue3.mjs';
|
|
2
|
+
import './custom-button.css';/* empty css */
|
|
3
|
+
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
4
|
+
|
|
5
|
+
const customButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-305f4090"]]);
|
|
6
|
+
|
|
7
|
+
export { customButton as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, withModifiers, renderSlot, toDisplayString } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = { class: "custom-btn-container" };
|
|
4
|
+
const _hoisted_2 = { class: "btn-left-title" };
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "custom-button",
|
|
7
|
+
props: {
|
|
8
|
+
title: {}
|
|
9
|
+
},
|
|
10
|
+
emits: ["btn-left-click", "btn-right-click"],
|
|
11
|
+
setup(__props) {
|
|
12
|
+
return (_ctx, _cache) => {
|
|
13
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
14
|
+
createElementVNode("div", {
|
|
15
|
+
class: "btn-left",
|
|
16
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.$emit("btn-left-click"), ["stop"]))
|
|
17
|
+
}, [
|
|
18
|
+
renderSlot(_ctx.$slots, "left-icon", {}, void 0, true),
|
|
19
|
+
createElementVNode("div", _hoisted_2, toDisplayString(__props.title), 1)
|
|
20
|
+
]),
|
|
21
|
+
createElementVNode("div", {
|
|
22
|
+
class: "btn-right",
|
|
23
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.$emit("btn-right-click"), ["stop"]))
|
|
24
|
+
}, [
|
|
25
|
+
renderSlot(_ctx.$slots, "right-icon", {}, void 0, true)
|
|
26
|
+
])
|
|
27
|
+
]);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export declare const buttonProps: {
|
|
3
|
+
color: {
|
|
4
|
+
type: PropType<string>;
|
|
5
|
+
validator: (v: string) => boolean;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
loading: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
};
|
|
11
|
+
disabled: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Text before icon.
|
|
16
|
+
*/
|
|
17
|
+
preIcon: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Text after icon.
|
|
22
|
+
*/
|
|
23
|
+
postIcon: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* preIcon and postIcon icon size.
|
|
28
|
+
* @default: 14
|
|
29
|
+
*/
|
|
30
|
+
iconSize: {
|
|
31
|
+
type: NumberConstructor;
|
|
32
|
+
default: number;
|
|
33
|
+
};
|
|
34
|
+
onClick: {
|
|
35
|
+
type: PropType<Fn>;
|
|
36
|
+
default: null;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const validColors = ["primary", "error", "warning", "success", ""];
|
|
2
|
+
const buttonProps = {
|
|
3
|
+
color: {
|
|
4
|
+
type: String,
|
|
5
|
+
validator: (v) => validColors.includes(v),
|
|
6
|
+
default: ""
|
|
7
|
+
},
|
|
8
|
+
loading: { type: Boolean },
|
|
9
|
+
disabled: { type: Boolean },
|
|
10
|
+
/**
|
|
11
|
+
* Text before icon.
|
|
12
|
+
*/
|
|
13
|
+
preIcon: { type: String },
|
|
14
|
+
/**
|
|
15
|
+
* Text after icon.
|
|
16
|
+
*/
|
|
17
|
+
postIcon: { type: String },
|
|
18
|
+
/**
|
|
19
|
+
* preIcon and postIcon icon size.
|
|
20
|
+
* @default: 14
|
|
21
|
+
*/
|
|
22
|
+
iconSize: { type: Number, default: 14 },
|
|
23
|
+
onClick: {
|
|
24
|
+
type: Function,
|
|
25
|
+
default: null
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { buttonProps };
|