@weitutech/by-components-v3 1.1.11 → 1.1.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/dist/by-component-v3.css +1 -1
- package/dist/by-component-v3.js +420 -53
- package/dist/by-component-v3.umd.cjs +1 -1
- package/dist/types/packages/index.d.ts +1 -0
- package/dist/types/packages/table/src/table.d.ts +9 -0
- package/dist/types/packages/tool-bar/ByToolBar.vue.d.ts +25 -0
- package/dist/types/packages/tool-bar/ToolBarType.d.ts +57 -0
- package/dist/types/packages/tool-bar/index.d.ts +3 -0
- package/dist/types/src/config.d.ts +0 -3
- package/dist/types/src/toolbar-config.d.ts +70 -0
- package/package.json +1 -1
- package/src/main.ts +7 -0
|
@@ -12,6 +12,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
12
12
|
type: BooleanConstructor;
|
|
13
13
|
default: boolean;
|
|
14
14
|
};
|
|
15
|
+
loading: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
15
19
|
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
20
|
gridOptions: {
|
|
17
21
|
type: ObjectConstructor;
|
|
@@ -25,10 +29,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
25
29
|
type: BooleanConstructor;
|
|
26
30
|
default: boolean;
|
|
27
31
|
};
|
|
32
|
+
loading: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
28
36
|
}>> & Readonly<{
|
|
29
37
|
[x: `on${Capitalize<string>}`]: (...args: any[]) => any;
|
|
30
38
|
}>, {
|
|
31
39
|
name: string;
|
|
32
40
|
autoHeight: boolean;
|
|
41
|
+
loading: boolean;
|
|
33
42
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
34
43
|
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ToolBarItem, type ToolBarActionEvent } from './ToolBarType';
|
|
2
|
+
import './ByToolBar.scss';
|
|
3
|
+
interface Props {
|
|
4
|
+
items?: ToolBarItem[];
|
|
5
|
+
}
|
|
6
|
+
declare var __VLS_29: string, __VLS_30: {}, __VLS_60: string, __VLS_61: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
[K in NonNullable<typeof __VLS_29>]?: (props: typeof __VLS_30) => any;
|
|
9
|
+
} & {
|
|
10
|
+
[K in NonNullable<typeof __VLS_60>]?: (props: typeof __VLS_61) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
+
action: (event: ToolBarActionEvent) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
15
|
+
onAction?: (event: ToolBarActionEvent) => any;
|
|
16
|
+
}>, {
|
|
17
|
+
items: ToolBarItem[];
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工具栏组件类型
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ToolBarItemType {
|
|
5
|
+
Text = "text",
|
|
6
|
+
Button = "button",
|
|
7
|
+
RadioGroup = "radio-group",
|
|
8
|
+
Select = "select",
|
|
9
|
+
Input = "input"
|
|
10
|
+
}
|
|
11
|
+
export interface ToolBarItem {
|
|
12
|
+
type?: ToolBarItemType;
|
|
13
|
+
name?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
position?: 'left' | 'right';
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
slot?: string;
|
|
19
|
+
props?: ToolBarItemProps;
|
|
20
|
+
radios?: ToolBarItemRadio[];
|
|
21
|
+
asyncOptions?: ToolBarItemOption[];
|
|
22
|
+
}
|
|
23
|
+
export interface ToolBarItemOption {
|
|
24
|
+
label: string;
|
|
25
|
+
value: any;
|
|
26
|
+
}
|
|
27
|
+
export interface ToolBarItemRadio {
|
|
28
|
+
label: string;
|
|
29
|
+
value: any;
|
|
30
|
+
}
|
|
31
|
+
export interface ToolBarItemProps {
|
|
32
|
+
size?: string;
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
options?: ToolBarItemOption[];
|
|
35
|
+
loadOptions?: () => Promise<ToolBarItemOption[]>;
|
|
36
|
+
icon?: string;
|
|
37
|
+
fontSize?: string;
|
|
38
|
+
color?: string;
|
|
39
|
+
maxWidth?: string;
|
|
40
|
+
width?: string;
|
|
41
|
+
children?: string;
|
|
42
|
+
innerHTML?: string;
|
|
43
|
+
onlyShowPlaceholder?: boolean;
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}
|
|
46
|
+
export interface LoadedOptions {
|
|
47
|
+
[key: string]: {
|
|
48
|
+
loading: boolean;
|
|
49
|
+
options: ToolBarItemOption[];
|
|
50
|
+
loaded?: boolean;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface ToolBarActionEvent {
|
|
54
|
+
type: string;
|
|
55
|
+
item: ToolBarItem;
|
|
56
|
+
payload: any;
|
|
57
|
+
}
|
|
@@ -435,7 +435,6 @@ export declare const tableConfig: import("vue").Ref<{
|
|
|
435
435
|
isPagination: boolean;
|
|
436
436
|
}>;
|
|
437
437
|
export declare const gridOptions: import("vue").Ref<{
|
|
438
|
-
autoHeight: boolean;
|
|
439
438
|
align: string;
|
|
440
439
|
pagerConfig: {
|
|
441
440
|
pageSize: number;
|
|
@@ -531,7 +530,6 @@ export declare const gridOptions: import("vue").Ref<{
|
|
|
531
530
|
department_name: string;
|
|
532
531
|
}[];
|
|
533
532
|
}, {
|
|
534
|
-
autoHeight: boolean;
|
|
535
533
|
align: string;
|
|
536
534
|
pagerConfig: {
|
|
537
535
|
pageSize: number;
|
|
@@ -627,7 +625,6 @@ export declare const gridOptions: import("vue").Ref<{
|
|
|
627
625
|
department_name: string;
|
|
628
626
|
}[];
|
|
629
627
|
} | {
|
|
630
|
-
autoHeight: boolean;
|
|
631
628
|
align: string;
|
|
632
629
|
pagerConfig: {
|
|
633
630
|
pageSize: number;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ToolBarItemType, type ToolBarItem } from '../packages/tool-bar/ToolBarType';
|
|
2
|
+
export declare const toolBarItems: import("vue").Ref<{
|
|
3
|
+
type?: ToolBarItemType;
|
|
4
|
+
name?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
position?: "left" | "right";
|
|
7
|
+
hidden?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
slot?: string;
|
|
10
|
+
props?: {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
size?: string;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
options?: {
|
|
15
|
+
label: string;
|
|
16
|
+
value: any;
|
|
17
|
+
}[];
|
|
18
|
+
loadOptions?: () => Promise<import("../packages/tool-bar/ToolBarType").ToolBarItemOption[]>;
|
|
19
|
+
icon?: string;
|
|
20
|
+
fontSize?: string;
|
|
21
|
+
color?: string;
|
|
22
|
+
maxWidth?: string;
|
|
23
|
+
width?: string;
|
|
24
|
+
children?: string;
|
|
25
|
+
innerHTML?: string;
|
|
26
|
+
onlyShowPlaceholder?: boolean;
|
|
27
|
+
};
|
|
28
|
+
radios?: {
|
|
29
|
+
label: string;
|
|
30
|
+
value: any;
|
|
31
|
+
}[];
|
|
32
|
+
asyncOptions?: {
|
|
33
|
+
label: string;
|
|
34
|
+
value: any;
|
|
35
|
+
}[];
|
|
36
|
+
}[], ToolBarItem[] | {
|
|
37
|
+
type?: ToolBarItemType;
|
|
38
|
+
name?: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
position?: "left" | "right";
|
|
41
|
+
hidden?: boolean;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
slot?: string;
|
|
44
|
+
props?: {
|
|
45
|
+
[x: string]: any;
|
|
46
|
+
size?: string;
|
|
47
|
+
loading?: boolean;
|
|
48
|
+
options?: {
|
|
49
|
+
label: string;
|
|
50
|
+
value: any;
|
|
51
|
+
}[];
|
|
52
|
+
loadOptions?: () => Promise<import("../packages/tool-bar/ToolBarType").ToolBarItemOption[]>;
|
|
53
|
+
icon?: string;
|
|
54
|
+
fontSize?: string;
|
|
55
|
+
color?: string;
|
|
56
|
+
maxWidth?: string;
|
|
57
|
+
width?: string;
|
|
58
|
+
children?: string;
|
|
59
|
+
innerHTML?: string;
|
|
60
|
+
onlyShowPlaceholder?: boolean;
|
|
61
|
+
};
|
|
62
|
+
radios?: {
|
|
63
|
+
label: string;
|
|
64
|
+
value: any;
|
|
65
|
+
}[];
|
|
66
|
+
asyncOptions?: {
|
|
67
|
+
label: string;
|
|
68
|
+
value: any;
|
|
69
|
+
}[];
|
|
70
|
+
}[]>;
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -11,6 +11,7 @@ import ByComponentsV3 from '../packages/index'
|
|
|
11
11
|
import ElementPlus from 'element-plus'
|
|
12
12
|
import 'element-plus/dist/index.css'
|
|
13
13
|
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
14
|
+
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
14
15
|
// import VxeTable from 'vxe-table'
|
|
15
16
|
// import 'vxe-table/lib/style.css'
|
|
16
17
|
import VxeUI from 'vxe-pc-ui'
|
|
@@ -19,6 +20,12 @@ import VxeUITable from 'vxe-table'
|
|
|
19
20
|
import 'vxe-table/lib/style.css'
|
|
20
21
|
import './style/index.scss'
|
|
21
22
|
const app = createApp(App)
|
|
23
|
+
|
|
24
|
+
// 注册所有图标
|
|
25
|
+
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
26
|
+
app.component(key, component)
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
app
|
|
23
30
|
.use(ElementPlus, {
|
|
24
31
|
locale: zhCn,
|