fan-standard-comp 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fan-standard-comp.umd.js +293 -285
- package/es/ButtonGroup/ButtonList.js +18 -36
- package/es/ButtonGroup/ButtonMenu.js +14 -27
- package/es/ButtonGroup/PopConfirmTitle.js +5 -16
- package/es/ButtonGroup/index.js +76 -107
- package/es/DragContent/DragBar.js +6 -18
- package/es/DragContent/index.js +12 -30
- package/es/FormComp/ChunkUploader/api.js +8 -21
- package/es/FormComp/ChunkUploader/index.js +27 -46
- package/es/FormComp/ChunkUploader/lib.js +9 -26
- package/es/FormComp/ChunkUploader/upload-queue.class.js +5 -12
- package/es/FormComp/ChunkUploader/worker.js +2 -7
- package/es/FormComp/EditButton/index.js +16 -35
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +26 -49
- package/es/FormComp/FieldComponent/TitleNode.js +3 -13
- package/es/FormComp/FieldComponent/index.js +87 -131
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -61
- package/es/FormComp/RenderItemGroup/index.js +34 -56
- package/es/FormComp/Uploader/index.js +38 -64
- package/es/FormComp/Uploader/util.js +2 -11
- package/es/FormComp/VarTemplate/index.js +31 -44
- package/es/FormComp/index.js +1 -15
- package/es/NavLeafScroll/index.js +35 -53
- package/es/RefactorTree/index.js +29 -52
- package/es/RefactorTree/indexTreeNode.js +31 -54
- package/es/RefactorTree/style/index.js +1 -3
- package/es/RefactorTree/util.js +10 -18
- package/es/SpecIcon/fonts/iconfont.js +0 -2
- package/es/SpecIcon/index.js +17 -30
- package/es/SplitterLayout/Pane.js +5 -17
- package/es/SplitterLayout/index.js +13 -24
- package/es/StandardContent/SplitterLayout/Pane.js +13 -25
- package/es/StandardContent/SplitterLayout/index.js +30 -43
- package/es/StandardContent/SubfieldContent.js +13 -28
- package/es/StandardContent/WrapperContent.js +10 -24
- package/es/StandardDragModal/index.d.ts +11 -0
- package/es/StandardDragModal/index.js +30 -0
- package/es/StandardFilter/index.js +27 -46
- package/es/StandardForm/ActionList.js +8 -21
- package/es/StandardForm/StepForm.js +40 -68
- package/es/StandardForm/TabForm.js +26 -52
- package/es/StandardForm/index.js +28 -55
- package/es/StandardModal/UpdateFormRef.js +4 -18
- package/es/StandardModal/index.d.ts +3 -0
- package/es/StandardModal/index.js +118 -119
- package/es/StandardPanel/index.js +32 -53
- package/es/StandardTable/index.js +17 -44
- package/es/StandardTable/style/index.js +1 -3
- package/es/components/IconNode/index.js +6 -17
- package/es/components/index.js +2 -15
- package/es/data/func.code.js +2 -9
- package/es/data/general.config.js +2 -9
- package/es/data/index.js +3 -23
- package/es/index.d.ts +0 -1
- package/es/index.js +24 -238
- package/es/utils/ValueFormat.js +1 -9
- package/es/utils/filterPermission.js +4 -20
- package/es/utils/getParentNodes.js +1 -12
- package/es/utils/index.js +3 -35
- package/lib/ButtonGroup/ButtonList.js +9 -9
- package/lib/ButtonGroup/ButtonMenu.js +11 -11
- package/lib/ButtonGroup/PopConfirmTitle.js +5 -5
- package/lib/ButtonGroup/index.js +47 -47
- package/lib/DragContent/DragBar.js +5 -5
- package/lib/DragContent/index.js +7 -7
- package/lib/FormComp/ChunkUploader/api.js +4 -4
- package/lib/FormComp/ChunkUploader/index.js +10 -10
- package/lib/FormComp/ChunkUploader/lib.js +2 -2
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +2 -2
- package/lib/FormComp/ChunkUploader/worker.js +2 -2
- package/lib/FormComp/EditButton/index.js +10 -10
- package/lib/FormComp/FieldComponent/ReUpload.js +9 -9
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +16 -16
- package/lib/FormComp/FieldComponent/TitleNode.js +4 -4
- package/lib/FormComp/FieldComponent/index.js +47 -47
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +23 -23
- package/lib/FormComp/RenderItemGroup/index.js +20 -21
- package/lib/FormComp/Uploader/index.js +16 -16
- package/lib/FormComp/VarTemplate/index.js +25 -23
- package/lib/FormComp/index.js +2 -2
- package/lib/NavLeafScroll/index.js +28 -28
- package/lib/RefactorTree/index.js +14 -14
- package/lib/RefactorTree/indexTreeNode.js +19 -19
- package/lib/SpecIcon/index.js +13 -13
- package/lib/SplitterLayout/Pane.js +4 -4
- package/lib/SplitterLayout/index.js +10 -10
- package/lib/StandardContent/SplitterLayout/Pane.js +11 -11
- package/lib/StandardContent/SplitterLayout/index.js +27 -27
- package/lib/StandardContent/SubfieldContent.js +9 -9
- package/lib/StandardContent/WrapperContent.js +7 -7
- package/lib/StandardDragModal/index.d.ts +11 -0
- package/lib/StandardDragModal/index.js +43 -0
- package/lib/StandardFilter/index.js +18 -18
- package/lib/StandardForm/ActionList.js +6 -6
- package/lib/StandardForm/StepForm.js +26 -26
- package/lib/StandardForm/TabForm.js +13 -13
- package/lib/StandardForm/index.js +14 -14
- package/lib/StandardModal/UpdateFormRef.js +4 -4
- package/lib/StandardModal/index.d.ts +3 -0
- package/lib/StandardModal/index.js +99 -70
- package/lib/StandardPanel/index.js +23 -23
- package/lib/StandardTable/index.js +9 -19
- package/lib/components/IconNode/index.js +6 -6
- package/lib/components/index.js +2 -2
- package/lib/data/func.code.js +2 -2
- package/lib/data/general.config.js +2 -2
- package/lib/data/index.js +3 -3
- package/lib/index.d.ts +0 -1
- package/lib/index.js +23 -32
- package/lib/utils/ValueFormat.js +2 -2
- package/lib/utils/filterPermission.js +2 -2
- package/lib/utils/index.js +2 -2
- package/package.json +4 -3
- package/es/ConfigContext/index.d.ts +0 -7
- package/es/ConfigContext/index.js +0 -12
- package/es/locale/index.d.ts +0 -12
- package/es/locale/index.js +0 -5
- package/es/locale/zh_CN.d.ts +0 -4
- package/es/locale/zh_CN.js +0 -34
- package/lib/ConfigContext/index.d.ts +0 -7
- package/lib/ConfigContext/index.js +0 -12
- package/lib/locale/index.d.ts +0 -12
- package/lib/locale/index.js +0 -5
- package/lib/locale/zh_CN.d.ts +0 -4
- package/lib/locale/zh_CN.js +0 -34
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getBase64 = getBase64;
|
|
7
|
-
exports.getAccept = getAccept;
|
|
8
|
-
|
|
9
|
-
function getBase64(file) {
|
|
1
|
+
export function getBase64(file) {
|
|
10
2
|
return new Promise(function (resolve) {
|
|
11
3
|
var reader = new FileReader();
|
|
12
4
|
reader.readAsDataURL(file);
|
|
@@ -26,8 +18,7 @@ function getBase64(file) {
|
|
|
26
18
|
};
|
|
27
19
|
});
|
|
28
20
|
}
|
|
29
|
-
|
|
30
|
-
function getAccept(fileType) {
|
|
21
|
+
export function getAccept(fileType) {
|
|
31
22
|
switch (fileType) {
|
|
32
23
|
case 'image':
|
|
33
24
|
return '.jpg,.png';
|
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
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); }
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
require("antd/es/tag/style");
|
|
11
|
-
|
|
12
|
-
var _tag = _interopRequireDefault(require("antd/es/tag"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/input/style");
|
|
15
|
-
|
|
16
|
-
var _input = _interopRequireDefault(require("antd/es/input"));
|
|
17
|
-
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
3
|
+
import "antd/es/tag/style";
|
|
4
|
+
import _Tag from "antd/es/tag";
|
|
5
|
+
import "antd/es/input/style";
|
|
6
|
+
import _Input from "antd/es/input";
|
|
25
7
|
|
|
26
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
27
9
|
|
|
@@ -43,13 +25,17 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
43
25
|
|
|
44
26
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
27
|
|
|
46
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
28
|
+
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; } }
|
|
47
29
|
|
|
48
30
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
31
|
|
|
50
32
|
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
33
|
|
|
52
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Created by S.C. on 2019/11/16.
|
|
36
|
+
*/
|
|
37
|
+
import React, { Component } from 'react';
|
|
38
|
+
var TextArea = _Input.TextArea;
|
|
53
39
|
var isIE = !!document.all;
|
|
54
40
|
|
|
55
41
|
var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
@@ -57,6 +43,19 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
57
43
|
|
|
58
44
|
var _super = _createSuper(VarTemplate);
|
|
59
45
|
|
|
46
|
+
_createClass(VarTemplate, null, [{
|
|
47
|
+
key: "getDerivedStateFromProps",
|
|
48
|
+
value: function getDerivedStateFromProps(nextProps) {
|
|
49
|
+
// console.log('执行getDerivedStateFromProps', nextProps)
|
|
50
|
+
// Should be a controlled component.
|
|
51
|
+
if ('value' in nextProps) {
|
|
52
|
+
return _objectSpread({}, nextProps.value || {});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}]);
|
|
58
|
+
|
|
60
59
|
function VarTemplate(props) {
|
|
61
60
|
var _this;
|
|
62
61
|
|
|
@@ -239,7 +238,7 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
239
238
|
wordCount: _value.length // 输入框内的字符数总和(包含占位符所需要的长度)
|
|
240
239
|
|
|
241
240
|
};
|
|
242
|
-
_this.content = /*#__PURE__*/
|
|
241
|
+
_this.content = /*#__PURE__*/React.createRef();
|
|
243
242
|
return _this;
|
|
244
243
|
}
|
|
245
244
|
|
|
@@ -256,24 +255,24 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
256
255
|
var _this$state3 = this.state,
|
|
257
256
|
currentContent = _this$state3.currentContent,
|
|
258
257
|
wordCount = _this$state3.wordCount;
|
|
259
|
-
return /*#__PURE__*/
|
|
258
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
260
259
|
className: "vart-wrap",
|
|
261
260
|
style: style,
|
|
262
261
|
ref: function ref(cRef) {
|
|
263
262
|
_this2.content = cRef;
|
|
264
263
|
}
|
|
265
|
-
}, tags && Array.isArray(tags) && /*#__PURE__*/
|
|
264
|
+
}, tags && Array.isArray(tags) && /*#__PURE__*/React.createElement("div", {
|
|
266
265
|
className: "vart-header"
|
|
267
266
|
}, tags.map(function (item) {
|
|
268
|
-
return /*#__PURE__*/
|
|
267
|
+
return /*#__PURE__*/React.createElement(_Tag, {
|
|
269
268
|
key: item.id,
|
|
270
269
|
onClick: function onClick() {
|
|
271
270
|
return !disabled && _this2.setTagWords(item.variableNameFormatted);
|
|
272
271
|
}
|
|
273
272
|
}, item.variableName);
|
|
274
|
-
})), /*#__PURE__*/
|
|
273
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
275
274
|
className: "vart-input"
|
|
276
|
-
}, /*#__PURE__*/
|
|
275
|
+
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
277
276
|
type: "text",
|
|
278
277
|
size: size,
|
|
279
278
|
value: currentContent,
|
|
@@ -286,21 +285,9 @@ var VarTemplate = /*#__PURE__*/function (_Component) {
|
|
|
286
285
|
disabled: disabled
|
|
287
286
|
})));
|
|
288
287
|
}
|
|
289
|
-
}], [{
|
|
290
|
-
key: "getDerivedStateFromProps",
|
|
291
|
-
value: function getDerivedStateFromProps(nextProps) {
|
|
292
|
-
// console.log('执行getDerivedStateFromProps', nextProps)
|
|
293
|
-
// Should be a controlled component.
|
|
294
|
-
if ('value' in nextProps) {
|
|
295
|
-
return _objectSpread({}, nextProps.value || {});
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
return null;
|
|
299
|
-
}
|
|
300
288
|
}]);
|
|
301
289
|
|
|
302
290
|
return VarTemplate;
|
|
303
|
-
}(
|
|
291
|
+
}(Component);
|
|
304
292
|
|
|
305
|
-
|
|
306
|
-
exports["default"] = _default;
|
|
293
|
+
export default VarTemplate;
|
package/es/FormComp/index.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Uploader", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Uploader["default"];
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _Uploader = _interopRequireDefault(require("./Uploader"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
export { default as Uploader } from './Uploader';
|
|
@@ -1,31 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
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); }
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/badge/style");
|
|
11
|
-
|
|
12
|
-
var _badge = _interopRequireDefault(require("antd/es/badge"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
|
-
var _index = _interopRequireDefault(require("../SpecIcon/index"));
|
|
17
|
-
|
|
18
|
-
var _lodash = _interopRequireDefault(require("lodash"));
|
|
19
|
-
|
|
20
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
|
-
require("./style/index.less");
|
|
23
|
-
|
|
24
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
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
|
-
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
3
|
+
import "antd/es/badge/style";
|
|
4
|
+
import _Badge from "antd/es/badge";
|
|
29
5
|
|
|
30
6
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
7
|
|
|
@@ -43,12 +19,19 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
43
19
|
|
|
44
20
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
45
21
|
|
|
46
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
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; } }
|
|
47
23
|
|
|
48
24
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
49
25
|
|
|
50
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; }
|
|
51
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
|
+
|
|
52
35
|
var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
53
36
|
_inherits(NavLeafScroll, _Component);
|
|
54
37
|
|
|
@@ -101,7 +84,7 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
101
84
|
});
|
|
102
85
|
|
|
103
86
|
if (activeKey && navList.length > 0) {
|
|
104
|
-
var matchIndex =
|
|
87
|
+
var matchIndex = _.findIndex(navList, function (item) {
|
|
105
88
|
return item[(optionName === null || optionName === void 0 ? void 0 : optionName.key) || 'id'] === activeKey;
|
|
106
89
|
});
|
|
107
90
|
|
|
@@ -206,9 +189,9 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
206
189
|
stepSize: 0 // 当前一页可容纳的单元格数量
|
|
207
190
|
|
|
208
191
|
};
|
|
209
|
-
_this.mainWrap = /*#__PURE__*/
|
|
210
|
-
_this.leafWrap = /*#__PURE__*/
|
|
211
|
-
_this.leafNav = /*#__PURE__*/
|
|
192
|
+
_this.mainWrap = /*#__PURE__*/React.createRef();
|
|
193
|
+
_this.leafWrap = /*#__PURE__*/React.createRef();
|
|
194
|
+
_this.leafNav = /*#__PURE__*/React.createRef();
|
|
212
195
|
_this.initFloorValues = _this.initFloorValues.bind(_assertThisInitialized(_this));
|
|
213
196
|
return _this;
|
|
214
197
|
}
|
|
@@ -280,7 +263,7 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
280
263
|
}
|
|
281
264
|
|
|
282
265
|
if (activeKey !== prevProps.activeKey) {
|
|
283
|
-
var matchIndex =
|
|
266
|
+
var matchIndex = _.findIndex(navList, function (item) {
|
|
284
267
|
return item[optionName.key] === activeKey;
|
|
285
268
|
});
|
|
286
269
|
|
|
@@ -324,8 +307,8 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
324
307
|
showArrow = _this$state4.showArrow,
|
|
325
308
|
arrowPermit = _this$state4.arrowPermit,
|
|
326
309
|
leafNavScrollY = _this$state4.leafNavScrollY;
|
|
327
|
-
return /*#__PURE__*/
|
|
328
|
-
className: (
|
|
310
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
311
|
+
className: classNames(className, "nav-leaf"),
|
|
329
312
|
style: width ? {
|
|
330
313
|
width: "".concat(width, "px")
|
|
331
314
|
} : {},
|
|
@@ -333,32 +316,32 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
333
316
|
,
|
|
334
317
|
onMouseEnter: this.mouseEnter,
|
|
335
318
|
onMouseLeave: this.mouseLeave
|
|
336
|
-
}, /*#__PURE__*/
|
|
319
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
337
320
|
className: "nav-leaf-container nav-leaf-container-scroll",
|
|
338
321
|
style: !showArrow || noArrowPadding ? {
|
|
339
322
|
padding: 0
|
|
340
323
|
} : {},
|
|
341
324
|
"data-prev": showArrow
|
|
342
|
-
}, /*#__PURE__*/
|
|
343
|
-
className: (
|
|
325
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
326
|
+
className: classNames("nav-leaf-arrow nav-leaf-btn-prev", showArrow ? '' : 'is-hide', arrowPermit.prev ? '' : 'is-disabled'),
|
|
344
327
|
onClick: function onClick() {
|
|
345
328
|
return arrowPermit.prev ? _this2.handleLeafControl('prev') : '';
|
|
346
329
|
}
|
|
347
|
-
}, /*#__PURE__*/
|
|
330
|
+
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
348
331
|
name: "caret-up"
|
|
349
|
-
})), /*#__PURE__*/
|
|
350
|
-
className: (
|
|
332
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
333
|
+
className: classNames("nav-leaf-arrow nav-leaf-btn-next", showArrow ? '' : 'is-hide', arrowPermit.next ? '' : 'is-disabled'),
|
|
351
334
|
onClick: function onClick() {
|
|
352
335
|
return arrowPermit.next ? _this2.handleLeafControl('next') : '';
|
|
353
336
|
}
|
|
354
|
-
}, /*#__PURE__*/
|
|
337
|
+
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
355
338
|
name: "caret-down"
|
|
356
|
-
})), /*#__PURE__*/
|
|
339
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
357
340
|
className: "nav-leaf-wrap",
|
|
358
341
|
ref: this.leafWrap
|
|
359
|
-
}, /*#__PURE__*/
|
|
342
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
360
343
|
className: "nav-leaf-scroll"
|
|
361
|
-
}, /*#__PURE__*/
|
|
344
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
362
345
|
className: "nav-leaf-nav",
|
|
363
346
|
ref: this.leafNav,
|
|
364
347
|
style: {
|
|
@@ -367,22 +350,22 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
367
350
|
}, navList && navList.length > 0 ? navList.map(function (item, i) {
|
|
368
351
|
var _this2$props;
|
|
369
352
|
|
|
370
|
-
return /*#__PURE__*/
|
|
353
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
371
354
|
key: item[optionName.key],
|
|
372
|
-
className: (
|
|
355
|
+
className: classNames('nav-leaf-item', activeKey && activeKey === item[optionName.key] ? 'is-active' : ''),
|
|
373
356
|
style: {
|
|
374
357
|
height: "".concat(((_this2$props = _this2.props) === null || _this2$props === void 0 ? void 0 : _this2$props.baseItemHeight) || 40, "px")
|
|
375
358
|
},
|
|
376
359
|
onClick: function onClick() {
|
|
377
360
|
return _this2.handleItemControl(item[optionName.key], item);
|
|
378
361
|
}
|
|
379
|
-
}, customLeafNode ? customLeafNode(item) : /*#__PURE__*/
|
|
362
|
+
}, customLeafNode ? customLeafNode(item) : /*#__PURE__*/React.createElement(React.Fragment, null, item[optionName.title] && /*#__PURE__*/React.createElement("span", {
|
|
380
363
|
className: "leaf-title"
|
|
381
|
-
}, "".concat(item[optionName.title]), " "), item[optionName.count] ? /*#__PURE__*/
|
|
364
|
+
}, "".concat(item[optionName.title]), " "), item[optionName.count] ? /*#__PURE__*/React.createElement("span", {
|
|
382
365
|
className: "leaf-extra"
|
|
383
|
-
}, " ", /*#__PURE__*/
|
|
366
|
+
}, " ", /*#__PURE__*/React.createElement(SpecIcon, {
|
|
384
367
|
name: "warn-fill"
|
|
385
|
-
}), /*#__PURE__*/
|
|
368
|
+
}), /*#__PURE__*/React.createElement(_Badge, {
|
|
386
369
|
className: "warning-count",
|
|
387
370
|
count: item[optionName.count]
|
|
388
371
|
})) : null));
|
|
@@ -391,7 +374,6 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
391
374
|
}]);
|
|
392
375
|
|
|
393
376
|
return NavLeafScroll;
|
|
394
|
-
}(
|
|
377
|
+
}(Component);
|
|
395
378
|
|
|
396
|
-
|
|
397
|
-
exports["default"] = _default;
|
|
379
|
+
export default NavLeafScroll;
|
package/es/RefactorTree/index.js
CHANGED
|
@@ -1,41 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import "antd/es/tree/style";
|
|
2
|
+
import _Tree from "antd/es/tree";
|
|
3
|
+
import "antd/es/empty/style";
|
|
4
|
+
import _Empty from "antd/es/empty";
|
|
5
|
+
import "antd/es/popconfirm/style";
|
|
6
|
+
import _Popconfirm from "antd/es/popconfirm";
|
|
2
7
|
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/tree/style");
|
|
11
|
-
|
|
12
|
-
var _tree = _interopRequireDefault(require("antd/es/tree"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/empty/style");
|
|
15
|
-
|
|
16
|
-
var _empty = _interopRequireDefault(require("antd/es/empty"));
|
|
17
|
-
|
|
18
|
-
require("antd/es/popconfirm/style");
|
|
19
|
-
|
|
20
|
-
var _popconfirm = _interopRequireDefault(require("antd/es/popconfirm"));
|
|
21
|
-
|
|
22
|
-
var _tslib = require("tslib");
|
|
23
|
-
|
|
24
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
25
|
-
|
|
26
|
-
var _index = _interopRequireDefault(require("../SpecIcon/index"));
|
|
27
|
-
|
|
28
|
-
var _util = require("./util");
|
|
29
|
-
|
|
30
|
-
require("./style/index.less");
|
|
31
|
-
|
|
32
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
33
|
-
|
|
34
|
-
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; }
|
|
8
|
+
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; }
|
|
35
9
|
|
|
36
|
-
|
|
10
|
+
import { __rest } from "tslib"; // 重构树控件,可直接配置数据
|
|
37
11
|
|
|
38
|
-
|
|
12
|
+
import React, { useMemo } from 'react';
|
|
13
|
+
import SpecIcon from '../SpecIcon/index';
|
|
14
|
+
import { transDataParam, resetDataWithLimit, resetDataWithDisabled } from './util';
|
|
15
|
+
import './style/index.less';
|
|
39
16
|
|
|
40
17
|
var RefactorTree = function RefactorTree(props) {
|
|
41
18
|
var treeData = props.treeData,
|
|
@@ -61,13 +38,14 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
61
38
|
onCheck = props.onCheck,
|
|
62
39
|
titleRender = props.titleRender,
|
|
63
40
|
disabledFields = props.disabledFields,
|
|
64
|
-
otherProps =
|
|
41
|
+
otherProps = __rest(props, ["treeData", "rootName", "rootKey", "emptyDescription", "optionName", "defaultSelectedKeys", "nodeExtra", "selectable", "nodeControl", "limitKey", "checkedKeys", "checkStrictly", "onSelect", "onCheck", "titleRender", "disabledFields"]); // const { title, value, children, disabled } = { value: 'value', title: 'title', children: 'children', disabled: 'disabled', ...optionName }
|
|
65
42
|
// 重新组合指定数据源字段
|
|
66
43
|
|
|
67
|
-
|
|
44
|
+
|
|
45
|
+
var transTreeData = useMemo(function () {
|
|
68
46
|
var _ref;
|
|
69
47
|
|
|
70
|
-
var afterTransData =
|
|
48
|
+
var afterTransData = transDataParam(treeData, optionName); // 通过转换后的数据
|
|
71
49
|
|
|
72
50
|
var resultData; // 如果有配置根节点,则添加 一个根节点数据
|
|
73
51
|
|
|
@@ -75,12 +53,12 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
75
53
|
|
|
76
54
|
if (checkStrictly && limitKey && checkedKeys) {
|
|
77
55
|
if (Array.isArray(checkedKeys) && checkedKeys.length > 0 || checkedKeys && Array.isArray(checkedKeys.checked) && checkedKeys.checked.length > 0) {
|
|
78
|
-
resultData =
|
|
56
|
+
resultData = resetDataWithLimit(Array.isArray(checkedKeys) ? checkedKeys : checkedKeys.checked, resultData, optionName, limitKey);
|
|
79
57
|
}
|
|
80
58
|
}
|
|
81
59
|
|
|
82
60
|
if (disabledFields && Array.isArray(disabledFields)) {
|
|
83
|
-
resultData =
|
|
61
|
+
resultData = resetDataWithDisabled(resultData, optionName, disabledFields);
|
|
84
62
|
}
|
|
85
63
|
|
|
86
64
|
return resultData;
|
|
@@ -128,35 +106,35 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
128
106
|
|
|
129
107
|
var renderNodeTitle = function renderNodeTitle(item) {
|
|
130
108
|
if (titleRender) return titleRender(item);
|
|
131
|
-
return /*#__PURE__*/
|
|
109
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, item[optionName.title || 'title'], nodeControl ? /*#__PURE__*/React.createElement("span", {
|
|
132
110
|
className: "treeControl"
|
|
133
|
-
}, /*#__PURE__*/
|
|
111
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
134
112
|
onClick: function onClick(e) {
|
|
135
113
|
handleNodeControl(e, 'edit', item);
|
|
136
114
|
}
|
|
137
|
-
}, /*#__PURE__*/
|
|
115
|
+
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
138
116
|
name: 'edit'
|
|
139
|
-
})), /*#__PURE__*/
|
|
117
|
+
})), /*#__PURE__*/React.createElement(_Popconfirm, {
|
|
140
118
|
placement: 'top',
|
|
141
119
|
title: "\u786E\u5B9A\u8981\u5220\u9664\uFF1A".concat(item[optionName.title || 'title'], "\u5417\uFF1F"),
|
|
142
|
-
icon: /*#__PURE__*/
|
|
120
|
+
icon: /*#__PURE__*/React.createElement(SpecIcon, {
|
|
143
121
|
name: "question"
|
|
144
122
|
}),
|
|
145
123
|
onConfirm: function onConfirm(e) {
|
|
146
124
|
handleNodeControl(e, 'delete', item);
|
|
147
125
|
}
|
|
148
|
-
}, /*#__PURE__*/
|
|
126
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
149
127
|
onClick: function onClick(e) {
|
|
150
128
|
return e.stopPropagation();
|
|
151
129
|
}
|
|
152
|
-
}, /*#__PURE__*/
|
|
130
|
+
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
153
131
|
name: 'delete'
|
|
154
132
|
})))) : null, nodeExtra && nodeExtra(item));
|
|
155
133
|
};
|
|
156
134
|
|
|
157
135
|
if (transTreeData.length == 0) {
|
|
158
|
-
return /*#__PURE__*/
|
|
159
|
-
image:
|
|
136
|
+
return /*#__PURE__*/React.createElement(_Empty, {
|
|
137
|
+
image: _Empty.PRESENTED_IMAGE_SIMPLE,
|
|
160
138
|
description: emptyDescription
|
|
161
139
|
});
|
|
162
140
|
} else {
|
|
@@ -168,7 +146,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
168
146
|
defExpand = rootKey ? [rootKey] : ['0'];
|
|
169
147
|
}
|
|
170
148
|
|
|
171
|
-
return /*#__PURE__*/
|
|
149
|
+
return /*#__PURE__*/React.createElement(_Tree, Object.assign({}, otherProps, {
|
|
172
150
|
onSelect: function onSelect(keys, e) {
|
|
173
151
|
return handleToSelectTreeNode(keys, e);
|
|
174
152
|
},
|
|
@@ -186,5 +164,4 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
186
164
|
}
|
|
187
165
|
};
|
|
188
166
|
|
|
189
|
-
|
|
190
|
-
exports["default"] = _default;
|
|
167
|
+
export default RefactorTree;
|