tntd 1.4.32 → 1.4.33-beta.1
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/Ellipsis/index.js +47 -15
- package/components/QueryListScene/QueryForm.js +4 -4
- package/components/QueryListScene/createActions.js +4 -4
- package/dist/1.tntd.js +1 -1
- package/dist/stats.json +24089 -23289
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +7 -10
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +79 -111
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +33 -40
- package/es/DevelopmentLogin/LoginModal.js +33 -46
- package/es/DevelopmentLogin/index.js +14 -18
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +100 -79
- package/es/Handle/index.js +46 -64
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +12 -15
- package/es/Img/Contain.js +26 -31
- package/es/Img/Cover.js +43 -57
- package/es/Img/index.js +39 -48
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +39 -94
- package/es/Layout/Application.js +28 -74
- package/es/Layout/Avatar.js +30 -67
- package/es/Layout/CompatibleLanguage.js +41 -96
- package/es/Layout/EnterpriseLayout/Avatar.js +39 -77
- package/es/Layout/EnterpriseLayout/Language.js +16 -34
- package/es/Layout/EnterpriseLayout/Theme.js +18 -36
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +61 -172
- package/es/Layout/GlobalNavigation/index.js +22 -56
- package/es/Layout/Header.js +26 -47
- package/es/Layout/HeaderActions.js +45 -59
- package/es/Layout/HeaderNavs.js +24 -51
- package/es/Layout/HeaderTabs.js +53 -106
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +16 -34
- package/es/Layout/Layout.js +88 -110
- package/es/Layout/Logo.js +17 -33
- package/es/Layout/OrgAppList.js +64 -109
- package/es/Layout/SideMenu.js +67 -128
- package/es/Layout/Theme.js +25 -63
- package/es/Layout/index.js +28 -37
- package/es/Layout/paaslayout/CompactSideMenu.js +37 -76
- package/es/Layout/paaslayout/Header.js +23 -46
- package/es/Layout/paaslayout/Logo.js +4 -14
- package/es/Layout/paaslayout/SideMenu.js +41 -80
- package/es/Layout/paaslayout/index.js +77 -104
- package/es/Layout/storage.js +10 -9
- package/es/LoadingButton/index.js +18 -27
- package/es/Modal/index.js +42 -51
- package/es/Page/Box.js +36 -43
- package/es/Page/index.js +56 -71
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +7 -11
- package/es/QueryForm/Field/Select.js +34 -44
- package/es/QueryForm/Field/SelectInput.js +31 -46
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +46 -78
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +79 -140
- package/es/QueryListScene/List.js +83 -139
- package/es/QueryListScene/QueryForm.js +54 -91
- package/es/QueryListScene/QueryListScene.js +29 -47
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +13 -14
- package/es/QueryListScene/createActions.js +4 -4
- package/es/Select/DropDownWrap.js +32 -55
- package/es/Select/index.js +140 -232
- package/es/Table/ResizableTable/index.js +29 -43
- package/es/Table/index.js +20 -19
- package/es/Title/index.js +23 -25
- package/es/locale.js +1 -5
- package/es/utils/checkAuth.js +6 -8
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +17 -27
- package/lib/ArrayInput/icon.js +7 -9
- package/lib/ArrayInput/index.js +82 -131
- package/lib/AuthContext.js +2 -6
- package/lib/Columns/index.js +36 -54
- package/lib/DevelopmentLogin/LoginModal.js +36 -63
- package/lib/DevelopmentLogin/index.js +21 -31
- package/lib/Ellipsis/Svg/CopySVG.js +15 -18
- package/lib/Ellipsis/Svg/TickSVG.js +10 -13
- package/lib/Ellipsis/index.js +105 -93
- package/lib/Handle/index.js +51 -87
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/iconList.js +1 -2
- package/lib/Icon/index.js +16 -26
- package/lib/Img/Contain.js +29 -40
- package/lib/Img/Cover.js +48 -72
- package/lib/Img/index.js +42 -58
- package/lib/Layout/ActionsContext.js +1 -5
- package/lib/Layout/AppList.js +45 -124
- package/lib/Layout/Application.js +31 -92
- package/lib/Layout/Avatar.js +36 -91
- package/lib/Layout/CompatibleLanguage.js +44 -116
- package/lib/Layout/EnterpriseLayout/Avatar.js +45 -105
- package/lib/Layout/EnterpriseLayout/Language.js +22 -54
- package/lib/Layout/EnterpriseLayout/Theme.js +21 -50
- package/lib/Layout/EnterpriseLayout/index.js +17 -27
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +64 -192
- package/lib/Layout/GlobalNavigation/index.js +28 -80
- package/lib/Layout/Header.js +36 -68
- package/lib/Layout/HeaderActions.js +51 -81
- package/lib/Layout/HeaderNavs.js +30 -70
- package/lib/Layout/HeaderTabs.js +58 -127
- package/lib/Layout/Iconfont.js +4 -9
- package/lib/Layout/Language.js +22 -54
- package/lib/Layout/Layout.js +93 -134
- package/lib/Layout/Logo.js +26 -47
- package/lib/Layout/OrgAppList.js +69 -133
- package/lib/Layout/SideMenu.js +72 -151
- package/lib/Layout/Theme.js +28 -79
- package/lib/Layout/createActions.js +3 -9
- package/lib/Layout/images/index.js +5 -36
- package/lib/Layout/index.js +35 -63
- package/lib/Layout/paaslayout/CompactSideMenu.js +40 -90
- package/lib/Layout/paaslayout/Header.js +30 -60
- package/lib/Layout/paaslayout/Logo.js +11 -24
- package/lib/Layout/paaslayout/SideMenu.js +44 -93
- package/lib/Layout/paaslayout/index.js +82 -128
- package/lib/Layout/storage.js +26 -68
- package/lib/LoadingButton/index.js +21 -36
- package/lib/Modal/index.js +45 -62
- package/lib/Page/Box.js +38 -50
- package/lib/Page/index.js +58 -84
- package/lib/Page/utils.js +5 -16
- package/lib/QueryForm/Field/Checkbox.js +10 -19
- package/lib/QueryForm/Field/Select.js +39 -60
- package/lib/QueryForm/Field/SelectInput.js +36 -65
- package/lib/QueryForm/Field/fieldsMap.js +6 -23
- package/lib/QueryForm/Field/index.js +50 -91
- package/lib/QueryForm/createActions.js +9 -16
- package/lib/QueryForm/index.js +83 -165
- package/lib/QueryForm/useForm.js +1 -6
- package/lib/QueryListScene/List.js +89 -153
- package/lib/QueryListScene/QueryForm.js +58 -101
- package/lib/QueryListScene/QueryListScene.js +31 -56
- package/lib/QueryListScene/Title.js +6 -11
- package/lib/QueryListScene/Toolbar.js +16 -22
- package/lib/QueryListScene/createActions.js +7 -13
- package/lib/QueryListScene/index.js +5 -19
- package/lib/QueryListScene/useActions.js +1 -6
- package/lib/Select/DropDownWrap.js +35 -63
- package/lib/Select/index.js +142 -245
- package/lib/Table/ResizableTable/index.js +31 -54
- package/lib/Table/index.js +21 -34
- package/lib/Title/index.js +26 -34
- package/lib/index.js +36 -57
- package/lib/locale.js +9 -25
- package/lib/utils/checkAuth.js +9 -16
- package/lib/utils/findMenuInfoByPath.js +3 -12
- package/lib/utils/index.js +26 -60
- package/package.json +3 -2
|
@@ -1,55 +1,46 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import "antd/lib/select/style";
|
|
2
3
|
import _Select from "antd/lib/select";
|
|
3
|
-
|
|
4
|
-
function _extends() { _extends = Object.assign
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
4
|
+
var _excluded = ["options", "params", "queryKey", "fieldNames", "loadData"];
|
|
5
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
6
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
24
19
|
import React, { useState, useEffect } from 'react';
|
|
25
20
|
var Option = _Select.Option;
|
|
26
21
|
export default (function (props) {
|
|
27
22
|
var options = props.options,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
params = props.params,
|
|
24
|
+
_props$queryKey = props.queryKey,
|
|
25
|
+
queryKey = _props$queryKey === void 0 ? 'name' : _props$queryKey,
|
|
26
|
+
_props$fieldNames = props.fieldNames,
|
|
27
|
+
fieldNames = _props$fieldNames === void 0 ? {
|
|
28
|
+
label: 'label',
|
|
29
|
+
value: 'value'
|
|
30
|
+
} : _props$fieldNames,
|
|
31
|
+
loadData = props.loadData,
|
|
32
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
39
33
|
var _useState = useState(options || []),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
items = _useState2[0],
|
|
36
|
+
setItems = _useState2[1];
|
|
44
37
|
var _useState3 = useState(''),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
+
query = _useState4[0],
|
|
40
|
+
setQuery = _useState4[1];
|
|
49
41
|
var onSearch = function onSearch(val) {
|
|
50
42
|
setQuery(val);
|
|
51
43
|
};
|
|
52
|
-
|
|
53
44
|
if (loadData) {
|
|
54
45
|
useEffect(function () {
|
|
55
46
|
loadData(_objectSpread(_defineProperty({}, queryKey, query), params || {})).then(function (items) {
|
|
@@ -57,11 +48,10 @@ export default (function (props) {
|
|
|
57
48
|
});
|
|
58
49
|
}, [params, query]);
|
|
59
50
|
}
|
|
60
|
-
|
|
61
51
|
useEffect(function () {
|
|
62
52
|
setItems(options || []);
|
|
63
53
|
}, [options]);
|
|
64
|
-
return React.createElement(_Select, _extends({
|
|
54
|
+
return /*#__PURE__*/React.createElement(_Select, _extends({
|
|
65
55
|
allowClear: true,
|
|
66
56
|
showSearch: true,
|
|
67
57
|
optionFilterProp: "children",
|
|
@@ -72,7 +62,7 @@ export default (function (props) {
|
|
|
72
62
|
var value = item instanceof Object ? item[valueKey] : item;
|
|
73
63
|
var label = item instanceof Object ? item[labelKey] : item;
|
|
74
64
|
var optionProps = item instanceof Object ? item : {};
|
|
75
|
-
return React.createElement(Option, _extends({}, optionProps, {
|
|
65
|
+
return /*#__PURE__*/React.createElement(Option, _extends({}, optionProps, {
|
|
76
66
|
key: value,
|
|
77
67
|
value: value
|
|
78
68
|
}), label);
|
|
@@ -1,69 +1,56 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import "antd/lib/input/style";
|
|
2
3
|
import _Input from "antd/lib/input";
|
|
3
4
|
import "antd/lib/select/style";
|
|
4
5
|
import _Select from "antd/lib/select";
|
|
5
|
-
|
|
6
|
-
function _extends() { _extends = Object.assign
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
6
|
+
var _excluded = ["options", "addonBeforeStyle", "addonProps"];
|
|
7
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
14
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
20
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
26
21
|
import React, { useState, useEffect } from 'react';
|
|
27
22
|
import { get } from 'lodash';
|
|
28
23
|
var Option = _Select.Option;
|
|
29
24
|
export default (function (props) {
|
|
30
25
|
var _props$options = props.options,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
options = _props$options === void 0 ? [] : _props$options,
|
|
27
|
+
addonBeforeStyle = props.addonBeforeStyle,
|
|
28
|
+
_props$addonProps = props.addonProps,
|
|
29
|
+
addonProps = _props$addonProps === void 0 ? {} : _props$addonProps,
|
|
30
|
+
inputProps = _objectWithoutProperties(props, _excluded);
|
|
37
31
|
var _useState = useState(options),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
items = _useState2[0],
|
|
34
|
+
setItems = _useState2[1];
|
|
42
35
|
var getInitialKey = function getInitialKey() {
|
|
43
36
|
var key = get(options, '0.value');
|
|
44
|
-
|
|
45
37
|
if (inputProps.value) {
|
|
46
38
|
key = get(Object.keys(inputProps.value), '0') || key;
|
|
47
39
|
}
|
|
48
|
-
|
|
49
40
|
return key;
|
|
50
41
|
};
|
|
51
|
-
|
|
52
42
|
var _useState3 = useState(getInitialKey()),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
+
key = _useState4[0],
|
|
45
|
+
setKey = _useState4[1];
|
|
57
46
|
var onKeyChange = function onKeyChange(key) {
|
|
58
47
|
setKey(key);
|
|
59
48
|
props.onChange(_defineProperty({}, key, ''));
|
|
60
49
|
};
|
|
61
|
-
|
|
62
50
|
var onChange = function onChange(evt) {
|
|
63
51
|
props.onChange(_defineProperty({}, key, evt.target.value));
|
|
64
52
|
};
|
|
65
|
-
|
|
66
|
-
var addonBefore = React.createElement(_Select, _extends({
|
|
53
|
+
var addonBefore = /*#__PURE__*/React.createElement(_Select, _extends({
|
|
67
54
|
value: key,
|
|
68
55
|
onChange: onKeyChange,
|
|
69
56
|
style: _objectSpread({
|
|
@@ -72,22 +59,20 @@ export default (function (props) {
|
|
|
72
59
|
dropdownMatchSelectWidth: false
|
|
73
60
|
}, addonProps || {}), items.map(function (_ref) {
|
|
74
61
|
var label = _ref.label,
|
|
75
|
-
|
|
76
|
-
return React.createElement(Option, {
|
|
62
|
+
value = _ref.value;
|
|
63
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
77
64
|
key: value,
|
|
78
65
|
value: value
|
|
79
66
|
}, label);
|
|
80
67
|
}));
|
|
81
|
-
|
|
82
68
|
var getInputValue = function getInputValue() {
|
|
83
69
|
return get(inputProps.value, key);
|
|
84
70
|
};
|
|
85
|
-
|
|
86
71
|
useEffect(function () {
|
|
87
72
|
setItems(options);
|
|
88
73
|
setKey(getInitialKey());
|
|
89
74
|
}, [options, inputProps.value]);
|
|
90
|
-
return React.createElement(_Input, _extends({}, inputProps, {
|
|
75
|
+
return /*#__PURE__*/React.createElement(_Input, _extends({}, inputProps, {
|
|
91
76
|
value: getInputValue(),
|
|
92
77
|
addonBefore: addonBefore,
|
|
93
78
|
onChange: onChange
|
|
@@ -1,135 +1,106 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import "antd/lib/form/style";
|
|
2
3
|
import _Form from "antd/lib/form";
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
21
|
-
|
|
22
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23
|
-
|
|
24
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
|
-
|
|
26
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
4
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
15
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
18
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
19
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
30
20
|
import { PureComponent } from 'react';
|
|
31
21
|
import { get } from 'lodash';
|
|
32
22
|
import fieldsMap, { getFieldWidth } from './fieldsMap';
|
|
33
23
|
var FormItem = _Form.Item;
|
|
34
|
-
|
|
35
24
|
var isInput = function isInput(type) {
|
|
36
25
|
return ['input', 'string', 'search'].includes(type);
|
|
37
26
|
};
|
|
38
|
-
|
|
39
|
-
var Field =
|
|
40
|
-
/*#__PURE__*/
|
|
41
|
-
function (_PureComponent) {
|
|
42
|
-
_inherits(Field, _PureComponent);
|
|
43
|
-
|
|
27
|
+
var Field = /*#__PURE__*/function (_PureComponent) {
|
|
44
28
|
function Field(props) {
|
|
45
29
|
var _this;
|
|
46
|
-
|
|
47
30
|
_classCallCheck(this, Field);
|
|
48
|
-
|
|
49
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(Field).call(this, props));
|
|
50
|
-
|
|
31
|
+
_this = _callSuper(this, Field, [props]);
|
|
51
32
|
_this.updateValue = function (name, value) {
|
|
52
33
|
if (name === _this.props.name) {
|
|
53
34
|
_this.setState({
|
|
54
35
|
value: value
|
|
55
36
|
});
|
|
56
|
-
|
|
57
37
|
_this.props.onChange(name, value);
|
|
58
38
|
}
|
|
59
39
|
};
|
|
60
|
-
|
|
61
40
|
_this.onChange = function () {
|
|
62
41
|
var _this$props = _this.props,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
name = _this$props.name,
|
|
43
|
+
_this$props$type = _this$props.type,
|
|
44
|
+
type = _this$props$type === void 0 ? 'input' : _this$props$type,
|
|
45
|
+
component = _this$props.component,
|
|
46
|
+
fieldProps = _this$props.props;
|
|
69
47
|
var _ref = fieldProps || {},
|
|
70
|
-
|
|
71
|
-
|
|
48
|
+
onChange = _ref.onChange;
|
|
72
49
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
50
|
args[_key] = arguments[_key];
|
|
74
51
|
}
|
|
52
|
+
onChange && onChange.apply(void 0, args);
|
|
75
53
|
|
|
76
|
-
|
|
77
|
-
|
|
54
|
+
// Input onChange第一个参数为Event对象,取值特殊处理
|
|
78
55
|
if (!component && isInput(type)) {
|
|
79
56
|
args[0] = get(args[0], 'target.value');
|
|
80
57
|
}
|
|
81
|
-
|
|
82
58
|
_this.setState({
|
|
83
59
|
value: args[0]
|
|
84
60
|
});
|
|
85
|
-
|
|
86
61
|
_this.props.onChange(name, args[0]);
|
|
87
62
|
};
|
|
88
|
-
|
|
89
63
|
_this.onFormChange = function (formData) {
|
|
90
64
|
_this.setState({
|
|
91
65
|
value: get(formData, _this.props.name)
|
|
92
66
|
});
|
|
93
67
|
};
|
|
94
|
-
|
|
95
68
|
_this.state = {
|
|
96
69
|
value: props.initialValue
|
|
97
70
|
};
|
|
98
71
|
return _this;
|
|
99
72
|
}
|
|
100
|
-
|
|
101
|
-
_createClass(Field, [{
|
|
73
|
+
_inherits(Field, _PureComponent);
|
|
74
|
+
return _createClass(Field, [{
|
|
102
75
|
key: "render",
|
|
103
76
|
value: function render() {
|
|
104
77
|
var _fieldProps$style;
|
|
105
|
-
|
|
106
78
|
var _this$props2 = this.props,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
79
|
+
_this$props2$type = _this$props2.type,
|
|
80
|
+
type = _this$props2$type === void 0 ? 'input' : _this$props2$type,
|
|
81
|
+
title = _this$props2.title,
|
|
82
|
+
name = _this$props2.name,
|
|
83
|
+
_this$props2$isFieldI = _this$props2.isFieldInDrawer,
|
|
84
|
+
isFieldInDrawer = _this$props2$isFieldI === void 0 ? false : _this$props2$isFieldI,
|
|
85
|
+
_this$props2$classNam = _this$props2.className,
|
|
86
|
+
className = _this$props2$classNam === void 0 ? '' : _this$props2$classNam,
|
|
87
|
+
component = _this$props2.component,
|
|
88
|
+
form = _this$props2.form,
|
|
89
|
+
fieldProps = _this$props2.props;
|
|
118
90
|
var value = this.state.value;
|
|
119
|
-
var
|
|
120
|
-
return React.createElement(FormItem, {
|
|
91
|
+
var _Field2 = component || fieldsMap[type];
|
|
92
|
+
return /*#__PURE__*/React.createElement(FormItem, {
|
|
121
93
|
label: title,
|
|
122
94
|
className: className
|
|
123
|
-
}, React.createElement(
|
|
95
|
+
}, /*#__PURE__*/React.createElement(_Field2, _extends({
|
|
124
96
|
value: value
|
|
125
97
|
}, isInput(type) ? {
|
|
126
98
|
onPressEnter: function onPressEnter(evt) {
|
|
127
|
-
var _evt$target
|
|
128
|
-
|
|
129
|
-
return form.emit('search', (_form$emit = {}, _defineProperty(_form$emit, name, evt == null ? void 0 : (_evt$target = evt.target) == null ? void 0 : _evt$target.value), _defineProperty(_form$emit, "current", 1), _form$emit));
|
|
99
|
+
var _evt$target;
|
|
100
|
+
return form.emit('search', _defineProperty(_defineProperty({}, name, evt == null ? void 0 : (_evt$target = evt.target) == null ? void 0 : _evt$target.value), "current", 1));
|
|
130
101
|
}
|
|
131
102
|
} : {}, fieldProps, {
|
|
132
|
-
style: _objectSpread({}, fieldProps == null ? void 0 : fieldProps.style, {
|
|
103
|
+
style: _objectSpread(_objectSpread({}, fieldProps == null ? void 0 : fieldProps.style), {}, {
|
|
133
104
|
width: isFieldInDrawer ? '100%' : (fieldProps == null ? void 0 : (_fieldProps$style = fieldProps.style) == null ? void 0 : _fieldProps$style.width) || getFieldWidth(type)
|
|
134
105
|
}),
|
|
135
106
|
onChange: this.onChange
|
|
@@ -150,8 +121,5 @@ function (_PureComponent) {
|
|
|
150
121
|
form.off('setValues', this.onFormChange);
|
|
151
122
|
}
|
|
152
123
|
}]);
|
|
153
|
-
|
|
154
|
-
return Field;
|
|
155
124
|
}(PureComponent);
|
|
156
|
-
|
|
157
125
|
export { Field as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
function _objectSpread(
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import EventEmitter from 'eventemitter3';
|
|
8
8
|
import { get, set } from 'lodash';
|
|
9
9
|
export default (function () {
|
|
@@ -37,7 +37,6 @@ export default (function () {
|
|
|
37
37
|
},
|
|
38
38
|
getValue: function getValue(name) {
|
|
39
39
|
var _data$values;
|
|
40
|
-
|
|
41
40
|
return (_data$values = data.values) == null ? void 0 : _data$values[name];
|
|
42
41
|
},
|
|
43
42
|
on: function on(eventName, callback) {
|