ll-plus 2.7.16 → 2.7.17

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 (245) hide show
  1. package/es/components/advanced-filtering/index.d.ts +296 -296
  2. package/es/components/advanced-filtering/src/advanced-filtering.vue.d.ts +148 -148
  3. package/es/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +148 -148
  4. package/es/components/breadcrumb-card/index.d.ts +1 -1
  5. package/es/components/breadcrumb-card/src/breadcrumb-card.vue.d.ts +1 -1
  6. package/es/components/cascader/index.d.ts +8 -8
  7. package/es/components/cascader/src/cascader.vue.d.ts +8 -8
  8. package/es/components/checkbox/index.d.ts +217 -217
  9. package/es/components/checkbox/src/checkbox-group.vue.d.ts +217 -217
  10. package/es/components/checkbox/src/checkbox.d.ts +56 -56
  11. package/es/components/drawer/index.d.ts +5 -5
  12. package/es/components/drawer/src/components/second-confirmation/index.d.ts +1 -1
  13. package/es/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +1 -1
  14. package/es/components/drawer/src/drawer.vue.d.ts +5 -5
  15. package/es/components/easy-cron/index.d.ts +88 -88
  16. package/es/components/easy-cron/src/components/easy-cron-inner.vue.d.ts +88 -88
  17. package/es/components/easy-cron/src/components/easy-cron-modal.vue.d.ts +88 -88
  18. package/es/components/easy-cron/src/easy-cron.vue.d.ts +88 -88
  19. package/es/components/form/index.d.ts +148 -148
  20. package/es/components/form/src/components/form-component.vue.d.ts +1 -1
  21. package/es/components/form/src/config/form.d.ts +56 -56
  22. package/es/components/form/src/form.vue.d.ts +147 -147
  23. package/es/components/icon-picker/index.d.ts +1 -1
  24. package/es/components/icon-picker/src/components/modal.vue.d.ts +1 -1
  25. package/es/components/icon-picker/src/icon-picker.vue.d.ts +1 -1
  26. package/es/components/input/index.d.ts +33 -33
  27. package/es/components/input/src/input.vue.d.ts +33 -33
  28. package/es/components/key-value/index.d.ts +2 -16122
  29. package/es/components/key-value/src/components/key-value-item.vue.d.ts +329 -372
  30. package/es/components/key-value/src/config/key-value-item.d.ts +40 -291
  31. package/es/components/key-value/src/config/key-value.d.ts +23 -29
  32. package/es/components/key-value/src/key-value.vue.d.ts +1137 -1251
  33. package/es/components/modal/index.d.ts +1 -1
  34. package/es/components/modal/src/modal.vue.d.ts +1 -1
  35. package/es/components/new-drawer/index.d.ts +7 -7
  36. package/es/components/new-drawer/src/drawer.vue.d.ts +7 -7
  37. package/es/components/new-modal/index.d.ts +2 -2
  38. package/es/components/new-modal/src/modal.vue.d.ts +2 -2
  39. package/es/components/rich-text-editor/index.d.ts +1 -1
  40. package/es/components/rich-text-editor/src/rich-text-editor.vue.d.ts +1 -1
  41. package/es/components/select/index.d.ts +4 -4
  42. package/es/components/select/src/select.vue.d.ts +4 -4
  43. package/es/components/select-group/index.d.ts +2 -2
  44. package/es/components/select-group/src/select-group.d.ts +1 -1
  45. package/es/components/select-group/src/select-group.vue.d.ts +2 -2
  46. package/es/components/table/index.d.ts +6 -6
  47. package/es/components/table/src/components/main-table.vue.d.ts +2 -2
  48. package/es/components/table/src/config/table.d.ts +2 -2
  49. package/es/components/table/src/table.vue.d.ts +6 -6
  50. package/es/components/textarea/index.d.ts +5 -5
  51. package/es/components/textarea/src/textarea.vue.d.ts +5 -5
  52. package/es/components/tooltip/index.d.ts +4 -4
  53. package/es/components/tooltip/src/tooltip.d.ts +1 -1
  54. package/es/components/tooltip/src/tooltip.vue.d.ts +4 -4
  55. package/es/components/tree-search/index.d.ts +1 -1
  56. package/es/components/tree-search/src/tree-search.vue.d.ts +1 -1
  57. package/es/components/upload-drag/index.d.ts +2 -2
  58. package/es/components/upload-drag/src/upload-drag.vue.d.ts +2 -2
  59. package/es/index.mjs +1 -1
  60. package/es/packages/components/form/src/form.vue2.mjs +15 -9
  61. package/es/packages/components/form/src/form.vue2.mjs.map +1 -1
  62. package/es/packages/components/key-value/index.mjs.map +1 -1
  63. package/es/packages/components/key-value/src/components/key-value-item.vue2.mjs +16 -9
  64. package/es/packages/components/key-value/src/components/key-value-item.vue2.mjs.map +1 -1
  65. package/es/packages/components/key-value/src/config/key-value-item.mjs +26 -10
  66. package/es/packages/components/key-value/src/config/key-value-item.mjs.map +1 -1
  67. package/es/packages/components/key-value/src/config/key-value.mjs +3 -1
  68. package/es/packages/components/key-value/src/config/key-value.mjs.map +1 -1
  69. package/es/packages/components/key-value/src/key-value.vue2.mjs +61 -21
  70. package/es/packages/components/key-value/src/key-value.vue2.mjs.map +1 -1
  71. package/es/packages/utils/data.mjs +8 -1
  72. package/es/packages/utils/data.mjs.map +1 -1
  73. package/es/packages/utils/index.mjs +1 -1
  74. package/es/utils/data.d.ts +1 -0
  75. package/index.full.js +126 -48
  76. package/index.full.min.js +22 -22
  77. package/index.full.min.js.map +1 -1
  78. package/index.full.min.mjs +22 -22
  79. package/index.full.min.mjs.map +1 -1
  80. package/index.full.mjs +126 -49
  81. package/lib/components/advanced-filtering/index.d.ts +296 -296
  82. package/lib/components/advanced-filtering/src/advanced-filtering.vue.d.ts +148 -148
  83. package/lib/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +148 -148
  84. package/lib/components/breadcrumb-card/index.d.ts +1 -1
  85. package/lib/components/breadcrumb-card/src/breadcrumb-card.vue.d.ts +1 -1
  86. package/lib/components/cascader/index.d.ts +8 -8
  87. package/lib/components/cascader/src/cascader.vue.d.ts +8 -8
  88. package/lib/components/checkbox/index.d.ts +217 -217
  89. package/lib/components/checkbox/src/checkbox-group.vue.d.ts +217 -217
  90. package/lib/components/checkbox/src/checkbox.d.ts +56 -56
  91. package/lib/components/drawer/index.d.ts +5 -5
  92. package/lib/components/drawer/src/components/second-confirmation/index.d.ts +1 -1
  93. package/lib/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +1 -1
  94. package/lib/components/drawer/src/drawer.vue.d.ts +5 -5
  95. package/lib/components/easy-cron/index.d.ts +88 -88
  96. package/lib/components/easy-cron/src/components/easy-cron-inner.vue.d.ts +88 -88
  97. package/lib/components/easy-cron/src/components/easy-cron-modal.vue.d.ts +88 -88
  98. package/lib/components/easy-cron/src/easy-cron.vue.d.ts +88 -88
  99. package/lib/components/form/index.d.ts +148 -148
  100. package/lib/components/form/src/components/form-component.vue.d.ts +1 -1
  101. package/lib/components/form/src/config/form.d.ts +56 -56
  102. package/lib/components/form/src/form.vue.d.ts +147 -147
  103. package/lib/components/icon-picker/index.d.ts +1 -1
  104. package/lib/components/icon-picker/src/components/modal.vue.d.ts +1 -1
  105. package/lib/components/icon-picker/src/icon-picker.vue.d.ts +1 -1
  106. package/lib/components/input/index.d.ts +33 -33
  107. package/lib/components/input/src/input.vue.d.ts +33 -33
  108. package/lib/components/key-value/index.d.ts +2 -16122
  109. package/lib/components/key-value/src/components/key-value-item.vue.d.ts +329 -372
  110. package/lib/components/key-value/src/config/key-value-item.d.ts +40 -291
  111. package/lib/components/key-value/src/config/key-value.d.ts +23 -29
  112. package/lib/components/key-value/src/key-value.vue.d.ts +1137 -1251
  113. package/lib/components/modal/index.d.ts +1 -1
  114. package/lib/components/modal/src/modal.vue.d.ts +1 -1
  115. package/lib/components/new-drawer/index.d.ts +7 -7
  116. package/lib/components/new-drawer/src/drawer.vue.d.ts +7 -7
  117. package/lib/components/new-modal/index.d.ts +2 -2
  118. package/lib/components/new-modal/src/modal.vue.d.ts +2 -2
  119. package/lib/components/rich-text-editor/index.d.ts +1 -1
  120. package/lib/components/rich-text-editor/src/rich-text-editor.vue.d.ts +1 -1
  121. package/lib/components/select/index.d.ts +4 -4
  122. package/lib/components/select/src/select.vue.d.ts +4 -4
  123. package/lib/components/select-group/index.d.ts +2 -2
  124. package/lib/components/select-group/src/select-group.d.ts +1 -1
  125. package/lib/components/select-group/src/select-group.vue.d.ts +2 -2
  126. package/lib/components/table/index.d.ts +6 -6
  127. package/lib/components/table/src/components/main-table.vue.d.ts +2 -2
  128. package/lib/components/table/src/config/table.d.ts +2 -2
  129. package/lib/components/table/src/table.vue.d.ts +6 -6
  130. package/lib/components/textarea/index.d.ts +5 -5
  131. package/lib/components/textarea/src/textarea.vue.d.ts +5 -5
  132. package/lib/components/tooltip/index.d.ts +4 -4
  133. package/lib/components/tooltip/src/tooltip.d.ts +1 -1
  134. package/lib/components/tooltip/src/tooltip.vue.d.ts +4 -4
  135. package/lib/components/tree-search/index.d.ts +1 -1
  136. package/lib/components/tree-search/src/tree-search.vue.d.ts +1 -1
  137. package/lib/components/upload-drag/index.d.ts +2 -2
  138. package/lib/components/upload-drag/src/upload-drag.vue.d.ts +2 -2
  139. package/lib/index.js +1 -0
  140. package/lib/index.js.map +1 -1
  141. package/lib/packages/components/form/src/form.vue2.js +15 -9
  142. package/lib/packages/components/form/src/form.vue2.js.map +1 -1
  143. package/lib/packages/components/key-value/index.js.map +1 -1
  144. package/lib/packages/components/key-value/src/components/key-value-item.vue2.js +15 -8
  145. package/lib/packages/components/key-value/src/components/key-value-item.vue2.js.map +1 -1
  146. package/lib/packages/components/key-value/src/config/key-value-item.js +26 -10
  147. package/lib/packages/components/key-value/src/config/key-value-item.js.map +1 -1
  148. package/lib/packages/components/key-value/src/config/key-value.js +3 -1
  149. package/lib/packages/components/key-value/src/config/key-value.js.map +1 -1
  150. package/lib/packages/components/key-value/src/key-value.vue2.js +60 -20
  151. package/lib/packages/components/key-value/src/key-value.vue2.js.map +1 -1
  152. package/lib/packages/utils/data.js +8 -0
  153. package/lib/packages/utils/data.js.map +1 -1
  154. package/lib/packages/utils/index.js +1 -0
  155. package/lib/packages/utils/index.js.map +1 -1
  156. package/lib/utils/data.d.ts +1 -0
  157. package/package.json +1 -1
  158. package/theme-chalk/css/advanced-filtering.css +2 -2
  159. package/theme-chalk/css/api-component.css +2 -2
  160. package/theme-chalk/css/cascader.css +2 -2
  161. package/theme-chalk/css/checkbox.css +2 -2
  162. package/theme-chalk/css/code-editor.css +2 -2
  163. package/theme-chalk/css/color-picker.css +2 -2
  164. package/theme-chalk/css/cropper.css +2 -2
  165. package/theme-chalk/css/descriptions.css +2 -2
  166. package/theme-chalk/css/drawer.css +2 -2
  167. package/theme-chalk/css/dropdown-button-simple.css +2 -2
  168. package/theme-chalk/css/dropdown.css +2 -2
  169. package/theme-chalk/css/easy-cron.css +2 -2
  170. package/theme-chalk/css/form.css +2 -2
  171. package/theme-chalk/css/images.css +1 -1
  172. package/theme-chalk/css/index.css +3 -3
  173. package/theme-chalk/css/input-number.css +2 -2
  174. package/theme-chalk/css/input.css +2 -2
  175. package/theme-chalk/css/key-value.css +2 -2
  176. package/theme-chalk/css/markdown-editor.css +2 -2
  177. package/theme-chalk/css/modal.css +2 -2
  178. package/theme-chalk/css/new-drawer.css +2 -2
  179. package/theme-chalk/css/new-modal.css +2 -2
  180. package/theme-chalk/css/number-range.css +2 -2
  181. package/theme-chalk/css/rich-text-editor.css +2 -2
  182. package/theme-chalk/css/segmented.css +2 -2
  183. package/theme-chalk/css/switch.css +2 -2
  184. package/theme-chalk/css/table.css +2 -2
  185. package/theme-chalk/css/tabs-simple.css +2 -2
  186. package/theme-chalk/css/tag-group.css +2 -2
  187. package/types/packages/components/advanced-filtering/index.d.ts +296 -296
  188. package/types/packages/components/advanced-filtering/src/advanced-filtering.vue.d.ts +148 -148
  189. package/types/packages/components/advanced-filtering/src/components/advanced-filtering-params.vue.d.ts +148 -148
  190. package/types/packages/components/breadcrumb-card/index.d.ts +1 -1
  191. package/types/packages/components/breadcrumb-card/src/breadcrumb-card.vue.d.ts +1 -1
  192. package/types/packages/components/cascader/index.d.ts +8 -8
  193. package/types/packages/components/cascader/src/cascader.vue.d.ts +8 -8
  194. package/types/packages/components/checkbox/index.d.ts +217 -217
  195. package/types/packages/components/checkbox/src/checkbox-group.vue.d.ts +217 -217
  196. package/types/packages/components/checkbox/src/checkbox.d.ts +56 -56
  197. package/types/packages/components/drawer/index.d.ts +5 -5
  198. package/types/packages/components/drawer/src/components/second-confirmation/index.d.ts +1 -1
  199. package/types/packages/components/drawer/src/components/second-confirmation/src/second-confirmation.vue.d.ts +1 -1
  200. package/types/packages/components/drawer/src/drawer.vue.d.ts +5 -5
  201. package/types/packages/components/easy-cron/index.d.ts +88 -88
  202. package/types/packages/components/easy-cron/src/components/easy-cron-inner.vue.d.ts +88 -88
  203. package/types/packages/components/easy-cron/src/components/easy-cron-modal.vue.d.ts +88 -88
  204. package/types/packages/components/easy-cron/src/easy-cron.vue.d.ts +88 -88
  205. package/types/packages/components/form/index.d.ts +148 -148
  206. package/types/packages/components/form/src/components/form-component.vue.d.ts +1 -1
  207. package/types/packages/components/form/src/config/form.d.ts +56 -56
  208. package/types/packages/components/form/src/form.vue.d.ts +147 -147
  209. package/types/packages/components/icon-picker/index.d.ts +1 -1
  210. package/types/packages/components/icon-picker/src/components/modal.vue.d.ts +1 -1
  211. package/types/packages/components/icon-picker/src/icon-picker.vue.d.ts +1 -1
  212. package/types/packages/components/input/index.d.ts +33 -33
  213. package/types/packages/components/input/src/input.vue.d.ts +33 -33
  214. package/types/packages/components/key-value/index.d.ts +2 -16122
  215. package/types/packages/components/key-value/src/components/key-value-item.vue.d.ts +329 -372
  216. package/types/packages/components/key-value/src/config/key-value-item.d.ts +40 -291
  217. package/types/packages/components/key-value/src/config/key-value.d.ts +23 -29
  218. package/types/packages/components/key-value/src/key-value.vue.d.ts +1137 -1251
  219. package/types/packages/components/modal/index.d.ts +1 -1
  220. package/types/packages/components/modal/src/modal.vue.d.ts +1 -1
  221. package/types/packages/components/new-drawer/index.d.ts +7 -7
  222. package/types/packages/components/new-drawer/src/drawer.vue.d.ts +7 -7
  223. package/types/packages/components/new-modal/index.d.ts +2 -2
  224. package/types/packages/components/new-modal/src/modal.vue.d.ts +2 -2
  225. package/types/packages/components/rich-text-editor/index.d.ts +1 -1
  226. package/types/packages/components/rich-text-editor/src/rich-text-editor.vue.d.ts +1 -1
  227. package/types/packages/components/select/index.d.ts +4 -4
  228. package/types/packages/components/select/src/select.vue.d.ts +4 -4
  229. package/types/packages/components/select-group/index.d.ts +2 -2
  230. package/types/packages/components/select-group/src/select-group.d.ts +1 -1
  231. package/types/packages/components/select-group/src/select-group.vue.d.ts +2 -2
  232. package/types/packages/components/table/index.d.ts +6 -6
  233. package/types/packages/components/table/src/components/main-table.vue.d.ts +2 -2
  234. package/types/packages/components/table/src/config/table.d.ts +2 -2
  235. package/types/packages/components/table/src/table.vue.d.ts +6 -6
  236. package/types/packages/components/textarea/index.d.ts +5 -5
  237. package/types/packages/components/textarea/src/textarea.vue.d.ts +5 -5
  238. package/types/packages/components/tooltip/index.d.ts +4 -4
  239. package/types/packages/components/tooltip/src/tooltip.d.ts +1 -1
  240. package/types/packages/components/tooltip/src/tooltip.vue.d.ts +4 -4
  241. package/types/packages/components/tree-search/index.d.ts +1 -1
  242. package/types/packages/components/tree-search/src/tree-search.vue.d.ts +1 -1
  243. package/types/packages/components/upload-drag/index.d.ts +2 -2
  244. package/types/packages/components/upload-drag/src/upload-drag.vue.d.ts +2 -2
  245. package/types/packages/utils/data.d.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  import Tooltip from './src/tooltip.vue';
2
2
  export declare const LlTooltip: import("ll-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
3
3
  readonly tip: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "提示", boolean>;
4
- readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
4
+ readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
5
5
  readonly maxWidth: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
6
6
  readonly tipEllipsis: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
7
7
  readonly tipEllipsisLine: import("ll-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
@@ -21,7 +21,7 @@ export declare const LlTooltip: import("ll-plus/es/utils").SFCWithInstall<import
21
21
  readonly width: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
22
22
  }, {
23
23
  props: import("@vue/shared").LooseRequired<{
24
- readonly placement: import("ll-plus/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown>;
24
+ readonly placement: import("ll-plus/es/utils").EpPropMergeType<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown>;
25
25
  readonly maxWidth: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>;
26
26
  readonly width: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>;
27
27
  readonly tip: string;
@@ -65,7 +65,7 @@ export declare const LlTooltip: import("ll-plus/es/utils").SFCWithInstall<import
65
65
  }>;
66
66
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
67
67
  readonly tip: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "提示", boolean>;
68
- readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
68
+ readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
69
69
  readonly maxWidth: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
70
70
  readonly tipEllipsis: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
71
71
  readonly tipEllipsisLine: import("ll-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
@@ -84,7 +84,7 @@ export declare const LlTooltip: import("ll-plus/es/utils").SFCWithInstall<import
84
84
  readonly ellipsis: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
85
85
  readonly width: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
86
86
  }>>, {
87
- readonly placement: import("ll-plus/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown>;
87
+ readonly placement: import("ll-plus/es/utils").EpPropMergeType<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown>;
88
88
  readonly maxWidth: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>;
89
89
  readonly width: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>;
90
90
  readonly tip: string;
@@ -3,7 +3,7 @@ import type Tooltip from './tooltip.vue';
3
3
  export declare const placement: readonly ["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"];
4
4
  export declare const tooltipProps: {
5
5
  readonly tip: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "提示", boolean>;
6
- readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
6
+ readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
7
7
  readonly maxWidth: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
8
8
  readonly tipEllipsis: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
9
9
  readonly tipEllipsisLine: import("ll-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
@@ -1,6 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  readonly tip: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "提示", boolean>;
3
- readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
3
+ readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
4
4
  readonly maxWidth: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
5
5
  readonly tipEllipsis: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
6
6
  readonly tipEllipsisLine: import("ll-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
@@ -20,7 +20,7 @@ declare const _default: import("vue").DefineComponent<{
20
20
  readonly width: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
21
21
  }, {
22
22
  props: import("@vue/shared").LooseRequired<{
23
- readonly placement: import("ll-plus/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown>;
23
+ readonly placement: import("ll-plus/es/utils").EpPropMergeType<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown>;
24
24
  readonly maxWidth: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>;
25
25
  readonly width: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>;
26
26
  readonly tip: string;
@@ -64,7 +64,7 @@ declare const _default: import("vue").DefineComponent<{
64
64
  }>;
65
65
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
66
66
  readonly tip: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "提示", boolean>;
67
- readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
67
+ readonly placement: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown, "top", boolean>;
68
68
  readonly maxWidth: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
69
69
  readonly tipEllipsis: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
70
70
  readonly tipEllipsisLine: import("ll-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
@@ -83,7 +83,7 @@ declare const _default: import("vue").DefineComponent<{
83
83
  readonly ellipsis: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
84
84
  readonly width: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
85
85
  }>>, {
86
- readonly placement: import("ll-plus/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom" | "left" | "right" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown>;
86
+ readonly placement: import("ll-plus/es/utils").EpPropMergeType<StringConstructor, "left" | "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom", unknown>;
87
87
  readonly maxWidth: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>;
88
88
  readonly width: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>;
89
89
  readonly tip: string;
@@ -105,7 +105,7 @@ export declare const LlTreeSearch: import("ll-plus/es/utils").SFCWithInstall<imp
105
105
  readonly onCancel?: (() => any) | undefined;
106
106
  readonly onClickAdd?: (() => any) | undefined;
107
107
  } & {}>;
108
- emits: ((event: "cancel") => void) & ((event: "close") => void) & ((event: "select", selectedKeys: string[], e: Event) => void) & ((event: "ok") => void) & ((event: "expand", expandedKeys: string[], data: any) => void) & ((event: "clickAdd") => void);
108
+ emits: ((event: "close") => void) & ((event: "select", selectedKeys: string[], e: Event) => void) & ((event: "ok") => void) & ((event: "cancel") => void) & ((event: "expand", expandedKeys: string[], data: any) => void) & ((event: "clickAdd") => void);
109
109
  isCollapseMenu: import("vue").Ref<boolean>;
110
110
  newExpandedKeys: import("vue").Ref<string[]>;
111
111
  bem: {
@@ -104,7 +104,7 @@ declare const _default: import("vue").DefineComponent<{
104
104
  readonly onCancel?: (() => any) | undefined;
105
105
  readonly onClickAdd?: (() => any) | undefined;
106
106
  } & {}>;
107
- emits: ((event: "cancel") => void) & ((event: "close") => void) & ((event: "select", selectedKeys: string[], e: Event) => void) & ((event: "ok") => void) & ((event: "expand", expandedKeys: string[], data: any) => void) & ((event: "clickAdd") => void);
107
+ emits: ((event: "close") => void) & ((event: "select", selectedKeys: string[], e: Event) => void) & ((event: "ok") => void) & ((event: "cancel") => void) & ((event: "expand", expandedKeys: string[], data: any) => void) & ((event: "clickAdd") => void);
108
108
  isCollapseMenu: import("vue").Ref<boolean>;
109
109
  newExpandedKeys: import("vue").Ref<string[]>;
110
110
  bem: {
@@ -39,7 +39,7 @@ export declare const LlUploadDrag: import("ll-plus/es/utils").SFCWithInstall<imp
39
39
  readonly onCancel?: ((...args: any[]) => any) | undefined;
40
40
  readonly onCustomRequest?: ((...args: any[]) => any) | undefined;
41
41
  } & {}>;
42
- emits: (event: "cancel" | "update:value" | "confirm" | "customRequest", ...args: any[]) => void;
42
+ emits: (event: "update:value" | "confirm" | "customRequest" | "cancel", ...args: any[]) => void;
43
43
  bem: {
44
44
  b: (blockSuffix?: string) => string;
45
45
  e: (element?: string) => string;
@@ -61,7 +61,7 @@ export declare const LlUploadDrag: import("ll-plus/es/utils").SFCWithInstall<imp
61
61
  handleDragReject: () => void;
62
62
  handleClickCancelBtn: () => void;
63
63
  handleClickOkBtn: () => void;
64
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "update:value" | "confirm" | "customRequest")[], "cancel" | "update:value" | "confirm" | "customRequest", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
64
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "confirm" | "customRequest" | "cancel")[], "update:value" | "confirm" | "customRequest" | "cancel", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
65
65
  value: {
66
66
  type: ArrayConstructor;
67
67
  default: () => never[];
@@ -39,7 +39,7 @@ declare const _default: import("vue").DefineComponent<{
39
39
  readonly onCancel?: ((...args: any[]) => any) | undefined;
40
40
  readonly onCustomRequest?: ((...args: any[]) => any) | undefined;
41
41
  } & {}>;
42
- emits: (event: "cancel" | "update:value" | "confirm" | "customRequest", ...args: any[]) => void;
42
+ emits: (event: "update:value" | "confirm" | "customRequest" | "cancel", ...args: any[]) => void;
43
43
  bem: {
44
44
  b: (blockSuffix?: string) => string;
45
45
  e: (element?: string) => string;
@@ -61,7 +61,7 @@ declare const _default: import("vue").DefineComponent<{
61
61
  handleDragReject: () => void;
62
62
  handleClickCancelBtn: () => void;
63
63
  handleClickOkBtn: () => void;
64
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "update:value" | "confirm" | "customRequest")[], "cancel" | "update:value" | "confirm" | "customRequest", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
64
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:value" | "confirm" | "customRequest" | "cancel")[], "update:value" | "confirm" | "customRequest" | "cancel", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
65
65
  value: {
66
66
  type: ArrayConstructor;
67
67
  default: () => never[];
package/es/index.mjs CHANGED
@@ -146,7 +146,7 @@ export { isVNode } from 'vue';
146
146
  export { getType, isBoolean, isElement, isEmpty, isNumber, isPropAbsent, isStringNumber, isUndefined, isWindow } from './packages/utils/types.mjs';
147
147
  export { dataURLtoBlob, fileToBase64, formatFileSize } from './packages/utils/file.mjs';
148
148
  export { deepUnref } from './packages/utils/deep-unref.mjs';
149
- export { deepCompare, hasValue } from './packages/utils/data.mjs';
149
+ export { deepCompare, guid, hasValue } from './packages/utils/data.mjs';
150
150
  export { useScroll } from './packages/hooks/use-scroll/index.mjs';
151
151
 
152
152
  "use strict";
@@ -50,27 +50,33 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
50
50
  const validate = async () => {
51
51
  if (props.validateErrorStop) {
52
52
  clearValidate();
53
- let bool = true;
54
53
  if (!validateFields.value.length)
55
- return bool;
54
+ return Promise.resolve();
56
55
  for (const i of validateFields.value) {
57
- bool = await formRef.value.validateFields([i]);
58
- if (!bool) {
59
- return bool;
56
+ try {
57
+ await formRef.value.validateFields([i]);
58
+ } catch (error) {
59
+ return Promise.reject(error);
60
60
  }
61
61
  }
62
+ return Promise.resolve();
62
63
  } else {
63
- return await formRef.value.validateFields();
64
+ try {
65
+ await formRef.value.validateFields(validateFields.value);
66
+ return Promise.resolve();
67
+ } catch (error) {
68
+ return Promise.reject(error);
69
+ }
64
70
  }
65
71
  };
66
72
  const resetFields = async () => {
67
- return await formRef.value.resetFields();
73
+ await formRef.value.resetFields();
68
74
  };
69
75
  const clearValidate = async (nameList) => {
70
- return await formRef.value.clearValidate(nameList);
76
+ await formRef.value.clearValidate(nameList);
71
77
  };
72
78
  const scrollToField = async (name, options) => {
73
- return await formRef.value.scrollToField(name, options);
79
+ await formRef.value.scrollToField(name, options);
74
80
  };
75
81
  const getBindValue = (item) => {
76
82
  const obj = { ...item };
@@ -1 +1 @@
1
- {"version":3,"file":"form.vue2.mjs","sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <a-spin :spinning=\"props.loading\">\n <a-form\n v-bind=\"computedFormOptions\"\n :id=\"id\"\n ref=\"formRef\"\n :model=\"props.formData\"\n >\n <a-row v-bind=\"props.rowOptions\">\n <a-col\n v-for=\"(item, index) in computedFormColumns\"\n :key=\"index\"\n v-bind=\"item?.colOptions ?? {}\"\n :span=\"item?.spanCol ?? 24\"\n >\n <slot name=\"formItem\" :item=\"item\" :index=\"index\">\n <ll-form-item\n :name=\"item?.key ?? index\"\n :class=\"getFormItemClass(item)\"\n v-bind=\"getBindValue(item)\"\n >\n <template #label>\n <slot name=\"label\" :item=\"item\" :index=\"index\">\n <span>{{ item.label }}</span>\n <span v-if=\"item?.tip\" :class=\"bem.e('tooltip-wrapper')\">\n <ll-tooltip\n style=\"margin-left: 8px\"\n :overlay-class-name=\"bem.e('tooltip')\"\n :arrow-point-at-center=\"true\"\n :max-width=\"item?.tipConfig?.maxWidth ?? 406\"\n :placement=\"item?.tipConfig?.placement ?? 'top'\"\n :tip=\"item.tip\"\n :font-size=\"'16px'\"\n v-bind=\"item?.tipConfig\"\n />\n </span>\n </slot>\n </template>\n <slot name=\"content\" :item=\"item\" :index=\"index\">\n <template v-if=\"!isEmpty(item.children)\">\n <a-row :gutter=\"5\" v-bind=\"item.rowOptions\">\n <a-col\n v-for=\"(child, childIndex) in item.children\"\n :key=\"childIndex\"\n :style=\"{\n display: 'flex',\n 'align-items': 'center'\n }\"\n v-bind=\"item?.colOptions ?? {}\"\n >\n <slot name=\"children\" :item=\"child\" :index=\"index\">\n <form-component\n :item=\"child\"\n :form-data=\"formData\"\n @change-field=\"handleChangeField\"\n />\n </slot>\n </a-col>\n </a-row>\n </template>\n <form-component\n v-else\n :ref=\"el => (formComponents[index] = el)\"\n :item=\"item\"\n :form-data=\"formData\"\n @change-field=\"handleChangeField\"\n />\n </slot>\n </ll-form-item>\n </slot>\n </a-col>\n </a-row>\n </a-form>\n </a-spin>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { reactive, ref, watch, onMounted, nextTick, computed } from 'vue'\nimport { omit, isEmpty, has } from 'lodash-es'\nimport { formProps, formEmits, type FormColumn } from './config'\n\nimport type { NamePath } from 'ant-design-vue/es/form/interface'\n\nimport { createNamespace, deepUnref } from '@ll-plus/utils'\n\nimport formComponent from './components/form-component.vue'\n\n// 定义组件名称\ndefineOptions({ name: 'LlForm' })\n\n// Props\nconst props = defineProps(formProps)\n\nconst emits = defineEmits(formEmits)\n\nconst bem = createNamespace('form')\n\nconst formData = reactive(props.formData)\n\nconst formRef = ref()\n\nconst formComponents = ref<InstanceType<typeof formComponent>[]>(\n [] as InstanceType<typeof formComponent>[]\n)\n\nconst computedFormColumns = computed(() => {\n const formColumns = deepUnref(props.formColumns) as FormColumn[]\n return formColumns.map(e => {\n e.disabled = has(e, 'disabled') ? e.disabled : props.disabled\n if (e.children && e.children.length) {\n e.children.map(a => {\n a.disabled = has(a, 'disabled') ? a.disabled : props.disabled\n return a\n })\n }\n return e\n })\n})\n\nconst validateFields = computed(() => {\n return props.formColumns\n .filter(e => e.required || (has(e, 'rules') && e.rules.length > 0))\n .map(e => {\n return e.key\n })\n})\n\nconst computedFormOptions = computed(() => {\n return {\n scrollToFirstError: !props.validateErrorStop,\n ...props.formOptions\n }\n})\n\nconst id = ref(`ll-form-${+new Date()}`)\n\nconst validate = async () => {\n if (props.validateErrorStop) {\n clearValidate()\n let bool = true\n if (!validateFields.value.length) return bool\n for (const i of validateFields.value) {\n bool = await formRef.value.validateFields([i])\n if (!bool) {\n return bool\n }\n }\n } else {\n return await formRef.value.validateFields()\n }\n}\n\nconst resetFields = async () => {\n return await formRef.value.resetFields()\n}\n\nconst clearValidate = async (nameList?: NamePath[]) => {\n return await formRef.value.clearValidate(nameList)\n}\n\nconst scrollToField = async (name: NamePath, options?: ScrollOptions) => {\n return await formRef.value.scrollToField(name, options)\n}\n\nconst getBindValue = (item: FormColumn) => {\n const obj = { ...item }\n return omit(obj, ['label'])\n}\n\nconst getFormItemClass = (item = {} as FormColumn) => {\n if (props.formOptions.layout === 'horizontal') {\n if (item?.labelCol) {\n return item.labelCol.span && item.labelCol.span >= 24\n ? bem.is('label-top')\n : bem.is('label-left')\n } else {\n return bem.is('label-left')\n }\n }\n return bem.is('label-top')\n}\n\nconst handleChangeField = (item: FormColumn) => {\n emits('change', { item, value: formData[item.key], formData })\n}\n\nwatch(\n () => props.formData,\n async val => {\n for (const i in val) {\n formData[i] = val[i]\n }\n },\n {\n deep: true,\n immediate: true\n }\n)\n\nonMounted(async () => {\n await nextTick()\n if (props.autoFocus) {\n for (const element of formComponents.value) {\n const item = element?.getItem()\n if (['input', 'textarea', 'input-number'].includes(item.type)) {\n element?.focus()\n break\n }\n }\n }\n})\n\ndefineExpose({\n validate,\n resetFields,\n clearValidate,\n scrollToField\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA4FA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAM,MAAA,GAAA,GAAM,gBAAgB,MAAM,CAAA,CAAA;AAElC,IAAM,MAAA,QAAA,GAAW,QAAS,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAExC,IAAA,MAAM,UAAU,GAAI,EAAA,CAAA;AAEpB,IAAA,MAAM,cAAiB,GAAA,GAAA;AAAA,MACrB,EAAC;AAAA,KACH,CAAA;AAEA,IAAM,MAAA,mBAAA,GAAsB,SAAS,MAAM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AAA,CAAA;AAC9B,UAAI,IAAA,CAAC,SAAS,UAAY,EAAA,cAAc,EAAE,QAAS,CAAA,IAAA,CAAK,IAAI,CAAG,EAAA;AAC7D,YAAA,OAAA,EAAS,KAAM,EAAA,CAAA;AACf,YAAA,MAAA;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,QAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"form.vue2.mjs","sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <a-spin :spinning=\"props.loading\">\n <a-form\n v-bind=\"computedFormOptions\"\n :id=\"id\"\n ref=\"formRef\"\n :model=\"props.formData\"\n >\n <a-row v-bind=\"props.rowOptions\">\n <a-col\n v-for=\"(item, index) in computedFormColumns\"\n :key=\"index\"\n v-bind=\"item?.colOptions ?? {}\"\n :span=\"item?.spanCol ?? 24\"\n >\n <slot name=\"formItem\" :item=\"item\" :index=\"index\">\n <ll-form-item\n :name=\"item?.key ?? index\"\n :class=\"getFormItemClass(item)\"\n v-bind=\"getBindValue(item)\"\n >\n <template #label>\n <slot name=\"label\" :item=\"item\" :index=\"index\">\n <span>{{ item.label }}</span>\n <span v-if=\"item?.tip\" :class=\"bem.e('tooltip-wrapper')\">\n <ll-tooltip\n style=\"margin-left: 8px\"\n :overlay-class-name=\"bem.e('tooltip')\"\n :arrow-point-at-center=\"true\"\n :max-width=\"item?.tipConfig?.maxWidth ?? 406\"\n :placement=\"item?.tipConfig?.placement ?? 'top'\"\n :tip=\"item.tip\"\n :font-size=\"'16px'\"\n v-bind=\"item?.tipConfig\"\n />\n </span>\n </slot>\n </template>\n <slot name=\"content\" :item=\"item\" :index=\"index\">\n <template v-if=\"!isEmpty(item.children)\">\n <a-row :gutter=\"5\" v-bind=\"item.rowOptions\">\n <a-col\n v-for=\"(child, childIndex) in item.children\"\n :key=\"childIndex\"\n :style=\"{\n display: 'flex',\n 'align-items': 'center'\n }\"\n v-bind=\"item?.colOptions ?? {}\"\n >\n <slot name=\"children\" :item=\"child\" :index=\"index\">\n <form-component\n :item=\"child\"\n :form-data=\"formData\"\n @change-field=\"handleChangeField\"\n />\n </slot>\n </a-col>\n </a-row>\n </template>\n <form-component\n v-else\n :ref=\"el => (formComponents[index] = el)\"\n :item=\"item\"\n :form-data=\"formData\"\n @change-field=\"handleChangeField\"\n />\n </slot>\n </ll-form-item>\n </slot>\n </a-col>\n </a-row>\n </a-form>\n </a-spin>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { reactive, ref, watch, onMounted, nextTick, computed } from 'vue'\nimport { omit, isEmpty, has } from 'lodash-es'\nimport { formProps, formEmits, type FormColumn } from './config'\n\nimport type { NamePath } from 'ant-design-vue/es/form/interface'\n\nimport { createNamespace, deepUnref } from '@ll-plus/utils'\n\nimport formComponent from './components/form-component.vue'\n\n// 定义组件名称\ndefineOptions({ name: 'LlForm' })\n\n// Props\nconst props = defineProps(formProps)\n\nconst emits = defineEmits(formEmits)\n\nconst bem = createNamespace('form')\n\nconst formData = reactive(props.formData)\n\nconst formRef = ref()\n\nconst formComponents = ref<InstanceType<typeof formComponent>[]>(\n [] as InstanceType<typeof formComponent>[]\n)\n\nconst computedFormColumns = computed(() => {\n const formColumns = deepUnref(props.formColumns) as FormColumn[]\n return formColumns.map(e => {\n e.disabled = has(e, 'disabled') ? e.disabled : props.disabled\n if (e.children && e.children.length) {\n e.children.map(a => {\n a.disabled = has(a, 'disabled') ? a.disabled : props.disabled\n return a\n })\n }\n return e\n })\n})\n\nconst validateFields = computed(() => {\n return props.formColumns\n .filter(e => e.required || (has(e, 'rules') && e.rules.length > 0))\n .map(e => {\n return e.key\n })\n})\n\nconst computedFormOptions = computed(() => {\n return {\n scrollToFirstError: !props.validateErrorStop,\n ...props.formOptions\n }\n})\n\nconst id = ref(`ll-form-${+new Date()}`)\n\nconst validate = async () => {\n if (props.validateErrorStop) {\n clearValidate()\n if (!validateFields.value.length) return Promise.resolve()\n for (const i of validateFields.value) {\n try {\n await formRef.value.validateFields([i])\n } catch (error) {\n return Promise.reject(error) // 跳出验证循环并返回错误\n }\n }\n return Promise.resolve()\n } else {\n try {\n await formRef.value.validateFields(validateFields.value)\n return Promise.resolve()\n } catch (error) {\n return Promise.reject(error)\n }\n }\n}\n\nconst resetFields = async () => {\n await formRef.value.resetFields()\n}\n\nconst clearValidate = async (nameList?: NamePath[]) => {\n await formRef.value.clearValidate(nameList)\n}\n\nconst scrollToField = async (name: NamePath, options?: ScrollOptions) => {\n await formRef.value.scrollToField(name, options)\n}\n\nconst getBindValue = (item: FormColumn) => {\n const obj = { ...item }\n return omit(obj, ['label'])\n}\n\nconst getFormItemClass = (item = {} as FormColumn) => {\n if (props.formOptions.layout === 'horizontal') {\n if (item?.labelCol) {\n return item.labelCol.span && item.labelCol.span >= 24\n ? bem.is('label-top')\n : bem.is('label-left')\n } else {\n return bem.is('label-left')\n }\n }\n return bem.is('label-top')\n}\n\nconst handleChangeField = (item: FormColumn) => {\n emits('change', { item, value: formData[item.key], formData })\n}\n\nwatch(\n () => props.formData,\n async val => {\n for (const i in val) {\n formData[i] = val[i]\n }\n },\n {\n deep: true,\n immediate: true\n }\n)\n\nonMounted(async () => {\n await nextTick()\n if (props.autoFocus) {\n for (const element of formComponents.value) {\n const item = element?.getItem()\n if (['input', 'textarea', 'input-number'].includes(item.type)) {\n element?.focus()\n break\n }\n }\n }\n})\n\ndefineExpose({\n validate,\n resetFields,\n clearValidate,\n scrollToField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/components/key-value/index.ts"],"sourcesContent":["import { withInstall } from '@ll-plus/utils'\n\nimport KeyValue from './src/key-value.vue'\n\nexport const LlKeyValue = withInstall(KeyValue)\n\nexport default LlKeyValue\n\nexport * from './src/config'\n\ndeclare module 'vue' {\n export interface GlobalComponents {\n LlKeyValue: typeof KeyValue\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAIa,MAAA,UAAA,GAAa,YAAY,QAAQ;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/components/key-value/index.ts"],"sourcesContent":["import { withInstall, type SFCWithInstall } from '@ll-plus/utils'\n\nimport KeyValue from './src/key-value.vue'\n\nexport const LlKeyValue: SFCWithInstall<typeof KeyValue> = withInstall(KeyValue)\n\nexport default LlKeyValue\n\nexport * from './src/config'\n\ndeclare module 'vue' {\n export interface GlobalComponents {\n LlKeyValue: typeof KeyValue\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAIa,MAAA,UAAA,GAA8C,YAAY,QAAQ;;;;"}
@@ -1,4 +1,4 @@
1
- import { defineComponent, useAttrs, ref, computed, watch, nextTick, resolveComponent, openBlock, createBlock, unref, withCtx, createElementBlock, normalizeClass, createVNode, renderSlot, resolveDynamicComponent, mergeProps, createSlots, renderList, createCommentVNode, normalizeStyle, createTextVNode, createElementVNode, normalizeProps, guardReactiveProps } from 'vue';
1
+ import { defineComponent, useAttrs, ref, computed, nextTick, watch, resolveComponent, openBlock, createBlock, unref, withCtx, createElementBlock, normalizeClass, createVNode, renderSlot, resolveDynamicComponent, mergeProps, createSlots, renderList, createCommentVNode, normalizeStyle, createTextVNode, createElementVNode, normalizeProps, guardReactiveProps } from 'vue';
2
2
  import { isEmpty } from 'lodash-es';
3
3
  import '../../../../utils/index.mjs';
4
4
  import '../config/index.mjs';
@@ -19,7 +19,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  const attrs = useAttrs();
20
20
  const bem = createNamespace("key-value");
21
21
  const innerValue = ref(props.value);
22
- const form = ref();
22
+ const formRef = ref();
23
23
  const getKeyType = computed(() => {
24
24
  const option = props.keyType;
25
25
  return option;
@@ -48,16 +48,23 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
48
48
  };
49
49
  const handleChange = async () => {
50
50
  innerValue.value["value"] = null;
51
- await form.value?.clearValidate();
51
+ await formRef.value?.clearValidate();
52
52
  };
53
53
  const validate = async () => {
54
- return await form.value?.validate();
54
+ await nextTick();
55
+ try {
56
+ await formRef.value?.validate();
57
+ return Promise.resolve();
58
+ } catch (error) {
59
+ console.log({ error }, props.idx);
60
+ return Promise.reject();
61
+ }
55
62
  };
56
63
  const resetFields = async () => {
57
- return await form.value?.resetFields();
64
+ await formRef.value?.resetFields();
58
65
  };
59
66
  const clearValidate = async (namePath) => {
60
- return await form.value?.clearValidate(namePath);
67
+ await formRef.value?.clearValidate(namePath);
61
68
  };
62
69
  watch(
63
70
  innerValue,
@@ -88,8 +95,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
88
95
  const _component_a_popconfirm = resolveComponent("a-popconfirm");
89
96
  const _component_ll_form = resolveComponent("ll-form");
90
97
  return openBlock(), createBlock(_component_ll_form, {
91
- ref_key: "form",
92
- ref: form,
98
+ ref_key: "formRef",
99
+ ref: formRef,
93
100
  "form-columns": unref(formColumns),
94
101
  "form-data": props.value,
95
102
  "form-options": unref(formOptions)
@@ -190,7 +197,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
190
197
  name: "value"
191
198
  }, {
192
199
  default: withCtx(() => [
193
- renderSlot(_ctx.$slots, "value-warapper", normalizeProps(guardReactiveProps(getValueType.value)), () => [
200
+ renderSlot(_ctx.$slots, "value-wrapper", normalizeProps(guardReactiveProps(getValueType.value)), () => [
194
201
  (openBlock(), createBlock(resolveDynamicComponent(`ll-${getValueType.value.type}`), mergeProps({
195
202
  value: innerValue.value["value"],
196
203
  "onUpdate:value": _cache[2] || (_cache[2] = ($event) => innerValue.value["value"] = $event),
@@ -1 +1 @@
1
- {"version":3,"file":"key-value-item.vue2.mjs","sources":["../../../../../../../packages/components/key-value/src/components/key-value-item.vue"],"sourcesContent":["<template>\n <ll-form\n ref=\"form\"\n :form-columns=\"formColumns\"\n :form-data=\"props.value\"\n :form-options=\"formOptions\"\n >\n <template #formItem=\"{ item }\">\n <template v-if=\"item.key === 'other'\">\n <div :class=\"bem.e('item')\">\n <div v-if=\"props.keyValueType !== 'single'\" :class=\"bem.m('left')\">\n <ll-form-item\n :label=\"attrs['key-label']\"\n :label-col=\"{\n span: 24\n }\"\n :rules=\"getKeyType.rules || []\"\n name=\"key\"\n >\n <slot name=\"key\">\n <ll-select\n v-if=\"!isEmpty(props.keyTypes)\"\n v-model:value=\"innerValue['key']\"\n :options=\"props.keyTypes\"\n :disabled=\"getKeyDisabled\"\n style=\"width: 100%\"\n placeholder=\"请选择\"\n allow-clear\n @change=\"handleChange\"\n />\n <component\n :is=\"`ll-${getKeyType.type}`\"\n v-else\n v-model:value=\"innerValue['key']\"\n v-bind=\"getKeyType\"\n :disabled=\"getKeyDisabled\"\n style=\"width: 100%\"\n >\n <template\n v-for=\"_item in Object.keys($slots)\"\n :key=\"_item\"\n #[_item]=\"data\"\n >\n <slot\n :name=\"_item\"\n v-bind=\"data || {}\"\n content=\"key\"\n ></slot>\n </template>\n </component>\n </slot>\n </ll-form-item>\n </div>\n\n <div\n v-if=\"props.keyValueType !== 'single'\"\n :class=\"bem.m('separator')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label'] ? '26px' : '0px'\n }\"\n >\n <slot name=\"separator\">~</slot>\n </div>\n\n <div :class=\"bem.m('right')\">\n <ll-form-item\n :label=\"attrs['value-label']\"\n :label-col=\"{\n span: 24\n }\"\n :rules=\"getValueType.rules || []\"\n name=\"value\"\n >\n <slot name=\"value-warapper\" v-bind=\"getValueType\">\n <component\n :is=\"`ll-${getValueType.type}`\"\n v-model:value=\"innerValue['value']\"\n :disabled=\"getValueDisabled\"\n style=\"width: 100%\"\n v-bind=\"getValueType\"\n >\n <template\n v-for=\"_item in Object.keys($slots)\"\n :key=\"_item\"\n #[_item]=\"data\"\n >\n <slot\n :name=\"_item\"\n v-bind=\"data || {}\"\n content=\"value\"\n ></slot>\n </template>\n </component>\n </slot>\n </ll-form-item>\n </div>\n <template v-if=\"hasValue\">\n <a-popconfirm\n title=\"确定要移除吗?\"\n ok-text=\"确认\"\n cancel-text=\"取消\"\n placement=\"topRight\"\n :overlay-class-name=\"bem.m('popconfirm')\"\n :get-popup-container=\"(trigger: Element) => trigger.parentNode\"\n destroy-tooltip-on-hide\n @confirm=\"handleDelete\"\n >\n <div\n :class=\"bem.m('delete')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label']\n ? '26px'\n : '0px'\n }\"\n >\n <ll-button type=\"link\" :disabled=\"getDeleteDisabled\">\n <slot name=\"delete-icon\">\n <ll-icon icon-name=\"icon-remove\" class=\"delete\" />\n </slot>\n </ll-button>\n </div>\n </a-popconfirm>\n </template>\n <div\n v-else\n :class=\"bem.m('delete')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label'] ? '26px' : '0px'\n }\"\n >\n <ll-button\n type=\"link\"\n :disabled=\"getDeleteDisabled\"\n @click=\"handleDelete\"\n >\n <slot name=\"delete-icon\">\n <ll-icon icon-name=\"icon-remove\" class=\"delete\" />\n </slot>\n </ll-button>\n </div>\n </div>\n </template>\n </template>\n </ll-form>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watch, nextTick } from 'vue'\nimport { isEmpty } from 'lodash-es'\nimport { createNamespace } from '@ll-plus/utils'\nimport type { FormInstance } from '@ll-plus/components'\nimport {\n keyValueItemProps,\n keyValueItemEmits,\n formColumns,\n formOptions\n} from '../config'\nimport { type FormColumn } from '@ll-plus/components'\nimport type { NamePath } from 'ant-design-vue/es/form/interface'\n\ndefineOptions({\n name: 'LlKeyValueItem'\n})\n\nconst props = defineProps(keyValueItemProps)\nconst emits = defineEmits(keyValueItemEmits)\n\nconst attrs = useAttrs()\nconst bem = createNamespace('key-value')\nconst innerValue = ref(props.value)\n\nconst form = ref<FormInstance | null>()\n\nconst getKeyType = computed<FormColumn>(() => {\n const option = props.keyType\n return option\n})\nconst getValueType = computed<FormColumn>(() => {\n let option = props.valueType\n if (innerValue.value['key'] && !isEmpty(props.keyValueTypeDict)) {\n option = props.keyValueTypeDict[innerValue.value['key']]\n }\n return option\n})\n\nconst getKeyDisabled = computed(() => {\n return (\n props.disabledKey?.includes(props.idx) ||\n props.disabled ||\n getKeyType.value?.disabled\n )\n})\n\nconst getValueDisabled = computed(() => {\n return (\n props.disabledValue?.includes(props.idx) ||\n props.disabled ||\n getValueType.value?.disabled\n )\n})\n\nconst hasValue = computed(() => {\n return (\n innerValue.value['key'] ||\n innerValue.value['key'] === 0 ||\n innerValue.value['value']\n )\n})\n\nconst getDeleteDisabled = computed(() => {\n return (\n props.disabledDelete?.includes(props.idx) ||\n props.disabled ||\n (props.values.length === 1 && !hasValue.value)\n )\n})\n\nconst handleDelete = () => {\n emits('delete')\n}\n\nconst handleChange = async () => {\n innerValue.value['value'] = null\n await form.value?.clearValidate()\n}\n\nconst validate = async () => {\n return await form.value?.validate()\n}\n\nconst resetFields = async () => {\n return await form.value?.resetFields()\n}\nconst clearValidate = async (namePath?: NamePath[]) => {\n return await form.value?.clearValidate(namePath)\n}\n\nwatch(\n innerValue,\n async val => {\n await nextTick().then(() => {\n try {\n emits('update:value', val)\n emits('change')\n } catch (error) {\n console.error(error)\n }\n })\n },\n {\n deep: true\n }\n)\n\ndefineExpose({\n validate,\n resetFields,\n clearValidate\n})\n</script>\n\n<style scoped></style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuKA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAM,MAAA,GAAA,GAAM,gBAAgB,WAAW,C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WACrB;AAAA,SACD,CAAA,CAAA;AAAA,OACH;AAAA,MACA;AAAA,QACE,IAAM,EAAA,IAAA;AAAA,OACR;AAAA,KACF,CAAA;AAEA,IAAa,QAAA,CAAA;AAAA,MACX,QAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"key-value-item.vue2.mjs","sources":["../../../../../../../packages/components/key-value/src/components/key-value-item.vue"],"sourcesContent":["<template>\n <ll-form\n ref=\"formRef\"\n :form-columns=\"formColumns\"\n :form-data=\"props.value\"\n :form-options=\"formOptions\"\n >\n <template #formItem=\"{ item }\">\n <template v-if=\"item.key === 'other'\">\n <div :class=\"bem.e('item')\">\n <div v-if=\"props.keyValueType !== 'single'\" :class=\"bem.m('left')\">\n <ll-form-item\n :label=\"attrs['key-label']\"\n :label-col=\"{\n span: 24\n }\"\n :rules=\"getKeyType.rules || []\"\n name=\"key\"\n >\n <slot name=\"key\">\n <ll-select\n v-if=\"!isEmpty(props.keyTypes)\"\n v-model:value=\"innerValue['key']\"\n :options=\"props.keyTypes\"\n :disabled=\"getKeyDisabled\"\n style=\"width: 100%\"\n placeholder=\"请选择\"\n allow-clear\n @change=\"handleChange\"\n />\n <component\n :is=\"`ll-${getKeyType.type}`\"\n v-else\n v-model:value=\"innerValue['key']\"\n v-bind=\"getKeyType\"\n :disabled=\"getKeyDisabled\"\n style=\"width: 100%\"\n >\n <template\n v-for=\"_item in Object.keys($slots)\"\n :key=\"_item\"\n #[_item]=\"data\"\n >\n <slot\n :name=\"_item\"\n v-bind=\"data || {}\"\n content=\"key\"\n ></slot>\n </template>\n </component>\n </slot>\n </ll-form-item>\n </div>\n\n <div\n v-if=\"props.keyValueType !== 'single'\"\n :class=\"bem.m('separator')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label'] ? '26px' : '0px'\n }\"\n >\n <slot name=\"separator\">~</slot>\n </div>\n\n <div :class=\"bem.m('right')\">\n <ll-form-item\n :label=\"attrs['value-label']\"\n :label-col=\"{\n span: 24\n }\"\n :rules=\"getValueType.rules || []\"\n name=\"value\"\n >\n <slot name=\"value-wrapper\" v-bind=\"getValueType\">\n <component\n :is=\"`ll-${getValueType.type}`\"\n v-model:value=\"innerValue['value']\"\n :disabled=\"getValueDisabled\"\n style=\"width: 100%\"\n v-bind=\"getValueType\"\n >\n <template\n v-for=\"_item in Object.keys($slots)\"\n :key=\"_item\"\n #[_item]=\"data\"\n >\n <slot\n :name=\"_item\"\n v-bind=\"data || {}\"\n content=\"value\"\n ></slot>\n </template>\n </component>\n </slot>\n </ll-form-item>\n </div>\n <template v-if=\"hasValue\">\n <a-popconfirm\n title=\"确定要移除吗?\"\n ok-text=\"确认\"\n cancel-text=\"取消\"\n placement=\"topRight\"\n :overlay-class-name=\"bem.m('popconfirm')\"\n :get-popup-container=\"(trigger: Element) => trigger.parentNode\"\n destroy-tooltip-on-hide\n @confirm=\"handleDelete\"\n >\n <div\n :class=\"bem.m('delete')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label']\n ? '26px'\n : '0px'\n }\"\n >\n <ll-button type=\"link\" :disabled=\"getDeleteDisabled\">\n <slot name=\"delete-icon\">\n <ll-icon icon-name=\"icon-remove\" class=\"delete\" />\n </slot>\n </ll-button>\n </div>\n </a-popconfirm>\n </template>\n <div\n v-else\n :class=\"bem.m('delete')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label'] ? '26px' : '0px'\n }\"\n >\n <ll-button\n type=\"link\"\n :disabled=\"getDeleteDisabled\"\n @click=\"handleDelete\"\n >\n <slot name=\"delete-icon\">\n <ll-icon icon-name=\"icon-remove\" class=\"delete\" />\n </slot>\n </ll-button>\n </div>\n </div>\n </template>\n </template>\n </ll-form>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watch, nextTick } from 'vue'\nimport { isEmpty } from 'lodash-es'\nimport { createNamespace } from '@ll-plus/utils'\nimport type { FormInstance } from '@ll-plus/components'\nimport {\n keyValueItemProps,\n keyValueItemEmits,\n formColumns,\n formOptions\n} from '../config'\nimport { type FormColumn } from '@ll-plus/components'\nimport type { NamePath } from 'ant-design-vue/es/form/interface'\n\ndefineOptions({\n name: 'LlKeyValueItem'\n})\n\nconst props = defineProps(keyValueItemProps)\nconst emits = defineEmits(keyValueItemEmits)\n\nconst attrs = useAttrs()\nconst bem = createNamespace('key-value')\nconst innerValue = ref(props.value)\n\nconst formRef = ref<FormInstance | null>()\n\nconst getKeyType = computed<FormColumn>(() => {\n const option = props.keyType\n return option\n})\nconst getValueType = computed<FormColumn>(() => {\n let option = props.valueType\n if (innerValue.value['key'] && !isEmpty(props.keyValueTypeDict)) {\n option = props.keyValueTypeDict[innerValue.value['key']]\n }\n return option\n})\n\nconst getKeyDisabled = computed(() => {\n return (\n props.disabledKey?.includes(props.idx) ||\n props.disabled ||\n getKeyType.value?.disabled\n )\n})\n\nconst getValueDisabled = computed(() => {\n return (\n props.disabledValue?.includes(props.idx) ||\n props.disabled ||\n getValueType.value?.disabled\n )\n})\n\nconst hasValue = computed(() => {\n return (\n innerValue.value['key'] ||\n innerValue.value['key'] === 0 ||\n innerValue.value['value']\n )\n})\n\nconst getDeleteDisabled = computed(() => {\n return (\n props.disabledDelete?.includes(props.idx) ||\n props.disabled ||\n (props.values.length === 1 && !hasValue.value)\n )\n})\n\nconst handleDelete = () => {\n emits('delete')\n}\n\nconst handleChange = async () => {\n innerValue.value['value'] = null\n await formRef.value?.clearValidate()\n}\n\nconst validate = async () => {\n await nextTick()\n try {\n await formRef.value?.validate()\n return Promise.resolve()\n } catch (error) {\n console.log({ error }, props.idx)\n return Promise.reject()\n }\n}\n\nconst resetFields = async () => {\n await formRef.value?.resetFields()\n}\n\nconst clearValidate = async (namePath?: NamePath[]) => {\n await formRef.value?.clearValidate(namePath)\n}\n\nwatch(\n innerValue,\n async val => {\n await nextTick().then(() => {\n try {\n emits('update:value', val)\n emits('change')\n } catch (error) {\n console.error(error)\n }\n })\n },\n {\n deep: true\n }\n)\n\ndefineExpose({\n validate,\n resetFields,\n clearValidate\n})\n</script>\n\n<style scoped></style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuKA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAM,MAAA,GAAA,GAAM,gBAAgB,WAAW,CAAA,CAAA;AACvC,IAAM,MAAA,UAAA,GAAa,GAAI,CAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAElC,IAAA,MAAM,UAAU,GAAyB,EAAA,CAAA;AAEzC,IAAM,MAAA,UAAA,GAAa,SAAqB,MAAM;AAC5C,MAAA,MAAM,SAAS,KAAM,CAAA,OAAA,CAAA;AACrB,MAAO,OAAA,MAAA,CAAA;AAAA,KACR,CAAA,CAAA;AACD,IAAM,MAAA,YAAA,GAAe,SAAqB,MAAM;AAC9C,MAAA,IAAI,SAAS,KAAM,CAAA,SAAA,CAAA;AACnB,MAAI,IAAA,UAAA,CAAW,MAAM,KAAK,CAAA,IAAK,CAAC,OAAQ,CAAA,KAAA,CAAM,gBAAgB,CAAG,EAAA;AAC/D,QAAA,MAAA,GAAS,KAAM,CAAA,gBAAA,CAAiB,UAAW,CAAA,KAAA,CAAM,KAAK,CAAC,CAAA,CAAA;AAAA,OACzD;AACA,MAAO,OAAA,MAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -29,43 +29,59 @@ const formColumns = [
29
29
  ];
30
30
  const keyValueItemProps = buildProps({
31
31
  disabled: {
32
- type: Boolean
32
+ type: Boolean,
33
+ default: false
33
34
  },
34
35
  values: {
35
36
  type: definePropType(Array),
36
37
  default: () => [
37
38
  {
38
39
  key: null,
39
- value: null
40
+ value: null,
41
+ guid: ""
40
42
  }
41
43
  ]
42
44
  },
43
45
  disabledValue: {
44
- type: definePropType(Array)
46
+ type: definePropType(Array),
47
+ default: () => []
45
48
  },
46
49
  disabledKey: {
47
- type: definePropType(Array)
50
+ type: definePropType(Array),
51
+ default: () => []
48
52
  },
49
53
  disabledDelete: {
50
- type: definePropType(Array)
54
+ type: definePropType(Array),
55
+ default: () => []
51
56
  },
52
57
  keyValueType: {
53
- type: definePropType(String)
58
+ type: definePropType(String),
59
+ default: "doubt"
54
60
  },
55
61
  keyType: {
56
- type: definePropType(Object)
62
+ type: definePropType(Object),
63
+ default: () => ({
64
+ type: "input",
65
+ placeholder: "\u8BF7\u8F93\u5165Key"
66
+ })
57
67
  },
58
68
  keyTypes: {
59
- type: definePropType(Array)
69
+ type: definePropType(Array),
70
+ default: () => []
60
71
  },
61
72
  valueType: {
62
- type: definePropType(Object)
73
+ type: definePropType(Object),
74
+ default: () => ({
75
+ type: "input",
76
+ placeholder: "\u8BF7\u8F93\u5165Value"
77
+ })
63
78
  },
64
79
  value: {
65
80
  type: definePropType(Object),
66
81
  default: () => ({
67
82
  key: "",
68
- value: ""
83
+ value: "",
84
+ guid: ""
69
85
  })
70
86
  },
71
87
  idx: {
@@ -1 +1 @@
1
- {"version":3,"file":"key-value-item.mjs","sources":["../../../../../../../packages/components/key-value/src/config/key-value-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\nimport type { FormProps } from 'ant-design-vue'\nimport type { FormColumn } from '@ll-plus/components'\nimport type { KeyType } from './'\n\nexport const typeRules = [\n {\n trigger: ['blur', 'change'],\n message: '此字段是必需的',\n validator: async (_rule: any, value: any) => {\n if (!value) {\n return Promise.reject(new Error('此字段是必需的'))\n } else {\n return Promise.resolve()\n }\n }\n }\n]\nexport const formOptions = {\n layout: 'horizontal',\n labelAlign: 'left'\n} as FormProps\n\nexport const formColumns = [\n {\n key: 'other',\n labelCol: {\n span: 24\n }\n }\n]\n\nexport interface KeyValueItem {\n key: any | null\n value: any | null\n}\n\nexport const keyValueItemProps = buildProps({\n disabled: {\n type: Boolean\n },\n values: {\n type: definePropType<KeyValueItem[]>(Array),\n default: () => [\n {\n key: null,\n value: null\n }\n ]\n },\n disabledValue: {\n type: definePropType<number[]>(Array)\n },\n disabledKey: {\n type: definePropType<number[]>(Array)\n },\n disabledDelete: {\n type: definePropType<number[]>(Array)\n },\n keyValueType: {\n type: definePropType<'single' | 'doubt'>(String)\n },\n keyType: {\n type: definePropType<FormColumn>(Object)\n },\n keyTypes: {\n type: definePropType<KeyType[]>(Array)\n },\n valueType: {\n type: definePropType<FormColumn>(Object)\n },\n value: {\n type: definePropType<KeyValueItem>(Object),\n default: () => ({\n key: '',\n value: ''\n })\n },\n idx: {\n type: Number,\n required: true\n },\n keyValueTypeDict: {\n type: Object,\n default: () => ({})\n },\n keepLast: {\n type: Boolean,\n default: false\n }\n} as const)\n\nexport const keyValueItemEmits = {\n delete: () => true,\n change: () => true,\n 'update:value': (value: KeyValueItem) => !!value\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,SAAY,GAAA;AAAA,EACvB;AAAA,IACE,OAAA,EAAS,CAAC,MAAA,EAAQ,QAAQ,CAAA;AAAA,IAC1B,OAAS,EAAA,4CAAA;AAAA,IACT,SAAA,EAAW,OAAO,KAAA,EAAY,KAAe,KAAA;AAC3C,MAAA,IAAI,CAAC,KAAO,EAAA;AACV,QAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,4CAAS,CAAC,CAAA,CAAA;AAAA,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,CAAA;AAAA,IACzC,SAAS,OAAO;AAAA,MACd,GAAK,EAAA,EAAA;AAAA,MACL,KAAO,EAAA,EAAA;AAAA,KACT,CAAA;AAAA,GACF;AAAA,EACA,GAAK,EAAA;AAAA,IACH,IAAM,EAAA,MAAA;AAAA,IACN,QAAU,EAAA,IAAA;AAAA,GACZ;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AACF,CAAU,EAAA;AAEH,MAAM,iBAAoB,GAAA;AAAA,EAC/B,QAAQ,MAAM,IAAA;AAAA,EACd,QAAQ,MAAM,IAAA;AAAA,EACd,cAAgB,EAAA,CAAC,KAAwB,KAAA,CAAC,CAAC,KAAA;AAC7C;;;;"}
1
+ {"version":3,"file":"key-value-item.mjs","sources":["../../../../../../../packages/components/key-value/src/config/key-value-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\nimport type { FormProps } from 'ant-design-vue'\nimport type { FormColumn } from '@ll-plus/components'\nimport type { IKeyType, IKeyValueItem } from './key-value'\n\n// 定义 typeRules 常量\nexport const typeRules: Array<{\n trigger: string[]\n message: string\n validator: (_rule: any, value: any) => Promise<void>\n}> = [\n {\n trigger: ['blur', 'change'],\n message: '此字段是必需的',\n validator: async (_rule: any, value: any): Promise<void> => {\n if (!value) {\n return Promise.reject(new Error('此字段是必需的'))\n } else {\n return Promise.resolve()\n }\n }\n }\n]\n\n// 定义 formOptions 常量\nexport const formOptions: FormProps = {\n layout: 'horizontal',\n labelAlign: 'left'\n}\n\n// 定义 formColumns 常量\nexport const formColumns: Array<{\n key: string\n labelCol: {\n span: number\n }\n}> = [\n {\n key: 'other',\n labelCol: {\n span: 24\n }\n }\n]\n\n// 定义 keyValueItemProps 常量\nexport const keyValueItemProps = buildProps({\n disabled: {\n type: Boolean,\n default: false\n },\n values: {\n type: definePropType<IKeyValueItem[]>(Array),\n default: (): IKeyValueItem[] => [\n {\n key: null,\n value: null,\n guid: ''\n }\n ]\n },\n disabledValue: {\n type: definePropType<number[]>(Array),\n default: (): number[] => []\n },\n disabledKey: {\n type: definePropType<number[]>(Array),\n default: (): number[] => []\n },\n disabledDelete: {\n type: definePropType<number[]>(Array),\n default: (): number[] => []\n },\n keyValueType: {\n type: definePropType<'single' | 'doubt'>(String),\n default: 'doubt'\n },\n keyType: {\n type: definePropType<FormColumn>(Object),\n default: (): FormColumn => ({\n type: 'input',\n placeholder: '请输入Key'\n })\n },\n keyTypes: {\n type: definePropType<IKeyType[]>(Array),\n default: (): IKeyType[] => []\n },\n valueType: {\n type: definePropType<FormColumn>(Object),\n default: (): FormColumn => ({\n type: 'input',\n placeholder: '请输入Value'\n })\n },\n value: {\n type: definePropType<IKeyValueItem>(Object),\n default: (): IKeyValueItem => ({\n key: '',\n value: '',\n guid: ''\n })\n },\n idx: {\n type: Number,\n required: true\n },\n keyValueTypeDict: {\n type: Object as () => Record<string, string>,\n default: (): Record<string, string> => ({})\n },\n keepLast: {\n type: Boolean,\n default: false\n }\n} as const)\n\n// 定义 keyValueItemEmits 常量\nexport const keyValueItemEmits = {\n delete: (): boolean => true,\n change: (): boolean => true,\n 'update:value': (value: IKeyValueItem): boolean => !!value\n}\n"],"names":[],"mappings":";;;;AAMO,MAAM,SAIR,GAAA;AAAA,EACH;AAAA,IACE,OAAA,EAAS,CAAC,MAAA,EAAQ,QAAQ,CAAA;AAAA,IAC1B,OAAS,EAAA,4CAAA;AAAA,IACT,SAAA,EAAW,OAAO,KAAA,EAAY,KAA8B,KAAA;AAC1D,MAAA,IAAI,CAAC,KAAO,EAAA;AACV,QAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,4CAAS,CAAC,CAAA,CAAA;AAAA,OACrC,MAAA;AACL,QAAA,OAAO,QAAQ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,OAAA;AAAA,MACN,WAAa,EAAA,uBAAA;AAAA,KACf,CAAA;AAAA,GACF;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAA,EAAM,eAA2B,KAAK,CAAA;AAAA,IACtC,OAAA,EAAS,MAAkB,EAAC;AAAA,GAC9B;AAAA,EACA,SAAW,EAAA;AAAA,IACT,IAAA,EAAM,eAA2B,MAAM,CAAA;AAAA,IACvC,SAAS,OAAmB;AAAA,MAC1B,IAAM,EAAA,OAAA;AAAA,MACN,WAAa,EAAA,yBAAA;AAAA,KACf,CAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAA8B,MAAM,CAAA;AAAA,IAC1C,SAAS,OAAsB;AAAA,MAC7B,GAAK,EAAA,EAAA;AAAA,MACL,KAAO,EAAA,EAAA;AAAA,MACP,IAAM,EAAA,EAAA;AAAA,KACR,CAAA;AAAA,GACF;AAAA,EACA,GAAK,EAAA;AAAA,IACH,IAAM,EAAA,MAAA;AAAA,IACN,QAAU,EAAA,IAAA;AAAA,GACZ;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,EAAS,OAA+B,EAAC,CAAA;AAAA,GAC3C;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AACF,CAAU,EAAA;AAGH,MAAM,iBAAoB,GAAA;AAAA,EAC/B,QAAQ,MAAe,IAAA;AAAA,EACvB,QAAQ,MAAe,IAAA;AAAA,EACvB,cAAgB,EAAA,CAAC,KAAkC,KAAA,CAAC,CAAC,KAAA;AACvD;;;;"}
@@ -1,10 +1,12 @@
1
1
  import '../../../../utils/index.mjs';
2
+ import { guid } from '../../../../utils/data.mjs';
2
3
  import { buildProps, definePropType } from '../../../../utils/props/runtime.mjs';
3
4
 
4
5
  "use strict";
5
6
  const getKeyValueItem = () => ({
6
7
  key: null,
7
- value: null
8
+ value: null,
9
+ guid: guid()
8
10
  });
9
11
  const keyValueProps = buildProps({
10
12
  value: {
@@ -1 +1 @@
1
- {"version":3,"file":"key-value.mjs","sources":["../../../../../../../packages/components/key-value/src/config/key-value.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport { type FormColumn } from '@ll-plus/components'\nimport type { KeyValueItem } from './key-value-item'\nimport type KeyValue from '../key-value.vue'\n\nexport interface KeyType {\n label: string\n value: string\n option: FormColumn\n}\n\ntype KeyValueType = 'single' | 'doubt'\n\nexport const getKeyValueItem = () => ({\n key: null,\n value: null\n})\n\nexport const keyValueProps = buildProps({\n value: {\n type: definePropType<KeyValueItem[]>(Array),\n default: () => [{ key: null, value: null }]\n },\n loading: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n keyLabel: {\n type: String,\n default: ''\n },\n valueLabel: {\n type: String,\n default: ''\n },\n addText: {\n type: String,\n default: '添加'\n },\n keyValueType: {\n type: definePropType<KeyValueType>(String),\n default: 'doubt'\n },\n keyType: {\n type: definePropType<FormColumn>(Object),\n default: () => ({\n type: 'input',\n placeholder: '请输入Key'\n })\n },\n keyTypes: {\n type: definePropType<KeyType[]>(Array),\n default: () => []\n },\n valueType: {\n type: definePropType<FormColumn>(Object),\n default: () => ({\n type: 'input',\n placeholder: '请输入Value'\n })\n },\n disabledValue: {\n type: definePropType<number[]>(Array),\n default: () => []\n },\n disabledKey: {\n type: definePropType<number[]>(Array),\n default: () => []\n },\n disabledDelete: {\n type: definePropType<number[]>(Array),\n default: () => []\n },\n disabledAdd: {\n type: Boolean,\n default: false\n },\n validate: {\n type: Boolean,\n default: false\n },\n keepLast: {\n type: Boolean,\n default: true\n }\n} as const)\n\nexport interface KeyValueAddEmits {\n index: number\n item: KeyValueItem\n value: KeyValueItem[]\n}\n\nexport const keyValueEmits = {\n change: (value: KeyValueItem[]) => !!value,\n add: (params: KeyValueAddEmits) => !!params,\n delete: (index: number) => typeof index === 'number',\n 'update:value': (value: KeyValueItem[]) => !!value\n}\n\n// props\nexport type KeyValueProps = ExtractPropTypes<typeof keyValueProps>\n// emits\nexport type KeyValueEmits = typeof keyValueEmits\n// instance\nexport type KeyValueInstance = InstanceType<typeof KeyValue>\n"],"names":[],"mappings":";;;;AAeO,MAAM,kBAAkB,OAAO;AAAA,EACpC,GAAK,EAAA,IAAA;AAAA,EACL,KAAO,EAAA,IAAA;AACT,CAAA,EAAA;AAEO,MAAM,gBAAgB,UAAW,CAAA;AAAA,EACtC,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAA+B,KAAK,CAAA;AAAA,IAC1C,OAAA,EAAS,MAAM,CAAC,EAAE,KAAK,IAAM,EAAA,KAAA,EAAO,MAAM,CAAA;AAAA,GAC5C;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,cAAA;AAAA,GACX;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,IAAA,EAAM,eAA6B,MAAM,CAAA;AAAA,IACzC,OAAS,EAAA,OAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAA,EAAM,eAA2B,MAAM,CAAA;AAAA,IACvC,SAAS,OAAO;AAAA,MACd,IAAM,EAAA,OAAA;AAAA,MACN,WAAa,EAAA,uBAAA;AAAA,KACf,CAAA;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 {"version":3,"file":"key-value.mjs","sources":["../../../../../../../packages/components/key-value/src/config/key-value.ts"],"sourcesContent":["import { buildProps, definePropType, guid } from '@ll-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport { type FormColumn } from '@ll-plus/components'\nimport type KeyValue from '../key-value.vue'\n\n// 定义 IKeyType 接口\nexport interface IKeyType {\n label: string\n value: string\n option: FormColumn\n}\n\n// 定义 IKeyValueReturn 接口\nexport interface IKeyValueReturn {\n key: any | null\n value: any | null\n}\n\n// 定义 IKeyValueItem 类型\nexport type IKeyValueItem = IKeyValueReturn & { guid: string }\n\n// 定义 IKeyValueType 类型\ntype IKeyValueType = 'single' | 'doubt'\n\n// 定义 getKeyValueItem 函数\nexport const getKeyValueItem = (): IKeyValueItem => ({\n key: null,\n value: null,\n guid: guid()\n})\n\n// 定义 keyValueProps 常量\nexport const keyValueProps = buildProps({\n value: {\n type: definePropType<IKeyValueReturn[]>(Array),\n default: (): IKeyValueReturn[] => [{ key: null, value: null }]\n },\n loading: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n keyLabel: {\n type: String,\n default: ''\n },\n valueLabel: {\n type: String,\n default: ''\n },\n addText: {\n type: String,\n default: '添加'\n },\n keyValueType: {\n type: definePropType<IKeyValueType>(String),\n default: 'doubt'\n },\n keyType: {\n type: definePropType<FormColumn>(Object),\n default: (): FormColumn => ({\n type: 'input',\n placeholder: '请输入Key'\n })\n },\n keyTypes: {\n type: definePropType<IKeyType[]>(Array),\n default: (): IKeyType[] => []\n },\n valueType: {\n type: definePropType<FormColumn>(Object),\n default: (): FormColumn => ({\n type: 'input',\n placeholder: '请输入Value'\n })\n },\n disabledValue: {\n type: definePropType<number[]>(Array),\n default: (): number[] => []\n },\n disabledKey: {\n type: definePropType<number[]>(Array),\n default: (): number[] => []\n },\n disabledDelete: {\n type: definePropType<number[]>(Array),\n default: (): number[] => []\n },\n disabledAdd: {\n type: Boolean,\n default: false\n },\n validate: {\n type: Boolean,\n default: false\n },\n keepLast: {\n type: Boolean,\n default: true\n }\n} as const)\n\n// 定义 IKeyValueAddEmits 接口\nexport interface IKeyValueAddEmits {\n index: number\n item: IKeyValueItem\n value: IKeyValueItem[]\n}\n\n// 定义 keyValueEmits 常量\nexport const keyValueEmits = {\n change: (value: IKeyValueReturn[]): boolean => !!value,\n add: (params: IKeyValueAddEmits): boolean => !!params,\n delete: (index: number): boolean => typeof index === 'number',\n 'update:value': (value: IKeyValueReturn[]): boolean => !!value\n}\n\n// 定义 KeyValueProps 类型\nexport type KeyValueProps = ExtractPropTypes<typeof keyValueProps>\n// 定义 KeyValueEmits 类型\nexport type KeyValueEmits = typeof keyValueEmits\n// 定义 KeyValueInstance 类型\nexport type KeyValueInstance = InstanceType<typeof KeyValue>\n"],"names":[],"mappings":";;;;;AAyBO,MAAM,kBAAkB,OAAsB;AAAA,EACnD,GAAK,EAAA,IAAA;AAAA,EACL,KAAO,EAAA,IAAA;AAAA,EACP,MAAM,IAAK,EAAA;AACb,CAAA,EAAA;AAGO,MAAM,gBAAgB,UAAW,CAAA;AAAA,EACtC,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAAkC,KAAK,CAAA;AAAA,IAC7C,OAAA,EAAS,MAAyB,CAAC,EAAE,KAAK,IAAM,EAAA,KAAA,EAAO,MAAM,CAAA;AAAA,GAC/D;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP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