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
package/es/QueryForm/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
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
|
import "antd/lib/drawer/style";
|
|
@@ -6,33 +7,22 @@ import "antd/lib/badge/style";
|
|
|
6
7
|
import _Badge from "antd/lib/badge";
|
|
7
8
|
import "antd/lib/button/style";
|
|
8
9
|
import _Button from "antd/lib/button";
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
27
|
-
|
|
28
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
-
|
|
30
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
31
|
-
|
|
32
|
-
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); }
|
|
33
|
-
|
|
34
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
-
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
15
|
+
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); } }
|
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
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); }
|
|
19
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
20
|
+
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); }
|
|
21
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
22
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
24
|
+
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); }
|
|
25
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
36
26
|
import React, { createRef } from 'react';
|
|
37
27
|
import classnames from 'classnames';
|
|
38
28
|
import { debounce } from 'lodash';
|
|
@@ -43,21 +33,13 @@ import Field from './Field';
|
|
|
43
33
|
import { getText as _getText, getLanguage } from '../locale';
|
|
44
34
|
import './index.less';
|
|
45
35
|
var clsPrefix = 'tnt-queryform';
|
|
46
|
-
|
|
47
|
-
var QueryForm =
|
|
48
|
-
/*#__PURE__*/
|
|
49
|
-
function (_React$PureComponent) {
|
|
50
|
-
_inherits(QueryForm, _React$PureComponent);
|
|
51
|
-
|
|
36
|
+
var QueryForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
52
37
|
function QueryForm(props) {
|
|
53
38
|
var _this;
|
|
54
|
-
|
|
55
39
|
_classCallCheck(this, QueryForm);
|
|
56
|
-
|
|
57
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));
|
|
40
|
+
_this = _callSuper(this, QueryForm, [props]);
|
|
58
41
|
_this.onWindowResize = debounce(function () {
|
|
59
42
|
var current = _this.fieldsRef.current;
|
|
60
|
-
|
|
61
43
|
if (current) {
|
|
62
44
|
setTimeout(function () {
|
|
63
45
|
_this.setState({
|
|
@@ -66,82 +48,60 @@ function (_React$PureComponent) {
|
|
|
66
48
|
}, 25);
|
|
67
49
|
}
|
|
68
50
|
}, 50);
|
|
69
|
-
|
|
70
51
|
_this.search = function (params) {
|
|
71
|
-
_this.props.onSearch(_objectSpread({}, _this.form.getValues(),
|
|
52
|
+
_this.props.onSearch(_objectSpread(_objectSpread({}, _this.form.getValues()), params));
|
|
72
53
|
};
|
|
73
|
-
|
|
74
54
|
_this.onSearch = function () {
|
|
75
55
|
_this.props.onSearch == null ? void 0 : _this.props.onSearch(_this.form.getValues());
|
|
76
56
|
};
|
|
77
|
-
|
|
78
57
|
_this.onReset = function () {
|
|
79
58
|
var _this$props = _this.props,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
59
|
+
initialValues = _this$props.initialValues,
|
|
60
|
+
onReset = _this$props.onReset;
|
|
83
61
|
_this.form.setValues(_objectSpread({}, initialValues));
|
|
84
|
-
|
|
85
62
|
_this.updateDrawerFieldsValueCount();
|
|
86
|
-
|
|
87
63
|
onReset == null ? void 0 : onReset(initialValues);
|
|
88
64
|
};
|
|
89
|
-
|
|
90
65
|
_this.onToggleExpand = function () {
|
|
91
66
|
_this.setState({
|
|
92
67
|
expanded: !_this.state.expanded
|
|
93
68
|
});
|
|
94
|
-
|
|
95
69
|
_this.props.onToggleExpand == null ? void 0 : _this.props.onToggleExpand(!_this.state.expanded);
|
|
96
70
|
};
|
|
97
|
-
|
|
98
71
|
_this.onShowDrawer = function () {
|
|
99
72
|
_this.setState({
|
|
100
73
|
drawerVisible: true
|
|
101
74
|
});
|
|
102
75
|
};
|
|
103
|
-
|
|
104
76
|
_this.onFieldChange = function (name, value) {
|
|
105
77
|
var values = _this.form.getValues();
|
|
106
|
-
|
|
107
|
-
var newValues = _objectSpread({}, values, _defineProperty({}, name, value));
|
|
108
|
-
|
|
78
|
+
var newValues = _objectSpread(_objectSpread({}, values), {}, _defineProperty({}, name, value));
|
|
109
79
|
var changedInfo = {
|
|
110
80
|
name: name,
|
|
111
81
|
value: value,
|
|
112
82
|
preValue: values == null ? void 0 : values[name]
|
|
113
83
|
};
|
|
114
84
|
var onChange = _this.props.onChange;
|
|
115
|
-
|
|
116
85
|
_this.form.setData('values', newValues);
|
|
117
|
-
|
|
118
86
|
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
119
87
|
rest[_key - 2] = arguments[_key];
|
|
120
88
|
}
|
|
121
|
-
|
|
122
89
|
onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));
|
|
123
|
-
|
|
124
90
|
_this.updateDrawerFieldsValueCount(newValues);
|
|
125
91
|
};
|
|
126
|
-
|
|
127
92
|
_this.updateDrawerFieldsValueCount = function () {
|
|
128
93
|
var values = _this.form.getValues();
|
|
129
|
-
|
|
130
94
|
var _this$props2 = _this.props,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
95
|
+
showFieldCount = _this$props2.showFieldCount,
|
|
96
|
+
children = _this$props2.children;
|
|
134
97
|
if (showFieldCount) {
|
|
135
98
|
var drawerFieldsValueCount = children.reduce(function (acc, cur, index) {
|
|
136
99
|
var _cur$props;
|
|
137
|
-
|
|
138
|
-
if (index >= showFieldCount && (values == null ? void 0 : values[cur == null ? void 0 : (_cur$props = cur.props) == null ? void 0 : _cur$props.name])) {
|
|
100
|
+
if (index >= showFieldCount && values != null && values[cur == null ? void 0 : (_cur$props = cur.props) == null ? void 0 : _cur$props.name]) {
|
|
139
101
|
acc++;
|
|
140
102
|
}
|
|
141
|
-
|
|
142
103
|
return acc;
|
|
143
104
|
}, 0);
|
|
144
|
-
|
|
145
105
|
if (drawerFieldsValueCount !== _this.state.drawerFieldsValueCount) {
|
|
146
106
|
_this.setState({
|
|
147
107
|
drawerFieldsValueCount: drawerFieldsValueCount
|
|
@@ -149,102 +109,93 @@ function (_React$PureComponent) {
|
|
|
149
109
|
}
|
|
150
110
|
}
|
|
151
111
|
};
|
|
152
|
-
|
|
153
112
|
var form = props.form,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
113
|
+
_initialValues = props.initialValues,
|
|
114
|
+
_props$showExpand = props.showExpand,
|
|
115
|
+
showExpand = _props$showExpand === void 0 ? true : _props$showExpand,
|
|
116
|
+
renderActions = props.renderActions,
|
|
117
|
+
defaultExpanded = props.defaultExpanded;
|
|
159
118
|
_this.state = {
|
|
160
119
|
showMore: false,
|
|
161
120
|
expanded: defaultExpanded || !showExpand || renderActions ? true : false,
|
|
162
121
|
drawerVisible: false,
|
|
163
122
|
drawerFieldsValueCount: 0
|
|
164
123
|
};
|
|
165
|
-
_this.fieldsRef = createRef();
|
|
166
|
-
_this.formBoxRef = createRef();
|
|
124
|
+
_this.fieldsRef = /*#__PURE__*/createRef();
|
|
125
|
+
_this.formBoxRef = /*#__PURE__*/createRef();
|
|
167
126
|
_this.form = form || createActions();
|
|
168
|
-
|
|
169
127
|
_this.form.setData('initialValues', _initialValues);
|
|
170
|
-
|
|
171
128
|
_this.form.setData('values', _objectSpread({}, _initialValues));
|
|
172
|
-
|
|
173
129
|
return _this;
|
|
174
130
|
}
|
|
175
|
-
|
|
176
|
-
_createClass(QueryForm, [{
|
|
131
|
+
_inherits(QueryForm, _React$PureComponent);
|
|
132
|
+
return _createClass(QueryForm, [{
|
|
177
133
|
key: "render",
|
|
178
134
|
value: function render() {
|
|
179
135
|
var _this2 = this;
|
|
180
|
-
|
|
181
136
|
var _this$props3 = this.props,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
137
|
+
children = _this$props3.children,
|
|
138
|
+
_this$props3$classNam = _this$props3.className,
|
|
139
|
+
className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,
|
|
140
|
+
_this$props3$initialV = _this$props3.initialValues,
|
|
141
|
+
initialValues = _this$props3$initialV === void 0 ? {} : _this$props3$initialV,
|
|
142
|
+
renderActions = _this$props3.renderActions,
|
|
143
|
+
_this$props3$showSear = _this$props3.showSearch,
|
|
144
|
+
showSearch = _this$props3$showSear === void 0 ? true : _this$props3$showSear,
|
|
145
|
+
_this$props3$showRese = _this$props3.showReset,
|
|
146
|
+
showReset = _this$props3$showRese === void 0 ? true : _this$props3$showRese,
|
|
147
|
+
showFieldCount = _this$props3.showFieldCount,
|
|
148
|
+
_this$props3$drawerPr = _this$props3.drawerProps,
|
|
149
|
+
drawerProps = _this$props3$drawerPr === void 0 ? {} : _this$props3$drawerPr,
|
|
150
|
+
size = _this$props3.size;
|
|
196
151
|
var extraActions = this.props.extraActions;
|
|
197
152
|
var _this$state = this.state,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
153
|
+
expanded = _this$state.expanded,
|
|
154
|
+
showMore = _this$state.showMore,
|
|
155
|
+
drawerVisible = _this$state.drawerVisible,
|
|
156
|
+
drawerFieldsValueCount = _this$state.drawerFieldsValueCount;
|
|
203
157
|
var renderFormActions = renderActions || function () {
|
|
204
|
-
return React.createElement(React.Fragment, null, showFieldCount && React.createElement(_Badge, {
|
|
158
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, showFieldCount && /*#__PURE__*/React.createElement(_Badge, {
|
|
205
159
|
count: drawerFieldsValueCount
|
|
206
|
-
}, React.createElement(_Button, {
|
|
160
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
207
161
|
onClick: _this2.onShowDrawer
|
|
208
|
-
}, React.createElement(Icon, {
|
|
162
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
209
163
|
type: "filter"
|
|
210
|
-
}), _this2.getText('moreFiltering'))), showSearch && React.createElement(_Button, {
|
|
164
|
+
}), _this2.getText('moreFiltering'))), showSearch && /*#__PURE__*/React.createElement(_Button, {
|
|
211
165
|
type: "primary",
|
|
212
166
|
onClick: _this2.onSearch
|
|
213
|
-
}, _this2.getText('search')), showReset && React.createElement(_Button, {
|
|
167
|
+
}, _this2.getText('search')), showReset && /*#__PURE__*/React.createElement(_Button, {
|
|
214
168
|
onClick: _this2.onReset
|
|
215
|
-
}, _this2.getText('reset')), showMore && !showFieldCount && React.createElement(_Button, {
|
|
169
|
+
}, _this2.getText('reset')), showMore && !showFieldCount && /*#__PURE__*/React.createElement(_Button, {
|
|
216
170
|
className: "expand-link",
|
|
217
171
|
type: "link",
|
|
218
172
|
onClick: _this2.onToggleExpand
|
|
219
173
|
}, _this2.getText(expanded ? 'collapse' : 'expand')), React.Children.map(children, function (child) {
|
|
220
174
|
var _child$props;
|
|
221
|
-
|
|
222
|
-
return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && React.cloneElement(child);
|
|
175
|
+
return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && /*#__PURE__*/React.cloneElement(child);
|
|
223
176
|
}));
|
|
224
177
|
};
|
|
225
|
-
|
|
226
|
-
return React.createElement("div", {
|
|
178
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
227
179
|
ref: this.formBoxRef,
|
|
228
180
|
className: classnames(clsPrefix, _defineProperty({}, className, className))
|
|
229
|
-
}, React.createElement(_Form, {
|
|
181
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
|
230
182
|
layout: "inline",
|
|
231
183
|
className: classnames({
|
|
232
184
|
expanded: !showMore || expanded,
|
|
233
185
|
showMore: showMore
|
|
234
186
|
})
|
|
235
|
-
}, React.createElement("div", {
|
|
187
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
236
188
|
ref: this.fieldsRef
|
|
237
189
|
}, React.Children.map(children, function (child, index) {
|
|
238
190
|
var _child$props2;
|
|
239
|
-
|
|
240
|
-
return child && (child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.align) !== 'right' && (!showFieldCount || showFieldCount > index) && React.cloneElement(child, {
|
|
191
|
+
return child && (child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.align) !== 'right' && (!showFieldCount || showFieldCount > index) && /*#__PURE__*/React.cloneElement(child, {
|
|
241
192
|
form: _this2.form,
|
|
242
193
|
initialValue: initialValues == null ? void 0 : initialValues[child.props.name],
|
|
243
194
|
onChange: _this2.onFieldChange
|
|
244
195
|
});
|
|
245
|
-
})), React.createElement("div", {
|
|
196
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
246
197
|
className: "".concat(clsPrefix, "-actions")
|
|
247
|
-
}, renderFormActions()), showFieldCount && React.createElement(_Drawer, _extends({
|
|
198
|
+
}, renderFormActions()), showFieldCount && /*#__PURE__*/React.createElement(_Drawer, _extends({
|
|
248
199
|
title: this.getText('moreFiltering'),
|
|
249
200
|
visible: drawerVisible,
|
|
250
201
|
onClose: function onClose() {
|
|
@@ -260,19 +211,19 @@ function (_React$PureComponent) {
|
|
|
260
211
|
'large-size': size === 'large'
|
|
261
212
|
}, className, className))
|
|
262
213
|
}), React.Children.map(children, function (child, index) {
|
|
263
|
-
return child && index >= showFieldCount && React.cloneElement(child, {
|
|
214
|
+
return child && index >= showFieldCount && /*#__PURE__*/React.cloneElement(child, {
|
|
264
215
|
form: _this2.form,
|
|
265
216
|
isFieldInDrawer: true,
|
|
266
217
|
initialValue: initialValues == null ? void 0 : initialValues[child.props.name],
|
|
267
218
|
onChange: _this2.onFieldChange,
|
|
268
219
|
onSearch: _this2.onSearch
|
|
269
220
|
});
|
|
270
|
-
}), React.createElement(_Button, {
|
|
221
|
+
}), /*#__PURE__*/React.createElement(_Button, {
|
|
271
222
|
type: "primary",
|
|
272
223
|
onClick: this.onSearch
|
|
273
|
-
}, this.getText('search')), React.createElement(_Button, {
|
|
224
|
+
}, this.getText('search')), /*#__PURE__*/React.createElement(_Button, {
|
|
274
225
|
onClick: this.onReset
|
|
275
|
-
}, this.getText('reset')))), extraActions && React.createElement("div", {
|
|
226
|
+
}, this.getText('reset')))), extraActions && /*#__PURE__*/React.createElement("div", {
|
|
276
227
|
className: "".concat(clsPrefix, "-extra")
|
|
277
228
|
}, extraActions));
|
|
278
229
|
}
|
|
@@ -285,7 +236,6 @@ function (_React$PureComponent) {
|
|
|
285
236
|
key: "isFieldsWidthOverflow",
|
|
286
237
|
value: function isFieldsWidthOverflow() {
|
|
287
238
|
var current = this.fieldsRef.current;
|
|
288
|
-
|
|
289
239
|
if (current) {
|
|
290
240
|
return current.offsetWidth < [].reduce.call(current.children, function (acc, cur) {
|
|
291
241
|
var marginArray = window.getComputedStyle(cur).margin.split(' ').map(function (str) {
|
|
@@ -295,30 +245,23 @@ function (_React$PureComponent) {
|
|
|
295
245
|
return acc;
|
|
296
246
|
}, 0);
|
|
297
247
|
}
|
|
298
|
-
|
|
299
248
|
return false;
|
|
300
249
|
}
|
|
301
250
|
}, {
|
|
302
251
|
key: "updateFieldHeight",
|
|
303
252
|
value: function updateFieldHeight() {
|
|
304
253
|
var _formBoxRef$current, _formBoxRef$current2, _fieldsRef$current;
|
|
305
|
-
|
|
306
254
|
var formBoxRef = this.formBoxRef,
|
|
307
|
-
|
|
308
|
-
|
|
255
|
+
fieldsRef = this.fieldsRef;
|
|
309
256
|
var getFieldHeight = function getFieldHeight() {
|
|
310
257
|
var _current$children;
|
|
311
|
-
|
|
312
258
|
var current = fieldsRef.current;
|
|
313
259
|
var height = '32px';
|
|
314
|
-
|
|
315
|
-
if (current && ((_current$children = current.children) == null ? void 0 : _current$children[0])) {
|
|
260
|
+
if (current && (_current$children = current.children) != null && _current$children[0]) {
|
|
316
261
|
height = window.getComputedStyle(current.children[0]).height;
|
|
317
262
|
}
|
|
318
|
-
|
|
319
263
|
return height;
|
|
320
264
|
};
|
|
321
|
-
|
|
322
265
|
var queryFormActionsDom = formBoxRef == null ? void 0 : (_formBoxRef$current = formBoxRef.current) == null ? void 0 : _formBoxRef$current.querySelector(".".concat(clsPrefix, "-actions"));
|
|
323
266
|
var queryFormExtraDom = formBoxRef == null ? void 0 : (_formBoxRef$current2 = formBoxRef.current) == null ? void 0 : _formBoxRef$current2.querySelector(".".concat(clsPrefix, "-extra"));
|
|
324
267
|
var formItemsDomList = fieldsRef == null ? void 0 : (_fieldsRef$current = fieldsRef.current) == null ? void 0 : _fieldsRef$current.querySelectorAll('.ant-form-item-control');
|
|
@@ -339,25 +282,24 @@ function (_React$PureComponent) {
|
|
|
339
282
|
value: function componentDidMount() {
|
|
340
283
|
var current = this.fieldsRef.current;
|
|
341
284
|
var _this$props4 = this.props,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
285
|
+
showFieldCount = _this$props4.showFieldCount,
|
|
286
|
+
_this$props4$showExpa = _this$props4.showExpand,
|
|
287
|
+
showExpand = _this$props4$showExpa === void 0 ? true : _this$props4$showExpa,
|
|
288
|
+
renderActions = _this$props4.renderActions;
|
|
346
289
|
this.updateFieldHeight();
|
|
347
|
-
this.form.on('search', this.search);
|
|
348
|
-
// || renderActions
|
|
290
|
+
this.form.on('search', this.search);
|
|
349
291
|
|
|
292
|
+
// 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑
|
|
293
|
+
// || renderActions
|
|
350
294
|
if (!showFieldCount && !showExpand) {
|
|
351
295
|
return;
|
|
352
296
|
}
|
|
353
|
-
|
|
354
297
|
if (!showFieldCount) {
|
|
355
298
|
if (current && this.isFieldsWidthOverflow()) {
|
|
356
299
|
this.setState({
|
|
357
300
|
showMore: true
|
|
358
301
|
});
|
|
359
302
|
}
|
|
360
|
-
|
|
361
303
|
window.addEventListener('resize', this.onWindowResize);
|
|
362
304
|
} else {
|
|
363
305
|
this.updateDrawerFieldsValueCount();
|
|
@@ -374,10 +316,7 @@ function (_React$PureComponent) {
|
|
|
374
316
|
this.form.off('search', this.search);
|
|
375
317
|
}
|
|
376
318
|
}]);
|
|
377
|
-
|
|
378
|
-
return QueryForm;
|
|
379
319
|
}(React.PureComponent);
|
|
380
|
-
|
|
381
320
|
;
|
|
382
321
|
QueryForm.Field = Field;
|
|
383
322
|
QueryForm.useForm = useForm;
|