@formvk/vue 0.0.0-stage → 1.0.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # @formvk/vue
2
+
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 65c066c: 添加readme.md文档
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [65c066c]
12
+ - @formvk/core@1.0.0
13
+ - @formvk/reactive@1.0.0
14
+ - @formvk/schema@1.0.0
15
+ - @formvk/shared@1.0.0
package/README.md CHANGED
@@ -1,3 +1,63 @@
1
- # Temporary Holding Version
1
+ # @formvk/vue
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Vue 3 bindings for Formvk. It connects the `@formvk/core` form model and `@formvk/schema` to Vue components through reactive renderers and composables.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @formvk/vue vue
9
+ ```
10
+
11
+ `vue` (`^3.5.0`) is a peer dependency.
12
+
13
+ ## Usage
14
+
15
+ ```vue
16
+ <script setup lang="ts">
17
+ import { createForm, createFragment, createSchema, FormProvider, SchemaField } from '@formvk/vue'
18
+
19
+ import MyInput from './MyInput.vue'
20
+
21
+ const form = createForm({ values: { name: '' } })
22
+ const f = createFragment()
23
+ const schema = createSchema({
24
+ name: f.Field({ title: 'Name', component: 'Input' }),
25
+ })
26
+ </script>
27
+
28
+ <template>
29
+ <FormProvider :form="form">
30
+ <SchemaField :schema="schema" :components="{ Input: MyInput }" />
31
+ </FormProvider>
32
+ </template>
33
+ ```
34
+
35
+ The schema field can also pre-bind components with `createSchemaField`:
36
+
37
+ ```ts
38
+ import { createSchema, createSchemaField } from '@formvk/vue'
39
+
40
+ const { SchemaField, fragment: f } = createSchemaField({
41
+ components: { Input: MyInput },
42
+ })
43
+
44
+ const schema = createSchema({
45
+ name: f.Input({ title: 'Name' }),
46
+ })
47
+ ```
48
+
49
+ ## API
50
+
51
+ - **Components** — `FormProvider`, `SchemaField`, `createSchemaField`, `RecursionField`, `ExpressionScope`, `FormConsumer`.
52
+ - **Hooks** — `useForm`, `useField`, `useFieldSchema`, `useAttach`, `useFormEffects`, `useInjectionCleaner`, `useParentForm`.
53
+ - **Helpers** — `createForm`, `connect`, `mapProps`, `mapReadPretty`.
54
+ - **Schema** — re-exports `@formvk/schema` (`createFragment`, `createSchema`, `ISchema`, expression types, ...).
55
+
56
+ ## Documentation
57
+
58
+ - Vue API: https://formvk.github.io/core/api/vue
59
+ - Getting started: https://formvk.github.io/core/guide/getting-started
60
+
61
+ ## License
62
+
63
+ MIT
@@ -0,0 +1,309 @@
1
+ import { AnyComponent } from '@formvk/schema';
2
+ import { Component } from 'vue';
3
+ import { ComponentOptionsMixin } from 'vue';
4
+ import { ComponentProvideOptions } from 'vue';
5
+ import { ComputedRef } from 'vue';
6
+ import { DefineComponent } from 'vue';
7
+ import { ExtractPropTypes } from 'vue';
8
+ import { Form } from '@formvk/core';
9
+ import { FormPathPattern } from '@formvk/shared';
10
+ import { Fragment } from '@formvk/schema';
11
+ import { GeneralField } from '@formvk/core';
12
+ import { IFieldFactoryProps } from '@formvk/core';
13
+ import { IFormProps } from '@formvk/core';
14
+ import { InjectionKey } from 'vue';
15
+ import { ISchema } from '@formvk/schema';
16
+ import { JSX } from 'vue/jsx-runtime';
17
+ import { ObjectField } from '@formvk/core';
18
+ import { PropType } from 'vue';
19
+ import { PublicProps } from 'vue';
20
+ import { Ref } from 'vue';
21
+ import { RendererElement } from 'vue';
22
+ import { RendererNode } from 'vue';
23
+ import { Schema } from '@formvk/schema';
24
+ import { SchemaKey } from '@formvk/schema';
25
+ import { SchemaPatchInput } from '@formvk/schema';
26
+ import { SlotsType } from 'vue';
27
+ import { TPropsOfComponent } from '@formvk/schema';
28
+ import { VNode } from 'vue';
29
+
30
+ /** 提取 Vue 组件定义的 props 类型。 */
31
+ export declare type ComponentProps<T> = T extends abstract new (...args: any) => {
32
+ $props: infer Props;
33
+ } ? Props : never;
34
+
35
+ export declare function connect<T extends VueComponent>(target: T, ...args: IComponentMapper[]): T;
36
+
37
+ export declare function createForm<T extends object = any>(options?: IFormProps<T>): Form<T>;
38
+
39
+ /**
40
+ * 基于扁平组件映射与分类组件 map 创建 SchemaField + fragment:
41
+ * - voidComponents / arrayComponents 只接收组件 map,分类名由工厂内部提取后传给 fragment
42
+ * - 分类组件会自动合并进运行时组件映射,无需在 components 中重复注册
43
+ * - 返回的 SchemaField 已预绑定拍平后的组件与 scope,props 仍可传扁平 map 覆盖同名组件
44
+ * - fragment 包含 Field / Object / Array / Void / transform 与按组件名生成的动态构造器
45
+ * 组件 props、字段值与 scope 类型全部自动推断,无需手写类型参数。
46
+ */
47
+ export declare function createSchemaField<F extends SchemaVueComponents = SchemaVueComponents, V extends SchemaVueComponents = {}, A extends SchemaVueComponents = {}, Scope extends object = Record<string, any>, Decorator extends AnyComponent<InferVoidProps<V, A>> = AnyComponent<InferVoidProps<V, A>>>(options?: ISchemaFieldFactoryOptions<F, V, A, Scope, Decorator>): SchemaFieldFactoryResult<F, V, A, Scope, Decorator>;
48
+
49
+ export declare const ExpressionScope: DefineComponent<{
50
+ value?: any;
51
+ }, () => VNode<RendererNode, RendererElement, {
52
+ [key: string]: any;
53
+ }>[] | undefined, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
54
+ value?: any;
55
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
56
+
57
+ export declare const FormConsumer: DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
58
+ [key: string]: any;
59
+ }>[], {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
60
+ default: IFormConsumerSlotProps;
61
+ }>, {}, {}, string, ComponentProvideOptions, true, {}, any>;
62
+
63
+ export declare const FormProvider: DefineComponent<{
64
+ form?: any;
65
+ }, () => VNode<RendererNode, RendererElement, {
66
+ [key: string]: any;
67
+ }>[] | undefined, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
68
+ form?: any;
69
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
70
+
71
+ export declare type IComponentMapper<T extends VueComponent = VueComponent> = (target: T) => VueComponent;
72
+
73
+ export declare interface IExpressionScopeProps {
74
+ value: any;
75
+ }
76
+
77
+ export declare interface IFormConsumerSlotProps {
78
+ form: Form;
79
+ }
80
+
81
+ export declare type InferArrayProps<A extends SchemaVueComponents> = {
82
+ [K in keyof A]: TPropsOfComponent<A[K]>;
83
+ };
84
+
85
+ /**
86
+ * 从扁平 components 与两个分类组件 map 分别推断 fragment 的三个 props map,组件 props 自动提取。
87
+ * 分类优先级与运行时 Proxy 一致:array > void > field,已分类的名字不会出现在 field 映射中,
88
+ * 避免同一组件名同时命中 field / void / array 多个动态构造器重载。
89
+ * 分类泛型默认空 map,keyof 结果为 never,省略分类时不会污染 field 推断。
90
+ */
91
+ export declare type InferFieldProps<F extends SchemaVueComponents, V extends SchemaVueComponents, A extends SchemaVueComponents> = {
92
+ [K in keyof F as K extends keyof V | keyof A ? never : K]: TPropsOfComponent<F[K]>;
93
+ };
94
+
95
+ export declare type InferVoidProps<V extends SchemaVueComponents, A extends SchemaVueComponents> = {
96
+ [K in keyof V as K extends keyof A ? never : K]: TPropsOfComponent<V[K]>;
97
+ };
98
+
99
+ export declare interface IProviderProps {
100
+ form: Form;
101
+ }
102
+
103
+ export declare interface IReactiveFieldProps {
104
+ fieldType?: ReactiveFieldType;
105
+ fieldProps?: IFieldFactoryProps<any, any>;
106
+ }
107
+
108
+ export declare interface IRecursionFieldProps {
109
+ schema: ISchema | Schema;
110
+ name?: SchemaKey;
111
+ basePath?: FormPathPattern;
112
+ onlyRenderProperties?: boolean;
113
+ onlyRenderSelf?: boolean;
114
+ mapProperties?: ISchemaMapper;
115
+ filterProperties?: ISchemaFilter;
116
+ }
117
+
118
+ declare interface IRecycleTarget {
119
+ onMount: () => void;
120
+ onUnmount: () => void;
121
+ }
122
+
123
+ export declare interface ISchemaFieldFactoryOptions<F extends SchemaVueComponents = SchemaVueComponents, V extends SchemaVueComponents = {}, A extends SchemaVueComponents = {}, Scope extends object = Record<string, any>, Decorator extends AnyComponent<InferVoidProps<V, A>> = AnyComponent<InferVoidProps<V, A>>> {
124
+ /** 扁平 name → component 映射,未声明分类的组件默认按 field 处理 */
125
+ components?: F;
126
+ /** void / 布局分类组件 map,自动合并进运行时组件映射 */
127
+ voidComponents?: V;
128
+ /** array 分类组件 map,自动合并进运行时组件映射 */
129
+ arrayComponents?: A;
130
+ /** 表达式与 reactions 的自定义 scope,传入后类型自动推断,无需手写泛型 */
131
+ scope?: Scope;
132
+ /** 默认装饰器,行为同 createFragment 的 defaultDecorator */
133
+ defaultDecorator?: Decorator;
134
+ /** 应用到 fragment 产出的每个 schema 上的 patch */
135
+ patches?: SchemaPatchInput | SchemaPatchInput[];
136
+ }
137
+
138
+ export declare interface ISchemaFieldProps extends IRecursionFieldProps {
139
+ /** 扁平 name → component 映射 */
140
+ components?: SchemaVueComponents;
141
+ scope?: Record<string, any>;
142
+ /**
143
+ * schema 引用变化时重建字段,默认关闭。
144
+ * 仅建议在开发环境开启,且 schema 需要保持稳定引用。
145
+ */
146
+ hotReload?: boolean;
147
+ }
148
+
149
+ /** 注入后代组件的运行时选项,components 始终是扁平 name → component。 */
150
+ export declare interface ISchemaFieldRuntimeOptions {
151
+ components?: SchemaVueComponents;
152
+ scope?: Record<string, any>;
153
+ }
154
+
155
+ export declare interface ISchemaFilter {
156
+ (schema: Schema, name: SchemaKey): boolean;
157
+ }
158
+
159
+ export declare interface ISchemaMapper {
160
+ (schema: Schema, name: SchemaKey): ISchema | Schema | void;
161
+ }
162
+
163
+ export declare type IStateMapper<Props = Record<string, any>> = Record<string, string | boolean> | ((props: Props, field: GeneralField) => Props);
164
+
165
+ export declare function mapProps<T extends VueComponent = VueComponent>(...args: IStateMapper[]): (target: T) => T;
166
+
167
+ export declare function mapReadPretty(component: VueComponent, readPrettyProps?: Record<string, any>): <T extends VueComponent>(target: T) => T;
168
+
169
+ export declare type ReactiveFieldType = 'Field' | 'ObjectField' | 'ArrayField' | 'VoidField';
170
+
171
+ export declare const RecursionField: DefineComponent<ExtractPropTypes<{
172
+ schema: {
173
+ required: true;
174
+ };
175
+ name: (StringConstructor | NumberConstructor)[];
176
+ basePath: {};
177
+ onlyRenderProperties: {
178
+ type: BooleanConstructor;
179
+ default: undefined;
180
+ };
181
+ onlyRenderSelf: {
182
+ type: BooleanConstructor;
183
+ default: undefined;
184
+ };
185
+ mapProperties: {};
186
+ filterProperties: {};
187
+ }>, () => VNode<RendererNode, RendererElement, {
188
+ [key: string]: any;
189
+ }> | null, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
190
+ schema: {
191
+ required: true;
192
+ };
193
+ name: (StringConstructor | NumberConstructor)[];
194
+ basePath: {};
195
+ onlyRenderProperties: {
196
+ type: BooleanConstructor;
197
+ default: undefined;
198
+ };
199
+ onlyRenderSelf: {
200
+ type: BooleanConstructor;
201
+ default: undefined;
202
+ };
203
+ mapProperties: {};
204
+ filterProperties: {};
205
+ }>> & Readonly<{}>, {
206
+ onlyRenderProperties: boolean;
207
+ onlyRenderSelf: boolean;
208
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
209
+
210
+ export declare const SchemaField: DefineComponent<ExtractPropTypes<{
211
+ schema: {
212
+ type: PropType<ISchema | Schema>;
213
+ required: true;
214
+ };
215
+ components: {
216
+ type: PropType<SchemaVueComponents>;
217
+ };
218
+ scope: {
219
+ type: PropType<Record<string, any>>;
220
+ };
221
+ name: PropType<SchemaKey>;
222
+ basePath: PropType<FormPathPattern>;
223
+ hotReload: {
224
+ type: BooleanConstructor;
225
+ default: undefined;
226
+ };
227
+ onlyRenderProperties: {
228
+ type: BooleanConstructor;
229
+ default: undefined;
230
+ };
231
+ onlyRenderSelf: {
232
+ type: BooleanConstructor;
233
+ default: undefined;
234
+ };
235
+ mapProperties: {
236
+ type: PropType<ISchemaMapper>;
237
+ };
238
+ filterProperties: {
239
+ type: PropType<ISchemaFilter>;
240
+ };
241
+ }>, () => JSX.Element, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
242
+ schema: {
243
+ type: PropType<ISchema | Schema>;
244
+ required: true;
245
+ };
246
+ components: {
247
+ type: PropType<SchemaVueComponents>;
248
+ };
249
+ scope: {
250
+ type: PropType<Record<string, any>>;
251
+ };
252
+ name: PropType<SchemaKey>;
253
+ basePath: PropType<FormPathPattern>;
254
+ hotReload: {
255
+ type: BooleanConstructor;
256
+ default: undefined;
257
+ };
258
+ onlyRenderProperties: {
259
+ type: BooleanConstructor;
260
+ default: undefined;
261
+ };
262
+ onlyRenderSelf: {
263
+ type: BooleanConstructor;
264
+ default: undefined;
265
+ };
266
+ mapProperties: {
267
+ type: PropType<ISchemaMapper>;
268
+ };
269
+ filterProperties: {
270
+ type: PropType<ISchemaFilter>;
271
+ };
272
+ }>> & Readonly<{}>, {
273
+ onlyRenderProperties: boolean;
274
+ onlyRenderSelf: boolean;
275
+ hotReload: boolean;
276
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
277
+
278
+ /**
279
+ * createSchemaField 的返回值:
280
+ * - SchemaField:预绑定 components 与 scope 的渲染组件
281
+ * - fragment:同配置的 fragment 构造器集合(Field / Object / Array / Void / transform 与动态构造器)
282
+ */
283
+ export declare type SchemaFieldFactoryResult<F extends SchemaVueComponents, V extends SchemaVueComponents, A extends SchemaVueComponents, Scope extends object, Decorator extends AnyComponent<InferVoidProps<V, A>>> = {
284
+ SchemaField: typeof SchemaField;
285
+ fragment: Fragment<InferFieldProps<F, V, A>, InferVoidProps<V, A>, InferArrayProps<A>, Scope, Decorator>;
286
+ };
287
+
288
+ export declare type SchemaVueComponents = Record<string, VueComponent>;
289
+
290
+ export declare function useAttach<T extends IRecycleTarget>(target: Ref<T>): Ref<T>;
291
+
292
+ export declare function useField<T = GeneralField>(): Ref<T>;
293
+
294
+ export declare function useFieldSchema(): Ref<Schema>;
295
+
296
+ export declare function useForm(): Ref<Form>;
297
+
298
+ export declare function useFormEffects(effects?: (form: Form) => void): void;
299
+
300
+ export declare function useInjectionCleaner(injectionKeys: InjectionKey<Ref<unknown>>[]): void;
301
+
302
+ export declare function useParentForm(): ComputedRef<Form | ObjectField>;
303
+
304
+ export declare type VueComponent = Component;
305
+
306
+
307
+ export * from "@formvk/schema";
308
+
309
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,504 @@
1
+ import { Schema as e, createFragment as t } from "@formvk/schema";
2
+ import { FormPath as n, each as r, isFn as i, isStr as a, isValid as o, lazyMerge as s, uid as c } from "@formvk/shared";
3
+ import { Fragment as l, computed as u, createVNode as d, defineComponent as f, h as p, inject as m, isVNode as h, markRaw as g, nextTick as _, onBeforeUnmount as v, onMounted as ee, onUnmounted as te, provide as y, ref as b, shallowRef as x, toRaw as S, toRef as ne, watch as C, watchEffect as re } from "vue";
4
+ import { createForm as w, isObjectField as T, isVoidField as E } from "@formvk/core";
5
+ import { toJS as D } from "@formvk/reactive";
6
+ export * from "@formvk/schema";
7
+ // src/shared/context.ts
8
+ var O = Symbol("form"), k = Symbol("field"), A = Symbol("schema"), j = Symbol("schemaExpression"), M = Symbol("schemaOptions"), ie = /* @__PURE__ */ f({
9
+ name: "ExpressionScope",
10
+ inheritAttrs: !1,
11
+ props: ["value"],
12
+ setup(e, { slots: t }) {
13
+ let n = m(j, b({})), r = u(() => s(n.value, e.value));
14
+ return y(j, r), () => t.default?.();
15
+ }
16
+ });
17
+ // src/hooks/useForm.ts
18
+ function N() {
19
+ return m(O, b());
20
+ }
21
+ // src/components/FormConsumer.tsx
22
+ var P = /* @__PURE__ */ f({
23
+ name: "FormConsumer",
24
+ inheritAttrs: !1,
25
+ slots: Object,
26
+ setup(e, { slots: t }) {
27
+ let n = N();
28
+ return () => t.default?.({ form: n.value }) ?? null;
29
+ }
30
+ });
31
+ // src/hooks/useAttach.ts
32
+ function F(e) {
33
+ return C(e, (e, t, n) => {
34
+ e && e !== t && (t?.onUnmount(), _(() => e.onMount()), n(() => e.onUnmount()));
35
+ }), ee(() => {
36
+ e.value?.onMount();
37
+ }), te(() => {
38
+ e.value?.onUnmount();
39
+ }), e;
40
+ }
41
+ // src/hooks/useInjectionCleaner.ts
42
+ function I(e) {
43
+ e.forEach((e) => y(e, b()));
44
+ }
45
+ // src/components/FormProvider.tsx
46
+ var ae = /* @__PURE__ */ f({
47
+ name: "FormProvider",
48
+ inheritAttrs: !1,
49
+ props: ["form"],
50
+ setup(e, { slots: t }) {
51
+ let n = F(ne(e, "form"));
52
+ return y(O, n), I([
53
+ k,
54
+ A,
55
+ j,
56
+ M
57
+ ]), () => t.default?.();
58
+ }
59
+ });
60
+ // src/hooks/useField.ts
61
+ function L() {
62
+ return m(k, b());
63
+ }
64
+ // src/utils/getRawComponent.ts
65
+ function R(e, t) {
66
+ let r = a(t) ? n.getIn(e, t) : void 0;
67
+ return S(r ?? t);
68
+ }
69
+ // src/components/ReactiveField.tsx
70
+ function z(e) {
71
+ return e ? i(e) ? !0 : typeof e == "object" && (i(e.setup) || i(e.render) || a(e.template)) : !1;
72
+ }
73
+ function B(e) {
74
+ return Array.isArray(e) ? e : e == null ? [] : [e];
75
+ }
76
+ function V(e) {
77
+ return Array.isArray(e) ? e.length > 1 ? p(l, null, e) : e[0] ?? null : e;
78
+ }
79
+ function H(e) {
80
+ return h(e) || a(e) ? e : z(e) ? p(e) : e;
81
+ }
82
+ function U(e, t, n) {
83
+ let i = {};
84
+ if (Object.keys(t).forEach((n) => {
85
+ i[n] = (r) => t[n]?.({
86
+ field: e,
87
+ form: e.form,
88
+ ...r
89
+ }) ?? [];
90
+ }), !n) return i;
91
+ function o(e, t) {
92
+ let n = i[e];
93
+ i[e] = (e) => [...B(n?.(e)), ...B(H(t))];
94
+ }
95
+ return a(n) || h(n) || z(n) ? o("default", n) : typeof n == "object" && r(n, (e, t) => {
96
+ o(t, e);
97
+ }), i;
98
+ }
99
+ function W(e) {
100
+ let t = {}, n = {};
101
+ return r(e, (e, r) => {
102
+ if (r.startsWith("on")) {
103
+ let t = `${r[2].toLowerCase()}${r.slice(3)}`;
104
+ n[t] = n[t] ?? e;
105
+ } else r.startsWith("@") ? n[r.slice(1)] = e : t[r] = e;
106
+ }), {
107
+ props: t,
108
+ events: n
109
+ };
110
+ }
111
+ function G(e) {
112
+ let t = {};
113
+ return r(e, (e, n) => {
114
+ t[`on${n.charAt(0).toUpperCase()}${n.slice(1)}`] = e;
115
+ }), t;
116
+ }
117
+ var K = /* @__PURE__ */ f({
118
+ name: "ReactiveField",
119
+ inheritAttrs: !1,
120
+ props: {
121
+ fieldType: {
122
+ type: String,
123
+ default: "Field"
124
+ },
125
+ fieldProps: {
126
+ type: Object,
127
+ default: () => ({})
128
+ }
129
+ },
130
+ setup(e, { slots: t }) {
131
+ let n = N(), r = L(), i = m(M, b({}));
132
+ function o() {
133
+ let t = e.fieldType ?? "Field", i = e.fieldProps ?? {};
134
+ return n.value?.[`create${t}`]?.({
135
+ ...i,
136
+ basePath: i.basePath ?? r.value?.address
137
+ });
138
+ }
139
+ let s = x(o());
140
+ return C(() => e.fieldProps, () => {
141
+ s.value = o();
142
+ }), F(s), y(k, s), () => {
143
+ let e = s.value, n = i.value;
144
+ if (!e) return t.default?.();
145
+ if (e.display !== "visible") return null;
146
+ let r = U(e, t, e.content);
147
+ function o(t) {
148
+ if (!e.decoratorType) return V(t);
149
+ let r = R(n?.components, e.decoratorType), { props: i, events: a } = W(D(e.decorator[1]) || {});
150
+ return p(r, {
151
+ ...i,
152
+ ...G(a)
153
+ }, { default: () => t });
154
+ }
155
+ function c() {
156
+ if (!e.componentType) return r.default?.() ?? null;
157
+ let t = R(n?.components, e.componentType), { props: i, events: o } = W(D(e.component[1]) || {}), s = o.change, c = o.focus, l = o.blur;
158
+ o.change = (...t) => {
159
+ E(e) || e.onInput(...t), s?.(...t);
160
+ }, o.focus = (...t) => {
161
+ E(e) || e.onFocus(...t), c?.(...t);
162
+ }, o.blur = (...t) => {
163
+ E(e) || e.onBlur(...t), l?.(...t);
164
+ };
165
+ let u = {
166
+ ...E(e) ? {} : {
167
+ disabled: e.pattern === "disabled" || e.pattern === "readPretty",
168
+ readOnly: e.pattern === "readOnly"
169
+ },
170
+ ...i,
171
+ ...E(e) ? {} : { value: e.value },
172
+ ...G(o)
173
+ };
174
+ return a(t) ? p(t, u, Object.keys(r).map((e) => r[e]())) : p(t, u, r);
175
+ }
176
+ return o(c());
177
+ };
178
+ }
179
+ });
180
+ // src/components/RecursionField.tsx
181
+ function q(e) {
182
+ let t = Object.keys(e);
183
+ if (!t.length) return null;
184
+ let n = t.reduce((t, n) => {
185
+ let r = e[n]();
186
+ return t.concat(Array.isArray(r) ? r : [r]);
187
+ }, []);
188
+ return p("div", { style: { display: "contents" } }, n);
189
+ }
190
+ var J = /* @__PURE__ */ f({
191
+ name: "RecursionField",
192
+ inheritAttrs: !1,
193
+ props: {
194
+ schema: { required: !0 },
195
+ name: [String, Number],
196
+ basePath: {},
197
+ onlyRenderProperties: {
198
+ type: Boolean,
199
+ default: void 0
200
+ },
201
+ onlyRenderSelf: {
202
+ type: Boolean,
203
+ default: void 0
204
+ },
205
+ mapProperties: {},
206
+ filterProperties: {}
207
+ },
208
+ setup(t) {
209
+ let n = L(), r = m(M, b({})), a = m(j, b({})), c = u(() => {
210
+ let n = t.schema;
211
+ return g(e.isSchemaInstance(n) ? n : new e(n));
212
+ });
213
+ function l(e) {
214
+ let t = r.value;
215
+ return e.toFieldProps({
216
+ ...t,
217
+ get scope() {
218
+ return s(t.scope, a.value);
219
+ }
220
+ });
221
+ }
222
+ let d = x(l(c.value));
223
+ C([c, r], () => {
224
+ d.value = l(c.value);
225
+ });
226
+ function f() {
227
+ return t.onlyRenderProperties ? t.basePath ?? (o(t.name) ? (n.value?.address ?? "").concat(t.name) : n.value?.address) : t.basePath ?? n.value?.address;
228
+ }
229
+ return y(A, c), () => {
230
+ let n = c.value;
231
+ if (!n) return null;
232
+ let r = f(), a = d.value;
233
+ function s(a = !1) {
234
+ if (t.onlyRenderSelf) return {};
235
+ let o = e.getOrderProperties(n);
236
+ if (!o.length) return {};
237
+ let s = {};
238
+ function c(e, t) {
239
+ s[e] || (s[e] = []), s[e].push(t);
240
+ }
241
+ let l = t.mapProperties, u = t.filterProperties;
242
+ o.forEach(({ schema: e, key: t }, n) => {
243
+ let a = e;
244
+ if (i(l)) {
245
+ let n = l(e, t);
246
+ n && (a = n);
247
+ }
248
+ i(u) && u(a, t) === !1 || c(a.slot ?? "default", (e) => p(J, {
249
+ key: `${n}-${t}`,
250
+ schema: a,
251
+ name: t,
252
+ basePath: e?.address ?? r
253
+ }));
254
+ });
255
+ let d = {};
256
+ return Object.keys(s).forEach((e) => {
257
+ let t = s[e];
258
+ d[e] = a ? ({ field: e } = {}) => t.map((t) => t(e)) : () => t.map((e) => e());
259
+ }), d;
260
+ }
261
+ if (!o(t.name)) return q(s());
262
+ let l = {
263
+ ...a,
264
+ name: t.name,
265
+ basePath: r
266
+ };
267
+ return n.type === "object" ? t.onlyRenderProperties ? q(s()) : p(K, {
268
+ fieldType: "ObjectField",
269
+ fieldProps: l
270
+ }, s(!0)) : n.type === "array" ? p(K, {
271
+ fieldType: "ArrayField",
272
+ fieldProps: l
273
+ }) : n.type === "void" ? t.onlyRenderProperties ? q(s()) : p(K, {
274
+ fieldType: "VoidField",
275
+ fieldProps: l
276
+ }, s(!0)) : p(K, {
277
+ fieldType: "Field",
278
+ fieldProps: l
279
+ });
280
+ };
281
+ }
282
+ }), Y = {
283
+ schema: {
284
+ type: Object,
285
+ required: !0
286
+ },
287
+ components: { type: Object },
288
+ scope: { type: Object },
289
+ name: [String, Number],
290
+ basePath: [
291
+ String,
292
+ Number,
293
+ Array,
294
+ Object,
295
+ Function
296
+ ],
297
+ hotReload: {
298
+ type: Boolean,
299
+ default: void 0
300
+ },
301
+ onlyRenderProperties: {
302
+ type: Boolean,
303
+ default: void 0
304
+ },
305
+ onlyRenderSelf: {
306
+ type: Boolean,
307
+ default: void 0
308
+ },
309
+ mapProperties: { type: Function },
310
+ filterProperties: { type: Function }
311
+ };
312
+ function X(e, t) {
313
+ return e ? `${e}.${t}` : String(t);
314
+ }
315
+ function Z(e, t, n) {
316
+ let r = [], i = [], a = (e, t) => {
317
+ e.type === "array" && i.push(X(t, "*")), s(e, t);
318
+ }, s = (e, t) => {
319
+ let n = e.properties ?? {};
320
+ Object.keys(n).forEach((e) => {
321
+ let i = X(t, e);
322
+ r.push(i), a(n[e], i);
323
+ });
324
+ let i = e.items;
325
+ i && (Array.isArray(i) ? i : [i]).forEach((e) => {
326
+ e && s(e, X(t, "*"));
327
+ });
328
+ };
329
+ if (o(n)) {
330
+ let i = X(t, String(n));
331
+ r.push(i), a(e, i);
332
+ } else s(e, t);
333
+ return {
334
+ fields: r,
335
+ arrays: i
336
+ };
337
+ }
338
+ function Q(t) {
339
+ return e.isSchemaInstance(t) ? t : new e({
340
+ type: "object",
341
+ ...t
342
+ });
343
+ }
344
+ function oe(e, t, n, r, i) {
345
+ let a = Z(t, r, i), o = Z(n, r, i), s = new Set(o.fields);
346
+ a.fields.forEach((t) => {
347
+ s.has(t) || (e.deleteValuesIn(t), e.deleteInitialValuesIn(t));
348
+ }), (/* @__PURE__ */ new Set([
349
+ ...a.fields,
350
+ ...o.fields,
351
+ ...a.arrays,
352
+ ...o.arrays
353
+ ])).forEach((t) => {
354
+ e.clearFormGraph(t, !1);
355
+ });
356
+ }
357
+ function se(e) {
358
+ if (!e.hotReload) return;
359
+ let t = N(), r = L();
360
+ C(() => e.schema, (i, a) => {
361
+ let o = t.value;
362
+ if (!o || !a || !i) return;
363
+ let s = e.basePath ? n.parse(e.basePath).toString() : r.value?.address?.toString() ?? "";
364
+ oe(o, Q(a), Q(i), s, e.name);
365
+ }, { flush: "pre" });
366
+ }
367
+ function $(e, t) {
368
+ let n = u(() => Q(e.schema));
369
+ se(e);
370
+ let r = u(() => ({
371
+ components: {
372
+ ...t?.components,
373
+ ...e.components
374
+ },
375
+ scope: {
376
+ ...t?.scope,
377
+ ...e.scope
378
+ }
379
+ })), i = u(() => r.value.scope);
380
+ return y(M, r), y(j, i), () => d(J, {
381
+ schema: n.value,
382
+ name: e.name,
383
+ basePath: e.basePath,
384
+ onlyRenderProperties: e.onlyRenderProperties,
385
+ onlyRenderSelf: e.onlyRenderSelf,
386
+ mapProperties: e.mapProperties,
387
+ filterProperties: e.filterProperties
388
+ }, null);
389
+ }
390
+ var ce = /* @__PURE__ */ f({
391
+ name: "SchemaField",
392
+ inheritAttrs: !1,
393
+ props: Y,
394
+ setup(e) {
395
+ return $(e);
396
+ }
397
+ });
398
+ function le(e = {}) {
399
+ let n = e.voidComponents ?? {}, r = e.arrayComponents ?? {}, i = {
400
+ ...e.components,
401
+ ...n,
402
+ ...r
403
+ }, a = t({
404
+ patches: e.patches,
405
+ voidComponentNames: Object.keys(n),
406
+ arrayComponentNames: Object.keys(r),
407
+ defaultDecorator: e.defaultDecorator
408
+ }), o = {
409
+ components: i,
410
+ scope: e.scope
411
+ };
412
+ return {
413
+ SchemaField: /* @__PURE__ */ f({
414
+ name: "SchemaField",
415
+ inheritAttrs: !1,
416
+ props: Y,
417
+ setup(e) {
418
+ return $(e, o);
419
+ }
420
+ }),
421
+ fragment: a
422
+ };
423
+ }
424
+ // src/hooks/useFieldSchema.ts
425
+ function ue() {
426
+ return m(A, b());
427
+ }
428
+ // src/hooks/useFormEffects.ts
429
+ function de(e) {
430
+ let t = N(), n = re((n) => {
431
+ let r = t.value;
432
+ if (!r) return;
433
+ let i = c();
434
+ r.addEffects(i, e), n(() => {
435
+ r.removeEffects(i);
436
+ });
437
+ });
438
+ v(() => n());
439
+ }
440
+ // src/hooks/useParentForm.ts
441
+ function fe() {
442
+ let e = L(), t = N();
443
+ function n(e) {
444
+ return e ? T(e) ? e : n(e.parent) : t.value;
445
+ }
446
+ return u(() => n(e.value));
447
+ }
448
+ // src/shared/connect.tsx
449
+ function pe(...e) {
450
+ function t(t, s) {
451
+ return e.reduce((e, t) => (i(t) ? e = Object.assign(e, t(e, s)) : r(t, (t, r) => {
452
+ let i = n.getIn(s, r), c = a(t) ? t : r, l = n.getIn(e, c);
453
+ r === "value" && t !== r && delete e.value, (!o(l) || o(i)) && n.setIn(e, c, i);
454
+ }), e), t);
455
+ }
456
+ return function(e) {
457
+ return /* @__PURE__ */ f({
458
+ name: e.name ? `Connected${e.name}` : "ConnectedComponent",
459
+ inheritAttrs: !1,
460
+ setup(n, { attrs: r, slots: i }) {
461
+ let a = L();
462
+ return () => {
463
+ let n = a.value ? t({ ...r }, a.value) : { ...r };
464
+ return p(e, n, i);
465
+ };
466
+ }
467
+ });
468
+ };
469
+ }
470
+ function me(e, t) {
471
+ return function(n) {
472
+ return /* @__PURE__ */ f({
473
+ name: n.name ? `Read${n.name}` : "ReadComponent",
474
+ inheritAttrs: !1,
475
+ setup(r, { attrs: i, slots: a }) {
476
+ let o = L();
477
+ return () => {
478
+ let r = o.value, s = r && !E(r) && r.pattern === "readPretty" ? e : n;
479
+ return p(s, {
480
+ ...t,
481
+ ...i
482
+ }, a);
483
+ };
484
+ }
485
+ });
486
+ };
487
+ }
488
+ function he(e, ...t) {
489
+ let n = t.reduce((e, t) => t(e), e);
490
+ return g(/* @__PURE__ */ f({
491
+ name: e.name,
492
+ inheritAttrs: !1,
493
+ setup(e, { attrs: t, slots: r }) {
494
+ return () => p(n, t, r);
495
+ }
496
+ }));
497
+ }
498
+ // src/shared/createForm.ts
499
+ function ge(e) {
500
+ return g(w(e));
501
+ }
502
+ export { ie as ExpressionScope, P as FormConsumer, ae as FormProvider, J as RecursionField, ce as SchemaField, he as connect, ge as createForm, le as createSchemaField, pe as mapProps, me as mapReadPretty, F as useAttach, L as useField, ue as useFieldSchema, N as useForm, de as useFormEffects, I as useInjectionCleaner, fe as useParentForm };
503
+
504
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["lazyMerge","computed","defineComponent","inject","provide","ref","SchemaExpressionScopeSymbol","ExpressionScope","name","inheritAttrs","props","setup","slots","scopeRef","expressionScopeRef","value","default","defineComponent","useForm","FormConsumer","name","inheritAttrs","slots","Object","setup","_","formRef","default","form","value","defineComponent","provide","toRef","useAttach","useInjectionCleaner","FieldSymbol","FormSymbol","SchemaExpressionScopeSymbol","SchemaOptionsSymbol","SchemaSymbol","FormProvider","name","inheritAttrs","props","setup","slots","formRef","default","isVoidField","toJS","each","isFn","isStr","Fragment","defineComponent","h","inject","isVNode","provide","ref","shallowRef","watch","useAttach","useField","useForm","FieldSymbol","SchemaOptionsSymbol","getRawComponent","isVueComponentLike","value","setup","render","template","toArray","Array","isArray","undefined","wrapFragment","child","length","renderContent","content","mergeSlots","field","slots","result","Object","keys","forEach","name","slotProps","form","appendToSlot","origin","key","normalizeProps","props","events","startsWith","eventName","toLowerCase","slice","toVueEventProps","handler","charAt","toUpperCase","ReactiveField","inheritAttrs","fieldType","type","String","default","fieldProps","formRef","parentRef","optionsRef","createField","basePath","address","fieldRef","options","display","mergedSlots","renderDecorator","children","decoratorType","Decorator","components","decoratorProps","decorator","renderComponent","componentType","Component","originProps","component","originChange","change","originFocus","focus","originBlur","blur","args","onInput","onFocus","onBlur","componentProps","disabled","pattern","readOnly","map","Schema","isFn","isValid","lazyMerge","computed","defineComponent","h","inject","markRaw","provide","ref","shallowRef","watch","useField","SchemaExpressionScopeSymbol","SchemaOptionsSymbol","SchemaSymbol","ReactiveField","resolveEmptySlot","slots","names","Object","keys","length","children","reduce","result","name","value","concat","Array","isArray","style","display","RecursionField","inheritAttrs","props","schema","required","String","Number","basePath","onlyRenderProperties","type","Boolean","default","undefined","onlyRenderSelf","mapProperties","filterProperties","setup","parentRef","optionsRef","scopeRef","fieldSchemaRef","isSchemaInstance","getPropsFromSchema","options","toFieldProps","scope","fieldPropsRef","getBasePath","address","fieldProps","generateSlotsByProperties","scoped","properties","getOrderProperties","renderMap","setRender","key","push","forEach","item","index","itemSchema","mapped","slot","field","renderFns","map","renderFn","commonFieldProps","fieldType","createFragment","Schema","FormPath","isValid","computed","defineComponent","provide","watch","useField","useForm","SchemaExpressionScopeSymbol","SchemaOptionsSymbol","RecursionField","schemaFieldProps","schema","type","Object","required","components","scope","name","String","Number","basePath","Array","Function","hotReload","Boolean","default","undefined","onlyRenderProperties","onlyRenderSelf","mapProperties","filterProperties","joinPath","prefix","segment","collectSchemaPaths","fields","arrays","walkNode","node","path","push","walkChildren","properties","keys","forEach","key","items","itemSchemas","isArray","item","rootPath","toSchema","isSchemaInstance","applyHotReload","form","prev","next","prevPaths","nextPaths","nextFields","Set","has","deleteValuesIn","deleteInitialValuesIn","patterns","pattern","clearFormGraph","setupHotReload","props","formRef","parentRef","value","parse","toString","address","flush","renderSchemaField","prebound","schemaRef","optionsRef","scopeRef","_createVNode","SchemaField","inheritAttrs","setup","createSchemaField","options","voidComponents","arrayComponents","flatComponents","fragment","patches","voidComponentNames","arrayComponentNames","defaultDecorator","BoundSchemaField","isVoidField","each","FormPath","isFn","isStr","isValid","defineComponent","h","markRaw","useField","mapProps","args","transform","input","field","reduce","props","mapper","Object","assign","to","extract","extractValue","getIn","targetValue","originalValue","value","setIn","target","name","inheritAttrs","setup","_","attrs","slots","fieldRef","newAttrs","mapReadPretty","component","readPrettyProps","Current","pattern","connect","Component","current","createCoreForm","createForm$1","FormSymbol","FieldSymbol","SchemaSymbol","SchemaExpressionScopeSymbol","SchemaOptionsSymbol","ExpressionScope","scopeRef","inject","ref","expressionScopeRef","computed","lazyMerge","props","provide","slots","useForm","FormConsumer","formRef","useAttach","watch","target","value","oldValue","nextTick","onInvalidate","onMounted","onUnmounted","useInjectionCleaner","key","FormProvider","toRef","useField","getRawComponent","resolved","isStr","component","FormPath","components","toRaw","isVueComponentLike","isFn","toArray","wrapFragment","child","h","Fragment","renderContent","isVNode","content","mergeSlots","result","name","field","slotProps","appendToSlot","origin","each","normalizeProps","events","eventName","toVueEventProps","handler","ReactiveField","parentRef","optionsRef","createField","fieldType","fieldProps","fieldRef","shallowRef","options","mergedSlots","renderDecorator","children","Decorator","decoratorProps","toJS","renderComponent","Component","originProps","originChange","originFocus","originBlur","args","isVoidField","componentProps","resolveEmptySlot","names","RecursionField","fieldSchemaRef","schema","markRaw","Schema","getPropsFromSchema","fieldPropsRef","getBasePath","isValid","basePath","generateSlotsByProperties","properties","renderMap","setRender","mapProperties","filterProperties","item","itemSchema","mapped","index","renderFns","scoped","renderFn","commonFieldProps","schemaFieldProps","joinPath","prefix","segment","collectSchemaPaths","fields","arrays","walkNode","node","path","walkChildren","items","rootPath","toSchema","applyHotReload","prevPaths","prev","nextPaths","next","nextFields","form","pattern","setupHotReload","renderSchemaField","schemaRef","prebound","createVNode","\"schema\"","\"name\"","\"basePath\"","\"onlyRenderProperties\"","\"onlyRenderSelf\"","\"mapProperties\"","\"filterProperties\"","SchemaField","createSchemaField","voidComponents","arrayComponents","flatComponents","fragment","createFragment","useFieldSchema","useFormEffects","stop","watchEffect","id","uid","effects","onCleanup","useParentForm","findObjectParent","isObjectField","mapProps","transform","mapper","extractValue","extract","targetValue","to","originalValue","input","newAttrs","attrs","mapReadPretty","Current","readPrettyProps","connect","current","createForm"],"sources":["../src/shared/context.ts","../src/components/ExpressionScope.tsx","../src/hooks/useForm.ts","../src/components/FormConsumer.tsx","../src/hooks/useAttach.ts","../src/hooks/useInjectionCleaner.ts","../src/components/FormProvider.tsx","../src/hooks/useField.ts","../src/utils/getRawComponent.ts","../src/components/ReactiveField.tsx","../src/components/RecursionField.tsx","../src/components/SchemaField.tsx","../src/hooks/useFieldSchema.ts","../src/hooks/useFormEffects.ts","../src/hooks/useParentForm.ts","../src/shared/connect.tsx","../src/shared/createForm.ts"],"sourcesContent":["import type { Form, GeneralField } from '@formvk/core'\nimport type { Schema } from '@formvk/schema'\nimport type { InjectionKey, Ref } from 'vue'\n\nimport type { ISchemaFieldRuntimeOptions } from '../types'\n\nexport const FormSymbol: InjectionKey<Ref<Form>> = Symbol('form')\n\nexport const FieldSymbol: InjectionKey<Ref<GeneralField>> = Symbol('field')\n\nexport const SchemaSymbol: InjectionKey<Ref<Schema>> = Symbol('schema')\n\nexport const SchemaExpressionScopeSymbol: InjectionKey<Ref<Record<string, any>>> = Symbol('schemaExpression')\n\nexport const SchemaOptionsSymbol: InjectionKey<Ref<ISchemaFieldRuntimeOptions>> = Symbol('schemaOptions')\n","import { lazyMerge } from '@formvk/shared'\nimport { computed, defineComponent, inject, provide, ref } from 'vue'\n\nimport { SchemaExpressionScopeSymbol } from '../shared/context'\n\nexport const ExpressionScope = defineComponent({\n name: 'ExpressionScope',\n inheritAttrs: false,\n props: ['value'],\n setup(props, { slots }) {\n const scopeRef = inject(SchemaExpressionScopeSymbol, ref({}))\n const expressionScopeRef = computed(() => lazyMerge(scopeRef.value, props.value))\n provide(SchemaExpressionScopeSymbol, expressionScopeRef)\n\n return () => slots.default?.()\n },\n})\n","import type { Form } from '@formvk/core'\nimport { inject, ref } from 'vue'\nimport type { Ref } from 'vue'\n\nimport { FormSymbol } from '../shared/context'\n\nexport function useForm(): Ref<Form> {\n return inject(FormSymbol, ref()) as Ref<Form>\n}\n","import type { SlotsType } from 'vue'\nimport { defineComponent } from 'vue'\n\nimport { useForm } from '../hooks/useForm'\nimport type { IFormConsumerSlotProps } from '../types'\n\nexport const FormConsumer = defineComponent({\n name: 'FormConsumer',\n inheritAttrs: false,\n slots: Object as SlotsType<{\n default: IFormConsumerSlotProps\n }>,\n setup(_, { slots }) {\n const formRef = useForm()\n return () => slots.default?.({ form: formRef.value }) ?? null\n },\n})\n","import { nextTick, onMounted, onUnmounted, watch } from 'vue'\nimport type { Ref } from 'vue'\n\ninterface IRecycleTarget {\n onMount: () => void\n onUnmount: () => void\n}\n\nexport function useAttach<T extends IRecycleTarget>(target: Ref<T>): Ref<T> {\n watch(target, (value, oldValue, onInvalidate) => {\n if (value && value !== oldValue) {\n oldValue?.onUnmount()\n nextTick(() => value.onMount())\n onInvalidate(() => value.onUnmount())\n }\n })\n onMounted(() => {\n target.value?.onMount()\n })\n onUnmounted(() => {\n target.value?.onUnmount()\n })\n return target\n}\n","import { provide, ref } from 'vue'\nimport type { InjectionKey, Ref } from 'vue'\n\nexport function useInjectionCleaner(injectionKeys: InjectionKey<Ref<unknown>>[]) {\n injectionKeys.forEach(key => provide(key, ref()))\n}\n","import { defineComponent, provide, toRef } from 'vue'\n\nimport { useAttach } from '../hooks/useAttach'\nimport { useInjectionCleaner } from '../hooks/useInjectionCleaner'\nimport {\n FieldSymbol,\n FormSymbol,\n SchemaExpressionScopeSymbol,\n SchemaOptionsSymbol,\n SchemaSymbol,\n} from '../shared/context'\n\nexport const FormProvider = defineComponent({\n name: 'FormProvider',\n inheritAttrs: false,\n props: ['form'],\n setup(props, { slots }) {\n const formRef = useAttach(toRef(props, 'form'))\n provide(FormSymbol, formRef)\n useInjectionCleaner([FieldSymbol, SchemaSymbol, SchemaExpressionScopeSymbol, SchemaOptionsSymbol])\n\n return () => slots.default?.()\n },\n})\n","import type { GeneralField } from '@formvk/core'\nimport { inject, ref } from 'vue'\nimport type { Ref } from 'vue'\n\nimport { FieldSymbol } from '../shared/context'\n\nexport function useField<T = GeneralField>(): Ref<T> {\n return inject(FieldSymbol, ref()) as Ref<T>\n}\n","import { FormPath, isStr } from '@formvk/shared'\nimport { toRaw } from 'vue'\n\n/**\n * 解析 schema 中的组件描述:字符串按路径从 components 中查找,组件对象直接使用。\n * 返回前统一 toRaw,避免组件定义被响应式代理包裹。\n */\nexport function getRawComponent(components: Record<string, any> | undefined, component: any): any {\n const resolved = isStr(component) ? FormPath.getIn(components, component) : undefined\n return toRaw(resolved ?? component)\n}\n","import { isVoidField } from '@formvk/core'\nimport type { GeneralField, IFieldFactoryProps } from '@formvk/core'\nimport { toJS } from '@formvk/reactive'\nimport { each, isFn, isStr } from '@formvk/shared'\nimport { Fragment, defineComponent, h, inject, isVNode, provide, ref, shallowRef, watch } from 'vue'\nimport type { Ref, VNode } from 'vue'\n\nimport { useAttach } from '../hooks/useAttach'\nimport { useField } from '../hooks/useField'\nimport { useForm } from '../hooks/useForm'\nimport { FieldSymbol, SchemaOptionsSymbol } from '../shared/context'\nimport type { IReactiveFieldProps, ISchemaFieldRuntimeOptions } from '../types'\nimport { getRawComponent } from '../utils/getRawComponent'\n\ntype SlotFn = (props?: any) => any\n\nfunction isVueComponentLike(value: any): boolean {\n if (!value) return false\n if (isFn(value)) return true\n return typeof value === 'object' && (isFn(value.setup) || isFn(value.render) || isStr(value.template))\n}\n\nfunction toArray(value: any): any[] {\n if (Array.isArray(value)) return value\n return value === undefined || value === null ? [] : [value]\n}\n\nfunction wrapFragment(child: VNode | VNode[] | null): VNode | VNode[] | null {\n if (Array.isArray(child)) {\n if (child.length > 1) return h(Fragment, null, child)\n return child[0] ?? null\n }\n return child\n}\n\nfunction renderContent(content: any): any {\n if (isVNode(content) || isStr(content)) return content\n if (isVueComponentLike(content)) return h(content)\n return content\n}\n\nfunction mergeSlots(field: GeneralField, slots: Record<string, any>, content: any): Record<string, SlotFn> {\n const result: Record<string, SlotFn> = {}\n Object.keys(slots).forEach(name => {\n result[name] = (slotProps?: any) => slots[name]?.({ field, form: field.form, ...slotProps }) ?? []\n })\n\n if (!content) return result\n\n function appendToSlot(name: string, value: any) {\n const origin = result[name]\n result[name] = (slotProps?: any) => [...toArray(origin?.(slotProps)), ...toArray(renderContent(value))]\n }\n\n if (isStr(content) || isVNode(content) || isVueComponentLike(content)) {\n appendToSlot('default', content)\n } else if (typeof content === 'object') {\n // 普通对象视为具名插槽内容映射\n each(content, (value, key) => {\n appendToSlot(key, value)\n })\n }\n\n return result\n}\n\nfunction normalizeProps(origin: Record<string, any>) {\n const props: Record<string, any> = {}\n const events: Record<string, any> = {}\n each(origin, (value, key) => {\n if (key.startsWith('on')) {\n const eventName = `${key[2].toLowerCase()}${key.slice(3)}`\n events[eventName] = events[eventName] ?? value\n } else if (key.startsWith('@')) {\n events[key.slice(1)] = value\n } else {\n props[key] = value\n }\n })\n return { props, events }\n}\n\nfunction toVueEventProps(events: Record<string, any>) {\n const props: Record<string, any> = {}\n each(events, (handler, name) => {\n props[`on${name.charAt(0).toUpperCase()}${name.slice(1)}`] = handler\n })\n return props\n}\n\nexport const ReactiveField = defineComponent({\n name: 'ReactiveField',\n inheritAttrs: false,\n props: {\n fieldType: {\n type: String,\n default: 'Field',\n },\n fieldProps: {\n type: Object,\n default: () => ({}),\n },\n },\n setup(props, { slots }) {\n const formRef = useForm()\n const parentRef = useField()\n const optionsRef = inject(SchemaOptionsSymbol, ref({})) as Ref<ISchemaFieldRuntimeOptions>\n\n function createField(): GeneralField {\n const fieldType = (props as IReactiveFieldProps).fieldType ?? 'Field'\n const fieldProps = ((props as IReactiveFieldProps).fieldProps ?? {}) as IFieldFactoryProps<any, any>\n return (formRef.value as any)?.[`create${fieldType}`]?.({\n ...fieldProps,\n basePath: fieldProps.basePath ?? parentRef.value?.address,\n })\n }\n\n const fieldRef = shallowRef(createField()) as Ref<GeneralField>\n watch(\n () => props.fieldProps,\n () => {\n fieldRef.value = createField()\n }\n )\n useAttach(fieldRef)\n provide(FieldSymbol, fieldRef)\n\n return () => {\n const field = fieldRef.value\n const options = optionsRef.value\n if (!field) return slots.default?.()\n if (field.display !== 'visible') return null\n\n const mergedSlots = mergeSlots(field, slots, field.content)\n\n function renderDecorator(children: VNode | VNode[] | null) {\n if (!field.decoratorType) return wrapFragment(children)\n const Decorator = getRawComponent(options?.components, field.decoratorType)\n const { props: decoratorProps, events } = normalizeProps(toJS((field.decorator as any)[1]) || {})\n return h(\n Decorator,\n { ...decoratorProps, ...toVueEventProps(events) },\n {\n default: () => children,\n }\n )\n }\n\n function renderComponent() {\n if (!field.componentType) return mergedSlots.default?.() ?? null\n\n const Component = getRawComponent(options?.components, field.componentType)\n const { props: originProps, events } = normalizeProps(toJS((field.component as any)[1]) || {})\n const originChange = events.change\n const originFocus = events.focus\n const originBlur = events.blur\n\n events.change = (...args: any[]) => {\n if (!isVoidField(field)) field.onInput(...args)\n originChange?.(...args)\n }\n events.focus = (...args: any[]) => {\n if (!isVoidField(field)) field.onFocus(...args)\n originFocus?.(...args)\n }\n events.blur = (...args: any[]) => {\n if (!isVoidField(field)) field.onBlur(...args)\n originBlur?.(...args)\n }\n\n const componentProps: Record<string, any> = {\n ...(isVoidField(field)\n ? {}\n : {\n disabled: field.pattern === 'disabled' || field.pattern === 'readPretty',\n readOnly: field.pattern === 'readOnly',\n }),\n ...originProps,\n ...(isVoidField(field) ? {} : { value: field.value }),\n ...toVueEventProps(events),\n }\n\n if (isStr(Component)) {\n return h(\n Component,\n componentProps,\n Object.keys(mergedSlots).map(name => mergedSlots[name]())\n )\n }\n return h(Component, componentProps, mergedSlots)\n }\n\n return renderDecorator(renderComponent())\n }\n },\n})\n","import type { GeneralField } from '@formvk/core'\nimport { Schema } from '@formvk/schema'\nimport { isFn, isValid, lazyMerge } from '@formvk/shared'\nimport { computed, defineComponent, h, inject, markRaw, provide, ref, shallowRef, watch } from 'vue'\nimport type { Ref } from 'vue'\n\nimport { useField } from '../hooks/useField'\nimport { SchemaExpressionScopeSymbol, SchemaOptionsSymbol, SchemaSymbol } from '../shared/context'\nimport type { ISchemaFieldRuntimeOptions, ISchemaFilter, ISchemaMapper } from '../types'\nimport { ReactiveField } from './ReactiveField'\n\ntype SlotFn = (props?: any) => any\n\nfunction resolveEmptySlot(slots: Record<string, SlotFn>) {\n const names = Object.keys(slots)\n if (!names.length) return null\n const children = names.reduce<any[]>((result, name) => {\n const value = slots[name]()\n return result.concat(Array.isArray(value) ? value : [value])\n }, [])\n return h('div', { style: { display: 'contents' } }, children)\n}\n\nexport const RecursionField = defineComponent({\n name: 'RecursionField',\n inheritAttrs: false,\n props: {\n schema: {\n required: true,\n },\n name: [String, Number],\n basePath: {},\n onlyRenderProperties: {\n type: Boolean,\n default: undefined,\n },\n onlyRenderSelf: {\n type: Boolean,\n default: undefined,\n },\n mapProperties: {},\n filterProperties: {},\n },\n setup(props) {\n const parentRef = useField()\n const optionsRef = inject(SchemaOptionsSymbol, ref({})) as Ref<ISchemaFieldRuntimeOptions>\n const scopeRef = inject(SchemaExpressionScopeSymbol, ref({}))\n\n const fieldSchemaRef = computed(() => {\n const schema = props.schema\n return markRaw(Schema.isSchemaInstance(schema) ? schema : new Schema(schema as any))\n })\n\n function getPropsFromSchema(schema: Schema) {\n const options = optionsRef.value\n return schema.toFieldProps({\n ...options,\n get scope() {\n return lazyMerge(options.scope as any, scopeRef.value)\n },\n })\n }\n\n const fieldPropsRef = shallowRef(getPropsFromSchema(fieldSchemaRef.value))\n watch([fieldSchemaRef, optionsRef], () => {\n fieldPropsRef.value = getPropsFromSchema(fieldSchemaRef.value)\n })\n\n function getBasePath() {\n if (props.onlyRenderProperties) {\n return (\n props.basePath ??\n (isValid(props.name) ? (parentRef.value?.address ?? '').concat(props.name) : parentRef.value?.address)\n )\n }\n return props.basePath ?? parentRef.value?.address\n }\n\n provide(SchemaSymbol, fieldSchemaRef)\n\n return () => {\n const schema = fieldSchemaRef.value\n if (!schema) return null\n\n const basePath = getBasePath()\n const fieldProps = fieldPropsRef.value\n\n function generateSlotsByProperties(scoped = false) {\n if (props.onlyRenderSelf) return {}\n const properties = Schema.getOrderProperties(schema)\n if (!properties.length) return {}\n\n const renderMap: Record<string, ((field?: GeneralField) => any)[]> = {}\n function setRender(key: string, value: (field?: GeneralField) => any) {\n if (!renderMap[key]) renderMap[key] = []\n renderMap[key].push(value)\n }\n\n const mapProperties = props.mapProperties as ISchemaMapper | undefined\n const filterProperties = props.filterProperties as ISchemaFilter | undefined\n\n properties.forEach(({ schema: item, key: name }, index) => {\n let itemSchema = item\n if (isFn(mapProperties)) {\n const mapped = mapProperties(item, name)\n if (mapped) itemSchema = mapped\n }\n if (isFn(filterProperties)) {\n if (filterProperties(itemSchema, name) === false) return\n }\n setRender(itemSchema.slot ?? 'default', (field?: GeneralField) =>\n h(RecursionField, {\n key: `${index}-${name}`,\n schema: itemSchema,\n name,\n basePath: field?.address ?? basePath,\n })\n )\n })\n\n const slots: Record<string, SlotFn> = {}\n Object.keys(renderMap).forEach(key => {\n const renderFns = renderMap[key]\n slots[key] = scoped\n ? ({ field }: { field?: GeneralField } = {}) => renderFns.map(renderFn => renderFn(field))\n : () => renderFns.map(renderFn => renderFn())\n })\n return slots\n }\n\n if (!isValid(props.name)) {\n return resolveEmptySlot(generateSlotsByProperties())\n }\n\n const commonFieldProps = {\n ...fieldProps,\n name: props.name,\n basePath,\n }\n\n if (schema.type === 'object') {\n if (props.onlyRenderProperties) return resolveEmptySlot(generateSlotsByProperties())\n return h(\n ReactiveField,\n { fieldType: 'ObjectField', fieldProps: commonFieldProps },\n generateSlotsByProperties(true)\n )\n }\n\n if (schema.type === 'array') {\n return h(ReactiveField, { fieldType: 'ArrayField', fieldProps: commonFieldProps })\n }\n\n if (schema.type === 'void') {\n if (props.onlyRenderProperties) return resolveEmptySlot(generateSlotsByProperties())\n return h(\n ReactiveField,\n { fieldType: 'VoidField', fieldProps: commonFieldProps },\n generateSlotsByProperties(true)\n )\n }\n\n return h(ReactiveField, { fieldType: 'Field', fieldProps: commonFieldProps })\n }\n },\n})\n","import type { Form } from '@formvk/core'\nimport { createFragment, Schema } from '@formvk/schema'\nimport type { AnyComponent, ISchema, SchemaKey } from '@formvk/schema'\nimport { FormPath, isValid } from '@formvk/shared'\nimport type { FormPathPattern } from '@formvk/shared'\nimport { computed, defineComponent, provide, watch } from 'vue'\nimport type { PropType } from 'vue'\n\nimport { useField } from '../hooks/useField'\nimport { useForm } from '../hooks/useForm'\nimport { SchemaExpressionScopeSymbol, SchemaOptionsSymbol } from '../shared/context'\nimport type {\n InferArrayProps,\n InferFieldProps,\n InferVoidProps,\n ISchemaFieldFactoryOptions,\n ISchemaFieldProps,\n ISchemaFieldRuntimeOptions,\n ISchemaFilter,\n ISchemaMapper,\n SchemaFieldFactoryResult,\n SchemaVueComponents,\n} from '../types'\nimport { RecursionField } from './RecursionField'\n\nconst schemaFieldProps = {\n schema: {\n type: Object as PropType<ISchema | Schema>,\n required: true as const,\n },\n components: {\n type: Object as PropType<SchemaVueComponents>,\n },\n scope: {\n type: Object as PropType<Record<string, any>>,\n },\n name: [String, Number] as PropType<SchemaKey>,\n basePath: [String, Number, Array, Object, Function] as PropType<FormPathPattern>,\n hotReload: {\n type: Boolean,\n default: undefined,\n },\n onlyRenderProperties: {\n type: Boolean,\n default: undefined,\n },\n onlyRenderSelf: {\n type: Boolean,\n default: undefined,\n },\n mapProperties: {\n type: Function as PropType<ISchemaMapper>,\n },\n filterProperties: {\n type: Function as PropType<ISchemaFilter>,\n },\n}\n\nfunction joinPath(prefix: string, segment: SchemaKey | '*') {\n return prefix ? `${prefix}.${segment}` : String(segment)\n}\n\ninterface ISchemaPaths {\n /** 字段的绝对路径,数组元素下标使用 * 通配 */\n fields: string[]\n /** 数组子树的清理模式,覆盖任意下标 */\n arrays: string[]\n}\n\n/**\n * 收集 schema 声明的字段路径,用于热更新时定位需要销毁的字段。\n * 数组元素的下标是运行时产物,这里统一用 * 通配。\n */\nfunction collectSchemaPaths(schema: Schema, basePath: string, name?: SchemaKey): ISchemaPaths {\n const fields: string[] = []\n const arrays: string[] = []\n\n const walkNode = (node: Schema, path: string) => {\n if (node.type === 'array') arrays.push(joinPath(path, '*'))\n walkChildren(node, path)\n }\n\n const walkChildren = (node: Schema, prefix: string) => {\n const properties = node.properties ?? {}\n Object.keys(properties).forEach(key => {\n const path = joinPath(prefix, key)\n fields.push(path)\n walkNode(properties[key], path)\n })\n const items = node.items\n if (items) {\n const itemSchemas = Array.isArray(items) ? items : [items]\n itemSchemas.forEach(item => {\n if (item) walkChildren(item, joinPath(prefix, '*'))\n })\n }\n }\n\n if (isValid(name)) {\n const rootPath = joinPath(basePath, String(name))\n fields.push(rootPath)\n walkNode(schema, rootPath)\n } else {\n walkChildren(schema, basePath)\n }\n\n return { fields, arrays }\n}\n\nfunction toSchema(schema: ISchema | Schema): Schema {\n return Schema.isSchemaInstance(schema) ? schema : new Schema({ type: 'object', ...schema })\n}\n\n/**\n * 热更新:销毁旧 schema 声明的字段(保留值),字段会在 fieldProps 更新后重建。\n */\nfunction applyHotReload(form: Form, prev: Schema, next: Schema, basePath: string, name?: SchemaKey) {\n const prevPaths = collectSchemaPaths(prev, basePath, name)\n const nextPaths = collectSchemaPaths(next, basePath, name)\n const nextFields = new Set(nextPaths.fields)\n\n prevPaths.fields.forEach(path => {\n if (nextFields.has(path)) return\n form.deleteValuesIn(path)\n form.deleteInitialValuesIn(path)\n })\n\n const patterns = new Set<string>([...prevPaths.fields, ...nextPaths.fields, ...prevPaths.arrays, ...nextPaths.arrays])\n patterns.forEach(pattern => {\n form.clearFormGraph(pattern, false)\n })\n}\n\nfunction setupHotReload(props: ISchemaFieldProps) {\n if (!props.hotReload) return\n\n const formRef = useForm()\n const parentRef = useField()\n\n watch(\n () => props.schema,\n (next, prev) => {\n const form = formRef.value\n if (!form || !prev || !next) return\n const basePath = props.basePath\n ? FormPath.parse(props.basePath).toString()\n : (parentRef.value?.address?.toString() ?? '')\n applyHotReload(form, toSchema(prev), toSchema(next), basePath, props.name)\n },\n { flush: 'pre' }\n )\n}\n\nfunction renderSchemaField(props: ISchemaFieldProps, prebound?: ISchemaFieldRuntimeOptions) {\n const schemaRef = computed(() => toSchema(props.schema))\n\n setupHotReload(props)\n\n const optionsRef = computed(() => ({\n components: { ...prebound?.components, ...props.components },\n scope: { ...prebound?.scope, ...props.scope },\n }))\n\n const scopeRef = computed(() => optionsRef.value.scope)\n\n provide(SchemaOptionsSymbol, optionsRef)\n provide(SchemaExpressionScopeSymbol, scopeRef)\n\n return () => (\n <RecursionField\n schema={schemaRef.value}\n name={props.name}\n basePath={props.basePath}\n onlyRenderProperties={props.onlyRenderProperties}\n onlyRenderSelf={props.onlyRenderSelf}\n mapProperties={props.mapProperties}\n filterProperties={props.filterProperties}\n />\n )\n}\n\nexport const SchemaField = defineComponent({\n name: 'SchemaField',\n inheritAttrs: false,\n props: schemaFieldProps,\n setup(props) {\n return renderSchemaField(props)\n },\n})\n\n/**\n * 基于扁平组件映射与分类组件 map 创建 SchemaField + fragment:\n * - voidComponents / arrayComponents 只接收组件 map,分类名由工厂内部提取后传给 fragment\n * - 分类组件会自动合并进运行时组件映射,无需在 components 中重复注册\n * - 返回的 SchemaField 已预绑定拍平后的组件与 scope,props 仍可传扁平 map 覆盖同名组件\n * - fragment 包含 Field / Object / Array / Void / transform 与按组件名生成的动态构造器\n * 组件 props、字段值与 scope 类型全部自动推断,无需手写类型参数。\n */\nexport function createSchemaField<\n F extends SchemaVueComponents = SchemaVueComponents,\n V extends SchemaVueComponents = {},\n A extends SchemaVueComponents = {},\n Scope extends object = Record<string, any>,\n Decorator extends AnyComponent<InferVoidProps<V, A>> = AnyComponent<InferVoidProps<V, A>>,\n>(\n options: ISchemaFieldFactoryOptions<F, V, A, Scope, Decorator> = {}\n): SchemaFieldFactoryResult<F, V, A, Scope, Decorator> {\n const voidComponents = options.voidComponents ?? {}\n const arrayComponents = options.arrayComponents ?? {}\n const flatComponents: SchemaVueComponents = {\n ...options.components,\n ...voidComponents,\n ...arrayComponents,\n }\n\n const fragment = createFragment<InferFieldProps<F, V, A>, InferVoidProps<V, A>, InferArrayProps<A>, Scope, Decorator>(\n {\n patches: options.patches,\n voidComponentNames: Object.keys(voidComponents),\n arrayComponentNames: Object.keys(arrayComponents),\n defaultDecorator: options.defaultDecorator,\n }\n )\n\n const prebound: ISchemaFieldRuntimeOptions = {\n components: flatComponents,\n scope: options.scope,\n }\n\n const BoundSchemaField = defineComponent({\n name: 'SchemaField',\n inheritAttrs: false,\n props: schemaFieldProps,\n setup(props) {\n return renderSchemaField(props, prebound)\n },\n })\n\n return { SchemaField: BoundSchemaField, fragment }\n}\n","import type { Schema } from '@formvk/schema'\nimport { inject, ref } from 'vue'\nimport type { Ref } from 'vue'\n\nimport { SchemaSymbol } from '../shared/context'\n\nexport function useFieldSchema(): Ref<Schema> {\n return inject(SchemaSymbol, ref()) as Ref<Schema>\n}\n","import type { Form } from '@formvk/core'\nimport { uid } from '@formvk/shared'\nimport { onBeforeUnmount, watchEffect } from 'vue'\n\nimport { useForm } from './useForm'\n\nexport function useFormEffects(effects?: (form: Form) => void): void {\n const formRef = useForm()\n\n const stop = watchEffect(onCleanup => {\n const form = formRef.value\n if (!form) return\n const id = uid()\n form.addEffects(id, effects)\n\n onCleanup(() => {\n // 捕获注册时的 form,避免 form 替换后清理到了新实例上\n form.removeEffects(id)\n })\n })\n\n onBeforeUnmount(() => stop())\n}\n","import { isObjectField } from '@formvk/core'\nimport type { Form, GeneralField, ObjectField } from '@formvk/core'\nimport { computed } from 'vue'\nimport type { ComputedRef } from 'vue'\n\nimport { useField } from './useField'\nimport { useForm } from './useForm'\n\nexport function useParentForm(): ComputedRef<Form | ObjectField> {\n const field = useField()\n const form = useForm()\n\n function findObjectParent(target?: GeneralField): Form | ObjectField {\n if (!target) return form.value\n if (isObjectField(target)) return target\n return findObjectParent(target.parent)\n }\n\n return computed(() => findObjectParent(field.value))\n}\n","import { isVoidField } from '@formvk/core'\nimport type { GeneralField } from '@formvk/core'\nimport { each, FormPath, isFn, isStr, isValid } from '@formvk/shared'\nimport { defineComponent, h, markRaw } from 'vue'\n\nimport { useField } from '../hooks/useField'\nimport type { IComponentMapper, IStateMapper, VueComponent } from '../types'\n\nexport function mapProps<T extends VueComponent = VueComponent>(...args: IStateMapper[]) {\n function transform(input: Record<string, any>, field: GeneralField) {\n return args.reduce((props, mapper) => {\n if (isFn(mapper)) {\n props = Object.assign(props, mapper(props, field))\n } else {\n each(mapper, (to, extract) => {\n const extractValue = FormPath.getIn(field, extract)\n const targetValue = isStr(to) ? to : extract\n const originalValue = FormPath.getIn(props, targetValue)\n if (extract === 'value') {\n if (to !== extract) {\n delete props.value\n }\n }\n if (isValid(originalValue) && !isValid(extractValue)) return\n FormPath.setIn(props, targetValue, extractValue)\n })\n }\n return props\n }, input)\n }\n\n return function (target: T): T {\n return defineComponent({\n name: target.name ? `Connected${target.name}` : 'ConnectedComponent',\n inheritAttrs: false,\n setup(_, { attrs, slots }) {\n const fieldRef = useField()\n return () => {\n const newAttrs = fieldRef.value ? transform({ ...attrs }, fieldRef.value) : { ...attrs }\n return h(target, newAttrs, slots)\n }\n },\n }) as unknown as T\n }\n}\n\nexport function mapReadPretty(component: VueComponent, readPrettyProps?: Record<string, any>) {\n return function <T extends VueComponent>(target: T): T {\n return defineComponent({\n name: target.name ? `Read${target.name}` : 'ReadComponent',\n inheritAttrs: false,\n setup(_, { attrs, slots }) {\n const fieldRef = useField()\n return () => {\n const field = fieldRef.value\n const Current = field && !isVoidField(field) && field.pattern === 'readPretty' ? component : target\n return h(Current, { ...readPrettyProps, ...attrs }, slots)\n }\n },\n }) as unknown as T\n }\n}\n\nexport function connect<T extends VueComponent>(target: T, ...args: IComponentMapper[]): T {\n const Component = args.reduce((current: VueComponent, mapper) => mapper(current), target as VueComponent)\n return markRaw(\n defineComponent({\n name: target.name,\n inheritAttrs: false,\n setup(_, { attrs, slots }) {\n return () => h(Component, attrs, slots)\n },\n })\n ) as unknown as T\n}\n","import type { Form, IFormProps } from '@formvk/core'\nimport { createForm as createCoreForm } from '@formvk/core'\nimport { markRaw } from 'vue'\n\nexport function createForm<T extends object = any>(options?: IFormProps<T>): Form<T> {\n return markRaw(createCoreForm<T>(options)) as Form<T>\n}\n"],"mappings":";;;;;;;AAMA,IAAa4X,IAAsC,OAAO,MAAM,GAEnDC,IAA+C,OAAO,OAAO,GAE7DC,IAA0C,OAAO,QAAQ,GAEzDC,IAAsE,OAAO,kBAAkB,GAE/FC,IAAqE,OAAO,eAAe,GCT3FzX,KAAkBL,kBAAgB;CAC7CM,MAAM;CACNC,cAAc;CACdC,OAAO,CAAC,OAAO;CACfC,M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MAAMC,GAAG,EAAEC,UAAOC,YAAS;IACzB,IAAMC,IAAW1B,EAAS;IAC1B,aAAa;KACX,IAAM2B,IAAWD,EAAST,QAAQd,EAAU,EAAE,GAAGqB,EAAM,GAAGE,EAAST,KAAK,IAAI,EAAE,GAAGO,EAAM;KACvF,OAAO1B,EAAEqB,GAAQQ,GAAUF,CAAK;IAClC;GACF;EACF,CAAC;CACH;AACF;AAEA,SAAgBG,GAAcC,GAAyBC,GAAuC;CAC5F,OAAO,SAAkCX,GAAc;EACrD,OAAOtB,kBAAgB;GACrBuB,MAAMD,EAAOC,OAAO,OAAOD,EAAOC,SAAS;GAC3CC,cAAc;GACdC,MAAMC,GAAG,EAAEC,UAAOC,YAAS;IACzB,IAAMC,IAAW1B,EAAS;IAC1B,aAAa;KACX,IAAMK,IAAQqB,EAAST,OACjBc,IAAU1B,KAAS,CAACd,EAAYc,CAAK,KAAKA,EAAM2B,YAAY,eAAeH,IAAYV;KAC7F,OAAOrB,EAAEiC,GAAS;MAAE,GAAGD;MAAiB,GAAGN;KAAM,GAAGC,CAAK;IAC3D;GACF;EACF,CAAC;CACH;AACF;AAEA,SAAgBQ,GAAgCd,GAAW,GAAGjB,GAA6B;CACzF,IAAMgC,IAAYhC,EAAKI,QAAQ6B,GAAuB3B,MAAWA,EAAO2B,CAAO,GAAGhB,CAAsB;CACxG,OAAOpB,EACLF,kBAAgB;EACduB,MAAMD,EAAOC;EACbC,cAAc;EACdC,MAAMC,GAAG,EAAEC,UAAOC,YAAS;GACzB,aAAa3B,EAAEoC,GAAWV,GAAOC,CAAK;EACxC;CACF,CAAC,CACH;AACF;;ACtEA,SAAgBiM,GAAmC,GAAkC;CACnF,OAAOzF,EAAQ7F,EAAkBwE,CAAO,CAAC;AAC3C"}
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "@formvk/vue",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "Formvk Vue Bindings",
5
+ "keywords": [
6
+ "form",
7
+ "formvk",
8
+ "formvk-vue",
9
+ "vue"
10
+ ],
11
+ "license": "MIT",
12
+ "author": "yiyunwan",
13
+ "files": [
14
+ "dist",
15
+ "CHANGELOG.md"
16
+ ],
17
+ "type": "module",
18
+ "main": "dist/index.js",
19
+ "module": "dist/index.js",
20
+ "types": "dist/index.d.ts",
21
+ "dependencies": {
22
+ "@formvk/core": "~1.0.0",
23
+ "@formvk/reactive": "~1.0.0",
24
+ "@formvk/schema": "~1.0.0",
25
+ "@formvk/shared": "~1.0.0"
26
+ },
27
+ "devDependencies": {
28
+ "@vitejs/plugin-vue-jsx": "^5.1.6",
29
+ "@vue/test-utils": "^2.6.0",
30
+ "happy-dom": "^21.0.4",
31
+ "vue": "^3.6.0-rc.15"
32
+ },
33
+ "peerDependencies": {
34
+ "vue": "^3.5.0"
35
+ },
36
+ "scripts": {
37
+ "build": "tsc --noEmit && vite build",
38
+ "test": "vitest"
39
+ }
6
40
  }