twcpt 0.0.22 → 0.0.24
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-input/index.d.ts +35 -1
- package/dist/components/j-tw-pdf-view/index.d.ts +3 -0
- package/dist/components/j-tw-pdf-view/types.d.ts +97 -0
- package/dist/components/j-tw-permission/types.d.ts +8 -2
- package/dist/components/j-tw-popup-proxy/index.d.ts +3 -0
- package/dist/components/j-tw-popup-proxy/types.d.ts +137 -0
- package/dist/global.d.ts +20 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/pdf-DNv6W857.js +18274 -0
- package/dist/pdf-DaVs5dNL.cjs +55 -0
- package/dist/twcpt.cjs.js +7 -7
- package/dist/twcpt.es.js +5400 -4571
- package/package.json +3 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DefineComponent, ExtractPropTypes, Ref, ComponentInternalInstance, StyleValue, VNodeProps, AllowedComponentProps, ComponentCustomProps, Attrs, Slot, ComponentPublicInstance, ComponentOptionsBase, ShallowRef, ComputedRef, ComponentOptionsMixin, CSSProperties, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, PublicProps, CreateComponentPublicInstanceWithMixins } from 'vue';
|
|
2
|
-
import { ComponentSize, InputModelModifiers, InputType, InputAutoSize, InputProps } from 'element-plus';
|
|
2
|
+
import { ComponentSize, InputModelModifiers, InputType, InputAutoSize, InputProps, IconProps } from 'element-plus';
|
|
3
3
|
import { IconPropType, SFCWithInstall } from 'element-plus/es/utils/index.mjs';
|
|
4
4
|
import { OnCleanup } from '@vue/reactivity';
|
|
5
5
|
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
@@ -11,6 +11,10 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
11
11
|
type: BooleanConstructor;
|
|
12
12
|
default: boolean;
|
|
13
13
|
};
|
|
14
|
+
clearable: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
14
18
|
}>, {
|
|
15
19
|
elInputRef: Ref<({
|
|
16
20
|
$: ComponentInternalInstance;
|
|
@@ -383,6 +387,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
383
387
|
attrsWithoutWordLimit: ComputedRef<{
|
|
384
388
|
[x: string]: any;
|
|
385
389
|
}>;
|
|
390
|
+
handleTextareaClear: () => void;
|
|
386
391
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
387
392
|
bgGrey: {
|
|
388
393
|
type: BooleanConstructor;
|
|
@@ -392,7 +397,12 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
392
397
|
type: BooleanConstructor;
|
|
393
398
|
default: boolean;
|
|
394
399
|
};
|
|
400
|
+
clearable: {
|
|
401
|
+
type: BooleanConstructor;
|
|
402
|
+
default: boolean;
|
|
403
|
+
};
|
|
395
404
|
}>> & Readonly<{}>, {
|
|
405
|
+
clearable: boolean;
|
|
396
406
|
wordLimitVisible: boolean;
|
|
397
407
|
bgGrey: boolean;
|
|
398
408
|
}, {}, {
|
|
@@ -560,5 +570,29 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
560
570
|
append?: (props: {}) => any;
|
|
561
571
|
};
|
|
562
572
|
})>;
|
|
573
|
+
ElIcon: SFCWithInstall<{
|
|
574
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< IconProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
575
|
+
size: number | string;
|
|
576
|
+
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
577
|
+
P: {};
|
|
578
|
+
B: {};
|
|
579
|
+
D: {};
|
|
580
|
+
C: {};
|
|
581
|
+
M: {};
|
|
582
|
+
Defaults: {};
|
|
583
|
+
}, Readonly< IconProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
584
|
+
size: number | string;
|
|
585
|
+
}>;
|
|
586
|
+
__isFragment?: never;
|
|
587
|
+
__isTeleport?: never;
|
|
588
|
+
__isSuspense?: never;
|
|
589
|
+
} & ComponentOptionsBase<Readonly< IconProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
590
|
+
size: number | string;
|
|
591
|
+
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
592
|
+
$slots: {
|
|
593
|
+
default?: (props: {}) => any;
|
|
594
|
+
};
|
|
595
|
+
})>;
|
|
596
|
+
CircleClose: DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
563
597
|
}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
564
598
|
export default _default;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
/** 加载状态常量 */
|
|
3
|
+
export declare const JTWPdfViewLoadState: {
|
|
4
|
+
readonly IDLE: "idle";
|
|
5
|
+
readonly LOADING: "loading";
|
|
6
|
+
readonly LOADED: "loaded";
|
|
7
|
+
readonly ERROR: "error";
|
|
8
|
+
};
|
|
9
|
+
export type JTWPdfViewLoadStateType = (typeof JTWPdfViewLoadState)[keyof typeof JTWPdfViewLoadState];
|
|
10
|
+
/**
|
|
11
|
+
* @description JTWPdfView PDF 预览组件 Props
|
|
12
|
+
*/
|
|
13
|
+
export interface JTWPdfViewProps {
|
|
14
|
+
/**
|
|
15
|
+
* PDF 文件地址(URL 或 base64 data URI)
|
|
16
|
+
*/
|
|
17
|
+
src: string;
|
|
18
|
+
/**
|
|
19
|
+
* 渲染缩放比例
|
|
20
|
+
* @default 1.5
|
|
21
|
+
*/
|
|
22
|
+
scale?: number;
|
|
23
|
+
/**
|
|
24
|
+
* 页面间距 px
|
|
25
|
+
* @default 12
|
|
26
|
+
*/
|
|
27
|
+
pageGap?: number;
|
|
28
|
+
/**
|
|
29
|
+
* 是否显示工具栏(页码 / 缩放)
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
showToolbar?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 是否显示页码跳转控件(上一页 / 下一页 / 页码输入)
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
showPageNav?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 是否显示缩放控件(放大 / 缩小 / 比例显示)
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
showZoom?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 容器高度,支持任意 CSS 值
|
|
45
|
+
* @default '100%'
|
|
46
|
+
*/
|
|
47
|
+
height?: string;
|
|
48
|
+
/**
|
|
49
|
+
* pdfjs worker 脚本路径。
|
|
50
|
+
* 默认使用 CDN:https://cdn.jsdelivr.net/npm/pdfjs-dist@{version}/build/pdf.worker.min.mjs
|
|
51
|
+
* 可传入本地路径如 '/pdf.worker.min.mjs' 以离线使用。
|
|
52
|
+
*/
|
|
53
|
+
workerSrc?: string;
|
|
54
|
+
/**
|
|
55
|
+
* 是否使用虚拟滚动(仅渲染可见页),对超大文件性能更好
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
virtual?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** JTWPdfView Emits */
|
|
61
|
+
export interface JTWPdfViewEmits {
|
|
62
|
+
(e: 'loaded', totalPages: number): void;
|
|
63
|
+
(e: 'error', err: Error): void;
|
|
64
|
+
(e: 'page-change', page: number): void;
|
|
65
|
+
}
|
|
66
|
+
/** JTWPdfView 暴露方法 */
|
|
67
|
+
export interface JTWPdfViewExpose {
|
|
68
|
+
/** 跳转到指定页(1-based) */
|
|
69
|
+
goToPage: (page: number) => void;
|
|
70
|
+
/** 设置缩放比例 */
|
|
71
|
+
setScale: (scale: number) => void;
|
|
72
|
+
/** 重新加载 */
|
|
73
|
+
reload: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* 下载 PDF 文件
|
|
76
|
+
* @param filename 保存的文件名,默认取 src 最后一段或 'download.pdf'
|
|
77
|
+
*/
|
|
78
|
+
download: (filename?: string) => void;
|
|
79
|
+
/** 当前页码 */
|
|
80
|
+
currentPage: number;
|
|
81
|
+
/** 总页数 */
|
|
82
|
+
totalPages: number;
|
|
83
|
+
/** 当前缩放比例 */
|
|
84
|
+
currentScale: number;
|
|
85
|
+
}
|
|
86
|
+
/** JTWPdfView 组件类型 */
|
|
87
|
+
export type JTWPdfViewComponent = DefineComponent<JTWPdfViewProps>;
|
|
88
|
+
/** JTWPdfView 实例类型 */
|
|
89
|
+
export type JTWPdfViewInstance = InstanceType<JTWPdfViewComponent> & JTWPdfViewExpose;
|
|
90
|
+
/** JTWPdfView 模板 Props */
|
|
91
|
+
export interface JTWPdfViewTemplateProps extends JTWPdfViewProps {
|
|
92
|
+
onLoaded?: (totalPages: number) => void;
|
|
93
|
+
onError?: (err: Error) => void;
|
|
94
|
+
'onPage-change'?: (page: number) => void;
|
|
95
|
+
class?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
|
|
96
|
+
style?: string | Record<string, string>;
|
|
97
|
+
}
|
|
@@ -4,10 +4,16 @@ import { DefineComponent } from 'vue';
|
|
|
4
4
|
*/
|
|
5
5
|
export interface JTWPermissionProps {
|
|
6
6
|
/**
|
|
7
|
-
* 权限码。传入 falsy 值(null / undefined / ''
|
|
7
|
+
* 权限码。传入 falsy 值(null / undefined / '' / [])时视为无需鉴权,直接渲染内容。
|
|
8
|
+
* 支持传入字符串或字符串数组。
|
|
8
9
|
* @default null
|
|
9
10
|
*/
|
|
10
|
-
code?: string | null;
|
|
11
|
+
code?: string | string[] | null;
|
|
12
|
+
/**
|
|
13
|
+
* 传入数组时的匹配模式:true = 需全部满足,false = 满足其中一个即可
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
matchAll?: boolean;
|
|
11
17
|
/**
|
|
12
18
|
* 无权限时显示的占位内容
|
|
13
19
|
* @default '-'
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
/** PopupProxy 触发方式常量 */
|
|
3
|
+
export declare const JTWPopupProxyTrigger: {
|
|
4
|
+
readonly CLICK: "click";
|
|
5
|
+
readonly HOVER: "hover";
|
|
6
|
+
readonly FOCUS: "focus";
|
|
7
|
+
readonly CONTEXTMENU: "contextmenu";
|
|
8
|
+
};
|
|
9
|
+
/** PopupProxy 弹出位置常量(popover 模式下有效) */
|
|
10
|
+
export declare const JTWPopupProxyPlacement: {
|
|
11
|
+
readonly TOP: "top";
|
|
12
|
+
readonly TOP_START: "top-start";
|
|
13
|
+
readonly TOP_END: "top-end";
|
|
14
|
+
readonly BOTTOM: "bottom";
|
|
15
|
+
readonly BOTTOM_START: "bottom-start";
|
|
16
|
+
readonly BOTTOM_END: "bottom-end";
|
|
17
|
+
readonly LEFT: "left";
|
|
18
|
+
readonly LEFT_START: "left-start";
|
|
19
|
+
readonly LEFT_END: "left-end";
|
|
20
|
+
readonly RIGHT: "right";
|
|
21
|
+
readonly RIGHT_START: "right-start";
|
|
22
|
+
readonly RIGHT_END: "right-end";
|
|
23
|
+
};
|
|
24
|
+
/** PopupProxy 模式(内部使用) */
|
|
25
|
+
export declare const JTWPopupProxyMode: {
|
|
26
|
+
readonly POPOVER: "popover";
|
|
27
|
+
readonly BOTTOM_SHEET: "bottom-sheet";
|
|
28
|
+
};
|
|
29
|
+
export type JTWPopupProxyTriggerType = (typeof JTWPopupProxyTrigger)[keyof typeof JTWPopupProxyTrigger];
|
|
30
|
+
export type JTWPopupProxyPlacementType = (typeof JTWPopupProxyPlacement)[keyof typeof JTWPopupProxyPlacement];
|
|
31
|
+
export type JTWPopupProxyModeType = (typeof JTWPopupProxyMode)[keyof typeof JTWPopupProxyMode];
|
|
32
|
+
/**
|
|
33
|
+
* @description JTWPopupProxy 组件 Props
|
|
34
|
+
*
|
|
35
|
+
* 宽屏下渲染为 popover(定位浮层),
|
|
36
|
+
* 窄屏(width ≤ breakpoint)下渲染为 bottom-sheet(底部半屏)。
|
|
37
|
+
*/
|
|
38
|
+
export interface JTWPopupProxyProps {
|
|
39
|
+
/**
|
|
40
|
+
* 受控显示状态
|
|
41
|
+
*/
|
|
42
|
+
modelValue?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 响应式断点(px),小于等于此值时切换为 bottom-sheet 模式
|
|
45
|
+
* @default 600
|
|
46
|
+
*/
|
|
47
|
+
breakpoint?: number;
|
|
48
|
+
/**
|
|
49
|
+
* 触发方式
|
|
50
|
+
* @default 'click'
|
|
51
|
+
*/
|
|
52
|
+
trigger?: JTWPopupProxyTriggerType;
|
|
53
|
+
/**
|
|
54
|
+
* Popover 弹出方向(popover 模式有效)
|
|
55
|
+
* @default 'bottom-start'
|
|
56
|
+
*/
|
|
57
|
+
placement?: JTWPopupProxyPlacementType;
|
|
58
|
+
/**
|
|
59
|
+
* Popover 偏移量 px(popover 模式有效)
|
|
60
|
+
* @default 4
|
|
61
|
+
*/
|
|
62
|
+
offset?: number;
|
|
63
|
+
/**
|
|
64
|
+
* 是否显示箭头(popover 模式有效)
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
showArrow?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Popover 最大宽度(popover 模式有效),如 '320px'
|
|
70
|
+
*/
|
|
71
|
+
maxWidth?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Popover 最小宽度(popover 模式有效),'trigger' 表示与触发元素同宽
|
|
74
|
+
* @default 'trigger'
|
|
75
|
+
*/
|
|
76
|
+
minWidth?: string | 'trigger';
|
|
77
|
+
/**
|
|
78
|
+
* 是否禁用
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* 点击 overlay/外部区域是否关闭
|
|
84
|
+
* @default true
|
|
85
|
+
*/
|
|
86
|
+
closeOnOutside?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Bottom-sheet 标题(bottom-sheet 模式有效)
|
|
89
|
+
*/
|
|
90
|
+
title?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Popover 额外 class
|
|
93
|
+
*/
|
|
94
|
+
popperClass?: string;
|
|
95
|
+
}
|
|
96
|
+
/** JTWPopupProxy Emits 接口 */
|
|
97
|
+
export interface JTWPopupProxyEmits {
|
|
98
|
+
(e: 'update:modelValue', visible: boolean): void;
|
|
99
|
+
(e: 'show'): void;
|
|
100
|
+
(e: 'hide'): void;
|
|
101
|
+
(e: 'before-show'): void;
|
|
102
|
+
(e: 'before-hide'): void;
|
|
103
|
+
}
|
|
104
|
+
/** JTWPopupProxy Slots 接口 */
|
|
105
|
+
export interface JTWPopupProxySlots {
|
|
106
|
+
/** 触发元素 */
|
|
107
|
+
default?: () => any;
|
|
108
|
+
/** 弹出内容 */
|
|
109
|
+
content?: () => any;
|
|
110
|
+
}
|
|
111
|
+
/** JTWPopupProxy 暴露方法 */
|
|
112
|
+
export interface JTWPopupProxyExpose {
|
|
113
|
+
/** 显示弹出层 */
|
|
114
|
+
show: () => void;
|
|
115
|
+
/** 隐藏弹出层 */
|
|
116
|
+
hide: () => void;
|
|
117
|
+
/** 切换显示/隐藏 */
|
|
118
|
+
toggle: () => void;
|
|
119
|
+
/** 当前是否可见 */
|
|
120
|
+
isVisible: boolean;
|
|
121
|
+
/** 当前渲染模式 */
|
|
122
|
+
currentMode: JTWPopupProxyModeType;
|
|
123
|
+
}
|
|
124
|
+
/** JTWPopupProxy 组件类型 */
|
|
125
|
+
export type JTWPopupProxyComponent = DefineComponent<JTWPopupProxyProps>;
|
|
126
|
+
/** JTWPopupProxy 实例类型 */
|
|
127
|
+
export type JTWPopupProxyInstance = InstanceType<JTWPopupProxyComponent> & JTWPopupProxyExpose;
|
|
128
|
+
/** JTWPopupProxy 模板 Props(用于全局类型声明) */
|
|
129
|
+
export interface JTWPopupProxyTemplateProps extends JTWPopupProxyProps {
|
|
130
|
+
'onUpdate:modelValue'?: (visible: boolean) => void;
|
|
131
|
+
onShow?: () => void;
|
|
132
|
+
onHide?: () => void;
|
|
133
|
+
'onBefore-show'?: () => void;
|
|
134
|
+
'onBefore-hide'?: () => void;
|
|
135
|
+
class?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
|
|
136
|
+
style?: string | Record<string, string>;
|
|
137
|
+
}
|
package/dist/global.d.ts
CHANGED
|
@@ -14,7 +14,9 @@ import { JTWFormItemProps, JTWFormItemSlots } from './components/j-tw-form-item/
|
|
|
14
14
|
import { JTWInputTemplateProps, JTWInputSlots, JTWInputEmits } from './components/j-tw-input/types';
|
|
15
15
|
import { JTWMultiSelectBtnTemplateProps, JTWMultiSelectBtnSlots, JTWMultiSelectBtnEmits } from './components/j-tw-multi-select-btn/types';
|
|
16
16
|
import { JTWPaginationTemplateProps, JTWPaginationEmits } from './components/j-tw-pagination/types';
|
|
17
|
+
import { JTWPdfViewTemplateProps, JTWPdfViewEmits } from './components/j-tw-pdf-view/types';
|
|
17
18
|
import { JTWPermissionTemplateProps, JTWPermissionSlots } from './components/j-tw-permission/types';
|
|
19
|
+
import { JTWPopupProxyTemplateProps, JTWPopupProxySlots, JTWPopupProxyEmits } from './components/j-tw-popup-proxy/types';
|
|
18
20
|
import { JTWRadioTemplateProps, JTWRadioSlots, JTWRadioEmits } from './components/j-tw-radio/types';
|
|
19
21
|
import { JTWRadioGroupTemplateProps, JTWRadioGroupSlots, JTWRadioGroupEmits } from './components/j-tw-radio-group/types';
|
|
20
22
|
import { JTWSearchBoxProps, JTWSearchBoxSlots, JTWSearchBoxEmits } from './components/j-tw-search-box/types';
|
|
@@ -172,6 +174,15 @@ declare module 'vue' {
|
|
|
172
174
|
$emit: JTWPaginationEmits;
|
|
173
175
|
};
|
|
174
176
|
|
|
177
|
+
/**
|
|
178
|
+
* JTWPdfView - JTWPdfView PDF 预览组件 Props
|
|
179
|
+
*/
|
|
180
|
+
JTWPdfView: new () => {
|
|
181
|
+
$props: JTWPdfViewTemplateProps;
|
|
182
|
+
$slots: {};
|
|
183
|
+
$emit: JTWPdfViewEmits;
|
|
184
|
+
};
|
|
185
|
+
|
|
175
186
|
/**
|
|
176
187
|
* JTWPermission - JTWPermission 权限控制组件
|
|
177
188
|
*/
|
|
@@ -181,6 +192,15 @@ declare module 'vue' {
|
|
|
181
192
|
$emit: {};
|
|
182
193
|
};
|
|
183
194
|
|
|
195
|
+
/**
|
|
196
|
+
* JTWPopupProxy - JTWPopupProxy 组件 Props
|
|
197
|
+
*/
|
|
198
|
+
JTWPopupProxy: new () => {
|
|
199
|
+
$props: JTWPopupProxyTemplateProps;
|
|
200
|
+
$slots: JTWPopupProxySlots;
|
|
201
|
+
$emit: JTWPopupProxyEmits;
|
|
202
|
+
};
|
|
203
|
+
|
|
184
204
|
/**
|
|
185
205
|
* JTWRadio - JTWRadio 组件
|
|
186
206
|
*/
|