fan-standard-comp 3.1.2 → 3.1.4
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/package.json +1 -1
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fan-standard-comp.umd.js +0 -597
- package/dist/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +0 -2
- package/es/ButtonGroup/ButtonList.js +0 -37
- package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/es/ButtonGroup/ButtonMenu.js +0 -38
- package/es/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/es/ButtonGroup/PopConfirmTitle.js +0 -37
- package/es/ButtonGroup/index.d.ts +0 -30
- package/es/ButtonGroup/index.js +0 -374
- package/es/ButtonGroup/style/index.less +0 -36
- package/es/DragContent/DragBar.js +0 -21
- package/es/DragContent/index.d.ts +0 -14
- package/es/DragContent/index.js +0 -173
- package/es/DragContent/index.less +0 -44
- package/es/FormComp/ChunkUploader/api.js +0 -76
- package/es/FormComp/ChunkUploader/index.js +0 -391
- package/es/FormComp/ChunkUploader/lib.js +0 -96
- package/es/FormComp/ChunkUploader/style/style.less +0 -3
- package/es/FormComp/ChunkUploader/upload-queue.class.js +0 -167
- package/es/FormComp/ChunkUploader/worker.js +0 -23
- package/es/FormComp/EditButton/index.d.ts +0 -26
- package/es/FormComp/EditButton/index.js +0 -140
- package/es/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/es/FormComp/FieldComponent/ReUpload.js +0 -131
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +0 -245
- package/es/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/es/FormComp/FieldComponent/TitleNode.js +0 -9
- package/es/FormComp/FieldComponent/index.d.ts +0 -38
- package/es/FormComp/FieldComponent/index.js +0 -413
- package/es/FormComp/FieldComponent/setReadonlyValues.js +0 -236
- package/es/FormComp/FieldComponent/style/index.less +0 -116
- package/es/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/es/FormComp/RenderItemGroup/index.js +0 -234
- package/es/FormComp/Uploader/index.d.ts +0 -19
- package/es/FormComp/Uploader/index.js +0 -275
- package/es/FormComp/Uploader/style/index.less +0 -14
- package/es/FormComp/Uploader/util.d.ts +0 -8
- package/es/FormComp/Uploader/util.js +0 -38
- package/es/FormComp/VarTemplate/index.js +0 -293
- package/es/FormComp/index.d.ts +0 -1
- package/es/FormComp/index.js +0 -1
- package/es/NavLeafScroll/index.js +0 -379
- package/es/NavLeafScroll/style/index.less +0 -119
- package/es/RefactorTree/data.d.ts +0 -7
- package/es/RefactorTree/index.d.ts +0 -40
- package/es/RefactorTree/index.js +0 -167
- package/es/RefactorTree/indexTreeNode.d.ts +0 -39
- package/es/RefactorTree/indexTreeNode.js +0 -237
- package/es/RefactorTree/style/index.d.ts +0 -1
- package/es/RefactorTree/style/index.js +0 -1
- package/es/RefactorTree/style/index.less +0 -22
- package/es/RefactorTree/util.d.ts +0 -42
- package/es/RefactorTree/util.js +0 -187
- package/es/SpecIcon/fonts/demo.css +0 -539
- package/es/SpecIcon/fonts/demo_index.html +0 -1315
- package/es/SpecIcon/fonts/iconfont.css +0 -211
- package/es/SpecIcon/fonts/iconfont.eot +0 -0
- package/es/SpecIcon/fonts/iconfont.js +0 -41
- package/es/SpecIcon/fonts/iconfont.json +0 -352
- package/es/SpecIcon/fonts/iconfont.svg +0 -173
- 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/index.d.ts +0 -17
- package/es/SpecIcon/index.js +0 -77
- package/es/SpecIcon/style/iconfont.less +0 -213
- package/es/SpecIcon/style/index.less +0 -98
- package/es/SplitterLayout/Pane.d.ts +0 -13
- package/es/SplitterLayout/Pane.js +0 -36
- package/es/SplitterLayout/index.js +0 -375
- package/es/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SplitterLayout/Pane.js +0 -50
- package/es/StandardContent/SplitterLayout/index.js +0 -374
- package/es/StandardContent/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SubfieldContent.d.ts +0 -17
- package/es/StandardContent/SubfieldContent.js +0 -41
- package/es/StandardContent/WrapperContent.d.ts +0 -13
- package/es/StandardContent/WrapperContent.js +0 -29
- package/es/StandardContent/data.d.ts +0 -101
- package/es/StandardContent/style/index.less +0 -80
- package/es/StandardDragModal/index.d.ts +0 -11
- package/es/StandardDragModal/index.js +0 -30
- package/es/StandardFilter/index.d.ts +0 -35
- package/es/StandardFilter/index.js +0 -253
- package/es/StandardFilter/style/index.less +0 -62
- package/es/StandardForm/ActionList.js +0 -44
- package/es/StandardForm/StepForm.d.ts +0 -19
- package/es/StandardForm/StepForm.js +0 -267
- package/es/StandardForm/TabForm.d.ts +0 -19
- package/es/StandardForm/TabForm.js +0 -122
- package/es/StandardForm/index.d.ts +0 -32
- package/es/StandardForm/index.js +0 -170
- package/es/StandardForm/style/index.less +0 -58
- package/es/StandardModal/UpdateFormRef.js +0 -18
- package/es/StandardModal/index.d.ts +0 -44
- package/es/StandardModal/index.js +0 -495
- package/es/StandardModal/style/index.less +0 -50
- package/es/StandardPanel/index.d.ts +0 -28
- package/es/StandardPanel/index.js +0 -134
- package/es/StandardPanel/style/index.less +0 -135
- package/es/StandardTable/index.d.ts +0 -22
- package/es/StandardTable/index.js +0 -126
- package/es/StandardTable/style/index.d.ts +0 -1
- package/es/StandardTable/style/index.js +0 -1
- package/es/StandardTable/style/index.less +0 -206
- package/es/components/IconNode/index.d.ts +0 -16
- package/es/components/IconNode/index.js +0 -28
- package/es/components/index.d.ts +0 -2
- package/es/components/index.js +0 -2
- package/es/data/func.code.js +0 -112
- package/es/data/general.config.js +0 -172
- package/es/data/index.js +0 -3
- package/es/index.d.ts +0 -24
- package/es/index.js +0 -31
- package/es/styles/index.less +0 -0
- package/es/theme/spec-variable.less +0 -48
- package/es/utils/ValueFormat.js +0 -50
- package/es/utils/filterPermission.js +0 -111
- package/es/utils/getParentNodes.js +0 -215
- package/es/utils/index.js +0 -3
- package/lib/ButtonGroup/ButtonList.d.ts +0 -2
- package/lib/ButtonGroup/ButtonList.js +0 -55
- package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/lib/ButtonGroup/ButtonMenu.js +0 -51
- package/lib/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/lib/ButtonGroup/PopConfirmTitle.js +0 -48
- package/lib/ButtonGroup/index.d.ts +0 -30
- package/lib/ButtonGroup/index.js +0 -405
- package/lib/ButtonGroup/style/index.less +0 -36
- package/lib/DragContent/DragBar.js +0 -33
- package/lib/DragContent/index.d.ts +0 -14
- package/lib/DragContent/index.js +0 -191
- package/lib/DragContent/index.less +0 -44
- package/lib/FormComp/ChunkUploader/api.js +0 -89
- package/lib/FormComp/ChunkUploader/index.js +0 -410
- package/lib/FormComp/ChunkUploader/lib.js +0 -113
- package/lib/FormComp/ChunkUploader/style/style.less +0 -3
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +0 -174
- package/lib/FormComp/ChunkUploader/worker.js +0 -28
- package/lib/FormComp/EditButton/index.d.ts +0 -26
- package/lib/FormComp/EditButton/index.js +0 -159
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/lib/FormComp/FieldComponent/ReUpload.js +0 -151
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +0 -268
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/lib/FormComp/FieldComponent/TitleNode.js +0 -19
- package/lib/FormComp/FieldComponent/index.d.ts +0 -38
- package/lib/FormComp/FieldComponent/index.js +0 -457
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +0 -263
- package/lib/FormComp/FieldComponent/style/index.less +0 -116
- package/lib/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/lib/FormComp/RenderItemGroup/index.js +0 -255
- package/lib/FormComp/Uploader/index.d.ts +0 -19
- package/lib/FormComp/Uploader/index.js +0 -301
- package/lib/FormComp/Uploader/style/index.less +0 -14
- package/lib/FormComp/Uploader/util.d.ts +0 -8
- package/lib/FormComp/Uploader/util.js +0 -47
- package/lib/FormComp/VarTemplate/index.js +0 -308
- package/lib/FormComp/index.d.ts +0 -1
- package/lib/FormComp/index.js +0 -15
- package/lib/NavLeafScroll/index.js +0 -397
- package/lib/NavLeafScroll/style/index.less +0 -119
- package/lib/RefactorTree/data.d.ts +0 -7
- package/lib/RefactorTree/index.d.ts +0 -40
- package/lib/RefactorTree/index.js +0 -190
- package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
- package/lib/RefactorTree/indexTreeNode.js +0 -260
- package/lib/RefactorTree/style/index.d.ts +0 -1
- package/lib/RefactorTree/style/index.js +0 -3
- package/lib/RefactorTree/style/index.less +0 -22
- package/lib/RefactorTree/util.d.ts +0 -42
- package/lib/RefactorTree/util.js +0 -195
- package/lib/SpecIcon/fonts/demo.css +0 -539
- package/lib/SpecIcon/fonts/demo_index.html +0 -1315
- package/lib/SpecIcon/fonts/iconfont.css +0 -211
- package/lib/SpecIcon/fonts/iconfont.eot +0 -0
- package/lib/SpecIcon/fonts/iconfont.js +0 -43
- package/lib/SpecIcon/fonts/iconfont.json +0 -352
- package/lib/SpecIcon/fonts/iconfont.svg +0 -173
- 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.d.ts +0 -17
- package/lib/SpecIcon/index.js +0 -90
- package/lib/SpecIcon/style/iconfont.less +0 -213
- package/lib/SpecIcon/style/index.less +0 -98
- package/lib/SplitterLayout/Pane.d.ts +0 -13
- package/lib/SplitterLayout/Pane.js +0 -48
- package/lib/SplitterLayout/index.js +0 -386
- package/lib/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SplitterLayout/Pane.js +0 -62
- package/lib/StandardContent/SplitterLayout/index.js +0 -387
- package/lib/StandardContent/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SubfieldContent.d.ts +0 -17
- package/lib/StandardContent/SubfieldContent.js +0 -56
- package/lib/StandardContent/WrapperContent.d.ts +0 -13
- package/lib/StandardContent/WrapperContent.js +0 -43
- package/lib/StandardContent/data.d.ts +0 -101
- package/lib/StandardContent/style/index.less +0 -80
- package/lib/StandardDragModal/index.d.ts +0 -11
- package/lib/StandardDragModal/index.js +0 -43
- package/lib/StandardFilter/index.d.ts +0 -35
- package/lib/StandardFilter/index.js +0 -272
- package/lib/StandardFilter/style/index.less +0 -62
- package/lib/StandardForm/ActionList.js +0 -57
- package/lib/StandardForm/StepForm.d.ts +0 -19
- package/lib/StandardForm/StepForm.js +0 -295
- package/lib/StandardForm/TabForm.d.ts +0 -19
- package/lib/StandardForm/TabForm.js +0 -148
- package/lib/StandardForm/index.d.ts +0 -32
- package/lib/StandardForm/index.js +0 -197
- package/lib/StandardForm/style/index.less +0 -58
- package/lib/StandardModal/UpdateFormRef.js +0 -32
- package/lib/StandardModal/index.d.ts +0 -44
- package/lib/StandardModal/index.js +0 -525
- package/lib/StandardModal/style/index.less +0 -50
- package/lib/StandardPanel/index.d.ts +0 -28
- package/lib/StandardPanel/index.js +0 -155
- package/lib/StandardPanel/style/index.less +0 -135
- package/lib/StandardTable/index.d.ts +0 -22
- package/lib/StandardTable/index.js +0 -143
- package/lib/StandardTable/style/index.d.ts +0 -1
- package/lib/StandardTable/style/index.js +0 -3
- package/lib/StandardTable/style/index.less +0 -206
- package/lib/components/IconNode/index.d.ts +0 -16
- package/lib/components/IconNode/index.js +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/components/index.js +0 -15
- package/lib/data/func.code.js +0 -119
- package/lib/data/general.config.js +0 -179
- package/lib/data/index.js +0 -23
- package/lib/index.d.ts +0 -24
- package/lib/index.js +0 -236
- package/lib/styles/index.less +0 -0
- package/lib/theme/spec-variable.less +0 -48
- package/lib/utils/ValueFormat.js +0 -58
- package/lib/utils/filterPermission.js +0 -127
- package/lib/utils/getParentNodes.js +0 -226
- package/lib/utils/index.js +0 -35
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
|
|
3
|
-
import "antd/es/badge/style";
|
|
4
|
-
import _Badge from "antd/es/badge";
|
|
5
|
-
|
|
6
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
-
|
|
8
|
-
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, descriptor.key, descriptor); } }
|
|
9
|
-
|
|
10
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
11
|
-
|
|
12
|
-
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); }
|
|
13
|
-
|
|
14
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
-
|
|
16
|
-
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); }; }
|
|
17
|
-
|
|
18
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
19
|
-
|
|
20
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
-
|
|
22
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
23
|
-
|
|
24
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
import React, { Component } from 'react';
|
|
30
|
-
import SpecIcon from "../SpecIcon/index";
|
|
31
|
-
import _ from 'lodash';
|
|
32
|
-
import classNames from 'classnames';
|
|
33
|
-
import './style/index.less';
|
|
34
|
-
|
|
35
|
-
var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
36
|
-
_inherits(NavLeafScroll, _Component);
|
|
37
|
-
|
|
38
|
-
var _super = _createSuper(NavLeafScroll);
|
|
39
|
-
|
|
40
|
-
function NavLeafScroll(props) {
|
|
41
|
-
var _this;
|
|
42
|
-
|
|
43
|
-
_classCallCheck(this, NavLeafScroll);
|
|
44
|
-
|
|
45
|
-
_this = _super.call(this, props);
|
|
46
|
-
|
|
47
|
-
_defineProperty(_assertThisInitialized(_this), "initFloorValues", function () {
|
|
48
|
-
var _this$props = _this.props,
|
|
49
|
-
baseItemHeight = _this$props.baseItemHeight,
|
|
50
|
-
activeKey = _this$props.activeKey,
|
|
51
|
-
navList = _this$props.navList,
|
|
52
|
-
_this$props$optionNam = _this$props.optionName,
|
|
53
|
-
optionName = _this$props$optionNam === void 0 ? {
|
|
54
|
-
key: 'id',
|
|
55
|
-
title: 'title',
|
|
56
|
-
count: 'count'
|
|
57
|
-
} : _this$props$optionNam; // 元素个数占用的高度是否不超过内容区域
|
|
58
|
-
|
|
59
|
-
var isInsideEnough = navList.length * baseItemHeight <= _this.mainWrap.current.clientHeight;
|
|
60
|
-
var wrapHeight = _this.mainWrap.current.clientHeight - (isInsideEnough ? 0 : 32 * 2); // 每次需要移动的偏移量 32是上下切换角占用的高度
|
|
61
|
-
|
|
62
|
-
var floorHeight = _this.leafNav.current.clientHeight; // 所有楼层占用的高度
|
|
63
|
-
|
|
64
|
-
var isEnough = wrapHeight % baseItemHeight === 0; // 剩余的是否足够容纳一个单元格
|
|
65
|
-
// 判断有效区域与单元格高度:若小于,则直接使用单元格高度,否则将内容区高度去除不足一个单元格高度
|
|
66
|
-
|
|
67
|
-
if (_this.mainWrap.current.clientHeight - (isInsideEnough ? 0 : 32 * 2) >= baseItemHeight) {
|
|
68
|
-
wrapHeight -= wrapHeight % baseItemHeight; // 判断是否除不尽,如果还有余数,则当前 区域有效区域要去除一个单元格的高度
|
|
69
|
-
} else {
|
|
70
|
-
wrapHeight = baseItemHeight;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
var stepSize = wrapHeight / baseItemHeight; // - (isEnough ? 0 : 1) // 当前一页可容纳的单元格数量
|
|
74
|
-
|
|
75
|
-
_this.setState({
|
|
76
|
-
floorRelatedSize: {
|
|
77
|
-
wrapHeight: wrapHeight,
|
|
78
|
-
// 有效内容区域的
|
|
79
|
-
floorHeight: floorHeight // 楼层列表占用的高度
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
stepSize: stepSize,
|
|
83
|
-
showArrow: floorHeight > wrapHeight
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
if (activeKey && navList.length > 0) {
|
|
87
|
-
var matchIndex = _.findIndex(navList, function (item) {
|
|
88
|
-
return item[(optionName === null || optionName === void 0 ? void 0 : optionName.key) || 'id'] === activeKey;
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
var stepNo = wrapHeight === 0 ? 0 : Math.floor(matchIndex / (wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
92
|
-
|
|
93
|
-
var stepTotalSize = Math.ceil(navList.length / stepSize) || 0; // 当前所有单元格占用的页总数
|
|
94
|
-
|
|
95
|
-
_this.setState({
|
|
96
|
-
leafNavScrollY: matchIndex !== -1 && stepNo !== 0 ? -wrapHeight * stepNo : 0,
|
|
97
|
-
// 如果当前默认传值有楼层节点,则需要判断其所在的位置
|
|
98
|
-
arrowPermit: {
|
|
99
|
-
prev: matchIndex !== -1 && stepNo !== 0,
|
|
100
|
-
next: floorHeight > wrapHeight && stepNo + 1 !== stepTotalSize
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
} else {
|
|
104
|
-
_this.setState({
|
|
105
|
-
leafNavScrollY: 0,
|
|
106
|
-
arrowPermit: {
|
|
107
|
-
prev: false,
|
|
108
|
-
next: floorHeight > wrapHeight
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
_defineProperty(_assertThisInitialized(_this), "handleLeafControl", function (type) {
|
|
115
|
-
var _this$state = _this.state,
|
|
116
|
-
floorRelatedSize = _this$state.floorRelatedSize,
|
|
117
|
-
leafNavScrollY = _this$state.leafNavScrollY;
|
|
118
|
-
var wrapHeight = floorRelatedSize.wrapHeight,
|
|
119
|
-
floorHeight = floorRelatedSize.floorHeight;
|
|
120
|
-
var maxNextPosition = -(wrapHeight * (Math.ceil(floorHeight / wrapHeight) - 1)); // 向下滚动的最大值
|
|
121
|
-
|
|
122
|
-
var scrollY = type === 'next' ? leafNavScrollY - wrapHeight : leafNavScrollY + wrapHeight;
|
|
123
|
-
|
|
124
|
-
_this.setState({
|
|
125
|
-
arrowPermit: {
|
|
126
|
-
prev: type === 'prev' ? scrollY !== 0 : true,
|
|
127
|
-
next: type === 'prev' ? true : scrollY !== maxNextPosition // 滚动大小与最大滚动值一致时,向下滚动禁用,
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
leafNavScrollY: scrollY
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
_defineProperty(_assertThisInitialized(_this), "handleItemControl", function (key, data) {
|
|
135
|
-
var onClick = _this.props.onClick;
|
|
136
|
-
onClick && onClick(key, data);
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
_defineProperty(_assertThisInitialized(_this), "mouseEnter", function (e) {
|
|
140
|
-
var onMouseEnter = _this.props.onMouseEnter;
|
|
141
|
-
|
|
142
|
-
_this.setState({
|
|
143
|
-
isMouseEnter: true
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
onMouseEnter && onMouseEnter(e);
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
_defineProperty(_assertThisInitialized(_this), "mouseLeave", function (e) {
|
|
150
|
-
var onMouseLeave = _this.props.onMouseLeave;
|
|
151
|
-
|
|
152
|
-
_this.setState({
|
|
153
|
-
isMouseEnter: false
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
onMouseLeave && onMouseLeave(e);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
_defineProperty(_assertThisInitialized(_this), "mouseWheel", function (e) {
|
|
160
|
-
var _this$state2 = _this.state,
|
|
161
|
-
isMouseEnter = _this$state2.isMouseEnter,
|
|
162
|
-
arrowPermit = _this$state2.arrowPermit;
|
|
163
|
-
if (!isMouseEnter) return; // 鼠标没有经过内容区域,则不会滚轮监听
|
|
164
|
-
|
|
165
|
-
e.preventDefault();
|
|
166
|
-
|
|
167
|
-
if (e.deltaY <= 0) {
|
|
168
|
-
arrowPermit.prev && _this.handleLeafControl('prev'); // 向上滚动
|
|
169
|
-
} else {
|
|
170
|
-
arrowPermit.next && _this.handleLeafControl('next'); // 向下滚动
|
|
171
|
-
} // onWheel && onWheel(e)
|
|
172
|
-
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
_this.state = {
|
|
176
|
-
isMouseEnter: false,
|
|
177
|
-
leafNavScrollY: 0,
|
|
178
|
-
showArrow: false,
|
|
179
|
-
arrowPermit: {
|
|
180
|
-
prev: false,
|
|
181
|
-
next: false
|
|
182
|
-
},
|
|
183
|
-
floorRelatedSize: {
|
|
184
|
-
wrapHeight: 0,
|
|
185
|
-
// 有效内容区域的
|
|
186
|
-
floorHeight: 0 // 楼层列表占用的高度
|
|
187
|
-
|
|
188
|
-
},
|
|
189
|
-
stepSize: 0 // 当前一页可容纳的单元格数量
|
|
190
|
-
|
|
191
|
-
};
|
|
192
|
-
_this.mainWrap = /*#__PURE__*/React.createRef();
|
|
193
|
-
_this.leafWrap = /*#__PURE__*/React.createRef();
|
|
194
|
-
_this.leafNav = /*#__PURE__*/React.createRef();
|
|
195
|
-
_this.initFloorValues = _this.initFloorValues.bind(_assertThisInitialized(_this));
|
|
196
|
-
return _this;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
_createClass(NavLeafScroll, [{
|
|
200
|
-
key: "componentDidMount",
|
|
201
|
-
value: function componentDidMount() {
|
|
202
|
-
var forbidScroll = this.props.forbidScroll;
|
|
203
|
-
window.addEventListener('resize', this.initFloorValues);
|
|
204
|
-
|
|
205
|
-
if (!forbidScroll) {
|
|
206
|
-
// 禁用时,不启动滚动监听
|
|
207
|
-
this.mainWrap.current.addEventListener('wheel', this.mouseWheel, {
|
|
208
|
-
passive: false
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
this.initFloorValues();
|
|
213
|
-
}
|
|
214
|
-
}, {
|
|
215
|
-
key: "componentWillUnmount",
|
|
216
|
-
value: function componentWillUnmount() {
|
|
217
|
-
var forbidScroll = this.props.forbidScroll;
|
|
218
|
-
window.removeEventListener('resize', this.initFloorValues);
|
|
219
|
-
|
|
220
|
-
if (!forbidScroll) {
|
|
221
|
-
// 禁用时,不启动滚动监听
|
|
222
|
-
this.mainWrap.current.addEventListener('wheel', this.mouseWheel, {
|
|
223
|
-
passive: false
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
this.mainWrap.current.removeEventListener('wheel', this.mouseWheel);
|
|
228
|
-
}
|
|
229
|
-
}, {
|
|
230
|
-
key: "componentDidUpdate",
|
|
231
|
-
value: function componentDidUpdate(prevProps) {
|
|
232
|
-
var _this$props2 = this.props,
|
|
233
|
-
baseItemHeight = _this$props2.baseItemHeight,
|
|
234
|
-
navList = _this$props2.navList,
|
|
235
|
-
activeKey = _this$props2.activeKey,
|
|
236
|
-
_this$props2$optionNa = _this$props2.optionName,
|
|
237
|
-
optionName = _this$props2$optionNa === void 0 ? {
|
|
238
|
-
key: 'id',
|
|
239
|
-
title: 'title',
|
|
240
|
-
count: 'count'
|
|
241
|
-
} : _this$props2$optionNa,
|
|
242
|
-
forbidScroll = _this$props2.forbidScroll;
|
|
243
|
-
var _this$state3 = this.state,
|
|
244
|
-
_this$state3$floorRel = _this$state3.floorRelatedSize,
|
|
245
|
-
wrapHeight = _this$state3$floorRel.wrapHeight,
|
|
246
|
-
floorHeight = _this$state3$floorRel.floorHeight,
|
|
247
|
-
stepSize = _this$state3.stepSize;
|
|
248
|
-
|
|
249
|
-
if (JSON.stringify(navList) !== JSON.stringify(prevProps.navList) || baseItemHeight !== prevProps.baseItemHeight) {
|
|
250
|
-
this.initFloorValues();
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (forbidScroll !== prevProps.forbidScroll) {
|
|
254
|
-
// 禁用时,不启动滚动监听
|
|
255
|
-
if (!forbidScroll) {
|
|
256
|
-
// 禁用时,不启动滚动监听
|
|
257
|
-
this.mainWrap.current.addEventListener('wheel', this.mouseWheel, {
|
|
258
|
-
passive: false
|
|
259
|
-
});
|
|
260
|
-
} else {
|
|
261
|
-
this.mainWrap.current.removeEventListener('wheel', this.mouseWheel);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
if (activeKey !== prevProps.activeKey) {
|
|
266
|
-
var matchIndex = _.findIndex(navList, function (item) {
|
|
267
|
-
return item[optionName.key] === activeKey;
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
var stepNo = Math.floor(matchIndex / (wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
271
|
-
|
|
272
|
-
var stepTotalSize = Array.isArray(navList) && Math.ceil(navList.length / stepSize) || 0; // 当前所有单元格占用的页总数
|
|
273
|
-
|
|
274
|
-
this.setState({
|
|
275
|
-
leafNavScrollY: matchIndex !== -1 && stepNo !== 0 ? -wrapHeight * stepNo : 0,
|
|
276
|
-
// 如果当前默认传值有楼层节点,则需要判断其所在的位置
|
|
277
|
-
arrowPermit: {
|
|
278
|
-
prev: matchIndex !== -1 && stepNo !== 0,
|
|
279
|
-
next: floorHeight > wrapHeight && stepNo + 1 !== stepTotalSize
|
|
280
|
-
},
|
|
281
|
-
isMouseEnter: true
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
} // 初始化楼层相关的值,如:是否允许触发滚动,默认滚动区间高度等
|
|
285
|
-
|
|
286
|
-
}, {
|
|
287
|
-
key: "render",
|
|
288
|
-
value: function render() {
|
|
289
|
-
var _this2 = this;
|
|
290
|
-
|
|
291
|
-
var _this$props3 = this.props,
|
|
292
|
-
className = _this$props3.className,
|
|
293
|
-
width = _this$props3.width,
|
|
294
|
-
activeKey = _this$props3.activeKey,
|
|
295
|
-
customLeafNode = _this$props3.customLeafNode,
|
|
296
|
-
noArrowPadding = _this$props3.noArrowPadding,
|
|
297
|
-
navList = _this$props3.navList,
|
|
298
|
-
_this$props3$optionNa = _this$props3.optionName,
|
|
299
|
-
optionName = _this$props3$optionNa === void 0 ? {
|
|
300
|
-
key: 'id',
|
|
301
|
-
title: 'title',
|
|
302
|
-
count: 'count'
|
|
303
|
-
} : _this$props3$optionNa,
|
|
304
|
-
_this$props3$emptyNod = _this$props3.emptyNode,
|
|
305
|
-
emptyNode = _this$props3$emptyNod === void 0 ? null : _this$props3$emptyNod;
|
|
306
|
-
var _this$state4 = this.state,
|
|
307
|
-
showArrow = _this$state4.showArrow,
|
|
308
|
-
arrowPermit = _this$state4.arrowPermit,
|
|
309
|
-
leafNavScrollY = _this$state4.leafNavScrollY;
|
|
310
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
311
|
-
className: classNames(className, "nav-leaf"),
|
|
312
|
-
style: width ? {
|
|
313
|
-
width: "".concat(width, "px")
|
|
314
|
-
} : {},
|
|
315
|
-
ref: this.mainWrap // onWheel={this.mouseWheel}
|
|
316
|
-
,
|
|
317
|
-
onMouseEnter: this.mouseEnter,
|
|
318
|
-
onMouseLeave: this.mouseLeave
|
|
319
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
320
|
-
className: "nav-leaf-container nav-leaf-container-scroll",
|
|
321
|
-
style: !showArrow || noArrowPadding ? {
|
|
322
|
-
padding: 0
|
|
323
|
-
} : {},
|
|
324
|
-
"data-prev": showArrow
|
|
325
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
326
|
-
className: classNames("nav-leaf-arrow nav-leaf-btn-prev", showArrow ? '' : 'is-hide', arrowPermit.prev ? '' : 'is-disabled'),
|
|
327
|
-
onClick: function onClick() {
|
|
328
|
-
return arrowPermit.prev ? _this2.handleLeafControl('prev') : '';
|
|
329
|
-
}
|
|
330
|
-
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
331
|
-
name: "caret-up"
|
|
332
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
333
|
-
className: classNames("nav-leaf-arrow nav-leaf-btn-next", showArrow ? '' : 'is-hide', arrowPermit.next ? '' : 'is-disabled'),
|
|
334
|
-
onClick: function onClick() {
|
|
335
|
-
return arrowPermit.next ? _this2.handleLeafControl('next') : '';
|
|
336
|
-
}
|
|
337
|
-
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
338
|
-
name: "caret-down"
|
|
339
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
340
|
-
className: "nav-leaf-wrap",
|
|
341
|
-
ref: this.leafWrap
|
|
342
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
343
|
-
className: "nav-leaf-scroll"
|
|
344
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
345
|
-
className: "nav-leaf-nav",
|
|
346
|
-
ref: this.leafNav,
|
|
347
|
-
style: {
|
|
348
|
-
transform: "translate3d(0px, ".concat(leafNavScrollY, "px, 0px)")
|
|
349
|
-
}
|
|
350
|
-
}, navList && navList.length > 0 ? navList.map(function (item, i) {
|
|
351
|
-
var _this2$props;
|
|
352
|
-
|
|
353
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
354
|
-
key: item[optionName.key],
|
|
355
|
-
className: classNames('nav-leaf-item', activeKey && activeKey === item[optionName.key] ? 'is-active' : ''),
|
|
356
|
-
style: {
|
|
357
|
-
height: "".concat(((_this2$props = _this2.props) === null || _this2$props === void 0 ? void 0 : _this2$props.baseItemHeight) || 40, "px")
|
|
358
|
-
},
|
|
359
|
-
onClick: function onClick() {
|
|
360
|
-
return _this2.handleItemControl(item[optionName.key], item);
|
|
361
|
-
}
|
|
362
|
-
}, customLeafNode ? customLeafNode(item) : /*#__PURE__*/React.createElement(React.Fragment, null, item[optionName.title] && /*#__PURE__*/React.createElement("span", {
|
|
363
|
-
className: "leaf-title"
|
|
364
|
-
}, "".concat(item[optionName.title]), " "), item[optionName.count] ? /*#__PURE__*/React.createElement("span", {
|
|
365
|
-
className: "leaf-extra"
|
|
366
|
-
}, " ", /*#__PURE__*/React.createElement(SpecIcon, {
|
|
367
|
-
name: "warn-fill"
|
|
368
|
-
}), /*#__PURE__*/React.createElement(_Badge, {
|
|
369
|
-
className: "warning-count",
|
|
370
|
-
count: item[optionName.count]
|
|
371
|
-
})) : null));
|
|
372
|
-
}) : emptyNode)))));
|
|
373
|
-
}
|
|
374
|
-
}]);
|
|
375
|
-
|
|
376
|
-
return NavLeafScroll;
|
|
377
|
-
}(Component);
|
|
378
|
-
|
|
379
|
-
export default NavLeafScroll;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
@root-entry-name: default;
|
|
2
|
-
@import (reference) '~antd/es/style/themes/index';
|
|
3
|
-
|
|
4
|
-
.nav-leaf {
|
|
5
|
-
width: 110px;
|
|
6
|
-
height: 100%;
|
|
7
|
-
//.nav-leaf-container {
|
|
8
|
-
// height: ~'calc(100vh - @{nav-header-height})';
|
|
9
|
-
//}
|
|
10
|
-
|
|
11
|
-
.nav-leaf-container {
|
|
12
|
-
position: relative;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
//height: calc(100% - 32px);
|
|
17
|
-
margin-bottom: -1px;
|
|
18
|
-
font-size: 16px;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
line-height: 1.6;
|
|
21
|
-
white-space: nowrap;
|
|
22
|
-
//transition: padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
23
|
-
zoom: 1;
|
|
24
|
-
&.nav-leaf-container-scroll {
|
|
25
|
-
padding: 32px 0;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
white-space: nowrap;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
.nav-leaf-wrap {
|
|
31
|
-
height: 100%;
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
}
|
|
34
|
-
.nav-leaf-nav {
|
|
35
|
-
position: relative;
|
|
36
|
-
display: inline-block;
|
|
37
|
-
box-sizing: border-box;
|
|
38
|
-
width: 100%;
|
|
39
|
-
margin: 0;
|
|
40
|
-
padding-left: 0;
|
|
41
|
-
//transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
42
|
-
}
|
|
43
|
-
.nav-leaf-arrow {
|
|
44
|
-
position: absolute;
|
|
45
|
-
left: 0;
|
|
46
|
-
width: 100%;
|
|
47
|
-
height: 32px;
|
|
48
|
-
color: @text-color;
|
|
49
|
-
text-align: center;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
&:hover {
|
|
52
|
-
color: @primary-color;
|
|
53
|
-
}
|
|
54
|
-
&.is-hide {
|
|
55
|
-
display: none;
|
|
56
|
-
}
|
|
57
|
-
&.is-disabled {
|
|
58
|
-
color: fade(@primary-color, 30%) !important;
|
|
59
|
-
cursor: not-allowed !important;
|
|
60
|
-
}
|
|
61
|
-
&.nav-leaf-btn-prev {
|
|
62
|
-
top: 0;
|
|
63
|
-
}
|
|
64
|
-
&.nav-leaf-btn-next {
|
|
65
|
-
bottom: 0;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
.nav-leaf-item {
|
|
69
|
-
height: 40px;
|
|
70
|
-
padding: 5px 10px 5px 10px;
|
|
71
|
-
color: @text-color-secondary;
|
|
72
|
-
line-height: 30px;
|
|
73
|
-
border-top-left-radius: 20px;
|
|
74
|
-
border-bottom-left-radius: 20px;
|
|
75
|
-
cursor: pointer;
|
|
76
|
-
&:hover {
|
|
77
|
-
color: @primary-color;
|
|
78
|
-
}
|
|
79
|
-
&.is-active {
|
|
80
|
-
color: @primary-color;
|
|
81
|
-
background: @background-color-base;
|
|
82
|
-
border-color: @primary-color;
|
|
83
|
-
}
|
|
84
|
-
.leaf-title {
|
|
85
|
-
display: inline-block;
|
|
86
|
-
min-width: 30px;
|
|
87
|
-
}
|
|
88
|
-
.leaf-extra {
|
|
89
|
-
position: relative;
|
|
90
|
-
display: inline-block;
|
|
91
|
-
width: 18px;
|
|
92
|
-
margin-left: 4px;
|
|
93
|
-
color: @error-color;
|
|
94
|
-
text-align: center;
|
|
95
|
-
i {
|
|
96
|
-
color: @error-color;
|
|
97
|
-
}
|
|
98
|
-
.warning-count {
|
|
99
|
-
position: absolute;
|
|
100
|
-
top: -1px;
|
|
101
|
-
left: 20px;
|
|
102
|
-
.ant-badge-multiple-words {
|
|
103
|
-
box-shadow: 0 1px 4px fade(@primary-color, 45%)
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
.nav-leaf-empty {
|
|
109
|
-
position: absolute;
|
|
110
|
-
top: -25px;
|
|
111
|
-
left: -10px;
|
|
112
|
-
width: 100%;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
.themeTech {
|
|
116
|
-
.nav-leaf .nav-leaf-item.is-active {
|
|
117
|
-
background: #10343A;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TreeProps } from 'antd/es/tree';
|
|
3
|
-
import './style/index.less';
|
|
4
|
-
interface selectDataProps {
|
|
5
|
-
currentData?: object;
|
|
6
|
-
multiData?: object[];
|
|
7
|
-
}
|
|
8
|
-
interface optionNameProps {
|
|
9
|
-
key?: string;
|
|
10
|
-
value?: string;
|
|
11
|
-
title?: string;
|
|
12
|
-
children?: string;
|
|
13
|
-
disabled?: string;
|
|
14
|
-
selectable?: string;
|
|
15
|
-
}
|
|
16
|
-
interface RefactorTreeProps extends TreeProps {
|
|
17
|
-
treeData: any[];
|
|
18
|
-
rootName?: string;
|
|
19
|
-
rootKey?: string;
|
|
20
|
-
emptyDescription?: string;
|
|
21
|
-
optionName?: optionNameProps;
|
|
22
|
-
defaultSelectedKeys?: string[];
|
|
23
|
-
onSelect?: (selectedKeys: string[], selectData: selectDataProps, e: any) => void;
|
|
24
|
-
onCheck?: (checkedKeys: string[] | {
|
|
25
|
-
checked: string[];
|
|
26
|
-
halfChecked: string[];
|
|
27
|
-
}, selectData: selectDataProps, e: any) => void;
|
|
28
|
-
nodeExtra?: (data?: object) => React.ReactNode;
|
|
29
|
-
selectable?: boolean;
|
|
30
|
-
checkStrictly?: boolean;
|
|
31
|
-
limitKey?: string;
|
|
32
|
-
checkedKeys?: any;
|
|
33
|
-
nodeControl?: any;
|
|
34
|
-
disabledFields?: {
|
|
35
|
-
key: string;
|
|
36
|
-
value: any;
|
|
37
|
-
}[];
|
|
38
|
-
}
|
|
39
|
-
declare const RefactorTree: (props: RefactorTreeProps) => JSX.Element;
|
|
40
|
-
export default RefactorTree;
|