@vunk/form 2.18.2 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/components/_plugin-vue_export-helper.cjs +1 -11
  2. package/components/api-tables-select/index.cjs +1 -467
  3. package/components/api-tables-select/index.mjs +56 -413
  4. package/components/api-tables-select/src/ctx.d.ts +152 -172
  5. package/components/api-tables-select/src/index.vue.d.ts +394 -983
  6. package/components/button/index.cjs +1 -112
  7. package/components/button/index.mjs +57 -85
  8. package/components/button/src/ctx.d.ts +28 -113
  9. package/components/button/src/index.vue.d.ts +317 -625
  10. package/components/card-input-collection/index.cjs +1 -370
  11. package/components/card-input-collection/index.mjs +175 -277
  12. package/components/card-input-collection/src/core.vue.d.ts +54 -951
  13. package/components/card-input-collection/src/ctx.d.ts +19 -49
  14. package/components/card-input-collection/src/index.vue.d.ts +46 -110
  15. package/components/cascader/index.cjs +1 -150
  16. package/components/cascader/index.mjs +88 -116
  17. package/components/cascader/src/ctx.d.ts +140 -207
  18. package/components/cascader/src/index.vue.d.ts +315 -522
  19. package/components/cascader/src/use.d.ts +1 -1
  20. package/components/checkbox/index.cjs +1 -152
  21. package/components/checkbox/index.mjs +75 -119
  22. package/components/checkbox/src/ctx.d.ts +46 -69
  23. package/components/checkbox/src/index.vue.d.ts +448 -1016
  24. package/components/cloneDeep.cjs +1 -2106
  25. package/components/color-picker/index.cjs +1 -80
  26. package/components/color-picker/index.mjs +46 -69
  27. package/components/color-picker/src/ctx.d.ts +130 -107
  28. package/components/color-picker/src/index.vue.d.ts +285 -255
  29. package/components/date-picker/index.cjs +1 -119
  30. package/components/date-picker/index.mjs +63 -97
  31. package/components/date-picker/src/ctx.d.ts +123 -206
  32. package/components/date-picker/src/index.vue.d.ts +269 -1358
  33. package/components/date-picker/src/types.d.ts +7 -7
  34. package/components/date-picker-range/index.cjs +1 -177
  35. package/components/date-picker-range/index.mjs +62 -113
  36. package/components/date-picker-range/src/ctx.d.ts +130 -206
  37. package/components/date-picker-range/src/index.vue.d.ts +861 -448
  38. package/components/debounce.cjs +1 -0
  39. package/components/dialog/index.cjs +1 -126
  40. package/components/dialog/index.mjs +65 -99
  41. package/components/dialog/src/ctx.d.ts +17 -108
  42. package/components/dialog/src/index.vue.d.ts +77 -1072
  43. package/components/dialog-input-collection/index.cjs +1 -624
  44. package/components/dialog-input-collection/index.mjs +276 -498
  45. package/components/dialog-input-collection/src/ctx.d.ts +21 -52
  46. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +29 -6371
  47. package/components/dialog-input-collection/src/index.vue.d.ts +65 -7630
  48. package/components/dialog-input-collection/src/layout.vue.d.ts +13 -73
  49. package/components/download-plus/index.cjs +1 -456
  50. package/components/download-plus/index.mjs +215 -358
  51. package/components/download-plus/src/api.d.ts +1 -1
  52. package/components/download-plus/src/ctx.d.ts +21 -52
  53. package/components/download-plus/src/index.vue.d.ts +437 -1177
  54. package/components/editable-text/index.cjs +1 -295
  55. package/components/editable-text/index.mjs +113 -239
  56. package/components/editable-text/src/ctx.d.ts +24 -50
  57. package/components/editable-text/src/index.vue.d.ts +59 -3258
  58. package/components/el-slider/index.cjs +1 -0
  59. package/components/el-slider/index.d.ts +5 -0
  60. package/components/el-slider/index.mjs +475 -0
  61. package/components/el-slider/src/button.d.ts +36 -0
  62. package/components/el-slider/src/button.vue.d.ts +41 -0
  63. package/components/el-slider/src/composables/index.cjs +1 -0
  64. package/components/el-slider/src/composables/index.d.ts +6 -0
  65. package/components/el-slider/src/composables/index.mjs +9 -0
  66. package/components/el-slider/src/composables/use-lifecycle.d.ts +4 -0
  67. package/components/el-slider/src/composables/use-marks.d.ts +7 -0
  68. package/components/el-slider/src/composables/use-slide.d.ts +23 -0
  69. package/components/el-slider/src/composables/use-slider-button.d.ts +18 -0
  70. package/components/el-slider/src/composables/use-stops.d.ts +8 -0
  71. package/components/el-slider/src/composables/use-watch.d.ts +4 -0
  72. package/components/el-slider/src/constants.d.ts +14 -0
  73. package/components/el-slider/src/marker.d.ts +37 -0
  74. package/components/el-slider/src/slider-core.vue.d.ts +218 -0
  75. package/components/el-slider/src/slider.d.ts +174 -0
  76. package/components/esri-input-geojson/index.cjs +2 -1604
  77. package/components/esri-input-geojson/index.mjs +682 -1290
  78. package/components/esri-input-geojson/src/append.vue.d.ts +239 -1099
  79. package/components/esri-input-geojson/src/const.d.ts +1 -1
  80. package/components/esri-input-geojson/src/ctx.d.ts +66 -161
  81. package/components/esri-input-geojson/src/default-view.vue.d.ts +8 -132
  82. package/components/esri-input-geojson/src/index.vue.d.ts +982 -708
  83. package/components/esri-input-geojson/src/types.d.ts +1 -0
  84. package/components/esri-input-geojson/src/viewer.vue.d.ts +53 -282
  85. package/components/fieldset/index.cjs +1 -110
  86. package/components/fieldset/index.mjs +63 -76
  87. package/components/fieldset/src/ctx.d.ts +4 -4
  88. package/components/fieldset/src/index.vue.d.ts +7 -7
  89. package/components/form/index.cjs +1 -248
  90. package/components/form/index.mjs +107 -161
  91. package/components/form/src/ctx.d.ts +15 -64
  92. package/components/form/src/index.vue.d.ts +374 -2431
  93. package/components/form-item/index.cjs +1 -294
  94. package/components/form-item/index.mjs +140 -229
  95. package/components/form-item/src/core.vue.d.ts +32 -1854
  96. package/components/form-item/src/ctx.d.ts +19 -51
  97. package/components/form-item/src/index.vue.d.ts +38 -101
  98. package/components/form-item-renderer/index.cjs +1 -193
  99. package/components/form-item-renderer/index.mjs +103 -162
  100. package/components/form-item-renderer/src/core.vue.d.ts +9 -9
  101. package/components/form-item-renderer/src/ctx.d.ts +3 -3
  102. package/components/form-item-renderer/src/index.vue.d.ts +24 -74
  103. package/components/form-item-renderer-template/index.cjs +1 -47
  104. package/components/form-item-renderer-template/index.mjs +20 -33
  105. package/components/form-item-renderer-template/src/index.vue.d.ts +1 -1
  106. package/components/forms-provider/index.cjs +1 -99
  107. package/components/forms-provider/index.mjs +44 -73
  108. package/components/forms-provider/src/core.d.ts +3 -2
  109. package/components/forms-provider/src/segment.vue.d.ts +8 -8
  110. package/components/forms-provider/src/view.vue.d.ts +14 -4
  111. package/components/index.cjs +1 -399
  112. package/components/index2.cjs +1 -17
  113. package/components/information/index.cjs +1 -65
  114. package/components/information/index.mjs +28 -38
  115. package/components/information/src/ctx.d.ts +2 -2
  116. package/components/information/src/index.vue.d.ts +4 -4
  117. package/components/information-collection/index.cjs +1 -81
  118. package/components/information-collection/index.mjs +44 -48
  119. package/components/information-collection/src/ctx.d.ts +29 -65
  120. package/components/information-collection/src/index.vue.d.ts +64 -136
  121. package/components/information-renderer/index.cjs +1 -16
  122. package/components/information-renderer/index.d.ts +9 -9
  123. package/components/information-renderer/index.mjs +9 -10
  124. package/components/information-tag/index.cjs +1 -101
  125. package/components/information-tag/index.mjs +44 -54
  126. package/components/information-tag/src/ctx.d.ts +6 -21
  127. package/components/information-tag/src/index.vue.d.ts +23 -51
  128. package/components/information-templates-default/index.cjs +1 -101
  129. package/components/information-templates-default/index.mjs +63 -73
  130. package/components/information-templates-default/src/index.vue.d.ts +1 -1
  131. package/components/input/index.cjs +1 -115
  132. package/components/input/index.mjs +60 -83
  133. package/components/input/src/ctx.d.ts +51 -152
  134. package/components/input/src/index.vue.d.ts +392 -951
  135. package/components/input-array/index.cjs +1 -310
  136. package/components/input-array/index.mjs +114 -244
  137. package/components/input-array/src/ctx.d.ts +19 -49
  138. package/components/input-array/src/form-template.vue.d.ts +1 -901
  139. package/components/input-array/src/index.vue.d.ts +43 -730
  140. package/components/input-collection/index.cjs +1 -452
  141. package/components/input-collection/index.mjs +195 -355
  142. package/components/input-collection/src/core.vue.d.ts +64 -1026
  143. package/components/input-collection/src/ctx.d.ts +21 -51
  144. package/components/input-collection/src/index.vue.d.ts +50 -114
  145. package/components/input-file/index.cjs +1 -142
  146. package/components/input-file/index.mjs +68 -100
  147. package/components/input-file/src/ctx.d.ts +8 -29
  148. package/components/input-file/src/index.vue.d.ts +444 -74
  149. package/components/input-file/src/template.vue.d.ts +1 -124
  150. package/components/input-link/index.cjs +1 -167
  151. package/components/input-link/index.mjs +60 -83
  152. package/components/input-link/src/ctx.d.ts +52 -137
  153. package/components/input-link/src/index.vue.d.ts +833 -311
  154. package/components/input-number/index.cjs +1 -119
  155. package/components/input-number/index.mjs +73 -87
  156. package/components/input-number/src/ctx.d.ts +38 -131
  157. package/components/input-number/src/index.vue.d.ts +321 -683
  158. package/components/input-tag/index.cjs +1 -100
  159. package/components/input-tag/index.mjs +51 -78
  160. package/components/input-tag/src/ctx.d.ts +43 -145
  161. package/components/input-tag/src/index.vue.d.ts +324 -778
  162. package/components/isObject.cjs +1 -165
  163. package/components/monaco-editor/index.cjs +1 -83
  164. package/components/monaco-editor/index.mjs +40 -59
  165. package/components/monaco-editor/src/ctx.d.ts +19 -44
  166. package/components/monaco-editor/src/index.vue.d.ts +209 -109
  167. package/components/radio/index.cjs +1 -267
  168. package/components/radio/index.mjs +110 -209
  169. package/components/radio/src/ctx.d.ts +27 -91
  170. package/components/radio/src/index.vue.d.ts +298 -1279
  171. package/components/radio/src/option.vue.d.ts +29 -881
  172. package/components/radio/src/wraper.vue.d.ts +64 -196
  173. package/components/renderer-data/index.cjs +1 -41
  174. package/components/renderer-data/index.mjs +19 -26
  175. package/components/renderer-data/src/ctx.d.ts +1 -1
  176. package/components/renderer-data/src/index.vue.d.ts +2 -2
  177. package/components/select/index.cjs +1 -311
  178. package/components/select/index.mjs +156 -214
  179. package/components/select/src/core.vue.d.ts +638 -1080
  180. package/components/select/src/ctx.d.ts +140 -223
  181. package/components/select/src/index.vue.d.ts +334 -610
  182. package/components/select/src/options.vue.d.ts +1 -1
  183. package/components/slider/index.cjs +1 -88
  184. package/components/slider/index.mjs +41 -70
  185. package/components/slider/src/ctx.d.ts +63 -174
  186. package/components/slider/src/index.vue.d.ts +151 -420
  187. package/components/style.css +1 -0
  188. package/components/switch/index.cjs +1 -88
  189. package/components/switch/index.mjs +37 -69
  190. package/components/switch/src/ctx.d.ts +34 -113
  191. package/components/switch/src/index.vue.d.ts +88 -699
  192. package/components/switch/src/types.d.ts +2 -2
  193. package/components/tables-select/index.cjs +1 -263
  194. package/components/tables-select/index.mjs +102 -172
  195. package/components/tables-select/src/ctx.d.ts +76 -91
  196. package/components/tables-select/src/index.vue.d.ts +228 -4969
  197. package/components/template-instances-provider/index.cjs +1 -31
  198. package/components/template-instances-provider/index.mjs +18 -22
  199. package/components/template-instances-provider/src/index.vue.d.ts +2 -2
  200. package/components/templates-default/index.cjs +1 -235
  201. package/components/templates-default/index.mjs +152 -211
  202. package/components/templates-default/src/ctx.d.ts +5 -3
  203. package/components/templates-default/src/index.vue.d.ts +7298 -157
  204. package/components/templates-element-plus/index.cjs +1 -112
  205. package/components/templates-element-plus/index.mjs +49 -91
  206. package/components/templates-element-plus/src/ctx.d.ts +1 -1
  207. package/components/templates-element-plus/src/index.vue.d.ts +65 -258
  208. package/components/templates-esri/index.cjs +1 -65
  209. package/components/templates-esri/index.mjs +29 -39
  210. package/components/templates-esri/src/ctx.d.ts +1 -1
  211. package/components/templates-esri/src/index.vue.d.ts +1776 -24
  212. package/components/templates-layout/index.cjs +1 -137
  213. package/components/templates-layout/index.mjs +78 -116
  214. package/components/templates-layout/src/ctx.d.ts +1 -1
  215. package/components/templates-layout/src/index.vue.d.ts +79 -411
  216. package/components/templates-variant/index.cjs +1 -70
  217. package/components/templates-variant/index.mjs +33 -43
  218. package/components/templates-variant/src/ctx.d.ts +1 -1
  219. package/components/templates-variant/src/index.vue.d.ts +1238 -24
  220. package/components/time-picker/index.cjs +1 -104
  221. package/components/time-picker/index.mjs +57 -87
  222. package/components/time-picker/src/ctx.d.ts +121 -211
  223. package/components/time-picker/src/index.vue.d.ts +263 -1368
  224. package/components/upload/index.cjs +1 -663
  225. package/components/upload/index.mjs +343 -537
  226. package/components/upload/src/ctx.d.ts +108 -195
  227. package/components/upload/src/file.vue.d.ts +197 -776
  228. package/components/upload/src/index.vue.d.ts +689 -1931
  229. package/components/upload/src/types.d.ts +1 -1
  230. package/components/upload/src/wraper.vue.d.ts +232 -407
  231. package/components/upload-plus/index.cjs +21 -18673
  232. package/components/upload-plus/index.mjs +4598 -18372
  233. package/components/upload-plus/src/api.d.ts +2 -2
  234. package/components/upload-plus/src/ctx.d.ts +24 -51
  235. package/components/upload-plus/src/index.vue.d.ts +51 -1656
  236. package/components/use-watch.cjs +1 -0
  237. package/components/van-cascader/index.cjs +1 -125
  238. package/components/van-cascader/index.mjs +51 -96
  239. package/components/van-cascader/src/ctx.d.ts +135 -203
  240. package/components/van-cascader/src/index.vue.d.ts +312 -985
  241. package/components/var-datetime-picker/index.cjs +1 -333
  242. package/components/var-datetime-picker/index.mjs +175 -254
  243. package/components/var-datetime-picker/src/ctx.d.ts +19 -50
  244. package/components/var-datetime-picker/src/index.vue.d.ts +688 -1115
  245. package/components/vditor/index.cjs +1 -86
  246. package/components/vditor/index.mjs +40 -66
  247. package/components/vditor/src/ctx.d.ts +16 -45
  248. package/components/vditor/src/index.vue.d.ts +195 -120
  249. package/composables/element-plus/index.cjs +1 -23
  250. package/composables/element-plus/index.mjs +14 -18
  251. package/composables/index.cjs +1 -161
  252. package/composables/index.d.ts +1 -0
  253. package/composables/index.mjs +102 -135
  254. package/composables/useForm.d.ts +2 -2
  255. package/composables/useRtl.d.ts +18 -0
  256. package/composables/useSourceManager.d.ts +2 -2
  257. package/composables/useTemplateInstances.d.ts +3 -3
  258. package/index.css +1 -562
  259. package/index.d.ts +0 -3
  260. package/index.esm.js +23 -48
  261. package/locale/index.cjs +1 -102
  262. package/locale/index.mjs +34 -34
  263. package/locale/lang/index.cjs +1 -2
  264. package/locale/lang/index.d.ts +1 -0
  265. package/package.json +14 -85
  266. package/shared/const/index.cjs +1 -59
  267. package/shared/const/index.d.ts +1 -1
  268. package/shared/const/index.mjs +18 -20
  269. package/shared/element-plus/ctx.d.ts +40 -37
  270. package/shared/element-plus/index.cjs +1 -211
  271. package/shared/element-plus/index.mjs +93 -161
  272. package/shared/element-plus/instances.d.ts +207 -321
  273. package/shared/form/index.cjs +1 -33
  274. package/shared/form/index.mjs +23 -25
  275. package/shared/helper/index.cjs +1 -11
  276. package/shared/helper/index.mjs +7 -8
  277. package/shared/index.cjs +1 -8
  278. package/shared/index.mjs +5 -1
  279. package/shared/infer-prop/index.cjs +1 -36
  280. package/shared/infer-prop/index.mjs +22 -28
  281. package/shared/progress-it/index.cjs +1 -42
  282. package/shared/progress-it/index.mjs +15 -31
  283. package/shared/rules/index.cjs +1 -56
  284. package/shared/rules/index.mjs +19 -18
  285. package/shared/types/form/index.cjs +1 -2
  286. package/shared/types/index.cjs +1 -2
  287. package/shared/types/source/index.cjs +1 -2
  288. package/shared/types/source-manager/index.cjs +1 -2
  289. package/shared/upload/index.cjs +1 -774
  290. package/shared/upload/index.mjs +180 -764
  291. package/component.d.ts +0 -3
  292. package/components/_plugin-vue_export-helper.mjs +0 -9
  293. package/components/card-input-collection/index.css +0 -21
  294. package/components/cascader/index.css +0 -9
  295. package/components/checkbox/index.css +0 -30
  296. package/components/cloneDeep.mjs +0 -2104
  297. package/components/date-picker-range/index.css +0 -18
  298. package/components/dialog-input-collection/index.css +0 -21
  299. package/components/download-plus/index.css +0 -68
  300. package/components/editable-text/index.css +0 -9
  301. package/components/esri-input-geojson/index.css +0 -32
  302. package/components/fieldset/index.css +0 -5
  303. package/components/form-item/index.css +0 -35
  304. package/components/index.mjs +0 -378
  305. package/components/index2.mjs +0 -14
  306. package/components/information-tag/index.css +0 -6
  307. package/components/information-templates-default/index.css +0 -16
  308. package/components/input-array/index.css +0 -14
  309. package/components/input-collection/index.css +0 -20
  310. package/components/input-link/index.css +0 -4
  311. package/components/input-number/index.css +0 -13
  312. package/components/isObject.mjs +0 -158
  313. package/components/monaco-editor/index.css +0 -4
  314. package/components/radio/index.css +0 -40
  315. package/components/select/index.css +0 -15
  316. package/components/switch/index.css +0 -10
  317. package/components/tables-select/index.css +0 -3
  318. package/components/templates-layout/index.css +0 -3
  319. package/components/upload/index.css +0 -34
  320. package/components/upload-plus/index.css +0 -84
  321. package/components/van-cascader/index.css +0 -6
  322. package/components/var-datetime-picker/index.css +0 -17
  323. package/defaults.d.ts +0 -5
@@ -1,624 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var vue = require('vue');
6
- var index = require('../index.cjs');
7
- var core = require('@vunk/core');
8
- var formItem = require('@vunk/form/components/form-item');
9
- var informationRenderer = require('@vunk/form/components/information-renderer');
10
- var composables$1 = require('@vunk/form/composables');
11
- var elementPlus = require('@vunk/form/composables/element-plus');
12
- var avatar = require('@vunk/plus/components/avatar');
13
- var tableColumns = require('@vunk/plus/components/table-columns');
14
- var _enum = require('@vunk/shared/enum');
15
- var _function = require('@vunk/shared/function');
16
- var elementPlus$1 = require('element-plus');
17
- var composables = require('@vunk/core/composables');
18
- var form$1 = require('@vunk/form/components/form');
19
- var form = require('@vunk/form/shared/form');
20
- var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
21
- var informationTemplatesDefault = require('@vunk/form/components/information-templates-default');
22
- var rendererData = require('@vunk/form/components/renderer-data');
23
- var templateInstancesProvider = require('@vunk/form/components/template-instances-provider');
24
- var templatesDefault = require('@vunk/form/components/templates-default');
25
- var cloneDeep = require('../cloneDeep.cjs');
26
- require('../isObject.cjs');
27
-
28
- const props = {
29
- ...formItem._VkfFormItemCtx.props,
30
- columns: {
31
- type: Array,
32
- default: () => []
33
- },
34
- /**
35
- * @description 表格数据 v-model
36
- */
37
- modelValue: {
38
- type: Array,
39
- default: () => []
40
- },
41
- readonly: {
42
- type: Boolean,
43
- default: void 0
44
- },
45
- /**
46
- * @description 是否可以splice
47
- */
48
- splicable: {
49
- type: Boolean,
50
- default: true
51
- },
52
- /**
53
- * @description 开启 form-item 的 label 上的操作区域, 在labelPosition为top时生效
54
- */
55
- labelActions: {
56
- type: Boolean,
57
- default: false
58
- },
59
- /**
60
- * @description 添加记录时的默认值
61
- */
62
- defaultItemValue: {
63
- type: [Object, Function],
64
- default: () => ({})
65
- },
66
- dialogFormProps: {
67
- type: Object,
68
- default: () => ({})
69
- },
70
- validateCatch: {
71
- type: Function
72
- },
73
- modules: {
74
- type: Array,
75
- default: () => ["operations:add"]
76
- },
77
- /**
78
- * @description 正在编辑的 dialog 表单数据
79
- */
80
- formdata: {
81
- type: Object,
82
- default: void 0
83
- }
84
- };
85
- const emits = {
86
- "update:modelValue": null,
87
- "update:formdata": null
88
- };
89
-
90
- var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
91
- __name: "dialog-form",
92
- props: {
93
- title: {
94
- type: String,
95
- default: ""
96
- },
97
- modelValue: {
98
- type: Object,
99
- default: () => ({})
100
- },
101
- openReset: {
102
- type: Boolean,
103
- default: true
104
- },
105
- visible: {
106
- type: Boolean,
107
- default: false
108
- },
109
- formItems: {
110
- type: Array,
111
- default: () => []
112
- },
113
- dialogFormProps: {
114
- type: Object,
115
- default: () => ({})
116
- },
117
- validateCatch: {
118
- type: Function,
119
- default: form.validateCatch
120
- },
121
- formdata: null
122
- },
123
- emits: ["update:modelValue", "update:visible", "change", "update:formdata"],
124
- setup(__props, { expose: __expose, emit: __emit }) {
125
- __expose();
126
- const props = __props;
127
- const emit = __emit;
128
- const { tr } = elementPlus.useLocale();
129
- const formData = composables.useModelComputed({
130
- key: "formdata",
131
- default: {}
132
- }, props, emit);
133
- const formDef = composables.useDeferred();
134
- formDef.promise.then((form) => {
135
- props.dialogFormProps.elRef?.(form);
136
- });
137
- vue.watch(() => props.visible, (v) => {
138
- if (props.openReset && v) {
139
- formData.value = { ...props.modelValue };
140
- setTimeout(() => {
141
- formDef.value?.clearValidate();
142
- });
143
- }
144
- });
145
- function handleSubmit() {
146
- formDef.value?.validate().then(() => {
147
- emit("update:modelValue", formData.value);
148
- emit("change", formData.value);
149
- emit("update:visible", false);
150
- }).catch(props.validateCatch);
151
- }
152
- const __returned__ = { props, emit, tr, formData, formDef, handleSubmit, get setData() {
153
- return core.setData;
154
- }, get VkfForm() {
155
- return form$1.VkfForm;
156
- }, get ElDialog() {
157
- return elementPlus$1.ElDialog;
158
- } };
159
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
160
- return __returned__;
161
- }
162
- });
163
-
164
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
165
- const _component_ElButton = vue.resolveComponent("ElButton");
166
- return vue.openBlock(), vue.createBlock($setup["ElDialog"], {
167
- "model-value": $props.visible,
168
- "append-to-body": "",
169
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:visible", $event))
170
- }, {
171
- header: vue.withCtx(() => [
172
- vue.renderSlot(_ctx.$slots, "header")
173
- ]),
174
- footer: vue.withCtx(() => [
175
- vue.createVNode(_component_ElButton, {
176
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:visible", false))
177
- }, {
178
- default: vue.withCtx(() => [
179
- vue.createTextVNode(
180
- vue.toDisplayString($setup.tr("el.messagebox.cancel", "\u53D6\u6D88")),
181
- 1
182
- /* TEXT */
183
- )
184
- ]),
185
- _: 1
186
- /* STABLE */
187
- }),
188
- vue.createVNode(_component_ElButton, {
189
- type: "primary",
190
- onClick: $setup.handleSubmit
191
- }, {
192
- default: vue.withCtx(() => [
193
- vue.createTextVNode(
194
- vue.toDisplayString($setup.tr("el.messagebox.confirm", "\u786E\u5B9A")),
195
- 1
196
- /* TEXT */
197
- )
198
- ]),
199
- _: 1
200
- /* STABLE */
201
- })
202
- ]),
203
- default: vue.withCtx(() => [
204
- vue.createVNode($setup["VkfForm"], vue.mergeProps($props.dialogFormProps, {
205
- "el-ref": $setup.formDef.resolve,
206
- "form-items": $props.formItems,
207
- data: $setup.formData,
208
- onSetData: _cache[0] || (_cache[0] = ($event) => $setup.setData($setup.formData, $event))
209
- }), null, 16, ["el-ref", "form-items", "data"])
210
- ]),
211
- _: 3
212
- /* FORWARDED */
213
- }, 8, ["model-value"]);
214
- }
215
- var DialogForm = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/dialog-input-collection/src/dialog-form.vue"]]);
216
-
217
- var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
218
- __name: "layout",
219
- props: {
220
- data: {
221
- type: Object,
222
- default: () => ({})
223
- }
224
- },
225
- emits: ["setData"],
226
- setup(__props, { expose: __expose }) {
227
- __expose();
228
- const __returned__ = { get VkfInformationData() {
229
- return informationRenderer.VkfInformationData;
230
- }, get VkfInformationTemplates() {
231
- return informationRenderer.VkfInformationTemplates;
232
- }, get VkfInformationTemplatesDefault() {
233
- return informationTemplatesDefault.VkfInformationTemplatesDefault;
234
- }, get VkfRendererData() {
235
- return rendererData.VkfRendererData;
236
- }, get VkfTemplateInstancesProvider() {
237
- return templateInstancesProvider.VkfTemplateInstancesProvider;
238
- }, get VkfTemplatesDefault() {
239
- return templatesDefault.VkfTemplatesDefault;
240
- } };
241
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
242
- return __returned__;
243
- }
244
- });
245
-
246
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
247
- return vue.openBlock(), vue.createBlock($setup["VkfTemplateInstancesProvider"], null, {
248
- placeholder: vue.withCtx(() => [
249
- vue.createVNode($setup["VkfTemplatesDefault"])
250
- ]),
251
- default: vue.withCtx(() => [
252
- vue.createVNode($setup["VkfInformationTemplates"], null, {
253
- placeholder: vue.withCtx(() => [
254
- vue.createVNode($setup["VkfInformationTemplatesDefault"])
255
- ]),
256
- default: vue.withCtx(() => [
257
- vue.createVNode($setup["VkfRendererData"], {
258
- data: $props.data,
259
- onSetData: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("setData", $event))
260
- }, {
261
- default: vue.withCtx(() => [
262
- vue.createVNode($setup["VkfInformationData"], {
263
- data: $props.data,
264
- onSetData: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("setData", $event))
265
- }, {
266
- default: vue.withCtx(() => [
267
- vue.renderSlot(_ctx.$slots, "default")
268
- ]),
269
- _: 3
270
- /* FORWARDED */
271
- }, 8, ["data"])
272
- ]),
273
- _: 3
274
- /* FORWARDED */
275
- }, 8, ["data"])
276
- ]),
277
- _: 3
278
- /* FORWARDED */
279
- })
280
- ]),
281
- _: 3
282
- /* FORWARDED */
283
- });
284
- }
285
- var TemplatesLayout = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/dialog-input-collection/src/layout.vue"]]);
286
-
287
- var _sfc_main = /* @__PURE__ */vue.defineComponent({
288
- ...{
289
- name: "VkfDialogInputCollection",
290
- inheritAttrs: false
291
- },
292
- __name: "index",
293
- props: props,
294
- emits,
295
- setup(__props, {
296
- expose: __expose,
297
- emit: __emit
298
- }) {
299
- __expose();
300
- const props = __props;
301
- const emit = __emit;
302
- const {
303
- tr
304
- } = elementPlus.useLocale();
305
- const ElTable = elementPlus$1.ElTable;
306
- const hasColAdd = vue.computed(() => {
307
- return props.modules.includes("operations:add");
308
- });
309
- const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props);
310
- const readonly = composables$1.useComputedReadonly(props);
311
- const formData = vue.computed(() => {
312
- if (!props.prop || props.prop.length === 0) {
313
- return props.modelValue;
314
- }
315
- const data = {};
316
- core.ensetData(data, {
317
- k: props.prop,
318
- v: props.modelValue
319
- });
320
- return data;
321
- });
322
- const fullColumns = vue.computed(() => {
323
- return props.columns.map(column => {
324
- const tableColProp = Array.isArray(column.prop) ? column.prop.join(".") : column.prop;
325
- return {
326
- ...column,
327
- prop: tableColProp,
328
- slots: e => {
329
- const prop = [props.prop ?? [], e.$index, column.prop].flat();
330
- const formItemProps = {
331
- prop,
332
- readonly: readonly.value,
333
- templateType: column.templateType,
334
- templateProps: column.templateProps
335
- };
336
- if (_function.isCallable(column.templateProps)) {
337
- formItemProps.templateProps = () => {
338
- return column.templateProps(e.row);
339
- };
340
- }
341
- return vue.createVNode(informationRenderer.VkfInformationRenderer, {
342
- "source": [{
343
- ...formItemProps,
344
- ...column.createTemplateProps?.(e, formItemProps)
345
- }]
346
- }, null);
347
- }
348
- };
349
- });
350
- });
351
- const buttonsColumn = vue.computed(() => ({
352
- label: tr("vkf.common.operations", "\u64CD\u4F5C"),
353
- align: "center",
354
- width: "85",
355
- hidden: readonly.value || !props.splicable,
356
- className: "vk-input-collection__buttons",
357
- slots: ({
358
- $index
359
- }) => vue.createVNode(vue.Fragment, null, [hasColAdd.value && vue.createVNode(elementPlus$1.ElButton, {
360
- "size": "small",
361
- "icon": index.plus_default,
362
- "type": "primary",
363
- "link": true,
364
- "onClick": () => handlePlus($index)
365
- }, null), vue.createVNode(elementPlus$1.ElButton, {
366
- "size": "small",
367
- "icon": index.edit_default,
368
- "type": "primary",
369
- "link": true,
370
- "onClick": () => handleEdit($index)
371
- }, null), vue.createVNode(elementPlus$1.ElPopconfirm, {
372
- "title": tr("vkf.dialogInputCollection.deleteConfirm", "\u786E\u5B9A\u5220\u9664\u5417\uFF1F"),
373
- "onConfirm": () => handleMinus($index),
374
- "confirmButtonText": tr("vkf.common.delete", "\u5220\u9664"),
375
- "cancelButtonText": tr("el.popconfirm.cancelButtonText", "\u53D6\u6D88")
376
- }, {
377
- reference: () => vue.createVNode(elementPlus$1.ElButton, {
378
- "size": "small",
379
- "icon": index.delete_default,
380
- "type": "danger",
381
- "link": true
382
- }, null)
383
- })])
384
- }));
385
- const allColumns = vue.computed(() => {
386
- const data = [...fullColumns.value, buttonsColumn.value];
387
- return data;
388
- });
389
- const cuState = vue.reactive({
390
- type: _enum.CRUD.create,
391
- index: 0,
392
- // 新增时,表示在哪条点击的 +
393
- data: {},
394
- dialogVisible: false
395
- });
396
- const cuFormItems = vue.computed(() => {
397
- return props.columns.map(c => {
398
- return {
399
- label: c.label,
400
- readonly: readonly.value,
401
- prop: c.prop,
402
- templateType: c.templateType,
403
- templateProps: c.templateProps
404
- };
405
- });
406
- });
407
- function handleMinus(index) {
408
- const data = cloneDeep.cloneDeep(props.modelValue);
409
- data.splice(index, 1);
410
- emit("update:modelValue", data);
411
- }
412
- function handlePlus(index) {
413
- const defaultItemValue = _function.isCallable(props.defaultItemValue) ? props.defaultItemValue() : props.defaultItemValue;
414
- cuState.index = index;
415
- cuState.data = cloneDeep.cloneDeep(defaultItemValue);
416
- cuState.type = _enum.CRUD.create;
417
- cuState.dialogVisible = true;
418
- }
419
- function handleEdit(index) {
420
- const data = props.modelValue[index];
421
- cuState.index = index;
422
- cuState.data = cloneDeep.cloneDeep(data);
423
- cuState.type = _enum.CRUD.update;
424
- cuState.dialogVisible = true;
425
- }
426
- function handleDialogFormChange(data) {
427
- const newData = cloneDeep.cloneDeep(props.modelValue);
428
- if (cuState.type === _enum.CRUD.create) {
429
- newData.splice(cuState.index + 1, 0, data);
430
- } else if (cuState.type === _enum.CRUD.update) {
431
- newData[cuState.index] = data;
432
- }
433
- emit("update:modelValue", newData);
434
- }
435
- const handleFormSetData = e => {
436
- console.warn("\u8868\u5355\u9879\u6B63\u5728\u76F4\u63A5\u4FEE\u6539 Data, \u8FD9\u5728 dialog-input-collection \u53EF\u80FD\u662F\u4E00\u4E2A\u610F\u5916\u64CD\u4F5C", e);
437
- const data = cloneDeep.cloneDeep(formData.value);
438
- core.ensetData(data, e);
439
- emit("update:modelValue", core.getValue(data, props.prop));
440
- };
441
- const __returned__ = {
442
- props,
443
- emit,
444
- tr,
445
- ElTable,
446
- hasColAdd,
447
- formItemBindProps,
448
- readonly,
449
- formData,
450
- fullColumns,
451
- buttonsColumn,
452
- allColumns,
453
- cuState,
454
- cuFormItems,
455
- handleMinus,
456
- handlePlus,
457
- handleEdit,
458
- handleDialogFormChange,
459
- handleFormSetData,
460
- get Edit() {
461
- return index.edit_default;
462
- },
463
- get Plus() {
464
- return index.plus_default;
465
- },
466
- get VkfFormItem() {
467
- return formItem.VkfFormItem;
468
- },
469
- get VkAvatar() {
470
- return avatar.VkAvatar;
471
- },
472
- get VkTableColumns() {
473
- return tableColumns.VkTableColumns;
474
- },
475
- get CRUD() {
476
- return _enum.CRUD;
477
- },
478
- get ElButton() {
479
- return elementPlus$1.ElButton;
480
- },
481
- DialogForm,
482
- TemplatesLayout
483
- };
484
- Object.defineProperty(__returned__, "__isScriptSetup", {
485
- enumerable: false,
486
- value: true
487
- });
488
- return __returned__;
489
- }
490
- });
491
-
492
- const _hoisted_1 = {
493
- key: 0,
494
- class: "vkf-dialog-input-collection-options"
495
- };
496
- const _hoisted_2 = { class: "vkf-dialog-input-collection__dialog-header" };
497
- const _hoisted_3 = { class: "vkf-dialog-input-collection__dialog-title" };
498
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
499
- return vue.openBlock(), vue.createElementBlock(
500
- vue.Fragment,
501
- null,
502
- [
503
- vue.createVNode($setup["TemplatesLayout"], {
504
- data: $setup.formData,
505
- onSetData: $setup.handleFormSetData
506
- }, {
507
- default: vue.withCtx(() => [
508
- vue.createVNode(
509
- $setup["VkfFormItem"],
510
- vue.normalizeProps(vue.guardReactiveProps({
511
- ...$setup.formItemBindProps,
512
- ..._ctx.$attrs
513
- })),
514
- vue.createSlots({
515
- default: vue.withCtx(() => [
516
- !$setup.readonly && _ctx.splicable && !_ctx.labelActions ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
517
- vue.createVNode($setup["ElButton"], {
518
- type: "primary",
519
- onClick: _cache[1] || (_cache[1] = ($event) => $setup.handlePlus(-1))
520
- }, {
521
- default: vue.withCtx(() => [
522
- vue.createTextVNode(
523
- vue.toDisplayString($setup.tr("vkf.common.add", "\u6DFB\u52A0")),
524
- 1
525
- /* TEXT */
526
- )
527
- ]),
528
- _: 1
529
- /* STABLE */
530
- })
531
- ])) : vue.createCommentVNode("v-if", true),
532
- vue.createVNode($setup["ElTable"], {
533
- data: _ctx.modelValue,
534
- class: "vkf-dialog-input-collection-table"
535
- }, {
536
- default: vue.withCtx(() => [
537
- vue.createVNode($setup["VkTableColumns"], { source: $setup.allColumns }, null, 8, ["source"])
538
- ]),
539
- _: 1
540
- /* STABLE */
541
- }, 8, ["data"])
542
- ]),
543
- _: 2
544
- /* DYNAMIC */
545
- }, [
546
- _ctx.labelActions ? {
547
- name: "labelActions",
548
- fn: vue.withCtx(() => [
549
- vue.renderSlot(_ctx.$slots, "labelActions"),
550
- !$setup.readonly && _ctx.splicable ? (vue.openBlock(), vue.createBlock($setup["ElButton"], {
551
- key: 0,
552
- size: "small",
553
- icon: $setup.Plus,
554
- onClick: _cache[0] || (_cache[0] = ($event) => $setup.handlePlus(-1))
555
- }, {
556
- default: vue.withCtx(() => [
557
- vue.createTextVNode(
558
- vue.toDisplayString($setup.tr("vkf.common.add", "\u6DFB\u52A0")),
559
- 1
560
- /* TEXT */
561
- )
562
- ]),
563
- _: 1
564
- /* STABLE */
565
- }, 8, ["icon"])) : vue.createCommentVNode("v-if", true)
566
- ]),
567
- key: "0"
568
- } : void 0
569
- ]),
570
- 1040
571
- /* FULL_PROPS, DYNAMIC_SLOTS */
572
- ),
573
- vue.createVNode($setup["DialogForm"], {
574
- visible: $setup.cuState.dialogVisible,
575
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => $setup.cuState.dialogVisible = $event),
576
- modelValue: $setup.cuState.data,
577
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.cuState.data = $event),
578
- formdata: _ctx.formdata,
579
- "form-items": $setup.cuFormItems,
580
- "dialog-form-props": _ctx.dialogFormProps,
581
- "validate-catch": _ctx.validateCatch,
582
- "onUpdate:formdata": _cache[4] || (_cache[4] = ($event) => _ctx.$emit("update:formdata", $event)),
583
- onChange: $setup.handleDialogFormChange
584
- }, {
585
- header: vue.withCtx(() => [
586
- vue.createElementVNode("div", _hoisted_2, [
587
- vue.createVNode($setup["VkAvatar"], {
588
- icon: $setup.cuState.type === $setup.CRUD.create ? $setup.Plus : $setup.Edit
589
- }, null, 8, ["icon"]),
590
- vue.createElementVNode(
591
- "span",
592
- _hoisted_3,
593
- vue.toDisplayString($setup.props.label),
594
- 1
595
- /* TEXT */
596
- )
597
- ])
598
- ]),
599
- _: 1
600
- /* STABLE */
601
- }, 8, ["visible", "modelValue", "formdata", "form-items", "dialog-form-props", "validate-catch"])
602
- ]),
603
- _: 3
604
- /* FORWARDED */
605
- }, 8, ["data"]),
606
- vue.renderSlot(_ctx.$slots, "default")
607
- ],
608
- 64
609
- /* STABLE_FRAGMENT */
610
- );
611
- }
612
- var VkfDialogInputCollection = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/dialog-input-collection/src/index.vue"]]);
613
-
614
- var types = /*#__PURE__*/Object.freeze({
615
- __proto__: null
616
- });
617
-
618
- VkfDialogInputCollection.install = (app) => {
619
- app.component(VkfDialogInputCollection.name || "VkfDialogInputCollection", VkfDialogInputCollection);
620
- };
621
-
622
- exports.VkfDialogInputCollection = VkfDialogInputCollection;
623
- exports.__VkfDialogInputCollection = types;
624
- exports.default = VkfDialogInputCollection;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../index.cjs"),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.cjs"),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;