@schemx/vue 0.1.22 → 0.2.1

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 (40) hide show
  1. package/README.md +37 -16
  2. package/dist/analyze.html +4949 -0
  3. package/dist/components/FormGroup/index.d.ts +1 -1
  4. package/dist/components/FormItem/index.d.ts +13 -6
  5. package/dist/components/FormItem/index.d.ts.map +1 -1
  6. package/dist/hocs/withRemoteOptions.d.ts +2 -2
  7. package/dist/hooks/index.d.ts +8 -4
  8. package/dist/hooks/index.d.ts.map +1 -1
  9. package/dist/hooks/provideFieldContext.d.ts +41 -0
  10. package/dist/hooks/provideFieldContext.d.ts.map +1 -0
  11. package/dist/hooks/provideFormConfigContext.d.ts +59 -0
  12. package/dist/hooks/provideFormConfigContext.d.ts.map +1 -0
  13. package/dist/hooks/provideFormContext.d.ts +57 -0
  14. package/dist/hooks/provideFormContext.d.ts.map +1 -0
  15. package/dist/hooks/useDictionary.d.ts +1 -1
  16. package/dist/hooks/useDictionary.d.ts.map +1 -1
  17. package/dist/hooks/useEffect.d.ts +1 -1
  18. package/dist/hooks/useField.d.ts +1 -32
  19. package/dist/hooks/useField.d.ts.map +1 -1
  20. package/dist/hooks/useForm.d.ts +30 -32
  21. package/dist/hooks/useForm.d.ts.map +1 -1
  22. package/dist/hooks/useViewSchemas.d.ts +1 -1
  23. package/dist/hooks/useWatch.d.ts +1 -1
  24. package/dist/index.cjs +1 -6
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.ts +2 -4
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.mjs +208 -6311
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/types/dictionary.d.ts +1 -1
  31. package/dist/types/field.d.ts +1 -1
  32. package/dist/types/form.d.ts +1 -1
  33. package/dist/utils/dynamic.d.ts +1 -1
  34. package/dist/utils/helpers.d.ts +1 -1
  35. package/dist/utils/rendererProvider.d.ts +1 -1
  36. package/dist/utils/rulesProvider.d.ts +1 -1
  37. package/dist/utils/validation.d.ts +1 -1
  38. package/package.json +12 -8
  39. package/dist/hooks/useContext.d.ts +0 -52
  40. package/dist/hooks/useContext.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { NamePath, SchemxInstance, Values } from '../../../core/src/index.ts';
1
+ import { NamePath, SchemxInstance, Values } from '@schemx/core';
2
2
 
3
3
  /**
4
4
  * 字典选项配置
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- import { FieldValue, NamePath, SchemxFieldInstance, Values } from '../../../core/src/index.ts';
2
+ import { FieldValue, NamePath, SchemxFieldInstance, Values } from '@schemx/core';
3
3
 
4
4
  /**
5
5
  * Vue 层字段控制器实例
@@ -1,4 +1,4 @@
1
- import { SchemxProps, Values } from '../../../core/src/index.ts';
1
+ import { SchemxProps, Values } from '@schemx/core';
2
2
  import * as CSS from "csstype";
3
3
  /**
4
4
  * schemx 组件 Props
@@ -1,4 +1,4 @@
1
- import { Dynamic, Values } from '../../../core/src/index.ts';
1
+ import { Dynamic, Values } from '@schemx/core';
2
2
 
3
3
  /**
4
4
  * 批量解析的单个属性条目
@@ -1,4 +1,4 @@
1
- import { SchemxViewSchema } from '../../../core/src/index.ts';
1
+ import { SchemxViewSchema } from '@schemx/core';
2
2
 
3
3
  /**
4
4
  * 判断当前项是否为顶层可见普通字段中的第一个或最后一个。
@@ -1,4 +1,4 @@
1
- import { RendererRegistryType, SchemxRendererKey } from '../../../core/src/index.ts';
1
+ import { RendererRegistryType, SchemxRendererKey } from '@schemx/core';
2
2
 
3
3
  /**
4
4
  * 全局渲染器注册实例
@@ -1,4 +1,4 @@
1
- import { ValidatorsRegistryType } from '../../../core/src/index.ts';
1
+ import { ValidatorsRegistryType } from '@schemx/core';
2
2
 
3
3
  /**
4
4
  * 全局校验规则注册实例
@@ -1,4 +1,4 @@
1
- import { ValidationTrigger } from '../../../core/src/index.ts';
1
+ import { ValidationTrigger } from '@schemx/core';
2
2
 
3
3
  /** 触发时机类型(支持单个或数组) */
4
4
  export type TriggerConfig = ValidationTrigger | ValidationTrigger[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@schemx/vue",
4
- "version": "0.1.22",
4
+ "version": "0.2.1",
5
5
  "description": "基于 JSON Schema 配置的 Vue 3 动态表单引擎(UI 无关核心)",
6
6
  "keywords": [
7
7
  "schemx",
@@ -47,26 +47,30 @@
47
47
  "**/index.ts"
48
48
  ],
49
49
  "peerDependencies": {
50
- "vue": "^3.0.0"
50
+ "vue": "^3.0.0",
51
+ "@schemx/core": "0.2.1"
51
52
  },
52
53
  "dependencies": {
53
54
  "classnames": "^2.5.1",
54
55
  "csstype": "^3.2.3",
55
- "dayjs": "^1.11.19",
56
- "es-toolkit": "^1.47.0",
57
- "@schemx/core": "0.1.24"
56
+ "es-toolkit": "^1.47.0"
58
57
  },
59
58
  "license": "MIT",
60
59
  "devDependencies": {
61
60
  "@vue/test-utils": "^2.4.6",
62
61
  "vue": "^3.4.0",
63
- "zod": "^4.3.6"
62
+ "zod": "^4.3.6",
63
+ "@schemx/core": "0.2.1"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "vite build",
67
- "build:analyze": "ANALYZE=true vite build",
67
+ "build:analyze": "vite build",
68
68
  "test": "vitest run",
69
69
  "lint": "eslint \"src/**/*.{ts,tsx,vue,js,jsx}\"",
70
- "type-check": "tsc -p tsconfig.json --noEmit"
70
+ "lint:fix": "eslint \"src/**/*.{ts,tsx,vue,js,jsx}\" --fix",
71
+ "format": "prettier --write \"src/**/*.{ts,tsx,vue,js,jsx,json,css,scss}\"",
72
+ "format:check": "prettier --check \"src/**/*.{ts,tsx,vue,js,jsx,json,css,scss}\"",
73
+ "type-check": "tsc -p tsconfig.json --noEmit",
74
+ "check": "pnpm run lint && pnpm run format:check && pnpm run type-check"
71
75
  }
72
76
  }
@@ -1,52 +0,0 @@
1
- import { SchemxFormProps } from '../types';
2
- import { Values } from '../../../core/src/index.ts';
3
-
4
- /** FormContext 注入 key */
5
- export declare const FORM_CONTEXT_KEY: unique symbol;
6
- /**
7
- * 表单上下文属性
8
- *
9
- * 由 schemx 组件注入,包含表单级别的全局配置。
10
- *
11
- * @typeParam T - 表单值类型
12
- */
13
- export interface FormContextProps<T extends Values = Values> extends Omit<SchemxFormProps<T>, "form" | "modelValue" | "rendererRegistry" | "defaultRendererType" | "rulesRegistery" | "onFinish" | "onFinishFailed" | "onValuesChange" | "onFieldsChange"> {
14
- }
15
- /**
16
- * 创建并注入表单上下文
17
- *
18
- * 在 schemx 的 setup 中调用,将表单级别配置注入到子组件树中。
19
- *
20
- * @typeParam T - 表单值类型
21
- * @param props - 表单上下文属性
22
- */
23
- export declare const createConfigContext: <T extends Values = Values>(props: FormContextProps<T>) => void;
24
- /**
25
- * @deprecated
26
- *
27
- * 已弃用,请使用 **createConfigContext**
28
- */
29
- export declare const createContext: <T extends Values = Values>(props: FormContextProps<T>) => void;
30
- /**
31
- * 获取表单上下文配置
32
- *
33
- * 在子组件中获取 schemx 注入的全局配置(readonly、disabled、labelAlign 等)。
34
- *
35
- * @returns 表单上下文属性
36
- *
37
- * @throws Error 如果不在 schemx 提供的上下文中调用
38
- *
39
- * @example
40
- * ```ts
41
- * const context = useConfigContext()
42
- * console.log(context.readonly, context.disabled)
43
- * ```
44
- */
45
- export declare function useConfigContext(): FormContextProps;
46
- /**
47
- * @deprecated
48
- *
49
- * 已弃用,请使用 **useConfigContext**
50
- */
51
- export declare const useContext: typeof useConfigContext;
52
- //# sourceMappingURL=useContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,yBAAyB;AACzB,eAAO,MAAM,gBAAgB,eAAwB,CAAA;AAErD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,IAAI,CACvE,eAAe,CAAC,CAAC,CAAC,EAChB,MAAM,GACN,YAAY,GACZ,kBAAkB,GAClB,qBAAqB,GACrB,gBAAgB,GAChB,UAAU,GACV,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,CACnB;CAAG;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,MAAM,GAAG,MAAM,EAC3D,OAAO,gBAAgB,CAAC,CAAC,CAAC,SAG3B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAXU,CAAC,SAAS,MAAM,kBAC3C,gBAAgB,CAAC,CAAC,CAAC,SAUoB,CAAA;AAEhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,IAAI,gBAAgB,CAQnD;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,yBAAmB,CAAA"}