@antsoo-lib/core 1.0.12 → 1.0.13
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 +8 -0
- package/dist/index.cjs +8 -4
- package/dist/index.js +49046 -1282
- package/dist/types/core/index.d.ts +6 -0
- package/dist/types/core/src/BaseTable/helpers.d.ts +9 -0
- package/dist/types/core/src/BaseTable/index.d.ts +190 -0
- package/dist/types/core/src/BaseTable/registry.d.ts +9 -0
- package/dist/types/core/src/BaseTable/renderers/AreaCascader.d.ts +5 -0
- package/dist/types/core/src/BaseTable/renderers/AutoComplete.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/Button.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/Cascader.d.ts +5 -0
- package/dist/types/core/src/BaseTable/renderers/Checkbox.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/CheckboxGroup.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/DatePicker.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/Input.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/InputGroup.d.ts +5 -0
- package/dist/types/core/src/BaseTable/renderers/InputNumber.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/InputPassword.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/RadioGroup.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/Select.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/SselectPage.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/Switch.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/TreeSelect.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/Upload.d.ts +4 -0
- package/dist/types/core/src/BaseTable/renderers/index.d.ts +24 -0
- package/dist/types/core/src/BaseTable/state.d.ts +19 -0
- package/dist/types/core/src/BaseTable/types.d.ts +391 -0
- package/dist/types/core/src/BaseTable/utils.d.ts +8 -0
- package/dist/types/core/src/index.d.ts +2 -0
- package/package.json +3 -3
- package/vite.config.ts +0 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { ToolbarState } from './state';
|
|
3
|
+
import { InputGroupToolbarItem, SlotConfig } from './types';
|
|
4
|
+
export declare function renderSlotContent(slotConfig: SlotConfig, toolbarState: ToolbarState): VNode | undefined;
|
|
5
|
+
export declare function validateInputGroupConfig(cfg: InputGroupToolbarItem): {
|
|
6
|
+
valid: boolean;
|
|
7
|
+
errors?: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function getInputNumberFocusState(toolbarState: ToolbarState): Map<string, boolean>;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { AnyObject } from '../../packages/shared/index.ts';
|
|
2
|
+
import { VxeGridProps } from 'vxe-table';
|
|
3
|
+
import { ToolbarConfig } from './utils';
|
|
4
|
+
interface Button {
|
|
5
|
+
name?: (row: any) => string;
|
|
6
|
+
permission?: string;
|
|
7
|
+
event?: (row: any, controls: any, grid: any) => void;
|
|
8
|
+
disabled?: (row: any, grid: any) => boolean;
|
|
9
|
+
beforeCreate?: (row: any) => boolean;
|
|
10
|
+
props?: AnyObject;
|
|
11
|
+
}
|
|
12
|
+
interface Column {
|
|
13
|
+
type?: 'checkbox' | 'radio' | 'seq' | 'html' | 'expand' | null;
|
|
14
|
+
buttons?: Button[];
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
interface Props {
|
|
18
|
+
scope?: string;
|
|
19
|
+
checkbox?: boolean;
|
|
20
|
+
checkboxConfig?: AnyObject;
|
|
21
|
+
radio?: boolean;
|
|
22
|
+
radioConfig?: AnyObject;
|
|
23
|
+
columns?: Column[];
|
|
24
|
+
customConfig?: AnyObject;
|
|
25
|
+
columnConfig?: AnyObject;
|
|
26
|
+
data?: any[];
|
|
27
|
+
drag?: boolean;
|
|
28
|
+
footerData?: any[];
|
|
29
|
+
height?: string;
|
|
30
|
+
lToolBar?: ToolbarConfig;
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
options?: Partial<VxeGridProps>;
|
|
33
|
+
pager?: boolean;
|
|
34
|
+
rToolBar?: ToolbarConfig;
|
|
35
|
+
rowConfig?: AnyObject;
|
|
36
|
+
rowDragConfig?: AnyObject;
|
|
37
|
+
seq?: boolean;
|
|
38
|
+
showFooter?: boolean;
|
|
39
|
+
toolbarConfig?: AnyObject;
|
|
40
|
+
tooltipConfig?: AnyObject;
|
|
41
|
+
total?: number;
|
|
42
|
+
tree?: boolean;
|
|
43
|
+
treeConfig?: AnyObject;
|
|
44
|
+
lToolBarCount?: number | (() => number);
|
|
45
|
+
rToolBarCount?: number | (() => number);
|
|
46
|
+
currentPage?: number;
|
|
47
|
+
pageSize?: number;
|
|
48
|
+
permissions?: string[];
|
|
49
|
+
getCommonCodeOptions?: (type: string) => Array<{
|
|
50
|
+
code: string;
|
|
51
|
+
name: string;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 跳转指定页码
|
|
56
|
+
* @param {number} page - 页码
|
|
57
|
+
*/
|
|
58
|
+
declare function goToPage(page: number): void;
|
|
59
|
+
/**
|
|
60
|
+
* 获取当前选中的数据(兼容复选框和单选框)
|
|
61
|
+
* @returns {Array | object | null}
|
|
62
|
+
* - 复选框模式:返回选中的行数据数组
|
|
63
|
+
* - 单选框模式:返回选中的行数据对象,如果没有选中则返回 null
|
|
64
|
+
*/
|
|
65
|
+
declare function getSelectedRecords(): any;
|
|
66
|
+
declare function __VLS_template(): {
|
|
67
|
+
attrs: Partial<{}>;
|
|
68
|
+
slots: any;
|
|
69
|
+
refs: {
|
|
70
|
+
basetable: (import('vxe-table').VxeGridMethods<any> & {
|
|
71
|
+
$props: VxeGridProps<any> & import('vxe-table').VxeGridEventProps<any>;
|
|
72
|
+
$slots: import('vxe-table').VxeGridSlots<any>;
|
|
73
|
+
}) | null;
|
|
74
|
+
paginationRef: unknown;
|
|
75
|
+
};
|
|
76
|
+
rootEl: any;
|
|
77
|
+
};
|
|
78
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
79
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {
|
|
80
|
+
grid: import('vue').Ref<any, any>;
|
|
81
|
+
getAllToolBarValues: () => {
|
|
82
|
+
lToolBar: {
|
|
83
|
+
[key: string]: any;
|
|
84
|
+
};
|
|
85
|
+
rToolBar: {
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
getLToolBarValues: () => {
|
|
90
|
+
[key: string]: any;
|
|
91
|
+
};
|
|
92
|
+
getRToolBarValues: () => {
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
};
|
|
95
|
+
goToPage: typeof goToPage;
|
|
96
|
+
lToolBarState: {
|
|
97
|
+
state: {
|
|
98
|
+
readonly [x: string]: any;
|
|
99
|
+
};
|
|
100
|
+
setValue: (key: string, value: any) => void;
|
|
101
|
+
getValue: <T = any>(key: string) => T | undefined;
|
|
102
|
+
clear: () => void;
|
|
103
|
+
getAllValues: () => {
|
|
104
|
+
[key: string]: any;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
rToolBarState: {
|
|
108
|
+
state: {
|
|
109
|
+
readonly [x: string]: any;
|
|
110
|
+
};
|
|
111
|
+
setValue: (key: string, value: any) => void;
|
|
112
|
+
getValue: <T = any>(key: string) => T | undefined;
|
|
113
|
+
clear: () => void;
|
|
114
|
+
getAllValues: () => {
|
|
115
|
+
[key: string]: any;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
getSelectedRecords: typeof getSelectedRecords;
|
|
119
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
120
|
+
pageChange: (page: number, size: number) => any;
|
|
121
|
+
pageShowSizeChange: (current: number, size: number) => any;
|
|
122
|
+
selectAllChangeEvent: (checked: boolean, records: any[]) => any;
|
|
123
|
+
selectChangeEvent: (params: {
|
|
124
|
+
checked: boolean;
|
|
125
|
+
row: any;
|
|
126
|
+
rowIndex: number;
|
|
127
|
+
records: any[];
|
|
128
|
+
}) => any;
|
|
129
|
+
radioChangeEvent: (params: {
|
|
130
|
+
row: any;
|
|
131
|
+
rowIndex: number;
|
|
132
|
+
records: any;
|
|
133
|
+
}) => any;
|
|
134
|
+
buttonClick: (params: {
|
|
135
|
+
button: Button;
|
|
136
|
+
row: any;
|
|
137
|
+
grid: any;
|
|
138
|
+
}) => any;
|
|
139
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
140
|
+
onPageChange?: ((page: number, size: number) => any) | undefined;
|
|
141
|
+
onPageShowSizeChange?: ((current: number, size: number) => any) | undefined;
|
|
142
|
+
onSelectAllChangeEvent?: ((checked: boolean, records: any[]) => any) | undefined;
|
|
143
|
+
onSelectChangeEvent?: ((params: {
|
|
144
|
+
checked: boolean;
|
|
145
|
+
row: any;
|
|
146
|
+
rowIndex: number;
|
|
147
|
+
records: any[];
|
|
148
|
+
}) => any) | undefined;
|
|
149
|
+
onRadioChangeEvent?: ((params: {
|
|
150
|
+
row: any;
|
|
151
|
+
rowIndex: number;
|
|
152
|
+
records: any;
|
|
153
|
+
}) => any) | undefined;
|
|
154
|
+
onButtonClick?: ((params: {
|
|
155
|
+
button: Button;
|
|
156
|
+
row: any;
|
|
157
|
+
grid: any;
|
|
158
|
+
}) => any) | undefined;
|
|
159
|
+
}>, {
|
|
160
|
+
loading: boolean;
|
|
161
|
+
checkbox: boolean;
|
|
162
|
+
radio: boolean;
|
|
163
|
+
drag: boolean;
|
|
164
|
+
height: string;
|
|
165
|
+
pager: boolean;
|
|
166
|
+
seq: boolean;
|
|
167
|
+
showFooter: boolean;
|
|
168
|
+
total: number;
|
|
169
|
+
tree: boolean;
|
|
170
|
+
lToolBarCount: number | (() => number);
|
|
171
|
+
rToolBarCount: number | (() => number);
|
|
172
|
+
permissions: string[];
|
|
173
|
+
getCommonCodeOptions: (type: string) => Array<{
|
|
174
|
+
code: string;
|
|
175
|
+
name: string;
|
|
176
|
+
}>;
|
|
177
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
178
|
+
basetable: (import('vxe-table').VxeGridMethods<any> & {
|
|
179
|
+
$props: VxeGridProps<any> & import('vxe-table').VxeGridEventProps<any>;
|
|
180
|
+
$slots: import('vxe-table').VxeGridSlots<any>;
|
|
181
|
+
}) | null;
|
|
182
|
+
paginationRef: unknown;
|
|
183
|
+
}, any>;
|
|
184
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
185
|
+
export default _default;
|
|
186
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
187
|
+
new (): {
|
|
188
|
+
$slots: S;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export declare function registerBaseTableComponents(components: {
|
|
3
|
+
SselectPage?: Component;
|
|
4
|
+
AutoComplete?: Component;
|
|
5
|
+
Cascader?: Component;
|
|
6
|
+
AreaCascader?: Component;
|
|
7
|
+
Upload?: Component;
|
|
8
|
+
}): void;
|
|
9
|
+
export declare function getRegisteredComponent(name: string): Component | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnyObject } from '../../../packages/shared/index.ts';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { ToolbarState } from '../state';
|
|
4
|
+
import { AreaCascaderToolbarItem } from '../types';
|
|
5
|
+
export declare function renderAreaCascader(config: AreaCascaderToolbarItem, toolbarState: ToolbarState, allValues?: AnyObject): VNode;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnyObject } from '../../../packages/shared/index.ts';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { ToolbarState } from '../state';
|
|
4
|
+
import { CascaderToolbarItem } from '../types';
|
|
5
|
+
export declare function renderCascader(config: CascaderToolbarItem, toolbarState: ToolbarState, allValues: AnyObject): VNode;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnyObject } from '../../../packages/shared/index.ts';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { ToolbarState } from '../state';
|
|
4
|
+
import { InputGroupToolbarItem } from '../types';
|
|
5
|
+
export declare function renderInputGroup(config: InputGroupToolbarItem, toolbarState: ToolbarState, formValues?: AnyObject): VNode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnyObject } from '../../../packages/shared/index.ts';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
import { ToolbarState } from '../state';
|
|
4
|
+
import { ToolbarItem } from '../types';
|
|
5
|
+
import { renderAreaCascader } from './AreaCascader';
|
|
6
|
+
import { renderAutoComplete } from './AutoComplete';
|
|
7
|
+
import { renderButton } from './Button';
|
|
8
|
+
import { renderCascader } from './Cascader';
|
|
9
|
+
import { renderCheckbox } from './Checkbox';
|
|
10
|
+
import { renderCheckboxGroup } from './CheckboxGroup';
|
|
11
|
+
import { renderDatePicker } from './DatePicker';
|
|
12
|
+
import { renderInput } from './Input';
|
|
13
|
+
import { renderInputGroup } from './InputGroup';
|
|
14
|
+
import { renderInputNumber } from './InputNumber';
|
|
15
|
+
import { renderInputPassword } from './InputPassword';
|
|
16
|
+
import { renderRadioGroup } from './RadioGroup';
|
|
17
|
+
import { renderSelect } from './Select';
|
|
18
|
+
import { renderSselectPage } from './SselectPage';
|
|
19
|
+
import { renderSwitch } from './Switch';
|
|
20
|
+
import { renderTreeSelect } from './TreeSelect';
|
|
21
|
+
import { renderUpload } from './Upload';
|
|
22
|
+
type Renderer = (item: ToolbarItem, toolbarState: ToolbarState, formValues?: AnyObject) => VNode;
|
|
23
|
+
export declare const rendererMap: Record<string, Renderer>;
|
|
24
|
+
export { renderAreaCascader, renderAutoComplete, renderButton, renderCascader, renderCheckbox, renderCheckboxGroup, renderDatePicker, renderInput, renderInputGroup, renderInputNumber, renderInputPassword, renderRadioGroup, renderSelect, renderSselectPage, renderSwitch, renderTreeSelect, renderUpload, };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ToolbarState {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
type ToolbarValue<T = any> = T | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* 工具栏状态管理组合式API
|
|
7
|
+
*/
|
|
8
|
+
export declare function useToolbarState(): {
|
|
9
|
+
state: {
|
|
10
|
+
readonly [x: string]: any;
|
|
11
|
+
};
|
|
12
|
+
setValue: (key: string, value: ToolbarValue) => void;
|
|
13
|
+
getValue: <T = any>(key: string) => ToolbarValue<T>;
|
|
14
|
+
clear: () => void;
|
|
15
|
+
getAllValues: () => {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export {};
|