@vrojs/element-plus 0.0.6 → 0.0.8

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 (190) hide show
  1. package/dist/index.d.ts +5 -0
  2. package/dist/index.js +125 -83
  3. package/dist/locale/index.js +6 -7
  4. package/dist/locale/lang/en.d.ts +8 -0
  5. package/dist/locale/lang/en.js +8 -0
  6. package/dist/locale/lang/zh-cn.d.ts +8 -0
  7. package/dist/locale/lang/zh-cn.js +8 -0
  8. package/dist/locale/useLocale.d.ts +1 -48
  9. package/dist/locale/useLocale.js +16 -17
  10. package/dist/style/deps.js +7 -0
  11. package/dist/style/index.css +1 -1
  12. package/dist/style/index.js +7 -0
  13. package/dist/utils/elTableColumnProps.d.ts +149 -0
  14. package/dist/utils/elTableColumnProps.js +152 -0
  15. package/dist/utils/index.d.ts +1 -0
  16. package/dist/utils/index.js +4 -2
  17. package/dist/vro-el-checkbox-group/index.d.ts +1 -1
  18. package/dist/vro-el-checkbox-group/vro-el-checkbox-group.vue.d.ts +1 -1
  19. package/dist/vro-el-checkbox-group/vro-el-checkbox-group.vue.js +10 -10
  20. package/dist/vro-el-config-provider/config.d.ts +14 -0
  21. package/dist/vro-el-config-provider/config.js +36 -0
  22. package/dist/vro-el-config-provider/index.d.ts +16 -0
  23. package/dist/vro-el-config-provider/index.js +8 -2
  24. package/dist/vro-el-config-provider/types.d.ts +7 -0
  25. package/dist/vro-el-config-provider/types.js +7 -0
  26. package/dist/vro-el-config-provider/vro-el-config-provider.vue.d.ts +9 -0
  27. package/dist/vro-el-config-provider/vro-el-config-provider.vue.js +11 -11
  28. package/dist/vro-el-file-upload/index.d.ts +6 -6
  29. package/dist/vro-el-file-upload/style/index.css +1 -1
  30. package/dist/vro-el-file-upload/types.d.ts +9 -2
  31. package/dist/vro-el-file-upload/vro-el-file-upload.vue.d.ts +7 -6
  32. package/dist/vro-el-file-upload/vro-el-file-upload.vue.js +55 -51
  33. package/dist/vro-el-icon/index.d.ts +28 -40
  34. package/dist/vro-el-icon/style/css.js +1 -0
  35. package/dist/vro-el-icon/style/deps.js +1 -1
  36. package/dist/vro-el-icon/style/index.js +1 -1
  37. package/dist/vro-el-icon/types.d.ts +16 -13
  38. package/dist/vro-el-icon/types.js +8 -1
  39. package/dist/vro-el-icon/vro-el-icon.vue.d.ts +18 -27
  40. package/dist/vro-el-icon/vro-el-icon.vue.js +27 -23
  41. package/dist/vro-el-image/index.d.ts +10 -4
  42. package/dist/vro-el-image/style/css.js +4 -0
  43. package/dist/vro-el-image/style/index.css +1 -0
  44. package/dist/vro-el-image/style/index.js +4 -0
  45. package/dist/vro-el-image/types.d.ts +35 -0
  46. package/dist/vro-el-image/types.js +24 -1
  47. package/dist/vro-el-image/utils.d.ts +1 -1
  48. package/dist/vro-el-image/vro-el-image.vue.d.ts +7 -2
  49. package/dist/vro-el-image/vro-el-image.vue.js +55 -24
  50. package/dist/vro-el-image-upload/index.d.ts +1 -1
  51. package/dist/vro-el-image-upload/style/css.js +4 -0
  52. package/dist/vro-el-image-upload/style/index.css +1 -1
  53. package/dist/vro-el-image-upload/style/index.js +4 -0
  54. package/dist/vro-el-image-upload/types.d.ts +24 -7
  55. package/dist/vro-el-image-upload/types.js +21 -7
  56. package/dist/vro-el-image-upload/vro-el-image-upload.vue.d.ts +1 -1
  57. package/dist/vro-el-image-upload/vro-el-image-upload.vue.js +82 -68
  58. package/dist/vro-el-radio-group/index.d.ts +1 -1
  59. package/dist/vro-el-radio-group/vro-el-radio-group.vue.d.ts +1 -1
  60. package/dist/vro-el-radio-group/vro-el-radio-group.vue.js +12 -12
  61. package/dist/vro-el-schema-filter/index.d.ts +27 -31
  62. package/dist/vro-el-schema-filter/style/css.js +5 -0
  63. package/dist/vro-el-schema-filter/style/index.css +1 -1
  64. package/dist/vro-el-schema-filter/style/index.js +5 -0
  65. package/dist/vro-el-schema-filter/types.d.ts +17 -0
  66. package/dist/vro-el-schema-filter/vro-el-schema-filter.vue.d.ts +38 -43
  67. package/dist/vro-el-schema-filter/vro-el-schema-filter.vue.js +63 -44
  68. package/dist/vro-el-schema-form/index.d.ts +16 -18
  69. package/dist/vro-el-schema-form/style/css.js +5 -0
  70. package/dist/vro-el-schema-form/style/index.css +1 -1
  71. package/dist/vro-el-schema-form/style/index.js +5 -0
  72. package/dist/vro-el-schema-form/types.d.ts +65 -7
  73. package/dist/vro-el-schema-form/useVroElSchemaForm.d.ts +33 -37
  74. package/dist/vro-el-schema-form/useVroElSchemaForm.js +13 -13
  75. package/dist/vro-el-schema-form/vro-el-schema-form.vue.d.ts +11 -13
  76. package/dist/vro-el-schema-form/vro-el-schema-form.vue.js +79 -79
  77. package/dist/vro-el-schema-form-dialog/function-call.js +10 -7
  78. package/dist/vro-el-schema-form-dialog/index.d.ts +111 -142
  79. package/dist/vro-el-schema-form-dialog/style/css.js +5 -0
  80. package/dist/vro-el-schema-form-dialog/style/index.css +1 -1
  81. package/dist/vro-el-schema-form-dialog/style/index.js +5 -0
  82. package/dist/vro-el-schema-form-dialog/types.d.ts +25 -16
  83. package/dist/vro-el-schema-form-dialog/types.js +6 -11
  84. package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.d.ts +92 -113
  85. package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.js +83 -87
  86. package/dist/vro-el-schema-form-drawer/function-call.d.ts +4 -0
  87. package/dist/vro-el-schema-form-drawer/function-call.js +20 -0
  88. package/dist/vro-el-schema-form-drawer/index.d.ts +2207 -0
  89. package/dist/vro-el-schema-form-drawer/index.js +16 -0
  90. package/dist/vro-el-schema-form-drawer/injection.d.ts +9 -0
  91. package/dist/vro-el-schema-form-drawer/injection.js +9 -0
  92. package/dist/vro-el-schema-form-drawer/style/css.d.ts +0 -0
  93. package/dist/vro-el-schema-form-drawer/style/css.js +24 -0
  94. package/dist/vro-el-schema-form-drawer/style/deps.d.ts +0 -0
  95. package/dist/vro-el-schema-form-drawer/style/deps.js +24 -0
  96. package/dist/vro-el-schema-form-drawer/style/index.css +1 -0
  97. package/dist/vro-el-schema-form-drawer/style/index.d.ts +0 -0
  98. package/dist/vro-el-schema-form-drawer/style/index.js +48 -0
  99. package/dist/vro-el-schema-form-drawer/types.d.ts +110 -0
  100. package/dist/vro-el-schema-form-drawer/types.js +75 -0
  101. package/dist/vro-el-schema-form-drawer/useVroElSchemaFormDrawer.d.ts +14 -0
  102. package/dist/vro-el-schema-form-drawer/useVroElSchemaFormDrawer.js +18 -0
  103. package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue.d.ts +1832 -0
  104. package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue.js +134 -0
  105. package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue2.js +4 -0
  106. package/dist/vro-el-select/index.d.ts +11 -11
  107. package/dist/vro-el-select/vro-el-select.vue.d.ts +11 -11
  108. package/dist/vro-el-select/vro-el-select.vue.js +11 -11
  109. package/dist/vro-el-skeleton/index.d.ts +9 -73
  110. package/dist/vro-el-skeleton/style/index.css +1 -1
  111. package/dist/vro-el-skeleton/types.d.ts +32 -24
  112. package/dist/vro-el-skeleton/types.js +3 -23
  113. package/dist/vro-el-skeleton/vro-el-skeleton.vue.d.ts +7 -48
  114. package/dist/vro-el-skeleton/vro-el-skeleton.vue.js +48 -46
  115. package/dist/vro-el-table/createUseVroElTable.d.ts +9 -0
  116. package/dist/vro-el-table/createUseVroElTable.js +7 -0
  117. package/dist/vro-el-table/index.js +13 -0
  118. package/dist/vro-el-table/style/css.d.ts +0 -0
  119. package/dist/vro-el-table/style/css.js +29 -0
  120. package/dist/vro-el-table/style/deps.d.ts +0 -0
  121. package/dist/vro-el-table/style/deps.js +28 -0
  122. package/dist/vro-el-table/style/index.css +1 -0
  123. package/dist/vro-el-table/style/index.d.ts +0 -0
  124. package/dist/vro-el-table/style/index.js +57 -0
  125. package/dist/vro-el-table/types.d.ts +97 -0
  126. package/dist/vro-el-table/types.js +66 -0
  127. package/dist/vro-el-table/useVroElTable.d.ts +43 -0
  128. package/dist/vro-el-table/useVroElTable.js +47 -0
  129. package/dist/vro-el-table/vro-el-table.vue.js +94 -0
  130. package/dist/vro-el-table/vro-el-table.vue2.js +4 -0
  131. package/dist/vro-el-table-actions-column/index.d.ts +269 -0
  132. package/dist/vro-el-table-actions-column/index.js +9 -0
  133. package/dist/vro-el-table-actions-column/style/css.d.ts +0 -0
  134. package/dist/vro-el-table-actions-column/style/css.js +4 -0
  135. package/dist/vro-el-table-actions-column/style/deps.d.ts +0 -0
  136. package/dist/vro-el-table-actions-column/style/deps.js +5 -0
  137. package/dist/vro-el-table-actions-column/style/index.css +1 -0
  138. package/dist/vro-el-table-actions-column/style/index.d.ts +0 -0
  139. package/dist/vro-el-table-actions-column/style/index.js +9 -0
  140. package/dist/vro-el-table-actions-column/types.d.ts +139 -0
  141. package/dist/vro-el-table-actions-column/types.js +37 -0
  142. package/dist/vro-el-table-actions-column/vro-el-table-actions-column.vue.d.ts +167 -0
  143. package/dist/vro-el-table-actions-column/vro-el-table-actions-column.vue.js +101 -0
  144. package/dist/vro-el-table-actions-column/vro-el-table-actions-column.vue2.js +4 -0
  145. package/dist/vro-el-table-column/index.d.ts +257 -0
  146. package/dist/vro-el-table-column/index.js +9 -0
  147. package/dist/vro-el-table-column/style/css.d.ts +0 -0
  148. package/dist/vro-el-table-column/style/css.js +6 -0
  149. package/dist/vro-el-table-column/style/deps.d.ts +0 -0
  150. package/dist/vro-el-table-column/style/deps.js +1 -0
  151. package/dist/vro-el-table-column/style/index.css +1 -0
  152. package/dist/vro-el-table-column/style/index.d.ts +0 -0
  153. package/dist/vro-el-table-column/style/index.js +7 -0
  154. package/dist/vro-el-table-column/types.d.ts +141 -0
  155. package/dist/vro-el-table-column/types.js +43 -0
  156. package/dist/vro-el-table-column/vro-el-table-column.vue.d.ts +161 -0
  157. package/dist/vro-el-table-column/vro-el-table-column.vue.js +66 -0
  158. package/dist/vro-el-table-column/vro-el-table-column.vue2.js +4 -0
  159. package/dist/vro-el-table-column-group/index.d.ts +23 -0
  160. package/dist/vro-el-table-column-group/index.js +13 -0
  161. package/dist/vro-el-table-column-group/style/css.d.ts +0 -0
  162. package/dist/vro-el-table-column-group/style/css.js +9 -0
  163. package/dist/vro-el-table-column-group/style/deps.d.ts +0 -0
  164. package/dist/vro-el-table-column-group/style/deps.js +5 -0
  165. package/dist/vro-el-table-column-group/style/index.d.ts +0 -0
  166. package/dist/vro-el-table-column-group/style/index.js +14 -0
  167. package/dist/vro-el-table-column-group/types.d.ts +87 -0
  168. package/dist/vro-el-table-column-group/types.js +12 -0
  169. package/dist/vro-el-table-column-group/useVroElTableColumnGroup.d.ts +2 -0
  170. package/dist/vro-el-table-column-group/useVroElTableColumnGroup.js +10 -0
  171. package/dist/vro-el-table-column-group/vro-el-table-column-group.vue.d.ts +14 -0
  172. package/dist/vro-el-table-column-group/vro-el-table-column-group.vue.js +29 -0
  173. package/dist/vro-el-table-column-group/vro-el-table-column-group.vue2.js +4 -0
  174. package/dist/vro-el-table-column-group/vroElTableColumnGroupColumnManager.d.ts +2 -0
  175. package/dist/vro-el-table-column-group/vroElTableColumnGroupColumnManager.js +9 -0
  176. package/dist/vro-el-tags/index.d.ts +234 -187
  177. package/dist/vro-el-tags/style/css.js +1 -0
  178. package/dist/vro-el-tags/style/index.css +1 -0
  179. package/dist/vro-el-tags/style/index.js +1 -0
  180. package/dist/vro-el-tags/types.d.ts +37 -1
  181. package/dist/vro-el-tags/types.js +17 -1
  182. package/dist/vro-el-tags/vro-el-tags.vue.d.ts +219 -8
  183. package/dist/vro-el-tags/vro-el-tags.vue.js +55 -45
  184. package/dist/vro-el-tree/index.d.ts +3235 -32
  185. package/dist/vro-el-tree/style/index.css +1 -1
  186. package/dist/vro-el-tree/types.d.ts +124 -5
  187. package/dist/vro-el-tree/types.js +12 -6
  188. package/dist/vro-el-tree/vro-el-tree.vue.d.ts +6020 -20
  189. package/dist/vro-el-tree/vro-el-tree.vue.js +54 -36
  190. package/package.json +10 -12
@@ -26,10 +26,10 @@ export declare const VroElSchemaForm: import('@vrojs/base').WithInstall<{
26
26
  default: () => {};
27
27
  };
28
28
  }>> & Readonly<{
29
- "onChange-field"?: ((...args: any[]) => any) | undefined;
30
- "onInput-field"?: ((...args: any[]) => any) | undefined;
29
+ "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
30
+ "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
31
31
  }>, {
32
- form: {
32
+ elForm: {
33
33
  $: import('vue').ComponentInternalInstance;
34
34
  $data: {};
35
35
  $props: {
@@ -140,8 +140,8 @@ export declare const VroElSchemaForm: import('@vrojs/base').WithInstall<{
140
140
  extractValues: () => Promise<Record<string, any>>;
141
141
  validateField: (key: string) => Promise<boolean | undefined>;
142
142
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
143
- "change-field": (...args: any[]) => void;
144
- "input-field": (...args: any[]) => void;
143
+ "change-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
144
+ "input-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
145
145
  }, import('vue').PublicProps, {
146
146
  colProps: Partial<import('element-plus').ColProps>;
147
147
  formItemProps: Partial<import('element-plus').FormItemProps>;
@@ -149,7 +149,7 @@ export declare const VroElSchemaForm: import('@vrojs/base').WithInstall<{
149
149
  rowProps: Partial<import('element-plus').RowProps>;
150
150
  schema: import('./types').VroElSchemaFormSchema;
151
151
  }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
152
- refForm: ({
152
+ formRef: ({
153
153
  $: import('vue').ComponentInternalInstance;
154
154
  $data: {};
155
155
  $props: {
@@ -250,7 +250,7 @@ export declare const VroElSchemaForm: import('@vrojs/base').WithInstall<{
250
250
  default?: (props: {}) => any;
251
251
  };
252
252
  }) | null;
253
- refComponents: unknown;
253
+ componentRefs: unknown;
254
254
  }, any, import('vue').ComponentProvideOptions, {
255
255
  P: {};
256
256
  B: {};
@@ -280,10 +280,10 @@ export declare const VroElSchemaForm: import('@vrojs/base').WithInstall<{
280
280
  default: () => {};
281
281
  };
282
282
  }>> & Readonly<{
283
- "onChange-field"?: ((...args: any[]) => any) | undefined;
284
- "onInput-field"?: ((...args: any[]) => any) | undefined;
283
+ "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
284
+ "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
285
285
  }>, {
286
- form: {
286
+ elForm: {
287
287
  $: import('vue').ComponentInternalInstance;
288
288
  $data: {};
289
289
  $props: {
@@ -425,10 +425,10 @@ export declare const VroElSchemaForm: import('@vrojs/base').WithInstall<{
425
425
  default: () => {};
426
426
  };
427
427
  }>> & Readonly<{
428
- "onChange-field"?: ((...args: any[]) => any) | undefined;
429
- "onInput-field"?: ((...args: any[]) => any) | undefined;
428
+ "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
429
+ "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
430
430
  }>, {
431
- form: {
431
+ elForm: {
432
432
  $: import('vue').ComponentInternalInstance;
433
433
  $data: {};
434
434
  $props: {
@@ -539,8 +539,8 @@ export declare const VroElSchemaForm: import('@vrojs/base').WithInstall<{
539
539
  extractValues: () => Promise<Record<string, any>>;
540
540
  validateField: (key: string) => Promise<boolean | undefined>;
541
541
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
542
- "change-field": (...args: any[]) => void;
543
- "input-field": (...args: any[]) => void;
542
+ "change-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
543
+ "input-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
544
544
  }, string, {
545
545
  colProps: Partial<import('element-plus').ColProps>;
546
546
  formItemProps: Partial<import('element-plus').FormItemProps>;
@@ -548,9 +548,7 @@ export declare const VroElSchemaForm: import('@vrojs/base').WithInstall<{
548
548
  rowProps: Partial<import('element-plus').RowProps>;
549
549
  schema: import('./types').VroElSchemaFormSchema;
550
550
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
551
- $slots: Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & {
552
- default?(_: {}): any;
553
- };
551
+ $slots: Readonly<import('./types').VroElSchemaFormSlots> & import('./types').VroElSchemaFormSlots;
554
552
  })>;
555
553
  export default VroElSchemaForm;
556
554
  export type VroElSchemaFormInstance = InstanceType<typeof VroElSchemaForm>;
@@ -1,11 +1,16 @@
1
1
  import '../../style/base.css';
2
2
  import '../../vro-el-file-upload/style/index.css';
3
3
  import '../../vro-el-image-upload/style/index.css';
4
+ import '../../vro-el-image/style/index.css';
4
5
  import './index.css';
6
+ import '../../vro-el-tags/style/index.css';
5
7
  import '../../vro-el-tree/style/index.css';
6
8
  /* empty css */
7
9
  /* empty css */
8
10
  /* empty css */
11
+ import "@vrojs/base/src/vro-loading/style/css";
12
+ import "@vrojs/base/src/vro-icon/style/css";
13
+ /* empty css */
9
14
  /* empty css */
10
15
  /* empty css */
11
16
  /* empty css */
@@ -1 +1 @@
1
- .vro-el-schema-form{display:block;width:100%}
1
+ .vro-el-schema-form{display:block;width:100%}.vro-el-schema-form .el-date-editor{--el-date-editor-width: 100%}.vro-el-schema-form .el-cascader,.vro-el-schema-form .el-input-number.is-controls-right{width:100%}
@@ -1,7 +1,9 @@
1
1
  import '../../style/base.css';
2
2
  import '../../vro-el-file-upload/style/index.css';
3
3
  import '../../vro-el-image-upload/style/index.css';
4
+ import '../../vro-el-image/style/index.css';
4
5
  import './index.css';
6
+ import '../../vro-el-tags/style/index.css';
5
7
  import '../../vro-el-tree/style/index.css';
6
8
  import "element-plus/es/components/checkbox-group/style/css";
7
9
  import "element-plus/es/components/checkbox/style/css";
@@ -28,6 +30,9 @@ import "element-plus/es/components/tree-select/style/css";
28
30
  /* empty css */
29
31
  /* empty css */
30
32
  /* empty css */
33
+ import "@vrojs/base/src/vro-loading/style/css";
34
+ import "@vrojs/base/src/vro-icon/style/css";
35
+ /* empty css */
31
36
  /* empty css */
32
37
  /* empty css */
33
38
  /* empty css */
@@ -1,11 +1,38 @@
1
- import { Arrayable } from '@vrojs/base';
2
- import { ColProps, FormItemProps, FormItemRule, FormProps, RowProps } from 'element-plus';
1
+ import { Arrayable, ExtractComponentProps, VroSlot } from '@vrojs/base';
2
+ import { CascaderComponentProps, CheckboxGroupProps, ColProps, DatePickerProps, DividerProps, ElTreeSelect, FormItemProps, FormItemRule, FormProps, InputNumberProps, InputProps, RadioGroupProps, RowProps, SelectProps } from 'element-plus';
3
3
  import { ExtractPropTypes, PropType, Raw } from 'vue';
4
- export interface VroElSchemaFormSchemaField {
4
+ import { VroElCheckboxGroupProps } from '../vro-el-checkbox-group';
5
+ import { VroElFileUploadProps } from '../vro-el-file-upload';
6
+ import { VroElImageUploadProps } from '../vro-el-image-upload';
7
+ import { VroElRadioGroupProps } from '../vro-el-radio-group';
8
+ import { VroElSelectProps } from '../vro-el-select';
9
+ import { VroElTagsProps } from '../vro-el-tags';
10
+ import { VroElTreeProps } from '../vro-el-tree';
11
+ export interface VroElSchemaFormFieldPropsMap {
12
+ ElInput: Partial<InputProps>;
13
+ ElSelect: Partial<SelectProps>;
14
+ ElRadioGroup: Partial<RadioGroupProps>;
15
+ ElCheckboxGroup: Partial<CheckboxGroupProps>;
16
+ ElDatePicker: Partial<DatePickerProps>;
17
+ ElInputNumber: Partial<InputNumberProps>;
18
+ ElTreeSelect: Partial<ExtractComponentProps<typeof ElTreeSelect>>;
19
+ ElCascader: Partial<CascaderComponentProps>;
20
+ ElDivider: Partial<DividerProps>;
21
+ VroElSelect: Partial<VroElSelectProps>;
22
+ VroElCheckboxGroup: Partial<VroElCheckboxGroupProps>;
23
+ VroElRadioGroup: Partial<VroElRadioGroupProps>;
24
+ VroElImageUpload: Partial<VroElImageUploadProps>;
25
+ VroElFileUpload: Partial<VroElFileUploadProps>;
26
+ VroElTags: Partial<VroElTagsProps>;
27
+ VroElTree: Partial<VroElTreeProps>;
28
+ }
29
+ export type VroElSchemaFormFieldType = keyof VroElSchemaFormFieldPropsMap;
30
+ export type VroElSchemaFormRawComponent = Raw<object>;
31
+ export interface VroElSchemaFormSchemaFieldBase<TProps = Record<string, any>> {
5
32
  /**
6
33
  * 字段渲染组件,支持内置注册名、外部注册名或组件对象。
7
34
  */
8
- is?: 'ElInput' | 'ElSelect' | 'ElRadioGroup' | 'ElCheckboxGroup' | 'ElDatePicker' | 'ElInputNumber' | 'ElTreeSelect' | 'ElCascader' | 'ElDivider' | 'VroElSelect' | 'VroElCheckboxGroup' | 'VroElRadioGroup' | 'VroElImageUpload' | 'VroElFileUpload' | 'VroElTags' | 'VroElTree' | Raw<object> | (string & {});
35
+ is?: VroElSchemaFormFieldType | VroElSchemaFormRawComponent;
9
36
  /**
10
37
  * 表单项标签文本。
11
38
  */
@@ -25,7 +52,7 @@ export interface VroElSchemaFormSchemaField {
25
52
  /**
26
53
  * 透传给字段组件的属性。
27
54
  */
28
- props?: Record<string, any>;
55
+ props?: TProps;
29
56
  /**
30
57
  * 字段选项列表,常用于选择器、单选、多选等组件。
31
58
  */
@@ -57,7 +84,7 @@ export interface VroElSchemaFormSchemaField {
57
84
  /**
58
85
  * 从字段值转换提交值。
59
86
  */
60
- get?: (value: any, filed: VroElSchemaFormSchemaField, metadata: VroElSchemaFormSchema) => any;
87
+ get?: (value: any, field: VroElSchemaFormSchemaField, metadata: VroElSchemaFormSchema) => any;
61
88
  /**
62
89
  * 将外部数据写入字段。
63
90
  */
@@ -65,7 +92,7 @@ export interface VroElSchemaFormSchemaField {
65
92
  /**
66
93
  * 是否隐藏字段,支持根据当前字段和完整 schema 动态判断。
67
94
  */
68
- hidden?: boolean | ((value: any, filed: VroElSchemaFormSchemaField, metadata: VroElSchemaFormSchema) => boolean);
95
+ hidden?: boolean | ((value: any, field: VroElSchemaFormSchemaField, metadata: VroElSchemaFormSchema) => boolean);
69
96
  /**
70
97
  * 字段校验规则,透传给 ElForm rules。
71
98
  */
@@ -80,8 +107,29 @@ export interface VroElSchemaFormSchemaField {
80
107
  onInput?: (value: any, field: VroElSchemaFormSchemaField, metadata: VroElSchemaFormSchema) => any;
81
108
  [key: string]: any;
82
109
  }
110
+ export type VroElSchemaFormMappedSchemaField = {
111
+ [K in VroElSchemaFormFieldType]: VroElSchemaFormSchemaFieldBase<VroElSchemaFormFieldPropsMap[K]> & {
112
+ is: K;
113
+ };
114
+ }[VroElSchemaFormFieldType];
115
+ export type VroElSchemaFormCustomSchemaField = VroElSchemaFormSchemaFieldBase & {
116
+ is?: VroElSchemaFormRawComponent;
117
+ };
118
+ export type VroElSchemaFormSchemaField = VroElSchemaFormMappedSchemaField | VroElSchemaFormCustomSchemaField;
83
119
  export type VroElSchemaFormSchema = Record<string, VroElSchemaFormSchemaField>;
84
120
  export type VroElSchemaFormFormProps = Partial<Omit<FormProps, 'model' | 'rules'>>;
121
+ export interface VroElSchemaFormFieldEvent {
122
+ key: string;
123
+ value: any;
124
+ }
125
+ export interface VroElSchemaFormSlotProps {
126
+ item: VroElSchemaFormSchemaField;
127
+ [key: string]: any;
128
+ }
129
+ export interface VroElSchemaFormEmits {
130
+ 'change-field': [payload: VroElSchemaFormFieldEvent];
131
+ 'input-field': [payload: VroElSchemaFormFieldEvent];
132
+ }
85
133
  export declare const vroElSchemaFormProps: {
86
134
  /**
87
135
  * 透传给 ElForm 的属性,不包含 model 和 rules。
@@ -120,3 +168,13 @@ export declare const vroElSchemaFormProps: {
120
168
  };
121
169
  };
122
170
  export type VroElSchemaFormProps = ExtractPropTypes<typeof vroElSchemaFormProps>;
171
+ export interface VroElSchemaFormSlots {
172
+ /**
173
+ * 表单尾部内容,会渲染在 ElRow 内部。
174
+ */
175
+ default?: VroSlot;
176
+ /**
177
+ * schema 字段 slots 或 itemSlots 配置中的插槽。
178
+ */
179
+ [key: string]: ((props: VroElSchemaFormSlotProps) => any) | VroSlot | undefined;
180
+ }
@@ -7,10 +7,10 @@ export interface UseVroElSchemaFormOptions extends Pick<UseAsyncTaskOptions<any>
7
7
  instanceRef?: Ref<VroElSchemaFormInstance | undefined>;
8
8
  }
9
9
  export declare function useVroElSchemaForm<T extends Record<string, any> = Record<string, any>>(rawSchema: (() => VroElSchemaFormSchema) | VroElSchemaFormSchema, task?: (data: T) => Promise<void>, options?: UseVroElSchemaFormOptions): {
10
- data: Ref<void | undefined, void | undefined>;
10
+ data: Ref<Awaited<T> | undefined, Awaited<T> | undefined>;
11
11
  error: Ref<unknown, unknown>;
12
12
  schema: VroElSchemaFormSchema;
13
- refVroElSchemaForm: Ref<({
13
+ schemaFormRef: Ref<({
14
14
  $: import('vue').ComponentInternalInstance;
15
15
  $data: {};
16
16
  $props: Partial<{
@@ -25,8 +25,8 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
25
25
  readonly formProps: Partial<Omit<import('element-plus').FormProps, "rules" | "model">>;
26
26
  readonly rowProps: Partial<import('element-plus').RowProps>;
27
27
  readonly schema: VroElSchemaFormSchema;
28
- readonly "onChange-field"?: ((...args: any[]) => any) | undefined;
29
- readonly "onInput-field"?: ((...args: any[]) => any) | undefined;
28
+ readonly "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
29
+ readonly "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
30
30
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "colProps" | "formItemProps" | "formProps" | "rowProps" | "schema">;
31
31
  $attrs: {
32
32
  [x: string]: unknown;
@@ -34,7 +34,7 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
34
34
  $refs: {
35
35
  [x: string]: unknown;
36
36
  } & {
37
- refForm: ({
37
+ formRef: ({
38
38
  $: import('vue').ComponentInternalInstance;
39
39
  $data: {};
40
40
  $props: {
@@ -135,7 +135,7 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
135
135
  default?: (props: {}) => any;
136
136
  };
137
137
  }) | null;
138
- refComponents: unknown;
138
+ componentRefs: unknown;
139
139
  };
140
140
  $slots: Readonly<{
141
141
  [name: string]: import('vue').Slot<any> | undefined;
@@ -143,7 +143,7 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
143
143
  $root: import('vue').ComponentPublicInstance | null;
144
144
  $parent: import('vue').ComponentPublicInstance | null;
145
145
  $host: Element | null;
146
- $emit: ((event: "change-field", ...args: any[]) => void) & ((event: "input-field", ...args: any[]) => void);
146
+ $emit: ((event: "change-field", payload: import('./types').VroElSchemaFormFieldEvent) => void) & ((event: "input-field", payload: import('./types').VroElSchemaFormFieldEvent) => void);
147
147
  $el: any;
148
148
  $options: import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
149
149
  formProps: {
@@ -167,10 +167,10 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
167
167
  default: () => {};
168
168
  };
169
169
  }>> & Readonly<{
170
- "onChange-field"?: ((...args: any[]) => any) | undefined;
171
- "onInput-field"?: ((...args: any[]) => any) | undefined;
170
+ "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
171
+ "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
172
172
  }>, {
173
- form: {
173
+ elForm: {
174
174
  $: import('vue').ComponentInternalInstance;
175
175
  $data: {};
176
176
  $props: {
@@ -281,8 +281,8 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
281
281
  extractValues: () => Promise<Record<string, any>>;
282
282
  validateField: (key: string) => Promise<boolean | undefined>;
283
283
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
284
- "change-field": (...args: any[]) => void;
285
- "input-field": (...args: any[]) => void;
284
+ "change-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
285
+ "input-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
286
286
  }, string, {
287
287
  colProps: Partial<import('element-plus').ColProps>;
288
288
  formItemProps: Partial<import('element-plus').FormItemProps>;
@@ -337,10 +337,10 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
337
337
  default: () => {};
338
338
  };
339
339
  }>> & Readonly<{
340
- "onChange-field"?: ((...args: any[]) => any) | undefined;
341
- "onInput-field"?: ((...args: any[]) => any) | undefined;
342
- }>, "form" | "trigger" | "validate" | "validateField" | "resetFields" | ("colProps" | "formItemProps" | "formProps" | "rowProps" | "schema") | "extractValues"> & import('vue').ShallowUnwrapRef<{
343
- form: {
340
+ "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
341
+ "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
342
+ }>, "trigger" | "validate" | "validateField" | "resetFields" | ("colProps" | "formItemProps" | "formProps" | "rowProps" | "schema") | "elForm" | "extractValues"> & import('vue').ShallowUnwrapRef<{
343
+ elForm: {
344
344
  $: import('vue').ComponentInternalInstance;
345
345
  $data: {};
346
346
  $props: {
@@ -451,9 +451,7 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
451
451
  extractValues: () => Promise<Record<string, any>>;
452
452
  validateField: (key: string) => Promise<boolean | undefined>;
453
453
  }> & {} & import('vue').ComponentCustomProperties & {} & {
454
- $slots: Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & {
455
- default?(_: {}): any;
456
- };
454
+ $slots: Readonly<import('./types').VroElSchemaFormSlots> & import('./types').VroElSchemaFormSlots;
457
455
  }) | undefined, ({
458
456
  $: import('vue').ComponentInternalInstance;
459
457
  $data: {};
@@ -469,8 +467,8 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
469
467
  readonly formProps: Partial<Omit<import('element-plus').FormProps, "rules" | "model">>;
470
468
  readonly rowProps: Partial<import('element-plus').RowProps>;
471
469
  readonly schema: VroElSchemaFormSchema;
472
- readonly "onChange-field"?: ((...args: any[]) => any) | undefined;
473
- readonly "onInput-field"?: ((...args: any[]) => any) | undefined;
470
+ readonly "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
471
+ readonly "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
474
472
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "colProps" | "formItemProps" | "formProps" | "rowProps" | "schema">;
475
473
  $attrs: {
476
474
  [x: string]: unknown;
@@ -478,7 +476,7 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
478
476
  $refs: {
479
477
  [x: string]: unknown;
480
478
  } & {
481
- refForm: ({
479
+ formRef: ({
482
480
  $: import('vue').ComponentInternalInstance;
483
481
  $data: {};
484
482
  $props: {
@@ -579,7 +577,7 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
579
577
  default?: (props: {}) => any;
580
578
  };
581
579
  }) | null;
582
- refComponents: unknown;
580
+ componentRefs: unknown;
583
581
  };
584
582
  $slots: Readonly<{
585
583
  [name: string]: import('vue').Slot<any> | undefined;
@@ -587,7 +585,7 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
587
585
  $root: import('vue').ComponentPublicInstance | null;
588
586
  $parent: import('vue').ComponentPublicInstance | null;
589
587
  $host: Element | null;
590
- $emit: ((event: "change-field", ...args: any[]) => void) & ((event: "input-field", ...args: any[]) => void);
588
+ $emit: ((event: "change-field", payload: import('./types').VroElSchemaFormFieldEvent) => void) & ((event: "input-field", payload: import('./types').VroElSchemaFormFieldEvent) => void);
591
589
  $el: any;
592
590
  $options: import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
593
591
  formProps: {
@@ -611,10 +609,10 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
611
609
  default: () => {};
612
610
  };
613
611
  }>> & Readonly<{
614
- "onChange-field"?: ((...args: any[]) => any) | undefined;
615
- "onInput-field"?: ((...args: any[]) => any) | undefined;
612
+ "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
613
+ "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
616
614
  }>, {
617
- form: {
615
+ elForm: {
618
616
  $: import('vue').ComponentInternalInstance;
619
617
  $data: {};
620
618
  $props: {
@@ -725,8 +723,8 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
725
723
  extractValues: () => Promise<Record<string, any>>;
726
724
  validateField: (key: string) => Promise<boolean | undefined>;
727
725
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
728
- "change-field": (...args: any[]) => void;
729
- "input-field": (...args: any[]) => void;
726
+ "change-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
727
+ "input-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
730
728
  }, string, {
731
729
  colProps: Partial<import('element-plus').ColProps>;
732
730
  formItemProps: Partial<import('element-plus').FormItemProps>;
@@ -781,10 +779,10 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
781
779
  default: () => {};
782
780
  };
783
781
  }>> & Readonly<{
784
- "onChange-field"?: ((...args: any[]) => any) | undefined;
785
- "onInput-field"?: ((...args: any[]) => any) | undefined;
786
- }>, "form" | "trigger" | "validate" | "validateField" | "resetFields" | ("colProps" | "formItemProps" | "formProps" | "rowProps" | "schema") | "extractValues"> & import('vue').ShallowUnwrapRef<{
787
- form: {
782
+ "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
783
+ "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
784
+ }>, "trigger" | "validate" | "validateField" | "resetFields" | ("colProps" | "formItemProps" | "formProps" | "rowProps" | "schema") | "elForm" | "extractValues"> & import('vue').ShallowUnwrapRef<{
785
+ elForm: {
788
786
  $: import('vue').ComponentInternalInstance;
789
787
  $data: {};
790
788
  $props: {
@@ -895,10 +893,8 @@ export declare function useVroElSchemaForm<T extends Record<string, any> = Recor
895
893
  extractValues: () => Promise<Record<string, any>>;
896
894
  validateField: (key: string) => Promise<boolean | undefined>;
897
895
  }> & {} & import('vue').ComponentCustomProperties & {} & {
898
- $slots: Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & {
899
- default?(_: {}): any;
900
- };
896
+ $slots: Readonly<import('./types').VroElSchemaFormSlots> & import('./types').VroElSchemaFormSlots;
901
897
  }) | undefined>;
902
898
  loading: Ref<boolean, boolean>;
903
- trigger: () => Promise<void>;
899
+ trigger: () => Promise<T | undefined>;
904
900
  };
@@ -2,8 +2,8 @@ import p from "@daysnap/banana";
2
2
  import { isFunction as v } from "@daysnap/utils";
3
3
  import { useAsyncTask as d } from "@vrojs/use";
4
4
  import { reactive as g, ref as h } from "vue";
5
- function x(r, e, n = {}) {
6
- const { instanceRef: i, source: a, ...s } = n, o = g(v(r) ? r() : r), t = i ?? h(), { loading: c, trigger: m, error: u, data: f } = d(async () => {
5
+ function R(r, n, s = {}) {
6
+ const { instanceRef: i, source: a, ...c } = s, e = g(v(r) ? r() : r), t = i ?? h(), { loading: m, trigger: u, error: f, data: l } = d(async () => {
7
7
  if (!t.value)
8
8
  return;
9
9
  try {
@@ -11,18 +11,18 @@ function x(r, e, n = {}) {
11
11
  } catch {
12
12
  throw "";
13
13
  }
14
- const l = await t.value.extractValues();
15
- await e?.(l);
16
- }, s);
17
- return a && p.assignment(a, o), {
18
- data: f,
19
- error: u,
20
- schema: o,
21
- refVroElSchemaForm: t,
22
- loading: c,
23
- trigger: m
14
+ const o = await t.value.extractValues();
15
+ return await n?.(o), o;
16
+ }, c);
17
+ return a && p.assignment(a, e), {
18
+ data: l,
19
+ error: f,
20
+ schema: e,
21
+ schemaFormRef: t,
22
+ loading: m,
23
+ trigger: u
24
24
  };
25
25
  }
26
26
  export {
27
- x as useVroElSchemaForm
27
+ R as useVroElSchemaForm
28
28
  };
@@ -1,11 +1,9 @@
1
- import { VroElSchemaFormSchema } from './types';
1
+ import { VroElSchemaFormSchema, VroElSchemaFormSlots } from './types';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
- slots: Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>> & {
5
- default?(_: {}): any;
6
- };
4
+ slots: Readonly<VroElSchemaFormSlots> & VroElSchemaFormSlots;
7
5
  refs: {
8
- refForm: ({
6
+ formRef: ({
9
7
  $: import('vue').ComponentInternalInstance;
10
8
  $data: {};
11
9
  $props: {
@@ -106,7 +104,7 @@ declare function __VLS_template(): {
106
104
  default?: (props: {}) => any;
107
105
  };
108
106
  }) | null;
109
- refComponents: unknown;
107
+ componentRefs: unknown;
110
108
  };
111
109
  rootEl: any;
112
110
  };
@@ -133,7 +131,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
133
131
  default: () => {};
134
132
  };
135
133
  }>, {
136
- form: {
134
+ elForm: {
137
135
  $: import('vue').ComponentInternalInstance;
138
136
  $data: {};
139
137
  $props: {
@@ -244,8 +242,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
244
242
  extractValues: () => Promise<Record<string, any>>;
245
243
  validateField: (key: string) => Promise<boolean | undefined>;
246
244
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
247
- "change-field": (...args: any[]) => void;
248
- "input-field": (...args: any[]) => void;
245
+ "change-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
246
+ "input-field": (payload: import('./types').VroElSchemaFormFieldEvent) => any;
249
247
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
250
248
  formProps: {
251
249
  type: import('vue').PropType<import('./types').VroElSchemaFormFormProps>;
@@ -268,8 +266,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
268
266
  default: () => {};
269
267
  };
270
268
  }>> & Readonly<{
271
- "onChange-field"?: ((...args: any[]) => any) | undefined;
272
- "onInput-field"?: ((...args: any[]) => any) | undefined;
269
+ "onChange-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
270
+ "onInput-field"?: ((payload: import('./types').VroElSchemaFormFieldEvent) => any) | undefined;
273
271
  }>, {
274
272
  colProps: Partial<import('element-plus').ColProps>;
275
273
  formItemProps: Partial<import('element-plus').FormItemProps>;
@@ -277,7 +275,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
277
275
  rowProps: Partial<import('element-plus').RowProps>;
278
276
  schema: VroElSchemaFormSchema;
279
277
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
280
- refForm: ({
278
+ formRef: ({
281
279
  $: import('vue').ComponentInternalInstance;
282
280
  $data: {};
283
281
  $props: {
@@ -378,7 +376,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
378
376
  default?: (props: {}) => any;
379
377
  };
380
378
  }) | null;
381
- refComponents: unknown;
379
+ componentRefs: unknown;
382
380
  }, any>;
383
381
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
384
382
  export default _default;