@silver-formily/vue 2.3.3 → 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.
Files changed (103) hide show
  1. package/esm/components/ArrayField.d.ts +67 -60
  2. package/esm/components/ArrayField.mjs +23 -23
  3. package/esm/components/ArrayField.mjs.map +1 -1
  4. package/esm/components/ExpressionScope.d.ts +21 -16
  5. package/esm/components/ExpressionScope.mjs +22 -24
  6. package/esm/components/ExpressionScope.mjs.map +1 -1
  7. package/esm/components/Field.d.ts +67 -60
  8. package/esm/components/Field.mjs +23 -23
  9. package/esm/components/Field.mjs.map +1 -1
  10. package/esm/components/FormConsumer.d.ts +9 -4
  11. package/esm/components/FormConsumer.mjs +17 -18
  12. package/esm/components/FormConsumer.mjs.map +1 -1
  13. package/esm/components/FormProvider.d.ts +21 -16
  14. package/esm/components/FormProvider.mjs +26 -26
  15. package/esm/components/FormProvider.mjs.map +1 -1
  16. package/esm/components/ObjectField.d.ts +68 -60
  17. package/esm/components/ObjectField.mjs +23 -23
  18. package/esm/components/ObjectField.mjs.map +1 -1
  19. package/esm/components/ReactiveField.mjs +103 -83
  20. package/esm/components/ReactiveField.mjs.map +1 -1
  21. package/esm/components/RecursionField.d.ts +142 -134
  22. package/esm/components/RecursionField.mjs +123 -125
  23. package/esm/components/RecursionField.mjs.map +1 -1
  24. package/esm/components/SchemaField.d.ts +3041 -3030
  25. package/esm/components/SchemaField.mjs +104 -99
  26. package/esm/components/SchemaField.mjs.map +1 -1
  27. package/esm/components/VoidField.d.ts +48 -42
  28. package/esm/components/VoidField.mjs +23 -23
  29. package/esm/components/VoidField.mjs.map +1 -1
  30. package/esm/components/index.d.ts +9 -9
  31. package/esm/components/index.mjs +10 -21
  32. package/esm/hooks/index.d.ts +5 -5
  33. package/esm/hooks/index.mjs +6 -13
  34. package/esm/hooks/useAttach.mjs +21 -13
  35. package/esm/hooks/useAttach.mjs.map +1 -1
  36. package/esm/hooks/useField.d.ts +8 -3
  37. package/esm/hooks/useField.mjs +9 -8
  38. package/esm/hooks/useField.mjs.map +1 -1
  39. package/esm/hooks/useFieldSchema.d.ts +8 -1
  40. package/esm/hooks/useFieldSchema.mjs +9 -8
  41. package/esm/hooks/useFieldSchema.mjs.map +1 -1
  42. package/esm/hooks/useForm.d.ts +8 -3
  43. package/esm/hooks/useForm.mjs +9 -8
  44. package/esm/hooks/useForm.mjs.map +1 -1
  45. package/esm/hooks/useFormEffects.d.ts +7 -2
  46. package/esm/hooks/useFormEffects.mjs +18 -15
  47. package/esm/hooks/useFormEffects.mjs.map +1 -1
  48. package/esm/hooks/useInjectionCleaner.mjs +8 -7
  49. package/esm/hooks/useInjectionCleaner.mjs.map +1 -1
  50. package/esm/hooks/useParentForm.d.ts +8 -3
  51. package/esm/hooks/useParentForm.mjs +18 -11
  52. package/esm/hooks/useParentForm.mjs.map +1 -1
  53. package/esm/index.d.ts +19 -4
  54. package/esm/index.mjs +20 -42
  55. package/esm/shared/connect.d.ts +10 -5
  56. package/esm/shared/connect.mjs +69 -63
  57. package/esm/shared/connect.mjs.map +1 -1
  58. package/esm/shared/context.d.ts +15 -10
  59. package/esm/shared/context.mjs +11 -10
  60. package/esm/shared/context.mjs.map +1 -1
  61. package/esm/shared/index.d.ts +2 -2
  62. package/esm/shared/index.mjs +3 -14
  63. package/esm/types/index.d.ts +72 -70
  64. package/esm/types/validator.d.ts +39 -35
  65. package/esm/utils/fieldProps.mjs +53 -52
  66. package/esm/utils/fieldProps.mjs.map +1 -1
  67. package/esm/utils/getRawComponent.mjs +16 -12
  68. package/esm/utils/getRawComponent.mjs.map +1 -1
  69. package/esm/utils/reactiveFieldHelpers.mjs +116 -94
  70. package/esm/utils/reactiveFieldHelpers.mjs.map +1 -1
  71. package/esm/utils/recursionFieldProps.mjs +14 -13
  72. package/esm/utils/recursionFieldProps.mjs.map +1 -1
  73. package/esm/utils/resolveSchemaProps.mjs +13 -10
  74. package/esm/utils/resolveSchemaProps.mjs.map +1 -1
  75. package/esm/utils/runtimeProps.d.ts +10 -7
  76. package/esm/utils/runtimeProps.mjs +15 -15
  77. package/esm/utils/runtimeProps.mjs.map +1 -1
  78. package/esm/utils/schemaFieldProps.mjs +63 -62
  79. package/esm/utils/schemaFieldProps.mjs.map +1 -1
  80. package/package.json +13 -10
  81. package/esm/components/ReactiveField.d.ts +0 -16
  82. package/esm/components/index.mjs.map +0 -1
  83. package/esm/global.d.d.ts +0 -1
  84. package/esm/global.d.mjs +0 -2
  85. package/esm/global.d.mjs.map +0 -1
  86. package/esm/hooks/index.mjs.map +0 -1
  87. package/esm/hooks/useAttach.d.ts +0 -7
  88. package/esm/hooks/useInjectionCleaner.d.ts +0 -2
  89. package/esm/index.mjs.map +0 -1
  90. package/esm/shared/index.mjs.map +0 -1
  91. package/esm/types/index.mjs +0 -2
  92. package/esm/types/index.mjs.map +0 -1
  93. package/esm/types/validator.mjs +0 -2
  94. package/esm/types/validator.mjs.map +0 -1
  95. package/esm/utils/fieldProps.d.ts +0 -52
  96. package/esm/utils/getRawComponent.d.ts +0 -8
  97. package/esm/utils/reactiveFieldHelpers.d.ts +0 -17
  98. package/esm/utils/recursionFieldProps.d.ts +0 -67
  99. package/esm/utils/resolveSchemaProps.d.ts +0 -1
  100. package/esm/utils/schemaFieldProps.d.ts +0 -232
  101. package/esm/utils/slotMap.d.ts +0 -1
  102. package/esm/utils/slotMap.mjs +0 -2
  103. package/esm/utils/slotMap.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useFieldSchema.mjs","sources":["../../src/hooks/useFieldSchema.ts"],"sourcesContent":["import { inject, ref } from 'vue'\nimport { SchemaSymbol } from '../shared/context'\n\nexport function useFieldSchema() {\n return inject(SchemaSymbol, ref())\n}\n"],"names":["useFieldSchema","inject","SchemaSymbol","ref"],"mappings":";;AAGO,SAASA,IAAiB;AAC/B,SAAOC,EAAOC,GAAcC,GAAK;AACnC;"}
1
+ {"version":3,"file":"useFieldSchema.mjs","names":[],"sources":["../../src/hooks/useFieldSchema.ts"],"sourcesContent":["import { inject, ref } from 'vue'\nimport { SchemaSymbol } from '../shared/context'\n\nexport function useFieldSchema() {\n return inject(SchemaSymbol, ref())\n}\n"],"mappings":";;;AAGA,SAAgB,iBAAiB;AAC/B,QAAO,OAAO,cAAc,KAAK,CAAC"}
@@ -1,3 +1,8 @@
1
- import { Form } from '@formily/core';
2
- import { Ref } from 'vue';
3
- export declare function useForm(): Ref<Form>;
1
+ import { Ref } from "vue";
2
+ import { Form } from "@formily/core";
3
+
4
+ //#region src/hooks/useForm.d.ts
5
+ declare function useForm(): Ref<Form>;
6
+ //#endregion
7
+ export { useForm };
8
+ //# sourceMappingURL=useForm.d.ts.map
@@ -1,9 +1,10 @@
1
- import { inject as o, ref as r } from "vue";
2
- import { FormSymbol as m } from "../shared/context.mjs";
3
- function n() {
4
- return o(m, r());
1
+ import { FormSymbol } from "../shared/context.mjs";
2
+ import { inject, ref } from "vue";
3
+ //#region src/hooks/useForm.ts
4
+ function useForm() {
5
+ return inject(FormSymbol, ref());
5
6
  }
6
- export {
7
- n as useForm
8
- };
9
- //# sourceMappingURL=useForm.mjs.map
7
+ //#endregion
8
+ export { useForm };
9
+
10
+ //# sourceMappingURL=useForm.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useForm.mjs","sources":["../../src/hooks/useForm.ts"],"sourcesContent":["import type { Form } from '@formily/core'\nimport type { Ref } from 'vue'\nimport { inject, ref } from 'vue'\nimport { FormSymbol } from '../shared/context'\n\nexport function useForm() {\n const form = inject(FormSymbol, ref())\n return form as Ref<Form>\n}\n"],"names":["useForm","inject","FormSymbol","ref"],"mappings":";;AAKO,SAASA,IAAU;AAExB,SADaC,EAAOC,GAAYC,EAAA,CAAK;AAEvC;"}
1
+ {"version":3,"file":"useForm.mjs","names":[],"sources":["../../src/hooks/useForm.ts"],"sourcesContent":["import type { Form } from '@formily/core'\nimport type { Ref } from 'vue'\nimport { inject, ref } from 'vue'\nimport { FormSymbol } from '../shared/context'\n\nexport function useForm() {\n const form = inject(FormSymbol, ref())\n return form as Ref<Form>\n}\n"],"mappings":";;;AAKA,SAAgB,UAAU;AAExB,QADa,OAAO,YAAY,KAAK,CAAC"}
@@ -1,2 +1,7 @@
1
- import { Form } from '@formily/core';
2
- export declare function useFormEffects(effects?: (form: Form) => void): void;
1
+ import { Form } from "@formily/core";
2
+
3
+ //#region src/hooks/useFormEffects.d.ts
4
+ declare function useFormEffects(effects?: (form: Form) => void): void;
5
+ //#endregion
6
+ export { useFormEffects };
7
+ //# sourceMappingURL=useFormEffects.d.ts.map
@@ -1,16 +1,19 @@
1
- import { uid as m } from "@formily/shared";
2
- import { watchEffect as c, onBeforeUnmount as s } from "vue";
3
- import { useForm as n } from "./useForm.mjs";
4
- function a(t) {
5
- const o = n(), e = c((r) => {
6
- const f = m();
7
- o.value.addEffects(f, t), r(() => {
8
- o.value.removeEffects(f);
9
- });
10
- });
11
- s(() => e());
1
+ import { useForm } from "./useForm.mjs";
2
+ import { onBeforeUnmount, watchEffect } from "vue";
3
+ import { uid } from "@formily/shared";
4
+ //#region src/hooks/useFormEffects.ts
5
+ function useFormEffects(effects) {
6
+ const formRef = useForm();
7
+ const stop = watchEffect((onCleanup) => {
8
+ const id = uid();
9
+ formRef.value.addEffects(id, effects);
10
+ onCleanup(() => {
11
+ formRef.value.removeEffects(id);
12
+ });
13
+ });
14
+ onBeforeUnmount(() => stop());
12
15
  }
13
- export {
14
- a as useFormEffects
15
- };
16
- //# sourceMappingURL=useFormEffects.mjs.map
16
+ //#endregion
17
+ export { useFormEffects };
18
+
19
+ //# sourceMappingURL=useFormEffects.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormEffects.mjs","sources":["../../src/hooks/useFormEffects.ts"],"sourcesContent":["import type { Form } from '@formily/core'\nimport { uid } from '@formily/shared'\nimport { onBeforeUnmount, watchEffect } from 'vue'\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 id = uid()\n formRef.value.addEffects(id, effects)\n\n onCleanup(() => {\n formRef.value.removeEffects(id)\n })\n })\n\n onBeforeUnmount(() => stop())\n}\n"],"names":["useFormEffects","effects","formRef","useForm","stop","watchEffect","onCleanup","id","uid","onBeforeUnmount"],"mappings":";;;AAKO,SAASA,EAAeC,GAAsC;AACnE,QAAMC,IAAUC,EAAA,GAEVC,IAAOC,EAAY,CAACC,MAAc;AACtC,UAAMC,IAAKC,EAAA;AACX,IAAAN,EAAQ,MAAM,WAAWK,GAAIN,CAAO,GAEpCK,EAAU,MAAM;AACd,MAAAJ,EAAQ,MAAM,cAAcK,CAAE;AAAA,IAChC,CAAC;AAAA,EACH,CAAC;AAED,EAAAE,EAAgB,MAAML,GAAM;AAC9B;"}
1
+ {"version":3,"file":"useFormEffects.mjs","names":[],"sources":["../../src/hooks/useFormEffects.ts"],"sourcesContent":["import type { Form } from '@formily/core'\nimport { uid } from '@formily/shared'\nimport { onBeforeUnmount, watchEffect } from 'vue'\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 id = uid()\n formRef.value.addEffects(id, effects)\n\n onCleanup(() => {\n formRef.value.removeEffects(id)\n })\n })\n\n onBeforeUnmount(() => stop())\n}\n"],"mappings":";;;;AAKA,SAAgB,eAAe,SAAsC;CACnE,MAAM,UAAU,SAAS;CAEzB,MAAM,OAAO,aAAa,cAAc;EACtC,MAAM,KAAK,KAAK;AAChB,UAAQ,MAAM,WAAW,IAAI,QAAQ;AAErC,kBAAgB;AACd,WAAQ,MAAM,cAAc,GAAG;IAC/B;GACF;AAEF,uBAAsB,MAAM,CAAC"}
@@ -1,8 +1,9 @@
1
- import { provide as r, ref as n } from "vue";
2
- function i(e) {
3
- e.forEach((o) => r(o, n()));
1
+ import { provide, ref } from "vue";
2
+ //#region src/hooks/useInjectionCleaner.ts
3
+ function useInjectionCleaner(injectionKeys) {
4
+ injectionKeys.forEach((key) => provide(key, ref()));
4
5
  }
5
- export {
6
- i as useInjectionCleaner
7
- };
8
- //# sourceMappingURL=useInjectionCleaner.mjs.map
6
+ //#endregion
7
+ export { useInjectionCleaner };
8
+
9
+ //# sourceMappingURL=useInjectionCleaner.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInjectionCleaner.mjs","sources":["../../src/hooks/useInjectionCleaner.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue'\nimport { provide, ref } from 'vue'\n\nexport function useInjectionCleaner(injectionKeys: InjectionKey<Ref<unknown>>[]) {\n injectionKeys.forEach(key => provide(key, ref()))\n}\n"],"names":["useInjectionCleaner","injectionKeys","key","provide","ref"],"mappings":";AAGO,SAASA,EAAoBC,GAA6C;AAC/E,EAAAA,EAAc,QAAQ,CAAAC,MAAOC,EAAQD,GAAKE,EAAA,CAAK,CAAC;AAClD;"}
1
+ {"version":3,"file":"useInjectionCleaner.mjs","names":[],"sources":["../../src/hooks/useInjectionCleaner.ts"],"sourcesContent":["import type { InjectionKey, Ref } from 'vue'\nimport { provide, ref } from 'vue'\n\nexport function useInjectionCleaner(injectionKeys: InjectionKey<Ref<unknown>>[]) {\n injectionKeys.forEach(key => provide(key, ref()))\n}\n"],"mappings":";;AAGA,SAAgB,oBAAoB,eAA6C;AAC/E,eAAc,SAAQ,QAAO,QAAQ,KAAK,KAAK,CAAC,CAAC"}
@@ -1,3 +1,8 @@
1
- import { Form, ObjectField } from '@formily/core';
2
- import { Ref } from 'vue';
3
- export declare function useParentForm(): Ref<Form | ObjectField>;
1
+ import { Ref } from "vue";
2
+ import { Form, ObjectField } from "@formily/core";
3
+
4
+ //#region src/hooks/useParentForm.d.ts
5
+ declare function useParentForm(): Ref<Form | ObjectField>;
6
+ //#endregion
7
+ export { useParentForm };
8
+ //# sourceMappingURL=useParentForm.d.ts.map
@@ -1,12 +1,19 @@
1
- import { isObjectField as n } from "@formily/core";
2
- import { computed as m } from "vue";
3
- import { useField as u } from "./useField.mjs";
4
- import { useForm as i } from "./useForm.mjs";
5
- function a() {
6
- const o = u(), e = i(), t = (r) => r ? n(r) ? r : t(r?.parent) : e.value;
7
- return m(() => t(o.value));
1
+ import { useField } from "./useField.mjs";
2
+ import { useForm } from "./useForm.mjs";
3
+ import { computed } from "vue";
4
+ import { isObjectField } from "@formily/core";
5
+ //#region src/hooks/useParentForm.ts
6
+ function useParentForm() {
7
+ const field = useField();
8
+ const form = useForm();
9
+ const findObjectParent = (field) => {
10
+ if (!field) return form.value;
11
+ if (isObjectField(field)) return field;
12
+ return findObjectParent(field?.parent);
13
+ };
14
+ return computed(() => findObjectParent(field.value));
8
15
  }
9
- export {
10
- a as useParentForm
11
- };
12
- //# sourceMappingURL=useParentForm.mjs.map
16
+ //#endregion
17
+ export { useParentForm };
18
+
19
+ //# sourceMappingURL=useParentForm.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useParentForm.mjs","sources":["../../src/hooks/useParentForm.ts"],"sourcesContent":["import type { Form, GeneralField, ObjectField } from '@formily/core'\nimport type { Ref } from 'vue'\nimport { isObjectField } from '@formily/core'\nimport { computed } from 'vue'\nimport { useField } from './useField'\nimport { useForm } from './useForm'\n\nexport function useParentForm(): Ref<Form | ObjectField> {\n const field = useField()\n const form = useForm()\n const findObjectParent = (field: GeneralField) => {\n if (!field)\n return form.value\n if (isObjectField(field))\n return field\n return findObjectParent(field?.parent)\n }\n return computed(() => findObjectParent(field.value))\n}\n"],"names":["useParentForm","field","useField","form","useForm","findObjectParent","isObjectField","computed"],"mappings":";;;;AAOO,SAASA,IAAyC;AACvD,QAAMC,IAAQC,EAAA,GACRC,IAAOC,EAAA,GACPC,IAAmB,CAACJ,MACnBA,IAEDK,EAAcL,CAAK,IACdA,IACFI,EAAiBJ,GAAO,MAAM,IAH5BE,EAAK;AAKhB,SAAOI,EAAS,MAAMF,EAAiBJ,EAAM,KAAK,CAAC;AACrD;"}
1
+ {"version":3,"file":"useParentForm.mjs","names":[],"sources":["../../src/hooks/useParentForm.ts"],"sourcesContent":["import type { Form, GeneralField, ObjectField } from '@formily/core'\nimport type { Ref } from 'vue'\nimport { isObjectField } from '@formily/core'\nimport { computed } from 'vue'\nimport { useField } from './useField'\nimport { useForm } from './useForm'\n\nexport function useParentForm(): Ref<Form | ObjectField> {\n const field = useField()\n const form = useForm()\n const findObjectParent = (field: GeneralField) => {\n if (!field)\n return form.value\n if (isObjectField(field))\n return field\n return findObjectParent(field?.parent)\n }\n return computed(() => findObjectParent(field.value))\n}\n"],"mappings":";;;;;AAOA,SAAgB,gBAAyC;CACvD,MAAM,QAAQ,UAAU;CACxB,MAAM,OAAO,SAAS;CACtB,MAAM,oBAAoB,UAAwB;AAChD,MAAI,CAAC,MACH,QAAO,KAAK;AACd,MAAI,cAAc,MAAM,CACtB,QAAO;AACT,SAAO,iBAAiB,OAAO,OAAO;;AAExC,QAAO,eAAe,iBAAiB,MAAM,MAAM,CAAC"}
package/esm/index.d.ts CHANGED
@@ -1,4 +1,19 @@
1
- export * from './components';
2
- export * from './hooks';
3
- export * from './shared';
4
- export * from './types';
1
+ import { Validator } from "./types/validator.js";
2
+ import { _default } from "./components/ArrayField.js";
3
+ import { ComponentPath, ComponentPropsByPathValue, IArrayFieldProps, IComponentMapper, IExpressionScopeProps, IFieldFactoryProps, IFieldProps, IObjectFieldProps, IProviderProps, IReactiveFieldProps, IRecursionFieldProps, ISchemaFieldProps, ISchemaFieldVueFactoryOptions, ISchemaFilter, ISchemaMapper, ISchemaMarkupFieldProps, ISchemaTypeFieldProps, IStateMapper, IVoidFieldProps, SchemaExpressionScope, SchemaFieldValidator, SchemaMarkupValidator, SchemaMultiValidator, SchemaValidateResult, SchemaValidatorFunction, SchemaValidatorResponse, SchemaValidatorRules, SchemaVueComponents, VueComponentOptionsWithProps, VueComponentProps } from "./types/index.js";
4
+ import { _default as _default$1 } from "./components/ExpressionScope.js";
5
+ import { _default as _default$2 } from "./components/Field.js";
6
+ import { _default as _default$3 } from "./components/FormConsumer.js";
7
+ import { _default as _default$4 } from "./components/FormProvider.js";
8
+ import { _default as _default$5 } from "./components/ObjectField.js";
9
+ import { RecursionField } from "./components/RecursionField.js";
10
+ import { createSchemaField } from "./components/SchemaField.js";
11
+ import { _default as _default$6 } from "./components/VoidField.js";
12
+ import { useField } from "./hooks/useField.js";
13
+ import { useFieldSchema } from "./hooks/useFieldSchema.js";
14
+ import { useForm } from "./hooks/useForm.js";
15
+ import { useFormEffects } from "./hooks/useFormEffects.js";
16
+ import { useParentForm } from "./hooks/useParentForm.js";
17
+ import { connect, mapProps, mapReadPretty } from "./shared/connect.js";
18
+ import { FieldSymbol, FormSymbol, SchemaExpressionScopeSymbol, SchemaMarkupSymbol, SchemaOptionsSymbol, SchemaSymbol } from "./shared/context.js";
19
+ export { _default as ArrayField, ComponentPath, ComponentPropsByPathValue, _default$1 as ExpressionScope, _default$2 as Field, FieldSymbol, _default$3 as FormConsumer, _default$4 as FormProvider, FormSymbol, Validator as FormilyValidator, IArrayFieldProps, IComponentMapper, IExpressionScopeProps, IFieldFactoryProps, IFieldProps, IObjectFieldProps, IProviderProps, IReactiveFieldProps, IRecursionFieldProps, ISchemaFieldProps, ISchemaFieldVueFactoryOptions, ISchemaFilter, ISchemaMapper, ISchemaMarkupFieldProps, ISchemaTypeFieldProps, IStateMapper, IVoidFieldProps, _default$5 as ObjectField, RecursionField, SchemaExpressionScope, SchemaExpressionScopeSymbol, SchemaFieldValidator, SchemaMarkupSymbol, SchemaMarkupValidator, SchemaMultiValidator, SchemaOptionsSymbol, SchemaSymbol, SchemaValidateResult, SchemaValidatorFunction, SchemaValidatorResponse, SchemaValidatorRules, SchemaVueComponents, _default$6 as VoidField, VueComponentOptionsWithProps, VueComponentProps, connect, createSchemaField, mapProps, mapReadPretty, useField, useFieldSchema, useForm, useFormEffects, useParentForm };
package/esm/index.mjs CHANGED
@@ -1,42 +1,20 @@
1
- import { default as r } from "./components/ArrayField.mjs";
2
- import { default as t } from "./components/ExpressionScope.mjs";
3
- import { default as f } from "./components/Field.mjs";
4
- import { default as l } from "./components/FormConsumer.mjs";
5
- import { default as d } from "./components/FormProvider.mjs";
6
- import { default as u } from "./components/ObjectField.mjs";
7
- import { default as F } from "./components/RecursionField.mjs";
8
- import { createSchemaField as S } from "./components/SchemaField.mjs";
9
- import { default as y } from "./components/VoidField.mjs";
10
- import { useField as h } from "./hooks/useField.mjs";
11
- import { useFieldSchema as E } from "./hooks/useFieldSchema.mjs";
12
- import { useForm as R } from "./hooks/useForm.mjs";
13
- import { useFormEffects as k } from "./hooks/useFormEffects.mjs";
14
- import { useParentForm as A } from "./hooks/useParentForm.mjs";
15
- import { connect as M, mapProps as V, mapReadPretty as g } from "./shared/connect.mjs";
16
- import { FieldSymbol as w, FormSymbol as z, SchemaExpressionScopeSymbol as B, SchemaMarkupSymbol as D, SchemaOptionsSymbol as G, SchemaSymbol as H } from "./shared/context.mjs";
17
- export {
18
- r as ArrayField,
19
- t as ExpressionScope,
20
- f as Field,
21
- w as FieldSymbol,
22
- l as FormConsumer,
23
- d as FormProvider,
24
- z as FormSymbol,
25
- u as ObjectField,
26
- F as RecursionField,
27
- B as SchemaExpressionScopeSymbol,
28
- D as SchemaMarkupSymbol,
29
- G as SchemaOptionsSymbol,
30
- H as SchemaSymbol,
31
- y as VoidField,
32
- M as connect,
33
- S as createSchemaField,
34
- V as mapProps,
35
- g as mapReadPretty,
36
- h as useField,
37
- E as useFieldSchema,
38
- R as useForm,
39
- k as useFormEffects,
40
- A as useParentForm
41
- };
42
- //# sourceMappingURL=index.mjs.map
1
+ import { FieldSymbol, FormSymbol, SchemaExpressionScopeSymbol, SchemaMarkupSymbol, SchemaOptionsSymbol, SchemaSymbol } from "./shared/context.mjs";
2
+ import { useField } from "./hooks/useField.mjs";
3
+ import { useFieldSchema } from "./hooks/useFieldSchema.mjs";
4
+ import { useForm } from "./hooks/useForm.mjs";
5
+ import { useFormEffects } from "./hooks/useFormEffects.mjs";
6
+ import { useParentForm } from "./hooks/useParentForm.mjs";
7
+ import "./hooks/index.mjs";
8
+ import { connect, mapProps, mapReadPretty } from "./shared/connect.mjs";
9
+ import "./shared/index.mjs";
10
+ import ArrayField_default from "./components/ArrayField.mjs";
11
+ import ExpressionScope_default from "./components/ExpressionScope.mjs";
12
+ import Field_default from "./components/Field.mjs";
13
+ import FormConsumer_default from "./components/FormConsumer.mjs";
14
+ import FormProvider_default from "./components/FormProvider.mjs";
15
+ import ObjectField_default from "./components/ObjectField.mjs";
16
+ import VoidField_default from "./components/VoidField.mjs";
17
+ import RecursionField from "./components/RecursionField.mjs";
18
+ import { createSchemaField } from "./components/SchemaField.mjs";
19
+ import "./components/index.mjs";
20
+ export { ArrayField_default as ArrayField, ExpressionScope_default as ExpressionScope, Field_default as Field, FieldSymbol, FormConsumer_default as FormConsumer, FormProvider_default as FormProvider, FormSymbol, ObjectField_default as ObjectField, RecursionField, SchemaExpressionScopeSymbol, SchemaMarkupSymbol, SchemaOptionsSymbol, SchemaSymbol, VoidField_default as VoidField, connect, createSchemaField, mapProps, mapReadPretty, useField, useFieldSchema, useForm, useFormEffects, useParentForm };
@@ -1,5 +1,10 @@
1
- import { Component } from 'vue';
2
- import { IComponentMapper, IStateMapper, VueComponentProps } from '../types';
3
- export declare function mapProps<T extends Component = Component>(...args: IStateMapper<VueComponentProps<T>>[]): (target: T) => any;
4
- export declare function mapReadPretty<T extends Component, C extends Component>(component: C, readPrettyProps?: Record<string, any>): (target: T) => any;
5
- export declare function connect<T extends Component>(target: T, ...args: IComponentMapper[]): T;
1
+ import { IComponentMapper, IStateMapper, VueComponentProps } from "../types/index.js";
2
+ import { Component } from "vue";
3
+
4
+ //#region src/shared/connect.d.ts
5
+ declare function mapProps<T extends Component = Component>(...args: IStateMapper<VueComponentProps<T>>[]): (target: T) => any;
6
+ declare function mapReadPretty<T extends Component, C extends Component>(component: C, readPrettyProps?: Record<string, any>): (target: T) => any;
7
+ declare function connect<T extends Component>(target: T, ...args: IComponentMapper[]): T;
8
+ //#endregion
9
+ export { connect, mapProps, mapReadPretty };
10
+ //# sourceMappingURL=connect.d.ts.map
@@ -1,66 +1,72 @@
1
- import { isVoidField as P } from "@formily/core";
2
- import { isFn as p, each as F, FormPath as d, isStr as b, isValid as C } from "@formily/shared";
3
- import { observer as R } from "@silver-formily/reactive-vue";
4
- import { defineComponent as f, h as l, markRaw as h } from "vue";
5
- import { useField as V } from "../hooks/useField.mjs";
6
- import { extractAttrsAndEvents as v, createVNodeProps as A } from "../utils/reactiveFieldHelpers.mjs";
7
- function j(...u) {
8
- const m = (t, i) => u.reduce((e, r) => (p(r) ? e = Object.assign(e, r(e, i)) : F(r, (o, n) => {
9
- const s = d.getIn(i, n), a = b(o) ? o : n, c = d.getIn(e, a);
10
- n === "value" && o !== n && delete e.value, !(C(c) && !C(s)) && d.setIn(e, a, s);
11
- }), e), t);
12
- return (t) => R(
13
- f({
14
- name: t.name ? `Connected${t.name}` : "ConnectedComponent",
15
- setup(i, { attrs: e, slots: r }) {
16
- const o = V();
17
- return () => {
18
- const { attrs: n, events: s } = v(e), a = { ...n }, c = o.value ? m(a, o.value) : a;
19
- return l(t, A(c, s), r);
20
- };
21
- }
22
- })
23
- );
1
+ import { useField } from "../hooks/useField.mjs";
2
+ import { createVNodeProps, extractAttrsAndEvents } from "../utils/reactiveFieldHelpers.mjs";
3
+ import { defineComponent, h, markRaw } from "vue";
4
+ import { isVoidField } from "@formily/core";
5
+ import { FormPath, each, isFn, isStr, isValid } from "@formily/shared";
6
+ import { observer } from "@silver-formily/reactive-vue";
7
+ //#region src/shared/connect.ts
8
+ function mapProps(...args) {
9
+ const transform = (input, field) => args.reduce((props, mapper) => {
10
+ if (isFn(mapper)) props = Object.assign(props, mapper(props, field));
11
+ else each(mapper, (to, extract) => {
12
+ const extractValue = FormPath.getIn(field, extract);
13
+ const targetValue = isStr(to) ? to : extract;
14
+ const originalValue = FormPath.getIn(props, targetValue);
15
+ if (extract === "value") {
16
+ if (to !== extract) delete props.value;
17
+ }
18
+ if (isValid(originalValue) && !isValid(extractValue)) return;
19
+ FormPath.setIn(props, targetValue, extractValue);
20
+ });
21
+ return props;
22
+ }, input);
23
+ return (target) => {
24
+ return observer(defineComponent({
25
+ name: target.name ? `Connected${target.name}` : `ConnectedComponent`,
26
+ setup(_, { attrs, slots }) {
27
+ const fieldRef = useField();
28
+ return () => {
29
+ const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs);
30
+ const baseAttrs = { ...normalizedAttrs };
31
+ return h(target, createVNodeProps(fieldRef.value ? transform(baseAttrs, fieldRef.value) : baseAttrs, events), slots);
32
+ };
33
+ }
34
+ }));
35
+ };
24
36
  }
25
- function k(u, m) {
26
- return (t) => R(
27
- f({
28
- name: t.name ? `Read${t.name}` : "ReadComponent",
29
- setup(i, { attrs: e, slots: r }) {
30
- const o = V();
31
- return () => {
32
- const n = o.value, { attrs: s, events: a } = v(e);
33
- return l(
34
- n && !P(n) && n.pattern === "readPretty" ? u : t,
35
- A(
36
- {
37
- ...m,
38
- ...s
39
- },
40
- a
41
- ),
42
- r
43
- );
44
- };
45
- }
46
- })
47
- );
37
+ function mapReadPretty(component, readPrettyProps) {
38
+ return (target) => {
39
+ return observer(defineComponent({
40
+ name: target.name ? `Read${target.name}` : `ReadComponent`,
41
+ setup(_, { attrs, slots }) {
42
+ const fieldRef = useField();
43
+ return () => {
44
+ const field = fieldRef.value;
45
+ const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs);
46
+ return h(field && !isVoidField(field) && field.pattern === "readPretty" ? component : target, createVNodeProps({
47
+ ...readPrettyProps,
48
+ ...normalizedAttrs
49
+ }, events), slots);
50
+ };
51
+ }
52
+ }));
53
+ };
48
54
  }
49
- function E(u, ...m) {
50
- const t = m.reduce((e, r) => r(e), u), i = f({
51
- name: u.name,
52
- setup(e, { attrs: r, slots: o }) {
53
- return () => {
54
- const { attrs: n, events: s } = v(r);
55
- return l(t, A(n, s), o);
56
- };
57
- }
58
- });
59
- return h(i);
55
+ function connect(target, ...args) {
56
+ const Component = args.reduce((target, mapper) => {
57
+ return mapper(target);
58
+ }, target);
59
+ return markRaw(defineComponent({
60
+ name: target.name,
61
+ setup(_, { attrs, slots }) {
62
+ return () => {
63
+ const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs);
64
+ return h(Component, createVNodeProps(normalizedAttrs, events), slots);
65
+ };
66
+ }
67
+ }));
60
68
  }
61
- export {
62
- E as connect,
63
- j as mapProps,
64
- k as mapReadPretty
65
- };
66
- //# sourceMappingURL=connect.mjs.map
69
+ //#endregion
70
+ export { connect, mapProps, mapReadPretty };
71
+
72
+ //# sourceMappingURL=connect.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.mjs","sources":["../../src/shared/connect.ts"],"sourcesContent":["import type { GeneralField } from '@formily/core'\nimport type { Component } from 'vue'\nimport type { IComponentMapper, IStateMapper, VueComponentProps } from '../types'\nimport { isVoidField } from '@formily/core'\nimport { each, FormPath, isFn, isStr, isValid } from '@formily/shared'\nimport { observer } from '@silver-formily/reactive-vue'\nimport { defineComponent, h, markRaw } from 'vue'\nimport { useField } from '../hooks/useField'\n\nimport { createVNodeProps, extractAttrsAndEvents } from '../utils/reactiveFieldHelpers'\n\nexport function mapProps<T extends Component = Component>(\n ...args: IStateMapper<VueComponentProps<T>>[]\n) {\n const transform = (input: VueComponentProps<T>, field: GeneralField) =>\n args.reduce((props, mapper) => {\n if (isFn(mapper)) {\n props = Object.assign(props, mapper(props, field))\n }\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))\n return\n FormPath.setIn(props, targetValue, extractValue)\n })\n }\n return props\n }, input)\n\n return (target: T) => {\n return observer(\n defineComponent({\n name: target.name ? `Connected${target.name}` : `ConnectedComponent`,\n setup(_, { attrs, slots }) {\n const fieldRef = useField()\n return () => {\n const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs)\n const baseAttrs = { ...normalizedAttrs } as VueComponentProps<T>\n const newAttrs = fieldRef.value ? transform(baseAttrs, fieldRef.value) : baseAttrs\n return h(target, createVNodeProps(newAttrs, events), slots)\n }\n },\n }),\n )\n }\n}\n\nexport function mapReadPretty<T extends Component, C extends Component>(\n component: C,\n readPrettyProps?: Record<string, any>,\n) {\n return (target: T) => {\n return observer(\n defineComponent({\n name: target.name ? `Read${target.name}` : `ReadComponent`,\n setup(_, { attrs, slots }) {\n const fieldRef = useField()\n return () => {\n const field = fieldRef.value\n const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs)\n return h(\n field && !isVoidField(field) && field.pattern === 'readPretty' ? component : target,\n createVNodeProps(\n {\n ...readPrettyProps,\n ...normalizedAttrs,\n },\n events,\n ),\n slots,\n )\n }\n },\n }),\n )\n }\n}\n\nexport function connect<T extends Component>(target: T, ...args: IComponentMapper[]): T {\n const Component = args.reduce((target: Component, mapper) => {\n return mapper(target)\n }, target)\n\n const functionalComponent = defineComponent({\n name: target.name,\n setup(_, { attrs, slots }) {\n return () => {\n const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs)\n return h(Component, createVNodeProps(normalizedAttrs, events), slots)\n }\n },\n })\n\n return markRaw(functionalComponent) as unknown as T\n}\n"],"names":["mapProps","args","transform","input","field","props","mapper","isFn","each","to","extract","extractValue","FormPath","targetValue","isStr","originalValue","isValid","target","observer","defineComponent","_","attrs","slots","fieldRef","useField","normalizedAttrs","events","extractAttrsAndEvents","baseAttrs","newAttrs","h","createVNodeProps","mapReadPretty","component","readPrettyProps","isVoidField","connect","Component","functionalComponent","markRaw"],"mappings":";;;;;;AAWO,SAASA,KACXC,GACH;AACA,QAAMC,IAAY,CAACC,GAA6BC,MAC9CH,EAAK,OAAO,CAACI,GAAOC,OACdC,EAAKD,CAAM,IACbD,IAAQ,OAAO,OAAOA,GAAOC,EAAOD,GAAOD,CAAK,CAAC,IAGjDI,EAAKF,GAAQ,CAACG,GAAIC,MAAY;AAC5B,UAAMC,IAAeC,EAAS,MAAMR,GAAOM,CAAO,GAC5CG,IAAcC,EAAML,CAAE,IAAIA,IAAKC,GAC/BK,IAAgBH,EAAS,MAAMP,GAAOQ,CAAW;AAMvD,IALIH,MAAY,WACVD,MAAOC,KACT,OAAOL,EAAM,OAGb,EAAAW,EAAQD,CAAa,KAAK,CAACC,EAAQL,CAAY,MAEnDC,EAAS,MAAMP,GAAOQ,GAAaF,CAAY;AAAA,EACjD,CAAC,GAEIN,IACNF,CAAK;AAEV,SAAO,CAACc,MACCC;AAAA,IACLC,EAAgB;AAAA,MACd,MAAMF,EAAO,OAAO,YAAYA,EAAO,IAAI,KAAK;AAAA,MAChD,MAAMG,GAAG,EAAE,OAAAC,GAAO,OAAAC,KAAS;AACzB,cAAMC,IAAWC,EAAA;AACjB,eAAO,MAAM;AACX,gBAAM,EAAE,OAAOC,GAAiB,QAAAC,EAAA,IAAWC,EAAsBN,CAAK,GAChEO,IAAY,EAAE,GAAGH,EAAA,GACjBI,IAAWN,EAAS,QAAQrB,EAAU0B,GAAWL,EAAS,KAAK,IAAIK;AACzE,iBAAOE,EAAEb,GAAQc,EAAiBF,GAAUH,CAAM,GAAGJ,CAAK;AAAA,QAC5D;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EAAA;AAGP;AAEO,SAASU,EACdC,GACAC,GACA;AACA,SAAO,CAACjB,MACCC;AAAA,IACLC,EAAgB;AAAA,MACd,MAAMF,EAAO,OAAO,OAAOA,EAAO,IAAI,KAAK;AAAA,MAC3C,MAAMG,GAAG,EAAE,OAAAC,GAAO,OAAAC,KAAS;AACzB,cAAMC,IAAWC,EAAA;AACjB,eAAO,MAAM;AACX,gBAAMpB,IAAQmB,EAAS,OACjB,EAAE,OAAOE,GAAiB,QAAAC,EAAA,IAAWC,EAAsBN,CAAK;AACtE,iBAAOS;AAAA,YACL1B,KAAS,CAAC+B,EAAY/B,CAAK,KAAKA,EAAM,YAAY,eAAe6B,IAAYhB;AAAA,YAC7Ec;AAAA,cACE;AAAA,gBACE,GAAGG;AAAA,gBACH,GAAGT;AAAA,cAAA;AAAA,cAELC;AAAA,YAAA;AAAA,YAEFJ;AAAA,UAAA;AAAA,QAEJ;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EAAA;AAGP;AAEO,SAASc,EAA6BnB,MAAchB,GAA6B;AACtF,QAAMoC,IAAYpC,EAAK,OAAO,CAACgB,GAAmBX,MACzCA,EAAOW,CAAM,GACnBA,CAAM,GAEHqB,IAAsBnB,EAAgB;AAAA,IAC1C,MAAMF,EAAO;AAAA,IACb,MAAMG,GAAG,EAAE,OAAAC,GAAO,OAAAC,KAAS;AACzB,aAAO,MAAM;AACX,cAAM,EAAE,OAAOG,GAAiB,QAAAC,EAAA,IAAWC,EAAsBN,CAAK;AACtE,eAAOS,EAAEO,GAAWN,EAAiBN,GAAiBC,CAAM,GAAGJ,CAAK;AAAA,MACtE;AAAA,IACF;AAAA,EAAA,CACD;AAED,SAAOiB,EAAQD,CAAmB;AACpC;"}
1
+ {"version":3,"file":"connect.mjs","names":[],"sources":["../../src/shared/connect.ts"],"sourcesContent":["import type { GeneralField } from '@formily/core'\nimport type { Component } from 'vue'\nimport type { IComponentMapper, IStateMapper, VueComponentProps } from '../types'\nimport { isVoidField } from '@formily/core'\nimport { each, FormPath, isFn, isStr, isValid } from '@formily/shared'\nimport { observer } from '@silver-formily/reactive-vue'\nimport { defineComponent, h, markRaw } from 'vue'\nimport { useField } from '../hooks/useField'\n\nimport { createVNodeProps, extractAttrsAndEvents } from '../utils/reactiveFieldHelpers'\n\nexport function mapProps<T extends Component = Component>(\n ...args: IStateMapper<VueComponentProps<T>>[]\n) {\n const transform = (input: VueComponentProps<T>, field: GeneralField) =>\n args.reduce((props, mapper) => {\n if (isFn(mapper)) {\n props = Object.assign(props, mapper(props, field))\n }\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))\n return\n FormPath.setIn(props, targetValue, extractValue)\n })\n }\n return props\n }, input)\n\n return (target: T) => {\n return observer(\n defineComponent({\n name: target.name ? `Connected${target.name}` : `ConnectedComponent`,\n setup(_, { attrs, slots }) {\n const fieldRef = useField()\n return () => {\n const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs)\n const baseAttrs = { ...normalizedAttrs } as VueComponentProps<T>\n const newAttrs = fieldRef.value ? transform(baseAttrs, fieldRef.value) : baseAttrs\n return h(target, createVNodeProps(newAttrs, events), slots)\n }\n },\n }),\n )\n }\n}\n\nexport function mapReadPretty<T extends Component, C extends Component>(\n component: C,\n readPrettyProps?: Record<string, any>,\n) {\n return (target: T) => {\n return observer(\n defineComponent({\n name: target.name ? `Read${target.name}` : `ReadComponent`,\n setup(_, { attrs, slots }) {\n const fieldRef = useField()\n return () => {\n const field = fieldRef.value\n const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs)\n return h(\n field && !isVoidField(field) && field.pattern === 'readPretty' ? component : target,\n createVNodeProps(\n {\n ...readPrettyProps,\n ...normalizedAttrs,\n },\n events,\n ),\n slots,\n )\n }\n },\n }),\n )\n }\n}\n\nexport function connect<T extends Component>(target: T, ...args: IComponentMapper[]): T {\n const Component = args.reduce((target: Component, mapper) => {\n return mapper(target)\n }, target)\n\n const functionalComponent = defineComponent({\n name: target.name,\n setup(_, { attrs, slots }) {\n return () => {\n const { attrs: normalizedAttrs, events } = extractAttrsAndEvents(attrs)\n return h(Component, createVNodeProps(normalizedAttrs, events), slots)\n }\n },\n })\n\n return markRaw(functionalComponent) as unknown as T\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,SACd,GAAG,MACH;CACA,MAAM,aAAa,OAA6B,UAC9C,KAAK,QAAQ,OAAO,WAAW;AAC7B,MAAI,KAAK,OAAO,CACd,SAAQ,OAAO,OAAO,OAAO,OAAO,OAAO,MAAM,CAAC;MAGlD,MAAK,SAAS,IAAI,YAAY;GAC5B,MAAM,eAAe,SAAS,MAAM,OAAO,QAAQ;GACnD,MAAM,cAAc,MAAM,GAAG,GAAG,KAAK;GACrC,MAAM,gBAAgB,SAAS,MAAM,OAAO,YAAY;AACxD,OAAI,YAAY;QACV,OAAO,QACT,QAAO,MAAM;;AAGjB,OAAI,QAAQ,cAAc,IAAI,CAAC,QAAQ,aAAa,CAClD;AACF,YAAS,MAAM,OAAO,aAAa,aAAa;IAChD;AAEJ,SAAO;IACN,MAAM;AAEX,SAAQ,WAAc;AACpB,SAAO,SACL,gBAAgB;GACd,MAAM,OAAO,OAAO,YAAY,OAAO,SAAS;GAChD,MAAM,GAAG,EAAE,OAAO,SAAS;IACzB,MAAM,WAAW,UAAU;AAC3B,iBAAa;KACX,MAAM,EAAE,OAAO,iBAAiB,WAAW,sBAAsB,MAAM;KACvE,MAAM,YAAY,EAAE,GAAG,iBAAiB;AAExC,YAAO,EAAE,QAAQ,iBADA,SAAS,QAAQ,UAAU,WAAW,SAAS,MAAM,GAAG,WAC7B,OAAO,EAAE,MAAM;;;GAGhE,CAAC,CACH;;;AAIL,SAAgB,cACd,WACA,iBACA;AACA,SAAQ,WAAc;AACpB,SAAO,SACL,gBAAgB;GACd,MAAM,OAAO,OAAO,OAAO,OAAO,SAAS;GAC3C,MAAM,GAAG,EAAE,OAAO,SAAS;IACzB,MAAM,WAAW,UAAU;AAC3B,iBAAa;KACX,MAAM,QAAQ,SAAS;KACvB,MAAM,EAAE,OAAO,iBAAiB,WAAW,sBAAsB,MAAM;AACvE,YAAO,EACL,SAAS,CAAC,YAAY,MAAM,IAAI,MAAM,YAAY,eAAe,YAAY,QAC7E,iBACE;MACE,GAAG;MACH,GAAG;MACJ,EACD,OACD,EACD,MACD;;;GAGN,CAAC,CACH;;;AAIL,SAAgB,QAA6B,QAAW,GAAG,MAA6B;CACtF,MAAM,YAAY,KAAK,QAAQ,QAAmB,WAAW;AAC3D,SAAO,OAAO,OAAO;IACpB,OAAO;AAYV,QAAO,QAVqB,gBAAgB;EAC1C,MAAM,OAAO;EACb,MAAM,GAAG,EAAE,OAAO,SAAS;AACzB,gBAAa;IACX,MAAM,EAAE,OAAO,iBAAiB,WAAW,sBAAsB,MAAM;AACvE,WAAO,EAAE,WAAW,iBAAiB,iBAAiB,OAAO,EAAE,MAAM;;;EAG1E,CAAC,CAEiC"}
@@ -1,10 +1,15 @@
1
- import { Form, GeneralField } from '@formily/core';
2
- import { Schema } from '@formily/json-schema';
3
- import { InjectionKey, Ref } from 'vue';
4
- import { ISchemaFieldVueFactoryOptions, SchemaExpressionScope } from '../types';
5
- export declare const FormSymbol: InjectionKey<Ref<Form>>;
6
- export declare const FieldSymbol: InjectionKey<Ref<GeneralField>>;
7
- export declare const SchemaMarkupSymbol: InjectionKey<Ref<Schema>>;
8
- export declare const SchemaSymbol: InjectionKey<Ref<Schema>>;
9
- export declare const SchemaExpressionScopeSymbol: InjectionKey<Ref<SchemaExpressionScope>>;
10
- export declare const SchemaOptionsSymbol: InjectionKey<Ref<ISchemaFieldVueFactoryOptions>>;
1
+ import { ISchemaFieldVueFactoryOptions, SchemaExpressionScope } from "../types/index.js";
2
+ import { InjectionKey, Ref } from "vue";
3
+ import { Form, GeneralField } from "@formily/core";
4
+ import { Schema } from "@formily/json-schema";
5
+
6
+ //#region src/shared/context.d.ts
7
+ declare const FormSymbol: InjectionKey<Ref<Form>>;
8
+ declare const FieldSymbol: InjectionKey<Ref<GeneralField>>;
9
+ declare const SchemaMarkupSymbol: InjectionKey<Ref<Schema>>;
10
+ declare const SchemaSymbol: InjectionKey<Ref<Schema>>;
11
+ declare const SchemaExpressionScopeSymbol: InjectionKey<Ref<SchemaExpressionScope>>;
12
+ declare const SchemaOptionsSymbol: InjectionKey<Ref<ISchemaFieldVueFactoryOptions>>;
13
+ //#endregion
14
+ export { FieldSymbol, FormSymbol, SchemaExpressionScopeSymbol, SchemaMarkupSymbol, SchemaOptionsSymbol, SchemaSymbol };
15
+ //# sourceMappingURL=context.d.ts.map
@@ -1,10 +1,11 @@
1
- const o = /* @__PURE__ */ Symbol("form"), m = /* @__PURE__ */ Symbol("field"), S = /* @__PURE__ */ Symbol("schemaMarkup"), s = /* @__PURE__ */ Symbol("schema"), c = /* @__PURE__ */ Symbol("schemaExpression"), e = /* @__PURE__ */ Symbol("schemaOptions");
2
- export {
3
- m as FieldSymbol,
4
- o as FormSymbol,
5
- c as SchemaExpressionScopeSymbol,
6
- S as SchemaMarkupSymbol,
7
- e as SchemaOptionsSymbol,
8
- s as SchemaSymbol
9
- };
10
- //# sourceMappingURL=context.mjs.map
1
+ //#region src/shared/context.ts
2
+ const FormSymbol = Symbol("form");
3
+ const FieldSymbol = Symbol("field");
4
+ const SchemaMarkupSymbol = Symbol("schemaMarkup");
5
+ const SchemaSymbol = Symbol("schema");
6
+ const SchemaExpressionScopeSymbol = Symbol("schemaExpression");
7
+ const SchemaOptionsSymbol = Symbol("schemaOptions");
8
+ //#endregion
9
+ export { FieldSymbol, FormSymbol, SchemaExpressionScopeSymbol, SchemaMarkupSymbol, SchemaOptionsSymbol, SchemaSymbol };
10
+
11
+ //# sourceMappingURL=context.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.mjs","sources":["../../src/shared/context.ts"],"sourcesContent":["import type { Form, GeneralField } from '@formily/core'\nimport type { Schema } from '@formily/json-schema'\nimport type { InjectionKey, Ref } from 'vue'\nimport type { ISchemaFieldVueFactoryOptions, SchemaExpressionScope } from '../types'\n\nexport const FormSymbol: InjectionKey<Ref<Form>> = Symbol('form')\nexport const FieldSymbol: InjectionKey<Ref<GeneralField>> = Symbol('field')\nexport const SchemaMarkupSymbol: InjectionKey<Ref<Schema>> = Symbol('schemaMarkup')\nexport const SchemaSymbol: InjectionKey<Ref<Schema>> = Symbol('schema')\nexport const SchemaExpressionScopeSymbol: InjectionKey<Ref<SchemaExpressionScope>>\n = Symbol('schemaExpression')\nexport const SchemaOptionsSymbol: InjectionKey<Ref<ISchemaFieldVueFactoryOptions>>\n = Symbol('schemaOptions')\n"],"names":["FormSymbol","FieldSymbol","SchemaMarkupSymbol","SchemaSymbol","SchemaExpressionScopeSymbol","SchemaOptionsSymbol"],"mappings":"AAKO,MAAMA,2BAA6C,MAAM,GACnDC,2BAAsD,OAAO,GAC7DC,2BAAuD,cAAc,GACrEC,2BAAiD,QAAQ,GACzDC,2BACF,kBAAkB,GAChBC,2BACF,eAAe;"}
1
+ {"version":3,"file":"context.mjs","names":[],"sources":["../../src/shared/context.ts"],"sourcesContent":["import type { Form, GeneralField } from '@formily/core'\nimport type { Schema } from '@formily/json-schema'\nimport type { InjectionKey, Ref } from 'vue'\nimport type { ISchemaFieldVueFactoryOptions, SchemaExpressionScope } from '../types'\n\nexport const FormSymbol: InjectionKey<Ref<Form>> = Symbol('form')\nexport const FieldSymbol: InjectionKey<Ref<GeneralField>> = Symbol('field')\nexport const SchemaMarkupSymbol: InjectionKey<Ref<Schema>> = Symbol('schemaMarkup')\nexport const SchemaSymbol: InjectionKey<Ref<Schema>> = Symbol('schema')\nexport const SchemaExpressionScopeSymbol: InjectionKey<Ref<SchemaExpressionScope>>\n = Symbol('schemaExpression')\nexport const SchemaOptionsSymbol: InjectionKey<Ref<ISchemaFieldVueFactoryOptions>>\n = Symbol('schemaOptions')\n"],"mappings":";AAKA,MAAa,aAAsC,OAAO,OAAO;AACjE,MAAa,cAA+C,OAAO,QAAQ;AAC3E,MAAa,qBAAgD,OAAO,eAAe;AACnF,MAAa,eAA0C,OAAO,SAAS;AACvE,MAAa,8BACT,OAAO,mBAAmB;AAC9B,MAAa,sBACT,OAAO,gBAAgB"}
@@ -1,2 +1,2 @@
1
- export * from './connect';
2
- export * from './context';
1
+ import { connect, mapProps, mapReadPretty } from "./connect.js";
2
+ import { FieldSymbol, FormSymbol, SchemaExpressionScopeSymbol, SchemaMarkupSymbol, SchemaOptionsSymbol, SchemaSymbol } from "./context.js";
@@ -1,14 +1,3 @@
1
- import { connect as e, mapProps as S, mapReadPretty as p } from "./connect.mjs";
2
- import { FieldSymbol as a, FormSymbol as c, SchemaExpressionScopeSymbol as l, SchemaMarkupSymbol as y, SchemaOptionsSymbol as b, SchemaSymbol as t } from "./context.mjs";
3
- export {
4
- a as FieldSymbol,
5
- c as FormSymbol,
6
- l as SchemaExpressionScopeSymbol,
7
- y as SchemaMarkupSymbol,
8
- b as SchemaOptionsSymbol,
9
- t as SchemaSymbol,
10
- e as connect,
11
- S as mapProps,
12
- p as mapReadPretty
13
- };
14
- //# sourceMappingURL=index.mjs.map
1
+ import "./context.mjs";
2
+ import "./connect.mjs";
3
+ export {};