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
|
@@ -10,54 +10,41 @@ var _tag = _interopRequireDefault(require("antd/es/tag"));
|
|
|
10
10
|
require("antd/es/input/style");
|
|
11
11
|
var _input = _interopRequireDefault(require("antd/es/input"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
-
function _interopRequireDefault(
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
function
|
|
21
|
-
function
|
|
22
|
-
function
|
|
23
|
-
function
|
|
24
|
-
function
|
|
25
|
-
function
|
|
26
|
-
function
|
|
27
|
-
function
|
|
28
|
-
function
|
|
29
|
-
function
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
|
+
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); } }
|
|
21
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
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); }
|
|
24
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
25
|
+
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); }
|
|
26
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
27
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
29
|
+
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); }
|
|
30
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } /**
|
|
31
|
+
* Created by S.C. on 2019/11/16.
|
|
32
|
+
*/
|
|
33
33
|
var TextArea = _input.default.TextArea;
|
|
34
34
|
var isIE = !!document.all;
|
|
35
35
|
var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
36
|
-
_inherits(VarTemplate, _Component);
|
|
37
|
-
var _super = _createSuper(VarTemplate);
|
|
38
|
-
_createClass(VarTemplate, null, [{
|
|
39
|
-
key: "getDerivedStateFromProps",
|
|
40
|
-
value: function getDerivedStateFromProps(nextProps) {
|
|
41
|
-
// console.log('执行getDerivedStateFromProps', nextProps)
|
|
42
|
-
// Should be a controlled component.
|
|
43
|
-
if ('value' in nextProps) {
|
|
44
|
-
return _objectSpread({}, nextProps.value || {});
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
}]);
|
|
49
36
|
function VarTemplate(props) {
|
|
50
37
|
var _this;
|
|
51
38
|
_classCallCheck(this, VarTemplate);
|
|
52
|
-
_this =
|
|
53
|
-
|
|
39
|
+
_this = _callSuper(this, VarTemplate, [props]);
|
|
40
|
+
_this.handleBlur = function (e) {
|
|
54
41
|
_this.getCurrentCursor();
|
|
55
|
-
}
|
|
56
|
-
|
|
42
|
+
};
|
|
43
|
+
_this.handleFocus = function (e) {
|
|
57
44
|
// console.log('获取焦点')
|
|
58
45
|
// this.$emit('focus', event)
|
|
59
|
-
}
|
|
60
|
-
|
|
46
|
+
};
|
|
47
|
+
_this.handleInputChange = function (e) {
|
|
61
48
|
var onChange = _this.props.onChange;
|
|
62
49
|
_this.getCurrentCursor();
|
|
63
50
|
_this.setState({
|
|
@@ -67,8 +54,8 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
67
54
|
wordCount: e.target.value.length
|
|
68
55
|
});
|
|
69
56
|
if (onChange) onChange(e.target.value);
|
|
70
|
-
}
|
|
71
|
-
|
|
57
|
+
};
|
|
58
|
+
_this.setTagWords = function (key) {
|
|
72
59
|
var onChange = _this.props.onChange;
|
|
73
60
|
var _this$state = _this.state,
|
|
74
61
|
currentContent = _this$state.currentContent,
|
|
@@ -86,8 +73,15 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
86
73
|
setTimeout(function () {
|
|
87
74
|
_this.moveToCursor(); // 重新定位光标
|
|
88
75
|
});
|
|
89
|
-
}
|
|
90
|
-
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* 指定位置插入标签占位符字符串,当光标有选中一段字符时,会将直接将其替换
|
|
79
|
+
* @param {str} 需要做插入的字符串
|
|
80
|
+
* @param {insertStr} 需要插入的字符串
|
|
81
|
+
* @param {start} 指定开始位置
|
|
82
|
+
* @param {end} 指定结束位置
|
|
83
|
+
* */
|
|
84
|
+
_this.insertContent = function (str, insertStr, start, end) {
|
|
91
85
|
if (start !== end) {
|
|
92
86
|
var _prevStr = str.substring(0, start);
|
|
93
87
|
var _nextStr = str.substring(end, str.length);
|
|
@@ -96,8 +90,13 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
96
90
|
var prevStr = str.substring(0, start);
|
|
97
91
|
var nextStr = str.substring(start, str.length);
|
|
98
92
|
return prevStr + insertStr + nextStr;
|
|
99
|
-
}
|
|
100
|
-
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* 获取当前(上一次)光标的位置
|
|
96
|
+
* @参考 http://blog.csdn.net/chadcao/article/details/6575927
|
|
97
|
+
* @TODO IE、火狐浏览器下未验证
|
|
98
|
+
*/
|
|
99
|
+
_this.getCurrentCursor = function () {
|
|
101
100
|
var start = 0;
|
|
102
101
|
var end = 0;
|
|
103
102
|
var oTextarea = _this.content.querySelector('textarea'); // 获取textarea标签
|
|
@@ -141,8 +140,13 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
141
140
|
startNum: start,
|
|
142
141
|
endNum: end
|
|
143
142
|
});
|
|
144
|
-
}
|
|
145
|
-
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* 跳转到上一次光标的位置
|
|
146
|
+
* @参考 http://blog.csdn.net/chadcao/article/details/6575927
|
|
147
|
+
* @TODO IE、火狐浏览器下未验证
|
|
148
|
+
*/
|
|
149
|
+
_this.moveToCursor = function () {
|
|
146
150
|
var _this$state2 = _this.state,
|
|
147
151
|
startNum = _this$state2.startNum,
|
|
148
152
|
endNum = _this$state2.endNum;
|
|
@@ -181,7 +185,7 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
181
185
|
oTextarea.selectionStart = startNum;
|
|
182
186
|
oTextarea.selectionEnd = endNum;
|
|
183
187
|
}
|
|
184
|
-
}
|
|
188
|
+
};
|
|
185
189
|
var _value = props.value || '';
|
|
186
190
|
_this.state = {
|
|
187
191
|
currentContent: _value,
|
|
@@ -191,31 +195,11 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
191
195
|
// 光标结束位置(当选中文本时)
|
|
192
196
|
wordCount: _value.length // 输入框内的字符数总和(包含占位符所需要的长度)
|
|
193
197
|
};
|
|
194
|
-
|
|
195
198
|
_this.content = /*#__PURE__*/_react.default.createRef();
|
|
196
199
|
return _this;
|
|
197
200
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
* 指定位置插入标签占位符字符串,当光标有选中一段字符时,会将直接将其替换
|
|
201
|
-
* @param {str} 需要做插入的字符串
|
|
202
|
-
* @param {insertStr} 需要插入的字符串
|
|
203
|
-
* @param {start} 指定开始位置
|
|
204
|
-
* @param {end} 指定结束位置
|
|
205
|
-
* */
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* 获取当前(上一次)光标的位置
|
|
209
|
-
* @参考 http://blog.csdn.net/chadcao/article/details/6575927
|
|
210
|
-
* @TODO IE、火狐浏览器下未验证
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* 跳转到上一次光标的位置
|
|
215
|
-
* @参考 http://blog.csdn.net/chadcao/article/details/6575927
|
|
216
|
-
* @TODO IE、火狐浏览器下未验证
|
|
217
|
-
*/
|
|
218
|
-
_createClass(VarTemplate, [{
|
|
201
|
+
_inherits(VarTemplate, _Component);
|
|
202
|
+
return _createClass(VarTemplate, [{
|
|
219
203
|
key: "render",
|
|
220
204
|
value: function render() {
|
|
221
205
|
var _this2 = this;
|
|
@@ -257,8 +241,16 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
257
241
|
disabled: disabled
|
|
258
242
|
})));
|
|
259
243
|
}
|
|
244
|
+
}], [{
|
|
245
|
+
key: "getDerivedStateFromProps",
|
|
246
|
+
value: function getDerivedStateFromProps(nextProps) {
|
|
247
|
+
// console.log('执行getDerivedStateFromProps', nextProps)
|
|
248
|
+
// Should be a controlled component.
|
|
249
|
+
if ('value' in nextProps) {
|
|
250
|
+
return _objectSpread({}, nextProps.value || {});
|
|
251
|
+
}
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
260
254
|
}]);
|
|
261
|
-
return VarTemplate;
|
|
262
255
|
}(_react.Component);
|
|
263
|
-
var _default = VarTemplate;
|
|
264
|
-
exports.default = _default;
|
|
256
|
+
var _default = exports.default = VarTemplate;
|
package/lib/FormComp/index.js
CHANGED
|
@@ -10,4 +10,4 @@ Object.defineProperty(exports, "Uploader", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
var _Uploader = _interopRequireDefault(require("./Uploader"));
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './PreviewStyles/ImagePreview.less';
|
|
3
|
+
interface ImagePreviewTypes {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
current?: number;
|
|
6
|
+
hasThumbnail?: boolean;
|
|
7
|
+
galleryItems?: any[];
|
|
8
|
+
children?: any;
|
|
9
|
+
mode?: string;
|
|
10
|
+
[k: string]: any;
|
|
11
|
+
}
|
|
12
|
+
declare const ImagePreview: (props: ImagePreviewTypes) => React.JSX.Element;
|
|
13
|
+
export default ImagePreview;
|
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
require("./PreviewStyles/ImagePreview.less");
|
|
11
|
+
var _reactHtmlParser = _interopRequireDefault(require("react-html-parser"));
|
|
12
|
+
var _Thumbnail = _interopRequireDefault(require("./Thumbnail"));
|
|
13
|
+
var _SliderContent = _interopRequireDefault(require("./SliderContent"));
|
|
14
|
+
var _uniqueId = require("./hook/uniqueId");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
|
+
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."); }
|
|
20
|
+
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; } }
|
|
21
|
+
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; }
|
|
22
|
+
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; } }
|
|
23
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // @ts-ignore
|
|
24
|
+
// react16上使用,react18上不能使用否则会报警
|
|
25
|
+
// import HtmlReactParse from 'html-react-parser'; // react18上使用
|
|
26
|
+
var delay = 40;
|
|
27
|
+
var ImagePreview = function ImagePreview(props) {
|
|
28
|
+
var open = props.open,
|
|
29
|
+
children = props.children,
|
|
30
|
+
onClose = props.onClose,
|
|
31
|
+
current = props.current,
|
|
32
|
+
hasThumbnail = props.hasThumbnail,
|
|
33
|
+
mode = props.mode,
|
|
34
|
+
galleryItems = props.galleryItems;
|
|
35
|
+
var prefixCls = 'spec-image-preview';
|
|
36
|
+
var coreId = (0, _uniqueId.useUniqueId)(prefixCls);
|
|
37
|
+
var $outer = (0, _react.useRef)();
|
|
38
|
+
var _useState = (0, _react.useState)(false),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
showDelay = _useState2[0],
|
|
41
|
+
setShowDelay = _useState2[1];
|
|
42
|
+
var _useState3 = (0, _react.useState)(0),
|
|
43
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
+
thumbCurrent = _useState4[0],
|
|
45
|
+
setThumbCurrent = _useState4[1];
|
|
46
|
+
var _useState5 = (0, _react.useState)(0),
|
|
47
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
48
|
+
thumbSlidePrev = _useState6[0],
|
|
49
|
+
setThumbSlidePrev = _useState6[1];
|
|
50
|
+
var _useState7 = (0, _react.useState)(0),
|
|
51
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
52
|
+
thumbSlideNext = _useState8[0],
|
|
53
|
+
setThumbSlideNext = _useState8[1];
|
|
54
|
+
var galleryCount = (0, _react.useMemo)(function () {
|
|
55
|
+
if (galleryItems) {
|
|
56
|
+
return galleryItems.length;
|
|
57
|
+
}
|
|
58
|
+
return _react.default.Children.count(children);
|
|
59
|
+
}, [children, galleryItems]);
|
|
60
|
+
var onClickClose = function onClickClose() {
|
|
61
|
+
if (mode !== 'inline') {
|
|
62
|
+
setShowDelay(false);
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
65
|
+
}, 300);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
// 切换上下图片
|
|
69
|
+
var handleTurning = (0, _react.useCallback)(function (key, index) {
|
|
70
|
+
setThumbSlidePrev(thumbCurrent);
|
|
71
|
+
var newCurrent = 0;
|
|
72
|
+
if (key === 'prev') {
|
|
73
|
+
newCurrent = thumbCurrent === 0 ? galleryCount - 1 : thumbCurrent - 1;
|
|
74
|
+
}
|
|
75
|
+
if (key === 'next') {
|
|
76
|
+
newCurrent = thumbCurrent === galleryCount - 1 ? 0 : thumbCurrent + 1;
|
|
77
|
+
}
|
|
78
|
+
if (key === 'number') {
|
|
79
|
+
newCurrent = index;
|
|
80
|
+
}
|
|
81
|
+
setThumbCurrent(newCurrent);
|
|
82
|
+
setTimeout(function () {
|
|
83
|
+
setThumbSlideNext(newCurrent);
|
|
84
|
+
}, 50);
|
|
85
|
+
}, [galleryCount, thumbCurrent]);
|
|
86
|
+
// const enableThumbDrag =()=> {
|
|
87
|
+
// let thumbDragUtils: ThumbDragUtils = {
|
|
88
|
+
// cords: {
|
|
89
|
+
// startX: 0,
|
|
90
|
+
// endX: 0,
|
|
91
|
+
// },
|
|
92
|
+
// isMoved: false,
|
|
93
|
+
// newTranslateX: 0,
|
|
94
|
+
// startTime: new Date(),
|
|
95
|
+
// endTime: new Date(),
|
|
96
|
+
// touchMoveTime: 0,
|
|
97
|
+
// };
|
|
98
|
+
// if (thumbOuter.current) {
|
|
99
|
+
// thumbOuter.current.classList.add('spec-image-preview-grab')
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
(0, _react.useEffect)(function () {
|
|
103
|
+
if (mode === 'inline') {
|
|
104
|
+
setShowDelay(true);
|
|
105
|
+
} else {
|
|
106
|
+
if (open) {
|
|
107
|
+
setTimeout(function () {
|
|
108
|
+
setShowDelay(true);
|
|
109
|
+
}, delay);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return function () {};
|
|
113
|
+
}, [open, mode]);
|
|
114
|
+
(0, _react.useEffect)(function () {
|
|
115
|
+
if (mode === 'inline') {
|
|
116
|
+
setThumbCurrent(current || 0);
|
|
117
|
+
} else {
|
|
118
|
+
if (open) {
|
|
119
|
+
setThumbCurrent(current || 0);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}, [open, current, mode]);
|
|
123
|
+
// const componentClassName = 'spec-image-preview';
|
|
124
|
+
// const [wrapSSR, hashId] = useStyle(componentClassName);
|
|
125
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
+
id: coreId,
|
|
127
|
+
className: (0, _classnames.default)('spec-image-preview-container', mode === 'inline' ? 'spec-image-preview-inline' : '', mode === 'inline' || open ? 'spec-image-preview-show' : '', showDelay ? 'spec-image-preview-show-in' : '')
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
129
|
+
className: (0, _classnames.default)('spec-image-preview-backdrop', mode === 'inline' || showDelay ? 'in' : '')
|
|
130
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
131
|
+
className: (0, _classnames.default)('spec-image-preview-outer spec-image-preview-use-css3 spec-image-preview-css3 spec-image-preview-fade spec-image-preview-grab spec-image-preview-animate-thumb', showDelay ? 'spec-image-preview-components-open' : '', showDelay ? 'spec-image-preview-zoom-from-image' : ''),
|
|
132
|
+
ref: $outer
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_SliderContent.default, {
|
|
134
|
+
hasThumbnail: hasThumbnail && galleryCount > 1,
|
|
135
|
+
thumbCurrent: thumbCurrent,
|
|
136
|
+
onTurning: handleTurning,
|
|
137
|
+
thumbSlidePrev: thumbSlidePrev,
|
|
138
|
+
thumbSlideNext: thumbSlideNext,
|
|
139
|
+
coreId: coreId,
|
|
140
|
+
galleryCount: galleryCount,
|
|
141
|
+
outerRef: $outer,
|
|
142
|
+
onUpdateTurning: function onUpdateTurning(index) {
|
|
143
|
+
return handleTurning('number', index);
|
|
144
|
+
},
|
|
145
|
+
onClose: onClickClose
|
|
146
|
+
}, children), /*#__PURE__*/_react.default.createElement("div", {
|
|
147
|
+
className: 'spec-image-preview-toolbar'
|
|
148
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
+
className: 'spec-image-preview-counter'
|
|
150
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
151
|
+
className: 'spec-image-preview-counter-current'
|
|
152
|
+
}, thumbCurrent + 1), " /", /*#__PURE__*/_react.default.createElement("span", {
|
|
153
|
+
className: 'spec-image-preview-counter-all'
|
|
154
|
+
}, galleryCount)), mode === 'inline' ? null : /*#__PURE__*/_react.default.createElement("a", {
|
|
155
|
+
className: 'spec-image-preview-close spec-image-preview-icon',
|
|
156
|
+
onClick: onClickClose
|
|
157
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
158
|
+
className: (0, _classnames.default)('spec-image-preview-components')
|
|
159
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
160
|
+
className: 'spec-image-preview-sub-html'
|
|
161
|
+
}, _react.default.Children.map(children, function (item, index) {
|
|
162
|
+
if (thumbCurrent === index) {
|
|
163
|
+
// react16用法
|
|
164
|
+
return item.props['data-sub-html'] ? (0, _reactHtmlParser.default)(item.props['data-sub-html']) : null;
|
|
165
|
+
// react18用法
|
|
166
|
+
// return item.props['data-sub-html'] ? HtmlReactParse(item.props['data-sub-html']) : null
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
})), hasThumbnail && galleryCount > 1 && /*#__PURE__*/_react.default.createElement(_Thumbnail.default, {
|
|
170
|
+
galleryCount: galleryCount,
|
|
171
|
+
thumbCurrent: thumbCurrent,
|
|
172
|
+
coreId: coreId,
|
|
173
|
+
onClickThumbItem: function onClickThumbItem(key, index) {
|
|
174
|
+
return handleTurning(key, index);
|
|
175
|
+
}
|
|
176
|
+
}, children))));
|
|
177
|
+
};
|
|
178
|
+
var _default = exports.default = ImagePreview;
|