@antsoo-lib/core 3.0.0 → 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.
- package/CHANGELOG.md +6 -0
- package/dist/core.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +6 -5
- package/dist/types/BaseSearch/index.d.ts +1 -1
- package/dist/types/BaseTable/index.d.ts +5 -475
- package/dist/types/Form/CoreForm.d.ts +82 -0
- package/dist/types/SSelectPage/index.d.ts +102 -0
- package/package.json +3 -3
- package/src/BaseSearch/index.vue +371 -371
- package/src/BaseTable/index.vue +910 -910
- package/src/Form/CoreForm.vue +782 -782
- package/src/Form/types.ts +86 -86
- package/src/SSelectPage/index.vue +607 -607
- package/src/index.ts +17 -17
- package/src/render/AreaCascader.tsx +64 -64
- package/src/render/AutoComplete.tsx +101 -101
- package/src/render/Button.tsx +62 -62
- package/src/render/Cascader.tsx +45 -45
- package/src/render/Checkbox.tsx +65 -65
- package/src/render/CheckboxGroup.tsx +57 -57
- package/src/render/Custom.tsx +19 -19
- package/src/render/DatePicker.tsx +83 -83
- package/src/render/Input.tsx +140 -140
- package/src/render/InputGroup.tsx +115 -115
- package/src/render/InputNumber.tsx +205 -205
- package/src/render/InputPassword.tsx +81 -81
- package/src/render/InputRange.tsx +154 -154
- package/src/render/RadioGroup.tsx +63 -63
- package/src/render/Select.tsx +96 -96
- package/src/render/SselectPage.tsx +107 -107
- package/src/render/Switch.tsx +60 -60
- package/src/render/Tree.tsx +136 -136
- package/src/render/TreeSelect.tsx +81 -81
- package/src/render/Upload.tsx +91 -91
- package/src/render/helper.tsx +221 -221
- package/src/render/index.ts +108 -108
- package/src/render/registry.ts +20 -20
- package/src/render/state.ts +37 -37
- package/src/render/types.ts +567 -567
- package/src/utils/attrMapping.ts +106 -106
- package/vite.config.ts +61 -61
- package/.turbo/turbo-build.log +0 -40
package/src/render/registry.ts
CHANGED
|
@@ -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
|
+
}
|
package/src/render/state.ts
CHANGED
|
@@ -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
|
+
}
|