ronds-metadata 1.2.57 → 1.2.59
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/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/NumberRange.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/NumberRange.js +42 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +3 -1
- package/es/comps/FormGenerator/comps/Settings/index.js +3 -5
- package/es/comps/FormGenerator/settings/index.d.ts +106 -0
- package/es/comps/FormGenerator/settings/index.js +32 -7
- package/es/comps/FormGenerator/settings/ruleConfig.d.ts +17 -0
- package/es/comps/FormGenerator/settings/ruleConfig.js +19 -2
- package/es/comps/MetadataForm/DataCell/Input.js +9 -4
- package/es/comps/MetadataForm/DataCell/Ref.js +1 -1
- package/es/comps/MetadataForm/DataCell/plugin/NumberRange.d.ts +19 -0
- package/es/comps/MetadataForm/DataCell/plugin/NumberRange.js +138 -0
- package/es/comps/MetadataForm/HOC/index.js +3 -2
- package/es/comps/MetadataForm/hooks/index.js +12 -4
- package/es/comps/MetadataForm/index.less +1 -1
- package/es/comps/MetadataForm/interface.d.ts +1 -0
- package/es/comps/MetadataForm/interface.js +1 -1
- package/es/utils.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
import "antd/es/input-number/style";
|
|
4
|
+
import _InputNumber from "antd/es/input-number";
|
|
5
|
+
import React from "react";
|
|
6
|
+
/*
|
|
7
|
+
* @Author: uloveits 719310130@qq.com
|
|
8
|
+
* @Date: 2023-02-06 15:05:42
|
|
9
|
+
* @LastEditors: Please set LastEditors
|
|
10
|
+
* @LastEditTime: 2023-06-02 11:34:36
|
|
11
|
+
*/
|
|
12
|
+
import { withFieldCellWrapper } from '../HOC';
|
|
13
|
+
var Index = function Index(props) {
|
|
14
|
+
var data = props.data,
|
|
15
|
+
fgStream = props.fgStream,
|
|
16
|
+
setting = props.setting;
|
|
17
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Input.Group, {
|
|
18
|
+
compact: true
|
|
19
|
+
}, /*#__PURE__*/React.createElement(_InputNumber, {
|
|
20
|
+
disabled: setting === null || setting === void 0 ? void 0 : setting.disabled,
|
|
21
|
+
style: {
|
|
22
|
+
width: (setting === null || setting === void 0 ? void 0 : setting.addonBefore) ? 'calc(50% - 44px)' : 'calc(50% - 14px)',
|
|
23
|
+
textAlign: 'center'
|
|
24
|
+
}
|
|
25
|
+
}), /*#__PURE__*/React.createElement(_Input, {
|
|
26
|
+
style: {
|
|
27
|
+
width: 30,
|
|
28
|
+
borderLeft: 0,
|
|
29
|
+
borderRight: 0,
|
|
30
|
+
pointerEvents: 'none'
|
|
31
|
+
},
|
|
32
|
+
placeholder: "~",
|
|
33
|
+
disabled: true
|
|
34
|
+
}), /*#__PURE__*/React.createElement(_InputNumber, {
|
|
35
|
+
disabled: setting === null || setting === void 0 ? void 0 : setting.disabled,
|
|
36
|
+
style: {
|
|
37
|
+
width: (setting === null || setting === void 0 ? void 0 : setting.addonBefore) ? 'calc(50% - 44px)' : 'calc(50% - 14px)',
|
|
38
|
+
textAlign: 'center'
|
|
39
|
+
}
|
|
40
|
+
})));
|
|
41
|
+
};
|
|
42
|
+
export default withFieldCellWrapper(Index);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: wangxian
|
|
3
3
|
* @Date: 2023-02-06 11:35:45
|
|
4
|
-
* @LastEditTime: 2023-02
|
|
4
|
+
* @LastEditTime: 2023-06-02 11:21:16
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import Input from './Cell/Input';
|
|
@@ -16,6 +16,7 @@ import Checkbox from './Cell/Checkbox';
|
|
|
16
16
|
import Radio from './Cell/Radio';
|
|
17
17
|
import Password from './Cell/Password';
|
|
18
18
|
import Upload from './Cell/Upload';
|
|
19
|
+
import NumberRange from './Cell/NumberRange';
|
|
19
20
|
import Obj from './Cell/Obj';
|
|
20
21
|
import List from './Cell/List';
|
|
21
22
|
import Table from './Cell/Table';
|
|
@@ -52,6 +53,7 @@ var DataCellMap = {
|
|
|
52
53
|
radio: Radio,
|
|
53
54
|
password: Password,
|
|
54
55
|
upload: Upload,
|
|
56
|
+
numberRange: NumberRange,
|
|
55
57
|
obj: Obj,
|
|
56
58
|
list: List,
|
|
57
59
|
table: Table
|
|
@@ -6,8 +6,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
6
6
|
/*
|
|
7
7
|
* @Author: uloveits 719310130@qq.com
|
|
8
8
|
* @Date: 2023-02-04 16:35:15
|
|
9
|
-
* @LastEditors:
|
|
10
|
-
* @LastEditTime: 2023-
|
|
9
|
+
* @LastEditors: Please set LastEditors
|
|
10
|
+
* @LastEditTime: 2023-05-30 15:19:23
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { FGCtx } from '../../Provider';
|
|
@@ -115,8 +115,7 @@ var Settings = function Settings() {
|
|
|
115
115
|
getFormInstance: function getFormInstance(form) {
|
|
116
116
|
compFormRef.current = form;
|
|
117
117
|
},
|
|
118
|
-
|
|
119
|
-
labelSpan: 8,
|
|
118
|
+
layout: "vertical",
|
|
120
119
|
onValuesChange: function onValuesChange(val, allVals) {
|
|
121
120
|
_onValuesChange(curNode.id, val, allVals);
|
|
122
121
|
}
|
|
@@ -129,7 +128,6 @@ var Settings = function Settings() {
|
|
|
129
128
|
getFormInstance: function getFormInstance(form) {
|
|
130
129
|
formRef.current = form;
|
|
131
130
|
},
|
|
132
|
-
colSpan: 24,
|
|
133
131
|
layout: "vertical",
|
|
134
132
|
onValuesChange: function onValuesChange(val, allVals) {
|
|
135
133
|
_onValuesChange(formSetting.id, val, allVals);
|
|
@@ -687,6 +687,56 @@ export declare const settingSchema: {
|
|
|
687
687
|
}[];
|
|
688
688
|
}[];
|
|
689
689
|
}[];
|
|
690
|
+
rangeNumber: {
|
|
691
|
+
id: string;
|
|
692
|
+
type: string;
|
|
693
|
+
properties: ({
|
|
694
|
+
id: string;
|
|
695
|
+
type: string;
|
|
696
|
+
fields: {
|
|
697
|
+
id: string;
|
|
698
|
+
type: string;
|
|
699
|
+
refId: string;
|
|
700
|
+
value: {
|
|
701
|
+
label: string;
|
|
702
|
+
};
|
|
703
|
+
}[];
|
|
704
|
+
} | {
|
|
705
|
+
id: string;
|
|
706
|
+
type: string;
|
|
707
|
+
fields: {
|
|
708
|
+
id: string;
|
|
709
|
+
type: string;
|
|
710
|
+
refId: string;
|
|
711
|
+
value: {
|
|
712
|
+
common: {
|
|
713
|
+
label: string;
|
|
714
|
+
};
|
|
715
|
+
'common-en-US': {};
|
|
716
|
+
};
|
|
717
|
+
}[];
|
|
718
|
+
})[];
|
|
719
|
+
types: {
|
|
720
|
+
id: string;
|
|
721
|
+
type: string;
|
|
722
|
+
properties: {
|
|
723
|
+
id: string;
|
|
724
|
+
type: string;
|
|
725
|
+
fields: {
|
|
726
|
+
id: string;
|
|
727
|
+
type: string;
|
|
728
|
+
refId: string;
|
|
729
|
+
value: {
|
|
730
|
+
text: {};
|
|
731
|
+
common: {
|
|
732
|
+
label: string;
|
|
733
|
+
};
|
|
734
|
+
'common-en-US': {};
|
|
735
|
+
};
|
|
736
|
+
}[];
|
|
737
|
+
}[];
|
|
738
|
+
}[];
|
|
739
|
+
}[];
|
|
690
740
|
switch: {
|
|
691
741
|
id: string;
|
|
692
742
|
type: string;
|
|
@@ -1715,6 +1765,62 @@ export declare const radioParam: {
|
|
|
1715
1765
|
type: string;
|
|
1716
1766
|
};
|
|
1717
1767
|
};
|
|
1768
|
+
export declare const numberRangeParam: {
|
|
1769
|
+
type: string;
|
|
1770
|
+
schema: {
|
|
1771
|
+
id: string;
|
|
1772
|
+
type: string;
|
|
1773
|
+
properties: ({
|
|
1774
|
+
id: string;
|
|
1775
|
+
type: string;
|
|
1776
|
+
fields: {
|
|
1777
|
+
id: string;
|
|
1778
|
+
type: string;
|
|
1779
|
+
refId: string;
|
|
1780
|
+
value: {
|
|
1781
|
+
label: string;
|
|
1782
|
+
};
|
|
1783
|
+
}[];
|
|
1784
|
+
} | {
|
|
1785
|
+
id: string;
|
|
1786
|
+
type: string;
|
|
1787
|
+
fields: {
|
|
1788
|
+
id: string;
|
|
1789
|
+
type: string;
|
|
1790
|
+
refId: string;
|
|
1791
|
+
value: {
|
|
1792
|
+
common: {
|
|
1793
|
+
label: string;
|
|
1794
|
+
};
|
|
1795
|
+
'common-en-US': {};
|
|
1796
|
+
};
|
|
1797
|
+
}[];
|
|
1798
|
+
})[];
|
|
1799
|
+
types: {
|
|
1800
|
+
id: string;
|
|
1801
|
+
type: string;
|
|
1802
|
+
properties: {
|
|
1803
|
+
id: string;
|
|
1804
|
+
type: string;
|
|
1805
|
+
fields: {
|
|
1806
|
+
id: string;
|
|
1807
|
+
type: string;
|
|
1808
|
+
refId: string;
|
|
1809
|
+
value: {
|
|
1810
|
+
text: {};
|
|
1811
|
+
common: {
|
|
1812
|
+
label: string;
|
|
1813
|
+
};
|
|
1814
|
+
'common-en-US': {};
|
|
1815
|
+
};
|
|
1816
|
+
}[];
|
|
1817
|
+
}[];
|
|
1818
|
+
}[];
|
|
1819
|
+
}[];
|
|
1820
|
+
rule: {
|
|
1821
|
+
type: string;
|
|
1822
|
+
};
|
|
1823
|
+
};
|
|
1718
1824
|
export declare const complexComps: {
|
|
1719
1825
|
id: string;
|
|
1720
1826
|
name: string;
|
|
@@ -2,19 +2,23 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
/*
|
|
3
3
|
* @Author: wangxian
|
|
4
4
|
* @Date: 2023-02-06 08:24:17
|
|
5
|
-
* @LastEditTime: 2023-
|
|
5
|
+
* @LastEditTime: 2023-06-05 16:21:16
|
|
6
6
|
*/
|
|
7
7
|
import { RefRule, Rule } from './ruleConfig';
|
|
8
8
|
export var inputSchema = [{
|
|
9
9
|
id: 'inputSchema',
|
|
10
10
|
type: 'object',
|
|
11
|
-
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
11
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
12
|
+
// Rule.common.defaultValue,
|
|
13
|
+
Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
|
|
12
14
|
types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.common.rules.types))
|
|
13
15
|
}];
|
|
14
16
|
export var textareaSchema = [{
|
|
15
17
|
id: 'textareaSchema',
|
|
16
18
|
type: 'object',
|
|
17
|
-
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, RefRule.textarea.props,
|
|
19
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan, RefRule.textarea.props,
|
|
20
|
+
// Rule.common.defaultValue,
|
|
21
|
+
Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
|
|
18
22
|
types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.textarea.types), _toConsumableArray(RefRule.common.rules.types))
|
|
19
23
|
}];
|
|
20
24
|
export var dateSchema = [{
|
|
@@ -28,7 +32,9 @@ export var dateSchema = [{
|
|
|
28
32
|
export var numberSchema = [{
|
|
29
33
|
id: 'numberSchema',
|
|
30
34
|
type: 'object',
|
|
31
|
-
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
35
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
36
|
+
// Rule.common.defaultValue,
|
|
37
|
+
Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
|
|
32
38
|
types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.common.rules.types))
|
|
33
39
|
}];
|
|
34
40
|
export var switchSchema = [{
|
|
@@ -42,19 +48,25 @@ export var switchSchema = [{
|
|
|
42
48
|
export var selectSchema = [{
|
|
43
49
|
id: 'selectSchema',
|
|
44
50
|
type: 'object',
|
|
45
|
-
properties: [Rule.common.id, Rule.common.label, RefRule.enum.props, Rule.common.color, Rule.common.colSpan,
|
|
51
|
+
properties: [Rule.common.id, Rule.common.label, RefRule.enum.props, Rule.common.color, Rule.common.colSpan,
|
|
52
|
+
// Rule.common.defaultValue,
|
|
53
|
+
Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props],
|
|
46
54
|
types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.enum.types))
|
|
47
55
|
}];
|
|
48
56
|
export var colorSchema = [{
|
|
49
57
|
id: 'colorSchema',
|
|
50
58
|
type: 'object',
|
|
51
|
-
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
59
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
60
|
+
// Rule.common.defaultValue,
|
|
61
|
+
Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props],
|
|
52
62
|
types: _toConsumableArray(RefRule.common.depend.types)
|
|
53
63
|
}];
|
|
54
64
|
export var passwordSchema = [{
|
|
55
65
|
id: 'passwordSchema',
|
|
56
66
|
type: 'object',
|
|
57
|
-
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
67
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
68
|
+
// Rule.common.defaultValue,
|
|
69
|
+
Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
|
|
58
70
|
types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.common.rules.types))
|
|
59
71
|
}];
|
|
60
72
|
export var uploadSchema = [{
|
|
@@ -74,6 +86,7 @@ export var settingSchema = {
|
|
|
74
86
|
textarea: textareaSchema,
|
|
75
87
|
date: dateSchema,
|
|
76
88
|
numebr: numberSchema,
|
|
89
|
+
rangeNumber: inputSchema,
|
|
77
90
|
switch: switchSchema,
|
|
78
91
|
select: selectSchema,
|
|
79
92
|
color: colorSchema,
|
|
@@ -192,6 +205,13 @@ export var radioParam = {
|
|
|
192
205
|
type: 'checkbox'
|
|
193
206
|
}
|
|
194
207
|
};
|
|
208
|
+
export var numberRangeParam = {
|
|
209
|
+
type: 'text',
|
|
210
|
+
schema: settingSchema.rangeNumber,
|
|
211
|
+
rule: {
|
|
212
|
+
type: 'rangeNumber'
|
|
213
|
+
}
|
|
214
|
+
};
|
|
195
215
|
// 基础组件列表渲染
|
|
196
216
|
export var complexComps = [{
|
|
197
217
|
id: 'color',
|
|
@@ -218,6 +238,11 @@ export var complexComps = [{
|
|
|
218
238
|
name: '单选框',
|
|
219
239
|
type: 'radio',
|
|
220
240
|
param: radioParam
|
|
241
|
+
}, {
|
|
242
|
+
id: 'numberRange',
|
|
243
|
+
name: '数字范围',
|
|
244
|
+
type: 'numberRange',
|
|
245
|
+
param: numberRangeParam
|
|
221
246
|
}];
|
|
222
247
|
export var objParam = {
|
|
223
248
|
type: 'ref',
|
|
@@ -209,6 +209,23 @@ export declare const Rule: {
|
|
|
209
209
|
};
|
|
210
210
|
}[];
|
|
211
211
|
};
|
|
212
|
+
disabled: {
|
|
213
|
+
id: string;
|
|
214
|
+
type: string;
|
|
215
|
+
fields: {
|
|
216
|
+
id: string;
|
|
217
|
+
type: string;
|
|
218
|
+
refId: string;
|
|
219
|
+
value: {
|
|
220
|
+
text: {};
|
|
221
|
+
common: {
|
|
222
|
+
label: string;
|
|
223
|
+
depend: {};
|
|
224
|
+
};
|
|
225
|
+
'common-en-US': {};
|
|
226
|
+
};
|
|
227
|
+
}[];
|
|
228
|
+
};
|
|
212
229
|
};
|
|
213
230
|
text: {
|
|
214
231
|
type: {
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
/*
|
|
3
3
|
* @Author: wangxian
|
|
4
4
|
* @Date: 2023-02-08 10:36:25
|
|
5
|
-
* @LastEditTime: 2023-02
|
|
5
|
+
* @LastEditTime: 2023-06-02 10:39:54
|
|
6
6
|
*/
|
|
7
7
|
import { DEFAULT_DATE_FORMAT } from '../../../comps/MetadataForm/DataCell/Input';
|
|
8
8
|
export var Rule = {
|
|
@@ -215,6 +215,23 @@ export var Rule = {
|
|
|
215
215
|
'common-en-US': {}
|
|
216
216
|
}
|
|
217
217
|
}]
|
|
218
|
+
},
|
|
219
|
+
disabled: {
|
|
220
|
+
id: 'disabled',
|
|
221
|
+
type: 'text',
|
|
222
|
+
fields: [{
|
|
223
|
+
id: 'Rule.Form',
|
|
224
|
+
type: 'ref',
|
|
225
|
+
refId: 'com.ronds.schema.default.Rule.Form',
|
|
226
|
+
value: {
|
|
227
|
+
text: {},
|
|
228
|
+
common: {
|
|
229
|
+
label: '只读',
|
|
230
|
+
depend: {}
|
|
231
|
+
},
|
|
232
|
+
'common-en-US': {}
|
|
233
|
+
}
|
|
234
|
+
}]
|
|
218
235
|
}
|
|
219
236
|
},
|
|
220
237
|
text: {
|
|
@@ -522,7 +539,7 @@ export var RefRule = {
|
|
|
522
539
|
types: [{
|
|
523
540
|
id: 'dependRule',
|
|
524
541
|
type: 'object',
|
|
525
|
-
properties: [Rule.depend.show, Rule.depend.hidden, Rule.depend.notRequire]
|
|
542
|
+
properties: [Rule.depend.show, Rule.depend.hidden, Rule.depend.notRequire, Rule.depend.disabled]
|
|
526
543
|
}]
|
|
527
544
|
},
|
|
528
545
|
rules: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import "antd/es/form/style";
|
|
3
2
|
import _Form from "antd/es/form";
|
|
4
3
|
import "antd/es/select/style";
|
|
5
4
|
import _Select from "antd/es/select";
|
|
5
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
6
6
|
import "antd/es/upload/style";
|
|
7
7
|
import _Upload from "antd/es/upload";
|
|
8
8
|
import "antd/es/button/style";
|
|
@@ -16,13 +16,14 @@ import _Input from "antd/es/input";
|
|
|
16
16
|
/*
|
|
17
17
|
* @Author: wangxian
|
|
18
18
|
* @Date: 2021-09-18 14:15:04
|
|
19
|
-
* @LastEditTime: 2023-
|
|
19
|
+
* @LastEditTime: 2023-06-02 10:46:41
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import { UploadOutlined } from '@ant-design/icons';
|
|
23
23
|
import { MetadataFormContext, MetadataRefContext } from '../interface';
|
|
24
24
|
import { useGetExtraInfo } from '../hooks';
|
|
25
25
|
import useObservable from '../../../framework/rxjs-hooks/useObservable';
|
|
26
|
+
import NumberRange from './plugin/NumberRange';
|
|
26
27
|
var TextArea = _Input.TextArea;
|
|
27
28
|
function Index(props) {
|
|
28
29
|
var _extraInfo$addonAfter7;
|
|
@@ -79,7 +80,7 @@ function Index(props) {
|
|
|
79
80
|
}
|
|
80
81
|
}, [extraInfo]);
|
|
81
82
|
var processInputType = function processInputType(_type) {
|
|
82
|
-
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$disabled5, _extraInfo$addonAfter2, _extraInfo$addonAfter3, _extraInfo$addonAfter4, _extraInfo$addonAfter5, _extraInfo$
|
|
83
|
+
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$disabled5, _extraInfo$disabled6, _extraInfo$addonAfter2, _extraInfo$addonAfter3, _extraInfo$addonAfter4, _extraInfo$addonAfter5, _extraInfo$disabled7;
|
|
83
84
|
switch (_type) {
|
|
84
85
|
case 'password':
|
|
85
86
|
return /*#__PURE__*/React.createElement(_Input.Password, {
|
|
@@ -117,6 +118,10 @@ function Index(props) {
|
|
|
117
118
|
disabled: (_extraInfo$disabled5 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled5 !== void 0 ? _extraInfo$disabled5 : disabled,
|
|
118
119
|
icon: /*#__PURE__*/React.createElement(UploadOutlined, null)
|
|
119
120
|
}, "\u4E0A\u4F20"));
|
|
121
|
+
case 'numberRange':
|
|
122
|
+
return /*#__PURE__*/React.createElement(NumberRange, _extends({}, extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.numberRange, {
|
|
123
|
+
disabled: (_extraInfo$disabled6 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled6 !== void 0 ? _extraInfo$disabled6 : disabled
|
|
124
|
+
}));
|
|
120
125
|
default:
|
|
121
126
|
return /*#__PURE__*/React.createElement(_Input, {
|
|
122
127
|
addonAfter: ((_extraInfo$addonAfter2 = extraInfo.addonAfter) === null || _extraInfo$addonAfter2 === void 0 ? void 0 : _extraInfo$addonAfter2.key) ? /*#__PURE__*/React.createElement(_Form.Item, {
|
|
@@ -131,7 +136,7 @@ function Index(props) {
|
|
|
131
136
|
}))) : undefined,
|
|
132
137
|
showCount: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.showCount,
|
|
133
138
|
maxLength: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxLength,
|
|
134
|
-
disabled: (_extraInfo$
|
|
139
|
+
disabled: (_extraInfo$disabled7 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled7 !== void 0 ? _extraInfo$disabled7 : disabled,
|
|
135
140
|
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder,
|
|
136
141
|
title: valueTitle,
|
|
137
142
|
allowClear: true
|
|
@@ -200,7 +200,7 @@ function Index(props) {
|
|
|
200
200
|
},
|
|
201
201
|
icon: isFold ? /*#__PURE__*/React.createElement(CaretDownOutlined, null) : /*#__PURE__*/React.createElement(CaretUpOutlined, null)
|
|
202
202
|
})))), /*#__PURE__*/React.createElement(_Col, {
|
|
203
|
-
flex: labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? "0 0 ".concat((24 - labelSpan) * 100 / 24, "%") : 1
|
|
203
|
+
flex: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.titleHidden) && labelSpan && (formContext === null || formContext === void 0 ? void 0 : formContext.layout) === 'horizontal' ? "0 0 ".concat((24 - labelSpan) * 100 / 24, "%") : 1
|
|
204
204
|
}, /*#__PURE__*/React.createElement("div", {
|
|
205
205
|
style: {
|
|
206
206
|
padding: '10px',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface INumberRangeProps {
|
|
2
|
+
startKey?: string;
|
|
3
|
+
endKey?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
addonBefore?: {
|
|
6
|
+
key: string;
|
|
7
|
+
defaultValue: string;
|
|
8
|
+
value: string[];
|
|
9
|
+
};
|
|
10
|
+
addonAfter?: {
|
|
11
|
+
key: string;
|
|
12
|
+
defaultValue: string;
|
|
13
|
+
value: string[];
|
|
14
|
+
};
|
|
15
|
+
value?: any;
|
|
16
|
+
onChange?: (value: any) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const NumberRange: (props: INumberRangeProps) => JSX.Element;
|
|
19
|
+
export default NumberRange;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
import "antd/es/input-number/style";
|
|
4
|
+
import _InputNumber from "antd/es/input-number";
|
|
5
|
+
import "antd/es/select/style";
|
|
6
|
+
import _Select from "antd/es/select";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
9
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
10
|
+
/*
|
|
11
|
+
* @Author: wangxian
|
|
12
|
+
* @Date: 2023-05-30 13:36:05
|
|
13
|
+
* @LastEditTime: 2023-06-05 16:34:56
|
|
14
|
+
*/
|
|
15
|
+
import React from 'react';
|
|
16
|
+
var NumberRange = function NumberRange(props) {
|
|
17
|
+
var startKey = props.startKey,
|
|
18
|
+
value = props.value,
|
|
19
|
+
disabled = props.disabled,
|
|
20
|
+
endKey = props.endKey,
|
|
21
|
+
addonBefore = props.addonBefore,
|
|
22
|
+
addonAfter = props.addonAfter,
|
|
23
|
+
onChange = props.onChange;
|
|
24
|
+
var _React$useState = React.useState(),
|
|
25
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26
|
+
min = _React$useState2[0],
|
|
27
|
+
setMin = _React$useState2[1];
|
|
28
|
+
var _React$useState3 = React.useState(),
|
|
29
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
30
|
+
max = _React$useState4[0],
|
|
31
|
+
setMax = _React$useState4[1];
|
|
32
|
+
var _React$useState5 = React.useState(),
|
|
33
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
34
|
+
before = _React$useState6[0],
|
|
35
|
+
setBefore = _React$useState6[1];
|
|
36
|
+
var _React$useState7 = React.useState(),
|
|
37
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
38
|
+
after = _React$useState8[0],
|
|
39
|
+
setAfter = _React$useState8[1];
|
|
40
|
+
React.useEffect(function () {
|
|
41
|
+
if (addonBefore === null || addonBefore === void 0 ? void 0 : addonBefore.defaultValue) {
|
|
42
|
+
setBefore(addonBefore.defaultValue);
|
|
43
|
+
}
|
|
44
|
+
if (addonAfter === null || addonAfter === void 0 ? void 0 : addonAfter.defaultValue) {
|
|
45
|
+
setAfter(addonAfter.defaultValue);
|
|
46
|
+
}
|
|
47
|
+
}, [addonBefore, addonAfter]);
|
|
48
|
+
React.useEffect(function () {
|
|
49
|
+
if (value) {
|
|
50
|
+
if (value[startKey || 'min']) {
|
|
51
|
+
setMin(value[startKey || 'min']);
|
|
52
|
+
}
|
|
53
|
+
if (value[endKey || 'max']) {
|
|
54
|
+
setMax(value[endKey || 'max']);
|
|
55
|
+
}
|
|
56
|
+
if ((addonBefore === null || addonBefore === void 0 ? void 0 : addonBefore.key) && value[addonBefore.key]) {
|
|
57
|
+
setBefore(value[addonBefore.key]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}, [value]);
|
|
61
|
+
var triggerChange = function triggerChange(changedValue) {
|
|
62
|
+
var _objectSpread2;
|
|
63
|
+
onChange && onChange(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, addonBefore === null || addonBefore === void 0 ? void 0 : addonBefore.key, before), _defineProperty(_objectSpread2, addonAfter === null || addonAfter === void 0 ? void 0 : addonAfter.key, after), _defineProperty(_objectSpread2, startKey || 'min', min), _defineProperty(_objectSpread2, endKey || 'max', max), _objectSpread2), changedValue));
|
|
64
|
+
};
|
|
65
|
+
var onStartChange = function onStartChange(v) {
|
|
66
|
+
setMin(v);
|
|
67
|
+
triggerChange(_defineProperty({}, startKey || 'min', v));
|
|
68
|
+
};
|
|
69
|
+
var onEndChange = function onEndChange(v) {
|
|
70
|
+
setMax(v);
|
|
71
|
+
triggerChange(_defineProperty({}, endKey || 'max', v));
|
|
72
|
+
};
|
|
73
|
+
var onBeforeChange = function onBeforeChange(v) {
|
|
74
|
+
setBefore(v);
|
|
75
|
+
triggerChange(_defineProperty({}, addonBefore === null || addonBefore === void 0 ? void 0 : addonBefore.key, v));
|
|
76
|
+
};
|
|
77
|
+
var onAfterChange = function onAfterChange(v) {
|
|
78
|
+
setAfter(v);
|
|
79
|
+
triggerChange(_defineProperty({}, addonAfter === null || addonAfter === void 0 ? void 0 : addonAfter.key, v));
|
|
80
|
+
};
|
|
81
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Input.Group, {
|
|
82
|
+
compact: true
|
|
83
|
+
}, addonBefore && /*#__PURE__*/React.createElement(_Select, {
|
|
84
|
+
disabled: disabled,
|
|
85
|
+
style: {
|
|
86
|
+
width: '60px'
|
|
87
|
+
},
|
|
88
|
+
defaultValue: addonBefore.defaultValue,
|
|
89
|
+
value: before,
|
|
90
|
+
options: addonBefore.value.map(function (it) {
|
|
91
|
+
return {
|
|
92
|
+
label: it,
|
|
93
|
+
value: it
|
|
94
|
+
};
|
|
95
|
+
}),
|
|
96
|
+
onChange: onBeforeChange
|
|
97
|
+
}), /*#__PURE__*/React.createElement(_InputNumber, {
|
|
98
|
+
disabled: disabled,
|
|
99
|
+
value: min,
|
|
100
|
+
style: {
|
|
101
|
+
width: addonBefore || addonAfter ? 'calc(50% - 44px)' : 'calc(50% - 14px)',
|
|
102
|
+
textAlign: 'center'
|
|
103
|
+
},
|
|
104
|
+
onChange: onStartChange
|
|
105
|
+
}), /*#__PURE__*/React.createElement(_Input, {
|
|
106
|
+
style: {
|
|
107
|
+
width: 30,
|
|
108
|
+
borderLeft: 0,
|
|
109
|
+
borderRight: 0,
|
|
110
|
+
pointerEvents: 'none'
|
|
111
|
+
},
|
|
112
|
+
placeholder: "~",
|
|
113
|
+
disabled: true
|
|
114
|
+
}), /*#__PURE__*/React.createElement(_InputNumber, {
|
|
115
|
+
disabled: disabled,
|
|
116
|
+
value: max,
|
|
117
|
+
style: {
|
|
118
|
+
width: addonBefore || addonAfter ? 'calc(50% - 44px)' : 'calc(50% - 14px)',
|
|
119
|
+
textAlign: 'center'
|
|
120
|
+
},
|
|
121
|
+
onChange: onEndChange
|
|
122
|
+
}), addonAfter && /*#__PURE__*/React.createElement(_Select, {
|
|
123
|
+
disabled: disabled,
|
|
124
|
+
style: {
|
|
125
|
+
width: '60px'
|
|
126
|
+
},
|
|
127
|
+
defaultValue: addonAfter.defaultValue,
|
|
128
|
+
value: after,
|
|
129
|
+
options: addonAfter.value.map(function (it) {
|
|
130
|
+
return {
|
|
131
|
+
label: it,
|
|
132
|
+
value: it
|
|
133
|
+
};
|
|
134
|
+
}),
|
|
135
|
+
onChange: onAfterChange
|
|
136
|
+
})));
|
|
137
|
+
};
|
|
138
|
+
export default NumberRange;
|
|
@@ -5,7 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
/*
|
|
6
6
|
* @Author: wangxian
|
|
7
7
|
* @Date: 2021-09-18 14:15:04
|
|
8
|
-
* @LastEditTime: 2023-
|
|
8
|
+
* @LastEditTime: 2023-06-02 10:55:33
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { deepClone } from '../../../utils';
|
|
@@ -99,7 +99,8 @@ export function withAddOnAfter(WrappedComponent) {
|
|
|
99
99
|
name: _name,
|
|
100
100
|
labelSpan: labelSpan,
|
|
101
101
|
isObj: isObj,
|
|
102
|
-
notRequire: depend === null || depend === void 0 ? void 0 : depend.notRequire
|
|
102
|
+
notRequire: depend === null || depend === void 0 ? void 0 : depend.notRequire,
|
|
103
|
+
disabled: (depend === null || depend === void 0 ? void 0 : depend.disabled) || false
|
|
103
104
|
})), isShowTypeInfo && !field && type !== 'number' && type !== 'bool' && /*#__PURE__*/React.createElement("div", {
|
|
104
105
|
className: "with-add-on-after-extra"
|
|
105
106
|
}, help !== null && help !== void 0 ? help : type))), fields && ((_fields$5 = fields[0]) === null || _fields$5 === void 0 ? void 0 : (_fields$5$value = _fields$5.value) === null || _fields$5$value === void 0 ? void 0 : (_fields$5$value$commo = _fields$5$value.common) === null || _fields$5$value$commo === void 0 ? void 0 : _fields$5$value$commo.br) && /*#__PURE__*/React.createElement(_Col, {
|
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
4
4
|
/*
|
|
5
5
|
* @Author: your name
|
|
6
6
|
* @Date: 2021-09-18 14:15:04
|
|
7
|
-
* @LastEditTime: 2023-
|
|
7
|
+
* @LastEditTime: 2023-06-05 18:47:31
|
|
8
8
|
*/
|
|
9
9
|
import { getLocale } from '../../../framework/locale';
|
|
10
10
|
import moment from 'moment';
|
|
@@ -77,12 +77,20 @@ export var useWatchDepend = function useWatchDepend(_depends, stream$, name) {
|
|
|
77
77
|
}
|
|
78
78
|
if (_depends === null || _depends === void 0 ? void 0 : _depends.notRequire) {
|
|
79
79
|
var _p$payload3;
|
|
80
|
-
var
|
|
80
|
+
var _notRequire = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.notRequire, p === null || p === void 0 ? void 0 : (_p$payload3 = p.payload) === null || _p$payload3 === void 0 ? void 0 : _p$payload3.allVals, stream$, name);
|
|
81
81
|
var _dr3 = dependsRef.current;
|
|
82
|
-
_dr3.notRequire =
|
|
82
|
+
_dr3.notRequire = _notRequire;
|
|
83
83
|
setDepends(_objectSpread({}, _dr3));
|
|
84
84
|
dependsRef.current = _dr3;
|
|
85
85
|
}
|
|
86
|
+
if (_depends === null || _depends === void 0 ? void 0 : _depends.disabled) {
|
|
87
|
+
var _p$payload4;
|
|
88
|
+
var _disabled = processDependHiddenOrShow(_depends === null || _depends === void 0 ? void 0 : _depends.disabled, p === null || p === void 0 ? void 0 : (_p$payload4 = p.payload) === null || _p$payload4 === void 0 ? void 0 : _p$payload4.allVals, stream$, name);
|
|
89
|
+
var _dr4 = dependsRef.current;
|
|
90
|
+
_dr4.disabled = _disabled;
|
|
91
|
+
setDepends(_objectSpread({}, _dr4));
|
|
92
|
+
dependsRef.current = _dr4;
|
|
93
|
+
}
|
|
86
94
|
}
|
|
87
95
|
});
|
|
88
96
|
}
|
|
@@ -93,7 +101,7 @@ var processDependHiddenOrShow = function processDependHiddenOrShow(depend, chang
|
|
|
93
101
|
try {
|
|
94
102
|
// const regex = /\w+(\.\w+)?[=<>!]{1}/g;
|
|
95
103
|
var regex = /\w+(\.\w+)?[=<>!]{1}|\w+(\.\w+)?(\.indexOf\('.+'\)[=<>!]{1})/g;
|
|
96
|
-
var keys = depend.trim().match(regex);
|
|
104
|
+
var keys = depend.trim().replace(/\s/g, '').match(regex);
|
|
97
105
|
if (!keys) {
|
|
98
106
|
return false;
|
|
99
107
|
}
|
|
@@ -54,6 +54,7 @@ export type IFiledDepend = {
|
|
|
54
54
|
hidden: string;
|
|
55
55
|
show: string;
|
|
56
56
|
notRequire: string;
|
|
57
|
+
disabled: string;
|
|
57
58
|
};
|
|
58
59
|
export type IStreamEventType = 'onSelectChange' | 'onButtonCellClick' | 'onValuesChange' | 'onWatchDepend' | string;
|
|
59
60
|
export type IStreamEvent = {
|
package/es/utils.js
CHANGED
|
@@ -6,7 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
/*
|
|
7
7
|
* @Author: wangxian
|
|
8
8
|
* @Date: 2021-09-18 14:15:04
|
|
9
|
-
* @LastEditTime: 2023-
|
|
9
|
+
* @LastEditTime: 2023-06-02 09:16:28
|
|
10
10
|
*/
|
|
11
11
|
import saveAs from 'file-saver';
|
|
12
12
|
import { asBlob } from 'html-docx-js-typescript';
|
|
@@ -191,7 +191,7 @@ function _handleMd2Doc() {
|
|
|
191
191
|
margin: {
|
|
192
192
|
top: 100
|
|
193
193
|
},
|
|
194
|
-
orientation: '
|
|
194
|
+
orientation: 'portrait'
|
|
195
195
|
};
|
|
196
196
|
_context.next = 6;
|
|
197
197
|
return asBlob(html, opt);
|