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
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
import "antd/es/button/style";
|
|
3
|
+
import _Button from "antd/es/button";
|
|
4
|
+
import "antd/es/form/style";
|
|
5
|
+
import _Form from "antd/es/form";
|
|
6
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
7
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
8
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
13
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
14
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
16
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
17
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import UtilValueFormat from '../utils/ValueFormat.js';
|
|
20
|
+
import ButtonGroup from '../ButtonGroup/index';
|
|
21
|
+
// import { general } from '../data/index';
|
|
22
|
+
import './style/index.less';
|
|
23
|
+
import RenderItemGroup from '../FormComp/RenderItemGroup';
|
|
24
|
+
var FormItem = _Form.Item;
|
|
25
|
+
var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
26
|
+
function StandardFilter(props) {
|
|
27
|
+
var _this;
|
|
28
|
+
_classCallCheck(this, StandardFilter);
|
|
29
|
+
_this = _callSuper(this, StandardFilter, [props]);
|
|
30
|
+
_this.filterFormRef = /*#__PURE__*/React.createRef();
|
|
31
|
+
// 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
|
|
32
|
+
_this.updateFormFields = function (newVal, force) {
|
|
33
|
+
var getFormFields = _this.props.getFormFields;
|
|
34
|
+
var resetValues = {};
|
|
35
|
+
if (force) {
|
|
36
|
+
// this.filterFormRef.current.resetFields()
|
|
37
|
+
// 先清空 再赋值
|
|
38
|
+
resetValues = _this.filterFormRef.current.getFieldsValue();
|
|
39
|
+
Object.keys(resetValues).forEach(function (item) {
|
|
40
|
+
resetValues[item] = undefined;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
_this.filterFormRef.current.setFieldsValue(Object.assign(Object.assign({}, resetValues), newVal)); // 直接清空表单的赋值
|
|
44
|
+
if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
|
|
45
|
+
}; // 强制更新表单值,用于赋初始化实例值
|
|
46
|
+
_this.forceUpdateForm = function () {
|
|
47
|
+
var getFormFields = _this.props.getFormFields;
|
|
48
|
+
if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
|
|
49
|
+
};
|
|
50
|
+
_this.handleSearch = function (values) {
|
|
51
|
+
var _this$props = _this.props,
|
|
52
|
+
formItemGroup = _this$props.formItemGroup,
|
|
53
|
+
onFilterSearch = _this$props.onFilterSearch;
|
|
54
|
+
// if (Object.prototype.hasOwnProperty.call(values, false)) {
|
|
55
|
+
// delete values.false // TODO 自定义结构会莫名的出来一个false字段
|
|
56
|
+
// }
|
|
57
|
+
var resultValues = UtilValueFormat(values, formItemGroup);
|
|
58
|
+
if (onFilterSearch) {
|
|
59
|
+
onFilterSearch(Object.assign({}, resultValues));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
_this.handleReset = function () {
|
|
63
|
+
var onFilterReset = _this.props.onFilterReset;
|
|
64
|
+
// 使用此方法,表单校验无法清空掉
|
|
65
|
+
// const resetValues = this.filterFormRef.current.getFieldsValue()
|
|
66
|
+
// Object.keys(resetValues).forEach((item) => {
|
|
67
|
+
// resetValues[item] = undefined
|
|
68
|
+
// })
|
|
69
|
+
// this.filterFormRef.current.setFieldsValue({ ...resetValues }) // 直接清空表单的赋值
|
|
70
|
+
_this.filterFormRef.current.resetFields();
|
|
71
|
+
_this.setState({
|
|
72
|
+
reFormItemGroup: _this.props.formItemGroup // 重新渲染列表
|
|
73
|
+
});
|
|
74
|
+
if (onFilterReset) {
|
|
75
|
+
onFilterReset(_this.filterFormRef.current.getFieldsValue());
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
_this.itemIsHide = function (isHide) {
|
|
79
|
+
var current = _this.filterFormRef.current;
|
|
80
|
+
if (!isHide) return false;
|
|
81
|
+
if (typeof isHide === 'function') {
|
|
82
|
+
return isHide(current ? current.getFieldsValue() : {}, current);
|
|
83
|
+
}
|
|
84
|
+
return isHide;
|
|
85
|
+
};
|
|
86
|
+
// 表单列表组 formItemGroup 类型为数组或者React.Node
|
|
87
|
+
_this.renderFormItemGroup = function () {
|
|
88
|
+
var reFormItemGroup = _this.state.reFormItemGroup;
|
|
89
|
+
if (Array.isArray(reFormItemGroup)) {
|
|
90
|
+
return /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
91
|
+
itemGroup: reFormItemGroup,
|
|
92
|
+
layout: "inline",
|
|
93
|
+
form: _this.filterFormRef,
|
|
94
|
+
doUpdateFormFields: function doUpdateFormFields() {
|
|
95
|
+
return _this.forceUpdateForm();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
/* return <>
|
|
99
|
+
{
|
|
100
|
+
reFormItemGroup.map((item, index) => {
|
|
101
|
+
const { componentStyle, isHide } = item
|
|
102
|
+
if (this.itemIsHide(isHide)) return null
|
|
103
|
+
return (
|
|
104
|
+
<FormItem key={item.filedName} label={item.label}
|
|
105
|
+
name={item.type !== 'custom' && item.filedName}
|
|
106
|
+
rules={item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])}
|
|
107
|
+
{...item.protoFormItem}>
|
|
108
|
+
{
|
|
109
|
+
(item.type === 'custom' && item.customRender) ? item.customRender(this.filterFormRef, { ...item }) :
|
|
110
|
+
<FieldComponent {...item}
|
|
111
|
+
onChange={(val, ...otherParams) => {
|
|
112
|
+
let updateValue = val
|
|
113
|
+
if (item.type === 'input' || item.type === 'textarea' || item.type === 'radio') {
|
|
114
|
+
updateValue = val.target.value
|
|
115
|
+
}
|
|
116
|
+
if (Array.isArray(val)) {
|
|
117
|
+
updateValue = [...val]
|
|
118
|
+
}
|
|
119
|
+
this.updateFormFields({ [item.filedName]: updateValue })
|
|
120
|
+
if (item.onChange) item.onChange(val, this.filterFormRef, ...otherParams)
|
|
121
|
+
}}
|
|
122
|
+
style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}/>
|
|
123
|
+
}
|
|
124
|
+
</FormItem>
|
|
125
|
+
)
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
</>*/
|
|
129
|
+
}
|
|
130
|
+
return reFormItemGroup;
|
|
131
|
+
};
|
|
132
|
+
_this.state = {
|
|
133
|
+
// recombinationGroup: [],
|
|
134
|
+
reFormItemGroup: undefined
|
|
135
|
+
};
|
|
136
|
+
return _this;
|
|
137
|
+
}
|
|
138
|
+
_inherits(StandardFilter, _React$Component);
|
|
139
|
+
return _createClass(StandardFilter, [{
|
|
140
|
+
key: "componentDidMount",
|
|
141
|
+
value: function componentDidMount() {
|
|
142
|
+
var initialValues = this.props.initialValues;
|
|
143
|
+
this.updateFormFields(initialValues, true);
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "componentDidUpdate",
|
|
147
|
+
value: function componentDidUpdate(prevProps) {
|
|
148
|
+
var initialValues = this.props.initialValues;
|
|
149
|
+
if (prevProps.initialValues !== initialValues) {
|
|
150
|
+
this.updateFormFields(initialValues, true);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "render",
|
|
155
|
+
value: function render() {
|
|
156
|
+
var _this$props2 = this.props,
|
|
157
|
+
className = _this$props2.className,
|
|
158
|
+
style = _this$props2.style,
|
|
159
|
+
onFilterReset = _this$props2.onFilterReset,
|
|
160
|
+
_this$props2$buttonGr = _this$props2.buttonGroup,
|
|
161
|
+
buttonGroup = _this$props2$buttonGr === void 0 ? [] : _this$props2$buttonGr,
|
|
162
|
+
min = _this$props2.min,
|
|
163
|
+
codes = _this$props2.codes,
|
|
164
|
+
permissionCodes = _this$props2.permissionCodes,
|
|
165
|
+
confirmText = _this$props2.confirmText,
|
|
166
|
+
cancelText = _this$props2.cancelText,
|
|
167
|
+
onFilterSearch = _this$props2.onFilterSearch,
|
|
168
|
+
buttonGroupConfig = _this$props2.buttonGroupConfig;
|
|
169
|
+
// const { recombinationGroup } = this.state;
|
|
170
|
+
return /*#__PURE__*/React.createElement(_Form, {
|
|
171
|
+
name: "standard-filter-form",
|
|
172
|
+
ref: this.filterFormRef,
|
|
173
|
+
layout: "inline",
|
|
174
|
+
onFinish: this.handleSearch,
|
|
175
|
+
className: className,
|
|
176
|
+
style: style
|
|
177
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
178
|
+
className: "filter-grid"
|
|
179
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
180
|
+
className: "filter-form"
|
|
181
|
+
}, this.state.reFormItemGroup ? /*#__PURE__*/React.createElement(React.Fragment, null, this.renderFormItemGroup(), /*#__PURE__*/React.createElement(FormItem, {
|
|
182
|
+
style: {
|
|
183
|
+
display: !onFilterSearch && !onFilterReset ? 'none' : 'inline-block'
|
|
184
|
+
}
|
|
185
|
+
}, onFilterSearch && /*#__PURE__*/React.createElement(_Button, {
|
|
186
|
+
type: "primary",
|
|
187
|
+
htmlType: "submit"
|
|
188
|
+
}, " ", confirmText || '查询'), onFilterReset && /*#__PURE__*/React.createElement(_Button, {
|
|
189
|
+
type: "primary",
|
|
190
|
+
style: {
|
|
191
|
+
marginLeft: 8
|
|
192
|
+
},
|
|
193
|
+
onClick: this.handleReset,
|
|
194
|
+
ghost: true
|
|
195
|
+
}, cancelText || '重置'))) : null), buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
196
|
+
className: "filter-btns"
|
|
197
|
+
}, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
198
|
+
options: buttonGroup,
|
|
199
|
+
min: min,
|
|
200
|
+
codes: codes,
|
|
201
|
+
permissionCodes: permissionCodes,
|
|
202
|
+
dropdownConfig: buttonGroupConfig
|
|
203
|
+
})) : null));
|
|
204
|
+
}
|
|
205
|
+
}], [{
|
|
206
|
+
key: "getDerivedStateFromProps",
|
|
207
|
+
value: function getDerivedStateFromProps(nextProps) {
|
|
208
|
+
var formItemGroup = nextProps.formItemGroup;
|
|
209
|
+
// const restOptionList = removeNoPermission(buttonGroup, permissionCodes, codes) || []
|
|
210
|
+
return {
|
|
211
|
+
// recombinationGroup: restOptionList,
|
|
212
|
+
reFormItemGroup: formItemGroup
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}]);
|
|
216
|
+
}(React.Component);
|
|
217
|
+
export default StandardFilter;
|
|
@@ -4,40 +4,109 @@
|
|
|
4
4
|
.filter-grid {
|
|
5
5
|
display: flex;
|
|
6
6
|
width: 100%;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
|
|
9
|
+
&.filter-grid-horizontal {
|
|
10
|
+
.filter-form {
|
|
11
|
+
width: 100%;
|
|
12
|
+
|
|
13
|
+
& > .ant-row {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 标签域自动换行
|
|
18
|
+
//.ant-form-item-label > label {
|
|
19
|
+
// white-space: pre-wrap;
|
|
20
|
+
// height: auto;
|
|
21
|
+
// min-height: @input-height-base;
|
|
22
|
+
//}
|
|
23
|
+
|
|
24
|
+
// 标签域自动换行
|
|
25
|
+
//.ant-form-item-control,
|
|
26
|
+
//.ant-form-item-label {
|
|
27
|
+
// line-height: 16px;
|
|
28
|
+
//}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.filter-btns {
|
|
32
|
+
width: 100%;
|
|
33
|
+
text-align: left;
|
|
34
|
+
|
|
35
|
+
.spec-button-group {
|
|
36
|
+
padding-left: 0;
|
|
37
|
+
padding-top: @padding-md;
|
|
38
|
+
|
|
39
|
+
.ant-btn:first-child {
|
|
40
|
+
margin-left: 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
7
48
|
.filter-form {
|
|
8
49
|
flex: 1;
|
|
9
50
|
font-size: 0;
|
|
10
51
|
display: flex;
|
|
11
52
|
flex-wrap: wrap;
|
|
53
|
+
|
|
54
|
+
&.filter-form-vertical {
|
|
55
|
+
display: block;
|
|
56
|
+
|
|
57
|
+
.ant-form-item {
|
|
58
|
+
margin-right: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.filter-form-horizontal {
|
|
63
|
+
.ant-form-item {
|
|
64
|
+
margin-right: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
12
67
|
.ant-form-item {
|
|
13
68
|
margin-right: @padding-md; // 16px
|
|
14
69
|
margin-bottom: @padding-md;
|
|
15
|
-
|
|
70
|
+
|
|
71
|
+
.ant-form-item {
|
|
16
72
|
margin-bottom: 0;
|
|
17
73
|
}
|
|
18
74
|
}
|
|
19
|
-
|
|
75
|
+
|
|
76
|
+
.ant-form-item-control {
|
|
20
77
|
.ant-form-item-control-input {
|
|
21
|
-
min-width: 180px;
|
|
78
|
+
//min-width: 180px;
|
|
22
79
|
}
|
|
23
80
|
}
|
|
81
|
+
|
|
24
82
|
.ant-form-item-control,
|
|
25
83
|
.ant-form-item-label {
|
|
26
|
-
line-height:
|
|
84
|
+
line-height: @input-height-base;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.filter-grid-inline {
|
|
89
|
+
.filter-form +.filter-btns {
|
|
90
|
+
.spec-button-group {
|
|
91
|
+
padding-left: 80px;
|
|
92
|
+
}
|
|
27
93
|
}
|
|
28
94
|
}
|
|
29
95
|
.filter-btns {
|
|
30
96
|
//max-width: 340px;
|
|
31
97
|
text-align: right;
|
|
32
|
-
|
|
33
|
-
padding-left: 80px;
|
|
34
|
-
}
|
|
98
|
+
|
|
35
99
|
.ant-btn {
|
|
36
100
|
margin-bottom: @padding-md;
|
|
37
101
|
margin-left: @padding-sm;
|
|
102
|
+
&:first-child {
|
|
103
|
+
margin-left: 0;
|
|
104
|
+
}
|
|
38
105
|
}
|
|
106
|
+
|
|
39
107
|
}
|
|
40
|
-
|
|
108
|
+
|
|
109
|
+
.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
|
|
41
110
|
line-height: @height-base - 2;
|
|
42
111
|
}
|
|
43
112
|
|
|
@@ -46,12 +115,15 @@
|
|
|
46
115
|
.toolbarBtn {
|
|
47
116
|
min-height: @btn-height-base;
|
|
48
117
|
margin-bottom: @padding-md;
|
|
118
|
+
|
|
49
119
|
.ant-btn {
|
|
50
120
|
margin-right: @padding-md;
|
|
51
121
|
}
|
|
52
122
|
}
|
|
123
|
+
|
|
53
124
|
.toolbar {
|
|
54
125
|
margin-bottom: @padding-md;
|
|
126
|
+
|
|
55
127
|
.toolbar-tForm {
|
|
56
128
|
//min-height: @btn-height-base;
|
|
57
129
|
//display: flex;
|
|
@@ -59,6 +131,7 @@
|
|
|
59
131
|
//align-items: center;
|
|
60
132
|
}
|
|
61
133
|
}
|
|
62
|
-
|
|
134
|
+
|
|
135
|
+
.searchForm {
|
|
63
136
|
margin-bottom: @padding-md;
|
|
64
137
|
}
|
|
@@ -15,5 +15,5 @@ export interface StepFormProp extends StandardFormProps {
|
|
|
15
15
|
stepClick?: (type?: string, formChild?: any, values?: any) => void;
|
|
16
16
|
formItemGroup?: StepItemGroupProps[];
|
|
17
17
|
}
|
|
18
|
-
declare const StepForm: React.ForwardRefExoticComponent<
|
|
18
|
+
declare const StepForm: React.ForwardRefExoticComponent<Omit<StepFormProp, "ref"> & React.RefAttributes<unknown>>;
|
|
19
19
|
export default StepForm;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import "antd/es/col/style";
|
|
2
2
|
import _Col from "antd/es/col";
|
|
3
|
-
import "antd/es/steps/style";
|
|
4
|
-
import _Steps from "antd/es/steps";
|
|
5
3
|
import "antd/es/button/style";
|
|
6
4
|
import _Button from "antd/es/button";
|
|
7
|
-
|
|
5
|
+
import "antd/es/steps/style";
|
|
6
|
+
import _Steps from "antd/es/steps";
|
|
7
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
8
|
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."); }
|
|
9
|
-
function _unsupportedIterableToArray(
|
|
10
|
-
function _arrayLikeToArray(
|
|
11
|
-
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)
|
|
12
|
-
function _arrayWithHoles(
|
|
13
|
-
import { __rest } from "tslib";
|
|
9
|
+
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; } }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
13
|
import React, { useEffect, useState, useMemo } from 'react';
|
|
15
14
|
import StandardForm from './index';
|
|
16
15
|
import RenderItemGroup from '../FormComp/RenderItemGroup';
|
|
17
16
|
import ActionList from "./ActionList";
|
|
18
17
|
import './style/index.less';
|
|
18
|
+
// import { BreadcrumbProps as AntdBreadcrumbProps } from 'antd/es/form';
|
|
19
|
+
var Step = _Steps.Step;
|
|
19
20
|
var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
20
21
|
var getFormFields = props.getFormFields,
|
|
21
22
|
_props$formItemGroup = props.formItemGroup,
|
|
@@ -47,7 +48,8 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
47
48
|
var _useState5 = useState(0),
|
|
48
49
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
49
50
|
currentStep = _useState6[0],
|
|
50
|
-
setCurrentStep = _useState6[1];
|
|
51
|
+
setCurrentStep = _useState6[1];
|
|
52
|
+
// const [fieldFailed, setFieldFailed] = useState(false)
|
|
51
53
|
useEffect(function () {
|
|
52
54
|
if (stepsConfig && (stepsConfig.current || stepsConfig.current === 0)) {
|
|
53
55
|
setCurrentStep(stepsConfig.current); // 判断是否有设置当前选中的步骤数
|
|
@@ -87,7 +89,6 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
87
89
|
var errorFields = _ref.errorFields;
|
|
88
90
|
} // console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
89
91
|
);
|
|
90
|
-
|
|
91
92
|
break;
|
|
92
93
|
case 'prev':
|
|
93
94
|
if (stepClick) stepClick(type, formChild);
|
|
@@ -101,15 +102,6 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
101
102
|
break;
|
|
102
103
|
}
|
|
103
104
|
};
|
|
104
|
-
var stepItems = useMemo(function () {
|
|
105
|
-
return (formItemGroup || []).filter(function (fItem) {
|
|
106
|
-
return !fItem.hideStep;
|
|
107
|
-
}).map(function (item, index) {
|
|
108
|
-
var hideStep = item.hideStep,
|
|
109
|
-
StepItem = __rest(item, ["hideStep"]);
|
|
110
|
-
return Object.assign({}, StepItem);
|
|
111
|
-
});
|
|
112
|
-
}, [formItemGroup]);
|
|
113
105
|
/* const handleStepChange = (cur:any) => {
|
|
114
106
|
// 自行判断是否校验通过
|
|
115
107
|
/!* if (cur > current) {
|
|
@@ -212,9 +204,23 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
212
204
|
onFinishFailed: function onFinishFailed() {
|
|
213
205
|
// setFieldFailed(true)
|
|
214
206
|
}
|
|
215
|
-
}, /*#__PURE__*/React.createElement(_Steps, Object.assign({}, stepsConfig, {
|
|
216
|
-
|
|
217
|
-
})
|
|
207
|
+
}, /*#__PURE__*/React.createElement(_Steps, Object.assign({}, stepsConfig), formItemGroup.filter(function (fItem) {
|
|
208
|
+
return !fItem.hideStep;
|
|
209
|
+
}).map(function (item, index) {
|
|
210
|
+
return /*#__PURE__*/React.createElement(Step, {
|
|
211
|
+
key: "".concat(item.title).concat(index),
|
|
212
|
+
description: item.description,
|
|
213
|
+
icon: item.icon,
|
|
214
|
+
status: item.status,
|
|
215
|
+
title: item.title,
|
|
216
|
+
subTitle: item.subTitle,
|
|
217
|
+
disabled: item.disabled
|
|
218
|
+
});
|
|
219
|
+
})),
|
|
220
|
+
// 过滤隐藏掉的步骤表单
|
|
221
|
+
formItemGroup.filter(function (fItem) {
|
|
222
|
+
return !fItem.hideStep;
|
|
223
|
+
}).map(function (item, index) {
|
|
218
224
|
return /*#__PURE__*/React.createElement("div", {
|
|
219
225
|
key: index,
|
|
220
226
|
className: "stepForm-content ".concat(layout === 'inline' ? 'stepForm-content-inline' : ''),
|
|
@@ -15,5 +15,5 @@ export interface TabFormProp extends StandardFormProps {
|
|
|
15
15
|
actionHide?: boolean;
|
|
16
16
|
formItemGroup?: TabItemGroupProps[];
|
|
17
17
|
}
|
|
18
|
-
declare const TabForm: React.ForwardRefExoticComponent<
|
|
18
|
+
declare const TabForm: React.ForwardRefExoticComponent<Omit<TabFormProp, "ref"> & React.RefAttributes<unknown>>;
|
|
19
19
|
export default TabForm;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import "antd/es/tabs/style";
|
|
2
|
-
import _Tabs from "antd/es/tabs";
|
|
3
1
|
import "antd/es/col/style";
|
|
4
2
|
import _Col from "antd/es/col";
|
|
5
|
-
|
|
3
|
+
import "antd/es/tabs/style";
|
|
4
|
+
import _Tabs from "antd/es/tabs";
|
|
5
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
6
6
|
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."); }
|
|
7
|
-
function _unsupportedIterableToArray(
|
|
8
|
-
function _arrayLikeToArray(
|
|
9
|
-
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)
|
|
10
|
-
function _arrayWithHoles(
|
|
7
|
+
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; } }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
11
|
import { __rest } from "tslib";
|
|
12
12
|
import React, { useEffect, useState, useMemo } from 'react';
|
|
13
13
|
import './style/index.less';
|
|
14
14
|
import StandardForm from './index';
|
|
15
15
|
import RenderItemGroup from '../FormComp/RenderItemGroup';
|
|
16
16
|
import ActionList from "./ActionList";
|
|
17
|
+
var TabPane = _Tabs.TabPane;
|
|
17
18
|
var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
18
19
|
var getFormFields = props.getFormFields,
|
|
19
20
|
_props$formItemGroup = props.formItemGroup,
|
|
@@ -37,7 +38,8 @@ var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
37
38
|
var _useState3 = useState(),
|
|
38
39
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
40
|
formChild = _useState4[0],
|
|
40
|
-
setFormChild = _useState4[1];
|
|
41
|
+
setFormChild = _useState4[1];
|
|
42
|
+
// const [fieldFailed, setFieldFailed] = useState(false)
|
|
41
43
|
var formGridSize = useMemo(function () {
|
|
42
44
|
if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
|
|
43
45
|
var sizeName = 'xs';
|
|
@@ -55,39 +57,6 @@ var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
55
57
|
getFormFields && getFormFields(formChildFields, formChild);
|
|
56
58
|
};
|
|
57
59
|
if (formItemGroup.length === 0) return null;
|
|
58
|
-
var items = useMemo(function () {
|
|
59
|
-
return formItemGroup.map(function (item, index) {
|
|
60
|
-
var title = item.title,
|
|
61
|
-
fields = item.fields,
|
|
62
|
-
actions = item.actions,
|
|
63
|
-
tabConfig = __rest(item, ["title", "fields", "actions"]);
|
|
64
|
-
return Object.assign({
|
|
65
|
-
key: item.key || index,
|
|
66
|
-
label: title || item.label,
|
|
67
|
-
children: /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
|
|
69
|
-
}, fields && Array.isArray(fields) ? /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
70
|
-
layout: layout,
|
|
71
|
-
form: formChild,
|
|
72
|
-
fieldStatus: fieldStatus,
|
|
73
|
-
size: formGridSize,
|
|
74
|
-
displayLayout: displayLayout,
|
|
75
|
-
doUpdateFormFields: function doUpdateFormFields() {
|
|
76
|
-
return forceUpdateForm();
|
|
77
|
-
},
|
|
78
|
-
// doUpdateFormFields={() => forceUpdateForm()}
|
|
79
|
-
itemGroup: fields
|
|
80
|
-
}) : fields, !actionHide && actions && /*#__PURE__*/React.createElement(_Col, {
|
|
81
|
-
span: 24
|
|
82
|
-
}, /*#__PURE__*/React.createElement(ActionList, {
|
|
83
|
-
list: item.actions,
|
|
84
|
-
form: formChild,
|
|
85
|
-
other: props,
|
|
86
|
-
align: actionAlign
|
|
87
|
-
})))
|
|
88
|
-
}, tabConfig);
|
|
89
|
-
});
|
|
90
|
-
}, [formItemGroup]);
|
|
91
60
|
return /*#__PURE__*/React.createElement(StandardForm, {
|
|
92
61
|
actionGroup: [],
|
|
93
62
|
ref: ref,
|
|
@@ -103,8 +72,37 @@ var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
103
72
|
}, /*#__PURE__*/React.createElement(_Tabs, Object.assign({
|
|
104
73
|
type: "card",
|
|
105
74
|
animated: false
|
|
106
|
-
}, tabsConfig, {
|
|
107
|
-
|
|
75
|
+
}, tabsConfig), formItemGroup.map(function (item, index) {
|
|
76
|
+
var title = item.title,
|
|
77
|
+
fields = item.fields,
|
|
78
|
+
actions = item.actions,
|
|
79
|
+
tabConfig = __rest(item, ["title", "fields", "actions"]);
|
|
80
|
+
return /*#__PURE__*/React.createElement(TabPane, Object.assign({
|
|
81
|
+
key: "".concat(item.key || index),
|
|
82
|
+
tab: title
|
|
83
|
+
}, tabConfig, {
|
|
84
|
+
forceRender: true
|
|
85
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
|
|
87
|
+
}, fields && Array.isArray(fields) ? /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
88
|
+
layout: layout,
|
|
89
|
+
form: formChild,
|
|
90
|
+
fieldStatus: fieldStatus,
|
|
91
|
+
size: formGridSize,
|
|
92
|
+
displayLayout: displayLayout,
|
|
93
|
+
doUpdateFormFields: function doUpdateFormFields() {
|
|
94
|
+
return forceUpdateForm();
|
|
95
|
+
},
|
|
96
|
+
// doUpdateFormFields={() => forceUpdateForm()}
|
|
97
|
+
itemGroup: fields
|
|
98
|
+
}) : fields, !actionHide && actions && /*#__PURE__*/React.createElement(_Col, {
|
|
99
|
+
span: 24
|
|
100
|
+
}, /*#__PURE__*/React.createElement(ActionList, {
|
|
101
|
+
list: item.actions,
|
|
102
|
+
form: formChild,
|
|
103
|
+
other: props,
|
|
104
|
+
align: actionAlign
|
|
105
|
+
}))));
|
|
108
106
|
})));
|
|
109
107
|
});
|
|
110
108
|
export default TabForm;
|
|
@@ -28,5 +28,5 @@ export interface StandardFormProps {
|
|
|
28
28
|
displayLayout?: any;
|
|
29
29
|
[k: string]: any;
|
|
30
30
|
}
|
|
31
|
-
declare const StandardForm: React.ForwardRefExoticComponent<
|
|
31
|
+
declare const StandardForm: React.ForwardRefExoticComponent<Omit<StandardFormProps, "ref"> & React.RefAttributes<unknown>>;
|
|
32
32
|
export default StandardForm;
|
package/es/StandardForm/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import "antd/es/button/style";
|
|
|
2
2
|
import _Button from "antd/es/button";
|
|
3
3
|
import "antd/es/form/style";
|
|
4
4
|
import _Form from "antd/es/form";
|
|
5
|
-
function _slicedToArray(
|
|
5
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
6
6
|
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."); }
|
|
7
|
-
function _unsupportedIterableToArray(
|
|
8
|
-
function _arrayLikeToArray(
|
|
9
|
-
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)
|
|
10
|
-
function _arrayWithHoles(
|
|
7
|
+
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; } }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
11
|
import { __rest } from "tslib";
|
|
12
12
|
import React, { useEffect, useMemo } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
@@ -3,6 +3,7 @@ import { ModalProps } from 'antd/es/modal';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { ItemGroupProps } from '../StandardForm/index';
|
|
5
5
|
import './style/index.less';
|
|
6
|
+
import 'ant-design-draggable-modal/dist/index.css';
|
|
6
7
|
export interface StandardModalProps extends ModalProps {
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
title?: String;
|
|
@@ -39,5 +40,5 @@ export interface StandardModalProps extends ModalProps {
|
|
|
39
40
|
dragAble?: boolean;
|
|
40
41
|
[k: string]: any;
|
|
41
42
|
}
|
|
42
|
-
declare const StandardModal: (props: StandardModalProps) => JSX.Element;
|
|
43
|
+
declare const StandardModal: (props: StandardModalProps) => React.JSX.Element;
|
|
43
44
|
export default StandardModal;
|