@silver-formily/vue 2.3.2 → 2.3.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/README.en.md +6 -6
- package/README.md +6 -6
- package/esm/components/ArrayField.d.ts +67 -58
- package/esm/components/ArrayField.mjs +23 -23
- package/esm/components/ArrayField.mjs.map +1 -1
- package/esm/components/ExpressionScope.d.ts +21 -16
- package/esm/components/ExpressionScope.mjs +22 -24
- package/esm/components/ExpressionScope.mjs.map +1 -1
- package/esm/components/Field.d.ts +67 -58
- package/esm/components/Field.mjs +23 -23
- package/esm/components/Field.mjs.map +1 -1
- package/esm/components/FormConsumer.d.ts +9 -4
- package/esm/components/FormConsumer.mjs +17 -18
- package/esm/components/FormConsumer.mjs.map +1 -1
- package/esm/components/FormProvider.d.ts +21 -16
- package/esm/components/FormProvider.mjs +26 -26
- package/esm/components/FormProvider.mjs.map +1 -1
- package/esm/components/ObjectField.d.ts +68 -58
- package/esm/components/ObjectField.mjs +23 -23
- package/esm/components/ObjectField.mjs.map +1 -1
- package/esm/components/ReactiveField.mjs +103 -75
- package/esm/components/ReactiveField.mjs.map +1 -1
- package/esm/components/RecursionField.d.ts +142 -22
- package/esm/components/RecursionField.mjs +123 -127
- package/esm/components/RecursionField.mjs.map +1 -1
- package/esm/components/SchemaField.d.ts +3041 -2919
- package/esm/components/SchemaField.mjs +104 -97
- package/esm/components/SchemaField.mjs.map +1 -1
- package/esm/components/VoidField.d.ts +48 -42
- package/esm/components/VoidField.mjs +23 -23
- package/esm/components/VoidField.mjs.map +1 -1
- package/esm/components/index.d.ts +9 -9
- package/esm/components/index.mjs +10 -21
- package/esm/hooks/index.d.ts +5 -5
- package/esm/hooks/index.mjs +6 -13
- package/esm/hooks/useAttach.mjs +21 -13
- package/esm/hooks/useAttach.mjs.map +1 -1
- package/esm/hooks/useField.d.ts +8 -3
- package/esm/hooks/useField.mjs +9 -8
- package/esm/hooks/useField.mjs.map +1 -1
- package/esm/hooks/useFieldSchema.d.ts +8 -1
- package/esm/hooks/useFieldSchema.mjs +9 -8
- package/esm/hooks/useFieldSchema.mjs.map +1 -1
- package/esm/hooks/useForm.d.ts +8 -3
- package/esm/hooks/useForm.mjs +9 -8
- package/esm/hooks/useForm.mjs.map +1 -1
- package/esm/hooks/useFormEffects.d.ts +7 -2
- package/esm/hooks/useFormEffects.mjs +18 -15
- package/esm/hooks/useFormEffects.mjs.map +1 -1
- package/esm/hooks/useInjectionCleaner.mjs +8 -7
- package/esm/hooks/useInjectionCleaner.mjs.map +1 -1
- package/esm/hooks/useParentForm.d.ts +8 -3
- package/esm/hooks/useParentForm.mjs +18 -11
- package/esm/hooks/useParentForm.mjs.map +1 -1
- package/esm/index.d.ts +19 -4
- package/esm/index.mjs +20 -42
- package/esm/shared/connect.d.ts +10 -5
- package/esm/shared/connect.mjs +69 -63
- package/esm/shared/connect.mjs.map +1 -1
- package/esm/shared/context.d.ts +15 -10
- package/esm/shared/context.mjs +11 -10
- package/esm/shared/context.mjs.map +1 -1
- package/esm/shared/index.d.ts +2 -2
- package/esm/shared/index.mjs +3 -14
- package/esm/types/index.d.ts +72 -68
- package/esm/types/validator.d.ts +39 -35
- package/esm/utils/fieldProps.mjs +53 -51
- package/esm/utils/fieldProps.mjs.map +1 -1
- package/esm/utils/getRawComponent.mjs +16 -12
- package/esm/utils/getRawComponent.mjs.map +1 -1
- package/esm/utils/reactiveFieldHelpers.mjs +116 -94
- package/esm/utils/reactiveFieldHelpers.mjs.map +1 -1
- package/esm/utils/recursionFieldProps.mjs +14 -13
- package/esm/utils/recursionFieldProps.mjs.map +1 -1
- package/esm/utils/resolveSchemaProps.mjs +13 -10
- package/esm/utils/resolveSchemaProps.mjs.map +1 -1
- package/esm/utils/runtimeProps.d.ts +10 -7
- package/esm/utils/runtimeProps.mjs +15 -15
- package/esm/utils/runtimeProps.mjs.map +1 -1
- package/esm/utils/schemaFieldProps.mjs +63 -62
- package/esm/utils/schemaFieldProps.mjs.map +1 -1
- package/package.json +13 -12
- package/esm/components/ReactiveField.d.ts +0 -16
- package/esm/components/index.mjs.map +0 -1
- package/esm/global.d.d.ts +0 -1
- package/esm/global.d.mjs +0 -2
- package/esm/global.d.mjs.map +0 -1
- package/esm/hooks/index.mjs.map +0 -1
- package/esm/hooks/useAttach.d.ts +0 -7
- package/esm/hooks/useInjectionCleaner.d.ts +0 -2
- package/esm/index.mjs.map +0 -1
- package/esm/shared/index.mjs.map +0 -1
- package/esm/types/index.mjs +0 -2
- package/esm/types/index.mjs.map +0 -1
- package/esm/types/validator.mjs +0 -2
- package/esm/types/validator.mjs.map +0 -1
- package/esm/utils/fieldProps.d.ts +0 -51
- package/esm/utils/getRawComponent.d.ts +0 -8
- package/esm/utils/reactiveFieldHelpers.d.ts +0 -16
- package/esm/utils/recursionFieldProps.d.ts +0 -67
- package/esm/utils/resolveSchemaProps.d.ts +0 -1
- package/esm/utils/schemaFieldProps.d.ts +0 -232
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[Documentation](https://vue.silver-formily.org/) · [中文 README](./README.md)
|
|
4
4
|
|
|
5
|
-
@silver-formily/vue is a Vue 3–first runtime wrapper around [Formily](https://formilyjs.org/). It keeps the orchestration power of `@formily/vue` while removing Vue 2 compatibility layers, redundant DOM wrappers, and inconsistent event contracts. The source lives in `src/`, docs in `docs/`, and build artifacts in `esm/`.
|
|
5
|
+
@silver-formily/vue is a Vue 3–first runtime wrapper around [Formily](https://formilyjs.org/). It keeps the orchestration power of `@formily/vue` while removing Vue 2 compatibility layers, redundant DOM wrappers, and inconsistent event contracts. The source lives in `src/`, the docs app lives in `apps/vue-docs/`, and build artifacts live in `esm/`.
|
|
6
6
|
|
|
7
7
|
## ✨ Features
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- **Richer TypeScript hints** – explicit generics and shared interfaces sit beside the runtime to keep emitted `.d.ts` files in sync.
|
|
12
12
|
- **Formily ecosystem alignment** – works with `@formily/core`, `@formily/json-schema`, and other official packages, keeping migration costs low.
|
|
13
13
|
- **Decorator slots** – wire `FormItem` and other wrappers to the form schema via `:decorator-content` / `x-decorator-content`, covering `default`, `label`, `extra`, or any named slot. See the [FAQ entry](../../apps/vue-docs/en/questions/index.md#how-do-i-pass-slots-to-a-decorator).
|
|
14
|
-
- **Docs & demos included** – VitePress docs
|
|
14
|
+
- **Docs & demos included** – the VitePress docs app covers APIs, migration notes, and Element Plus demos; run `pnpm dev -- vue-docs` from the repo root to browse locally.
|
|
15
15
|
|
|
16
16
|
## 🔄 Differences vs `@formily/vue`
|
|
17
17
|
|
|
@@ -77,7 +77,7 @@ const FormItem = connect(
|
|
|
77
77
|
</template>
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
Explore more components (`SchemaField`, `RecursionField`, `ArrayField`, etc.) and composables in [`docs/api`](../../apps/vue-docs/api).
|
|
80
|
+
Explore more components (`SchemaField`, `RecursionField`, `ArrayField`, etc.) and composables in [`apps/vue-docs/api`](../../apps/vue-docs/api).
|
|
81
81
|
|
|
82
82
|
## 🧱 API Overview
|
|
83
83
|
|
|
@@ -93,8 +93,8 @@ All public symbols are re-exported from `src/index.ts`, and the published bundle
|
|
|
93
93
|
pnpm install # Install dependencies
|
|
94
94
|
pnpm lint # Run Antfu ESLint rules
|
|
95
95
|
pnpm build # Build the library + types via Vite
|
|
96
|
-
pnpm docs
|
|
97
|
-
pnpm docs:build
|
|
96
|
+
pnpm dev -- vue-docs # Launch the docs app from the repo root
|
|
97
|
+
pnpm --filter vue-docs docs:build # Build the docs site
|
|
98
98
|
pnpm commit # Conventional Commit helper (czg)
|
|
99
99
|
pnpm release # Changeset-driven release (requires clean tree)
|
|
100
100
|
```
|
|
@@ -106,7 +106,7 @@ pnpm release # Changeset-driven release (requires clean tree)
|
|
|
106
106
|
## 📚 Docs & Examples
|
|
107
107
|
|
|
108
108
|
- Visit the published site: <https://vue.silver-formily.org/>.
|
|
109
|
-
- `docs/demos` contains Element Plus playgrounds that double as regression samples.
|
|
109
|
+
- `apps/vue-docs/demos` contains Element Plus playgrounds that double as regression samples.
|
|
110
110
|
|
|
111
111
|
## 📄 License
|
|
112
112
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[文档网站](https://vue.silver-formily.org/) · [本地文档首页](../../apps/vue-docs/index.md) · [English README](./README.en.md)
|
|
4
4
|
|
|
5
|
-
@silver-formily/vue 是一个专注于 Vue 3 生态的 [Formily](https://formilyjs.org/) 运行时封装。它保留了 `@formily/vue` 的编排能力,同时去除了 Vue 2 兼容层、冗余 DOM 包裹以及不一致的事件契约。源码位于 `src
|
|
5
|
+
@silver-formily/vue 是一个专注于 Vue 3 生态的 [Formily](https://formilyjs.org/) 运行时封装。它保留了 `@formily/vue` 的编排能力,同时去除了 Vue 2 兼容层、冗余 DOM 包裹以及不一致的事件契约。源码位于 `src/`,文档应用位于 `apps/vue-docs/`,构建产物存放在 `esm/`。
|
|
6
6
|
|
|
7
7
|
## ✨ 特性
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- **完善的 TypeScript 类型**:在运行时附近维护显式泛型与公共接口,确保生成的 `.d.ts` 与实现同步。
|
|
12
12
|
- **Formily 生态对齐**:与 `@formily/core`、`@formily/json-schema` 等官方包保持兼容,迁移成本低。
|
|
13
13
|
- **Decorator 插槽支持**:通过 `:decorator-content` 与 `x-decorator-content` 将 `FormItem` 等装饰器的 `default`、`label`、`extra` 插槽与 schema 数据解耦,详见[常见问题](../../apps/vue-docs/questions/index.md#如何向装饰器传递插槽)。
|
|
14
|
-
- **配套文档与示例**:内置 VitePress
|
|
14
|
+
- **配套文档与示例**:内置 VitePress 文档应用,包含 API、迁移提示以及 Element Plus 示例,可在仓库根目录执行 `pnpm dev -- vue-docs` 本地查看。
|
|
15
15
|
|
|
16
16
|
## 🔄 与 `@formily/vue` 的差异
|
|
17
17
|
|
|
@@ -77,7 +77,7 @@ const FormItem = connect(
|
|
|
77
77
|
</template>
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
更多组件(`SchemaField`、`RecursionField`、`ArrayField` 等)与组合式 API 请参阅 [`docs/api`](../../apps/vue-docs/api)。
|
|
80
|
+
更多组件(`SchemaField`、`RecursionField`、`ArrayField` 等)与组合式 API 请参阅 [`apps/vue-docs/api`](../../apps/vue-docs/api)。
|
|
81
81
|
|
|
82
82
|
## 🧱 API 速览
|
|
83
83
|
|
|
@@ -93,8 +93,8 @@ const FormItem = connect(
|
|
|
93
93
|
pnpm install # 安装依赖
|
|
94
94
|
pnpm lint # 运行 Antfu ESLint 规则
|
|
95
95
|
pnpm build # 基于 Vite 生成库与类型
|
|
96
|
-
pnpm
|
|
97
|
-
pnpm docs:build
|
|
96
|
+
pnpm dev -- vue-docs # 从仓库根目录启动文档应用
|
|
97
|
+
pnpm --filter vue-docs docs:build # 构建文档站点
|
|
98
98
|
pnpm commit # 使用 czg 编写 Conventional Commit
|
|
99
99
|
pnpm release # Changeset 发布流程(需要干净工作区)
|
|
100
100
|
```
|
|
@@ -106,7 +106,7 @@ pnpm release # Changeset 发布流程(需要干净工作区)
|
|
|
106
106
|
## 📚 文档与示例
|
|
107
107
|
|
|
108
108
|
- 在线站点:<https://vue.silver-formily.org/>
|
|
109
|
-
- `docs/demos` 提供 Element Plus 示例,可作为封装自定义组件的起点。
|
|
109
|
+
- `apps/vue-docs/demos` 提供 Element Plus 示例,可作为封装自定义组件的起点。
|
|
110
110
|
|
|
111
111
|
## 📄 License
|
|
112
112
|
|
|
@@ -1,58 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
import { IValidatorRules, MultiValidator, ValidatorFunction } from "../types/validator.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
import * as _$_formily_core0 from "@formily/core";
|
|
4
|
+
|
|
5
|
+
//#region src/components/ArrayField.d.ts
|
|
6
|
+
declare const _default: _$vue.DefineComponent<{
|
|
7
|
+
loading?: boolean | undefined;
|
|
8
|
+
validator?: string | ValidatorFunction<any> | IValidatorRules<any> | MultiValidator<any> | undefined;
|
|
9
|
+
decoratorContent?: any;
|
|
10
|
+
name: _$_formily_core0.FormPathPattern;
|
|
11
|
+
dataSource?: _$_formily_core0.FieldDataSource | undefined;
|
|
12
|
+
value?: any;
|
|
13
|
+
initialValue?: any;
|
|
14
|
+
required?: boolean | undefined;
|
|
15
|
+
title?: any;
|
|
16
|
+
description?: any;
|
|
17
|
+
content?: any;
|
|
18
|
+
data?: any;
|
|
19
|
+
component?: boolean | any[] | undefined;
|
|
20
|
+
decorator?: boolean | any[] | undefined;
|
|
21
|
+
display?: string | undefined;
|
|
22
|
+
pattern?: string | undefined;
|
|
23
|
+
editable?: boolean | undefined;
|
|
24
|
+
disabled?: boolean | undefined;
|
|
25
|
+
readOnly?: boolean | undefined;
|
|
26
|
+
readPretty?: boolean | undefined;
|
|
27
|
+
hidden?: boolean | undefined;
|
|
28
|
+
visible?: boolean | undefined;
|
|
29
|
+
basePath?: _$_formily_core0.FormPathPattern | undefined;
|
|
30
|
+
reactions?: (_$_formily_core0.FieldReaction[] | _$_formily_core0.FieldReaction) | undefined;
|
|
31
|
+
validateFirst?: boolean | undefined;
|
|
32
|
+
validatePattern?: _$_formily_core0.FieldPatternTypes[] | undefined;
|
|
33
|
+
validateDisplay?: _$_formily_core0.FieldDisplayTypes[] | undefined;
|
|
34
|
+
}, () => _$vue.VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}>, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<{
|
|
37
|
+
loading?: boolean | undefined;
|
|
38
|
+
validator?: string | ValidatorFunction<any> | IValidatorRules<any> | MultiValidator<any> | undefined;
|
|
39
|
+
decoratorContent?: any;
|
|
40
|
+
name: _$_formily_core0.FormPathPattern;
|
|
41
|
+
dataSource?: _$_formily_core0.FieldDataSource | undefined;
|
|
42
|
+
value?: any;
|
|
43
|
+
initialValue?: any;
|
|
44
|
+
required?: boolean | undefined;
|
|
45
|
+
title?: any;
|
|
46
|
+
description?: any;
|
|
47
|
+
content?: any;
|
|
48
|
+
data?: any;
|
|
49
|
+
component?: boolean | any[] | undefined;
|
|
50
|
+
decorator?: boolean | any[] | undefined;
|
|
51
|
+
display?: string | undefined;
|
|
52
|
+
pattern?: string | undefined;
|
|
53
|
+
editable?: boolean | undefined;
|
|
54
|
+
disabled?: boolean | undefined;
|
|
55
|
+
readOnly?: boolean | undefined;
|
|
56
|
+
readPretty?: boolean | undefined;
|
|
57
|
+
hidden?: boolean | undefined;
|
|
58
|
+
visible?: boolean | undefined;
|
|
59
|
+
basePath?: _$_formily_core0.FormPathPattern | undefined;
|
|
60
|
+
reactions?: (_$_formily_core0.FieldReaction[] | _$_formily_core0.FieldReaction) | undefined;
|
|
61
|
+
validateFirst?: boolean | undefined;
|
|
62
|
+
validatePattern?: _$_formily_core0.FieldPatternTypes[] | undefined;
|
|
63
|
+
validateDisplay?: _$_formily_core0.FieldDisplayTypes[] | undefined;
|
|
64
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
65
|
+
//#endregion
|
|
66
|
+
export { _default };
|
|
67
|
+
//# sourceMappingURL=ArrayField.d.ts.map
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { fieldProps } from "../utils/fieldProps.mjs";
|
|
2
|
+
import { getRawComponent } from "../utils/getRawComponent.mjs";
|
|
3
|
+
import ReactiveField_default from "./ReactiveField.mjs";
|
|
4
|
+
import { defineComponent, h } from "vue";
|
|
5
|
+
//#region src/components/ArrayField.ts
|
|
6
|
+
var ArrayField_default = defineComponent({
|
|
7
|
+
name: "ArrayField",
|
|
8
|
+
props: fieldProps,
|
|
9
|
+
setup(props, { slots }) {
|
|
10
|
+
return () => {
|
|
11
|
+
return h(ReactiveField_default, {
|
|
12
|
+
fieldType: "ArrayField",
|
|
13
|
+
fieldProps: {
|
|
14
|
+
...props,
|
|
15
|
+
...getRawComponent(props)
|
|
16
|
+
}
|
|
17
|
+
}, slots);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=ArrayField.mjs.map
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ArrayField_default as default };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=ArrayField.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayField.mjs","sources":["../../src/components/ArrayField.ts"],"sourcesContent":["import type { IArrayFieldProps } from '../types'\nimport { defineComponent, h } from 'vue'\nimport { fieldProps } from '../utils/fieldProps'\nimport { getRawComponent } from '../utils/getRawComponent'\nimport ReactiveField from './ReactiveField'\n\nexport default defineComponent({\n name: 'ArrayField',\n props: fieldProps,\n setup(props: IArrayFieldProps, { slots }) {\n return () => {\n const componentData = {\n fieldType: 'ArrayField',\n fieldProps: {\n ...props,\n ...getRawComponent(props),\n },\n }\n return h(ReactiveField, componentData, slots)\n }\n },\n})\n"],"
|
|
1
|
+
{"version":3,"file":"ArrayField.mjs","names":["ReactiveField"],"sources":["../../src/components/ArrayField.ts"],"sourcesContent":["import type { IArrayFieldProps } from '../types'\nimport { defineComponent, h } from 'vue'\nimport { fieldProps } from '../utils/fieldProps'\nimport { getRawComponent } from '../utils/getRawComponent'\nimport ReactiveField from './ReactiveField'\n\nexport default defineComponent({\n name: 'ArrayField',\n props: fieldProps,\n setup(props: IArrayFieldProps, { slots }) {\n return () => {\n const componentData = {\n fieldType: 'ArrayField',\n fieldProps: {\n ...props,\n ...getRawComponent(props),\n },\n }\n return h(ReactiveField, componentData, slots)\n }\n },\n})\n"],"mappings":";;;;;AAMA,IAAA,qBAAe,gBAAgB;CAC7B,MAAM;CACN,OAAO;CACP,MAAM,OAAyB,EAAE,SAAS;AACxC,eAAa;AAQX,UAAO,EAAEA,uBAPa;IACpB,WAAW;IACX,YAAY;KACV,GAAG;KACH,GAAG,gBAAgB,MAAM;KAC1B;IACF,EACsC,MAAM;;;CAGlD,CAAC"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { IExpressionScopeProps } from "../types/index.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
import { PropType } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/components/ExpressionScope.d.ts
|
|
6
|
+
declare const _default: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
7
|
+
value: {
|
|
8
|
+
type: PropType<IExpressionScopeProps["value"]>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
}>, () => _$vue.VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}>[] | undefined, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{
|
|
14
|
+
value: {
|
|
15
|
+
type: PropType<IExpressionScopeProps["value"]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { _default };
|
|
21
|
+
//# sourceMappingURL=ExpressionScope.d.ts.map
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
4
|
-
import "@
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return a(e, t), () => p.default?.();
|
|
20
|
-
}
|
|
1
|
+
import { SchemaExpressionScopeSymbol } from "../shared/context.mjs";
|
|
2
|
+
import "../shared/index.mjs";
|
|
3
|
+
import { computed, defineComponent, inject, provide } from "vue";
|
|
4
|
+
import { lazyMerge } from "@formily/shared";
|
|
5
|
+
//#region src/components/ExpressionScope.ts
|
|
6
|
+
var ExpressionScope_default = defineComponent({
|
|
7
|
+
name: "ExpressionScope",
|
|
8
|
+
props: { value: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true
|
|
11
|
+
} },
|
|
12
|
+
setup(props, { slots }) {
|
|
13
|
+
const parentScopeRef = inject(SchemaExpressionScopeSymbol);
|
|
14
|
+
provide(SchemaExpressionScopeSymbol, computed(() => {
|
|
15
|
+
return lazyMerge(parentScopeRef?.value ?? {}, props.value);
|
|
16
|
+
}));
|
|
17
|
+
return () => slots.default?.();
|
|
18
|
+
}
|
|
21
19
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=ExpressionScope.mjs.map
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ExpressionScope_default as default };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=ExpressionScope.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpressionScope.mjs","sources":["../../src/components/ExpressionScope.ts"],"sourcesContent":["import type { PropType, Ref } from 'vue'\nimport type { IExpressionScopeProps, SchemaExpressionScope } from '../types'\nimport { lazyMerge } from '@formily/shared'\nimport { computed, defineComponent, inject, provide } from 'vue'\nimport { SchemaExpressionScopeSymbol } from '../shared'\n\nexport default defineComponent({\n name: 'ExpressionScope',\n props: {\n value: {\n type: Object as PropType<IExpressionScopeProps['value']>,\n required: true,\n },\n },\n setup(props, { slots }) {\n const parentScopeRef = inject<Ref<SchemaExpressionScope>>(SchemaExpressionScopeSymbol)\n const expressionScopeRef = computed<SchemaExpressionScope>(() => {\n const parentScope = parentScopeRef?.value ?? {}\n return lazyMerge(parentScope, props.value)\n })\n\n provide(SchemaExpressionScopeSymbol, expressionScopeRef)\n\n return () => slots.default?.()\n },\n})\n"],"
|
|
1
|
+
{"version":3,"file":"ExpressionScope.mjs","names":[],"sources":["../../src/components/ExpressionScope.ts"],"sourcesContent":["import type { PropType, Ref } from 'vue'\nimport type { IExpressionScopeProps, SchemaExpressionScope } from '../types'\nimport { lazyMerge } from '@formily/shared'\nimport { computed, defineComponent, inject, provide } from 'vue'\nimport { SchemaExpressionScopeSymbol } from '../shared'\n\nexport default defineComponent({\n name: 'ExpressionScope',\n props: {\n value: {\n type: Object as PropType<IExpressionScopeProps['value']>,\n required: true,\n },\n },\n setup(props, { slots }) {\n const parentScopeRef = inject<Ref<SchemaExpressionScope>>(SchemaExpressionScopeSymbol)\n const expressionScopeRef = computed<SchemaExpressionScope>(() => {\n const parentScope = parentScopeRef?.value ?? {}\n return lazyMerge(parentScope, props.value)\n })\n\n provide(SchemaExpressionScopeSymbol, expressionScopeRef)\n\n return () => slots.default?.()\n },\n})\n"],"mappings":";;;;;AAMA,IAAA,0BAAe,gBAAgB;CAC7B,MAAM;CACN,OAAO,EACL,OAAO;EACL,MAAM;EACN,UAAU;EACX,EACF;CACD,MAAM,OAAO,EAAE,SAAS;EACtB,MAAM,iBAAiB,OAAmC,4BAA4B;AAMtF,UAAQ,6BALmB,eAAsC;AAE/D,UAAO,UADa,gBAAgB,SAAS,EAAE,EACjB,MAAM,MAAM;IAC1C,CAEsD;AAExD,eAAa,MAAM,WAAW;;CAEjC,CAAC"}
|
|
@@ -1,58 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
import { IValidatorRules, MultiValidator, ValidatorFunction } from "../types/validator.js";
|
|
2
|
+
import * as _$vue from "vue";
|
|
3
|
+
import * as _$_formily_core0 from "@formily/core";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Field.d.ts
|
|
6
|
+
declare const _default: _$vue.DefineComponent<{
|
|
7
|
+
loading?: boolean | undefined;
|
|
8
|
+
validator?: string | ValidatorFunction<any> | IValidatorRules<any> | MultiValidator<any> | undefined;
|
|
9
|
+
decoratorContent?: any;
|
|
10
|
+
name: _$_formily_core0.FormPathPattern;
|
|
11
|
+
dataSource?: _$_formily_core0.FieldDataSource | undefined;
|
|
12
|
+
value?: any;
|
|
13
|
+
initialValue?: any;
|
|
14
|
+
required?: boolean | undefined;
|
|
15
|
+
title?: any;
|
|
16
|
+
description?: any;
|
|
17
|
+
content?: any;
|
|
18
|
+
data?: any;
|
|
19
|
+
component?: boolean | any[] | undefined;
|
|
20
|
+
decorator?: boolean | any[] | undefined;
|
|
21
|
+
display?: string | undefined;
|
|
22
|
+
pattern?: string | undefined;
|
|
23
|
+
editable?: boolean | undefined;
|
|
24
|
+
disabled?: boolean | undefined;
|
|
25
|
+
readOnly?: boolean | undefined;
|
|
26
|
+
readPretty?: boolean | undefined;
|
|
27
|
+
hidden?: boolean | undefined;
|
|
28
|
+
visible?: boolean | undefined;
|
|
29
|
+
basePath?: _$_formily_core0.FormPathPattern | undefined;
|
|
30
|
+
reactions?: (_$_formily_core0.FieldReaction[] | _$_formily_core0.FieldReaction) | undefined;
|
|
31
|
+
validateFirst?: boolean | undefined;
|
|
32
|
+
validatePattern?: _$_formily_core0.FieldPatternTypes[] | undefined;
|
|
33
|
+
validateDisplay?: _$_formily_core0.FieldDisplayTypes[] | undefined;
|
|
34
|
+
}, () => _$vue.VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}>, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<{
|
|
37
|
+
loading?: boolean | undefined;
|
|
38
|
+
validator?: string | ValidatorFunction<any> | IValidatorRules<any> | MultiValidator<any> | undefined;
|
|
39
|
+
decoratorContent?: any;
|
|
40
|
+
name: _$_formily_core0.FormPathPattern;
|
|
41
|
+
dataSource?: _$_formily_core0.FieldDataSource | undefined;
|
|
42
|
+
value?: any;
|
|
43
|
+
initialValue?: any;
|
|
44
|
+
required?: boolean | undefined;
|
|
45
|
+
title?: any;
|
|
46
|
+
description?: any;
|
|
47
|
+
content?: any;
|
|
48
|
+
data?: any;
|
|
49
|
+
component?: boolean | any[] | undefined;
|
|
50
|
+
decorator?: boolean | any[] | undefined;
|
|
51
|
+
display?: string | undefined;
|
|
52
|
+
pattern?: string | undefined;
|
|
53
|
+
editable?: boolean | undefined;
|
|
54
|
+
disabled?: boolean | undefined;
|
|
55
|
+
readOnly?: boolean | undefined;
|
|
56
|
+
readPretty?: boolean | undefined;
|
|
57
|
+
hidden?: boolean | undefined;
|
|
58
|
+
visible?: boolean | undefined;
|
|
59
|
+
basePath?: _$_formily_core0.FormPathPattern | undefined;
|
|
60
|
+
reactions?: (_$_formily_core0.FieldReaction[] | _$_formily_core0.FieldReaction) | undefined;
|
|
61
|
+
validateFirst?: boolean | undefined;
|
|
62
|
+
validatePattern?: _$_formily_core0.FieldPatternTypes[] | undefined;
|
|
63
|
+
validateDisplay?: _$_formily_core0.FieldDisplayTypes[] | undefined;
|
|
64
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
65
|
+
//#endregion
|
|
66
|
+
export { _default };
|
|
67
|
+
//# sourceMappingURL=Field.d.ts.map
|
package/esm/components/Field.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { fieldProps } from "../utils/fieldProps.mjs";
|
|
2
|
+
import { getRawComponent } from "../utils/getRawComponent.mjs";
|
|
3
|
+
import ReactiveField_default from "./ReactiveField.mjs";
|
|
4
|
+
import { defineComponent, h } from "vue";
|
|
5
|
+
//#region src/components/Field.ts
|
|
6
|
+
var Field_default = defineComponent({
|
|
7
|
+
name: "Field",
|
|
8
|
+
props: fieldProps,
|
|
9
|
+
setup(props, context) {
|
|
10
|
+
return () => {
|
|
11
|
+
return h(ReactiveField_default, {
|
|
12
|
+
fieldType: "Field",
|
|
13
|
+
fieldProps: {
|
|
14
|
+
...props,
|
|
15
|
+
...getRawComponent(props)
|
|
16
|
+
}
|
|
17
|
+
}, context.slots);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=Field.mjs.map
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Field_default as default };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=Field.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.mjs","sources":["../../src/components/Field.ts"],"sourcesContent":["import type { IFieldProps, IReactiveFieldProps } from '../types'\nimport { defineComponent, h } from 'vue'\nimport { fieldProps } from '../utils/fieldProps'\nimport { getRawComponent } from '../utils/getRawComponent'\nimport ReactiveField from './ReactiveField'\n\nexport default defineComponent({\n name: 'Field',\n props: fieldProps,\n setup(props: IFieldProps, context) {\n return () => {\n const componentData: IReactiveFieldProps = {\n fieldType: 'Field',\n fieldProps: {\n ...props,\n ...getRawComponent(props),\n },\n }\n return h(ReactiveField, componentData, context.slots)\n }\n },\n})\n"],"
|
|
1
|
+
{"version":3,"file":"Field.mjs","names":["ReactiveField"],"sources":["../../src/components/Field.ts"],"sourcesContent":["import type { IFieldProps, IReactiveFieldProps } from '../types'\nimport { defineComponent, h } from 'vue'\nimport { fieldProps } from '../utils/fieldProps'\nimport { getRawComponent } from '../utils/getRawComponent'\nimport ReactiveField from './ReactiveField'\n\nexport default defineComponent({\n name: 'Field',\n props: fieldProps,\n setup(props: IFieldProps, context) {\n return () => {\n const componentData: IReactiveFieldProps = {\n fieldType: 'Field',\n fieldProps: {\n ...props,\n ...getRawComponent(props),\n },\n }\n return h(ReactiveField, componentData, context.slots)\n }\n },\n})\n"],"mappings":";;;;;AAMA,IAAA,gBAAe,gBAAgB;CAC7B,MAAM;CACN,OAAO;CACP,MAAM,OAAoB,SAAS;AACjC,eAAa;AAQX,UAAO,EAAEA,uBAPkC;IACzC,WAAW;IACX,YAAY;KACV,GAAG;KACH,GAAG,gBAAgB,MAAM;KAC1B;IACF,EACsC,QAAQ,MAAM;;;CAG1D,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as _$vue from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/components/FormConsumer.d.ts
|
|
4
|
+
declare const _default: _$vue.DefineComponent<{}, () => _$vue.VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}>[] | null, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _default };
|
|
9
|
+
//# sourceMappingURL=FormConsumer.d.ts.map
|