@silver-formily/element-plus 0.0.1-alpha.0 → 0.0.1-alpha.1

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 (321) hide show
  1. package/package.json +1 -1
  2. package/esm/__builtins__/configs/index.d.ts +0 -1
  3. package/esm/__builtins__/configs/index.mjs +0 -5
  4. package/esm/__builtins__/configs/index.mjs.map +0 -1
  5. package/esm/__builtins__/index.d.ts +0 -2
  6. package/esm/__builtins__/index.mjs +0 -27
  7. package/esm/__builtins__/index.mjs.map +0 -1
  8. package/esm/__builtins__/shared/hooks.d.ts +0 -7
  9. package/esm/__builtins__/shared/hooks.mjs +0 -59
  10. package/esm/__builtins__/shared/hooks.mjs.map +0 -1
  11. package/esm/__builtins__/shared/index.d.ts +0 -7
  12. package/esm/__builtins__/shared/index.mjs +0 -25
  13. package/esm/__builtins__/shared/index.mjs.map +0 -1
  14. package/esm/__builtins__/shared/load-config-provider.d.ts +0 -2
  15. package/esm/__builtins__/shared/load-config-provider.mjs +0 -13
  16. package/esm/__builtins__/shared/load-config-provider.mjs.map +0 -1
  17. package/esm/__builtins__/shared/loading.d.ts +0 -12
  18. package/esm/__builtins__/shared/loading.mjs +0 -49
  19. package/esm/__builtins__/shared/loading.mjs.map +0 -1
  20. package/esm/__builtins__/shared/simple-version-compare.d.ts +0 -2
  21. package/esm/__builtins__/shared/simple-version-compare.mjs +0 -18
  22. package/esm/__builtins__/shared/simple-version-compare.mjs.map +0 -1
  23. package/esm/__builtins__/shared/transform-component.d.ts +0 -8
  24. package/esm/__builtins__/shared/transform-component.mjs +0 -50
  25. package/esm/__builtins__/shared/transform-component.mjs.map +0 -1
  26. package/esm/__builtins__/shared/types.d.ts +0 -2
  27. package/esm/__builtins__/shared/types.mjs +0 -2
  28. package/esm/__builtins__/shared/types.mjs.map +0 -1
  29. package/esm/__builtins__/shared/utils.d.ts +0 -8
  30. package/esm/__builtins__/shared/utils.mjs +0 -34
  31. package/esm/__builtins__/shared/utils.mjs.map +0 -1
  32. package/esm/array-base/array-base-addition.d.ts +0 -5
  33. package/esm/array-base/array-base-index.d.ts +0 -19
  34. package/esm/array-base/array-base-inner.d.ts +0 -18
  35. package/esm/array-base/array-base-item.d.ts +0 -18
  36. package/esm/array-base/array-base-move-down.d.ts +0 -18
  37. package/esm/array-base/array-base-move-up.d.ts +0 -18
  38. package/esm/array-base/array-base-remove.d.ts +0 -18
  39. package/esm/array-base/array-base-sort-handle.d.ts +0 -2
  40. package/esm/array-base/index.d.ts +0 -114
  41. package/esm/array-base/index.mjs +0 -225
  42. package/esm/array-base/index.mjs.map +0 -1
  43. package/esm/array-base/symbols.d.ts +0 -4
  44. package/esm/array-base/symbols.mjs +0 -6
  45. package/esm/array-base/symbols.mjs.map +0 -1
  46. package/esm/array-base/types.d.ts +0 -28
  47. package/esm/array-base/types.mjs +0 -2
  48. package/esm/array-base/types.mjs.map +0 -1
  49. package/esm/array-base/utils.d.ts +0 -18
  50. package/esm/array-base/utils.mjs +0 -88
  51. package/esm/array-base/utils.mjs.map +0 -1
  52. package/esm/array-cards/array-cards.d.ts +0 -13
  53. package/esm/array-cards/index.d.ts +0 -122
  54. package/esm/array-cards/index.mjs +0 -119
  55. package/esm/array-cards/index.mjs.map +0 -1
  56. package/esm/array-collapse/array-collapse-item.d.ts +0 -18
  57. package/esm/array-collapse/array-collapse.d.ts +0 -16
  58. package/esm/array-collapse/index.d.ts +0 -134
  59. package/esm/array-collapse/index.mjs +0 -180
  60. package/esm/array-collapse/index.mjs.map +0 -1
  61. package/esm/array-collapse/utils.d.ts +0 -1
  62. package/esm/array-collapse/utils.mjs +0 -12
  63. package/esm/array-collapse/utils.mjs.map +0 -1
  64. package/esm/array-items/array-items-item.d.ts +0 -30
  65. package/esm/array-items/array-items.d.ts +0 -2
  66. package/esm/array-items/index.d.ts +0 -130
  67. package/esm/array-items/index.mjs +0 -105
  68. package/esm/array-items/index.mjs.map +0 -1
  69. package/esm/array-list-tabs/array-list-tabs.d.ts +0 -31
  70. package/esm/array-list-tabs/index.d.ts +0 -83
  71. package/esm/array-list-tabs/index.mjs +0 -183
  72. package/esm/array-list-tabs/index.mjs.map +0 -1
  73. package/esm/array-list-tabs/utils.d.ts +0 -3
  74. package/esm/array-list-tabs/utils.mjs +0 -16
  75. package/esm/array-list-tabs/utils.mjs.map +0 -1
  76. package/esm/array-table/index.mjs +0 -230
  77. package/esm/array-table/index.mjs.map +0 -1
  78. package/esm/array-table/types.d.ts +0 -6
  79. package/esm/array-table/types.mjs +0 -2
  80. package/esm/array-table/types.mjs.map +0 -1
  81. package/esm/array-table/utils.d.ts +0 -5
  82. package/esm/array-table/utils.mjs +0 -26
  83. package/esm/array-table/utils.mjs.map +0 -1
  84. package/esm/array-tabs/array-tabs.d.ts +0 -2
  85. package/esm/array-tabs/index.d.ts +0 -2
  86. package/esm/array-tabs/index.mjs +0 -88
  87. package/esm/array-tabs/index.mjs.map +0 -1
  88. package/esm/cascader/cascader.d.ts +0 -30
  89. package/esm/cascader/index.d.ts +0 -41
  90. package/esm/cascader/index.mjs +0 -54
  91. package/esm/cascader/index.mjs.map +0 -1
  92. package/esm/checkbox/checkbox-group.d.ts +0 -58
  93. package/esm/checkbox/index.d.ts +0 -716
  94. package/esm/checkbox/index.mjs +0 -86
  95. package/esm/checkbox/index.mjs.map +0 -1
  96. package/esm/date-picker/index.d.ts +0 -2
  97. package/esm/date-picker/index.mjs +0 -57
  98. package/esm/date-picker/index.mjs.map +0 -1
  99. package/esm/editable/editable-popover.d.ts +0 -25
  100. package/esm/editable/editable.d.ts +0 -187
  101. package/esm/editable/index.d.ts +0 -147
  102. package/esm/editable/index.mjs +0 -231
  103. package/esm/editable/index.mjs.map +0 -1
  104. package/esm/form/form.d.ts +0 -46
  105. package/esm/form/form.mjs +0 -77
  106. package/esm/form/form.mjs.map +0 -1
  107. package/esm/form/index.d.ts +0 -1
  108. package/esm/form/index.mjs +0 -6
  109. package/esm/form/index.mjs.map +0 -1
  110. package/esm/form-button-group/form-button-group-sticky.d.ts +0 -17
  111. package/esm/form-button-group/form-button-group.d.ts +0 -48
  112. package/esm/form-button-group/index.d.ts +0 -87
  113. package/esm/form-button-group/index.mjs +0 -90
  114. package/esm/form-button-group/index.mjs.map +0 -1
  115. package/esm/form-button-group/utils.d.ts +0 -1
  116. package/esm/form-button-group/utils.mjs +0 -12
  117. package/esm/form-button-group/utils.mjs.map +0 -1
  118. package/esm/form-collapse/form-collapse.d.ts +0 -18
  119. package/esm/form-collapse/index.d.ts +0 -45
  120. package/esm/form-collapse/index.mjs +0 -103
  121. package/esm/form-collapse/index.mjs.map +0 -1
  122. package/esm/form-collapse/utils.d.ts +0 -31
  123. package/esm/form-collapse/utils.mjs +0 -54
  124. package/esm/form-collapse/utils.mjs.map +0 -1
  125. package/esm/form-dialog/dialog-content.d.ts +0 -60
  126. package/esm/form-dialog/index.d.ts +0 -4
  127. package/esm/form-dialog/index.mjs +0 -209
  128. package/esm/form-dialog/index.mjs.map +0 -1
  129. package/esm/form-dialog/types.d.ts +0 -32
  130. package/esm/form-dialog/types.mjs +0 -2
  131. package/esm/form-dialog/types.mjs.map +0 -1
  132. package/esm/form-drawer/drawer-content.d.ts +0 -60
  133. package/esm/form-drawer/index.d.ts +0 -4
  134. package/esm/form-drawer/index.mjs +0 -203
  135. package/esm/form-drawer/index.mjs.map +0 -1
  136. package/esm/form-drawer/types.d.ts +0 -32
  137. package/esm/form-drawer/types.mjs +0 -2
  138. package/esm/form-drawer/types.mjs.map +0 -1
  139. package/esm/form-grid/form-grid-column.d.ts +0 -29
  140. package/esm/form-grid/form-grid.d.ts +0 -101
  141. package/esm/form-grid/hooks.d.ts +0 -4
  142. package/esm/form-grid/hooks.mjs +0 -7
  143. package/esm/form-grid/hooks.mjs.map +0 -1
  144. package/esm/form-grid/index.d.ts +0 -182
  145. package/esm/form-grid/index.mjs +0 -106
  146. package/esm/form-grid/index.mjs.map +0 -1
  147. package/esm/form-item/form-item.d.ts +0 -18
  148. package/esm/form-item/index.d.ts +0 -70
  149. package/esm/form-item/index.mjs +0 -346
  150. package/esm/form-item/index.mjs.map +0 -1
  151. package/esm/form-item/types.d.ts +0 -25
  152. package/esm/form-item/types.mjs +0 -2
  153. package/esm/form-item/types.mjs.map +0 -1
  154. package/esm/form-item/utils.d.ts +0 -3
  155. package/esm/form-item/utils.mjs +0 -18
  156. package/esm/form-item/utils.mjs.map +0 -1
  157. package/esm/form-layout/form-layout.d.ts +0 -32
  158. package/esm/form-layout/form-layout.mjs +0 -86
  159. package/esm/form-layout/form-layout.mjs.map +0 -1
  160. package/esm/form-layout/index.d.ts +0 -1
  161. package/esm/form-layout/index.mjs +0 -6
  162. package/esm/form-layout/index.mjs.map +0 -1
  163. package/esm/form-layout/types.d.ts +0 -43
  164. package/esm/form-layout/types.mjs +0 -2
  165. package/esm/form-layout/types.mjs.map +0 -1
  166. package/esm/form-layout/utils.d.ts +0 -57
  167. package/esm/form-layout/utils.mjs +0 -109
  168. package/esm/form-layout/utils.mjs.map +0 -1
  169. package/esm/form-step/form-step-pane.d.ts +0 -2
  170. package/esm/form-step/form-step.d.ts +0 -5
  171. package/esm/form-step/index.d.ts +0 -24
  172. package/esm/form-step/index.mjs +0 -96
  173. package/esm/form-step/index.mjs.map +0 -1
  174. package/esm/form-step/types.d.ts +0 -21
  175. package/esm/form-step/types.mjs +0 -2
  176. package/esm/form-step/types.mjs.map +0 -1
  177. package/esm/form-step/utils.d.ts +0 -11
  178. package/esm/form-step/utils.mjs +0 -66
  179. package/esm/form-step/utils.mjs.map +0 -1
  180. package/esm/form-tab/form-tab.d.ts +0 -7
  181. package/esm/form-tab/hooks.d.ts +0 -7
  182. package/esm/form-tab/hooks.mjs +0 -32
  183. package/esm/form-tab/hooks.mjs.map +0 -1
  184. package/esm/form-tab/index.d.ts +0 -28
  185. package/esm/form-tab/index.mjs +0 -80
  186. package/esm/form-tab/index.mjs.map +0 -1
  187. package/esm/form-tab/types.d.ts +0 -12
  188. package/esm/form-tab/types.mjs +0 -2
  189. package/esm/form-tab/types.mjs.map +0 -1
  190. package/esm/form-tab/utils.d.ts +0 -4
  191. package/esm/form-tab/utils.mjs +0 -14
  192. package/esm/form-tab/utils.mjs.map +0 -1
  193. package/esm/index.d.ts +0 -37
  194. package/esm/index.mjs +0 -81
  195. package/esm/index.mjs.map +0 -1
  196. package/esm/input/index.d.ts +0 -84
  197. package/esm/input/index.mjs +0 -77
  198. package/esm/input/index.mjs.map +0 -1
  199. package/esm/input/input.d.ts +0 -32
  200. package/esm/input-number/index.d.ts +0 -4
  201. package/esm/input-number/index.mjs +0 -30
  202. package/esm/input-number/index.mjs.map +0 -1
  203. package/esm/pagination/components/jumper.d.ts +0 -16
  204. package/esm/pagination/components/jumper.mjs +0 -12
  205. package/esm/pagination/components/jumper.mjs.map +0 -1
  206. package/esm/pagination/components/next.d.ts +0 -42
  207. package/esm/pagination/components/next.mjs +0 -23
  208. package/esm/pagination/components/next.mjs.map +0 -1
  209. package/esm/pagination/components/pager.d.ts +0 -42
  210. package/esm/pagination/components/pager.mjs +0 -23
  211. package/esm/pagination/components/pager.mjs.map +0 -1
  212. package/esm/pagination/components/prev.d.ts +0 -39
  213. package/esm/pagination/components/prev.mjs +0 -22
  214. package/esm/pagination/components/prev.mjs.map +0 -1
  215. package/esm/pagination/components/sizes.d.ts +0 -56
  216. package/esm/pagination/components/sizes.mjs +0 -7
  217. package/esm/pagination/components/sizes.mjs.map +0 -1
  218. package/esm/pagination/components/total.d.ts +0 -8
  219. package/esm/pagination/components/total.mjs +0 -11
  220. package/esm/pagination/components/total.mjs.map +0 -1
  221. package/esm/pagination/pagination.d.ts +0 -128
  222. package/esm/pagination/pagination.mjs +0 -631
  223. package/esm/pagination/pagination.mjs.map +0 -1
  224. package/esm/password/index.d.ts +0 -86
  225. package/esm/password/index.mjs +0 -14
  226. package/esm/password/index.mjs.map +0 -1
  227. package/esm/preview-text/cascader.d.ts +0 -5
  228. package/esm/preview-text/date-picker.d.ts +0 -5
  229. package/esm/preview-text/index.d.ts +0 -102
  230. package/esm/preview-text/index.mjs +0 -321
  231. package/esm/preview-text/index.mjs.map +0 -1
  232. package/esm/preview-text/input.d.ts +0 -28
  233. package/esm/preview-text/preview.d.ts +0 -18
  234. package/esm/preview-text/select.d.ts +0 -5
  235. package/esm/preview-text/time-picker.d.ts +0 -5
  236. package/esm/preview-text/tree.d.ts +0 -22
  237. package/esm/preview-text/utils.d.ts +0 -14
  238. package/esm/preview-text/utils.mjs +0 -16
  239. package/esm/preview-text/utils.mjs.map +0 -1
  240. package/esm/radio/index.d.ts +0 -634
  241. package/esm/radio/index.mjs +0 -80
  242. package/esm/radio/index.mjs.map +0 -1
  243. package/esm/radio/radio-group.d.ts +0 -44
  244. package/esm/reset/index.d.ts +0 -63
  245. package/esm/reset/index.mjs +0 -48
  246. package/esm/reset/index.mjs.map +0 -1
  247. package/esm/reset/reset.d.ts +0 -45
  248. package/esm/select/index.d.ts +0 -142
  249. package/esm/select/index.mjs +0 -132
  250. package/esm/select/index.mjs.map +0 -1
  251. package/esm/select/select.d.ts +0 -50
  252. package/esm/select-table/index.mjs +0 -204
  253. package/esm/select-table/index.mjs.map +0 -1
  254. package/esm/select-table/types.d.ts +0 -14
  255. package/esm/select-table/types.mjs +0 -2
  256. package/esm/select-table/types.mjs.map +0 -1
  257. package/esm/space/index.d.ts +0 -1
  258. package/esm/space/index.mjs +0 -6
  259. package/esm/space/index.mjs.map +0 -1
  260. package/esm/styles/array-base/index.css +0 -1
  261. package/esm/styles/array-cards/index.css +0 -1
  262. package/esm/styles/array-collapse/index.css +0 -1
  263. package/esm/styles/array-items/index.css +0 -1
  264. package/esm/styles/array-list-tabs/index.css +0 -1
  265. package/esm/styles/array-table/index.css +0 -1
  266. package/esm/styles/array-tabs/index.css +0 -1
  267. package/esm/styles/editable/index.css +0 -1
  268. package/esm/styles/form-button-group/index.css +0 -1
  269. package/esm/styles/form-collapse/index.css +0 -1
  270. package/esm/styles/form-grid/index.css +0 -1
  271. package/esm/styles/form-item/index.css +0 -1
  272. package/esm/styles/form-tab/index.css +0 -1
  273. package/esm/styles/preview-text/index.css +0 -1
  274. package/esm/styles/radio/index.css +0 -1
  275. package/esm/styles/select-table/index.css +0 -1
  276. package/esm/submit/index.d.ts +0 -48
  277. package/esm/submit/index.mjs +0 -47
  278. package/esm/submit/index.mjs.map +0 -1
  279. package/esm/submit/submit.d.ts +0 -36
  280. package/esm/switch/index.d.ts +0 -4
  281. package/esm/switch/index.mjs +0 -19
  282. package/esm/switch/index.mjs.map +0 -1
  283. package/esm/time-picker/index.d.ts +0 -4
  284. package/esm/time-picker/index.mjs +0 -21
  285. package/esm/time-picker/index.mjs.map +0 -1
  286. package/esm/time-select/index.d.ts +0 -2
  287. package/esm/time-select/index.mjs +0 -21
  288. package/esm/time-select/index.mjs.map +0 -1
  289. package/esm/transfer/index.d.ts +0 -1509
  290. package/esm/transfer/index.mjs +0 -11
  291. package/esm/transfer/index.mjs.map +0 -1
  292. package/esm/tree/index.d.ts +0 -42
  293. package/esm/tree/index.mjs +0 -105
  294. package/esm/tree/index.mjs.map +0 -1
  295. package/esm/tree/tree.d.ts +0 -20
  296. package/esm/tree/types.d.ts +0 -13
  297. package/esm/tree/types.mjs +0 -2
  298. package/esm/tree/types.mjs.map +0 -1
  299. package/esm/tree/utils.d.ts +0 -45
  300. package/esm/tree/utils.mjs +0 -161
  301. package/esm/tree/utils.mjs.map +0 -1
  302. package/esm/tree-select/index.d.ts +0 -32
  303. package/esm/tree-select/index.mjs +0 -51
  304. package/esm/tree-select/index.mjs.map +0 -1
  305. package/esm/tree-select/tree-select.d.ts +0 -17
  306. package/esm/upload/index.d.ts +0 -889
  307. package/esm/upload/index.mjs +0 -185
  308. package/esm/upload/index.mjs.map +0 -1
  309. package/esm/upload/upload.d.ts +0 -1613
  310. package/esm/vendor/icon.mjs +0 -11
  311. package/esm/vendor/icon.mjs.map +0 -1
  312. package/esm/vendor/lodash.mjs +0 -1400
  313. package/esm/vendor/lodash.mjs.map +0 -1
  314. package/esm/vendor/runtime.mjs +0 -29
  315. package/esm/vendor/runtime.mjs.map +0 -1
  316. package/esm/vendor/shared.esm-bundler.mjs +0 -14
  317. package/esm/vendor/shared.esm-bundler.mjs.map +0 -1
  318. package/esm/vendor/sizes.mjs +0 -27
  319. package/esm/vendor/sizes.mjs.map +0 -1
  320. package/esm/vendor/types.mjs +0 -19
  321. package/esm/vendor/types.mjs.map +0 -1
@@ -1,231 +0,0 @@
1
- import { useField as z, connect as T, mapProps as W } from "@formily/vue";
2
- import { defineComponent as A, ref as y, createElementBlock as m, openBlock as s, normalizeClass as n, createVNode as f, unref as t, mergeProps as C, withCtx as d, withDirectives as F, createBlock as B, createElementVNode as $, createTextVNode as I, toDisplayString as N, renderSlot as L, computed as h, createCommentVNode as D, Fragment as M, nextTick as R } from "vue";
3
- import { ElPopover as j, ElText as G, ClickOutside as O } from "element-plus";
4
- import { reaction as H } from "@formily/reactive";
5
- import "@formily/core";
6
- import "@formily/reactive-vue";
7
- import { composeExport as J } from "../__builtins__/shared/utils.mjs";
8
- import { FormBaseItem as b, fieldFeedbackMapper as S } from "../form-item/index.mjs";
9
- import { Edit as V, Close as K } from "@element-plus/icons-vue";
10
- import { isValid as w, isPlainObj as Q } from "@formily/shared";
11
- import { stylePrefix as q } from "../__builtins__/configs/index.mjs";
12
- import { o as _ } from "../vendor/lodash.mjs";
13
- import '../styles/editable/index.css';const U = /* @__PURE__ */ A({
14
- name: "FEditablePopover",
15
- inheritAttrs: !1,
16
- __name: "editable-popover",
17
- props: {
18
- label: null,
19
- for: null,
20
- tooltip: null,
21
- addonBefore: null,
22
- addonAfter: null,
23
- extra: null,
24
- feedbackText: null,
25
- feedbackStatus: null,
26
- asterisk: { type: Boolean },
27
- colon: { type: Boolean },
28
- labelAlign: null,
29
- wrapperAlign: null,
30
- labelWrap: { type: Boolean },
31
- labelWidth: null,
32
- wrapperWidth: null,
33
- wrapperWrap: { type: Boolean },
34
- labelCol: null,
35
- wrapperCol: null,
36
- fullness: { type: Boolean },
37
- size: { default: "default" },
38
- layout: null,
39
- feedbackLayout: { default: "popover" },
40
- tooltipLayout: null
41
- },
42
- setup(v) {
43
- const l = v, e = z(), r = `${q}-editable`, i = y(), o = y(!1);
44
- if (w(e.value.data)) {
45
- /* istanbul ignore else -- @preserve */
46
- w(e.value.data.readPretty) || (e.value.data.readPretty = !0);
47
- } else
48
- e.value.data = {}, e.value.data.readPretty = !0;
49
- function k(a) {
50
- const c = i.value.parentElement;
51
- /* istanbul ignore else -- @preserve */
52
- c.contains(a.target) || (o.value = !1);
53
- }
54
- function P() {
55
- o.value = !0;
56
- }
57
- return H(
58
- () => e.value.form.queryFeedbacks({
59
- type: "error",
60
- address: `${e.value.address.entire}.*`
61
- }),
62
- (a) => {
63
- a.length > 0 && (o.value = !0);
64
- }
65
- ), (a, c) => (s(), m("div", {
66
- class: n(r)
67
- }, [
68
- f(t(j), C(a.$attrs, {
69
- visible: o.value,
70
- title: a.$attrs.title || t(e).title,
71
- trigger: "click",
72
- width: "auto"
73
- }), {
74
- default: d(() => [
75
- $("div", {
76
- ref_key: "contentRef",
77
- ref: i,
78
- class: n(`${r}-popover-wrapper`)
79
- }, [
80
- L(a.$slots, "default")
81
- ], 2)
82
- ]),
83
- reference: d(() => [
84
- F((s(), B(t(b), C(l, {
85
- class: `${r}-trigger`
86
- }), {
87
- default: d(() => [
88
- $("div", {
89
- class: n(`${r}-content`),
90
- onClick: P
91
- }, [
92
- f(t(G), null, {
93
- default: d(() => [
94
- I(N(t(e).title), 1)
95
- ]),
96
- _: 1
97
- }),
98
- f(t(V), {
99
- class: n(`${r}-edit-btn`)
100
- }, null, 8, ["class"])
101
- ], 2)
102
- ]),
103
- _: 1
104
- }, 16, ["class"])), [
105
- [t(O), k]
106
- ])
107
- ]),
108
- _: 3
109
- }, 16, ["visible", "title"])
110
- ]));
111
- }
112
- }), X = /* @__PURE__ */ A({
113
- name: "FEditable",
114
- __name: "editable",
115
- props: {
116
- label: null,
117
- for: null,
118
- tooltip: null,
119
- addonBefore: null,
120
- addonAfter: null,
121
- extra: null,
122
- feedbackText: null,
123
- feedbackStatus: null,
124
- asterisk: { type: Boolean },
125
- colon: { type: Boolean },
126
- labelAlign: null,
127
- wrapperAlign: null,
128
- labelWrap: { type: Boolean },
129
- labelWidth: null,
130
- wrapperWidth: null,
131
- wrapperWrap: { type: Boolean },
132
- labelCol: null,
133
- wrapperCol: null,
134
- fullness: { type: Boolean },
135
- size: { default: "default" },
136
- layout: null,
137
- feedbackLayout: { default: "popover" },
138
- tooltipLayout: null,
139
- editProps: null
140
- },
141
- setup(v) {
142
- const l = v, e = z(), r = y(null), i = `${q}-editable`, o = y(null), k = h(() => _(l, "editProps")), P = h(() => Q(l.editProps) ? { ..._(l, "editProps"), ...l.editProps } : _(l, "editProps"));
143
- function a() {
144
- w(e.value.data) || (e.value.data = {});
145
- }
146
- a(), e.value.data.readPretty = !0;
147
- async function c() {
148
- var u, p;
149
- e.value.disabled || (a(), e.value.data.readPretty = !1, await R(), o.value.feedbackTooltipRef.updatePopper(), (p = (u = r.value) == null ? void 0 : u.querySelector("input")) == null || p.focus());
150
- }
151
- function g() {
152
- var u;
153
- ((u = e.value.data) == null ? void 0 : u.readPretty) !== !0 && (a(), setTimeout(async () => {
154
- var p;
155
- e.value.data.readPretty = !0, await R(), (p = o.value) == null || p.feedbackTooltipRef.updatePopper();
156
- }, 0));
157
- }
158
- return (u, p) => {
159
- var x, E;
160
- return s(), m("div", {
161
- ref_key: "innerRef",
162
- ref: r,
163
- class: n([i, t(e).disabled && "is-disabled"])
164
- }, [
165
- F((s(), m("div", {
166
- class: n(`${i}-content`)
167
- }, [
168
- f(t(b), C({
169
- ref_key: "formItemRef",
170
- ref: o
171
- }, ((x = t(e).data) == null ? void 0 : x.readPretty) === !1 ? P.value : k.value, { onClick: c }), {
172
- default: d(() => [
173
- $("div", null, [
174
- L(u.$slots, "default")
175
- ])
176
- ]),
177
- _: 3
178
- }, 16),
179
- t(e).disabled ? D("", !0) : (s(), m(M, { key: 0 }, [
180
- ((E = t(e).data) == null ? void 0 : E.readPretty) === !0 ? (s(), B(t(b), {
181
- key: 0,
182
- size: l.size,
183
- "feedback-layout": l.feedbackLayout
184
- }, {
185
- default: d(() => [
186
- f(t(V), {
187
- class: n(`${i}-edit-btn`),
188
- onClick: c
189
- }, null, 8, ["class"])
190
- ]),
191
- _: 1
192
- }, 8, ["size", "feedback-layout"])) : (s(), B(t(b), {
193
- key: 1,
194
- size: l.size,
195
- "feedback-layout": l.feedbackLayout
196
- }, {
197
- default: d(() => [
198
- f(t(K), {
199
- class: n(`${i}-close-btn`),
200
- onClick: g
201
- }, null, 8, ["class"])
202
- ]),
203
- _: 1
204
- }, 8, ["size", "feedback-layout"]))
205
- ], 64))
206
- ], 2)), [
207
- [t(O), g]
208
- ])
209
- ], 2);
210
- };
211
- }
212
- }), Y = T(X, W(
213
- {
214
- required: !0,
215
- description: "extra"
216
- },
217
- S
218
- )), Z = T(U, W(
219
- {
220
- required: !0,
221
- description: "extra"
222
- },
223
- S
224
- )), fe = J(Y, {
225
- Popover: Z
226
- });
227
- export {
228
- fe as Editable,
229
- fe as default
230
- };
231
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/editable/editable-popover.vue","../../src/editable/editable.vue","../../src/editable/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type { IFormItemProps } from '../form-item/types'\nimport { Edit } from '@element-plus/icons-vue'\nimport { reaction } from '@formily/reactive'\nimport { isValid } from '@formily/shared'\nimport { useField } from '@formily/vue'\nimport { ElPopover, ElText, ClickOutside as vClickOutside } from 'element-plus'\nimport { ref } from 'vue'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { FormBaseItem } from '../form-item'\n\ndefineOptions({\n name: 'FEditablePopover',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n label: null,\n for: null,\n tooltip: null,\n addonBefore: null,\n addonAfter: null,\n extra: null,\n feedbackText: null,\n feedbackStatus: null,\n asterisk: { type: Boolean },\n colon: { type: Boolean },\n labelAlign: null,\n wrapperAlign: null,\n labelWrap: { type: Boolean },\n labelWidth: null,\n wrapperWidth: null,\n wrapperWrap: { type: Boolean },\n labelCol: null,\n wrapperCol: null,\n fullness: { type: Boolean },\n size: { default: 'default' },\n layout: null,\n feedbackLayout: { default: 'popover' },\n tooltipLayout: null\n})\n\nconst fieldRef = useField<Field>()\nconst prefixCls = `${stylePrefix}-editable`\nconst contentRef = ref<HTMLElement>()\nconst visible = ref(false)\n\nif (isValid(fieldRef.value.data)) {\n /* istanbul ignore else -- @preserve */\n if (!isValid(fieldRef.value.data.readPretty)) {\n fieldRef.value.data.readPretty = true\n }\n}\nelse {\n fieldRef.value.data = {}\n fieldRef.value.data.readPretty = true\n}\n\nfunction onClickOutside(e) {\n const popoverDOM = contentRef.value.parentElement\n /* istanbul ignore else -- @preserve */\n if (!popoverDOM.contains(e.target)) {\n visible.value = false\n }\n}\nfunction onClick() {\n visible.value = true\n}\n\nreaction(\n () => fieldRef.value.form.queryFeedbacks({\n type: 'error',\n address: `${fieldRef.value.address.entire}.*`,\n }),\n (errorList) => {\n if (errorList.length > 0) {\n visible.value = true\n }\n },\n)\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ElPopover\n v-bind=\"$attrs\"\n :visible=\"visible\"\n :title=\"$attrs.title || fieldRef.title\" trigger=\"click\" width=\"auto\"\n >\n <template #default>\n <div ref=\"contentRef\" :class=\"`${prefixCls}-popover-wrapper`\">\n <slot />\n </div>\n </template>\n <template #reference>\n <FormBaseItem v-click-outside=\"onClickOutside\" v-bind=\"props\" :class=\"`${prefixCls}-trigger`\">\n <div :class=\"`${prefixCls}-content`\" @click=\"onClick\">\n <ElText>\n {{ fieldRef.title }}\n </ElText>\n <Edit :class=\"`${prefixCls}-edit-btn`\" />\n </div>\n </FormBaseItem>\n </template>\n </ElPopover>\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type { IFormItemProps } from '../form-item/types'\nimport { Close, Edit } from '@element-plus/icons-vue'\nimport { isPlainObj, isValid } from '@formily/shared'\nimport { useField } from '@formily/vue'\nimport { ClickOutside as vClickOutside } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, nextTick, ref } from 'vue'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { FormBaseItem } from '../form-item'\n\ndefineOptions({\n name: 'FEditable',\n})\n\nconst props = defineProps({\n label: null,\n for: null,\n tooltip: null,\n addonBefore: null,\n addonAfter: null,\n extra: null,\n feedbackText: null,\n feedbackStatus: null,\n asterisk: { type: Boolean },\n colon: { type: Boolean },\n labelAlign: null,\n wrapperAlign: null,\n labelWrap: { type: Boolean },\n labelWidth: null,\n wrapperWidth: null,\n wrapperWrap: { type: Boolean },\n labelCol: null,\n wrapperCol: null,\n fullness: { type: Boolean },\n size: { default: 'default' },\n layout: null,\n feedbackLayout: { default: 'popover' },\n tooltipLayout: null,\n editProps: null\n})\n\nconst fieldRef = useField<Field>()\nconst innerRef = ref<HTMLElement>(null)\nconst prefixCls = `${stylePrefix}-editable`\nconst formItemRef = ref<InstanceType<typeof FormBaseItem>>(null)\n\nconst commonProps = computed(() => omit(props, 'editProps'))\nconst editProps = computed(() => {\n if (isPlainObj(props.editProps)) {\n return { ...omit(props, 'editProps'), ...props.editProps }\n }\n return omit(props, 'editProps')\n})\n\nfunction handleEnsureReadPretty() {\n if (!isValid(fieldRef.value.data)) {\n fieldRef.value.data = {}\n }\n}\n\nhandleEnsureReadPretty()\nfieldRef.value.data.readPretty = true\n\nasync function onClick() {\n if (fieldRef.value.disabled)\n return\n handleEnsureReadPretty()\n fieldRef.value.data.readPretty = false\n await nextTick()\n formItemRef.value.feedbackTooltipRef.updatePopper()\n innerRef.value?.querySelector('input')?.focus()\n}\n\nfunction onClickOutside() {\n if (fieldRef.value.data?.readPretty === true)\n return\n handleEnsureReadPretty()\n // 使用下拉菜单等触发的事件完成应有的操作\n setTimeout(async () => {\n fieldRef.value.data.readPretty = true\n await nextTick()\n formItemRef.value?.feedbackTooltipRef.updatePopper()\n }, 0)\n}\n</script>\n\n<template>\n <div ref=\"innerRef\" :class=\"[prefixCls, fieldRef.disabled && 'is-disabled']\">\n <div v-click-outside=\"onClickOutside\" :class=\"`${prefixCls}-content`\">\n <FormBaseItem ref=\"formItemRef\" v-bind=\"fieldRef.data?.readPretty === false ? editProps : commonProps\" @click=\"onClick\">\n <div>\n <slot />\n </div>\n </FormBaseItem>\n <template v-if=\"!fieldRef.disabled\">\n <template v-if=\"fieldRef.data?.readPretty === true\">\n <FormBaseItem :size=\"props.size\" :feedback-layout=\"props.feedbackLayout\">\n <Edit :class=\"`${prefixCls}-edit-btn`\" @click=\"onClick\" />\n </FormBaseItem>\n </template>\n <template v-else>\n <FormBaseItem :size=\"props.size\" :feedback-layout=\"props.feedbackLayout\">\n <Close :class=\"`${prefixCls}-close-btn`\" @click=\"onClickOutside\" />\n </FormBaseItem>\n </template>\n </template>\n </div>\n </div>\n</template>\n","import type { ElPopover } from 'element-plus'\nimport type { IFormItemProps } from '../form-item/types'\nimport { connect, mapProps } from '@formily/vue'\nimport { composeExport } from '../__builtins__/shared'\nimport { fieldFeedbackMapper } from '../form-item'\nimport FEditablePopover from './editable-popover.vue'\nimport FEditable from './editable.vue'\nimport './style.scss'\n\nexport type EditableProps = IFormItemProps\nexport type EditablePopoverProps = typeof ElPopover\n\nconst EditableInner = connect(FEditable, mapProps(\n {\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n))\n\nconst EditablePopover = connect(FEditablePopover, mapProps(\n {\n required: true,\n description: 'extra',\n },\n fieldFeedbackMapper,\n))\n\nexport const Editable = composeExport(EditableInner, {\n Popover: EditablePopover,\n})\n\nexport default Editable\n"],"names":["props","__props","fieldRef","useField","prefixCls","stylePrefix","contentRef","ref","visible","isValid","onClickOutside","e","popoverDOM","onClick","reaction","errorList","_createElementBlock","_createVNode","_unref","ElPopover","_mergeProps","_ctx","$attrs","_createElementVNode","_renderSlot","_createBlock","FormBaseItem","ElText","_createTextVNode","_toDisplayString","Edit","innerRef","formItemRef","commonProps","computed","omit","editProps","isPlainObj","handleEnsureReadPretty","nextTick","_b","_a","_normalizeClass","_Fragment","Close","EditableInner","connect","FEditable","mapProps","fieldFeedbackMapper","EditablePopover","FEditablePopover","Editable","composeExport"],"mappings":"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"}
@@ -1,46 +0,0 @@
1
- import { Form as FormType, IFormFeedback } from '@formily/core';
2
- import { PropType } from 'vue';
3
- declare function __VLS_template(): {
4
- attrs: Partial<{}>;
5
- slots: {
6
- default?(_: {}): any;
7
- default?(_: {}): any;
8
- };
9
- refs: {};
10
- rootEl: any;
11
- };
12
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
14
- form: {
15
- type: PropType<FormType>;
16
- };
17
- previewTextPlaceholder: {
18
- type: StringConstructor;
19
- };
20
- onAutoSubmit: {
21
- type: PropType<(values: FormType["values"]) => Promise<any>>;
22
- };
23
- onAutoSubmitFailed: {
24
- type: PropType<(error: IFormFeedback[]) => void>;
25
- };
26
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
27
- form: {
28
- type: PropType<FormType>;
29
- };
30
- previewTextPlaceholder: {
31
- type: StringConstructor;
32
- };
33
- onAutoSubmit: {
34
- type: PropType<(values: FormType["values"]) => Promise<any>>;
35
- };
36
- onAutoSubmitFailed: {
37
- type: PropType<(error: IFormFeedback[]) => void>;
38
- };
39
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
40
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
41
- export default _default;
42
- type __VLS_WithTemplateSlots<T, S> = T & {
43
- new (): {
44
- $slots: S;
45
- };
46
- };
package/esm/form/form.mjs DELETED
@@ -1,77 +0,0 @@
1
- import { defineComponent as S, createBlock as d, createCommentVNode as F, openBlock as s, unref as o, withCtx as n, createVNode as l, mergeProps as p, renderSlot as c, withModifiers as v } from "vue";
2
- import { useForm as w, FormProvider as y } from "@formily/vue";
3
- import { _ as b } from "../form-layout/form-layout.mjs";
4
- import { PreviewText as h } from "../preview-text/index.mjs";
5
- const k = /* @__PURE__ */ S({
6
- name: "FForm",
7
- inheritAttrs: !1,
8
- __name: "form",
9
- props: {
10
- form: {
11
- type: Object
12
- },
13
- previewTextPlaceholder: {
14
- type: String
15
- },
16
- onAutoSubmit: {
17
- type: Function
18
- },
19
- onAutoSubmitFailed: {
20
- type: Function
21
- }
22
- },
23
- setup(u) {
24
- const e = u, a = w();
25
- function f(m, r) {
26
- r.submit((t) => {
27
- var i;
28
- return (i = e.onAutoSubmit) == null ? void 0 : i.call(e, t);
29
- }).catch((t) => {
30
- var i;
31
- return (i = e.onAutoSubmitFailed) == null ? void 0 : i.call(e, t);
32
- });
33
- }
34
- return (m, r) => e.form ? (s(), d(o(y), {
35
- key: 0,
36
- form: e.form
37
- }, {
38
- default: n(() => [
39
- l(o(h), {
40
- placeholder: e.previewTextPlaceholder
41
- }, {
42
- default: n(() => [
43
- l(o(b), p(m.$attrs, {
44
- onSubmit: r[0] || (r[0] = (t) => f(t, u.form))
45
- }), {
46
- default: n(() => [
47
- c(m.$slots, "default")
48
- ]),
49
- _: 3
50
- }, 16)
51
- ]),
52
- _: 3
53
- }, 8, ["placeholder"])
54
- ]),
55
- _: 3
56
- }, 8, ["form"])) : o(a) ? (s(), d(o(h), {
57
- key: 1,
58
- placeholder: e.previewTextPlaceholder
59
- }, {
60
- default: n(() => [
61
- l(o(b), p(m.$attrs, {
62
- onSubmit: r[1] || (r[1] = v((t) => f(t, o(a)), ["prevent", "stop"]))
63
- }), {
64
- default: n(() => [
65
- c(m.$slots, "default")
66
- ]),
67
- _: 3
68
- }, 16)
69
- ]),
70
- _: 3
71
- }, 8, ["placeholder"])) : F("", !0);
72
- }
73
- });
74
- export {
75
- k as _
76
- };
77
- //# sourceMappingURL=form.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"form.mjs","sources":["../../src/form/form.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { Form as FormType, IFormFeedback } from '@formily/core'\nimport type { PropType } from 'vue'\nimport { FormProvider, useForm } from '@formily/vue'\nimport { FormLayout } from '../form-layout'\nimport { PreviewText } from '../preview-text'\n\ndefineOptions({\n name: 'FForm',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n form: {\n type: Object as PropType<FormType>,\n },\n previewTextPlaceholder: {\n type: String,\n },\n onAutoSubmit: {\n type: Function as PropType<(values: FormType['values']) => Promise<any>>,\n },\n onAutoSubmitFailed: {\n type: Function as PropType<(error: IFormFeedback[]) => void>,\n },\n})\n\nconst top = useForm()\n\nfunction handleSubmit(e: Event, form: FormType) {\n form\n .submit(values => props.onAutoSubmit?.(values))\n .catch(error => props.onAutoSubmitFailed?.(error))\n}\n</script>\n\n<template>\n <FormProvider v-if=\"props.form\" :form=\"props.form\">\n <PreviewText :placeholder=\"props.previewTextPlaceholder\">\n <FormLayout v-bind=\"$attrs\" @submit=\"(e) => handleSubmit(e, form)\">\n <slot />\n </FormLayout>\n </PreviewText>\n </FormProvider>\n <template v-else-if=\"top\">\n <PreviewText :placeholder=\"props.previewTextPlaceholder\">\n <FormLayout\n v-bind=\"$attrs\"\n @submit.prevent.stop=\"(e) => handleSubmit(e, top)\"\n >\n <slot />\n </FormLayout>\n </PreviewText>\n </template>\n</template>\n"],"names":["props","__props","top","useForm","handleSubmit","e","form","values","_a","error","_createBlock","_unref","FormProvider","_createVNode","PreviewText","FormLayout","_mergeProps","_ctx","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYA,UAAMA,IAAQC,GAeRC,IAAMC,EAAA;AAEZ,aAASC,EAAaC,GAAUC,GAAgB;AAC9C,MAAAA,EACG,OAAO,CAAAC,MAAA;;AAAU,gBAAAC,IAAAR,EAAM,iBAAN,gBAAAQ,EAAA,KAAAR,GAAqBO;AAAA,OAAO,EAC7C,MAAM,CAAAE,MAAA;;AAAS,gBAAAD,IAAAR,EAAM,uBAAN,gBAAAQ,EAAA,KAAAR,GAA2BS;AAAA,OAAM;AAAA,IACrD;qBAIsBT,EAAM,aAA1BU,EAMeC,EAAAC,CAAA,GAAA;AAAA;MANkB,MAAMZ,EAAM;AAAA,IAAA;iBAC3C,MAIc;AAAA,QAJda,EAIcF,EAAAG,CAAA,GAAA;AAAA,UAJA,aAAad,EAAM;AAAA,QAAA;qBAC/B,MAEa;AAAA,YAFba,EAEaF,EAAAI,CAAA,GAFbC,EAEaC,EAAA,QAFa;AAAA,cAAG,2BAASZ,MAAMD,EAAaC,GAAGJ,EAAA,IAAI;AAAA,YAAA;yBAC9D,MAAQ;AAAA,gBAARiB,EAAQD,EAAA,QAAA,SAAA;AAAA,cAAA;;;;;;;;uBAION,EAAAT,CAAA,UACnBQ,EAOcC,EAAAG,CAAA,GAAA;AAAA;MAPA,aAAad,EAAM;AAAA,IAAA;iBAC/B,MAKa;AAAA,QALba,EAKaF,EAAAI,CAAA,GALbC,EAKaC,EAAA,QAJG;AAAA,UACb,6BAAsBZ,MAAMD,EAAaC,GAAGM,EAAAT,CAAA,CAAG,GAAA,CAAA,WAAA,MAAA,CAAA;AAAA,QAAA;qBAEhD,MAAQ;AAAA,YAARgB,EAAQD,EAAA,QAAA,SAAA;AAAA,UAAA;;;;;;;;"}
@@ -1 +0,0 @@
1
- export { default, default as Form } from './form';
@@ -1,6 +0,0 @@
1
- import { _ as r, _ as e } from "./form.mjs";
2
- export {
3
- r as Form,
4
- e as default
5
- };
6
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,17 +0,0 @@
1
- declare function __VLS_template(): {
2
- attrs: Partial<{}>;
3
- slots: {
4
- default?(_: {}): any;
5
- };
6
- refs: {};
7
- rootEl: any;
8
- };
9
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
- declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
11
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
- export default _default;
13
- type __VLS_WithTemplateSlots<T, S> = T & {
14
- new (): {
15
- $slots: S;
16
- };
17
- };
@@ -1,48 +0,0 @@
1
- declare function __VLS_template(): {
2
- attrs: Partial<{}>;
3
- slots: {
4
- default?(_: {}): any;
5
- default?(_: {}): any;
6
- };
7
- refs: {};
8
- rootEl: any;
9
- };
10
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
12
- align: {
13
- type: StringConstructor;
14
- default: string;
15
- };
16
- gutter: {
17
- type: NumberConstructor;
18
- default: number;
19
- };
20
- alignFormItem: {
21
- type: BooleanConstructor;
22
- default: boolean;
23
- };
24
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
25
- align: {
26
- type: StringConstructor;
27
- default: string;
28
- };
29
- gutter: {
30
- type: NumberConstructor;
31
- default: number;
32
- };
33
- alignFormItem: {
34
- type: BooleanConstructor;
35
- default: boolean;
36
- };
37
- }>> & Readonly<{}>, {
38
- gutter: number;
39
- align: string;
40
- alignFormItem: boolean;
41
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
42
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
43
- export default _default;
44
- type __VLS_WithTemplateSlots<T, S> = T & {
45
- new (): {
46
- $slots: S;
47
- };
48
- };
@@ -1,87 +0,0 @@
1
- export declare const FormButtonGroup: {
2
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
3
- align: {
4
- type: StringConstructor;
5
- default: string;
6
- };
7
- gutter: {
8
- type: NumberConstructor;
9
- default: number;
10
- };
11
- alignFormItem: {
12
- type: BooleanConstructor;
13
- default: boolean;
14
- };
15
- }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
16
- gutter: number;
17
- align: string;
18
- alignFormItem: boolean;
19
- }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
20
- P: {};
21
- B: {};
22
- D: {};
23
- C: {};
24
- M: {};
25
- Defaults: {};
26
- }, Readonly<import('vue').ExtractPropTypes<{
27
- align: {
28
- type: StringConstructor;
29
- default: string;
30
- };
31
- gutter: {
32
- type: NumberConstructor;
33
- default: number;
34
- };
35
- alignFormItem: {
36
- type: BooleanConstructor;
37
- default: boolean;
38
- };
39
- }>> & Readonly<{}>, {}, {}, {}, {}, {
40
- gutter: number;
41
- align: string;
42
- alignFormItem: boolean;
43
- }>;
44
- __isFragment?: never;
45
- __isTeleport?: never;
46
- __isSuspense?: never;
47
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
48
- align: {
49
- type: StringConstructor;
50
- default: string;
51
- };
52
- gutter: {
53
- type: NumberConstructor;
54
- default: number;
55
- };
56
- alignFormItem: {
57
- type: BooleanConstructor;
58
- default: boolean;
59
- };
60
- }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
61
- gutter: number;
62
- align: string;
63
- alignFormItem: boolean;
64
- }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
65
- $slots: {
66
- default?(_: {}): any;
67
- default?(_: {}): any;
68
- };
69
- }) & {
70
- Sticky: {
71
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
72
- P: {};
73
- B: {};
74
- D: {};
75
- C: {};
76
- M: {};
77
- Defaults: {};
78
- }, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
79
- __isFragment?: never;
80
- __isTeleport?: never;
81
- __isSuspense?: never;
82
- } & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
83
- $slots: {
84
- default?(_: {}): any;
85
- };
86
- });
87
- };
@@ -1,90 +0,0 @@
1
- import { defineComponent as c, createBlock as s, openBlock as l, unref as t, mergeProps as a, withCtx as r, renderSlot as i, createVNode as d } from "vue";
2
- import { useAttrs as g, ElAffix as _, ElSpace as u } from "element-plus";
3
- import "@formily/reactive";
4
- import "@formily/core";
5
- import "@formily/reactive-vue";
6
- import { useForm as y } from "@formily/vue";
7
- import { composeExport as $ } from "../__builtins__/shared/utils.mjs";
8
- import { prefixCls as n } from "./utils.mjs";
9
- import { FormItem as k } from "../form-item/index.mjs";
10
- import '../styles/form-button-group/index.css';const F = /* @__PURE__ */ c({
11
- __name: "form-button-group-sticky",
12
- setup(m) {
13
- const e = g(), o = y();
14
- return (f, b) => {
15
- var p;
16
- return l(), s(t(_), a({
17
- class: `${t(n)}__sticky`
18
- }, t(e), {
19
- position: t(e).position ?? "bottom",
20
- target: t(e).target ?? `#formily-${(p = t(o)) == null ? void 0 : p.id}`
21
- }), {
22
- default: r(() => [
23
- i(f.$slots, "default")
24
- ]),
25
- _: 3
26
- }, 16, ["class", "position", "target"]);
27
- };
28
- }
29
- }), h = /* @__PURE__ */ c({
30
- name: "FFormButtonGroup",
31
- inheritAttrs: !1,
32
- __name: "form-button-group",
33
- props: {
34
- align: {
35
- type: String,
36
- default: "left"
37
- },
38
- gutter: {
39
- type: Number,
40
- default: 8
41
- },
42
- alignFormItem: {
43
- type: Boolean,
44
- default: !1
45
- }
46
- },
47
- setup(m) {
48
- const e = m;
49
- return (o, f) => e.alignFormItem ? (l(), s(t(k), a({
50
- key: 0,
51
- colon: !1,
52
- label: " "
53
- }, o.$attrs, {
54
- class: t(n),
55
- style: {
56
- width: "100%"
57
- }
58
- }), {
59
- default: r(() => [
60
- d(t(u), {
61
- size: e.gutter
62
- }, {
63
- default: r(() => [
64
- i(o.$slots, "default")
65
- ]),
66
- _: 3
67
- }, 8, ["size"])
68
- ]),
69
- _: 3
70
- }, 16, ["class"])) : (l(), s(t(u), a({ key: 1 }, o.$attrs, {
71
- class: t(n),
72
- style: {
73
- justifyContent: e.align === "left" ? "flex-start" : e.align === "right" ? "flex-end" : "center",
74
- display: "flex"
75
- },
76
- size: e.gutter
77
- }), {
78
- default: r(() => [
79
- i(o.$slots, "default")
80
- ]),
81
- _: 3
82
- }, 16, ["class", "style", "size"]));
83
- }
84
- }), G = $(h, {
85
- Sticky: F
86
- });
87
- export {
88
- G as FormButtonGroup
89
- };
90
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/form-button-group/form-button-group-sticky.vue","../../src/form-button-group/form-button-group.vue","../../src/form-button-group/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { AffixProps } from 'element-plus'\nimport type { ComputedRef } from 'vue'\nimport { useForm } from '@formily/vue'\nimport { ElAffix, useAttrs } from 'element-plus'\nimport { prefixCls } from './utils'\n\nconst attrs = useAttrs() as ComputedRef<Partial<AffixProps>>\nconst formRef = useForm()\n</script>\n\n<template>\n <ElAffix\n :class=\"`${prefixCls}__sticky`\"\n v-bind=\"attrs\"\n :position=\"attrs.position ?? 'bottom'\"\n :target=\"attrs.target ?? `#formily-${formRef?.id}`\"\n >\n <slot />\n </ElAffix>\n</template>\n","<script lang=\"ts\" setup>\nimport { ElSpace } from 'element-plus'\nimport FormItem from '../form-item/index'\nimport { prefixCls } from './utils'\n\ndefineOptions({\n name: 'FFormButtonGroup',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n align: {\n type: String,\n default: 'left',\n },\n gutter: {\n type: Number,\n default: 8,\n },\n alignFormItem: {\n type: Boolean,\n default: false,\n },\n})\n</script>\n\n<template>\n <FormItem\n v-if=\"props.alignFormItem\"\n :colon=\"false\"\n label=\" \"\n v-bind=\"$attrs\"\n :class=\"prefixCls\"\n :style=\"{\n width: '100%',\n }\"\n >\n <ElSpace :size=\"props.gutter\">\n <slot />\n </ElSpace>\n </FormItem>\n <ElSpace\n v-else\n v-bind=\"$attrs\"\n :class=\"prefixCls\"\n :style=\"{\n justifyContent: props.align === 'left'\n ? 'flex-start'\n : (props.align === 'right'\n ? 'flex-end'\n : 'center'),\n display: 'flex',\n }\"\n :size=\"props.gutter\"\n >\n <slot />\n </ElSpace>\n</template>\n","import { composeExport } from '../__builtins__/shared'\nimport FormButtonGroupSticky from './form-button-group-sticky.vue'\nimport FormButtonGroupInner from './form-button-group.vue'\nimport './style.scss'\n\nexport const FormButtonGroup = composeExport(FormButtonGroupInner, {\n Sticky: FormButtonGroupSticky,\n})\n"],"names":["attrs","useAttrs","formRef","useForm","_openBlock","_createBlock","_unref","_mergeProps","prefixCls","_renderSlot","_ctx","props","__props","$attrs","_createVNode","ElSpace","FormButtonGroup","composeExport","FormButtonGroupInner","FormButtonGroupSticky"],"mappings":";;;;;;;;;;;;AAOA,UAAMA,IAAQC,EAAA,GACRC,IAAUC,EAAA;;;AAId,aAAAC,KAAAC,EAOUC,MAPVC,EAOU;AAAA,QANP,UAAUD,EAAAE,CAAA,CAAS;AAAA,MAAA,GACZF,EAAAN,CAAA,GAAK;AAAA,QACZ,UAAUM,EAAAN,CAAA,EAAM,YAAQ;AAAA,QACxB,QAAQM,EAAAN,CAAA,EAAM,UAAM,aAAgBM,IAAAA,EAAAJ,CAAA,MAAAI,gBAAAA,EAAS,EAAE;AAAA,MAAA;mBAEhD,MAAQ;AAAA,UAARG,EAAQC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;ACRZ,UAAMC,IAAQC;qBAkBJD,EAAM,iBADdP,EAAA,GAAAC,EAaWC,MAbXC,EAaW;AAAA;MAXR,OAAO;AAAA,MACR,OAAM;AAAA,IAAA,GACEM,EAAAA,QAAM;AAAA,MACb,OAAOP,EAAAE,CAAA;AAAA,MACP,OAAO;AAAA;;IAEP;iBAED,MAEU;AAAA,QAFVM,EAEUR,EAAAS,CAAA,GAAA;AAAA,UAFA,MAAMJ,EAAM;AAAA,QAAA;qBACpB,MAAQ;AAAA,YAARF,EAAQC,EAAA,QAAA,SAAA;AAAA,UAAA;;;;;+BAGZL,EAeUC,EAAAS,CAAA,GAfVR,EAeU,EAAA,KAAA,EAAA,GAbAM,EAAAA,QAAM;AAAA,MACb,OAAOP,EAAAE,CAAA;AAAA,MACP,OAAK;AAAA,QAA0B,gBAAAG,EAAM,UAAK,wBAA8CA,EAAM,UAAK;;;MAQnG,MAAMA,EAAM;AAAA,IAAA;iBAEb,MAAQ;AAAA,QAARF,EAAQC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;IClDCM,IAAkBC,EAAcC,GAAsB;AAAA,EACjE,QAAQC;AACV,CAAC;"}
@@ -1 +0,0 @@
1
- export declare const prefixCls = "formily-element-plus-form-button-group";