@vunk/form 2.19.18 → 2.19.19
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/components/card-input-collection/index.cjs +1 -1
- package/components/card-input-collection/index.mjs +1 -1
- package/components/dialog-input-collection/index.cjs +1 -1
- package/components/dialog-input-collection/index.mjs +1 -1
- package/components/download-plus/index.cjs +1 -1
- package/components/download-plus/index.mjs +1 -1
- package/components/editable-text/index.cjs +1 -1
- package/components/editable-text/index.mjs +108 -74
- package/components/editable-text/src/ctx.d.ts +31 -8
- package/components/editable-text/src/index.vue.d.ts +29 -0
- package/components/esri-input-geojson/index.cjs +1 -1
- package/components/esri-input-geojson/index.mjs +1 -1
- package/components/form-item/index.cjs +1 -1
- package/components/form-item/index.mjs +55 -51
- package/components/index-BBriTmQP.js +1 -0
- package/components/{index-BCZuzyeO.mjs → index-CeHbpfCD.mjs} +51 -36
- package/components/input-array/index.cjs +1 -1
- package/components/input-array/index.mjs +1 -1
- package/components/input-collection/index.cjs +1 -1
- package/components/input-collection/index.mjs +1 -1
- package/components/input-link/index.cjs +1 -1
- package/components/input-link/index.mjs +1 -1
- package/components/style.css +1 -1
- package/components/upload/index.cjs +1 -1
- package/components/upload/index.mjs +1 -1
- package/components/upload-plus/index.cjs +1 -1
- package/components/upload-plus/index.mjs +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/components/index-DSyxYMB0.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@vunk/form/components/form-item"),N=require("@vunk/form/composables"),n=require("element-plus"),s=require("@vunk/core"),q=require("@vunk/form/components/templates-default"),w=require("@vunk/form/components/template-instances-provider"),T=require("@vunk/form/components/fieldset"),I=require("@vunk/form/components/form-item-renderer"),E=require("@vunk/form/components/renderer-data"),A=require("@vunk/form/composables/element-plus"),v=require("@vunk/shared/function"),F=require("../index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@vunk/form/components/form-item"),N=require("@vunk/form/composables"),n=require("element-plus"),s=require("@vunk/core"),q=require("@vunk/form/components/templates-default"),w=require("@vunk/form/components/template-instances-provider"),T=require("@vunk/form/components/fieldset"),I=require("@vunk/form/components/form-item-renderer"),E=require("@vunk/form/components/renderer-data"),A=require("@vunk/form/composables/element-plus"),v=require("@vunk/shared/function"),F=require("../index-BBriTmQP.js"),f=require("../cloneDeep-DaYwfXwD.js"),b={...y._VkfFormItemCtx.props,columns:{type:Array,default:()=>[]},modelValue:{type:Array,default:()=>[]},readonly:{type:Boolean,default:void 0},splicable:{type:Boolean,default:!0},slots:{type:Object,default:()=>({})},labelActions:{type:Boolean,default:!1},defaultItemValue:{type:[Object,Function],default:()=>({})},keepLast:{type:Boolean,default:!1},topSplicable:{type:Boolean,default:!0},cardProps:{type:Object,default:()=>({})},fieldsetProps:{type:Object,default:()=>({})}},P={"update:modelValue":null},j={key:0,class:"vkf-card-input-collection-options"},O={class:"vkf-card-input-collection-card__footer"},$=e.defineComponent({inheritAttrs:!1,__name:"core",props:b,emits:P,setup(c,{emit:m}){const l=c,u=m,g=y._VkfFormItemCtx.createBindProps(l),d=N.useComputedReadonly(l),{tr:p}=A.useLocale(),i=e.computed(()=>{if(!l.prop||l.prop.length===0)return l.modelValue;const t={};return s.ensetData(t,{k:l.prop,v:l.modelValue}),t});function V(t){const o=f.cloneDeep(l.modelValue),a=v.isCallable(l.defaultItemValue)?l.defaultItemValue():l.defaultItemValue;o.splice(t+1,0,f.cloneDeep(a)),u("update:modelValue",o)}function h(t){const o=f.cloneDeep(l.modelValue);o.splice(t,1),u("update:modelValue",o)}const D=t=>{const o=f.cloneDeep(i.value);s.ensetData(o,t),u("update:modelValue",s.getValue(o,l.prop))};function S(t){return l.columns.map(o=>{var C;const a=[l.prop??[],t].flat(),k=[a,o.prop].flat(),r={readonly:d.value,...o,prop:k};Reflect.deleteProperty(r,"createTemplateProps"),v.isCallable(o.templateProps)&&(r.templateProps=()=>o.templateProps(s.getValue(i.value,a)));const _=((C=o.createTemplateProps)==null?void 0:C.call(o,{$index:t,row:s.getValue(i.value,a)},r))??{};return Object.assign(r,_),r})}return(t,o)=>(e.openBlock(),e.createBlock(e.unref(w.VkfTemplateInstancesProvider),null,{placeholder:e.withCtx(()=>[e.createVNode(e.unref(q.VkfTemplatesDefault))]),default:e.withCtx(()=>[e.createVNode(e.unref(y.VkfFormItem),e.mergeProps({class:"vkf-card-input-collection"},{...e.unref(g),...t.$attrs}),e.createSlots({default:e.withCtx(()=>{var a;return[!e.unref(d)&&t.splicable&&!t.labelActions&&t.topSplicable?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(e.unref(n.ElButton),{type:"primary",onClick:o[1]||(o[1]=k=>V(-1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)("vkf.common.add","添加")),1)]),_:1})])):e.createCommentVNode("",!0),(a=t.modelValue)!=null&&a.length?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(n.ElEmpty),{key:1,class:"vkf-card-input-collection-empty"},{image:e.withCtx(()=>[...o[2]||(o[2]=[e.createTextVNode(e.toDisplayString(""),-1)])]),_:1})),e.createVNode(e.unref(E.VkfRendererData),{data:i.value,onSetData:D},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.modelValue,(k,r)=>(e.openBlock(),e.createBlock(e.unref(n.ElCard),e.mergeProps({key:r,class:"vkf-card-input-collection-card"},{ref_for:!0},t.cardProps),e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(T.VkfFieldset),e.mergeProps({ref_for:!0},t.fieldsetProps),{default:e.withCtx(()=>[e.createVNode(e.unref(I.VkfFormItemRenderer),{source:S(r)},null,8,["source"])]),_:2},1040)]),_:2},[!e.unref(d)&&t.splicable?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",O,[e.renderSlot(t.$slots,"footerActions",{index:r}),e.createVNode(e.unref(n.ElButton),{type:"primary",onClick:()=>V(r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)("vkf.common.add","添加")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(n.ElButton),{type:"danger",disabled:t.modelValue.length<=1&&l.keepLast,onClick:()=>h(r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)("vkf.common.delete","删除")),1)]),_:1},8,["disabled","onClick"])])]),key:"0"}:void 0]),1040))),128))]),_:3},8,["data"])]}),_:2},[t.labelActions?{name:"labelActions",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"labelActions"),!e.unref(d)&&t.splicable&&t.topSplicable?(e.openBlock(),e.createBlock(e.unref(n.ElButton),{key:0,size:"small",icon:e.unref(F.plus_default),onClick:o[0]||(o[0]=a=>V(-1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)("vkf.common.add","添加")),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1040)]),_:3}))}}),B=e.defineComponent({name:"VkfCardInputCollection",props:b,emits:P,setup(c,{slots:m,emit:l}){return()=>e.h($,{...c,"onUpdate:modelValue":u=>l("update:modelValue",u)},{...c.slots,...m})}}),R=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfCardInputCollection=B;exports.__VkfCardInputCollection=R;exports.default=B;
|
|
@@ -10,7 +10,7 @@ import { VkfFormItemRenderer as Z } from "@vunk/form/components/form-item-render
|
|
|
10
10
|
import { VkfRendererData as x } from "@vunk/form/components/renderer-data";
|
|
11
11
|
import { useLocale as ee } from "@vunk/form/composables/element-plus";
|
|
12
12
|
import { isCallable as j } from "@vunk/shared/function";
|
|
13
|
-
import { p as te } from "../index-
|
|
13
|
+
import { p as te } from "../index-CeHbpfCD.mjs";
|
|
14
14
|
import { c as v } from "../cloneDeep-DE0l40hv.mjs";
|
|
15
15
|
const T = {
|
|
16
16
|
...O.props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../index-BBriTmQP.js"),g=require("@vunk/core"),N=require("@vunk/form/components/form-item"),P=require("@vunk/form/components/information-renderer"),A=require("@vunk/form/composables"),T=require("@vunk/form/composables/element-plus"),R=require("@vunk/plus/components/avatar"),j=require("@vunk/plus/components/table-columns"),C=require("@vunk/shared/enum"),I=require("@vunk/shared/function"),p=require("element-plus"),w=require("@vunk/core/composables"),U=require("@vunk/form/components/form"),O=require("@vunk/form/shared/form"),z=require("@vunk/form/components/information-templates-default"),M=require("@vunk/form/components/renderer-data"),L=require("@vunk/form/components/template-instances-provider"),G=require("@vunk/form/components/templates-default"),b=require("../cloneDeep-DaYwfXwD.js"),H={...N._VkfFormItemCtx.props,columns:{type:Array,default:()=>[]},modelValue:{type:Array,default:()=>[]},readonly:{type:Boolean,default:void 0},splicable:{type:Boolean,default:!0},labelActions:{type:Boolean,default:!1},defaultItemValue:{type:[Object,Function],default:()=>({})},dialogFormProps:{type:Object,default:()=>({})},validateCatch:{type:Function},modules:{type:Array,default:()=>["operations:add"]},formdata:{type:Object,default:void 0}},J={"update:modelValue":null,"update:formdata":null},K=e.defineComponent({__name:"dialog-form",props:{title:{type:String,default:""},modelValue:{type:Object,default:()=>({})},openReset:{type:Boolean,default:!0},visible:{type:Boolean,default:!1},formItems:{type:Array,default:()=>[]},dialogFormProps:{type:Object,default:()=>({})},validateCatch:{type:Function,default:O.validateCatch},formdata:null},emits:["update:modelValue","update:visible","change","update:formdata"],setup(d,{emit:m}){const a=d,u=m,{tr:s}=T.useLocale(),c=w.useModelComputed({key:"formdata",default:{}},a,u),V=w.useDeferred();V.promise.then(n=>{var r,f;(f=(r=a.dialogFormProps).elRef)==null||f.call(r,n)}),e.watch(()=>a.visible,n=>{a.openReset&&n&&(c.value={...a.modelValue},setTimeout(()=>{var r;(r=V.value)==null||r.clearValidate()}))});function k(){var n;(n=V.value)==null||n.validate().then(()=>{u("update:modelValue",c.value),u("change",c.value),u("update:visible",!1)}).catch(a.validateCatch)}return(n,r)=>{const f=e.resolveComponent("ElButton");return e.openBlock(),e.createBlock(e.unref(p.ElDialog),{"model-value":d.visible,"append-to-body":"","onUpdate:modelValue":r[2]||(r[2]=v=>n.$emit("update:visible",v))},{header:e.withCtx(()=>[e.renderSlot(n.$slots,"header")]),footer:e.withCtx(()=>[e.createVNode(f,{onClick:r[1]||(r[1]=v=>n.$emit("update:visible",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("el.messagebox.cancel","取消")),1)]),_:1}),e.createVNode(f,{type:"primary",onClick:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("el.messagebox.confirm","确定")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(U.VkfForm),e.mergeProps(d.dialogFormProps,{"el-ref":e.unref(V).resolve,"form-items":d.formItems,data:e.unref(c),onSetData:r[0]||(r[0]=v=>e.unref(g.setData)(e.unref(c),v))}),null,16,["el-ref","form-items","data"])]),_:3},8,["model-value"])}}}),Q=e.defineComponent({__name:"layout",props:{data:{type:Object,default:()=>({})}},emits:["setData"],setup(d){return(m,a)=>(e.openBlock(),e.createBlock(e.unref(L.VkfTemplateInstancesProvider),null,{placeholder:e.withCtx(()=>[e.createVNode(e.unref(G.VkfTemplatesDefault))]),default:e.withCtx(()=>[e.createVNode(e.unref(P.VkfInformationTemplates),null,{placeholder:e.withCtx(()=>[e.createVNode(e.unref(z.VkfInformationTemplatesDefault))]),default:e.withCtx(()=>[e.createVNode(e.unref(M.VkfRendererData),{data:d.data,onSetData:a[1]||(a[1]=u=>m.$emit("setData",u))},{default:e.withCtx(()=>[e.createVNode(e.unref(P.VkfInformationData),{data:d.data,onSetData:a[0]||(a[0]=u=>m.$emit("setData",u))},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"default")]),_:3},8,["data"])]),_:3},8,["data"])]),_:3})]),_:3}))}}),W={key:0,class:"vkf-dialog-input-collection-options"},X={class:"vkf-dialog-input-collection__dialog-header"},Y={class:"vkf-dialog-input-collection__dialog-title"},S=e.defineComponent({name:"VkfDialogInputCollection",inheritAttrs:!1,__name:"index",props:H,emits:J,setup(d,{emit:m}){const a=d,u=m,{tr:s}=T.useLocale(),c=p.ElTable,V=e.computed(()=>a.modules.includes("operations:add")),k=N._VkfFormItemCtx.createBindProps(a),n=A.useComputedReadonly(a),r=e.computed(()=>{if(!a.prop||a.prop.length===0)return a.modelValue;const t={};return g.ensetData(t,{k:a.prop,v:a.modelValue}),t}),f=e.computed(()=>a.columns.map(t=>{const o=Array.isArray(t.prop)?t.prop.join("."):t.prop;return{...t,prop:o,slots:i=>{var B;const h={prop:[a.prop??[],i.$index,t.prop].flat(),readonly:n.value,templateType:t.templateType,templateProps:t.templateProps};return I.isCallable(t.templateProps)&&(h.templateProps=()=>t.templateProps(i.row)),e.createVNode(P.VkfInformationRenderer,{source:[{...h,...(B=t.createTemplateProps)==null?void 0:B.call(t,i,h)}]},null)}}})),v=e.computed(()=>({label:s("vkf.common.operations","操作"),align:"center",width:"85",hidden:n.value||!a.splicable,className:"vk-input-collection__buttons",slots:({$index:t})=>e.createVNode(e.Fragment,null,[V.value&&e.createVNode(p.ElButton,{size:"small",icon:y.plus_default,type:"primary",link:!0,onClick:()=>D(t)},null),e.createVNode(p.ElButton,{size:"small",icon:y.edit_default,type:"primary",link:!0,onClick:()=>_(t)},null),e.createVNode(p.ElPopconfirm,{title:s("vkf.dialogInputCollection.deleteConfirm","确定删除吗?"),onConfirm:()=>F(t),confirmButtonText:s("vkf.common.delete","删除"),cancelButtonText:s("el.popconfirm.cancelButtonText","取消")},{reference:()=>e.createVNode(p.ElButton,{size:"small",icon:y.delete_default,type:"danger",link:!0},null)})])})),q=e.computed(()=>[...f.value,v.value]),l=e.reactive({type:C.CRUD.create,index:0,data:{},dialogVisible:!1}),x=e.computed(()=>a.columns.map(t=>({label:t.label,readonly:n.value,prop:t.prop,templateType:t.templateType,templateProps:t.templateProps})));function F(t){const o=b.cloneDeep(a.modelValue);o.splice(t,1),u("update:modelValue",o)}function D(t){const o=I.isCallable(a.defaultItemValue)?a.defaultItemValue():a.defaultItemValue;l.index=t,l.data=b.cloneDeep(o),l.type=C.CRUD.create,l.dialogVisible=!0}function _(t){const o=a.modelValue[t];l.index=t,l.data=b.cloneDeep(o),l.type=C.CRUD.update,l.dialogVisible=!0}function $(t){const o=b.cloneDeep(a.modelValue);l.type===C.CRUD.create?o.splice(l.index+1,0,t):l.type===C.CRUD.update&&(o[l.index]=t),u("update:modelValue",o)}const E=t=>{console.warn("表单项正在直接修改 Data, 这在 dialog-input-collection 可能是一个意外操作",t);const o=b.cloneDeep(r.value);g.ensetData(o,t),u("update:modelValue",g.getValue(o,a.prop))};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Q,{data:r.value,onSetData:E},{default:e.withCtx(()=>[e.createVNode(e.unref(N.VkfFormItem),e.normalizeProps(e.guardReactiveProps({...e.unref(k),...t.$attrs})),e.createSlots({default:e.withCtx(()=>[!e.unref(n)&&t.splicable&&!t.labelActions?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:o[1]||(o[1]=i=>D(-1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("vkf.common.add","添加")),1)]),_:1})])):e.createCommentVNode("",!0),e.createVNode(e.unref(c),{data:t.modelValue,class:"vkf-dialog-input-collection-table"},{default:e.withCtx(()=>[e.createVNode(e.unref(j.VkTableColumns),{source:q.value},null,8,["source"])]),_:1},8,["data"])]),_:2},[t.labelActions?{name:"labelActions",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"labelActions"),!e.unref(n)&&t.splicable?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,size:"small",icon:e.unref(y.plus_default),onClick:o[0]||(o[0]=i=>D(-1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("vkf.common.add","添加")),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1040),e.createVNode(K,{visible:l.dialogVisible,"onUpdate:visible":o[2]||(o[2]=i=>l.dialogVisible=i),modelValue:l.data,"onUpdate:modelValue":o[3]||(o[3]=i=>l.data=i),formdata:t.formdata,"form-items":x.value,"dialog-form-props":t.dialogFormProps,"validate-catch":t.validateCatch,"onUpdate:formdata":o[4]||(o[4]=i=>t.$emit("update:formdata",i)),onChange:$},{header:e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(e.unref(R.VkAvatar),{icon:l.type===e.unref(C.CRUD).create?e.unref(y.plus_default):e.unref(y.edit_default)},null,8,["icon"]),e.createElementVNode("span",Y,e.toDisplayString(a.label),1)])]),_:1},8,["visible","modelValue","formdata","form-items","dialog-form-props","validate-catch"])]),_:3},8,["data"]),e.renderSlot(t.$slots,"default")],64))}}),Z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfDialogInputCollection=S;exports.__VkfDialogInputCollection=Z;exports.default=S;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as A, watch as Q, resolveComponent as W, openBlock as D, createBlock as S, unref as a, withCtx as r, createVNode as l, mergeProps as X, createTextVNode as I, toDisplayString as P, renderSlot as h, computed as b, Fragment as j, reactive as Y, createElementBlock as _, normalizeProps as Z, guardReactiveProps as x, createSlots as ee, createCommentVNode as O, createElementVNode as R } from "vue";
|
|
2
|
-
import { p as $,
|
|
2
|
+
import { p as $, a as w, d as te } from "../index-CeHbpfCD.mjs";
|
|
3
3
|
import { setData as ae, ensetData as z, getValue as oe } from "@vunk/core";
|
|
4
4
|
import { _VkfFormItemCtx as U, VkfFormItem as le } from "@vunk/form/components/form-item";
|
|
5
5
|
import { VkfInformationTemplates as re, VkfInformationData as ne, VkfInformationRenderer as ie } from "@vunk/form/components/information-renderer";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var N=Object.defineProperty;var U=(e,o,c)=>o in e?N(e,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):e[o]=c;var R=(e,o,c)=>U(e,typeof o!="symbol"?o+"":o,c);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@vunk/form/components/form-item"),t=require("vue"),$=require("@skzz/platform/api/basic"),q=require("@skzz/platform/shared/fetch/platform"),C=require("element-plus"),x=require("@vunk/core/shared/utils-fetch"),V=require("../index-BNPcMpOO.js"),H=require("@vunk/core/composables"),T=require("../index-
|
|
1
|
+
"use strict";var N=Object.defineProperty;var U=(e,o,c)=>o in e?N(e,o,{enumerable:!0,configurable:!0,writable:!0,value:c}):e[o]=c;var R=(e,o,c)=>U(e,typeof o!="symbol"?o+"":o,c);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@vunk/form/components/form-item"),t=require("vue"),$=require("@skzz/platform/api/basic"),q=require("@skzz/platform/shared/fetch/platform"),C=require("element-plus"),x=require("@vunk/core/shared/utils-fetch"),V=require("../index-BNPcMpOO.js"),H=require("@vunk/core/composables"),T=require("../index-BBriTmQP.js"),M=require("@vunk/core/shared/utils-class"),O=require("@vunk/form/composables/element-plus"),j=require("../_plugin-vue_export-helper-BHFhmbuH.js"),A={...P._VkfFormItemCtx.props,fileId:{type:String,default:""},url:{type:String,default:void 0},chunkSize:{type:Number,default:1024*1024*10},fileServiceType:{type:String,default:void 0},fileStatus:{type:String,default:void 0}},G={"update:fileStatus":null};var r=(e=>(e.wait="wait",e.doPause="doPause",e.pause="pause",e.doDownload="doDownload",e.downloading="downloading",e.error="error",e.done="done",e))(r||{});const F=new x.RestFetch({baseURL:q.restFetch.baseURL,presetRequestInit:e=>{const o=e.headers,c=V.getToken();return c&&o.set("Token",c),e}}),X=(e,o)=>new Promise((c,h)=>{var b;const n=new XMLHttpRequest;let y=`${F.baseURL}/file/downloadByRange?fileId=${e.fileId}`;e.fileServiceType&&(y+=`&fileServiceType=${e.fileServiceType}`,n.setRequestHeader("fileServiceType",e.fileServiceType)),o!=null&&o.onprogress&&(n.onprogress=o==null?void 0:o.onprogress),n.open("GET",y,!0),n.responseType="blob",n.setRequestHeader("Token",V.getToken()),n.setRequestHeader("tenant","default"),n.setRequestHeader("application","platform"),n.setRequestHeader("Content-Range",`bytes=${e.start}-${e.end}`),n.setRequestHeader("Accept-Ranges","bytes"),n.onreadystatechange=l=>{const w=l.target;if(n.readyState===4)if(n.status===200||n.status===206){if(o!=null&&o.xhrs){const u=o.xhrs.findIndex(g=>g===n);o.xhrs.splice(u,1)}c({data:w.response})}else n.status===500&&h(w.response)},n.onerror=()=>{h(n.response)};try{n.send()}catch(l){h(l)}(b=o==null?void 0:o.xhrs)==null||b.push(n)}),J=t.defineComponent({name:"VkfDownloadPlus",components:{VkfFormItem:P.VkfFormItem,ElButtonGroup:C.ElButtonGroup,ElButton:C.ElButton,ElInput:C.ElInput},props:A,emits:G,setup(e,{emit:o}){const c=P._VkfFormItemCtx.createBindProps(e),{tr:h}=O.useLocale();t.watchEffect(()=>{F.baseURL=e.url||q.restFetch.baseURL});const n=t.ref();y(),t.watch(()=>e.fileId,y);function y(){e.fileId&&$.rFile({fileId:e.fileId}).then(a=>{n.value=a})}const b=t.computed(()=>u.value===r.error?T.circle_close_filled_default:T.download_default),l=t.ref([]),w=t.ref([]),u=H.useModelComputed({default:r.wait,key:"fileStatus"},e,o),g=()=>{if(!n.value)return;const a=n.value.size,k=n.value.id,I=Math.ceil(a/e.chunkSize);l.value=Array.from({length:I},(v,s)=>{const i=s*e.chunkSize,f=Math.min(i+e.chunkSize,a)-1;let S={};return l.value[s]&&l.value[s].start===i&&l.value[s].end===f&&l.value[s].status===r.done&&(S=l.value[s]),{start:i,end:f,index:s,status:r.wait,fileId:k,fileServiceType:e.fileServiceType,progress:0,...S}}),u.value=r.downloading;const _=l.value.filter(v=>v.status===r.wait||v.status===r.error);m(_).then(()=>{const v=l.value.map(s=>s.data);return new Blob(v,{type:"application/octet-stream"})}).then(v=>{var f;const s=URL.createObjectURL(v),i=document.createElement("a");i.href=s,i.download=((f=n.value)==null?void 0:f.realName)||h("vkf.downloadPlus.unknownFile","未知文件"),i.click(),URL.revokeObjectURL(s)}).then(()=>{u.value=r.done}).catch(()=>{u.value=r.error,C.ElMessage.error(h("vkf.downloadPlus.downloadFailed","下载失败"))})};t.watch(()=>u.value,a=>{a===r.doDownload&&g()});function m(a,k=4,I=10){return new Promise((_,v)=>{const s=a.length;let i=0;if(s===0)return _(void 0);const f=[],S=async()=>{for(;i<s&&k>0;){k--;const z=a.findIndex(d=>d.status===r.wait||d.status===r.error),p=a[z];p&&(p.status=r.downloading,X(p,{onprogress(d){p.progress=parseInt(d.loaded/d.total*100+"")},xhrs:w.value}).then(d=>{p.status=r.done,p.data=d.data,k++,i++}).then(()=>{i===s?_(void 0):S()}).catch(()=>{p.status=r.error;const d=p.index;if(typeof f[d]!="number"&&(f[d]=0),f[d]++,console.warn(d,p,f[d],"次报错"),p.progress=-1,f[d]>=I)return v();k++,S()}))}};S()})}const B=()=>{w.value.forEach(a=>{a.abort()}),w.value=[],u.value=r.pause};t.watch(()=>u.value,a=>{a===r.doPause&&B()}),t.onBeforeUnmount(()=>{B()});class D extends M.ToggleHandler{constructor(I){super();R(this,"listener");this.listener=I}add(){window.addEventListener("online",this.listener),this.removeHandler=()=>{window.removeEventListener("online",this.listener)}}}const E=new D(()=>{u.value===r.error&&(u.value=r.doDownload)});return E.add(),t.onBeforeUnmount(()=>{E.remove()}),{formItemBindProps:c,fileInfo:n,handleDownload:g,handlePause:B,Status:r,chunks:l,fileStatus:u,filePrefixIcon:b,tr:h}}}),K={class:"vkf-download-plus-main"},Q={class:"vkf-download-plus-label"},W={key:0,class:"vkf-download-plus-cube-x"};function Y(e,o,c,h,n,y){const b=t.resolveComponent("ElInput"),l=t.resolveComponent("el-button"),w=t.resolveComponent("el-button-group"),u=t.resolveComponent("VkfFormItem");return t.openBlock(),t.createBlock(u,t.mergeProps(e.formItemBindProps,{class:"vkf-download-plus"}),{default:t.withCtx(()=>{var g;return[t.createElementVNode("div",K,[t.createElementVNode("label",Q,[t.createVNode(b,{class:t.normalizeClass({"is-error":e.fileStatus===e.Status.error}),"prefix-icon":e.filePrefixIcon,"model-value":(g=e.fileInfo)==null?void 0:g.realName,readonly:""},null,8,["class","prefix-icon","model-value"]),e.fileStatus===e.Status.downloading||e.fileStatus===e.Status.pause?(t.openBlock(),t.createElementBlock("div",W,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.chunks,m=>(t.openBlock(),t.createElementBlock("div",{key:m.fileId+"-"+m.index,class:t.normalizeClass(["vkf-download-plus-cube",{error:m.status==e.Status.error}]),style:t.normalizeStyle({width:100/e.chunks.length+"%"})},[t.createElementVNode("div",{class:t.normalizeClass({uploading:m.progress>0&&m.progress<100,success:m.progress==100}),style:t.normalizeStyle({height:m.progress+"%"})},null,6)],6))),128))])):t.createCommentVNode("",!0)]),t.createVNode(w,{class:"vkf-download-plus-btng"},{default:t.withCtx(()=>[e.fileStatus===e.Status.downloading?(t.openBlock(),t.createBlock(l,{key:0,type:"danger",onClick:e.handlePause},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.tr("vkf.common.pause","暂停")),1)]),_:1},8,["onClick"])):(t.openBlock(),t.createBlock(l,{key:1,type:"primary",onClick:e.handleDownload},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.tr("vkf.common.download","下载")),1)]),_:1},8,["onClick"]))]),_:1})])]}),_:1},16)}const L=j._export_sfc(J,[["render",Y]]),Z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfDownloadPlus=L;exports.__VkfDownloadPlus=Z;exports.default=L;
|
|
@@ -9,7 +9,7 @@ import { ElInput as re, ElButton as se, ElButtonGroup as le, ElMessage as ae } f
|
|
|
9
9
|
import { RestFetch as de } from "@vunk/core/shared/utils-fetch";
|
|
10
10
|
import { g as x } from "../index-DJv1MwwH.mjs";
|
|
11
11
|
import { useModelComputed as ue } from "@vunk/core/composables";
|
|
12
|
-
import {
|
|
12
|
+
import { b as ie, f as fe } from "../index-CeHbpfCD.mjs";
|
|
13
13
|
import { ToggleHandler as ce } from "@vunk/core/shared/utils-class";
|
|
14
14
|
import { useLocale as pe } from "@vunk/form/composables/element-plus";
|
|
15
15
|
import { _ as me } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("@vunk/form/components/form-item"),S=require("element-plus"),T=require("@vunk/form"),g=require("@vunk/core/composables"),E=require("@vunk/form/components/form-item-renderer"),N=require("@vunk/form/components/templates-default"),P=require("@vunk/form/components/renderer-data"),w=require("@vunk/core"),b=require("@vunk/plus/components/avatar"),f=require("../index-BBriTmQP.js"),D=require("@vunk/plus/components/text"),R={...u._VkfFormItemCtx.props,modelValue:null,iconSize:{type:Number,default:22},readonly:{type:Boolean,default:void 0},editable:{type:Boolean,default:void 0},edit:{type:Object,default:void 0},textProps:{type:Object,default:()=>({})},showEditIcon:{type:Boolean,default:!1},clickOutsideToClose:{type:Boolean,default:!0},validate:{type:Function,default:void 0}},z={"update:editable":null,"update:modelValue":null,checked:d=>d||!0},O={class:"vkf-editable-text-actions"},_=e.defineComponent({name:"VkfEditableText",inheritAttrs:!1,__name:"index",props:R,emits:z,setup(d,{emit:C}){const o=d,l=C,x=e.useId(),n=g.useModelComputed({key:"editable",default:!1},o,l),p=e.computed(()=>o.prop??x),m=u._VkfFormItemCtx.createBindProps(o,[]),k=T.useComputedReadonly(o),v=e.ref(),i=e.ref(),I=e.computed(()=>[{templateType:"VkfInput",...m.value,inline:!0,onBlur:o.clickOutsideToClose?s:void 0,onKeydown:r=>{r.key==="Enter"?s():r.key==="Escape"&&y(),r.stopPropagation()},...o.edit,prop:p.value,elRef:r=>{var a,h;(h=(a=o.edit)==null?void 0:a.elRef)==null||h.call(a,r),i.value=r}}]),q=e.computed(()=>{const t={};return w.setData(t,{k:p.value,v:o.modelValue}),t}),B=({v:t})=>{l("update:modelValue",t)},V=e.ref(o.modelValue);function c(){V.value=o.modelValue,n.value=!0,e.nextTick(()=>{var r;const t=(r=v.value)==null?void 0:r.$el.querySelector("input, textarea");t&&t.focus()})}function s(){var a;const t=()=>{n.value=!1,l("checked",o.modelValue)},r=()=>{console.warn("Validation failed, editable text remains open.")};o.validate?o.validate(o.modelValue).then(t).catch(r):(a=i.value)!=null&&a.validate?i.value.validate().then(t).catch(r):t()}function y(){l("update:modelValue",V.value),n.value=!1}return(t,r)=>e.unref(k)||!e.unref(n)?(e.openBlock(),e.createBlock(e.unref(u.VkfFormItem),e.mergeProps({key:0},{...e.unref(m),...t.$attrs},{class:"vkf-editable-text"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"text",{handleEdit:c},()=>[e.createVNode(e.unref(D.VkText),e.mergeProps(t.textProps,{onDblclick:c}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.modelValue),1)]),_:1},16)]),!e.unref(k)&&t.showEditIcon?(e.openBlock(),e.createBlock(e.unref(S.ElIcon),{key:0,color:"var(--el-color-primary)",class:"vk-editable-text-edit",onClick:c},{default:e.withCtx(()=>[e.createVNode(e.unref(f.edit_pen_default))]),_:1})):e.createCommentVNode("",!0)]),_:3},16)):(e.openBlock(),e.createBlock(e.unref(P.VkfRendererData),{key:1,data:q.value,onSetData:B},{default:e.withCtx(()=>[e.createVNode(e.unref(u.VkfFormItem),e.mergeProps({ref_key:"formItemContainerRef",ref:v,class:"vk-editable-text-edit-x"},t.$attrs),{default:e.withCtx(()=>[e.createVNode(e.unref(E.VkfFormItemRenderer),{source:I.value},{placeholder:e.withCtx(()=>[e.createVNode(e.unref(N.VkfTemplatesDefault))]),_:1},8,["source"]),e.createElementVNode("div",O,[e.createVNode(e.unref(b.VkAvatar),{icon:e.unref(f.select_default),size:t.iconSize,color:"var(--el-color-primary)",onClick:s},null,8,["icon","size"]),e.createVNode(e.unref(b.VkAvatar),{icon:e.unref(f.close_bold_default),size:t.iconSize,color:"var(--el-color-danger)",onClick:y},null,8,["icon","size"])])]),_:1},16)]),_:1},8,["data"]))}}),F=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfEditableText=_;exports.__VkfEditableText=F;exports.default=_;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _VkfFormItemCtx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { defineComponent as P, useId as O, computed as m, ref as p, unref as t, openBlock as k, createBlock as v, mergeProps as y, withCtx as n, renderSlot as w, createVNode as r, createTextVNode as N, toDisplayString as j, createCommentVNode as F, createElementVNode as $, nextTick as A } from "vue";
|
|
2
|
+
import { _VkfFormItemCtx as T, VkfFormItem as E } from "@vunk/form/components/form-item";
|
|
3
|
+
import { ElIcon as M } from "element-plus";
|
|
4
|
+
import { useComputedReadonly as q } from "@vunk/form";
|
|
5
|
+
import { useModelComputed as K } from "@vunk/core/composables";
|
|
6
|
+
import { VkfFormItemRenderer as G } from "@vunk/form/components/form-item-renderer";
|
|
7
|
+
import { VkfTemplatesDefault as H } from "@vunk/form/components/templates-default";
|
|
8
|
+
import { VkfRendererData as J } from "@vunk/form/components/renderer-data";
|
|
9
|
+
import { setData as L } from "@vunk/core";
|
|
9
10
|
import { VkAvatar as S } from "@vunk/plus/components/avatar";
|
|
10
|
-
import { s as
|
|
11
|
-
import { VkText as
|
|
12
|
-
const
|
|
13
|
-
...
|
|
11
|
+
import { e as Q, s as U, c as W } from "../index-CeHbpfCD.mjs";
|
|
12
|
+
import { VkText as X } from "@vunk/plus/components/text";
|
|
13
|
+
const Y = {
|
|
14
|
+
...T.props,
|
|
14
15
|
/**
|
|
15
16
|
* @description model;
|
|
16
17
|
*/
|
|
@@ -46,118 +47,151 @@ const W = {
|
|
|
46
47
|
textProps: {
|
|
47
48
|
type: Object,
|
|
48
49
|
default: () => ({})
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* @description 是否显示编辑图标
|
|
53
|
+
*/
|
|
54
|
+
showEditIcon: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* @description 点击外部是否退出编辑状态
|
|
60
|
+
*/
|
|
61
|
+
clickOutsideToClose: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !0
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* @description 自定义验证函数
|
|
67
|
+
*/
|
|
68
|
+
validate: {
|
|
69
|
+
type: Function,
|
|
70
|
+
default: void 0
|
|
49
71
|
}
|
|
50
|
-
},
|
|
72
|
+
}, Z = {
|
|
51
73
|
"update:editable": null,
|
|
52
|
-
"update:modelValue": null
|
|
53
|
-
|
|
74
|
+
"update:modelValue": null,
|
|
75
|
+
checked: (s) => s || !0
|
|
76
|
+
}, ee = {
|
|
54
77
|
class: "vkf-editable-text-actions"
|
|
55
|
-
},
|
|
78
|
+
}, me = /* @__PURE__ */ P({
|
|
56
79
|
name: "VkfEditableText",
|
|
57
80
|
inheritAttrs: !1,
|
|
58
81
|
__name: "index",
|
|
59
|
-
props:
|
|
60
|
-
emits:
|
|
61
|
-
setup(
|
|
62
|
-
emit:
|
|
82
|
+
props: Y,
|
|
83
|
+
emits: Z,
|
|
84
|
+
setup(s, {
|
|
85
|
+
emit: B
|
|
63
86
|
}) {
|
|
64
|
-
const
|
|
87
|
+
const o = s, i = B, z = O(), d = K({
|
|
65
88
|
key: "editable",
|
|
66
89
|
default: !1
|
|
67
|
-
},
|
|
90
|
+
}, o, i), V = m(() => o.prop ?? z), b = T.createBindProps(o, []), h = q(o), _ = p(), u = p(), D = m(() => [{
|
|
68
91
|
templateType: "VkfInput",
|
|
69
|
-
...
|
|
92
|
+
...b.value,
|
|
70
93
|
inline: !0,
|
|
71
|
-
onBlur:
|
|
72
|
-
onKeydown: (
|
|
73
|
-
|
|
94
|
+
onBlur: o.clickOutsideToClose ? f : void 0,
|
|
95
|
+
onKeydown: (a) => {
|
|
96
|
+
a.key === "Enter" ? f() : a.key === "Escape" && x(), a.stopPropagation();
|
|
74
97
|
},
|
|
75
|
-
...
|
|
76
|
-
prop:
|
|
77
|
-
elRef: (
|
|
78
|
-
var
|
|
79
|
-
(
|
|
98
|
+
...o.edit,
|
|
99
|
+
prop: V.value,
|
|
100
|
+
elRef: (a) => {
|
|
101
|
+
var l, I;
|
|
102
|
+
(I = (l = o.edit) == null ? void 0 : l.elRef) == null || I.call(l, a), u.value = a;
|
|
80
103
|
}
|
|
81
|
-
}]), R =
|
|
104
|
+
}]), R = m(() => {
|
|
82
105
|
const e = {};
|
|
83
|
-
return
|
|
84
|
-
k:
|
|
85
|
-
v:
|
|
106
|
+
return L(e, {
|
|
107
|
+
k: V.value,
|
|
108
|
+
v: o.modelValue
|
|
86
109
|
}), e;
|
|
87
110
|
}), g = ({
|
|
88
111
|
v: e
|
|
89
112
|
}) => {
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
-
var
|
|
95
|
-
const e = (
|
|
113
|
+
i("update:modelValue", e);
|
|
114
|
+
}, C = p(o.modelValue);
|
|
115
|
+
function c() {
|
|
116
|
+
C.value = o.modelValue, d.value = !0, A(() => {
|
|
117
|
+
var a;
|
|
118
|
+
const e = (a = _.value) == null ? void 0 : a.$el.querySelector("input, textarea");
|
|
96
119
|
e && e.focus();
|
|
97
120
|
});
|
|
98
121
|
}
|
|
99
|
-
function
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
122
|
+
function f() {
|
|
123
|
+
var l;
|
|
124
|
+
const e = () => {
|
|
125
|
+
d.value = !1, i("checked", o.modelValue);
|
|
126
|
+
}, a = () => {
|
|
104
127
|
console.warn("Validation failed, editable text remains open.");
|
|
105
|
-
}
|
|
128
|
+
};
|
|
129
|
+
o.validate ? o.validate(o.modelValue).then(e).catch(a) : (l = u.value) != null && l.validate ? u.value.validate().then(e).catch(a) : e();
|
|
106
130
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
131
|
+
function x() {
|
|
132
|
+
i("update:modelValue", C.value), d.value = !1;
|
|
109
133
|
}
|
|
110
|
-
return (e,
|
|
134
|
+
return (e, a) => t(h) || !t(d) ? (k(), v(t(E), y({
|
|
111
135
|
key: 0
|
|
112
136
|
}, {
|
|
113
|
-
...t(
|
|
137
|
+
...t(b),
|
|
114
138
|
...e.$attrs
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
139
|
+
}, {
|
|
140
|
+
class: "vkf-editable-text"
|
|
141
|
+
}), {
|
|
142
|
+
default: n(() => [w(e.$slots, "text", {
|
|
143
|
+
handleEdit: c
|
|
144
|
+
}, () => [r(t(X), y(e.textProps, {
|
|
145
|
+
onDblclick: c
|
|
120
146
|
}), {
|
|
121
|
-
default: n(() => [
|
|
147
|
+
default: n(() => [N(j(e.modelValue), 1)]),
|
|
148
|
+
_: 1
|
|
149
|
+
}, 16)]), !t(h) && e.showEditIcon ? (k(), v(t(M), {
|
|
150
|
+
key: 0,
|
|
151
|
+
color: "var(--el-color-primary)",
|
|
152
|
+
class: "vk-editable-text-edit",
|
|
153
|
+
onClick: c
|
|
154
|
+
}, {
|
|
155
|
+
default: n(() => [r(t(Q))]),
|
|
122
156
|
_: 1
|
|
123
|
-
},
|
|
157
|
+
})) : F("", !0)]),
|
|
124
158
|
_: 3
|
|
125
|
-
}, 16)) : (
|
|
159
|
+
}, 16)) : (k(), v(t(J), {
|
|
126
160
|
key: 1,
|
|
127
161
|
data: R.value,
|
|
128
162
|
onSetData: g
|
|
129
163
|
}, {
|
|
130
|
-
default: n(() => [
|
|
164
|
+
default: n(() => [r(t(E), y({
|
|
131
165
|
ref_key: "formItemContainerRef",
|
|
132
|
-
ref:
|
|
166
|
+
ref: _,
|
|
133
167
|
class: "vk-editable-text-edit-x"
|
|
134
168
|
}, e.$attrs), {
|
|
135
|
-
default: n(() => [
|
|
136
|
-
source:
|
|
169
|
+
default: n(() => [r(t(G), {
|
|
170
|
+
source: D.value
|
|
137
171
|
}, {
|
|
138
|
-
placeholder: n(() => [
|
|
172
|
+
placeholder: n(() => [r(t(H))]),
|
|
139
173
|
_: 1
|
|
140
|
-
}, 8, ["source"]),
|
|
141
|
-
icon: t(
|
|
174
|
+
}, 8, ["source"]), $("div", ee, [r(t(S), {
|
|
175
|
+
icon: t(U),
|
|
142
176
|
size: e.iconSize,
|
|
143
177
|
color: "var(--el-color-primary)",
|
|
144
|
-
onClick:
|
|
145
|
-
}, null, 8, ["icon", "size"]),
|
|
146
|
-
icon: t(
|
|
178
|
+
onClick: f
|
|
179
|
+
}, null, 8, ["icon", "size"]), r(t(S), {
|
|
180
|
+
icon: t(W),
|
|
147
181
|
size: e.iconSize,
|
|
148
182
|
color: "var(--el-color-danger)",
|
|
149
|
-
onClick:
|
|
183
|
+
onClick: x
|
|
150
184
|
}, null, 8, ["icon", "size"])])]),
|
|
151
185
|
_: 1
|
|
152
186
|
}, 16)]),
|
|
153
187
|
_: 1
|
|
154
188
|
}, 8, ["data"]));
|
|
155
189
|
}
|
|
156
|
-
}),
|
|
190
|
+
}), pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
157
191
|
__proto__: null
|
|
158
192
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
159
193
|
export {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
194
|
+
me as VkfEditableText,
|
|
195
|
+
pe as __VkfEditableText,
|
|
196
|
+
me as default
|
|
163
197
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
1
2
|
export declare const props: {
|
|
2
3
|
/**
|
|
3
4
|
* @description model;
|
|
@@ -35,21 +36,42 @@ export declare const props: {
|
|
|
35
36
|
type: ObjectConstructor;
|
|
36
37
|
default: () => {};
|
|
37
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* @description 是否显示编辑图标
|
|
41
|
+
*/
|
|
42
|
+
showEditIcon: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: boolean;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @description 点击外部是否退出编辑状态
|
|
48
|
+
*/
|
|
49
|
+
clickOutsideToClose: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @description 自定义验证函数
|
|
55
|
+
*/
|
|
56
|
+
validate: {
|
|
57
|
+
type: PropType<(text: string) => Promise<any>>;
|
|
58
|
+
default: undefined;
|
|
59
|
+
};
|
|
38
60
|
required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
39
61
|
labelPosition: {
|
|
40
|
-
type:
|
|
62
|
+
type: PropType<"left" | "right" | "top" | "start" | "end">;
|
|
41
63
|
default: undefined;
|
|
42
64
|
};
|
|
43
65
|
formItemSize: {
|
|
44
|
-
type:
|
|
66
|
+
type: PropType<"default" | "small" | "large">;
|
|
45
67
|
default: undefined;
|
|
46
68
|
};
|
|
47
69
|
formItemSlots: {
|
|
48
|
-
type:
|
|
70
|
+
type: PropType<import("../../form-item/src/types").FormItemSlots>;
|
|
49
71
|
default: undefined;
|
|
50
72
|
};
|
|
51
73
|
elRef: {
|
|
52
|
-
type:
|
|
74
|
+
type: PropType<any>;
|
|
53
75
|
required: boolean;
|
|
54
76
|
};
|
|
55
77
|
inline: {
|
|
@@ -72,25 +94,25 @@ export declare const props: {
|
|
|
72
94
|
prop: null;
|
|
73
95
|
defaultModelValue: null;
|
|
74
96
|
labelTipProps: {
|
|
75
|
-
type:
|
|
97
|
+
type: PropType<import("element-plus").UseTooltipProps>;
|
|
76
98
|
default: () => {};
|
|
77
99
|
};
|
|
78
100
|
label: StringConstructor;
|
|
79
101
|
labelWidth: {
|
|
80
|
-
readonly type:
|
|
102
|
+
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
81
103
|
readonly required: false;
|
|
82
104
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
83
105
|
__epPropKey: true;
|
|
84
106
|
};
|
|
85
107
|
rules: {
|
|
86
|
-
readonly type:
|
|
108
|
+
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>) | (((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils/typescript.mjs").Arrayable<import("element-plus").FormItemRule>)) | null)[], unknown, unknown>>;
|
|
87
109
|
readonly required: false;
|
|
88
110
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
89
111
|
__epPropKey: true;
|
|
90
112
|
};
|
|
91
113
|
error: StringConstructor;
|
|
92
114
|
validateStatus: {
|
|
93
|
-
readonly type:
|
|
115
|
+
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
|
|
94
116
|
readonly required: false;
|
|
95
117
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
96
118
|
__epPropKey: true;
|
|
@@ -102,4 +124,5 @@ export declare const props: {
|
|
|
102
124
|
export declare const emits: {
|
|
103
125
|
'update:editable': null;
|
|
104
126
|
'update:modelValue': null;
|
|
127
|
+
checked: (v: string) => string | true;
|
|
105
128
|
};
|
|
@@ -27,6 +27,18 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
27
27
|
type: ObjectConstructor;
|
|
28
28
|
default: () => {};
|
|
29
29
|
};
|
|
30
|
+
showEditIcon: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
clickOutsideToClose: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
validate: {
|
|
39
|
+
type: import("vue").PropType<(text: string) => Promise<any>>;
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
30
42
|
required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
31
43
|
labelPosition: {
|
|
32
44
|
type: import("vue").PropType<"left" | "right" | "top" | "start" | "end">;
|
|
@@ -92,6 +104,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
92
104
|
showMessage: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
93
105
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
94
106
|
"update:modelValue": (...args: any[]) => void;
|
|
107
|
+
checked: (v: string) => void;
|
|
95
108
|
"update:editable": (...args: any[]) => void;
|
|
96
109
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
97
110
|
modelValue: null;
|
|
@@ -115,6 +128,18 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
115
128
|
type: ObjectConstructor;
|
|
116
129
|
default: () => {};
|
|
117
130
|
};
|
|
131
|
+
showEditIcon: {
|
|
132
|
+
type: BooleanConstructor;
|
|
133
|
+
default: boolean;
|
|
134
|
+
};
|
|
135
|
+
clickOutsideToClose: {
|
|
136
|
+
type: BooleanConstructor;
|
|
137
|
+
default: boolean;
|
|
138
|
+
};
|
|
139
|
+
validate: {
|
|
140
|
+
type: import("vue").PropType<(text: string) => Promise<any>>;
|
|
141
|
+
default: undefined;
|
|
142
|
+
};
|
|
118
143
|
required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
119
144
|
labelPosition: {
|
|
120
145
|
type: import("vue").PropType<"left" | "right" | "top" | "start" | "end">;
|
|
@@ -180,6 +205,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
180
205
|
showMessage: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
181
206
|
}>> & Readonly<{
|
|
182
207
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
208
|
+
onChecked?: ((v: string) => any) | undefined;
|
|
183
209
|
"onUpdate:editable"?: ((...args: any[]) => any) | undefined;
|
|
184
210
|
}>, {
|
|
185
211
|
required: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
@@ -195,9 +221,12 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
195
221
|
inlineMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
196
222
|
showMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
197
223
|
editable: boolean;
|
|
224
|
+
validate: (text: string) => Promise<any>;
|
|
198
225
|
edit: Record<string, any>;
|
|
199
226
|
iconSize: number;
|
|
200
227
|
textProps: Record<string, any>;
|
|
228
|
+
showEditIcon: boolean;
|
|
229
|
+
clickOutsideToClose: boolean;
|
|
201
230
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
202
231
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
203
232
|
declare const _default: typeof __VLS_export;
|