antd-management-fast-framework 1.2.39 → 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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-management-fast-framework",
3
- "version": "1.2.39",
3
+ "version": "1.2.40",
4
4
  "description": "antd-management-fast-framework",
5
5
  "keywords": [
6
6
  "antd-management-fast-framework"