tntd 1.4.20 → 1.4.22
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/components/Handle/README.md +0 -20
- package/components/Handle/index.js +44 -7
- package/components/locale.js +8 -2
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24430 -24390
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -8
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +108 -76
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +38 -31
- package/es/DevelopmentLogin/LoginModal.js +45 -32
- package/es/DevelopmentLogin/index.js +17 -13
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +69 -58
- package/es/Handle/README.md +0 -20
- package/es/Handle/index.js +100 -33
- package/es/Icon/fonts/iconfont.js +12 -7
- package/es/Icon/index.js +13 -10
- package/es/Img/Contain.js +29 -24
- package/es/Img/Cover.js +54 -40
- package/es/Img/index.js +45 -36
- package/es/Layout/ActionsContext.js +2 -3
- package/es/Layout/AppList.js +92 -37
- package/es/Layout/Application.js +72 -26
- package/es/Layout/Avatar.js +66 -29
- package/es/Layout/CompatibleLanguage.js +94 -39
- package/es/Layout/EnterpriseLayout/Avatar.js +76 -38
- package/es/Layout/EnterpriseLayout/Language.js +32 -14
- package/es/Layout/EnterpriseLayout/Theme.js +34 -16
- package/es/Layout/EnterpriseLayout/index.js +16 -14
- package/es/Layout/GlobalNavigation/NavigationPopup.js +170 -59
- package/es/Layout/GlobalNavigation/index.js +54 -20
- package/es/Layout/Header.js +46 -25
- package/es/Layout/HeaderActions.js +56 -42
- package/es/Layout/HeaderNavs.js +47 -20
- package/es/Layout/HeaderTabs.js +102 -49
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +32 -14
- package/es/Layout/Layout.js +108 -86
- package/es/Layout/Logo.js +32 -16
- package/es/Layout/OrgAppList.js +107 -62
- package/es/Layout/SideMenu.js +124 -63
- package/es/Layout/Theme.js +61 -23
- package/es/Layout/checkAuth.js +29 -0
- package/es/Layout/index.js +34 -26
- package/es/Layout/paaslayout/CompactSideMenu.js +74 -35
- package/es/Layout/paaslayout/Header.js +45 -22
- package/es/Layout/paaslayout/Logo.js +13 -3
- package/es/Layout/paaslayout/SideMenu.js +78 -39
- package/es/Layout/paaslayout/index.js +102 -75
- package/es/Layout/storage.js +9 -10
- package/es/Layout/utils.js +136 -0
- package/es/LoadingButton/index.js +24 -15
- package/es/Modal/index.js +46 -38
- package/es/Page/Box.js +41 -34
- package/es/Page/index.js +67 -52
- package/es/Page/utils.js +5 -0
- package/es/QueryForm/Field/Checkbox.js +9 -5
- package/es/QueryForm/Field/Select.js +41 -31
- package/es/QueryForm/Field/SelectInput.js +41 -26
- package/es/QueryForm/Field/fieldsMap.js +1 -0
- package/es/QueryForm/Field/index.js +71 -41
- package/es/QueryForm/createActions.js +7 -6
- package/es/QueryForm/index.js +135 -76
- package/es/QueryListScene/List.js +128 -74
- package/es/QueryListScene/QueryForm.js +81 -46
- package/es/QueryListScene/QueryListScene.js +40 -25
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +12 -11
- package/es/Select/DropDownWrap.js +50 -29
- package/es/Select/index.js +231 -135
- package/es/Table/ResizableTable/index.js +40 -26
- package/es/Table/index.js +16 -18
- package/es/Title/index.js +23 -21
- package/es/locale.js +11 -3
- package/es/utils/checkAuth.js +5 -3
- package/es/utils/findMenuInfoByPath.js +4 -0
- package/es/utils/index.js +23 -12
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +127 -78
- package/lib/AuthContext.js +4 -1
- package/lib/Columns/index.js +47 -31
- package/lib/DevelopmentLogin/LoginModal.js +58 -32
- package/lib/DevelopmentLogin/index.js +27 -16
- package/lib/Ellipsis/Svg/CopySVG.js +15 -13
- package/lib/Ellipsis/Svg/TickSVG.js +10 -8
- package/lib/Ellipsis/index.js +80 -57
- package/lib/Handle/README.md +0 -20
- package/lib/Handle/index.js +119 -33
- package/lib/Icon/fonts/iconfont.js +12 -7
- package/lib/Icon/index.js +20 -11
- package/lib/Img/Contain.js +34 -24
- package/lib/Img/Cover.js +65 -42
- package/lib/Img/index.js +51 -36
- package/lib/Layout/ActionsContext.js +4 -1
- package/lib/Layout/AppList.js +118 -40
- package/lib/Layout/Application.js +86 -26
- package/lib/Layout/Avatar.js +86 -32
- package/lib/Layout/CompatibleLanguage.js +110 -39
- package/lib/Layout/EnterpriseLayout/Avatar.js +100 -41
- package/lib/Layout/EnterpriseLayout/Header.js +113 -0
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +104 -0
- package/lib/Layout/EnterpriseLayout/Language.js +48 -17
- package/lib/Layout/EnterpriseLayout/Theme.js +44 -16
- package/lib/Layout/EnterpriseLayout/index.js +23 -14
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +186 -59
- package/lib/Layout/GlobalNavigation/index.js +74 -23
- package/lib/Layout/Header.js +63 -28
- package/lib/Layout/HeaderActions.js +74 -45
- package/lib/Layout/HeaderNavs.js +61 -23
- package/lib/Layout/HeaderTabs.js +118 -51
- package/lib/Layout/Iconfont.js +5 -1
- package/lib/Layout/Language.js +48 -17
- package/lib/Layout/Layout.js +128 -88
- package/lib/Layout/Logo.js +43 -19
- package/lib/Layout/OrgAppList.js +127 -64
- package/lib/Layout/SideMenu.js +143 -65
- package/lib/Layout/Theme.js +73 -23
- package/lib/Layout/checkAuth.js +39 -0
- package/lib/Layout/createActions.js +5 -0
- package/lib/Layout/images/index.js +28 -0
- package/lib/Layout/index.js +55 -30
- package/lib/Layout/paaslayout/CompactSideMenu.js +84 -35
- package/lib/Layout/paaslayout/Header.js +55 -22
- package/lib/Layout/paaslayout/Logo.js +19 -3
- package/lib/Layout/paaslayout/SideMenu.js +87 -39
- package/lib/Layout/paaslayout/index.js +122 -77
- package/lib/Layout/storage.js +40 -11
- package/lib/Layout/utils.js +166 -0
- package/lib/LoadingButton/index.js +29 -15
- package/lib/Modal/index.js +53 -38
- package/lib/Page/Box.js +45 -34
- package/lib/Page/index.js +77 -52
- package/lib/Page/utils.js +9 -1
- package/lib/QueryForm/Field/Checkbox.js +13 -5
- package/lib/QueryForm/Field/Select.js +53 -33
- package/lib/QueryForm/Field/SelectInput.js +56 -28
- package/lib/QueryForm/Field/fieldsMap.js +15 -1
- package/lib/QueryForm/Field/index.js +81 -43
- package/lib/QueryForm/createActions.js +12 -6
- package/lib/QueryForm/index.js +157 -78
- package/lib/QueryForm/useForm.js +5 -0
- package/lib/QueryListScene/List.js +140 -76
- package/lib/QueryListScene/QueryForm.js +86 -46
- package/lib/QueryListScene/QueryListScene.js +46 -25
- package/lib/QueryListScene/Title.js +7 -3
- package/lib/QueryListScene/Toolbar.js +16 -11
- package/lib/QueryListScene/createActions.js +5 -0
- package/lib/QueryListScene/index.js +10 -0
- package/lib/QueryListScene/useActions.js +5 -0
- package/lib/Select/DropDownWrap.js +56 -31
- package/lib/Select/index.js +241 -135
- package/lib/Table/ResizableTable/index.js +48 -26
- package/lib/Table/index.js +28 -17
- package/lib/Title/index.js +28 -21
- package/lib/index.js +56 -35
- package/lib/locale.js +19 -4
- package/lib/utils/checkAuth.js +9 -4
- package/lib/utils/findMenuInfoByPath.js +8 -1
- package/lib/utils/index.js +42 -15
- package/package.json +2 -2
package/es/ArrayInput/icon.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export var plusIcon =
|
|
1
|
+
export var plusIcon = React.createElement("svg", {
|
|
2
2
|
viewBox: "64 64 896 896",
|
|
3
3
|
focusable: "false",
|
|
4
4
|
"data-icon": "plus-circle",
|
|
@@ -6,12 +6,12 @@ export var plusIcon = /*#__PURE__*/React.createElement("svg", {
|
|
|
6
6
|
height: "1em",
|
|
7
7
|
fill: "currentColor",
|
|
8
8
|
"aria-hidden": "true"
|
|
9
|
-
},
|
|
9
|
+
}, React.createElement("path", {
|
|
10
10
|
d: "M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"
|
|
11
|
-
}),
|
|
11
|
+
}), React.createElement("path", {
|
|
12
12
|
d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
|
|
13
13
|
}));
|
|
14
|
-
export var deleteIcon =
|
|
14
|
+
export var deleteIcon = React.createElement("svg", {
|
|
15
15
|
viewBox: "64 64 896 896",
|
|
16
16
|
focusable: "false",
|
|
17
17
|
"data-icon": "delete",
|
|
@@ -19,6 +19,6 @@ export var deleteIcon = /*#__PURE__*/React.createElement("svg", {
|
|
|
19
19
|
height: "1em",
|
|
20
20
|
fill: "currentColor",
|
|
21
21
|
"aria-hidden": "true"
|
|
22
|
-
},
|
|
22
|
+
}, React.createElement("path", {
|
|
23
23
|
d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
|
|
24
24
|
}));
|
package/es/ArrayInput/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
1
|
import "antd/lib/row/style";
|
|
3
2
|
import _Row from "antd/lib/row";
|
|
4
3
|
import "antd/lib/tooltip/style";
|
|
@@ -7,59 +6,74 @@ import "antd/lib/col/style";
|
|
|
7
6
|
import _Col from "antd/lib/col";
|
|
8
7
|
import "antd/lib/table/style";
|
|
9
8
|
import _Table from "antd/lib/table";
|
|
10
|
-
|
|
9
|
+
|
|
11
10
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
+
|
|
12
12
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
13
|
+
|
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
|
|
16
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
17
|
+
|
|
18
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
19
|
+
|
|
20
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
28
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
29
|
+
|
|
30
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
31
|
+
|
|
32
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { 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; }
|
|
33
|
+
|
|
27
34
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
+
|
|
28
36
|
import React, { useEffect, useState, useCallback, isValidElement } from "react";
|
|
29
37
|
import { isFunction, isArray, sumBy, sum, set, get } from "lodash";
|
|
30
38
|
import { plusIcon, deleteIcon } from "./icon";
|
|
31
39
|
import "./index.less";
|
|
32
40
|
var Column = _Table.Column;
|
|
41
|
+
|
|
33
42
|
var getWidth = function getWidth(span) {
|
|
34
43
|
return 1000 / span;
|
|
35
44
|
};
|
|
45
|
+
|
|
36
46
|
export default function ArrayInput(_ref) {
|
|
37
47
|
var children = _ref.children,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
defaultValue = _ref.defaultValue,
|
|
49
|
+
value = _ref.value,
|
|
50
|
+
onChange = _ref.onChange,
|
|
51
|
+
_ref$mode = _ref.mode,
|
|
52
|
+
mode = _ref$mode === void 0 ? "list" : _ref$mode,
|
|
53
|
+
_ref$gutter = _ref.gutter,
|
|
54
|
+
gutter = _ref$gutter === void 0 ? 10 : _ref$gutter,
|
|
55
|
+
_ref$require = _ref.require,
|
|
56
|
+
require = _ref$require === void 0 ? false : _ref$require,
|
|
57
|
+
_ref$deleteTip = _ref.deleteTip,
|
|
58
|
+
deleteTip = _ref$deleteTip === void 0 ? "" : _ref$deleteTip,
|
|
59
|
+
_ref$plusTip = _ref.plusTip,
|
|
60
|
+
plusTip = _ref$plusTip === void 0 ? "" : _ref$plusTip,
|
|
61
|
+
_ref$addText = _ref.addText,
|
|
62
|
+
addText = _ref$addText === void 0 ? "添加" : _ref$addText;
|
|
63
|
+
|
|
53
64
|
if (!isFunction(children)) {
|
|
54
65
|
throw new Error("ArrayInput的children必须是函数");
|
|
55
66
|
}
|
|
67
|
+
|
|
56
68
|
var _useState = useState(value || defaultValue),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
70
|
+
_value = _useState2[0],
|
|
71
|
+
setValue = _useState2[1];
|
|
72
|
+
|
|
60
73
|
useEffect(function () {
|
|
61
74
|
setValue(value);
|
|
62
75
|
}, [value]);
|
|
76
|
+
|
|
63
77
|
var _onChange = useCallback(function (value) {
|
|
64
78
|
if (onChange) {
|
|
65
79
|
onChange(value);
|
|
@@ -67,55 +81,68 @@ export default function ArrayInput(_ref) {
|
|
|
67
81
|
setValue(value);
|
|
68
82
|
}
|
|
69
83
|
}, []);
|
|
84
|
+
|
|
70
85
|
var inValue = _value || [];
|
|
86
|
+
|
|
71
87
|
if (require && inValue.length === 0) {
|
|
72
88
|
inValue = [{}];
|
|
73
89
|
}
|
|
90
|
+
|
|
74
91
|
var changeValue = function changeValue(index, name, value) {
|
|
75
|
-
inValue[index] = _objectSpread(
|
|
92
|
+
inValue[index] = _objectSpread({}, inValue[index], _defineProperty({}, name, value));
|
|
93
|
+
|
|
76
94
|
_onChange(_toConsumableArray(inValue));
|
|
77
95
|
};
|
|
96
|
+
|
|
78
97
|
var onAdd = function onAdd(index) {
|
|
79
98
|
if (index === undefined) {
|
|
80
99
|
_onChange([].concat(_toConsumableArray(inValue), [{}]));
|
|
81
100
|
} else {
|
|
82
101
|
inValue.splice(index + 1, 0, {});
|
|
102
|
+
|
|
83
103
|
_onChange(_toConsumableArray(inValue));
|
|
84
104
|
}
|
|
85
105
|
};
|
|
106
|
+
|
|
86
107
|
var onDelete = function onDelete(i) {
|
|
87
108
|
inValue.splice(i, 1);
|
|
109
|
+
|
|
88
110
|
_onChange(_toConsumableArray(inValue));
|
|
89
111
|
};
|
|
112
|
+
|
|
90
113
|
if (mode === "list") {
|
|
91
|
-
return
|
|
114
|
+
return React.createElement("div", {
|
|
92
115
|
className: "tntd-array-input"
|
|
93
116
|
}, inValue.map(function (item, index) {
|
|
94
117
|
var fields = children(item, index);
|
|
118
|
+
|
|
95
119
|
if (!isArray(fields)) {
|
|
96
120
|
fields = get(fields, "props.children", []);
|
|
97
121
|
}
|
|
98
|
-
|
|
122
|
+
|
|
123
|
+
return React.createElement(_Row, {
|
|
99
124
|
gutter: gutter,
|
|
100
125
|
key: index,
|
|
101
126
|
className: "tntd-array-input-item"
|
|
102
127
|
}, fields.map(function (field, i) {
|
|
103
|
-
if (!
|
|
104
|
-
return field ?
|
|
128
|
+
if (!isValidElement(field)) {
|
|
129
|
+
return field ? React.createElement(_Col, {
|
|
105
130
|
span: 4,
|
|
106
131
|
key: i
|
|
107
132
|
}, field) : "";
|
|
108
133
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
134
|
+
|
|
135
|
+
var _ref2 = field == null ? void 0 : field.props,
|
|
136
|
+
name = _ref2.name,
|
|
137
|
+
_ref2$span = _ref2.span,
|
|
138
|
+
span = _ref2$span === void 0 ? 4 : _ref2$span,
|
|
139
|
+
fieldChange = _ref2.onChange,
|
|
140
|
+
other = _objectWithoutProperties(_ref2, ["name", "span", "onChange"]);
|
|
141
|
+
|
|
142
|
+
return React.createElement(_Col, {
|
|
116
143
|
span: span,
|
|
117
144
|
key: i
|
|
118
|
-
},
|
|
145
|
+
}, React.cloneElement(field, _objectSpread({
|
|
119
146
|
value: item[name] || undefined,
|
|
120
147
|
onChange: function onChange(e) {
|
|
121
148
|
fieldChange && fieldChange(e, index, changeValue);
|
|
@@ -123,85 +150,90 @@ export default function ArrayInput(_ref) {
|
|
|
123
150
|
changeValue(index, name, newValue);
|
|
124
151
|
}
|
|
125
152
|
}, other)));
|
|
126
|
-
}),
|
|
153
|
+
}), React.createElement(_Col, {
|
|
127
154
|
span: 24 - sum(fields.map(function (f) {
|
|
128
155
|
return get(f, "props.span", 4);
|
|
129
156
|
})) % 24
|
|
130
|
-
},
|
|
157
|
+
}, React.createElement("span", {
|
|
131
158
|
className: "tntd-array-input-action"
|
|
132
|
-
}, plusTip ?
|
|
159
|
+
}, plusTip ? React.createElement(_Tooltip, {
|
|
133
160
|
title: plusTip,
|
|
134
161
|
placement: "left"
|
|
135
|
-
},
|
|
162
|
+
}, React.createElement("span", {
|
|
136
163
|
className: "mr10",
|
|
137
164
|
onClick: function onClick() {
|
|
138
165
|
return onAdd(index);
|
|
139
166
|
}
|
|
140
|
-
}, plusIcon)) :
|
|
167
|
+
}, plusIcon)) : React.createElement("span", {
|
|
141
168
|
className: "mr10",
|
|
142
169
|
onClick: function onClick() {
|
|
143
170
|
return onAdd(index);
|
|
144
171
|
}
|
|
145
|
-
}, plusIcon), deleteTip ?
|
|
172
|
+
}, plusIcon), deleteTip ? React.createElement(_Tooltip, {
|
|
146
173
|
title: deleteTip,
|
|
147
174
|
placement: "right"
|
|
148
|
-
},
|
|
175
|
+
}, React.createElement("span", {
|
|
149
176
|
onClick: function onClick() {
|
|
150
177
|
return onDelete(index);
|
|
151
178
|
}
|
|
152
|
-
}, deleteIcon)) :
|
|
179
|
+
}, deleteIcon)) : React.createElement("span", {
|
|
153
180
|
onClick: function onClick() {
|
|
154
181
|
return onDelete(index);
|
|
155
182
|
}
|
|
156
183
|
}, deleteIcon))));
|
|
157
|
-
}), inValue.length === 0 &&
|
|
184
|
+
}), inValue.length === 0 && React.createElement("a", {
|
|
158
185
|
onClick: function onClick() {
|
|
159
186
|
return onAdd();
|
|
160
187
|
}
|
|
161
188
|
}, addText));
|
|
162
189
|
} else {
|
|
163
190
|
var fields = children({}, 0);
|
|
191
|
+
|
|
164
192
|
if (!isArray(fields)) {
|
|
165
193
|
fields = get(fields, "props.children", []);
|
|
166
194
|
}
|
|
195
|
+
|
|
167
196
|
var dataSource = inValue.map(function (value, index) {
|
|
168
197
|
var fields = children(value, index);
|
|
169
198
|
var back = {};
|
|
170
199
|
fields.forEach(function (field) {
|
|
171
|
-
var _field$
|
|
172
|
-
|
|
200
|
+
var _field$props;
|
|
201
|
+
|
|
202
|
+
var name = field == null ? void 0 : (_field$props = field.props) == null ? void 0 : _field$props.name;
|
|
173
203
|
name && set(back, name, field);
|
|
174
204
|
});
|
|
175
205
|
return back;
|
|
176
206
|
});
|
|
177
|
-
return
|
|
207
|
+
return React.createElement("div", {
|
|
178
208
|
className: "tntd-array-input"
|
|
179
|
-
},
|
|
209
|
+
}, React.createElement(_Table, {
|
|
180
210
|
dataSource: dataSource,
|
|
181
211
|
pagination: false,
|
|
182
212
|
locale: {
|
|
183
|
-
emptyText:
|
|
213
|
+
emptyText: React.createElement("a", {
|
|
184
214
|
onClick: function onClick() {
|
|
185
215
|
return onAdd();
|
|
186
216
|
}
|
|
187
217
|
}, addText)
|
|
188
218
|
}
|
|
189
219
|
}, fields.map(function (field) {
|
|
190
|
-
var
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
220
|
+
var _ref3 = (field == null ? void 0 : field.props) || {},
|
|
221
|
+
name = _ref3.name,
|
|
222
|
+
span = _ref3.span,
|
|
223
|
+
title = _ref3.title;
|
|
224
|
+
|
|
225
|
+
return React.createElement(Column, {
|
|
195
226
|
key: name,
|
|
196
227
|
dataIndex: name,
|
|
197
228
|
title: title,
|
|
198
229
|
width: getWidth(span || 24 / (fields.length + 1)),
|
|
199
230
|
render: function render(field, row, index) {
|
|
200
|
-
if (!
|
|
231
|
+
if (!isValidElement(field)) {
|
|
201
232
|
return field;
|
|
202
233
|
}
|
|
234
|
+
|
|
203
235
|
var fieldChange = field.props.onChange;
|
|
204
|
-
return
|
|
236
|
+
return React.cloneElement(field, {
|
|
205
237
|
value: inValue[index][name] || undefined,
|
|
206
238
|
onChange: function onChange(e) {
|
|
207
239
|
fieldChange && fieldChange(e, index, changeValue);
|
|
@@ -211,35 +243,35 @@ export default function ArrayInput(_ref) {
|
|
|
211
243
|
});
|
|
212
244
|
}
|
|
213
245
|
});
|
|
214
|
-
}),
|
|
246
|
+
}), React.createElement(Column, {
|
|
215
247
|
key: "action",
|
|
216
248
|
dataIndex: "action",
|
|
217
249
|
title: "\u64CD\u4F5C",
|
|
218
250
|
width: getWidth(24 - sumBy(fields, "props.span") % 24),
|
|
219
251
|
render: function render(text, row, index) {
|
|
220
|
-
return
|
|
252
|
+
return React.createElement("span", {
|
|
221
253
|
className: "tntd-array-input-action"
|
|
222
|
-
}, plusTip ?
|
|
254
|
+
}, plusTip ? React.createElement(_Tooltip, {
|
|
223
255
|
title: plusTip,
|
|
224
256
|
placement: "left"
|
|
225
|
-
},
|
|
257
|
+
}, React.createElement("span", {
|
|
226
258
|
className: "mr10",
|
|
227
259
|
onClick: function onClick() {
|
|
228
260
|
return onAdd(index);
|
|
229
261
|
}
|
|
230
|
-
}, plusIcon)) :
|
|
262
|
+
}, plusIcon)) : React.createElement("span", {
|
|
231
263
|
className: "mr10",
|
|
232
264
|
onClick: function onClick() {
|
|
233
265
|
return onAdd(index);
|
|
234
266
|
}
|
|
235
|
-
}, plusIcon), deleteTip ?
|
|
267
|
+
}, plusIcon), deleteTip ? React.createElement(_Tooltip, {
|
|
236
268
|
title: deleteTip,
|
|
237
269
|
placement: "right"
|
|
238
|
-
},
|
|
270
|
+
}, React.createElement("span", {
|
|
239
271
|
onClick: function onClick() {
|
|
240
272
|
return onDelete(index);
|
|
241
273
|
}
|
|
242
|
-
}, deleteIcon)) :
|
|
274
|
+
}, deleteIcon)) : React.createElement("span", {
|
|
243
275
|
onClick: function onClick() {
|
|
244
276
|
return onDelete(index);
|
|
245
277
|
}
|
package/es/AuthContext.js
CHANGED
package/es/Columns/index.js
CHANGED
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
1
|
import "antd/lib/row/style";
|
|
3
2
|
import _Row from "antd/lib/row";
|
|
4
3
|
import "antd/lib/col/style";
|
|
5
4
|
import _Col from "antd/lib/col";
|
|
6
|
-
|
|
7
|
-
function _extends() { _extends = Object.assign
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
5
|
+
|
|
6
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
|
+
|
|
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; }
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
13
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
+
|
|
14
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
|
+
|
|
15
18
|
import classnames from 'classnames';
|
|
16
19
|
import './index.less';
|
|
17
20
|
var clsPrefix = 'tnt-columns';
|
|
18
21
|
export var Item = function Item(props) {
|
|
19
22
|
var children = props.children,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
span = props.span,
|
|
24
|
+
extra = props.extra,
|
|
25
|
+
title = props.title,
|
|
26
|
+
tabList = props.tabList,
|
|
27
|
+
defaultActiveTabKey = props.defaultActiveTabKey,
|
|
28
|
+
activeTabKey = props.activeTabKey,
|
|
29
|
+
tabType = props.tabType,
|
|
30
|
+
onTabChange = props.onTabChange;
|
|
28
31
|
var realActiveKey = activeTabKey || defaultActiveTabKey;
|
|
29
|
-
return
|
|
32
|
+
return React.createElement(_Col, {
|
|
30
33
|
className: "".concat(clsPrefix, "-col"),
|
|
31
34
|
span: span < 4 ? 4 : span
|
|
32
|
-
},
|
|
35
|
+
}, React.createElement("div", null, (!tabList || tabList.length < 0) && React.createElement("div", {
|
|
33
36
|
className: "".concat(clsPrefix, "-col-header")
|
|
34
|
-
},
|
|
37
|
+
}, React.createElement("div", {
|
|
35
38
|
className: "title-left"
|
|
36
|
-
}, title), extra &&
|
|
39
|
+
}, title), extra && React.createElement("div", {
|
|
37
40
|
className: "title-extra"
|
|
38
|
-
}, extra)), (tabList == null ? void 0 : tabList.length) > 0 &&
|
|
41
|
+
}, extra)), (tabList == null ? void 0 : tabList.length) > 0 && React.createElement("div", {
|
|
39
42
|
className: "".concat(clsPrefix, "-col-tabs"),
|
|
40
43
|
tabType: tabType,
|
|
41
44
|
tabList: tabList
|
|
42
45
|
}, tabList.map(function (_ref) {
|
|
43
46
|
var tab = _ref.tab,
|
|
44
|
-
|
|
45
|
-
return
|
|
47
|
+
key = _ref.key;
|
|
48
|
+
return React.createElement("span", {
|
|
46
49
|
className: classnames('tab-item', {
|
|
47
50
|
'active-tab': realActiveKey === key
|
|
48
51
|
}),
|
|
@@ -54,26 +57,30 @@ export var Item = function Item(props) {
|
|
|
54
57
|
return onTabChange(key);
|
|
55
58
|
}
|
|
56
59
|
}, tab);
|
|
57
|
-
})),
|
|
60
|
+
})), React.createElement("div", {
|
|
58
61
|
className: "".concat(clsPrefix, "-col-body")
|
|
59
62
|
}, children)));
|
|
60
63
|
};
|
|
64
|
+
|
|
61
65
|
var Columns = function Columns(props) {
|
|
62
66
|
var children = props.children,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
height = props.height,
|
|
68
|
+
_props$gutter = props.gutter,
|
|
69
|
+
gutter = _props$gutter === void 0 ? 0 : _props$gutter,
|
|
70
|
+
style = props.style,
|
|
71
|
+
rest = _objectWithoutProperties(props, ["children", "height", "gutter", "style"]);
|
|
72
|
+
|
|
73
|
+
var rowStyle = _objectSpread({}, style, {
|
|
69
74
|
height: props.height ? "".concat(props.height, "px") : 'calc(100vh)'
|
|
70
75
|
});
|
|
71
|
-
|
|
76
|
+
|
|
77
|
+
return React.createElement(_Row, _extends({
|
|
72
78
|
className: classnames(clsPrefix, {
|
|
73
79
|
gutter: gutter
|
|
74
80
|
}),
|
|
75
81
|
style: rowStyle
|
|
76
82
|
}, rest), children);
|
|
77
83
|
};
|
|
84
|
+
|
|
78
85
|
Columns.Item = Item;
|
|
79
86
|
export default Columns;
|