@schemx/vue 1.0.0-next.2 → 1.0.0-next.3

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 (37) hide show
  1. package/README.md +60 -62
  2. package/dist/analyze.html +1 -1
  3. package/dist/bridge/fieldBridge.d.ts +23 -0
  4. package/dist/bridge/fieldBridge.d.ts.map +1 -0
  5. package/dist/bridge/formBridge.d.ts +81 -0
  6. package/dist/bridge/formBridge.d.ts.map +1 -0
  7. package/dist/bridge/formFacade.d.ts +65 -0
  8. package/dist/bridge/formFacade.d.ts.map +1 -0
  9. package/dist/bridge/helpers.d.ts +31 -0
  10. package/dist/bridge/helpers.d.ts.map +1 -0
  11. package/dist/bridge/index.d.ts +11 -0
  12. package/dist/bridge/index.d.ts.map +1 -0
  13. package/dist/bridge/types.d.ts +109 -0
  14. package/dist/bridge/types.d.ts.map +1 -0
  15. package/dist/components/Button/index.vue.d.ts +30 -0
  16. package/dist/components/Button/index.vue.d.ts.map +1 -0
  17. package/dist/hooks/index.d.ts +1 -1
  18. package/dist/hooks/index.d.ts.map +1 -1
  19. package/dist/hooks/provideFormContext.d.ts +1 -1
  20. package/dist/hooks/provideFormContext.d.ts.map +1 -1
  21. package/dist/hooks/useField.d.ts +1 -1
  22. package/dist/hooks/useField.d.ts.map +1 -1
  23. package/dist/hooks/useForm.d.ts +1 -1
  24. package/dist/hooks/useForm.d.ts.map +1 -1
  25. package/dist/hooks/useFormSelector.d.ts.map +1 -1
  26. package/dist/hooks/useWatch.d.ts.map +1 -1
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.ts +0 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.mjs +184 -176
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/types/form.d.ts +1 -1
  34. package/dist/types/form.d.ts.map +1 -1
  35. package/package.json +3 -3
  36. package/dist/formBridge.d.ts +0 -188
  37. package/dist/formBridge.d.ts.map +0 -1
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  如果项目使用 Vant,推荐直接安装 [`@schemx/vant`](../vant)。该包已经注册常用的移动端表单 Renderer。
6
6
 
7
+ 适用于使用自研组件或设计系统的 Vue 3 项目。该包提供表单组件、响应式 Hook 和 Renderer 注册机制,但不内置具体输入控件;每种 `componentType` 都需要由应用自行注册 Renderer。
8
+
7
9
  ## 安装与样式
8
10
 
9
11
  ```bash
@@ -83,7 +85,7 @@ console.log(Schemx === schemxForm) // true
83
85
  | `modelValue` | `T` | `{}` | `v-model` 的输入端;非空值参与初始快照,后续替换会同步到内部表单,字段变化会通过 `update:modelValue` 输出 |
84
86
  | `initialValues` | `T` | `{}` | 创建内部表单时的初始值,也是 `reset()` 的还原基准 |
85
87
  | `form` | `SchemxInstance<T>` | `undefined` | 外部表单实例;传入后组件不再创建实例,但仍会提供 Vue 上下文并同步 `schemas`;组件级回调不会写入该实例,`v-model` 仍监听实例变化 |
86
- | `rendererProps` | `SchemxRendererPropsMap<T>` | `undefined` | 按 Renderer 类型设置静态默认 Props;字段 `componentProps` 与 Runtime 注入值优先 |
88
+ | `rendererProps` | `SchemxRendererPropsMap<T>` | `undefined` | 按 Renderer 类型设置静态默认 Props;字段 `componentProps` 与 Runtime 注入值优先 |
87
89
  | `rendererRegistry` | `RendererRegistry` | 全局 `rendererRegistry` | 当前表单使用的 Renderer Registry |
88
90
  | `defaultRendererType` | `SchemxRendererKey` | `undefined` | 创建内部表单且未传 `rendererRegistry` 时的默认 Renderer 类型;Vue 全局 Registry 存在时由该 Registry 的 fallback 决定 |
89
91
  | `validationRuleRegistry` | `ValidationRuleRegistry` | 全局 `validationRuleRegistry` | 当前表单使用的校验规则 Registry |
@@ -101,13 +103,13 @@ console.log(Schemx === schemxForm) // true
101
103
  | `colon` | `boolean` | `undefined` | 表单级标签冒号默认值;字段自身配置优先,均未配置时为 `true` |
102
104
  | `onFinish` | `(values: Readonly<T>) => void \| Promise<void>` | `undefined` | `submit()` 校验通过后的回调 Prop |
103
105
  | `onFinishFailed` | `(failure: ValidationFailure<T>) => void` | `undefined` | `submit()` 校验失败后的回调 Prop |
104
- | `onReset` | `() => void` | `undefined` | 内部表单完整 `reset()` 完成后的回调;不在 `resetFields()` 后触发 |
105
- | `onLoadingChange` | `(loading: boolean) => void` | `undefined` | 内部表单提交开始和结束时的回调 |
106
+ | `onReset` | `() => void` | `undefined` | 内部表单完整 `reset()` 完成后的回调;不在 `resetFields()` 后触发 |
107
+ | `onLoadingChange` | `(loading: boolean) => void` | `undefined` | 内部表单提交开始和结束时的回调 |
106
108
  | `onValuesChange` | `(changedValues, latestSnapshot) => void` | `undefined` | 字段值变化后的回调 Prop |
107
109
  | `onFieldsChange` | `(changedFields, allFields) => void` | `undefined` | 字段路径变化后的回调 Prop |
108
110
  | `onRuleError` | `CreateValidatorOptions<T>["onRuleError"]` | `undefined` | 规则解析异常回调;内部创建实例时当前不会透传,需在外部 `form` 实例上配置 |
109
- | `loading` | `boolean` | `undefined` | 覆盖内置操作区显示的提交状态,不改变 Core 的真实提交状态 |
110
- | `submitter` / `resetter` | `boolean \| SchemxFormActionConfig` | `true` | 控制内置提交 / 重置按钮;设为 `false` 隐藏,配置可设置 `text` 和 `buttonProps` |
111
+ | `loading` | `boolean` | `undefined` | 覆盖内置操作区显示的提交状态,不改变 Core 的真实提交状态 |
112
+ | `submitter` / `resetter` | `boolean \| SchemxFormActionConfig` | `undefined` | 控制内置提交 / 重置按钮;未配置时不渲染,设为 `false` 隐藏,配置可设置 `text` 和 `buttonProps` |
111
113
  | `class` | `string` | `""` | 添加到根 `.schemx` 元素的类名 |
112
114
  | `style` | `StyleValue` | `{}` | 绑定到根 `.schemx` 元素 |
113
115
 
@@ -138,19 +140,21 @@ console.log(Schemx === schemxForm) // true
138
140
 
139
141
  ### Slots
140
142
 
141
- `Schemx` 把收到的所有 Slots 继续传给每个 `FormItem`。字符串字段名直接参与 Slot 命名。数组路径目前存在两种不同的字符串化规则:整体字段 Slot 和 Renderer 子 Slot 会先经过 `normalizeNameKey()`,用 `.` 连接;标签、内容和错误 Slot 则直接把数组插入模板字符串,使用 JavaScript 默认的逗号连接。这是当前实现差异,并非统一的命名约定。
143
+ `Schemx` 把收到的所有 Slots 继续传给每个 `FormItem`。字符串字段名直接参与 Slot 命名。数组路径目前存在两种不同的字符串化规则:整体字段 Slot 和 Renderer 子 Slot 会先经过 `normalizeNameKey()`,用 `.` 连接;标签、前置、内容、后置和错误 Slot 则直接把数组插入模板字符串,使用 JavaScript 默认的逗号连接。这是当前实现差异,并非统一的命名约定。
142
144
 
143
145
  | Slot 名称 | Slot Props | 行为 |
144
146
  | ------------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------- |
145
147
  | `{name}` | 当前字段的 `SchemxViewSchema` | 完全接管整个字段,不渲染默认 FormItem 结构;数组路径 `['user', 'name']` 对应 `user.name` |
146
148
  | `{name}Label` | 当前字段的 `SchemxViewSchema` | 替换标签区域;同一数组路径当前对应 `user,nameLabel` |
149
+ | `{name}Before` | 当前字段的 `value` 与 Renderer Props | 渲染在 Renderer 前;同一数组路径当前对应 `user,nameBefore` |
147
150
  | `{name}Content` | 当前字段 Schema 字段及 `columnElement` | 替换控件内容区域;`columnElement` 是已经创建的 Renderer VNode;同一数组路径当前对应 `user,nameContent` |
151
+ | `{name}After` | 当前字段的 `value` 与 Renderer Props | 渲染在 Renderer 后、错误区域前;同一数组路径当前对应 `user,nameAfter` |
148
152
  | `{name}Error` | 当前字段 Schema 字段及 `errors` | 替换错误区域;同一数组路径当前对应 `user,nameError` |
149
153
  | `{name}:{slotName}` | 原样传给 Renderer | 去掉 `{name}:` 前缀后作为 Renderer 命名 Slot;同一数组路径的前缀为 `user.name:`,例如 `user.name:prefix` |
150
- | `submitter` | `{ form, loading, disabled, submit }` | 替换内置提交按钮。 |
151
- | `resetter` | `{ form, loading, disabled, reset }` | 替换内置重置按钮。 |
154
+ | `submitter` | `{ form, loading, disabled, submit }` | 替换内置提交按钮。 |
155
+ | `resetter` | `{ form, loading, disabled, reset }` | 替换内置重置按钮。 |
152
156
 
153
- 字段名和 `Label` / `Content` / `Error` 组合支持 camelCase 与 kebab-case 互查。子 Renderer Slot 的字段名前缀也支持这两种形式。
157
+ 字段名和 `Label` / `Before` / `Content` / `After` / `Error` 组合支持 camelCase 与 kebab-case 互查。子 Renderer Slot 的字段名前缀也支持这两种形式。
154
158
 
155
159
  ```vue
156
160
  <Schemx :schemas="schemas">
@@ -158,6 +162,14 @@ console.log(Schemx === schemxForm) // true
158
162
  <strong>{{ schema.label }}</strong>
159
163
  </template>
160
164
 
165
+ <template #nicknameBefore>
166
+ <span>@</span>
167
+ </template>
168
+
169
+ <template #nicknameAfter="{ value }">
170
+ <small>{{ String(value).length }}/20</small>
171
+ </template>
172
+
161
173
  <template #nicknameError="{ errors }">
162
174
  <small v-if="errors?.length">{{ errors.join(";") }}</small>
163
175
  </template>
@@ -168,18 +180,6 @@ console.log(Schemx === schemxForm) // true
168
180
  </Schemx>
169
181
  ```
170
182
 
171
- ### `Button`
172
-
173
- 根入口导出独立的 `Button` 组件及 `SchemxButtonProps`、`SchemxButtonSize` 类型。它支持原生按钮属性、`loading`、`loadingText`、`disabled` 与 `size`(`small`、`medium`、`large`);加载时会自动禁用按钮并设置 `aria-busy`。`prefix`、默认与 `suffix` 插槽依次渲染,`loadingText` 仅替换默认插槽内容。
174
-
175
- ```vue
176
- <Button :loading="saving" loading-text="保存中" size="small">
177
- <template #prefix>✓</template>
178
- 保存
179
- <template #suffix>→</template>
180
- </Button>
181
- ```
182
-
183
183
  ### 组件 ref 暴露实例
184
184
 
185
185
  组件通过 `defineExpose` 暴露传入或内部创建的完整 `SchemxInstance<T>`。该接口当前共有 41 个成员:
@@ -721,8 +721,8 @@ componentProps: {
721
721
  | `useDictionary()` | 管理依赖字段的函数式选项来源 |
722
722
  | `useStableRef()` | 创建引用保持稳定的 `shallowRef` |
723
723
  | `useViewSchemas()` | 把 `subscribeViewSchemas()` 桥接为 Vue `shallowRef` |
724
- | `useFormSelector()` | 从共享表单值 Bridge 派生只读 Vue Ref |
725
- | `getCoreForm()` | 从 Vue Facade 取得原始 Core Form |
724
+ | `useFormSelector()` | 从共享表单值 Bridge 派生只读 Vue Ref |
725
+ | `getCoreForm()` | 从 Vue Facade 取得原始 Core Form |
726
726
 
727
727
  `useForm()` 只负责创建和销毁实例。如需让自定义组件树中的 `useField()`、`useDictionary()` 或 `FormItem` 找到实例,Provider 必须在 `setup()` 的同步调用栈中调用 `createFormContext(form)`;展示层还应调用 `createFormConfigContext({ schemaConfig })`。直接使用 `<Schemx>` 时,这两种上下文已经由组件提供。
728
728
 
@@ -756,7 +756,7 @@ createFormContext(form)
756
756
 
757
757
  同一 Core Form 始终复用一个 Facade;Vue Bridge 按需创建,并在存活期间由各个 Vue owner 共享。Facade 的写入、校验、提交、Schema 与 Registry 方法都委托原始 Core Form;仅常用状态读取会额外建立 Vue 依赖。`getFieldsValue()` 无参数时依赖全表值,传入路径时仅依赖这些字段。`getFieldSnapshot()`、`getFieldsSnapshot()`、`getInitialValue()` 与 `getInitialValues()` 保持 Core 的无依赖快照语义。
758
758
 
759
- `useFormSelector()` 和 `useField()` 复用这个 Bridge;前者返回 selector 结果的只读 Ref,后者复用字段 `value`、`errors`、`touched` 和 `pending` Ref。最后一个 Vue owner 释放或手动调用 `form.destroy()` 后,Bridge 会停止订阅并释放 Core External Store。
759
+ `useFormSelector()` 和 `useField()` 复用这个 Bridge;前者返回 selector 结果的只读 Ref,后者复用字段 `value`、`errors`、`touched` 和 `pending` Ref。Bridge 通过 `@schemx/core/adapter` 的 `createFormStateAdapter()` 消费 Core `SnapshotSource`。最后一个 Vue owner 释放或手动调用 `form.destroy()` 后,Bridge 会停止订阅并释放这些快照来源。
760
760
 
761
761
  ### 3 组 Context API
762
762
 
@@ -781,11 +781,11 @@ function useFormConfigContext(): FormContextProps
781
781
 
782
782
  上面签名中的 `FieldInstance` 已从 `@schemx/vue` 根入口导出。`createFieldContext()` 当前只有 `TValues extends Values = Values`,**没有独立的 `TName` 泛型**;`field` 必须是 `useField()` 返回的 Vue 字段控制器,字段路径已由创建该返回值时的 `name` 捕获。调用方可以显式导入 `FieldInstance`,也可以依靠 `useField()` 推导参数。
783
783
 
784
- | Provider 签名 | Reader 签名 | 职责、所有权与缺失行为 |
785
- | ------------------------------------------------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
784
+ | Provider 签名 | Reader 签名 | 职责、所有权与缺失行为 |
785
+ | --------------------------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
786
786
  | `createFormContext<T>(form: SchemxInstance<T>): VueSchemxInstance<T>` | `useFormContext<T>(): VueSchemxInstance<T>` | 将 Core Form 或已有 Facade 归一化后提供 / 读取。Provider 只持有 Bridge,不销毁外部 Core Form;缺失时 Reader 抛出带 `createFormContext(form)` 指引的 `Error`。 |
787
- | `createFieldContext<TValues extends Values = Values>(field): void` | `useFieldContext(): FieldInstance<Values>` | 提供 / 读取 `useField()` 返回的字段控制器。Provider 不创建字段、不接管订阅;缺失时 Reader 抛出指向 `createFieldContext(field)` 的 `Error`。 |
788
- | `createFormConfigContext<T>(props: FormContextProps<T>): void` | `useFormConfigContext(): FormContextProps` | 提供 / 读取表单展示配置。Provider 不复制、不更新传入对象;缺失时 Reader 抛出带 `createFormConfigContext(props)` 指引的 `Error`。 |
787
+ | `createFieldContext<TValues extends Values = Values>(field): void` | `useFieldContext(): FieldInstance<Values>` | 提供 / 读取 `useField()` 返回的字段控制器。Provider 不创建字段、不接管订阅;缺失时 Reader 抛出指向 `createFieldContext(field)` 的 `Error`。 |
788
+ | `createFormConfigContext<T>(props: FormContextProps<T>): void` | `useFormConfigContext(): FormContextProps` | 提供 / 读取表单展示配置。Provider 不复制、不更新传入对象;缺失时 Reader 抛出带 `createFormConfigContext(props)` 指引的 `Error`。 |
789
789
 
790
790
  ```ts
791
791
  import {
@@ -833,7 +833,7 @@ function useField<TValues extends Values = Values>(
833
833
 
834
834
  Hook 从 `useFormContext()` 取得 Facade,为 `name` 创建 Core 字段控制器,并复用共享 Vue Field Bridge。它保留 Core `SchemxFieldInstance` 的全部成员,并增加 `value: Ref<FieldValue<...> | undefined>`、`errors: ComputedRef<readonly string[]>`、`dirty: ComputedRef<boolean>` 与 `pending: ComputedRef<boolean>`;`dirty` 读取字段 touched Ref。`getValue()`、`getErrors()`、`isTouched()` 和 `isPending()` 都读取对应 Vue Ref,`getValues()` 则通过 Facade 读取全表值。只有 `value` 可通过 `.value` 写入,其余三个 computed 状态只读。Core 方法的完整签名见 [Core 单字段控制器](../core#单字段控制器)。
835
835
 
836
- `useField()` 不缓存字段控制器对象;每次调用只创建轻量的 Core 控制器包装,并复用当前 Form Bridge 中按 Field External Store 身份缓存的字段 Ref。Bridge 以公开 `NamePath` 规范化结果复用字段;当前公开类型仅支持字符串路径。Form Bridge 由 `useForm()`、Form Context 和 `useFormSelector()` 等 Vue owner 的引用计数持有,最后一个 owner 释放或手动销毁后停止订阅。`FieldInstance` 可从 `@schemx/vue` 根入口导入;不需要依赖深层路径。
836
+ `useField()` 不缓存字段控制器对象;每次调用只创建轻量的 Core 控制器包装,并复用当前 Form Bridge 中按字段 `SnapshotSource` 缓存的字段 Ref。Bridge 以公开 `NamePath` 规范化结果复用字段;当前公开类型仅支持字符串路径。Form Bridge 由 `useForm()`、Form Context 和 `useFormSelector()` 等 Vue owner 的引用计数持有,最后一个 owner 释放或手动销毁后停止订阅。`FieldInstance` 可从 `@schemx/vue` 根入口导入;不需要依赖深层路径。
837
837
 
838
838
  ```ts
839
839
  import { createFieldContext, useField } from "@schemx/vue"
@@ -1072,39 +1072,37 @@ Vue 根入口自有以下公开类型:
1072
1072
 
1073
1073
  ### Vue 自有导出
1074
1074
 
1075
- | 分类 | 导出 | 用途 |
1076
- | --------------- | -------------------------- | --------------------------------------------- |
1077
- | 表单组件 | `schemxForm` | 可安装的表单组件;与 `default` 指向同一对象。 |
1078
- | 组件 | `FormItem` | 渲染字段或分组 ViewSchema。 |
1079
- | 组件 | `FormGroup` | 渲染分组 ViewSchema。 |
1080
- | 组件 | `Button` | 支持 loading、尺寸与前后缀插槽的基础按钮。 |
1081
- | HOC | `WithRemoteOptions` | Renderer 接入 Dictionary |
1082
- | Registry | `rendererRegistry` | Vue 全局 Renderer Registry |
1083
- | Registry | `validationRuleRegistry` | Vue 全局 ValidationRuleRegistry。 |
1084
- | Hook | `useForm` | 创建并按 Vue scope 销毁表单。 |
1085
- | Context | `createFormContext` | 提供表单实例。 |
1086
- | Context | `useFormContext` | 读取表单实例。 |
1087
- | Hook | `useField` | 创建 Vue 字段控制器。 |
1088
- | Context | `createFieldContext` | 提供字段控制器。 |
1089
- | Context | `useFieldContext` | 读取字段控制器。 |
1090
- | Context | `createFormConfigContext` | 提供表单展示配置。 |
1091
- | Context | `useFormConfigContext` | 读取表单展示配置。 |
1092
- | Watch | `useWatch` | 统一分发 Vue Watch。 |
1093
- | Watch | `useWatchField` | 单字段 Vue Watch。 |
1094
- | Watch | `useWatchFields` | 多字段 Vue Watch。 |
1095
- | Watch | `useWatchAll` | 全表 Vue Watch。 |
1096
- | Dictionary | `useDictionary` | 管理函数式选项源。 |
1097
- | Vue 响应式 | `useStableRef` | 建立浅比较稳定 Ref。 |
1098
- | ViewSchema | `useViewSchemas` | 桥接 ViewSchemas 为 Ref。 |
1099
- | 默认导出 | `default` | `schemxForm` 严格相等。 |
1100
- | Context 类型 | `FormContextProps` | 表单展示 Context。 |
1101
- | Dictionary 类型 | `SchemxDictionary` | 函数式选项源配置。 |
1102
- | 插件类型 | `SchemxInstallOptions` | 当前 Vue App 的默认配置安装选项。 |
1103
- | Dictionary 类型 | `SchemxWithDictionary` | Props 增加 `dict`。 |
1104
- | Dictionary 类型 | `UseDictionaryReturn` | `useDictionary()` 返回值。 |
1105
- | 表单类型 | `SchemxFormProps<TValues>` | `<Schemx>` 组件 Props 类型。 |
1106
- | 按钮类型 | `SchemxButtonProps`、`SchemxButtonSize` | `Button` 的 Props 与尺寸类型。 |
1107
- | 字段类型 | `FieldInstance<TValues>` | Vue Ref / Computed 桥接后的字段控制器类型。 |
1075
+ | 分类 | 导出 | 用途 |
1076
+ | --------------- | --------------------------------------- | --------------------------------------------- |
1077
+ | 表单组件 | `schemxForm` | 可安装的表单组件;与 `default` 指向同一对象。 |
1078
+ | 组件 | `FormItem` | 渲染字段或分组 ViewSchema。 |
1079
+ | 组件 | `FormGroup` | 渲染分组 ViewSchema。 |
1080
+ | HOC | `WithRemoteOptions` | Renderer 接入 Dictionary。 |
1081
+ | Registry | `rendererRegistry` | Vue 全局 Renderer Registry |
1082
+ | Registry | `validationRuleRegistry` | Vue 全局 ValidationRuleRegistry |
1083
+ | Hook | `useForm` | 创建并按 Vue scope 销毁表单。 |
1084
+ | Context | `createFormContext` | 提供表单实例。 |
1085
+ | Context | `useFormContext` | 读取表单实例。 |
1086
+ | Hook | `useField` | 创建 Vue 字段控制器。 |
1087
+ | Context | `createFieldContext` | 提供字段控制器。 |
1088
+ | Context | `useFieldContext` | 读取字段控制器。 |
1089
+ | Context | `createFormConfigContext` | 提供表单展示配置。 |
1090
+ | Context | `useFormConfigContext` | 读取表单展示配置。 |
1091
+ | Watch | `useWatch` | 统一分发 Vue Watch。 |
1092
+ | Watch | `useWatchField` | 单字段 Vue Watch。 |
1093
+ | Watch | `useWatchFields` | 多字段 Vue Watch。 |
1094
+ | Watch | `useWatchAll` | 全表 Vue Watch。 |
1095
+ | Dictionary | `useDictionary` | 管理函数式选项源。 |
1096
+ | Vue 响应式 | `useStableRef` | 建立浅比较稳定 Ref。 |
1097
+ | ViewSchema | `useViewSchemas` | 桥接 ViewSchemas 为 Ref。 |
1098
+ | 默认导出 | `default` | `schemxForm` 严格相等。 |
1099
+ | Context 类型 | `FormContextProps` | 表单展示 Context。 |
1100
+ | Dictionary 类型 | `SchemxDictionary` | 函数式选项源配置。 |
1101
+ | 插件类型 | `SchemxInstallOptions` | 当前 Vue App 的默认配置安装选项。 |
1102
+ | Dictionary 类型 | `SchemxWithDictionary` | Props 增加 `dict`。 |
1103
+ | Dictionary 类型 | `UseDictionaryReturn` | `useDictionary()` 返回值。 |
1104
+ | 表单类型 | `SchemxFormProps<TValues>` | `<Schemx>` 组件 Props 类型。 |
1105
+ | 字段类型 | `FieldInstance<TValues>` | Vue Ref / Computed 桥接后的字段控制器类型。 |
1108
1106
 
1109
1107
  根入口没有名为 `SchemxForm` 的命名导出。
1110
1108
 
package/dist/analyze.html CHANGED
@@ -4929,7 +4929,7 @@ var drawChart = (function (exports) {
4929
4929
  </script>
4930
4930
  <script>
4931
4931
  /*<!--*/
4932
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.cjs","children":[{"name":"src","children":[{"name":"styles/index.css","uid":"409cd899-1"},{"name":"config/appConfig.ts","uid":"409cd899-3"},{"uid":"409cd899-5","name":"formBridge.ts"},{"name":"utils","children":[{"uid":"409cd899-7","name":"rendererProvider.ts"},{"uid":"409cd899-9","name":"rulesProvider.ts"},{"uid":"409cd899-25","name":"equal.ts"},{"uid":"409cd899-33","name":"validation.ts"},{"uid":"409cd899-35","name":"slot.ts"},{"uid":"409cd899-47","name":"helpers.ts"}]},{"name":"hooks","children":[{"uid":"409cd899-11","name":"useForm.ts"},{"uid":"409cd899-13","name":"provideFormContext.ts"},{"uid":"409cd899-15","name":"useField.ts"},{"uid":"409cd899-17","name":"provideFieldContext.ts"},{"uid":"409cd899-19","name":"useWatch.ts"},{"uid":"409cd899-21","name":"useDictionary.ts"},{"uid":"409cd899-23","name":"provideFormConfigContext.ts"},{"uid":"409cd899-27","name":"useStableRef.ts"},{"uid":"409cd899-29","name":"useViewSchemas.ts"},{"uid":"409cd899-31","name":"useFormSelector.ts"}]},{"name":"components","children":[{"name":"FormGroup/index.tsx","uid":"409cd899-37"},{"name":"FormItem","children":[{"uid":"409cd899-39","name":"slot.tsx"},{"uid":"409cd899-41","name":"index.tsx"}]},{"name":"Button","children":[{"uid":"409cd899-43","name":"index.vue?vue&type=script&setup=true&lang.ts"},{"uid":"409cd899-45","name":"index.vue?vue&type=style&index=0&lang.css"}]}]},{"uid":"409cd899-49","name":"form.vue?vue&type=script&setup=true&lang.ts"},{"uid":"409cd899-51","name":"form.ts"},{"name":"hocs/withRemoteOptions.ts","uid":"409cd899-53"},{"uid":"409cd899-55","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"409cd899-1":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"409cd899-0"},"409cd899-3":{"renderedLength":1317,"gzipLength":489,"brotliLength":422,"metaUid":"409cd899-2"},"409cd899-5":{"renderedLength":6908,"gzipLength":1387,"brotliLength":1226,"metaUid":"409cd899-4"},"409cd899-7":{"renderedLength":65,"gzipLength":72,"brotliLength":52,"metaUid":"409cd899-6"},"409cd899-9":{"renderedLength":67,"gzipLength":68,"brotliLength":53,"metaUid":"409cd899-8"},"409cd899-11":{"renderedLength":1079,"gzipLength":482,"brotliLength":400,"metaUid":"409cd899-10"},"409cd899-13":{"renderedLength":628,"gzipLength":340,"brotliLength":290,"metaUid":"409cd899-12"},"409cd899-15":{"renderedLength":1038,"gzipLength":344,"brotliLength":307,"metaUid":"409cd899-14"},"409cd899-17":{"renderedLength":410,"gzipLength":249,"brotliLength":198,"metaUid":"409cd899-16"},"409cd899-19":{"renderedLength":564,"gzipLength":229,"brotliLength":192,"metaUid":"409cd899-18"},"409cd899-21":{"renderedLength":2879,"gzipLength":953,"brotliLength":814,"metaUid":"409cd899-20"},"409cd899-23":{"renderedLength":483,"gzipLength":288,"brotliLength":239,"metaUid":"409cd899-22"},"409cd899-25":{"renderedLength":206,"gzipLength":156,"brotliLength":122,"metaUid":"409cd899-24"},"409cd899-27":{"renderedLength":240,"gzipLength":168,"brotliLength":143,"metaUid":"409cd899-26"},"409cd899-29":{"renderedLength":1781,"gzipLength":706,"brotliLength":590,"metaUid":"409cd899-28"},"409cd899-31":{"renderedLength":594,"gzipLength":306,"brotliLength":266,"metaUid":"409cd899-30"},"409cd899-33":{"renderedLength":788,"gzipLength":325,"brotliLength":267,"metaUid":"409cd899-32"},"409cd899-35":{"renderedLength":1278,"gzipLength":491,"brotliLength":404,"metaUid":"409cd899-34"},"409cd899-37":{"renderedLength":3726,"gzipLength":1330,"brotliLength":1126,"metaUid":"409cd899-36"},"409cd899-39":{"renderedLength":4194,"gzipLength":1528,"brotliLength":1268,"metaUid":"409cd899-38"},"409cd899-41":{"renderedLength":5674,"gzipLength":2071,"brotliLength":1707,"metaUid":"409cd899-40"},"409cd899-43":{"renderedLength":2486,"gzipLength":913,"brotliLength":789,"metaUid":"409cd899-42"},"409cd899-45":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"409cd899-44"},"409cd899-47":{"renderedLength":1052,"gzipLength":382,"brotliLength":332,"metaUid":"409cd899-46"},"409cd899-49":{"renderedLength":10188,"gzipLength":2759,"brotliLength":2326,"metaUid":"409cd899-48"},"409cd899-51":{"renderedLength":384,"gzipLength":269,"brotliLength":214,"metaUid":"409cd899-50"},"409cd899-53":{"renderedLength":1052,"gzipLength":455,"brotliLength":378,"metaUid":"409cd899-52"},"409cd899-55":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"409cd899-54"}},"nodeMetas":{"409cd899-0":{"id":"/src/styles/index.css","moduleParts":{"index.cjs":"409cd899-1"},"imported":[],"importedBy":[{"uid":"409cd899-54"},{"uid":"409cd899-48"}]},"409cd899-2":{"id":"/src/config/appConfig.ts","moduleParts":{"index.cjs":"409cd899-3"},"imported":[{"uid":"409cd899-65"}],"importedBy":[{"uid":"409cd899-61"}]},"409cd899-4":{"id":"/src/formBridge.ts","moduleParts":{"index.cjs":"409cd899-5"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-63"}],"importedBy":[{"uid":"409cd899-56"},{"uid":"409cd899-10"},{"uid":"409cd899-12"},{"uid":"409cd899-14"},{"uid":"409cd899-18"},{"uid":"409cd899-28"},{"uid":"409cd899-30"}]},"409cd899-6":{"id":"/src/utils/rendererProvider.ts","moduleParts":{"index.cjs":"409cd899-7"},"imported":[{"uid":"409cd899-63"}],"importedBy":[{"uid":"409cd899-54"},{"uid":"409cd899-10"}]},"409cd899-8":{"id":"/src/utils/rulesProvider.ts","moduleParts":{"index.cjs":"409cd899-9"},"imported":[{"uid":"409cd899-59"}],"importedBy":[{"uid":"409cd899-54"},{"uid":"409cd899-10"}]},"409cd899-10":{"id":"/src/hooks/useForm.ts","moduleParts":{"index.cjs":"409cd899-11"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-59"},{"uid":"409cd899-61"},{"uid":"409cd899-4"},{"uid":"409cd899-6"},{"uid":"409cd899-8"}],"importedBy":[{"uid":"409cd899-56"}]},"409cd899-12":{"id":"/src/hooks/provideFormContext.ts","moduleParts":{"index.cjs":"409cd899-13"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-4"}],"importedBy":[{"uid":"409cd899-56"},{"uid":"409cd899-14"},{"uid":"409cd899-18"},{"uid":"409cd899-20"}]},"409cd899-14":{"id":"/src/hooks/useField.ts","moduleParts":{"index.cjs":"409cd899-15"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-59"},{"uid":"409cd899-4"},{"uid":"409cd899-12"}],"importedBy":[{"uid":"409cd899-56"}]},"409cd899-16":{"id":"/src/hooks/provideFieldContext.ts","moduleParts":{"index.cjs":"409cd899-17"},"imported":[{"uid":"409cd899-65"}],"importedBy":[{"uid":"409cd899-56"},{"uid":"409cd899-52"}]},"409cd899-18":{"id":"/src/hooks/useWatch.ts","moduleParts":{"index.cjs":"409cd899-19"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-59"},{"uid":"409cd899-4"},{"uid":"409cd899-12"}],"importedBy":[{"uid":"409cd899-56"},{"uid":"409cd899-20"}]},"409cd899-20":{"id":"/src/hooks/useDictionary.ts","moduleParts":{"index.cjs":"409cd899-21"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-12"},{"uid":"409cd899-18"}],"importedBy":[{"uid":"409cd899-56"},{"uid":"409cd899-52"}]},"409cd899-22":{"id":"/src/hooks/provideFormConfigContext.ts","moduleParts":{"index.cjs":"409cd899-23"},"imported":[{"uid":"409cd899-65"}],"importedBy":[{"uid":"409cd899-56"}]},"409cd899-24":{"id":"/src/utils/equal.ts","moduleParts":{"index.cjs":"409cd899-25"},"imported":[],"importedBy":[{"uid":"409cd899-26"}]},"409cd899-26":{"id":"/src/hooks/useStableRef.ts","moduleParts":{"index.cjs":"409cd899-27"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-24"}],"importedBy":[{"uid":"409cd899-56"}]},"409cd899-28":{"id":"/src/hooks/useViewSchemas.ts","moduleParts":{"index.cjs":"409cd899-29"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-59"},{"uid":"409cd899-4"}],"importedBy":[{"uid":"409cd899-56"},{"uid":"409cd899-40"}]},"409cd899-30":{"id":"/src/hooks/useFormSelector.ts","moduleParts":{"index.cjs":"409cd899-31"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-4"}],"importedBy":[{"uid":"409cd899-56"}]},"409cd899-32":{"id":"/src/utils/validation.ts","moduleParts":{"index.cjs":"409cd899-33"},"imported":[],"importedBy":[{"uid":"409cd899-67"}]},"409cd899-34":{"id":"/src/utils/slot.ts","moduleParts":{"index.cjs":"409cd899-35"},"imported":[],"importedBy":[{"uid":"409cd899-67"}]},"409cd899-36":{"id":"/src/components/FormGroup/index.tsx","moduleParts":{"index.cjs":"409cd899-37"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-66"},{"uid":"409cd899-40"}],"importedBy":[{"uid":"409cd899-54"},{"uid":"409cd899-40"}]},"409cd899-38":{"id":"/src/components/FormItem/slot.tsx","moduleParts":{"index.cjs":"409cd899-39"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-67"}],"importedBy":[{"uid":"409cd899-40"}]},"409cd899-40":{"id":"/src/components/FormItem/index.tsx","moduleParts":{"index.cjs":"409cd899-41"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-59"},{"uid":"409cd899-66"},{"uid":"409cd899-56"},{"uid":"409cd899-28"},{"uid":"409cd899-67"},{"uid":"409cd899-36"},{"uid":"409cd899-38"}],"importedBy":[{"uid":"409cd899-54"},{"uid":"409cd899-50"},{"uid":"409cd899-36"},{"uid":"409cd899-48"}]},"409cd899-42":{"id":"/src/components/Button/index.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"index.cjs":"409cd899-43"},"imported":[{"uid":"409cd899-65"}],"importedBy":[{"uid":"409cd899-64"}]},"409cd899-44":{"id":"/src/components/Button/index.vue?vue&type=style&index=0&lang.css","moduleParts":{"index.cjs":"409cd899-45"},"imported":[],"importedBy":[{"uid":"409cd899-64"}]},"409cd899-46":{"id":"/src/utils/helpers.ts","moduleParts":{"index.cjs":"409cd899-47"},"imported":[{"uid":"409cd899-59"}],"importedBy":[{"uid":"409cd899-48"}]},"409cd899-48":{"id":"/src/form.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"index.cjs":"409cd899-49"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-59"},{"uid":"409cd899-74"},{"uid":"409cd899-40"},{"uid":"409cd899-58"},{"uid":"409cd899-56"},{"uid":"409cd899-46"},{"uid":"409cd899-0"}],"importedBy":[{"uid":"409cd899-71"}]},"409cd899-50":{"id":"/src/form.ts","moduleParts":{"index.cjs":"409cd899-51"},"imported":[{"uid":"409cd899-40"},{"uid":"409cd899-61"},{"uid":"409cd899-62"}],"importedBy":[{"uid":"409cd899-54"}]},"409cd899-52":{"id":"/src/hocs/withRemoteOptions.ts","moduleParts":{"index.cjs":"409cd899-53"},"imported":[{"uid":"409cd899-65"},{"uid":"409cd899-16"},{"uid":"409cd899-20"}],"importedBy":[{"uid":"409cd899-57"}]},"409cd899-54":{"id":"/src/index.ts","moduleParts":{"index.cjs":"409cd899-55"},"imported":[{"uid":"409cd899-0"},{"uid":"409cd899-50"},{"uid":"409cd899-6"},{"uid":"409cd899-8"},{"uid":"409cd899-56"},{"uid":"409cd899-57"},{"uid":"409cd899-58"},{"uid":"409cd899-40"},{"uid":"409cd899-36"},{"uid":"409cd899-59"},{"uid":"409cd899-60"}],"importedBy":[],"isEntry":true},"409cd899-56":{"id":"/src/hooks/index.ts","moduleParts":{},"imported":[{"uid":"409cd899-10"},{"uid":"409cd899-4"},{"uid":"409cd899-12"},{"uid":"409cd899-14"},{"uid":"409cd899-16"},{"uid":"409cd899-18"},{"uid":"409cd899-20"},{"uid":"409cd899-22"},{"uid":"409cd899-26"},{"uid":"409cd899-28"},{"uid":"409cd899-30"}],"importedBy":[{"uid":"409cd899-54"},{"uid":"409cd899-40"},{"uid":"409cd899-48"}]},"409cd899-57":{"id":"/src/hocs/index.ts","moduleParts":{},"imported":[{"uid":"409cd899-52"}],"importedBy":[{"uid":"409cd899-54"}]},"409cd899-58":{"id":"/src/components/Button/index.ts","moduleParts":{},"imported":[{"uid":"409cd899-64"}],"importedBy":[{"uid":"409cd899-54"},{"uid":"409cd899-48"}]},"409cd899-59":{"id":"@schemx/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-54"},{"uid":"409cd899-8"},{"uid":"409cd899-40"},{"uid":"409cd899-10"},{"uid":"409cd899-14"},{"uid":"409cd899-18"},{"uid":"409cd899-28"},{"uid":"409cd899-48"},{"uid":"409cd899-46"}],"isExternal":true},"409cd899-60":{"id":"/src/types/index.ts","moduleParts":{},"imported":[{"uid":"409cd899-68"},{"uid":"409cd899-69"},{"uid":"409cd899-70"}],"importedBy":[{"uid":"409cd899-54"}]},"409cd899-61":{"id":"/src/config/index.ts","moduleParts":{},"imported":[{"uid":"409cd899-2"}],"importedBy":[{"uid":"409cd899-50"},{"uid":"409cd899-10"}]},"409cd899-62":{"id":"/src/formRuntime.js","moduleParts":{},"imported":[{"uid":"409cd899-71"}],"importedBy":[{"uid":"409cd899-50"}]},"409cd899-63":{"id":"@schemx/core/adapter","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-6"},{"uid":"409cd899-4"}],"isExternal":true},"409cd899-64":{"id":"/src/components/Button/index.vue","moduleParts":{},"imported":[{"uid":"409cd899-42"},{"uid":"409cd899-44"}],"importedBy":[{"uid":"409cd899-58"}]},"409cd899-65":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-40"},{"uid":"409cd899-36"},{"uid":"409cd899-10"},{"uid":"409cd899-4"},{"uid":"409cd899-12"},{"uid":"409cd899-14"},{"uid":"409cd899-16"},{"uid":"409cd899-18"},{"uid":"409cd899-20"},{"uid":"409cd899-22"},{"uid":"409cd899-26"},{"uid":"409cd899-28"},{"uid":"409cd899-30"},{"uid":"409cd899-52"},{"uid":"409cd899-38"},{"uid":"409cd899-2"},{"uid":"409cd899-42"},{"uid":"409cd899-48"}],"isExternal":true},"409cd899-66":{"id":"classnames","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-40"},{"uid":"409cd899-36"}],"isExternal":true},"409cd899-67":{"id":"/src/utils/index.ts","moduleParts":{},"imported":[{"uid":"409cd899-72"},{"uid":"409cd899-32"},{"uid":"409cd899-34"},{"uid":"409cd899-73"}],"importedBy":[{"uid":"409cd899-40"},{"uid":"409cd899-38"}]},"409cd899-68":{"id":"/src/types/dictionary.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-60"}]},"409cd899-69":{"id":"/src/types/form.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-60"}]},"409cd899-70":{"id":"/src/types/field.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-60"}]},"409cd899-71":{"id":"/src/form.vue","moduleParts":{},"imported":[{"uid":"409cd899-48"}],"importedBy":[{"uid":"409cd899-62"}]},"409cd899-72":{"id":"/src/utils/dynamic.ts","moduleParts":{},"imported":[{"uid":"409cd899-74"}],"importedBy":[{"uid":"409cd899-67"}]},"409cd899-73":{"id":"/src/utils/diff.ts","moduleParts":{},"imported":[{"uid":"409cd899-75"}],"importedBy":[{"uid":"409cd899-67"}]},"409cd899-74":{"id":"es-toolkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-72"},{"uid":"409cd899-48"}],"isExternal":true},"409cd899-75":{"id":"es-toolkit/compat","moduleParts":{},"imported":[],"importedBy":[{"uid":"409cd899-73"}],"isExternal":true}},"env":{"rollup":"4.14.3"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
4932
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.cjs","children":[{"name":"src","children":[{"name":"styles/index.css","uid":"48c3f3fa-1"},{"name":"bridge","children":[{"uid":"48c3f3fa-3","name":"helpers.ts"},{"uid":"48c3f3fa-5","name":"fieldBridge.ts"},{"uid":"48c3f3fa-7","name":"formFacade.ts"},{"uid":"48c3f3fa-9","name":"formBridge.ts"}]},{"name":"config/appConfig.ts","uid":"48c3f3fa-11"},{"name":"utils","children":[{"uid":"48c3f3fa-13","name":"rendererProvider.ts"},{"uid":"48c3f3fa-15","name":"rulesProvider.ts"},{"uid":"48c3f3fa-31","name":"equal.ts"},{"uid":"48c3f3fa-39","name":"validation.ts"},{"uid":"48c3f3fa-41","name":"slot.ts"},{"uid":"48c3f3fa-53","name":"helpers.ts"}]},{"name":"hooks","children":[{"uid":"48c3f3fa-17","name":"useForm.ts"},{"uid":"48c3f3fa-19","name":"provideFormContext.ts"},{"uid":"48c3f3fa-21","name":"useField.ts"},{"uid":"48c3f3fa-23","name":"provideFieldContext.ts"},{"uid":"48c3f3fa-25","name":"useWatch.ts"},{"uid":"48c3f3fa-27","name":"useDictionary.ts"},{"uid":"48c3f3fa-29","name":"provideFormConfigContext.ts"},{"uid":"48c3f3fa-33","name":"useStableRef.ts"},{"uid":"48c3f3fa-35","name":"useViewSchemas.ts"},{"uid":"48c3f3fa-37","name":"useFormSelector.ts"}]},{"name":"components","children":[{"name":"FormGroup/index.tsx","uid":"48c3f3fa-43"},{"name":"FormItem","children":[{"uid":"48c3f3fa-45","name":"slot.tsx"},{"uid":"48c3f3fa-47","name":"index.tsx"}]},{"name":"Button","children":[{"uid":"48c3f3fa-49","name":"index.vue?vue&type=script&setup=true&lang.ts"},{"uid":"48c3f3fa-51","name":"index.vue?vue&type=style&index=0&lang.css"}]}]},{"uid":"48c3f3fa-55","name":"form.vue?vue&type=script&setup=true&lang.ts"},{"uid":"48c3f3fa-57","name":"form.ts"},{"name":"hocs/withRemoteOptions.ts","uid":"48c3f3fa-59"},{"uid":"48c3f3fa-61","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"48c3f3fa-1":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"48c3f3fa-0"},"48c3f3fa-3":{"renderedLength":221,"gzipLength":161,"brotliLength":119,"metaUid":"48c3f3fa-2"},"48c3f3fa-5":{"renderedLength":1253,"gzipLength":416,"brotliLength":362,"metaUid":"48c3f3fa-4"},"48c3f3fa-7":{"renderedLength":2380,"gzipLength":463,"brotliLength":393,"metaUid":"48c3f3fa-6"},"48c3f3fa-9":{"renderedLength":3540,"gzipLength":827,"brotliLength":751,"metaUid":"48c3f3fa-8"},"48c3f3fa-11":{"renderedLength":1317,"gzipLength":489,"brotliLength":422,"metaUid":"48c3f3fa-10"},"48c3f3fa-13":{"renderedLength":65,"gzipLength":72,"brotliLength":52,"metaUid":"48c3f3fa-12"},"48c3f3fa-15":{"renderedLength":67,"gzipLength":68,"brotliLength":53,"metaUid":"48c3f3fa-14"},"48c3f3fa-17":{"renderedLength":1079,"gzipLength":482,"brotliLength":400,"metaUid":"48c3f3fa-16"},"48c3f3fa-19":{"renderedLength":628,"gzipLength":340,"brotliLength":290,"metaUid":"48c3f3fa-18"},"48c3f3fa-21":{"renderedLength":1038,"gzipLength":344,"brotliLength":307,"metaUid":"48c3f3fa-20"},"48c3f3fa-23":{"renderedLength":410,"gzipLength":249,"brotliLength":198,"metaUid":"48c3f3fa-22"},"48c3f3fa-25":{"renderedLength":564,"gzipLength":229,"brotliLength":192,"metaUid":"48c3f3fa-24"},"48c3f3fa-27":{"renderedLength":2879,"gzipLength":953,"brotliLength":814,"metaUid":"48c3f3fa-26"},"48c3f3fa-29":{"renderedLength":483,"gzipLength":288,"brotliLength":239,"metaUid":"48c3f3fa-28"},"48c3f3fa-31":{"renderedLength":206,"gzipLength":156,"brotliLength":122,"metaUid":"48c3f3fa-30"},"48c3f3fa-33":{"renderedLength":240,"gzipLength":168,"brotliLength":143,"metaUid":"48c3f3fa-32"},"48c3f3fa-35":{"renderedLength":1781,"gzipLength":706,"brotliLength":590,"metaUid":"48c3f3fa-34"},"48c3f3fa-37":{"renderedLength":594,"gzipLength":306,"brotliLength":266,"metaUid":"48c3f3fa-36"},"48c3f3fa-39":{"renderedLength":788,"gzipLength":325,"brotliLength":267,"metaUid":"48c3f3fa-38"},"48c3f3fa-41":{"renderedLength":1278,"gzipLength":491,"brotliLength":404,"metaUid":"48c3f3fa-40"},"48c3f3fa-43":{"renderedLength":3726,"gzipLength":1330,"brotliLength":1126,"metaUid":"48c3f3fa-42"},"48c3f3fa-45":{"renderedLength":4194,"gzipLength":1528,"brotliLength":1268,"metaUid":"48c3f3fa-44"},"48c3f3fa-47":{"renderedLength":5674,"gzipLength":2071,"brotliLength":1707,"metaUid":"48c3f3fa-46"},"48c3f3fa-49":{"renderedLength":2486,"gzipLength":913,"brotliLength":789,"metaUid":"48c3f3fa-48"},"48c3f3fa-51":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"48c3f3fa-50"},"48c3f3fa-53":{"renderedLength":1052,"gzipLength":382,"brotliLength":332,"metaUid":"48c3f3fa-52"},"48c3f3fa-55":{"renderedLength":10221,"gzipLength":2767,"brotliLength":2328,"metaUid":"48c3f3fa-54"},"48c3f3fa-57":{"renderedLength":384,"gzipLength":269,"brotliLength":214,"metaUid":"48c3f3fa-56"},"48c3f3fa-59":{"renderedLength":1052,"gzipLength":455,"brotliLength":378,"metaUid":"48c3f3fa-58"},"48c3f3fa-61":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"48c3f3fa-60"}},"nodeMetas":{"48c3f3fa-0":{"id":"/src/styles/index.css","moduleParts":{"index.cjs":"48c3f3fa-1"},"imported":[],"importedBy":[{"uid":"48c3f3fa-60"},{"uid":"48c3f3fa-54"}]},"48c3f3fa-2":{"id":"/src/bridge/helpers.ts","moduleParts":{"index.cjs":"48c3f3fa-3"},"imported":[{"uid":"48c3f3fa-70"}],"importedBy":[{"uid":"48c3f3fa-8"},{"uid":"48c3f3fa-4"}]},"48c3f3fa-4":{"id":"/src/bridge/fieldBridge.ts","moduleParts":{"index.cjs":"48c3f3fa-5"},"imported":[{"uid":"48c3f3fa-2"}],"importedBy":[{"uid":"48c3f3fa-69"},{"uid":"48c3f3fa-8"}]},"48c3f3fa-6":{"id":"/src/bridge/formFacade.ts","moduleParts":{"index.cjs":"48c3f3fa-7"},"imported":[],"importedBy":[{"uid":"48c3f3fa-8"}]},"48c3f3fa-8":{"id":"/src/bridge/formBridge.ts","moduleParts":{"index.cjs":"48c3f3fa-9"},"imported":[{"uid":"48c3f3fa-68"},{"uid":"48c3f3fa-4"},{"uid":"48c3f3fa-6"},{"uid":"48c3f3fa-2"}],"importedBy":[{"uid":"48c3f3fa-69"}]},"48c3f3fa-10":{"id":"/src/config/appConfig.ts","moduleParts":{"index.cjs":"48c3f3fa-11"},"imported":[{"uid":"48c3f3fa-70"}],"importedBy":[{"uid":"48c3f3fa-66"}]},"48c3f3fa-12":{"id":"/src/utils/rendererProvider.ts","moduleParts":{"index.cjs":"48c3f3fa-13"},"imported":[{"uid":"48c3f3fa-68"}],"importedBy":[{"uid":"48c3f3fa-60"},{"uid":"48c3f3fa-16"}]},"48c3f3fa-14":{"id":"/src/utils/rulesProvider.ts","moduleParts":{"index.cjs":"48c3f3fa-15"},"imported":[{"uid":"48c3f3fa-64"}],"importedBy":[{"uid":"48c3f3fa-60"},{"uid":"48c3f3fa-16"}]},"48c3f3fa-16":{"id":"/src/hooks/useForm.ts","moduleParts":{"index.cjs":"48c3f3fa-17"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-64"},{"uid":"48c3f3fa-69"},{"uid":"48c3f3fa-66"},{"uid":"48c3f3fa-12"},{"uid":"48c3f3fa-14"}],"importedBy":[{"uid":"48c3f3fa-62"}]},"48c3f3fa-18":{"id":"/src/hooks/provideFormContext.ts","moduleParts":{"index.cjs":"48c3f3fa-19"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-69"}],"importedBy":[{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-20"},{"uid":"48c3f3fa-24"},{"uid":"48c3f3fa-26"}]},"48c3f3fa-20":{"id":"/src/hooks/useField.ts","moduleParts":{"index.cjs":"48c3f3fa-21"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-64"},{"uid":"48c3f3fa-69"},{"uid":"48c3f3fa-18"}],"importedBy":[{"uid":"48c3f3fa-62"}]},"48c3f3fa-22":{"id":"/src/hooks/provideFieldContext.ts","moduleParts":{"index.cjs":"48c3f3fa-23"},"imported":[{"uid":"48c3f3fa-70"}],"importedBy":[{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-58"}]},"48c3f3fa-24":{"id":"/src/hooks/useWatch.ts","moduleParts":{"index.cjs":"48c3f3fa-25"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-64"},{"uid":"48c3f3fa-69"},{"uid":"48c3f3fa-18"}],"importedBy":[{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-26"}]},"48c3f3fa-26":{"id":"/src/hooks/useDictionary.ts","moduleParts":{"index.cjs":"48c3f3fa-27"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-18"},{"uid":"48c3f3fa-24"}],"importedBy":[{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-58"}]},"48c3f3fa-28":{"id":"/src/hooks/provideFormConfigContext.ts","moduleParts":{"index.cjs":"48c3f3fa-29"},"imported":[{"uid":"48c3f3fa-70"}],"importedBy":[{"uid":"48c3f3fa-62"}]},"48c3f3fa-30":{"id":"/src/utils/equal.ts","moduleParts":{"index.cjs":"48c3f3fa-31"},"imported":[],"importedBy":[{"uid":"48c3f3fa-32"}]},"48c3f3fa-32":{"id":"/src/hooks/useStableRef.ts","moduleParts":{"index.cjs":"48c3f3fa-33"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-30"}],"importedBy":[{"uid":"48c3f3fa-62"}]},"48c3f3fa-34":{"id":"/src/hooks/useViewSchemas.ts","moduleParts":{"index.cjs":"48c3f3fa-35"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-64"},{"uid":"48c3f3fa-69"}],"importedBy":[{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-46"}]},"48c3f3fa-36":{"id":"/src/hooks/useFormSelector.ts","moduleParts":{"index.cjs":"48c3f3fa-37"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-69"}],"importedBy":[{"uid":"48c3f3fa-62"}]},"48c3f3fa-38":{"id":"/src/utils/validation.ts","moduleParts":{"index.cjs":"48c3f3fa-39"},"imported":[],"importedBy":[{"uid":"48c3f3fa-72"}]},"48c3f3fa-40":{"id":"/src/utils/slot.ts","moduleParts":{"index.cjs":"48c3f3fa-41"},"imported":[],"importedBy":[{"uid":"48c3f3fa-72"}]},"48c3f3fa-42":{"id":"/src/components/FormGroup/index.tsx","moduleParts":{"index.cjs":"48c3f3fa-43"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-71"},{"uid":"48c3f3fa-46"}],"importedBy":[{"uid":"48c3f3fa-60"},{"uid":"48c3f3fa-46"}]},"48c3f3fa-44":{"id":"/src/components/FormItem/slot.tsx","moduleParts":{"index.cjs":"48c3f3fa-45"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-72"}],"importedBy":[{"uid":"48c3f3fa-46"}]},"48c3f3fa-46":{"id":"/src/components/FormItem/index.tsx","moduleParts":{"index.cjs":"48c3f3fa-47"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-64"},{"uid":"48c3f3fa-71"},{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-34"},{"uid":"48c3f3fa-72"},{"uid":"48c3f3fa-42"},{"uid":"48c3f3fa-44"}],"importedBy":[{"uid":"48c3f3fa-60"},{"uid":"48c3f3fa-56"},{"uid":"48c3f3fa-42"},{"uid":"48c3f3fa-54"}]},"48c3f3fa-48":{"id":"/src/components/Button/index.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"index.cjs":"48c3f3fa-49"},"imported":[{"uid":"48c3f3fa-70"}],"importedBy":[{"uid":"48c3f3fa-82"}]},"48c3f3fa-50":{"id":"/src/components/Button/index.vue?vue&type=style&index=0&lang.css","moduleParts":{"index.cjs":"48c3f3fa-51"},"imported":[],"importedBy":[{"uid":"48c3f3fa-82"}]},"48c3f3fa-52":{"id":"/src/utils/helpers.ts","moduleParts":{"index.cjs":"48c3f3fa-53"},"imported":[{"uid":"48c3f3fa-64"}],"importedBy":[{"uid":"48c3f3fa-54"}]},"48c3f3fa-54":{"id":"/src/form.vue?vue&type=script&setup=true&lang.ts","moduleParts":{"index.cjs":"48c3f3fa-55"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-64"},{"uid":"48c3f3fa-79"},{"uid":"48c3f3fa-81"},{"uid":"48c3f3fa-46"},{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-52"},{"uid":"48c3f3fa-0"}],"importedBy":[{"uid":"48c3f3fa-76"}]},"48c3f3fa-56":{"id":"/src/form.ts","moduleParts":{"index.cjs":"48c3f3fa-57"},"imported":[{"uid":"48c3f3fa-46"},{"uid":"48c3f3fa-66"},{"uid":"48c3f3fa-67"}],"importedBy":[{"uid":"48c3f3fa-60"}]},"48c3f3fa-58":{"id":"/src/hocs/withRemoteOptions.ts","moduleParts":{"index.cjs":"48c3f3fa-59"},"imported":[{"uid":"48c3f3fa-70"},{"uid":"48c3f3fa-22"},{"uid":"48c3f3fa-26"}],"importedBy":[{"uid":"48c3f3fa-63"}]},"48c3f3fa-60":{"id":"/src/index.ts","moduleParts":{"index.cjs":"48c3f3fa-61"},"imported":[{"uid":"48c3f3fa-0"},{"uid":"48c3f3fa-56"},{"uid":"48c3f3fa-12"},{"uid":"48c3f3fa-14"},{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-63"},{"uid":"48c3f3fa-46"},{"uid":"48c3f3fa-42"},{"uid":"48c3f3fa-64"},{"uid":"48c3f3fa-65"}],"importedBy":[],"isEntry":true},"48c3f3fa-62":{"id":"/src/hooks/index.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-16"},{"uid":"48c3f3fa-69"},{"uid":"48c3f3fa-18"},{"uid":"48c3f3fa-20"},{"uid":"48c3f3fa-22"},{"uid":"48c3f3fa-24"},{"uid":"48c3f3fa-26"},{"uid":"48c3f3fa-28"},{"uid":"48c3f3fa-32"},{"uid":"48c3f3fa-34"},{"uid":"48c3f3fa-36"}],"importedBy":[{"uid":"48c3f3fa-60"},{"uid":"48c3f3fa-46"},{"uid":"48c3f3fa-54"}]},"48c3f3fa-63":{"id":"/src/hocs/index.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-58"}],"importedBy":[{"uid":"48c3f3fa-60"}]},"48c3f3fa-64":{"id":"@schemx/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-60"},{"uid":"48c3f3fa-14"},{"uid":"48c3f3fa-46"},{"uid":"48c3f3fa-16"},{"uid":"48c3f3fa-20"},{"uid":"48c3f3fa-24"},{"uid":"48c3f3fa-34"},{"uid":"48c3f3fa-54"},{"uid":"48c3f3fa-52"}],"isExternal":true},"48c3f3fa-65":{"id":"/src/types/index.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-73"},{"uid":"48c3f3fa-74"},{"uid":"48c3f3fa-75"}],"importedBy":[{"uid":"48c3f3fa-60"}]},"48c3f3fa-66":{"id":"/src/config/index.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-10"}],"importedBy":[{"uid":"48c3f3fa-56"},{"uid":"48c3f3fa-16"}]},"48c3f3fa-67":{"id":"/src/formRuntime.js","moduleParts":{},"imported":[{"uid":"48c3f3fa-76"}],"importedBy":[{"uid":"48c3f3fa-56"}]},"48c3f3fa-68":{"id":"@schemx/core/adapter","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-12"},{"uid":"48c3f3fa-8"}],"isExternal":true},"48c3f3fa-69":{"id":"/src/bridge/index.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-8"},{"uid":"48c3f3fa-4"}],"importedBy":[{"uid":"48c3f3fa-62"},{"uid":"48c3f3fa-16"},{"uid":"48c3f3fa-18"},{"uid":"48c3f3fa-20"},{"uid":"48c3f3fa-24"},{"uid":"48c3f3fa-34"},{"uid":"48c3f3fa-36"}]},"48c3f3fa-70":{"id":"vue","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-46"},{"uid":"48c3f3fa-42"},{"uid":"48c3f3fa-16"},{"uid":"48c3f3fa-18"},{"uid":"48c3f3fa-20"},{"uid":"48c3f3fa-22"},{"uid":"48c3f3fa-24"},{"uid":"48c3f3fa-26"},{"uid":"48c3f3fa-28"},{"uid":"48c3f3fa-32"},{"uid":"48c3f3fa-34"},{"uid":"48c3f3fa-36"},{"uid":"48c3f3fa-58"},{"uid":"48c3f3fa-44"},{"uid":"48c3f3fa-10"},{"uid":"48c3f3fa-54"},{"uid":"48c3f3fa-2"},{"uid":"48c3f3fa-48"}],"isExternal":true},"48c3f3fa-71":{"id":"classnames","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-46"},{"uid":"48c3f3fa-42"}],"isExternal":true},"48c3f3fa-72":{"id":"/src/utils/index.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-77"},{"uid":"48c3f3fa-38"},{"uid":"48c3f3fa-40"},{"uid":"48c3f3fa-78"}],"importedBy":[{"uid":"48c3f3fa-46"},{"uid":"48c3f3fa-44"}]},"48c3f3fa-73":{"id":"/src/types/dictionary.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-65"}]},"48c3f3fa-74":{"id":"/src/types/form.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-65"}]},"48c3f3fa-75":{"id":"/src/types/field.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-65"}]},"48c3f3fa-76":{"id":"/src/form.vue","moduleParts":{},"imported":[{"uid":"48c3f3fa-54"}],"importedBy":[{"uid":"48c3f3fa-67"}]},"48c3f3fa-77":{"id":"/src/utils/dynamic.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-79"}],"importedBy":[{"uid":"48c3f3fa-72"}]},"48c3f3fa-78":{"id":"/src/utils/diff.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-80"}],"importedBy":[{"uid":"48c3f3fa-72"}]},"48c3f3fa-79":{"id":"es-toolkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-77"},{"uid":"48c3f3fa-54"}],"isExternal":true},"48c3f3fa-80":{"id":"es-toolkit/compat","moduleParts":{},"imported":[],"importedBy":[{"uid":"48c3f3fa-78"}],"isExternal":true},"48c3f3fa-81":{"id":"/src/components/Button/index.ts","moduleParts":{},"imported":[{"uid":"48c3f3fa-82"}],"importedBy":[{"uid":"48c3f3fa-54"}]},"48c3f3fa-82":{"id":"/src/components/Button/index.vue","moduleParts":{},"imported":[{"uid":"48c3f3fa-48"},{"uid":"48c3f3fa-50"}],"importedBy":[{"uid":"48c3f3fa-81"}]}},"env":{"rollup":"4.14.3"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
4933
4933
 
4934
4934
  const run = () => {
4935
4935
  const width = window.innerWidth;
@@ -0,0 +1,23 @@
1
+ import { VueFieldBridge, VueFormBridge } from './types';
2
+ import { NamePath, Values } from '@schemx/core';
3
+ /**
4
+ * 获取一个字段的共享 Vue Ref 投影。
5
+ *
6
+ * 字段 Bridge 以 Core `FieldSnapshotSource` 的对象身份缓存,因此同一 Form
7
+ * 中对同一规范化字段路径的多次读取会复用同一组 Ref。
8
+ *
9
+ * @typeParam TValues - Form 的值类型。
10
+ * @typeParam TName - 字段路径类型。
11
+ * @param bridge - 所属 Form Bridge。
12
+ * @param name - 字段路径。
13
+ * @returns 对应字段的共享 Vue Bridge。
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const bridge = getVueFormBridge(form)
18
+ * const field = getVueFieldBridge(bridge, "email")
19
+ * watchEffect(() => console.log(field.value.value))
20
+ * ```
21
+ */
22
+ export declare function getVueFieldBridge<TValues extends Values = Values, TName extends NamePath<TValues> = NamePath<TValues>>(bridge: VueFormBridge<TValues>, name: TName): VueFieldBridge<TValues, TName>;
23
+ //# sourceMappingURL=fieldBridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldBridge.d.ts","sourceRoot":"","sources":["../../src/bridge/fieldBridge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAyB,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACnF,OAAO,KAAK,EAAc,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,KAAK,SAAS,QAAQ,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,EACnD,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAmE7E"}
@@ -0,0 +1,81 @@
1
+ import { VueFormBridge, VueSchemxInstance } from './types';
2
+ import { SchemxInstance, Values } from '@schemx/core';
3
+ /**
4
+ * 返回原始 Core Form;普通 Core Form 输入时保持引用不变。
5
+ *
6
+ * @param form - Core Form 或 Vue Facade。
7
+ * @returns 原始 Core Form。
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const coreForm = getCoreForm(form)
12
+ * const snapshot = coreForm.getFieldsSnapshot()
13
+ * ```
14
+ */
15
+ export declare function getCoreForm<TValues extends Values = Values>(form: SchemxInstance<TValues> | VueSchemxInstance<TValues>): SchemxInstance<TValues>;
16
+ /**
17
+ * 获取指定 Form 的共享 Vue Bridge。
18
+ *
19
+ * @param form - Core Form 或 Vue Facade。
20
+ * @returns 对应的共享 Bridge。
21
+ *
22
+ * @remarks
23
+ * 首次调用会创建 SnapshotSource 订阅;调用方应使用
24
+ * `retainVueFormBridge()` 持有 Bridge,并在 owner 销毁时释放。
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const bridge = getVueFormBridge(form)
29
+ * const release = retainVueFormBridge(bridge)
30
+ * onScopeDispose(release)
31
+ * ```
32
+ */
33
+ export declare function getVueFormBridge<TValues extends Values = Values>(form: SchemxInstance<TValues> | VueSchemxInstance<TValues>): VueFormBridge<TValues>;
34
+ /**
35
+ * 获取指定 Form 的唯一 Vue Facade。
36
+ *
37
+ * @param form - Core Form 或已有 Vue Facade。
38
+ * @returns 可被 Vue effect 追踪的 Facade。
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const reactiveForm = getVueFormFacade(form)
43
+ * watchEffect(() => {
44
+ * console.log(reactiveForm.getFieldsValue())
45
+ * })
46
+ * ```
47
+ */
48
+ export declare function getVueFormFacade<TValues extends Values = Values>(form: SchemxInstance<TValues> | VueSchemxInstance<TValues>): VueSchemxInstance<TValues>;
49
+ /**
50
+ * 为一个 Vue owner 保留 Bridge,并返回对应的幂等释放函数。
51
+ *
52
+ * @param bridge - 要保留的共享 Bridge。
53
+ * @returns 释放当前 owner 的函数。
54
+ *
55
+ * @remarks
56
+ * 返回的释放函数可安全重复调用;最后一个 owner 释放后,Bridge 会自动销毁。
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const bridge = getVueFormBridge(form)
61
+ * const release = retainVueFormBridge(bridge)
62
+ * onScopeDispose(release)
63
+ * ```
64
+ */
65
+ export declare function retainVueFormBridge<TValues extends Values>(bridge: VueFormBridge<TValues>): () => void;
66
+ /**
67
+ * 销毁共享 Bridge、全部字段订阅与 Core 状态适配器。
68
+ *
69
+ * @param bridge - 要销毁的共享 Form Bridge。
70
+ *
71
+ * @remarks
72
+ * 销毁后 Bridge、字段 Ref 投影和状态适配器均不可继续使用;通常由
73
+ * `retainVueFormBridge()` 返回的最后一个释放函数自动触发。
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * disposeVueFormBridge(bridge)
78
+ * ```
79
+ */
80
+ export declare function disposeVueFormBridge<TValues extends Values>(bridge: VueFormBridge<TValues>): void;
81
+ //# sourceMappingURL=formBridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formBridge.d.ts","sourceRoot":"","sources":["../../src/bridge/formBridge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAGV,aAAa,EACb,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAY,cAAc,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAiBpE;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EACzD,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,GACzD,cAAc,CAAC,OAAO,CAAC,CAIzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC9D,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,GACzD,aAAa,CAAC,OAAO,CAAC,CAcxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC9D,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,GACzD,iBAAiB,CAAC,OAAO,CAAC,CAwB5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,MAAM,EACxD,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,GAC7B,MAAM,IAAI,CAqBZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,MAAM,EACzD,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,GAC7B,IAAI,CAgBN"}
@@ -0,0 +1,65 @@
1
+ import { VueFieldBridge, VueFormBridge, VueSchemxInstance } from './types';
2
+ import { NamePath, SchemxInstance, Values } from '@schemx/core';
3
+ /**
4
+ * 创建 Facade 所需的 Bridge 生命周期操作。
5
+ *
6
+ * @internal
7
+ * @typeParam TValues - Form 的值类型。
8
+ */
9
+ export interface VueFormFacadeDependencies<TValues extends Values> {
10
+ /**
11
+ * 获取指定 Form 的共享 Bridge。
12
+ *
13
+ * @param form - 要获取 Bridge 的 Core Form。
14
+ * @returns 对应的共享 Form Bridge。
15
+ */
16
+ getFormBridge(form: SchemxInstance<TValues>): VueFormBridge<TValues>;
17
+ /**
18
+ * 获取指定字段的共享 Bridge。
19
+ *
20
+ * @param bridge - 所属 Form Bridge。
21
+ * @param name - 字段路径。
22
+ * @returns 对应字段的 Vue Bridge。
23
+ */
24
+ getFieldBridge<TName extends NamePath<TValues>>(bridge: VueFormBridge<TValues>, name: TName): VueFieldBridge<TValues, TName>;
25
+ /**
26
+ * 查找已创建的 Form Bridge,但不因销毁动作创建新 Bridge。
27
+ *
28
+ * @param form - 要查找的 Core Form。
29
+ * @returns 已缓存的 Bridge;不存在时返回 `undefined`。
30
+ */
31
+ getCachedFormBridge(form: SchemxInstance<TValues>): VueFormBridge<TValues> | undefined;
32
+ /**
33
+ * 销毁指定的共享 Form Bridge。
34
+ *
35
+ * @param bridge - 要销毁的 Form Bridge。
36
+ */
37
+ disposeFormBridge(bridge: VueFormBridge<TValues>): void;
38
+ }
39
+ /**
40
+ * 为 Core Form 创建保持完整 API 的 Vue Facade。
41
+ *
42
+ * Facade 将字段和聚合状态读取转发给 Core,并在读取期间访问 Vue Ref,
43
+ * 从而让当前 Vue effect 建立对应的响应式依赖。
44
+ *
45
+ * @typeParam TValues - Form 的值类型。
46
+ * @param form - 要包装的原始 Core Form。
47
+ * @param dependencies - 提供 Bridge 获取、字段读取和销毁能力的运行时依赖。
48
+ * @param dependencies.getFormBridge - 获取共享 Form Bridge。
49
+ * @param dependencies.getFieldBridge - 获取共享字段 Bridge。
50
+ * @param dependencies.getCachedFormBridge - 查找已缓存的 Form Bridge。
51
+ * @param dependencies.disposeFormBridge - 销毁共享 Form Bridge。
52
+ * @returns 可被 Vue effect 追踪的 Facade。
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const facade = createVueFormFacade(form, {
57
+ * getFormBridge,
58
+ * getFieldBridge,
59
+ * getCachedFormBridge,
60
+ * disposeFormBridge,
61
+ * })
62
+ * ```
63
+ */
64
+ export declare function createVueFormFacade<TValues extends Values>(form: SchemxInstance<TValues>, dependencies: VueFormFacadeDependencies<TValues>): VueSchemxInstance<TValues>;
65
+ //# sourceMappingURL=formFacade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formFacade.d.ts","sourceRoot":"","sources":["../../src/bridge/formFacade.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB,CAAC,OAAO,SAAS,MAAM;IAC/D;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IACpE;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,SAAS,QAAQ,CAAC,OAAO,CAAC,EAC5C,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAC9B,IAAI,EAAE,KAAK,GACV,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACjC;;;;;OAKG;IACH,mBAAmB,CAAC,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,CAAA;IACtF;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,MAAM,EACxD,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,EAC7B,YAAY,EAAE,yBAAyB,CAAC,OAAO,CAAC,GAC/C,iBAAiB,CAAC,OAAO,CAAC,CA0J5B"}
@@ -0,0 +1,31 @@
1
+ import { ShallowRef } from 'vue';
2
+ /**
3
+ * 创建类型为 `ShallowRef` 的 Vue 浅层 Ref。
4
+ *
5
+ * 运行时直接委托 Vue 的 `shallowRef`,类型断言用于保留当前 Bridge 对快照引用的控制。
6
+ *
7
+ * @typeParam TValue - Ref 中保存的值类型。
8
+ * @param value - 要包装为 shallow Ref 的当前值。
9
+ * @returns 包装后的 shallow Ref。
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const ready = createVueShallowRef(false)
14
+ * ready.value = true
15
+ * ```
16
+ */
17
+ export declare function createVueShallowRef<TValue>(value: TValue): ShallowRef<TValue>;
18
+ /**
19
+ * 比较两份错误消息列表,避免无变化时写入 Vue Ref。
20
+ *
21
+ * @param previous - 当前 Ref 中保存的错误消息列表。
22
+ * @param next - SnapshotSource 返回的最新错误消息列表。
23
+ * @returns 两个列表的长度和每一项都相同时返回 `true`。
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const changed = !areStringListsEqual(previous, next)
28
+ * ```
29
+ */
30
+ export declare function areStringListsEqual(previous: readonly string[], next: readonly string[]): boolean;
31
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/bridge/helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAErC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAE7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,OAAO,CAKT"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Vue Bridge 的内部统一入口。
3
+ *
4
+ * 该目录消费 Core 的 `FormStateAdapter`,并将快照同步为 Vue Ref 与 Facade。
5
+ *
6
+ * @module vue/bridge
7
+ */
8
+ export { disposeVueFormBridge, getCoreForm, getVueFormBridge, getVueFormFacade, retainVueFormBridge, } from './formBridge';
9
+ export { getVueFieldBridge } from './fieldBridge';
10
+ export type { VueFieldBridge, VueFormBridge, VueSchemxInstance } from './types';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bridge/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA"}