@vunk/form 2.18.1 → 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 (325) 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 -352
  11. package/components/card-input-collection/index.mjs +177 -261
  12. package/components/card-input-collection/src/core.vue.d.ts +54 -950
  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 -297
  136. package/components/input-array/index.mjs +115 -232
  137. package/components/input-array/src/ctx.d.ts +19 -49
  138. package/components/input-array/src/form-template.vue.d.ts +1 -900
  139. package/components/input-array/src/index.vue.d.ts +43 -729
  140. package/components/input-collection/index.cjs +1 -444
  141. package/components/input-collection/index.mjs +195 -347
  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 -110
  262. package/locale/index.mjs +37 -45
  263. package/locale/lang/en.d.ts +2 -6
  264. package/locale/lang/index.cjs +1 -2
  265. package/locale/lang/index.d.ts +1 -0
  266. package/locale/lang/zh-cn.d.ts +2 -6
  267. package/package.json +14 -85
  268. package/shared/const/index.cjs +1 -59
  269. package/shared/const/index.d.ts +1 -1
  270. package/shared/const/index.mjs +18 -20
  271. package/shared/element-plus/ctx.d.ts +40 -37
  272. package/shared/element-plus/index.cjs +1 -211
  273. package/shared/element-plus/index.mjs +93 -161
  274. package/shared/element-plus/instances.d.ts +207 -321
  275. package/shared/form/index.cjs +1 -33
  276. package/shared/form/index.mjs +23 -25
  277. package/shared/helper/index.cjs +1 -11
  278. package/shared/helper/index.mjs +7 -8
  279. package/shared/index.cjs +1 -8
  280. package/shared/index.mjs +5 -1
  281. package/shared/infer-prop/index.cjs +1 -36
  282. package/shared/infer-prop/index.mjs +22 -28
  283. package/shared/progress-it/index.cjs +1 -42
  284. package/shared/progress-it/index.mjs +15 -31
  285. package/shared/rules/index.cjs +1 -56
  286. package/shared/rules/index.mjs +19 -18
  287. package/shared/types/form/index.cjs +1 -2
  288. package/shared/types/index.cjs +1 -2
  289. package/shared/types/source/index.cjs +1 -2
  290. package/shared/types/source-manager/index.cjs +1 -2
  291. package/shared/upload/index.cjs +1 -774
  292. package/shared/upload/index.mjs +180 -764
  293. package/component.d.ts +0 -3
  294. package/components/_plugin-vue_export-helper.mjs +0 -9
  295. package/components/card-input-collection/index.css +0 -21
  296. package/components/cascader/index.css +0 -9
  297. package/components/checkbox/index.css +0 -30
  298. package/components/cloneDeep.mjs +0 -2104
  299. package/components/date-picker-range/index.css +0 -18
  300. package/components/dialog-input-collection/index.css +0 -21
  301. package/components/download-plus/index.css +0 -68
  302. package/components/editable-text/index.css +0 -9
  303. package/components/esri-input-geojson/index.css +0 -32
  304. package/components/fieldset/index.css +0 -5
  305. package/components/form-item/index.css +0 -35
  306. package/components/index.mjs +0 -378
  307. package/components/index2.mjs +0 -14
  308. package/components/information-tag/index.css +0 -6
  309. package/components/information-templates-default/index.css +0 -16
  310. package/components/input-array/index.css +0 -14
  311. package/components/input-collection/index.css +0 -20
  312. package/components/input-link/index.css +0 -4
  313. package/components/input-number/index.css +0 -13
  314. package/components/isObject.mjs +0 -158
  315. package/components/monaco-editor/index.css +0 -4
  316. package/components/radio/index.css +0 -40
  317. package/components/select/index.css +0 -15
  318. package/components/switch/index.css +0 -10
  319. package/components/tables-select/index.css +0 -3
  320. package/components/templates-layout/index.css +0 -3
  321. package/components/upload/index.css +0 -34
  322. package/components/upload-plus/index.css +0 -84
  323. package/components/van-cascader/index.css +0 -6
  324. package/components/var-datetime-picker/index.css +0 -17
  325. package/defaults.d.ts +0 -5
@@ -1,295 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var vue = require('vue');
6
- var formItem = require('@vunk/form/components/form-item');
7
- var form = require('@vunk/form');
8
- var composables = require('@vunk/core/composables');
9
- var formItemRenderer = require('@vunk/form/components/form-item-renderer');
10
- var templatesDefault = require('@vunk/form/components/templates-default');
11
- var rendererData = require('@vunk/form/components/renderer-data');
12
- var core = require('@vunk/core');
13
- var avatar = require('@vunk/plus/components/avatar');
14
- var index = require('../index.cjs');
15
- var text = require('@vunk/plus/components/text');
16
- var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
17
-
18
- const props = {
19
- ...formItem._VkfFormItemCtx.props,
20
- /**
21
- * @description model;
22
- */
23
- modelValue: null,
24
- iconSize: {
25
- type: Number,
26
- default: 22
27
- },
28
- readonly: {
29
- type: Boolean,
30
- default: void 0
31
- },
32
- /**
33
- * @description model; Whether the text is editable.
34
- * @default false
35
- */
36
- editable: {
37
- type: Boolean,
38
- default: void 0
39
- },
40
- /**
41
- * @description 编辑主体
42
- * @default __VkfInput.Source
43
- */
44
- edit: {
45
- type: Object,
46
- default: void 0
47
- },
48
- /**
49
- * @description 文本属性
50
- * @link https://element-plus.org/zh-CN/component/text.html
51
- */
52
- textProps: {
53
- type: Object,
54
- default: () => ({})
55
- }
56
- };
57
- const emits = {
58
- "update:editable": null,
59
- "update:modelValue": null
60
- };
61
-
62
- var _sfc_main = /* @__PURE__ */vue.defineComponent({
63
- ...{
64
- name: "VkfEditableText",
65
- inheritAttrs: false
66
- },
67
- __name: "index",
68
- props: props,
69
- emits,
70
- setup(__props, {
71
- expose: __expose,
72
- emit: __emit
73
- }) {
74
- __expose();
75
- const props = __props;
76
- const emit = __emit;
77
- const id = vue.useId();
78
- const editable = composables.useModelComputed({
79
- key: "editable",
80
- default: false
81
- }, props, emit);
82
- const prop = vue.computed(() => {
83
- return props.prop ?? id;
84
- });
85
- const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props, []);
86
- const readonly = form.useComputedReadonly(props);
87
- const formItemContainerRef = vue.ref();
88
- const formItemRef = vue.ref();
89
- const editSource = vue.computed(() => {
90
- const source = {
91
- templateType: "VkfInput",
92
- ...formItemBindProps.value,
93
- inline: true,
94
- onBlur: handleCheck,
95
- onKeydown: e => {
96
- if (e.key === "Enter") {
97
- handleCheck();
98
- } else if (e.key === "Escape") {
99
- handleCancel();
100
- }
101
- e.stopPropagation();
102
- },
103
- ...props.edit,
104
- prop: prop.value,
105
- elRef: e => {
106
- props.edit?.elRef?.(e);
107
- formItemRef.value = e;
108
- }
109
- };
110
- return [source];
111
- });
112
- const rendererData$1 = vue.computed(() => {
113
- const data = {};
114
- core.setData(data, {
115
- k: prop.value,
116
- v: props.modelValue
117
- });
118
- return data;
119
- });
120
- const handleSetData = ({
121
- v
122
- }) => {
123
- emit("update:modelValue", v);
124
- };
125
- const originValue = vue.ref(props.modelValue);
126
- function handleEdit() {
127
- originValue.value = props.modelValue;
128
- editable.value = true;
129
- vue.nextTick(() => {
130
- const input = formItemContainerRef.value?.$el.querySelector("input, textarea");
131
- if (input) {
132
- input.focus();
133
- }
134
- });
135
- }
136
- function handleCheck() {
137
- if (formItemRef.value?.validate) {
138
- formItemRef.value.validate().then(() => {
139
- editable.value = false;
140
- }).catch(() => {
141
- console.warn("Validation failed, editable text remains open.");
142
- });
143
- } else {
144
- editable.value = false;
145
- }
146
- }
147
- function handleCancel() {
148
- emit("update:modelValue", originValue.value);
149
- editable.value = false;
150
- }
151
- const __returned__ = {
152
- props,
153
- emit,
154
- id,
155
- editable,
156
- prop,
157
- formItemBindProps,
158
- readonly,
159
- formItemContainerRef,
160
- formItemRef,
161
- editSource,
162
- rendererData: rendererData$1,
163
- handleSetData,
164
- originValue,
165
- handleEdit,
166
- handleCheck,
167
- handleCancel,
168
- get VkfFormItem() {
169
- return formItem.VkfFormItem;
170
- },
171
- get VkfFormItemRenderer() {
172
- return formItemRenderer.VkfFormItemRenderer;
173
- },
174
- get VkfTemplatesDefault() {
175
- return templatesDefault.VkfTemplatesDefault;
176
- },
177
- get VkfRendererData() {
178
- return rendererData.VkfRendererData;
179
- },
180
- get VkAvatar() {
181
- return avatar.VkAvatar;
182
- },
183
- get CloseBold() {
184
- return index.close_bold_default;
185
- },
186
- get Select() {
187
- return index.select_default;
188
- },
189
- get VkText() {
190
- return text.VkText;
191
- }
192
- };
193
- Object.defineProperty(__returned__, "__isScriptSetup", {
194
- enumerable: false,
195
- value: true
196
- });
197
- return __returned__;
198
- }
199
- });
200
-
201
- const _hoisted_1 = { class: "vkf-editable-text-actions" };
202
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
203
- return $setup.readonly || !$setup.editable ? (vue.openBlock(), vue.createBlock(
204
- $setup["VkfFormItem"],
205
- vue.normalizeProps(vue.mergeProps({ key: 0 }, {
206
- ...$setup.formItemBindProps,
207
- ..._ctx.$attrs
208
- })),
209
- {
210
- default: vue.withCtx(() => [
211
- vue.renderSlot(_ctx.$slots, "text", { handleEdit: $setup.handleEdit }, () => [
212
- vue.createVNode(
213
- $setup["VkText"],
214
- vue.mergeProps(_ctx.textProps, { onDblclick: $setup.handleEdit }),
215
- {
216
- default: vue.withCtx(() => [
217
- vue.createTextVNode(
218
- vue.toDisplayString(_ctx.modelValue),
219
- 1
220
- /* TEXT */
221
- )
222
- ]),
223
- _: 1
224
- /* STABLE */
225
- },
226
- 16
227
- /* FULL_PROPS */
228
- )
229
- ])
230
- ]),
231
- _: 3
232
- /* FORWARDED */
233
- },
234
- 16
235
- /* FULL_PROPS */
236
- )) : (vue.openBlock(), vue.createBlock($setup["VkfRendererData"], {
237
- key: 1,
238
- data: $setup.rendererData,
239
- onSetData: $setup.handleSetData
240
- }, {
241
- default: vue.withCtx(() => [
242
- vue.createVNode(
243
- $setup["VkfFormItem"],
244
- vue.mergeProps({
245
- ref: "formItemContainerRef",
246
- class: "vk-editable-text-edit-x"
247
- }, _ctx.$attrs),
248
- {
249
- default: vue.withCtx(() => [
250
- vue.createVNode($setup["VkfFormItemRenderer"], { source: $setup.editSource }, {
251
- placeholder: vue.withCtx(() => [
252
- vue.createVNode($setup["VkfTemplatesDefault"])
253
- ]),
254
- _: 1
255
- /* STABLE */
256
- }, 8, ["source"]),
257
- vue.createElementVNode("div", _hoisted_1, [
258
- vue.createVNode($setup["VkAvatar"], {
259
- icon: $setup.Select,
260
- size: _ctx.iconSize,
261
- color: "var(--el-color-primary)",
262
- onClick: $setup.handleCheck
263
- }, null, 8, ["icon", "size"]),
264
- vue.createVNode($setup["VkAvatar"], {
265
- icon: $setup.CloseBold,
266
- size: _ctx.iconSize,
267
- color: "var(--el-color-danger)",
268
- onClick: $setup.handleCancel
269
- }, null, 8, ["icon", "size"])
270
- ])
271
- ]),
272
- _: 1
273
- /* STABLE */
274
- },
275
- 16
276
- /* FULL_PROPS */
277
- )
278
- ]),
279
- _: 1
280
- /* STABLE */
281
- }, 8, ["data"]));
282
- }
283
- var VkfEditableText = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\editable-text\\src\\index.vue"]]);
284
-
285
- var types = /*#__PURE__*/Object.freeze({
286
- __proto__: null
287
- });
288
-
289
- VkfEditableText.install = (app) => {
290
- app.component(VkfEditableText.name || "VkfEditableText", VkfEditableText);
291
- };
292
-
293
- exports.VkfEditableText = VkfEditableText;
294
- exports.__VkfEditableText = types;
295
- exports.default = VkfEditableText;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("@vunk/form/components/form-item"),g=require("@vunk/form"),P=require("@vunk/core/composables"),D=require("@vunk/form/components/form-item-renderer"),T=require("@vunk/form/components/templates-default"),z=require("@vunk/form/components/renderer-data"),B=require("@vunk/core"),V=require("@vunk/plus/components/avatar"),y=require("../index.cjs"),N=require("@vunk/plus/components/text"),R={...n._VkfFormItemCtx.props,modelValue:null,iconSize:{type:Number,default:22},readonly:{type:Boolean,default:void 0},editable:{type:Boolean,default:void 0},edit:{type:Object,default:void 0},textProps:{type:Object,default:()=>({})}},E={"update:editable":null,"update:modelValue":null},w={class:"vkf-editable-text-actions"},b=e.defineComponent({name:"VkfEditableText",inheritAttrs:!1,__name:"index",props:R,emits:E,setup(_,{emit:x}){const r=_,u=x,h=e.useId(),a=P.useModelComputed({key:"editable",default:!1},r,u),s=e.computed(()=>r.prop??h),c=n._VkfFormItemCtx.createBindProps(r,[]),C=g.useComputedReadonly(r),f=e.ref(),i=e.ref(),I=e.computed(()=>[{templateType:"VkfInput",...c.value,inline:!0,onBlur:d,onKeydown:o=>{o.key==="Enter"?d():o.key==="Escape"&&v(),o.stopPropagation()},...r.edit,prop:s.value,elRef:o=>{var l,k;(k=(l=r.edit)==null?void 0:l.elRef)==null||k.call(l,o),i.value=o}}]),S=e.computed(()=>{const t={};return B.setData(t,{k:s.value,v:r.modelValue}),t}),q=({v:t})=>{u("update:modelValue",t)},p=e.ref(r.modelValue);function m(){p.value=r.modelValue,a.value=!0,e.nextTick(()=>{var o;const t=(o=f.value)==null?void 0:o.$el.querySelector("input, textarea");t&&t.focus()})}function d(){var t;(t=i.value)!=null&&t.validate?i.value.validate().then(()=>{a.value=!1}).catch(()=>{console.warn("Validation failed, editable text remains open.")}):a.value=!1}function v(){u("update:modelValue",p.value),a.value=!1}return(t,o)=>e.unref(C)||!e.unref(a)?(e.openBlock(),e.createBlock(e.unref(n.VkfFormItem),e.normalizeProps(e.mergeProps({key:0},{...e.unref(c),...t.$attrs})),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"text",{handleEdit:m},()=>[e.createVNode(e.unref(N.VkText),e.mergeProps(t.textProps,{onDblclick:m}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.modelValue),1)]),_:1},16)])]),_:3},16)):(e.openBlock(),e.createBlock(e.unref(z.VkfRendererData),{key:1,data:S.value,onSetData:q},{default:e.withCtx(()=>[e.createVNode(e.unref(n.VkfFormItem),e.mergeProps({ref_key:"formItemContainerRef",ref:f,class:"vk-editable-text-edit-x"},t.$attrs),{default:e.withCtx(()=>[e.createVNode(e.unref(D.VkfFormItemRenderer),{source:I.value},{placeholder:e.withCtx(()=>[e.createVNode(e.unref(T.VkfTemplatesDefault))]),_:1},8,["source"]),e.createElementVNode("div",w,[e.createVNode(e.unref(V.VkAvatar),{icon:e.unref(y.select_default),size:t.iconSize,color:"var(--el-color-primary)",onClick:d},null,8,["icon","size"]),e.createVNode(e.unref(V.VkAvatar),{icon:e.unref(y.close_bold_default),size:t.iconSize,color:"var(--el-color-danger)",onClick:v},null,8,["icon","size"])])]),_:1},16)]),_:1},8,["data"]))}}),j=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfEditableText=b;exports.__VkfEditableText=j;exports.default=b;
@@ -1,18 +1,16 @@
1
- import { defineComponent, useId, computed, ref, nextTick, openBlock, createBlock, normalizeProps, mergeProps, withCtx, renderSlot, createVNode, createTextVNode, toDisplayString, createElementVNode } from 'vue';
2
- import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
3
- import { useComputedReadonly } from '@vunk/form';
4
- import { useModelComputed } from '@vunk/core/composables';
5
- import { VkfFormItemRenderer } from '@vunk/form/components/form-item-renderer';
6
- import { VkfTemplatesDefault } from '@vunk/form/components/templates-default';
7
- import { VkfRendererData } from '@vunk/form/components/renderer-data';
8
- import { setData } from '@vunk/core';
9
- import { VkAvatar } from '@vunk/plus/components/avatar';
10
- import { b as close_bold_default, s as select_default } from '../index.mjs';
11
- import { VkText } from '@vunk/plus/components/text';
12
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
13
-
14
- const props = {
15
- ..._VkfFormItemCtx.props,
1
+ import { defineComponent as B, useId as j, computed as c, ref as f, unref as t, openBlock as h, createBlock as x, normalizeProps as N, mergeProps as m, withCtx as n, renderSlot as O, createVNode as l, createTextVNode as $, toDisplayString as w, createElementVNode as F, nextTick as A } from "vue";
2
+ import { _VkfFormItemCtx as z, VkfFormItem as C } from "@vunk/form/components/form-item";
3
+ import { useComputedReadonly as M } from "@vunk/form";
4
+ import { useModelComputed as q } from "@vunk/core/composables";
5
+ import { VkfFormItemRenderer as K } from "@vunk/form/components/form-item-renderer";
6
+ import { VkfTemplatesDefault as G } from "@vunk/form/components/templates-default";
7
+ import { VkfRendererData as H } from "@vunk/form/components/renderer-data";
8
+ import { setData as J } from "@vunk/core";
9
+ import { VkAvatar as S } from "@vunk/plus/components/avatar";
10
+ import { s as L, c as Q } from "../index.cjs";
11
+ import { VkText as U } from "@vunk/plus/components/text";
12
+ const W = {
13
+ ...z.props,
16
14
  /**
17
15
  * @description model;
18
16
  */
@@ -49,241 +47,117 @@ const props = {
49
47
  type: Object,
50
48
  default: () => ({})
51
49
  }
52
- };
53
- const emits = {
50
+ }, X = {
54
51
  "update:editable": null,
55
52
  "update:modelValue": null
56
- };
57
-
58
- var _sfc_main = /* @__PURE__ */defineComponent({
59
- ...{
60
- name: "VkfEditableText",
61
- inheritAttrs: false
62
- },
53
+ }, Y = {
54
+ class: "vkf-editable-text-actions"
55
+ }, ue = /* @__PURE__ */ B({
56
+ name: "VkfEditableText",
57
+ inheritAttrs: !1,
63
58
  __name: "index",
64
- props: props,
65
- emits,
66
- setup(__props, {
67
- expose: __expose,
68
- emit: __emit
59
+ props: W,
60
+ emits: X,
61
+ setup(I, {
62
+ emit: T
69
63
  }) {
70
- __expose();
71
- const props = __props;
72
- const emit = __emit;
73
- const id = useId();
74
- const editable = useModelComputed({
64
+ const a = I, d = T, D = j(), r = q({
75
65
  key: "editable",
76
- default: false
77
- }, props, emit);
78
- const prop = computed(() => {
79
- return props.prop ?? id;
80
- });
81
- const formItemBindProps = _VkfFormItemCtx.createBindProps(props, []);
82
- const readonly = useComputedReadonly(props);
83
- const formItemContainerRef = ref();
84
- const formItemRef = ref();
85
- const editSource = computed(() => {
86
- const source = {
87
- templateType: "VkfInput",
88
- ...formItemBindProps.value,
89
- inline: true,
90
- onBlur: handleCheck,
91
- onKeydown: e => {
92
- if (e.key === "Enter") {
93
- handleCheck();
94
- } else if (e.key === "Escape") {
95
- handleCancel();
96
- }
97
- e.stopPropagation();
98
- },
99
- ...props.edit,
100
- prop: prop.value,
101
- elRef: e => {
102
- props.edit?.elRef?.(e);
103
- formItemRef.value = e;
104
- }
105
- };
106
- return [source];
107
- });
108
- const rendererData = computed(() => {
109
- const data = {};
110
- setData(data, {
111
- k: prop.value,
112
- v: props.modelValue
113
- });
114
- return data;
115
- });
116
- const handleSetData = ({
117
- v
66
+ default: !1
67
+ }, a, d), p = c(() => a.prop ?? D), v = z.createBindProps(a, []), E = M(a), k = f(), s = f(), P = c(() => [{
68
+ templateType: "VkfInput",
69
+ ...v.value,
70
+ inline: !0,
71
+ onBlur: u,
72
+ onKeydown: (o) => {
73
+ o.key === "Enter" ? u() : o.key === "Escape" && b(), o.stopPropagation();
74
+ },
75
+ ...a.edit,
76
+ prop: p.value,
77
+ elRef: (o) => {
78
+ var i, _;
79
+ (_ = (i = a.edit) == null ? void 0 : i.elRef) == null || _.call(i, o), s.value = o;
80
+ }
81
+ }]), R = c(() => {
82
+ const e = {};
83
+ return J(e, {
84
+ k: p.value,
85
+ v: a.modelValue
86
+ }), e;
87
+ }), g = ({
88
+ v: e
118
89
  }) => {
119
- emit("update:modelValue", v);
120
- };
121
- const originValue = ref(props.modelValue);
122
- function handleEdit() {
123
- originValue.value = props.modelValue;
124
- editable.value = true;
125
- nextTick(() => {
126
- const input = formItemContainerRef.value?.$el.querySelector("input, textarea");
127
- if (input) {
128
- input.focus();
129
- }
90
+ d("update:modelValue", e);
91
+ }, V = f(a.modelValue);
92
+ function y() {
93
+ V.value = a.modelValue, r.value = !0, A(() => {
94
+ var o;
95
+ const e = (o = k.value) == null ? void 0 : o.$el.querySelector("input, textarea");
96
+ e && e.focus();
130
97
  });
131
98
  }
132
- function handleCheck() {
133
- if (formItemRef.value?.validate) {
134
- formItemRef.value.validate().then(() => {
135
- editable.value = false;
136
- }).catch(() => {
137
- console.warn("Validation failed, editable text remains open.");
138
- });
139
- } else {
140
- editable.value = false;
141
- }
99
+ function u() {
100
+ var e;
101
+ (e = s.value) != null && e.validate ? s.value.validate().then(() => {
102
+ r.value = !1;
103
+ }).catch(() => {
104
+ console.warn("Validation failed, editable text remains open.");
105
+ }) : r.value = !1;
142
106
  }
143
- function handleCancel() {
144
- emit("update:modelValue", originValue.value);
145
- editable.value = false;
107
+ function b() {
108
+ d("update:modelValue", V.value), r.value = !1;
146
109
  }
147
- const __returned__ = {
148
- props,
149
- emit,
150
- id,
151
- editable,
152
- prop,
153
- formItemBindProps,
154
- readonly,
155
- formItemContainerRef,
156
- formItemRef,
157
- editSource,
158
- rendererData,
159
- handleSetData,
160
- originValue,
161
- handleEdit,
162
- handleCheck,
163
- handleCancel,
164
- get VkfFormItem() {
165
- return VkfFormItem;
166
- },
167
- get VkfFormItemRenderer() {
168
- return VkfFormItemRenderer;
169
- },
170
- get VkfTemplatesDefault() {
171
- return VkfTemplatesDefault;
172
- },
173
- get VkfRendererData() {
174
- return VkfRendererData;
175
- },
176
- get VkAvatar() {
177
- return VkAvatar;
178
- },
179
- get CloseBold() {
180
- return close_bold_default;
181
- },
182
- get Select() {
183
- return select_default;
184
- },
185
- get VkText() {
186
- return VkText;
187
- }
188
- };
189
- Object.defineProperty(__returned__, "__isScriptSetup", {
190
- enumerable: false,
191
- value: true
192
- });
193
- return __returned__;
194
- }
195
- });
196
-
197
- const _hoisted_1 = { class: "vkf-editable-text-actions" };
198
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
199
- return $setup.readonly || !$setup.editable ? (openBlock(), createBlock(
200
- $setup["VkfFormItem"],
201
- normalizeProps(mergeProps({ key: 0 }, {
202
- ...$setup.formItemBindProps,
203
- ..._ctx.$attrs
204
- })),
205
- {
206
- default: withCtx(() => [
207
- renderSlot(_ctx.$slots, "text", { handleEdit: $setup.handleEdit }, () => [
208
- createVNode(
209
- $setup["VkText"],
210
- mergeProps(_ctx.textProps, { onDblclick: $setup.handleEdit }),
211
- {
212
- default: withCtx(() => [
213
- createTextVNode(
214
- toDisplayString(_ctx.modelValue),
215
- 1
216
- /* TEXT */
217
- )
218
- ]),
219
- _: 1
220
- /* STABLE */
221
- },
222
- 16
223
- /* FULL_PROPS */
224
- )
225
- ])
226
- ]),
110
+ return (e, o) => t(E) || !t(r) ? (h(), x(t(C), N(m({
111
+ key: 0
112
+ }, {
113
+ ...t(v),
114
+ ...e.$attrs
115
+ })), {
116
+ default: n(() => [O(e.$slots, "text", {
117
+ handleEdit: y
118
+ }, () => [l(t(U), m(e.textProps, {
119
+ onDblclick: y
120
+ }), {
121
+ default: n(() => [$(w(e.modelValue), 1)]),
122
+ _: 1
123
+ }, 16)])]),
227
124
  _: 3
228
- /* FORWARDED */
229
- },
230
- 16
231
- /* FULL_PROPS */
232
- )) : (openBlock(), createBlock($setup["VkfRendererData"], {
233
- key: 1,
234
- data: $setup.rendererData,
235
- onSetData: $setup.handleSetData
236
- }, {
237
- default: withCtx(() => [
238
- createVNode(
239
- $setup["VkfFormItem"],
240
- mergeProps({
241
- ref: "formItemContainerRef",
242
- class: "vk-editable-text-edit-x"
243
- }, _ctx.$attrs),
244
- {
245
- default: withCtx(() => [
246
- createVNode($setup["VkfFormItemRenderer"], { source: $setup.editSource }, {
247
- placeholder: withCtx(() => [
248
- createVNode($setup["VkfTemplatesDefault"])
249
- ]),
250
- _: 1
251
- /* STABLE */
252
- }, 8, ["source"]),
253
- createElementVNode("div", _hoisted_1, [
254
- createVNode($setup["VkAvatar"], {
255
- icon: $setup.Select,
256
- size: _ctx.iconSize,
257
- color: "var(--el-color-primary)",
258
- onClick: $setup.handleCheck
259
- }, null, 8, ["icon", "size"]),
260
- createVNode($setup["VkAvatar"], {
261
- icon: $setup.CloseBold,
262
- size: _ctx.iconSize,
263
- color: "var(--el-color-danger)",
264
- onClick: $setup.handleCancel
265
- }, null, 8, ["icon", "size"])
266
- ])
267
- ]),
125
+ }, 16)) : (h(), x(t(H), {
126
+ key: 1,
127
+ data: R.value,
128
+ onSetData: g
129
+ }, {
130
+ default: n(() => [l(t(C), m({
131
+ ref_key: "formItemContainerRef",
132
+ ref: k,
133
+ class: "vk-editable-text-edit-x"
134
+ }, e.$attrs), {
135
+ default: n(() => [l(t(K), {
136
+ source: P.value
137
+ }, {
138
+ placeholder: n(() => [l(t(G))]),
268
139
  _: 1
269
- /* STABLE */
270
- },
271
- 16
272
- /* FULL_PROPS */
273
- )
274
- ]),
275
- _: 1
276
- /* STABLE */
277
- }, 8, ["data"]));
278
- }
279
- var VkfEditableText = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\editable-text\\src\\index.vue"]]);
280
-
281
- var types = /*#__PURE__*/Object.freeze({
140
+ }, 8, ["source"]), F("div", Y, [l(t(S), {
141
+ icon: t(L),
142
+ size: e.iconSize,
143
+ color: "var(--el-color-primary)",
144
+ onClick: u
145
+ }, null, 8, ["icon", "size"]), l(t(S), {
146
+ icon: t(Q),
147
+ size: e.iconSize,
148
+ color: "var(--el-color-danger)",
149
+ onClick: b
150
+ }, null, 8, ["icon", "size"])])]),
151
+ _: 1
152
+ }, 16)]),
153
+ _: 1
154
+ }, 8, ["data"]));
155
+ }
156
+ }), ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
282
157
  __proto__: null
283
- });
284
-
285
- VkfEditableText.install = (app) => {
286
- app.component(VkfEditableText.name || "VkfEditableText", VkfEditableText);
158
+ }, Symbol.toStringTag, { value: "Module" }));
159
+ export {
160
+ ue as VkfEditableText,
161
+ ce as __VkfEditableText,
162
+ ue as default
287
163
  };
288
-
289
- export { VkfEditableText, types as __VkfEditableText, VkfEditableText as default };