@maxtan/ez-ui 0.24.0 → 0.25.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.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +774 -643
- package/dist/types/index.d.ts +66 -7
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { ExtractPropTypes as ExtractPropTypes_2 } from 'vue';
|
|
|
26
26
|
import { EzFormItemProps as EzFormItemProps_2 } from '.';
|
|
27
27
|
import { FastTableSolt as FastTableSolt_2 } from '.';
|
|
28
28
|
import { FormData as FormData_3 } from '.';
|
|
29
|
+
import { FormGroupConfig as FormGroupConfig_2 } from '.';
|
|
29
30
|
import { FormItemConfig as FormItemConfig_2 } from '.';
|
|
30
31
|
import { FormItemContext } from 'element-plus';
|
|
31
32
|
import { FormItemProp } from 'element-plus';
|
|
@@ -206,6 +207,20 @@ export declare interface DynamicFormExpose {
|
|
|
206
207
|
formRef: any;
|
|
207
208
|
}
|
|
208
209
|
|
|
210
|
+
/**
|
|
211
|
+
* 分组插槽作用域
|
|
212
|
+
*/
|
|
213
|
+
export declare interface DynamicFormGroupSlotScope {
|
|
214
|
+
/** 分组配置 */
|
|
215
|
+
group: FormGroupConfig;
|
|
216
|
+
/** 分组索引 */
|
|
217
|
+
index: number;
|
|
218
|
+
/** 分组内可见项 */
|
|
219
|
+
items: FormItemConfig[];
|
|
220
|
+
/** 完整表单数据 */
|
|
221
|
+
formData: FormData_2;
|
|
222
|
+
}
|
|
223
|
+
|
|
209
224
|
/**
|
|
210
225
|
* 标签插槽作用域
|
|
211
226
|
*/
|
|
@@ -219,8 +234,10 @@ export declare interface DynamicFormLabelSlotScope {
|
|
|
219
234
|
* 继承 FormProps,排除会干扰内部逻辑的属性,并添加组件特有属性
|
|
220
235
|
*/
|
|
221
236
|
export declare interface DynamicFormProps extends Partial<Omit<FormProps, 'model' | 'rules' | 'showMessage'>> {
|
|
222
|
-
/**
|
|
223
|
-
items
|
|
237
|
+
/** 扁平表单配置项(兼容旧版) */
|
|
238
|
+
items?: FormItemConfig[];
|
|
239
|
+
/** 分组表单配置项(新版推荐) */
|
|
240
|
+
groups?: FormGroupConfig[];
|
|
224
241
|
/** 双向绑定的表单数据 */
|
|
225
242
|
modelValue?: FormData_2;
|
|
226
243
|
/** 栅格布局列数(默认 1) */
|
|
@@ -235,10 +252,11 @@ export declare interface DynamicFormProps extends Partial<Omit<FormProps, 'model
|
|
|
235
252
|
* 动态表单插槽
|
|
236
253
|
*/
|
|
237
254
|
export declare interface DynamicFormSlots {
|
|
238
|
-
/**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
255
|
+
/**
|
|
256
|
+
* 动态表单支持项级与分组级的动态插槽,
|
|
257
|
+
* 统一放宽为 any 作用域,避免模板静态校验冲突。
|
|
258
|
+
*/
|
|
259
|
+
[key: string]: ((scope: any) => VNode_2 | VNode_2[]) | undefined;
|
|
242
260
|
}
|
|
243
261
|
|
|
244
262
|
/**
|
|
@@ -365,9 +383,10 @@ export declare const EzDynamicForm: ({
|
|
|
365
383
|
"update:modelValue": (value: FormData_3) => any;
|
|
366
384
|
}, PublicProps, {
|
|
367
385
|
items: FormItemConfig_2[];
|
|
386
|
+
groups: FormGroupConfig_2[];
|
|
368
387
|
cols: number;
|
|
369
388
|
gutter: number;
|
|
370
|
-
},
|
|
389
|
+
}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
|
371
390
|
formRef: {
|
|
372
391
|
$: ComponentInternalInstance;
|
|
373
392
|
$data: {};
|
|
@@ -569,6 +588,7 @@ export declare const EzDynamicForm: ({
|
|
|
569
588
|
formRef: any;
|
|
570
589
|
}, {}, {}, {}, {
|
|
571
590
|
items: FormItemConfig_2[];
|
|
591
|
+
groups: FormGroupConfig_2[];
|
|
572
592
|
cols: number;
|
|
573
593
|
gutter: number;
|
|
574
594
|
}>;
|
|
@@ -590,6 +610,7 @@ formRef: any;
|
|
|
590
610
|
"update:modelValue": (value: FormData_3) => any;
|
|
591
611
|
}, string, {
|
|
592
612
|
items: FormItemConfig_2[];
|
|
613
|
+
groups: FormGroupConfig_2[];
|
|
593
614
|
cols: number;
|
|
594
615
|
gutter: number;
|
|
595
616
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
@@ -1475,6 +1496,44 @@ export declare type FormConditionFn = (formData: FormData_2) => boolean;
|
|
|
1475
1496
|
declare type FormData_2 = Record<string, any>;
|
|
1476
1497
|
export { FormData_2 as FormData }
|
|
1477
1498
|
|
|
1499
|
+
/**
|
|
1500
|
+
* 表单分组配置
|
|
1501
|
+
*/
|
|
1502
|
+
export declare interface FormGroupConfig {
|
|
1503
|
+
/** 分组唯一标识(用于 key、插槽名) */
|
|
1504
|
+
name?: string;
|
|
1505
|
+
/** 分组标题 */
|
|
1506
|
+
title?: string;
|
|
1507
|
+
/** 分组描述 */
|
|
1508
|
+
description?: string;
|
|
1509
|
+
/** 分组下的表单项 */
|
|
1510
|
+
items: FormItemConfig[];
|
|
1511
|
+
/** 分组内栅格列数(不传则继承全局 cols) */
|
|
1512
|
+
cols?: number;
|
|
1513
|
+
/** 分组内栅格间距(不传则继承全局 gutter) */
|
|
1514
|
+
gutter?: number;
|
|
1515
|
+
/** 是否隐藏分组 */
|
|
1516
|
+
hidden?: boolean;
|
|
1517
|
+
/** 分组显示条件 */
|
|
1518
|
+
show?: FormConditionFn;
|
|
1519
|
+
/** 分组容器 class */
|
|
1520
|
+
className?: string;
|
|
1521
|
+
/** 分组容器 style */
|
|
1522
|
+
style?: string | Record<string, any>;
|
|
1523
|
+
/** 分组头部 class */
|
|
1524
|
+
headerClassName?: string;
|
|
1525
|
+
/** 分组头部 style */
|
|
1526
|
+
headerStyle?: string | Record<string, any>;
|
|
1527
|
+
/** 分组主体 class */
|
|
1528
|
+
bodyClassName?: string;
|
|
1529
|
+
/** 分组主体 style */
|
|
1530
|
+
bodyStyle?: string | Record<string, any>;
|
|
1531
|
+
/** 自定义分组头插槽名 */
|
|
1532
|
+
headerSlot?: string;
|
|
1533
|
+
/** 自定义分组内容插槽名 */
|
|
1534
|
+
slot?: string;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1478
1537
|
/**
|
|
1479
1538
|
* 表单项配置
|
|
1480
1539
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxtan/ez-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.25.0",
|
|
5
5
|
"description": "一个基于element-plus的拓展组件库",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"vue",
|
|
24
24
|
"element-plus"
|
|
25
25
|
],
|
|
26
|
-
"author": "MaxTan<
|
|
26
|
+
"author": "MaxTan<maxtan330@163.com>",
|
|
27
27
|
"homepage": "https://ezui.cc",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"scripts": {
|