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
package/lib/ButtonGroup/index.js
DELETED
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/popconfirm/style");
|
|
11
|
-
|
|
12
|
-
var _popconfirm = _interopRequireDefault(require("antd/es/popconfirm"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/button/style");
|
|
15
|
-
|
|
16
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
17
|
-
|
|
18
|
-
require("antd/es/dropdown/style");
|
|
19
|
-
|
|
20
|
-
var _dropdown = _interopRequireDefault(require("antd/es/dropdown"));
|
|
21
|
-
|
|
22
|
-
require("antd/es/menu/style");
|
|
23
|
-
|
|
24
|
-
var _menu = _interopRequireDefault(require("antd/es/menu"));
|
|
25
|
-
|
|
26
|
-
var _tslib = require("tslib");
|
|
27
|
-
|
|
28
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
29
|
-
|
|
30
|
-
var _index = require("../components/index");
|
|
31
|
-
|
|
32
|
-
var _index2 = _interopRequireDefault(require("../SpecIcon/index"));
|
|
33
|
-
|
|
34
|
-
var _PopConfirmTitle = _interopRequireDefault(require("./PopConfirmTitle"));
|
|
35
|
-
|
|
36
|
-
var _index3 = require("../data/index");
|
|
37
|
-
|
|
38
|
-
var _icons = require("@ant-design/icons");
|
|
39
|
-
|
|
40
|
-
var _filterPermission = require("../utils/filterPermission.js");
|
|
41
|
-
|
|
42
|
-
require("./style/index.less");
|
|
43
|
-
|
|
44
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
45
|
-
|
|
46
|
-
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; }
|
|
47
|
-
|
|
48
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
49
|
-
|
|
50
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
51
|
-
|
|
52
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
53
|
-
|
|
54
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
55
|
-
|
|
56
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
57
|
-
|
|
58
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
59
|
-
|
|
60
|
-
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."); }
|
|
61
|
-
|
|
62
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
63
|
-
|
|
64
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
65
|
-
|
|
66
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
67
|
-
|
|
68
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
69
|
-
|
|
70
|
-
var ButtonGroup = function ButtonGroup(props) {
|
|
71
|
-
var _props$type = props.type,
|
|
72
|
-
type = _props$type === void 0 ? 'button' : _props$type,
|
|
73
|
-
_props$rowParams = props.rowParams,
|
|
74
|
-
rowParams = _props$rowParams === void 0 ? {
|
|
75
|
-
text: undefined,
|
|
76
|
-
record: undefined,
|
|
77
|
-
rowIndex: undefined
|
|
78
|
-
} : _props$rowParams,
|
|
79
|
-
_props$codes = props.codes,
|
|
80
|
-
codes = _props$codes === void 0 ? _index3.funcCode.btnFuncCodes : _props$codes,
|
|
81
|
-
permissionCodes = props.permissionCodes;
|
|
82
|
-
var _props$options = props.options,
|
|
83
|
-
options = _props$options === void 0 ? [] : _props$options,
|
|
84
|
-
_props$min = props.min,
|
|
85
|
-
min = _props$min === void 0 ? 3 : _props$min; // 最小展示长度不能小于2
|
|
86
|
-
|
|
87
|
-
if (!options) return null; // 没有配置list返回null
|
|
88
|
-
|
|
89
|
-
var _useState = (0, _react.useState)(-1),
|
|
90
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
91
|
-
popVisibleIndex = _useState2[0],
|
|
92
|
-
setPopVisibleIndex = _useState2[1];
|
|
93
|
-
|
|
94
|
-
var _useState3 = (0, _react.useState)({}),
|
|
95
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
96
|
-
popRow = _useState4[0],
|
|
97
|
-
setPopRow = _useState4[1];
|
|
98
|
-
|
|
99
|
-
var _useState5 = (0, _react.useState)([]),
|
|
100
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
101
|
-
resetList = _useState6[0],
|
|
102
|
-
setResetList = _useState6[1];
|
|
103
|
-
|
|
104
|
-
(0, _react.useEffect)(function () {
|
|
105
|
-
// 重组选项options集合数据,排除:无权限(有配置code,并且不包含permissionCodes内)的数据及,isHide 为true的数据
|
|
106
|
-
setResetList(_toConsumableArray((0, _filterPermission.removeNoPermission)(options, permissionCodes, codes, rowParams)) || []);
|
|
107
|
-
return function () {
|
|
108
|
-
setResetList([]);
|
|
109
|
-
};
|
|
110
|
-
}, [options, codes, permissionCodes]);
|
|
111
|
-
(0, _react.useEffect)(function () {
|
|
112
|
-
setPopVisibleIndex(-1);
|
|
113
|
-
}, [rowParams]); // 渲染按钮多层级形式 (用于筛选)
|
|
114
|
-
|
|
115
|
-
var buttonMenu = function buttonMenu(group) {
|
|
116
|
-
return /*#__PURE__*/_react.default.createElement(_menu.default, null, group.map(function (item, index) {
|
|
117
|
-
if (item.children) {
|
|
118
|
-
return /*#__PURE__*/_react.default.createElement(_menu.default.SubMenu, {
|
|
119
|
-
title: item.exName || item.name,
|
|
120
|
-
key: index
|
|
121
|
-
}, item.children.map(function (child, childIndex) {
|
|
122
|
-
return /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
123
|
-
key: childIndex
|
|
124
|
-
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
125
|
-
onClick: child.fn ? function () {
|
|
126
|
-
return child.fn(child);
|
|
127
|
-
} : null
|
|
128
|
-
}, /*#__PURE__*/_react.default.createElement(_index.IconNode, {
|
|
129
|
-
icon: child.icon
|
|
130
|
-
}), " ", child.exName || child.name));
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
135
|
-
key: index
|
|
136
|
-
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
137
|
-
onClick: item.fn ? function () {
|
|
138
|
-
return item.fn(item);
|
|
139
|
-
} : null
|
|
140
|
-
}, /*#__PURE__*/_react.default.createElement(_index.IconNode, {
|
|
141
|
-
icon: item.icon
|
|
142
|
-
}), " ", item.exName || item.name));
|
|
143
|
-
}));
|
|
144
|
-
}; // 渲染按钮形式 (用于筛选)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
var RenderButtonList = function RenderButtonList(item) {
|
|
148
|
-
var exName = item.exName,
|
|
149
|
-
name = item.name,
|
|
150
|
-
type = item.type,
|
|
151
|
-
icon = item.icon,
|
|
152
|
-
ghost = item.ghost,
|
|
153
|
-
danger = item.danger,
|
|
154
|
-
disabled = item.disabled,
|
|
155
|
-
loading = item.loading,
|
|
156
|
-
fn = item.fn,
|
|
157
|
-
code = item.code,
|
|
158
|
-
rowParams = item.rowParams,
|
|
159
|
-
others = (0, _tslib.__rest)(item, ["exName", "name", "type", "icon", "ghost", "danger", "disabled", "loading", "fn", "code", "rowParams"]);
|
|
160
|
-
|
|
161
|
-
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
162
|
-
return /*#__PURE__*/_react.default.createElement(_dropdown.default, {
|
|
163
|
-
overlay: buttonMenu(item.children),
|
|
164
|
-
placement: "bottomRight"
|
|
165
|
-
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
166
|
-
type: "primary"
|
|
167
|
-
}, item.exName || item.name, " ", /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
168
|
-
name: "down"
|
|
169
|
-
})));
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return /*#__PURE__*/_react.default.createElement(_button.default, Object.assign({
|
|
173
|
-
type: type || 'primary',
|
|
174
|
-
danger: danger,
|
|
175
|
-
ghost: ghost,
|
|
176
|
-
onClick: fn ? function () {
|
|
177
|
-
return fn(item);
|
|
178
|
-
} : null
|
|
179
|
-
}, others, {
|
|
180
|
-
icon: /*#__PURE__*/_react.default.createElement(_index.IconNode, {
|
|
181
|
-
icon: icon
|
|
182
|
-
}),
|
|
183
|
-
disabled: (0, _filterPermission.btnIsDisabled)(disabled, rowParams)
|
|
184
|
-
}), exName || name);
|
|
185
|
-
}; // 渲染文本形式多级菜单列表(用于表格)
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
var textMenu = function textMenu(group) {
|
|
189
|
-
return /*#__PURE__*/_react.default.createElement(_menu.default, {
|
|
190
|
-
className: "spec-button-text-dropdown"
|
|
191
|
-
}, group.map(function (gItem, gIndex) {
|
|
192
|
-
if (gItem.children) {
|
|
193
|
-
return /*#__PURE__*/_react.default.createElement(_menu.default.SubMenu, {
|
|
194
|
-
title: gItem.exName || gItem.name,
|
|
195
|
-
key: gItem
|
|
196
|
-
}, gItem.children.map(function (child, childIndex) {
|
|
197
|
-
return /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
198
|
-
key: childIndex
|
|
199
|
-
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
200
|
-
onClick: child.fn ? function () {
|
|
201
|
-
return child.fn.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
202
|
-
return rowParams[pItem];
|
|
203
|
-
})));
|
|
204
|
-
} : null
|
|
205
|
-
}, child.render ? child.render.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
206
|
-
return rowParams[pItem];
|
|
207
|
-
}))) : child.exName || child.name));
|
|
208
|
-
}));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
212
|
-
key: gIndex,
|
|
213
|
-
disabled: (0, _filterPermission.btnIsDisabled)(gItem.disabled, rowParams)
|
|
214
|
-
}, gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
|
|
215
|
-
/*#__PURE__*/
|
|
216
|
-
// @ts-ignore
|
|
217
|
-
_react.default.createElement("a", {
|
|
218
|
-
disabled: (0, _filterPermission.btnIsDisabled)(gItem.disabled, rowParams),
|
|
219
|
-
onClick: gItem.fn ? function () {
|
|
220
|
-
setPopVisibleIndex(rowParams.rowIndex);
|
|
221
|
-
setPopRow(gItem);
|
|
222
|
-
} : null
|
|
223
|
-
}, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
224
|
-
return rowParams[pItem];
|
|
225
|
-
}))) : gItem.exName || gItem.name) : /*#__PURE__*/_react.default.createElement("a", {
|
|
226
|
-
className: "spec-button-group-text",
|
|
227
|
-
onClick: gItem.fn ? function () {
|
|
228
|
-
return gItem.fn.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
229
|
-
return rowParams[pItem];
|
|
230
|
-
})));
|
|
231
|
-
} : null,
|
|
232
|
-
// @ts-ignore
|
|
233
|
-
disabled: (0, _filterPermission.btnIsDisabled)(gItem.disabled, rowParams)
|
|
234
|
-
}, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
235
|
-
return rowParams[pItem];
|
|
236
|
-
}))) : gItem.exName || gItem.name));
|
|
237
|
-
}));
|
|
238
|
-
}; // 渲染文本形式 列表(用于表格)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
var RenderTextList = function RenderTextList(item) {
|
|
242
|
-
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
243
|
-
return /*#__PURE__*/_react.default.createElement(_dropdown.default, {
|
|
244
|
-
overlay: textMenu(item.children),
|
|
245
|
-
placement: "bottomRight"
|
|
246
|
-
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
247
|
-
className: "spec-button-group-text"
|
|
248
|
-
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
249
|
-
return rowParams[pItem];
|
|
250
|
-
}))) : item.exName || item.name, " ", /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
251
|
-
name: "down"
|
|
252
|
-
})));
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.hasOwnProperty('confirmText') || item.hasOwnProperty('confirmConfig') ? /*#__PURE__*/_react.default.createElement(_popconfirm.default, Object.assign({
|
|
256
|
-
placement: "topRight",
|
|
257
|
-
icon: /*#__PURE__*/_react.default.createElement(_icons.QuestionCircleOutlined, null)
|
|
258
|
-
}, item.hasOwnProperty('confirmConfig') ? item.confirmConfig : {}, {
|
|
259
|
-
title: /*#__PURE__*/_react.default.createElement(_PopConfirmTitle.default, Object.assign({}, item, {
|
|
260
|
-
extraRow: rowParams
|
|
261
|
-
})),
|
|
262
|
-
onCancel: function onCancel() {
|
|
263
|
-
if (item.hasOwnProperty('confirmConfig') && item.confirmConfig.onCancel) {
|
|
264
|
-
var _item$confirmConfig;
|
|
265
|
-
|
|
266
|
-
(_item$confirmConfig = item.confirmConfig).onCancel.apply(_item$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
267
|
-
return rowParams[pItem];
|
|
268
|
-
})));
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
onConfirm: function onConfirm() {
|
|
272
|
-
if (item.hasOwnProperty('confirmConfig') && item.confirmConfig.onConfirm) {
|
|
273
|
-
var _item$confirmConfig2;
|
|
274
|
-
|
|
275
|
-
(_item$confirmConfig2 = item.confirmConfig).onConfirm.apply(_item$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
276
|
-
return rowParams[pItem];
|
|
277
|
-
})));
|
|
278
|
-
} else if (item.fn) {
|
|
279
|
-
item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
280
|
-
return rowParams[pItem];
|
|
281
|
-
})));
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}), /*#__PURE__*/_react.default.createElement("a", {
|
|
285
|
-
className: "spec-button-group-text",
|
|
286
|
-
key: item.index,
|
|
287
|
-
title: item.exName || item.name,
|
|
288
|
-
// @ts-ignore
|
|
289
|
-
disabled: (0, _filterPermission.btnIsDisabled)(item.disabled, rowParams)
|
|
290
|
-
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
291
|
-
return rowParams[pItem];
|
|
292
|
-
}))) : item.exName || item.name)) : /*#__PURE__*/_react.default.createElement("a", {
|
|
293
|
-
className: "spec-button-group-text",
|
|
294
|
-
title: item.exName || item.name,
|
|
295
|
-
key: item.index,
|
|
296
|
-
// @ts-ignore
|
|
297
|
-
disabled: (0, _filterPermission.btnIsDisabled)(item.disabled, rowParams),
|
|
298
|
-
onClick: item.fn ? function () {
|
|
299
|
-
return item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
300
|
-
return rowParams[pItem];
|
|
301
|
-
})));
|
|
302
|
-
} : null
|
|
303
|
-
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
304
|
-
return rowParams[pItem];
|
|
305
|
-
}))) : item.exName || item.name));
|
|
306
|
-
}; // 渲染展示的按钮列表
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
var renderDisplayButton = function renderDisplayButton(item, index) {
|
|
310
|
-
/*渲染自定义*/
|
|
311
|
-
if (item.render) {
|
|
312
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, typeof item.render === 'function' ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
313
|
-
return rowParams[pItem];
|
|
314
|
-
}))) : item.render);
|
|
315
|
-
}
|
|
316
|
-
/*渲染按钮形式*/
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (type === 'button') {
|
|
320
|
-
return /*#__PURE__*/_react.default.createElement(RenderButtonList, Object.assign({
|
|
321
|
-
key: index
|
|
322
|
-
}, item, {
|
|
323
|
-
rowParams: rowParams
|
|
324
|
-
}));
|
|
325
|
-
}
|
|
326
|
-
/*渲染文本形式*/
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
return /*#__PURE__*/_react.default.createElement(RenderTextList, Object.assign({
|
|
330
|
-
key: index
|
|
331
|
-
}, item));
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
if (min < 2) min = 2;
|
|
335
|
-
|
|
336
|
-
if (resetList.length === 0) {
|
|
337
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, type !== 'button' ? '-' : null);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
if (resetList.length > min) {
|
|
341
|
-
var forGroup = resetList.slice(0, min - 1);
|
|
342
|
-
var forDrop = resetList.slice(min - 1);
|
|
343
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
344
|
-
className: "spec-button-group"
|
|
345
|
-
}, forGroup.map(function (item, index) {
|
|
346
|
-
return index < min - 1 ? renderDisplayButton(item, index) : null;
|
|
347
|
-
}), type === 'button' ? /*#__PURE__*/_react.default.createElement(_dropdown.default, {
|
|
348
|
-
overlay: buttonMenu(forDrop),
|
|
349
|
-
placement: "bottomRight"
|
|
350
|
-
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
351
|
-
type: "primary"
|
|
352
|
-
}, "\u66F4\u591A ", /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
353
|
-
name: "down"
|
|
354
|
-
}))) : /*#__PURE__*/_react.default.createElement(_popconfirm.default, Object.assign({
|
|
355
|
-
placement: "topRight",
|
|
356
|
-
visible: popVisibleIndex === rowParams.rowIndex,
|
|
357
|
-
icon: /*#__PURE__*/_react.default.createElement(_icons.QuestionCircleOutlined, null),
|
|
358
|
-
trigger: "click"
|
|
359
|
-
}, popRow.hasOwnProperty('confirmConfig') ? popRow.confirmConfig : {}, {
|
|
360
|
-
title: /*#__PURE__*/_react.default.createElement(_PopConfirmTitle.default, Object.assign({}, popRow, {
|
|
361
|
-
extraRow: rowParams
|
|
362
|
-
})),
|
|
363
|
-
onCancel: function onCancel() {
|
|
364
|
-
setPopVisibleIndex(-1); // 优先调用其 confirmConfig 配置的 onCancel 事件
|
|
365
|
-
|
|
366
|
-
if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onCancel) {
|
|
367
|
-
var _popRow$confirmConfig;
|
|
368
|
-
|
|
369
|
-
(_popRow$confirmConfig = popRow.confirmConfig).onCancel.apply(_popRow$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
370
|
-
return rowParams[pItem];
|
|
371
|
-
})));
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
onConfirm: function onConfirm() {
|
|
375
|
-
setPopVisibleIndex(-1); // 优先调用其 confirmConfig 配置的 onConfirm 事件
|
|
376
|
-
|
|
377
|
-
if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onConfirm) {
|
|
378
|
-
var _popRow$confirmConfig2;
|
|
379
|
-
|
|
380
|
-
(_popRow$confirmConfig2 = popRow.confirmConfig).onConfirm.apply(_popRow$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
381
|
-
return rowParams[pItem];
|
|
382
|
-
})));
|
|
383
|
-
} else if (popRow.fn) {
|
|
384
|
-
popRow.fn.apply(popRow, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
385
|
-
return rowParams[pItem];
|
|
386
|
-
})));
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}), /*#__PURE__*/_react.default.createElement(_dropdown.default, {
|
|
390
|
-
overlay: textMenu(forDrop),
|
|
391
|
-
placement: "bottomRight"
|
|
392
|
-
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
393
|
-
className: "spec-button-group-text"
|
|
394
|
-
}, "\u66F4\u591A ", /*#__PURE__*/_react.default.createElement(_icons.DownOutlined, null)))));
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
398
|
-
className: "spec-button-group"
|
|
399
|
-
}, resetList.map(function (item, index) {
|
|
400
|
-
return renderDisplayButton(item, index);
|
|
401
|
-
}));
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
var _default = ButtonGroup;
|
|
405
|
-
exports.default = _default;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
@root-entry-name: default;
|
|
2
|
-
@import (reference) '~antd/es/style/themes/index';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.spec-button-group {
|
|
6
|
-
display: inline-block;
|
|
7
|
-
vertical-align: middle;
|
|
8
|
-
.ant-btn + .ant-btn {
|
|
9
|
-
margin-left: @padding-sm;
|
|
10
|
-
}
|
|
11
|
-
.spec-button-group-text + .spec-button-group-text {
|
|
12
|
-
position: relative;
|
|
13
|
-
margin-left: @padding-sm;
|
|
14
|
-
&:before {
|
|
15
|
-
position: absolute;
|
|
16
|
-
content: '';
|
|
17
|
-
top: 50%;
|
|
18
|
-
left: -@padding-sm/2;
|
|
19
|
-
transform: translate(0, -50%);
|
|
20
|
-
display: inline-block;
|
|
21
|
-
height: .9em;
|
|
22
|
-
vertical-align: middle;
|
|
23
|
-
border-left: 1px solid @border-color-base;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//& when (@theme = dark) {
|
|
27
|
-
// .ant-btn + .ant-btn {
|
|
28
|
-
// background: #795da3 !important;
|
|
29
|
-
// }
|
|
30
|
-
//}
|
|
31
|
-
//& when not (@theme = dark) {
|
|
32
|
-
// .ant-btn + .ant-btn {
|
|
33
|
-
// background: #c81313 !important;
|
|
34
|
-
// }
|
|
35
|
-
//}
|
|
36
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
|
-
require("./index.less");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
var DragBar = function DragBar(props) {
|
|
17
|
-
var direction = props.direction,
|
|
18
|
-
className = props.className,
|
|
19
|
-
onMouseDown = props.onMouseDown;
|
|
20
|
-
var directionStyle = direction === 'left' ? "spec-grid-dragbar-left-horizontal" : direction === 'right' ? "spec-grid-dragbar-right-horizontal" : direction === 'top' ? "spec-grid-dragbar-up-vertical" : "spec-grid-dragbar-down-vertical";
|
|
21
|
-
|
|
22
|
-
var handleMouseDown = function handleMouseDown(e) {
|
|
23
|
-
onMouseDown(e, direction);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
|
-
className: (0, _classnames.default)(directionStyle, className),
|
|
28
|
-
onMouseDown: handleMouseDown
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var _default = DragBar;
|
|
33
|
-
exports.default = _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface DragContentProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
direction?: string[];
|
|
6
|
-
moveMaxWidth?: number;
|
|
7
|
-
moveMaxHeight?: number;
|
|
8
|
-
style?: React.CSSProperties;
|
|
9
|
-
dragMouseDown?: (evt: any, direction?: string) => void;
|
|
10
|
-
dragMouseMove?: (evt: any, direction?: string) => void;
|
|
11
|
-
dragMouseUp?: (evt: any, direction?: string) => void;
|
|
12
|
-
}
|
|
13
|
-
declare const DragContent: (props: DragContentProps) => JSX.Element;
|
|
14
|
-
export default DragContent;
|
package/lib/DragContent/index.js
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var _DragBar = _interopRequireDefault(require("./DragBar"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
-
|
|
24
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
-
|
|
26
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
|
-
|
|
28
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
29
|
-
|
|
30
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
31
|
-
|
|
32
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
-
|
|
34
|
-
var DragContent = function DragContent(props) {
|
|
35
|
-
var children = props.children,
|
|
36
|
-
className = props.className,
|
|
37
|
-
direction = props.direction,
|
|
38
|
-
_props$moveMaxWidth = props.moveMaxWidth,
|
|
39
|
-
moveMaxWidth = _props$moveMaxWidth === void 0 ? 0 : _props$moveMaxWidth,
|
|
40
|
-
_props$moveMaxHeight = props.moveMaxHeight,
|
|
41
|
-
moveMaxHeight = _props$moveMaxHeight === void 0 ? 0 : _props$moveMaxHeight,
|
|
42
|
-
style = props.style,
|
|
43
|
-
dragMouseDown = props.dragMouseDown,
|
|
44
|
-
dragMouseMove = props.dragMouseMove,
|
|
45
|
-
dragMouseUp = props.dragMouseUp;
|
|
46
|
-
var divRef = (0, _react.useRef)();
|
|
47
|
-
|
|
48
|
-
var _useState = (0, _react.useState)(0),
|
|
49
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
-
targetWidth = _useState2[0],
|
|
51
|
-
setTargetWidth = _useState2[1];
|
|
52
|
-
|
|
53
|
-
var _useState3 = (0, _react.useState)(0),
|
|
54
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
-
targetHeight = _useState4[0],
|
|
56
|
-
setTargetHeight = _useState4[1];
|
|
57
|
-
|
|
58
|
-
(0, _react.useEffect)(function () {
|
|
59
|
-
setTargetWidth(divRef.current.offsetWidth);
|
|
60
|
-
setTargetHeight(divRef.current.offsetHeight);
|
|
61
|
-
}, []);
|
|
62
|
-
|
|
63
|
-
var onmousedown = function onmousedown(e, direction) {
|
|
64
|
-
var parent = divRef.current;
|
|
65
|
-
var nextNode = parent.nextSibling; //相邻兄弟节点
|
|
66
|
-
|
|
67
|
-
var prevNode = parent.previousSibling; //相邻兄弟节点
|
|
68
|
-
//获取前后兄弟节点宽高
|
|
69
|
-
|
|
70
|
-
var prevWidth = 0,
|
|
71
|
-
prevHeight = 0,
|
|
72
|
-
nextWidth = 0,
|
|
73
|
-
nextHeight = 0;
|
|
74
|
-
|
|
75
|
-
if (prevNode) {
|
|
76
|
-
prevWidth = prevNode.offsetWidth;
|
|
77
|
-
prevHeight = prevNode.offsetHeight;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (nextNode) {
|
|
81
|
-
nextWidth = nextNode.offsetWidth;
|
|
82
|
-
nextHeight = nextNode.offsetHeight;
|
|
83
|
-
} //鼠标按下
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (dragMouseDown) dragMouseDown(e, direction);
|
|
87
|
-
var initWidth = parent.offsetWidth;
|
|
88
|
-
var initHeight = parent.offsetHeight; // let initLeft = parent.offsetLeft;
|
|
89
|
-
// let initTop = parent.offsetTop;
|
|
90
|
-
|
|
91
|
-
var startX = e.clientX;
|
|
92
|
-
var startY = e.clientY;
|
|
93
|
-
|
|
94
|
-
document.onmousemove = function (e) {
|
|
95
|
-
var currX = e.clientX;
|
|
96
|
-
var currY = e.clientY;
|
|
97
|
-
var disY = currY - startY;
|
|
98
|
-
var disX = currX - startX;
|
|
99
|
-
var hasT = /top/.test(direction);
|
|
100
|
-
var hasB = /bottom/.test(direction);
|
|
101
|
-
var hasL = /left/.test(direction);
|
|
102
|
-
var hasR = /right/.test(direction);
|
|
103
|
-
|
|
104
|
-
if (hasL || hasR) {
|
|
105
|
-
var newWidth = initWidth + (hasL ? -disX : hasR ? disX : 0);
|
|
106
|
-
var width = newWidth > 0 ? newWidth : 0; //获取兄弟节点可变动的宽度
|
|
107
|
-
|
|
108
|
-
var changeWidth = hasL ? prevWidth : hasR ? nextWidth : 0;
|
|
109
|
-
var maxWidth = changeWidth + initWidth;
|
|
110
|
-
|
|
111
|
-
if (moveMaxWidth > 0 && maxWidth > moveMaxWidth) {
|
|
112
|
-
maxWidth = moveMaxWidth;
|
|
113
|
-
} //拉伸容器宽度不可小于初始宽度
|
|
114
|
-
//判断拉伸宽度不可超过 拉伸容器宽度+变动的兄弟容器宽度或设置的最大宽度
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (width > targetWidth && width <= maxWidth) {
|
|
118
|
-
//左拉且有前兄弟节点即变化其宽度
|
|
119
|
-
if (hasL && prevNode) {
|
|
120
|
-
var newPrevWidth = prevWidth + (hasL ? disX : hasR ? -disX : 0);
|
|
121
|
-
prevNode.style.width = newPrevWidth + 'px';
|
|
122
|
-
} //右拉且有后兄弟节点即变化其宽度
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (hasR && nextNode) {
|
|
126
|
-
var newNextWidth = nextWidth + (hasL ? disX : hasR ? -disX : 0);
|
|
127
|
-
nextNode.style.width = newNextWidth + 'px';
|
|
128
|
-
} //设置拉伸容器的宽度
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
parent.style.width = width + "px";
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (hasT || hasB) {
|
|
136
|
-
var newHeight = initHeight + (hasT ? -disY : hasB ? disY : 0);
|
|
137
|
-
var height = newHeight > 0 ? newHeight : 0; //获取兄弟节点需要变动的高度
|
|
138
|
-
|
|
139
|
-
var changeHeight = hasT ? prevHeight : hasB ? nextHeight : 0;
|
|
140
|
-
var maxHeight = changeHeight + initHeight;
|
|
141
|
-
|
|
142
|
-
if (moveMaxHeight > 0 && maxHeight > moveMaxHeight) {
|
|
143
|
-
maxHeight = moveMaxHeight;
|
|
144
|
-
} //拉伸容器高度不可小于初始高度
|
|
145
|
-
//判断拉伸高度不可超过 拉伸容器高度+变动的兄弟容器高度或设置的最大高度
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (height > targetHeight && height <= maxHeight) {
|
|
149
|
-
//上拉且有前兄弟节点即变化其高度
|
|
150
|
-
if (hasT && prevNode) {
|
|
151
|
-
var newPrevHeight = prevHeight + (hasT ? disY : hasB ? -disY : 0);
|
|
152
|
-
prevNode.style.height = newPrevHeight + 'px';
|
|
153
|
-
} //下拉且有后兄弟节点即变化其高度
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (hasB && nextNode) {
|
|
157
|
-
var newNextHeight = nextHeight + (hasT ? disY : hasB ? -disY : 0);
|
|
158
|
-
nextNode.style.height = newNextHeight + 'px';
|
|
159
|
-
} //设置拉伸容器的高度
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
parent.style.height = height + "px";
|
|
163
|
-
}
|
|
164
|
-
} //鼠标按下
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (dragMouseMove) dragMouseMove(e, direction);
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
document.onmouseup = function (e) {
|
|
171
|
-
document.onmousemove = document.onmouseup = null; //鼠标按下
|
|
172
|
-
|
|
173
|
-
if (dragMouseUp) dragMouseUp(e, direction);
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
178
|
-
ref: divRef,
|
|
179
|
-
className: (0, _classnames.default)("spec-grid-dragContent", className),
|
|
180
|
-
style: style
|
|
181
|
-
}, children, direction && direction.map(function (item, idx) {
|
|
182
|
-
return /*#__PURE__*/_react.default.createElement(_DragBar.default, {
|
|
183
|
-
key: idx,
|
|
184
|
-
direction: item,
|
|
185
|
-
onMouseDown: onmousedown
|
|
186
|
-
});
|
|
187
|
-
}));
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
var _default = DragContent;
|
|
191
|
-
exports.default = _default;
|