@antsoo-lib/core 1.0.17 → 2.0.2
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/.turbo/turbo-build.log +0 -0
- package/CHANGELOG.md +16 -0
- package/dist/core.css +1 -1
- package/dist/index.cjs +4 -8
- package/dist/index.js +2367 -49071
- package/dist/types/BaseSearch/index.d.ts +59 -0
- package/dist/types/{core/src/BaseTable → BaseTable}/index.d.ts +20 -6
- package/dist/types/Form/CoreForm.d.ts +82 -0
- package/dist/types/Form/types.d.ts +57 -0
- package/dist/types/SSelectPage/index.d.ts +102 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/{core/src/BaseTable/renderers → render}/AreaCascader.d.ts +3 -3
- package/dist/types/{core/src/BaseTable/renderers → render}/AutoComplete.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/Button.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/Cascader.d.ts +3 -3
- package/dist/types/{core/src/BaseTable/renderers → render}/Checkbox.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/CheckboxGroup.d.ts +2 -2
- package/dist/types/render/Custom.d.ts +8 -0
- package/dist/types/{core/src/BaseTable/renderers → render}/DatePicker.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/Input.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/InputGroup.d.ts +3 -3
- package/dist/types/{core/src/BaseTable/renderers → render}/InputNumber.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/InputPassword.d.ts +2 -2
- package/dist/types/render/InputRange.d.ts +9 -0
- package/dist/types/{core/src/BaseTable/renderers → render}/RadioGroup.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/Select.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/SselectPage.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/Switch.d.ts +2 -2
- package/dist/types/render/Tree.d.ts +9 -0
- package/dist/types/{core/src/BaseTable/renderers → render}/TreeSelect.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/renderers → render}/Upload.d.ts +2 -2
- package/dist/types/{core/src/BaseTable/helpers.d.ts → render/helper.d.ts} +2 -1
- package/dist/types/{core/src/BaseTable/renderers → render}/index.d.ts +24 -5
- package/dist/types/{core/src/BaseTable → render}/types.d.ts +48 -4
- package/dist/types/utils/attrMapping.d.ts +26 -0
- package/package.json +12 -15
- package/src/BaseSearch/index.vue +371 -0
- package/src/BaseTable/index.vue +48 -22
- package/src/Form/CoreForm.vue +782 -0
- package/src/Form/types.ts +86 -0
- package/src/SSelectPage/index.vue +607 -0
- package/src/index.ts +15 -1
- package/src/{BaseTable/renderers → render}/AreaCascader.tsx +3 -3
- package/src/{BaseTable/renderers → render}/AutoComplete.tsx +3 -3
- package/src/{BaseTable/renderers → render}/Button.tsx +2 -2
- package/src/{BaseTable/renderers → render}/Cascader.tsx +3 -3
- package/src/{BaseTable/renderers → render}/Checkbox.tsx +2 -2
- package/src/{BaseTable/renderers → render}/CheckboxGroup.tsx +2 -2
- package/src/render/Custom.tsx +19 -0
- package/src/{BaseTable/renderers → render}/DatePicker.tsx +2 -2
- package/src/{BaseTable/renderers → render}/Input.tsx +3 -3
- package/src/{BaseTable/renderers → render}/InputGroup.tsx +3 -3
- package/src/{BaseTable/renderers → render}/InputNumber.tsx +3 -3
- package/src/{BaseTable/renderers → render}/InputPassword.tsx +3 -3
- package/src/render/InputRange.tsx +154 -0
- package/src/{BaseTable/renderers → render}/RadioGroup.tsx +2 -2
- package/src/{BaseTable/renderers → render}/Select.tsx +2 -2
- package/src/{BaseTable/renderers → render}/SselectPage.tsx +3 -3
- package/src/{BaseTable/renderers → render}/Switch.tsx +2 -2
- package/src/render/Tree.tsx +136 -0
- package/src/{BaseTable/renderers → render}/TreeSelect.tsx +2 -2
- package/src/{BaseTable/renderers → render}/Upload.tsx +4 -5
- package/src/{BaseTable/utils.tsx → render/helper.tsx} +86 -9
- package/src/{BaseTable/renderers → render}/index.ts +45 -4
- package/src/{BaseTable → render}/types.ts +62 -2
- package/src/utils/attrMapping.ts +106 -0
- package/vite.config.ts +15 -2
- package/dist/types/core/index.d.ts +0 -6
- package/dist/types/core/src/BaseTable/utils.d.ts +0 -8
- package/dist/types/core/src/index.d.ts +0 -2
- package/index.css +0 -2
- package/index.ts +0 -21
- package/src/BaseTable/helpers.tsx +0 -91
- /package/dist/types/{core/src/BaseTable → render}/registry.d.ts +0 -0
- /package/dist/types/{core/src/BaseTable → render}/state.d.ts +0 -0
- /package/src/{BaseTable → render}/registry.ts +0 -0
- /package/src/{BaseTable → render}/state.ts +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
import { FormField } from '../Form/types';
|
|
4
|
+
interface Props {
|
|
5
|
+
searchFields?: FormField[];
|
|
6
|
+
labelWidth?: number;
|
|
7
|
+
actionsSpan?: number;
|
|
8
|
+
gutter?: number;
|
|
9
|
+
padding?: boolean;
|
|
10
|
+
outerBaseForm?: Component;
|
|
11
|
+
innerBaseForm?: Component;
|
|
12
|
+
innerBaseFormProps?: AnyObject;
|
|
13
|
+
}
|
|
14
|
+
declare function __VLS_template(): {
|
|
15
|
+
attrs: Partial<{}>;
|
|
16
|
+
slots: {
|
|
17
|
+
'reset-icon'?(_: {}): any;
|
|
18
|
+
'reset-icon'?(_: {}): any;
|
|
19
|
+
'more-icon'?(_: {}): any;
|
|
20
|
+
};
|
|
21
|
+
refs: {
|
|
22
|
+
baseFormRef: unknown;
|
|
23
|
+
baseFormRef2: unknown;
|
|
24
|
+
};
|
|
25
|
+
rootEl: HTMLDivElement;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
28
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
29
|
+
getSearchParams: () => {
|
|
30
|
+
[x: string]: any;
|
|
31
|
+
};
|
|
32
|
+
initAllFieldDefaults: () => void;
|
|
33
|
+
setFormValue: (values: AnyObject, key?: string[]) => void;
|
|
34
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
35
|
+
search: (values: AnyObject) => any;
|
|
36
|
+
reset: (values: AnyObject) => any;
|
|
37
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
38
|
+
onSearch?: ((values: AnyObject) => any) | undefined;
|
|
39
|
+
onReset?: ((values: AnyObject) => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
padding: boolean;
|
|
42
|
+
labelWidth: number;
|
|
43
|
+
actionsSpan: number;
|
|
44
|
+
gutter: number;
|
|
45
|
+
searchFields: FormField[];
|
|
46
|
+
outerBaseForm: Component;
|
|
47
|
+
innerBaseForm: Component;
|
|
48
|
+
innerBaseFormProps: AnyObject;
|
|
49
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
50
|
+
baseFormRef: unknown;
|
|
51
|
+
baseFormRef2: unknown;
|
|
52
|
+
}, HTMLDivElement>;
|
|
53
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
54
|
+
export default _default;
|
|
55
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
|
+
import { env as _env } from '../../packages/utils/index.ts';
|
|
2
3
|
import { VxeGridProps } from 'vxe-table';
|
|
3
|
-
import { ToolbarConfig } from '
|
|
4
|
+
import { ToolbarConfig } from '../render/types';
|
|
4
5
|
interface Button {
|
|
5
6
|
name?: (row: any) => string;
|
|
6
7
|
permission?: string;
|
|
@@ -50,12 +51,18 @@ interface Props {
|
|
|
50
51
|
code: string;
|
|
51
52
|
name: string;
|
|
52
53
|
}>;
|
|
54
|
+
hoverColor?: string | null;
|
|
55
|
+
env?: ReturnType<typeof _env>;
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* 跳转指定页码
|
|
56
59
|
* @param {number} page - 页码
|
|
57
60
|
*/
|
|
58
61
|
declare function goToPage(page: number): void;
|
|
62
|
+
/**
|
|
63
|
+
* 重置分页到第一页
|
|
64
|
+
*/
|
|
65
|
+
declare function resetPageNumber(): void;
|
|
59
66
|
/**
|
|
60
67
|
* 获取当前选中的数据(兼容复选框和单选框)
|
|
61
68
|
* @returns {Array | object | null}
|
|
@@ -63,6 +70,10 @@ declare function goToPage(page: number): void;
|
|
|
63
70
|
* - 单选框模式:返回选中的行数据对象,如果没有选中则返回 null
|
|
64
71
|
*/
|
|
65
72
|
declare function getSelectedRecords(): any;
|
|
73
|
+
/**
|
|
74
|
+
* 获取表格实例
|
|
75
|
+
*/
|
|
76
|
+
declare function getGrid(): unknown;
|
|
66
77
|
declare function __VLS_template(): {
|
|
67
78
|
attrs: Partial<{}>;
|
|
68
79
|
slots: any;
|
|
@@ -71,7 +82,7 @@ declare function __VLS_template(): {
|
|
|
71
82
|
$props: VxeGridProps<any> & import('vxe-table').VxeGridEventProps<any>;
|
|
72
83
|
$slots: import('vxe-table').VxeGridSlots<any>;
|
|
73
84
|
}) | null;
|
|
74
|
-
paginationRef:
|
|
85
|
+
paginationRef: any;
|
|
75
86
|
};
|
|
76
87
|
rootEl: any;
|
|
77
88
|
};
|
|
@@ -93,6 +104,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
|
93
104
|
[key: string]: any;
|
|
94
105
|
};
|
|
95
106
|
goToPage: typeof goToPage;
|
|
107
|
+
resetPageNumber: typeof resetPageNumber;
|
|
108
|
+
getGrid: typeof getGrid;
|
|
96
109
|
lToolBarState: {
|
|
97
110
|
state: {
|
|
98
111
|
readonly [x: string]: any;
|
|
@@ -157,16 +170,16 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
|
157
170
|
grid: any;
|
|
158
171
|
}) => any) | undefined;
|
|
159
172
|
}>, {
|
|
160
|
-
loading: boolean;
|
|
161
173
|
checkbox: boolean;
|
|
162
|
-
|
|
174
|
+
tree: boolean;
|
|
163
175
|
drag: boolean;
|
|
176
|
+
radio: boolean;
|
|
164
177
|
height: string;
|
|
178
|
+
loading: boolean;
|
|
165
179
|
pager: boolean;
|
|
166
180
|
seq: boolean;
|
|
167
181
|
showFooter: boolean;
|
|
168
182
|
total: number;
|
|
169
|
-
tree: boolean;
|
|
170
183
|
lToolBarCount: number | (() => number);
|
|
171
184
|
rToolBarCount: number | (() => number);
|
|
172
185
|
permissions: string[];
|
|
@@ -174,12 +187,13 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
|
174
187
|
code: string;
|
|
175
188
|
name: string;
|
|
176
189
|
}>;
|
|
190
|
+
hoverColor: string | null;
|
|
177
191
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
178
192
|
basetable: (import('vxe-table').VxeGridMethods<any> & {
|
|
179
193
|
$props: VxeGridProps<any> & import('vxe-table').VxeGridEventProps<any>;
|
|
180
194
|
$slots: import('vxe-table').VxeGridSlots<any>;
|
|
181
195
|
}) | null;
|
|
182
|
-
paginationRef:
|
|
196
|
+
paginationRef: any;
|
|
183
197
|
}, any>;
|
|
184
198
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
185
199
|
export default _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
|
+
import { BaseFormProps, FormField } from './types';
|
|
3
|
+
interface GetAccessParams {
|
|
4
|
+
operation: 'get';
|
|
5
|
+
keys: string[] | string;
|
|
6
|
+
}
|
|
7
|
+
interface SetAccessParams {
|
|
8
|
+
operation: 'set';
|
|
9
|
+
keys: string[] | string;
|
|
10
|
+
values: AnyObject;
|
|
11
|
+
}
|
|
12
|
+
type AccessFormFieldsParams = GetAccessParams | SetAccessParams;
|
|
13
|
+
type AccessFormFieldsResult = {
|
|
14
|
+
success: true;
|
|
15
|
+
operation: 'get';
|
|
16
|
+
keys: string[];
|
|
17
|
+
data: AnyObject;
|
|
18
|
+
missingKeys?: string[];
|
|
19
|
+
} | {
|
|
20
|
+
success: true;
|
|
21
|
+
operation: 'set';
|
|
22
|
+
keys: string[];
|
|
23
|
+
applied: string[];
|
|
24
|
+
skipped: string[];
|
|
25
|
+
} | {
|
|
26
|
+
success: false;
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
declare function accessFormFields(params: AccessFormFieldsParams): AccessFormFieldsResult;
|
|
30
|
+
declare function __VLS_template(): {
|
|
31
|
+
attrs: Partial<{}>;
|
|
32
|
+
slots: {
|
|
33
|
+
search?(_: {}): any;
|
|
34
|
+
actions?(_: {}): any;
|
|
35
|
+
};
|
|
36
|
+
refs: {
|
|
37
|
+
formRef: any;
|
|
38
|
+
};
|
|
39
|
+
rootEl: HTMLDivElement;
|
|
40
|
+
};
|
|
41
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
42
|
+
declare const __VLS_component: import('vue').DefineComponent<BaseFormProps, {
|
|
43
|
+
getFormValue: (key?: string[]) => AnyObject;
|
|
44
|
+
setFormValue: (values: AnyObject, key?: string[]) => void;
|
|
45
|
+
accessFormFields: typeof accessFormFields;
|
|
46
|
+
resetFormValue: (key?: string[]) => void;
|
|
47
|
+
validateForm: () => Promise<{
|
|
48
|
+
valid: boolean;
|
|
49
|
+
errors?: any;
|
|
50
|
+
}>;
|
|
51
|
+
validateFields: (fieldKey: string[]) => Promise<{
|
|
52
|
+
valid: boolean;
|
|
53
|
+
errors?: any;
|
|
54
|
+
}>;
|
|
55
|
+
clearValidate: (fieldKeys?: string[]) => void;
|
|
56
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
57
|
+
"update:value": (value: AnyObject) => any;
|
|
58
|
+
change: (value: AnyObject) => any;
|
|
59
|
+
}, string, import('vue').PublicProps, Readonly<BaseFormProps> & Readonly<{
|
|
60
|
+
"onUpdate:value"?: ((value: AnyObject) => any) | undefined;
|
|
61
|
+
onChange?: ((value: AnyObject) => any) | undefined;
|
|
62
|
+
}>, {
|
|
63
|
+
value: AnyObject;
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
fields: FormField[];
|
|
66
|
+
labelWidth: number;
|
|
67
|
+
labelPosition: "horizontal" | "vertical";
|
|
68
|
+
labelAlign: "left" | "right";
|
|
69
|
+
inlineActions: boolean;
|
|
70
|
+
actionsSpan: number;
|
|
71
|
+
colon: boolean;
|
|
72
|
+
gutter: number | [number, number];
|
|
73
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
74
|
+
formRef: any;
|
|
75
|
+
}, HTMLDivElement>;
|
|
76
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
77
|
+
export default _default;
|
|
78
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
79
|
+
new (): {
|
|
80
|
+
$slots: S;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
|
+
import { InjectionKey } from 'vue';
|
|
3
|
+
export interface CommonCodeItem {
|
|
4
|
+
name: string;
|
|
5
|
+
code: string | number;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface CommonCodeService {
|
|
9
|
+
getCodesByType: (type: string) => CommonCodeItem[];
|
|
10
|
+
}
|
|
11
|
+
export declare const COMMON_CODE_SERVICE_KEY: InjectionKey<CommonCodeService>;
|
|
12
|
+
export interface ValidationRule {
|
|
13
|
+
required?: boolean;
|
|
14
|
+
message?: string;
|
|
15
|
+
pattern?: RegExp;
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
len?: number;
|
|
19
|
+
type?: 'string' | 'number' | 'boolean' | 'method' | 'regexp' | 'integer' | 'float' | 'array' | 'object' | 'enum' | 'date' | 'url' | 'hex' | 'email';
|
|
20
|
+
validator?: (rule: any, value: any) => Promise<void> | void;
|
|
21
|
+
trigger?: 'change' | 'blur' | ['change', 'blur'];
|
|
22
|
+
}
|
|
23
|
+
export interface FormField {
|
|
24
|
+
key?: string;
|
|
25
|
+
attr?: string[] | {
|
|
26
|
+
ids?: string[];
|
|
27
|
+
names?: string[];
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
30
|
+
type?: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
span?: number;
|
|
33
|
+
hidden?: boolean;
|
|
34
|
+
disabled?: boolean | ((formValues: AnyObject, toolbarState: any, field: FormField) => boolean);
|
|
35
|
+
labelWidth?: number;
|
|
36
|
+
labelAlign?: 'left' | 'right';
|
|
37
|
+
props?: AnyObject;
|
|
38
|
+
events?: Record<string, (...args: any[]) => any>;
|
|
39
|
+
beforeCreate?: boolean | ((field: FormField) => boolean);
|
|
40
|
+
required?: boolean;
|
|
41
|
+
rules?: ValidationRule[];
|
|
42
|
+
textarea?: boolean;
|
|
43
|
+
commonCode?: string;
|
|
44
|
+
helpText?: string | false;
|
|
45
|
+
}
|
|
46
|
+
export interface BaseFormProps {
|
|
47
|
+
value: AnyObject;
|
|
48
|
+
fields?: FormField[];
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
labelWidth?: number;
|
|
51
|
+
labelPosition?: 'horizontal' | 'vertical';
|
|
52
|
+
labelAlign?: 'left' | 'right';
|
|
53
|
+
inlineActions?: boolean;
|
|
54
|
+
actionsSpan?: number;
|
|
55
|
+
colon?: boolean;
|
|
56
|
+
gutter?: number | [number, number];
|
|
57
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { SelectProps } from '../../packages/components/index.ts';
|
|
2
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
3
|
+
interface RequestConfig {
|
|
4
|
+
method?: 'GET' | 'POST';
|
|
5
|
+
url: string;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
params?: AnyObject;
|
|
8
|
+
data?: AnyObject;
|
|
9
|
+
}
|
|
10
|
+
type Requester = (config: Required<Pick<RequestConfig, 'method' | 'url'>> & RequestConfig) => Promise<any>;
|
|
11
|
+
interface ApiConfig extends RequestConfig {
|
|
12
|
+
request?: Requester;
|
|
13
|
+
}
|
|
14
|
+
interface DataMapping {
|
|
15
|
+
list?: string;
|
|
16
|
+
total?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
interface PaginationConfig {
|
|
21
|
+
pageField?: string;
|
|
22
|
+
pageSizeField?: string;
|
|
23
|
+
searchField?: string;
|
|
24
|
+
searchContains?: string;
|
|
25
|
+
}
|
|
26
|
+
interface Props extends /* @vue-ignore */ Omit<SelectProps, 'options' | 'loading'> {
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
allowClear?: boolean;
|
|
29
|
+
showSearch?: boolean;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
maxTagCount?: 'responsive' | number;
|
|
32
|
+
size?: 'large' | 'middle' | 'small';
|
|
33
|
+
mode?: 'multiple' | 'tags';
|
|
34
|
+
value?: any;
|
|
35
|
+
api: ApiConfig;
|
|
36
|
+
dataMapping?: DataMapping;
|
|
37
|
+
pagination?: boolean;
|
|
38
|
+
paginationConfig?: PaginationConfig;
|
|
39
|
+
pageSize?: number;
|
|
40
|
+
searchDelay?: number;
|
|
41
|
+
extraParams?: AnyObject;
|
|
42
|
+
params?: AnyObject;
|
|
43
|
+
transformData?: (data: any) => any;
|
|
44
|
+
autoLoad?: boolean;
|
|
45
|
+
attr?: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
48
|
+
pagination: boolean;
|
|
49
|
+
pageSize: number;
|
|
50
|
+
searchDelay: number;
|
|
51
|
+
extraParams: () => {};
|
|
52
|
+
params: () => {};
|
|
53
|
+
autoLoad: boolean;
|
|
54
|
+
allowClear: boolean;
|
|
55
|
+
showSearch: boolean;
|
|
56
|
+
placeholder: string;
|
|
57
|
+
maxTagCount: number;
|
|
58
|
+
}>>, {
|
|
59
|
+
reload: () => void;
|
|
60
|
+
fetchData: () => Promise<void> | void;
|
|
61
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
62
|
+
search: (value: string) => any;
|
|
63
|
+
clear: () => any;
|
|
64
|
+
"update:value": (value: any) => any;
|
|
65
|
+
change: (value: any, option: any, allOptions: any) => any;
|
|
66
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
67
|
+
pagination: boolean;
|
|
68
|
+
pageSize: number;
|
|
69
|
+
searchDelay: number;
|
|
70
|
+
extraParams: () => {};
|
|
71
|
+
params: () => {};
|
|
72
|
+
autoLoad: boolean;
|
|
73
|
+
allowClear: boolean;
|
|
74
|
+
showSearch: boolean;
|
|
75
|
+
placeholder: string;
|
|
76
|
+
maxTagCount: number;
|
|
77
|
+
}>>> & Readonly<{
|
|
78
|
+
onSearch?: ((value: string) => any) | undefined;
|
|
79
|
+
onClear?: (() => any) | undefined;
|
|
80
|
+
"onUpdate:value"?: ((value: any) => any) | undefined;
|
|
81
|
+
onChange?: ((value: any, option: any, allOptions: any) => any) | undefined;
|
|
82
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
83
|
+
selectRef: any;
|
|
84
|
+
}, any>;
|
|
85
|
+
export default _default;
|
|
86
|
+
type __VLS_WithDefaults<P, D> = {
|
|
87
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
88
|
+
default: D[K];
|
|
89
|
+
}> : P[K];
|
|
90
|
+
};
|
|
91
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
92
|
+
type __VLS_TypePropsToOption<T> = {
|
|
93
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
94
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
95
|
+
} : {
|
|
96
|
+
type: import('vue').PropType<T[K]>;
|
|
97
|
+
required: true;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
type __VLS_PrettifyLocal<T> = {
|
|
101
|
+
[K in keyof T]: T[K];
|
|
102
|
+
} & {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as BaseSearch } from './BaseSearch/index';
|
|
2
|
+
import { default as BaseTable } from './BaseTable/index';
|
|
3
|
+
import { default as CoreForm } from './Form/CoreForm';
|
|
4
|
+
import { default as SSelectPage } from './SSelectPage/index';
|
|
5
|
+
import { registerRenderer, Renderer } from './render';
|
|
6
|
+
export { BaseSearch, BaseTable, CoreForm, registerRenderer, SSelectPage };
|
|
7
|
+
export type { Renderer };
|
|
8
|
+
export declare const version = "0.0.0";
|
|
9
|
+
export * from './render/registry';
|
|
10
|
+
export * from './render/types';
|
|
11
|
+
export * from './render/state';
|
|
12
|
+
export * from './render';
|
|
13
|
+
export * from './Form/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyObject } from '
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
2
|
import { VNode } from 'vue';
|
|
3
|
-
import { ToolbarState } from '
|
|
4
|
-
import { AreaCascaderToolbarItem } from '
|
|
3
|
+
import { ToolbarState } from './state';
|
|
4
|
+
import { AreaCascaderToolbarItem } from './types';
|
|
5
5
|
export declare function renderAreaCascader(config: AreaCascaderToolbarItem, toolbarState: ToolbarState, allValues?: AnyObject): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderAutoComplete(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderButton(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyObject } from '
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
2
|
import { VNode } from 'vue';
|
|
3
|
-
import { ToolbarState } from '
|
|
4
|
-
import { CascaderToolbarItem } from '
|
|
3
|
+
import { ToolbarState } from './state';
|
|
4
|
+
import { CascaderToolbarItem } from './types';
|
|
5
5
|
export declare function renderCascader(config: CascaderToolbarItem, toolbarState: ToolbarState, allValues: AnyObject): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderCheckbox(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderCheckboxGroup(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { BaseToolbarItem, ToolbarItem } from './types';
|
|
4
|
+
export interface CustomToolbarItem extends BaseToolbarItem {
|
|
5
|
+
type: 'custom';
|
|
6
|
+
render: (toolbarState: ToolbarState) => VNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function renderCustom(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderDatePicker(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderInput(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyObject } from '
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
2
|
import { VNode } from 'vue';
|
|
3
|
-
import { ToolbarState } from '
|
|
4
|
-
import { InputGroupToolbarItem } from '
|
|
3
|
+
import { ToolbarState } from './state';
|
|
4
|
+
import { InputGroupToolbarItem } from './types';
|
|
5
5
|
export declare function renderInputGroup(config: InputGroupToolbarItem, toolbarState: ToolbarState, formValues?: AnyObject): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderInputNumber(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderInputPassword(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { ToolbarState } from './state';
|
|
4
|
+
import { ToolbarItem } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* 渲染 InputRange
|
|
7
|
+
* @description 透传 toolbarState 与 formValues,供 CoreForm 统一状态管理
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderInputRange(item: ToolbarItem, toolbarState: ToolbarState, formValues?: AnyObject): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderRadioGroup(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderSelect(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderSselectPage(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderSwitch(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { ToolbarState } from './state';
|
|
4
|
+
import { ToolbarItem } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* 渲染树控件
|
|
7
|
+
* @description 提供 checkedKeys 与 expandedKeys 的同步能力,并桥接到 CoreForm 事件系统
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderTree(item: ToolbarItem, toolbarState: ToolbarState, formValues?: AnyObject): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderTreeSelect(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { ToolbarState } from '
|
|
3
|
-
import { ToolbarItem } from '
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { ToolbarItem } from './types';
|
|
4
4
|
export declare function renderUpload(item: ToolbarItem, toolbarState: ToolbarState): VNode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
import { ToolbarState } from './state';
|
|
3
|
-
import { InputGroupToolbarItem, SlotConfig } from './types';
|
|
3
|
+
import { InputGroupToolbarItem, SlotConfig, ToolbarConfig } from './types';
|
|
4
|
+
export declare function renderToolbar(config: ToolbarConfig, toolbarState: ToolbarState, count: number | (() => number), permissions?: string[]): VNode[];
|
|
4
5
|
export declare function renderSlotContent(slotConfig: SlotConfig, toolbarState: ToolbarState): VNode | undefined;
|
|
5
6
|
export declare function validateInputGroupConfig(cfg: InputGroupToolbarItem): {
|
|
6
7
|
valid: boolean;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { AnyObject } from '
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
2
|
import { VNode } from 'vue';
|
|
3
|
-
import { ToolbarState } from '../state';
|
|
4
|
-
import { ToolbarItem } from '../types';
|
|
5
3
|
import { renderAreaCascader } from './AreaCascader';
|
|
6
4
|
import { renderAutoComplete } from './AutoComplete';
|
|
7
5
|
import { renderButton } from './Button';
|
|
@@ -13,12 +11,33 @@ import { renderInput } from './Input';
|
|
|
13
11
|
import { renderInputGroup } from './InputGroup';
|
|
14
12
|
import { renderInputNumber } from './InputNumber';
|
|
15
13
|
import { renderInputPassword } from './InputPassword';
|
|
14
|
+
import { renderInputRange } from './InputRange';
|
|
16
15
|
import { renderRadioGroup } from './RadioGroup';
|
|
17
16
|
import { renderSelect } from './Select';
|
|
18
17
|
import { renderSselectPage } from './SselectPage';
|
|
19
18
|
import { renderSwitch } from './Switch';
|
|
19
|
+
import { renderTree } from './Tree';
|
|
20
20
|
import { renderTreeSelect } from './TreeSelect';
|
|
21
21
|
import { renderUpload } from './Upload';
|
|
22
|
-
|
|
22
|
+
import { ToolbarState } from './state';
|
|
23
|
+
import { ToolbarItem } from './types';
|
|
24
|
+
export type Renderer = (item: ToolbarItem, toolbarState: ToolbarState, formValues?: AnyObject) => VNode;
|
|
23
25
|
export declare const rendererMap: Record<string, Renderer>;
|
|
24
|
-
|
|
26
|
+
/**
|
|
27
|
+
* 注册自定义渲染器
|
|
28
|
+
* @param name 渲染器名称
|
|
29
|
+
* @param renderer 渲染函数
|
|
30
|
+
*/
|
|
31
|
+
export declare function registerRenderer(name: string, renderer: Renderer): void;
|
|
32
|
+
/**
|
|
33
|
+
* 批量注册自定义渲染器
|
|
34
|
+
* @param renderers 渲染器映射对象
|
|
35
|
+
*/
|
|
36
|
+
export declare function registerRenderers(renderers: Record<string, Renderer>): void;
|
|
37
|
+
/**
|
|
38
|
+
* 获取渲染器
|
|
39
|
+
* @param name 渲染器名称
|
|
40
|
+
* @returns 渲染函数
|
|
41
|
+
*/
|
|
42
|
+
export declare function getRenderer(name: string): Renderer | undefined;
|
|
43
|
+
export { renderAreaCascader, renderAutoComplete, renderButton, renderCascader, renderCheckbox, renderCheckboxGroup, renderDatePicker, renderInput, renderInputGroup, renderInputNumber, renderInputPassword, renderInputRange, renderRadioGroup, renderSelect, renderSselectPage, renderSwitch, renderTree, renderTreeSelect, renderUpload, };
|