twcpt 0.0.13 → 0.0.15
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-tw-amap/composables/useAMapCore.d.ts +19 -0
- package/dist/components/j-tw-amap/composables/useAMapPoints.d.ts +277 -0
- package/dist/components/j-tw-amap/composables/useAMapPolyline.d.ts +16 -0
- package/dist/components/j-tw-amap/composables/useAMapTrack.d.ts +159 -0
- package/dist/components/j-tw-amap/constants.d.ts +23 -0
- package/dist/components/j-tw-amap/index.d.ts +175 -0
- package/dist/components/j-tw-amap/types.d.ts +44 -0
- package/dist/components/j-tw-amap/utils/coordinate.d.ts +17 -0
- package/dist/components/j-tw-amap/utils/loader.d.ts +12 -0
- package/dist/components/j-tw-amap/utils/parse.d.ts +17 -0
- package/dist/components/j-tw-dialog/index.d.ts +25 -0
- package/dist/components/j-tw-dialog/types.d.ts +12 -0
- package/dist/components/j-tw-pagination/index.d.ts +189 -0
- package/dist/components/j-tw-pagination/types.d.ts +40 -0
- package/dist/components/j-tw-table/index.d.ts +326 -237
- package/dist/global.d.ts +20 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/twcpt-styles.css +1 -1
- package/dist/twcpt.cjs.js +63 -5
- package/dist/twcpt.es.js +6687 -2669
- package/dist/types/coordtransform.d.ts +49 -0
- package/dist/utils/init.d.ts +4 -0
- package/dist/utils/useRAFPolling.d.ts +13 -0
- package/package.json +10 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AMapComponent 公共类型定义
|
|
3
|
+
*/
|
|
4
|
+
/** 经纬度 [lng, lat] */
|
|
5
|
+
export type LngLat = [number, number];
|
|
6
|
+
/** 路径:单条为 LngLat[],多航线为 LngLat[][] */
|
|
7
|
+
export type PathInput = LngLat[] | LngLat[][];
|
|
8
|
+
/** 地图类型 */
|
|
9
|
+
export type MapType = 'normal' | 'satellite';
|
|
10
|
+
/** 视图模式 */
|
|
11
|
+
export type ViewMode = '2D' | '3D';
|
|
12
|
+
/** 点位类型 */
|
|
13
|
+
export type PointType = 'drone' | 'base';
|
|
14
|
+
/** 点位数据(支持多种字段名) */
|
|
15
|
+
export interface MapPointItem {
|
|
16
|
+
longitude?: number;
|
|
17
|
+
latitude?: number;
|
|
18
|
+
name?: string;
|
|
19
|
+
nickName?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
link?: string;
|
|
22
|
+
url?: string;
|
|
23
|
+
onClick?: (point: MapPointItem) => void;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
/** 组件 Props 类型(供 composable 使用) */
|
|
27
|
+
export interface AMapProps {
|
|
28
|
+
lineArr: PathInput;
|
|
29
|
+
points: MapPointItem[];
|
|
30
|
+
pointType: PointType;
|
|
31
|
+
label: string[];
|
|
32
|
+
center: LngLat;
|
|
33
|
+
zoom: number;
|
|
34
|
+
circleRadius: number;
|
|
35
|
+
trackPoints: LngLat[];
|
|
36
|
+
mapType: MapType;
|
|
37
|
+
highlightLineIndex: number;
|
|
38
|
+
highlightStrokeColor: string;
|
|
39
|
+
mapLineArr: LngLat[][];
|
|
40
|
+
trackLineArr: LngLat[][];
|
|
41
|
+
routeCompletedList: (boolean | number)[];
|
|
42
|
+
viewMode: ViewMode;
|
|
43
|
+
elevationDimensionalId: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LngLat } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 验证坐标是否有效 [lng, lat]
|
|
4
|
+
*/
|
|
5
|
+
export declare function isValidCoordinate(coord: unknown): coord is LngLat;
|
|
6
|
+
/**
|
|
7
|
+
* 将路径点数组转为高德坐标(WGS84 → GCJ02)
|
|
8
|
+
*/
|
|
9
|
+
export declare function toValidPath(path: LngLat[] | unknown): LngLat[];
|
|
10
|
+
/**
|
|
11
|
+
* 判断是否为多航线数据(lineArr 为 [ [ [lng,lat], ... ], ... ])
|
|
12
|
+
*/
|
|
13
|
+
export declare function isMultiRoute(arr: unknown): arr is LngLat[][];
|
|
14
|
+
/**
|
|
15
|
+
* 单点 WGS84 → GCJ02,无效时返回 null
|
|
16
|
+
*/
|
|
17
|
+
export declare function wgs84ToGcj02(lng: number, lat: number): LngLat | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface LoadAmapOptions {
|
|
2
|
+
plugins?: string[];
|
|
3
|
+
withLoca?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/** 设置高德地图配置 */
|
|
6
|
+
export declare function setAmapConfig(config: {
|
|
7
|
+
key: string;
|
|
8
|
+
securityCode: string;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function loadAmap(options?: LoadAmapOptions): Promise<typeof AMap>;
|
|
11
|
+
export declare function loadLocaOnly(): Promise<void>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** 解析结果:合并点列 + 带状多段线 + 面状外轮廓(测区) */
|
|
2
|
+
export interface ParsedKmzRoute {
|
|
3
|
+
/** 用于中心点、兼容旧逻辑的合并轨迹点(WGS84) */
|
|
4
|
+
points: [number, number][];
|
|
5
|
+
/** 多 Folder 航迹(带状常见),每段一条折线 */
|
|
6
|
+
polylines: [number, number][][];
|
|
7
|
+
/** template.kml 中测区多边形外轮廓(闭合,面状测区) */
|
|
8
|
+
polygonOutline?: [number, number][];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 完整解析 KMZ:优先 wpmz/waylines.wpml,其次 wpmz/template.kml(面轮廓),再尝试任意 .kml + togeojson
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseKMZRouteFromUrl(url: string): Promise<ParsedKmzRoute>;
|
|
14
|
+
/**
|
|
15
|
+
* 兼容旧调用:仅返回合并后的轨迹点(WGS84)
|
|
16
|
+
*/
|
|
17
|
+
export declare const parseKMZFromUrl: (url: string) => Promise<[number, number][]>;
|
|
@@ -66,6 +66,14 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
66
66
|
type: PropType<JTWDialogFooterExtra>;
|
|
67
67
|
default: null;
|
|
68
68
|
};
|
|
69
|
+
bodyPadded: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
width: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
69
77
|
}>, {
|
|
70
78
|
visible: Ref<boolean, boolean>;
|
|
71
79
|
maskRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
@@ -75,6 +83,13 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
75
83
|
confirmText: Ref<string, string>;
|
|
76
84
|
transitionName: ComputedRef<"j-tw-dialog-slide-right" | "j-tw-dialog-fade">;
|
|
77
85
|
sizeClass: ComputedRef<string>;
|
|
86
|
+
wrapperStyle: ComputedRef<{
|
|
87
|
+
width: string;
|
|
88
|
+
maxWidth: string;
|
|
89
|
+
} | {
|
|
90
|
+
width?: undefined;
|
|
91
|
+
maxWidth?: undefined;
|
|
92
|
+
}>;
|
|
78
93
|
computedComponentBind: ComputedRef<{
|
|
79
94
|
dialogInstance: any;
|
|
80
95
|
}>;
|
|
@@ -150,10 +165,19 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
150
165
|
type: PropType<JTWDialogFooterExtra>;
|
|
151
166
|
default: null;
|
|
152
167
|
};
|
|
168
|
+
bodyPadded: {
|
|
169
|
+
type: BooleanConstructor;
|
|
170
|
+
default: boolean;
|
|
171
|
+
};
|
|
172
|
+
width: {
|
|
173
|
+
type: StringConstructor;
|
|
174
|
+
default: string;
|
|
175
|
+
};
|
|
153
176
|
}>> & Readonly<{}>, {
|
|
154
177
|
size: JTWDialogSizeType;
|
|
155
178
|
component: null;
|
|
156
179
|
title: string;
|
|
180
|
+
width: string;
|
|
157
181
|
position: JTWDialogPositionType;
|
|
158
182
|
showFooter: boolean;
|
|
159
183
|
confirmText: string;
|
|
@@ -165,6 +189,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
165
189
|
closeOnMask: boolean;
|
|
166
190
|
closeOnEsc: boolean;
|
|
167
191
|
footerExtra: JTWDialogFooterExtra;
|
|
192
|
+
bodyPadded: boolean;
|
|
168
193
|
}, {}, {
|
|
169
194
|
JTWBtn: DefineComponent<ExtractPropTypes<{
|
|
170
195
|
size: {
|
|
@@ -50,6 +50,10 @@ export interface JTWDialogOptions {
|
|
|
50
50
|
* @default 'md'
|
|
51
51
|
*/
|
|
52
52
|
size?: JTWDialogSizeType;
|
|
53
|
+
/**
|
|
54
|
+
* 自定义宽度(如 '600px' 或 '50%'),设置后 size 将失效
|
|
55
|
+
*/
|
|
56
|
+
width?: string;
|
|
53
57
|
/**
|
|
54
58
|
* 是否显示 Header
|
|
55
59
|
* @default true
|
|
@@ -101,6 +105,11 @@ export interface JTWDialogOptions {
|
|
|
101
105
|
* Footer 上方的额外组件配置
|
|
102
106
|
*/
|
|
103
107
|
footerExtra?: JTWDialogFooterExtra;
|
|
108
|
+
/**
|
|
109
|
+
* 是否为 body 添加内边距
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
112
|
+
bodyPadded?: boolean;
|
|
104
113
|
}
|
|
105
114
|
/**
|
|
106
115
|
* @description JTWDialog 组件 Props
|
|
@@ -121,6 +130,8 @@ export interface JTWDialogProps {
|
|
|
121
130
|
closeOnMask?: boolean;
|
|
122
131
|
closeOnEsc?: boolean;
|
|
123
132
|
footerExtra?: JTWDialogFooterExtra;
|
|
133
|
+
bodyPadded?: boolean;
|
|
134
|
+
width?: string;
|
|
124
135
|
}
|
|
125
136
|
/** JTWDialog Expose 接口 */
|
|
126
137
|
export interface JTWDialogExpose {
|
|
@@ -130,6 +141,7 @@ export interface JTWDialogExpose {
|
|
|
130
141
|
changeCancelText: (text: string) => void;
|
|
131
142
|
changeConfirmText: (text: string) => void;
|
|
132
143
|
setFooterExtraBind: (bind: Record<string, any>) => void;
|
|
144
|
+
setDialogWidth: (width: string) => void;
|
|
133
145
|
}
|
|
134
146
|
/** JTWDialog 组件类型定义 */
|
|
135
147
|
export type JTWDialogComponent = DefineComponent<JTWDialogProps>;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { PropType, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, CSSProperties, Component, ComponentProvideOptions, VNode, RendererNode, RendererElement } from 'vue';
|
|
2
|
+
import { SFCWithInstall, EpPropFinalized, EpPropMergeType } from 'element-plus/es/utils/index.mjs';
|
|
3
|
+
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
4
|
+
page: {
|
|
5
|
+
type: NumberConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
pageSize: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
total: {
|
|
13
|
+
type: NumberConstructor;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
pageSizes: {
|
|
17
|
+
type: PropType<number[]>;
|
|
18
|
+
default: () => number[];
|
|
19
|
+
};
|
|
20
|
+
layout: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
pagerCount: {
|
|
25
|
+
type: NumberConstructor;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
background: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
disabled: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: boolean;
|
|
35
|
+
};
|
|
36
|
+
}>, {
|
|
37
|
+
handleSizeChange: (size: number) => void;
|
|
38
|
+
handleCurrentChange: (page: number) => void;
|
|
39
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
40
|
+
sizeChange: (_size: number) => true;
|
|
41
|
+
currentChange: (_page: number) => true;
|
|
42
|
+
'update:page': (_page: number) => true;
|
|
43
|
+
'update:pageSize': (_pageSize: number) => true;
|
|
44
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
45
|
+
page: {
|
|
46
|
+
type: NumberConstructor;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
pageSize: {
|
|
50
|
+
type: NumberConstructor;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
total: {
|
|
54
|
+
type: NumberConstructor;
|
|
55
|
+
required: true;
|
|
56
|
+
};
|
|
57
|
+
pageSizes: {
|
|
58
|
+
type: PropType<number[]>;
|
|
59
|
+
default: () => number[];
|
|
60
|
+
};
|
|
61
|
+
layout: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
pagerCount: {
|
|
66
|
+
type: NumberConstructor;
|
|
67
|
+
default: number;
|
|
68
|
+
};
|
|
69
|
+
background: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
disabled: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
77
|
+
}>> & Readonly<{
|
|
78
|
+
onSizeChange?: ((_size: number) => any) | undefined;
|
|
79
|
+
onCurrentChange?: ((_page: number) => any) | undefined;
|
|
80
|
+
"onUpdate:page"?: ((_page: number) => any) | undefined;
|
|
81
|
+
"onUpdate:pageSize"?: ((_pageSize: number) => any) | undefined;
|
|
82
|
+
}>, {
|
|
83
|
+
disabled: boolean;
|
|
84
|
+
pagerCount: number;
|
|
85
|
+
layout: string;
|
|
86
|
+
pageSizes: number[];
|
|
87
|
+
background: boolean;
|
|
88
|
+
}, {}, {
|
|
89
|
+
ElPagination: SFCWithInstall<DefineComponent<ExtractPropTypes<{
|
|
90
|
+
readonly pageSize: NumberConstructor;
|
|
91
|
+
readonly defaultPageSize: NumberConstructor;
|
|
92
|
+
readonly total: NumberConstructor;
|
|
93
|
+
readonly pageCount: NumberConstructor;
|
|
94
|
+
readonly pagerCount: EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
|
95
|
+
readonly currentPage: NumberConstructor;
|
|
96
|
+
readonly defaultCurrentPage: NumberConstructor;
|
|
97
|
+
readonly layout: EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
98
|
+
readonly pageSizes: EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | (((new (...args: any[]) => number[]) | (() => number[])) | null)[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
|
|
99
|
+
readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
100
|
+
readonly popperStyle: {
|
|
101
|
+
readonly type: PropType< EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
|
|
102
|
+
readonly required: false;
|
|
103
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
104
|
+
__epPropKey: true;
|
|
105
|
+
};
|
|
106
|
+
readonly prevText: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
107
|
+
readonly prevIcon: EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, boolean>;
|
|
108
|
+
readonly nextText: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
109
|
+
readonly nextIcon: EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, boolean>;
|
|
110
|
+
readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
111
|
+
readonly small: BooleanConstructor;
|
|
112
|
+
readonly size: {
|
|
113
|
+
readonly type: PropType< EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
|
|
114
|
+
readonly required: false;
|
|
115
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
116
|
+
__epPropKey: true;
|
|
117
|
+
};
|
|
118
|
+
readonly background: BooleanConstructor;
|
|
119
|
+
readonly disabled: BooleanConstructor;
|
|
120
|
+
readonly hideOnSinglePage: BooleanConstructor;
|
|
121
|
+
readonly appendSizeTo: StringConstructor;
|
|
122
|
+
}>, () => VNode<RendererNode, RendererElement, {
|
|
123
|
+
[key: string]: any;
|
|
124
|
+
}> | null, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
125
|
+
'update:current-page': (val: number) => boolean;
|
|
126
|
+
'update:page-size': (val: number) => boolean;
|
|
127
|
+
'size-change': (val: number) => boolean;
|
|
128
|
+
change: (currentPage: number, pageSize: number) => boolean;
|
|
129
|
+
'current-change': (val: number) => boolean;
|
|
130
|
+
'prev-click': (val: number) => boolean;
|
|
131
|
+
'next-click': (val: number) => boolean;
|
|
132
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
133
|
+
readonly pageSize: NumberConstructor;
|
|
134
|
+
readonly defaultPageSize: NumberConstructor;
|
|
135
|
+
readonly total: NumberConstructor;
|
|
136
|
+
readonly pageCount: NumberConstructor;
|
|
137
|
+
readonly pagerCount: EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
|
|
138
|
+
readonly currentPage: NumberConstructor;
|
|
139
|
+
readonly defaultCurrentPage: NumberConstructor;
|
|
140
|
+
readonly layout: EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
141
|
+
readonly pageSizes: EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | (((new (...args: any[]) => number[]) | (() => number[])) | null)[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
|
|
142
|
+
readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
143
|
+
readonly popperStyle: {
|
|
144
|
+
readonly type: PropType< EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
|
|
145
|
+
readonly required: false;
|
|
146
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
147
|
+
__epPropKey: true;
|
|
148
|
+
};
|
|
149
|
+
readonly prevText: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
150
|
+
readonly prevIcon: EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, boolean>;
|
|
151
|
+
readonly nextText: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
152
|
+
readonly nextIcon: EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, boolean>;
|
|
153
|
+
readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
154
|
+
readonly small: BooleanConstructor;
|
|
155
|
+
readonly size: {
|
|
156
|
+
readonly type: PropType< EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
|
|
157
|
+
readonly required: false;
|
|
158
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
159
|
+
__epPropKey: true;
|
|
160
|
+
};
|
|
161
|
+
readonly background: BooleanConstructor;
|
|
162
|
+
readonly disabled: BooleanConstructor;
|
|
163
|
+
readonly hideOnSinglePage: BooleanConstructor;
|
|
164
|
+
readonly appendSizeTo: StringConstructor;
|
|
165
|
+
}>> & Readonly<{
|
|
166
|
+
onChange?: ((currentPage: number, pageSize: number) => any) | undefined;
|
|
167
|
+
"onUpdate:current-page"?: ((val: number) => any) | undefined;
|
|
168
|
+
"onUpdate:page-size"?: ((val: number) => any) | undefined;
|
|
169
|
+
"onSize-change"?: ((val: number) => any) | undefined;
|
|
170
|
+
"onCurrent-change"?: ((val: number) => any) | undefined;
|
|
171
|
+
"onPrev-click"?: ((val: number) => any) | undefined;
|
|
172
|
+
"onNext-click"?: ((val: number) => any) | undefined;
|
|
173
|
+
}>, {
|
|
174
|
+
readonly disabled: boolean;
|
|
175
|
+
readonly popperClass: string;
|
|
176
|
+
readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
177
|
+
readonly background: boolean;
|
|
178
|
+
readonly layout: string;
|
|
179
|
+
readonly small: boolean;
|
|
180
|
+
readonly pagerCount: number;
|
|
181
|
+
readonly pageSizes: number[];
|
|
182
|
+
readonly prevText: string;
|
|
183
|
+
readonly prevIcon: EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown>;
|
|
184
|
+
readonly nextText: string;
|
|
185
|
+
readonly nextIcon: EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown>;
|
|
186
|
+
readonly hideOnSinglePage: boolean;
|
|
187
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>>;
|
|
188
|
+
}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
189
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
/** 分页配置 */
|
|
3
|
+
export interface JTWPaginationProps {
|
|
4
|
+
/** 当前页,从 1 开始 */
|
|
5
|
+
page: number;
|
|
6
|
+
/** 每页条数 */
|
|
7
|
+
pageSize: number;
|
|
8
|
+
/** 总条数 */
|
|
9
|
+
total: number;
|
|
10
|
+
/** 可选每页条数 */
|
|
11
|
+
pageSizes?: number[];
|
|
12
|
+
/** 分页布局 */
|
|
13
|
+
layout?: string;
|
|
14
|
+
/** 每页显示的页码按钮数量 */
|
|
15
|
+
pagerCount?: number;
|
|
16
|
+
/** 是否显示背景色 */
|
|
17
|
+
background?: boolean;
|
|
18
|
+
/** 是否禁用 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** JTWPagination Emits 接口 */
|
|
22
|
+
export interface JTWPaginationEmits {
|
|
23
|
+
(e: 'sizeChange', size: number): void;
|
|
24
|
+
(e: 'currentChange', page: number): void;
|
|
25
|
+
(e: 'update:page', page: number): void;
|
|
26
|
+
(e: 'update:pageSize', pageSize: number): void;
|
|
27
|
+
}
|
|
28
|
+
/** JTWPagination 组件类型定义 */
|
|
29
|
+
export type JTWPaginationComponent = DefineComponent<JTWPaginationProps, {}, {}, {}, {}, {}, {}, any>;
|
|
30
|
+
/** JTWPagination 实例类型 */
|
|
31
|
+
export type JTWPaginationInstance = InstanceType<JTWPaginationComponent>;
|
|
32
|
+
/** JTWPagination 模板 Props(用于全局类型声明) */
|
|
33
|
+
export interface JTWPaginationTemplateProps extends JTWPaginationProps {
|
|
34
|
+
onSizeChange?: (size: number) => void;
|
|
35
|
+
onCurrentChange?: (page: number) => void;
|
|
36
|
+
'onUpdate:page'?: (page: number) => void;
|
|
37
|
+
'onUpdate:pageSize'?: (pageSize: number) => void;
|
|
38
|
+
class?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
|
|
39
|
+
style?: string | Record<string, string>;
|
|
40
|
+
}
|