@flyto/farco 1.2.1 → 1.3.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/chunk-0b1102a0.js +95 -0
- package/dist/chunk-0d0f8483.js +6 -0
- package/dist/chunk-0ec0668f.js +42 -0
- package/dist/chunk-0f50b26a.js +153 -0
- package/dist/chunk-17a233d7.js +1 -0
- package/dist/chunk-18dd07f2.js +71 -0
- package/dist/chunk-28ba1e67.js +4525 -0
- package/dist/chunk-2d4cc9ab.js +287 -0
- package/dist/chunk-32aa5901.js +1 -0
- package/dist/chunk-3659754f.js +103 -0
- package/dist/chunk-3e27c862.js +38 -0
- package/dist/chunk-3e3782aa.js +1 -0
- package/dist/chunk-451afd44.js +58 -0
- package/dist/chunk-45dbb8f9.js +1 -0
- package/dist/chunk-540a3872.js +1 -0
- package/dist/chunk-5672685f.js +2 -0
- package/dist/chunk-592857c5.js +1 -0
- package/dist/chunk-5f89350b.js +2 -0
- package/dist/chunk-6c665483.js +4 -0
- package/dist/chunk-7779a34c.js +169 -0
- package/dist/chunk-7e78427e.js +1 -0
- package/dist/chunk-7f0e9b41.js +1 -0
- package/dist/chunk-82468a2e.js +1 -0
- package/dist/chunk-867494bd.js +99 -0
- package/dist/chunk-8a4bafe4.js +135 -0
- package/dist/chunk-912642ce.js +36 -0
- package/dist/chunk-995c23b4.js +85 -0
- package/dist/chunk-a016ffab.js +1 -0
- package/dist/chunk-a1e9227b.js +1 -0
- package/dist/chunk-a67d2308.js +1 -0
- package/dist/chunk-abb01801.js +955 -0
- package/dist/chunk-b2838051.js +42 -0
- package/dist/chunk-c4c93c86.js +1 -0
- package/dist/chunk-c9e8fc0f.js +5 -0
- package/dist/chunk-db179b28.js +82 -0
- package/dist/chunk-dc6689c4.js +34 -0
- package/dist/chunk-e7fc446a.js +29 -0
- package/dist/chunk-ed8bf4fb.js +12607 -0
- package/dist/chunk-f363e104.js +1 -0
- package/dist/chunk-fe45f9f8.js +1 -0
- package/dist/fbutton.cjs.js +1 -0
- package/dist/fbutton.es.js +9 -0
- package/dist/fcheckbox.cjs.js +1 -0
- package/dist/fcheckbox.es.js +8 -0
- package/dist/fdate.cjs.js +1 -0
- package/dist/fdate.es.js +8 -0
- package/dist/fform-item.cjs.js +1 -0
- package/dist/fform-item.es.js +26 -0
- package/dist/fform.cjs.js +1 -0
- package/dist/fform.es.js +24 -0
- package/dist/ficon.cjs.js +1 -0
- package/dist/ficon.es.js +9 -0
- package/dist/finput.cjs.js +1 -0
- package/dist/finput.es.js +9 -0
- package/dist/flink.cjs.js +1 -0
- package/dist/flink.es.js +9 -0
- package/dist/fml-input.cjs.js +1 -0
- package/dist/fml-input.es.js +11 -0
- package/dist/fpop-choice.cjs.js +1 -0
- package/dist/fpop-choice.es.js +26 -0
- package/dist/fquery-list.cjs.js +1 -0
- package/dist/fquery-list.es.js +24 -0
- package/dist/fradio.cjs.js +1 -0
- package/dist/fradio.es.js +8 -0
- package/dist/frange.cjs.js +1 -0
- package/dist/frange.es.js +10 -0
- package/dist/fsearch.cjs.js +1 -0
- package/dist/fsearch.es.js +24 -0
- package/dist/fselect.cjs.js +1 -0
- package/dist/fselect.es.js +12 -0
- package/dist/fskeleton.cjs.js +1 -0
- package/dist/fskeleton.es.js +8 -0
- package/dist/fswitch.cjs.js +1 -0
- package/dist/fswitch.es.js +8 -0
- package/dist/ftable.cjs.js +1 -0
- package/dist/ftable.es.js +13 -0
- package/dist/ftext.cjs.js +1 -0
- package/dist/ftext.es.js +12 -0
- package/dist/ftextarea.cjs.js +1 -0
- package/dist/ftextarea.es.js +9 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.es.js +175 -19505
- package/dist/keys.cjs.js +1 -0
- package/dist/keys.es.js +9 -0
- package/dist/types/components/fbutton/fbutton.d.ts +35 -35
- package/dist/types/components/fbutton/fbutton.vue.d.ts +35 -33
- package/dist/types/components/fbutton/index.d.ts +4 -4
- package/dist/types/components/fcheckbox/constants/index.d.ts +10 -10
- package/dist/types/components/fcheckbox/fcheckbox.d.ts +41 -41
- package/dist/types/components/fcheckbox/fcheckbox.vue.d.ts +168 -166
- package/dist/types/components/fcheckbox/index.d.ts +4 -4
- package/dist/types/components/fdate/fdate.d.ts +67 -67
- package/dist/types/components/fdate/fdate.vue.d.ts +47 -45
- package/dist/types/components/fdate/index.d.ts +4 -4
- package/dist/types/components/fform/fform.d.ts +83 -83
- package/dist/types/components/fform/fform.vue.d.ts +124 -122
- package/dist/types/components/fform/index.d.ts +4 -4
- package/dist/types/components/fform-item/fform-item.d.ts +91 -91
- package/dist/types/components/fform-item/fform-item.vue.d.ts +121 -117
- package/dist/types/components/fform-item/index.d.ts +4 -4
- package/dist/types/components/ficon/ficon.d.ts +44 -44
- package/dist/types/components/ficon/ficon.vue.d.ts +63 -59
- package/dist/types/components/ficon/index.d.ts +4 -4
- package/dist/types/components/finput/finput.d.ts +54 -54
- package/dist/types/components/finput/finput.vue.d.ts +87 -83
- package/dist/types/components/finput/index.d.ts +4 -4
- package/dist/types/components/flink/flink.d.ts +26 -26
- package/dist/types/components/flink/flink.vue.d.ts +42 -40
- package/dist/types/components/flink/index.d.ts +4 -4
- package/dist/types/components/fml-input/fml-input.d.ts +74 -74
- package/dist/types/components/fml-input/fml-input.vue.d.ts +601 -622
- package/dist/types/components/fml-input/index.d.ts +4 -4
- package/dist/types/components/fpop-choice/fpop-choice.d.ts +52 -52
- package/dist/types/components/fpop-choice/fpop-choice.vue.d.ts +884 -891
- package/dist/types/components/fpop-choice/index.d.ts +5 -5
- package/dist/types/components/fpop-choice/utils/index.d.ts +16 -16
- package/dist/types/components/fquery-list/fquery-list.d.ts +133 -133
- package/dist/types/components/fquery-list/fquery-list.vue.d.ts +467 -1352
- package/dist/types/components/fquery-list/index.d.ts +4 -4
- package/dist/types/components/fradio/constants/index.d.ts +8 -8
- package/dist/types/components/fradio/fradio.d.ts +48 -48
- package/dist/types/components/fradio/fradio.vue.d.ts +176 -174
- package/dist/types/components/fradio/index.d.ts +4 -4
- package/dist/types/components/frange/frange.d.ts +47 -47
- package/dist/types/components/frange/frange.vue.d.ts +92 -90
- package/dist/types/components/frange/index.d.ts +4 -4
- package/dist/types/components/fsearch/fsearch.d.ts +75 -75
- package/dist/types/components/fsearch/fsearch.vue.d.ts +103 -103
- package/dist/types/components/fsearch/index.d.ts +4 -4
- package/dist/types/components/fselect/constants/index.d.ts +6 -6
- package/dist/types/components/fselect/fselect-option.vue.d.ts +25 -25
- package/dist/types/components/fselect/fselect.d.ts +120 -120
- package/dist/types/components/fselect/fselect.vue.d.ts +184 -182
- package/dist/types/components/fselect/index.d.ts +4 -4
- package/dist/types/components/fskeleton/fskeleton.d.ts +18 -18
- package/dist/types/components/fskeleton/fskeleton.vue.d.ts +17 -15
- package/dist/types/components/fskeleton/index.d.ts +4 -4
- package/dist/types/components/fswitch/fswitch.d.ts +8 -8
- package/dist/types/components/fswitch/fswitch.vue.d.ts +365 -365
- package/dist/types/components/fswitch/index.d.ts +4 -4
- package/dist/types/components/ftable/constants/index.d.ts +14 -14
- package/dist/types/components/ftable/ftable-cols-set.vue.d.ts +6 -6
- package/dist/types/components/ftable/ftable-toolbar.vue.d.ts +57 -54
- package/dist/types/components/ftable/ftable.d.ts +332 -332
- package/dist/types/components/ftable/ftable.vue.d.ts +139 -333
- package/dist/types/components/ftable/index.d.ts +4 -4
- package/dist/types/components/ftable/utils/index.d.ts +13 -13
- package/dist/types/components/ftext/ftext.d.ts +97 -96
- package/dist/types/components/ftext/ftext.vue.d.ts +88 -86
- package/dist/types/components/ftext/index.d.ts +4 -4
- package/dist/types/components/ftextarea/ftextarea.d.ts +32 -32
- package/dist/types/components/ftextarea/ftextarea.vue.d.ts +569 -575
- package/dist/types/components/ftextarea/index.d.ts +4 -4
- package/dist/types/components/index.d.ts +40 -40
- package/dist/types/constants/fform.d.ts +8 -8
- package/dist/types/constants/global.d.ts +9 -24
- package/dist/types/constants/keys.d.ts +14 -0
- package/dist/types/env.d.ts +4 -0
- package/dist/types/index.d.ts +14 -15
- package/dist/types/types/global.d.ts +44 -44
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/business-format.d.ts +136 -136
- package/dist/types/utils/index.d.ts +4 -4
- package/package.json +23 -3
- package/dist/index.umd.js +0 -128
|
@@ -1,124 +1,126 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { FFormItemType } from './fform';
|
|
3
|
-
|
|
4
|
-
declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
type:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
type:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
3
|
+
|
|
4
|
+
declare function __VLS_template(): Partial<Record<NonNullable<`item-undefined_${string}` | `item-${string}_${string}`>, (_: any) => any>> & {
|
|
5
|
+
prepend?(_: {
|
|
6
|
+
data: Record<string, any>;
|
|
7
|
+
}): any;
|
|
8
|
+
append?(_: {
|
|
9
|
+
data: Record<string, any>;
|
|
10
|
+
}): any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
13
|
+
contentClass: {
|
|
14
|
+
type: PropType<string | unknown[] | import('vue').CSSProperties>;
|
|
15
|
+
};
|
|
16
|
+
data: {
|
|
17
|
+
type: ObjectConstructor;
|
|
18
|
+
default: null;
|
|
19
|
+
};
|
|
20
|
+
defaultData: {
|
|
21
|
+
type: ObjectConstructor;
|
|
22
|
+
default: null;
|
|
23
|
+
};
|
|
24
|
+
gridProps: {
|
|
25
|
+
type: PropType<import('@arco-design/web-vue').GridProps & {
|
|
26
|
+
style?: import('vue').CSSProperties;
|
|
27
|
+
class?: string | string[] | object;
|
|
28
|
+
}>;
|
|
29
|
+
default: () => {};
|
|
30
|
+
};
|
|
31
|
+
itemSpan: {
|
|
32
|
+
type: PropType<import('@arco-design/web-vue').GridItemProps | number>;
|
|
33
|
+
default: () => {
|
|
34
|
+
span: {
|
|
35
|
+
xxl: number;
|
|
36
|
+
xl: number;
|
|
37
|
+
lg: number;
|
|
38
|
+
md: number;
|
|
39
|
+
sm: number;
|
|
40
|
+
xs: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
labelWidth: {
|
|
45
|
+
type: PropType<number | string>;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
items: {
|
|
49
|
+
type: PropType<FFormItemType[]>;
|
|
50
|
+
default: () => never[];
|
|
51
|
+
required: boolean;
|
|
52
|
+
};
|
|
53
|
+
}>, {
|
|
54
|
+
/**
|
|
55
|
+
* 表单数据,在非受控模式下,读取组件的值
|
|
56
|
+
*/
|
|
57
|
+
data: import('vue').Ref<Record<string, any>, Record<string, any>>;
|
|
58
|
+
/**
|
|
59
|
+
* 在非受控模式下,直接设置某个表单项的数据
|
|
60
|
+
* @param field 字段名
|
|
61
|
+
* @param value 字段值
|
|
62
|
+
*/
|
|
63
|
+
setFieldValue: (field: string, value: any) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Arco Form 实例(可调用组件内部方法)
|
|
66
|
+
* */
|
|
67
|
+
ins: import('vue').Ref<any, any>;
|
|
68
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
69
|
+
contentClass: {
|
|
70
|
+
type: PropType<string | unknown[] | import('vue').CSSProperties>;
|
|
71
|
+
};
|
|
72
|
+
data: {
|
|
73
|
+
type: ObjectConstructor;
|
|
74
|
+
default: null;
|
|
75
|
+
};
|
|
76
|
+
defaultData: {
|
|
77
|
+
type: ObjectConstructor;
|
|
78
|
+
default: null;
|
|
79
|
+
};
|
|
80
|
+
gridProps: {
|
|
81
|
+
type: PropType<import('@arco-design/web-vue').GridProps & {
|
|
82
|
+
style?: import('vue').CSSProperties;
|
|
83
|
+
class?: string | string[] | object;
|
|
84
|
+
}>;
|
|
85
|
+
default: () => {};
|
|
86
|
+
};
|
|
87
|
+
itemSpan: {
|
|
88
|
+
type: PropType<import('@arco-design/web-vue').GridItemProps | number>;
|
|
89
|
+
default: () => {
|
|
90
|
+
span: {
|
|
91
|
+
xxl: number;
|
|
92
|
+
xl: number;
|
|
93
|
+
lg: number;
|
|
94
|
+
md: number;
|
|
95
|
+
sm: number;
|
|
96
|
+
xs: number;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
labelWidth: {
|
|
101
|
+
type: PropType<number | string>;
|
|
102
|
+
default: string;
|
|
103
|
+
};
|
|
104
|
+
items: {
|
|
105
|
+
type: PropType<FFormItemType[]>;
|
|
106
|
+
default: () => never[];
|
|
107
|
+
required: boolean;
|
|
108
|
+
};
|
|
109
|
+
}>> & Readonly<{}>, {
|
|
110
|
+
data: Record<string, any>;
|
|
111
|
+
defaultData: Record<string, any>;
|
|
112
|
+
gridProps: import('@arco-design/web-vue').GridProps & {
|
|
113
|
+
style?: import('vue').CSSProperties;
|
|
114
|
+
class?: string | string[] | object;
|
|
115
|
+
};
|
|
116
|
+
itemSpan: number | import('@arco-design/web-vue').GridItemProps;
|
|
117
|
+
labelWidth: string | number;
|
|
118
|
+
items: FFormItemType<import('../../types').AnyObject>[];
|
|
119
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
120
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
121
|
+
export default _default;
|
|
122
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
123
|
+
new (): {
|
|
124
|
+
$slots: S;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="./components.d.ts" />
|
|
2
2
|
import { default as FForm } from './fform.vue';
|
|
3
|
-
|
|
4
|
-
export default FForm;
|
|
5
|
-
export type FFormInstance = InstanceType<typeof FForm>;
|
|
6
|
-
export * from './fform';
|
|
3
|
+
|
|
4
|
+
export default FForm;
|
|
5
|
+
export type FFormInstance = InstanceType<typeof FForm>;
|
|
6
|
+
export * from './fform';
|
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
import { ExtractPublicPropTypes, Component, PropType, VNodeChild } from 'vue';
|
|
2
2
|
import { AnyObject } from '../../../../../../../../../src/types';
|
|
3
3
|
import { FieldRule, FormItem } from '@arco-design/web-vue';
|
|
4
|
-
|
|
5
|
-
export declare const CUSTOM_COMPONENT_NAME = "custom";
|
|
6
|
-
/**
|
|
7
|
-
* 所有支持通过配置项来渲染的组件合集
|
|
8
|
-
* 当前引入的组件基本上都会在正常业务中所使用到,所以此处就直接引入全部,暂时不考虑实际使用时传入一个组件,进行按需引入,编译需要TreeShake的事情
|
|
9
|
-
*/
|
|
10
|
-
type FacroComponentNames = typeof CUSTOM_COMPONENT_NAME | 'text' | 'radio' | 'date' | 'range' | 'input' | 'select' | 'checkbox' | 'switch' | 'ml-input' | 'textarea' | 'search';
|
|
11
|
-
export declare const fFormItemComponents: Record<FacroComponentNames, Component | null>;
|
|
12
|
-
export declare const fFormItemProps: {
|
|
13
|
-
/**
|
|
14
|
-
* 表单项唯一标识
|
|
15
|
-
* 在配置FForm使用时,也是获取值的唯一标识符
|
|
16
|
-
*/
|
|
17
|
-
prop: {
|
|
18
|
-
type: StringConstructor;
|
|
19
|
-
default: null;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* 需要渲染的内部组件的名称,必须在上面fFormItemComponents变量中定义过才支持
|
|
23
|
-
* 非受控字段,只在初始化时确认唯一渲染组件
|
|
24
|
-
* 为了扩展性,提供custom特殊值,在使用default插槽进行自定义渲染时,请使用该特殊值
|
|
25
|
-
*/
|
|
26
|
-
comp: {
|
|
27
|
-
required: boolean;
|
|
28
|
-
type: PropType<FacroComponentNames>;
|
|
29
|
-
default: null;
|
|
30
|
-
validator: (value: string) => boolean;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* 通过函数自定义表单内部组件渲染
|
|
34
|
-
* 只在comp = 'custom' 生效
|
|
35
|
-
*/
|
|
36
|
-
render: {
|
|
37
|
-
type: PropType<(data: {
|
|
38
|
-
data: AnyObject;
|
|
39
|
-
}) => VNodeChild>;
|
|
40
|
-
default: null;
|
|
41
|
-
validator: (_v: any, props: any) => boolean;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* 传递给到渲染组件的props
|
|
45
|
-
* 如果需要传递events方法,请在方法前面加上on,方法名首字母大写
|
|
46
|
-
* 例:click => onClick
|
|
47
|
-
*/
|
|
48
|
-
compProps: {
|
|
49
|
-
type: ObjectConstructor;
|
|
50
|
-
default: null;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* 标签文本
|
|
54
|
-
*/
|
|
55
|
-
label: {
|
|
56
|
-
type: StringConstructor;
|
|
57
|
-
default: string;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* 是否隐藏标签
|
|
61
|
-
* @value 在标签无值或者标签值为空字符串时,默认为true
|
|
62
|
-
*/
|
|
63
|
-
hideLabel: {
|
|
64
|
-
type: BooleanConstructor;
|
|
65
|
-
default: (props: any) => boolean;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* 提示语
|
|
69
|
-
*
|
|
70
|
-
* 如需换行显示,可使用"\n"作为换行符
|
|
71
|
-
*/
|
|
72
|
-
tooltip: {
|
|
73
|
-
type: StringConstructor;
|
|
74
|
-
default: null;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* 是否必填
|
|
78
|
-
*/
|
|
79
|
-
required: {
|
|
80
|
-
type: BooleanConstructor;
|
|
81
|
-
default: boolean;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* 校验规则
|
|
85
|
-
*/
|
|
86
|
-
rules: {
|
|
87
|
-
type: PropType<
|
|
88
|
-
default(props: any): FieldRule[] | null;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
export type FFormItemProps<T = object> = Omit<ExtractPublicPropTypes<typeof fFormItemProps>, 'compProps'> & Omit<InstanceType<typeof FormItem>['$props'], 'label' | 'hideLabel'> & {
|
|
92
|
-
compProps?: T;
|
|
93
|
-
};
|
|
94
|
-
export {};
|
|
4
|
+
|
|
5
|
+
export declare const CUSTOM_COMPONENT_NAME = "custom";
|
|
6
|
+
/**
|
|
7
|
+
* 所有支持通过配置项来渲染的组件合集
|
|
8
|
+
* 当前引入的组件基本上都会在正常业务中所使用到,所以此处就直接引入全部,暂时不考虑实际使用时传入一个组件,进行按需引入,编译需要TreeShake的事情
|
|
9
|
+
*/
|
|
10
|
+
type FacroComponentNames = typeof CUSTOM_COMPONENT_NAME | 'text' | 'radio' | 'date' | 'range' | 'input' | 'select' | 'checkbox' | 'switch' | 'ml-input' | 'textarea' | 'search';
|
|
11
|
+
export declare const fFormItemComponents: Record<FacroComponentNames, Component | null>;
|
|
12
|
+
export declare const fFormItemProps: {
|
|
13
|
+
/**
|
|
14
|
+
* 表单项唯一标识
|
|
15
|
+
* 在配置FForm使用时,也是获取值的唯一标识符
|
|
16
|
+
*/
|
|
17
|
+
prop: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: null;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 需要渲染的内部组件的名称,必须在上面fFormItemComponents变量中定义过才支持
|
|
23
|
+
* 非受控字段,只在初始化时确认唯一渲染组件
|
|
24
|
+
* 为了扩展性,提供custom特殊值,在使用default插槽进行自定义渲染时,请使用该特殊值
|
|
25
|
+
*/
|
|
26
|
+
comp: {
|
|
27
|
+
required: boolean;
|
|
28
|
+
type: PropType<FacroComponentNames>;
|
|
29
|
+
default: null;
|
|
30
|
+
validator: (value: string) => boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 通过函数自定义表单内部组件渲染
|
|
34
|
+
* 只在comp = 'custom' 生效
|
|
35
|
+
*/
|
|
36
|
+
render: {
|
|
37
|
+
type: PropType<(data: {
|
|
38
|
+
data: AnyObject;
|
|
39
|
+
}) => VNodeChild>;
|
|
40
|
+
default: null;
|
|
41
|
+
validator: (_v: any, props: any) => boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 传递给到渲染组件的props
|
|
45
|
+
* 如果需要传递events方法,请在方法前面加上on,方法名首字母大写
|
|
46
|
+
* 例:click => onClick
|
|
47
|
+
*/
|
|
48
|
+
compProps: {
|
|
49
|
+
type: ObjectConstructor;
|
|
50
|
+
default: null;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 标签文本
|
|
54
|
+
*/
|
|
55
|
+
label: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* 是否隐藏标签
|
|
61
|
+
* @value 在标签无值或者标签值为空字符串时,默认为true
|
|
62
|
+
*/
|
|
63
|
+
hideLabel: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: (props: any) => boolean;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* 提示语
|
|
69
|
+
*
|
|
70
|
+
* 如需换行显示,可使用"\n"作为换行符
|
|
71
|
+
*/
|
|
72
|
+
tooltip: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
default: null;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* 是否必填
|
|
78
|
+
*/
|
|
79
|
+
required: {
|
|
80
|
+
type: BooleanConstructor;
|
|
81
|
+
default: boolean;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* 校验规则
|
|
85
|
+
*/
|
|
86
|
+
rules: {
|
|
87
|
+
type: PropType<FieldRule | FieldRule[]>;
|
|
88
|
+
default(props: any): FieldRule[] | null;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export type FFormItemProps<T = object> = Omit<ExtractPublicPropTypes<typeof fFormItemProps>, 'compProps'> & Omit<InstanceType<typeof FormItem>['$props'], 'label' | 'hideLabel'> & {
|
|
92
|
+
compProps?: T;
|
|
93
|
+
};
|
|
94
|
+
export {};
|