@weitutech/by-components-v3 1.1.10 → 1.1.12
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 +423 -54
- 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 +56 -0
- package/dist/types/packages/tool-bar/index.d.ts +3 -0
- package/dist/types/src/toolbar-config.d.ts +68 -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,56 @@
|
|
|
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
|
+
[key: string]: any;
|
|
44
|
+
}
|
|
45
|
+
export interface LoadedOptions {
|
|
46
|
+
[key: string]: {
|
|
47
|
+
loading: boolean;
|
|
48
|
+
options: ToolBarItemOption[];
|
|
49
|
+
loaded?: boolean;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export interface ToolBarActionEvent {
|
|
53
|
+
type: string;
|
|
54
|
+
item: ToolBarItem;
|
|
55
|
+
payload: any;
|
|
56
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
};
|
|
27
|
+
radios?: {
|
|
28
|
+
label: string;
|
|
29
|
+
value: any;
|
|
30
|
+
}[];
|
|
31
|
+
asyncOptions?: {
|
|
32
|
+
label: string;
|
|
33
|
+
value: any;
|
|
34
|
+
}[];
|
|
35
|
+
}[], ToolBarItem[] | {
|
|
36
|
+
type?: ToolBarItemType;
|
|
37
|
+
name?: string;
|
|
38
|
+
label?: string;
|
|
39
|
+
position?: "left" | "right";
|
|
40
|
+
hidden?: boolean;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
slot?: string;
|
|
43
|
+
props?: {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
size?: string;
|
|
46
|
+
loading?: boolean;
|
|
47
|
+
options?: {
|
|
48
|
+
label: string;
|
|
49
|
+
value: any;
|
|
50
|
+
}[];
|
|
51
|
+
loadOptions?: () => Promise<import("../packages/tool-bar/ToolBarType").ToolBarItemOption[]>;
|
|
52
|
+
icon?: string;
|
|
53
|
+
fontSize?: string;
|
|
54
|
+
color?: string;
|
|
55
|
+
maxWidth?: string;
|
|
56
|
+
width?: string;
|
|
57
|
+
children?: string;
|
|
58
|
+
innerHTML?: string;
|
|
59
|
+
};
|
|
60
|
+
radios?: {
|
|
61
|
+
label: string;
|
|
62
|
+
value: any;
|
|
63
|
+
}[];
|
|
64
|
+
asyncOptions?: {
|
|
65
|
+
label: string;
|
|
66
|
+
value: any;
|
|
67
|
+
}[];
|
|
68
|
+
}[]>;
|
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,
|