@qin-ui/vant-pro 1.0.2 → 1.0.4

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.
package/AI-CONTEXT.md ADDED
@@ -0,0 +1,38 @@
1
+ # @qin-ui/vant-pro
2
+
3
+ > 基于 Vant v4 的配置驱动表单组件库。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install @qin-ui/vant-pro vant vue
9
+ ```
10
+
11
+ ## 核心导出
12
+
13
+ ### 组件
14
+
15
+ - `ProForm` - 配置驱动表单组件
16
+ - `ProComponentProvider` - 全局配置提供者
17
+
18
+ ### Hooks
19
+
20
+ - `useForm<D>()` - 创建表单实例
21
+ - `useFields<D>()` - 字段配置管理
22
+ - `useFormRef()` - 表单组件引用
23
+
24
+ ## 字段配置(Field)
25
+
26
+ 每个字段支持:`path`, `label`, `component`, `hidden`, `disabled`, `rules`, `valueFormatter`, `fields`, `grid`, `slots`, `componentStyle`, `componentClass`, `componentContainer`, `formItemStyle`, `formItemClass`, `formItemContainer`, `modelProp`
27
+
28
+ 内置组件:field, switch, stepper, rate, slider, uploader, checkbox-group, radio-group, picker, date-picker, time-picker, cascader, area, signature, button, custom
29
+
30
+ ## 类型扩展
31
+
32
+ ```typescript
33
+ declare module '@qin-ui/vant-pro' {
34
+ interface ComponentMap {
35
+ 'my-custom-component': typeof MyComponent;
36
+ }
37
+ }
38
+ ```
package/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # @qin-ui/vant-pro
2
2
 
3
- > 基于 Vant 4 和 @qin-ui/core 二次封装的移动端高级表单组件库。
3
+ > 基于 **Vant 4****@qin-ui/core** 二次封装的移动端高级表单组件库,专门针对移动端 H5 精细化打造,助您极速构建交互流畅、配置驱动的移动端表单应用。
4
4
 
5
- ## [📖 使用示例和文档详情](https://dufan3715.github.io/pro-components/)
5
+ <p align="center">
6
+ <img src="https://img.shields.io/badge/Vant-4.x-blue" alt="Vant 4.x" />
7
+ <img src="https://img.shields.io/badge/Vue-3.5%2B-brightgreen" alt="Vue 3.5+" />
8
+ <img src="https://img.shields.io/badge/TypeScript-5.x-blue" alt="TypeScript" />
9
+ <img src="https://img.shields.io/badge/License-MIT-green" alt="MIT" />
10
+ </p>
11
+
12
+ ## 📝 [使用示例和文档详细内容](https://dufan3715.github.io/pro-components/)
6
13
 
7
14
  ---
8
15
 
package/api.json ADDED
@@ -0,0 +1,163 @@
1
+ {
2
+ "generatedAt": "2026-05-26T08:42:45.735Z",
3
+ "name": "@qin-ui/vant-pro",
4
+ "api": [
5
+ {
6
+ "name": "ProComponentProvider",
7
+ "type": "component",
8
+ "package": "@qin-ui/vant-pro",
9
+ "signature": "<ProComponentProvider>",
10
+ "description": "@qin-ui/vant-pro 全局配置提供者组件\n用于在组件树的顶层配置所有子组件的全局默认属性。",
11
+ "examples": [
12
+ "```vue\n<ProComponentProvider\n:componentVars=\"{ 'field': { placeholder: '请输入' } }\"\n>\n<ProForm :form=\"form\" :fields=\"fields\" />\n</ProComponentProvider>\n```"
13
+ ]
14
+ },
15
+ {
16
+ "name": "ProForm",
17
+ "type": "component",
18
+ "package": "@qin-ui/vant-pro",
19
+ "signature": "<ProForm>",
20
+ "description": "@qin-ui/vant-pro 配置驱动表单组件(移动端)\n通过配置驱动的方式快速构建移动端表单,支持:\n- 字段联动、嵌套字段、自定义组件\n- 弹出层表单(Popup,适用于移动端选择器场景)",
21
+ "typeParams": [
22
+ {
23
+ "name": "F"
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "name": "ContainerFragment",
29
+ "type": "component",
30
+ "package": "@qin-ui/vant-pro",
31
+ "signature": "<ContainerFragment>",
32
+ "description": "容器分片渲染组件。用于动态渲染表单行或表单项的外部包裹容器(例如 Grid 行、Col 列等布局容器)。"
33
+ },
34
+ {
35
+ "name": "SlotComponent",
36
+ "type": "component",
37
+ "package": "@qin-ui/vant-pro",
38
+ "signature": "<SlotComponent>",
39
+ "description": "插槽渲染辅助组件。用于在表单或表格的自定义插槽中动态渲染外部传入的 VNode、渲染函数或静态字符串。"
40
+ },
41
+ {
42
+ "name": "ComponentMap",
43
+ "type": "interface",
44
+ "package": "@qin-ui/vant-pro",
45
+ "signature": "export interface ComponentMap {}",
46
+ "description": "组件映射扩展接口\n通过 TypeScript 声明合并添加自定义组件",
47
+ "examples": [
48
+ "```ts\ndeclare module '@qin-ui/vant-pro' {\ninterface ComponentMap {\n'my-custom': typeof MyComponent;\n}\n}\n```"
49
+ ]
50
+ },
51
+ {
52
+ "name": "ComponentName",
53
+ "type": "type",
54
+ "package": "@qin-ui/vant-pro",
55
+ "signature": "export type ComponentName =\n | keyof BaseComponentMap\n | keyof ComponentMap\n | 'custom';",
56
+ "description": "组件名称联合类型\n所有支持的组件名称"
57
+ },
58
+ {
59
+ "name": "useFormData",
60
+ "type": "function",
61
+ "package": "@qin-ui/vant-pro",
62
+ "signature": "export const useFormData = <D extends Data = Data>(\n initFormData?: ExtendWithAny<DeepPartial<D>>\n) =>",
63
+ "description": "表单数据处理 Hook\n提供响应式表单数据的管理能力,支持:\n- 响应式数据存储(基于 Vue reactive)\n- 深层路径读写(支持点号分隔,如 'address.city')\n- 类型安全的路径提示(传入泛型 D 后,path 参数可获得类型推导)\n- 父子表单自动注入(非根表单会从注入中获取数据)",
64
+ "returns": "{Function} .setFormData(path, value) - 设置指定路径的数据",
65
+ "typeParams": [
66
+ {
67
+ "name": "D"
68
+ }
69
+ ],
70
+ "examples": [
71
+ "```ts\ninterface User { name: string; age: number; address: { city: string } }\n\nconst { formData, getFormData, setFormData } = useFormData<User>({\nname: '张三',\naddress: { city: '北京' }\n})\n\n// 读取\ngetFormData('name') // '张三'\ngetFormData('address.city') // '北京'\nformData.name // '张三'(响应式)\n\n// 设置\nsetFormData('name', '李四')\nsetFormData('address.city', '上海')\nsetFormData({ name: '王五', age: 30 }) // 批量覆盖\nsetFormData(prev => ({ ...prev, name: '赵六' })) // 函数式更新\n```"
72
+ ]
73
+ },
74
+ {
75
+ "name": "useFields",
76
+ "type": "function",
77
+ "package": "@qin-ui/vant-pro",
78
+ "signature": "export const useFields = _useFields as",
79
+ "description": "类型安全的 re-export。将 core useFields 的泛型参数绑定为本地类型:\n- 字段类型 F → Field<ComponentName, D>(支持 Vant 组件类型推导)\n- Field 实例 → Vant 的 FieldInstance",
80
+ "typeParams": [
81
+ {
82
+ "name": "D"
83
+ }
84
+ ],
85
+ "examples": [
86
+ "```ts\ninterface User { name: string; age: number }\n\nconst { fields, getField, setField } = useFields<User>([\n{ path: 'name', label: '姓名', component: 'field' },\n{ path: 'age', label: '年龄', component: 'stepper' },\n])\n```"
87
+ ]
88
+ },
89
+ {
90
+ "name": "UseFields",
91
+ "type": "type",
92
+ "package": "@qin-ui/vant-pro",
93
+ "signature": "export type UseFields<D extends Data = Data> = ReturnType<typeof useFields<D>>;",
94
+ "description": "useFields 返回值类型,固定为本地 Fields<D>"
95
+ },
96
+ {
97
+ "name": "Form",
98
+ "type": "type",
99
+ "package": "@qin-ui/vant-pro",
100
+ "signature": "export type Form<\n D extends Data = Data,\n F extends Field<ComponentName, D> = Field<ComponentName, D>,\n> = _Form<D, F, FormInstance> & { formPopup: FormPopup };",
101
+ "description": "在 core Form 类型的基础上:\n1. 将字段类型 F 绑定为本地 Field<ComponentName, D>\n2. 将底层表单实例绑定为 Vant 的 FormInstance\n3. 额外包含 formPopup 对象,用于管理弹出层表单",
102
+ "typeParams": [
103
+ {
104
+ "name": "D"
105
+ },
106
+ {
107
+ "name": "F"
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "name": "useForm",
113
+ "type": "function",
114
+ "package": "@qin-ui/vant-pro",
115
+ "signature": "export function useForm<D extends Data = Data>(\n initFormData?: ExtendWithAny<DeepPartial<D>>,\n initFields?: Field<ComponentName, D>[],\n root?: boolean\n): Form<D, Field<ComponentName, D>>;",
116
+ "description": "创建 @qin-ui/vant-pro 表单实例的 Hook\n基于 core useForm 封装,额外提供了 formPopup 用于移动端弹窗表单。",
117
+ "typeParams": [
118
+ {
119
+ "name": "D"
120
+ }
121
+ ],
122
+ "examples": [
123
+ "```ts\ninterface User { name: string; age: number }\n\nconst form = useForm<User>(\n{ name: '张三' },\n[\n{ path: 'name', label: '姓名', component: 'field' },\n]\n)\n\n// 打开弹出层表单\nform.formPopup.open('address')\nform.formPopup.close()\n```"
124
+ ]
125
+ },
126
+ {
127
+ "name": "PopupProps",
128
+ "type": "type",
129
+ "package": "@qin-ui/vant-pro",
130
+ "signature": "export type PopupProps = ComponentProps<typeof Popup> &",
131
+ "description": "Vant Popup 组件属性类型\n用于配置表单弹出层的属性"
132
+ },
133
+ {
134
+ "name": "FormPopup",
135
+ "type": "type",
136
+ "package": "@qin-ui/vant-pro",
137
+ "signature": "export type FormPopup =",
138
+ "description": "表单弹出层管理对象\nVant 移动端特有的表单弹出层功能"
139
+ },
140
+ {
141
+ "name": "useFormPopup",
142
+ "type": "function",
143
+ "package": "@qin-ui/vant-pro",
144
+ "signature": "export function useFormPopup(root?: boolean): FormPopup;",
145
+ "description": "用于管理 Vant 移动端的表单弹出层(Popup)。\n在移动端表单中,某些字段(如地址选择、日期选择)需要以弹出层形式展示。",
146
+ "returns": "{FormPopup} 弹出层管理对象",
147
+ "examples": [
148
+ "```ts\nconst formPopup = useFormPopup(true)\nformPopup.open('address') // 打开地址选择弹出层\nformPopup.close() // 关闭\nformPopup.updateProps({ position: 'top' })\n```"
149
+ ]
150
+ },
151
+ {
152
+ "name": "useFormRef",
153
+ "type": "function",
154
+ "package": "@qin-ui/vant-pro",
155
+ "signature": "export const useFormRef = _useFormRef as",
156
+ "description": "类型安全的 re-export。将 core useFormRef 的泛型参数绑定为 Vant 的 FormInstance。",
157
+ "returns": "{Function} .setFormRef(inst) - 设置表单组件实例",
158
+ "examples": [
159
+ "```ts\nconst { formRef, setFormRef } = useFormRef()\nformRef.value?.submit()\n```"
160
+ ]
161
+ }
162
+ ]
163
+ }
@@ -0,0 +1,142 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @qin-ui/* AI 上下文初始化 CLI 工具
5
+ *
6
+ * 遵循 Agentic Collaboration Standard (ACS),
7
+ * 在消费方项目中自动生成统一的 .agents 规范配置文件。
8
+ *
9
+ * 用法:
10
+ * npx @qin-ui/vant-pro init-ai
11
+ */
12
+
13
+ import fs from 'node:fs';
14
+ import path from 'node:path';
15
+ import { fileURLToPath } from 'node:url';
16
+
17
+ // ==================== 常量 ====================
18
+
19
+ const __filename = fileURLToPath(import.meta.url);
20
+ const __dirname = path.dirname(__filename);
21
+ const PKG_ROOT = path.resolve(__dirname, '..');
22
+
23
+ const PKG_JSON = JSON.parse(
24
+ fs.readFileSync(path.join(PKG_ROOT, 'package.json'), 'utf-8')
25
+ );
26
+ const PKG_NAME = PKG_JSON.name;
27
+ const PKG_SHORT = PKG_NAME.replace(/^@qin-ui\//, '');
28
+
29
+ // ==================== 终端颜色 ====================
30
+
31
+ const green = (s) => `\x1b[32m${s}\x1b[0m`;
32
+ const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
33
+ const bold = (s) => `\x1b[1m${s}\x1b[0m`;
34
+ const red = (s) => `\x1b[31m${s}\x1b[0m`;
35
+
36
+ // ==================== 内容生成 ====================
37
+
38
+ function getAiContextContent() {
39
+ const filePath = path.join(PKG_ROOT, 'AI-CONTEXT.md');
40
+ if (fs.existsSync(filePath)) {
41
+ return fs.readFileSync(filePath, 'utf-8').trim();
42
+ }
43
+ return `# ${PKG_NAME}\n\n> 基于 Vue 3 的配置驱动组件库。`;
44
+ }
45
+
46
+ function getUnifiedAgentContent() {
47
+ const aiContext = getAiContextContent();
48
+ const core = [
49
+ aiContext,
50
+ '',
51
+ '## 完整 API 参考',
52
+ '',
53
+ `使用 \`${PKG_NAME}\` 时,请阅读以下文件获取完整的 API 定义、类型签名和使用示例:`,
54
+ `- \`node_modules/${PKG_NAME}/README.md\` — 详细使用文档和代码示例`,
55
+ `- \`node_modules/${PKG_NAME}/api.json\` — 结构化 API 元数据(组件、Hook、类型的签名和 JSDoc 示例)`,
56
+ '',
57
+ ].join('\n');
58
+
59
+ // 包含兼容性的 Frontmatter(如 Cursor 支持的 globs 等)
60
+ return [
61
+ '---',
62
+ `description: "${PKG_NAME} 组件库使用规范"`,
63
+ 'globs: ["**/*.vue", "**/*.ts", "**/*.tsx"]',
64
+ 'alwaysApply: false',
65
+ '---',
66
+ '',
67
+ core,
68
+ ].join('\n');
69
+ }
70
+
71
+ // ==================== 文件写入 ====================
72
+
73
+ function ensureDir(dirPath) {
74
+ if (!fs.existsSync(dirPath)) {
75
+ fs.mkdirSync(dirPath, { recursive: true });
76
+ }
77
+ }
78
+
79
+ // ==================== CLI 入口 ====================
80
+
81
+ function printHelp() {
82
+ console.log(`
83
+ ${bold(`${PKG_NAME} CLI`)}
84
+
85
+ ${bold('用法:')}
86
+ npx ${PKG_NAME} init-ai
87
+
88
+ ${bold('命令:')}
89
+ init-ai 在当前项目中生成统一的 .agents 规范配置文件
90
+
91
+ ${bold('选项:')}
92
+ --help 显示帮助信息
93
+
94
+ ${bold('说明:')}
95
+ 该命令将采用统一的 Agentic 标准,在项目的 .agents/rules/ 目录下
96
+ 生成上下文文件。兼容支持读取 .agents 的主流 AI IDE 和 CLI 工具。
97
+ `);
98
+ }
99
+
100
+ function main() {
101
+ const args = process.argv.slice(2);
102
+ const subcommand = args.find((a) => !a.startsWith('-'));
103
+ const flags = args.filter((a) => a.startsWith('-'));
104
+
105
+ if (!subcommand || flags.includes('--help') || flags.includes('-h')) {
106
+ printHelp();
107
+ process.exit(0);
108
+ }
109
+
110
+ if (subcommand !== 'init-ai') {
111
+ console.error(red(`\n 未知命令: ${subcommand}\n`));
112
+ printHelp();
113
+ process.exit(1);
114
+ }
115
+
116
+ console.log('');
117
+ console.log(bold(`📦 ${PKG_NAME} — AI 上下文初始化 (ACS 标准)`));
118
+ console.log('');
119
+
120
+ const content = getUnifiedAgentContent();
121
+ const dirPath = '.agents/rules';
122
+ const fileName = `${PKG_SHORT}.md`;
123
+
124
+ const fullDir = path.join(process.cwd(), dirPath);
125
+ const fullPath = path.join(fullDir, fileName);
126
+
127
+ ensureDir(fullDir);
128
+ fs.writeFileSync(fullPath, content, 'utf-8');
129
+
130
+ const relPath = path.join(dirPath, fileName);
131
+ console.log(` ${green('✔')} ${cyan(relPath)} ${green('[created/updated]')}`);
132
+
133
+ console.log('');
134
+ console.log(green('✅ 完成!已生成统一标准规则文件。'));
135
+ console.log('');
136
+ console.log(`${bold('下一步:')}`);
137
+ console.log(
138
+ ` 将 ${cyan(dirPath)} 目录提交到 Git,团队即可自动享受 AI 增强\n`
139
+ );
140
+ }
141
+
142
+ main();
@@ -0,0 +1,121 @@
1
+ import { defineComponent, provide, renderSlot } from "vue";
2
+ import { g as getObject } from "../core/index-B5vvm4Fj.js";
3
+ const INJECT_CONFIG = {
4
+ "pro-form": {
5
+ injectionKey: Symbol(""),
6
+ default: {
7
+ inputAlign: "right",
8
+ errorMessageAlign: "right",
9
+ required: "auto",
10
+ scrollToError: true,
11
+ scrollToErrorPosition: "nearest"
12
+ }
13
+ },
14
+ field: {
15
+ injectionKey: Symbol(""),
16
+ default: { clearable: true, placeholder: "请输入" }
17
+ },
18
+ switch: {
19
+ injectionKey: Symbol(""),
20
+ default: {}
21
+ },
22
+ stepper: {
23
+ injectionKey: Symbol(""),
24
+ default: {}
25
+ },
26
+ rate: {
27
+ injectionKey: Symbol(""),
28
+ default: {}
29
+ },
30
+ slider: {
31
+ injectionKey: Symbol(""),
32
+ default: {}
33
+ },
34
+ uploader: {
35
+ injectionKey: Symbol(""),
36
+ default: {}
37
+ },
38
+ "checkbox-group": {
39
+ injectionKey: Symbol(""),
40
+ default: {}
41
+ },
42
+ "radio-group": {
43
+ injectionKey: Symbol(""),
44
+ default: {}
45
+ },
46
+ picker: {
47
+ injectionKey: Symbol(""),
48
+ default: {}
49
+ },
50
+ "date-picker": {
51
+ injectionKey: Symbol(""),
52
+ default: {}
53
+ },
54
+ "time-picker": {
55
+ injectionKey: Symbol(""),
56
+ default: {}
57
+ },
58
+ cascader: {
59
+ injectionKey: Symbol(""),
60
+ default: {}
61
+ },
62
+ area: {
63
+ injectionKey: Symbol(""),
64
+ default: {}
65
+ },
66
+ signature: {
67
+ injectionKey: Symbol(""),
68
+ default: {}
69
+ },
70
+ button: {
71
+ injectionKey: Symbol(""),
72
+ default: {}
73
+ }
74
+ };
75
+ const INJECT_COMPONENTS = Symbol("INJECT_COMPONENTS");
76
+ const DYNAMIC_INJECT_CONFIG = /* @__PURE__ */ Object.create(null);
77
+ const getInjectConfig = (key) => {
78
+ return INJECT_CONFIG[key] || DYNAMIC_INJECT_CONFIG[key];
79
+ };
80
+ const ensureInjectConfig = (key) => {
81
+ const existing = getInjectConfig(key);
82
+ if (existing) return existing;
83
+ const created = {
84
+ injectionKey: Symbol(`dynamic:${key}`),
85
+ default: {}
86
+ };
87
+ DYNAMIC_INJECT_CONFIG[key] = created;
88
+ return created;
89
+ };
90
+ const _sfc_main = /* @__PURE__ */ defineComponent({
91
+ ...{
92
+ name: "ProComponentProvider",
93
+ inheritAttrs: false
94
+ },
95
+ __name: "index",
96
+ props: {
97
+ componentVars: {},
98
+ componentMap: {}
99
+ },
100
+ setup(__props) {
101
+ const props = __props;
102
+ if (props.componentMap) {
103
+ provide(INJECT_COMPONENTS, props.componentMap);
104
+ }
105
+ if (props.componentVars) {
106
+ Object.entries(props.componentVars).forEach(([key, val]) => {
107
+ const config = ensureInjectConfig(key);
108
+ provide(config.injectionKey, { ...config.default, ...getObject(val) });
109
+ });
110
+ }
111
+ return (_ctx, _cache) => {
112
+ return renderSlot(_ctx.$slots, "default");
113
+ };
114
+ }
115
+ });
116
+ export {
117
+ INJECT_COMPONENTS as I,
118
+ _sfc_main as _,
119
+ INJECT_CONFIG as a,
120
+ getInjectConfig as g
121
+ };
@@ -1,122 +1,4 @@
1
- import { defineComponent, provide, renderSlot } from "vue";
2
- import { g as getObject } from "../core/index-D-2iAH6o.js";
3
- const INJECT_CONFIG = {
4
- "pro-form": {
5
- injectionKey: Symbol(""),
6
- default: {
7
- inputAlign: "right",
8
- errorMessageAlign: "right",
9
- required: "auto",
10
- scrollToError: true,
11
- scrollToErrorPosition: "nearest"
12
- }
13
- },
14
- field: {
15
- injectionKey: Symbol(""),
16
- default: { clearable: true, placeholder: "请输入" }
17
- },
18
- switch: {
19
- injectionKey: Symbol(""),
20
- default: {}
21
- },
22
- stepper: {
23
- injectionKey: Symbol(""),
24
- default: {}
25
- },
26
- rate: {
27
- injectionKey: Symbol(""),
28
- default: {}
29
- },
30
- slider: {
31
- injectionKey: Symbol(""),
32
- default: {}
33
- },
34
- uploader: {
35
- injectionKey: Symbol(""),
36
- default: {}
37
- },
38
- "checkbox-group": {
39
- injectionKey: Symbol(""),
40
- default: {}
41
- },
42
- "radio-group": {
43
- injectionKey: Symbol(""),
44
- default: {}
45
- },
46
- picker: {
47
- injectionKey: Symbol(""),
48
- default: {}
49
- },
50
- "date-picker": {
51
- injectionKey: Symbol(""),
52
- default: {}
53
- },
54
- "time-picker": {
55
- injectionKey: Symbol(""),
56
- default: {}
57
- },
58
- cascader: {
59
- injectionKey: Symbol(""),
60
- default: {}
61
- },
62
- area: {
63
- injectionKey: Symbol(""),
64
- default: {}
65
- },
66
- signature: {
67
- injectionKey: Symbol(""),
68
- default: {}
69
- },
70
- button: {
71
- injectionKey: Symbol(""),
72
- default: {}
73
- }
74
- };
75
- const INJECT_COMPONENTS = Symbol("INJECT_COMPONENTS");
76
- const DYNAMIC_INJECT_CONFIG = /* @__PURE__ */ Object.create(null);
77
- const getInjectConfig = (key) => {
78
- return INJECT_CONFIG[key] || DYNAMIC_INJECT_CONFIG[key];
79
- };
80
- const ensureInjectConfig = (key) => {
81
- const existing = getInjectConfig(key);
82
- if (existing) return existing;
83
- const created = {
84
- injectionKey: Symbol(`dynamic:${key}`),
85
- default: {}
86
- };
87
- DYNAMIC_INJECT_CONFIG[key] = created;
88
- return created;
89
- };
90
- const _sfc_main = /* @__PURE__ */ defineComponent({
91
- ...{
92
- name: "ProComponentProvider",
93
- inheritAttrs: false
94
- },
95
- __name: "index",
96
- props: {
97
- componentVars: {},
98
- componentMap: {}
99
- },
100
- setup(__props) {
101
- const props = __props;
102
- if (props.componentMap) {
103
- provide(INJECT_COMPONENTS, props.componentMap);
104
- }
105
- if (props.componentVars) {
106
- Object.entries(props.componentVars).forEach(([key, val]) => {
107
- const config = ensureInjectConfig(key);
108
- provide(config.injectionKey, { ...config.default, ...getObject(val) });
109
- });
110
- }
111
- return (_ctx, _cache) => {
112
- return renderSlot(_ctx.$slots, "default");
113
- };
114
- }
115
- });
1
+ import { _ } from "./index-DC_k4_R3.js";
116
2
  export {
117
- INJECT_COMPONENTS,
118
- INJECT_CONFIG,
119
- _sfc_main as default,
120
- ensureInjectConfig,
121
- getInjectConfig
3
+ _ as default
122
4
  };
@@ -1,4 +1,4 @@
1
- import { camelize, inject, reactive, provide, ref } from "vue";
1
+ import { ref, inject, reactive, provide, camelize } from "vue";
2
2
  import { i as isPlainObject, s as set, g as get, t as toPath } from "../vendor/utils/lodash-es-DN4QDiDm.js";
3
3
  const InjectionFormKey = Symbol("form");
4
4
  const InjectionPathKey = Symbol("path");
@@ -109,23 +109,6 @@ const useFields = (initFields) => {
109
109
  options
110
110
  );
111
111
  }
112
- function addFields(path, newFields, options, placement) {
113
- if (newFields.length === 0) return;
114
- if (path) {
115
- updaterMatch(
116
- path,
117
- ({ fieldIndex, parentField }) => {
118
- const index = placement === "after" ? fieldIndex + 1 : fieldIndex;
119
- parentField.fields.splice(index, 0, ...newFields);
120
- },
121
- options
122
- );
123
- } else if (placement === "after") {
124
- fields.value.push(...newFields);
125
- } else {
126
- fields.value.unshift(...newFields);
127
- }
128
- }
129
112
  function appendField(path, field, options) {
130
113
  const newFields = Array.isArray(field) ? field : [field];
131
114
  addFields(path, newFields, options, "after");
@@ -146,6 +129,23 @@ const useFields = (initFields) => {
146
129
  );
147
130
  return (options == null ? void 0 : options.all) ? res : res[0];
148
131
  }
132
+ function addFields(path, newFields, options, placement) {
133
+ if (newFields.length === 0) return;
134
+ if (path) {
135
+ updaterMatch(
136
+ path,
137
+ ({ fieldIndex, parentField }) => {
138
+ const index = placement === "after" ? fieldIndex + 1 : fieldIndex;
139
+ parentField.fields.splice(index, 0, ...newFields);
140
+ },
141
+ options
142
+ );
143
+ } else if (placement === "after") {
144
+ fields.value.push(...newFields);
145
+ } else {
146
+ fields.value.unshift(...newFields);
147
+ }
148
+ }
149
149
  return {
150
150
  fields,
151
151
  getField,
@@ -225,8 +225,8 @@ function useForm(...args) {
225
225
  };
226
226
  }
227
227
  export {
228
- InjectionFormKey as I,
229
- InjectionPathKey as a,
228
+ InjectionPathKey as I,
229
+ InjectionFormKey as a,
230
230
  useFields as b,
231
231
  camelizeProperties as c,
232
232
  useFormRef as d,