@vunk/form 2.19.20 → 2.19.22

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.
Files changed (197) hide show
  1. package/components/ai-provider/index.cjs +1 -0
  2. package/components/ai-provider/index.d.ts +7 -0
  3. package/components/ai-provider/index.mjs +61 -0
  4. package/components/ai-provider/src/ctx.d.ts +8 -0
  5. package/components/ai-provider/src/index.vue.d.ts +23 -0
  6. package/components/ai-provider/src/types.d.ts +56 -0
  7. package/components/ai-provider/src/use.d.ts +3 -0
  8. package/components/api-tables-select/index.cjs +1 -1
  9. package/components/api-tables-select/index.mjs +1 -1
  10. package/components/api-tables-select/src/ctx.d.ts +57 -57
  11. package/components/api-tables-select/src/index.vue.d.ts +46 -419
  12. package/components/button/index.cjs +1 -1
  13. package/components/button/index.mjs +12 -12
  14. package/components/button/src/ctx.d.ts +7 -2
  15. package/components/button/src/index.vue.d.ts +36 -14
  16. package/components/card-input-collection/index.cjs +1 -1
  17. package/components/card-input-collection/index.mjs +136 -141
  18. package/components/card-input-collection/src/core.vue.d.ts +18 -7
  19. package/components/card-input-collection/src/ctx.d.ts +7 -2
  20. package/components/card-input-collection/src/index.vue.d.ts +18 -7
  21. package/components/cascader/index.cjs +1 -1
  22. package/components/cascader/index.mjs +38 -39
  23. package/components/cascader/src/ctx.d.ts +8 -3
  24. package/components/cascader/src/index.vue.d.ts +19 -8
  25. package/components/checkbox/src/ctx.d.ts +8 -3
  26. package/components/checkbox/src/index.vue.d.ts +43 -21
  27. package/components/{cloneDeep-DE0l40hv.mjs → cloneDeep-2YeQ7w2t.mjs} +10 -10
  28. package/components/cloneDeep-Btpy0oPF.js +1 -0
  29. package/components/collapse/index.cjs +1 -1
  30. package/components/collapse/index.mjs +19 -22
  31. package/components/collapse-item/index.cjs +1 -1
  32. package/components/collapse-item/index.mjs +21 -21
  33. package/components/collapse-item/src/index.vue.d.ts +2 -2
  34. package/components/color-picker/index.cjs +1 -1
  35. package/components/color-picker/index.mjs +26 -27
  36. package/components/color-picker/src/ctx.d.ts +7 -2
  37. package/components/color-picker/src/index.vue.d.ts +17 -6
  38. package/components/{style.css → components.css} +1 -1
  39. package/components/date-picker/index.cjs +1 -1
  40. package/components/date-picker/index.mjs +40 -41
  41. package/components/date-picker/src/ctx.d.ts +8 -3
  42. package/components/date-picker/src/index.vue.d.ts +17 -6
  43. package/components/date-picker-range/index.cjs +1 -1
  44. package/components/date-picker-range/index.mjs +17 -17
  45. package/components/date-picker-range/src/ctx.d.ts +14 -9
  46. package/components/date-picker-range/src/index.vue.d.ts +48 -26
  47. package/components/dialog/index.cjs +1 -1
  48. package/components/dialog/index.mjs +41 -52
  49. package/components/dialog/src/ctx.d.ts +1 -1
  50. package/components/dialog/src/index.vue.d.ts +1 -1
  51. package/components/dialog-input-collection/index.cjs +1 -1
  52. package/components/dialog-input-collection/index.mjs +124 -122
  53. package/components/dialog-input-collection/src/ctx.d.ts +7 -2
  54. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +1 -1
  55. package/components/dialog-input-collection/src/index.vue.d.ts +17 -6
  56. package/components/download-plus/index.cjs +1 -1
  57. package/components/download-plus/index.mjs +193 -202
  58. package/components/download-plus/src/ctx.d.ts +7 -2
  59. package/components/download-plus/src/index.vue.d.ts +32 -10
  60. package/components/editable-text/index.cjs +1 -1
  61. package/components/editable-text/index.mjs +72 -75
  62. package/components/editable-text/src/ctx.d.ts +7 -2
  63. package/components/editable-text/src/index.vue.d.ts +18 -7
  64. package/components/el-slider/index.cjs +1 -1
  65. package/components/el-slider/index.mjs +230 -233
  66. package/components/el-slider/src/composables/index.cjs +1 -1
  67. package/components/el-slider/src/composables/index.mjs +1 -1
  68. package/components/el-slider/src/slider-core.vue.d.ts +3 -3
  69. package/components/esri-input-geojson/index.cjs +1 -5
  70. package/components/esri-input-geojson/index.mjs +59 -68
  71. package/components/esri-input-geojson/src/append.vue.d.ts +2 -2
  72. package/components/esri-input-geojson/src/ctx.d.ts +9 -4
  73. package/components/esri-input-geojson/src/index.vue.d.ts +65 -30
  74. package/components/fieldset/src/index.vue.d.ts +1 -1
  75. package/components/form/index.cjs +1 -1
  76. package/components/form/index.mjs +96 -101
  77. package/components/form/src/ctx.d.ts +2 -2
  78. package/components/form/src/index.vue.d.ts +4 -4
  79. package/components/form/src/use.d.ts +2 -2
  80. package/components/form-item/index.cjs +1 -1
  81. package/components/form-item/index.mjs +179 -107
  82. package/components/form-item/src/core.vue.d.ts +7 -3
  83. package/components/form-item/src/ctx.d.ts +7 -1
  84. package/components/form-item/src/index.vue.d.ts +13 -2
  85. package/components/form-item/src/use.d.ts +11 -0
  86. package/components/form-item-renderer/index.cjs +1 -1
  87. package/components/form-item-renderer/index.d.ts +1 -0
  88. package/components/form-item-renderer/index.mjs +85 -78
  89. package/components/form-item-renderer/src/use.d.ts +3 -0
  90. package/components/forms-provider/index.cjs +1 -1
  91. package/components/forms-provider/index.mjs +18 -21
  92. package/components/index-BIo_4rr_.mjs +18620 -0
  93. package/components/index-Bc7UifHG.js +1 -0
  94. package/components/index-D0D9ABpH.js +108 -0
  95. package/components/{index-CeHbpfCD.mjs → index-DCNYT7Wv.mjs} +0 -1
  96. package/components/information-collection/index.cjs +1 -1
  97. package/components/information-collection/index.mjs +32 -38
  98. package/components/information-collection/src/ctx.d.ts +7 -2
  99. package/components/information-collection/src/index.vue.d.ts +17 -6
  100. package/components/information-tag/index.cjs +1 -1
  101. package/components/information-tag/index.mjs +9 -12
  102. package/components/information-tag/src/index.vue.d.ts +1 -1
  103. package/components/input/index.cjs +1 -1
  104. package/components/input/index.mjs +27 -27
  105. package/components/input/src/ctx.d.ts +9 -4
  106. package/components/input/src/index.vue.d.ts +35 -13
  107. package/components/input-array/index.cjs +1 -1
  108. package/components/input-array/index.mjs +71 -74
  109. package/components/input-array/src/ctx.d.ts +7 -2
  110. package/components/input-array/src/index.vue.d.ts +18 -7
  111. package/components/input-collection/index.cjs +1 -1
  112. package/components/input-collection/index.mjs +121 -126
  113. package/components/input-collection/src/core.vue.d.ts +17 -6
  114. package/components/input-collection/src/ctx.d.ts +7 -2
  115. package/components/input-collection/src/index.vue.d.ts +17 -6
  116. package/components/input-file/src/index.vue.d.ts +19 -8
  117. package/components/input-link/index.cjs +1 -1
  118. package/components/input-link/index.mjs +1 -1
  119. package/components/input-link/src/ctx.d.ts +7 -2
  120. package/components/input-link/src/index.vue.d.ts +54 -21
  121. package/components/input-number/index.cjs +1 -1
  122. package/components/input-number/index.mjs +30 -33
  123. package/components/input-number/src/ctx.d.ts +8 -3
  124. package/components/input-number/src/index.vue.d.ts +33 -11
  125. package/components/input-tag/index.cjs +1 -1
  126. package/components/input-tag/index.mjs +24 -24
  127. package/components/input-tag/src/ctx.d.ts +9 -4
  128. package/components/input-tag/src/index.vue.d.ts +33 -11
  129. package/components/monaco-editor/src/ctx.d.ts +8 -3
  130. package/components/monaco-editor/src/index.vue.d.ts +38 -16
  131. package/components/radio/src/ctx.d.ts +7 -2
  132. package/components/radio/src/index.vue.d.ts +40 -18
  133. package/components/radio/src/wraper.vue.d.ts +22 -11
  134. package/components/renderer-data/index.cjs +1 -1
  135. package/components/renderer-data/index.mjs +14 -17
  136. package/components/select/index.cjs +1 -1
  137. package/components/select/index.mjs +167 -131
  138. package/components/select/src/core.vue.d.ts +96 -69
  139. package/components/select/src/ctx.d.ts +9 -4
  140. package/components/select/src/index.vue.d.ts +53 -42
  141. package/components/slider/index.cjs +1 -1
  142. package/components/slider/index.mjs +30 -31
  143. package/components/slider/src/ctx.d.ts +7 -2
  144. package/components/slider/src/index.vue.d.ts +18 -7
  145. package/components/switch/src/ctx.d.ts +7 -2
  146. package/components/switch/src/index.vue.d.ts +18 -7
  147. package/components/tables-select/index.cjs +1 -1
  148. package/components/tables-select/index.mjs +4 -4
  149. package/components/tables-select/src/ctx.d.ts +68 -68
  150. package/components/tables-select/src/index.vue.d.ts +52 -420
  151. package/components/template-instances-provider/index.cjs +1 -1
  152. package/components/template-instances-provider/index.mjs +11 -17
  153. package/components/templates-default/src/index.vue.d.ts +404 -185
  154. package/components/templates-esri/src/index.vue.d.ts +65 -30
  155. package/components/templates-variant/src/index.vue.d.ts +48 -26
  156. package/components/time-picker/index.cjs +1 -1
  157. package/components/time-picker/index.mjs +38 -39
  158. package/components/time-picker/src/ctx.d.ts +8 -3
  159. package/components/time-picker/src/index.vue.d.ts +17 -6
  160. package/components/upload/index.cjs +1 -1
  161. package/components/upload/index.mjs +244 -253
  162. package/components/upload/src/ctx.d.ts +8 -3
  163. package/components/upload/src/file.vue.d.ts +3 -3
  164. package/components/upload/src/index.vue.d.ts +37 -15
  165. package/components/upload/src/wraper.vue.d.ts +19 -8
  166. package/components/upload-plus/index.cjs +7 -15
  167. package/components/upload-plus/index.mjs +1879 -1897
  168. package/components/upload-plus/src/ctx.d.ts +7 -2
  169. package/components/upload-plus/src/index.vue.d.ts +18 -7
  170. package/components/use-watch-C3iIa2DX.js +1 -0
  171. package/components/use-watch-Dp64x0si.mjs +411 -0
  172. package/components/van-cascader/src/ctx.d.ts +7 -2
  173. package/components/van-cascader/src/index.vue.d.ts +19 -8
  174. package/components/var-datetime-picker/src/ctx.d.ts +7 -2
  175. package/components/var-datetime-picker/src/index.vue.d.ts +30 -8
  176. package/components/vditor/src/ctx.d.ts +7 -2
  177. package/components/vditor/src/index.vue.d.ts +41 -19
  178. package/composables/element-plus/index.cjs +1 -1
  179. package/composables/element-plus/index.mjs +10 -10
  180. package/composables/form-mitt/index.mjs +1 -1
  181. package/composables/index.cjs +1 -1
  182. package/composables/index.mjs +53 -53
  183. package/index.css +1 -1
  184. package/locale/index.cjs +1 -1
  185. package/locale/index.mjs +8 -5
  186. package/locale/lang/ar.d.ts +1 -0
  187. package/locale/lang/en.d.ts +1 -0
  188. package/locale/lang/zh-cn.d.ts +1 -0
  189. package/package.json +9 -1
  190. package/shared/element-plus/ctx.d.ts +16 -16
  191. package/shared/types/source/index.d.ts +5 -0
  192. package/shared/upload/index.cjs +1 -1
  193. package/shared/upload/index.mjs +166 -165
  194. package/components/cloneDeep-DaYwfXwD.js +0 -1
  195. package/components/index-BBriTmQP.js +0 -1
  196. package/components/use-watch-Bfrz9pv_.js +0 -1
  197. package/components/use-watch-t49wP7jy.mjs +0 -414
@@ -1 +1 @@
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
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../index-Bc7UifHG.js"),k=require("@vunk/core"),N=require("@vunk/form/components/form-item"),P=require("@vunk/form/components/information-renderer"),E=require("@vunk/form/composables"),I=require("@vunk/form/composables/element-plus"),A=require("@vunk/plus/components/avatar"),R=require("@vunk/plus/components/table-columns"),y=require("@vunk/shared/enum"),B=require("@vunk/shared/function"),p=require("element-plus"),w=require("@vunk/core/composables"),j=require("@vunk/form/components/form"),U=require("@vunk/form/shared/form"),O=require("@vunk/form/components/forms-provider"),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"),C=require("../cloneDeep-Btpy0oPF.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:U.validateCatch},formdata:null},emits:["update:modelValue","update:visible","change","update:formdata"],setup(i,{emit:m}){const a=i,n=m,{tr:d}=I.useLocale(),c=w.useModelComputed({key:"formdata",default:{}},a,n),f=w.useDeferred();f.promise.then(r=>{a.dialogFormProps.elRef?.(r)}),e.watch(()=>a.visible,r=>{a.openReset&&r&&(c.value={...a.modelValue},setTimeout(()=>{f.value?.clearValidate()}))});function g(){f.value?.validate().then(()=>{n("update:modelValue",c.value),n("change",c.value),n("update:visible",!1)}).catch(a.validateCatch)}return(r,s)=>{const b=e.resolveComponent("ElButton");return e.openBlock(),e.createBlock(e.unref(p.ElDialog),{"model-value":i.visible,"append-to-body":"","onUpdate:modelValue":s[2]||(s[2]=V=>r.$emit("update:visible",V))},{header:e.withCtx(()=>[e.renderSlot(r.$slots,"header")]),footer:e.withCtx(()=>[e.createVNode(b,{onClick:s[1]||(s[1]=V=>r.$emit("update:visible",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("el.messagebox.cancel","取消")),1)]),_:1}),e.createVNode(b,{type:"primary",onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("el.messagebox.confirm","确定")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(O.VkfFormsProvider),null,{default:e.withCtx(()=>[e.createVNode(e.unref(j.VkfForm),e.mergeProps(i.dialogFormProps,{"el-ref":e.unref(f).resolve,"form-items":i.formItems,data:e.unref(c),onSetData:s[0]||(s[0]=V=>e.unref(k.setData)(e.unref(c),V))}),null,16,["el-ref","form-items","data"])]),_:1})]),_:3},8,["model-value"])}}}),Q=e.defineComponent({__name:"layout",props:{data:{type:Object,default:()=>({})}},emits:["setData"],setup(i){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:i.data,onSetData:a[1]||(a[1]=n=>m.$emit("setData",n))},{default:e.withCtx(()=>[e.createVNode(e.unref(P.VkfInformationData),{data:i.data,onSetData:a[0]||(a[0]=n=>m.$emit("setData",n))},{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"},T=e.defineComponent({name:"VkfDialogInputCollection",inheritAttrs:!1,__name:"index",props:H,emits:J,setup(i,{emit:m}){const a=i,n=m,{tr:d}=I.useLocale(),c=p.ElTable,f=e.computed(()=>a.modules.includes("operations:add")),g=N._VkfFormItemCtx.createBindProps(a),r=E.useComputedReadonly(a),s=e.computed(()=>{if(!a.prop||a.prop.length===0)return a.modelValue;const t={};return k.ensetData(t,{k:a.prop,v:a.modelValue}),t}),b=e.computed(()=>a.columns.map(t=>{const o=Array.isArray(t.prop)?t.prop.join("."):t.prop;return{...t,prop:o,slots:u=>{const h={prop:[a.prop??[],u.$index,t.prop].flat(),readonly:r.value,templateType:t.templateType,templateProps:t.templateProps};return B.isCallable(t.templateProps)&&(h.templateProps=()=>t.templateProps(u.row)),e.createVNode(P.VkfInformationRenderer,{source:[{...h,...t.createTemplateProps?.(u,h)}]},null)}}})),V=e.computed(()=>({label:d("vkf.common.operations","操作"),align:"center",width:"85",hidden:r.value||!a.splicable,className:"vk-input-collection__buttons",slots:({$index:t})=>e.createVNode(e.Fragment,null,[f.value&&e.createVNode(p.ElButton,{size:"small",icon:v.plus_default,type:"primary",link:!0,onClick:()=>D(t)},null),e.createVNode(p.ElButton,{size:"small",icon:v.edit_default,type:"primary",link:!0,onClick:()=>F(t)},null),e.createVNode(p.ElPopconfirm,{title:d("vkf.dialogInputCollection.deleteConfirm","确定删除吗?"),onConfirm:()=>x(t),confirmButtonText:d("vkf.common.delete","删除"),cancelButtonText:d("el.popconfirm.cancelButtonText","取消")},{reference:()=>e.createVNode(p.ElButton,{size:"small",icon:v.delete_default,type:"danger",link:!0},null)})])})),S=e.computed(()=>[...b.value,V.value]),l=e.reactive({type:y.CRUD.create,index:0,data:{},dialogVisible:!1}),q=e.computed(()=>a.columns.map(t=>({label:t.label,readonly:r.value,prop:t.prop,templateType:t.templateType,templateProps:t.templateProps})));function x(t){const o=C.cloneDeep(a.modelValue);o.splice(t,1),n("update:modelValue",o)}function D(t){const o=B.isCallable(a.defaultItemValue)?a.defaultItemValue():a.defaultItemValue;l.index=t,l.data=C.cloneDeep(o),l.type=y.CRUD.create,l.dialogVisible=!0}function F(t){const o=a.modelValue[t];l.index=t,l.data=C.cloneDeep(o),l.type=y.CRUD.update,l.dialogVisible=!0}function _(t){const o=C.cloneDeep(a.modelValue);l.type===y.CRUD.create?o.splice(l.index+1,0,t):l.type===y.CRUD.update&&(o[l.index]=t),n("update:modelValue",o)}const $=t=>{console.warn("表单项正在直接修改 Data, 这在 dialog-input-collection 可能是一个意外操作",t);const o=C.cloneDeep(s.value);k.ensetData(o,t),n("update:modelValue",k.getValue(o,a.prop))};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Q,{data:s.value,onSetData:$},{default:e.withCtx(()=>[e.createVNode(e.unref(N.VkfFormItem),e.normalizeProps(e.guardReactiveProps({...e.unref(g),...t.$attrs})),e.createSlots({default:e.withCtx(()=>[!e.unref(r)&&t.splicable&&!t.labelActions?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(e.unref(p.ElButton),{type:"primary",onClick:o[1]||(o[1]=u=>D(-1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("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(R.VkTableColumns),{source:S.value},null,8,["source"])]),_:1},8,["data"])]),_:2},[t.labelActions?{name:"labelActions",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"labelActions"),!e.unref(r)&&t.splicable?(e.openBlock(),e.createBlock(e.unref(p.ElButton),{key:0,size:"small",icon:e.unref(v.plus_default),onClick:o[0]||(o[0]=u=>D(-1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(d)("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]=u=>l.dialogVisible=u),modelValue:l.data,"onUpdate:modelValue":o[3]||(o[3]=u=>l.data=u),formdata:t.formdata,"form-items":q.value,"dialog-form-props":t.dialogFormProps,"validate-catch":t.validateCatch,"onUpdate:formdata":o[4]||(o[4]=u=>t.$emit("update:formdata",u)),onChange:_},{header:e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(e.unref(A.VkAvatar),{icon:l.type===e.unref(y.CRUD).create?e.unref(v.plus_default):e.unref(v.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=T;exports.__VkfDialogInputCollection=Z;exports.default=T;
@@ -1,25 +1,26 @@
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 $, a as w, d as te } from "../index-CeHbpfCD.mjs";
3
- import { setData as ae, ensetData as z, getValue as oe } from "@vunk/core";
4
- import { _VkfFormItemCtx as U, VkfFormItem as le } from "@vunk/form/components/form-item";
5
- import { VkfInformationTemplates as re, VkfInformationData as ne, VkfInformationRenderer as ie } from "@vunk/form/components/information-renderer";
6
- import { useComputedReadonly as de } from "@vunk/form/composables";
7
- import { useLocale as M } from "@vunk/form/composables/element-plus";
8
- import { VkAvatar as se } from "@vunk/plus/components/avatar";
9
- import { VkTableColumns as pe } from "@vunk/plus/components/table-columns";
10
- import { CRUD as g } from "@vunk/shared/enum";
11
- import { isCallable as N } from "@vunk/shared/function";
12
- import { ElDialog as me, ElButton as k, ElPopconfirm as ue, ElTable as fe } from "element-plus";
13
- import { useModelComputed as ce, useDeferred as ve } from "@vunk/core/composables";
14
- import { VkfForm as ye } from "@vunk/form/components/form";
15
- import { validateCatch as Ve } from "@vunk/form/shared/form";
1
+ import { defineComponent as A, watch as K, resolveComponent as Q, openBlock as C, createBlock as S, unref as a, withCtx as r, createVNode as l, mergeProps as W, createTextVNode as I, toDisplayString as D, renderSlot as h, computed as V, Fragment as E, reactive as X, createElementBlock as _, normalizeProps as Y, guardReactiveProps as Z, createSlots as x, createCommentVNode as j, createElementVNode as O } from "vue";
2
+ import { p as $, a as R, d as ee } from "../index-DCNYT7Wv.mjs";
3
+ import { setData as te, ensetData as w, getValue as ae } from "@vunk/core";
4
+ import { _VkfFormItemCtx as N, VkfFormItem as oe } from "@vunk/form/components/form-item";
5
+ import { VkfInformationTemplates as le, VkfInformationData as re, VkfInformationRenderer as ne } from "@vunk/form/components/information-renderer";
6
+ import { useComputedReadonly as ie } from "@vunk/form/composables";
7
+ import { useLocale as U } from "@vunk/form/composables/element-plus";
8
+ import { VkAvatar as de } from "@vunk/plus/components/avatar";
9
+ import { VkTableColumns as se } from "@vunk/plus/components/table-columns";
10
+ import { CRUD as b } from "@vunk/shared/enum";
11
+ import { isCallable as z } from "@vunk/shared/function";
12
+ import { ElDialog as pe, ElButton as g, ElPopconfirm as me, ElTable as ue } from "element-plus";
13
+ import { useModelComputed as fe, useDeferred as ce } from "@vunk/core/composables";
14
+ import { VkfForm as ve } from "@vunk/form/components/form";
15
+ import { validateCatch as ye } from "@vunk/form/shared/form";
16
+ import { VkfFormsProvider as Ve } from "@vunk/form/components/forms-provider";
16
17
  import { VkfInformationTemplatesDefault as be } from "@vunk/form/components/information-templates-default";
17
18
  import { VkfRendererData as ge } from "@vunk/form/components/renderer-data";
18
19
  import { VkfTemplateInstancesProvider as ke } from "@vunk/form/components/template-instances-provider";
19
20
  import { VkfTemplatesDefault as Ce } from "@vunk/form/components/templates-default";
20
- import { c as C } from "../cloneDeep-DE0l40hv.mjs";
21
+ import { c as k } from "../cloneDeep-2YeQ7w2t.mjs";
21
22
  const De = {
22
- ...U.props,
23
+ ...N.props,
23
24
  columns: {
24
25
  type: Array,
25
26
  default: () => []
@@ -106,67 +107,69 @@ const De = {
106
107
  },
107
108
  validateCatch: {
108
109
  type: Function,
109
- default: Ve
110
+ default: ye
110
111
  },
111
112
  formdata: null
112
113
  },
113
114
  emits: ["update:modelValue", "update:visible", "change", "update:formdata"],
114
- setup(m, { emit: f }) {
115
- const t = m, s = f, { tr: u } = M(), c = ce({
115
+ setup(p, { emit: f }) {
116
+ const t = p, d = f, { tr: m } = U(), c = fe({
116
117
  key: "formdata",
117
118
  default: {}
118
- }, t, s), y = ve();
119
- y.promise.then((i) => {
120
- var d, v;
121
- (v = (d = t.dialogFormProps).elRef) == null || v.call(d, i);
122
- }), Q(() => t.visible, (i) => {
119
+ }, t, d), v = ce();
120
+ v.promise.then((i) => {
121
+ t.dialogFormProps.elRef?.(i);
122
+ }), K(() => t.visible, (i) => {
123
123
  t.openReset && i && (c.value = { ...t.modelValue }, setTimeout(() => {
124
- var d;
125
- (d = y.value) == null || d.clearValidate();
124
+ v.value?.clearValidate();
126
125
  }));
127
126
  });
128
127
  function T() {
129
- var i;
130
- (i = y.value) == null || i.validate().then(() => {
131
- s("update:modelValue", c.value), s("change", c.value), s("update:visible", !1);
128
+ v.value?.validate().then(() => {
129
+ d("update:modelValue", c.value), d("change", c.value), d("update:visible", !1);
132
130
  }).catch(t.validateCatch);
133
131
  }
134
- return (i, d) => {
135
- const v = W("ElButton");
136
- return D(), S(a(me), {
137
- "model-value": m.visible,
132
+ return (i, u) => {
133
+ const P = Q("ElButton");
134
+ return C(), S(a(pe), {
135
+ "model-value": p.visible,
138
136
  "append-to-body": "",
139
- "onUpdate:modelValue": d[2] || (d[2] = (V) => i.$emit("update:visible", V))
137
+ "onUpdate:modelValue": u[2] || (u[2] = (y) => i.$emit("update:visible", y))
140
138
  }, {
141
139
  header: r(() => [
142
140
  h(i.$slots, "header")
143
141
  ]),
144
142
  footer: r(() => [
145
- l(v, {
146
- onClick: d[1] || (d[1] = (V) => i.$emit("update:visible", !1))
143
+ l(P, {
144
+ onClick: u[1] || (u[1] = (y) => i.$emit("update:visible", !1))
147
145
  }, {
148
146
  default: r(() => [
149
- I(P(a(u)("el.messagebox.cancel", "取消")), 1)
147
+ I(D(a(m)("el.messagebox.cancel", "取消")), 1)
150
148
  ]),
151
149
  _: 1
152
150
  }),
153
- l(v, {
151
+ l(P, {
154
152
  type: "primary",
155
153
  onClick: T
156
154
  }, {
157
155
  default: r(() => [
158
- I(P(a(u)("el.messagebox.confirm", "确定")), 1)
156
+ I(D(a(m)("el.messagebox.confirm", "确定")), 1)
159
157
  ]),
160
158
  _: 1
161
159
  })
162
160
  ]),
163
161
  default: r(() => [
164
- l(a(ye), X(m.dialogFormProps, {
165
- "el-ref": a(y).resolve,
166
- "form-items": m.formItems,
167
- data: a(c),
168
- onSetData: d[0] || (d[0] = (V) => a(ae)(a(c), V))
169
- }), null, 16, ["el-ref", "form-items", "data"])
162
+ l(a(Ve), null, {
163
+ default: r(() => [
164
+ l(a(ve), W(p.dialogFormProps, {
165
+ "el-ref": a(v).resolve,
166
+ "form-items": p.formItems,
167
+ data: a(c),
168
+ onSetData: u[0] || (u[0] = (y) => a(te)(a(c), y))
169
+ }), null, 16, ["el-ref", "form-items", "data"])
170
+ ]),
171
+ _: 1
172
+ })
170
173
  ]),
171
174
  _: 3
172
175
  }, 8, ["model-value"]);
@@ -181,25 +184,25 @@ const De = {
181
184
  }
182
185
  },
183
186
  emits: ["setData"],
184
- setup(m) {
185
- return (f, t) => (D(), S(a(ke), null, {
187
+ setup(p) {
188
+ return (f, t) => (C(), S(a(ke), null, {
186
189
  placeholder: r(() => [
187
190
  l(a(Ce))
188
191
  ]),
189
192
  default: r(() => [
190
- l(a(re), null, {
193
+ l(a(le), null, {
191
194
  placeholder: r(() => [
192
195
  l(a(be))
193
196
  ]),
194
197
  default: r(() => [
195
198
  l(a(ge), {
196
- data: m.data,
197
- onSetData: t[1] || (t[1] = (s) => f.$emit("setData", s))
199
+ data: p.data,
200
+ onSetData: t[1] || (t[1] = (d) => f.$emit("setData", d))
198
201
  }, {
199
202
  default: r(() => [
200
- l(a(ne), {
201
- data: m.data,
202
- onSetData: t[0] || (t[0] = (s) => f.$emit("setData", s))
203
+ l(a(re), {
204
+ data: p.data,
205
+ onSetData: t[0] || (t[0] = (d) => f.$emit("setData", d))
203
206
  }, {
204
207
  default: r(() => [
205
208
  h(f.$slots, "default")
@@ -223,174 +226,173 @@ const De = {
223
226
  class: "vkf-dialog-input-collection__dialog-header"
224
227
  }, Fe = {
225
228
  class: "vkf-dialog-input-collection__dialog-title"
226
- }, Xe = /* @__PURE__ */ A({
229
+ }, Ye = /* @__PURE__ */ A({
227
230
  name: "VkfDialogInputCollection",
228
231
  inheritAttrs: !1,
229
232
  __name: "index",
230
233
  props: De,
231
234
  emits: Pe,
232
- setup(m, {
235
+ setup(p, {
233
236
  emit: f
234
237
  }) {
235
- const t = m, s = f, {
236
- tr: u
237
- } = M(), c = fe, y = b(() => t.modules.includes("operations:add")), T = U.createBindProps(t), i = de(t), d = b(() => {
238
+ const t = p, d = f, {
239
+ tr: m
240
+ } = U(), c = ue, v = V(() => t.modules.includes("operations:add")), T = N.createBindProps(t), i = ie(t), u = V(() => {
238
241
  if (!t.prop || t.prop.length === 0)
239
242
  return t.modelValue;
240
243
  const e = {};
241
- return z(e, {
244
+ return w(e, {
242
245
  k: t.prop,
243
246
  v: t.modelValue
244
247
  }), e;
245
- }), v = b(() => t.columns.map((e) => {
248
+ }), P = V(() => t.columns.map((e) => {
246
249
  const o = Array.isArray(e.prop) ? e.prop.join(".") : e.prop;
247
250
  return {
248
251
  ...e,
249
252
  prop: o,
250
- slots: (p) => {
251
- var E;
253
+ slots: (s) => {
252
254
  const F = {
253
- prop: [t.prop ?? [], p.$index, e.prop].flat(),
255
+ prop: [t.prop ?? [], s.$index, e.prop].flat(),
254
256
  readonly: i.value,
255
257
  templateType: e.templateType,
256
258
  templateProps: e.templateProps
257
259
  };
258
- return N(e.templateProps) && (F.templateProps = () => e.templateProps(p.row)), l(ie, {
260
+ return z(e.templateProps) && (F.templateProps = () => e.templateProps(s.row)), l(ne, {
259
261
  source: [{
260
262
  ...F,
261
- ...(E = e.createTemplateProps) == null ? void 0 : E.call(e, p, F)
263
+ ...e.createTemplateProps?.(s, F)
262
264
  }]
263
265
  }, null);
264
266
  }
265
267
  };
266
- })), V = b(() => ({
267
- label: u("vkf.common.operations", "操作"),
268
+ })), y = V(() => ({
269
+ label: m("vkf.common.operations", "操作"),
268
270
  align: "center",
269
271
  width: "85",
270
272
  hidden: i.value || !t.splicable,
271
273
  className: "vk-input-collection__buttons",
272
274
  slots: ({
273
275
  $index: e
274
- }) => l(j, null, [y.value && l(k, {
276
+ }) => l(E, null, [v.value && l(g, {
275
277
  size: "small",
276
278
  icon: $,
277
279
  type: "primary",
278
280
  link: !0,
279
281
  onClick: () => B(e)
280
- }, null), l(k, {
282
+ }, null), l(g, {
281
283
  size: "small",
282
- icon: w,
284
+ icon: R,
283
285
  type: "primary",
284
286
  link: !0,
285
- onClick: () => H(e)
286
- }, null), l(ue, {
287
- title: u("vkf.dialogInputCollection.deleteConfirm", "确定删除吗?"),
288
- onConfirm: () => G(e),
289
- confirmButtonText: u("vkf.common.delete", "删除"),
290
- cancelButtonText: u("el.popconfirm.cancelButtonText", "取消")
287
+ onClick: () => G(e)
288
+ }, null), l(me, {
289
+ title: m("vkf.dialogInputCollection.deleteConfirm", "确定删除吗?"),
290
+ onConfirm: () => q(e),
291
+ confirmButtonText: m("vkf.common.delete", "删除"),
292
+ cancelButtonText: m("el.popconfirm.cancelButtonText", "取消")
291
293
  }, {
292
- reference: () => l(k, {
294
+ reference: () => l(g, {
293
295
  size: "small",
294
- icon: te,
296
+ icon: ee,
295
297
  type: "danger",
296
298
  link: !0
297
299
  }, null)
298
300
  })])
299
- })), L = b(() => [...v.value, V.value]), n = Y({
300
- type: g.create,
301
+ })), M = V(() => [...P.value, y.value]), n = X({
302
+ type: b.create,
301
303
  index: 0,
302
304
  // 新增时,表示在哪条点击的 +
303
305
  data: {},
304
306
  dialogVisible: !1
305
- }), q = b(() => t.columns.map((e) => ({
307
+ }), L = V(() => t.columns.map((e) => ({
306
308
  label: e.label,
307
309
  readonly: i.value,
308
310
  prop: e.prop,
309
311
  templateType: e.templateType,
310
312
  templateProps: e.templateProps
311
313
  })));
312
- function G(e) {
313
- const o = C(t.modelValue);
314
- o.splice(e, 1), s("update:modelValue", o);
314
+ function q(e) {
315
+ const o = k(t.modelValue);
316
+ o.splice(e, 1), d("update:modelValue", o);
315
317
  }
316
318
  function B(e) {
317
- const o = N(t.defaultItemValue) ? t.defaultItemValue() : t.defaultItemValue;
318
- n.index = e, n.data = C(o), n.type = g.create, n.dialogVisible = !0;
319
+ const o = z(t.defaultItemValue) ? t.defaultItemValue() : t.defaultItemValue;
320
+ n.index = e, n.data = k(o), n.type = b.create, n.dialogVisible = !0;
319
321
  }
320
- function H(e) {
322
+ function G(e) {
321
323
  const o = t.modelValue[e];
322
- n.index = e, n.data = C(o), n.type = g.update, n.dialogVisible = !0;
324
+ n.index = e, n.data = k(o), n.type = b.update, n.dialogVisible = !0;
323
325
  }
324
- function J(e) {
325
- const o = C(t.modelValue);
326
- n.type === g.create ? o.splice(n.index + 1, 0, e) : n.type === g.update && (o[n.index] = e), s("update:modelValue", o);
326
+ function H(e) {
327
+ const o = k(t.modelValue);
328
+ n.type === b.create ? o.splice(n.index + 1, 0, e) : n.type === b.update && (o[n.index] = e), d("update:modelValue", o);
327
329
  }
328
- const K = (e) => {
330
+ const J = (e) => {
329
331
  console.warn("表单项正在直接修改 Data, 这在 dialog-input-collection 可能是一个意外操作", e);
330
- const o = C(d.value);
331
- z(o, e), s("update:modelValue", oe(o, t.prop));
332
+ const o = k(u.value);
333
+ w(o, e), d("update:modelValue", ae(o, t.prop));
332
334
  };
333
- return (e, o) => (D(), _(j, null, [l(he, {
334
- data: d.value,
335
- onSetData: K
335
+ return (e, o) => (C(), _(E, null, [l(he, {
336
+ data: u.value,
337
+ onSetData: J
336
338
  }, {
337
- default: r(() => [l(a(le), Z(x({
339
+ default: r(() => [l(a(oe), Y(Z({
338
340
  ...a(T),
339
341
  ...e.$attrs
340
- })), ee({
341
- default: r(() => [!a(i) && e.splicable && !e.labelActions ? (D(), _("div", Te, [l(a(k), {
342
+ })), x({
343
+ default: r(() => [!a(i) && e.splicable && !e.labelActions ? (C(), _("div", Te, [l(a(g), {
342
344
  type: "primary",
343
- onClick: o[1] || (o[1] = (p) => B(-1))
345
+ onClick: o[1] || (o[1] = (s) => B(-1))
344
346
  }, {
345
- default: r(() => [I(P(a(u)("vkf.common.add", "添加")), 1)]),
347
+ default: r(() => [I(D(a(m)("vkf.common.add", "添加")), 1)]),
346
348
  _: 1
347
- })])) : O("", !0), l(a(c), {
349
+ })])) : j("", !0), l(a(c), {
348
350
  data: e.modelValue,
349
351
  class: "vkf-dialog-input-collection-table"
350
352
  }, {
351
- default: r(() => [l(a(pe), {
352
- source: L.value
353
+ default: r(() => [l(a(se), {
354
+ source: M.value
353
355
  }, null, 8, ["source"])]),
354
356
  _: 1
355
357
  }, 8, ["data"])]),
356
358
  _: 2
357
359
  }, [e.labelActions ? {
358
360
  name: "labelActions",
359
- fn: r(() => [h(e.$slots, "labelActions"), !a(i) && e.splicable ? (D(), S(a(k), {
361
+ fn: r(() => [h(e.$slots, "labelActions"), !a(i) && e.splicable ? (C(), S(a(g), {
360
362
  key: 0,
361
363
  size: "small",
362
364
  icon: a($),
363
- onClick: o[0] || (o[0] = (p) => B(-1))
365
+ onClick: o[0] || (o[0] = (s) => B(-1))
364
366
  }, {
365
- default: r(() => [I(P(a(u)("vkf.common.add", "添加")), 1)]),
367
+ default: r(() => [I(D(a(m)("vkf.common.add", "添加")), 1)]),
366
368
  _: 1
367
- }, 8, ["icon"])) : O("", !0)]),
369
+ }, 8, ["icon"])) : j("", !0)]),
368
370
  key: "0"
369
371
  } : void 0]), 1040), l(Ie, {
370
372
  visible: n.dialogVisible,
371
- "onUpdate:visible": o[2] || (o[2] = (p) => n.dialogVisible = p),
373
+ "onUpdate:visible": o[2] || (o[2] = (s) => n.dialogVisible = s),
372
374
  modelValue: n.data,
373
- "onUpdate:modelValue": o[3] || (o[3] = (p) => n.data = p),
375
+ "onUpdate:modelValue": o[3] || (o[3] = (s) => n.data = s),
374
376
  formdata: e.formdata,
375
- "form-items": q.value,
377
+ "form-items": L.value,
376
378
  "dialog-form-props": e.dialogFormProps,
377
379
  "validate-catch": e.validateCatch,
378
- "onUpdate:formdata": o[4] || (o[4] = (p) => e.$emit("update:formdata", p)),
379
- onChange: J
380
+ "onUpdate:formdata": o[4] || (o[4] = (s) => e.$emit("update:formdata", s)),
381
+ onChange: H
380
382
  }, {
381
- header: r(() => [R("div", Be, [l(a(se), {
382
- icon: n.type === a(g).create ? a($) : a(w)
383
- }, null, 8, ["icon"]), R("span", Fe, P(t.label), 1)])]),
383
+ header: r(() => [O("div", Be, [l(a(de), {
384
+ icon: n.type === a(b).create ? a($) : a(R)
385
+ }, null, 8, ["icon"]), O("span", Fe, D(t.label), 1)])]),
384
386
  _: 1
385
387
  }, 8, ["visible", "modelValue", "formdata", "form-items", "dialog-form-props", "validate-catch"])]),
386
388
  _: 3
387
389
  }, 8, ["data"]), h(e.$slots, "default")], 64));
388
390
  }
389
- }), Ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
391
+ }), Ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
390
392
  __proto__: null
391
393
  }, Symbol.toStringTag, { value: "Module" }));
392
394
  export {
393
- Xe as VkfDialogInputCollection,
394
- Ye as __VkfDialogInputCollection,
395
- Xe as default
395
+ Ye as VkfDialogInputCollection,
396
+ Ze as __VkfDialogInputCollection,
397
+ Ye as default
396
398
  };
@@ -57,6 +57,8 @@ export declare const props: {
57
57
  default: undefined;
58
58
  };
59
59
  required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
60
+ error: StringConstructor;
61
+ prop: null;
60
62
  labelPosition: {
61
63
  type: PropType<"left" | "right" | "top" | "start" | "end">;
62
64
  default: undefined;
@@ -90,12 +92,16 @@ export declare const props: {
90
92
  type: BooleanConstructor;
91
93
  default: boolean;
92
94
  };
93
- prop: null;
94
95
  defaultModelValue: null;
95
96
  labelTipProps: {
96
97
  type: PropType<import("element-plus").UseTooltipProps>;
97
98
  default: () => {};
98
99
  };
100
+ ai: {
101
+ type: PropType<import("../../ai-provider").AiConfig>;
102
+ default: undefined;
103
+ };
104
+ aiOutput: null;
99
105
  label: StringConstructor;
100
106
  labelWidth: {
101
107
  readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
@@ -109,7 +115,6 @@ export declare const props: {
109
115
  readonly validator: ((val: unknown) => boolean) | undefined;
110
116
  __epPropKey: true;
111
117
  };
112
- error: StringConstructor;
113
118
  validateStatus: {
114
119
  readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
115
120
  readonly required: false;
@@ -81,9 +81,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
81
81
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
82
82
  "onUpdate:formdata"?: ((...args: any[]) => any) | undefined;
83
83
  }>, {
84
+ title: string;
84
85
  visible: boolean;
85
86
  modelValue: Record<string, any>;
86
- title: string;
87
87
  formItems: unknown[];
88
88
  dialogFormProps: Record<string, any>;
89
89
  validateCatch: AnyFunc;
@@ -46,6 +46,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
46
46
  default: undefined;
47
47
  };
48
48
  required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
49
+ error: StringConstructor;
50
+ prop: null;
49
51
  labelPosition: {
50
52
  type: import("vue").PropType<"left" | "right" | "top" | "start" | "end">;
51
53
  default: undefined;
@@ -79,12 +81,16 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
79
81
  type: BooleanConstructor;
80
82
  default: boolean;
81
83
  };
82
- prop: null;
83
84
  defaultModelValue: null;
84
85
  labelTipProps: {
85
86
  type: import("vue").PropType<import("element-plus").UseTooltipProps>;
86
87
  default: () => {};
87
88
  };
89
+ ai: {
90
+ type: import("vue").PropType<import("../../ai-provider/index.ts").AiConfig>;
91
+ default: undefined;
92
+ };
93
+ aiOutput: null;
88
94
  label: StringConstructor;
89
95
  labelWidth: {
90
96
  readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
@@ -98,7 +104,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
98
104
  readonly validator: ((val: unknown) => boolean) | undefined;
99
105
  __epPropKey: true;
100
106
  };
101
- error: StringConstructor;
102
107
  validateStatus: {
103
108
  readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
104
109
  readonly required: false;
@@ -152,6 +157,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
152
157
  default: undefined;
153
158
  };
154
159
  required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
160
+ error: StringConstructor;
161
+ prop: null;
155
162
  labelPosition: {
156
163
  type: import("vue").PropType<"left" | "right" | "top" | "start" | "end">;
157
164
  default: undefined;
@@ -185,12 +192,16 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
185
192
  type: BooleanConstructor;
186
193
  default: boolean;
187
194
  };
188
- prop: null;
189
195
  defaultModelValue: null;
190
196
  labelTipProps: {
191
197
  type: import("vue").PropType<import("element-plus").UseTooltipProps>;
192
198
  default: () => {};
193
199
  };
200
+ ai: {
201
+ type: import("vue").PropType<import("../../ai-provider/index.ts").AiConfig>;
202
+ default: undefined;
203
+ };
204
+ aiOutput: null;
194
205
  label: StringConstructor;
195
206
  labelWidth: {
196
207
  readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
@@ -204,7 +215,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
204
215
  readonly validator: ((val: unknown) => boolean) | undefined;
205
216
  __epPropKey: true;
206
217
  };
207
- error: StringConstructor;
208
218
  validateStatus: {
209
219
  readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
210
220
  readonly required: false;
@@ -219,8 +229,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
219
229
  "onUpdate:formdata"?: ((...args: any[]) => any) | undefined;
220
230
  }>, {
221
231
  required: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
222
- labelPosition: "left" | "right" | "top" | "start" | "end";
223
- formItemSize: "default" | "small" | "large";
232
+ labelPosition: "start" | "left" | "right" | "top" | "end";
233
+ formItemSize: "small" | "default" | "large";
224
234
  formItemSlots: import("../../form-item/src/types.ts").FormItemSlots;
225
235
  inline: boolean;
226
236
  readonly: boolean;
@@ -228,6 +238,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
228
238
  labelTip: string;
229
239
  information: boolean;
230
240
  labelTipProps: import("element-plus").UseTooltipProps;
241
+ ai: import("../../ai-provider/index.ts").AiConfig;
231
242
  inlineMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
232
243
  showMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
233
244
  modelValue: NormalObject[];