dynamicformdjx 0.4.1 → 0.4.3
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/README.md +1 -6
- package/dist/elementPlus/EleDynamicCascadeInput.d.ts +3 -3
- package/dist/elementPlus/EleDynamicInput.d.ts +3 -3
- package/dist/elementPlus/hooks/renderForm.d.ts +42 -13
- package/dist/elementPlus/index.cjs +1 -1
- package/dist/elementPlus/index.mjs +563 -469
- package/dist/hooks/useDyForm.d.ts +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.mjs +306 -252
- package/dist/naiveUi/NaiDynamicCascadeInput.d.ts +3 -3
- package/dist/naiveUi/NaiDynamicInput.d.ts +3 -3
- package/dist/naiveUi/hooks/renderForm.d.ts +19 -4
- package/dist/naiveUi/index.cjs +1 -1
- package/dist/naiveUi/index.mjs +542 -446
- package/dist/origin/DynamicCascadeInput.d.ts +3 -3
- package/dist/origin/DynamicInput.d.ts +3 -3
- package/dist/types/form.d.ts +2 -2
- package/dist/types/index.d.ts +38 -0
- package/dist/utils/tools.d.ts +3 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
2
|
-
import { ValueType, DyRandomFun, DyBtnConfig, DyListConfig, DyCasConfig, DyCasFormItem } from '../types';
|
|
1
|
+
import { PropType, SlotsType } from 'vue';
|
|
2
|
+
import { ValueType, DyRandomFun, DyBtnConfig, DyListConfig, DyCasConfig, DyCasFormItem, DynamicCasInputSlots } from '../types';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
type: PropType<ValueType>;
|
|
@@ -77,5 +77,5 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
77
77
|
randomFun: DyRandomFun;
|
|
78
78
|
depth: number;
|
|
79
79
|
newChildTxt: (it: DyCasFormItem) => string;
|
|
80
|
-
},
|
|
80
|
+
}, SlotsType<DynamicCasInputSlots>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
81
81
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PropType } from 'vue';
|
|
2
|
-
import { FSize, ValueType, DyRandomFun, DyBtnConfig, DyListConfig, DyConfig, DyCFormItem } from '../types';
|
|
1
|
+
import { SlotsType, PropType } from 'vue';
|
|
2
|
+
import { FSize, ValueType, DyRandomFun, DyBtnConfig, DyListConfig, DyConfig, DyCFormItem, DynamicInputSlots } from '../types';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
4
|
size: {
|
|
5
5
|
type: PropType<FSize>;
|
|
@@ -65,5 +65,5 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
65
65
|
}>, {
|
|
66
66
|
isController: boolean;
|
|
67
67
|
randomFun: DyRandomFun;
|
|
68
|
-
},
|
|
68
|
+
}, SlotsType<DynamicInputSlots>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
69
69
|
export default _default;
|
package/dist/types/form.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, Ref, VNode } from 'vue';
|
|
2
2
|
export interface SelectOptionItem {
|
|
3
|
-
label
|
|
3
|
+
label?: string;
|
|
4
4
|
value: any;
|
|
5
5
|
class?: string;
|
|
6
6
|
style?: string | CSSProperties;
|
|
@@ -8,7 +8,7 @@ export interface SelectOptionItem {
|
|
|
8
8
|
}
|
|
9
9
|
export interface BaseDyFormItem<T = any> {
|
|
10
10
|
key: keyof T;
|
|
11
|
-
label
|
|
11
|
+
label?: string;
|
|
12
12
|
value: Ref<any>;
|
|
13
13
|
placeholder?: string;
|
|
14
14
|
options?: SelectOptionItem[] | any[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export type DyConfig = {
|
|
|
21
21
|
maxHeight?: string;
|
|
22
22
|
autoScroll?: boolean;
|
|
23
23
|
allowFilter?: boolean;
|
|
24
|
+
hideArrayBtn?: boolean;
|
|
25
|
+
hideNumberBtn?: boolean;
|
|
24
26
|
};
|
|
25
27
|
export type DyCasConfig = {
|
|
26
28
|
showBorder?: boolean;
|
|
@@ -31,6 +33,42 @@ export type DyCasConfig = {
|
|
|
31
33
|
export type DyListConfig = {
|
|
32
34
|
arraySplitSymbol: string;
|
|
33
35
|
};
|
|
36
|
+
export type ScopeType = {
|
|
37
|
+
row: {
|
|
38
|
+
rId: string;
|
|
39
|
+
key: string;
|
|
40
|
+
value: string;
|
|
41
|
+
isArray?: boolean | undefined;
|
|
42
|
+
isNumber?: boolean | undefined;
|
|
43
|
+
};
|
|
44
|
+
index: number;
|
|
45
|
+
isLast: boolean;
|
|
46
|
+
addItem: () => void;
|
|
47
|
+
removeItem: () => void;
|
|
48
|
+
toggleArray: () => boolean;
|
|
49
|
+
toggleNumber: () => boolean;
|
|
50
|
+
};
|
|
51
|
+
export type CasScopeType = ScopeType & {
|
|
52
|
+
addChild: () => void;
|
|
53
|
+
};
|
|
54
|
+
export interface DynamicInputSlots {
|
|
55
|
+
newBtn?: ({ newItem }: {
|
|
56
|
+
newItem: () => void;
|
|
57
|
+
}) => VNode[];
|
|
58
|
+
resetBtn?: ({ reset }: {
|
|
59
|
+
reset: () => void;
|
|
60
|
+
}) => VNode[];
|
|
61
|
+
mergeBtn?: ({ merge }: {
|
|
62
|
+
merge: () => void;
|
|
63
|
+
}) => VNode[];
|
|
64
|
+
typeTools?: (row: ScopeType) => VNode[];
|
|
65
|
+
rowActions?: (row: ScopeType) => VNode[];
|
|
66
|
+
}
|
|
67
|
+
export interface DynamicCasInputSlots extends Omit<DynamicInputSlots, 'rowActions' | 'typeTools'> {
|
|
68
|
+
typeTools?: (row: CasScopeType) => VNode[];
|
|
69
|
+
rowActions?: (row: CasScopeType) => VNode[];
|
|
70
|
+
newChild?: (row: CasScopeType) => VNode[];
|
|
71
|
+
}
|
|
34
72
|
export type ValueType = Record<string, any>;
|
|
35
73
|
export type DyRandomFun = (id?: number | string) => string;
|
|
36
74
|
export type ExposeType = {
|
package/dist/utils/tools.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ValueType, DyCFormItem, DyRandomFun } from '../types';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
|
+
import { DyFormItem } from '../types/form';
|
|
3
4
|
declare const tranArr: (obj: ValueType, arrayFun: DyRandomFun, splitSymbol: string) => DyCFormItem[];
|
|
4
5
|
declare const resetObj: (arr: DyCFormItem[], splitSymbol: string) => ValueType;
|
|
5
6
|
declare const parseValue: (value: string, isArray?: boolean, isNumber?: boolean, splitSym?: string) => any;
|
|
@@ -7,4 +8,5 @@ declare const formatNumberInput: (val: string, isArray?: boolean, splitSymbol?:
|
|
|
7
8
|
declare const getDepthColor: (depth: number) => string;
|
|
8
9
|
declare const saferRepairColor: (colors: string[], i: number) => string;
|
|
9
10
|
declare function ensureRef(v: any): Ref<any>;
|
|
10
|
-
|
|
11
|
+
declare function OmitValue<T extends DyFormItem, const K extends readonly (keyof T)[]>(f: T, extraKeys?: K): Omit<T, "value" | K[number]>;
|
|
12
|
+
export { tranArr, resetObj, parseValue, formatNumberInput, getDepthColor, saferRepairColor, ensureRef, OmitValue };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dynamicformdjx",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "xczcdjx",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/xczcdjx/dynamicForm"
|
|
11
11
|
},
|
|
12
|
-
"homepage": "https://github.
|
|
12
|
+
"homepage": "https://xczcdjx.github.io/dynamicFormDoc",
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/xczcdjx/dynamicForm/issues"
|
|
15
15
|
},
|