@elementplus-kit/uikit 1.4.0 → 1.6.0
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.css +1 -0
- package/dist/index.mjs +1079 -0
- package/dist/index.umd.js +1 -0
- package/package.json +14 -4
- package/aaaindex.ts +0 -55
- package/build.log +0 -0
- package/components/button/index.ts +0 -4
- package/components/button/src/constants.ts +0 -50
- package/components/button/src/index.ts +0 -264
- package/components/button/style/index.scss +0 -3
- package/components/config.ts +0 -4
- package/components/dialog/index.ts +0 -6
- package/components/dialog/src/constants.ts +0 -3
- package/components/dialog/src/index.ts +0 -54
- package/components/dialog/style/index.scss +0 -18
- package/components/dictLabel/index.ts +0 -4
- package/components/dictLabel/src/index.vue +0 -21
- package/components/drawer/index.ts +0 -4
- package/components/drawer/src/constants.ts +0 -3
- package/components/drawer/src/index.ts +0 -53
- package/components/drawer/style/index.scss +0 -18
- package/components/form/index.ts +0 -4
- package/components/form/src/FormItem.ts +0 -397
- package/components/form/src/constants.ts +0 -161
- package/components/form/src/index.ts +0 -207
- package/components/form/src/types.ts +0 -39
- package/components/form/src/utils.ts +0 -4
- package/components/form/style/index.scss +0 -5
- package/components/pagination/index.ts +0 -4
- package/components/pagination/src/constants.ts +0 -5
- package/components/pagination/src/index.ts +0 -50
- package/components/search/index.ts +0 -4
- package/components/search/src/index.tsx +0 -276
- package/components/search/style/index.scss +0 -101
- package/components/table/index.ts +0 -4
- package/components/table/src/TableColumn.ts +0 -116
- package/components/table/src/constants.ts +0 -42
- package/components/table/src/index.ts +0 -250
- package/components/table/src/index2.ts +0 -219
- package/components/table/src/index3.ts +0 -233
- package/components/table/src/tableDictLabel.vue +0 -21
- package/components/table/src/tableaa.ts +0 -71
- package/components/table/src/type.ts +0 -0
- package/components/table/type/index.scss +0 -0
- package/components/table2/index.ts +0 -4
- package/components/table2/src/config.ts +0 -5
- package/components/table2/src/index.ts +0 -12
- package/components/table2/src/render.ts +0 -136
- package/components/table2/src/types.ts +0 -39
- package/components/table2/style/index.scss +0 -0
- package/components//346/250/241/346/235/277/index.tsx +0 -57
- package/components//346/250/241/346/235/277/ttt.ts +0 -66
- package/components//346/250/241/346/235/277/ttt.vue +0 -18
- package/index.ts +0 -2
- package/vite.config.ts +0 -26
- package//345/205/266/344/273/226/core/dialog/elementPlus/dialogWarp.vue +0 -151
- package//345/205/266/344/273/226/core/dialog/index.ts +0 -10
- package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.ts +0 -15
- package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.vue +0 -16
- package//345/205/266/344/273/226/core/form/elementPlus/formRender.ts +0 -55
- package//345/205/266/344/273/226/core/form/index.ts +0 -10
- package//345/205/266/344/273/226/core/table/config.ts +0 -5
- package//345/205/266/344/273/226/core/table/render.ts +0 -91
- package//345/205/266/344/273/226/core/table/warp.ts +0 -11
- package//345/205/266/344/273/226/core/utils/fetch.ts +0 -58
- package//345/205/266/344/273/226/useMessage.ts +0 -95
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(C,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus"),require("lodash-es"),require("@element-plus/icons-vue")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","lodash-es","@element-plus/icons-vue"],e):(C=typeof globalThis<"u"?globalThis:C||self,e(C.ElementPlusKit={},C.vue,C.elementPlus,C._,C.iconsVue))})(this,(function(C,e,l,S,X){"use strict";const B={input:{elName:"input",defaultAttrs:{},events:["blur","focus","change","input","clear","keydown","mouseleave","mouseenter","compositionstart","compositionupdate","compositionend"],slots:["prefix","suffix","prepend","append"]},textarea:{elName:"textarea",defaultAttrs:{},events:["blur","focus","change","input"]},"input-number":{elName:"input-number",defaultAttrs:{},events:["change","Function","blur","focus"],slots:["decrease-icon","increase-icon","prefix","suffix"]},select:{elName:"select",defaultAttrs:{},events:["change","visible-change","remove-tag","clear","blur","focus","popup-scroll"],slots:["default","header","footer","prefix","empty","tag","loading","label"]},"select-v2":{elName:"select-v2",defaultAttrs:{},events:["focus","blur","selectedLabel"],slots:["default","header","footer","prefix","empty","tag","loading","label"]},cascader:{elName:"cascader",defaultAttrs:{},events:["change","expand-change","blur","focus","clear","visible-change","remove-tag"],slots:["default","empty","prefix","suggestion-item","tag"]},"tree-select":{elName:"tree-select",defaultAttrs:{},events:["change","clear","blur","focus"],slots:["default"]},radio:{elName:"radio",defaultAttrs:{},events:["change"]},checkbox:{elName:"checkbox",defaultAttrs:{},events:["change"]},"time-select":{elName:"time-select",defaultAttrs:{},events:["change","blur","focus","clear"]},"date-picker":{elName:"date-picker",defaultAttrs:{},events:["change","blur","focus","clear","calendar-change","panel-change","visible-change"],slots:["default","range-separator","prev-month","next-month","prev-year","next-year"]},"time-picker":{elName:"time-picker",defaultAttrs:{},events:["change","blur","focus","clear","visible-change"],slots:[]},rate:{elName:"rate",defaultAttrs:{},events:["change"]},"color-picker":{elName:"color-picker",defaultAttrs:{},events:["change","active-change","focus","blur"]},slider:{elName:"slider",defaultAttrs:{},events:["change","input"]},switch:{elName:"switch",defaultAttrs:{},events:["change"],slots:["active-action","inactive-action"]},text:{elName:"text",defaultAttrs:{},slots:["default"]},html:{},slot:{}},Z=()=>{let t=[];return Object.keys(B).map(r=>{const p=B[r]?.events;p?.length>0&&t.push(...p)}),t=[...new Set(t)],t},P=t=>t.replace(/(?:^|-)(\w)/g,(r,p)=>p.toUpperCase()),ee={model:{type:Object,default:()=>{}},label:{type:String,default:""},type:{type:String,default:""},prop:{type:String,default:""},required:{type:Boolean,default:!1},allReadonly:{type:Object,default:null},formItem:{type:Object,default:()=>{}},attrs:{type:Object,default:()=>{}},dictType:{type:String,default:void 0},options:{type:Array,default:()=>[]},optionsRef:{type:Object,default:()=>{}},mergeParams:{type:Object,default:()=>{}}},te=e.defineComponent({props:ee,setup(t,{attrs:r,emit:p,slots:i,expose:m}){const{formSlots:u,events:N}=e.inject("formContext"),{model:v,type:O,label:A,prop:d,required:n,allReadonly:h,formItem:a,attrs:f,dictType:T,options:w}=e.toRefs(t),E=()=>{const b={};return B[O.value]?.slots?.forEach(y=>{const V=`${d.value}.${y}`;Object.keys(u).map(x=>{x===V&&(b[y]=u[x])})}),b},s=()=>{const b={};return B[O.value]?.events?.forEach(y=>{const V=`on${P(y)}`;b[V]=(...x)=>N(y,d.value,...x)}),b},g=()=>{let b=!1;return S.isFunction(f.value?.disabled)&&(b=f.value.disabled(t.mergeParams)),S.isBoolean(f.value?.disabled)&&(b=f.value.disabled),h.value&&(b=!0),{disabled:b}},o=()=>{const b=B[O.value]?.defaultAttrs||{},c={ref:y=>L(y,d.value),...b,...f.value,...g()};return["html"].includes(O.value)||(c.modelValue=v.value[d.value],c["onUpdate:modelValue"]=y=>v.value[d.value]=y),c},L=(b,c)=>{t.optionsRef[`${c}Ref`]=b},R={input:()=>e.h(l.ElInput,{clearable:!0,...o(),...s()},{...E()}),textarea:()=>e.h(l.ElInput,{...o(),...s(),type:"textarea"}),"input-number":()=>e.h(l.ElInputNumber,{...o(),...s()},{...E()}),select:()=>e.h(l.ElSelect,{clearable:!0,...o(),...s()},()=>w?.value?.map(b=>e.h(l.ElOption,{...b,label:b.label,value:b.value,key:b.value}))),"select-v2":()=>e.h(l.ElSelectV2,{options:w.value,clearable:!0,...o(),...s()}),cascader:()=>e.h(l.ElCascader,{options:w.value,clearable:!0,...o(),...s()},{...E()}),"tree-select":()=>e.h(l.ElTreeSelect,{data:w.value,clearable:!0,...o(),...s()},{...E()}),radio:()=>e.h(l.ElRadioGroup,{...o(),...s()},{default:()=>w?.value?.map(c=>e.h(c.radioButton?l.ElRadioButton:l.ElRadio,{...c,label:c.label,value:c.value,key:c.value}))}),checkbox:()=>e.h(l.ElCheckboxGroup,{...o(),...s()},{default:()=>w?.value?.map(c=>e.h(l.ElCheckbox,{...c,label:c.label,value:c.value,key:c.value}))}),"time-select":()=>e.h(l.ElTimeSelect,{...o(),...s()}),"date-picker":()=>{const b=f.value?.type||"date",y={year:"YYYY",month:"YYYY-MM",date:"YYYY-MM-DD"}[b];return e.h(l.ElDatePicker,{type:b,valueFormat:y,...o(),...s()},{...E()})},"time-picker":()=>e.h(l.ElTimePicker,{valueFormat:"HH:mm:ss",...o(),...s()}),rate:()=>e.h(l.ElRate,{...o(),...s()}),"color-picker":()=>e.h(l.ElColorPicker,{...o(),...s()}),slider:()=>e.h(l.ElSlider,{...o(),...s()}),switch:()=>e.h(l.ElSwitch,{...o(),...s()},{...E()}),text:()=>e.h(l.ElText,{...o()}),html:()=>e.h("div",{innerHTML:v.value[d.value],...o()}),slot:()=>u[d.value]?.(v.value)},k=()=>u[d.value]?R.slot():O.value==="slot"?`表单属性 ${d.value} 插槽模板未定义`:R[O.value]?R[O.value]():(console.error(`不支持的表单类型 ${O.value}`),`不支持的表单类型 ${O.value}`),I=()=>{const b=k();return e.h(l.ElFormItem,{label:A.value,prop:d.value,rules:n.value?[{required:!0,message:`${A.value} 必填`,trigger:"blur"}]:void 0,...a.value},{default:()=>b})};return()=>I()}}),re={model:{type:Object,default:()=>({})},formOptions:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1},gutter:{type:Number||String,default:void 0},col:{type:Number,default:void 0},params:{type:Object,default:()=>({})}},Y=e.defineComponent({props:re,emits:[...Z()],setup(t,{attrs:r,emit:p,slots:i,expose:m}){e.provide("formContext",{formSlots:i,events:(g,...o)=>{p(g,...o)}});const u=e.ref({});m({optionsRef:u});const{model:N,formOptions:v,readonly:O,gutter:A,col:d}=e.toRefs(t),n=e.getCurrentInstance(),h=g=>{g&&(n.exposed=g,n.exposeProxy=g)},a=e.computed(()=>O.value),f=e.computed(()=>["",0].includes(A?.value)||d?.value||v?.value.some(g=>S.has(g,"col"))),T=()=>{const g=E();return f.value?e.h(l.ElRow,{class:"c-row",gutter:A.value||20,...r},{default:()=>g}):g},w=e.computed(()=>({formData:N.value,params:t.params})),E=()=>{const g=[];return v.value.map(o=>{S.isFunction(o?.vIf)&&o.vIf(w.value)!==void 0?o.vIf(w.value)&&g.push(o):g.push(o)}),g.map(o=>{const L=()=>e.h(te,{class:"c-form-itme",model:N.value,allReadonly:a,mergeParams:w.value,...o,optionsRef:u.value});if(f.value){let R,k=`col.${o.prop}`;return o?.colSlot?S.has(i,k)?R=i[k]:R=()=>"col插槽模板未定义":S.has(i,k)&&(R=i[k]),e.h(l.ElCol,{class:"c-col",span:S.has(o,"col")?o.col:d?.value?d?.value:f.value?8:void 0},{default:()=>R?R():L()})}else return L()})},s=()=>e.h(l.ElForm,{ref:h,...r,model:N.value,class:a.value?"isReadonly c-form":"c-form"},{default:()=>T()});return()=>s()}}),ae=e.defineComponent({__name:"tableDictLabel",props:{options:{type:Array,default:()=>[]},value:{type:String,default:""}},setup(t){const r=t,p=e.computed(()=>r.options?.find(m=>m.value==r.value.toString())?.label||r.value);return(i,m)=>e.toDisplayString(p.value)}}),oe=["default","append","empty"],le=["default","header","filter-icon","expand"],ne={module:{type:Object,default:()=>{}},params:{type:Object,default:()=>{}},columns:{type:Array,default:()=>[]},showSelection:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},M=e.defineComponent({props:ne,setup(t,{attrs:r,emit:p,slots:i,expose:m}){const u=e.getCurrentInstance(),N=d=>{d&&(u.exposed=d,u.exposeProxy=d)},v=()=>{const d=[];t.showSelection&&d.push(e.h(l.ElTableColumn,{type:"selection",width:50,align:"center"})),t.showIndex&&d.push(e.h(l.ElTableColumn,{label:"序号",type:"index",width:60,align:"center"}));const n=(h,a)=>{h.map(f=>{const{children:T,...w}=f;if(S.isFunction(f.vIf)&&f.vIf(t.params)!==void 0&&!f.vIf(t.params))return;const E=[];T?.length&&n(T,E);const s={};if(le.map(g=>{const o=`${f.prop}.${g}`;i[o]&&(s[g]=i[o])}),i[f.prop]?s.default=i[f.prop]:S.isFunction(f.render)?s.default=f.render:S.isArray(f.options)&&(s.default=g=>e.h(ae,{options:f.options,value:g.row[f.prop]})),Object.keys(s).length){const g=()=>{let o;return E.length?o={...s,default:()=>E}:o={...s},o};a.push(e.h(l.ElTableColumn,{...w,class:"c-table-column"},g()))}else{const g=()=>{let o;return E.length&&(o={default:()=>E}),o};a.push(e.h(l.ElTableColumn,{...w,class:"c-table-column"},g()))}})};return n(t.columns,d),d},O=()=>{const d={};return oe.map(n=>{i[n]&&(d[n]=i[n])}),d},A=()=>{const d=v();return e.h(l.ElTable,{ref:N,...r,class:"c-table"},{default:()=>d,...O()})};return()=>A()}}),j={OPERATION_COL_LABEL:"操作",OPERATION_SLOT_NAME:"custom",CHILDREN_SLOT_KEY:"children"};function se(t,r,p,i){const m={default:()=>ce(t,i)};return e.h(l.ElTable,{data:r,class:"c-table"},m)}function ce(t,r){const p=[];if(S.isObject(t)&&Object.keys(t).forEach(m=>{let u=t[m],N=r[m];if(r[`${m}.header`]){let v=W(m,u),O={header:A=>r[`${m}.header`](A)};r[m]&&(O.default=A=>[r[m](A)]),p.push(e.h(l.ElTableColumn,v,O))}else p.push(z(m,u,N,r))}),r[j.OPERATION_SLOT_NAME]){let i={label:j.OPERATION_COL_LABEL};if(r[`${j.OPERATION_SLOT_NAME}.header`]){let m={header:u=>r[`${j.OPERATION_SLOT_NAME}.header`](u),default:u=>[r[j.OPERATION_SLOT_NAME](u)]};p.push(e.h(l.ElTableColumn,i,m))}else{let m={default:u=>[r[j.OPERATION_SLOT_NAME](u)]};p.push(e.h(l.ElTableColumn,i,m))}}return p}function z(t,r,p,i){let m=W(t,r);delete m[j.CHILDREN_SLOT_KEY];let u=[];if(r[j.CHILDREN_SLOT_KEY]&&S.isObject(r[j.CHILDREN_SLOT_KEY])){let v=r[j.CHILDREN_SLOT_KEY];S.isObject(v)&&Object.keys(v).forEach(A=>{let d=v[A],n=i[A];u.push(z(A,d,n,i))})}let N=()=>[];return p?N={default:v=>[...u,p(v)]}:N={default:()=>[...u]},e.h(l.ElTableColumn,m,N)}function W(t,r){if(S.isString(r))return{prop:t,label:r};if(S.isObject(r))return{prop:t,...r}}const H=e.defineComponent({props:["schema","data"],emits:[],setup(t,{attrs:r,emit:p,slots:i,expose:m}){return()=>se(t.schema,t.data,p,i)}}),ie={pageSizes:[10,20,50,100,200,500],layout:"total, sizes, prev, pager, next, jumper"},q=e.defineComponent({setup(t,{attrs:r,emit:p,slots:i,expose:m}){const u=()=>({...ie}),N=()=>e.h(l.ElPagination,{...u(),class:"c-pagination"});return()=>N()}}),ue={destroyOnClose:!0},de=S.capitalize("C"),U=e.defineComponent({name:`${de}Dialog`,setup(t,{attrs:r,emit:p,slots:i,expose:m}){const u=()=>({...ue}),N=()=>e.h(l.ElDialog,{...u(),class:"c-dialog"},i);return()=>N()}}),fe={destroyOnClose:!0},G=e.defineComponent({setup(t,{attrs:r,emit:p,slots:i,expose:m}){const u=()=>({...fe}),N=()=>e.h(l.ElDrawer,{...u(),class:"c-drawer"},i);return()=>N()}});function _(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}const K=e.defineComponent({props:{modelValue:{type:Object,default:{}},formOptions:{type:Array,default:()=>[]},isDrawer:{type:Boolean,default:!1}},emits:["update:modelValue","search","reset","close"],setup(t,{emit:r,slots:p,attrs:i,expose:m}){const u=["btn-left","btn-right"],N=()=>{let c={};return Object.keys(i)?.forEach(y=>{y.indexOf("on")===0&&(c[y]=i[y])}),c},v=()=>{let c={};return Object.keys(p).forEach(y=>{u.includes(y)||(c[y]=p[y])}),c},O=()=>{r("search"),a.value=!1,document.removeEventListener("click",h)},A=()=>{r("reset")},d=()=>{a.value=!1,document.removeEventListener("click",h),r("close")},n=e.ref(null),h=c=>{a.value&&n.value&&!n.value?.$el?.contains(c.target)&&(a.value=!1,document.removeEventListener("click",h))},a=e.ref(!1),f=()=>{a.value?(a.value=!1,document.removeEventListener("click",h)):(a.value=!0,setTimeout(()=>{document.addEventListener("click",h)},0))},T=e.ref(6),w=e.ref(null),E=e.ref(null),s=e.ref(null),g=e.ref(null),o=e.ref(null);let L=null;const R=()=>{L&&clearTimeout(L),L=setTimeout(()=>{k()},200)},k=()=>{if(s.value){const c=s.value.children[0],y=E.value.offsetWidth;let V=0;T.value=c?.children?.length,Array.from(c.children).map((x,D)=>{if(x.style.display="inline-flex",V>y){x.style.display="none";return}const ve=window.getComputedStyle(x).marginRight,Ee=parseFloat(ve),Ce=x.offsetWidth+Ee;V=V+Ce,V>y&&(x.style.display="none",T.value=D,V=1e5)})}},I=e.ref(0),b=()=>{const c=E.value.children[0];new ResizeObserver(V=>{for(const D of V){const F=D.contentRect.width;F!==I.value&&(I.value===0||F<I.value-25?(I.value=F,R()):F>I.value+25&&(R(),I.value=F))}}).observe(c)};return e.onMounted(()=>{b(),window.addEventListener("resize",R)}),e.onUnmounted(()=>{window.removeEventListener("resize",R),document.removeEventListener("click",h)}),()=>{let c,y,V;return e.createVNode("div",{className:"c-search"},[e.createVNode("div",{className:"c-search-simple",ref:w},[e.createVNode("div",{className:"c-search-simple-form",ref:E},[e.createVNode("div",{className:"c-simple-form-container",ref:s},[e.createVNode($,e.mergeProps({ref:x=>o.value=x},N(),{inline:!0,model:t.modelValue,formOptions:t.formOptions}),_(c=v())?c:{default:()=>[c]})])]),e.createVNode("div",{className:"c-search-simple-btn",ref:g},[p["arrow-left"]?.(),T.value<t.formOptions?.length&&e.createVNode("div",{className:`c-search-simple-icon ${a.value?"icon-rotate":""}`,onClick:f},[e.createVNode(e.resolveComponent("el-icon"),{className:"el-icon c-search-icon"},{default:()=>[e.createVNode(X.ArrowUpBold,null,null)]})]),p["search-btn"]?p["search-btn"]():e.createVNode(e.Fragment,null,[p["btn-left"]?.(),e.createVNode(e.resolveComponent("el-button"),{type:"primary",onClick:O},{default:()=>[e.createTextVNode("搜索")]}),e.createVNode(e.resolveComponent("el-button"),{type:"primary",onClick:A},{default:()=>[e.createTextVNode("重置")]}),p["btn-right"]?.()])])]),!t.isDrawer&&a.value&&e.createVNode(e.resolveComponent("transition"),{name:"search-form-transition"},{default:()=>[e.createVNode(e.resolveComponent("el-card"),{ref:n,className:"c-search-form el-card is-always-shadow"},{default:()=>[e.createVNode($,e.mergeProps(N(),{inline:!0,model:t.modelValue,formOptions:t.formOptions.filter((x,D)=>D>=T.value),ref:"formRef"}),_(y=v())?y:{default:()=>[y]}),e.createVNode("div",{style:"text-align: right;"},[e.createVNode(e.resolveComponent("el-button"),{type:"primary",onClick:O},{default:()=>[e.createTextVNode("搜索")]}),e.createVNode(e.resolveComponent("el-button"),{type:"primary",onClick:d},{default:()=>[e.createTextVNode("关闭")]})])]})]}),t.isDrawer&&e.createVNode(Q,{title:"搜索",modelValue:a.value,"onUpdate:modelValue":x=>a.value=x,size:"660px"},{default:()=>[e.createVNode($,e.mergeProps(N(),{col:12,model:t.modelValue,formOptions:t.formOptions.filter((x,D)=>D>=T.value),ref:"formRef"}),_(V=v())?V:{default:()=>[V]}),e.createVNode("div",{style:"text-align: right;"},[e.createVNode(e.resolveComponent("el-button"),{type:"primary",onClick:O},{default:()=>[e.createTextVNode("搜索")]}),e.createVNode(e.resolveComponent("el-button"),{type:"primary",onClick:d},{default:()=>[e.createTextVNode("关闭")]})])]})])}}}),J=e.defineComponent({props:{params:{type:Object,default:()=>({})},btnOptions:{type:Array,default:()=>[]},permit:{type:Function},size:{type:String,default:void 0},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:{type:Boolean,default:void 0},fold:{type:Boolean,default:!1},foldNum:{type:Number,default:0}},emits:["btnAction"],setup(t,{emit:r,slots:p,attrs:i,expose:m}){const u=n=>{let h={size:t.size,plain:t.plain,text:t.text,link:t.link,class:`c-btn-alias-${n.alias||""}`};const a=["label","alias","permit","vIf","disable"];return Object.keys(n).map(f=>{a.includes(f)||(h[f]=n[f])}),S.isBoolean(n.disable)&&(h.disabled=n.disable),S.isFunction(n.disable)&&n.disable(t.params)!==void 0&&(h.disabled=n.disable(t.params)),h},N=n=>{const h=u(n),a={splitButton:!0};return["type","size","splitButton","disabled","placement","effect","trigger"].forEach(T=>{h[T]!==void 0&&(a[T]=h[T])}),a},v=()=>{const n=[];t.btnOptions.map(a=>{S.isArray(a.permit)&&a.permit.length>0&&S.isFunction(t.permit)?t.permit(a.permit)&&n.push(a):n.push(a)});const h=[];return n.map(a=>{S.has(a,"vIf")&&S.isFunction(a.vIf)&&a.vIf(t.params)!==void 0?a.vIf(t.params)&&h.push(a):h.push(a)}),h},O=n=>e.h(l.ElButton,{...u(n),onClick:()=>{r("btnAction",n.alias,t.params)}},{default:()=>n?.label}),A=n=>{const h=[],a=[],f=[];n.map((E,s)=>{s<t.foldNum?h.push(E):s===t.foldNum?a.push(E):f.push(E)}),a.length>0&&f.length===0&&h.push(a[0]);let T=[];const w=h.map(E=>O(E));if(w.length>0&&(T=T.concat(w)),a.length>0&&f.length>0){const E=e.h(l.ElDropdown,{...N(a[0]),class:"c-btn-dropdown",buttonProps:u(a[0]),splitButton:!0,onClick:()=>{r("btnAction",a[0].alias,t.params)},onCommand:s=>{r("btnAction",s,t.params)}},{default:()=>a[0].label,dropdown:()=>f.map(s=>e.h(l.ElDropdownItem,{command:s.alias},{default:()=>s?.label}))});T=T.concat(E)}return T},d=()=>{const n=v();return t.fold?A(n):n.map(h=>O(h))};return()=>d()}}),$=Y,pe=M,me=H,he=q,be=U,Q=G,ge=K,ye=J;C.Button=J,C.CButton=ye,C.CDialog=be,C.CDrawer=Q,C.CForm=$,C.CPagination=he,C.CSearch=ge,C.CTable=pe,C.CTable2=me,C.Dialog=U,C.Drawer=G,C.Form=Y,C.Pagination=q,C.Search=K,C.Table=M,C.Table2=H,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementplus-kit/uikit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./components/index.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist/"
|
|
8
|
+
],
|
|
6
9
|
"peerDependencies": {
|
|
7
|
-
"element-plus": "
|
|
8
|
-
"
|
|
10
|
+
"@element-plus/icons-vue": "*",
|
|
11
|
+
"element-plus": "*",
|
|
12
|
+
"lodash-es": "*",
|
|
13
|
+
"vue": "*"
|
|
9
14
|
},
|
|
10
15
|
"keywords": [],
|
|
11
16
|
"author": "",
|
|
12
17
|
"license": "ISC",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
20
|
+
"@vitejs/plugin-vue-jsx": "^5.0.1",
|
|
21
|
+
"vite": "^7.1.3"
|
|
22
|
+
},
|
|
13
23
|
"scripts": {
|
|
14
|
-
"build": "build",
|
|
24
|
+
"build": "vite build",
|
|
15
25
|
"pub": "npx standard-version && npm publish"
|
|
16
26
|
}
|
|
17
27
|
}
|
package/aaaindex.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// // 引入封装好的组件
|
|
2
|
-
// // import kButton from "./k-button/index.vue";
|
|
3
|
-
// // 将来如果有其它组件,都可以写到这个数组里
|
|
4
|
-
// // const coms = [kButton];
|
|
5
|
-
|
|
6
|
-
// // 批量组件注册
|
|
7
|
-
// const install = function (Vue, options) {
|
|
8
|
-
// console.log("🚀 ~ install ~ Vue:", Vue);
|
|
9
|
-
// console.log("插件安装了 ", options);
|
|
10
|
-
|
|
11
|
-
// coms.forEach((com) => {
|
|
12
|
-
// console.log("🚀 ~ install ~ com:", com);
|
|
13
|
-
// Vue.component("k-button", com);
|
|
14
|
-
// });
|
|
15
|
-
// };
|
|
16
|
-
|
|
17
|
-
// import { capitalize } from "lodash-es";
|
|
18
|
-
|
|
19
|
-
// // import { prefix as basePrefix } from "./config.ts";
|
|
20
|
-
// // 将来如果有其它组件,都可以写到这个数组里
|
|
21
|
-
// // const coms = [CForm, CTable, CTable2, CPagination, CDialog, CDrawer, CSearch];
|
|
22
|
-
|
|
23
|
-
// // 批量组件注册
|
|
24
|
-
// const install = function (app, options = {}) {
|
|
25
|
-
// // 获取自定义前缀,默认使用组件原名称
|
|
26
|
-
// // let { prefix = "" } = options;
|
|
27
|
-
// // prefix = capitalize(prefix) || basePrefix;
|
|
28
|
-
// // // 循环注册
|
|
29
|
-
// // coms.forEach((item) => {
|
|
30
|
-
// // // 组件可能直接是组件对象,或者有com属性
|
|
31
|
-
// // const component = item.com || item;
|
|
32
|
-
// // const componentName = component.name || item.name;
|
|
33
|
-
// // if (componentName) {
|
|
34
|
-
// // // 生成注册名称:前缀 + 组件名
|
|
35
|
-
// // const registerName = prefix
|
|
36
|
-
// // ? `${prefix}${componentName.replace(/^[A-Z]/, (char) =>
|
|
37
|
-
// // char.toLowerCase()
|
|
38
|
-
// // )}`
|
|
39
|
-
// // : componentName;
|
|
40
|
-
// // // 注册组件
|
|
41
|
-
// // app.component(registerName, component);
|
|
42
|
-
// // }
|
|
43
|
-
// // });
|
|
44
|
-
// };
|
|
45
|
-
|
|
46
|
-
// // 创建插件对象,包含install方法
|
|
47
|
-
// const plugin = {
|
|
48
|
-
// install,
|
|
49
|
-
// };
|
|
50
|
-
|
|
51
|
-
// // 导出插件
|
|
52
|
-
// // export default plugin; // 这个方法以后再使用的时候可以被use调用
|
|
53
|
-
// // 为什么导出为install? 安装 Vue.js 插件。如果插件是一个对象,必须提供 install 方法。
|
|
54
|
-
// // 如果插件是一个函数,它会被作为install 方法。install 方法调用时,会将 Vue 作为参数传入。
|
|
55
|
-
// export default install; // 这个方法以后再使用的时候可以被use调用
|
package/build.log
DELETED
|
Binary file
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export const typeActiveMap = {
|
|
2
|
-
reset: {
|
|
3
|
-
name: "重置",
|
|
4
|
-
type: "info",
|
|
5
|
-
},
|
|
6
|
-
search: {
|
|
7
|
-
name: "查询",
|
|
8
|
-
type: "primary",
|
|
9
|
-
},
|
|
10
|
-
submit: {
|
|
11
|
-
name: "提交",
|
|
12
|
-
type: "primary",
|
|
13
|
-
},
|
|
14
|
-
save: {
|
|
15
|
-
name: "保存",
|
|
16
|
-
type: "primary",
|
|
17
|
-
},
|
|
18
|
-
create: {
|
|
19
|
-
name: "新增",
|
|
20
|
-
type: "primary",
|
|
21
|
-
},
|
|
22
|
-
delete: {
|
|
23
|
-
name: "删除",
|
|
24
|
-
type: "danger",
|
|
25
|
-
},
|
|
26
|
-
edit: {
|
|
27
|
-
name: "编辑",
|
|
28
|
-
type: "primary",
|
|
29
|
-
},
|
|
30
|
-
view: {
|
|
31
|
-
name: "查看",
|
|
32
|
-
type: "primary",
|
|
33
|
-
},
|
|
34
|
-
publish: {
|
|
35
|
-
name: "发布",
|
|
36
|
-
type: "primary",
|
|
37
|
-
},
|
|
38
|
-
import: {
|
|
39
|
-
name: "导入",
|
|
40
|
-
type: "primary",
|
|
41
|
-
},
|
|
42
|
-
export: {
|
|
43
|
-
name: "导出",
|
|
44
|
-
type: "primary",
|
|
45
|
-
},
|
|
46
|
-
exportAll: {
|
|
47
|
-
name: "导出全部",
|
|
48
|
-
type: "primary",
|
|
49
|
-
},
|
|
50
|
-
};
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { defineComponent, h, PropType } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
ElButton,
|
|
4
|
-
ElDropdown,
|
|
5
|
-
ElDropdownMenu,
|
|
6
|
-
ElDropdownItem,
|
|
7
|
-
buttonProps,
|
|
8
|
-
} from "element-plus";
|
|
9
|
-
|
|
10
|
-
import "../style/index.scss";
|
|
11
|
-
import { typeActiveMap } from "./constants.ts";
|
|
12
|
-
import { has, isBoolean, isFunction, isArray } from "lodash-es";
|
|
13
|
-
import { tr } from "element-plus/es/locales.mjs";
|
|
14
|
-
export default defineComponent({
|
|
15
|
-
props: {
|
|
16
|
-
params: {
|
|
17
|
-
// 用于验证自定义函数的外部数据
|
|
18
|
-
type: Object,
|
|
19
|
-
default: () => ({}),
|
|
20
|
-
},
|
|
21
|
-
btnOptions: {
|
|
22
|
-
type: Array,
|
|
23
|
-
default: () => [],
|
|
24
|
-
},
|
|
25
|
-
// 权限验证函数
|
|
26
|
-
permit: {
|
|
27
|
-
type: Function,
|
|
28
|
-
},
|
|
29
|
-
size: {
|
|
30
|
-
type: String as PropType<"large" | "default" | "small">,
|
|
31
|
-
default: undefined,
|
|
32
|
-
},
|
|
33
|
-
plain: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: undefined,
|
|
36
|
-
},
|
|
37
|
-
text: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: undefined,
|
|
40
|
-
},
|
|
41
|
-
link: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
default: undefined,
|
|
44
|
-
},
|
|
45
|
-
// 折叠
|
|
46
|
-
fold: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: false,
|
|
49
|
-
},
|
|
50
|
-
// 折叠数量
|
|
51
|
-
foldNum: {
|
|
52
|
-
type: Number,
|
|
53
|
-
default: 0,
|
|
54
|
-
},
|
|
55
|
-
// // 权限函数
|
|
56
|
-
// hasRole: {
|
|
57
|
-
// type: Function,
|
|
58
|
-
// default: () => true
|
|
59
|
-
// },
|
|
60
|
-
},
|
|
61
|
-
emits: ["btnAction"],
|
|
62
|
-
setup(props, { emit, slots, attrs, expose }) {
|
|
63
|
-
// console.log('slots', slots);
|
|
64
|
-
// console.log('attrs', attrs);
|
|
65
|
-
|
|
66
|
-
// 解析按钮属性
|
|
67
|
-
const getAttrs = (item) => {
|
|
68
|
-
let defaultAttrs = {
|
|
69
|
-
size: props.size,
|
|
70
|
-
plain: props.plain,
|
|
71
|
-
text: props.text,
|
|
72
|
-
link: props.link,
|
|
73
|
-
class: `c-btn-alias-${item.alias || ""}`,
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// 默认按钮类型 用样式控制?
|
|
77
|
-
// if (item?.alias && typeActiveMap[item.alias]) {
|
|
78
|
-
// defaultAttrs = {
|
|
79
|
-
// ...typeActiveMap[item.alias],
|
|
80
|
-
// ...defaultAttrs,
|
|
81
|
-
// };
|
|
82
|
-
// }
|
|
83
|
-
|
|
84
|
-
// 过滤掉非elbutton属性
|
|
85
|
-
const filterAttrsList = ["label", "alias", "permit", "vIf", "disable"];
|
|
86
|
-
|
|
87
|
-
Object.keys(item).map((key) => {
|
|
88
|
-
if (!filterAttrsList.includes(key)) {
|
|
89
|
-
defaultAttrs[key] = item[key];
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// 处理禁用
|
|
94
|
-
if (isBoolean(item.disable)) {
|
|
95
|
-
defaultAttrs.disabled = item.disable;
|
|
96
|
-
}
|
|
97
|
-
if (
|
|
98
|
-
isFunction(item.disable) &&
|
|
99
|
-
item.disable(props.params) !== undefined
|
|
100
|
-
) {
|
|
101
|
-
defaultAttrs.disabled = item.disable(props.params);
|
|
102
|
-
}
|
|
103
|
-
return defaultAttrs;
|
|
104
|
-
};
|
|
105
|
-
// 解析下拉菜单属性
|
|
106
|
-
const getDropdownAttrs = (item) => {
|
|
107
|
-
const obj = getAttrs(item);
|
|
108
|
-
const defaultAttrs = {
|
|
109
|
-
splitButton: true,
|
|
110
|
-
};
|
|
111
|
-
// 过滤下拉菜单属性
|
|
112
|
-
const l = [
|
|
113
|
-
"type",
|
|
114
|
-
"size",
|
|
115
|
-
"splitButton",
|
|
116
|
-
"disabled",
|
|
117
|
-
"placement",
|
|
118
|
-
"effect",
|
|
119
|
-
"trigger",
|
|
120
|
-
];
|
|
121
|
-
l.forEach((key) => {
|
|
122
|
-
if (obj[key] !== undefined) {
|
|
123
|
-
defaultAttrs[key] = obj[key];
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
return defaultAttrs;
|
|
127
|
-
};
|
|
128
|
-
// 过滤权限与 vIf
|
|
129
|
-
const filterOptions = () => {
|
|
130
|
-
const list = [];
|
|
131
|
-
// 过滤权限
|
|
132
|
-
props.btnOptions.map((item) => {
|
|
133
|
-
if (
|
|
134
|
-
isArray(item.permit) &&
|
|
135
|
-
item.permit.length > 0 &&
|
|
136
|
-
isFunction(props.permit)
|
|
137
|
-
) {
|
|
138
|
-
if (props.permit(item.permit)) {
|
|
139
|
-
list.push(item);
|
|
140
|
-
}
|
|
141
|
-
} else {
|
|
142
|
-
list.push(item);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
const list2 = [];
|
|
146
|
-
// 过滤 vIf
|
|
147
|
-
list.map((item) => {
|
|
148
|
-
if (
|
|
149
|
-
has(item, "vIf") &&
|
|
150
|
-
isFunction(item.vIf) &&
|
|
151
|
-
item.vIf(props.params) !== undefined
|
|
152
|
-
) {
|
|
153
|
-
if (item.vIf(props.params)) {
|
|
154
|
-
list2.push(item);
|
|
155
|
-
}
|
|
156
|
-
} else {
|
|
157
|
-
list2.push(item);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
return list2;
|
|
161
|
-
};
|
|
162
|
-
// 按钮单个生成函数
|
|
163
|
-
const createBtn = (item) => {
|
|
164
|
-
return h(
|
|
165
|
-
ElButton,
|
|
166
|
-
{
|
|
167
|
-
...getAttrs(item),
|
|
168
|
-
onClick: () => {
|
|
169
|
-
emit("btnAction", item.alias, props.params);
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
default: () => item?.label,
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
};
|
|
177
|
-
// 下拉菜单生成函数
|
|
178
|
-
const createDropdown = (finalList) => {
|
|
179
|
-
const dropdownList = []; // 不折叠的按钮
|
|
180
|
-
const dropdownMain = []; // 下拉占位
|
|
181
|
-
const dropdownItemList = []; // 折叠的按钮
|
|
182
|
-
|
|
183
|
-
finalList.map((itm, idx) => {
|
|
184
|
-
if (idx < props.foldNum) {
|
|
185
|
-
dropdownList.push(itm);
|
|
186
|
-
} else if (idx === props.foldNum) {
|
|
187
|
-
dropdownMain.push(itm);
|
|
188
|
-
} else {
|
|
189
|
-
dropdownItemList.push(itm);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
// 处理只有一个下拉按钮的情况
|
|
193
|
-
if (dropdownMain.length > 0 && dropdownItemList.length === 0) {
|
|
194
|
-
dropdownList.push(dropdownMain[0]);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// 最终渲染的vdom
|
|
198
|
-
let renderVdom = [];
|
|
199
|
-
// 展示按钮vdom
|
|
200
|
-
const butsVdom = dropdownList.map((item) => {
|
|
201
|
-
return createBtn(item);
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
// 合并参数
|
|
205
|
-
if (butsVdom.length > 0) {
|
|
206
|
-
renderVdom = renderVdom.concat(butsVdom);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (dropdownMain.length > 0 && dropdownItemList.length > 0) {
|
|
210
|
-
// 下拉菜单vdom
|
|
211
|
-
const dropdownVdom = h(
|
|
212
|
-
ElDropdown,
|
|
213
|
-
{
|
|
214
|
-
...getDropdownAttrs(dropdownMain[0]),
|
|
215
|
-
class: "c-btn-dropdown",
|
|
216
|
-
buttonProps: getAttrs(dropdownMain[0]),
|
|
217
|
-
splitButton: true,
|
|
218
|
-
// splitButton: dropdownItemList.length > 0,
|
|
219
|
-
onClick: () => {
|
|
220
|
-
emit("btnAction", dropdownMain[0].alias, props.params);
|
|
221
|
-
},
|
|
222
|
-
onCommand: (command: string) => {
|
|
223
|
-
emit("btnAction", command, props.params);
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
default: () => {
|
|
228
|
-
return dropdownMain[0].label;
|
|
229
|
-
},
|
|
230
|
-
dropdown: () => {
|
|
231
|
-
return dropdownItemList.map((item) => {
|
|
232
|
-
return h(
|
|
233
|
-
ElDropdownItem,
|
|
234
|
-
{
|
|
235
|
-
command: item.alias,
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
default: () => item?.label,
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
});
|
|
242
|
-
},
|
|
243
|
-
}
|
|
244
|
-
);
|
|
245
|
-
renderVdom = renderVdom.concat(dropdownVdom);
|
|
246
|
-
}
|
|
247
|
-
return renderVdom;
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
const render = () => {
|
|
251
|
-
const finalList = filterOptions(); // 最终列表
|
|
252
|
-
// 是否折叠 折叠
|
|
253
|
-
if (props.fold) {
|
|
254
|
-
return createDropdown(finalList);
|
|
255
|
-
} else {
|
|
256
|
-
// 不折叠
|
|
257
|
-
return finalList.map((item) => {
|
|
258
|
-
return createBtn(item);
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
return () => render();
|
|
263
|
-
},
|
|
264
|
-
});
|
package/components/config.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineComponent,
|
|
3
|
-
ref,
|
|
4
|
-
h,
|
|
5
|
-
computed,
|
|
6
|
-
toRefs,
|
|
7
|
-
type ExtractPropTypes,
|
|
8
|
-
} from "vue";
|
|
9
|
-
import { ElDialog } from "element-plus";
|
|
10
|
-
import { defaultAttrs } from "./constants.ts";
|
|
11
|
-
import { prefix } from "../../config.ts";
|
|
12
|
-
const propsAttrs = {};
|
|
13
|
-
|
|
14
|
-
export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
|
|
15
|
-
|
|
16
|
-
export default defineComponent({
|
|
17
|
-
name: `${prefix}Dialog`,
|
|
18
|
-
// props: propsAttrs,
|
|
19
|
-
// emits: eventList,
|
|
20
|
-
|
|
21
|
-
// attrs, emit会继承, slots需要设置
|
|
22
|
-
setup(props: PropsAttrs, { attrs, emit, slots, expose }) {
|
|
23
|
-
// const dialogRef = ref();
|
|
24
|
-
|
|
25
|
-
// 暴露方法
|
|
26
|
-
// expose({
|
|
27
|
-
// dialogRef,
|
|
28
|
-
// });
|
|
29
|
-
|
|
30
|
-
// 属性处理
|
|
31
|
-
const getAttrs = () => {
|
|
32
|
-
const obj = {
|
|
33
|
-
...defaultAttrs, // 设置默认值
|
|
34
|
-
};
|
|
35
|
-
return obj;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// 渲染组件
|
|
39
|
-
const render = () => {
|
|
40
|
-
return h(
|
|
41
|
-
ElDialog,
|
|
42
|
-
{
|
|
43
|
-
// ref: dialogRef,
|
|
44
|
-
...getAttrs(),
|
|
45
|
-
class: "c-dialog",
|
|
46
|
-
},
|
|
47
|
-
slots
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// 返回渲染函数
|
|
52
|
-
return () => render();
|
|
53
|
-
},
|
|
54
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* Bounce Animation */
|
|
2
|
-
.dialog-bounce-enter-active,
|
|
3
|
-
.dialog-bounce-leave-active,
|
|
4
|
-
.dialog-bounce-enter-active .el-dialog,
|
|
5
|
-
.dialog-bounce-leave-active .el-dialog {
|
|
6
|
-
transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.dialog-bounce-enter-from,
|
|
10
|
-
.dialog-bounce-leave-to {
|
|
11
|
-
opacity: 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.dialog-bounce-enter-from .el-dialog,
|
|
15
|
-
.dialog-bounce-leave-to .el-dialog {
|
|
16
|
-
transform: scale(0.3) translateY(-50px);
|
|
17
|
-
opacity: 0;
|
|
18
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
{{ label }}
|
|
3
|
-
</template>
|
|
4
|
-
<script setup lang="ts">
|
|
5
|
-
import { computed, PropType } from 'vue'
|
|
6
|
-
const props = defineProps({
|
|
7
|
-
options: {
|
|
8
|
-
type: Array,
|
|
9
|
-
default: () => []
|
|
10
|
-
},
|
|
11
|
-
value: {
|
|
12
|
-
type: String as PropType<any>,
|
|
13
|
-
default: ''
|
|
14
|
-
},
|
|
15
|
-
})
|
|
16
|
-
const label = computed(() => {
|
|
17
|
-
// 处理value为数字的情况 后端字典都是字符串
|
|
18
|
-
const item = props.options?.find((item) => item.value == props.value.toString());
|
|
19
|
-
return item?.label || props.value;
|
|
20
|
-
});
|
|
21
|
-
</script>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineComponent,
|
|
3
|
-
ref,
|
|
4
|
-
h,
|
|
5
|
-
computed,
|
|
6
|
-
toRefs,
|
|
7
|
-
type ExtractPropTypes,
|
|
8
|
-
} from "vue";
|
|
9
|
-
import { ElDrawer } from "element-plus";
|
|
10
|
-
import { defaultAttrs } from "./constants.ts";
|
|
11
|
-
|
|
12
|
-
const propsAttrs = {};
|
|
13
|
-
|
|
14
|
-
export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
|
|
15
|
-
|
|
16
|
-
export default defineComponent({
|
|
17
|
-
// props: propsAttrs,
|
|
18
|
-
// emits: eventList,
|
|
19
|
-
|
|
20
|
-
// attrs, emit会继承, slots需要设置
|
|
21
|
-
setup(props: PropsAttrs, { attrs, emit, slots, expose }) {
|
|
22
|
-
// const drawerRef = ref();
|
|
23
|
-
|
|
24
|
-
// 暴露方法
|
|
25
|
-
// expose({
|
|
26
|
-
// drawerRef,
|
|
27
|
-
// });
|
|
28
|
-
|
|
29
|
-
// 属性处理
|
|
30
|
-
const getAttrs = () => {
|
|
31
|
-
const obj = {
|
|
32
|
-
...defaultAttrs, // 设置默认值
|
|
33
|
-
};
|
|
34
|
-
return obj;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// 渲染组件
|
|
38
|
-
const render = () => {
|
|
39
|
-
return h(
|
|
40
|
-
ElDrawer,
|
|
41
|
-
{
|
|
42
|
-
// ref: drawerRef,
|
|
43
|
-
...getAttrs(),
|
|
44
|
-
class: "c-drawer",
|
|
45
|
-
},
|
|
46
|
-
slots
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// 返回渲染函数
|
|
51
|
-
return () => render();
|
|
52
|
-
},
|
|
53
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// /* Bounce Animation */
|
|
2
|
-
// .dialog-bounce-enter-active,
|
|
3
|
-
// .dialog-bounce-leave-active,
|
|
4
|
-
// .dialog-bounce-enter-active .el-dialog,
|
|
5
|
-
// .dialog-bounce-leave-active .el-dialog {
|
|
6
|
-
// transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
7
|
-
// }
|
|
8
|
-
|
|
9
|
-
// .dialog-bounce-enter-from,
|
|
10
|
-
// .dialog-bounce-leave-to {
|
|
11
|
-
// opacity: 0;
|
|
12
|
-
// }
|
|
13
|
-
|
|
14
|
-
// .dialog-bounce-enter-from .el-dialog,
|
|
15
|
-
// .dialog-bounce-leave-to .el-dialog {
|
|
16
|
-
// transform: scale(0.3) translateY(-50px);
|
|
17
|
-
// opacity: 0;
|
|
18
|
-
// }
|
package/components/form/index.ts
DELETED