antd-management-fast-framework 1.2.36 → 1.2.40

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.
@@ -380,6 +380,10 @@ export function buildColorText({ canCopy, randomSeed, seedOffset, randomColor, c
380
380
  separatorStyle?: null | undefined;
381
381
  wrapperBuilder?: null | undefined;
382
382
  }): any;
383
+ export function adjustTableExpandConfig({ list, config }: {
384
+ list: any;
385
+ config: any;
386
+ }): any;
383
387
  /**
384
388
  * 占位函数
385
389
  *
@@ -54,6 +54,7 @@ exports.buildFormDatePicker = buildFormDatePicker;
54
54
  exports.buildColumnList = buildColumnList;
55
55
  exports.buildColumnItem = buildColumnItem;
56
56
  exports.buildColorText = buildColorText;
57
+ exports.adjustTableExpandConfig = adjustTableExpandConfig;
57
58
  exports.empty = empty;
58
59
 
59
60
  require("antd/es/badge/style");
@@ -160,6 +161,12 @@ var _FlexText = _interopRequireDefault(require("../FlexText"));
160
161
 
161
162
  var _ColorText = _interopRequireDefault(require("../ColorText"));
162
163
 
164
+ var _RotateBox = _interopRequireDefault(require("../AnimalBox/RotateBox"));
165
+
166
+ var _QueueBox = _interopRequireDefault(require("../AnimalBox/QueueBox"));
167
+
168
+ var _FadeBox = _interopRequireDefault(require("../AnimalBox/FadeBox"));
169
+
163
170
  var _index = _interopRequireDefault(require("./index.less"));
164
171
 
165
172
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -2840,6 +2847,114 @@ function buildColorText(_ref50) {
2840
2847
 
2841
2848
  return wrapperBuilder(colorText);
2842
2849
  }
2850
+
2851
+ function adjustTableExpandConfig(_ref51) {
2852
+ var list = _ref51.list,
2853
+ config = _ref51.config;
2854
+
2855
+ if ((config || null) != null) {
2856
+ var _checkNeedExpander$ro = _objectSpread(_objectSpread({}, {
2857
+ // 判断当前列表数据,如若列表所有数据都不需要显示展开按钮,则忽略其他配置
2858
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2859
+ checkNeedExpander: null,
2860
+ rowExpandable: false,
2861
+ expandPlaceholderIcon: /*#__PURE__*/_react["default"].createElement(_icons.BorderOuterOutlined, {
2862
+ style: {
2863
+ color: '#ccc'
2864
+ }
2865
+ }),
2866
+ expanderStyle: null,
2867
+ animalType: _constants.listViewConfig.expandAnimalType.none,
2868
+ expandIconRotate: true,
2869
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2870
+ expandIcon: function expandIcon(_ref52) {
2871
+ var expanded = _ref52.expanded,
2872
+ onExpand = _ref52.onExpand,
2873
+ record = _ref52.record;
2874
+ return /*#__PURE__*/_react["default"].createElement(_icons.RightCircleOutlined, null);
2875
+ },
2876
+ expandedRowRender: null
2877
+ }), config || null),
2878
+ checkNeedExpander = _checkNeedExpander$ro.checkNeedExpander,
2879
+ rowExpandable = _checkNeedExpander$ro.rowExpandable,
2880
+ expandPlaceholderIcon = _checkNeedExpander$ro.expandPlaceholderIcon,
2881
+ expanderStyle = _checkNeedExpander$ro.expanderStyle,
2882
+ expandAnimalType = _checkNeedExpander$ro.animalType,
2883
+ expandIconRotate = _checkNeedExpander$ro.expandIconRotate,
2884
+ expandIconCustom = _checkNeedExpander$ro.expandIcon,
2885
+ expandedRowRenderCustom = _checkNeedExpander$ro.expandedRowRender;
2886
+
2887
+ var checkNeedExpanderResult = true;
2888
+
2889
+ if ((0, _tools.isBoolean)(checkNeedExpander)) {
2890
+ checkNeedExpanderResult = checkNeedExpander;
2891
+ }
2892
+
2893
+ if ((0, _tools.isFunction)(checkNeedExpander)) {
2894
+ var r = checkNeedExpander(list);
2895
+
2896
+ if ((0, _tools.isBoolean)(checkNeedExpander)) {
2897
+ checkNeedExpanderResult = r;
2898
+ }
2899
+ }
2900
+
2901
+ expandableConfig = checkNeedExpanderResult ? {
2902
+ rowExpandable: rowExpandable,
2903
+ expandIcon: function expandIcon(_ref53) {
2904
+ var canExpand = _ref53.expandable,
2905
+ expanded = _ref53.expanded,
2906
+ onExpand = _ref53.onExpand,
2907
+ record = _ref53.record;
2908
+
2909
+ if (!canExpand && (expandPlaceholderIcon || null) != null) {
2910
+ return expandPlaceholderIcon || null;
2911
+ }
2912
+
2913
+ if (expandIconRotate) {
2914
+ return /*#__PURE__*/_react["default"].createElement(_RotateBox["default"], {
2915
+ rotate: expanded ? 90 : 0,
2916
+ duration: 200,
2917
+ onClick: function onClick(e) {
2918
+ return onExpand(record, e);
2919
+ }
2920
+ }, expandIconCustom({
2921
+ expanded: expanded,
2922
+ onExpand: onExpand,
2923
+ record: record
2924
+ }));
2925
+ }
2926
+
2927
+ return expandIconCustom({
2928
+ expanded: expanded,
2929
+ onExpand: onExpand,
2930
+ record: record
2931
+ });
2932
+ },
2933
+ expandedRowRender: (0, _tools.isFunction)(expandedRowRenderCustom) ? function (record, index, indent, expanded) {
2934
+ var child = expandedRowRenderCustom(record, index, indent, expanded);
2935
+
2936
+ if (expandAnimalType === _constants.listViewConfig.expandAnimalType.fade) {
2937
+ child = /*#__PURE__*/_react["default"].createElement(_FadeBox["default"], {
2938
+ show: expanded
2939
+ }, child);
2940
+ }
2941
+
2942
+ if (expandAnimalType === _constants.listViewConfig.expandAnimalType.queue) {
2943
+ child = /*#__PURE__*/_react["default"].createElement(_QueueBox["default"], {
2944
+ show: expanded
2945
+ }, child);
2946
+ }
2947
+
2948
+ return /*#__PURE__*/_react["default"].createElement("div", {
2949
+ style: expanderStyle || {}
2950
+ }, child);
2951
+ } : null
2952
+ } : {};
2953
+ return expandableConfig;
2954
+ }
2955
+
2956
+ return null;
2957
+ }
2843
2958
  /**
2844
2959
  * 占位函数
2845
2960
  *
@@ -87,12 +87,6 @@ var _StandardTableCustom = _interopRequireDefault(require("../../../customCompon
87
87
 
88
88
  var _AuthorizationWrapper2 = _interopRequireDefault(require("../../AuthorizationWrapper"));
89
89
 
90
- var _QueueBox = _interopRequireDefault(require("../../../customComponents/AnimalBox/QueueBox"));
91
-
92
- var _FadeBox = _interopRequireDefault(require("../../../customComponents/AnimalBox/FadeBox"));
93
-
94
- var _RotateBox = _interopRequireDefault(require("../../../customComponents/AnimalBox/RotateBox"));
95
-
96
90
  var _DensityAction = _interopRequireDefault(require("../DensityAction"));
97
91
 
98
92
  var _ColumnSetting = _interopRequireDefault(require("../ColumnSetting"));
@@ -1199,7 +1193,11 @@ var ListBase = /*#__PURE__*/function (_AuthorizationWrapper) {
1199
1193
  columns: columns,
1200
1194
  size: size || null,
1201
1195
  onSelectRow: _this.handleSelectRows,
1202
- onChange: _this.handleStandardTableChange
1196
+ onChange: _this.handleStandardTableChange,
1197
+ expandable: (0, _FunctionComponent.adjustTableExpandConfig)({
1198
+ list: metaListData,
1199
+ config: expandable
1200
+ })
1203
1201
  };
1204
1202
 
1205
1203
  if (!!paginationConfig) {
@@ -1221,116 +1219,13 @@ var ListBase = /*#__PURE__*/function (_AuthorizationWrapper) {
1221
1219
  standardTableCustomOption.scroll = tableScroll;
1222
1220
  }
1223
1221
 
1224
- var expandableConfig = null;
1225
-
1226
- if ((expandable || null) != null) {
1227
- var _checkNeedExpander$ro = _objectSpread(_objectSpread({}, {
1228
- // 判断当前列表数据,如若列表所有数据都不需要显示展开按钮,则忽略其他配置
1229
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1230
- checkNeedExpander: null,
1231
- rowExpandable: false,
1232
- expandPlaceholderIcon: /*#__PURE__*/_react["default"].createElement(_icons.BorderOuterOutlined, {
1233
- style: {
1234
- color: '#ccc'
1235
- }
1236
- }),
1237
- expanderStyle: null,
1238
- animalType: _constants.listViewConfig.expandAnimalType.none,
1239
- expandIconRotate: true,
1240
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1241
- expandIcon: function expandIcon(_ref4) {
1242
- var expanded = _ref4.expanded,
1243
- onExpand = _ref4.onExpand,
1244
- record = _ref4.record;
1245
- return /*#__PURE__*/_react["default"].createElement(_icons.RightCircleOutlined, null);
1246
- },
1247
- expandedRowRender: null
1248
- }), expandable || null),
1249
- checkNeedExpander = _checkNeedExpander$ro.checkNeedExpander,
1250
- rowExpandable = _checkNeedExpander$ro.rowExpandable,
1251
- expandPlaceholderIcon = _checkNeedExpander$ro.expandPlaceholderIcon,
1252
- expanderStyle = _checkNeedExpander$ro.expanderStyle,
1253
- expandAnimalType = _checkNeedExpander$ro.animalType,
1254
- expandIconRotate = _checkNeedExpander$ro.expandIconRotate,
1255
- expandIconCustom = _checkNeedExpander$ro.expandIcon,
1256
- expandedRowRenderCustom = _checkNeedExpander$ro.expandedRowRender;
1257
-
1258
- var checkNeedExpanderResult = true;
1259
-
1260
- if ((0, _tools.isBoolean)(checkNeedExpander)) {
1261
- checkNeedExpanderResult = checkNeedExpander;
1262
- }
1263
-
1264
- if ((0, _tools.isFunction)(checkNeedExpander)) {
1265
- var r = checkNeedExpander(metaListData);
1266
-
1267
- if ((0, _tools.isBoolean)(checkNeedExpander)) {
1268
- checkNeedExpanderResult = r;
1269
- }
1270
- }
1271
-
1272
- expandableConfig = checkNeedExpanderResult ? {
1273
- rowExpandable: rowExpandable,
1274
- expandIcon: function expandIcon(_ref5) {
1275
- var canExpand = _ref5.expandable,
1276
- expanded = _ref5.expanded,
1277
- onExpand = _ref5.onExpand,
1278
- record = _ref5.record;
1279
-
1280
- if (!canExpand && (expandPlaceholderIcon || null) != null) {
1281
- return expandPlaceholderIcon || null;
1282
- }
1283
-
1284
- if (expandIconRotate) {
1285
- return /*#__PURE__*/_react["default"].createElement(_RotateBox["default"], {
1286
- rotate: expanded ? 90 : 0,
1287
- duration: 200,
1288
- onClick: function onClick(e) {
1289
- return onExpand(record, e);
1290
- }
1291
- }, expandIconCustom({
1292
- expanded: expanded,
1293
- onExpand: onExpand,
1294
- record: record
1295
- }));
1296
- }
1297
-
1298
- return expandIconCustom({
1299
- expanded: expanded,
1300
- onExpand: onExpand,
1301
- record: record
1302
- });
1303
- },
1304
- expandedRowRender: (0, _tools.isFunction)(expandedRowRenderCustom) ? function (record, index, indent, expanded) {
1305
- var child = expandedRowRenderCustom(record, index, indent, expanded);
1306
-
1307
- if (expandAnimalType === _constants.listViewConfig.expandAnimalType.fade) {
1308
- child = /*#__PURE__*/_react["default"].createElement(_FadeBox["default"], {
1309
- show: expanded
1310
- }, child);
1311
- }
1312
-
1313
- if (expandAnimalType === _constants.listViewConfig.expandAnimalType.queue) {
1314
- child = /*#__PURE__*/_react["default"].createElement(_QueueBox["default"], {
1315
- show: expanded
1316
- }, child);
1317
- }
1318
-
1319
- return /*#__PURE__*/_react["default"].createElement("div", {
1320
- style: expanderStyle || {}
1321
- }, child);
1322
- } : null
1323
- } : {};
1324
- }
1325
-
1326
- standardTableCustomOption.expandable = expandableConfig;
1327
1222
  return /*#__PURE__*/_react["default"].createElement("div", {
1328
1223
  className: _index["default"].tableContainor
1329
1224
  }, /*#__PURE__*/_react["default"].createElement(_StandardTableCustom["default"], standardTableCustomOption));
1330
1225
  };
1331
1226
 
1332
- _this.renderCardCollectionView = function (_ref6) {
1333
- var list = _ref6.list;
1227
+ _this.renderCardCollectionView = function (_ref4) {
1228
+ var list = _ref4.list;
1334
1229
  var _this$state8 = _this.state,
1335
1230
  dataLoading = _this$state8.dataLoading,
1336
1231
  reloading = _this$state8.reloading,
@@ -16,5 +16,9 @@ declare class MultiPage extends Base {
16
16
  afterGetFirstRequestResult: (submitData: any, responseData: any) => void;
17
17
  adjustRenderLoadRequestParamsWithKey: (d: any) => void;
18
18
  afterGetRequestResult: () => void;
19
+ establishPaginationViewStyle: () => {
20
+ paddingTop: number;
21
+ paddingBottom: number;
22
+ };
19
23
  }
20
24
  import Base from "../../DataListView/Base";
@@ -323,14 +323,20 @@ var MultiPage = /*#__PURE__*/function (_Base) {
323
323
  return paginationConfig;
324
324
  };
325
325
 
326
+ _this.establishPaginationViewStyle = function () {
327
+ return {
328
+ paddingTop: 16,
329
+ paddingBottom: 16
330
+ };
331
+ };
332
+
326
333
  _this.renderPaginationView = function () {
327
334
  var paginationConfig = _this.supplementPaginationConfig();
328
335
 
336
+ var style = _this.establishPaginationViewStyle();
337
+
329
338
  return /*#__PURE__*/_react["default"].createElement(_FlexBox["default"], {
330
- style: {
331
- paddingTop: 16,
332
- paddingBottom: 16
333
- },
339
+ style: style,
334
340
  right: /*#__PURE__*/_react["default"].createElement(_pagination2["default"], _extends({}, paginationConfig, {
335
341
  onChange: function onChange(page, size) {
336
342
  _this.handlePaginationChange(page, size);
@@ -13,7 +13,9 @@ declare class MultiPageDrawer extends MultiPage {
13
13
  onClose: () => void;
14
14
  renderTitleIcon: () => JSX.Element;
15
15
  hideDrawer: () => void;
16
- selectRecord: (record: any) => void;
16
+ selectRecord: ({ handleData }: {
17
+ handleData: any;
18
+ }) => void;
17
19
  establishWrapperTypeConfig: () => {
18
20
  mode: string;
19
21
  };
@@ -172,13 +172,14 @@ var MultiPageDrawer = /*#__PURE__*/function (_MultiPage) {
172
172
  _this.onClose();
173
173
  };
174
174
 
175
- _this.selectRecord = function (record) {
175
+ _this.selectRecord = function (_ref) {
176
+ var handleData = _ref.handleData;
176
177
  var _this$props = _this.props,
177
178
  afterSelectSuccess = _this$props.afterSelectSuccess,
178
179
  hideDrawerAfterSelect = _this$props.hideDrawerAfterSelect;
179
180
 
180
181
  if ((0, _tools.isFunction)(afterSelectSuccess)) {
181
- afterSelectSuccess(record);
182
+ afterSelectSuccess(handleData);
182
183
  }
183
184
 
184
185
  if (hideDrawerAfterSelect) {
@@ -365,6 +366,13 @@ var MultiPageDrawer = /*#__PURE__*/function (_MultiPage) {
365
366
  }, _this.renderContentContainor());
366
367
  };
367
368
 
369
+ _this.establishPaginationViewStyle = function () {
370
+ return {
371
+ paddingTop: 10,
372
+ paddingBottom: 10
373
+ };
374
+ };
375
+
368
376
  _this.renderListView = function () {
369
377
  var listViewMode = _this.state.listViewMode;
370
378
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -393,8 +401,8 @@ var MultiPageDrawer = /*#__PURE__*/function (_MultiPage) {
393
401
  })), /*#__PURE__*/_react["default"].createElement("div", {
394
402
  style: listViewMode === _constants.listViewConfig.viewMode.list ? {
395
403
  flex: 0,
396
- paddingTop: 10,
397
- paddingBottom: 10
404
+ paddingTop: 0,
405
+ paddingBottom: 0
398
406
  } : {}
399
407
  }, /*#__PURE__*/_react["default"].createElement("div", {
400
408
  style: listViewMode === _constants.listViewConfig.viewMode.list ? {
@@ -416,7 +424,9 @@ var MultiPageDrawer = /*#__PURE__*/function (_MultiPage) {
416
424
  index: index,
417
425
  selectData: item,
418
426
  selectCallback: function selectCallback(data) {
419
- return that.selectRecord(data);
427
+ return that.selectRecord({
428
+ handleData: data || null
429
+ });
420
430
  }
421
431
  });
422
432
  };
@@ -11,7 +11,9 @@ declare class SinglePageDrawer extends SinglePage {
11
11
  doOtherWhenChangeVisible: (preProps: any, preState: any, snapshot: any) => void;
12
12
  executeAfterDoOtherWhenChangeVisible: () => void;
13
13
  onClose: () => void;
14
- selectRecord: (record: any) => void;
14
+ selectRecord: ({ handleData }: {
15
+ handleData: any;
16
+ }) => void;
15
17
  renderTitleIcon: () => JSX.Element;
16
18
  hideDrawer: () => void;
17
19
  establishWrapperTypeConfig: () => {
@@ -137,13 +137,14 @@ var SinglePageDrawer = /*#__PURE__*/function (_SinglePage) {
137
137
  }
138
138
  };
139
139
 
140
- _this.selectRecord = function (record) {
140
+ _this.selectRecord = function (_ref) {
141
+ var handleData = _ref.handleData;
141
142
  var _this$props = _this.props,
142
143
  afterSelectSuccess = _this$props.afterSelectSuccess,
143
144
  hideDrawerAfterSelect = _this$props.hideDrawerAfterSelect;
144
145
 
145
146
  if ((0, _tools.isFunction)(afterSelectSuccess)) {
146
- afterSelectSuccess(record);
147
+ afterSelectSuccess(handleData);
147
148
  }
148
149
 
149
150
  if (hideDrawerAfterSelect) {
@@ -387,7 +388,9 @@ var SinglePageDrawer = /*#__PURE__*/function (_SinglePage) {
387
388
  index: index,
388
389
  selectData: item,
389
390
  selectCallback: function selectCallback(data) {
390
- return that.selectRecord(data);
391
+ return that.selectRecord({
392
+ handleData: data || null
393
+ });
391
394
  }
392
395
  });
393
396
  };
@@ -4,6 +4,9 @@
4
4
  * @returns
5
5
  */
6
6
  export function handleItem({ target, dataId, compareDataIdHandler, handler }: any): void;
7
+ /**
8
+ * remote assess core
9
+ */
7
10
  export function actionCore({ api, params, getApiData, target, handleData, successCallback, successMessage, successMessageBuilder, showProcessing, textProcessing, }: {
8
11
  api: any;
9
12
  params: any;
@@ -88,6 +88,10 @@ function handleItem(_ref) {
88
88
  });
89
89
  }
90
90
  }
91
+ /**
92
+ * remote assess core
93
+ */
94
+
91
95
 
92
96
  function actionCore(_x) {
93
97
  return _actionCore.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-management-fast-framework",
3
- "version": "1.2.36",
3
+ "version": "1.2.40",
4
4
  "description": "antd-management-fast-framework",
5
5
  "keywords": [
6
6
  "antd-management-fast-framework"
@@ -42,7 +42,7 @@
42
42
  "lodash-decorators": "^6.0.1",
43
43
  "lodash.debounce": "^4.0.8",
44
44
  "lodash.isequal": "^4.5.0",
45
- "memoize-one": "^5.2.1",
45
+ "memoize-one": "^6.0.0",
46
46
  "moment": "^2.29.1",
47
47
  "numeral": "^2.0.6",
48
48
  "omit.js": "^2.0.2",
@@ -79,7 +79,7 @@
79
79
  "@testing-library/react": "^12.1.2",
80
80
  "@testing-library/react-hooks": "^7.0.2",
81
81
  "@types/jest": "^27.0.2",
82
- "@types/node": "^16.11.1",
82
+ "@types/node": "^16.11.2",
83
83
  "@typescript-eslint/eslint-plugin": "^5.1.0",
84
84
  "@umijs/fabric": "^2.8.1",
85
85
  "@umijs/test": "^3.5.20",
@@ -103,7 +103,7 @@
103
103
  "eslint-plugin-unicorn": "^37.0.1",
104
104
  "express": "^4.17.1",
105
105
  "father-build": "^1.20.1",
106
- "husky": "^7.0.2",
106
+ "husky": "^7.0.4",
107
107
  "import-sort-cli": "^6.0.0",
108
108
  "import-sort-parser-babylon": "^6.0.0",
109
109
  "import-sort-parser-typescript": "^6.0.0",
@@ -119,9 +119,9 @@
119
119
  "react-dom": "^17.0.2",
120
120
  "react-test-renderer": "^17.0.2",
121
121
  "rimraf": "^3.0.2",
122
- "stylelint": "^13.13.1",
122
+ "stylelint": "^14.0.0",
123
123
  "stylelint-config-prettier": "^9.0.3",
124
- "stylelint-config-standard": "^22.0.0",
124
+ "stylelint-config-standard": "^23.0.0",
125
125
  "test-umi-plugin": "^0.1.0",
126
126
  "umi": "^3.5.20",
127
127
  "umi-plugin-custom-extra": "^1.0.12",