fan-standard-comp 3.2.1 → 3.2.2
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 +1 -33
- package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
- package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
- package/dist/fan-standard-comp.umd.js +166 -444
- 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 +33 -23
- package/es/FormComp/FieldComponent/setReadonlyValues.js +6 -6
- package/es/FormComp/RenderItemGroup/index.js +24 -8
- package/es/FormComp/Uploader/index.d.ts +3 -1
- package/es/FormComp/Uploader/index.js +243 -119
- 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 +38 -26
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +15 -20
- package/lib/FormComp/RenderItemGroup/index.js +26 -11
- package/lib/FormComp/Uploader/index.d.ts +3 -1
- package/lib/FormComp/Uploader/index.js +244 -123
- 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 +14 -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,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
require("antd/es/button/style");
|
|
9
|
+
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
10
|
+
require("antd/es/form/style");
|
|
11
|
+
var _form = _interopRequireDefault(require("antd/es/form"));
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _ValueFormat = _interopRequireDefault(require("../utils/ValueFormat.js"));
|
|
14
|
+
var _index = _interopRequireDefault(require("../ButtonGroup/index"));
|
|
15
|
+
require("./style/index.less");
|
|
16
|
+
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
|
+
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); } }
|
|
20
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
+
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); }
|
|
23
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
24
|
+
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); }
|
|
25
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
26
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
28
|
+
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); }
|
|
29
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } // import { general } from '../data/index';
|
|
30
|
+
var FormItem = _form.default.Item;
|
|
31
|
+
var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
32
|
+
function StandardFilter(props) {
|
|
33
|
+
var _this;
|
|
34
|
+
_classCallCheck(this, StandardFilter);
|
|
35
|
+
_this = _callSuper(this, StandardFilter, [props]);
|
|
36
|
+
_this.filterFormRef = /*#__PURE__*/_react.default.createRef();
|
|
37
|
+
// 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
|
|
38
|
+
_this.updateFormFields = function (newVal, force) {
|
|
39
|
+
var getFormFields = _this.props.getFormFields;
|
|
40
|
+
var resetValues = {};
|
|
41
|
+
if (force) {
|
|
42
|
+
// this.filterFormRef.current.resetFields()
|
|
43
|
+
// 先清空 再赋值
|
|
44
|
+
resetValues = _this.filterFormRef.current.getFieldsValue();
|
|
45
|
+
Object.keys(resetValues).forEach(function (item) {
|
|
46
|
+
resetValues[item] = undefined;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
_this.filterFormRef.current.setFieldsValue(Object.assign(Object.assign({}, resetValues), newVal)); // 直接清空表单的赋值
|
|
50
|
+
if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
|
|
51
|
+
}; // 强制更新表单值,用于赋初始化实例值
|
|
52
|
+
_this.forceUpdateForm = function () {
|
|
53
|
+
var getFormFields = _this.props.getFormFields;
|
|
54
|
+
if (getFormFields) getFormFields(_this.filterFormRef.current.getFieldsValue(), _this.filterFormRef);
|
|
55
|
+
};
|
|
56
|
+
_this.handleSearch = function (values) {
|
|
57
|
+
var _this$props = _this.props,
|
|
58
|
+
formItemGroup = _this$props.formItemGroup,
|
|
59
|
+
onFilterSearch = _this$props.onFilterSearch;
|
|
60
|
+
// if (Object.prototype.hasOwnProperty.call(values, false)) {
|
|
61
|
+
// delete values.false // TODO 自定义结构会莫名的出来一个false字段
|
|
62
|
+
// }
|
|
63
|
+
var resultValues = (0, _ValueFormat.default)(values, formItemGroup);
|
|
64
|
+
if (onFilterSearch) {
|
|
65
|
+
onFilterSearch(Object.assign({}, resultValues));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
_this.handleReset = function () {
|
|
69
|
+
var onFilterReset = _this.props.onFilterReset;
|
|
70
|
+
// 使用此方法,表单校验无法清空掉
|
|
71
|
+
// const resetValues = this.filterFormRef.current.getFieldsValue()
|
|
72
|
+
// Object.keys(resetValues).forEach((item) => {
|
|
73
|
+
// resetValues[item] = undefined
|
|
74
|
+
// })
|
|
75
|
+
// this.filterFormRef.current.setFieldsValue({ ...resetValues }) // 直接清空表单的赋值
|
|
76
|
+
_this.filterFormRef.current.resetFields();
|
|
77
|
+
_this.setState({
|
|
78
|
+
reFormItemGroup: _this.props.formItemGroup // 重新渲染列表
|
|
79
|
+
});
|
|
80
|
+
if (onFilterReset) {
|
|
81
|
+
onFilterReset(_this.filterFormRef.current.getFieldsValue());
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
_this.itemIsHide = function (isHide) {
|
|
85
|
+
var current = _this.filterFormRef.current;
|
|
86
|
+
if (!isHide) return false;
|
|
87
|
+
if (typeof isHide === 'function') {
|
|
88
|
+
return isHide(current ? current.getFieldsValue() : {}, current);
|
|
89
|
+
}
|
|
90
|
+
return isHide;
|
|
91
|
+
};
|
|
92
|
+
// 表单列表组 formItemGroup 类型为数组或者React.Node
|
|
93
|
+
_this.renderFormItemGroup = function () {
|
|
94
|
+
var reFormItemGroup = _this.state.reFormItemGroup;
|
|
95
|
+
if (Array.isArray(reFormItemGroup)) {
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
97
|
+
itemGroup: reFormItemGroup,
|
|
98
|
+
layout: "inline",
|
|
99
|
+
form: _this.filterFormRef,
|
|
100
|
+
doUpdateFormFields: function doUpdateFormFields() {
|
|
101
|
+
return _this.forceUpdateForm();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
/* return <>
|
|
105
|
+
{
|
|
106
|
+
reFormItemGroup.map((item, index) => {
|
|
107
|
+
const { componentStyle, isHide } = item
|
|
108
|
+
if (this.itemIsHide(isHide)) return null
|
|
109
|
+
return (
|
|
110
|
+
<FormItem key={item.filedName} label={item.label}
|
|
111
|
+
name={item.type !== 'custom' && item.filedName}
|
|
112
|
+
rules={item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])}
|
|
113
|
+
{...item.protoFormItem}>
|
|
114
|
+
{
|
|
115
|
+
(item.type === 'custom' && item.customRender) ? item.customRender(this.filterFormRef, { ...item }) :
|
|
116
|
+
<FieldComponent {...item}
|
|
117
|
+
onChange={(val, ...otherParams) => {
|
|
118
|
+
let updateValue = val
|
|
119
|
+
if (item.type === 'input' || item.type === 'textarea' || item.type === 'radio') {
|
|
120
|
+
updateValue = val.target.value
|
|
121
|
+
}
|
|
122
|
+
if (Array.isArray(val)) {
|
|
123
|
+
updateValue = [...val]
|
|
124
|
+
}
|
|
125
|
+
this.updateFormFields({ [item.filedName]: updateValue })
|
|
126
|
+
if (item.onChange) item.onChange(val, this.filterFormRef, ...otherParams)
|
|
127
|
+
}}
|
|
128
|
+
style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}/>
|
|
129
|
+
}
|
|
130
|
+
</FormItem>
|
|
131
|
+
)
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
</>*/
|
|
135
|
+
}
|
|
136
|
+
return reFormItemGroup;
|
|
137
|
+
};
|
|
138
|
+
_this.state = {
|
|
139
|
+
// recombinationGroup: [],
|
|
140
|
+
reFormItemGroup: undefined
|
|
141
|
+
};
|
|
142
|
+
return _this;
|
|
143
|
+
}
|
|
144
|
+
_inherits(StandardFilter, _React$Component);
|
|
145
|
+
return _createClass(StandardFilter, [{
|
|
146
|
+
key: "componentDidMount",
|
|
147
|
+
value: function componentDidMount() {
|
|
148
|
+
var initialValues = this.props.initialValues;
|
|
149
|
+
this.updateFormFields(initialValues, true);
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "componentDidUpdate",
|
|
153
|
+
value: function componentDidUpdate(prevProps) {
|
|
154
|
+
var initialValues = this.props.initialValues;
|
|
155
|
+
if (prevProps.initialValues !== initialValues) {
|
|
156
|
+
this.updateFormFields(initialValues, true);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "render",
|
|
161
|
+
value: function render() {
|
|
162
|
+
var _this$props2 = this.props,
|
|
163
|
+
className = _this$props2.className,
|
|
164
|
+
style = _this$props2.style,
|
|
165
|
+
onFilterReset = _this$props2.onFilterReset,
|
|
166
|
+
_this$props2$buttonGr = _this$props2.buttonGroup,
|
|
167
|
+
buttonGroup = _this$props2$buttonGr === void 0 ? [] : _this$props2$buttonGr,
|
|
168
|
+
min = _this$props2.min,
|
|
169
|
+
codes = _this$props2.codes,
|
|
170
|
+
permissionCodes = _this$props2.permissionCodes,
|
|
171
|
+
confirmText = _this$props2.confirmText,
|
|
172
|
+
cancelText = _this$props2.cancelText,
|
|
173
|
+
onFilterSearch = _this$props2.onFilterSearch,
|
|
174
|
+
buttonGroupConfig = _this$props2.buttonGroupConfig;
|
|
175
|
+
// const { recombinationGroup } = this.state;
|
|
176
|
+
return /*#__PURE__*/_react.default.createElement(_form.default, {
|
|
177
|
+
name: "standard-filter-form",
|
|
178
|
+
ref: this.filterFormRef,
|
|
179
|
+
layout: "inline",
|
|
180
|
+
onFinish: this.handleSearch,
|
|
181
|
+
className: className,
|
|
182
|
+
style: style
|
|
183
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
184
|
+
className: "filter-grid"
|
|
185
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
186
|
+
className: "filter-form"
|
|
187
|
+
}, this.state.reFormItemGroup ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderFormItemGroup(), /*#__PURE__*/_react.default.createElement(FormItem, {
|
|
188
|
+
style: {
|
|
189
|
+
display: !onFilterSearch && !onFilterReset ? 'none' : 'inline-block'
|
|
190
|
+
}
|
|
191
|
+
}, onFilterSearch && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
192
|
+
type: "primary",
|
|
193
|
+
htmlType: "submit"
|
|
194
|
+
}, " ", confirmText || '查询'), onFilterReset && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
195
|
+
type: "primary",
|
|
196
|
+
style: {
|
|
197
|
+
marginLeft: 8
|
|
198
|
+
},
|
|
199
|
+
onClick: this.handleReset,
|
|
200
|
+
ghost: true
|
|
201
|
+
}, cancelText || '重置'))) : null), buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
+
className: "filter-btns"
|
|
203
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
204
|
+
options: buttonGroup,
|
|
205
|
+
min: min,
|
|
206
|
+
codes: codes,
|
|
207
|
+
permissionCodes: permissionCodes,
|
|
208
|
+
dropdownConfig: buttonGroupConfig
|
|
209
|
+
})) : null));
|
|
210
|
+
}
|
|
211
|
+
}], [{
|
|
212
|
+
key: "getDerivedStateFromProps",
|
|
213
|
+
value: function getDerivedStateFromProps(nextProps) {
|
|
214
|
+
var formItemGroup = nextProps.formItemGroup;
|
|
215
|
+
// const restOptionList = removeNoPermission(buttonGroup, permissionCodes, codes) || []
|
|
216
|
+
return {
|
|
217
|
+
// recombinationGroup: restOptionList,
|
|
218
|
+
reFormItemGroup: formItemGroup
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}]);
|
|
222
|
+
}(_react.default.Component);
|
|
223
|
+
var _default = exports.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
|
}
|
|
@@ -8,7 +8,7 @@ require("antd/es/button/style");
|
|
|
8
8
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _IconNode = _interopRequireDefault(require("../components/IconNode"));
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
var ActionList = function ActionList(props) {
|
|
13
13
|
var list = props.list,
|
|
14
14
|
form = props.form,
|
|
@@ -46,5 +46,4 @@ var ActionList = function ActionList(props) {
|
|
|
46
46
|
}, item.name);
|
|
47
47
|
}));
|
|
48
48
|
};
|
|
49
|
-
var _default = ActionList;
|
|
50
|
-
exports.default = _default;
|
|
49
|
+
var _default = exports.default = ActionList;
|
|
@@ -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;
|
|
@@ -7,25 +7,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
require("antd/es/col/style");
|
|
9
9
|
var _col = _interopRequireDefault(require("antd/es/col"));
|
|
10
|
-
require("antd/es/steps/style");
|
|
11
|
-
var _steps = _interopRequireDefault(require("antd/es/steps"));
|
|
12
10
|
require("antd/es/button/style");
|
|
13
11
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
14
|
-
|
|
12
|
+
require("antd/es/steps/style");
|
|
13
|
+
var _steps = _interopRequireDefault(require("antd/es/steps"));
|
|
15
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
15
|
var _index = _interopRequireDefault(require("./index"));
|
|
17
16
|
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
18
17
|
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
19
18
|
require("./style/index.less");
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
function _interopRequireWildcard(
|
|
22
|
-
function _interopRequireDefault(
|
|
23
|
-
function _slicedToArray(
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
24
23
|
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."); }
|
|
25
|
-
function _unsupportedIterableToArray(
|
|
26
|
-
function _arrayLikeToArray(
|
|
27
|
-
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)
|
|
28
|
-
function _arrayWithHoles(
|
|
24
|
+
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; } }
|
|
25
|
+
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; }
|
|
26
|
+
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; } }
|
|
27
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
28
|
+
// import { BreadcrumbProps as AntdBreadcrumbProps } from 'antd/es/form';
|
|
29
|
+
var Step = _steps.default.Step;
|
|
29
30
|
var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
30
31
|
var getFormFields = props.getFormFields,
|
|
31
32
|
_props$formItemGroup = props.formItemGroup,
|
|
@@ -57,7 +58,8 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
57
58
|
var _useState5 = (0, _react.useState)(0),
|
|
58
59
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
60
|
currentStep = _useState6[0],
|
|
60
|
-
setCurrentStep = _useState6[1];
|
|
61
|
+
setCurrentStep = _useState6[1];
|
|
62
|
+
// const [fieldFailed, setFieldFailed] = useState(false)
|
|
61
63
|
(0, _react.useEffect)(function () {
|
|
62
64
|
if (stepsConfig && (stepsConfig.current || stepsConfig.current === 0)) {
|
|
63
65
|
setCurrentStep(stepsConfig.current); // 判断是否有设置当前选中的步骤数
|
|
@@ -97,7 +99,6 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
97
99
|
var errorFields = _ref.errorFields;
|
|
98
100
|
} // console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
99
101
|
);
|
|
100
|
-
|
|
101
102
|
break;
|
|
102
103
|
case 'prev':
|
|
103
104
|
if (stepClick) stepClick(type, formChild);
|
|
@@ -111,15 +112,6 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
111
112
|
break;
|
|
112
113
|
}
|
|
113
114
|
};
|
|
114
|
-
var stepItems = (0, _react.useMemo)(function () {
|
|
115
|
-
return (formItemGroup || []).filter(function (fItem) {
|
|
116
|
-
return !fItem.hideStep;
|
|
117
|
-
}).map(function (item, index) {
|
|
118
|
-
var hideStep = item.hideStep,
|
|
119
|
-
StepItem = (0, _tslib.__rest)(item, ["hideStep"]);
|
|
120
|
-
return Object.assign({}, StepItem);
|
|
121
|
-
});
|
|
122
|
-
}, [formItemGroup]);
|
|
123
115
|
/* const handleStepChange = (cur:any) => {
|
|
124
116
|
// 自行判断是否校验通过
|
|
125
117
|
/!* if (cur > current) {
|
|
@@ -222,9 +214,23 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
222
214
|
onFinishFailed: function onFinishFailed() {
|
|
223
215
|
// setFieldFailed(true)
|
|
224
216
|
}
|
|
225
|
-
}, /*#__PURE__*/_react.default.createElement(_steps.default, Object.assign({}, stepsConfig, {
|
|
226
|
-
|
|
227
|
-
})
|
|
217
|
+
}, /*#__PURE__*/_react.default.createElement(_steps.default, Object.assign({}, stepsConfig), formItemGroup.filter(function (fItem) {
|
|
218
|
+
return !fItem.hideStep;
|
|
219
|
+
}).map(function (item, index) {
|
|
220
|
+
return /*#__PURE__*/_react.default.createElement(Step, {
|
|
221
|
+
key: "".concat(item.title).concat(index),
|
|
222
|
+
description: item.description,
|
|
223
|
+
icon: item.icon,
|
|
224
|
+
status: item.status,
|
|
225
|
+
title: item.title,
|
|
226
|
+
subTitle: item.subTitle,
|
|
227
|
+
disabled: item.disabled
|
|
228
|
+
});
|
|
229
|
+
})),
|
|
230
|
+
// 过滤隐藏掉的步骤表单
|
|
231
|
+
formItemGroup.filter(function (fItem) {
|
|
232
|
+
return !fItem.hideStep;
|
|
233
|
+
}).map(function (item, index) {
|
|
228
234
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
229
235
|
key: index,
|
|
230
236
|
className: "stepForm-content ".concat(layout === 'inline' ? 'stepForm-content-inline' : ''),
|
|
@@ -253,5 +259,4 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
253
259
|
}) : renderStepActions(item, index)));
|
|
254
260
|
}));
|
|
255
261
|
});
|
|
256
|
-
var _default = StepForm;
|
|
257
|
-
exports.default = _default;
|
|
262
|
+
var _default = exports.default = StepForm;
|
|
@@ -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;
|
|
@@ -5,25 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
require("antd/es/tabs/style");
|
|
9
|
-
var _tabs = _interopRequireDefault(require("antd/es/tabs"));
|
|
10
8
|
require("antd/es/col/style");
|
|
11
9
|
var _col = _interopRequireDefault(require("antd/es/col"));
|
|
10
|
+
require("antd/es/tabs/style");
|
|
11
|
+
var _tabs = _interopRequireDefault(require("antd/es/tabs"));
|
|
12
12
|
var _tslib = require("tslib");
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
require("./style/index.less");
|
|
15
15
|
var _index2 = _interopRequireDefault(require("./index"));
|
|
16
16
|
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
17
17
|
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
20
|
-
function _interopRequireDefault(
|
|
21
|
-
function _slicedToArray(
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
22
22
|
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."); }
|
|
23
|
-
function _unsupportedIterableToArray(
|
|
24
|
-
function _arrayLikeToArray(
|
|
25
|
-
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)
|
|
26
|
-
function _arrayWithHoles(
|
|
23
|
+
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; } }
|
|
24
|
+
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; }
|
|
25
|
+
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; } }
|
|
26
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
27
|
+
var TabPane = _tabs.default.TabPane;
|
|
27
28
|
var TabForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
28
29
|
var getFormFields = props.getFormFields,
|
|
29
30
|
_props$formItemGroup = props.formItemGroup,
|
|
@@ -47,7 +48,8 @@ var TabForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
47
48
|
var _useState3 = (0, _react.useState)(),
|
|
48
49
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
50
|
formChild = _useState4[0],
|
|
50
|
-
setFormChild = _useState4[1];
|
|
51
|
+
setFormChild = _useState4[1];
|
|
52
|
+
// const [fieldFailed, setFieldFailed] = useState(false)
|
|
51
53
|
var formGridSize = (0, _react.useMemo)(function () {
|
|
52
54
|
if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
|
|
53
55
|
var sizeName = 'xs';
|
|
@@ -65,39 +67,6 @@ var TabForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
65
67
|
getFormFields && getFormFields(formChildFields, formChild);
|
|
66
68
|
};
|
|
67
69
|
if (formItemGroup.length === 0) return null;
|
|
68
|
-
var items = (0, _react.useMemo)(function () {
|
|
69
|
-
return formItemGroup.map(function (item, index) {
|
|
70
|
-
var title = item.title,
|
|
71
|
-
fields = item.fields,
|
|
72
|
-
actions = item.actions,
|
|
73
|
-
tabConfig = (0, _tslib.__rest)(item, ["title", "fields", "actions"]);
|
|
74
|
-
return Object.assign({
|
|
75
|
-
key: item.key || index,
|
|
76
|
-
label: title || item.label,
|
|
77
|
-
children: /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
-
className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
|
|
79
|
-
}, fields && Array.isArray(fields) ? /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
80
|
-
layout: layout,
|
|
81
|
-
form: formChild,
|
|
82
|
-
fieldStatus: fieldStatus,
|
|
83
|
-
size: formGridSize,
|
|
84
|
-
displayLayout: displayLayout,
|
|
85
|
-
doUpdateFormFields: function doUpdateFormFields() {
|
|
86
|
-
return forceUpdateForm();
|
|
87
|
-
},
|
|
88
|
-
// doUpdateFormFields={() => forceUpdateForm()}
|
|
89
|
-
itemGroup: fields
|
|
90
|
-
}) : fields, !actionHide && actions && /*#__PURE__*/_react.default.createElement(_col.default, {
|
|
91
|
-
span: 24
|
|
92
|
-
}, /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
93
|
-
list: item.actions,
|
|
94
|
-
form: formChild,
|
|
95
|
-
other: props,
|
|
96
|
-
align: actionAlign
|
|
97
|
-
})))
|
|
98
|
-
}, tabConfig);
|
|
99
|
-
});
|
|
100
|
-
}, [formItemGroup]);
|
|
101
70
|
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
102
71
|
actionGroup: [],
|
|
103
72
|
ref: ref,
|
|
@@ -113,9 +82,37 @@ var TabForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
113
82
|
}, /*#__PURE__*/_react.default.createElement(_tabs.default, Object.assign({
|
|
114
83
|
type: "card",
|
|
115
84
|
animated: false
|
|
116
|
-
}, tabsConfig, {
|
|
117
|
-
|
|
85
|
+
}, tabsConfig), formItemGroup.map(function (item, index) {
|
|
86
|
+
var title = item.title,
|
|
87
|
+
fields = item.fields,
|
|
88
|
+
actions = item.actions,
|
|
89
|
+
tabConfig = (0, _tslib.__rest)(item, ["title", "fields", "actions"]);
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement(TabPane, Object.assign({
|
|
91
|
+
key: "".concat(item.key || index),
|
|
92
|
+
tab: title
|
|
93
|
+
}, tabConfig, {
|
|
94
|
+
forceRender: true
|
|
95
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
|
|
97
|
+
}, fields && Array.isArray(fields) ? /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
98
|
+
layout: layout,
|
|
99
|
+
form: formChild,
|
|
100
|
+
fieldStatus: fieldStatus,
|
|
101
|
+
size: formGridSize,
|
|
102
|
+
displayLayout: displayLayout,
|
|
103
|
+
doUpdateFormFields: function doUpdateFormFields() {
|
|
104
|
+
return forceUpdateForm();
|
|
105
|
+
},
|
|
106
|
+
// doUpdateFormFields={() => forceUpdateForm()}
|
|
107
|
+
itemGroup: fields
|
|
108
|
+
}) : fields, !actionHide && actions && /*#__PURE__*/_react.default.createElement(_col.default, {
|
|
109
|
+
span: 24
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
111
|
+
list: item.actions,
|
|
112
|
+
form: formChild,
|
|
113
|
+
other: props,
|
|
114
|
+
align: actionAlign
|
|
115
|
+
}))));
|
|
118
116
|
})));
|
|
119
117
|
});
|
|
120
|
-
var _default = TabForm;
|
|
121
|
-
exports.default = _default;
|
|
118
|
+
var _default = exports.default = TabForm;
|