amis 1.9.1-beta.21 → 1.9.1-beta.24
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/AssociatedSelection.d.ts +40 -40
- package/lib/components/Badge.d.ts +1 -1
- package/lib/components/Badge.js.map +1 -1
- package/lib/components/ChainedSelection.d.ts +40 -40
- package/lib/components/GroupedSelection.d.ts +40 -40
- package/lib/components/GroupedSelection.js +2 -3
- package/lib/components/GroupedSelection.js.map +2 -2
- package/lib/components/PickerContainer.d.ts +0 -1
- package/lib/components/PickerContainer.js +4 -4
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/ResultBox.js +3 -1
- package/lib/components/ResultBox.js.map +2 -2
- package/lib/components/ResultList.d.ts +53 -43
- package/lib/components/ResultList.js +22 -34
- package/lib/components/ResultList.js.map +2 -2
- package/lib/components/ResultTableList.d.ts +40 -40
- package/lib/components/ResultTreeList.d.ts +40 -40
- package/lib/components/Select.js +10 -6
- package/lib/components/Select.js.map +2 -2
- package/lib/components/Selection.d.ts +40 -41
- package/lib/components/Selection.js.map +2 -2
- package/lib/components/TableSelection.d.ts +40 -40
- package/lib/components/TabsTransfer.d.ts +2 -2
- package/lib/components/TabsTransfer.js.map +1 -1
- package/lib/components/Transfer.d.ts +40 -40
- package/lib/components/Transfer.js +1 -1
- package/lib/components/Transfer.js.map +2 -2
- package/lib/components/TransferDropDown.d.ts +40 -40
- package/lib/components/TreeSelection.d.ts +40 -40
- package/lib/components/TreeSelection.js +2 -3
- package/lib/components/TreeSelection.js.map +2 -2
- package/lib/components/formula/Editor.d.ts +45 -45
- package/lib/components/formula/Editor.js +16 -11
- package/lib/components/formula/Editor.js.map +2 -2
- package/lib/components/formula/Picker.d.ts +85 -40
- package/lib/components/formula/Picker.js +12 -6
- package/lib/components/formula/Picker.js.map +2 -2
- package/lib/components/formula/VariableList.d.ts +0 -2
- package/lib/components/formula/VariableList.js +5 -15
- package/lib/components/formula/VariableList.js.map +2 -2
- package/lib/components/index.d.ts +1 -3
- package/lib/components/index.js +1 -5
- package/lib/components/index.js.map +2 -2
- package/lib/components/schema-editor/SchemaVariableList.d.ts +0 -1
- package/lib/components/schema-editor/SchemaVariableList.js +2 -2
- package/lib/components/schema-editor/SchemaVariableList.js.map +2 -2
- package/lib/components/schema-editor/SchemaVariableListPicker.d.ts +0 -1
- package/lib/components/schema-editor/SchemaVariableListPicker.js +2 -2
- package/lib/components/schema-editor/SchemaVariableListPicker.js.map +2 -2
- package/lib/helper.css.map +1 -1
- package/lib/index.js +1 -1
- package/lib/renderers/CRUD.js +3 -3
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Form/DiffEditor.d.ts +66 -20
- package/lib/renderers/Form/Editor.d.ts +66 -20
- package/lib/renderers/Form/Group.js +1 -1
- package/lib/renderers/Form/Group.js.map +2 -2
- package/lib/renderers/Form/InputFormula.d.ts +5 -5
- package/lib/renderers/Form/InputFormula.js +4 -3
- package/lib/renderers/Form/InputFormula.js.map +2 -2
- package/lib/renderers/Form/InputTag.d.ts +1 -1
- package/lib/renderers/Form/InputTag.js.map +1 -1
- package/lib/renderers/Form/Options.js +7 -7
- package/lib/renderers/Form/Options.js.map +2 -2
- package/lib/renderers/Form/Select.d.ts +6 -1
- package/lib/renderers/Form/Select.js +3 -1
- package/lib/renderers/Form/Select.js.map +2 -2
- package/lib/renderers/Form/TreeSelect.d.ts +0 -1
- package/lib/renderers/Form/TreeSelect.js +1 -9
- package/lib/renderers/Form/TreeSelect.js.map +2 -2
- package/lib/renderers/Form/index.js +9 -4
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/Table/exportExcel.js +1 -1
- package/lib/renderers/Table/exportExcel.js.map +2 -2
- package/lib/renderers/Table/index.d.ts +2 -0
- package/lib/renderers/Table/index.js +37 -5
- package/lib/renderers/Table/index.js.map +2 -2
- package/lib/renderers/Tpl.d.ts +4 -0
- package/lib/renderers/Tpl.js +6 -3
- package/lib/renderers/Tpl.js.map +2 -2
- package/lib/store/combo.d.ts +72 -22
- package/lib/store/form.d.ts +30 -9
- package/lib/store/form.js +28 -10
- package/lib/store/form.js.map +2 -2
- package/lib/store/formItem.d.ts +3 -1
- package/lib/store/formItem.js +3 -5
- package/lib/store/formItem.js.map +2 -2
- package/lib/store/table.d.ts +60 -18
- package/lib/themes/ang-ie11.css +33 -9
- package/lib/themes/ang.css +27 -9
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +33 -9
- package/lib/themes/antd.css +27 -9
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +35 -15
- package/lib/themes/cxd.css +31 -17
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +33 -9
- package/lib/themes/dark.css +27 -9
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +35 -15
- package/lib/themes/default.css +31 -17
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/formula.js +2 -3
- package/lib/utils/formula.js.map +2 -2
- package/lib/utils/helper.js +1 -1
- package/lib/utils/helper.js.map +2 -2
- package/package.json +1 -1
- package/schema.json +22 -16
- package/scss/_mixins.scss +1 -1
- package/scss/components/form/_date.scss +9 -10
- package/scss/components/form/_select.scss +14 -0
- package/scss/components/form/_transfer.scss +1 -2
- package/scss/themes/cxd.scss +4 -9
- package/sdk/ang-ie11.css +36 -9
- package/sdk/ang.css +30 -9
- package/sdk/antd-ie11.css +36 -9
- package/sdk/antd.css +30 -9
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +38 -16
- package/sdk/cxd.css +34 -18
- package/sdk/dark-ie11.css +36 -9
- package/sdk/dark.css +30 -9
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css.map +1 -1
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +16 -16
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +38 -16
- package/sdk/sdk.css +34 -18
- package/sdk/sdk.js +1356 -1354
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/components/Badge.tsx +1 -1
- package/src/components/GroupedSelection.tsx +2 -3
- package/src/components/PickerContainer.tsx +8 -13
- package/src/components/ResultBox.tsx +3 -1
- package/src/components/ResultList.tsx +51 -48
- package/src/components/Select.tsx +16 -8
- package/src/components/Selection.tsx +0 -1
- package/src/components/TabsTransfer.tsx +2 -2
- package/src/components/Transfer.tsx +4 -0
- package/src/components/TreeSelection.tsx +1 -2
- package/src/components/formula/Editor.tsx +51 -38
- package/src/components/formula/Picker.tsx +26 -7
- package/src/components/formula/VariableList.tsx +2 -36
- package/src/components/index.tsx +0 -4
- package/src/components/schema-editor/SchemaVariableList.tsx +2 -4
- package/src/components/schema-editor/SchemaVariableListPicker.tsx +1 -4
- package/src/renderers/CRUD.tsx +3 -3
- package/src/renderers/Form/Group.tsx +1 -1
- package/src/renderers/Form/InputFormula.tsx +11 -10
- package/src/renderers/Form/InputTag.tsx +1 -1
- package/src/renderers/Form/Options.tsx +7 -9
- package/src/renderers/Form/Select.tsx +10 -2
- package/src/renderers/Form/TreeSelect.tsx +14 -16
- package/src/renderers/Form/index.tsx +13 -2
- package/src/renderers/Table/exportExcel.ts +1 -1
- package/src/renderers/Table/index.tsx +42 -6
- package/src/renderers/Tpl.tsx +11 -1
- package/src/store/form.ts +31 -24
- package/src/store/formItem.ts +65 -52
- package/src/utils/formula.ts +2 -2
- package/src/utils/helper.ts +2 -2
@@ -340,7 +340,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
340
340
|
validateOnChange?: boolean | undefined;
|
341
341
|
label?: string | undefined;
|
342
342
|
}) => void;
|
343
|
-
validate: (data: Object, hook?: any
|
343
|
+
validate: (data: Object, hook?: any, customRules?: {
|
344
|
+
[propName: string]: any;
|
345
|
+
} | undefined) => Promise<boolean>;
|
344
346
|
setError: (msg: string | string[], tag?: string) => void;
|
345
347
|
addError: (msg: string | (string | {
|
346
348
|
msg: string;
|
@@ -747,7 +749,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
747
749
|
validateOnChange?: boolean | undefined;
|
748
750
|
label?: string | undefined;
|
749
751
|
}) => void;
|
750
|
-
validate: (data: Object, hook?: any
|
752
|
+
validate: (data: Object, hook?: any, customRules?: {
|
753
|
+
[propName: string]: any;
|
754
|
+
} | undefined) => Promise<boolean>;
|
751
755
|
setError: (msg: string | string[], tag?: string) => void;
|
752
756
|
addError: (msg: string | (string | {
|
753
757
|
msg: string;
|
@@ -1163,7 +1167,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
1163
1167
|
validateOnChange?: boolean | undefined;
|
1164
1168
|
label?: string | undefined;
|
1165
1169
|
}) => void;
|
1166
|
-
validate: (data: Object, hook?: any
|
1170
|
+
validate: (data: Object, hook?: any, customRules?: {
|
1171
|
+
[propName: string]: any;
|
1172
|
+
} | undefined) => Promise<boolean>;
|
1167
1173
|
setError: (msg: string | string[], tag?: string) => void;
|
1168
1174
|
addError: (msg: string | (string | {
|
1169
1175
|
msg: string;
|
@@ -1570,7 +1576,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
1570
1576
|
validateOnChange?: boolean | undefined;
|
1571
1577
|
label?: string | undefined;
|
1572
1578
|
}) => void;
|
1573
|
-
validate: (data: Object, hook?: any
|
1579
|
+
validate: (data: Object, hook?: any, customRules?: {
|
1580
|
+
[propName: string]: any;
|
1581
|
+
} | undefined) => Promise<boolean>;
|
1574
1582
|
setError: (msg: string | string[], tag?: string) => void;
|
1575
1583
|
addError: (msg: string | (string | {
|
1576
1584
|
msg: string;
|
@@ -1981,7 +1989,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
1981
1989
|
validateOnChange?: boolean | undefined;
|
1982
1990
|
label?: string | undefined;
|
1983
1991
|
}) => void;
|
1984
|
-
validate: (data: Object, hook?: any
|
1992
|
+
validate: (data: Object, hook?: any, customRules?: {
|
1993
|
+
[propName: string]: any;
|
1994
|
+
} | undefined) => Promise<boolean>;
|
1985
1995
|
setError: (msg: string | string[], tag?: string) => void;
|
1986
1996
|
addError: (msg: string | (string | {
|
1987
1997
|
msg: string;
|
@@ -2388,7 +2398,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
2388
2398
|
validateOnChange?: boolean | undefined;
|
2389
2399
|
label?: string | undefined;
|
2390
2400
|
}) => void;
|
2391
|
-
validate: (data: Object, hook?: any
|
2401
|
+
validate: (data: Object, hook?: any, customRules?: {
|
2402
|
+
[propName: string]: any;
|
2403
|
+
} | undefined) => Promise<boolean>;
|
2392
2404
|
setError: (msg: string | string[], tag?: string) => void;
|
2393
2405
|
addError: (msg: string | (string | {
|
2394
2406
|
msg: string;
|
@@ -2799,7 +2811,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
2799
2811
|
validateOnChange?: boolean | undefined;
|
2800
2812
|
label?: string | undefined;
|
2801
2813
|
}) => void;
|
2802
|
-
validate: (data: Object, hook?: any
|
2814
|
+
validate: (data: Object, hook?: any, customRules?: {
|
2815
|
+
[propName: string]: any;
|
2816
|
+
} | undefined) => Promise<boolean>;
|
2803
2817
|
setError: (msg: string | string[], tag?: string) => void;
|
2804
2818
|
addError: (msg: string | (string | {
|
2805
2819
|
msg: string;
|
@@ -3206,7 +3220,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
3206
3220
|
validateOnChange?: boolean | undefined;
|
3207
3221
|
label?: string | undefined;
|
3208
3222
|
}) => void;
|
3209
|
-
validate: (data: Object, hook?: any
|
3223
|
+
validate: (data: Object, hook?: any, customRules?: {
|
3224
|
+
[propName: string]: any;
|
3225
|
+
} | undefined) => Promise<boolean>;
|
3210
3226
|
setError: (msg: string | string[], tag?: string) => void;
|
3211
3227
|
addError: (msg: string | (string | {
|
3212
3228
|
msg: string;
|
@@ -3527,7 +3543,12 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
3527
3543
|
trimValues: () => void;
|
3528
3544
|
submit: (fn?: ((values: object) => Promise<any>) | undefined, hooks?: (() => Promise<any>)[] | undefined, failedMessage?: string | undefined, validateErrCb?: (() => void) | undefined) => Promise<any>;
|
3529
3545
|
validate: (hooks?: (() => Promise<any>)[] | undefined, forceValidate?: boolean | undefined) => Promise<boolean>;
|
3530
|
-
validateFields: (fields: string
|
3546
|
+
validateFields: (fields: (string | {
|
3547
|
+
name: string;
|
3548
|
+
rules: {
|
3549
|
+
[propName: string]: any;
|
3550
|
+
};
|
3551
|
+
})[]) => Promise<boolean>;
|
3531
3552
|
clearErrors: () => void;
|
3532
3553
|
saveRemote: (api: import("../../types").Api, data?: object | undefined, options?: import("../../types").fetchOptions | undefined) => Promise<any>;
|
3533
3554
|
reset: (cb?: ((data: any) => void) | undefined, resetData?: boolean) => void;
|
@@ -3728,7 +3749,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
3728
3749
|
validateOnChange?: boolean | undefined;
|
3729
3750
|
label?: string | undefined;
|
3730
3751
|
}) => void;
|
3731
|
-
validate: (data: Object, hook?: any
|
3752
|
+
validate: (data: Object, hook?: any, customRules?: {
|
3753
|
+
[propName: string]: any;
|
3754
|
+
} | undefined) => Promise<boolean>;
|
3732
3755
|
setError: (msg: string | string[], tag?: string) => void;
|
3733
3756
|
addError: (msg: string | (string | {
|
3734
3757
|
msg: string;
|
@@ -4135,7 +4158,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
4135
4158
|
validateOnChange?: boolean | undefined;
|
4136
4159
|
label?: string | undefined;
|
4137
4160
|
}) => void;
|
4138
|
-
validate: (data: Object, hook?: any
|
4161
|
+
validate: (data: Object, hook?: any, customRules?: {
|
4162
|
+
[propName: string]: any;
|
4163
|
+
} | undefined) => Promise<boolean>;
|
4139
4164
|
setError: (msg: string | string[], tag?: string) => void;
|
4140
4165
|
addError: (msg: string | (string | {
|
4141
4166
|
msg: string;
|
@@ -4551,7 +4576,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
4551
4576
|
validateOnChange?: boolean | undefined;
|
4552
4577
|
label?: string | undefined;
|
4553
4578
|
}) => void;
|
4554
|
-
validate: (data: Object, hook?: any
|
4579
|
+
validate: (data: Object, hook?: any, customRules?: {
|
4580
|
+
[propName: string]: any;
|
4581
|
+
} | undefined) => Promise<boolean>;
|
4555
4582
|
setError: (msg: string | string[], tag?: string) => void;
|
4556
4583
|
addError: (msg: string | (string | {
|
4557
4584
|
msg: string;
|
@@ -4958,7 +4985,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
4958
4985
|
validateOnChange?: boolean | undefined;
|
4959
4986
|
label?: string | undefined;
|
4960
4987
|
}) => void;
|
4961
|
-
validate: (data: Object, hook?: any
|
4988
|
+
validate: (data: Object, hook?: any, customRules?: {
|
4989
|
+
[propName: string]: any;
|
4990
|
+
} | undefined) => Promise<boolean>;
|
4962
4991
|
setError: (msg: string | string[], tag?: string) => void;
|
4963
4992
|
addError: (msg: string | (string | {
|
4964
4993
|
msg: string;
|
@@ -5369,7 +5398,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
5369
5398
|
validateOnChange?: boolean | undefined;
|
5370
5399
|
label?: string | undefined;
|
5371
5400
|
}) => void;
|
5372
|
-
validate: (data: Object, hook?: any
|
5401
|
+
validate: (data: Object, hook?: any, customRules?: {
|
5402
|
+
[propName: string]: any;
|
5403
|
+
} | undefined) => Promise<boolean>;
|
5373
5404
|
setError: (msg: string | string[], tag?: string) => void;
|
5374
5405
|
addError: (msg: string | (string | {
|
5375
5406
|
msg: string;
|
@@ -5776,7 +5807,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
5776
5807
|
validateOnChange?: boolean | undefined;
|
5777
5808
|
label?: string | undefined;
|
5778
5809
|
}) => void;
|
5779
|
-
validate: (data: Object, hook?: any
|
5810
|
+
validate: (data: Object, hook?: any, customRules?: {
|
5811
|
+
[propName: string]: any;
|
5812
|
+
} | undefined) => Promise<boolean>;
|
5780
5813
|
setError: (msg: string | string[], tag?: string) => void;
|
5781
5814
|
addError: (msg: string | (string | {
|
5782
5815
|
msg: string;
|
@@ -6187,7 +6220,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
6187
6220
|
validateOnChange?: boolean | undefined;
|
6188
6221
|
label?: string | undefined;
|
6189
6222
|
}) => void;
|
6190
|
-
validate: (data: Object, hook?: any
|
6223
|
+
validate: (data: Object, hook?: any, customRules?: {
|
6224
|
+
[propName: string]: any;
|
6225
|
+
} | undefined) => Promise<boolean>;
|
6191
6226
|
setError: (msg: string | string[], tag?: string) => void;
|
6192
6227
|
addError: (msg: string | (string | {
|
6193
6228
|
msg: string;
|
@@ -6594,7 +6629,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
6594
6629
|
validateOnChange?: boolean | undefined;
|
6595
6630
|
label?: string | undefined;
|
6596
6631
|
}) => void;
|
6597
|
-
validate: (data: Object, hook?: any
|
6632
|
+
validate: (data: Object, hook?: any, customRules?: {
|
6633
|
+
[propName: string]: any;
|
6634
|
+
} | undefined) => Promise<boolean>;
|
6598
6635
|
setError: (msg: string | string[], tag?: string) => void;
|
6599
6636
|
addError: (msg: string | (string | {
|
6600
6637
|
msg: string;
|
@@ -6915,7 +6952,12 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
6915
6952
|
trimValues: () => void;
|
6916
6953
|
submit: (fn?: ((values: object) => Promise<any>) | undefined, hooks?: (() => Promise<any>)[] | undefined, failedMessage?: string | undefined, validateErrCb?: (() => void) | undefined) => Promise<any>;
|
6917
6954
|
validate: (hooks?: (() => Promise<any>)[] | undefined, forceValidate?: boolean | undefined) => Promise<boolean>;
|
6918
|
-
validateFields: (fields: string
|
6955
|
+
validateFields: (fields: (string | {
|
6956
|
+
name: string;
|
6957
|
+
rules: {
|
6958
|
+
[propName: string]: any;
|
6959
|
+
};
|
6960
|
+
})[]) => Promise<boolean>;
|
6919
6961
|
clearErrors: () => void;
|
6920
6962
|
saveRemote: (api: import("../../types").Api, data?: object | undefined, options?: import("../../types").fetchOptions | undefined) => Promise<any>;
|
6921
6963
|
reset: (cb?: ((data: any) => void) | undefined, resetData?: boolean) => void;
|
@@ -7039,7 +7081,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
7039
7081
|
validateOnChange?: boolean | undefined;
|
7040
7082
|
label?: string | undefined;
|
7041
7083
|
}) => void;
|
7042
|
-
validate: (data: Object, hook?: any
|
7084
|
+
validate: (data: Object, hook?: any, customRules?: {
|
7085
|
+
[propName: string]: any;
|
7086
|
+
} | undefined) => Promise<boolean>;
|
7043
7087
|
setError: (msg: string | string[], tag?: string) => void;
|
7044
7088
|
addError: (msg: string | (string | {
|
7045
7089
|
msg: string;
|
@@ -7446,7 +7490,9 @@ export declare class DiffEditorControlRenderer extends DiffEditor {
|
|
7446
7490
|
validateOnChange?: boolean | undefined;
|
7447
7491
|
label?: string | undefined;
|
7448
7492
|
}) => void;
|
7449
|
-
validate: (data: Object, hook?: any
|
7493
|
+
validate: (data: Object, hook?: any, customRules?: {
|
7494
|
+
[propName: string]: any;
|
7495
|
+
} | undefined) => Promise<boolean>;
|
7450
7496
|
setError: (msg: string | string[], tag?: string) => void;
|
7451
7497
|
addError: (msg: string | (string | {
|
7452
7498
|
msg: string;
|
@@ -346,7 +346,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
346
346
|
validateOnChange?: boolean | undefined;
|
347
347
|
label?: string | undefined;
|
348
348
|
}) => void;
|
349
|
-
validate: (data: Object, hook?: any
|
349
|
+
validate: (data: Object, hook?: any, customRules?: {
|
350
|
+
[propName: string]: any;
|
351
|
+
} | undefined) => Promise<boolean>;
|
350
352
|
setError: (msg: string | string[], tag?: string) => void;
|
351
353
|
addError: (msg: string | (string | {
|
352
354
|
msg: string;
|
@@ -763,7 +765,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
763
765
|
validateOnChange?: boolean | undefined;
|
764
766
|
label?: string | undefined;
|
765
767
|
}) => void;
|
766
|
-
validate: (data: Object, hook?: any
|
768
|
+
validate: (data: Object, hook?: any, customRules?: {
|
769
|
+
[propName: string]: any;
|
770
|
+
} | undefined) => Promise<boolean>;
|
767
771
|
setError: (msg: string | string[], tag?: string) => void;
|
768
772
|
addError: (msg: string | (string | {
|
769
773
|
msg: string;
|
@@ -1189,7 +1193,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
1189
1193
|
validateOnChange?: boolean | undefined;
|
1190
1194
|
label?: string | undefined;
|
1191
1195
|
}) => void;
|
1192
|
-
validate: (data: Object, hook?: any
|
1196
|
+
validate: (data: Object, hook?: any, customRules?: {
|
1197
|
+
[propName: string]: any;
|
1198
|
+
} | undefined) => Promise<boolean>;
|
1193
1199
|
setError: (msg: string | string[], tag?: string) => void;
|
1194
1200
|
addError: (msg: string | (string | {
|
1195
1201
|
msg: string;
|
@@ -1606,7 +1612,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
1606
1612
|
validateOnChange?: boolean | undefined;
|
1607
1613
|
label?: string | undefined;
|
1608
1614
|
}) => void;
|
1609
|
-
validate: (data: Object, hook?: any
|
1615
|
+
validate: (data: Object, hook?: any, customRules?: {
|
1616
|
+
[propName: string]: any;
|
1617
|
+
} | undefined) => Promise<boolean>;
|
1610
1618
|
setError: (msg: string | string[], tag?: string) => void;
|
1611
1619
|
addError: (msg: string | (string | {
|
1612
1620
|
msg: string;
|
@@ -2027,7 +2035,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
2027
2035
|
validateOnChange?: boolean | undefined;
|
2028
2036
|
label?: string | undefined;
|
2029
2037
|
}) => void;
|
2030
|
-
validate: (data: Object, hook?: any
|
2038
|
+
validate: (data: Object, hook?: any, customRules?: {
|
2039
|
+
[propName: string]: any;
|
2040
|
+
} | undefined) => Promise<boolean>;
|
2031
2041
|
setError: (msg: string | string[], tag?: string) => void;
|
2032
2042
|
addError: (msg: string | (string | {
|
2033
2043
|
msg: string;
|
@@ -2444,7 +2454,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
2444
2454
|
validateOnChange?: boolean | undefined;
|
2445
2455
|
label?: string | undefined;
|
2446
2456
|
}) => void;
|
2447
|
-
validate: (data: Object, hook?: any
|
2457
|
+
validate: (data: Object, hook?: any, customRules?: {
|
2458
|
+
[propName: string]: any;
|
2459
|
+
} | undefined) => Promise<boolean>;
|
2448
2460
|
setError: (msg: string | string[], tag?: string) => void;
|
2449
2461
|
addError: (msg: string | (string | {
|
2450
2462
|
msg: string;
|
@@ -2865,7 +2877,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
2865
2877
|
validateOnChange?: boolean | undefined;
|
2866
2878
|
label?: string | undefined;
|
2867
2879
|
}) => void;
|
2868
|
-
validate: (data: Object, hook?: any
|
2880
|
+
validate: (data: Object, hook?: any, customRules?: {
|
2881
|
+
[propName: string]: any;
|
2882
|
+
} | undefined) => Promise<boolean>;
|
2869
2883
|
setError: (msg: string | string[], tag?: string) => void;
|
2870
2884
|
addError: (msg: string | (string | {
|
2871
2885
|
msg: string;
|
@@ -3282,7 +3296,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
3282
3296
|
validateOnChange?: boolean | undefined;
|
3283
3297
|
label?: string | undefined;
|
3284
3298
|
}) => void;
|
3285
|
-
validate: (data: Object, hook?: any
|
3299
|
+
validate: (data: Object, hook?: any, customRules?: {
|
3300
|
+
[propName: string]: any;
|
3301
|
+
} | undefined) => Promise<boolean>;
|
3286
3302
|
setError: (msg: string | string[], tag?: string) => void;
|
3287
3303
|
addError: (msg: string | (string | {
|
3288
3304
|
msg: string;
|
@@ -3611,7 +3627,12 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
3611
3627
|
trimValues: () => void;
|
3612
3628
|
submit: (fn?: ((values: object) => Promise<any>) | undefined, hooks?: (() => Promise<any>)[] | undefined, failedMessage?: string | undefined, validateErrCb?: (() => void) | undefined) => Promise<any>;
|
3613
3629
|
validate: (hooks?: (() => Promise<any>)[] | undefined, forceValidate?: boolean | undefined) => Promise<boolean>;
|
3614
|
-
validateFields: (fields: string
|
3630
|
+
validateFields: (fields: (string | {
|
3631
|
+
name: string;
|
3632
|
+
rules: {
|
3633
|
+
[propName: string]: any;
|
3634
|
+
};
|
3635
|
+
})[]) => Promise<boolean>;
|
3615
3636
|
clearErrors: () => void;
|
3616
3637
|
saveRemote: (api: import("../../types").Api, data?: object | undefined, options?: import("../../types").fetchOptions | undefined) => Promise<any>;
|
3617
3638
|
reset: (cb?: ((data: any) => void) | undefined, resetData?: boolean) => void;
|
@@ -3816,7 +3837,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
3816
3837
|
validateOnChange?: boolean | undefined;
|
3817
3838
|
label?: string | undefined;
|
3818
3839
|
}) => void;
|
3819
|
-
validate: (data: Object, hook?: any
|
3840
|
+
validate: (data: Object, hook?: any, customRules?: {
|
3841
|
+
[propName: string]: any;
|
3842
|
+
} | undefined) => Promise<boolean>;
|
3820
3843
|
setError: (msg: string | string[], tag?: string) => void;
|
3821
3844
|
addError: (msg: string | (string | {
|
3822
3845
|
msg: string;
|
@@ -4233,7 +4256,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
4233
4256
|
validateOnChange?: boolean | undefined;
|
4234
4257
|
label?: string | undefined;
|
4235
4258
|
}) => void;
|
4236
|
-
validate: (data: Object, hook?: any
|
4259
|
+
validate: (data: Object, hook?: any, customRules?: {
|
4260
|
+
[propName: string]: any;
|
4261
|
+
} | undefined) => Promise<boolean>;
|
4237
4262
|
setError: (msg: string | string[], tag?: string) => void;
|
4238
4263
|
addError: (msg: string | (string | {
|
4239
4264
|
msg: string;
|
@@ -4659,7 +4684,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
4659
4684
|
validateOnChange?: boolean | undefined;
|
4660
4685
|
label?: string | undefined;
|
4661
4686
|
}) => void;
|
4662
|
-
validate: (data: Object, hook?: any
|
4687
|
+
validate: (data: Object, hook?: any, customRules?: {
|
4688
|
+
[propName: string]: any;
|
4689
|
+
} | undefined) => Promise<boolean>;
|
4663
4690
|
setError: (msg: string | string[], tag?: string) => void;
|
4664
4691
|
addError: (msg: string | (string | {
|
4665
4692
|
msg: string;
|
@@ -5076,7 +5103,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
5076
5103
|
validateOnChange?: boolean | undefined;
|
5077
5104
|
label?: string | undefined;
|
5078
5105
|
}) => void;
|
5079
|
-
validate: (data: Object, hook?: any
|
5106
|
+
validate: (data: Object, hook?: any, customRules?: {
|
5107
|
+
[propName: string]: any;
|
5108
|
+
} | undefined) => Promise<boolean>;
|
5080
5109
|
setError: (msg: string | string[], tag?: string) => void;
|
5081
5110
|
addError: (msg: string | (string | {
|
5082
5111
|
msg: string;
|
@@ -5497,7 +5526,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
5497
5526
|
validateOnChange?: boolean | undefined;
|
5498
5527
|
label?: string | undefined;
|
5499
5528
|
}) => void;
|
5500
|
-
validate: (data: Object, hook?: any
|
5529
|
+
validate: (data: Object, hook?: any, customRules?: {
|
5530
|
+
[propName: string]: any;
|
5531
|
+
} | undefined) => Promise<boolean>;
|
5501
5532
|
setError: (msg: string | string[], tag?: string) => void;
|
5502
5533
|
addError: (msg: string | (string | {
|
5503
5534
|
msg: string;
|
@@ -5914,7 +5945,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
5914
5945
|
validateOnChange?: boolean | undefined;
|
5915
5946
|
label?: string | undefined;
|
5916
5947
|
}) => void;
|
5917
|
-
validate: (data: Object, hook?: any
|
5948
|
+
validate: (data: Object, hook?: any, customRules?: {
|
5949
|
+
[propName: string]: any;
|
5950
|
+
} | undefined) => Promise<boolean>;
|
5918
5951
|
setError: (msg: string | string[], tag?: string) => void;
|
5919
5952
|
addError: (msg: string | (string | {
|
5920
5953
|
msg: string;
|
@@ -6335,7 +6368,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
6335
6368
|
validateOnChange?: boolean | undefined;
|
6336
6369
|
label?: string | undefined;
|
6337
6370
|
}) => void;
|
6338
|
-
validate: (data: Object, hook?: any
|
6371
|
+
validate: (data: Object, hook?: any, customRules?: {
|
6372
|
+
[propName: string]: any;
|
6373
|
+
} | undefined) => Promise<boolean>;
|
6339
6374
|
setError: (msg: string | string[], tag?: string) => void;
|
6340
6375
|
addError: (msg: string | (string | {
|
6341
6376
|
msg: string;
|
@@ -6752,7 +6787,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
6752
6787
|
validateOnChange?: boolean | undefined;
|
6753
6788
|
label?: string | undefined;
|
6754
6789
|
}) => void;
|
6755
|
-
validate: (data: Object, hook?: any
|
6790
|
+
validate: (data: Object, hook?: any, customRules?: {
|
6791
|
+
[propName: string]: any;
|
6792
|
+
} | undefined) => Promise<boolean>;
|
6756
6793
|
setError: (msg: string | string[], tag?: string) => void;
|
6757
6794
|
addError: (msg: string | (string | {
|
6758
6795
|
msg: string;
|
@@ -7081,7 +7118,12 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
7081
7118
|
trimValues: () => void;
|
7082
7119
|
submit: (fn?: ((values: object) => Promise<any>) | undefined, hooks?: (() => Promise<any>)[] | undefined, failedMessage?: string | undefined, validateErrCb?: (() => void) | undefined) => Promise<any>;
|
7083
7120
|
validate: (hooks?: (() => Promise<any>)[] | undefined, forceValidate?: boolean | undefined) => Promise<boolean>;
|
7084
|
-
validateFields: (fields: string
|
7121
|
+
validateFields: (fields: (string | {
|
7122
|
+
name: string;
|
7123
|
+
rules: {
|
7124
|
+
[propName: string]: any;
|
7125
|
+
};
|
7126
|
+
})[]) => Promise<boolean>;
|
7085
7127
|
clearErrors: () => void;
|
7086
7128
|
saveRemote: (api: import("../../types").Api, data?: object | undefined, options?: import("../../types").fetchOptions | undefined) => Promise<any>;
|
7087
7129
|
reset: (cb?: ((data: any) => void) | undefined, resetData?: boolean) => void;
|
@@ -7207,7 +7249,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
7207
7249
|
validateOnChange?: boolean | undefined;
|
7208
7250
|
label?: string | undefined;
|
7209
7251
|
}) => void;
|
7210
|
-
validate: (data: Object, hook?: any
|
7252
|
+
validate: (data: Object, hook?: any, customRules?: {
|
7253
|
+
[propName: string]: any;
|
7254
|
+
} | undefined) => Promise<boolean>;
|
7211
7255
|
setError: (msg: string | string[], tag?: string) => void;
|
7212
7256
|
addError: (msg: string | (string | {
|
7213
7257
|
msg: string;
|
@@ -7624,7 +7668,9 @@ export declare class EditorControlRenderer extends EditorControl {
|
|
7624
7668
|
validateOnChange?: boolean | undefined;
|
7625
7669
|
label?: string | undefined;
|
7626
7670
|
}) => void;
|
7627
|
-
validate: (data: Object, hook?: any
|
7671
|
+
validate: (data: Object, hook?: any, customRules?: {
|
7672
|
+
[propName: string]: any;
|
7673
|
+
} | undefined) => Promise<boolean>;
|
7628
7674
|
setError: (msg: string | string[], tag?: string) => void;
|
7629
7675
|
addError: (msg: string | (string | {
|
7630
7676
|
msg: string;
|
@@ -19,7 +19,7 @@ var ControlGroupRenderer = /** @class */ (function (_super) {
|
|
19
19
|
return null;
|
20
20
|
}
|
21
21
|
var subSchema = control;
|
22
|
-
return render("".concat(index), subSchema, (0, tslib_1.__assign)({ disabled: disabled, formMode: subFormMode || mode || formMode, formHorizontal: subFormHorizontal || horizontal || formHorizontal }, otherProps));
|
22
|
+
return render("".concat(index), subSchema, (0, tslib_1.__assign)({ disabled: control.disabled || disabled, formMode: subFormMode || mode || formMode, formHorizontal: subFormHorizontal || horizontal || formHorizontal }, otherProps));
|
23
23
|
};
|
24
24
|
ControlGroupRenderer.prototype.renderVertical = function (props) {
|
25
25
|
var _this = this;
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/renderers/Form/Group.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";;;;AAAA,6DAA0B;AAC1B,yCAAsD;AAEtD,6CAI4B;AAE5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,EAAE,KAAK,EAClB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,IAAI,CAAC,WAAW,IAC/B,CACH,CAAC;SACH;QAED,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAvKU,oBAAoB;QAHhC,IAAA,kBAAQ,EAAC;YACR,IAAI,EAAE,OAAO;SACd,CAAC;;OACW,oBAAoB,CAwKhC;IAAD,2BAAC;CAAA,AAxKD,CAA0C,eAAK,CAAC,SAAS,GAwKxD;AAxKY,oDAAoB",
|
10
10
|
"sourcesContent": [
|
11
|
-
"import React from 'react';\nimport {Renderer, RendererProps} from '../../factory';\nimport {Schema} from '../../types';\nimport {\n isVisible,\n getWidthRate,\n makeHorizontalDeeper\n} from '../../utils/helper';\nimport cx from 'classnames';\nimport {FormBaseControl, FormItemWrap} from './Item';\nimport getExprProperties from '../../utils/filter-schema';\nimport {SchemaClassName, SchemaObject} from '../../Schema';\nimport Form, {FormSchemaHorizontal} from './index';\n\nexport type GroupSubControl = SchemaObject & {\n /**\n * 列类名\n */\n columnClassName?: SchemaClassName;\n\n /**\n * 宽度占用比率。在某些容器里面有用比如 group\n */\n columnRatio?: number | 'auto';\n};\n\n/**\n * Group 表单集合渲染器,能让多个表单在一行显示\n * 文档:https://baidu.gitee.io/amis/docs/components/form/group\n */\nexport interface GroupControlSchema extends FormBaseControl {\n type: 'group';\n\n /**\n * FormItem 集合\n */\n body: Array<GroupSubControl>;\n\n /**\n * 间隔\n */\n gap?: 'xs' | 'sm' | 'normal';\n\n /**\n * 配置时垂直摆放还是左右摆放。\n */\n direction?: 'horizontal' | 'vertical';\n\n /**\n * 配置子表单项默认的展示方式。\n */\n subFormMode?: 'normal' | 'inline' | 'horizontal';\n /**\n * 如果是水平排版,这个属性可以细化水平排版的左右宽度占比。\n */\n subFormHorizontal?: FormSchemaHorizontal;\n}\n\nexport interface InputGroupProps\n extends RendererProps,\n Omit<GroupControlSchema, 'type' | 'className'> {}\n\n@Renderer({\n type: 'group'\n})\nexport class ControlGroupRenderer extends React.Component<InputGroupProps> {\n constructor(props: InputGroupProps) {\n super(props);\n this.renderInput = this.renderInput.bind(this);\n }\n\n renderControl(control: any, index: any, otherProps?: any) {\n const {\n render,\n disabled,\n data,\n mode,\n horizontal,\n formMode,\n formHorizontal,\n subFormMode,\n subFormHorizontal\n } = this.props;\n\n if (!control) {\n return null;\n }\n\n const subSchema: any = control;\n\n return render(`${index}`, subSchema, {\n disabled,\n formMode: subFormMode || mode || formMode,\n formHorizontal: subFormHorizontal || horizontal || formHorizontal,\n ...otherProps\n });\n }\n\n renderVertical(props = this.props) {\n let {body, className, classnames: cx, mode, formMode, data} = props;\n formMode = mode || formMode;\n\n if (!Array.isArray(body)) {\n return null;\n }\n\n return (\n <div\n className={cx(\n `Form-group Form-group--ver Form-group--${formMode}`,\n className\n )}\n >\n {body.map((control, index) => {\n if (!isVisible(control, data)) {\n return null;\n }\n\n return this.renderControl(control, index, {\n key: index\n });\n })}\n </div>\n );\n }\n\n renderHorizontal(props = this.props) {\n let {\n body,\n className,\n classPrefix: ns,\n classnames: cx,\n mode,\n horizontal,\n formMode,\n formHorizontal,\n subFormMode,\n subFormHorizontal,\n data,\n gap\n } = props;\n\n if (!Array.isArray(body)) {\n return null;\n }\n\n formMode = subFormMode || mode || formMode;\n\n let horizontalDeeper =\n subFormHorizontal ||\n horizontal ||\n (formHorizontal\n ? makeHorizontalDeeper(\n formHorizontal,\n body.filter(\n item =>\n (item as FormBaseControl)?.mode !== 'inline' &&\n isVisible(item, data)\n ).length\n )\n : undefined);\n\n return (\n <div\n className={cx(\n `Form-group Form-group--hor Form-group--${formMode}`,\n gap ? `Form-group--${gap}` : '',\n className\n )}\n >\n {body.map((control, index) => {\n if (!isVisible(control, data)) {\n return null;\n }\n const controlMode = (control as FormBaseControl)?.mode || formMode;\n\n if (\n controlMode === 'inline' ||\n (control && (control as any).type === 'formula')\n ) {\n return this.renderControl(control, index, {\n key: index,\n className: cx(control.className, control.columnClassName)\n });\n }\n\n const columnWidth =\n control.columnRatio ||\n getWidthRate(control && control.columnClassName, true);\n\n return (\n <div\n key={index}\n className={cx(\n `${ns}Form-groupColumn`,\n columnWidth ? `${ns}Form-groupColumn--${columnWidth}` : '',\n control && control.columnClassName\n )}\n >\n {this.renderControl(control, index, {\n formHorizontal: horizontalDeeper,\n formMode: controlMode\n })}\n </div>\n );\n })}\n </div>\n );\n }\n\n renderInput(props = this.props) {\n const direction = props.direction;\n return direction === 'vertical'\n ? this.renderVertical(props)\n : this.renderHorizontal(props);\n }\n\n render() {\n const {label, ...rest} = this.props;\n\n if (typeof label !== 'undefined') {\n return (\n <FormItemWrap\n {...(rest as any)}\n sizeMutable={false}\n label={label}\n renderControl={this.renderInput}\n />\n );\n }\n\n return this.renderInput();\n }\n}\n"
|
11
|
+
"import React from 'react';\nimport {Renderer, RendererProps} from '../../factory';\nimport {Schema} from '../../types';\nimport {\n isVisible,\n getWidthRate,\n makeHorizontalDeeper\n} from '../../utils/helper';\nimport cx from 'classnames';\nimport {FormBaseControl, FormItemWrap} from './Item';\nimport getExprProperties from '../../utils/filter-schema';\nimport {SchemaClassName, SchemaObject} from '../../Schema';\nimport Form, {FormSchemaHorizontal} from './index';\n\nexport type GroupSubControl = SchemaObject & {\n /**\n * 列类名\n */\n columnClassName?: SchemaClassName;\n\n /**\n * 宽度占用比率。在某些容器里面有用比如 group\n */\n columnRatio?: number | 'auto';\n};\n\n/**\n * Group 表单集合渲染器,能让多个表单在一行显示\n * 文档:https://baidu.gitee.io/amis/docs/components/form/group\n */\nexport interface GroupControlSchema extends FormBaseControl {\n type: 'group';\n\n /**\n * FormItem 集合\n */\n body: Array<GroupSubControl>;\n\n /**\n * 间隔\n */\n gap?: 'xs' | 'sm' | 'normal';\n\n /**\n * 配置时垂直摆放还是左右摆放。\n */\n direction?: 'horizontal' | 'vertical';\n\n /**\n * 配置子表单项默认的展示方式。\n */\n subFormMode?: 'normal' | 'inline' | 'horizontal';\n /**\n * 如果是水平排版,这个属性可以细化水平排版的左右宽度占比。\n */\n subFormHorizontal?: FormSchemaHorizontal;\n}\n\nexport interface InputGroupProps\n extends RendererProps,\n Omit<GroupControlSchema, 'type' | 'className'> {}\n\n@Renderer({\n type: 'group'\n})\nexport class ControlGroupRenderer extends React.Component<InputGroupProps> {\n constructor(props: InputGroupProps) {\n super(props);\n this.renderInput = this.renderInput.bind(this);\n }\n\n renderControl(control: any, index: any, otherProps?: any) {\n const {\n render,\n disabled,\n data,\n mode,\n horizontal,\n formMode,\n formHorizontal,\n subFormMode,\n subFormHorizontal\n } = this.props;\n\n if (!control) {\n return null;\n }\n\n const subSchema: any = control;\n\n return render(`${index}`, subSchema, {\n disabled: control.disabled || disabled,\n formMode: subFormMode || mode || formMode,\n formHorizontal: subFormHorizontal || horizontal || formHorizontal,\n ...otherProps\n });\n }\n\n renderVertical(props = this.props) {\n let {body, className, classnames: cx, mode, formMode, data} = props;\n formMode = mode || formMode;\n\n if (!Array.isArray(body)) {\n return null;\n }\n\n return (\n <div\n className={cx(\n `Form-group Form-group--ver Form-group--${formMode}`,\n className\n )}\n >\n {body.map((control, index) => {\n if (!isVisible(control, data)) {\n return null;\n }\n\n return this.renderControl(control, index, {\n key: index\n });\n })}\n </div>\n );\n }\n\n renderHorizontal(props = this.props) {\n let {\n body,\n className,\n classPrefix: ns,\n classnames: cx,\n mode,\n horizontal,\n formMode,\n formHorizontal,\n subFormMode,\n subFormHorizontal,\n data,\n gap\n } = props;\n\n if (!Array.isArray(body)) {\n return null;\n }\n\n formMode = subFormMode || mode || formMode;\n\n let horizontalDeeper =\n subFormHorizontal ||\n horizontal ||\n (formHorizontal\n ? makeHorizontalDeeper(\n formHorizontal,\n body.filter(\n item =>\n (item as FormBaseControl)?.mode !== 'inline' &&\n isVisible(item, data)\n ).length\n )\n : undefined);\n\n return (\n <div\n className={cx(\n `Form-group Form-group--hor Form-group--${formMode}`,\n gap ? `Form-group--${gap}` : '',\n className\n )}\n >\n {body.map((control, index) => {\n if (!isVisible(control, data)) {\n return null;\n }\n const controlMode = (control as FormBaseControl)?.mode || formMode;\n\n if (\n controlMode === 'inline' ||\n (control && (control as any).type === 'formula')\n ) {\n return this.renderControl(control, index, {\n key: index,\n className: cx(control.className, control.columnClassName)\n });\n }\n\n const columnWidth =\n control.columnRatio ||\n getWidthRate(control && control.columnClassName, true);\n\n return (\n <div\n key={index}\n className={cx(\n `${ns}Form-groupColumn`,\n columnWidth ? `${ns}Form-groupColumn--${columnWidth}` : '',\n control && control.columnClassName\n )}\n >\n {this.renderControl(control, index, {\n formHorizontal: horizontalDeeper,\n formMode: controlMode\n })}\n </div>\n );\n })}\n </div>\n );\n }\n\n renderInput(props = this.props) {\n const direction = props.direction;\n return direction === 'vertical'\n ? this.renderVertical(props)\n : this.renderHorizontal(props);\n }\n\n render() {\n const {label, ...rest} = this.props;\n\n if (typeof label !== 'undefined') {\n return (\n <FormItemWrap\n {...(rest as any)}\n sizeMutable={false}\n label={label}\n renderControl={this.renderInput}\n />\n );\n }\n\n return this.renderInput();\n }\n}\n"
|
12
12
|
]
|
13
13
|
}
|
@@ -63,6 +63,10 @@ export interface InputFormulaControlSchema extends FormBaseControl {
|
|
63
63
|
* 边框模式,全边框,还是半边框,或者没边框。
|
64
64
|
*/
|
65
65
|
borderMode?: 'full' | 'half' | 'none';
|
66
|
+
/**
|
67
|
+
* 只展示变量,不需要其他面板
|
68
|
+
*/
|
69
|
+
onlyVariable?: boolean;
|
66
70
|
/**
|
67
71
|
* 输入框占位符
|
68
72
|
*/
|
@@ -75,15 +79,11 @@ export interface InputFormulaControlSchema extends FormBaseControl {
|
|
75
79
|
* 函数面板CSS样式类名
|
76
80
|
*/
|
77
81
|
functionClassName?: string;
|
78
|
-
/**
|
79
|
-
* 当前输入项字段 name: 用于避免循环绑定自身导致无限渲染
|
80
|
-
*/
|
81
|
-
selfVariableName?: string;
|
82
82
|
}
|
83
83
|
export interface InputFormulaProps extends FormControlProps, Omit<InputFormulaControlSchema, 'options' | 'inputClassName' | 'className' | 'descriptionClassName'> {
|
84
84
|
}
|
85
85
|
export declare class InputFormulaRenderer extends React.Component<InputFormulaProps> {
|
86
|
-
static defaultProps: Pick<InputFormulaControlSchema, 'inputMode' | 'borderMode' | 'evalMode'>;
|
86
|
+
static defaultProps: Pick<InputFormulaControlSchema, 'inputMode' | 'borderMode' | 'evalMode' | 'onlyVariable'>;
|
87
87
|
ref: any;
|
88
88
|
formulaRef(ref: any): void;
|
89
89
|
validate(): any;
|
@@ -34,7 +34,7 @@ var InputFormulaRenderer = /** @class */ (function (_super) {
|
|
34
34
|
}
|
35
35
|
};
|
36
36
|
InputFormulaRenderer.prototype.render = function () {
|
37
|
-
var _a = this.props, selectedOptions = _a.selectedOptions, disabled = _a.disabled, onChange = _a.onChange, evalMode = _a.evalMode, variableMode = _a.variableMode, header = _a.header, label = _a.label, value = _a.value, clearable = _a.clearable, className = _a.className, ns = _a.classPrefix, cx = _a.classnames, _b = _a.allowInput, allowInput = _b === void 0 ? true : _b, borderMode = _a.borderMode, placeholder = _a.placeholder, inputMode = _a.inputMode, btnLabel = _a.btnLabel, level = _a.level, btnSize = _a.btnSize, icon = _a.icon, title = _a.title, variableClassName = _a.variableClassName, functionClassName = _a.functionClassName, data = _a.data, onPickerOpen = _a.onPickerOpen
|
37
|
+
var _a = this.props, selectedOptions = _a.selectedOptions, disabled = _a.disabled, onChange = _a.onChange, evalMode = _a.evalMode, variableMode = _a.variableMode, onlyVariable = _a.onlyVariable, header = _a.header, label = _a.label, value = _a.value, clearable = _a.clearable, className = _a.className, ns = _a.classPrefix, cx = _a.classnames, _b = _a.allowInput, allowInput = _b === void 0 ? true : _b, borderMode = _a.borderMode, placeholder = _a.placeholder, inputMode = _a.inputMode, btnLabel = _a.btnLabel, level = _a.level, btnSize = _a.btnSize, icon = _a.icon, title = _a.title, variableClassName = _a.variableClassName, functionClassName = _a.functionClassName, data = _a.data, onPickerOpen = _a.onPickerOpen;
|
38
38
|
var _c = this.props, variables = _c.variables, functions = _c.functions;
|
39
39
|
if ((0, tpl_builtin_1.isPureVariable)(variables)) {
|
40
40
|
// 如果 variables 是 ${xxx} 这种形式,将其处理成实际的值
|
@@ -44,12 +44,13 @@ var InputFormulaRenderer = /** @class */ (function (_super) {
|
|
44
44
|
// 如果 functions 是 ${xxx} 这种形式,将其处理成实际的值
|
45
45
|
functions = (0, tpl_builtin_1.resolveVariableAndFilter)(functions, this.props.data, '| raw');
|
46
46
|
}
|
47
|
-
return (react_1.default.createElement(Picker_1.default, { ref: this.formulaRef, className: className, value: value, disabled: disabled, allowInput: allowInput, onChange: onChange, evalMode: evalMode, variables: variables, variableMode: variableMode, functions: functions, header: header || label || '', borderMode: borderMode, placeholder: placeholder, mode: inputMode, btnLabel: btnLabel, level: level, btnSize: btnSize, icon: icon, title: title, clearable: clearable, variableClassName: variableClassName, functionClassName: functionClassName, data: data, onPickerOpen: onPickerOpen
|
47
|
+
return (react_1.default.createElement(Picker_1.default, { ref: this.formulaRef, className: className, value: value, disabled: disabled, allowInput: allowInput, onChange: onChange, evalMode: evalMode, variables: variables, variableMode: variableMode, onlyVariable: onlyVariable, functions: functions, header: header || label || '', borderMode: borderMode, placeholder: placeholder, mode: inputMode, btnLabel: btnLabel, level: level, btnSize: btnSize, icon: icon, title: title, clearable: clearable, variableClassName: variableClassName, functionClassName: functionClassName, data: data, onPickerOpen: onPickerOpen }));
|
48
48
|
};
|
49
49
|
InputFormulaRenderer.defaultProps = {
|
50
50
|
inputMode: 'input-button',
|
51
51
|
borderMode: 'full',
|
52
|
-
evalMode: true
|
52
|
+
evalMode: true,
|
53
|
+
onlyVariable: false
|
53
54
|
};
|
54
55
|
(0, tslib_1.__decorate)([
|
55
56
|
helper_1.autobind,
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/renderers/Form/InputFormula.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";;;;AAAA,6DAA0B;AAE1B,6DAAmE;AACnE,wFAA4D;AAC5D,6CAA4C;A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AE,iBAAiB,EACpC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;IACJ,CAAC;IAzGM,iCAAY,GAGf;QACF,SAAS,EAAE,cAAc;QACzB,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,KAAK;KACnB,CAAA;IAKF;QADC,iBAAQ;;;;0DAUR;IAvBU,oBAAoB;QAHhC,IAAA,cAAQ,EAAC;YACR,IAAI,EAAE,eAAe;SACtB,CAAC;OACW,oBAAoB,CA2GhC;IAAD,2BAAC;CAAA,AA3GD,CAA0C,eAAK,CAAC,SAAS,GA2GxD;AA3GY,oDAAoB",
|
10
10
|
"sourcesContent": [
|
11
|
-
"import React from 'react';\nimport {parse, Evaluator} from 'amis-formula';\nimport FormItem, {FormBaseControl, FormControlProps} from './Item';\nimport FormulaPicker from '../../components/formula/Picker';\nimport {autobind} from '../../utils/helper';\n\nimport type {FuncGroup, VariableItem} from '../../components/formula/Editor';\nimport type {SchemaIcon} from '../../Schema';\nimport {\n isPureVariable,\n resolveVariableAndFilter\n} from '../../utils/tpl-builtin';\n\n/**\n * InputFormula 公式编辑器\n * 文档:https://baidu.gitee.io/amis/zh-CN/components/form/input-formula\n */\nexport interface InputFormulaControlSchema extends FormBaseControl {\n type: 'input-formula';\n\n /**\n * evalMode 即直接就是表达式,否则\n * 需要 ${这里面才是表达式}\n * 默认为 true\n */\n evalMode?: boolean;\n\n /**\n * 用于提示的变量集合,默认为空\n */\n variables: Array<VariableItem>;\n\n /**\n * 变量展现模式,可选值:'tabs' | 'tree'\n */\n variableMode?: 'tabs' | 'tree';\n\n /**\n * 函数集合,默认不需要传,即 amis-formula 里面那个函数\n * 如果有扩充,则需要传。\n */\n functions: Array<FuncGroup>;\n\n /**\n * 编辑器标题\n */\n title?: string;\n\n /**\n * 顶部标题,默认为表达式\n */\n header: string;\n\n /**\n * 控件模式\n */\n inputMode?: 'button' | 'input-button' | 'input-group';\n\n /**\n * 外层input是否允许输入,否需要点击fx在弹窗中输入\n */\n allowInput?: boolean;\n\n /**\n * 按钮图标\n */\n icon?: SchemaIcon;\n\n /**\n * 按钮Label,inputMode为button时生效\n */\n btnLabel?: string;\n\n /**\n * 按钮样式\n */\n level?:\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'\n | 'link'\n | 'primary'\n | 'dark'\n | 'light';\n\n /**\n * 按钮大小\n */\n btnSize?: 'xs' | 'sm' | 'md' | 'lg';\n\n /**\n * 边框模式,全边框,还是半边框,或者没边框。\n */\n borderMode?: 'full' | 'half' | 'none';\n\n /**\n *
|
11
|
+
"import React from 'react';\nimport {parse, Evaluator} from 'amis-formula';\nimport FormItem, {FormBaseControl, FormControlProps} from './Item';\nimport FormulaPicker from '../../components/formula/Picker';\nimport {autobind} from '../../utils/helper';\n\nimport type {FuncGroup, VariableItem} from '../../components/formula/Editor';\nimport type {SchemaIcon} from '../../Schema';\nimport {\n isPureVariable,\n resolveVariableAndFilter\n} from '../../utils/tpl-builtin';\n\n/**\n * InputFormula 公式编辑器\n * 文档:https://baidu.gitee.io/amis/zh-CN/components/form/input-formula\n */\nexport interface InputFormulaControlSchema extends FormBaseControl {\n type: 'input-formula';\n\n /**\n * evalMode 即直接就是表达式,否则\n * 需要 ${这里面才是表达式}\n * 默认为 true\n */\n evalMode?: boolean;\n\n /**\n * 用于提示的变量集合,默认为空\n */\n variables: Array<VariableItem>;\n\n /**\n * 变量展现模式,可选值:'tabs' | 'tree'\n */\n variableMode?: 'tabs' | 'tree';\n\n /**\n * 函数集合,默认不需要传,即 amis-formula 里面那个函数\n * 如果有扩充,则需要传。\n */\n functions: Array<FuncGroup>;\n\n /**\n * 编辑器标题\n */\n title?: string;\n\n /**\n * 顶部标题,默认为表达式\n */\n header: string;\n\n /**\n * 控件模式\n */\n inputMode?: 'button' | 'input-button' | 'input-group';\n\n /**\n * 外层input是否允许输入,否需要点击fx在弹窗中输入\n */\n allowInput?: boolean;\n\n /**\n * 按钮图标\n */\n icon?: SchemaIcon;\n\n /**\n * 按钮Label,inputMode为button时生效\n */\n btnLabel?: string;\n\n /**\n * 按钮样式\n */\n level?:\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'\n | 'link'\n | 'primary'\n | 'dark'\n | 'light';\n\n /**\n * 按钮大小\n */\n btnSize?: 'xs' | 'sm' | 'md' | 'lg';\n\n /**\n * 边框模式,全边框,还是半边框,或者没边框。\n */\n borderMode?: 'full' | 'half' | 'none';\n\n /**\n * 只展示变量,不需要其他面板\n */\n onlyVariable?: boolean;\n\n /**\n * 输入框占位符\n */\n placeholder?: string;\n\n /**\n * 变量面板CSS样式类名\n */\n variableClassName?: string;\n\n /**\n * 函数面板CSS样式类名\n */\n functionClassName?: string;\n}\n\nexport interface InputFormulaProps\n extends FormControlProps,\n Omit<\n InputFormulaControlSchema,\n 'options' | 'inputClassName' | 'className' | 'descriptionClassName'\n > {}\n\n@FormItem({\n type: 'input-formula'\n})\nexport class InputFormulaRenderer extends React.Component<InputFormulaProps> {\n static defaultProps: Pick<\n InputFormulaControlSchema,\n 'inputMode' | 'borderMode' | 'evalMode' | 'onlyVariable'\n > = {\n inputMode: 'input-button',\n borderMode: 'full',\n evalMode: true,\n onlyVariable: false\n };\n\n ref: any;\n\n @autobind\n formulaRef(ref: any) {\n if (ref) {\n while (ref && ref.getWrappedInstance) {\n ref = ref.getWrappedInstance();\n }\n this.ref = ref;\n } else {\n this.ref = undefined;\n }\n }\n\n validate() {\n const {translate: __, value} = this.props;\n\n if (this.ref?.validate) {\n const res = this.ref.validate(value);\n if (res !== true) {\n return __('FormulaEditor.invalidData', {err: res});\n }\n }\n }\n\n render() {\n let {\n selectedOptions,\n disabled,\n onChange,\n evalMode,\n variableMode,\n onlyVariable,\n header,\n label,\n value,\n clearable,\n className,\n classPrefix: ns,\n classnames: cx,\n allowInput = true,\n borderMode,\n placeholder,\n inputMode,\n btnLabel,\n level,\n btnSize,\n icon,\n title,\n variableClassName,\n functionClassName,\n data,\n onPickerOpen\n } = this.props;\n let {variables, functions} = this.props;\n\n if (isPureVariable(variables)) {\n // 如果 variables 是 ${xxx} 这种形式,将其处理成实际的值\n variables = resolveVariableAndFilter(variables, this.props.data, '| raw');\n }\n\n if (isPureVariable(functions)) {\n // 如果 functions 是 ${xxx} 这种形式,将其处理成实际的值\n functions = resolveVariableAndFilter(functions, this.props.data, '| raw');\n }\n\n return (\n <FormulaPicker\n ref={this.formulaRef}\n className={className}\n value={value}\n disabled={disabled}\n allowInput={allowInput}\n onChange={onChange}\n evalMode={evalMode}\n variables={variables}\n variableMode={variableMode}\n onlyVariable={onlyVariable}\n functions={functions}\n header={header || label || ''}\n borderMode={borderMode}\n placeholder={placeholder}\n mode={inputMode}\n btnLabel={btnLabel}\n level={level}\n btnSize={btnSize}\n icon={icon}\n title={title}\n clearable={clearable}\n variableClassName={variableClassName}\n functionClassName={functionClassName}\n data={data}\n onPickerOpen={onPickerOpen}\n />\n );\n }\n}\n"
|
12
12
|
]
|
13
13
|
}
|