@wyfex/ivue 0.19.0 → 0.19.1
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/index.es.js +1 -1
- package/dist/index.umd.cjs +10 -10
- package/dist/ivue.css +1 -1
- package/dist/types/UseElButton/types.d.ts +2 -2
- package/dist/types/UseElConfigProvider/defaultExtConfig.d.ts +2 -7
- package/dist/types/UseElConfigProvider/types.d.ts +4 -9
- package/dist/types/UseElSelect/index.vue.d.ts +2 -2
- package/dist/types/UseElSelect/props.d.ts +1 -1
- package/dist/types/UseElSwitch/index.vue.d.ts +4 -4
- package/dist/types/UseElSwitch/props.d.ts +2 -2
- package/dist/types/UseElTable/defaultExtConfig.d.ts +2 -2
- package/dist/types/UseElTable/hooks/useElTable.d.ts +5 -2
- package/dist/types/UseElTable/hooks/useSelection.d.ts +1 -1
- package/dist/types/UseElTable/index.vue.d.ts +2 -11
- package/dist/types/UseElTable/props.d.ts +0 -4
- package/dist/types/UseElTable/types.d.ts +8 -7
- package/package.json +1 -1
- package/src/components/UseElButton/types.ts +3 -4
- package/src/components/UseElConfigProvider/defaultExtConfig.ts +1 -8
- package/src/components/UseElConfigProvider/types.ts +10 -24
- package/src/components/UseElTable/defaultExtConfig.ts +1 -46
- package/src/components/UseElTable/props.ts +0 -7
- package/src/components/UseElTable/types.ts +175 -31
- package/src/types/index.ts +119 -41
- package/dist/types/UseElTable/hooks/useTableHeightAdaptive.d.ts +0 -11
- package/dist/useLog-DrLGlf1g.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
2
|
import { default as componentProps } from './props';
|
|
3
3
|
export type Props = ExtractPropTypes<typeof componentProps>;
|
|
4
|
-
export
|
|
4
|
+
export type Emits = {
|
|
5
5
|
(e: 'click', value?: string | number | Record<string, unknown>): void;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export interface ExtConfig {
|
|
8
8
|
debounce?: {
|
|
9
9
|
delay?: number;
|
|
@@ -5,13 +5,8 @@ declare const _default: {
|
|
|
5
5
|
children: string;
|
|
6
6
|
};
|
|
7
7
|
table: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
debug: {
|
|
12
|
-
open: false;
|
|
13
|
-
type: "primary";
|
|
14
|
-
toJson: false;
|
|
8
|
+
pageBottomOffset: number;
|
|
9
|
+
modalBottomOffset: number;
|
|
15
10
|
};
|
|
16
11
|
};
|
|
17
12
|
export default _default;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
2
|
import { default as componentProps } from './props';
|
|
3
3
|
import { DictProps } from '../../types';
|
|
4
|
-
import { LogType } from '../../hooks/useLog';
|
|
5
4
|
export type Props = ExtractPropTypes<typeof componentProps>;
|
|
6
|
-
export interface Debug {
|
|
7
|
-
open: boolean;
|
|
8
|
-
type: LogType;
|
|
9
|
-
toJson: boolean;
|
|
10
|
-
}
|
|
11
5
|
export interface ExtConfig {
|
|
12
6
|
dictProps?: DictProps;
|
|
13
7
|
table?: {
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
pageHeight?: string;
|
|
9
|
+
modalHeight?: string;
|
|
10
|
+
pageBottomOffset?: number;
|
|
11
|
+
modalBottomOffset?: number;
|
|
16
12
|
};
|
|
17
|
-
debug?: Debug;
|
|
18
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
2
|
modelValue: {
|
|
3
|
-
type: (ArrayConstructor |
|
|
3
|
+
type: (ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: string;
|
|
5
5
|
};
|
|
6
6
|
options: {
|
|
@@ -40,7 +40,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
40
40
|
"update:label": (label: string | string[]) => any;
|
|
41
41
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
42
42
|
modelValue: {
|
|
43
|
-
type: (ArrayConstructor |
|
|
43
|
+
type: (ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
44
44
|
default: string;
|
|
45
45
|
};
|
|
46
46
|
options: {
|
|
@@ -2,7 +2,7 @@ import { PropType } from 'vue';
|
|
|
2
2
|
import { DictProps, RenderConfig } from '../../types';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
modelValue: {
|
|
5
|
-
type: (ArrayConstructor |
|
|
5
|
+
type: (ArrayConstructor | BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
6
6
|
default: string;
|
|
7
7
|
};
|
|
8
8
|
options: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
2
|
activeValue: {
|
|
3
|
-
type: (
|
|
3
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: number;
|
|
5
5
|
};
|
|
6
6
|
inactiveValue: {
|
|
7
|
-
type: (
|
|
7
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
8
8
|
default: number;
|
|
9
9
|
};
|
|
10
10
|
activeText: {
|
|
@@ -21,11 +21,11 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
|
|
|
21
21
|
};
|
|
22
22
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
23
23
|
activeValue: {
|
|
24
|
-
type: (
|
|
24
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
25
25
|
default: number;
|
|
26
26
|
};
|
|
27
27
|
inactiveValue: {
|
|
28
|
-
type: (
|
|
28
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
29
29
|
default: number;
|
|
30
30
|
};
|
|
31
31
|
activeText: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
activeValue: {
|
|
3
|
-
type: (
|
|
3
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
4
4
|
default: number;
|
|
5
5
|
};
|
|
6
6
|
inactiveValue: {
|
|
7
|
-
type: (
|
|
7
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
8
8
|
default: number;
|
|
9
9
|
};
|
|
10
10
|
activeText: {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
1
|
+
import { Attrs, ComputedRef } from 'vue';
|
|
2
2
|
import { Emits, Props, TableColumn } from '../types';
|
|
3
3
|
import { GlobalConfig } from '../../../types';
|
|
4
|
-
export declare const useElTable: ({ mergedProps, emits, globalConfig }: {
|
|
4
|
+
export declare const useElTable: ({ mergedProps, emits, attrs, globalConfig }: {
|
|
5
5
|
mergedProps: ComputedRef<Props>;
|
|
6
6
|
emits: Emits;
|
|
7
|
+
attrs: Attrs;
|
|
7
8
|
globalConfig: ComputedRef<GlobalConfig>;
|
|
8
9
|
}) => {
|
|
10
|
+
heightComputed: ComputedRef<string>;
|
|
11
|
+
adaptiveComputed: ComputedRef<number | false>;
|
|
9
12
|
processHeaderCellClassName: ({ column }: any) => "" | "hideAllSelection";
|
|
10
13
|
tableColumnsComputed: ComputedRef<TableColumn[]>;
|
|
11
14
|
processDictData: (item: TableColumn) => Record<string, any>[];
|
|
@@ -11,5 +11,5 @@ export declare const useSelection: ({ mergedProps, emits, attrs, etRef }: {
|
|
|
11
11
|
selectionContent: ComputedRef<string>;
|
|
12
12
|
handleSelectAll: (selection: any) => void;
|
|
13
13
|
handleSelect: (selection: any, row: any) => void;
|
|
14
|
-
handleRowClick: (row: any) => void;
|
|
14
|
+
handleRowClick: (row: Record<string, any>) => void;
|
|
15
15
|
};
|
|
@@ -7,10 +7,6 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
7
7
|
type: import('vue').PropType<Record<string, unknown>[]>;
|
|
8
8
|
required: boolean;
|
|
9
9
|
};
|
|
10
|
-
tableHeight: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
10
|
tableLoading: {
|
|
15
11
|
type: BooleanConstructor;
|
|
16
12
|
default: boolean;
|
|
@@ -47,7 +43,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
47
43
|
validateRequired: (row: Record<string, any>) => boolean;
|
|
48
44
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
49
45
|
onDictKeys: (value?: string[] | undefined) => any;
|
|
50
|
-
"update:selectionData": (selectionData: any) => any;
|
|
46
|
+
"update:selectionData": (selectionData: any[]) => any;
|
|
51
47
|
"update:currentRow": (currentRow: any) => any;
|
|
52
48
|
"update:currentPage": (currentPage: number) => any;
|
|
53
49
|
"update:pageSize": (pageSize: number) => any;
|
|
@@ -60,10 +56,6 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
60
56
|
type: import('vue').PropType<Record<string, unknown>[]>;
|
|
61
57
|
required: boolean;
|
|
62
58
|
};
|
|
63
|
-
tableHeight: {
|
|
64
|
-
type: StringConstructor;
|
|
65
|
-
default: string;
|
|
66
|
-
};
|
|
67
59
|
tableLoading: {
|
|
68
60
|
type: BooleanConstructor;
|
|
69
61
|
default: boolean;
|
|
@@ -98,12 +90,11 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
98
90
|
};
|
|
99
91
|
}>> & Readonly<{
|
|
100
92
|
onOnDictKeys?: ((value?: string[] | undefined) => any) | undefined;
|
|
101
|
-
"onUpdate:selectionData"?: ((selectionData: any) => any) | undefined;
|
|
93
|
+
"onUpdate:selectionData"?: ((selectionData: any[]) => any) | undefined;
|
|
102
94
|
"onUpdate:currentRow"?: ((currentRow: any) => any) | undefined;
|
|
103
95
|
"onUpdate:currentPage"?: ((currentPage: number) => any) | undefined;
|
|
104
96
|
"onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
|
|
105
97
|
}>, {
|
|
106
|
-
tableHeight: string;
|
|
107
98
|
tableLoading: boolean;
|
|
108
99
|
tableColumnAlign: string;
|
|
109
100
|
dictMap: import('../../types').DictMap;
|
|
@@ -2,13 +2,13 @@ import { Component, ExtractPropTypes } from 'vue';
|
|
|
2
2
|
import { EditAttrs, GlobalConfig, UseDict } from '../../types';
|
|
3
3
|
import { default as componentProps } from './props';
|
|
4
4
|
export type Props = ExtractPropTypes<typeof componentProps>;
|
|
5
|
-
export
|
|
5
|
+
export type Emits = {
|
|
6
6
|
(e: 'onDictKeys', value?: string[]): void;
|
|
7
|
-
(e: 'update:selectionData', selectionData: any): void;
|
|
7
|
+
(e: 'update:selectionData', selectionData: any[]): void;
|
|
8
8
|
(e: 'update:currentRow', currentRow: any): void;
|
|
9
9
|
(e: 'update:currentPage', currentPage: number): void;
|
|
10
10
|
(e: 'update:pageSize', pageSize: number): void;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
export interface EditableCellAndSpanVueProps {
|
|
13
13
|
row: Record<string, any>;
|
|
14
14
|
item: TableColumn;
|
|
@@ -48,7 +48,7 @@ export interface TableColumn {
|
|
|
48
48
|
}
|
|
49
49
|
export interface Selection {
|
|
50
50
|
label?: string;
|
|
51
|
-
type?:
|
|
51
|
+
type?: 'CHECKBOX' | 'CHECKBOXRADIO' | 'RADIO';
|
|
52
52
|
width?: number;
|
|
53
53
|
key?: string;
|
|
54
54
|
enableRowClick?: boolean;
|
|
@@ -62,15 +62,16 @@ export interface Selection {
|
|
|
62
62
|
}
|
|
63
63
|
export interface ExtConfig {
|
|
64
64
|
extraHeader?: {
|
|
65
|
+
border?: boolean;
|
|
65
66
|
class?: string;
|
|
66
67
|
style?: {
|
|
67
68
|
padding?: string;
|
|
68
69
|
borderBottom?: string;
|
|
69
70
|
};
|
|
70
71
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
mode?: {
|
|
73
|
+
type?: 'PAGE' | 'MODAL';
|
|
74
|
+
height?: string;
|
|
74
75
|
bottomOffset?: number;
|
|
75
76
|
};
|
|
76
77
|
selection?: Selection;
|
package/package.json
CHANGED
|
@@ -7,9 +7,9 @@ import componentProps from './props'
|
|
|
7
7
|
export type Props = ExtractPropTypes<typeof componentProps>
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* emits
|
|
10
|
+
* emits类型
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type Emits = {
|
|
13
13
|
/**
|
|
14
14
|
* 点击事件 默认自带防抖
|
|
15
15
|
*/
|
|
@@ -21,8 +21,7 @@ export interface Emits {
|
|
|
21
21
|
*/
|
|
22
22
|
export interface ExtConfig {
|
|
23
23
|
/**
|
|
24
|
-
* 防抖配置项
|
|
25
|
-
* 无需防抖将delay设置为0即可
|
|
24
|
+
* 防抖配置项 无需防抖将delay设置为0即可
|
|
26
25
|
*/
|
|
27
26
|
debounce?: {
|
|
28
27
|
/**
|
|
@@ -4,13 +4,6 @@ import type { ExtConfig } from './types'
|
|
|
4
4
|
* 默认扩展配置
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
7
|
-
/**
|
|
8
|
-
* 字典属性配置项
|
|
9
|
-
*/
|
|
10
7
|
dictProps: { value: 'value', label: 'label', children: 'children' },
|
|
11
|
-
|
|
12
|
-
* 表格配置项
|
|
13
|
-
*/
|
|
14
|
-
table: { bottomOffset: 20, modalFooterHeight: 82 },
|
|
15
|
-
debug: { open: false, type: 'primary', toJson: false }
|
|
8
|
+
table: { pageBottomOffset: 20, modalBottomOffset: 92 }
|
|
16
9
|
} satisfies ExtConfig
|
|
@@ -1,31 +1,12 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue'
|
|
2
2
|
import componentProps from './props'
|
|
3
3
|
import type { DictProps } from '@/types'
|
|
4
|
-
import type { LogType } from '@/hooks/useLog'
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* props类型
|
|
8
7
|
*/
|
|
9
8
|
export type Props = ExtractPropTypes<typeof componentProps>
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
* 调试接口
|
|
13
|
-
*/
|
|
14
|
-
export interface Debug {
|
|
15
|
-
/**
|
|
16
|
-
* 是否开启调试
|
|
17
|
-
*/
|
|
18
|
-
open: boolean
|
|
19
|
-
/**
|
|
20
|
-
* 调试日志类型
|
|
21
|
-
*/
|
|
22
|
-
type: LogType
|
|
23
|
-
/**
|
|
24
|
-
* 是否JSON格式化打印
|
|
25
|
-
*/
|
|
26
|
-
toJson: boolean
|
|
27
|
-
}
|
|
28
|
-
|
|
29
10
|
/**
|
|
30
11
|
* extConfig接口
|
|
31
12
|
*/
|
|
@@ -36,10 +17,15 @@ export interface ExtConfig {
|
|
|
36
17
|
dictProps?: DictProps
|
|
37
18
|
/**
|
|
38
19
|
* 表格配置项
|
|
20
|
+
* pageHeight:表格页面高度 extConfig.mode.type='PAGE'时生效,显式设置则表格自适应高度不生效,否则默认使用表格自适应高度
|
|
21
|
+
* modalHeight:表格弹窗高度 extConfig.mode.type='MODAL'时生效,显式设置则表格自适应高度不生效,否则默认使用表格自适应高度
|
|
22
|
+
* pageBottomOffset:表格页面底部预留偏移
|
|
23
|
+
* modalBottomOffset:表格弹窗底部预留偏移
|
|
39
24
|
*/
|
|
40
|
-
table?: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
table?: {
|
|
26
|
+
pageHeight?: string
|
|
27
|
+
modalHeight?: string
|
|
28
|
+
pageBottomOffset?: number
|
|
29
|
+
modalBottomOffset?: number
|
|
30
|
+
}
|
|
45
31
|
}
|
|
@@ -4,62 +4,17 @@ import type { ExtConfig } from './types'
|
|
|
4
4
|
* 默认扩展配置
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
7
|
-
/**
|
|
8
|
-
* 额外表头配置项
|
|
9
|
-
* class:额外表头类名
|
|
10
|
-
* style:额外表头样式对象
|
|
11
|
-
*/
|
|
12
7
|
extraHeader: {
|
|
13
8
|
style: {
|
|
14
9
|
padding: '10px',
|
|
15
10
|
borderBottom: '1px solid var(--el-border-color-light)'
|
|
16
11
|
}
|
|
17
12
|
},
|
|
18
|
-
|
|
19
|
-
* 高度自适应配置项
|
|
20
|
-
* isModal:是否弹窗模式,弹窗模式自动追加底部按钮预留
|
|
21
|
-
* modalFooterHeight:弹窗底部操作栏固定高度,isModal=true生效,该项由UseElConfigProvider组件统一提供默认值
|
|
22
|
-
* bottomOffset:底部预留偏移,该项由UseElConfigProvider组件统一提供默认值
|
|
23
|
-
*/
|
|
24
|
-
heightAdaptive: { isModal: false },
|
|
25
|
-
/**
|
|
26
|
-
* 选择器配置项
|
|
27
|
-
* 绑定v-model:selectionData="selectionData"则开启选择器 不显式设置type则默认为CHECKBOX复选
|
|
28
|
-
* type:选择类型 可选值:CHECKBOX(复选) | CHECKBOXRADIO(复选框单选) | RADIO(单选)
|
|
29
|
-
* label:type为CHECKBOXRADIO、RADIO时表头全选复选框的文本 不设置则为空显示
|
|
30
|
-
* key:选中数据的唯一键 对应tableData中的唯一键 如id
|
|
31
|
-
* selectable:决定当前行复选框是否可以勾选 传入function,如果是简单禁用逻辑推荐优先使用disabledConfig配置项,复杂逻辑才建议使用本配置项
|
|
32
|
-
* disabledConfig:禁用配置 可传对象或对象数组
|
|
33
|
-
* enableRowClick:允许通过点击行触发单选/复选 默认否 PS:默认不高亮当前行,若需高亮当前行,只需给UseElTable组件设置highlightCurrentRow属性即可
|
|
34
|
-
* width:选择器的列宽 默认为40px
|
|
35
|
-
* align:选择器的排列方式 默认为center居中
|
|
36
|
-
* fixed:是否固定 默认为true
|
|
37
|
-
*/
|
|
13
|
+
mode: { type: 'PAGE' },
|
|
38
14
|
selection: { width: 40, enableRowClick: false, align: 'center', fixed: true },
|
|
39
|
-
/**
|
|
40
|
-
* 序号列配置项
|
|
41
|
-
* label:序号列表头文本 不显式设置则不显示序号列
|
|
42
|
-
* width、align、fixed同选择器配置项
|
|
43
|
-
*/
|
|
44
15
|
index: { width: 55, align: 'center', fixed: true },
|
|
45
|
-
/**
|
|
46
|
-
* 展开列配置项
|
|
47
|
-
*/
|
|
48
16
|
expand: { show: false },
|
|
49
|
-
/**
|
|
50
|
-
* 操作列配置项
|
|
51
|
-
* label:操作列文案 显式设置则开启操作列
|
|
52
|
-
* width:操作列宽度 默认为128px
|
|
53
|
-
* fixed:固定方向 默认固定在右侧
|
|
54
|
-
*/
|
|
55
17
|
operation: { width: 128, fixed: 'right' },
|
|
56
|
-
/**
|
|
57
|
-
* 分页器配置项
|
|
58
|
-
* total:分页总数 为-1时不显示分页器
|
|
59
|
-
* marginTop:分页器与表格的间距 默认20px
|
|
60
|
-
* func:分页方法 显式设置则在组件内部自动处理分页逻辑
|
|
61
|
-
* position:分页器位置 默认为right 可选值:left | center | right
|
|
62
|
-
*/
|
|
63
18
|
pagination: {
|
|
64
19
|
total: -1,
|
|
65
20
|
marginTop: 20,
|
|
@@ -22,13 +22,6 @@ export default {
|
|
|
22
22
|
type: Array as PropType<Record<string, unknown>[]>,
|
|
23
23
|
required: true
|
|
24
24
|
},
|
|
25
|
-
/**
|
|
26
|
-
* 表格高度 如为autoCalc则使用组件内部高度自适应逻辑,可指定具体高度值或auto
|
|
27
|
-
*/
|
|
28
|
-
tableHeight: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: 'autoCalc'
|
|
31
|
-
},
|
|
32
25
|
/**
|
|
33
26
|
* 表格loading
|
|
34
27
|
*/
|