@teamix/pro 1.2.27 → 1.2.28

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/pro.js CHANGED
@@ -61184,12 +61184,11 @@ function useErrorAction(action, context) {
61184
61184
  var _excluded = ["type"],
61185
61185
  _excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "onClick"],
61186
61186
  _excluded3 = ["loading"],
61187
- _excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type"],
61187
+ _excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type", "className", "noArrow"],
61188
61188
  _excluded5 = ["context", "text"],
61189
- _excluded6 = ["noArrow", "className"],
61190
- _excluded7 = ["key", "actions"],
61191
- _excluded8 = ["key", "config"],
61192
- _excluded9 = ["type", "divider", "max", "moreText", "more", "context", "actions", "className"];
61189
+ _excluded6 = ["key", "actions"],
61190
+ _excluded7 = ["key", "config"],
61191
+ _excluded8 = ["type", "divider", "max", "moreText", "more", "context", "actions", "className"];
61193
61192
 
61194
61193
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
61195
61194
 
@@ -61414,6 +61413,8 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
61414
61413
  context = props.context,
61415
61414
  _props$type2 = props.type,
61416
61415
  type = _props$type2 === void 0 ? 'primary' : _props$type2,
61416
+ className = props.className,
61417
+ noArrow = props.noArrow,
61417
61418
  others = _objectWithoutPropertiesLoose(props, _excluded4);
61418
61419
 
61419
61420
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_2__.MenuButton, _extends({
@@ -61427,7 +61428,10 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
61427
61428
  v2: true
61428
61429
  },
61429
61430
  type: type,
61430
- label: buttonContent(label || children, icon, iconSize, context)
61431
+ label: buttonContent(label || children, icon, iconSize, context),
61432
+ className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, {
61433
+ 'teamix-pro-actions-text-menu-btn-no-arrow': noArrow
61434
+ })
61431
61435
  }, others), actions.map(function (action, i) {
61432
61436
  return renderCommonActionButtonMenuItem(action, action.key || i, context);
61433
61437
  }));
@@ -61489,16 +61493,12 @@ function renderCommonActionButton(button, context, isTypeText) {
61489
61493
  }
61490
61494
 
61491
61495
  function getDefaultMoreButton(type, more) {
61492
- var _cls;
61493
-
61494
- var noArrowClassName = 'teamix-pro-actions-text-menu-btn-no-arrow';
61495
61496
  var defaultConfig = type === 'button' ? {
61496
61497
  children: (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_4__.getMessage)('more')
61497
61498
  } : {
61498
61499
  icon: 'more-line',
61499
- // iconSize: 'small',
61500
61500
  autoWidth: false,
61501
- className: noArrowClassName
61501
+ noArrow: true
61502
61502
  };
61503
61503
 
61504
61504
  if (!more) {
@@ -61513,13 +61513,7 @@ function getDefaultMoreButton(type, more) {
61513
61513
  return Object.assign(defaultConfig, moreConfig);
61514
61514
  }
61515
61515
 
61516
- var noArrow = moreConfig.noArrow,
61517
- className = moreConfig.className,
61518
- others = _objectWithoutPropertiesLoose(moreConfig, _excluded6);
61519
-
61520
- return _objectSpread({
61521
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, (_cls = {}, _cls["" + noArrowClassName] = noArrow, _cls))
61522
- }, others);
61516
+ return moreConfig;
61523
61517
  }
61524
61518
 
61525
61519
  var MAX_ACTTIONS = 4;
@@ -61537,7 +61531,7 @@ function getActionConfig(action, index, context) {
61537
61531
  var _ref2 = action,
61538
61532
  _key = _ref2.key,
61539
61533
  actions = _ref2.actions,
61540
- _others = _objectWithoutPropertiesLoose(_ref2, _excluded7);
61534
+ _others = _objectWithoutPropertiesLoose(_ref2, _excluded6);
61541
61535
 
61542
61536
  return _objectSpread({
61543
61537
  key: getKey(index, _key),
@@ -61550,7 +61544,7 @@ function getActionConfig(action, index, context) {
61550
61544
  var _ref3 = action,
61551
61545
  key = _ref3.key,
61552
61546
  config = _ref3.config,
61553
- others = _objectWithoutPropertiesLoose(_ref3, _excluded8);
61547
+ others = _objectWithoutPropertiesLoose(_ref3, _excluded7);
61554
61548
 
61555
61549
  return _objectSpread({
61556
61550
  key: getKey(index, key),
@@ -61571,7 +61565,7 @@ function ProActionGroup(props) {
61571
61565
  _props$actions = props.actions,
61572
61566
  actions = _props$actions === void 0 ? [] : _props$actions,
61573
61567
  className = props.className,
61574
- containerProps = _objectWithoutPropertiesLoose(props, _excluded9);
61568
+ containerProps = _objectWithoutPropertiesLoose(props, _excluded8);
61575
61569
 
61576
61570
  var isTypeText = type === 'text';
61577
61571
  var filteredActions = actions.map(function (action, index) {
@@ -66284,7 +66278,7 @@ _teamix_icon__WEBPACK_IMPORTED_MODULE_14__/* ["default"].setConfig */ .Z.setConf
66284
66278
  // export * from './sidebar';
66285
66279
 
66286
66280
 
66287
- var version = '1.2.27';
66281
+ var version = '1.2.28';
66288
66282
 
66289
66283
 
66290
66284
  /***/ }),
@@ -71801,7 +71795,7 @@ var globalFormatSort = function globalFormatSort(sort) {
71801
71795
  };
71802
71796
 
71803
71797
  var ProTable = function ProTable(props) {
71804
- var _rowSelection$selecte;
71798
+ var _rowSelection$selecte, _dataFilterForm4;
71805
71799
 
71806
71800
  var header = props.header,
71807
71801
  className = props.className,
@@ -71946,7 +71940,7 @@ var ProTable = function ProTable(props) {
71946
71940
  var normalDataFilterForm = normalDataFilterFormRef.current;
71947
71941
  var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current; // 传给 QueryFilter 的 formRef
71948
71942
 
71949
- var dataFilterFormRef = fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
71943
+ var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
71950
71944
  var dataFilterForm = dataFilterFormRef.current; // 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
71951
71945
 
71952
71946
  var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
@@ -72121,12 +72115,12 @@ var ProTable = function ProTable(props) {
72121
72115
  _request(params);
72122
72116
  },
72123
72117
  reset: function reset() {
72124
- var _actionRef$current3, _request2;
72118
+ var _actionRef$current3, _dataFilterForm, _request2;
72125
72119
 
72126
72120
  (propsDataFilter == null ? void 0 : propsDataFilter.onReset) && (propsDataFilter == null ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
72127
72121
 
72128
72122
  (_actionRef$current3 = actionRef.current) == null ? void 0 : _actionRef$current3.setFilterRules == null ? void 0 : _actionRef$current3.setFilterRules({});
72129
- dataFilterForm == null ? void 0 : dataFilterForm.reset();
72123
+ (_dataFilterForm = dataFilterForm) == null ? void 0 : _dataFilterForm.reset();
72130
72124
  setCurrentPage(1);
72131
72125
 
72132
72126
  _request((_request2 = {}, _request2[targetPageKey] = 1, _request2));
@@ -72242,7 +72236,7 @@ var ProTable = function ProTable(props) {
72242
72236
  }); // 请求函数
72243
72237
 
72244
72238
  function _request(params, noLoading) {
72245
- var _actionRef$current$ge, _actionRef$current4, _objectSpread2;
72239
+ var _dataFilterForm2, _actionRef$current$ge, _actionRef$current4, _objectSpread2;
72246
72240
 
72247
72241
  // 如果没有传 url 且没有 customRequest,直接返回
72248
72242
  if (!url && !customRequest) {
@@ -72255,7 +72249,7 @@ var ProTable = function ProTable(props) {
72255
72249
 
72256
72250
  var sortParams = targetFormatSort(sort); // 筛选区请求参数
72257
72251
 
72258
- var dataFilterParams = toJS(dataFilterForm == null ? void 0 : dataFilterForm.values); // 列过滤请求参数
72252
+ var dataFilterParams = toJS((_dataFilterForm2 = dataFilterForm) == null ? void 0 : _dataFilterForm2.values); // 列过滤请求参数
72259
72253
 
72260
72254
  var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current4 = actionRef.current) == null ? void 0 : _actionRef$current4.getFilterRules == null ? void 0 : _actionRef$current4.getFilterRules()) != null ? _actionRef$current$ge : {}; // 格式化后的请求参数
72261
72255
 
@@ -72306,8 +72300,11 @@ var ProTable = function ProTable(props) {
72306
72300
  }
72307
72301
 
72308
72302
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
72303
+ var _dataFilterForm3;
72304
+
72309
72305
  // 初始化 actionRef state、callback 此时 actionRef 已初始化完成
72310
- (0,_utils__WEBPACK_IMPORTED_MODULE_7__/* .initActionRef */ .rf)(); // 监听 浏览器变化 更吸底状态
72306
+ (0,_utils__WEBPACK_IMPORTED_MODULE_7__/* .initActionRef */ .rf)();
72307
+ dataFilterForm = dataFilterFormRef.current; // 监听 浏览器变化 更吸底状态
72311
72308
 
72312
72309
  if (footerSuction) {
72313
72310
  getFooterSuctionState();
@@ -72317,7 +72314,7 @@ var ProTable = function ProTable(props) {
72317
72314
  };
72318
72315
  }
72319
72316
 
72320
- if (requestWhenMount) {
72317
+ if (requestWhenMount && (_dataFilterForm3 = dataFilterForm) != null && _dataFilterForm3.id) {
72321
72318
  // 在请求发送之前 处理漏斗默认数据
72322
72319
  (0,_utils__WEBPACK_IMPORTED_MODULE_7__/* .processDefaultFilter */ .aP)(propsColumns, actionRef, defaultFilterParams);
72323
72320
 
@@ -72335,7 +72332,7 @@ var ProTable = function ProTable(props) {
72335
72332
 
72336
72333
  actionRef.current = undefined;
72337
72334
  };
72338
- }, []);
72335
+ }, [(_dataFilterForm4 = dataFilterForm) == null ? void 0 : _dataFilterForm4.id]);
72339
72336
 
72340
72337
  function onSort(dataIndex, order) {
72341
72338
  var _nextSort;
@@ -72361,10 +72358,10 @@ var ProTable = function ProTable(props) {
72361
72358
  _request((_request3 = {}, _request3[targetPageKey] = 1, _request3));
72362
72359
  },
72363
72360
  onReset: function onReset() {
72364
- var _request4;
72361
+ var _dataFilterForm5, _request4;
72365
72362
 
72366
72363
  (propsDataFilter == null ? void 0 : propsDataFilter.onReset) && (propsDataFilter == null ? void 0 : propsDataFilter.onReset());
72367
- dataFilterForm == null ? void 0 : dataFilterForm.reset();
72364
+ (_dataFilterForm5 = dataFilterForm) == null ? void 0 : _dataFilterForm5.reset();
72368
72365
  setCurrentPage(1);
72369
72366
 
72370
72367
  _request((_request4 = {}, _request4[targetPageKey] = 1, _request4));