fan-standard-comp 3.1.9 → 3.2.0
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 +35 -0
- package/dist/fan-standard-comp.umd.js +15 -10
- package/es/ButtonGroup/ButtonList.js +0 -3
- package/es/ButtonGroup/ButtonMenu.js +0 -3
- package/es/ButtonGroup/PopConfirmTitle.js +5 -15
- package/es/ButtonGroup/index.d.ts +2 -0
- package/es/ButtonGroup/index.js +223 -193
- package/es/ButtonGroup/style/index.less +1 -1
- package/es/DragContent/DragBar.js +2 -6
- package/es/DragContent/index.js +44 -75
- package/es/FormComp/ChunkUploader/api.js +6 -10
- package/es/FormComp/ChunkUploader/index.js +105 -171
- package/es/FormComp/ChunkUploader/lib.js +4 -17
- package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
- package/es/FormComp/ChunkUploader/worker.js +0 -3
- package/es/FormComp/EditButton/index.js +24 -49
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +37 -75
- package/es/FormComp/FieldComponent/TitleNode.js +1 -3
- package/es/FormComp/FieldComponent/index.js +38 -74
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
- package/es/FormComp/FieldComponent/style/index.less +6 -0
- package/es/FormComp/RenderItemGroup/index.js +46 -74
- package/es/FormComp/Uploader/index.js +36 -77
- package/es/FormComp/Uploader/util.js +0 -6
- package/es/FormComp/VarTemplate/index.js +58 -96
- package/es/NavLeafScroll/index.js +172 -154
- package/es/NavLeafScroll/style/index.less +33 -1
- package/es/RefactorTree/index.js +36 -53
- package/es/RefactorTree/indexTreeNode.js +35 -68
- package/es/RefactorTree/util.js +9 -43
- package/es/SpecIcon/fonts/iconfont.js +7 -12
- package/es/SpecIcon/index.js +16 -25
- package/es/SplitterLayout/Pane.js +2 -5
- package/es/SplitterLayout/index.js +20 -70
- package/es/StandardContent/SplitterLayout/Pane.js +6 -10
- package/es/StandardContent/SplitterLayout/index.js +12 -63
- package/es/StandardContent/SubfieldContent.js +12 -14
- package/es/StandardContent/WrapperContent.js +8 -10
- package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/es/StandardDragModal/ChangeStandardModal.js +493 -0
- package/es/StandardDragModal/DraggableModal.d.ts +7 -0
- package/es/StandardDragModal/DraggableModal.js +31 -0
- package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/es/StandardDragModal/DraggableModalContext.js +5 -0
- package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/es/StandardDragModal/DraggableModalInner.js +114 -0
- package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/es/StandardDragModal/DraggableModalProvider.js +40 -0
- package/es/StandardDragModal/Modal.d.ts +11 -0
- package/es/StandardDragModal/Modal.js +24 -0
- package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/es/StandardDragModal/ResizeHandle.js +8 -0
- package/es/StandardDragModal/clamp.d.ts +1 -0
- package/es/StandardDragModal/clamp.js +3 -0
- package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/es/StandardDragModal/draggableModalReducer.js +157 -0
- package/es/StandardDragModal/getWindowSize.d.ts +4 -0
- package/es/StandardDragModal/getWindowSize.js +6 -0
- package/es/StandardDragModal/index.d.ts +3 -11
- package/es/StandardDragModal/index.js +3 -30
- package/es/StandardDragModal/index.less +65 -0
- package/es/StandardDragModal/useDrag.d.ts +5 -0
- package/es/StandardDragModal/useDrag.js +66 -0
- package/es/StandardDragModal/usePrevious.d.ts +1 -0
- package/es/StandardDragModal/usePrevious.js +8 -0
- package/es/StandardDragModal/useResize.d.ts +7 -0
- package/es/StandardDragModal/useResize.js +74 -0
- package/es/StandardFilter/index.d.ts +1 -0
- package/es/StandardFilter/index.js +32 -70
- package/es/StandardForm/ActionList.js +5 -7
- package/es/StandardForm/StepForm.js +50 -71
- package/es/StandardForm/TabForm.js +58 -70
- package/es/StandardForm/index.js +37 -56
- package/es/StandardModal/UpdateFormRef.js +1 -4
- package/es/StandardModal/index.d.ts +0 -1
- package/es/StandardModal/index.js +115 -159
- package/es/StandardPanel/index.js +19 -35
- package/es/StandardTable/index.js +20 -30
- package/es/components/IconNode/index.js +0 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +15 -14
- package/es/utils/ValueFormat.js +0 -9
- package/es/utils/dictSelectUtil.js +153 -0
- package/es/utils/filterPermission.js +16 -34
- package/es/utils/getParentNodes.js +24 -47
- package/es/utils/index.js +2 -1
- package/lib/ButtonGroup/ButtonList.js +1 -13
- package/lib/ButtonGroup/ButtonMenu.js +1 -8
- package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
- package/lib/ButtonGroup/index.d.ts +2 -0
- package/lib/ButtonGroup/index.js +226 -216
- package/lib/ButtonGroup/style/index.less +1 -1
- package/lib/DragContent/DragBar.js +2 -10
- package/lib/DragContent/index.js +47 -85
- package/lib/FormComp/ChunkUploader/api.js +6 -15
- package/lib/FormComp/ChunkUploader/index.js +107 -185
- package/lib/FormComp/ChunkUploader/lib.js +8 -27
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
- package/lib/FormComp/ChunkUploader/worker.js +1 -5
- package/lib/FormComp/EditButton/index.js +26 -60
- package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +39 -90
- package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
- package/lib/FormComp/FieldComponent/index.js +38 -110
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
- package/lib/FormComp/FieldComponent/style/index.less +6 -0
- package/lib/FormComp/RenderItemGroup/index.js +46 -87
- package/lib/FormComp/Uploader/index.js +38 -95
- package/lib/FormComp/Uploader/util.js +1 -9
- package/lib/FormComp/VarTemplate/index.js +62 -106
- package/lib/FormComp/index.js +0 -2
- package/lib/NavLeafScroll/index.js +174 -165
- package/lib/NavLeafScroll/style/index.less +33 -1
- package/lib/RefactorTree/index.js +36 -67
- package/lib/RefactorTree/indexTreeNode.js +37 -83
- package/lib/RefactorTree/util.js +11 -45
- package/lib/SpecIcon/fonts/iconfont.js +7 -12
- package/lib/SpecIcon/index.js +16 -30
- package/lib/SplitterLayout/Pane.js +0 -7
- package/lib/SplitterLayout/index.js +18 -72
- package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
- package/lib/StandardContent/SplitterLayout/index.js +12 -68
- package/lib/StandardContent/SubfieldContent.js +12 -21
- package/lib/StandardContent/WrapperContent.js +8 -16
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
- package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
- package/lib/StandardDragModal/DraggableModal.js +40 -0
- package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/lib/StandardDragModal/DraggableModalContext.js +15 -0
- package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/lib/StandardDragModal/DraggableModalInner.js +124 -0
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
- package/lib/StandardDragModal/Modal.d.ts +11 -0
- package/lib/StandardDragModal/Modal.js +32 -0
- package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/lib/StandardDragModal/ResizeHandle.js +18 -0
- package/lib/StandardDragModal/clamp.d.ts +1 -0
- package/lib/StandardDragModal/clamp.js +10 -0
- package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/lib/StandardDragModal/draggableModalReducer.js +167 -0
- package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
- package/lib/StandardDragModal/getWindowSize.js +13 -0
- package/lib/StandardDragModal/index.d.ts +3 -11
- package/lib/StandardDragModal/index.js +33 -38
- package/lib/StandardDragModal/index.less +65 -0
- package/lib/StandardDragModal/useDrag.d.ts +5 -0
- package/lib/StandardDragModal/useDrag.js +73 -0
- package/lib/StandardDragModal/usePrevious.d.ts +1 -0
- package/lib/StandardDragModal/usePrevious.js +15 -0
- package/lib/StandardDragModal/useResize.d.ts +7 -0
- package/lib/StandardDragModal/useResize.js +81 -0
- package/lib/StandardFilter/index.d.ts +1 -0
- package/lib/StandardFilter/index.js +30 -78
- package/lib/StandardForm/ActionList.js +5 -12
- package/lib/StandardForm/StepForm.js +52 -90
- package/lib/StandardForm/TabForm.js +61 -88
- package/lib/StandardForm/index.js +40 -75
- package/lib/StandardModal/UpdateFormRef.js +4 -12
- package/lib/StandardModal/index.d.ts +0 -1
- package/lib/StandardModal/index.js +117 -184
- package/lib/StandardPanel/index.js +22 -48
- package/lib/StandardTable/index.js +20 -39
- package/lib/components/IconNode/index.js +0 -7
- package/lib/components/index.js +0 -2
- package/lib/data/index.js +4 -7
- package/lib/index.d.ts +1 -0
- package/lib/index.js +50 -68
- package/lib/utils/ValueFormat.js +0 -10
- package/lib/utils/dictSelectUtil.js +161 -0
- package/lib/utils/filterPermission.js +15 -39
- package/lib/utils/getParentNodes.js +25 -52
- package/lib/utils/index.js +24 -9
- package/package.json +6 -5
|
@@ -1,197 +1,190 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
require("antd/es/badge/style");
|
|
11
|
-
|
|
12
8
|
var _badge = _interopRequireDefault(require("antd/es/badge"));
|
|
13
|
-
|
|
14
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
10
|
var _index = _interopRequireDefault(require("../SpecIcon/index"));
|
|
17
|
-
|
|
18
11
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
19
|
-
|
|
20
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
13
|
require("./style/index.less");
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
17
|
+
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); }
|
|
30
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
|
-
|
|
38
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
39
|
-
|
|
19
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
40
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
41
|
-
|
|
42
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
43
|
-
|
|
24
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
44
25
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
51
|
-
|
|
26
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
28
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
30
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // @ts-ignore
|
|
52
31
|
var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
53
32
|
_inherits(NavLeafScroll, _Component);
|
|
54
|
-
|
|
55
33
|
var _super = _createSuper(NavLeafScroll);
|
|
56
|
-
|
|
57
34
|
function NavLeafScroll(props) {
|
|
58
35
|
var _this;
|
|
59
|
-
|
|
60
36
|
_classCallCheck(this, NavLeafScroll);
|
|
61
|
-
|
|
62
37
|
_this = _super.call(this, props);
|
|
63
|
-
|
|
64
38
|
_defineProperty(_assertThisInitialized(_this), "initFloorValues", function () {
|
|
65
39
|
var _this$props = _this.props,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
40
|
+
baseItemHeight = _this$props.baseItemHeight,
|
|
41
|
+
baseItemWidth = _this$props.baseItemWidth,
|
|
42
|
+
activeKey = _this$props.activeKey,
|
|
43
|
+
navList = _this$props.navList,
|
|
44
|
+
_this$props$optionNam = _this$props.optionName,
|
|
45
|
+
optionName = _this$props$optionNam === void 0 ? {
|
|
46
|
+
key: 'id',
|
|
47
|
+
title: 'title',
|
|
48
|
+
count: 'count'
|
|
49
|
+
} : _this$props$optionNam,
|
|
50
|
+
type = _this$props.type; // 元素个数占用的高度是否不超过内容区域
|
|
76
51
|
var isInsideEnough = navList.length * baseItemHeight <= _this.mainWrap.current.clientHeight;
|
|
77
52
|
var wrapHeight = _this.mainWrap.current.clientHeight - (isInsideEnough ? 0 : 32 * 2); // 每次需要移动的偏移量 32是上下切换角占用的高度
|
|
78
|
-
|
|
79
53
|
var floorHeight = _this.leafNav.current.clientHeight; // 所有楼层占用的高度
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
54
|
+
// const isEnough = wrapHeight % baseItemHeight === 0; // 剩余的是否足够容纳一个单元格
|
|
55
|
+
var isInsideEnoughWidth = navList.length * baseItemWidth <= _this.mainWrap.current.clientWidth;
|
|
56
|
+
var wrapWidth = _this.mainWrap.current.clientWidth - (isInsideEnoughWidth ? 0 : 30 * 2);
|
|
57
|
+
var floorWidth = _this.leafNav.current.clientWidth; // 所有楼层占用的宽度
|
|
58
|
+
if (type === 'horizontal') {
|
|
59
|
+
// 判断有效区域与单元格高度:若小于,则直接使用单元格高度,否则将内容区高度去除不足一个单元格高度
|
|
60
|
+
if (_this.mainWrap.current.clientWidth - (isInsideEnoughWidth ? 0 : 30 * 2) >= baseItemWidth) {
|
|
61
|
+
wrapWidth -= wrapWidth % baseItemWidth; // 判断是否除不尽,如果还有余数,则当前 区域有效区域要去除一个单元格的高度
|
|
62
|
+
} else {
|
|
63
|
+
wrapWidth = baseItemWidth;
|
|
64
|
+
}
|
|
86
65
|
} else {
|
|
87
|
-
|
|
66
|
+
// 判断有效区域与单元格高度:若小于,则直接使用单元格高度,否则将内容区高度去除不足一个单元格高度
|
|
67
|
+
if (_this.mainWrap.current.clientHeight - (isInsideEnough ? 0 : 32 * 2) >= baseItemHeight) {
|
|
68
|
+
wrapHeight -= wrapHeight % baseItemHeight; // 判断是否除不尽,如果还有余数,则当前 区域有效区域要去除一个单元格的高度
|
|
69
|
+
} else {
|
|
70
|
+
wrapHeight = baseItemHeight;
|
|
71
|
+
}
|
|
88
72
|
}
|
|
89
|
-
|
|
90
|
-
var stepSize = wrapHeight / baseItemHeight; // - (isEnough ? 0 : 1) // 当前一页可容纳的单元格数量
|
|
91
|
-
|
|
73
|
+
var stepSize = type === 'horizontal' ? wrapWidth / baseItemWidth : wrapHeight / baseItemHeight; // - (isEnough ? 0 : 1) // 当前一页可容纳的单元格数量
|
|
92
74
|
_this.setState({
|
|
93
75
|
floorRelatedSize: {
|
|
94
76
|
wrapHeight: wrapHeight,
|
|
95
77
|
// 有效内容区域的
|
|
96
|
-
floorHeight: floorHeight
|
|
97
|
-
|
|
78
|
+
floorHeight: floorHeight,
|
|
79
|
+
// 楼层列表占用的高度
|
|
80
|
+
wrapWidth: wrapWidth,
|
|
81
|
+
floorWidth: floorWidth
|
|
98
82
|
},
|
|
99
83
|
stepSize: stepSize,
|
|
100
|
-
showArrow: floorHeight > wrapHeight
|
|
84
|
+
showArrow: type === 'horizontal' ? isInsideEnoughWidth ? false : floorWidth > wrapWidth : isInsideEnough ? false : floorHeight > wrapHeight
|
|
101
85
|
});
|
|
102
|
-
|
|
103
86
|
if (activeKey && navList.length > 0) {
|
|
104
87
|
var matchIndex = _lodash.default.findIndex(navList, function (item) {
|
|
105
88
|
return item[(optionName === null || optionName === void 0 ? void 0 : optionName.key) || 'id'] === activeKey;
|
|
106
89
|
});
|
|
107
|
-
|
|
108
|
-
var stepNo = wrapHeight === 0 ? 0 : Math.floor(matchIndex / (wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
109
|
-
|
|
90
|
+
var stepNo = type === 'horizontal' ? wrapWidth === 0 ? 0 : Math.floor(matchIndex / (wrapWidth / baseItemWidth)) : wrapHeight === 0 ? 0 : Math.floor(matchIndex / (wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
110
91
|
var stepTotalSize = Math.ceil(navList.length / stepSize) || 0; // 当前所有单元格占用的页总数
|
|
111
|
-
|
|
112
92
|
_this.setState({
|
|
93
|
+
leafNavScrollX: matchIndex !== -1 && stepNo !== 0 ? -wrapWidth * stepNo : 0,
|
|
113
94
|
leafNavScrollY: matchIndex !== -1 && stepNo !== 0 ? -wrapHeight * stepNo : 0,
|
|
114
95
|
// 如果当前默认传值有楼层节点,则需要判断其所在的位置
|
|
115
96
|
arrowPermit: {
|
|
116
97
|
prev: matchIndex !== -1 && stepNo !== 0,
|
|
117
|
-
|
|
98
|
+
left: matchIndex !== -1 && stepNo !== 0,
|
|
99
|
+
next: floorHeight > wrapHeight && stepNo + 1 !== stepTotalSize,
|
|
100
|
+
right: floorWidth > wrapWidth && stepNo + 1 !== stepTotalSize
|
|
118
101
|
}
|
|
119
102
|
});
|
|
120
103
|
} else {
|
|
121
104
|
_this.setState({
|
|
105
|
+
leafNavScrollX: 0,
|
|
122
106
|
leafNavScrollY: 0,
|
|
123
107
|
arrowPermit: {
|
|
124
108
|
prev: false,
|
|
125
|
-
|
|
109
|
+
left: false,
|
|
110
|
+
next: floorHeight > wrapHeight,
|
|
111
|
+
right: floorWidth > wrapWidth
|
|
126
112
|
}
|
|
127
113
|
});
|
|
128
114
|
}
|
|
129
115
|
});
|
|
130
|
-
|
|
131
|
-
|
|
116
|
+
_defineProperty(_assertThisInitialized(_this), "handleLeafControl", function (method) {
|
|
117
|
+
var type = _this.props.type;
|
|
132
118
|
var _this$state = _this.state,
|
|
133
|
-
|
|
134
|
-
|
|
119
|
+
floorRelatedSize = _this$state.floorRelatedSize,
|
|
120
|
+
leafNavScrollY = _this$state.leafNavScrollY,
|
|
121
|
+
leafNavScrollX = _this$state.leafNavScrollX;
|
|
135
122
|
var wrapHeight = floorRelatedSize.wrapHeight,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
123
|
+
floorHeight = floorRelatedSize.floorHeight,
|
|
124
|
+
wrapWidth = floorRelatedSize.wrapWidth,
|
|
125
|
+
floorWidth = floorRelatedSize.floorWidth;
|
|
126
|
+
if (type === 'horizontal') {
|
|
127
|
+
var maxNextPosition = -(wrapWidth * (Math.ceil(floorWidth / wrapWidth) - 1)); // 向右滚动的最大值
|
|
128
|
+
var scrollX = method === 'right' ? leafNavScrollX - wrapWidth : leafNavScrollX + wrapWidth;
|
|
129
|
+
_this.setState({
|
|
130
|
+
arrowPermit: {
|
|
131
|
+
left: method === 'left' ? scrollX !== 0 : true,
|
|
132
|
+
right: method === 'left' ? true : scrollX !== maxNextPosition // 滚动大小与最大滚动值一致时,向右滚动禁用,
|
|
133
|
+
},
|
|
140
134
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
leafNavScrollX: scrollX
|
|
136
|
+
});
|
|
137
|
+
} else {
|
|
138
|
+
var _maxNextPosition = -(wrapHeight * (Math.ceil(floorHeight / wrapHeight) - 1)); // 向下滚动的最大值
|
|
139
|
+
var scrollY = method === 'next' ? leafNavScrollY - wrapHeight : leafNavScrollY + wrapHeight;
|
|
140
|
+
_this.setState({
|
|
141
|
+
arrowPermit: {
|
|
142
|
+
prev: method === 'prev' ? scrollY !== 0 : true,
|
|
143
|
+
next: method === 'prev' ? true : scrollY !== _maxNextPosition // 滚动大小与最大滚动值一致时,向下滚动禁用,
|
|
144
|
+
},
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
146
|
+
leafNavScrollY: scrollY
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
149
|
});
|
|
150
|
-
|
|
151
150
|
_defineProperty(_assertThisInitialized(_this), "handleItemControl", function (key, data) {
|
|
152
151
|
var onClick = _this.props.onClick;
|
|
153
152
|
onClick && onClick(key, data);
|
|
154
153
|
});
|
|
155
|
-
|
|
156
154
|
_defineProperty(_assertThisInitialized(_this), "mouseEnter", function (e) {
|
|
157
155
|
var onMouseEnter = _this.props.onMouseEnter;
|
|
158
|
-
|
|
159
156
|
_this.setState({
|
|
160
157
|
isMouseEnter: true
|
|
161
158
|
});
|
|
162
|
-
|
|
163
159
|
onMouseEnter && onMouseEnter(e);
|
|
164
160
|
});
|
|
165
|
-
|
|
166
161
|
_defineProperty(_assertThisInitialized(_this), "mouseLeave", function (e) {
|
|
167
162
|
var onMouseLeave = _this.props.onMouseLeave;
|
|
168
|
-
|
|
169
163
|
_this.setState({
|
|
170
164
|
isMouseEnter: false
|
|
171
165
|
});
|
|
172
|
-
|
|
173
166
|
onMouseLeave && onMouseLeave(e);
|
|
174
167
|
});
|
|
175
|
-
|
|
176
168
|
_defineProperty(_assertThisInitialized(_this), "mouseWheel", function (e) {
|
|
169
|
+
var type = _this.props.type;
|
|
177
170
|
var _this$state2 = _this.state,
|
|
178
|
-
|
|
179
|
-
|
|
171
|
+
isMouseEnter = _this$state2.isMouseEnter,
|
|
172
|
+
arrowPermit = _this$state2.arrowPermit;
|
|
180
173
|
if (!isMouseEnter) return; // 鼠标没有经过内容区域,则不会滚轮监听
|
|
181
|
-
|
|
182
174
|
e.preventDefault();
|
|
183
|
-
|
|
184
175
|
if (e.deltaY <= 0) {
|
|
185
|
-
|
|
176
|
+
// 向上滚动(向左滚动)
|
|
177
|
+
type === 'horizontal' ? arrowPermit.left && _this.handleLeafControl('left') : arrowPermit.prev && _this.handleLeafControl('prev');
|
|
186
178
|
} else {
|
|
187
|
-
arrowPermit.next && _this.handleLeafControl('next'); // 向下滚动
|
|
188
|
-
}
|
|
189
|
-
|
|
179
|
+
type === 'horizontal' ? arrowPermit.right && _this.handleLeafControl('right') : arrowPermit.next && _this.handleLeafControl('next'); // 向下滚动(向右滚动)
|
|
180
|
+
}
|
|
190
181
|
});
|
|
191
|
-
|
|
192
182
|
_this.state = {
|
|
193
183
|
isMouseEnter: false,
|
|
184
|
+
leafNavScrollX: 0,
|
|
185
|
+
// 水平滚动区域
|
|
194
186
|
leafNavScrollY: 0,
|
|
187
|
+
// 垂直滚动区域
|
|
195
188
|
showArrow: false,
|
|
196
189
|
arrowPermit: {
|
|
197
190
|
prev: false,
|
|
@@ -201,31 +194,28 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
201
194
|
wrapHeight: 0,
|
|
202
195
|
// 有效内容区域的
|
|
203
196
|
floorHeight: 0 // 楼层列表占用的高度
|
|
204
|
-
|
|
205
197
|
},
|
|
206
|
-
stepSize: 0 // 当前一页可容纳的单元格数量
|
|
207
198
|
|
|
199
|
+
stepSize: 0 // 当前一页可容纳的单元格数量
|
|
208
200
|
};
|
|
201
|
+
|
|
209
202
|
_this.mainWrap = /*#__PURE__*/_react.default.createRef();
|
|
210
203
|
_this.leafWrap = /*#__PURE__*/_react.default.createRef();
|
|
211
204
|
_this.leafNav = /*#__PURE__*/_react.default.createRef();
|
|
212
205
|
_this.initFloorValues = _this.initFloorValues.bind(_assertThisInitialized(_this));
|
|
213
206
|
return _this;
|
|
214
207
|
}
|
|
215
|
-
|
|
216
208
|
_createClass(NavLeafScroll, [{
|
|
217
209
|
key: "componentDidMount",
|
|
218
210
|
value: function componentDidMount() {
|
|
219
211
|
var forbidScroll = this.props.forbidScroll;
|
|
220
212
|
window.addEventListener('resize', this.initFloorValues);
|
|
221
|
-
|
|
222
213
|
if (!forbidScroll) {
|
|
223
214
|
// 禁用时,不启动滚动监听
|
|
224
215
|
this.mainWrap.current.addEventListener('wheel', this.mouseWheel, {
|
|
225
216
|
passive: false
|
|
226
217
|
});
|
|
227
218
|
}
|
|
228
|
-
|
|
229
219
|
this.initFloorValues();
|
|
230
220
|
}
|
|
231
221
|
}, {
|
|
@@ -233,40 +223,41 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
233
223
|
value: function componentWillUnmount() {
|
|
234
224
|
var forbidScroll = this.props.forbidScroll;
|
|
235
225
|
window.removeEventListener('resize', this.initFloorValues);
|
|
236
|
-
|
|
237
226
|
if (!forbidScroll) {
|
|
238
227
|
// 禁用时,不启动滚动监听
|
|
239
228
|
this.mainWrap.current.addEventListener('wheel', this.mouseWheel, {
|
|
240
229
|
passive: false
|
|
241
230
|
});
|
|
242
231
|
}
|
|
243
|
-
|
|
244
232
|
this.mainWrap.current.removeEventListener('wheel', this.mouseWheel);
|
|
245
233
|
}
|
|
246
234
|
}, {
|
|
247
235
|
key: "componentDidUpdate",
|
|
248
236
|
value: function componentDidUpdate(prevProps) {
|
|
249
237
|
var _this$props2 = this.props,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
238
|
+
baseItemHeight = _this$props2.baseItemHeight,
|
|
239
|
+
baseItemWidth = _this$props2.baseItemWidth,
|
|
240
|
+
type = _this$props2.type,
|
|
241
|
+
navList = _this$props2.navList,
|
|
242
|
+
activeKey = _this$props2.activeKey,
|
|
243
|
+
_this$props2$optionNa = _this$props2.optionName,
|
|
244
|
+
optionName = _this$props2$optionNa === void 0 ? {
|
|
245
|
+
key: 'id',
|
|
246
|
+
title: 'title',
|
|
247
|
+
count: 'count'
|
|
248
|
+
} : _this$props2$optionNa,
|
|
249
|
+
forbidScroll = _this$props2.forbidScroll;
|
|
260
250
|
var _this$state3 = this.state,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
251
|
+
_this$state3$floorRel = _this$state3.floorRelatedSize,
|
|
252
|
+
wrapHeight = _this$state3$floorRel.wrapHeight,
|
|
253
|
+
floorHeight = _this$state3$floorRel.floorHeight,
|
|
254
|
+
wrapWidth = _this$state3$floorRel.wrapWidth,
|
|
255
|
+
floorWidth = _this$state3$floorRel.floorWidth,
|
|
256
|
+
stepSize = _this$state3.stepSize;
|
|
257
|
+
if (type === 'horizontal') {}
|
|
258
|
+
if (JSON.stringify(navList) !== JSON.stringify(prevProps.navList) || (type === 'horizontal' ? baseItemWidth !== prevProps.baseItemWidth : baseItemHeight !== prevProps.baseItemHeight)) {
|
|
267
259
|
this.initFloorValues();
|
|
268
260
|
}
|
|
269
|
-
|
|
270
261
|
if (forbidScroll !== prevProps.forbidScroll) {
|
|
271
262
|
// 禁用时,不启动滚动监听
|
|
272
263
|
if (!forbidScroll) {
|
|
@@ -278,58 +269,63 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
278
269
|
this.mainWrap.current.removeEventListener('wheel', this.mouseWheel);
|
|
279
270
|
}
|
|
280
271
|
}
|
|
281
|
-
|
|
282
272
|
if (activeKey !== prevProps.activeKey) {
|
|
283
273
|
var matchIndex = _lodash.default.findIndex(navList, function (item) {
|
|
284
274
|
return item[optionName.key] === activeKey;
|
|
285
275
|
});
|
|
286
|
-
|
|
287
|
-
var stepNo = Math.floor(matchIndex / (wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
288
|
-
|
|
276
|
+
var stepNo = Math.floor(matchIndex / (type === 'horizontal' ? wrapWidth / baseItemWidth : wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
289
277
|
var stepTotalSize = Array.isArray(navList) && Math.ceil(navList.length / stepSize) || 0; // 当前所有单元格占用的页总数
|
|
290
|
-
|
|
278
|
+
console.log('stepTotalSize', stepTotalSize);
|
|
291
279
|
this.setState({
|
|
280
|
+
leafNavScrollX: matchIndex !== -1 && stepNo !== 0 ? -wrapWidth * stepNo : 0,
|
|
292
281
|
leafNavScrollY: matchIndex !== -1 && stepNo !== 0 ? -wrapHeight * stepNo : 0,
|
|
293
282
|
// 如果当前默认传值有楼层节点,则需要判断其所在的位置
|
|
294
283
|
arrowPermit: {
|
|
295
284
|
prev: matchIndex !== -1 && stepNo !== 0,
|
|
296
|
-
next: floorHeight > wrapHeight && stepNo + 1 !== stepTotalSize
|
|
285
|
+
next: floorHeight > wrapHeight && stepNo + 1 !== stepTotalSize,
|
|
286
|
+
left: matchIndex !== -1 && stepNo !== 0,
|
|
287
|
+
right: floorWidth > wrapWidth && stepNo + 1 !== stepTotalSize
|
|
297
288
|
},
|
|
298
289
|
isMouseEnter: true
|
|
299
290
|
});
|
|
300
291
|
}
|
|
301
292
|
} // 初始化楼层相关的值,如:是否允许触发滚动,默认滚动区间高度等
|
|
302
|
-
|
|
293
|
+
// 点击节点事件
|
|
294
|
+
// 鼠标滚轮监听
|
|
303
295
|
}, {
|
|
304
296
|
key: "render",
|
|
305
297
|
value: function render() {
|
|
306
298
|
var _this2 = this;
|
|
307
|
-
|
|
308
299
|
var _this$props3 = this.props,
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
300
|
+
className = _this$props3.className,
|
|
301
|
+
width = _this$props3.width,
|
|
302
|
+
activeKey = _this$props3.activeKey,
|
|
303
|
+
customLeafNode = _this$props3.customLeafNode,
|
|
304
|
+
noArrowPadding = _this$props3.noArrowPadding,
|
|
305
|
+
navList = _this$props3.navList,
|
|
306
|
+
_this$props3$optionNa = _this$props3.optionName,
|
|
307
|
+
optionName = _this$props3$optionNa === void 0 ? {
|
|
308
|
+
key: 'id',
|
|
309
|
+
title: 'title',
|
|
310
|
+
count: 'count'
|
|
311
|
+
} : _this$props3$optionNa,
|
|
312
|
+
_this$props3$emptyNod = _this$props3.emptyNode,
|
|
313
|
+
emptyNode = _this$props3$emptyNod === void 0 ? null : _this$props3$emptyNod,
|
|
314
|
+
type = _this$props3.type,
|
|
315
|
+
height = _this$props3.height;
|
|
323
316
|
var _this$state4 = this.state,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
317
|
+
showArrow = _this$state4.showArrow,
|
|
318
|
+
arrowPermit = _this$state4.arrowPermit,
|
|
319
|
+
leafNavScrollY = _this$state4.leafNavScrollY,
|
|
320
|
+
leafNavScrollX = _this$state4.leafNavScrollX;
|
|
327
321
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
328
|
-
className: (0, _classnames.default)(className, "nav-leaf"),
|
|
329
|
-
style:
|
|
330
|
-
width: "".concat(width, "px")
|
|
331
|
-
|
|
332
|
-
|
|
322
|
+
className: (0, _classnames.default)(className, "nav-leaf", type === 'horizontal' ? 'nav-leaf-horizontal' : ''),
|
|
323
|
+
style: {
|
|
324
|
+
width: width ? "".concat(width, "px") : '',
|
|
325
|
+
height: height ? "".concat(height, "px") : ''
|
|
326
|
+
},
|
|
327
|
+
ref: this.mainWrap
|
|
328
|
+
// onWheel={this.mouseWheel}
|
|
333
329
|
,
|
|
334
330
|
onMouseEnter: this.mouseEnter,
|
|
335
331
|
onMouseLeave: this.mouseLeave
|
|
@@ -339,7 +335,21 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
339
335
|
padding: 0
|
|
340
336
|
} : {},
|
|
341
337
|
"data-prev": showArrow
|
|
342
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
338
|
+
}, type === 'horizontal' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
339
|
+
className: (0, _classnames.default)("nav-leaf-arrow nav-leaf-btn-left", showArrow ? '' : 'is-hide', arrowPermit.left ? '' : 'is-disabled'),
|
|
340
|
+
onClick: function onClick() {
|
|
341
|
+
return arrowPermit.left ? _this2.handleLeafControl('left') : '';
|
|
342
|
+
}
|
|
343
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
344
|
+
name: "caret-left"
|
|
345
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
346
|
+
className: (0, _classnames.default)("nav-leaf-arrow nav-leaf-btn-right", showArrow ? '' : 'is-hide', arrowPermit.right ? '' : 'is-disabled'),
|
|
347
|
+
onClick: function onClick() {
|
|
348
|
+
return arrowPermit.right ? _this2.handleLeafControl('right') : '';
|
|
349
|
+
}
|
|
350
|
+
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
351
|
+
name: "caret-right"
|
|
352
|
+
}))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
343
353
|
className: (0, _classnames.default)("nav-leaf-arrow nav-leaf-btn-prev", showArrow ? '' : 'is-hide', arrowPermit.prev ? '' : 'is-disabled'),
|
|
344
354
|
onClick: function onClick() {
|
|
345
355
|
return arrowPermit.prev ? _this2.handleLeafControl('prev') : '';
|
|
@@ -353,7 +363,7 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
353
363
|
}
|
|
354
364
|
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
355
365
|
name: "caret-down"
|
|
356
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
366
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
357
367
|
className: "nav-leaf-wrap",
|
|
358
368
|
ref: this.leafWrap
|
|
359
369
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -362,16 +372,17 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
362
372
|
className: "nav-leaf-nav",
|
|
363
373
|
ref: this.leafNav,
|
|
364
374
|
style: {
|
|
365
|
-
transform: "translate3d(
|
|
375
|
+
transform: "translate3d(".concat(type === 'horizontal' ? leafNavScrollX : 0, "px, ").concat(type === 'horizontal' ? 0 : leafNavScrollY, "px, 0px)")
|
|
366
376
|
}
|
|
367
377
|
}, navList && navList.length > 0 ? navList.map(function (item, i) {
|
|
368
|
-
var _this2$props;
|
|
369
|
-
|
|
378
|
+
var _this2$props, _this2$props2;
|
|
370
379
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
371
380
|
key: item[optionName.key],
|
|
372
381
|
className: (0, _classnames.default)('nav-leaf-item', activeKey && activeKey === item[optionName.key] ? 'is-active' : ''),
|
|
373
|
-
style: {
|
|
374
|
-
|
|
382
|
+
style: type === 'horizontal' ? {
|
|
383
|
+
width: "".concat(((_this2$props = _this2.props) === null || _this2$props === void 0 ? void 0 : _this2$props.baseItemWidth) || 60, "px")
|
|
384
|
+
} : {
|
|
385
|
+
height: "".concat(((_this2$props2 = _this2.props) === null || _this2$props2 === void 0 ? void 0 : _this2$props2.baseItemHeight) || 40, "px")
|
|
375
386
|
},
|
|
376
387
|
onClick: function onClick() {
|
|
377
388
|
return _this2.handleItemControl(item[optionName.key], item);
|
|
@@ -389,9 +400,7 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
389
400
|
}) : emptyNode)))));
|
|
390
401
|
}
|
|
391
402
|
}]);
|
|
392
|
-
|
|
393
403
|
return NavLeafScroll;
|
|
394
404
|
}(_react.Component);
|
|
395
|
-
|
|
396
405
|
var _default = NavLeafScroll;
|
|
397
406
|
exports.default = _default;
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
.nav-leaf {
|
|
5
5
|
width: 110px;
|
|
6
6
|
height: 100%;
|
|
7
|
+
&.nav-leaf-horizontal {
|
|
8
|
+
width: 100%;
|
|
9
|
+
.nav-leaf-container.nav-leaf-container-scroll {
|
|
10
|
+
padding: 0 30px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
7
13
|
//.nav-leaf-container {
|
|
8
14
|
// height: ~'calc(100vh - @{nav-header-height})';
|
|
9
15
|
//}
|
|
@@ -31,6 +37,17 @@
|
|
|
31
37
|
height: 100%;
|
|
32
38
|
overflow: hidden;
|
|
33
39
|
}
|
|
40
|
+
&.nav-leaf-horizontal {
|
|
41
|
+
.nav-leaf-item {
|
|
42
|
+
display: inline-block;
|
|
43
|
+
text-align: center;
|
|
44
|
+
border-top-right-radius: 20px;
|
|
45
|
+
border-bottom-right-radius: 20px;
|
|
46
|
+
}
|
|
47
|
+
.nav-leaf-nav {
|
|
48
|
+
width: inherit;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
34
51
|
.nav-leaf-nav {
|
|
35
52
|
position: relative;
|
|
36
53
|
display: inline-block;
|
|
@@ -42,7 +59,6 @@
|
|
|
42
59
|
}
|
|
43
60
|
.nav-leaf-arrow {
|
|
44
61
|
position: absolute;
|
|
45
|
-
left: 0;
|
|
46
62
|
width: 100%;
|
|
47
63
|
height: 32px;
|
|
48
64
|
color: @text-color;
|
|
@@ -58,11 +74,27 @@
|
|
|
58
74
|
color: fade(@primary-color, 30%) !important;
|
|
59
75
|
cursor: not-allowed !important;
|
|
60
76
|
}
|
|
77
|
+
&.nav-leaf-btn-left {
|
|
78
|
+
width: 30px;
|
|
79
|
+
height: auto;
|
|
80
|
+
top: 50%;
|
|
81
|
+
left: 0;
|
|
82
|
+
transform: translateY(-50%);
|
|
83
|
+
}
|
|
84
|
+
&.nav-leaf-btn-right{
|
|
85
|
+
width: 30px;
|
|
86
|
+
height: auto;
|
|
87
|
+
top: 50%;
|
|
88
|
+
right: 0;
|
|
89
|
+
transform: translateY(-50%);
|
|
90
|
+
}
|
|
61
91
|
&.nav-leaf-btn-prev {
|
|
62
92
|
top: 0;
|
|
93
|
+
left:0;
|
|
63
94
|
}
|
|
64
95
|
&.nav-leaf-btn-next {
|
|
65
96
|
bottom: 0;
|
|
97
|
+
left:0;
|
|
66
98
|
}
|
|
67
99
|
}
|
|
68
100
|
.nav-leaf-item {
|