@qin-ui/antdv-next-pro 1.1.14 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/AI-CONTEXT.md +281 -23
  2. package/LICENSE +9 -0
  3. package/README.md +75 -58
  4. package/api.json +70 -28
  5. package/bin/init-ai.mjs +404 -49
  6. package/es/antdv-next-pro.css +9 -9
  7. package/es/component-provider/{index-Daiw7IxY.js → index-Tesc9NuK.js} +2 -1
  8. package/es/component-provider/index-Tesc9NuK.js.map +1 -0
  9. package/es/component-provider/index.js +2 -1
  10. package/es/component-provider/index.js.map +1 -0
  11. package/es/components/component-provider/components/index.vue.d.ts +27 -0
  12. package/es/components/component-provider/components/index.vue.d.ts.map +1 -0
  13. package/es/components/component-provider/constants/index.d.ts +16 -0
  14. package/es/components/component-provider/constants/index.d.ts.map +1 -0
  15. package/es/components/component-provider/index.d.ts +4 -0
  16. package/es/components/component-provider/index.d.ts.map +1 -0
  17. package/es/components/component-provider/types/index.d.ts +26 -0
  18. package/es/components/component-provider/types/index.d.ts.map +1 -0
  19. package/es/components/form/components/BaseField/index.vue.d.ts +13 -0
  20. package/es/components/form/components/BaseField/index.vue.d.ts.map +1 -0
  21. package/es/components/form/components/BaseField/utils/index.d.ts +3 -0
  22. package/es/components/form/components/BaseField/utils/index.d.ts.map +1 -0
  23. package/es/components/form/components/BaseFormItem/index.vue.d.ts +9 -0
  24. package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -0
  25. package/es/components/form/components/ContainerFragment/index.vue.d.ts +23 -0
  26. package/es/components/form/components/ContainerFragment/index.vue.d.ts.map +1 -0
  27. package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts +31 -0
  28. package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts.map +1 -0
  29. package/es/components/form/components/PathProvider/index.vue.d.ts +24 -0
  30. package/es/components/form/components/PathProvider/index.vue.d.ts.map +1 -0
  31. package/es/components/form/components/ProForm/index.vue.d.ts +36 -0
  32. package/es/components/form/components/ProForm/index.vue.d.ts.map +1 -0
  33. package/es/components/form/components/SlotComponent/index.vue.d.ts +7 -0
  34. package/es/components/form/components/SlotComponent/index.vue.d.ts.map +1 -0
  35. package/es/components/form/components/index.d.ts +12 -0
  36. package/es/components/form/components/index.d.ts.map +1 -0
  37. package/es/components/form/constants/index.d.ts +81 -0
  38. package/es/components/form/constants/index.d.ts.map +1 -0
  39. package/es/components/form/hooks/index.d.ts +5 -0
  40. package/es/components/form/hooks/index.d.ts.map +1 -0
  41. package/es/components/form/hooks/useFields.d.ts +57 -0
  42. package/es/components/form/hooks/useFields.d.ts.map +1 -0
  43. package/es/components/form/hooks/useForm.d.ts +93 -0
  44. package/es/components/form/hooks/useForm.d.ts.map +1 -0
  45. package/es/components/form/hooks/useFormRef.d.ts +30 -0
  46. package/es/components/form/hooks/useFormRef.d.ts.map +1 -0
  47. package/es/components/form/index.d.ts +7 -0
  48. package/es/components/form/index.d.ts.map +1 -0
  49. package/es/components/form/types/index.d.ts +251 -0
  50. package/es/components/form/types/index.d.ts.map +1 -0
  51. package/es/components/table/components/ColumnControl.vue.d.ts +9 -0
  52. package/es/components/table/components/ColumnControl.vue.d.ts.map +1 -0
  53. package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts +18 -0
  54. package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +1 -0
  55. package/es/components/table/components/DefaultTableContainer.vue.d.ts +18 -0
  56. package/es/components/table/components/DefaultTableContainer.vue.d.ts.map +1 -0
  57. package/es/components/table/components/ProTable.vue.d.ts +118 -0
  58. package/es/components/table/components/ProTable.vue.d.ts.map +1 -0
  59. package/es/components/table/components/SearchForm.vue.d.ts +48 -0
  60. package/es/components/table/components/SearchForm.vue.d.ts.map +1 -0
  61. package/es/components/table/components/SizeControl.vue.d.ts +12 -0
  62. package/es/components/table/components/SizeControl.vue.d.ts.map +1 -0
  63. package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts +3 -0
  64. package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +1 -0
  65. package/es/components/table/components/icons/DownOutlined.vue.d.ts +3 -0
  66. package/es/components/table/components/icons/DownOutlined.vue.d.ts.map +1 -0
  67. package/es/components/table/components/icons/FilterOutlined.vue.d.ts +3 -0
  68. package/es/components/table/components/icons/FilterOutlined.vue.d.ts.map +1 -0
  69. package/es/components/table/components/index.d.ts +5 -0
  70. package/es/components/table/components/index.d.ts.map +1 -0
  71. package/es/components/table/index.d.ts +8 -0
  72. package/es/components/table/index.d.ts.map +1 -0
  73. package/es/components/table/types/index.d.ts +48 -0
  74. package/es/components/table/types/index.d.ts.map +1 -0
  75. package/es/components/table/useTable.d.ts +111 -0
  76. package/es/components/table/useTable.d.ts.map +1 -0
  77. package/es/form/{index-7clzY8ZD.js → index-CcP5OaUd.js} +12 -6
  78. package/es/form/index-CcP5OaUd.js.map +1 -0
  79. package/es/form/index.js +4 -3
  80. package/es/form/index.js.map +1 -0
  81. package/es/index.d.ts +76 -1522
  82. package/es/index.d.ts.map +1 -0
  83. package/es/index.js +14 -23
  84. package/es/index.js.map +1 -0
  85. package/es/shared/core/index.d.ts +6 -0
  86. package/es/shared/core/index.d.ts.map +1 -0
  87. package/es/shared/ui/index.d.ts +9 -0
  88. package/es/shared/ui/index.d.ts.map +1 -0
  89. package/es/table/index.js +11 -9
  90. package/es/table/index.js.map +1 -0
  91. package/package.json +10 -11
  92. package/src/components/component-provider/components/index.vue +67 -0
  93. package/src/components/component-provider/constants/index.ts +177 -0
  94. package/src/components/component-provider/index.ts +6 -0
  95. package/src/components/component-provider/types/index.ts +59 -0
  96. package/src/components/form/components/BaseField/index.vue +181 -0
  97. package/src/components/form/components/BaseField/utils/index.ts +16 -0
  98. package/src/components/form/components/BaseFormItem/index.vue +158 -0
  99. package/src/components/form/components/ContainerFragment/index.vue +24 -0
  100. package/src/components/form/components/GroupedFieldAttrs/index.vue +119 -0
  101. package/src/components/form/components/PathProvider/index.vue +19 -0
  102. package/src/components/form/components/ProForm/index.vue +104 -0
  103. package/src/components/form/components/SlotComponent/index.vue +26 -0
  104. package/src/components/form/components/index.ts +15 -0
  105. package/src/components/form/constants/index.ts +140 -0
  106. package/src/components/form/hooks/index.ts +5 -0
  107. package/src/components/form/hooks/useFields.ts +67 -0
  108. package/src/components/form/hooks/useForm.ts +110 -0
  109. package/src/components/form/hooks/useFormRef.ts +35 -0
  110. package/src/components/form/index.ts +29 -0
  111. package/src/components/form/types/index.ts +317 -0
  112. package/src/components/table/components/ColumnControl.vue +142 -0
  113. package/src/components/table/components/DefaultSearchFormContainer.vue +22 -0
  114. package/src/components/table/components/DefaultTableContainer.vue +19 -0
  115. package/src/components/table/components/ProTable.vue +372 -0
  116. package/src/components/table/components/SearchForm.vue +296 -0
  117. package/src/components/table/components/SizeControl.vue +54 -0
  118. package/src/components/table/components/icons/ColumnHeightOutlined.vue +4 -0
  119. package/src/components/table/components/icons/DownOutlined.vue +4 -0
  120. package/src/components/table/components/icons/FilterOutlined.vue +4 -0
  121. package/src/components/table/components/index.ts +4 -0
  122. package/src/components/table/index.ts +14 -0
  123. package/src/components/table/types/index.ts +52 -0
  124. package/src/components/table/useTable.ts +129 -0
  125. package/src/index.ts +81 -0
  126. package/src/shared/core/index.ts +37 -0
  127. package/src/shared/ui/index.ts +55 -0
  128. package/es/core/index-ghYuQ3Sy.js +0 -360
  129. package/es/vendor/utils/lodash-es-p6jau26B.js +0 -1120
@@ -0,0 +1,16 @@
1
+ import { RequiredComponentVars } from '../types';
2
+ import { InjectionKey, Component } from 'vue';
3
+ export type InjectConfigEntry<T = any> = {
4
+ injectionKey: InjectionKey<T>;
5
+ default: T;
6
+ };
7
+ export declare const INJECT_CONFIG: {
8
+ [key in keyof RequiredComponentVars]: {
9
+ injectionKey: InjectionKey<RequiredComponentVars[key]>;
10
+ default: RequiredComponentVars[key];
11
+ };
12
+ };
13
+ export declare const INJECT_COMPONENTS: InjectionKey<Partial<Record<string, Component>>>;
14
+ export declare const getInjectConfig: (key: string) => InjectConfigEntry | undefined;
15
+ export declare const ensureInjectConfig: (key: string) => InjectConfigEntry;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/component-provider/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAK9C,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IACvC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE;KACzB,GAAG,IAAI,MAAM,qBAAqB,GAAG;QACpC,YAAY,EAAE,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;QACvD,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;KACrC;CAwIF,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAC1C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CACL,CAAC;AAKhC,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,iBAAiB,GAAG,SAKjE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,iBAShD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { default as ComponentProvider } from './components/index.vue';
2
+ export { type ComponentVars } from './types';
3
+ export default ComponentProvider;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/component-provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { GridItemProps, FormItemProps, TableProps } from '../../../shared/ui';
2
+ import { ComponentName, GetComponentType } from '../../form/constants';
3
+ import { Base, Grid } from '../../form/types';
4
+ import { ProFormProps } from '../../form';
5
+ import { ProTableProps } from '../../table';
6
+ import { AllowedComponentProps } from 'vue';
7
+ import { ComponentProps } from 'vue-component-type-helpers';
8
+ type PP<T extends Record<string, any>> = Partial<T & AllowedComponentProps>;
9
+ type FP<T extends Record<string, any>> = Partial<T & Pick<Base, 'valueFormatter' | 'componentContainer' | 'modelProp' | 'componentClass' | 'componentStyle'> & AllowedComponentProps>;
10
+ export type RequiredComponentVars = {
11
+ 'pro-table': PP<TableProps & Pick<ProTableProps, 'control' | 'searchFormConfig' | 'immediateSearch' | 'addIndexColumn' | 'tableContainer'>>;
12
+ 'pro-form': PP<Omit<ProFormProps, 'form' | 'grid'> & {
13
+ grid: Exclude<Grid, undefined | boolean>;
14
+ }>;
15
+ 'pro-form-item': PP<FormItemProps & Pick<GridItemProps, 'span' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'> & Pick<Base, 'formItemContainer'>>;
16
+ 'date-picker.date': FP<ComponentProps<GetComponentType<'date-picker'>>>;
17
+ 'date-picker.week': FP<ComponentProps<GetComponentType<'date-picker'>>>;
18
+ 'date-picker.month': FP<ComponentProps<GetComponentType<'date-picker'>>>;
19
+ 'date-picker.year': FP<ComponentProps<GetComponentType<'date-picker'>>>;
20
+ 'date-picker.quarter': FP<ComponentProps<GetComponentType<'date-picker'>>>;
21
+ } & {
22
+ [K in Exclude<ComponentName, 'custom'>]: FP<ComponentProps<GetComponentType<K>>>;
23
+ };
24
+ export type ComponentVars = Partial<RequiredComponentVars>;
25
+ export {};
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/component-provider/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC;AAE5E,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,OAAO,CAC9C,CAAC,GACC,IAAI,CACF,IAAI,EACF,gBAAgB,GAChB,oBAAoB,GACpB,WAAW,GACX,gBAAgB,GAChB,gBAAgB,CACnB,GACD,qBAAqB,CACxB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,EAAE,CACb,UAAU,GACR,IAAI,CACF,aAAa,EACX,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,CACnB,CACJ,CAAC;IACF,UAAU,EAAE,EAAE,CACZ,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG;QACpC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;KAC1C,CACF,CAAC;IACF,eAAe,EAAE,EAAE,CACjB,aAAa,GACX,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC,GACtE,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAClC,CAAC;IAEF,kBAAkB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACxE,kBAAkB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACxE,mBAAmB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACzE,kBAAkB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACxE,qBAAqB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAC5E,GAAG;KAED,CAAC,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,EAAE,CACzC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CACpC;CACF,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Component } from 'vue';
2
+ type Props = {
3
+ component?: string | Component;
4
+ path?: string;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<Props, {
7
+ getComponentRef: () => any;
8
+ getComponentComputedProps: () => any;
9
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
10
+ componentRef: unknown;
11
+ }, any>;
12
+ export default _default;
13
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseField/index.vue"],"names":[],"mappings":"AAuLA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,KAAK,CAAC;AAYb,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;;;qCAgH6D,GAAG;;;;AAsGlE,wBAQG"}
@@ -0,0 +1,3 @@
1
+ import { Field } from '../../../types';
2
+ export declare const getInitProps: (field: Field) => Record<string, any>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/BaseField/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIvC,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAW7D,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Fields, Grid } from '../../types';
2
+ type Props = {
3
+ grid?: Grid;
4
+ fields?: Fields;
5
+ disabled?: boolean;
6
+ };
7
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
9
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseFormItem/index.vue"],"names":[],"mappings":"AAwLA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAQhD,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;AAiRF,wBAMG"}
@@ -0,0 +1,23 @@
1
+ import { ContainerComponent } from '../../types';
2
+ type Props = {
3
+ component?: ContainerComponent;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ default?(_: {}): any;
9
+ default?(_: {}): any;
10
+ };
11
+ refs: {};
12
+ rootEl: any;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
+ export default _default;
18
+ type __VLS_WithTemplateSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
23
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/ContainerFragment/index.vue"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC,CAAC;AASF,iBAAS,cAAc;WAoCT,OAAO,IAA6B;;yBAZrB,GAAG;yBACH,GAAG;;;;EAgB/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,sRAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { GridItemProps, FormItemProps } from '../../../../shared/ui';
2
+ import { Base, Field } from '../../types';
3
+ import { FORM_ITEM_SLOT_KEYS } from '../../constants';
4
+ type Props = {
5
+ field: Field;
6
+ };
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {
11
+ gridItemProps: GridItemProps;
12
+ formItemProps: FormItemProps & {
13
+ container?: Base["formItemContainer"];
14
+ };
15
+ formItemSlots: Record<(typeof FORM_ITEM_SLOT_KEYS)[number], any>;
16
+ componentProps: Record<string, any>;
17
+ }): any;
18
+ };
19
+ refs: {};
20
+ rootEl: any;
21
+ };
22
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
23
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
25
+ export default _default;
26
+ type __VLS_WithTemplateSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
31
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/GroupedFieldAttrs/index.vue"],"names":[],"mappings":"AA+IA,OAAO,EACL,aAAa,EACb,aAAa,EAGd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAMtD,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AA+EF,iBAAS,cAAc;WAqBT,OAAO,IAA6B;;;2BA5FjC,aAAa;2BACb,aAAa,GAAG;gBAAE,SAAS,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAA;aAAE;2BACzD,MAAM,CAAC,CAAC,OAAO,mBAAmB,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC;4BAChD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;YA+ER,GAAG;;;;EAe/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,sRAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { NamePath } from '../../../../shared/ui';
2
+ type __VLS_Props = {
3
+ path?: NamePath;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ default?(_: {
9
+ path: string | undefined;
10
+ }): any;
11
+ };
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
24
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/PathProvider/index.vue"],"names":[],"mappings":"AAuBA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,KAAK,WAAW,GAAG;IAAE,IAAI,CAAC,EAAE,QAAQ,CAAA;CAAE,CAAC;AAavC,iBAAS,cAAc;WAqBT,OAAO,IAA6B;;;;YAVrB,GAAG;;;;EAe/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { FormProps as AFormProps } from '../../../../shared/ui';
2
+ import { Slot } from 'vue';
3
+ import { Grid, VModelProps } from '../../types';
4
+ import { Path } from '../../../../shared/core';
5
+ import { Form } from '../../hooks/useForm';
6
+ declare const _default: <F extends Form<any> = Form>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
7
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & ({
8
+ grid?: Grid;
9
+ form?: F;
10
+ } & Partial<Omit<AFormProps, "model">>) & Partial<{}>> & import('vue').PublicProps;
11
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
12
+ attrs: any;
13
+ slots: Readonly<Partial<Record<F extends Form<infer D extends import('@qin-ui/pro-components-core').Data> ? Path<D> : string, Slot<VModelProps & {
14
+ path?: string;
15
+ } & import('@qin-ui/pro-components-core').Data & {
16
+ [x: string]: any;
17
+ disabled?: boolean;
18
+ }>> & {
19
+ default: Slot;
20
+ }>> & Partial<Record<F extends Form<infer D extends import('@qin-ui/pro-components-core').Data> ? Path<D> : string, Slot<VModelProps & {
21
+ path?: string;
22
+ } & import('@qin-ui/pro-components-core').Data & {
23
+ [x: string]: any;
24
+ disabled?: boolean;
25
+ }>> & {
26
+ default: Slot;
27
+ }>;
28
+ emit: {};
29
+ }>) => import('vue').VNode & {
30
+ __ctx?: Awaited<typeof __VLS_setup>;
31
+ };
32
+ export default _default;
33
+ type __VLS_PrettifyLocal<T> = {
34
+ [K in keyof T]: T[K];
35
+ } & {};
36
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/ProForm/index.vue"],"names":[],"mappings":"AA0GA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAiB,SAAS,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAIL,KAAK,IAAI,EAGV,MAAM,KAAK,CAAC;AAIb,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,IAAI,EAAsB,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;yBAE/B,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,EAC1C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WA4HO,mBAAmB,CAAC;eAvHN,IAAI;eAAS,CAAC;yDAuH0D,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;wDAjGgC,CAAC;;;;mBAEjB,OAAO;;iBAGwB,IAAI;8CALnB,CAAC;;;;mBAEjB,OAAO;;iBAGwB,IAAI;;UA8FvD,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAvIzE,wBAuI4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { SlotComponentType } from '../../types';
2
+ type Props = {
3
+ component?: SlotComponentType;
4
+ };
5
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
7
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/SlotComponent/index.vue"],"names":[],"mappings":"AAmCA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B,CAAC;;AAkDF,wBAMG"}
@@ -0,0 +1,12 @@
1
+ import { ComponentProps, ComponentExposed } from 'vue-component-type-helpers';
2
+ import { default as ProForm } from './ProForm/index.vue';
3
+ import { default as BaseFormItem } from './BaseFormItem/index.vue';
4
+ export { default as BaseField } from './BaseField/index.vue';
5
+ export { default as ContainerFragment } from './ContainerFragment/index.vue';
6
+ export { default as SlotComponent } from './SlotComponent/index.vue';
7
+ export { ProForm, BaseFormItem };
8
+ export type ProFormInstance = ComponentExposed<typeof ProForm>;
9
+ export type ProFormProps = ComponentProps<typeof ProForm>;
10
+ export type ProFormItemInstance = ComponentExposed<typeof BaseFormItem>;
11
+ export type ProFormItemProps = ComponentProps<typeof BaseFormItem>;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AAGjC,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC,OAAO,OAAO,CAAC,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,OAAO,YAAY,CAAC,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { Cascader, CheckboxGroup, DatePicker, AutoComplete, Input, InputNumber, InputPassword, InputSearch, RadioGroup, Select, Slider, Switch, TextArea, TimePicker, TimeRangePicker, Transfer, TreeSelect, RangePicker, InputOTP } from '../../../shared/ui';
2
+ /**
3
+ * FormItem 插槽名称列表
4
+ * @description 用于在字段配置中透传 FormItem 的插槽
5
+ */
6
+ export declare const FORM_ITEM_SLOT_KEYS: readonly ["label", "extra", "help", "tooltip"];
7
+ /**
8
+ * 内置组件映射表
9
+ * @description antdv-next 内置支持的组件类型映射。
10
+ * 每个 key 对应 Field 配置中 `component` 可使用的字符串值,
11
+ * value 为实际渲染的 antdv-next 组件。
12
+ *
13
+ * @public
14
+ */
15
+ export type BaseComponentMap = {
16
+ 'input': typeof Input;
17
+ 'textarea': typeof TextArea;
18
+ 'input-search': typeof InputSearch;
19
+ 'input-password': typeof InputPassword;
20
+ 'input-number': typeof InputNumber;
21
+ 'input-otp': typeof InputOTP;
22
+ 'auto-complete': typeof AutoComplete;
23
+ 'select': typeof Select;
24
+ 'cascader': typeof Cascader;
25
+ 'date-picker': typeof DatePicker;
26
+ 'range-picker': typeof RangePicker;
27
+ 'time-picker': typeof TimePicker;
28
+ 'time-range-picker': typeof TimeRangePicker;
29
+ 'checkbox-group': typeof CheckboxGroup;
30
+ 'radio-group': typeof RadioGroup;
31
+ 'switch': typeof Switch;
32
+ 'slider': typeof Slider;
33
+ 'tree-select': typeof TreeSelect;
34
+ 'transfer': typeof Transfer;
35
+ };
36
+ /**
37
+ * 组件映射扩展接口
38
+ * @description 暴露给外部扩充自定义组件类型的接口。
39
+ * 用户可通过 TypeScript 的声明合并(module augmentation)添加自定义组件。
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * // 在项目中任意 .d.ts 文件中
44
+ * declare module '@qin-ui/antdv-next-pro' {
45
+ * interface ComponentMap {
46
+ * 'my-custom-input': typeof MyCustomInput;
47
+ * }
48
+ * }
49
+ * ```
50
+
51
+ * @public
52
+ */
53
+ export interface ComponentMap {
54
+ }
55
+ /**
56
+ * 组件名称联合类型
57
+ * @description 所有支持的组件名称
58
+
59
+ * @public
60
+ */
61
+ export type ComponentName = keyof BaseComponentMap | keyof ComponentMap | 'custom';
62
+ /**
63
+ * 根据组件名获取组件类型
64
+ * @template K - 组件名称
65
+ */
66
+ export type GetComponentType<K extends ComponentName> = K extends keyof ComponentMap ? ComponentMap[K] : K extends keyof BaseComponentMap ? BaseComponentMap[K] : never;
67
+ /**
68
+ * 组件名称到 antdv-next 组件的运行时映射
69
+ * @description ProForm 通过此映射将 Field 配置中的 component 字符串解析为实际 Vue 组件。
70
+ * 例如 `component: 'input'` → `Input`, `component: 'select'` → `Select`。
71
+ *
72
+ * @public
73
+ */
74
+ export declare const componentMap: BaseComponentMap;
75
+ /**
76
+ * Teleport 组件名称前缀
77
+ * @description 用于通过插槽动态替换指定 path 的组件
78
+ */
79
+ export declare const TeleportComponentNamePrefix = "TeleportComponent_";
80
+ export { InjectionFormKey, InjectionPathKey } from '../../../shared/core';
81
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,YAAY,EACZ,KAAK,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,eAAe,EACf,QAAQ,EACR,UAAU,EACV,WAAW,EACX,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,gDAAiD,CAAC;AAElF;;;;;;;GAOG;AAEH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,KAAK,CAAC;IACtB,UAAU,EAAE,OAAO,QAAQ,CAAC;IAC5B,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,gBAAgB,EAAE,OAAO,aAAa,CAAC;IACvC,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,WAAW,EAAE,OAAO,QAAQ,CAAC;IAC7B,eAAe,EAAE,OAAO,YAAY,CAAC;IACrC,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,QAAQ,CAAC;IAC5B,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,cAAc,EAAE,OAAO,WAAW,CAAC;IACnC,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,mBAAmB,EAAE,OAAO,eAAe,CAAC;IAC5C,gBAAgB,EAAE,OAAO,aAAa,CAAC;IACvC,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,QAAQ,EAAE,OAAO,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,UAAU,CAAC;IACjC,UAAU,EAAE,OAAO,QAAQ,CAAC;CAC7B,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,YAAY;CAAG;AAEhC;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB,MAAM,gBAAgB,GACtB,MAAM,YAAY,GAClB,QAAQ,CAAC;AAEb;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,IAClD,CAAC,SAAS,MAAM,YAAY,GACxB,YAAY,CAAC,CAAC,CAAC,GACf,CAAC,SAAS,MAAM,gBAAgB,GAC9B,gBAAgB,CAAC,CAAC,CAAC,GACnB,KAAK,CAAC;AAEd;;;;;;GAMG;AAEH,eAAO,MAAM,YAAY,EAAE,gBAoB1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAGhE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './useForm';
2
+ export * from './useFields';
3
+ export * from './useFormRef';
4
+ export { useFormData } from '../../../shared/core';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { FormItemInstance } from '../../../shared/ui';
2
+ import { UseFieldsReturn, Data } from '../../../shared/core';
3
+ import { Field, Fields } from '../types';
4
+ import { ComponentName } from '../constants';
5
+ /**
6
+ * 字段配置管理 Hook
7
+ *
8
+ * @description 基于 `@qin-ui/pro-components-core` 的 `useFields`,将泛型参数绑定为 antdv-next 的本地类型:
9
+ * - 字段类型 F → `Field<ComponentName, D>`(支持 antdv-next 组件类型推导)
10
+ * - FormItem 实例 → antdv-next 的 `FormItemInstance`
11
+ *
12
+ * 提供对字段配置数组的增删改查操作,支持:
13
+ * - 通过路径字符串或查找函数定位字段
14
+ * - 深层嵌套字段的遍历和匹配
15
+ * - 字段配置的合并/覆盖更新
16
+ * - 字段的添加、插入、删除
17
+ * - 父级字段查找
18
+ *
19
+ * @template D - 表单数据类型
20
+ * @param {Fields<D>} [initFields] - 初始字段配置数组
21
+ *
22
+ * @returns 字段操作对象,包含以下属性:
23
+ * - `fields` — 字段配置数组(响应式 Ref\<F[]\>)
24
+ * - `getField(path)` — 获取字段配置,支持路径字符串或查找函数
25
+ * - `setField(path, field, options?)` — 更新字段配置,默认合并模式
26
+ * - `deleteField(path, options?)` — 删除字段配置
27
+ * - `appendField(path, field, options?)` — 在指定字段后追加
28
+ * - `prependField(path, field, options?)` — 在指定字段前插入
29
+ * - `getParentField(path, options?)` — 获取父级字段配置
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * interface User { name: string; age: number }
34
+ *
35
+ * const { fields, getField, setField } = useFields<User>([
36
+ * { path: 'name', label: '姓名', component: 'input' },
37
+ * { path: 'age', label: '年龄', component: 'input-number' },
38
+ * ])
39
+ *
40
+ * // 通过路径获取
41
+ * getField('name')
42
+ * // 通过查找函数获取
43
+ * getField(f => f.label === '姓名')
44
+ * // 更新字段(合并模式)
45
+ * setField('name', { label: '用户名', disabled: true })
46
+ * ```
47
+ *
48
+ * @see {@link coreUseFields} 底层核心实现(来自 @qin-ui/pro-components-core)
49
+ *
50
+ * @public
51
+ */
52
+ export declare function useFields<D extends Data = Data>(initFields?: Fields<D>): UseFieldsReturn<D, Field<ComponentName, D>, FormItemInstance>;
53
+ /** useFields 返回值类型
54
+ * @public
55
+ */
56
+ export type UseFields<D extends Data = Data> = ReturnType<typeof useFields<D>>;
57
+ //# sourceMappingURL=useFields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFields.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hooks/useFields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,EAC7C,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,GACrB,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAKjE;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,IAAI,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,93 @@
1
+ import { Form as _Form, Data, ExtendWithAny, DeepPartial } from '../../../shared/core';
2
+ import { Field } from '../types';
3
+ import { ComponentName } from '../constants';
4
+ import { FormInstance } from '../../../shared/ui';
5
+ /**
6
+ * 表单实例类型
7
+ *
8
+ * @description 在 core Form 类型的基础上,将字段类型 F 绑定为本地 Field<ComponentName, D>,
9
+ * 将底层表单实例 I 绑定为 antdv-next 的 FormInstance,使 formRef 获得完整的类型提示。
10
+ *
11
+ * @template D - 表单数据类型
12
+ * @template F - 字段配置类型,默认使用本地 Field 类型
13
+ *
14
+ * @property formData - 响应式表单数据对象,可直接读写,支持深层路径如 `formData.address.city`
15
+ * @property getFormData - 获取指定路径的表单数据,支持点号分隔的深层路径,如 `getFormData('address.city')`
16
+ * @property setFormData - 设置表单数据,支持三种调用方式:<br>
17
+ * 1. `setFormData(path, value)` — 设置指定路径的值<br>
18
+ * 2. `setFormData(path, prev => newVal)` — 函数式更新<br>
19
+ * 3. `setFormData({ ... })` — 批量覆盖整个表单
20
+ * @property fields - 字段配置数组(响应式 Ref),ProForm 根据此数组渲染表单字段
21
+ * @property getField - 获取字段配置,支持路径字符串(如 `'name'`)或查找函数(如 `f => f.label === '姓名'`)
22
+ * @property setField - 更新字段配置,默认合并模式(Object.assign),可通过 `{ updateType: 'rewrite' }` 覆盖
23
+ * @property deleteField - 删除字段配置,支持 `{ all: true }` 批量删除所有匹配项
24
+ * @property appendField - 在指定字段后追加新字段,传 `undefined` 则在末尾追加
25
+ * @property prependField - 在指定字段前插入新字段,传 `undefined` 则在开头插入
26
+ * @property getParentField - 获取指定字段的父级字段配置,用于嵌套字段场景
27
+ * @property formRef - 底层 antdv-next Form 组件实例的响应式引用(Ref),可调用 `validate()`、`resetFields()` 等方法
28
+ * @property setFormRef - 设置底层 Form 组件实例,由 ProForm 内部自动调用,一般无需手动使用
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * interface User { name: string; age: number }
33
+ * const form: Form<User> = useForm({ name: '张三', age: 25 })
34
+ *
35
+ * form.formData.name // 直接读写响应式数据
36
+ * form.getFormData('name') // 通过路径读取
37
+ * form.setFormData('name', '李四') // 更新数据
38
+ * form.formRef.value?.validate() // 访问底层 Form 实例
39
+ * ```
40
+ *
41
+ * @public
42
+ */
43
+ export type Form<D extends Data = Data, F extends Field<ComponentName, D> = Field<ComponentName, D>> = _Form<D, F, FormInstance>;
44
+ /**
45
+ * 创建表单实例的 Hook
46
+ *
47
+ * @description 基于 `@qin-ui/pro-components-core` 的 `useForm`,将泛型参数绑定为 antdv-next 的本地类型:
48
+ * - 字段类型 F → `Field<ComponentName, D>`(支持 antdv-next 所有内置组件类型推导)
49
+ * - 表单实例 → antdv-next 的 `FormInstance`(使 formRef 获得完整的类型提示)
50
+ *
51
+ * 表单实例组合了三个子模块的能力:
52
+ * - **useFormData**:表单数据管理(响应式数据、读写、批量更新)
53
+ * - **useFields**:字段配置管理(增删改查字段配置,支持嵌套)
54
+ * - **useFormRef**:底层 Form 组件实例引用
55
+ *
56
+ * @template D - 表单数据类型
57
+ *
58
+ * @param {ExtendWithAny<DeepPartial<D>>} [initFormData] - 初始表单数据
59
+ * @param {Field<ComponentName, D>[]} [initFields] - 初始字段配置数组
60
+ * @param {boolean} [root=true] - 是否为根表单。设为 `false` 时尝试从父组件注入获取表单实例
61
+ *
62
+ * @returns {Form<D>} 表单实例,包含数据操作、字段操作和 ref 操作
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * interface User { name: string; age: number }
67
+ *
68
+ * // 方式一:同时传入初始数据和字段
69
+ * const form = useForm<User>(
70
+ * { name: '张三', age: 25 },
71
+ * [
72
+ * { path: 'name', label: '姓名', component: 'input' },
73
+ * { path: 'age', label: '年龄', component: 'input-number' },
74
+ * ],
75
+ * true
76
+ * )
77
+ *
78
+ * // 方式二:仅设置 root 标识
79
+ * const form = useForm<User>(true)
80
+ *
81
+ * // 使用
82
+ * const { formData, formRef, fields, setFormData, getField } = form
83
+ * setFormData('name', '李四')
84
+ * await formRef.value?.validate()
85
+ * ```
86
+ *
87
+ * @see {@link coreUseForm} 底层核心实现(来自 @qin-ui/pro-components-core)
88
+ *
89
+ * @public
90
+ */
91
+ export declare function useForm<D extends Data = Data>(initFormData?: ExtendWithAny<DeepPartial<D>>, initFields?: Field<ComponentName, D>[], root?: boolean): Form<D, Field<ComponentName, D>>;
92
+ export declare function useForm<D extends Data = Data>(root?: boolean): Form<D, Field<ComponentName, D>>;
93
+ //# sourceMappingURL=useForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hooks/useForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,IAAI,IAAI,KAAK,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,MAAM,IAAI,CACd,CAAC,SAAS,IAAI,GAAG,IAAI,EACrB,CAAC,SAAS,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,IACzD,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,EAC3C,YAAY,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAC5C,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EACtC,IAAI,CAAC,EAAE,OAAO,GACb,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC;AACpC,wBAAgB,OAAO,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,EAC3C,IAAI,CAAC,EAAE,OAAO,GACb,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { UseFormRefReturn } from '../../../shared/core';
2
+ import { FormInstance } from '../../../shared/ui';
3
+ /**
4
+ * 表单组件实例引用 Hook
5
+ *
6
+ * @description 基于 `@qin-ui/pro-components-core` 的 `useFormRef`,将泛型参数绑定为 antdv-next 的 `FormInstance`,
7
+ * 使 formRef 获取到完整的 antdv-next Form 组件 API 类型提示(如 `validate()`、`resetFields()` 等)。
8
+ *
9
+ * `formRef` 由 ProForm 组件内部自动通过 `setFormRef` 绑定,无需手动调用。
10
+ *
11
+ * @returns 表单组件实例引用管理对象:
12
+ * - `formRef` — antdv-next Form 组件实例的响应式引用(`Ref<FormInstance | undefined>`)
13
+ * - `setFormRef(inst)` — 设置 Form 组件实例,由 ProForm 内部自动调用
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const { formRef, setFormRef } = useFormRef()
18
+ *
19
+ * // formRef 由 ProForm 自动绑定,可直接使用
20
+ * await formRef.value?.validate()
21
+ * formRef.value?.resetFields()
22
+ * formRef.value?.scrollToField('username')
23
+ * ```
24
+ *
25
+ * @see {@link coreUseFormRef} 底层核心实现(来自 @qin-ui/pro-components-core)
26
+ *
27
+ * @public
28
+ */
29
+ export declare function useFormRef(): UseFormRefReturn<FormInstance>;
30
+ //# sourceMappingURL=useFormRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormRef.d.ts","sourceRoot":"","sources":["../../../../src/components/form/hooks/useFormRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,UAAU,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAE3D"}
@@ -0,0 +1,7 @@
1
+ import { default as ProForm } from './components/ProForm/index.vue';
2
+ export { ContainerFragment, SlotComponent, type ProFormProps, type ProFormInstance, type ProFormItemProps, type ProFormItemInstance, } from './components';
3
+ export { type ComponentMap, type ComponentName } from './constants';
4
+ export { type Field, type Fields } from './types';
5
+ export { useForm, useFields, useFormRef, useFormData, type Form, type UseFields, } from './hooks';
6
+ export default ProForm;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gCAAgC,CAAC;AAGrD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAGpE,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAGlD,OAAO,EACL,OAAO,EACP,SAAS,EACT,UAAU,EACV,WAAW,EACX,KAAK,IAAI,EACT,KAAK,SAAS,GACf,MAAM,SAAS,CAAC;AAEjB,eAAe,OAAO,CAAC"}