twcpt 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-tw-date-picker/index.d.ts +2 -2
- package/dist/components/j-tw-datetime-picker/index.d.ts +2 -2
- package/dist/components/j-tw-file-upload/index.d.ts +3 -0
- package/dist/components/j-tw-file-upload/types.d.ts +68 -0
- package/dist/components/j-tw-input/index.d.ts +2 -2
- package/dist/components/j-tw-multi-select-btn/index.d.ts +3 -0
- package/dist/components/j-tw-multi-select-btn/types.d.ts +82 -0
- package/dist/components/j-tw-search-box/index.d.ts +3 -0
- package/dist/components/j-tw-search-box/types.d.ts +28 -0
- package/dist/components/j-tw-select/index.d.ts +8 -8
- package/dist/components/j-tw-table/index.d.ts +998 -4
- package/dist/components/j-tw-table/types.d.ts +17 -0
- package/dist/components/j-tw-toggle/index.d.ts +4 -4
- package/dist/components/j-tw-tree-select/index.d.ts +2 -2
- package/dist/components/j-tw-tree-select-btn/index.d.ts +2 -2
- package/dist/components/j-tw-tree-select-input/index.d.ts +12 -12
- package/dist/global.d.ts +30 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/twcpt-styles.css +1 -1
- package/dist/twcpt.cjs.js +14 -14
- package/dist/twcpt.es.js +5976 -5059
- package/package.json +1 -1
|
@@ -1182,15 +1182,15 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
1182
1182
|
popperOptions: Record<string, any>;
|
|
1183
1183
|
placeholder: string;
|
|
1184
1184
|
modelValue: [string, string] | [Date, Date] | [number, number];
|
|
1185
|
-
clearable: boolean;
|
|
1186
1185
|
validateEvent: boolean;
|
|
1186
|
+
clearable: boolean;
|
|
1187
|
+
readonly: boolean;
|
|
1187
1188
|
bgGrey: boolean;
|
|
1188
1189
|
format: string;
|
|
1189
1190
|
valueFormat: string;
|
|
1190
1191
|
startPlaceholder: string;
|
|
1191
1192
|
endPlaceholder: string;
|
|
1192
1193
|
disable: boolean;
|
|
1193
|
-
readonly: boolean;
|
|
1194
1194
|
disabledDate: (date: Date) => boolean;
|
|
1195
1195
|
minDate: string | number | Date;
|
|
1196
1196
|
maxDate: string | number | Date;
|
|
@@ -1182,15 +1182,15 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
1182
1182
|
popperOptions: Record<string, any>;
|
|
1183
1183
|
placeholder: string;
|
|
1184
1184
|
modelValue: [string, string] | [Date, Date] | [number, number];
|
|
1185
|
-
clearable: boolean;
|
|
1186
1185
|
validateEvent: boolean;
|
|
1186
|
+
clearable: boolean;
|
|
1187
|
+
readonly: boolean;
|
|
1187
1188
|
bgGrey: boolean;
|
|
1188
1189
|
format: string;
|
|
1189
1190
|
valueFormat: string;
|
|
1190
1191
|
startPlaceholder: string;
|
|
1191
1192
|
endPlaceholder: string;
|
|
1192
1193
|
disable: boolean;
|
|
1193
|
-
readonly: boolean;
|
|
1194
1194
|
disabledDate: (date: Date) => boolean;
|
|
1195
1195
|
minDate: string | number | Date;
|
|
1196
1196
|
maxDate: string | number | Date;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Component, ComponentPublicInstance } from 'vue';
|
|
2
|
+
export interface JTWFileUploadProps {
|
|
3
|
+
/**
|
|
4
|
+
* 文件列表
|
|
5
|
+
*/
|
|
6
|
+
modelValue?: File[];
|
|
7
|
+
/**
|
|
8
|
+
* 接受的文件类型
|
|
9
|
+
* @default 'image/png,image/jpg,image/jpeg'
|
|
10
|
+
*/
|
|
11
|
+
accept?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 最大文件大小(字节)
|
|
14
|
+
* @default 5242880 (5MB)
|
|
15
|
+
*/
|
|
16
|
+
maxSize?: number;
|
|
17
|
+
/**
|
|
18
|
+
* 最大文件数量
|
|
19
|
+
* @default 1
|
|
20
|
+
*/
|
|
21
|
+
maxFiles?: number;
|
|
22
|
+
/**
|
|
23
|
+
* 是否支持多选
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
multiple?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 是否禁用
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface JTWFileUploadEmits {
|
|
34
|
+
/**
|
|
35
|
+
* 更新文件列表
|
|
36
|
+
*/
|
|
37
|
+
'update:modelValue': (files: File[]) => void;
|
|
38
|
+
/**
|
|
39
|
+
* 文件数量超出限制
|
|
40
|
+
*/
|
|
41
|
+
'exceed': (files: File[]) => void;
|
|
42
|
+
/**
|
|
43
|
+
* 文件验证错误
|
|
44
|
+
*/
|
|
45
|
+
'error': (error: {
|
|
46
|
+
type: string;
|
|
47
|
+
message: string;
|
|
48
|
+
file?: File;
|
|
49
|
+
}) => void;
|
|
50
|
+
}
|
|
51
|
+
export interface JTWFileUploadSlots {
|
|
52
|
+
/**
|
|
53
|
+
* 上传区域文本
|
|
54
|
+
*/
|
|
55
|
+
'upload-text': () => any;
|
|
56
|
+
}
|
|
57
|
+
export interface JTWFileUploadExpose {
|
|
58
|
+
}
|
|
59
|
+
export type JTWFileUploadComponent = Component<JTWFileUploadProps, JTWFileUploadEmits, JTWFileUploadSlots>;
|
|
60
|
+
export type JTWFileUploadInstance = ComponentPublicInstance<JTWFileUploadProps, JTWFileUploadExpose>;
|
|
61
|
+
export type JTWFileUploadTemplateProps = Partial<JTWFileUploadProps> & {
|
|
62
|
+
onExceed?: (files: File[]) => void;
|
|
63
|
+
onError?: (error: {
|
|
64
|
+
type: string;
|
|
65
|
+
message: string;
|
|
66
|
+
file?: File;
|
|
67
|
+
}) => void;
|
|
68
|
+
};
|
|
@@ -164,7 +164,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
164
164
|
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
165
165
|
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
166
166
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
167
|
-
}>, "focus" | "type" | "disabled" | "ref" | "clear" | "input" | "select" | "textarea" | "modelValue" | "blur" | "
|
|
167
|
+
}>, "focus" | "type" | "disabled" | "ref" | "clear" | "input" | "select" | "textarea" | "modelValue" | "blur" | "tabindex" | "validateEvent" | "rows" | "autosize" | "autocomplete" | "inputStyle" | "textareaStyle" | "resizeTextarea" | "modelModifiers" | "clearIcon" | "wordLimitPosition" | "isComposing"> & ShallowUnwrapRef<{
|
|
168
168
|
input: ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
169
169
|
textarea: ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
170
170
|
ref: ComputedRef<HTMLInputElement | HTMLTextAreaElement | undefined>;
|
|
@@ -346,7 +346,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
346
346
|
onMouseleave?: ((evt: MouseEvent) => any) | undefined;
|
|
347
347
|
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
348
348
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
349
|
-
}>, "focus" | "type" | "disabled" | "ref" | "clear" | "input" | "select" | "textarea" | "modelValue" | "blur" | "
|
|
349
|
+
}>, "focus" | "type" | "disabled" | "ref" | "clear" | "input" | "select" | "textarea" | "modelValue" | "blur" | "tabindex" | "validateEvent" | "rows" | "autosize" | "autocomplete" | "inputStyle" | "textareaStyle" | "resizeTextarea" | "modelModifiers" | "clearIcon" | "wordLimitPosition" | "isComposing"> & ShallowUnwrapRef<{
|
|
350
350
|
input: ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
351
351
|
textarea: ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
352
352
|
ref: ComputedRef<HTMLInputElement | HTMLTextAreaElement | undefined>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
import { JTWBtnProps } from '../j-tw-btn/types';
|
|
3
|
+
export interface JTWMultiSelectOption {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
value: string | number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @description JTWMultiSelectBtn 按钮触发多选下拉组件
|
|
10
|
+
* 只支持 primary 颜色,不支持 color 属性
|
|
11
|
+
*/
|
|
12
|
+
export interface JTWMultiSelectBtnProps extends Omit<JTWBtnProps, 'color'> {
|
|
13
|
+
/**
|
|
14
|
+
* 本地选项列表
|
|
15
|
+
*/
|
|
16
|
+
data?: JTWMultiSelectOption[];
|
|
17
|
+
/**
|
|
18
|
+
* 下拉框最大高度
|
|
19
|
+
*/
|
|
20
|
+
dropdownMaxHeight?: number;
|
|
21
|
+
/**
|
|
22
|
+
* 下拉框宽度
|
|
23
|
+
*/
|
|
24
|
+
dropdownWidth?: number;
|
|
25
|
+
/**
|
|
26
|
+
* 远程加载方法(包含远程搜索)
|
|
27
|
+
*/
|
|
28
|
+
fetchOptions?: (keyword: string) => Promise<JTWMultiSelectOption[]>;
|
|
29
|
+
/**
|
|
30
|
+
* 本地搜索过滤方法
|
|
31
|
+
*/
|
|
32
|
+
filterMethod?: (option: JTWMultiSelectOption, keyword: string) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 选中值
|
|
35
|
+
*/
|
|
36
|
+
modelValue?: Array<string | number>;
|
|
37
|
+
/**
|
|
38
|
+
* 无数据文案
|
|
39
|
+
*/
|
|
40
|
+
noDataText?: string;
|
|
41
|
+
/**
|
|
42
|
+
* 搜索框占位符
|
|
43
|
+
*/
|
|
44
|
+
searchPlaceholder?: string;
|
|
45
|
+
/**
|
|
46
|
+
* 搜索防抖时长(ms)
|
|
47
|
+
*/
|
|
48
|
+
searchDebounce?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface JTWMultiSelectBtnEmits {
|
|
51
|
+
(e: 'click', event: MouseEvent): void;
|
|
52
|
+
(e: 'search', keyword: string): void;
|
|
53
|
+
(e: 'select', options: JTWMultiSelectOption[]): void;
|
|
54
|
+
(e: 'update:modelValue', value: Array<string | number>): void;
|
|
55
|
+
}
|
|
56
|
+
export interface JTWMultiSelectBtnSlots {
|
|
57
|
+
default?: () => any;
|
|
58
|
+
icon?: () => any;
|
|
59
|
+
loading?: () => any;
|
|
60
|
+
}
|
|
61
|
+
export interface JTWMultiSelectBtnExpose {
|
|
62
|
+
$el: HTMLElement | undefined;
|
|
63
|
+
click: () => void;
|
|
64
|
+
closeDropdown: () => void;
|
|
65
|
+
openDropdown: () => void;
|
|
66
|
+
}
|
|
67
|
+
export type JTWMultiSelectBtnEmitsOptions = {
|
|
68
|
+
click: (e: MouseEvent) => true;
|
|
69
|
+
search: (keyword: string) => true;
|
|
70
|
+
select: (options: JTWMultiSelectOption[]) => true;
|
|
71
|
+
'update:modelValue': (value: Array<string | number>) => true;
|
|
72
|
+
};
|
|
73
|
+
export type JTWMultiSelectBtnComponent = DefineComponent<JTWMultiSelectBtnProps, JTWMultiSelectBtnExpose, {}, {}, {}, {}, {}, JTWMultiSelectBtnEmitsOptions>;
|
|
74
|
+
export type JTWMultiSelectBtnInstance = InstanceType<JTWMultiSelectBtnComponent> & JTWMultiSelectBtnExpose;
|
|
75
|
+
export interface JTWMultiSelectBtnTemplateProps extends JTWMultiSelectBtnProps {
|
|
76
|
+
onClick?: (event: MouseEvent) => void;
|
|
77
|
+
onSearch?: (keyword: string) => void;
|
|
78
|
+
onSelect?: (options: JTWMultiSelectOption[]) => void;
|
|
79
|
+
'onUpdate:modelValue'?: (value: Array<string | number>) => void;
|
|
80
|
+
class?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
|
|
81
|
+
style?: string | Record<string, string>;
|
|
82
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component, ComponentPublicInstance } from 'vue';
|
|
2
|
+
export interface JTWSearchBoxProps {
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
defaultExpanded?: boolean;
|
|
6
|
+
wrapWidth?: string;
|
|
7
|
+
gap?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface JTWSearchBoxEmits {
|
|
10
|
+
'update:modelValue': (value: string) => void;
|
|
11
|
+
search: (value: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface JTWSearchBoxSlots {
|
|
14
|
+
before?: () => any;
|
|
15
|
+
after?: () => any;
|
|
16
|
+
}
|
|
17
|
+
export interface JTWSearchBoxExpose {
|
|
18
|
+
focus: () => void;
|
|
19
|
+
blur: () => void;
|
|
20
|
+
expand: () => void;
|
|
21
|
+
collapse: () => void;
|
|
22
|
+
}
|
|
23
|
+
export type JTWSearchBoxComponent = Component<JTWSearchBoxProps, JTWSearchBoxEmits, JTWSearchBoxSlots>;
|
|
24
|
+
export type JTWSearchBoxInstance = ComponentPublicInstance<JTWSearchBoxProps, JTWSearchBoxExpose>;
|
|
25
|
+
export type JTWSearchBoxTemplateProps = Partial<JTWSearchBoxProps> & {
|
|
26
|
+
'onUpdate:modelValue'?: (value: string) => void;
|
|
27
|
+
onSearch?: (value: string) => void;
|
|
28
|
+
};
|
|
@@ -4225,9 +4225,13 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
4225
4225
|
readonly persistent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
4226
4226
|
readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
4227
4227
|
readonly props: Props;
|
|
4228
|
-
readonly
|
|
4228
|
+
readonly tabindex: EpPropMergeType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
4229
|
+
readonly validateEvent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
4229
4230
|
readonly clearable: boolean;
|
|
4231
|
+
readonly suffixIcon: EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | null)[], unknown, unknown>;
|
|
4230
4232
|
readonly autocomplete: string;
|
|
4233
|
+
readonly clearIcon: EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | null)[], unknown, unknown>;
|
|
4234
|
+
readonly multiple: boolean;
|
|
4231
4235
|
readonly automaticDropdown: boolean;
|
|
4232
4236
|
readonly filterable: boolean;
|
|
4233
4237
|
readonly allowCreate: boolean;
|
|
@@ -4241,14 +4245,10 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
4241
4245
|
readonly collapseTagsTooltip: boolean;
|
|
4242
4246
|
readonly tagTooltip: TagTooltipProps;
|
|
4243
4247
|
readonly maxCollapseTags: number;
|
|
4244
|
-
readonly clearIcon: EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | null)[], unknown, unknown>;
|
|
4245
4248
|
readonly fitInputWidth: boolean;
|
|
4246
|
-
readonly suffixIcon: EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | null)[], unknown, unknown>;
|
|
4247
4249
|
readonly tagType: EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>;
|
|
4248
4250
|
readonly tagEffect: EpPropMergeType<StringConstructor, "dark" | "light" | "plain", unknown>;
|
|
4249
|
-
readonly validateEvent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
4250
4251
|
readonly remoteShowSuffix: boolean;
|
|
4251
|
-
readonly tabindex: EpPropMergeType<(StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
4252
4252
|
readonly size?: EpPropMergeType<StringConstructor, "" | "large" | "small" | "default", never> | undefined;
|
|
4253
4253
|
readonly disabled?: EpPropMergeType<BooleanConstructor, unknown, unknown> | undefined;
|
|
4254
4254
|
readonly id?: string | undefined;
|
|
@@ -4259,13 +4259,13 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
4259
4259
|
readonly placeholder?: string | undefined;
|
|
4260
4260
|
readonly options?: Record<string, any>[] | undefined;
|
|
4261
4261
|
readonly modelValue?: EpPropMergeType<(new (...args: any[]) => string | number | boolean | Record<string, any> | EpPropMergeType<(BooleanConstructor | NumberConstructor | ObjectConstructor | StringConstructor)[], unknown, unknown>[]) | (() => EpPropMergeType<(BooleanConstructor | NumberConstructor | ObjectConstructor | StringConstructor)[], unknown, unknown> | EpPropMergeType<(BooleanConstructor | NumberConstructor | ObjectConstructor | StringConstructor)[], unknown, unknown>[] | null) | ((new (...args: any[]) => string | number | boolean | Record<string, any> | EpPropMergeType<(BooleanConstructor | NumberConstructor | ObjectConstructor | StringConstructor)[], unknown, unknown>[]) | (() => EpPropMergeType<(BooleanConstructor | NumberConstructor | ObjectConstructor | StringConstructor)[], unknown, unknown> | EpPropMergeType<(BooleanConstructor | NumberConstructor | ObjectConstructor | StringConstructor)[], unknown, unknown>[] | null) | null)[], unknown, unknown> | undefined;
|
|
4262
|
+
readonly filterMethod?: ((query: string) => void) | undefined;
|
|
4263
|
+
readonly noDataText?: string | undefined;
|
|
4262
4264
|
readonly emptyValues?: unknown[] | undefined;
|
|
4263
4265
|
readonly valueOnClear?: EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | null)[], unknown, unknown> | undefined;
|
|
4264
4266
|
readonly loadingText?: string | undefined;
|
|
4265
4267
|
readonly noMatchText?: string | undefined;
|
|
4266
|
-
readonly noDataText?: string | undefined;
|
|
4267
4268
|
readonly remoteMethod?: ((query: string) => void) | undefined;
|
|
4268
|
-
readonly filterMethod?: ((query: string) => void) | undefined;
|
|
4269
4269
|
readonly onChange?: ((...args: any[]) => any) | undefined | undefined;
|
|
4270
4270
|
readonly "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined | undefined;
|
|
4271
4271
|
readonly onFocus?: ((...args: any[]) => any) | undefined | undefined;
|
|
@@ -4274,7 +4274,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
4274
4274
|
readonly "onVisible-change"?: ((...args: any[]) => any) | undefined | undefined;
|
|
4275
4275
|
readonly "onRemove-tag"?: ((...args: any[]) => any) | undefined | undefined;
|
|
4276
4276
|
readonly "onPopup-scroll"?: ((...args: any[]) => any) | undefined | undefined;
|
|
4277
|
-
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "loading" | "disabled" | "effect" | "popperClass" | "fallbackPlacements" | "offset" | "placement" | "popperOptions" | "showArrow" | "persistent" | "teleported" | "props" | "modelValue" | "
|
|
4277
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, "loading" | "disabled" | "effect" | "popperClass" | "fallbackPlacements" | "offset" | "placement" | "popperOptions" | "showArrow" | "persistent" | "teleported" | "props" | "modelValue" | "tabindex" | "validateEvent" | "clearable" | "suffixIcon" | "autocomplete" | "clearIcon" | "multiple" | "valueOnClear" | "automaticDropdown" | "filterable" | "allowCreate" | "remote" | "debounce" | "multipleLimit" | "defaultFirstOption" | "reserveKeyword" | "valueKey" | "collapseTags" | "collapseTagsTooltip" | "tagTooltip" | "maxCollapseTags" | "fitInputWidth" | "tagType" | "tagEffect" | "remoteShowSuffix">>) => void;
|
|
4278
4278
|
} & {
|
|
4279
4279
|
Option: DefineComponent<ExtractPropTypes<{
|
|
4280
4280
|
value: {
|