fan-standard-comp 3.2.1 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +2 -32
- package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
- package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
- package/dist/fan-standard-comp.umd.js +183 -439
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/dist/fonts/lg.ttf +0 -0
- package/dist/fonts/lg.woff +0 -0
- package/dist/fonts/lg.woff2 +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +2 -1
- package/es/ButtonGroup/ButtonMenu.d.ts +2 -1
- package/es/ButtonGroup/PopConfirmTitle.js +5 -5
- package/es/ButtonGroup/index.d.ts +3 -1
- package/es/ButtonGroup/index.js +146 -180
- package/es/ButtonGroup/style/index.less +4 -1
- package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/es/CalendarCoordPicker/CalendarMonthPicker.js +26 -0
- package/es/CalendarCoordPicker/index.d.ts +8 -0
- package/es/CalendarCoordPicker/index.js +296 -0
- package/es/CalendarCoordPicker/index.less +31 -0
- package/es/ConfigContext/index.d.ts +7 -0
- package/es/ConfigContext/index.js +12 -0
- package/es/DragContent/index.d.ts +1 -1
- package/es/DragContent/index.js +5 -5
- package/es/FormComp/ChunkUploader/api.js +14 -14
- package/es/FormComp/ChunkUploader/index.js +132 -139
- package/es/FormComp/ChunkUploader/lib.js +21 -21
- package/es/FormComp/ChunkUploader/upload-queue.class.js +64 -66
- package/es/FormComp/EditButton/index.d.ts +1 -1
- package/es/FormComp/EditButton/index.js +15 -17
- package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/es/FormComp/FieldComponent/ReUpload.js +37 -23
- package/es/FormComp/FieldComponent/RefactorTextarea.js +32 -0
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +72 -19
- package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/es/FormComp/FieldComponent/index.d.ts +1 -1
- package/es/FormComp/FieldComponent/index.js +37 -26
- package/es/FormComp/FieldComponent/setReadonlyValues.js +6 -6
- package/es/FormComp/RenderItemGroup/index.js +24 -8
- package/es/FormComp/Uploader/index.d.ts +9 -2
- package/es/FormComp/Uploader/index.js +325 -156
- package/es/FormComp/VarTemplate/index.js +57 -64
- package/es/ImageGallery/ImagePreview.d.ts +13 -0
- package/es/ImageGallery/ImagePreview.js +168 -0
- package/es/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
- package/es/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
- package/es/ImageGallery/PreviewStyles/lg-video.css +144 -0
- package/es/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
- package/es/ImageGallery/PreviewStyles/lightgallery.css +728 -0
- package/es/ImageGallery/SliderContent.d.ts +7 -0
- package/es/ImageGallery/SliderContent.js +699 -0
- package/es/ImageGallery/Thumbnail.d.ts +3 -0
- package/es/ImageGallery/Thumbnail.js +296 -0
- package/es/ImageGallery/hook/uniqueId.d.ts +1 -0
- package/es/ImageGallery/hook/uniqueId.js +10 -0
- package/es/ImageGallery/index.d.ts +4 -0
- package/es/ImageGallery/index.js +29 -0
- package/es/ImageGallery/style/index.less +5 -0
- package/es/ImageGallery/types.d.ts +5 -0
- package/es/ImageGallery/types.js +1 -0
- package/es/NavLeafScroll/index.js +94 -50
- package/es/RefactorTree/index.d.ts +1 -1
- package/es/RefactorTree/index.js +6 -6
- package/es/RefactorTree/indexTreeNode.d.ts +1 -1
- package/es/RefactorTree/indexTreeNode.js +19 -17
- package/es/RefactorTree/util.js +18 -18
- package/es/SpecIcon/fonts/demo_index.html +559 -5
- package/es/SpecIcon/fonts/iconfont.css +101 -3
- package/es/SpecIcon/fonts/iconfont.js +34 -27
- package/es/SpecIcon/fonts/iconfont.json +168 -0
- package/es/SpecIcon/fonts/iconfont.svg +163 -171
- package/es/SpecIcon/fonts/iconfont.ttf +0 -0
- package/es/SpecIcon/fonts/iconfont.woff +0 -0
- package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/es/SpecIcon/style/iconfont.less +106 -11
- package/es/SplitterLayout/Pane.d.ts +1 -1
- package/es/SplitterLayout/index.js +25 -26
- package/es/StandardContent/SplitterLayout/Pane.js +3 -3
- package/es/StandardContent/SplitterLayout/index.js +25 -26
- package/es/StandardContent/SubfieldContent.d.ts +1 -1
- package/es/StandardContent/WrapperContent.d.ts +1 -1
- package/es/StandardDragModal/index.d.ts +11 -3
- package/es/StandardDragModal/index.js +25 -3
- package/es/StandardFilter/index.d.ts +5 -16
- package/es/StandardFilter/index.js +212 -200
- package/es/StandardFilter/indexClass.d.ts +37 -0
- package/es/StandardFilter/indexClass.js +217 -0
- package/es/StandardFilter/style/index.less +82 -9
- package/es/StandardForm/StepForm.d.ts +1 -1
- package/es/StandardForm/StepForm.js +28 -22
- package/es/StandardForm/TabForm.d.ts +1 -1
- package/es/StandardForm/TabForm.js +41 -43
- package/es/StandardForm/index.d.ts +1 -1
- package/es/StandardForm/index.js +5 -5
- package/es/StandardModal/UpdateFormRef.js +0 -1
- package/es/StandardModal/index.d.ts +2 -1
- package/es/StandardModal/index.js +25 -39
- package/es/StandardPanel/index.d.ts +1 -1
- package/es/StandardPanel/index.js +7 -7
- package/es/StandardTable/index.d.ts +1 -0
- package/es/StandardTable/index.js +44 -26
- package/es/components/IconNode/index.d.ts +1 -1
- package/es/components/IconNode/index.js +0 -1
- package/es/data/general.config.js +31 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +6 -2
- package/es/utils/filterPermission.js +7 -10
- package/es/utils/getParentNodes.js +101 -26
- package/es/utils/index.js +2 -3
- package/es/utils/urlUtils.js +76 -0
- package/lib/ButtonGroup/ButtonList.d.ts +2 -1
- package/lib/ButtonGroup/ButtonList.js +2 -3
- package/lib/ButtonGroup/ButtonMenu.d.ts +2 -1
- package/lib/ButtonGroup/ButtonMenu.js +2 -3
- package/lib/ButtonGroup/PopConfirmTitle.js +7 -8
- package/lib/ButtonGroup/index.d.ts +3 -1
- package/lib/ButtonGroup/index.js +150 -185
- package/lib/ButtonGroup/style/index.less +4 -1
- package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/lib/CalendarCoordPicker/CalendarMonthPicker.js +36 -0
- package/lib/CalendarCoordPicker/index.d.ts +8 -0
- package/lib/CalendarCoordPicker/index.js +305 -0
- package/lib/CalendarCoordPicker/index.less +31 -0
- package/lib/ConfigContext/index.d.ts +7 -0
- package/lib/ConfigContext/index.js +17 -0
- package/lib/DragContent/DragBar.js +2 -3
- package/lib/DragContent/index.d.ts +1 -1
- package/lib/DragContent/index.js +9 -10
- package/lib/FormComp/ChunkUploader/api.js +15 -15
- package/lib/FormComp/ChunkUploader/index.js +135 -142
- package/lib/FormComp/ChunkUploader/lib.js +22 -22
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +66 -69
- package/lib/FormComp/ChunkUploader/worker.js +1 -1
- package/lib/FormComp/EditButton/index.d.ts +1 -1
- package/lib/FormComp/EditButton/index.js +19 -22
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/lib/FormComp/FieldComponent/ReUpload.js +40 -28
- package/lib/FormComp/FieldComponent/RefactorTextarea.js +42 -0
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +75 -23
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/lib/FormComp/FieldComponent/TitleNode.js +2 -3
- package/lib/FormComp/FieldComponent/index.d.ts +1 -1
- package/lib/FormComp/FieldComponent/index.js +41 -28
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +15 -20
- package/lib/FormComp/RenderItemGroup/index.js +26 -11
- package/lib/FormComp/Uploader/index.d.ts +9 -2
- package/lib/FormComp/Uploader/index.js +325 -159
- package/lib/FormComp/VarTemplate/index.js +63 -71
- package/lib/FormComp/index.js +1 -1
- package/lib/ImageGallery/ImagePreview.d.ts +13 -0
- package/lib/ImageGallery/ImagePreview.js +178 -0
- package/lib/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
- package/lib/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
- package/lib/ImageGallery/PreviewStyles/lg-video.css +144 -0
- package/lib/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
- package/lib/ImageGallery/PreviewStyles/lightgallery.css +728 -0
- package/lib/ImageGallery/SliderContent.d.ts +7 -0
- package/lib/ImageGallery/SliderContent.js +708 -0
- package/lib/ImageGallery/Thumbnail.d.ts +3 -0
- package/lib/ImageGallery/Thumbnail.js +306 -0
- package/lib/ImageGallery/hook/uniqueId.d.ts +1 -0
- package/lib/ImageGallery/hook/uniqueId.js +17 -0
- package/lib/ImageGallery/index.d.ts +4 -0
- package/lib/ImageGallery/index.js +36 -0
- package/lib/ImageGallery/style/index.less +5 -0
- package/lib/ImageGallery/types.d.ts +5 -0
- package/lib/ImageGallery/types.js +5 -0
- package/lib/NavLeafScroll/index.js +98 -55
- package/lib/RefactorTree/index.d.ts +1 -1
- package/lib/RefactorTree/index.js +10 -11
- package/lib/RefactorTree/indexTreeNode.d.ts +1 -1
- package/lib/RefactorTree/indexTreeNode.js +23 -22
- package/lib/RefactorTree/util.js +18 -18
- package/lib/SpecIcon/fonts/demo_index.html +559 -5
- package/lib/SpecIcon/fonts/iconfont.css +101 -3
- package/lib/SpecIcon/fonts/iconfont.js +34 -27
- package/lib/SpecIcon/fonts/iconfont.json +168 -0
- package/lib/SpecIcon/fonts/iconfont.svg +163 -171
- package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/lib/SpecIcon/index.js +2 -3
- package/lib/SpecIcon/style/iconfont.less +106 -11
- package/lib/SplitterLayout/Pane.d.ts +1 -1
- package/lib/SplitterLayout/Pane.js +2 -3
- package/lib/SplitterLayout/index.js +27 -29
- package/lib/StandardContent/SplitterLayout/Pane.js +5 -6
- package/lib/StandardContent/SplitterLayout/index.js +27 -29
- package/lib/StandardContent/SubfieldContent.d.ts +1 -1
- package/lib/StandardContent/SubfieldContent.js +2 -3
- package/lib/StandardContent/WrapperContent.d.ts +1 -1
- package/lib/StandardContent/WrapperContent.js +2 -3
- package/lib/StandardDragModal/index.d.ts +11 -3
- package/lib/StandardDragModal/index.js +27 -33
- package/lib/StandardFilter/index.d.ts +5 -16
- package/lib/StandardFilter/index.js +215 -201
- package/lib/StandardFilter/indexClass.d.ts +37 -0
- package/lib/StandardFilter/indexClass.js +223 -0
- package/lib/StandardFilter/style/index.less +82 -9
- package/lib/StandardForm/ActionList.js +2 -3
- package/lib/StandardForm/StepForm.d.ts +1 -1
- package/lib/StandardForm/StepForm.js +32 -27
- package/lib/StandardForm/TabForm.d.ts +1 -1
- package/lib/StandardForm/TabForm.js +45 -48
- package/lib/StandardForm/index.d.ts +1 -1
- package/lib/StandardForm/index.js +9 -10
- package/lib/StandardModal/UpdateFormRef.js +3 -4
- package/lib/StandardModal/index.d.ts +2 -1
- package/lib/StandardModal/index.js +29 -43
- package/lib/StandardPanel/index.d.ts +1 -1
- package/lib/StandardPanel/index.js +11 -12
- package/lib/StandardTable/index.d.ts +1 -0
- package/lib/StandardTable/index.js +49 -29
- package/lib/components/IconNode/index.d.ts +1 -1
- package/lib/components/IconNode/index.js +2 -4
- package/lib/components/index.js +1 -1
- package/lib/data/func.code.js +2 -3
- package/lib/data/general.config.js +33 -3
- package/lib/data/index.js +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +30 -10
- package/lib/utils/ValueFormat.js +1 -2
- package/lib/utils/filterPermission.js +11 -18
- package/lib/utils/getParentNodes.js +103 -29
- package/lib/utils/index.js +5 -27
- package/lib/utils/urlUtils.js +82 -0
- package/package.json +15 -9
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fonts/iconfont.eot +0 -0
- package/es/StandardDragModal/ChangeStandardModal.d.ts +0 -44
- package/es/StandardDragModal/ChangeStandardModal.js +0 -493
- package/es/StandardDragModal/DraggableModal.d.ts +0 -7
- package/es/StandardDragModal/DraggableModal.js +0 -31
- package/es/StandardDragModal/DraggableModalContext.d.ts +0 -9
- package/es/StandardDragModal/DraggableModalContext.js +0 -5
- package/es/StandardDragModal/DraggableModalInner.d.ts +0 -16
- package/es/StandardDragModal/DraggableModalInner.js +0 -114
- package/es/StandardDragModal/DraggableModalProvider.d.ts +0 -4
- package/es/StandardDragModal/DraggableModalProvider.js +0 -40
- package/es/StandardDragModal/Modal.d.ts +0 -11
- package/es/StandardDragModal/Modal.js +0 -24
- package/es/StandardDragModal/ResizeHandle.d.ts +0 -2
- package/es/StandardDragModal/ResizeHandle.js +0 -8
- package/es/StandardDragModal/clamp.d.ts +0 -1
- package/es/StandardDragModal/clamp.js +0 -3
- package/es/StandardDragModal/draggableModalReducer.d.ts +0 -66
- package/es/StandardDragModal/draggableModalReducer.js +0 -157
- package/es/StandardDragModal/getWindowSize.d.ts +0 -4
- package/es/StandardDragModal/getWindowSize.js +0 -6
- package/es/StandardDragModal/index.less +0 -65
- package/es/StandardDragModal/useDrag.d.ts +0 -5
- package/es/StandardDragModal/useDrag.js +0 -66
- package/es/StandardDragModal/usePrevious.d.ts +0 -1
- package/es/StandardDragModal/usePrevious.js +0 -8
- package/es/StandardDragModal/useResize.d.ts +0 -7
- package/es/StandardDragModal/useResize.js +0 -74
- package/es/utils/dictSelectUtil.js +0 -153
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +0 -44
- package/lib/StandardDragModal/ChangeStandardModal.js +0 -502
- package/lib/StandardDragModal/DraggableModal.d.ts +0 -7
- package/lib/StandardDragModal/DraggableModal.js +0 -40
- package/lib/StandardDragModal/DraggableModalContext.d.ts +0 -9
- package/lib/StandardDragModal/DraggableModalContext.js +0 -15
- package/lib/StandardDragModal/DraggableModalInner.d.ts +0 -16
- package/lib/StandardDragModal/DraggableModalInner.js +0 -124
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +0 -4
- package/lib/StandardDragModal/DraggableModalProvider.js +0 -48
- package/lib/StandardDragModal/Modal.d.ts +0 -11
- package/lib/StandardDragModal/Modal.js +0 -32
- package/lib/StandardDragModal/ResizeHandle.d.ts +0 -2
- package/lib/StandardDragModal/ResizeHandle.js +0 -18
- package/lib/StandardDragModal/clamp.d.ts +0 -1
- package/lib/StandardDragModal/clamp.js +0 -10
- package/lib/StandardDragModal/draggableModalReducer.d.ts +0 -66
- package/lib/StandardDragModal/draggableModalReducer.js +0 -167
- package/lib/StandardDragModal/getWindowSize.d.ts +0 -4
- package/lib/StandardDragModal/getWindowSize.js +0 -13
- package/lib/StandardDragModal/index.less +0 -65
- package/lib/StandardDragModal/useDrag.d.ts +0 -5
- package/lib/StandardDragModal/useDrag.js +0 -73
- package/lib/StandardDragModal/usePrevious.d.ts +0 -1
- package/lib/StandardDragModal/usePrevious.js +0 -15
- package/lib/StandardDragModal/useResize.d.ts +0 -7
- package/lib/StandardDragModal/useResize.js +0 -81
- package/lib/utils/dictSelectUtil.js +0 -161
|
@@ -24,17 +24,19 @@ import "antd/es/select/style";
|
|
|
24
24
|
import _Select from "antd/es/select";
|
|
25
25
|
import "antd/es/input/style";
|
|
26
26
|
import _Input from "antd/es/input";
|
|
27
|
-
import React from "react";
|
|
27
|
+
import React, { useContext } from "react";
|
|
28
28
|
import Uploader from '../Uploader';
|
|
29
29
|
import SpecIcon from '../../SpecIcon';
|
|
30
30
|
import RefactorTreeSelect from './RefactorTreeSelect.js';
|
|
31
|
-
import { setSelectValue,
|
|
31
|
+
import { setSelectValue, setDatePickerValue, setTimePickerValue, setCascaderValue } from './setReadonlyValues.js';
|
|
32
32
|
import TitleNode from './TitleNode';
|
|
33
33
|
import ReUpload from './ReUpload';
|
|
34
|
+
import { FanContext } from '../../ConfigContext';
|
|
34
35
|
var TextArea = _Input.TextArea,
|
|
35
36
|
Password = _Input.Password;
|
|
36
37
|
var Option = _Select.Option;
|
|
37
|
-
var RangePicker = _DatePicker.RangePicker;
|
|
38
|
+
var RangePicker = _DatePicker.RangePicker;
|
|
39
|
+
// 表单组件类型
|
|
38
40
|
var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
39
41
|
var type = props.type,
|
|
40
42
|
_onChange = props.onChange,
|
|
@@ -69,6 +71,8 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
69
71
|
selectOptionRender = props.selectOptionRender,
|
|
70
72
|
render = props.render;
|
|
71
73
|
var selectOptions = props.selectOptions;
|
|
74
|
+
var InitFanContext = useContext(FanContext);
|
|
75
|
+
var providerConfig = InitFanContext[type] || {}; // 使用上下文(全局配置)设置扩展的配置项
|
|
72
76
|
var compContent;
|
|
73
77
|
if (selectOptionName && selectOptions) {
|
|
74
78
|
// 将传值的数据进行转换
|
|
@@ -81,14 +85,14 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
81
85
|
});
|
|
82
86
|
});
|
|
83
87
|
}
|
|
84
|
-
var defaultProps = Object.assign({
|
|
88
|
+
var defaultProps = Object.assign(Object.assign({
|
|
85
89
|
style: style,
|
|
86
90
|
onChange: _onChange,
|
|
87
91
|
value: value,
|
|
88
92
|
render: render,
|
|
89
93
|
size: size,
|
|
90
94
|
ref: ref
|
|
91
|
-
}, protoConfig);
|
|
95
|
+
}, providerConfig), protoConfig);
|
|
92
96
|
if (fieldStatus === 'disabled') {
|
|
93
97
|
defaultProps.disabled = true;
|
|
94
98
|
}
|
|
@@ -104,35 +108,41 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
104
108
|
var viewOnly = fieldStatus === 'viewOnly'; // 是否纯展示
|
|
105
109
|
switch (type) {
|
|
106
110
|
case 'input':
|
|
107
|
-
compContent = viewOnly ? value || '-' : /*#__PURE__*/React.createElement(_Input, Object.assign({
|
|
111
|
+
compContent = viewOnly ? value || '-' : (/*#__PURE__*/React.createElement(_Input, Object.assign({
|
|
108
112
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
|
|
109
113
|
autoComplete: "off",
|
|
110
114
|
title: fieldStatus === 'disabled' || defaultProps.disabled ? value : null,
|
|
111
|
-
maxLength: defaultProps.maxLength || 50
|
|
112
|
-
|
|
115
|
+
maxLength: defaultProps.maxLength || 50,
|
|
116
|
+
onKeyDown: function onKeyDown(evt) {
|
|
117
|
+
if (evt.key === 'Enter') {
|
|
118
|
+
// 表单只有一个输入框时,焦点定到输入框后按下Enter会触发提交事件
|
|
119
|
+
evt.preventDefault(); // 禁止默认行为
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}, defaultProps)));
|
|
113
123
|
break;
|
|
114
124
|
case 'password':
|
|
115
|
-
compContent = viewOnly ? value ? "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" : '-' : /*#__PURE__*/React.createElement(Password, Object.assign({
|
|
125
|
+
compContent = viewOnly ? value ? "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" : '-' : (/*#__PURE__*/React.createElement(Password, Object.assign({
|
|
116
126
|
autoComplete: "off",
|
|
117
127
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
|
|
118
128
|
maxLength: defaultProps.maxLength || 50
|
|
119
|
-
}, defaultProps));
|
|
129
|
+
}, defaultProps)));
|
|
120
130
|
break;
|
|
121
131
|
case 'textarea':
|
|
122
|
-
compContent = viewOnly ? value || '-' : /*#__PURE__*/React.createElement(TextArea, Object.assign({
|
|
132
|
+
compContent = viewOnly ? value || '-' : (/*#__PURE__*/React.createElement(TextArea, Object.assign({
|
|
123
133
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
|
|
124
134
|
maxLength: defaultProps.maxLength || 500,
|
|
125
135
|
title: fieldStatus === 'disabled' || defaultProps.disabled ? value : null
|
|
126
|
-
}, defaultProps));
|
|
136
|
+
}, defaultProps)));
|
|
127
137
|
break;
|
|
128
138
|
case 'inputNumber':
|
|
129
|
-
compContent = viewOnly ? value || 0 : /*#__PURE__*/React.createElement(_InputNumber, Object.assign({
|
|
139
|
+
compContent = viewOnly ? value || 0 : (/*#__PURE__*/React.createElement(_InputNumber, Object.assign({
|
|
130
140
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入数字'
|
|
131
141
|
}, sortLimitRule, defaultProps, {
|
|
132
142
|
style: Object.assign({
|
|
133
143
|
width: '120px'
|
|
134
144
|
}, defaultProps.style)
|
|
135
|
-
}));
|
|
145
|
+
})));
|
|
136
146
|
break;
|
|
137
147
|
case 'select':
|
|
138
148
|
// 重置返回完整字段值
|
|
@@ -153,7 +163,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
153
163
|
selectOptionRender: selectOptionRender,
|
|
154
164
|
defaultProps: defaultProps,
|
|
155
165
|
type: type
|
|
156
|
-
}) : /*#__PURE__*/React.createElement(_Select, Object.assign({
|
|
166
|
+
}) : (/*#__PURE__*/React.createElement(_Select, Object.assign({
|
|
157
167
|
allowClear: true,
|
|
158
168
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || "".concat(defaultProps.showSearch ? '请输入选择' : '请选择'),
|
|
159
169
|
filterOption: function filterOption(inputValue, option) {
|
|
@@ -172,7 +182,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
172
182
|
title: selectOptionRender ? selectOptionRender(val) : val.title || val.label,
|
|
173
183
|
disabled: val.disabled
|
|
174
184
|
}, selectOptionRender ? selectOptionRender(val) : val.label);
|
|
175
|
-
}));
|
|
185
|
+
})));
|
|
176
186
|
break;
|
|
177
187
|
case 'tree-select':
|
|
178
188
|
compContent = /*#__PURE__*/React.createElement(RefactorTreeSelect, Object.assign({
|
|
@@ -280,13 +290,13 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
280
290
|
compContent = viewOnly ? setTimePickerValue(value, {
|
|
281
291
|
type: type,
|
|
282
292
|
protoConfig: protoConfig
|
|
283
|
-
}) : /*#__PURE__*/React.createElement(_TimePicker, Object.assign({}, defaultProps, {
|
|
293
|
+
}) : (/*#__PURE__*/React.createElement(_TimePicker, Object.assign({}, defaultProps, {
|
|
284
294
|
style: Object.assign(Object.assign({
|
|
285
295
|
'minWidth': 'auto'
|
|
286
296
|
}, defaultProps.style), {
|
|
287
297
|
width: 'auto'
|
|
288
298
|
})
|
|
289
|
-
}));
|
|
299
|
+
})));
|
|
290
300
|
break;
|
|
291
301
|
case 'timePickerRange':
|
|
292
302
|
if (fieldStatus === 'disabled' || defaultProps.disabled) defaultProps.placeholder = ''; // 禁用时,placeHolder不显示
|
|
@@ -294,13 +304,13 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
294
304
|
compContent = viewOnly ? setTimePickerValue(value, {
|
|
295
305
|
type: type,
|
|
296
306
|
protoConfig: protoConfig
|
|
297
|
-
}) : /*#__PURE__*/React.createElement(_TimePicker.RangePicker, Object.assign({}, defaultProps, {
|
|
307
|
+
}) : (/*#__PURE__*/React.createElement(_TimePicker.RangePicker, Object.assign({}, defaultProps, {
|
|
298
308
|
style: Object.assign(Object.assign({
|
|
299
309
|
'minWidth': 'auto'
|
|
300
310
|
}, defaultProps.style), {
|
|
301
311
|
width: 'auto'
|
|
302
312
|
})
|
|
303
|
-
}));
|
|
313
|
+
})));
|
|
304
314
|
break;
|
|
305
315
|
case 'upload':
|
|
306
316
|
compContent = viewOnly && (!value || value.length === 0) ? '-' : /*#__PURE__*/React.createElement(ReUpload, Object.assign({}, defaultProps, {
|
|
@@ -317,22 +327,23 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
317
327
|
}), " \u70B9\u51FB\u4E0A\u4F20")));
|
|
318
328
|
break;
|
|
319
329
|
case 'uploader':
|
|
320
|
-
compContent = viewOnly ? setUploaderValue(value) :
|
|
330
|
+
// compContent = viewOnly ? setUploaderValue(value) : <Uploader {...defaultProps} size={protoConfig?.size}/>
|
|
331
|
+
compContent = /*#__PURE__*/React.createElement(Uploader, Object.assign({}, defaultProps, {
|
|
332
|
+
viewOnly: viewOnly,
|
|
321
333
|
size: protoConfig === null || protoConfig === void 0 ? void 0 : protoConfig.size
|
|
322
334
|
}));
|
|
323
|
-
// compContent = <Uploader {...defaultProps}></Uploader>
|
|
324
335
|
break;
|
|
325
336
|
case 'cascader':
|
|
326
337
|
compContent = viewOnly ? setCascaderValue(value, {
|
|
327
338
|
selectOptions: selectOptions,
|
|
328
339
|
selectOptionRender: selectOptionRender,
|
|
329
340
|
defaultProps: defaultProps
|
|
330
|
-
}) : /*#__PURE__*/React.createElement(_Cascader, Object.assign({
|
|
341
|
+
}) : (/*#__PURE__*/React.createElement(_Cascader, Object.assign({
|
|
331
342
|
options: selectOptions,
|
|
332
343
|
allowClear: true,
|
|
333
344
|
fieldNames: (defaultProps === null || defaultProps === void 0 ? void 0 : defaultProps.fieldNames) || selectOptionName,
|
|
334
345
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请选择'
|
|
335
|
-
}, defaultProps));
|
|
346
|
+
}, defaultProps)));
|
|
336
347
|
break;
|
|
337
348
|
case 'switch':
|
|
338
349
|
compContent = /*#__PURE__*/React.createElement(_Switch, Object.assign({}, defaultProps, {
|
|
@@ -345,9 +356,9 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
345
356
|
// compContent = viewOnly ? (String(value) === 'undefined' ? '-' : String(value)) : (<Switch {...defaultProps} checked={value} style={{ ...defaultProps.style, width: 'auto' }} />)
|
|
346
357
|
break;
|
|
347
358
|
case 'slider':
|
|
348
|
-
compContent = viewOnly ? value : /*#__PURE__*/React.createElement(_Slider, Object.assign({}, defaultProps, {
|
|
359
|
+
compContent = viewOnly ? value : (/*#__PURE__*/React.createElement(_Slider, Object.assign({}, defaultProps, {
|
|
349
360
|
style: Object.assign({}, defaultProps.style)
|
|
350
|
-
}));
|
|
361
|
+
})));
|
|
351
362
|
break;
|
|
352
363
|
case 'mentions':
|
|
353
364
|
compContent = viewOnly ? value : /*#__PURE__*/React.createElement(_Mentions, Object.assign({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "antd/es/image/style";
|
|
2
2
|
import _Image from "antd/es/image";
|
|
3
|
-
function _slicedToArray(
|
|
3
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
function _unsupportedIterableToArray(
|
|
6
|
-
function _arrayLikeToArray(
|
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
8
|
-
function _arrayWithHoles(
|
|
5
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
9
|
import React, { useEffect, useMemo, useState } from "react";
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { getBase64 } from "../Uploader/util";
|
|
@@ -65,7 +65,7 @@ var setSelectValue = function setSelectValue(value, props) {
|
|
|
65
65
|
if (matchValue.length > 0) {
|
|
66
66
|
// 如果 select 配置选项展示内容,则直接使用其配置值展示当前只读信息
|
|
67
67
|
if (selectOptionRender) {
|
|
68
|
-
matchValues.push(
|
|
68
|
+
matchValues.push(/*#__PURE__*/React.createElement("div", {
|
|
69
69
|
key: index,
|
|
70
70
|
className: "checkbox-viewonly-item"
|
|
71
71
|
}, selectOptionRender(matchValue[0]), value.length - 1 > index ? separator ? separator : separator == null ? '' : ',' : ''));
|
|
@@ -32,6 +32,9 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
32
32
|
if (modalSize === 'lg' || modalSize === 'xlg') {
|
|
33
33
|
return 8;
|
|
34
34
|
}
|
|
35
|
+
if (modalSize === 'xxlg') {
|
|
36
|
+
return 6;
|
|
37
|
+
}
|
|
35
38
|
return 12;
|
|
36
39
|
};
|
|
37
40
|
var updateFormFields = function updateFormFields() {
|
|
@@ -48,6 +51,12 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
48
51
|
}
|
|
49
52
|
return isHide || false;
|
|
50
53
|
};
|
|
54
|
+
// layout='inline'条件下设置指定控件宽度自动
|
|
55
|
+
var setAutoWidth = function setAutoWidth(fieldType) {
|
|
56
|
+
var widgets = ['checkbox', 'radio', 'datePicker', 'dateTimePicker', 'rangePicker', 'rangeTimePicker', 'timePicker', 'timePickerRange'];
|
|
57
|
+
if (!fieldType) return false;
|
|
58
|
+
return widgets.includes(fieldType);
|
|
59
|
+
};
|
|
51
60
|
// 渲染表单控件
|
|
52
61
|
var renderFormField = function renderFormField(field) {
|
|
53
62
|
var componentStyle = field.componentStyle,
|
|
@@ -69,7 +78,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
69
78
|
},
|
|
70
79
|
fieldStatus: field.fieldStatus || fieldStatus,
|
|
71
80
|
size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
|
|
72
|
-
style:
|
|
81
|
+
// style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}
|
|
82
|
+
// style={componentStyle || (layout === 'inline' ? { ...general.formItemStyle.xsm } : { ...general.formItemStyle.wide } )}
|
|
83
|
+
style: Object.assign({
|
|
84
|
+
width: layout === 'inline' ? setAutoWidth(field.type) ? 'auto' : general.formItemStyle.xsm.width : general.formItemStyle.wide.width
|
|
85
|
+
}, componentStyle)
|
|
73
86
|
}))), extra ? extra(field, form) : '');
|
|
74
87
|
} else {
|
|
75
88
|
return /*#__PURE__*/React.createElement(Field, Object.assign({}, field, {
|
|
@@ -88,7 +101,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
88
101
|
},
|
|
89
102
|
fieldStatus: field.fieldStatus || fieldStatus,
|
|
90
103
|
size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
|
|
91
|
-
style
|
|
104
|
+
// style={componentStyle || { ...general.formItemStyle.wide }}
|
|
105
|
+
style: Object.assign({
|
|
106
|
+
width: layout === 'inline' ? setAutoWidth(field.type) ? 'auto' : general.formItemStyle.xsm.width : general.formItemStyle.wide.width
|
|
107
|
+
}, componentStyle)
|
|
92
108
|
}));
|
|
93
109
|
}
|
|
94
110
|
};
|
|
@@ -105,11 +121,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
105
121
|
}, /*#__PURE__*/React.createElement(FormItem, Object.assign({
|
|
106
122
|
name: type !== 'custom' && filedName,
|
|
107
123
|
className: fieldStatus === 'viewOnly' ? 'form-item-view-only' : '',
|
|
108
|
-
label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
124
|
+
label: description ? (/*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
109
125
|
title: description
|
|
110
126
|
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
111
127
|
name: "info"
|
|
112
|
-
}))) : label,
|
|
128
|
+
})))) : label,
|
|
113
129
|
rules: item.preExtra || item.extra ? [] : item.rules || (item.fieldOptions ? item.fieldOptions.rules : []),
|
|
114
130
|
required: item.rules && item.rules.filter(function (rItem) {
|
|
115
131
|
return rItem.required;
|
|
@@ -120,11 +136,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
120
136
|
key: index,
|
|
121
137
|
name: type !== 'custom' && filedName,
|
|
122
138
|
className: fieldStatus === 'viewOnly' ? 'form-item-view-only' : '',
|
|
123
|
-
label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
139
|
+
label: description ? (/*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
124
140
|
title: description
|
|
125
141
|
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
126
142
|
name: "info"
|
|
127
|
-
}))) : label,
|
|
143
|
+
})))) : label,
|
|
128
144
|
rules: item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])
|
|
129
145
|
}, formLayout, item.protoFormItem), type === 'custom' && customRender ? customRender(form, Object.assign({}, item), fieldStatus) : renderFormField(Object.assign({}, item)));
|
|
130
146
|
}
|
|
@@ -170,11 +186,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
170
186
|
}, function (FormInstance) {
|
|
171
187
|
var _a;
|
|
172
188
|
// isHide 返回为true则隐藏当前控件
|
|
173
|
-
return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/React.createElement(_Col, {
|
|
189
|
+
return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? (/*#__PURE__*/React.createElement(_Col, {
|
|
174
190
|
span: item.colSpan || 24
|
|
175
191
|
}, type === 'title' ? /*#__PURE__*/React.createElement("h3", Object.assign({}, item.protoConfig, {
|
|
176
192
|
className: "modalPanelTitle ".concat(((_a = item === null || item === void 0 ? void 0 : item.protoConfig) === null || _a === void 0 ? void 0 : _a.className) || '')
|
|
177
|
-
}), label) : label) : /*#__PURE__*/React.createElement(React.Fragment, null, null);
|
|
193
|
+
}), label) : label)) : /*#__PURE__*/React.createElement(React.Fragment, null, null);
|
|
178
194
|
});
|
|
179
195
|
}
|
|
180
196
|
// 判断是否强制重新渲染表单
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import './style/index.less';
|
|
2
3
|
interface UploaderProps {
|
|
3
4
|
extraExt?: string;
|
|
4
5
|
accept?: string;
|
|
@@ -7,7 +8,10 @@ interface UploaderProps {
|
|
|
7
8
|
className?: string;
|
|
8
9
|
isOnly?: boolean;
|
|
9
10
|
children?: React.ReactNode;
|
|
10
|
-
onChange?: (file?: any
|
|
11
|
+
onChange?: (file?: any, defaultFile?: {
|
|
12
|
+
file: any;
|
|
13
|
+
fileList: any[];
|
|
14
|
+
}) => void;
|
|
11
15
|
value?: any;
|
|
12
16
|
size?: number;
|
|
13
17
|
modalSize?: string;
|
|
@@ -16,6 +20,9 @@ interface UploaderProps {
|
|
|
16
20
|
limit?: number;
|
|
17
21
|
modalConfig?: any;
|
|
18
22
|
modalZIndex?: number;
|
|
23
|
+
crop?: boolean;
|
|
24
|
+
cropConfig?: any;
|
|
25
|
+
[k: string]: any;
|
|
19
26
|
}
|
|
20
|
-
declare const Uploader: React.ForwardRefExoticComponent<UploaderProps & React.RefAttributes<unknown>>;
|
|
27
|
+
declare const Uploader: React.ForwardRefExoticComponent<Omit<UploaderProps, "ref"> & React.RefAttributes<unknown>>;
|
|
21
28
|
export default Uploader;
|