tntd 1.4.18 → 1.4.20
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 +1 -1
- package/components/Layout/Avatar.js +4 -4
- package/components/Layout/EnterpriseLayout/Avatar.js +10 -7
- package/components/Layout/EnterpriseLayout/Language.js +5 -3
- package/components/Layout/EnterpriseLayout/Theme.js +6 -7
- package/components/Layout/EnterpriseLayout/index.js +1 -1
- package/components/Layout/HeaderActions.js +13 -10
- package/components/Layout/HeaderTabs.js +13 -14
- package/components/Layout/Layout.js +2 -0
- package/components/Layout/index.js +2 -1
- package/components/Layout/storage.js +12 -2
- package/components/Page/index.js +2 -2
- package/components/locale.js +7 -2
- package/dist/1.tntd.js +1 -12
- package/dist/stats.json +28426 -28000
- package/dist/tntd.css +1 -1
- package/dist/tntd.js +13 -7
- package/es/ArrayInput/icon.js +5 -5
- package/es/ArrayInput/index.js +76 -108
- package/es/AuthContext.js +1 -1
- package/es/Columns/index.js +31 -38
- package/es/DevelopmentLogin/LoginModal.js +32 -45
- package/es/DevelopmentLogin/index.js +13 -17
- package/es/Ellipsis/Svg/CopySVG.js +13 -13
- package/es/Ellipsis/Svg/TickSVG.js +8 -8
- package/es/Ellipsis/index.js +59 -70
- package/es/Handle/index.js +25 -35
- package/es/Icon/fonts/iconfont.js +7 -12
- package/es/Icon/index.js +10 -13
- package/es/Img/Contain.js +24 -29
- package/es/Img/Cover.js +40 -54
- package/es/Img/index.js +36 -45
- package/es/Layout/ActionsContext.js +3 -2
- package/es/Layout/AppList.js +37 -92
- package/es/Layout/Application.js +26 -72
- package/es/Layout/Avatar.js +32 -69
- package/es/Layout/CompatibleLanguage.js +39 -94
- package/es/Layout/EnterpriseLayout/Avatar.js +49 -79
- package/es/Layout/EnterpriseLayout/Language.js +19 -34
- package/es/Layout/EnterpriseLayout/Theme.js +23 -37
- package/es/Layout/EnterpriseLayout/index.js +14 -16
- package/es/Layout/GlobalNavigation/NavigationPopup.js +59 -170
- package/es/Layout/GlobalNavigation/index.js +20 -54
- package/es/Layout/Header.js +25 -46
- package/es/Layout/HeaderActions.js +52 -63
- package/es/Layout/HeaderNavs.js +20 -47
- package/es/Layout/HeaderTabs.js +61 -115
- package/es/Layout/Iconfont.js +1 -1
- package/es/Layout/Language.js +14 -32
- package/es/Layout/Layout.js +88 -108
- package/es/Layout/Logo.js +16 -32
- package/es/Layout/OrgAppList.js +62 -107
- package/es/Layout/SideMenu.js +63 -124
- package/es/Layout/Theme.js +23 -61
- package/es/Layout/index.js +29 -36
- package/es/Layout/paaslayout/CompactSideMenu.js +35 -74
- package/es/Layout/paaslayout/Header.js +22 -45
- package/es/Layout/paaslayout/Logo.js +3 -13
- package/es/Layout/paaslayout/SideMenu.js +39 -78
- package/es/Layout/paaslayout/index.js +75 -102
- package/es/Layout/storage.js +26 -9
- package/es/LoadingButton/index.js +15 -24
- package/es/Modal/index.js +38 -46
- package/es/Page/Box.js +34 -41
- package/es/Page/index.js +54 -68
- package/es/Page/utils.js +0 -5
- package/es/QueryForm/Field/Checkbox.js +5 -9
- package/es/QueryForm/Field/Select.js +31 -41
- package/es/QueryForm/Field/SelectInput.js +26 -41
- package/es/QueryForm/Field/fieldsMap.js +0 -1
- package/es/QueryForm/Field/index.js +41 -71
- package/es/QueryForm/createActions.js +6 -7
- package/es/QueryForm/index.js +76 -135
- package/es/QueryListScene/List.js +74 -128
- package/es/QueryListScene/QueryForm.js +46 -81
- package/es/QueryListScene/QueryListScene.js +25 -40
- package/es/QueryListScene/Title.js +3 -3
- package/es/QueryListScene/Toolbar.js +11 -12
- package/es/Select/DropDownWrap.js +29 -50
- package/es/Select/index.js +135 -231
- package/es/Table/ResizableTable/index.js +26 -40
- package/es/Table/index.js +18 -16
- package/es/Title/index.js +21 -23
- package/es/locale.js +9 -7
- package/es/utils/checkAuth.js +3 -5
- package/es/utils/findMenuInfoByPath.js +0 -4
- package/es/utils/index.js +12 -23
- package/lib/ArrayInput/icon.js +6 -6
- package/lib/ArrayInput/index.js +78 -127
- package/lib/AuthContext.js +1 -4
- package/lib/Columns/index.js +31 -47
- package/lib/DevelopmentLogin/LoginModal.js +32 -58
- package/lib/DevelopmentLogin/index.js +16 -27
- package/lib/Ellipsis/Svg/CopySVG.js +13 -15
- package/lib/Ellipsis/Svg/TickSVG.js +8 -10
- package/lib/Ellipsis/index.js +58 -81
- package/lib/Handle/index.js +25 -47
- package/lib/Icon/fonts/iconfont.js +7 -12
- package/lib/Icon/index.js +11 -20
- package/lib/Img/Contain.js +24 -34
- package/lib/Img/Cover.js +42 -65
- package/lib/Img/index.js +36 -51
- package/lib/Layout/ActionsContext.js +1 -4
- package/lib/Layout/AppList.js +40 -118
- package/lib/Layout/Application.js +26 -86
- package/lib/Layout/Avatar.js +35 -89
- package/lib/Layout/CompatibleLanguage.js +39 -110
- package/lib/Layout/EnterpriseLayout/Avatar.js +52 -101
- package/lib/Layout/EnterpriseLayout/Language.js +21 -49
- package/lib/Layout/EnterpriseLayout/Theme.js +22 -46
- package/lib/Layout/EnterpriseLayout/index.js +14 -23
- package/lib/Layout/GlobalNavigation/NavigationPopup.js +59 -186
- package/lib/Layout/GlobalNavigation/index.js +23 -74
- package/lib/Layout/Header.js +28 -63
- package/lib/Layout/HeaderActions.js +48 -74
- package/lib/Layout/HeaderNavs.js +23 -61
- package/lib/Layout/HeaderTabs.js +58 -126
- package/lib/Layout/Iconfont.js +1 -5
- package/lib/Layout/Language.js +17 -48
- package/lib/Layout/Layout.js +90 -128
- package/lib/Layout/Logo.js +19 -43
- package/lib/Layout/OrgAppList.js +64 -127
- package/lib/Layout/SideMenu.js +65 -143
- package/lib/Layout/Theme.js +23 -73
- package/lib/Layout/createActions.js +0 -5
- package/lib/Layout/images/index.js +0 -28
- package/lib/Layout/index.js +33 -57
- package/lib/Layout/paaslayout/CompactSideMenu.js +35 -84
- package/lib/Layout/paaslayout/Header.js +22 -55
- package/lib/Layout/paaslayout/Logo.js +3 -19
- package/lib/Layout/paaslayout/SideMenu.js +39 -87
- package/lib/Layout/paaslayout/index.js +77 -122
- package/lib/Layout/storage.js +29 -35
- package/lib/LoadingButton/index.js +15 -29
- package/lib/Modal/index.js +38 -53
- package/lib/Page/Box.js +34 -45
- package/lib/Page/index.js +54 -78
- package/lib/Page/utils.js +1 -9
- package/lib/QueryForm/Field/Checkbox.js +5 -13
- package/lib/QueryForm/Field/Select.js +33 -53
- package/lib/QueryForm/Field/SelectInput.js +28 -56
- package/lib/QueryForm/Field/fieldsMap.js +1 -15
- package/lib/QueryForm/Field/index.js +43 -81
- package/lib/QueryForm/createActions.js +6 -12
- package/lib/QueryForm/index.js +78 -157
- package/lib/QueryForm/useForm.js +0 -5
- package/lib/QueryListScene/List.js +76 -140
- package/lib/QueryListScene/QueryForm.js +46 -86
- package/lib/QueryListScene/QueryListScene.js +25 -46
- package/lib/QueryListScene/Title.js +3 -7
- package/lib/QueryListScene/Toolbar.js +11 -16
- package/lib/QueryListScene/createActions.js +0 -5
- package/lib/QueryListScene/index.js +0 -10
- package/lib/QueryListScene/useActions.js +0 -5
- package/lib/Select/DropDownWrap.js +31 -56
- package/lib/Select/index.js +135 -241
- package/lib/Table/ResizableTable/index.js +26 -48
- package/lib/Table/index.js +17 -28
- package/lib/Title/index.js +21 -28
- package/lib/index.js +35 -56
- package/lib/locale.js +11 -12
- package/lib/utils/checkAuth.js +4 -9
- package/lib/utils/findMenuInfoByPath.js +1 -8
- package/lib/utils/index.js +15 -42
- package/package.json +2 -2
- package/es/Layout/checkAuth.js +0 -29
- package/es/Layout/utils.js +0 -136
- package/lib/Layout/EnterpriseLayout/Header.js +0 -113
- package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
- package/lib/Layout/checkAuth.js +0 -39
- package/lib/Layout/utils.js +0 -166
|
@@ -3,42 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
6
|
+
exports.getFieldWidth = exports.defaultFieldWidth = exports["default"] = void 0;
|
|
8
7
|
require("antd/lib/date-picker/style");
|
|
9
|
-
|
|
10
8
|
var _datePicker = _interopRequireDefault(require("antd/lib/date-picker"));
|
|
11
|
-
|
|
12
9
|
require("antd/lib/input-number/style");
|
|
13
|
-
|
|
14
10
|
var _inputNumber = _interopRequireDefault(require("antd/lib/input-number"));
|
|
15
|
-
|
|
16
11
|
require("antd/lib/input/style");
|
|
17
|
-
|
|
18
12
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
19
|
-
|
|
20
13
|
var _Select = _interopRequireDefault(require("./Select"));
|
|
21
|
-
|
|
22
14
|
var _SelectInput = _interopRequireDefault(require("./SelectInput"));
|
|
23
|
-
|
|
24
15
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
25
|
-
|
|
26
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
17
|
var defaultFieldWidth = '200px';
|
|
29
18
|
exports.defaultFieldWidth = defaultFieldWidth;
|
|
30
|
-
|
|
31
19
|
var getFieldWidth = function getFieldWidth(type) {
|
|
32
20
|
if (type === 'dateRange') {
|
|
33
21
|
return '340px';
|
|
34
22
|
}
|
|
35
|
-
|
|
36
23
|
return {
|
|
37
24
|
dateRange: '340px',
|
|
38
25
|
selectInput: '320px'
|
|
39
26
|
}[type] || defaultFieldWidth;
|
|
40
27
|
};
|
|
41
|
-
|
|
42
28
|
exports.getFieldWidth = getFieldWidth;
|
|
43
29
|
var _default = {
|
|
44
30
|
string: _input["default"],
|
|
@@ -1,152 +1,116 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
8
|
require("antd/lib/form/style");
|
|
9
|
-
|
|
10
9
|
var _form = _interopRequireDefault(require("antd/lib/form"));
|
|
11
|
-
|
|
12
10
|
var _react = require("react");
|
|
13
|
-
|
|
14
11
|
var _lodash = require("lodash");
|
|
15
|
-
|
|
16
12
|
var _fieldsMap = _interopRequireWildcard(require("./fieldsMap"));
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
22
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
32
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
-
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
20
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
21
|
+
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
24
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
25
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
26
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
28
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
42
29
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
-
|
|
44
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
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); }
|
|
47
|
-
|
|
48
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
|
-
|
|
30
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
50
32
|
var FormItem = _form["default"].Item;
|
|
51
|
-
|
|
52
33
|
var isInput = function isInput(type) {
|
|
53
34
|
return ['input', 'string', 'search'].includes(type);
|
|
54
35
|
};
|
|
55
|
-
|
|
56
|
-
var Field =
|
|
57
|
-
/*#__PURE__*/
|
|
58
|
-
function (_PureComponent) {
|
|
36
|
+
var Field = /*#__PURE__*/function (_PureComponent) {
|
|
59
37
|
_inherits(Field, _PureComponent);
|
|
60
|
-
|
|
38
|
+
var _super = _createSuper(Field);
|
|
61
39
|
function Field(props) {
|
|
62
40
|
var _this;
|
|
63
|
-
|
|
64
41
|
_classCallCheck(this, Field);
|
|
65
|
-
|
|
66
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(Field).call(this, props));
|
|
67
|
-
|
|
42
|
+
_this = _super.call(this, props);
|
|
68
43
|
_this.updateValue = function (name, value) {
|
|
69
44
|
if (name === _this.props.name) {
|
|
70
45
|
_this.setState({
|
|
71
46
|
value: value
|
|
72
47
|
});
|
|
73
|
-
|
|
74
48
|
_this.props.onChange(name, value);
|
|
75
49
|
}
|
|
76
50
|
};
|
|
77
|
-
|
|
78
51
|
_this.onChange = function () {
|
|
79
52
|
var _this$props = _this.props,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
53
|
+
name = _this$props.name,
|
|
54
|
+
_this$props$type = _this$props.type,
|
|
55
|
+
type = _this$props$type === void 0 ? 'input' : _this$props$type,
|
|
56
|
+
component = _this$props.component,
|
|
57
|
+
fieldProps = _this$props.props;
|
|
86
58
|
var _ref = fieldProps || {},
|
|
87
|
-
|
|
88
|
-
|
|
59
|
+
onChange = _ref.onChange;
|
|
89
60
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
90
61
|
args[_key] = arguments[_key];
|
|
91
62
|
}
|
|
63
|
+
onChange && onChange.apply(void 0, args);
|
|
92
64
|
|
|
93
|
-
|
|
94
|
-
|
|
65
|
+
// Input onChange第一个参数为Event对象,取值特殊处理
|
|
95
66
|
if (!component && isInput(type)) {
|
|
96
67
|
args[0] = (0, _lodash.get)(args[0], 'target.value');
|
|
97
68
|
}
|
|
98
|
-
|
|
99
69
|
_this.setState({
|
|
100
70
|
value: args[0]
|
|
101
71
|
});
|
|
102
|
-
|
|
103
72
|
_this.props.onChange(name, args[0]);
|
|
104
73
|
};
|
|
105
|
-
|
|
106
74
|
_this.onFormChange = function (formData) {
|
|
107
75
|
_this.setState({
|
|
108
76
|
value: (0, _lodash.get)(formData, _this.props.name)
|
|
109
77
|
});
|
|
110
78
|
};
|
|
111
|
-
|
|
112
79
|
_this.state = {
|
|
113
80
|
value: props.initialValue
|
|
114
81
|
};
|
|
115
82
|
return _this;
|
|
116
83
|
}
|
|
117
|
-
|
|
118
84
|
_createClass(Field, [{
|
|
119
85
|
key: "render",
|
|
120
86
|
value: function render() {
|
|
121
87
|
var _fieldProps$style;
|
|
122
|
-
|
|
123
88
|
var _this$props2 = this.props,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
89
|
+
_this$props2$type = _this$props2.type,
|
|
90
|
+
type = _this$props2$type === void 0 ? 'input' : _this$props2$type,
|
|
91
|
+
title = _this$props2.title,
|
|
92
|
+
name = _this$props2.name,
|
|
93
|
+
_this$props2$isFieldI = _this$props2.isFieldInDrawer,
|
|
94
|
+
isFieldInDrawer = _this$props2$isFieldI === void 0 ? false : _this$props2$isFieldI,
|
|
95
|
+
_this$props2$classNam = _this$props2.className,
|
|
96
|
+
className = _this$props2$classNam === void 0 ? '' : _this$props2$classNam,
|
|
97
|
+
component = _this$props2.component,
|
|
98
|
+
form = _this$props2.form,
|
|
99
|
+
fieldProps = _this$props2.props;
|
|
135
100
|
var value = this.state.value;
|
|
136
|
-
var
|
|
137
|
-
return React.createElement(FormItem, {
|
|
101
|
+
var _Field = component || _fieldsMap["default"][type];
|
|
102
|
+
return /*#__PURE__*/React.createElement(FormItem, {
|
|
138
103
|
label: title,
|
|
139
104
|
className: className
|
|
140
|
-
}, React.createElement(
|
|
105
|
+
}, /*#__PURE__*/React.createElement(_Field, _extends({
|
|
141
106
|
value: value
|
|
142
107
|
}, isInput(type) ? {
|
|
143
108
|
onPressEnter: function onPressEnter(evt) {
|
|
144
109
|
var _evt$target, _form$emit;
|
|
145
|
-
|
|
146
110
|
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));
|
|
147
111
|
}
|
|
148
112
|
} : {}, fieldProps, {
|
|
149
|
-
style: _objectSpread({}, fieldProps == null ? void 0 : fieldProps.style, {
|
|
113
|
+
style: _objectSpread(_objectSpread({}, fieldProps == null ? void 0 : fieldProps.style), {}, {
|
|
150
114
|
width: isFieldInDrawer ? '100%' : (fieldProps == null ? void 0 : (_fieldProps$style = fieldProps.style) == null ? void 0 : _fieldProps$style.width) || (0, _fieldsMap.getFieldWidth)(type)
|
|
151
115
|
}),
|
|
152
116
|
onChange: this.onChange
|
|
@@ -167,8 +131,6 @@ function (_PureComponent) {
|
|
|
167
131
|
form.off('setValues', this.onFormChange);
|
|
168
132
|
}
|
|
169
133
|
}]);
|
|
170
|
-
|
|
171
134
|
return Field;
|
|
172
135
|
}(_react.PureComponent);
|
|
173
|
-
|
|
174
136
|
exports["default"] = Field;
|
|
@@ -4,19 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _eventemitter = _interopRequireDefault(require("eventemitter3"));
|
|
9
|
-
|
|
10
8
|
var _lodash = require("lodash");
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
10
|
+
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); }
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
16
|
var _default = function _default() {
|
|
21
17
|
var eventEmitter = new _eventemitter["default"]();
|
|
22
18
|
var data = {
|
|
@@ -48,7 +44,6 @@ var _default = function _default() {
|
|
|
48
44
|
},
|
|
49
45
|
getValue: function getValue(name) {
|
|
50
46
|
var _data$values;
|
|
51
|
-
|
|
52
47
|
return (_data$values = data.values) == null ? void 0 : _data$values[name];
|
|
53
48
|
},
|
|
54
49
|
on: function on(eventName, callback) {
|
|
@@ -62,5 +57,4 @@ var _default = function _default() {
|
|
|
62
57
|
}
|
|
63
58
|
};
|
|
64
59
|
};
|
|
65
|
-
|
|
66
60
|
exports["default"] = _default;
|