@wyfex/ivue 0.12.0 → 0.14.0
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 +23 -6
- package/dist/index.umd.cjs +23 -6
- package/dist/ivue.css +1 -1
- package/dist/types/UseElForm/components/QueryForm.vue.d.ts +134 -0
- package/dist/types/UseElForm/components/RowForm.vue.d.ts +140 -0
- package/dist/types/UseElForm/components/controls/Cascader.vue.d.ts +14 -0
- package/dist/types/UseElForm/components/controls/DatePicker.vue.d.ts +15 -0
- package/dist/types/UseElForm/components/controls/Input.vue.d.ts +11 -0
- package/dist/types/UseElForm/components/controls/InputNumber.vue.d.ts +10 -0
- package/dist/types/UseElForm/components/controls/InputRange.vue.d.ts +11 -0
- package/dist/types/UseElForm/components/controls/Radio.vue.d.ts +11 -0
- package/dist/types/UseElForm/components/controls/Select.vue.d.ts +18 -0
- package/dist/types/UseElForm/components/controls/Switch.vue.d.ts +8 -0
- package/dist/types/UseElForm/components/controls/TimePicker.vue.d.ts +10 -0
- package/dist/types/UseElForm/components/controls/TimeSelect.vue.d.ts +10 -0
- package/dist/types/UseElForm/components/controls/TreeSelect.vue.d.ts +12 -0
- package/dist/types/UseElForm/components/useQueryColSpan.d.ts +6 -0
- package/dist/types/UseElForm/hook.d.ts +14 -0
- package/dist/types/UseElForm/index.vue.d.ts +139 -0
- package/dist/types/UseElForm/props.d.ts +60 -0
- package/dist/types/UseElForm/types.d.ts +194 -0
- package/dist/types/UseLineTitle/defaultExtConfig.d.ts +19 -0
- package/dist/types/UseLineTitle/index.vue.d.ts +50 -0
- package/dist/types/UseLineTitle/props.d.ts +25 -0
- package/dist/types/UseLineTitle/types.d.ts +24 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/UseElDialog/props.ts +2 -2
- package/src/components/UseElForm/props.ts +102 -0
- package/src/components/UseElForm/types.ts +371 -0
- package/src/components/UseLineTitle/defaultExtConfig.ts +32 -0
- package/src/components/UseLineTitle/props.ts +43 -0
- package/src/components/UseLineTitle/types.ts +44 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { default as componentProps } from './props';
|
|
3
|
+
import { RenderConfig, UseDict } from '../../../types';
|
|
4
|
+
export type Props = ExtractPropTypes<typeof componentProps>;
|
|
5
|
+
export interface Emits {
|
|
6
|
+
(e: 'onDictKeys', value?: string[]): void;
|
|
7
|
+
(e: 'update:formModel', value: Record<string, any>): void;
|
|
8
|
+
}
|
|
9
|
+
export interface QueryConfig {
|
|
10
|
+
mode?: 'ROW' | 'INLINE';
|
|
11
|
+
colSpan?: 24 | 12 | 8 | 6 | 4 | 3 | 2 | 1 | 0;
|
|
12
|
+
formItemWidth?: string;
|
|
13
|
+
showBottomBorber?: boolean;
|
|
14
|
+
openQueryBtnLoading?: boolean;
|
|
15
|
+
onQuery?: Function;
|
|
16
|
+
}
|
|
17
|
+
export interface InputConfig {
|
|
18
|
+
useRender: boolean | RenderConfig;
|
|
19
|
+
type?: 'text' | 'textarea' | 'number' | 'password' | 'email' | 'search' | 'tel' | 'url';
|
|
20
|
+
prefixIcon?: string;
|
|
21
|
+
suffixIcon?: string;
|
|
22
|
+
clearable?: boolean;
|
|
23
|
+
maxlength?: string;
|
|
24
|
+
formatter?: string;
|
|
25
|
+
parser?: string;
|
|
26
|
+
autosize?: boolean | {
|
|
27
|
+
minRows?: number;
|
|
28
|
+
maxRows?: number;
|
|
29
|
+
};
|
|
30
|
+
rows?: number;
|
|
31
|
+
resize?: string;
|
|
32
|
+
showPassword?: boolean;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
width?: string;
|
|
35
|
+
autoFocus?: boolean;
|
|
36
|
+
prefixContent?: string | object;
|
|
37
|
+
suffixContent?: string | object;
|
|
38
|
+
prependContent?: string | object;
|
|
39
|
+
appendContent?: string | object;
|
|
40
|
+
unit?: string | object;
|
|
41
|
+
onClear?: (...args: any) => any;
|
|
42
|
+
inputEvent?: Function;
|
|
43
|
+
onKeyupEnter?: (...args: any) => any;
|
|
44
|
+
}
|
|
45
|
+
export interface InputNumberConfig {
|
|
46
|
+
useRender: boolean | RenderConfig;
|
|
47
|
+
min?: number;
|
|
48
|
+
max?: number;
|
|
49
|
+
step?: number;
|
|
50
|
+
precision?: number;
|
|
51
|
+
placeholder?: string;
|
|
52
|
+
disabledScientific?: boolean;
|
|
53
|
+
unit?: string | object;
|
|
54
|
+
}
|
|
55
|
+
export interface RadioConfig {
|
|
56
|
+
useRender: boolean | RenderConfig;
|
|
57
|
+
options?: Array<{
|
|
58
|
+
label: string;
|
|
59
|
+
value: string | number;
|
|
60
|
+
}>;
|
|
61
|
+
props?: {
|
|
62
|
+
value: string;
|
|
63
|
+
label?: string;
|
|
64
|
+
};
|
|
65
|
+
reverse?: boolean;
|
|
66
|
+
onChange?: (...args: any) => any;
|
|
67
|
+
}
|
|
68
|
+
export interface SelectConfig {
|
|
69
|
+
useRender: boolean | RenderConfig;
|
|
70
|
+
multiple?: boolean;
|
|
71
|
+
clearable?: boolean;
|
|
72
|
+
placeholder?: string;
|
|
73
|
+
options?: Array<{
|
|
74
|
+
label: string;
|
|
75
|
+
value: string | number;
|
|
76
|
+
}>;
|
|
77
|
+
props?: {
|
|
78
|
+
value: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
};
|
|
81
|
+
useV2: boolean;
|
|
82
|
+
reverse?: boolean;
|
|
83
|
+
toJoin?: boolean;
|
|
84
|
+
width?: string;
|
|
85
|
+
onChange?: (...args: any) => any;
|
|
86
|
+
}
|
|
87
|
+
export interface CascaderConfig {
|
|
88
|
+
useRender: boolean | RenderConfig;
|
|
89
|
+
clearable?: boolean;
|
|
90
|
+
options?: Array<{
|
|
91
|
+
label: string;
|
|
92
|
+
value: string | number;
|
|
93
|
+
}>;
|
|
94
|
+
props?: {
|
|
95
|
+
value: string;
|
|
96
|
+
label?: string;
|
|
97
|
+
};
|
|
98
|
+
width?: string;
|
|
99
|
+
onChange?: (...args: any) => any;
|
|
100
|
+
}
|
|
101
|
+
export interface DatePickerConfig {
|
|
102
|
+
useRender: boolean | RenderConfig;
|
|
103
|
+
type?: 'year' | 'years' | 'month' | 'months' | 'date' | 'dates' | 'datetime' | 'week' | 'datetimerange' | 'daterange' | 'monthrange' | 'yearrange';
|
|
104
|
+
clearable?: boolean;
|
|
105
|
+
disabledDate?: Function;
|
|
106
|
+
placeholder?: string;
|
|
107
|
+
format?: string;
|
|
108
|
+
valueFormat?: string;
|
|
109
|
+
startPlaceholder?: string;
|
|
110
|
+
endPlaceholder?: string;
|
|
111
|
+
rangeSeparator?: string;
|
|
112
|
+
width?: string;
|
|
113
|
+
onCalendarChange?: Function;
|
|
114
|
+
onClear?: Function;
|
|
115
|
+
onChange?: Function;
|
|
116
|
+
}
|
|
117
|
+
export interface TimePickerConfig {
|
|
118
|
+
useRender: boolean | RenderConfig;
|
|
119
|
+
startPlaceholder?: string;
|
|
120
|
+
endPlaceholder?: string;
|
|
121
|
+
rangeSeparator?: string;
|
|
122
|
+
isRange?: boolean;
|
|
123
|
+
editable?: boolean;
|
|
124
|
+
format?: string;
|
|
125
|
+
valueFormat?: string;
|
|
126
|
+
onChange?: (...args: any) => any;
|
|
127
|
+
}
|
|
128
|
+
export interface TimeSelectConfig {
|
|
129
|
+
useRender: boolean | RenderConfig;
|
|
130
|
+
startProp: string;
|
|
131
|
+
endProp: string;
|
|
132
|
+
}
|
|
133
|
+
export interface SwitchConfig {
|
|
134
|
+
useRender: boolean | RenderConfig;
|
|
135
|
+
activeValue?: string | number | boolean;
|
|
136
|
+
inactiveValue?: string | number | boolean;
|
|
137
|
+
onChange?: (...args: any) => any;
|
|
138
|
+
}
|
|
139
|
+
export interface InputRangeConfig {
|
|
140
|
+
startProp: string;
|
|
141
|
+
endProp: string;
|
|
142
|
+
startPlaceholder?: string;
|
|
143
|
+
endPlaceholder?: string;
|
|
144
|
+
rangeSeparator?: string;
|
|
145
|
+
onClear?: (...args: any) => any;
|
|
146
|
+
}
|
|
147
|
+
export interface TreeSelectConfig {
|
|
148
|
+
useRender?: boolean | RenderConfig;
|
|
149
|
+
data: Record<string, unknown>[];
|
|
150
|
+
reverse?: boolean;
|
|
151
|
+
width?: string;
|
|
152
|
+
placeholder?: string;
|
|
153
|
+
props?: {
|
|
154
|
+
value: string;
|
|
155
|
+
label?: string;
|
|
156
|
+
};
|
|
157
|
+
checkStrictly?: boolean;
|
|
158
|
+
filterable?: boolean;
|
|
159
|
+
clearable?: boolean;
|
|
160
|
+
defaultExpandedKeys?: Array<string | number>;
|
|
161
|
+
}
|
|
162
|
+
export interface IRequired {
|
|
163
|
+
isRequired?: boolean;
|
|
164
|
+
validator: 'mobile' | 'nonNegativeDecimal';
|
|
165
|
+
parmas?: any;
|
|
166
|
+
}
|
|
167
|
+
export interface FormColumn {
|
|
168
|
+
label?: string;
|
|
169
|
+
prop: string;
|
|
170
|
+
queryProp?: string | string[];
|
|
171
|
+
required: boolean | IRequired;
|
|
172
|
+
errorMessage?: string;
|
|
173
|
+
disabled?: boolean;
|
|
174
|
+
useDict?: boolean | string | UseDict;
|
|
175
|
+
span?: number;
|
|
176
|
+
labelWidth?: string;
|
|
177
|
+
labelPosition?: 'left' | 'right' | 'top';
|
|
178
|
+
show?: boolean;
|
|
179
|
+
filter?: boolean;
|
|
180
|
+
formItemClass?: string;
|
|
181
|
+
slot?: string | boolean;
|
|
182
|
+
renderConfig?: RenderConfig;
|
|
183
|
+
inputConfig?: InputConfig;
|
|
184
|
+
inputNumberConfig?: InputNumberConfig;
|
|
185
|
+
selectConfig?: SelectConfig;
|
|
186
|
+
treeSelectConfig?: TreeSelectConfig;
|
|
187
|
+
cascaderConfig?: CascaderConfig;
|
|
188
|
+
datePickerConfig?: DatePickerConfig;
|
|
189
|
+
timePickerConfig?: TimePickerConfig;
|
|
190
|
+
timeSelectConfig?: TimeSelectConfig;
|
|
191
|
+
radioConfig?: RadioConfig;
|
|
192
|
+
switchConfig?: SwitchConfig;
|
|
193
|
+
inputRangeConfig?: InputRangeConfig;
|
|
194
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
margin: {
|
|
3
|
+
top: string;
|
|
4
|
+
bottom: string;
|
|
5
|
+
};
|
|
6
|
+
line: {
|
|
7
|
+
width: string;
|
|
8
|
+
height: string;
|
|
9
|
+
color: string;
|
|
10
|
+
position: "left";
|
|
11
|
+
verticalPadding: string;
|
|
12
|
+
};
|
|
13
|
+
borderBottom: {
|
|
14
|
+
show: false;
|
|
15
|
+
color: string;
|
|
16
|
+
paddingBottom: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
title: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: boolean;
|
|
5
|
+
};
|
|
6
|
+
fontSize: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
color: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
class: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
extConfig: {
|
|
19
|
+
type: import('vue').PropType<import('./types').ExtConfig>;
|
|
20
|
+
default: () => {};
|
|
21
|
+
};
|
|
22
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
23
|
+
title: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
required: boolean;
|
|
26
|
+
};
|
|
27
|
+
fontSize: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
color: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
class: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
extConfig: {
|
|
40
|
+
type: import('vue').PropType<import('./types').ExtConfig>;
|
|
41
|
+
default: () => {};
|
|
42
|
+
};
|
|
43
|
+
}>> & Readonly<{}>, {
|
|
44
|
+
extConfig: import('./types').ExtConfig;
|
|
45
|
+
class: string;
|
|
46
|
+
fontSize: string;
|
|
47
|
+
color: string;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ExtConfig } from './types';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
required: boolean;
|
|
7
|
+
};
|
|
8
|
+
fontSize: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
color: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
class: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
extConfig: {
|
|
21
|
+
type: PropType<ExtConfig>;
|
|
22
|
+
default: () => {};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { default as componentProps } from './props';
|
|
3
|
+
export type Props = ExtractPropTypes<typeof componentProps>;
|
|
4
|
+
export interface Line {
|
|
5
|
+
width: string;
|
|
6
|
+
height: string;
|
|
7
|
+
color: string;
|
|
8
|
+
position: 'left' | 'bottom' | 'between';
|
|
9
|
+
verticalPadding: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Margin {
|
|
12
|
+
top: string;
|
|
13
|
+
bottom: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BorderBottom {
|
|
16
|
+
show: boolean;
|
|
17
|
+
color: string;
|
|
18
|
+
paddingBottom: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ExtConfig {
|
|
21
|
+
line: Line;
|
|
22
|
+
margin: Margin;
|
|
23
|
+
borderBottom: BorderBottom;
|
|
24
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ export { default as UseElDatePicker } from './UseElDatePicker/index.vue';
|
|
|
4
4
|
export { default as UseElDescriptions } from './UseElDescriptions/index.vue';
|
|
5
5
|
export { default as UseElDialog } from './UseElDialog/index.vue';
|
|
6
6
|
export { default as UseElDrawer } from './UseElDrawer/index.vue';
|
|
7
|
+
export { default as UseElForm } from './UseElForm/index.vue';
|
|
7
8
|
export { default as UseElInput } from './UseElInput/index.vue';
|
|
8
9
|
export { default as UseElSelect } from './UseElSelect/index.vue';
|
|
9
10
|
export { default as UseElSwitch } from './UseElSwitch/index.vue';
|
|
10
11
|
export { default as UseElTable } from './UseElTable/index.vue';
|
|
12
|
+
export { default as UseLineTitle } from './UseLineTitle/index.vue';
|
|
11
13
|
export { default as UseRender } from './UseRender/index.vue';
|
|
12
14
|
export { default as UseSvgIcon } from './UseSvgIcon/index.vue';
|
package/package.json
CHANGED
|
@@ -73,11 +73,11 @@ export default {
|
|
|
73
73
|
default: false
|
|
74
74
|
},
|
|
75
75
|
/**
|
|
76
|
-
* 底部定位 默认
|
|
76
|
+
* 底部定位 默认left
|
|
77
77
|
*/
|
|
78
78
|
footerPosition: {
|
|
79
79
|
type: String,
|
|
80
|
-
default: '
|
|
80
|
+
default: 'left',
|
|
81
81
|
validator: (val: string) => ['left', 'center', 'right'].includes(val)
|
|
82
82
|
},
|
|
83
83
|
/**
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
|
+
import type { FormColumn, QueryConfig } from './types'
|
|
3
|
+
import type { DictMap, DictProps, RenderConfig } from '@/types'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 组件props
|
|
7
|
+
*/
|
|
8
|
+
export default {
|
|
9
|
+
/**
|
|
10
|
+
* 表单列 必传
|
|
11
|
+
*/
|
|
12
|
+
formColumns: {
|
|
13
|
+
type: Array as PropType<FormColumn[]>,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* 表单模型 必传
|
|
18
|
+
*/
|
|
19
|
+
formModel: {
|
|
20
|
+
type: Object as PropType<Record<string, any>>,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* 是否使用渲染器 默认否
|
|
25
|
+
*/
|
|
26
|
+
useRender: {
|
|
27
|
+
type: [Boolean, Object] as PropType<boolean | RenderConfig>,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* 字典映射 数据结构为{ formColumns[][label | useDict | useDict.data]: Array<{ label: string, value: any }> }
|
|
32
|
+
*/
|
|
33
|
+
dictMap: {
|
|
34
|
+
type: Object as PropType<DictMap>,
|
|
35
|
+
default: () => ({})
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* 字典属性 默认为{ value: 'value', label: 'label', children: 'children' },可通过全局配置进行设置,为适配全局配置此处不再设置默认值
|
|
39
|
+
*/
|
|
40
|
+
dictProps: {
|
|
41
|
+
type: Object as PropType<DictProps>,
|
|
42
|
+
default: () => ({})
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* el-form-item宽度值
|
|
46
|
+
*/
|
|
47
|
+
formItemWidth: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '100%'
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* label后缀
|
|
53
|
+
*/
|
|
54
|
+
labelSuffix: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ''
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* label宽度
|
|
60
|
+
*/
|
|
61
|
+
labelWidth: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: 'auto'
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* label定位
|
|
67
|
+
*/
|
|
68
|
+
labelPosition: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'right',
|
|
71
|
+
validator: (val: string) => ['left', 'right', 'top'].includes(val)
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* el-row的gutter值
|
|
75
|
+
*/
|
|
76
|
+
rowGutter: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: 20
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* el-col的span值
|
|
82
|
+
*/
|
|
83
|
+
colSpan: {
|
|
84
|
+
type: Number,
|
|
85
|
+
default: 12,
|
|
86
|
+
validator: (val: number) => [24, 12, 8, 6, 4, 3, 2, 1, 0].includes(val)
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* 是否禁用
|
|
90
|
+
*/
|
|
91
|
+
disabled: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* 查询配置
|
|
97
|
+
*/
|
|
98
|
+
queryConfig: {
|
|
99
|
+
type: Object as PropType<QueryConfig>,
|
|
100
|
+
default: () => ({})
|
|
101
|
+
}
|
|
102
|
+
}
|