rtcpts 0.0.18 → 0.0.20
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/components/j-q-button-dropdown/index.d.ts +190 -0
- package/dist/components/j-q-button-dropdown/types.d.ts +133 -0
- package/dist/components/j-q-confirm-dialog/index.d.ts +43 -20
- package/dist/components/j-q-confirm-dialog/types.d.ts +73 -0
- package/dist/components/j-q-table/pagination.d.ts +19 -20
- package/dist/global.d.ts +10 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/rtcpt-styles.css +1 -1
- package/dist/rtcpt.cjs.js +1 -1
- package/dist/rtcpt.es.js +1936 -1692
- package/package.json +1 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { PropType, Ref, SlotsType, DefineComponent, ExtractPropTypes, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
import { QBtnDropdown, QList, QItem, QItemSection, QItemLabel, QIcon, QBtnDropdownProps, ComponentConstructor } from 'quasar';
|
|
3
|
+
import { JQButtonDropdownSizeType, JQButtonDropdownTypeType, JQButtonDropdownItem, JQButtonDropdownSlots } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
6
|
+
/**
|
|
7
|
+
* 按钮标签文字
|
|
8
|
+
* @default ''
|
|
9
|
+
*/
|
|
10
|
+
label: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 下拉菜单项列表
|
|
16
|
+
* @default []
|
|
17
|
+
*/
|
|
18
|
+
items: {
|
|
19
|
+
type: PropType<JQButtonDropdownItem[]>;
|
|
20
|
+
default: () => never[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* 按钮大小
|
|
24
|
+
* @default 'large'
|
|
25
|
+
*/
|
|
26
|
+
size: {
|
|
27
|
+
type: PropType<JQButtonDropdownSizeType>;
|
|
28
|
+
default: "large";
|
|
29
|
+
validator: (value: JQButtonDropdownSizeType) => boolean;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 按钮类型
|
|
33
|
+
* @default 'primary'
|
|
34
|
+
*/
|
|
35
|
+
type: {
|
|
36
|
+
type: PropType<JQButtonDropdownTypeType>;
|
|
37
|
+
default: "primary";
|
|
38
|
+
validator: (value: JQButtonDropdownTypeType) => boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* 下拉箭头图标
|
|
42
|
+
* @default null
|
|
43
|
+
*/
|
|
44
|
+
dropdownIcon: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: null;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* 是否禁用
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
disabled: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* 菜单锚点位置(相对于按钮)
|
|
58
|
+
* @default 'bottom left'
|
|
59
|
+
*/
|
|
60
|
+
menuAnchor: {
|
|
61
|
+
type: PropType<QBtnDropdownProps["menuAnchor"]>;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* 菜单自身定位点
|
|
66
|
+
* @default 'top left'
|
|
67
|
+
*/
|
|
68
|
+
menuSelf: {
|
|
69
|
+
type: PropType<QBtnDropdownProps["menuSelf"]>;
|
|
70
|
+
default: string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* 菜单偏移量 [x, y]
|
|
74
|
+
* @default [0, 4]
|
|
75
|
+
*/
|
|
76
|
+
menuOffset: {
|
|
77
|
+
type: PropType<QBtnDropdownProps["menuOffset"]>;
|
|
78
|
+
default: () => number[];
|
|
79
|
+
};
|
|
80
|
+
}>, {
|
|
81
|
+
qBtnDropdownRef: Ref<QBtnDropdown | null, QBtnDropdown | null>;
|
|
82
|
+
computedClass: ComputedRef<{
|
|
83
|
+
[x: string]: boolean;
|
|
84
|
+
'j-q-button-dropdown': boolean;
|
|
85
|
+
}>;
|
|
86
|
+
computedIcon: ComputedRef<"app:dropdown-btn" | "app:dropdown-btn-white">;
|
|
87
|
+
filteredItems: ComputedRef<JQButtonDropdownItem[]>;
|
|
88
|
+
handleItemClick: (item: JQButtonDropdownItem) => void;
|
|
89
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
90
|
+
/**
|
|
91
|
+
* 选择菜单项事件
|
|
92
|
+
* @param item 选中的菜单项
|
|
93
|
+
*/
|
|
94
|
+
select: (item: JQButtonDropdownItem) => true;
|
|
95
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
96
|
+
/**
|
|
97
|
+
* 按钮标签文字
|
|
98
|
+
* @default ''
|
|
99
|
+
*/
|
|
100
|
+
label: {
|
|
101
|
+
type: StringConstructor;
|
|
102
|
+
default: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* 下拉菜单项列表
|
|
106
|
+
* @default []
|
|
107
|
+
*/
|
|
108
|
+
items: {
|
|
109
|
+
type: PropType<JQButtonDropdownItem[]>;
|
|
110
|
+
default: () => never[];
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* 按钮大小
|
|
114
|
+
* @default 'large'
|
|
115
|
+
*/
|
|
116
|
+
size: {
|
|
117
|
+
type: PropType<JQButtonDropdownSizeType>;
|
|
118
|
+
default: "large";
|
|
119
|
+
validator: (value: JQButtonDropdownSizeType) => boolean;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* 按钮类型
|
|
123
|
+
* @default 'primary'
|
|
124
|
+
*/
|
|
125
|
+
type: {
|
|
126
|
+
type: PropType<JQButtonDropdownTypeType>;
|
|
127
|
+
default: "primary";
|
|
128
|
+
validator: (value: JQButtonDropdownTypeType) => boolean;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* 下拉箭头图标
|
|
132
|
+
* @default null
|
|
133
|
+
*/
|
|
134
|
+
dropdownIcon: {
|
|
135
|
+
type: StringConstructor;
|
|
136
|
+
default: null;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* 是否禁用
|
|
140
|
+
* @default false
|
|
141
|
+
*/
|
|
142
|
+
disabled: {
|
|
143
|
+
type: BooleanConstructor;
|
|
144
|
+
default: boolean;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* 菜单锚点位置(相对于按钮)
|
|
148
|
+
* @default 'bottom left'
|
|
149
|
+
*/
|
|
150
|
+
menuAnchor: {
|
|
151
|
+
type: PropType<QBtnDropdownProps["menuAnchor"]>;
|
|
152
|
+
default: string;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* 菜单自身定位点
|
|
156
|
+
* @default 'top left'
|
|
157
|
+
*/
|
|
158
|
+
menuSelf: {
|
|
159
|
+
type: PropType<QBtnDropdownProps["menuSelf"]>;
|
|
160
|
+
default: string;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* 菜单偏移量 [x, y]
|
|
164
|
+
* @default [0, 4]
|
|
165
|
+
*/
|
|
166
|
+
menuOffset: {
|
|
167
|
+
type: PropType<QBtnDropdownProps["menuOffset"]>;
|
|
168
|
+
default: () => number[];
|
|
169
|
+
};
|
|
170
|
+
}>> & Readonly<{
|
|
171
|
+
onSelect?: ((item: JQButtonDropdownItem) => any) | undefined;
|
|
172
|
+
}>, {
|
|
173
|
+
type: JQButtonDropdownTypeType;
|
|
174
|
+
size: JQButtonDropdownSizeType;
|
|
175
|
+
label: string;
|
|
176
|
+
dropdownIcon: string;
|
|
177
|
+
menuAnchor: "top middle" | "top left" | "top right" | "top start" | "top end" | "center left" | "center middle" | "center right" | "center start" | "center end" | "bottom left" | "bottom middle" | "bottom right" | "bottom start" | "bottom end" | undefined;
|
|
178
|
+
menuSelf: "top middle" | "top left" | "top right" | "top start" | "top end" | "center left" | "center middle" | "center right" | "center start" | "center end" | "bottom left" | "bottom middle" | "bottom right" | "bottom start" | "bottom end" | undefined;
|
|
179
|
+
menuOffset: readonly any[] | undefined;
|
|
180
|
+
disabled: boolean;
|
|
181
|
+
items: JQButtonDropdownItem[];
|
|
182
|
+
}, SlotsType<JQButtonDropdownSlots>, {
|
|
183
|
+
QBtnDropdown: ComponentConstructor<QBtnDropdown>;
|
|
184
|
+
QList: ComponentConstructor<QList>;
|
|
185
|
+
QItem: ComponentConstructor<QItem>;
|
|
186
|
+
QItemSection: ComponentConstructor<QItemSection>;
|
|
187
|
+
QItemLabel: ComponentConstructor<QItemLabel>;
|
|
188
|
+
QIcon: ComponentConstructor<QIcon>;
|
|
189
|
+
}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
190
|
+
export default _default;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { QBtnDropdownProps } from 'quasar';
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
export declare const JQButtonDropdownSize: {
|
|
4
|
+
readonly LARGE: "large";
|
|
5
|
+
readonly NORMAL: "normal";
|
|
6
|
+
readonly SMALL: "small";
|
|
7
|
+
};
|
|
8
|
+
export declare const JQButtonDropdownType: {
|
|
9
|
+
readonly PRIMARY: "primary";
|
|
10
|
+
readonly SECONDARY: "secondary";
|
|
11
|
+
};
|
|
12
|
+
/** 按钮尺寸类型 */
|
|
13
|
+
export type JQButtonDropdownSizeType = (typeof JQButtonDropdownSize)[keyof typeof JQButtonDropdownSize];
|
|
14
|
+
/** 按钮类型 */
|
|
15
|
+
export type JQButtonDropdownTypeType = (typeof JQButtonDropdownType)[keyof typeof JQButtonDropdownType];
|
|
16
|
+
/** 下拉菜单项接口 */
|
|
17
|
+
export interface JQButtonDropdownItem {
|
|
18
|
+
/** 显示标签 */
|
|
19
|
+
label: string;
|
|
20
|
+
/** 选项值 */
|
|
21
|
+
value?: string | number;
|
|
22
|
+
/** 是否禁用 */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** 图标 */
|
|
25
|
+
icon?: string;
|
|
26
|
+
/** 点击回调 */
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
/** 权限码,用于权限控制,不传则默认显示 */
|
|
29
|
+
code?: string | null;
|
|
30
|
+
}
|
|
31
|
+
/** JQButtonDropdown Props 接口 */
|
|
32
|
+
export interface JQButtonDropdownProps {
|
|
33
|
+
/**
|
|
34
|
+
* 按钮标签文字
|
|
35
|
+
*/
|
|
36
|
+
label?: string;
|
|
37
|
+
/**
|
|
38
|
+
* 下拉菜单项列表
|
|
39
|
+
* @default []
|
|
40
|
+
* @description 下拉菜单项列表
|
|
41
|
+
* @type {JQButtonDropdownItem[]}
|
|
42
|
+
* @example
|
|
43
|
+
* [
|
|
44
|
+
* {
|
|
45
|
+
* label: '选项1',
|
|
46
|
+
* value: 'option1',
|
|
47
|
+
* disabled: false,
|
|
48
|
+
* icon: 'app:icon-name', // Optional, Quasar icon name
|
|
49
|
+
* onClick: () => {
|
|
50
|
+
* console.log('选项1被点击'); // Optional, 点击回调
|
|
51
|
+
* },
|
|
52
|
+
* }
|
|
53
|
+
* ]
|
|
54
|
+
*/
|
|
55
|
+
items?: JQButtonDropdownItem[];
|
|
56
|
+
/**
|
|
57
|
+
* 按钮大小
|
|
58
|
+
* @default 'large'
|
|
59
|
+
* @values 'large' | 'normal' | 'small'
|
|
60
|
+
*/
|
|
61
|
+
size?: JQButtonDropdownSizeType;
|
|
62
|
+
/**
|
|
63
|
+
* 按钮类型
|
|
64
|
+
* @default 'primary'
|
|
65
|
+
* @values 'primary' | 'secondary'
|
|
66
|
+
*/
|
|
67
|
+
type?: JQButtonDropdownTypeType;
|
|
68
|
+
/**
|
|
69
|
+
* 下拉箭头图标
|
|
70
|
+
* @default null
|
|
71
|
+
*/
|
|
72
|
+
dropdownIcon?: string;
|
|
73
|
+
/**
|
|
74
|
+
* 是否禁用
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* 菜单锚点位置(相对于按钮)
|
|
80
|
+
* @default 'bottom left'
|
|
81
|
+
*/
|
|
82
|
+
menuAnchor?: string;
|
|
83
|
+
/**
|
|
84
|
+
* 菜单自身定位点
|
|
85
|
+
* @default 'top left'
|
|
86
|
+
*/
|
|
87
|
+
menuSelf?: string;
|
|
88
|
+
/**
|
|
89
|
+
* 菜单偏移量 [x, y]
|
|
90
|
+
* @default [0, 4]
|
|
91
|
+
*/
|
|
92
|
+
menuOffset?: [number, number];
|
|
93
|
+
}
|
|
94
|
+
/** JQButtonDropdown Emits 接口 */
|
|
95
|
+
export interface JQButtonDropdownEmits {
|
|
96
|
+
/**
|
|
97
|
+
* 选择菜单项事件
|
|
98
|
+
* @param item 选中的菜单项
|
|
99
|
+
*/
|
|
100
|
+
(e: 'select', item: JQButtonDropdownItem): void;
|
|
101
|
+
}
|
|
102
|
+
/** JQButtonDropdown Slots 接口 */
|
|
103
|
+
export interface JQButtonDropdownSlots {
|
|
104
|
+
/** 默认插槽,用于自定义下拉菜单内容 */
|
|
105
|
+
default?: () => any;
|
|
106
|
+
/** 标签插槽,用于自定义按钮标签 */
|
|
107
|
+
label?: () => any;
|
|
108
|
+
}
|
|
109
|
+
/** JQButtonDropdown 暴露的方法和属性 */
|
|
110
|
+
export interface JQButtonDropdownExpose {
|
|
111
|
+
/** 获取内部 QBtnDropdown 组件的 DOM 元素 */
|
|
112
|
+
$el: HTMLElement | undefined;
|
|
113
|
+
/** 显示下拉菜单 */
|
|
114
|
+
show: () => void;
|
|
115
|
+
/** 隐藏下拉菜单 */
|
|
116
|
+
hide: () => void;
|
|
117
|
+
/** 切换下拉菜单 */
|
|
118
|
+
toggle: () => void;
|
|
119
|
+
}
|
|
120
|
+
/** 合并后的完整 Props 类型 (包含 QBtnDropdown 的 Props) */
|
|
121
|
+
export type JQButtonDropdownAllProps = JQButtonDropdownProps & Omit<QBtnDropdownProps, keyof JQButtonDropdownProps>;
|
|
122
|
+
/** Emits 配置对象格式 (用于 DefineComponent) */
|
|
123
|
+
export type JQButtonDropdownEmitsOptions = {
|
|
124
|
+
/**
|
|
125
|
+
* 选择菜单项事件
|
|
126
|
+
* @param item 选中的菜单项
|
|
127
|
+
*/
|
|
128
|
+
select: (item: JQButtonDropdownItem) => true;
|
|
129
|
+
};
|
|
130
|
+
/** JQButtonDropdown 组件类型定义 */
|
|
131
|
+
export type JQButtonDropdownComponent = DefineComponent<JQButtonDropdownAllProps, JQButtonDropdownExpose, {}, {}, {}, {}, {}, JQButtonDropdownEmitsOptions>;
|
|
132
|
+
/** JQButtonDropdown 实例类型 - 用于 ref 类型定义 */
|
|
133
|
+
export type JQButtonDropdownInstance = InstanceType<JQButtonDropdownComponent> & JQButtonDropdownExpose;
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import { QVueGlobals } from 'quasar';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
confirmButtonText?: string;
|
|
6
|
-
cancelButtonText?: string;
|
|
7
|
-
showCancelButton?: boolean;
|
|
8
|
-
color?: string;
|
|
9
|
-
isDelete?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export interface IGlobalConfirm {
|
|
12
|
-
show: (params: ShowParams) => Promise<boolean>;
|
|
13
|
-
setQuasarInstance: (instance: QVueGlobals) => void;
|
|
14
|
-
}
|
|
15
|
-
declare class GlobalConfirm implements IGlobalConfirm {
|
|
2
|
+
import { JQConfirmDialogShowParams, IJQConfirmDialog } from './types';
|
|
3
|
+
export type { JQConfirmDialogShowParams, IJQConfirmDialog } from './types';
|
|
4
|
+
declare class GlobalConfirm implements IJQConfirmDialog {
|
|
16
5
|
/**
|
|
17
6
|
* 设置 Quasar 实例(在 rtcptInit 中调用)
|
|
18
7
|
*/
|
|
@@ -20,13 +9,33 @@ declare class GlobalConfirm implements IGlobalConfirm {
|
|
|
20
9
|
/**
|
|
21
10
|
* 弹出自定义确认对话框,返回一个 Promise,resolve(true) 表示确定,resolve(false) 表示取消/关闭。
|
|
22
11
|
*/
|
|
23
|
-
show({ title, color, content, confirmButtonText, cancelButtonText, showCancelButton, isDelete }:
|
|
12
|
+
show({ title, color, content, confirmButtonText, cancelButtonText, showCancelButton, isDelete, icon, showClose }: JQConfirmDialogShowParams): Promise<boolean>;
|
|
24
13
|
}
|
|
25
14
|
declare const globalConfirm: GlobalConfirm;
|
|
26
15
|
export default globalConfirm;
|
|
27
|
-
|
|
16
|
+
: StringConstructor;
|
|
28
17
|
default: string;
|
|
29
18
|
};
|
|
19
|
+
cancel: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
default: boolean;
|
|
22
|
+
};
|
|
23
|
+
isDelete: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
color: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
icon: {
|
|
32
|
+
type: PropType<string | VNode | VueComponent>;
|
|
33
|
+
default: null;
|
|
34
|
+
};
|
|
35
|
+
showClose: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
30
39
|
}>, {
|
|
31
40
|
dialogRef: Ref<QDialog | undefined, QDialog | undefined>;
|
|
32
41
|
onDialogHide: () => void;
|
|
@@ -35,6 +44,8 @@ export default globalConfirm;
|
|
|
35
44
|
computedCancelText: ComputedRef<string>;
|
|
36
45
|
computedConfirmText: ComputedRef<string>;
|
|
37
46
|
computedButtonColor: ComputedRef<string>;
|
|
47
|
+
isIconString: ComputedRef<boolean>;
|
|
48
|
+
onCloseClick: () => void;
|
|
38
49
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("hide" | "ok")[], "hide" | "ok", PublicProps, Readonly< ExtractPropTypes<{
|
|
39
50
|
title: {
|
|
40
51
|
type: StringConstructor;
|
|
@@ -64,17 +75,29 @@ export default globalConfirm;
|
|
|
64
75
|
type: StringConstructor;
|
|
65
76
|
default: string;
|
|
66
77
|
};
|
|
78
|
+
icon: {
|
|
79
|
+
type: PropType<string | VNode | VueComponent>;
|
|
80
|
+
default: null;
|
|
81
|
+
};
|
|
82
|
+
showClose: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
67
86
|
}>> & Readonly<{
|
|
68
87
|
onHide?: ((...args: any[]) => any) | undefined;
|
|
69
88
|
onOk?: ((...args: any[]) => any) | undefined;
|
|
70
89
|
}>, {
|
|
71
90
|
color: string;
|
|
72
91
|
title: string;
|
|
92
|
+
icon: string | VNode< RendererNode, RendererElement, {
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
}> | VueComponent;
|
|
73
95
|
content: string;
|
|
74
96
|
cancel: boolean;
|
|
75
97
|
confirmButtonText: string;
|
|
76
98
|
cancelButtonText: string;
|
|
77
99
|
isDelete: boolean;
|
|
100
|
+
showClose: boolean;
|
|
78
101
|
}, {}, {
|
|
79
102
|
QDialog: ComponentConstructor<QDialog>;
|
|
80
103
|
QCard: ComponentConstructor<QCard>;
|
|
@@ -82,12 +105,12 @@ export default globalConfirm;
|
|
|
82
105
|
QIcon: ComponentConstructor<QIcon>;
|
|
83
106
|
JQButton: DefineComponent<ExtractPropTypes<{
|
|
84
107
|
size: {
|
|
85
|
-
type: PropType<JQButtonSizeType>;
|
|
108
|
+
type: PropType< JQButtonSizeType>;
|
|
86
109
|
default: "large";
|
|
87
110
|
validator: (value: JQButtonSizeType) => boolean;
|
|
88
111
|
};
|
|
89
112
|
type: {
|
|
90
|
-
type: PropType<JQButtonTypeType>;
|
|
113
|
+
type: PropType< JQButtonTypeType>;
|
|
91
114
|
default: "primary";
|
|
92
115
|
validator: (value: JQButtonTypeType) => boolean;
|
|
93
116
|
};
|
|
@@ -129,12 +152,12 @@ export default globalConfirm;
|
|
|
129
152
|
click: (e: Event) => true;
|
|
130
153
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
131
154
|
size: {
|
|
132
|
-
type: PropType<JQButtonSizeType>;
|
|
155
|
+
type: PropType< JQButtonSizeType>;
|
|
133
156
|
default: "large";
|
|
134
157
|
validator: (value: JQButtonSizeType) => boolean;
|
|
135
158
|
};
|
|
136
159
|
type: {
|
|
137
|
-
type: PropType<JQButtonTypeType>;
|
|
160
|
+
type: PropType< JQButtonTypeType>;
|
|
138
161
|
default: "primary";
|
|
139
162
|
validator: (value: JQButtonTypeType) => boolean;
|
|
140
163
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { QVueGlobals } from 'quasar';
|
|
2
|
+
import { VNode, Component } from 'vue';
|
|
3
|
+
/** JQConfirmDialog 显示参数接口 */
|
|
4
|
+
export interface JQConfirmDialogShowParams {
|
|
5
|
+
/**
|
|
6
|
+
* 对话框标题
|
|
7
|
+
* @description 显示在对话框顶部的标题文字
|
|
8
|
+
*/
|
|
9
|
+
title: string;
|
|
10
|
+
/**
|
|
11
|
+
* 对话框内容
|
|
12
|
+
* @description 支持 HTML 标签,如 <b></b>
|
|
13
|
+
*/
|
|
14
|
+
content: string;
|
|
15
|
+
/**
|
|
16
|
+
* 确认按钮文本
|
|
17
|
+
* @default i18n('action.confirm')
|
|
18
|
+
* @description 自定义确认按钮的显示文字
|
|
19
|
+
*/
|
|
20
|
+
confirmButtonText?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 取消按钮文本
|
|
23
|
+
* @default i18n('action.cancel')
|
|
24
|
+
* @description 自定义取消按钮的显示文字
|
|
25
|
+
*/
|
|
26
|
+
cancelButtonText?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 是否显示取消按钮
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
showCancelButton?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 确认按钮颜色
|
|
34
|
+
* @default 'primary',isDelete 为 true 时默认 'negative'
|
|
35
|
+
* @description Quasar 颜色值
|
|
36
|
+
*/
|
|
37
|
+
color?: string;
|
|
38
|
+
/**
|
|
39
|
+
* 是否为删除确认对话框
|
|
40
|
+
* @default false
|
|
41
|
+
* @description 影响默认图标和按钮颜色
|
|
42
|
+
*/
|
|
43
|
+
isDelete?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 自定义图标
|
|
46
|
+
* @default undefined
|
|
47
|
+
* @description 可以是 Quasar 图标名称字符串或 Vue 组件
|
|
48
|
+
*/
|
|
49
|
+
icon?: string | VNode | Component;
|
|
50
|
+
/**
|
|
51
|
+
* 是否显示关闭按钮
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
showClose?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** @deprecated 使用 JQConfirmDialogShowParams 代替 */
|
|
57
|
+
export type ShowParams = JQConfirmDialogShowParams;
|
|
58
|
+
/** JQConfirmDialog 全局实例接口 */
|
|
59
|
+
export interface IJQConfirmDialog {
|
|
60
|
+
/**
|
|
61
|
+
* 显示确认对话框
|
|
62
|
+
* @param params 对话框配置参数
|
|
63
|
+
* @returns Promise<boolean> 确认返回 true,取消/关闭返回 false
|
|
64
|
+
*/
|
|
65
|
+
show: (params: JQConfirmDialogShowParams) => Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* 设置 Quasar 实例(在 rtcptInit 中调用)
|
|
68
|
+
* @param instance Quasar 全局实例
|
|
69
|
+
*/
|
|
70
|
+
setQuasarInstance: (instance: QVueGlobals) => void;
|
|
71
|
+
}
|
|
72
|
+
/** @deprecated 使用 IJQConfirmDialog 代替 */
|
|
73
|
+
export type IGlobalConfirm = IJQConfirmDialog;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { t } from '../../composables/useI18n.ts';
|
|
4
|
-
export interface PaginationInfo {
|
|
1
|
+
export type PaginationParameter = Pick<Paginator, 'page' | 'rowsPerPage'>;
|
|
2
|
+
export interface Paginator {
|
|
5
3
|
page: number;
|
|
6
4
|
rowsPerPage: number;
|
|
7
5
|
rowsNumber: number;
|
|
8
6
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
export type UsePaginationOptions = {
|
|
8
|
+
page?: number;
|
|
9
|
+
rowsPerPage?: number;
|
|
10
|
+
rowsNumber?: number;
|
|
11
|
+
};
|
|
12
|
+
export type UsePaginationReturn = {
|
|
13
|
+
paginationInfo: Paginator;
|
|
14
|
+
getNum: () => number;
|
|
15
|
+
getPaginationParam: () => PaginationParameter;
|
|
16
|
+
setNum: (value?: number) => void;
|
|
17
|
+
setSize: (value?: number) => void;
|
|
18
|
+
setTotal: (value?: number) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const DEFAULT_ROWS_PER_PAGE = 15;
|
|
21
|
+
export declare const ROWS_PER_PAGE_OPTIONS: number[];
|
|
22
|
+
export declare function usePagination(options?: UsePaginationOptions): UsePaginationReturn;
|
|
23
|
+
rowsPerPage: number;
|
|
25
24
|
rowsNumber: number;
|
|
26
25
|
};
|
|
27
26
|
rowNumbersArr: number[];
|
package/dist/global.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JQButtonTemplateProps, JQButtonSlots, JQButtonEmits } from './components/j-q-button/types';
|
|
2
|
+
import { JQButtonDropdownProps, JQButtonDropdownSlots, JQButtonDropdownEmits } from './components/j-q-button-dropdown/types';
|
|
2
3
|
import { JQConfirmTemplateProps, JQConfirmSlots, JQConfirmEmits } from './components/j-q-confirm/types';
|
|
3
4
|
declare module 'vue' {
|
|
4
5
|
export interface GlobalComponents {
|
|
@@ -11,6 +12,15 @@ declare module 'vue' {
|
|
|
11
12
|
$emit: JQButtonEmits;
|
|
12
13
|
};
|
|
13
14
|
|
|
15
|
+
/**
|
|
16
|
+
* JQButtonDropdown - JQButtonDropdown 组件
|
|
17
|
+
*/
|
|
18
|
+
JQButtonDropdown: new () => {
|
|
19
|
+
$props: JQButtonDropdownProps;
|
|
20
|
+
$slots: JQButtonDropdownSlots;
|
|
21
|
+
$emit: JQButtonDropdownEmits;
|
|
22
|
+
};
|
|
23
|
+
|
|
14
24
|
/**
|
|
15
25
|
* JQConfirm - JQConfirm 组件
|
|
16
26
|
*/
|