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.
Files changed (171) hide show
  1. package/components/Ellipsis/index.js +1 -1
  2. package/components/Layout/Avatar.js +4 -4
  3. package/components/Layout/EnterpriseLayout/Avatar.js +10 -7
  4. package/components/Layout/EnterpriseLayout/Language.js +5 -3
  5. package/components/Layout/EnterpriseLayout/Theme.js +6 -7
  6. package/components/Layout/EnterpriseLayout/index.js +1 -1
  7. package/components/Layout/HeaderActions.js +13 -10
  8. package/components/Layout/HeaderTabs.js +13 -14
  9. package/components/Layout/Layout.js +2 -0
  10. package/components/Layout/index.js +2 -1
  11. package/components/Layout/storage.js +12 -2
  12. package/components/Page/index.js +2 -2
  13. package/components/locale.js +7 -2
  14. package/dist/1.tntd.js +1 -12
  15. package/dist/stats.json +28426 -28000
  16. package/dist/tntd.css +1 -1
  17. package/dist/tntd.js +13 -7
  18. package/es/ArrayInput/icon.js +5 -5
  19. package/es/ArrayInput/index.js +76 -108
  20. package/es/AuthContext.js +1 -1
  21. package/es/Columns/index.js +31 -38
  22. package/es/DevelopmentLogin/LoginModal.js +32 -45
  23. package/es/DevelopmentLogin/index.js +13 -17
  24. package/es/Ellipsis/Svg/CopySVG.js +13 -13
  25. package/es/Ellipsis/Svg/TickSVG.js +8 -8
  26. package/es/Ellipsis/index.js +59 -70
  27. package/es/Handle/index.js +25 -35
  28. package/es/Icon/fonts/iconfont.js +7 -12
  29. package/es/Icon/index.js +10 -13
  30. package/es/Img/Contain.js +24 -29
  31. package/es/Img/Cover.js +40 -54
  32. package/es/Img/index.js +36 -45
  33. package/es/Layout/ActionsContext.js +3 -2
  34. package/es/Layout/AppList.js +37 -92
  35. package/es/Layout/Application.js +26 -72
  36. package/es/Layout/Avatar.js +32 -69
  37. package/es/Layout/CompatibleLanguage.js +39 -94
  38. package/es/Layout/EnterpriseLayout/Avatar.js +49 -79
  39. package/es/Layout/EnterpriseLayout/Language.js +19 -34
  40. package/es/Layout/EnterpriseLayout/Theme.js +23 -37
  41. package/es/Layout/EnterpriseLayout/index.js +14 -16
  42. package/es/Layout/GlobalNavigation/NavigationPopup.js +59 -170
  43. package/es/Layout/GlobalNavigation/index.js +20 -54
  44. package/es/Layout/Header.js +25 -46
  45. package/es/Layout/HeaderActions.js +52 -63
  46. package/es/Layout/HeaderNavs.js +20 -47
  47. package/es/Layout/HeaderTabs.js +61 -115
  48. package/es/Layout/Iconfont.js +1 -1
  49. package/es/Layout/Language.js +14 -32
  50. package/es/Layout/Layout.js +88 -108
  51. package/es/Layout/Logo.js +16 -32
  52. package/es/Layout/OrgAppList.js +62 -107
  53. package/es/Layout/SideMenu.js +63 -124
  54. package/es/Layout/Theme.js +23 -61
  55. package/es/Layout/index.js +29 -36
  56. package/es/Layout/paaslayout/CompactSideMenu.js +35 -74
  57. package/es/Layout/paaslayout/Header.js +22 -45
  58. package/es/Layout/paaslayout/Logo.js +3 -13
  59. package/es/Layout/paaslayout/SideMenu.js +39 -78
  60. package/es/Layout/paaslayout/index.js +75 -102
  61. package/es/Layout/storage.js +26 -9
  62. package/es/LoadingButton/index.js +15 -24
  63. package/es/Modal/index.js +38 -46
  64. package/es/Page/Box.js +34 -41
  65. package/es/Page/index.js +54 -68
  66. package/es/Page/utils.js +0 -5
  67. package/es/QueryForm/Field/Checkbox.js +5 -9
  68. package/es/QueryForm/Field/Select.js +31 -41
  69. package/es/QueryForm/Field/SelectInput.js +26 -41
  70. package/es/QueryForm/Field/fieldsMap.js +0 -1
  71. package/es/QueryForm/Field/index.js +41 -71
  72. package/es/QueryForm/createActions.js +6 -7
  73. package/es/QueryForm/index.js +76 -135
  74. package/es/QueryListScene/List.js +74 -128
  75. package/es/QueryListScene/QueryForm.js +46 -81
  76. package/es/QueryListScene/QueryListScene.js +25 -40
  77. package/es/QueryListScene/Title.js +3 -3
  78. package/es/QueryListScene/Toolbar.js +11 -12
  79. package/es/Select/DropDownWrap.js +29 -50
  80. package/es/Select/index.js +135 -231
  81. package/es/Table/ResizableTable/index.js +26 -40
  82. package/es/Table/index.js +18 -16
  83. package/es/Title/index.js +21 -23
  84. package/es/locale.js +9 -7
  85. package/es/utils/checkAuth.js +3 -5
  86. package/es/utils/findMenuInfoByPath.js +0 -4
  87. package/es/utils/index.js +12 -23
  88. package/lib/ArrayInput/icon.js +6 -6
  89. package/lib/ArrayInput/index.js +78 -127
  90. package/lib/AuthContext.js +1 -4
  91. package/lib/Columns/index.js +31 -47
  92. package/lib/DevelopmentLogin/LoginModal.js +32 -58
  93. package/lib/DevelopmentLogin/index.js +16 -27
  94. package/lib/Ellipsis/Svg/CopySVG.js +13 -15
  95. package/lib/Ellipsis/Svg/TickSVG.js +8 -10
  96. package/lib/Ellipsis/index.js +58 -81
  97. package/lib/Handle/index.js +25 -47
  98. package/lib/Icon/fonts/iconfont.js +7 -12
  99. package/lib/Icon/index.js +11 -20
  100. package/lib/Img/Contain.js +24 -34
  101. package/lib/Img/Cover.js +42 -65
  102. package/lib/Img/index.js +36 -51
  103. package/lib/Layout/ActionsContext.js +1 -4
  104. package/lib/Layout/AppList.js +40 -118
  105. package/lib/Layout/Application.js +26 -86
  106. package/lib/Layout/Avatar.js +35 -89
  107. package/lib/Layout/CompatibleLanguage.js +39 -110
  108. package/lib/Layout/EnterpriseLayout/Avatar.js +52 -101
  109. package/lib/Layout/EnterpriseLayout/Language.js +21 -49
  110. package/lib/Layout/EnterpriseLayout/Theme.js +22 -46
  111. package/lib/Layout/EnterpriseLayout/index.js +14 -23
  112. package/lib/Layout/GlobalNavigation/NavigationPopup.js +59 -186
  113. package/lib/Layout/GlobalNavigation/index.js +23 -74
  114. package/lib/Layout/Header.js +28 -63
  115. package/lib/Layout/HeaderActions.js +48 -74
  116. package/lib/Layout/HeaderNavs.js +23 -61
  117. package/lib/Layout/HeaderTabs.js +58 -126
  118. package/lib/Layout/Iconfont.js +1 -5
  119. package/lib/Layout/Language.js +17 -48
  120. package/lib/Layout/Layout.js +90 -128
  121. package/lib/Layout/Logo.js +19 -43
  122. package/lib/Layout/OrgAppList.js +64 -127
  123. package/lib/Layout/SideMenu.js +65 -143
  124. package/lib/Layout/Theme.js +23 -73
  125. package/lib/Layout/createActions.js +0 -5
  126. package/lib/Layout/images/index.js +0 -28
  127. package/lib/Layout/index.js +33 -57
  128. package/lib/Layout/paaslayout/CompactSideMenu.js +35 -84
  129. package/lib/Layout/paaslayout/Header.js +22 -55
  130. package/lib/Layout/paaslayout/Logo.js +3 -19
  131. package/lib/Layout/paaslayout/SideMenu.js +39 -87
  132. package/lib/Layout/paaslayout/index.js +77 -122
  133. package/lib/Layout/storage.js +29 -35
  134. package/lib/LoadingButton/index.js +15 -29
  135. package/lib/Modal/index.js +38 -53
  136. package/lib/Page/Box.js +34 -45
  137. package/lib/Page/index.js +54 -78
  138. package/lib/Page/utils.js +1 -9
  139. package/lib/QueryForm/Field/Checkbox.js +5 -13
  140. package/lib/QueryForm/Field/Select.js +33 -53
  141. package/lib/QueryForm/Field/SelectInput.js +28 -56
  142. package/lib/QueryForm/Field/fieldsMap.js +1 -15
  143. package/lib/QueryForm/Field/index.js +43 -81
  144. package/lib/QueryForm/createActions.js +6 -12
  145. package/lib/QueryForm/index.js +78 -157
  146. package/lib/QueryForm/useForm.js +0 -5
  147. package/lib/QueryListScene/List.js +76 -140
  148. package/lib/QueryListScene/QueryForm.js +46 -86
  149. package/lib/QueryListScene/QueryListScene.js +25 -46
  150. package/lib/QueryListScene/Title.js +3 -7
  151. package/lib/QueryListScene/Toolbar.js +11 -16
  152. package/lib/QueryListScene/createActions.js +0 -5
  153. package/lib/QueryListScene/index.js +0 -10
  154. package/lib/QueryListScene/useActions.js +0 -5
  155. package/lib/Select/DropDownWrap.js +31 -56
  156. package/lib/Select/index.js +135 -241
  157. package/lib/Table/ResizableTable/index.js +26 -48
  158. package/lib/Table/index.js +17 -28
  159. package/lib/Title/index.js +21 -28
  160. package/lib/index.js +35 -56
  161. package/lib/locale.js +11 -12
  162. package/lib/utils/checkAuth.js +4 -9
  163. package/lib/utils/findMenuInfoByPath.js +1 -8
  164. package/lib/utils/index.js +15 -42
  165. package/package.json +2 -2
  166. package/es/Layout/checkAuth.js +0 -29
  167. package/es/Layout/utils.js +0 -136
  168. package/lib/Layout/EnterpriseLayout/Header.js +0 -113
  169. package/lib/Layout/EnterpriseLayout/HeaderActions.js +0 -104
  170. package/lib/Layout/checkAuth.js +0 -39
  171. package/lib/Layout/utils.js +0 -166
@@ -1,92 +1,56 @@
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
  require("antd/lib/drawer/style");
13
-
14
11
  var _drawer = _interopRequireDefault(require("antd/lib/drawer"));
15
-
16
12
  require("antd/lib/badge/style");
17
-
18
13
  var _badge = _interopRequireDefault(require("antd/lib/badge"));
19
-
20
14
  require("antd/lib/button/style");
21
-
22
15
  var _button = _interopRequireDefault(require("antd/lib/button"));
23
-
24
16
  var _react = _interopRequireWildcard(require("react"));
25
-
26
17
  var _classnames3 = _interopRequireDefault(require("classnames"));
27
-
28
18
  var _lodash = require("lodash");
29
-
30
19
  var _useForm = _interopRequireDefault(require("./useForm"));
31
-
32
20
  var _createActions = _interopRequireDefault(require("./createActions"));
33
-
34
21
  var _Icon = _interopRequireDefault(require("../Icon"));
35
-
36
22
  var _Field = _interopRequireDefault(require("./Field"));
37
-
38
23
  var _locale = require("../locale");
39
-
40
24
  require("./index.less");
41
-
42
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
43
-
44
- 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; }
45
-
25
+ 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); }
26
+ 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; }
46
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
47
-
48
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
49
-
50
- 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); }
51
-
52
- 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; }
53
-
54
- 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; }
55
-
56
- 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; }
57
-
28
+ 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); }
29
+ 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; }
30
+ 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; }
31
+ 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; }
58
32
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
59
-
60
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
61
-
62
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
63
-
64
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
65
-
33
+ 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); } }
34
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
35
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
36
+ 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); }
37
+ 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); }
38
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
+ 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); }; }
40
+ 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); }
66
41
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
67
-
68
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
69
-
70
- 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); }
71
-
72
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
73
-
42
+ 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; } }
43
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
74
44
  var clsPrefix = 'tnt-queryform';
75
-
76
- var QueryForm =
77
- /*#__PURE__*/
78
- function (_React$PureComponent) {
45
+ var QueryForm = /*#__PURE__*/function (_React$PureComponent) {
79
46
  _inherits(QueryForm, _React$PureComponent);
80
-
47
+ var _super = _createSuper(QueryForm);
81
48
  function QueryForm(props) {
82
49
  var _this;
83
-
84
50
  _classCallCheck(this, QueryForm);
85
-
86
- _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));
51
+ _this = _super.call(this, props);
87
52
  _this.onWindowResize = (0, _lodash.debounce)(function () {
88
53
  var current = _this.fieldsRef.current;
89
-
90
54
  if (current) {
91
55
  setTimeout(function () {
92
56
  _this.setState({
@@ -95,82 +59,60 @@ function (_React$PureComponent) {
95
59
  }, 25);
96
60
  }
97
61
  }, 50);
98
-
99
62
  _this.search = function (params) {
100
- _this.props.onSearch(_objectSpread({}, _this.form.getValues(), {}, params));
63
+ _this.props.onSearch(_objectSpread(_objectSpread({}, _this.form.getValues()), params));
101
64
  };
102
-
103
65
  _this.onSearch = function () {
104
66
  _this.props.onSearch == null ? void 0 : _this.props.onSearch(_this.form.getValues());
105
67
  };
106
-
107
68
  _this.onReset = function () {
108
69
  var _this$props = _this.props,
109
- initialValues = _this$props.initialValues,
110
- onReset = _this$props.onReset;
111
-
70
+ initialValues = _this$props.initialValues,
71
+ onReset = _this$props.onReset;
112
72
  _this.form.setValues(_objectSpread({}, initialValues));
113
-
114
73
  _this.updateDrawerFieldsValueCount();
115
-
116
74
  onReset == null ? void 0 : onReset(initialValues);
117
75
  };
118
-
119
76
  _this.onToggleExpand = function () {
120
77
  _this.setState({
121
78
  expanded: !_this.state.expanded
122
79
  });
123
-
124
80
  _this.props.onToggleExpand == null ? void 0 : _this.props.onToggleExpand(!_this.state.expanded);
125
81
  };
126
-
127
82
  _this.onShowDrawer = function () {
128
83
  _this.setState({
129
84
  drawerVisible: true
130
85
  });
131
86
  };
132
-
133
87
  _this.onFieldChange = function (name, value) {
134
88
  var values = _this.form.getValues();
135
-
136
- var newValues = _objectSpread({}, values, _defineProperty({}, name, value));
137
-
89
+ var newValues = _objectSpread(_objectSpread({}, values), {}, _defineProperty({}, name, value));
138
90
  var changedInfo = {
139
91
  name: name,
140
92
  value: value,
141
93
  preValue: values == null ? void 0 : values[name]
142
94
  };
143
95
  var onChange = _this.props.onChange;
144
-
145
96
  _this.form.setData('values', newValues);
146
-
147
97
  for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
148
98
  rest[_key - 2] = arguments[_key];
149
99
  }
150
-
151
100
  onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));
152
-
153
101
  _this.updateDrawerFieldsValueCount(newValues);
154
102
  };
155
-
156
103
  _this.updateDrawerFieldsValueCount = function () {
157
104
  var values = _this.form.getValues();
158
-
159
105
  var _this$props2 = _this.props,
160
- showFieldCount = _this$props2.showFieldCount,
161
- children = _this$props2.children;
162
-
106
+ showFieldCount = _this$props2.showFieldCount,
107
+ children = _this$props2.children;
163
108
  if (showFieldCount) {
164
109
  var drawerFieldsValueCount = children.reduce(function (acc, cur, index) {
165
110
  var _cur$props;
166
-
167
- if (index >= showFieldCount && (values == null ? void 0 : values[cur == null ? void 0 : (_cur$props = cur.props) == null ? void 0 : _cur$props.name])) {
111
+ if (index >= showFieldCount && values != null && values[cur == null ? void 0 : (_cur$props = cur.props) == null ? void 0 : _cur$props.name]) {
168
112
  acc++;
169
113
  }
170
-
171
114
  return acc;
172
115
  }, 0);
173
-
174
116
  if (drawerFieldsValueCount !== _this.state.drawerFieldsValueCount) {
175
117
  _this.setState({
176
118
  drawerFieldsValueCount: drawerFieldsValueCount
@@ -178,102 +120,92 @@ function (_React$PureComponent) {
178
120
  }
179
121
  }
180
122
  };
181
-
182
123
  var form = props.form,
183
- _initialValues = props.initialValues,
184
- _props$showExpand = props.showExpand,
185
- showExpand = _props$showExpand === void 0 ? true : _props$showExpand,
186
- renderActions = props.renderActions,
187
- defaultExpanded = props.defaultExpanded;
124
+ _initialValues = props.initialValues,
125
+ _props$showExpand = props.showExpand,
126
+ showExpand = _props$showExpand === void 0 ? true : _props$showExpand,
127
+ renderActions = props.renderActions,
128
+ defaultExpanded = props.defaultExpanded;
188
129
  _this.state = {
189
130
  showMore: false,
190
131
  expanded: defaultExpanded || !showExpand || renderActions ? true : false,
191
132
  drawerVisible: false,
192
133
  drawerFieldsValueCount: 0
193
134
  };
194
- _this.fieldsRef = (0, _react.createRef)();
195
- _this.formBoxRef = (0, _react.createRef)();
135
+ _this.fieldsRef = /*#__PURE__*/(0, _react.createRef)();
136
+ _this.formBoxRef = /*#__PURE__*/(0, _react.createRef)();
196
137
  _this.form = form || (0, _createActions["default"])();
197
-
198
138
  _this.form.setData('initialValues', _initialValues);
199
-
200
139
  _this.form.setData('values', _objectSpread({}, _initialValues));
201
-
202
140
  return _this;
203
141
  }
204
-
205
142
  _createClass(QueryForm, [{
206
143
  key: "render",
207
144
  value: function render() {
208
145
  var _this2 = this;
209
-
210
146
  var _this$props3 = this.props,
211
- children = _this$props3.children,
212
- _this$props3$classNam = _this$props3.className,
213
- className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
214
- _this$props3$initialV = _this$props3.initialValues,
215
- initialValues = _this$props3$initialV === void 0 ? {} : _this$props3$initialV,
216
- renderActions = _this$props3.renderActions,
217
- _this$props3$showSear = _this$props3.showSearch,
218
- showSearch = _this$props3$showSear === void 0 ? true : _this$props3$showSear,
219
- _this$props3$showRese = _this$props3.showReset,
220
- showReset = _this$props3$showRese === void 0 ? true : _this$props3$showRese,
221
- showFieldCount = _this$props3.showFieldCount,
222
- _this$props3$drawerPr = _this$props3.drawerProps,
223
- drawerProps = _this$props3$drawerPr === void 0 ? {} : _this$props3$drawerPr,
224
- size = _this$props3.size;
147
+ children = _this$props3.children,
148
+ _this$props3$classNam = _this$props3.className,
149
+ className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
150
+ _this$props3$initialV = _this$props3.initialValues,
151
+ initialValues = _this$props3$initialV === void 0 ? {} : _this$props3$initialV,
152
+ renderActions = _this$props3.renderActions,
153
+ _this$props3$showSear = _this$props3.showSearch,
154
+ showSearch = _this$props3$showSear === void 0 ? true : _this$props3$showSear,
155
+ _this$props3$showRese = _this$props3.showReset,
156
+ showReset = _this$props3$showRese === void 0 ? true : _this$props3$showRese,
157
+ showFieldCount = _this$props3.showFieldCount,
158
+ _this$props3$drawerPr = _this$props3.drawerProps,
159
+ drawerProps = _this$props3$drawerPr === void 0 ? {} : _this$props3$drawerPr,
160
+ size = _this$props3.size;
225
161
  var extraActions = this.props.extraActions;
226
162
  var _this$state = this.state,
227
- expanded = _this$state.expanded,
228
- showMore = _this$state.showMore,
229
- drawerVisible = _this$state.drawerVisible,
230
- drawerFieldsValueCount = _this$state.drawerFieldsValueCount;
231
-
163
+ expanded = _this$state.expanded,
164
+ showMore = _this$state.showMore,
165
+ drawerVisible = _this$state.drawerVisible,
166
+ drawerFieldsValueCount = _this$state.drawerFieldsValueCount;
232
167
  var renderFormActions = renderActions || function () {
233
- return _react["default"].createElement(_react["default"].Fragment, null, showFieldCount && _react["default"].createElement(_badge["default"], {
168
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, showFieldCount && /*#__PURE__*/_react["default"].createElement(_badge["default"], {
234
169
  count: drawerFieldsValueCount
235
- }, _react["default"].createElement(_button["default"], {
170
+ }, /*#__PURE__*/_react["default"].createElement(_button["default"], {
236
171
  onClick: _this2.onShowDrawer
237
- }, _react["default"].createElement(_Icon["default"], {
172
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
238
173
  type: "filter"
239
- }), _this2.getText('moreFiltering'))), showSearch && _react["default"].createElement(_button["default"], {
174
+ }), _this2.getText('moreFiltering'))), showSearch && /*#__PURE__*/_react["default"].createElement(_button["default"], {
240
175
  type: "primary",
241
176
  onClick: _this2.onSearch
242
- }, _this2.getText('search')), showReset && _react["default"].createElement(_button["default"], {
177
+ }, _this2.getText('search')), showReset && /*#__PURE__*/_react["default"].createElement(_button["default"], {
243
178
  onClick: _this2.onReset
244
- }, _this2.getText('reset')), showMore && !showFieldCount && _react["default"].createElement(_button["default"], {
179
+ }, _this2.getText('reset')), showMore && !showFieldCount && /*#__PURE__*/_react["default"].createElement(_button["default"], {
245
180
  className: "expand-link",
246
181
  type: "link",
247
182
  onClick: _this2.onToggleExpand
248
183
  }, _this2.getText(expanded ? 'collapse' : 'expand')), _react["default"].Children.map(children, function (child) {
249
184
  var _child$props;
250
-
251
- return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && _react["default"].cloneElement(child);
185
+ return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && /*#__PURE__*/_react["default"].cloneElement(child);
252
186
  }));
253
187
  };
254
-
255
- return _react["default"].createElement("div", {
188
+ return /*#__PURE__*/_react["default"].createElement("div", {
256
189
  ref: this.formBoxRef,
257
190
  className: (0, _classnames3["default"])(clsPrefix, _defineProperty({}, className, className))
258
- }, _react["default"].createElement(_form["default"], {
191
+ }, /*#__PURE__*/_react["default"].createElement(_form["default"], {
259
192
  layout: "inline",
260
193
  className: (0, _classnames3["default"])({
261
194
  expanded: !showMore || expanded,
262
195
  showMore: showMore
263
196
  })
264
- }, _react["default"].createElement("div", {
197
+ }, /*#__PURE__*/_react["default"].createElement("div", {
265
198
  ref: this.fieldsRef
266
199
  }, _react["default"].Children.map(children, function (child, index) {
267
200
  var _child$props2;
268
-
269
- return child && (child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.align) !== 'right' && (!showFieldCount || showFieldCount > index) && _react["default"].cloneElement(child, {
201
+ return child && (child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.align) !== 'right' && (!showFieldCount || showFieldCount > index) && /*#__PURE__*/_react["default"].cloneElement(child, {
270
202
  form: _this2.form,
271
203
  initialValue: initialValues == null ? void 0 : initialValues[child.props.name],
272
204
  onChange: _this2.onFieldChange
273
205
  });
274
- })), _react["default"].createElement("div", {
206
+ })), /*#__PURE__*/_react["default"].createElement("div", {
275
207
  className: "".concat(clsPrefix, "-actions")
276
- }, renderFormActions()), showFieldCount && _react["default"].createElement(_drawer["default"], _extends({
208
+ }, renderFormActions()), showFieldCount && /*#__PURE__*/_react["default"].createElement(_drawer["default"], _extends({
277
209
  title: this.getText('moreFiltering'),
278
210
  visible: drawerVisible,
279
211
  onClose: function onClose() {
@@ -289,19 +221,19 @@ function (_React$PureComponent) {
289
221
  'large-size': size === 'large'
290
222
  }, className, className))
291
223
  }), _react["default"].Children.map(children, function (child, index) {
292
- return child && index >= showFieldCount && _react["default"].cloneElement(child, {
224
+ return child && index >= showFieldCount && /*#__PURE__*/_react["default"].cloneElement(child, {
293
225
  form: _this2.form,
294
226
  isFieldInDrawer: true,
295
227
  initialValue: initialValues == null ? void 0 : initialValues[child.props.name],
296
228
  onChange: _this2.onFieldChange,
297
229
  onSearch: _this2.onSearch
298
230
  });
299
- }), _react["default"].createElement(_button["default"], {
231
+ }), /*#__PURE__*/_react["default"].createElement(_button["default"], {
300
232
  type: "primary",
301
233
  onClick: this.onSearch
302
- }, this.getText('search')), _react["default"].createElement(_button["default"], {
234
+ }, this.getText('search')), /*#__PURE__*/_react["default"].createElement(_button["default"], {
303
235
  onClick: this.onReset
304
- }, this.getText('reset')))), extraActions && _react["default"].createElement("div", {
236
+ }, this.getText('reset')))), extraActions && /*#__PURE__*/_react["default"].createElement("div", {
305
237
  className: "".concat(clsPrefix, "-extra")
306
238
  }, extraActions));
307
239
  }
@@ -314,7 +246,6 @@ function (_React$PureComponent) {
314
246
  key: "isFieldsWidthOverflow",
315
247
  value: function isFieldsWidthOverflow() {
316
248
  var current = this.fieldsRef.current;
317
-
318
249
  if (current) {
319
250
  return current.offsetWidth < [].reduce.call(current.children, function (acc, cur) {
320
251
  var marginArray = window.getComputedStyle(cur).margin.split(' ').map(function (str) {
@@ -324,30 +255,23 @@ function (_React$PureComponent) {
324
255
  return acc;
325
256
  }, 0);
326
257
  }
327
-
328
258
  return false;
329
259
  }
330
260
  }, {
331
261
  key: "updateFieldHeight",
332
262
  value: function updateFieldHeight() {
333
263
  var _formBoxRef$current, _formBoxRef$current2, _fieldsRef$current;
334
-
335
264
  var formBoxRef = this.formBoxRef,
336
- fieldsRef = this.fieldsRef;
337
-
265
+ fieldsRef = this.fieldsRef;
338
266
  var getFieldHeight = function getFieldHeight() {
339
267
  var _current$children;
340
-
341
268
  var current = fieldsRef.current;
342
269
  var height = '32px';
343
-
344
- if (current && ((_current$children = current.children) == null ? void 0 : _current$children[0])) {
270
+ if (current && (_current$children = current.children) != null && _current$children[0]) {
345
271
  height = window.getComputedStyle(current.children[0]).height;
346
272
  }
347
-
348
273
  return height;
349
274
  };
350
-
351
275
  var queryFormActionsDom = formBoxRef == null ? void 0 : (_formBoxRef$current = formBoxRef.current) == null ? void 0 : _formBoxRef$current.querySelector(".".concat(clsPrefix, "-actions"));
352
276
  var queryFormExtraDom = formBoxRef == null ? void 0 : (_formBoxRef$current2 = formBoxRef.current) == null ? void 0 : _formBoxRef$current2.querySelector(".".concat(clsPrefix, "-extra"));
353
277
  var formItemsDomList = fieldsRef == null ? void 0 : (_fieldsRef$current = fieldsRef.current) == null ? void 0 : _fieldsRef$current.querySelectorAll('.ant-form-item-control');
@@ -368,25 +292,24 @@ function (_React$PureComponent) {
368
292
  value: function componentDidMount() {
369
293
  var current = this.fieldsRef.current;
370
294
  var _this$props4 = this.props,
371
- showFieldCount = _this$props4.showFieldCount,
372
- _this$props4$showExpa = _this$props4.showExpand,
373
- showExpand = _this$props4$showExpa === void 0 ? true : _this$props4$showExpa,
374
- renderActions = _this$props4.renderActions;
295
+ showFieldCount = _this$props4.showFieldCount,
296
+ _this$props4$showExpa = _this$props4.showExpand,
297
+ showExpand = _this$props4$showExpa === void 0 ? true : _this$props4$showExpa,
298
+ renderActions = _this$props4.renderActions;
375
299
  this.updateFieldHeight();
376
- this.form.on('search', this.search); // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑
377
- // || renderActions
300
+ this.form.on('search', this.search);
378
301
 
302
+ // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑
303
+ // || renderActions
379
304
  if (!showFieldCount && !showExpand) {
380
305
  return;
381
306
  }
382
-
383
307
  if (!showFieldCount) {
384
308
  if (current && this.isFieldsWidthOverflow()) {
385
309
  this.setState({
386
310
  showMore: true
387
311
  });
388
312
  }
389
-
390
313
  window.addEventListener('resize', this.onWindowResize);
391
314
  } else {
392
315
  this.updateDrawerFieldsValueCount();
@@ -403,10 +326,8 @@ function (_React$PureComponent) {
403
326
  this.form.off('search', this.search);
404
327
  }
405
328
  }]);
406
-
407
329
  return QueryForm;
408
330
  }(_react["default"].PureComponent);
409
-
410
331
  ;
411
332
  QueryForm.Field = _Field["default"];
412
333
  QueryForm.useForm = _useForm["default"];
@@ -4,16 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = useForm;
7
-
8
7
  var _react = require("react");
9
-
10
8
  var _createActions = _interopRequireDefault(require("./createActions"));
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
10
  function useForm() {
15
11
  var form = (0, _react.useRef)((0, _createActions["default"])());
16
12
  return [form.current];
17
13
  }
18
-
19
14
  ;