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,37 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/empty/style");
|
|
11
|
-
|
|
12
|
-
var _empty = _interopRequireDefault(require("antd/es/empty"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/popconfirm/style");
|
|
15
|
-
|
|
16
|
-
var _popconfirm = _interopRequireDefault(require("antd/es/popconfirm"));
|
|
17
|
-
|
|
18
|
-
require("antd/es/tree/style");
|
|
19
|
-
|
|
20
|
-
var _tree = _interopRequireDefault(require("antd/es/tree"));
|
|
21
|
-
|
|
22
|
-
var _tslib = require("tslib");
|
|
23
|
-
|
|
24
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
25
|
-
|
|
26
|
-
var _index = _interopRequireDefault(require("../SpecIcon/index"));
|
|
27
|
-
|
|
28
|
-
require("./style/index.less");
|
|
29
|
-
|
|
30
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
import "antd/es/empty/style";
|
|
2
|
+
import _Empty from "antd/es/empty";
|
|
3
|
+
import "antd/es/popconfirm/style";
|
|
4
|
+
import _Popconfirm from "antd/es/popconfirm";
|
|
5
|
+
import "antd/es/tree/style";
|
|
6
|
+
import _Tree from "antd/es/tree";
|
|
35
7
|
|
|
36
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
9
|
|
|
@@ -45,7 +17,12 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
45
17
|
|
|
46
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
19
|
|
|
48
|
-
|
|
20
|
+
import { __rest } from "tslib"; // 重构树控件,可直接配置数据
|
|
21
|
+
|
|
22
|
+
import React, { useEffect, useState } from 'react';
|
|
23
|
+
import SpecIcon from '../SpecIcon/index';
|
|
24
|
+
var TreeNode = _Tree.TreeNode;
|
|
25
|
+
import './style/index.less';
|
|
49
26
|
|
|
50
27
|
var RefactorTree = function RefactorTree(props) {
|
|
51
28
|
var treeData = props.treeData,
|
|
@@ -71,10 +48,11 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
71
48
|
checkStrictly = props.checkStrictly,
|
|
72
49
|
onSelect = props.onSelect,
|
|
73
50
|
onCheck = props.onCheck,
|
|
74
|
-
otherProps =
|
|
51
|
+
otherProps = __rest(props, ["treeData", "rootName", "rootKey", "rootIcon", "emptyDescription", "optionName", "defaultSelectedKeys", "nodeItemReset", "nodeExtra", "selectable", "nodeControl", "limitKey", "checkedKeys", "checkStrictly", "onSelect", "onCheck"]); // 重新组合指定数据源字段 (limitKey:用于限制只能选择指定同一层级的数据)
|
|
75
52
|
// const { title, value, children, disabled } = { value: 'value', title: 'title', children: 'children', disabled: 'disabled', ...optionName }
|
|
76
53
|
|
|
77
|
-
|
|
54
|
+
|
|
55
|
+
var _useState = useState([]),
|
|
78
56
|
_useState2 = _slicedToArray(_useState, 2),
|
|
79
57
|
dataList = _useState2[0],
|
|
80
58
|
setDataList = _useState2[1]; // 限制节点选中条件下更新列表数据
|
|
@@ -116,7 +94,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
116
94
|
}
|
|
117
95
|
};
|
|
118
96
|
|
|
119
|
-
|
|
97
|
+
useEffect(function () {
|
|
120
98
|
// 有配置limitKey指定限制同级节点时,添加判断节点选择限制(在父子节点不相关联条件下使用checkStrictly=true)
|
|
121
99
|
if (checkStrictly && limitKey && checkedKeys) {
|
|
122
100
|
if (Array.isArray(checkedKeys) && checkedKeys.length > 0 || checkedKeys && Array.isArray(checkedKeys.checked) && checkedKeys.checked.length > 0) {
|
|
@@ -173,30 +151,30 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
173
151
|
|
|
174
152
|
|
|
175
153
|
var renderNodeTitle = function renderNodeTitle(item) {
|
|
176
|
-
return /*#__PURE__*/
|
|
154
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, nodeItemReset && nodeItemReset(item).icon || (item.icon ? /*#__PURE__*/React.createElement(SpecIcon, {
|
|
177
155
|
name: item.icon
|
|
178
|
-
}) : null), " ", item[optionName.title || 'title'], nodeControl ? /*#__PURE__*/
|
|
156
|
+
}) : null), " ", item[optionName.title || 'title'], nodeControl ? /*#__PURE__*/React.createElement("span", {
|
|
179
157
|
className: "treeControl"
|
|
180
|
-
}, /*#__PURE__*/
|
|
158
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
181
159
|
onClick: function onClick(e) {
|
|
182
160
|
handleNodeControl(e, 'edit', item);
|
|
183
161
|
}
|
|
184
|
-
}, /*#__PURE__*/
|
|
162
|
+
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
185
163
|
name: 'edit'
|
|
186
|
-
})), /*#__PURE__*/
|
|
164
|
+
})), /*#__PURE__*/React.createElement(_Popconfirm, {
|
|
187
165
|
placement: 'top',
|
|
188
166
|
title: "\u786E\u5B9A\u8981\u5220\u9664\uFF1A".concat(item[optionName.title || 'title'], "\u5417\uFF1F"),
|
|
189
|
-
icon: /*#__PURE__*/
|
|
167
|
+
icon: /*#__PURE__*/React.createElement(SpecIcon, {
|
|
190
168
|
name: "question"
|
|
191
169
|
}),
|
|
192
170
|
onConfirm: function onConfirm(e) {
|
|
193
171
|
handleNodeControl(e, 'delete', item);
|
|
194
172
|
}
|
|
195
|
-
}, /*#__PURE__*/
|
|
173
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
196
174
|
onClick: function onClick(e) {
|
|
197
175
|
return e.stopPropagation();
|
|
198
176
|
}
|
|
199
|
-
}, /*#__PURE__*/
|
|
177
|
+
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
200
178
|
name: 'delete'
|
|
201
179
|
})))) : null, nodeExtra && nodeExtra);
|
|
202
180
|
};
|
|
@@ -204,7 +182,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
204
182
|
var renderTreeNodes = function renderTreeNodes(data) {
|
|
205
183
|
return data.map(function (item) {
|
|
206
184
|
if (item[optionName.children || 'children']) {
|
|
207
|
-
return /*#__PURE__*/
|
|
185
|
+
return /*#__PURE__*/React.createElement(TreeNode, Object.assign({}, item, {
|
|
208
186
|
title: renderNodeTitle(item),
|
|
209
187
|
key: item[optionName.value || 'value'],
|
|
210
188
|
className: selectable ? '' : "notPointer",
|
|
@@ -213,7 +191,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
213
191
|
}), renderTreeNodes(item[optionName.children || 'children']));
|
|
214
192
|
}
|
|
215
193
|
|
|
216
|
-
return /*#__PURE__*/
|
|
194
|
+
return /*#__PURE__*/React.createElement(TreeNode, Object.assign({}, item, {
|
|
217
195
|
title: renderNodeTitle(item),
|
|
218
196
|
key: item[optionName.value || 'value'],
|
|
219
197
|
className: selectable ? '' : "notPointer",
|
|
@@ -223,8 +201,8 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
223
201
|
});
|
|
224
202
|
};
|
|
225
203
|
|
|
226
|
-
if (dataList.length == 0 && !rootName) return /*#__PURE__*/
|
|
227
|
-
image:
|
|
204
|
+
if (dataList.length == 0 && !rootName) return /*#__PURE__*/React.createElement(_Empty, {
|
|
205
|
+
image: _Empty.PRESENTED_IMAGE_SIMPLE,
|
|
228
206
|
description: emptyDescription
|
|
229
207
|
});
|
|
230
208
|
var defExpand = [];
|
|
@@ -235,7 +213,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
235
213
|
defExpand = rootKey ? [rootKey] : ['0'];
|
|
236
214
|
}
|
|
237
215
|
|
|
238
|
-
return /*#__PURE__*/
|
|
216
|
+
return /*#__PURE__*/React.createElement(_Tree, // switcherIcon={<Icon type="down" />}
|
|
239
217
|
Object.assign({}, otherProps, {
|
|
240
218
|
onSelect: function onSelect(keys, e) {
|
|
241
219
|
return handleToSelectTreeNode(keys, e);
|
|
@@ -248,7 +226,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
248
226
|
selectable: selectable,
|
|
249
227
|
checkedKeys: checkedKeys,
|
|
250
228
|
checkStrictly: checkStrictly
|
|
251
|
-
}), rootName ? /*#__PURE__*/
|
|
229
|
+
}), rootName ? /*#__PURE__*/React.createElement(TreeNode, {
|
|
252
230
|
title: rootName,
|
|
253
231
|
key: rootKey || '0',
|
|
254
232
|
className: selectable ? '' : "notPointer",
|
|
@@ -256,5 +234,4 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
256
234
|
}, renderTreeNodes(dataList)) : renderTreeNodes(dataList));
|
|
257
235
|
};
|
|
258
236
|
|
|
259
|
-
|
|
260
|
-
exports["default"] = _default;
|
|
237
|
+
export default RefactorTree;
|
package/es/RefactorTree/util.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.transDataParam = transDataParam;
|
|
7
|
-
exports.resetDataWithLimit = resetDataWithLimit;
|
|
8
|
-
exports.resetDataWithDisabled = resetDataWithDisabled;
|
|
9
|
-
|
|
10
|
-
var _tslib = require("tslib");
|
|
11
|
-
|
|
12
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13
2
|
|
|
14
3
|
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."); }
|
|
@@ -21,6 +10,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
21
10
|
|
|
22
11
|
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; }
|
|
23
12
|
|
|
13
|
+
import { __rest } from "tslib";
|
|
24
14
|
/**
|
|
25
15
|
* transDataParam 根据指定选项字段名重组数据
|
|
26
16
|
*
|
|
@@ -28,7 +18,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
28
18
|
* @params {object} optionName 选项字段值
|
|
29
19
|
*
|
|
30
20
|
* */
|
|
31
|
-
|
|
21
|
+
|
|
22
|
+
export function transDataParam(array) {
|
|
32
23
|
var optionName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
33
24
|
key: 'key',
|
|
34
25
|
value: 'key',
|
|
@@ -74,8 +65,7 @@ function transDataParam(array) {
|
|
|
74
65
|
*
|
|
75
66
|
* */
|
|
76
67
|
|
|
77
|
-
|
|
78
|
-
function resetDataWithLimit(hasKeys, list) {
|
|
68
|
+
export function resetDataWithLimit(hasKeys, list) {
|
|
79
69
|
var optionName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
80
70
|
key: 'key',
|
|
81
71
|
value: 'key',
|
|
@@ -111,7 +101,8 @@ function resetDataWithLimit(hasKeys, list) {
|
|
|
111
101
|
if (!matchDataValue) return preList;
|
|
112
102
|
return preList === null || preList === void 0 ? void 0 : preList.map(function (preItem) {
|
|
113
103
|
var oldItem = Object.assign({}, preItem);
|
|
114
|
-
|
|
104
|
+
|
|
105
|
+
var item = __rest(oldItem, []);
|
|
115
106
|
|
|
116
107
|
if (item[limitKey] !== matchDataValue) {
|
|
117
108
|
item.disabled = true;
|
|
@@ -154,14 +145,15 @@ function resetDataWithLimit(hasKeys, list) {
|
|
|
154
145
|
*
|
|
155
146
|
* */
|
|
156
147
|
|
|
157
|
-
|
|
158
|
-
function resetDataWithDisabled(list, optionName, disabledFields) {
|
|
148
|
+
export function resetDataWithDisabled(list, optionName, disabledFields) {
|
|
159
149
|
// 筛选与禁用字段内值相同的节点进行禁用
|
|
160
150
|
var filterResetTargetFields = function filterResetTargetFields(preList, fields) {
|
|
161
151
|
if (!preList) return [];
|
|
162
152
|
return preList.map(function (preItem) {
|
|
163
153
|
var oldItem = Object.assign({}, preItem);
|
|
164
|
-
|
|
154
|
+
|
|
155
|
+
var item = __rest(oldItem, []);
|
|
156
|
+
|
|
165
157
|
Object.keys(item).forEach(function (itemKeyName) {
|
|
166
158
|
var _a;
|
|
167
159
|
|
package/es/SpecIcon/index.js
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _tslib = require("tslib");
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
require("./style/index.less");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import './style/index.less';
|
|
17
5
|
|
|
18
6
|
require('./fonts/iconfont.js'); // import './fonts/iconfont.js';
|
|
19
7
|
|
|
20
8
|
|
|
21
|
-
var SpecIcon = /*#__PURE__*/
|
|
9
|
+
var SpecIcon = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
22
10
|
var _props$type = props.type,
|
|
23
11
|
type = _props$type === void 0 ? "colour" : _props$type,
|
|
24
12
|
name = props.name,
|
|
@@ -33,7 +21,8 @@ var SpecIcon = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
33
21
|
_props$noPrefix = props.noPrefix,
|
|
34
22
|
noPrefix = _props$noPrefix === void 0 ? false : _props$noPrefix,
|
|
35
23
|
className = props.className,
|
|
36
|
-
otherProps =
|
|
24
|
+
otherProps = __rest(props, ["type", "name", "size", "status", "round", "title", "onClick", "style", "prefix", "noPrefix", "className"]);
|
|
25
|
+
|
|
37
26
|
var extraClassName = '';
|
|
38
27
|
if (status) extraClassName += " is-".concat(status);
|
|
39
28
|
var fontStyle = {};
|
|
@@ -46,8 +35,8 @@ var SpecIcon = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
46
35
|
|
|
47
36
|
var renderIconFont = function renderIconFont() {
|
|
48
37
|
if (round) extraClassName += " is-round";
|
|
49
|
-
return /*#__PURE__*/
|
|
50
|
-
className: (
|
|
38
|
+
return /*#__PURE__*/React.createElement("i", Object.assign({
|
|
39
|
+
className: classNames("specicon", "specicon-font", noPrefix ? '' : "".concat(prefix, "font"), noPrefix ? "".concat(name) : "".concat(prefix ? prefix + '-' : '').concat(name), extraClassName, name === 'loading' ? 'anticon-spin' : '', className),
|
|
51
40
|
title: title,
|
|
52
41
|
onClick: onClick,
|
|
53
42
|
style: Object.assign(Object.assign({}, fontStyle), style),
|
|
@@ -57,34 +46,32 @@ var SpecIcon = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
57
46
|
|
|
58
47
|
var renderIconSvg = function renderIconSvg() {
|
|
59
48
|
var baseElement = function baseElement() {
|
|
60
|
-
return /*#__PURE__*/
|
|
61
|
-
className: (
|
|
49
|
+
return /*#__PURE__*/React.createElement("i", Object.assign({
|
|
50
|
+
className: classNames("specicon", 'anticon', noPrefix ? "".concat(name, "-svg") : "".concat(prefix ? prefix + '-' : '').concat(name, "-svg"), !round && extraClassName, className),
|
|
62
51
|
style: Object.assign(Object.assign({}, fontStyle), style),
|
|
63
52
|
title: title,
|
|
64
53
|
onClick: onClick,
|
|
65
54
|
ref: ref
|
|
66
|
-
}, otherProps), /*#__PURE__*/
|
|
55
|
+
}, otherProps), /*#__PURE__*/React.createElement("svg", {
|
|
67
56
|
width: "1em",
|
|
68
57
|
height: "1em",
|
|
69
58
|
fill: "currentColor",
|
|
70
59
|
"aria-hidden": "true",
|
|
71
60
|
focusable: "false",
|
|
72
61
|
className: name === 'loading' ? 'anticon-spin' : ''
|
|
73
|
-
}, noPrefix ? /*#__PURE__*/
|
|
62
|
+
}, noPrefix ? /*#__PURE__*/React.createElement("use", {
|
|
74
63
|
xlinkHref: "#".concat(name)
|
|
75
|
-
}) : /*#__PURE__*/
|
|
64
|
+
}) : /*#__PURE__*/React.createElement("use", {
|
|
76
65
|
xlinkHref: "#".concat(prefix ? prefix + '-' : '').concat(name)
|
|
77
66
|
})));
|
|
78
67
|
};
|
|
79
68
|
|
|
80
|
-
return round ? /*#__PURE__*/
|
|
81
|
-
className: (
|
|
69
|
+
return round ? /*#__PURE__*/React.createElement("span", {
|
|
70
|
+
className: classNames('specicon-round', status && "is-".concat(status))
|
|
82
71
|
}, baseElement()) : baseElement();
|
|
83
72
|
}; // 去除引入 font图标
|
|
84
73
|
|
|
85
74
|
|
|
86
75
|
return type === 'colour' ? renderIconSvg() : renderIconFont();
|
|
87
76
|
});
|
|
88
|
-
|
|
89
|
-
var _default = SpecIcon;
|
|
90
|
-
exports["default"] = _default;
|
|
77
|
+
export default SpecIcon;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
require("./index.less");
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
//
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less'; //
|
|
15
3
|
// Pane.defaultProps = {
|
|
16
4
|
// paneClassName:'',
|
|
17
5
|
// vertical: false,
|
|
@@ -20,6 +8,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
20
8
|
// percentage: false,
|
|
21
9
|
// children: []
|
|
22
10
|
// };
|
|
11
|
+
|
|
23
12
|
function Pane(props) {
|
|
24
13
|
var size = props.size || 0;
|
|
25
14
|
var unit = props.percentage ? '%' : 'px';
|
|
@@ -38,11 +27,10 @@ function Pane(props) {
|
|
|
38
27
|
classes += ' layout-pane-primary';
|
|
39
28
|
}
|
|
40
29
|
|
|
41
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
31
|
className: classes,
|
|
43
32
|
style: Object.assign(Object.assign({}, props.paneStyle), style)
|
|
44
33
|
}, props.children);
|
|
45
34
|
}
|
|
46
35
|
|
|
47
|
-
|
|
48
|
-
exports["default"] = _default;
|
|
36
|
+
export default Pane;
|
|
@@ -1,20 +1,5 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _Pane = _interopRequireDefault(require("./Pane"));
|
|
13
|
-
|
|
14
|
-
require("./index.less");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
4
|
|
|
20
5
|
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); } }
|
|
@@ -31,10 +16,15 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
31
16
|
|
|
32
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
18
|
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
19
|
+
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; } }
|
|
35
20
|
|
|
36
21
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
22
|
|
|
23
|
+
import React from 'react'; // import PropTypes from 'prop-types';
|
|
24
|
+
|
|
25
|
+
import Pane from './Pane';
|
|
26
|
+
import './index.less';
|
|
27
|
+
|
|
38
28
|
function clearSelection() {
|
|
39
29
|
if (document.body.createTextRange) {
|
|
40
30
|
// https://github.com/zesik/react-splitter-layout/issues/16
|
|
@@ -293,10 +283,10 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
293
283
|
containerClasses += ' layout-changing';
|
|
294
284
|
}
|
|
295
285
|
|
|
296
|
-
var children =
|
|
286
|
+
var children = React.Children.toArray(this.props.children).slice(0, 2);
|
|
297
287
|
|
|
298
288
|
if (children.length === 0) {
|
|
299
|
-
children.push( /*#__PURE__*/
|
|
289
|
+
children.push( /*#__PURE__*/React.createElement("div", null));
|
|
300
290
|
}
|
|
301
291
|
|
|
302
292
|
var wrappedChildren = [];
|
|
@@ -313,7 +303,7 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
313
303
|
size = this.state.secondaryPaneSize;
|
|
314
304
|
}
|
|
315
305
|
|
|
316
|
-
wrappedChildren.push( /*#__PURE__*/
|
|
306
|
+
wrappedChildren.push( /*#__PURE__*/React.createElement(Pane, {
|
|
317
307
|
vertical: vertical,
|
|
318
308
|
percentage: this.props.percentage,
|
|
319
309
|
primary: primary,
|
|
@@ -323,13 +313,13 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
323
313
|
}, children[i]));
|
|
324
314
|
}
|
|
325
315
|
|
|
326
|
-
return /*#__PURE__*/
|
|
316
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
327
317
|
className: containerClasses,
|
|
328
318
|
style: this.props.containerStyle,
|
|
329
319
|
ref: function ref(c) {
|
|
330
320
|
_this2.container = c;
|
|
331
321
|
}
|
|
332
|
-
}, wrappedChildren[0], wrappedChildren.length > 1 && /*#__PURE__*/
|
|
322
|
+
}, wrappedChildren[0], wrappedChildren.length > 1 && /*#__PURE__*/React.createElement("div", {
|
|
333
323
|
role: "separator",
|
|
334
324
|
className: "layout-splitter ".concat(!this.props.vertical && 'layout-splitter-horizontal', " ").concat(this.props.splitterClassName),
|
|
335
325
|
style: this.props.splitterStyle,
|
|
@@ -343,7 +333,7 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
343
333
|
}]);
|
|
344
334
|
|
|
345
335
|
return SplitterLayout;
|
|
346
|
-
}(
|
|
336
|
+
}(React.Component); //
|
|
347
337
|
// SplitterLayout.propTypes = {
|
|
348
338
|
// containerStyle: PropTypes.object,
|
|
349
339
|
// customClassName: PropTypes.string,
|
|
@@ -382,5 +372,4 @@ var SplitterLayout = /*#__PURE__*/function (_React$Component) {
|
|
|
382
372
|
// };
|
|
383
373
|
|
|
384
374
|
|
|
385
|
-
|
|
386
|
-
exports["default"] = _default;
|
|
375
|
+
export default SplitterLayout;
|
|
@@ -1,24 +1,13 @@
|
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
|
-
require("./index.less");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
1
|
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; }
|
|
17
2
|
|
|
18
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
4
|
|
|
20
5
|
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; }
|
|
21
6
|
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import './index.less';
|
|
10
|
+
|
|
22
11
|
function Pane(props) {
|
|
23
12
|
var size = props.size || 0;
|
|
24
13
|
var unit = props.percentage ? '%' : 'px';
|
|
@@ -35,20 +24,20 @@ function Pane(props) {
|
|
|
35
24
|
classes += ' layout-pane-primary';
|
|
36
25
|
}
|
|
37
26
|
|
|
38
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
28
|
className: classes,
|
|
40
29
|
style: _objectSpread(_objectSpread({}, props.paneStyle), style)
|
|
41
30
|
}, props.children);
|
|
42
31
|
}
|
|
43
32
|
|
|
44
33
|
Pane.propTypes = {
|
|
45
|
-
paneClassName:
|
|
46
|
-
paneStyle:
|
|
47
|
-
vertical:
|
|
48
|
-
primary:
|
|
49
|
-
size:
|
|
50
|
-
percentage:
|
|
51
|
-
children:
|
|
34
|
+
paneClassName: PropTypes.string,
|
|
35
|
+
paneStyle: PropTypes.object,
|
|
36
|
+
vertical: PropTypes.bool,
|
|
37
|
+
primary: PropTypes.bool,
|
|
38
|
+
size: PropTypes.number,
|
|
39
|
+
percentage: PropTypes.bool,
|
|
40
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
|
|
52
41
|
};
|
|
53
42
|
Pane.defaultProps = {
|
|
54
43
|
paneClassName: '',
|
|
@@ -58,5 +47,4 @@ Pane.defaultProps = {
|
|
|
58
47
|
percentage: false,
|
|
59
48
|
children: []
|
|
60
49
|
};
|
|
61
|
-
|
|
62
|
-
exports["default"] = _default;
|
|
50
|
+
export default Pane;
|