@antsoo-lib/core 2.0.5 → 3.0.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 (43) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/core.css +1 -1
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.js +6 -5
  5. package/dist/types/BaseSearch/index.d.ts +1 -1
  6. package/dist/types/BaseTable/index.d.ts +4 -480
  7. package/dist/types/Form/CoreForm.d.ts +82 -0
  8. package/dist/types/SSelectPage/index.d.ts +102 -0
  9. package/package.json +5 -5
  10. package/src/BaseSearch/index.vue +371 -371
  11. package/src/BaseTable/index.vue +910 -910
  12. package/src/Form/CoreForm.vue +782 -782
  13. package/src/Form/types.ts +86 -86
  14. package/src/SSelectPage/index.vue +607 -607
  15. package/src/index.ts +17 -17
  16. package/src/render/AreaCascader.tsx +64 -64
  17. package/src/render/AutoComplete.tsx +101 -101
  18. package/src/render/Button.tsx +62 -62
  19. package/src/render/Cascader.tsx +45 -45
  20. package/src/render/Checkbox.tsx +65 -65
  21. package/src/render/CheckboxGroup.tsx +57 -57
  22. package/src/render/Custom.tsx +19 -19
  23. package/src/render/DatePicker.tsx +83 -83
  24. package/src/render/Input.tsx +140 -140
  25. package/src/render/InputGroup.tsx +115 -115
  26. package/src/render/InputNumber.tsx +205 -205
  27. package/src/render/InputPassword.tsx +81 -81
  28. package/src/render/InputRange.tsx +154 -154
  29. package/src/render/RadioGroup.tsx +63 -63
  30. package/src/render/Select.tsx +96 -96
  31. package/src/render/SselectPage.tsx +107 -107
  32. package/src/render/Switch.tsx +60 -60
  33. package/src/render/Tree.tsx +136 -136
  34. package/src/render/TreeSelect.tsx +81 -81
  35. package/src/render/Upload.tsx +91 -91
  36. package/src/render/helper.tsx +221 -221
  37. package/src/render/index.ts +108 -108
  38. package/src/render/registry.ts +20 -20
  39. package/src/render/state.ts +37 -37
  40. package/src/render/types.ts +567 -567
  41. package/src/utils/attrMapping.ts +106 -106
  42. package/vite.config.ts +61 -61
  43. package/.turbo/turbo-build.log +0 -40
@@ -1,20 +1,20 @@
1
- import type { Component } from 'vue'
2
-
3
- // 外部组件注册表
4
- const componentRegistry: Record<string, Component> = {}
5
-
6
- // 注册外部组件
7
- export function registerBaseTableComponents(components: {
8
- SselectPage?: Component
9
- AutoComplete?: Component
10
- Cascader?: Component
11
- AreaCascader?: Component
12
- Upload?: Component
13
- }) {
14
- Object.assign(componentRegistry, components)
15
- }
16
-
17
- // 获取注册的组件,如果未注册则返回 undefined
18
- export function getRegisteredComponent(name: string): Component | undefined {
19
- return componentRegistry[name]
20
- }
1
+ import type { Component } from 'vue'
2
+
3
+ // 外部组件注册表
4
+ const componentRegistry: Record<string, Component> = {}
5
+
6
+ // 注册外部组件
7
+ export function registerBaseTableComponents(components: {
8
+ SselectPage?: Component
9
+ AutoComplete?: Component
10
+ Cascader?: Component
11
+ AreaCascader?: Component
12
+ Upload?: Component
13
+ }) {
14
+ Object.assign(componentRegistry, components)
15
+ }
16
+
17
+ // 获取注册的组件,如果未注册则返回 undefined
18
+ export function getRegisteredComponent(name: string): Component | undefined {
19
+ return componentRegistry[name]
20
+ }
@@ -1,37 +1,37 @@
1
- import { reactive, readonly } from 'vue'
2
-
3
- export interface ToolbarState {
4
- [key: string]: any
5
- }
6
-
7
- type ToolbarValue<T = any> = T | undefined
8
-
9
- /**
10
- * 工具栏状态管理组合式API
11
- */
12
- export function useToolbarState() {
13
- const state = reactive<ToolbarState>({})
14
-
15
- const setValue = (key: string, value: ToolbarValue) => {
16
- if (!key) return
17
- state[key] = value
18
- }
19
-
20
- const getValue = <T = any>(key: string): ToolbarValue<T> => {
21
- return state[key] as T
22
- }
23
-
24
- const clear = () => {
25
- Object.keys(state).forEach((key) => {
26
- delete state[key]
27
- })
28
- }
29
-
30
- return {
31
- state: readonly(state), // 只读版本,防止直接修改
32
- setValue,
33
- getValue,
34
- clear,
35
- getAllValues: () => ({ ...state }),
36
- }
37
- }
1
+ import { reactive, readonly } from 'vue'
2
+
3
+ export interface ToolbarState {
4
+ [key: string]: any
5
+ }
6
+
7
+ type ToolbarValue<T = any> = T | undefined
8
+
9
+ /**
10
+ * 工具栏状态管理组合式API
11
+ */
12
+ export function useToolbarState() {
13
+ const state = reactive<ToolbarState>({})
14
+
15
+ const setValue = (key: string, value: ToolbarValue) => {
16
+ if (!key) return
17
+ state[key] = value
18
+ }
19
+
20
+ const getValue = <T = any>(key: string): ToolbarValue<T> => {
21
+ return state[key] as T
22
+ }
23
+
24
+ const clear = () => {
25
+ Object.keys(state).forEach((key) => {
26
+ delete state[key]
27
+ })
28
+ }
29
+
30
+ return {
31
+ state: readonly(state), // 只读版本,防止直接修改
32
+ setValue,
33
+ getValue,
34
+ clear,
35
+ getAllValues: () => ({ ...state }),
36
+ }
37
+ }