tntd 1.4.3 → 1.4.6

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/dist/stats.json CHANGED
@@ -5,9 +5,9 @@
5
5
  "entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.\nEntrypoints:\n main (599 KiB)\n tntd.css\n tntd.js\n"
6
6
  ],
7
7
  "version": "4.46.0",
8
- "hash": "235c7ad4c3efdc5a5bdc",
9
- "time": 28972,
10
- "builtAt": 1648709379874,
8
+ "hash": "84d8361f224baea5bd03",
9
+ "time": 20640,
10
+ "builtAt": 1650874735875,
11
11
  "publicPath": "",
12
12
  "outputPath": "/Users/zhouzefei/projects/tntd/dist",
13
13
  "assetsByChunkName": {
@@ -137,7 +137,7 @@
137
137
  },
138
138
  {
139
139
  "name": "tntd.js",
140
- "size": 600755,
140
+ "size": 600786,
141
141
  "chunks": [
142
142
  0
143
143
  ],
@@ -184,7 +184,7 @@
184
184
  "rendered": true,
185
185
  "initial": true,
186
186
  "entry": true,
187
- "size": 889664,
187
+ "size": 889784,
188
188
  "names": [
189
189
  "main"
190
190
  ],
@@ -192,7 +192,7 @@
192
192
  "tntd.css",
193
193
  "tntd.js"
194
194
  ],
195
- "hash": "6e5cf49876d1987b35a0",
195
+ "hash": "8c90d77c9dfea6a5ee3a",
196
196
  "siblings": [],
197
197
  "parents": [],
198
198
  "children": [
@@ -546,7 +546,7 @@
546
546
  "moduleName": "./components/index.js + 88 modules",
547
547
  "type": "harmony side effect evaluation",
548
548
  "userRequest": "react",
549
- "loc": "1:0-31"
549
+ "loc": "1:0-38"
550
550
  },
551
551
  {
552
552
  "moduleId": 87,
@@ -564,7 +564,7 @@
564
564
  "moduleName": "./components/index.js + 88 modules",
565
565
  "type": "harmony side effect evaluation",
566
566
  "userRequest": "react",
567
- "loc": "1:0-38"
567
+ "loc": "1:0-31"
568
568
  },
569
569
  {
570
570
  "moduleId": 87,
@@ -915,7 +915,7 @@
915
915
  "moduleName": "./components/index.js + 88 modules",
916
916
  "type": "harmony side effect evaluation",
917
917
  "userRequest": "react",
918
- "loc": "27:0-80"
918
+ "loc": "27:0-41"
919
919
  },
920
920
  {
921
921
  "moduleId": 87,
@@ -924,7 +924,7 @@
924
924
  "moduleName": "./components/index.js + 88 modules",
925
925
  "type": "harmony side effect evaluation",
926
926
  "userRequest": "react",
927
- "loc": "27:0-41"
927
+ "loc": "27:0-80"
928
928
  },
929
929
  {
930
930
  "moduleId": 87,
@@ -1077,7 +1077,7 @@
1077
1077
  "moduleName": "./components/index.js + 88 modules",
1078
1078
  "type": "harmony side effect evaluation",
1079
1079
  "userRequest": "react",
1080
- "loc": "35:0-41"
1080
+ "loc": "35:0-44"
1081
1081
  },
1082
1082
  {
1083
1083
  "moduleId": 87,
@@ -1086,7 +1086,7 @@
1086
1086
  "moduleName": "./components/index.js + 88 modules",
1087
1087
  "type": "harmony side effect evaluation",
1088
1088
  "userRequest": "react",
1089
- "loc": "35:0-44"
1089
+ "loc": "35:0-41"
1090
1090
  },
1091
1091
  {
1092
1092
  "moduleId": 87,
@@ -2049,7 +2049,7 @@
2049
2049
  "moduleName": "./components/index.js + 88 modules",
2050
2050
  "type": "harmony import specifier",
2051
2051
  "userRequest": "react",
2052
- "loc": "127:13-18"
2052
+ "loc": "128:5-10"
2053
2053
  },
2054
2054
  {
2055
2055
  "moduleId": 87,
@@ -2058,7 +2058,7 @@
2058
2058
  "moduleName": "./components/index.js + 88 modules",
2059
2059
  "type": "harmony import specifier",
2060
2060
  "userRequest": "react",
2061
- "loc": "128:5-10"
2061
+ "loc": "129:19-27"
2062
2062
  },
2063
2063
  {
2064
2064
  "moduleId": 87,
@@ -2067,7 +2067,7 @@
2067
2067
  "moduleName": "./components/index.js + 88 modules",
2068
2068
  "type": "harmony import specifier",
2069
2069
  "userRequest": "react",
2070
- "loc": "129:19-27"
2070
+ "loc": "130:13-18"
2071
2071
  },
2072
2072
  {
2073
2073
  "moduleId": 87,
@@ -2301,7 +2301,7 @@
2301
2301
  "moduleName": "./components/index.js + 88 modules",
2302
2302
  "type": "harmony import specifier",
2303
2303
  "userRequest": "react",
2304
- "loc": "162:2-7"
2304
+ "loc": "163:19-27"
2305
2305
  },
2306
2306
  {
2307
2307
  "moduleId": 87,
@@ -2310,7 +2310,7 @@
2310
2310
  "moduleName": "./components/index.js + 88 modules",
2311
2311
  "type": "harmony import specifier",
2312
2312
  "userRequest": "react",
2313
- "loc": "163:19-27"
2313
+ "loc": "164:32-37"
2314
2314
  },
2315
2315
  {
2316
2316
  "moduleId": 87,
@@ -2319,7 +2319,7 @@
2319
2319
  "moduleName": "./components/index.js + 88 modules",
2320
2320
  "type": "harmony import specifier",
2321
2321
  "userRequest": "react",
2322
- "loc": "164:32-37"
2322
+ "loc": "165:2-7"
2323
2323
  },
2324
2324
  {
2325
2325
  "moduleId": 87,
@@ -2805,7 +2805,7 @@
2805
2805
  "moduleName": "./components/index.js + 88 modules",
2806
2806
  "type": "harmony import specifier",
2807
2807
  "userRequest": "react",
2808
- "loc": "370:2-7"
2808
+ "loc": "371:2-7"
2809
2809
  },
2810
2810
  {
2811
2811
  "moduleId": 87,
@@ -2909,9 +2909,9 @@
2909
2909
  "chunks": [
2910
2910
  0
2911
2911
  ],
2912
- "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/ResizableTable/index.js",
2912
+ "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/index.js",
2913
2913
  "issuerId": null,
2914
- "issuerName": "./components/Table/ResizableTable/index.js",
2914
+ "issuerName": "./components/Table/index.js",
2915
2915
  "issuerPath": [
2916
2916
  {
2917
2917
  "id": null,
@@ -2920,8 +2920,8 @@
2920
2920
  },
2921
2921
  {
2922
2922
  "id": null,
2923
- "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/ResizableTable/index.js",
2924
- "name": "./components/Table/ResizableTable/index.js"
2923
+ "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/index.js",
2924
+ "name": "./components/Table/index.js"
2925
2925
  }
2926
2926
  ],
2927
2927
  "failed": false,
@@ -3071,7 +3071,7 @@
3071
3071
  "moduleName": "./components/index.js + 88 modules",
3072
3072
  "type": "harmony side effect evaluation",
3073
3073
  "userRequest": "antd",
3074
- "loc": "22:0-37"
3074
+ "loc": "22:0-30"
3075
3075
  },
3076
3076
  {
3077
3077
  "moduleId": 87,
@@ -3080,7 +3080,7 @@
3080
3080
  "moduleName": "./components/index.js + 88 modules",
3081
3081
  "type": "harmony side effect evaluation",
3082
3082
  "userRequest": "antd",
3083
- "loc": "22:0-30"
3083
+ "loc": "22:0-37"
3084
3084
  },
3085
3085
  {
3086
3086
  "moduleId": 87,
@@ -3170,7 +3170,7 @@
3170
3170
  "moduleName": "./components/index.js + 88 modules",
3171
3171
  "type": "harmony import specifier",
3172
3172
  "userRequest": "antd",
3173
- "loc": "28:29-32"
3173
+ "loc": "28:29-34"
3174
3174
  },
3175
3175
  {
3176
3176
  "moduleId": 87,
@@ -3179,7 +3179,7 @@
3179
3179
  "moduleName": "./components/index.js + 88 modules",
3180
3180
  "type": "harmony import specifier",
3181
3181
  "userRequest": "antd",
3182
- "loc": "28:29-34"
3182
+ "loc": "28:29-32"
3183
3183
  },
3184
3184
  {
3185
3185
  "moduleId": 87,
@@ -5182,7 +5182,7 @@
5182
5182
  "moduleName": "./components/index.js + 88 modules",
5183
5183
  "type": "harmony side effect evaluation",
5184
5184
  "userRequest": "lodash",
5185
- "loc": "29:0-67"
5185
+ "loc": "29:0-34"
5186
5186
  },
5187
5187
  {
5188
5188
  "moduleId": 87,
@@ -5191,7 +5191,7 @@
5191
5191
  "moduleName": "./components/index.js + 88 modules",
5192
5192
  "type": "harmony side effect evaluation",
5193
5193
  "userRequest": "lodash",
5194
- "loc": "29:0-34"
5194
+ "loc": "29:0-67"
5195
5195
  },
5196
5196
  {
5197
5197
  "moduleId": 87,
@@ -5272,7 +5272,7 @@
5272
5272
  "moduleName": "./components/index.js + 88 modules",
5273
5273
  "type": "harmony side effect evaluation",
5274
5274
  "userRequest": "lodash",
5275
- "loc": "38:0-66"
5275
+ "loc": "38:0-29"
5276
5276
  },
5277
5277
  {
5278
5278
  "moduleId": 87,
@@ -5281,7 +5281,7 @@
5281
5281
  "moduleName": "./components/index.js + 88 modules",
5282
5282
  "type": "harmony side effect evaluation",
5283
5283
  "userRequest": "lodash",
5284
- "loc": "38:0-29"
5284
+ "loc": "38:0-66"
5285
5285
  },
5286
5286
  {
5287
5287
  "moduleId": 87,
@@ -5913,9 +5913,9 @@
5913
5913
  "chunks": [
5914
5914
  0
5915
5915
  ],
5916
- "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/ResizableTable/index.js",
5916
+ "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/index.js",
5917
5917
  "issuerId": null,
5918
- "issuerName": "./components/Table/ResizableTable/index.js",
5918
+ "issuerName": "./components/Table/index.js",
5919
5919
  "issuerPath": [
5920
5920
  {
5921
5921
  "id": null,
@@ -5924,8 +5924,8 @@
5924
5924
  },
5925
5925
  {
5926
5926
  "id": null,
5927
- "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/ResizableTable/index.js",
5928
- "name": "./components/Table/ResizableTable/index.js"
5927
+ "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/index.js",
5928
+ "name": "./components/Table/index.js"
5929
5929
  }
5930
5930
  ],
5931
5931
  "failed": false,
@@ -6300,7 +6300,7 @@
6300
6300
  "moduleName": "./components/index.js + 88 modules",
6301
6301
  "type": "harmony import specifier",
6302
6302
  "userRequest": "classnames",
6303
- "loc": "129:19-29"
6303
+ "loc": "132:19-29"
6304
6304
  },
6305
6305
  {
6306
6306
  "moduleId": 87,
@@ -6542,9 +6542,9 @@
6542
6542
  "chunks": [
6543
6543
  0
6544
6544
  ],
6545
- "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/QueryListScene/createActions.js",
6545
+ "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Layout/createActions.js",
6546
6546
  "issuerId": null,
6547
- "issuerName": "./components/QueryListScene/createActions.js",
6547
+ "issuerName": "./components/Layout/createActions.js",
6548
6548
  "issuerPath": [
6549
6549
  {
6550
6550
  "id": null,
@@ -6553,13 +6553,13 @@
6553
6553
  },
6554
6554
  {
6555
6555
  "id": null,
6556
- "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/QueryListScene/index.js",
6557
- "name": "./components/QueryListScene/index.js"
6556
+ "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Layout/index.js",
6557
+ "name": "./components/Layout/index.js"
6558
6558
  },
6559
6559
  {
6560
6560
  "id": null,
6561
- "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/QueryListScene/createActions.js",
6562
- "name": "./components/QueryListScene/createActions.js"
6561
+ "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Layout/createActions.js",
6562
+ "name": "./components/Layout/createActions.js"
6563
6563
  }
6564
6564
  ],
6565
6565
  "failed": false,
@@ -12767,7 +12767,7 @@
12767
12767
  "name": "./components/index.js + 88 modules",
12768
12768
  "index": 0,
12769
12769
  "index2": 187,
12770
- "size": 397482,
12770
+ "size": 397602,
12771
12771
  "cacheable": true,
12772
12772
  "built": true,
12773
12773
  "optional": false,
@@ -13392,7 +13392,7 @@
13392
13392
  "name": "./components/QueryForm/index.js",
13393
13393
  "index": 113,
13394
13394
  "index2": 121,
13395
- "size": 16414,
13395
+ "size": 16423,
13396
13396
  "cacheable": true,
13397
13397
  "built": true,
13398
13398
  "optional": false,
@@ -13447,7 +13447,7 @@
13447
13447
  "moduleName": "./components/QueryListScene/QueryForm.js",
13448
13448
  "type": "harmony import specifier",
13449
13449
  "userRequest": "../QueryForm",
13450
- "loc": "107:25-29"
13450
+ "loc": "110:25-29"
13451
13451
  },
13452
13452
  {
13453
13453
  "moduleId": null,
@@ -13456,7 +13456,7 @@
13456
13456
  "moduleName": "./components/QueryListScene/QueryForm.js",
13457
13457
  "type": "harmony import specifier",
13458
13458
  "userRequest": "../QueryForm",
13459
- "loc": "127:33-37"
13459
+ "loc": "130:33-37"
13460
13460
  },
13461
13461
  {
13462
13462
  "moduleId": null,
@@ -13465,7 +13465,7 @@
13465
13465
  "moduleName": "./components/QueryListScene/QueryForm.js",
13466
13466
  "type": "harmony import specifier",
13467
13467
  "userRequest": "../QueryForm",
13468
- "loc": "166:18-22"
13468
+ "loc": "169:18-22"
13469
13469
  }
13470
13470
  ],
13471
13471
  "usedExports": [
@@ -13476,7 +13476,7 @@
13476
13476
  ],
13477
13477
  "optimizationBailout": [],
13478
13478
  "depth": 1,
13479
- "source": "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); }\n\nfunction _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); }\n\nfunction 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; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport React, { createRef } from 'react';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { Form, Button, Drawer, Badge } from 'antd';\nimport useForm from './useForm';\nimport createActions from './createActions';\nimport Icon from '../Icon';\nimport Field from './Field';\nimport { getText as _getText, getLanguage } from '../locale';\nimport './index.less';\nvar clsPrefix = 'tnt-queryform';\n\nvar QueryForm =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(QueryForm, _React$PureComponent);\n\n function QueryForm(props) {\n var _this;\n\n _classCallCheck(this, QueryForm);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));\n _this.onWindowResize = debounce(function () {\n var current = _this.fieldsRef.current;\n\n if (current) {\n setTimeout(function () {\n _this.setState({\n showMore: _this.isFieldsWidthOverflow()\n });\n }, 25);\n }\n }, 50);\n\n _this.search = function (params) {\n _this.props.onSearch(_objectSpread({}, _this.form.getValues(), {}, params));\n };\n\n _this.onSearch = function () {\n _this.props.onSearch == null ? void 0 : _this.props.onSearch(_this.form.getValues());\n };\n\n _this.onReset = function () {\n var _this$props = _this.props,\n initialValues = _this$props.initialValues,\n onReset = _this$props.onReset;\n\n _this.form.setValues(_objectSpread({}, initialValues));\n\n _this.updateDrawerFieldsValueCount();\n\n onReset == null ? void 0 : onReset(initialValues);\n };\n\n _this.onToggleExpand = function () {\n _this.setState({\n expanded: !_this.state.expanded\n });\n\n _this.props.onToggleExpand == null ? void 0 : _this.props.onToggleExpand(!_this.state.expanded);\n };\n\n _this.onShowDrawer = function () {\n _this.setState({\n drawerVisible: true\n });\n };\n\n _this.onFieldChange = function (name, value) {\n var values = _this.form.getValues();\n\n var newValues = _objectSpread({}, values, _defineProperty({}, name, value));\n\n var changedInfo = {\n name: name,\n value: value,\n preValue: values == null ? void 0 : values[name]\n };\n var onChange = _this.props.onChange;\n\n _this.form.setData('values', newValues);\n\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));\n\n _this.updateDrawerFieldsValueCount(newValues);\n };\n\n _this.updateDrawerFieldsValueCount = function () {\n var values = _this.form.getValues();\n\n var _this$props2 = _this.props,\n showFieldCount = _this$props2.showFieldCount,\n children = _this$props2.children;\n\n if (showFieldCount) {\n var drawerFieldsValueCount = children.reduce(function (acc, cur, index) {\n var _cur$props;\n\n if (index >= showFieldCount && (values == null ? void 0 : values[cur == null ? void 0 : (_cur$props = cur.props) == null ? void 0 : _cur$props.name])) {\n acc++;\n }\n\n return acc;\n }, 0);\n\n if (drawerFieldsValueCount !== _this.state.drawerFieldsValueCount) {\n _this.setState({\n drawerFieldsValueCount: drawerFieldsValueCount\n });\n }\n }\n };\n\n var form = props.form,\n _initialValues = props.initialValues,\n _props$showExpand = props.showExpand,\n showExpand = _props$showExpand === void 0 ? true : _props$showExpand,\n renderActions = props.renderActions,\n defaultExpanded = props.defaultExpanded;\n _this.state = {\n showMore: false,\n expanded: defaultExpanded || !showExpand || renderActions ? true : false,\n drawerVisible: false,\n drawerFieldsValueCount: 0\n };\n _this.fieldsRef = createRef();\n _this.formBoxRef = createRef();\n _this.form = form || createActions();\n\n _this.form.setData('initialValues', _initialValues);\n\n _this.form.setData('values', _objectSpread({}, _initialValues));\n\n return _this;\n }\n\n _createClass(QueryForm, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n children = _this$props3.children,\n _this$props3$classNam = _this$props3.className,\n className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,\n _this$props3$initialV = _this$props3.initialValues,\n initialValues = _this$props3$initialV === void 0 ? {} : _this$props3$initialV,\n renderActions = _this$props3.renderActions,\n _this$props3$showSear = _this$props3.showSearch,\n showSearch = _this$props3$showSear === void 0 ? true : _this$props3$showSear,\n _this$props3$showRese = _this$props3.showReset,\n showReset = _this$props3$showRese === void 0 ? true : _this$props3$showRese,\n showFieldCount = _this$props3.showFieldCount,\n _this$props3$drawerPr = _this$props3.drawerProps,\n drawerProps = _this$props3$drawerPr === void 0 ? {} : _this$props3$drawerPr,\n size = _this$props3.size;\n var extraActions = this.props.extraActions;\n var _this$state = this.state,\n expanded = _this$state.expanded,\n showMore = _this$state.showMore,\n drawerVisible = _this$state.drawerVisible,\n drawerFieldsValueCount = _this$state.drawerFieldsValueCount;\n\n var renderFormActions = renderActions || function () {\n return React.createElement(React.Fragment, null, showFieldCount && React.createElement(Badge, {\n count: drawerFieldsValueCount\n }, React.createElement(Button, {\n onClick: _this2.onShowDrawer\n }, React.createElement(Icon, {\n type: \"filter\"\n }), _this2.getText('moreFiltering'))), showSearch && React.createElement(Button, {\n type: \"primary\",\n onClick: _this2.onSearch\n }, _this2.getText('search')), showReset && React.createElement(Button, {\n onClick: _this2.onReset\n }, _this2.getText('reset')), showMore && !showFieldCount && React.createElement(Button, {\n className: \"expand-link\",\n type: \"link\",\n onClick: _this2.onToggleExpand\n }, _this2.getText(expanded ? 'collapse' : 'expand')), React.Children.map(children, function (child) {\n var _child$props;\n\n return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && React.cloneElement(child);\n }));\n };\n\n return React.createElement(\"div\", {\n ref: this.formBoxRef,\n className: classnames(clsPrefix, _defineProperty({}, className, className))\n }, React.createElement(Form, {\n layout: \"inline\",\n className: classnames({\n expanded: !showMore || expanded,\n showMore: showMore\n })\n }, React.createElement(\"div\", {\n ref: this.fieldsRef\n }, React.Children.map(children, function (child, index) {\n var _child$props2;\n\n return child && (child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.align) !== 'right' && (!showFieldCount || showFieldCount > index) && React.cloneElement(child, {\n form: _this2.form,\n initialValue: initialValues == null ? void 0 : initialValues[child.props.name],\n onChange: _this2.onFieldChange\n });\n })), React.createElement(\"div\", {\n className: \"\".concat(clsPrefix, \"-actions\")\n }, renderFormActions()), showFieldCount && React.createElement(Drawer, _extends({\n title: this.getText('moreFiltering'),\n visible: drawerVisible,\n onClose: function onClose() {\n return _this2.setState({\n drawerVisible: false\n });\n },\n width: 300,\n size: size,\n getContainer: false\n }, drawerProps, {\n className: classnames(\"\".concat(clsPrefix, \"-drawer\"), _defineProperty({\n 'large-size': size === 'large'\n }, className, className))\n }), React.Children.map(children, function (child, index) {\n return child && index >= showFieldCount && React.cloneElement(child, {\n form: _this2.form,\n isFieldInDrawer: true,\n initialValue: initialValues == null ? void 0 : initialValues[child.props.name],\n onChange: _this2.onFieldChange,\n onSearch: _this2.onSearch\n });\n }), React.createElement(Button, {\n type: \"primary\",\n onClick: this.onSearch\n }, this.getText('search')), React.createElement(Button, {\n onClick: this.onReset\n }, this.getText('reset')))), extraActions && React.createElement(\"div\", {\n className: \"\".concat(clsPrefix, \"-extra\")\n }, extraActions));\n }\n }, {\n key: \"getText\",\n value: function getText(key) {\n return _getText(key, this.props.language || getLanguage());\n }\n }, {\n key: \"isFieldsWidthOverflow\",\n value: function isFieldsWidthOverflow() {\n var current = this.fieldsRef.current;\n\n if (current) {\n return current.offsetWidth < [].reduce.call(current.children, function (acc, cur) {\n var marginArray = window.getComputedStyle(cur).margin.split(' ').map(function (str) {\n return parseInt(str, 10);\n });\n acc += cur.offsetWidth + marginArray[1];\n return acc;\n }, 0);\n }\n\n return false;\n }\n }, {\n key: \"updateFieldHeight\",\n value: function updateFieldHeight() {\n var _formBoxRef$current, _formBoxRef$current2, _fieldsRef$current;\n\n var formBoxRef = this.formBoxRef,\n fieldsRef = this.fieldsRef;\n\n var getFieldHeight = function getFieldHeight() {\n var _current$children;\n\n var current = fieldsRef.current;\n var height = '32px';\n\n if (current && ((_current$children = current.children) == null ? void 0 : _current$children[0])) {\n height = window.getComputedStyle(current.children[0]).height;\n }\n\n return height;\n };\n\n var queryFormActionsDom = formBoxRef == null ? void 0 : (_formBoxRef$current = formBoxRef.current) == null ? void 0 : _formBoxRef$current.querySelector(\".\".concat(clsPrefix, \"-actions\"));\n var queryFormExtraDom = formBoxRef == null ? void 0 : (_formBoxRef$current2 = formBoxRef.current) == null ? void 0 : _formBoxRef$current2.querySelector(\".\".concat(clsPrefix, \"-extra\"));\n var formItemsDomList = fieldsRef == null ? void 0 : (_fieldsRef$current = fieldsRef.current) == null ? void 0 : _fieldsRef$current.querySelectorAll('.ant-form-item-control');\n var fieldHeight = getFieldHeight();\n fieldsRef.current.style.height = fieldHeight;\n [queryFormActionsDom, queryFormExtraDom].forEach(function (item) {\n item && Object.assign(item.style, {\n height: fieldHeight,\n lineHeight: fieldHeight\n });\n });\n [].forEach.call(formItemsDomList, function (item) {\n item.style.lineHeight = fieldHeight;\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var current = this.fieldsRef.current;\n var _this$props4 = this.props,\n showFieldCount = _this$props4.showFieldCount,\n _this$props4$showExpa = _this$props4.showExpand,\n showExpand = _this$props4$showExpa === void 0 ? true : _this$props4$showExpa,\n renderActions = _this$props4.renderActions;\n this.updateFieldHeight();\n this.form.on('search', this.search); // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑\n\n if (!showFieldCount && !showExpand || renderActions) {\n return;\n }\n\n if (!showFieldCount) {\n if (current && this.isFieldsWidthOverflow()) {\n this.setState({\n showMore: true\n });\n }\n\n window.addEventListener('resize', this.onWindowResize);\n } else {\n this.updateDrawerFieldsValueCount();\n this.form.on('setValues', this.updateDrawerFieldsValueCount);\n this.form.on('setValue', this.updateDrawerFieldsValueCount);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.onWindowResize);\n this.form.off('setValues', this.updateDrawerFieldsValueCount);\n this.form.off('setValue', this.updateDrawerFieldsValueCount);\n this.form.off('search', this.search);\n }\n }]);\n\n return QueryForm;\n}(React.PureComponent);\n\n;\nQueryForm.Field = Field;\nQueryForm.useForm = useForm;\nQueryForm.createForm = createActions;\nexport default QueryForm;"
13479
+ "source": "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); }\n\nfunction _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); }\n\nfunction 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; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport React, { createRef } from 'react';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { Form, Button, Drawer, Badge } from 'antd';\nimport useForm from './useForm';\nimport createActions from './createActions';\nimport Icon from '../Icon';\nimport Field from './Field';\nimport { getText as _getText, getLanguage } from '../locale';\nimport './index.less';\nvar clsPrefix = 'tnt-queryform';\n\nvar QueryForm =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(QueryForm, _React$PureComponent);\n\n function QueryForm(props) {\n var _this;\n\n _classCallCheck(this, QueryForm);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));\n _this.onWindowResize = debounce(function () {\n var current = _this.fieldsRef.current;\n\n if (current) {\n setTimeout(function () {\n _this.setState({\n showMore: _this.isFieldsWidthOverflow()\n });\n }, 25);\n }\n }, 50);\n\n _this.search = function (params) {\n _this.props.onSearch(_objectSpread({}, _this.form.getValues(), {}, params));\n };\n\n _this.onSearch = function () {\n _this.props.onSearch == null ? void 0 : _this.props.onSearch(_this.form.getValues());\n };\n\n _this.onReset = function () {\n var _this$props = _this.props,\n initialValues = _this$props.initialValues,\n onReset = _this$props.onReset;\n\n _this.form.setValues(_objectSpread({}, initialValues));\n\n _this.updateDrawerFieldsValueCount();\n\n onReset == null ? void 0 : onReset(initialValues);\n };\n\n _this.onToggleExpand = function () {\n _this.setState({\n expanded: !_this.state.expanded\n });\n\n _this.props.onToggleExpand == null ? void 0 : _this.props.onToggleExpand(!_this.state.expanded);\n };\n\n _this.onShowDrawer = function () {\n _this.setState({\n drawerVisible: true\n });\n };\n\n _this.onFieldChange = function (name, value) {\n var values = _this.form.getValues();\n\n var newValues = _objectSpread({}, values, _defineProperty({}, name, value));\n\n var changedInfo = {\n name: name,\n value: value,\n preValue: values == null ? void 0 : values[name]\n };\n var onChange = _this.props.onChange;\n\n _this.form.setData('values', newValues);\n\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));\n\n _this.updateDrawerFieldsValueCount(newValues);\n };\n\n _this.updateDrawerFieldsValueCount = function () {\n var values = _this.form.getValues();\n\n var _this$props2 = _this.props,\n showFieldCount = _this$props2.showFieldCount,\n children = _this$props2.children;\n\n if (showFieldCount) {\n var drawerFieldsValueCount = children.reduce(function (acc, cur, index) {\n var _cur$props;\n\n if (index >= showFieldCount && (values == null ? void 0 : values[cur == null ? void 0 : (_cur$props = cur.props) == null ? void 0 : _cur$props.name])) {\n acc++;\n }\n\n return acc;\n }, 0);\n\n if (drawerFieldsValueCount !== _this.state.drawerFieldsValueCount) {\n _this.setState({\n drawerFieldsValueCount: drawerFieldsValueCount\n });\n }\n }\n };\n\n var form = props.form,\n _initialValues = props.initialValues,\n _props$showExpand = props.showExpand,\n showExpand = _props$showExpand === void 0 ? true : _props$showExpand,\n renderActions = props.renderActions,\n defaultExpanded = props.defaultExpanded;\n _this.state = {\n showMore: false,\n expanded: defaultExpanded || !showExpand || renderActions ? true : false,\n drawerVisible: false,\n drawerFieldsValueCount: 0\n };\n _this.fieldsRef = createRef();\n _this.formBoxRef = createRef();\n _this.form = form || createActions();\n\n _this.form.setData('initialValues', _initialValues);\n\n _this.form.setData('values', _objectSpread({}, _initialValues));\n\n return _this;\n }\n\n _createClass(QueryForm, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n children = _this$props3.children,\n _this$props3$classNam = _this$props3.className,\n className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,\n _this$props3$initialV = _this$props3.initialValues,\n initialValues = _this$props3$initialV === void 0 ? {} : _this$props3$initialV,\n renderActions = _this$props3.renderActions,\n _this$props3$showSear = _this$props3.showSearch,\n showSearch = _this$props3$showSear === void 0 ? true : _this$props3$showSear,\n _this$props3$showRese = _this$props3.showReset,\n showReset = _this$props3$showRese === void 0 ? true : _this$props3$showRese,\n showFieldCount = _this$props3.showFieldCount,\n _this$props3$drawerPr = _this$props3.drawerProps,\n drawerProps = _this$props3$drawerPr === void 0 ? {} : _this$props3$drawerPr,\n size = _this$props3.size;\n var extraActions = this.props.extraActions;\n var _this$state = this.state,\n expanded = _this$state.expanded,\n showMore = _this$state.showMore,\n drawerVisible = _this$state.drawerVisible,\n drawerFieldsValueCount = _this$state.drawerFieldsValueCount;\n\n var renderFormActions = renderActions || function () {\n return React.createElement(React.Fragment, null, showFieldCount && React.createElement(Badge, {\n count: drawerFieldsValueCount\n }, React.createElement(Button, {\n onClick: _this2.onShowDrawer\n }, React.createElement(Icon, {\n type: \"filter\"\n }), _this2.getText('moreFiltering'))), showSearch && React.createElement(Button, {\n type: \"primary\",\n onClick: _this2.onSearch\n }, _this2.getText('search')), showReset && React.createElement(Button, {\n onClick: _this2.onReset\n }, _this2.getText('reset')), showMore && !showFieldCount && React.createElement(Button, {\n className: \"expand-link\",\n type: \"link\",\n onClick: _this2.onToggleExpand\n }, _this2.getText(expanded ? 'collapse' : 'expand')), React.Children.map(children, function (child) {\n var _child$props;\n\n return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && React.cloneElement(child);\n }));\n };\n\n return React.createElement(\"div\", {\n ref: this.formBoxRef,\n className: classnames(clsPrefix, _defineProperty({}, className, className))\n }, React.createElement(Form, {\n layout: \"inline\",\n className: classnames({\n expanded: !showMore || expanded,\n showMore: showMore\n })\n }, React.createElement(\"div\", {\n ref: this.fieldsRef\n }, React.Children.map(children, function (child, index) {\n var _child$props2;\n\n return child && (child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.align) !== 'right' && (!showFieldCount || showFieldCount > index) && React.cloneElement(child, {\n form: _this2.form,\n initialValue: initialValues == null ? void 0 : initialValues[child.props.name],\n onChange: _this2.onFieldChange\n });\n })), React.createElement(\"div\", {\n className: \"\".concat(clsPrefix, \"-actions\")\n }, renderFormActions()), showFieldCount && React.createElement(Drawer, _extends({\n title: this.getText('moreFiltering'),\n visible: drawerVisible,\n onClose: function onClose() {\n return _this2.setState({\n drawerVisible: false\n });\n },\n width: 300,\n size: size,\n getContainer: false\n }, drawerProps, {\n className: classnames(\"\".concat(clsPrefix, \"-drawer\"), _defineProperty({\n 'large-size': size === 'large'\n }, className, className))\n }), React.Children.map(children, function (child, index) {\n return child && index >= showFieldCount && React.cloneElement(child, {\n form: _this2.form,\n isFieldInDrawer: true,\n initialValue: initialValues == null ? void 0 : initialValues[child.props.name],\n onChange: _this2.onFieldChange,\n onSearch: _this2.onSearch\n });\n }), React.createElement(Button, {\n type: \"primary\",\n onClick: this.onSearch\n }, this.getText('search')), React.createElement(Button, {\n onClick: this.onReset\n }, this.getText('reset')))), extraActions && React.createElement(\"div\", {\n className: \"\".concat(clsPrefix, \"-extra\")\n }, extraActions));\n }\n }, {\n key: \"getText\",\n value: function getText(key) {\n return _getText(key, this.props.language || getLanguage());\n }\n }, {\n key: \"isFieldsWidthOverflow\",\n value: function isFieldsWidthOverflow() {\n var current = this.fieldsRef.current;\n\n if (current) {\n return current.offsetWidth < [].reduce.call(current.children, function (acc, cur) {\n var marginArray = window.getComputedStyle(cur).margin.split(' ').map(function (str) {\n return parseInt(str, 10);\n });\n acc += cur.offsetWidth + marginArray[1];\n return acc;\n }, 0);\n }\n\n return false;\n }\n }, {\n key: \"updateFieldHeight\",\n value: function updateFieldHeight() {\n var _formBoxRef$current, _formBoxRef$current2, _fieldsRef$current;\n\n var formBoxRef = this.formBoxRef,\n fieldsRef = this.fieldsRef;\n\n var getFieldHeight = function getFieldHeight() {\n var _current$children;\n\n var current = fieldsRef.current;\n var height = '32px';\n\n if (current && ((_current$children = current.children) == null ? void 0 : _current$children[0])) {\n height = window.getComputedStyle(current.children[0]).height;\n }\n\n return height;\n };\n\n var queryFormActionsDom = formBoxRef == null ? void 0 : (_formBoxRef$current = formBoxRef.current) == null ? void 0 : _formBoxRef$current.querySelector(\".\".concat(clsPrefix, \"-actions\"));\n var queryFormExtraDom = formBoxRef == null ? void 0 : (_formBoxRef$current2 = formBoxRef.current) == null ? void 0 : _formBoxRef$current2.querySelector(\".\".concat(clsPrefix, \"-extra\"));\n var formItemsDomList = fieldsRef == null ? void 0 : (_fieldsRef$current = fieldsRef.current) == null ? void 0 : _fieldsRef$current.querySelectorAll('.ant-form-item-control');\n var fieldHeight = getFieldHeight();\n fieldsRef.current.style.height = fieldHeight;\n [queryFormActionsDom, queryFormExtraDom].forEach(function (item) {\n item && Object.assign(item.style, {\n height: fieldHeight,\n lineHeight: fieldHeight\n });\n });\n [].forEach.call(formItemsDomList, function (item) {\n item.style.lineHeight = fieldHeight;\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var current = this.fieldsRef.current;\n var _this$props4 = this.props,\n showFieldCount = _this$props4.showFieldCount,\n _this$props4$showExpa = _this$props4.showExpand,\n showExpand = _this$props4$showExpa === void 0 ? true : _this$props4$showExpa,\n renderActions = _this$props4.renderActions;\n this.updateFieldHeight();\n this.form.on('search', this.search); // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑\n // || renderActions\n\n if (!showFieldCount && !showExpand) {\n return;\n }\n\n if (!showFieldCount) {\n if (current && this.isFieldsWidthOverflow()) {\n this.setState({\n showMore: true\n });\n }\n\n window.addEventListener('resize', this.onWindowResize);\n } else {\n this.updateDrawerFieldsValueCount();\n this.form.on('setValues', this.updateDrawerFieldsValueCount);\n this.form.on('setValue', this.updateDrawerFieldsValueCount);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.onWindowResize);\n this.form.off('setValues', this.updateDrawerFieldsValueCount);\n this.form.off('setValue', this.updateDrawerFieldsValueCount);\n this.form.off('search', this.search);\n }\n }]);\n\n return QueryForm;\n}(React.PureComponent);\n\n;\nQueryForm.Field = Field;\nQueryForm.useForm = useForm;\nQueryForm.createForm = createActions;\nexport default QueryForm;"
13480
13480
  },
13481
13481
  {
13482
13482
  "id": null,
@@ -16021,7 +16021,7 @@
16021
16021
  "moduleName": "./components/QueryForm/index.js",
16022
16022
  "type": "harmony import specifier",
16023
16023
  "userRequest": "./createActions",
16024
- "loc": "375:23-36"
16024
+ "loc": "376:23-36"
16025
16025
  }
16026
16026
  ],
16027
16027
  "usedExports": [
@@ -16082,7 +16082,7 @@
16082
16082
  "moduleName": "./components/QueryForm/index.js",
16083
16083
  "type": "harmony import specifier",
16084
16084
  "userRequest": "./useForm",
16085
- "loc": "374:20-27"
16085
+ "loc": "375:20-27"
16086
16086
  }
16087
16087
  ],
16088
16088
  "usedExports": [
@@ -16143,7 +16143,7 @@
16143
16143
  "moduleName": "./components/QueryForm/index.js",
16144
16144
  "type": "harmony import specifier",
16145
16145
  "userRequest": "./Field",
16146
- "loc": "373:18-23"
16146
+ "loc": "374:18-23"
16147
16147
  }
16148
16148
  ],
16149
16149
  "usedExports": [
@@ -16637,7 +16637,7 @@
16637
16637
  "name": "./components/QueryListScene/QueryForm.js",
16638
16638
  "index": 148,
16639
16639
  "index2": 146,
16640
- "size": 8579,
16640
+ "size": 8690,
16641
16641
  "cacheable": true,
16642
16642
  "built": true,
16643
16643
  "optional": false,
@@ -16708,7 +16708,7 @@
16708
16708
  ],
16709
16709
  "optimizationBailout": [],
16710
16710
  "depth": 2,
16711
- "source": "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); }\n\nfunction _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); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction 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; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport React from 'react';\nimport classnames from 'classnames';\nimport Form from '../QueryForm';\nvar clsPrefix = 'tnt-querylistscene-queryform';\n\nvar QueryForm =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(QueryForm, _React$PureComponent);\n\n function QueryForm(props) {\n var _this;\n\n _classCallCheck(this, QueryForm);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));\n\n _this.onSearch = function () {\n var _this$props = _this.props,\n onSearch = _this$props.onSearch,\n actions = _this$props.actions;\n var values = actions.getFormData();\n\n var params = _objectSpread({}, values, {\n current: 1\n });\n\n actions.setData('formData', values);\n onSearch && onSearch(params);\n actions.emit('search', params);\n };\n\n _this.onReset = function () {\n var _this$props2 = _this.props,\n initialValues = _this$props2.initialValues,\n onReset = _this$props2.onReset,\n actions = _this$props2.actions;\n actions.setFormData(initialValues, false);\n onReset && onReset(initialValues);\n\n _this.onSearch();\n };\n\n _this.onChange = function (newValues, changedInfo) {\n var _this$props3 = _this.props,\n onChange = _this$props3.onChange,\n actions = _this$props3.actions;\n\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));\n actions.setFormData(newValues, false);\n };\n\n _this.setFormData = function (data, needSearch) {\n var actions = _this.props.actions;\n actions.setData('formData', data);\n\n _this.form.setValues(data);\n\n needSearch && _this.onSearch();\n };\n\n _this.resetFormData = function (needSearch) {\n var _this$props4 = _this.props,\n initialValues = _this$props4.initialValues,\n actions = _this$props4.actions;\n actions.setFormData(initialValues, needSearch);\n\n _this.form.resetValues();\n };\n\n var _actions = props.actions,\n form = props.form;\n _this.form = form || Form.createForm();\n\n _actions.on('setFormData', _this.setFormData);\n\n _actions.on('resetFormData', _this.resetFormData);\n\n return _this;\n }\n\n _createClass(QueryForm, [{\n key: \"render\",\n value: function render() {\n var _this$props5 = this.props,\n className = _this$props5.className,\n actions = _this$props5.actions,\n extraActions = _this$props5.extraActions,\n extralActions = _this$props5.extralActions,\n qlsProps = _this$props5.qlsProps,\n props = _objectWithoutProperties(_this$props5, [\"className\", \"actions\", \"extraActions\", \"extralActions\", \"qlsProps\"]);\n\n return React.createElement(Form, _extends({}, props, {\n form: this.form,\n className: classnames(clsPrefix, _defineProperty({}, className, className)) // 前期拼写错误,导致需要兼容错误的api\n ,\n extraActions: extraActions || extralActions,\n onChange: this.onChange,\n onSearch: this.onSearch,\n onReset: this.onReset\n }));\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props6 = this.props,\n _this$props6$initialV = _this$props6.initialValues,\n initialValues = _this$props6$initialV === void 0 ? {} : _this$props6$initialV,\n actions = _this$props6.actions,\n qlsProps = _this$props6.qlsProps;\n\n if (qlsProps.memory) {\n actions.setFormData(_objectSpread({}, initialValues, {}, actions.getFormData()), false);\n } else {\n actions.setData('formData', initialValues);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var actions = this.props.actions;\n actions.removeListener('setFormData', this.setFormData);\n actions.removeListener('resetFormData', this.resetFormData);\n }\n }]);\n\n return QueryForm;\n}(React.PureComponent);\n\nexport { QueryForm as default };\n;\nQueryForm.Field = Form.Field;"
16711
+ "source": "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); }\n\nfunction _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); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction 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; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport React from 'react';\nimport classnames from 'classnames';\nimport Form from '../QueryForm';\nvar clsPrefix = 'tnt-querylistscene-queryform';\n\nvar QueryForm =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(QueryForm, _React$PureComponent);\n\n function QueryForm(props) {\n var _this;\n\n _classCallCheck(this, QueryForm);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));\n\n _this.onSearch = function () {\n var _this$props = _this.props,\n onSearch = _this$props.onSearch,\n actions = _this$props.actions;\n var values = actions.getFormData();\n\n var params = _objectSpread({}, values, {\n current: 1\n }); // memory 与 url解析setForm时 监听事件异步\n\n\n actions.setData('formData', values);\n Promise.resolve().then(function () {\n onSearch && onSearch(params);\n actions.emit('search', params);\n });\n };\n\n _this.onReset = function () {\n var _this$props2 = _this.props,\n initialValues = _this$props2.initialValues,\n onReset = _this$props2.onReset,\n actions = _this$props2.actions;\n actions.setFormData(initialValues, false);\n onReset && onReset(initialValues);\n\n _this.onSearch();\n };\n\n _this.onChange = function (newValues, changedInfo) {\n var _this$props3 = _this.props,\n onChange = _this$props3.onChange,\n actions = _this$props3.actions;\n\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));\n actions.setFormData(newValues, false);\n };\n\n _this.setFormData = function (data, needSearch) {\n var actions = _this.props.actions;\n actions.setData('formData', data);\n\n _this.form.setValues(data);\n\n needSearch && _this.onSearch();\n };\n\n _this.resetFormData = function (needSearch) {\n var _this$props4 = _this.props,\n initialValues = _this$props4.initialValues,\n actions = _this$props4.actions;\n actions.setFormData(initialValues, needSearch);\n\n _this.form.resetValues();\n };\n\n var _actions = props.actions,\n form = props.form;\n _this.form = form || Form.createForm();\n\n _actions.on('setFormData', _this.setFormData);\n\n _actions.on('resetFormData', _this.resetFormData);\n\n return _this;\n }\n\n _createClass(QueryForm, [{\n key: \"render\",\n value: function render() {\n var _this$props5 = this.props,\n className = _this$props5.className,\n actions = _this$props5.actions,\n extraActions = _this$props5.extraActions,\n extralActions = _this$props5.extralActions,\n qlsProps = _this$props5.qlsProps,\n props = _objectWithoutProperties(_this$props5, [\"className\", \"actions\", \"extraActions\", \"extralActions\", \"qlsProps\"]);\n\n return React.createElement(Form, _extends({}, props, {\n form: this.form,\n className: classnames(clsPrefix, _defineProperty({}, className, className)) // 前期拼写错误,导致需要兼容错误的api\n ,\n extraActions: extraActions || extralActions,\n onChange: this.onChange,\n onSearch: this.onSearch,\n onReset: this.onReset\n }));\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props6 = this.props,\n _this$props6$initialV = _this$props6.initialValues,\n initialValues = _this$props6$initialV === void 0 ? {} : _this$props6$initialV,\n actions = _this$props6.actions,\n qlsProps = _this$props6.qlsProps;\n\n if (qlsProps.memory) {\n actions.setFormData(_objectSpread({}, initialValues, {}, actions.getFormData()), false);\n } else {\n actions.setData('formData', initialValues);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var actions = this.props.actions;\n actions.removeListener('setFormData', this.setFormData);\n actions.removeListener('resetFormData', this.resetFormData);\n }\n }]);\n\n return QueryForm;\n}(React.PureComponent);\n\nexport { QueryForm as default };\n;\nQueryForm.Field = Form.Field;"
16712
16712
  },
16713
16713
  {
16714
16714
  "id": null,
@@ -21993,7 +21993,7 @@
21993
21993
  "moduleName": "./components/index.js + 88 modules",
21994
21994
  "type": "harmony side effect evaluation",
21995
21995
  "userRequest": "react",
21996
- "loc": "1:0-31"
21996
+ "loc": "1:0-38"
21997
21997
  },
21998
21998
  {
21999
21999
  "moduleId": 87,
@@ -22011,7 +22011,7 @@
22011
22011
  "moduleName": "./components/index.js + 88 modules",
22012
22012
  "type": "harmony side effect evaluation",
22013
22013
  "userRequest": "react",
22014
- "loc": "1:0-38"
22014
+ "loc": "1:0-31"
22015
22015
  },
22016
22016
  {
22017
22017
  "moduleId": 87,
@@ -22362,7 +22362,7 @@
22362
22362
  "moduleName": "./components/index.js + 88 modules",
22363
22363
  "type": "harmony side effect evaluation",
22364
22364
  "userRequest": "react",
22365
- "loc": "27:0-80"
22365
+ "loc": "27:0-41"
22366
22366
  },
22367
22367
  {
22368
22368
  "moduleId": 87,
@@ -22371,7 +22371,7 @@
22371
22371
  "moduleName": "./components/index.js + 88 modules",
22372
22372
  "type": "harmony side effect evaluation",
22373
22373
  "userRequest": "react",
22374
- "loc": "27:0-41"
22374
+ "loc": "27:0-80"
22375
22375
  },
22376
22376
  {
22377
22377
  "moduleId": 87,
@@ -22524,7 +22524,7 @@
22524
22524
  "moduleName": "./components/index.js + 88 modules",
22525
22525
  "type": "harmony side effect evaluation",
22526
22526
  "userRequest": "react",
22527
- "loc": "35:0-41"
22527
+ "loc": "35:0-44"
22528
22528
  },
22529
22529
  {
22530
22530
  "moduleId": 87,
@@ -22533,7 +22533,7 @@
22533
22533
  "moduleName": "./components/index.js + 88 modules",
22534
22534
  "type": "harmony side effect evaluation",
22535
22535
  "userRequest": "react",
22536
- "loc": "35:0-44"
22536
+ "loc": "35:0-41"
22537
22537
  },
22538
22538
  {
22539
22539
  "moduleId": 87,
@@ -23496,7 +23496,7 @@
23496
23496
  "moduleName": "./components/index.js + 88 modules",
23497
23497
  "type": "harmony import specifier",
23498
23498
  "userRequest": "react",
23499
- "loc": "127:13-18"
23499
+ "loc": "128:5-10"
23500
23500
  },
23501
23501
  {
23502
23502
  "moduleId": 87,
@@ -23505,7 +23505,7 @@
23505
23505
  "moduleName": "./components/index.js + 88 modules",
23506
23506
  "type": "harmony import specifier",
23507
23507
  "userRequest": "react",
23508
- "loc": "128:5-10"
23508
+ "loc": "129:19-27"
23509
23509
  },
23510
23510
  {
23511
23511
  "moduleId": 87,
@@ -23514,7 +23514,7 @@
23514
23514
  "moduleName": "./components/index.js + 88 modules",
23515
23515
  "type": "harmony import specifier",
23516
23516
  "userRequest": "react",
23517
- "loc": "129:19-27"
23517
+ "loc": "130:13-18"
23518
23518
  },
23519
23519
  {
23520
23520
  "moduleId": 87,
@@ -23748,7 +23748,7 @@
23748
23748
  "moduleName": "./components/index.js + 88 modules",
23749
23749
  "type": "harmony import specifier",
23750
23750
  "userRequest": "react",
23751
- "loc": "162:2-7"
23751
+ "loc": "163:19-27"
23752
23752
  },
23753
23753
  {
23754
23754
  "moduleId": 87,
@@ -23757,7 +23757,7 @@
23757
23757
  "moduleName": "./components/index.js + 88 modules",
23758
23758
  "type": "harmony import specifier",
23759
23759
  "userRequest": "react",
23760
- "loc": "163:19-27"
23760
+ "loc": "164:32-37"
23761
23761
  },
23762
23762
  {
23763
23763
  "moduleId": 87,
@@ -23766,7 +23766,7 @@
23766
23766
  "moduleName": "./components/index.js + 88 modules",
23767
23767
  "type": "harmony import specifier",
23768
23768
  "userRequest": "react",
23769
- "loc": "164:32-37"
23769
+ "loc": "165:2-7"
23770
23770
  },
23771
23771
  {
23772
23772
  "moduleId": 87,
@@ -24252,7 +24252,7 @@
24252
24252
  "moduleName": "./components/index.js + 88 modules",
24253
24253
  "type": "harmony import specifier",
24254
24254
  "userRequest": "react",
24255
- "loc": "370:2-7"
24255
+ "loc": "371:2-7"
24256
24256
  },
24257
24257
  {
24258
24258
  "moduleId": 87,
@@ -24356,9 +24356,9 @@
24356
24356
  "chunks": [
24357
24357
  0
24358
24358
  ],
24359
- "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/ResizableTable/index.js",
24359
+ "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/index.js",
24360
24360
  "issuerId": null,
24361
- "issuerName": "./components/Table/ResizableTable/index.js",
24361
+ "issuerName": "./components/Table/index.js",
24362
24362
  "issuerPath": [
24363
24363
  {
24364
24364
  "id": null,
@@ -24367,8 +24367,8 @@
24367
24367
  },
24368
24368
  {
24369
24369
  "id": null,
24370
- "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/ResizableTable/index.js",
24371
- "name": "./components/Table/ResizableTable/index.js"
24370
+ "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/index.js",
24371
+ "name": "./components/Table/index.js"
24372
24372
  }
24373
24373
  ],
24374
24374
  "failed": false,
@@ -24518,7 +24518,7 @@
24518
24518
  "moduleName": "./components/index.js + 88 modules",
24519
24519
  "type": "harmony side effect evaluation",
24520
24520
  "userRequest": "antd",
24521
- "loc": "22:0-37"
24521
+ "loc": "22:0-30"
24522
24522
  },
24523
24523
  {
24524
24524
  "moduleId": 87,
@@ -24527,7 +24527,7 @@
24527
24527
  "moduleName": "./components/index.js + 88 modules",
24528
24528
  "type": "harmony side effect evaluation",
24529
24529
  "userRequest": "antd",
24530
- "loc": "22:0-30"
24530
+ "loc": "22:0-37"
24531
24531
  },
24532
24532
  {
24533
24533
  "moduleId": 87,
@@ -24617,7 +24617,7 @@
24617
24617
  "moduleName": "./components/index.js + 88 modules",
24618
24618
  "type": "harmony import specifier",
24619
24619
  "userRequest": "antd",
24620
- "loc": "28:29-32"
24620
+ "loc": "28:29-34"
24621
24621
  },
24622
24622
  {
24623
24623
  "moduleId": 87,
@@ -24626,7 +24626,7 @@
24626
24626
  "moduleName": "./components/index.js + 88 modules",
24627
24627
  "type": "harmony import specifier",
24628
24628
  "userRequest": "antd",
24629
- "loc": "28:29-34"
24629
+ "loc": "28:29-32"
24630
24630
  },
24631
24631
  {
24632
24632
  "moduleId": 87,
@@ -26629,7 +26629,7 @@
26629
26629
  "moduleName": "./components/index.js + 88 modules",
26630
26630
  "type": "harmony side effect evaluation",
26631
26631
  "userRequest": "lodash",
26632
- "loc": "29:0-67"
26632
+ "loc": "29:0-34"
26633
26633
  },
26634
26634
  {
26635
26635
  "moduleId": 87,
@@ -26638,7 +26638,7 @@
26638
26638
  "moduleName": "./components/index.js + 88 modules",
26639
26639
  "type": "harmony side effect evaluation",
26640
26640
  "userRequest": "lodash",
26641
- "loc": "29:0-34"
26641
+ "loc": "29:0-67"
26642
26642
  },
26643
26643
  {
26644
26644
  "moduleId": 87,
@@ -26719,7 +26719,7 @@
26719
26719
  "moduleName": "./components/index.js + 88 modules",
26720
26720
  "type": "harmony side effect evaluation",
26721
26721
  "userRequest": "lodash",
26722
- "loc": "38:0-66"
26722
+ "loc": "38:0-29"
26723
26723
  },
26724
26724
  {
26725
26725
  "moduleId": 87,
@@ -26728,7 +26728,7 @@
26728
26728
  "moduleName": "./components/index.js + 88 modules",
26729
26729
  "type": "harmony side effect evaluation",
26730
26730
  "userRequest": "lodash",
26731
- "loc": "38:0-29"
26731
+ "loc": "38:0-66"
26732
26732
  },
26733
26733
  {
26734
26734
  "moduleId": 87,
@@ -27360,9 +27360,9 @@
27360
27360
  "chunks": [
27361
27361
  0
27362
27362
  ],
27363
- "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/ResizableTable/index.js",
27363
+ "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/index.js",
27364
27364
  "issuerId": null,
27365
- "issuerName": "./components/Table/ResizableTable/index.js",
27365
+ "issuerName": "./components/Table/index.js",
27366
27366
  "issuerPath": [
27367
27367
  {
27368
27368
  "id": null,
@@ -27371,8 +27371,8 @@
27371
27371
  },
27372
27372
  {
27373
27373
  "id": null,
27374
- "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/ResizableTable/index.js",
27375
- "name": "./components/Table/ResizableTable/index.js"
27374
+ "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Table/index.js",
27375
+ "name": "./components/Table/index.js"
27376
27376
  }
27377
27377
  ],
27378
27378
  "failed": false,
@@ -27747,7 +27747,7 @@
27747
27747
  "moduleName": "./components/index.js + 88 modules",
27748
27748
  "type": "harmony import specifier",
27749
27749
  "userRequest": "classnames",
27750
- "loc": "129:19-29"
27750
+ "loc": "132:19-29"
27751
27751
  },
27752
27752
  {
27753
27753
  "moduleId": 87,
@@ -27989,9 +27989,9 @@
27989
27989
  "chunks": [
27990
27990
  0
27991
27991
  ],
27992
- "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/QueryListScene/createActions.js",
27992
+ "issuer": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Layout/createActions.js",
27993
27993
  "issuerId": null,
27994
- "issuerName": "./components/QueryListScene/createActions.js",
27994
+ "issuerName": "./components/Layout/createActions.js",
27995
27995
  "issuerPath": [
27996
27996
  {
27997
27997
  "id": null,
@@ -28000,13 +28000,13 @@
28000
28000
  },
28001
28001
  {
28002
28002
  "id": null,
28003
- "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/QueryListScene/index.js",
28004
- "name": "./components/QueryListScene/index.js"
28003
+ "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Layout/index.js",
28004
+ "name": "./components/Layout/index.js"
28005
28005
  },
28006
28006
  {
28007
28007
  "id": null,
28008
- "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/QueryListScene/createActions.js",
28009
- "name": "./components/QueryListScene/createActions.js"
28008
+ "identifier": "/Users/zhouzefei/projects/tntd/node_modules/babel-loader/lib/index.js?cacheDirectory=true!/Users/zhouzefei/projects/tntd/components/Layout/createActions.js",
28009
+ "name": "./components/Layout/createActions.js"
28010
28010
  }
28011
28011
  ],
28012
28012
  "failed": false,
@@ -34214,7 +34214,7 @@
34214
34214
  "name": "./components/index.js + 88 modules",
34215
34215
  "index": 0,
34216
34216
  "index2": 187,
34217
- "size": 397482,
34217
+ "size": 397602,
34218
34218
  "cacheable": true,
34219
34219
  "built": true,
34220
34220
  "optional": false,
@@ -34839,7 +34839,7 @@
34839
34839
  "name": "./components/QueryForm/index.js",
34840
34840
  "index": 113,
34841
34841
  "index2": 121,
34842
- "size": 16414,
34842
+ "size": 16423,
34843
34843
  "cacheable": true,
34844
34844
  "built": true,
34845
34845
  "optional": false,
@@ -34894,7 +34894,7 @@
34894
34894
  "moduleName": "./components/QueryListScene/QueryForm.js",
34895
34895
  "type": "harmony import specifier",
34896
34896
  "userRequest": "../QueryForm",
34897
- "loc": "107:25-29"
34897
+ "loc": "110:25-29"
34898
34898
  },
34899
34899
  {
34900
34900
  "moduleId": null,
@@ -34903,7 +34903,7 @@
34903
34903
  "moduleName": "./components/QueryListScene/QueryForm.js",
34904
34904
  "type": "harmony import specifier",
34905
34905
  "userRequest": "../QueryForm",
34906
- "loc": "127:33-37"
34906
+ "loc": "130:33-37"
34907
34907
  },
34908
34908
  {
34909
34909
  "moduleId": null,
@@ -34912,7 +34912,7 @@
34912
34912
  "moduleName": "./components/QueryListScene/QueryForm.js",
34913
34913
  "type": "harmony import specifier",
34914
34914
  "userRequest": "../QueryForm",
34915
- "loc": "166:18-22"
34915
+ "loc": "169:18-22"
34916
34916
  }
34917
34917
  ],
34918
34918
  "usedExports": [
@@ -34923,7 +34923,7 @@
34923
34923
  ],
34924
34924
  "optimizationBailout": [],
34925
34925
  "depth": 1,
34926
- "source": "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); }\n\nfunction _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); }\n\nfunction 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; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport React, { createRef } from 'react';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { Form, Button, Drawer, Badge } from 'antd';\nimport useForm from './useForm';\nimport createActions from './createActions';\nimport Icon from '../Icon';\nimport Field from './Field';\nimport { getText as _getText, getLanguage } from '../locale';\nimport './index.less';\nvar clsPrefix = 'tnt-queryform';\n\nvar QueryForm =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(QueryForm, _React$PureComponent);\n\n function QueryForm(props) {\n var _this;\n\n _classCallCheck(this, QueryForm);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));\n _this.onWindowResize = debounce(function () {\n var current = _this.fieldsRef.current;\n\n if (current) {\n setTimeout(function () {\n _this.setState({\n showMore: _this.isFieldsWidthOverflow()\n });\n }, 25);\n }\n }, 50);\n\n _this.search = function (params) {\n _this.props.onSearch(_objectSpread({}, _this.form.getValues(), {}, params));\n };\n\n _this.onSearch = function () {\n _this.props.onSearch == null ? void 0 : _this.props.onSearch(_this.form.getValues());\n };\n\n _this.onReset = function () {\n var _this$props = _this.props,\n initialValues = _this$props.initialValues,\n onReset = _this$props.onReset;\n\n _this.form.setValues(_objectSpread({}, initialValues));\n\n _this.updateDrawerFieldsValueCount();\n\n onReset == null ? void 0 : onReset(initialValues);\n };\n\n _this.onToggleExpand = function () {\n _this.setState({\n expanded: !_this.state.expanded\n });\n\n _this.props.onToggleExpand == null ? void 0 : _this.props.onToggleExpand(!_this.state.expanded);\n };\n\n _this.onShowDrawer = function () {\n _this.setState({\n drawerVisible: true\n });\n };\n\n _this.onFieldChange = function (name, value) {\n var values = _this.form.getValues();\n\n var newValues = _objectSpread({}, values, _defineProperty({}, name, value));\n\n var changedInfo = {\n name: name,\n value: value,\n preValue: values == null ? void 0 : values[name]\n };\n var onChange = _this.props.onChange;\n\n _this.form.setData('values', newValues);\n\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));\n\n _this.updateDrawerFieldsValueCount(newValues);\n };\n\n _this.updateDrawerFieldsValueCount = function () {\n var values = _this.form.getValues();\n\n var _this$props2 = _this.props,\n showFieldCount = _this$props2.showFieldCount,\n children = _this$props2.children;\n\n if (showFieldCount) {\n var drawerFieldsValueCount = children.reduce(function (acc, cur, index) {\n var _cur$props;\n\n if (index >= showFieldCount && (values == null ? void 0 : values[cur == null ? void 0 : (_cur$props = cur.props) == null ? void 0 : _cur$props.name])) {\n acc++;\n }\n\n return acc;\n }, 0);\n\n if (drawerFieldsValueCount !== _this.state.drawerFieldsValueCount) {\n _this.setState({\n drawerFieldsValueCount: drawerFieldsValueCount\n });\n }\n }\n };\n\n var form = props.form,\n _initialValues = props.initialValues,\n _props$showExpand = props.showExpand,\n showExpand = _props$showExpand === void 0 ? true : _props$showExpand,\n renderActions = props.renderActions,\n defaultExpanded = props.defaultExpanded;\n _this.state = {\n showMore: false,\n expanded: defaultExpanded || !showExpand || renderActions ? true : false,\n drawerVisible: false,\n drawerFieldsValueCount: 0\n };\n _this.fieldsRef = createRef();\n _this.formBoxRef = createRef();\n _this.form = form || createActions();\n\n _this.form.setData('initialValues', _initialValues);\n\n _this.form.setData('values', _objectSpread({}, _initialValues));\n\n return _this;\n }\n\n _createClass(QueryForm, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n children = _this$props3.children,\n _this$props3$classNam = _this$props3.className,\n className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,\n _this$props3$initialV = _this$props3.initialValues,\n initialValues = _this$props3$initialV === void 0 ? {} : _this$props3$initialV,\n renderActions = _this$props3.renderActions,\n _this$props3$showSear = _this$props3.showSearch,\n showSearch = _this$props3$showSear === void 0 ? true : _this$props3$showSear,\n _this$props3$showRese = _this$props3.showReset,\n showReset = _this$props3$showRese === void 0 ? true : _this$props3$showRese,\n showFieldCount = _this$props3.showFieldCount,\n _this$props3$drawerPr = _this$props3.drawerProps,\n drawerProps = _this$props3$drawerPr === void 0 ? {} : _this$props3$drawerPr,\n size = _this$props3.size;\n var extraActions = this.props.extraActions;\n var _this$state = this.state,\n expanded = _this$state.expanded,\n showMore = _this$state.showMore,\n drawerVisible = _this$state.drawerVisible,\n drawerFieldsValueCount = _this$state.drawerFieldsValueCount;\n\n var renderFormActions = renderActions || function () {\n return React.createElement(React.Fragment, null, showFieldCount && React.createElement(Badge, {\n count: drawerFieldsValueCount\n }, React.createElement(Button, {\n onClick: _this2.onShowDrawer\n }, React.createElement(Icon, {\n type: \"filter\"\n }), _this2.getText('moreFiltering'))), showSearch && React.createElement(Button, {\n type: \"primary\",\n onClick: _this2.onSearch\n }, _this2.getText('search')), showReset && React.createElement(Button, {\n onClick: _this2.onReset\n }, _this2.getText('reset')), showMore && !showFieldCount && React.createElement(Button, {\n className: \"expand-link\",\n type: \"link\",\n onClick: _this2.onToggleExpand\n }, _this2.getText(expanded ? 'collapse' : 'expand')), React.Children.map(children, function (child) {\n var _child$props;\n\n return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && React.cloneElement(child);\n }));\n };\n\n return React.createElement(\"div\", {\n ref: this.formBoxRef,\n className: classnames(clsPrefix, _defineProperty({}, className, className))\n }, React.createElement(Form, {\n layout: \"inline\",\n className: classnames({\n expanded: !showMore || expanded,\n showMore: showMore\n })\n }, React.createElement(\"div\", {\n ref: this.fieldsRef\n }, React.Children.map(children, function (child, index) {\n var _child$props2;\n\n return child && (child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.align) !== 'right' && (!showFieldCount || showFieldCount > index) && React.cloneElement(child, {\n form: _this2.form,\n initialValue: initialValues == null ? void 0 : initialValues[child.props.name],\n onChange: _this2.onFieldChange\n });\n })), React.createElement(\"div\", {\n className: \"\".concat(clsPrefix, \"-actions\")\n }, renderFormActions()), showFieldCount && React.createElement(Drawer, _extends({\n title: this.getText('moreFiltering'),\n visible: drawerVisible,\n onClose: function onClose() {\n return _this2.setState({\n drawerVisible: false\n });\n },\n width: 300,\n size: size,\n getContainer: false\n }, drawerProps, {\n className: classnames(\"\".concat(clsPrefix, \"-drawer\"), _defineProperty({\n 'large-size': size === 'large'\n }, className, className))\n }), React.Children.map(children, function (child, index) {\n return child && index >= showFieldCount && React.cloneElement(child, {\n form: _this2.form,\n isFieldInDrawer: true,\n initialValue: initialValues == null ? void 0 : initialValues[child.props.name],\n onChange: _this2.onFieldChange,\n onSearch: _this2.onSearch\n });\n }), React.createElement(Button, {\n type: \"primary\",\n onClick: this.onSearch\n }, this.getText('search')), React.createElement(Button, {\n onClick: this.onReset\n }, this.getText('reset')))), extraActions && React.createElement(\"div\", {\n className: \"\".concat(clsPrefix, \"-extra\")\n }, extraActions));\n }\n }, {\n key: \"getText\",\n value: function getText(key) {\n return _getText(key, this.props.language || getLanguage());\n }\n }, {\n key: \"isFieldsWidthOverflow\",\n value: function isFieldsWidthOverflow() {\n var current = this.fieldsRef.current;\n\n if (current) {\n return current.offsetWidth < [].reduce.call(current.children, function (acc, cur) {\n var marginArray = window.getComputedStyle(cur).margin.split(' ').map(function (str) {\n return parseInt(str, 10);\n });\n acc += cur.offsetWidth + marginArray[1];\n return acc;\n }, 0);\n }\n\n return false;\n }\n }, {\n key: \"updateFieldHeight\",\n value: function updateFieldHeight() {\n var _formBoxRef$current, _formBoxRef$current2, _fieldsRef$current;\n\n var formBoxRef = this.formBoxRef,\n fieldsRef = this.fieldsRef;\n\n var getFieldHeight = function getFieldHeight() {\n var _current$children;\n\n var current = fieldsRef.current;\n var height = '32px';\n\n if (current && ((_current$children = current.children) == null ? void 0 : _current$children[0])) {\n height = window.getComputedStyle(current.children[0]).height;\n }\n\n return height;\n };\n\n var queryFormActionsDom = formBoxRef == null ? void 0 : (_formBoxRef$current = formBoxRef.current) == null ? void 0 : _formBoxRef$current.querySelector(\".\".concat(clsPrefix, \"-actions\"));\n var queryFormExtraDom = formBoxRef == null ? void 0 : (_formBoxRef$current2 = formBoxRef.current) == null ? void 0 : _formBoxRef$current2.querySelector(\".\".concat(clsPrefix, \"-extra\"));\n var formItemsDomList = fieldsRef == null ? void 0 : (_fieldsRef$current = fieldsRef.current) == null ? void 0 : _fieldsRef$current.querySelectorAll('.ant-form-item-control');\n var fieldHeight = getFieldHeight();\n fieldsRef.current.style.height = fieldHeight;\n [queryFormActionsDom, queryFormExtraDom].forEach(function (item) {\n item && Object.assign(item.style, {\n height: fieldHeight,\n lineHeight: fieldHeight\n });\n });\n [].forEach.call(formItemsDomList, function (item) {\n item.style.lineHeight = fieldHeight;\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var current = this.fieldsRef.current;\n var _this$props4 = this.props,\n showFieldCount = _this$props4.showFieldCount,\n _this$props4$showExpa = _this$props4.showExpand,\n showExpand = _this$props4$showExpa === void 0 ? true : _this$props4$showExpa,\n renderActions = _this$props4.renderActions;\n this.updateFieldHeight();\n this.form.on('search', this.search); // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑\n\n if (!showFieldCount && !showExpand || renderActions) {\n return;\n }\n\n if (!showFieldCount) {\n if (current && this.isFieldsWidthOverflow()) {\n this.setState({\n showMore: true\n });\n }\n\n window.addEventListener('resize', this.onWindowResize);\n } else {\n this.updateDrawerFieldsValueCount();\n this.form.on('setValues', this.updateDrawerFieldsValueCount);\n this.form.on('setValue', this.updateDrawerFieldsValueCount);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.onWindowResize);\n this.form.off('setValues', this.updateDrawerFieldsValueCount);\n this.form.off('setValue', this.updateDrawerFieldsValueCount);\n this.form.off('search', this.search);\n }\n }]);\n\n return QueryForm;\n}(React.PureComponent);\n\n;\nQueryForm.Field = Field;\nQueryForm.useForm = useForm;\nQueryForm.createForm = createActions;\nexport default QueryForm;"
34926
+ "source": "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); }\n\nfunction _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); }\n\nfunction 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; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport React, { createRef } from 'react';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { Form, Button, Drawer, Badge } from 'antd';\nimport useForm from './useForm';\nimport createActions from './createActions';\nimport Icon from '../Icon';\nimport Field from './Field';\nimport { getText as _getText, getLanguage } from '../locale';\nimport './index.less';\nvar clsPrefix = 'tnt-queryform';\n\nvar QueryForm =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(QueryForm, _React$PureComponent);\n\n function QueryForm(props) {\n var _this;\n\n _classCallCheck(this, QueryForm);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));\n _this.onWindowResize = debounce(function () {\n var current = _this.fieldsRef.current;\n\n if (current) {\n setTimeout(function () {\n _this.setState({\n showMore: _this.isFieldsWidthOverflow()\n });\n }, 25);\n }\n }, 50);\n\n _this.search = function (params) {\n _this.props.onSearch(_objectSpread({}, _this.form.getValues(), {}, params));\n };\n\n _this.onSearch = function () {\n _this.props.onSearch == null ? void 0 : _this.props.onSearch(_this.form.getValues());\n };\n\n _this.onReset = function () {\n var _this$props = _this.props,\n initialValues = _this$props.initialValues,\n onReset = _this$props.onReset;\n\n _this.form.setValues(_objectSpread({}, initialValues));\n\n _this.updateDrawerFieldsValueCount();\n\n onReset == null ? void 0 : onReset(initialValues);\n };\n\n _this.onToggleExpand = function () {\n _this.setState({\n expanded: !_this.state.expanded\n });\n\n _this.props.onToggleExpand == null ? void 0 : _this.props.onToggleExpand(!_this.state.expanded);\n };\n\n _this.onShowDrawer = function () {\n _this.setState({\n drawerVisible: true\n });\n };\n\n _this.onFieldChange = function (name, value) {\n var values = _this.form.getValues();\n\n var newValues = _objectSpread({}, values, _defineProperty({}, name, value));\n\n var changedInfo = {\n name: name,\n value: value,\n preValue: values == null ? void 0 : values[name]\n };\n var onChange = _this.props.onChange;\n\n _this.form.setData('values', newValues);\n\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));\n\n _this.updateDrawerFieldsValueCount(newValues);\n };\n\n _this.updateDrawerFieldsValueCount = function () {\n var values = _this.form.getValues();\n\n var _this$props2 = _this.props,\n showFieldCount = _this$props2.showFieldCount,\n children = _this$props2.children;\n\n if (showFieldCount) {\n var drawerFieldsValueCount = children.reduce(function (acc, cur, index) {\n var _cur$props;\n\n if (index >= showFieldCount && (values == null ? void 0 : values[cur == null ? void 0 : (_cur$props = cur.props) == null ? void 0 : _cur$props.name])) {\n acc++;\n }\n\n return acc;\n }, 0);\n\n if (drawerFieldsValueCount !== _this.state.drawerFieldsValueCount) {\n _this.setState({\n drawerFieldsValueCount: drawerFieldsValueCount\n });\n }\n }\n };\n\n var form = props.form,\n _initialValues = props.initialValues,\n _props$showExpand = props.showExpand,\n showExpand = _props$showExpand === void 0 ? true : _props$showExpand,\n renderActions = props.renderActions,\n defaultExpanded = props.defaultExpanded;\n _this.state = {\n showMore: false,\n expanded: defaultExpanded || !showExpand || renderActions ? true : false,\n drawerVisible: false,\n drawerFieldsValueCount: 0\n };\n _this.fieldsRef = createRef();\n _this.formBoxRef = createRef();\n _this.form = form || createActions();\n\n _this.form.setData('initialValues', _initialValues);\n\n _this.form.setData('values', _objectSpread({}, _initialValues));\n\n return _this;\n }\n\n _createClass(QueryForm, [{\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n children = _this$props3.children,\n _this$props3$classNam = _this$props3.className,\n className = _this$props3$classNam === void 0 ? '' : _this$props3$classNam,\n _this$props3$initialV = _this$props3.initialValues,\n initialValues = _this$props3$initialV === void 0 ? {} : _this$props3$initialV,\n renderActions = _this$props3.renderActions,\n _this$props3$showSear = _this$props3.showSearch,\n showSearch = _this$props3$showSear === void 0 ? true : _this$props3$showSear,\n _this$props3$showRese = _this$props3.showReset,\n showReset = _this$props3$showRese === void 0 ? true : _this$props3$showRese,\n showFieldCount = _this$props3.showFieldCount,\n _this$props3$drawerPr = _this$props3.drawerProps,\n drawerProps = _this$props3$drawerPr === void 0 ? {} : _this$props3$drawerPr,\n size = _this$props3.size;\n var extraActions = this.props.extraActions;\n var _this$state = this.state,\n expanded = _this$state.expanded,\n showMore = _this$state.showMore,\n drawerVisible = _this$state.drawerVisible,\n drawerFieldsValueCount = _this$state.drawerFieldsValueCount;\n\n var renderFormActions = renderActions || function () {\n return React.createElement(React.Fragment, null, showFieldCount && React.createElement(Badge, {\n count: drawerFieldsValueCount\n }, React.createElement(Button, {\n onClick: _this2.onShowDrawer\n }, React.createElement(Icon, {\n type: \"filter\"\n }), _this2.getText('moreFiltering'))), showSearch && React.createElement(Button, {\n type: \"primary\",\n onClick: _this2.onSearch\n }, _this2.getText('search')), showReset && React.createElement(Button, {\n onClick: _this2.onReset\n }, _this2.getText('reset')), showMore && !showFieldCount && React.createElement(Button, {\n className: \"expand-link\",\n type: \"link\",\n onClick: _this2.onToggleExpand\n }, _this2.getText(expanded ? 'collapse' : 'expand')), React.Children.map(children, function (child) {\n var _child$props;\n\n return child && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.align) === 'right' && React.cloneElement(child);\n }));\n };\n\n return React.createElement(\"div\", {\n ref: this.formBoxRef,\n className: classnames(clsPrefix, _defineProperty({}, className, className))\n }, React.createElement(Form, {\n layout: \"inline\",\n className: classnames({\n expanded: !showMore || expanded,\n showMore: showMore\n })\n }, React.createElement(\"div\", {\n ref: this.fieldsRef\n }, React.Children.map(children, function (child, index) {\n var _child$props2;\n\n return child && (child == null ? void 0 : (_child$props2 = child.props) == null ? void 0 : _child$props2.align) !== 'right' && (!showFieldCount || showFieldCount > index) && React.cloneElement(child, {\n form: _this2.form,\n initialValue: initialValues == null ? void 0 : initialValues[child.props.name],\n onChange: _this2.onFieldChange\n });\n })), React.createElement(\"div\", {\n className: \"\".concat(clsPrefix, \"-actions\")\n }, renderFormActions()), showFieldCount && React.createElement(Drawer, _extends({\n title: this.getText('moreFiltering'),\n visible: drawerVisible,\n onClose: function onClose() {\n return _this2.setState({\n drawerVisible: false\n });\n },\n width: 300,\n size: size,\n getContainer: false\n }, drawerProps, {\n className: classnames(\"\".concat(clsPrefix, \"-drawer\"), _defineProperty({\n 'large-size': size === 'large'\n }, className, className))\n }), React.Children.map(children, function (child, index) {\n return child && index >= showFieldCount && React.cloneElement(child, {\n form: _this2.form,\n isFieldInDrawer: true,\n initialValue: initialValues == null ? void 0 : initialValues[child.props.name],\n onChange: _this2.onFieldChange,\n onSearch: _this2.onSearch\n });\n }), React.createElement(Button, {\n type: \"primary\",\n onClick: this.onSearch\n }, this.getText('search')), React.createElement(Button, {\n onClick: this.onReset\n }, this.getText('reset')))), extraActions && React.createElement(\"div\", {\n className: \"\".concat(clsPrefix, \"-extra\")\n }, extraActions));\n }\n }, {\n key: \"getText\",\n value: function getText(key) {\n return _getText(key, this.props.language || getLanguage());\n }\n }, {\n key: \"isFieldsWidthOverflow\",\n value: function isFieldsWidthOverflow() {\n var current = this.fieldsRef.current;\n\n if (current) {\n return current.offsetWidth < [].reduce.call(current.children, function (acc, cur) {\n var marginArray = window.getComputedStyle(cur).margin.split(' ').map(function (str) {\n return parseInt(str, 10);\n });\n acc += cur.offsetWidth + marginArray[1];\n return acc;\n }, 0);\n }\n\n return false;\n }\n }, {\n key: \"updateFieldHeight\",\n value: function updateFieldHeight() {\n var _formBoxRef$current, _formBoxRef$current2, _fieldsRef$current;\n\n var formBoxRef = this.formBoxRef,\n fieldsRef = this.fieldsRef;\n\n var getFieldHeight = function getFieldHeight() {\n var _current$children;\n\n var current = fieldsRef.current;\n var height = '32px';\n\n if (current && ((_current$children = current.children) == null ? void 0 : _current$children[0])) {\n height = window.getComputedStyle(current.children[0]).height;\n }\n\n return height;\n };\n\n var queryFormActionsDom = formBoxRef == null ? void 0 : (_formBoxRef$current = formBoxRef.current) == null ? void 0 : _formBoxRef$current.querySelector(\".\".concat(clsPrefix, \"-actions\"));\n var queryFormExtraDom = formBoxRef == null ? void 0 : (_formBoxRef$current2 = formBoxRef.current) == null ? void 0 : _formBoxRef$current2.querySelector(\".\".concat(clsPrefix, \"-extra\"));\n var formItemsDomList = fieldsRef == null ? void 0 : (_fieldsRef$current = fieldsRef.current) == null ? void 0 : _fieldsRef$current.querySelectorAll('.ant-form-item-control');\n var fieldHeight = getFieldHeight();\n fieldsRef.current.style.height = fieldHeight;\n [queryFormActionsDom, queryFormExtraDom].forEach(function (item) {\n item && Object.assign(item.style, {\n height: fieldHeight,\n lineHeight: fieldHeight\n });\n });\n [].forEach.call(formItemsDomList, function (item) {\n item.style.lineHeight = fieldHeight;\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var current = this.fieldsRef.current;\n var _this$props4 = this.props,\n showFieldCount = _this$props4.showFieldCount,\n _this$props4$showExpa = _this$props4.showExpand,\n showExpand = _this$props4$showExpa === void 0 ? true : _this$props4$showExpa,\n renderActions = _this$props4.renderActions;\n this.updateFieldHeight();\n this.form.on('search', this.search); // 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑\n // || renderActions\n\n if (!showFieldCount && !showExpand) {\n return;\n }\n\n if (!showFieldCount) {\n if (current && this.isFieldsWidthOverflow()) {\n this.setState({\n showMore: true\n });\n }\n\n window.addEventListener('resize', this.onWindowResize);\n } else {\n this.updateDrawerFieldsValueCount();\n this.form.on('setValues', this.updateDrawerFieldsValueCount);\n this.form.on('setValue', this.updateDrawerFieldsValueCount);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.onWindowResize);\n this.form.off('setValues', this.updateDrawerFieldsValueCount);\n this.form.off('setValue', this.updateDrawerFieldsValueCount);\n this.form.off('search', this.search);\n }\n }]);\n\n return QueryForm;\n}(React.PureComponent);\n\n;\nQueryForm.Field = Field;\nQueryForm.useForm = useForm;\nQueryForm.createForm = createActions;\nexport default QueryForm;"
34927
34927
  },
34928
34928
  {
34929
34929
  "id": null,
@@ -37468,7 +37468,7 @@
37468
37468
  "moduleName": "./components/QueryForm/index.js",
37469
37469
  "type": "harmony import specifier",
37470
37470
  "userRequest": "./createActions",
37471
- "loc": "375:23-36"
37471
+ "loc": "376:23-36"
37472
37472
  }
37473
37473
  ],
37474
37474
  "usedExports": [
@@ -37529,7 +37529,7 @@
37529
37529
  "moduleName": "./components/QueryForm/index.js",
37530
37530
  "type": "harmony import specifier",
37531
37531
  "userRequest": "./useForm",
37532
- "loc": "374:20-27"
37532
+ "loc": "375:20-27"
37533
37533
  }
37534
37534
  ],
37535
37535
  "usedExports": [
@@ -37590,7 +37590,7 @@
37590
37590
  "moduleName": "./components/QueryForm/index.js",
37591
37591
  "type": "harmony import specifier",
37592
37592
  "userRequest": "./Field",
37593
- "loc": "373:18-23"
37593
+ "loc": "374:18-23"
37594
37594
  }
37595
37595
  ],
37596
37596
  "usedExports": [
@@ -38084,7 +38084,7 @@
38084
38084
  "name": "./components/QueryListScene/QueryForm.js",
38085
38085
  "index": 148,
38086
38086
  "index2": 146,
38087
- "size": 8579,
38087
+ "size": 8690,
38088
38088
  "cacheable": true,
38089
38089
  "built": true,
38090
38090
  "optional": false,
@@ -38155,7 +38155,7 @@
38155
38155
  ],
38156
38156
  "optimizationBailout": [],
38157
38157
  "depth": 2,
38158
- "source": "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); }\n\nfunction _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); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction 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; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport React from 'react';\nimport classnames from 'classnames';\nimport Form from '../QueryForm';\nvar clsPrefix = 'tnt-querylistscene-queryform';\n\nvar QueryForm =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(QueryForm, _React$PureComponent);\n\n function QueryForm(props) {\n var _this;\n\n _classCallCheck(this, QueryForm);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));\n\n _this.onSearch = function () {\n var _this$props = _this.props,\n onSearch = _this$props.onSearch,\n actions = _this$props.actions;\n var values = actions.getFormData();\n\n var params = _objectSpread({}, values, {\n current: 1\n });\n\n actions.setData('formData', values);\n onSearch && onSearch(params);\n actions.emit('search', params);\n };\n\n _this.onReset = function () {\n var _this$props2 = _this.props,\n initialValues = _this$props2.initialValues,\n onReset = _this$props2.onReset,\n actions = _this$props2.actions;\n actions.setFormData(initialValues, false);\n onReset && onReset(initialValues);\n\n _this.onSearch();\n };\n\n _this.onChange = function (newValues, changedInfo) {\n var _this$props3 = _this.props,\n onChange = _this$props3.onChange,\n actions = _this$props3.actions;\n\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));\n actions.setFormData(newValues, false);\n };\n\n _this.setFormData = function (data, needSearch) {\n var actions = _this.props.actions;\n actions.setData('formData', data);\n\n _this.form.setValues(data);\n\n needSearch && _this.onSearch();\n };\n\n _this.resetFormData = function (needSearch) {\n var _this$props4 = _this.props,\n initialValues = _this$props4.initialValues,\n actions = _this$props4.actions;\n actions.setFormData(initialValues, needSearch);\n\n _this.form.resetValues();\n };\n\n var _actions = props.actions,\n form = props.form;\n _this.form = form || Form.createForm();\n\n _actions.on('setFormData', _this.setFormData);\n\n _actions.on('resetFormData', _this.resetFormData);\n\n return _this;\n }\n\n _createClass(QueryForm, [{\n key: \"render\",\n value: function render() {\n var _this$props5 = this.props,\n className = _this$props5.className,\n actions = _this$props5.actions,\n extraActions = _this$props5.extraActions,\n extralActions = _this$props5.extralActions,\n qlsProps = _this$props5.qlsProps,\n props = _objectWithoutProperties(_this$props5, [\"className\", \"actions\", \"extraActions\", \"extralActions\", \"qlsProps\"]);\n\n return React.createElement(Form, _extends({}, props, {\n form: this.form,\n className: classnames(clsPrefix, _defineProperty({}, className, className)) // 前期拼写错误,导致需要兼容错误的api\n ,\n extraActions: extraActions || extralActions,\n onChange: this.onChange,\n onSearch: this.onSearch,\n onReset: this.onReset\n }));\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props6 = this.props,\n _this$props6$initialV = _this$props6.initialValues,\n initialValues = _this$props6$initialV === void 0 ? {} : _this$props6$initialV,\n actions = _this$props6.actions,\n qlsProps = _this$props6.qlsProps;\n\n if (qlsProps.memory) {\n actions.setFormData(_objectSpread({}, initialValues, {}, actions.getFormData()), false);\n } else {\n actions.setData('formData', initialValues);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var actions = this.props.actions;\n actions.removeListener('setFormData', this.setFormData);\n actions.removeListener('resetFormData', this.resetFormData);\n }\n }]);\n\n return QueryForm;\n}(React.PureComponent);\n\nexport { QueryForm as default };\n;\nQueryForm.Field = Form.Field;"
38158
+ "source": "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); }\n\nfunction _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); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction 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; }\n\nfunction _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; }\n\nfunction _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; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _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); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport React from 'react';\nimport classnames from 'classnames';\nimport Form from '../QueryForm';\nvar clsPrefix = 'tnt-querylistscene-queryform';\n\nvar QueryForm =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(QueryForm, _React$PureComponent);\n\n function QueryForm(props) {\n var _this;\n\n _classCallCheck(this, QueryForm);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(QueryForm).call(this, props));\n\n _this.onSearch = function () {\n var _this$props = _this.props,\n onSearch = _this$props.onSearch,\n actions = _this$props.actions;\n var values = actions.getFormData();\n\n var params = _objectSpread({}, values, {\n current: 1\n }); // memory 与 url解析setForm时 监听事件异步\n\n\n actions.setData('formData', values);\n Promise.resolve().then(function () {\n onSearch && onSearch(params);\n actions.emit('search', params);\n });\n };\n\n _this.onReset = function () {\n var _this$props2 = _this.props,\n initialValues = _this$props2.initialValues,\n onReset = _this$props2.onReset,\n actions = _this$props2.actions;\n actions.setFormData(initialValues, false);\n onReset && onReset(initialValues);\n\n _this.onSearch();\n };\n\n _this.onChange = function (newValues, changedInfo) {\n var _this$props3 = _this.props,\n onChange = _this$props3.onChange,\n actions = _this$props3.actions;\n\n for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n rest[_key - 2] = arguments[_key];\n }\n\n onChange && onChange.apply(void 0, [newValues, changedInfo].concat(rest));\n actions.setFormData(newValues, false);\n };\n\n _this.setFormData = function (data, needSearch) {\n var actions = _this.props.actions;\n actions.setData('formData', data);\n\n _this.form.setValues(data);\n\n needSearch && _this.onSearch();\n };\n\n _this.resetFormData = function (needSearch) {\n var _this$props4 = _this.props,\n initialValues = _this$props4.initialValues,\n actions = _this$props4.actions;\n actions.setFormData(initialValues, needSearch);\n\n _this.form.resetValues();\n };\n\n var _actions = props.actions,\n form = props.form;\n _this.form = form || Form.createForm();\n\n _actions.on('setFormData', _this.setFormData);\n\n _actions.on('resetFormData', _this.resetFormData);\n\n return _this;\n }\n\n _createClass(QueryForm, [{\n key: \"render\",\n value: function render() {\n var _this$props5 = this.props,\n className = _this$props5.className,\n actions = _this$props5.actions,\n extraActions = _this$props5.extraActions,\n extralActions = _this$props5.extralActions,\n qlsProps = _this$props5.qlsProps,\n props = _objectWithoutProperties(_this$props5, [\"className\", \"actions\", \"extraActions\", \"extralActions\", \"qlsProps\"]);\n\n return React.createElement(Form, _extends({}, props, {\n form: this.form,\n className: classnames(clsPrefix, _defineProperty({}, className, className)) // 前期拼写错误,导致需要兼容错误的api\n ,\n extraActions: extraActions || extralActions,\n onChange: this.onChange,\n onSearch: this.onSearch,\n onReset: this.onReset\n }));\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props6 = this.props,\n _this$props6$initialV = _this$props6.initialValues,\n initialValues = _this$props6$initialV === void 0 ? {} : _this$props6$initialV,\n actions = _this$props6.actions,\n qlsProps = _this$props6.qlsProps;\n\n if (qlsProps.memory) {\n actions.setFormData(_objectSpread({}, initialValues, {}, actions.getFormData()), false);\n } else {\n actions.setData('formData', initialValues);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var actions = this.props.actions;\n actions.removeListener('setFormData', this.setFormData);\n actions.removeListener('resetFormData', this.resetFormData);\n }\n }]);\n\n return QueryForm;\n}(React.PureComponent);\n\nexport { QueryForm as default };\n;\nQueryForm.Field = Form.Field;"
38159
38159
  },
38160
38160
  {
38161
38161
  "id": null,