@teamix/pro 1.5.39 → 1.5.41

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
@@ -82596,6 +82596,9 @@ var MenuSelect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forwa
82596
82596
  }
82597
82597
  if (value.length === allKey.length) {
82598
82598
  setCheckboxChecked(true);
82599
+ } else {
82600
+ //对于异步请求的数据,dataSource变化时需要重新判断
82601
+ setCheckboxChecked(false);
82599
82602
  }
82600
82603
  }, [value, dataSource]);
82601
82604
  // 获取瀑布流列数
@@ -112962,7 +112965,7 @@ if (!((_window = window) != null && _window.TEAMIXPRO_WITHOUT_ICON)) {
112962
112965
 
112963
112966
 
112964
112967
 
112965
- var version = '1.5.39';
112968
+ var version = '1.5.41';
112966
112969
 
112967
112970
  // By TeamixTest
112968
112971
  window.postMessage({
@@ -116552,7 +116555,7 @@ function renderTreeNode(data) {
116552
116555
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_alicloudfe_components__WEBPACK_IMPORTED_MODULE_0__.Tree.Node, _extends({
116553
116556
  key: item.value,
116554
116557
  label: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default().createElement(ProSideBarTreeNode, labelProps)
116555
- }, nodeProps), item.children && item.children.length > 0 && renderTreeNode(item.children));
116558
+ }, nodeProps), (item == null ? void 0 : item.children) && item.children.length > 0 && renderTreeNode(item.children));
116556
116559
  });
116557
116560
  }
116558
116561
 
@@ -116847,7 +116850,7 @@ var ProSidebarTree = function ProSidebarTree(props) {
116847
116850
  if (extra != null && (_extra$event = extra.event) != null && (_extra$event$target = _extra$event.target) != null && _extra$event$target.closest != null && _extra$event$target.closest('.teamix-pro-sidebar-delete-overlay')) {
116848
116851
  return;
116849
116852
  }
116850
- if (!selectedKeys) {
116853
+ if (!selectedKeysProp) {
116851
116854
  setSelectedKeys(value);
116852
116855
  }
116853
116856
  onSelect == null ? void 0 : onSelect(value, extra);
@@ -116866,6 +116869,12 @@ var ProSidebarTree = function ProSidebarTree(props) {
116866
116869
  setExpandedKeys(key);
116867
116870
  setAutoExpandParent(false);
116868
116871
  };
116872
+ var renderTreeNodeGroup = function renderTreeNodeGroup() {
116873
+ if (onBeforeRenderNodeEvent) {
116874
+ return (0,_tree_node__WEBPACK_IMPORTED_MODULE_3__/* .renderTreeNodeDependenceValue */ .S1)(dataSource, onBeforeRenderNodeEvent, checkedKeys, selectedKeys);
116875
+ }
116876
+ return (0,_tree_node__WEBPACK_IMPORTED_MODULE_3__/* .renderTreeNode */ .uT)(dataSource);
116877
+ };
116869
116878
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", {
116870
116879
  className: cls({
116871
116880
  '': true,
@@ -116885,7 +116894,7 @@ var ProSidebarTree = function ProSidebarTree(props) {
116885
116894
  className: cls({
116886
116895
  checkable: others.checkable
116887
116896
  }) + " " + className
116888
- }, others), !onBeforeRenderNodeEvent && (0,_tree_node__WEBPACK_IMPORTED_MODULE_3__/* .renderTreeNode */ .uT)(dataSource), onBeforeRenderNodeEvent && (0,_tree_node__WEBPACK_IMPORTED_MODULE_3__/* .renderTreeNodeDependenceValue */ .S1)(dataSource, onBeforeRenderNodeEvent, checkedKeys, selectedKeys)));
116897
+ }, others), renderTreeNodeGroup()));
116889
116898
  };
116890
116899
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProSidebarTree);
116891
116900
 
@@ -118041,7 +118050,7 @@ var equalColumns = function equalColumns(prevProps, nextProps) {
118041
118050
  }
118042
118051
 
118043
118052
  // 操作列的时候强制刷新 || 当 value 值拿不到的时候
118044
- if (preValue === false && nextValue === false || nextValue === undefined) {
118053
+ if (preValue === false || nextValue === false || preValue === undefined || nextValue === undefined) {
118045
118054
  return false;
118046
118055
  }
118047
118056
 
@@ -118052,19 +118061,6 @@ var equalColumns = function equalColumns(prevProps, nextProps) {
118052
118061
  if (preValue === nextValue) {
118053
118062
  return true;
118054
118063
  }
118055
-
118056
- // 针对 value 是数组类型的判断 value 是否和原来相等,相等则不渲染
118057
- if (Array.isArray(nextValue) && Array.isArray(preValue)) {
118058
- var nextValueStr = nextValue.map(function (item) {
118059
- return item.TagValue;
118060
- });
118061
- var preValueStr = preValue.map(function (item) {
118062
- return item.TagValue;
118063
- });
118064
- if (nextValueStr.toString() === preValueStr.toString()) {
118065
- return true;
118066
- }
118067
- }
118068
118064
  return false;
118069
118065
  };
118070
118066
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(Cell, equalColumns));
@@ -118487,7 +118483,7 @@ var Layout = function Layout(props) {
118487
118483
  // todo: 有问题
118488
118484
  mainAction,
118489
118485
  // todo: 有问题
118490
- dataFilterFormRef, afterDataFilter, rowSelection]);
118486
+ dataFilterFormRef, afterDataFilter, rowSelection, actionRef]);
118491
118487
 
118492
118488
  // 区域组合渲染
118493
118489
  var renderLayout = function renderLayout() {
@@ -119285,7 +119281,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
119285
119281
  });
119286
119282
  (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {
119287
119283
  var _actionRef$current2;
119288
- setNewColumns(processColumns(columns, (_actionRef$current2 = actionRef.current) == null ? void 0 : _actionRef$current2.filterColumns));
119284
+ setNewColumns(processColumns(newColumns, (_actionRef$current2 = actionRef.current) == null ? void 0 : _actionRef$current2.filterColumns));
119289
119285
  }, [columns, (_actionRef$current3 = actionRef.current) == null ? void 0 : _actionRef$current3.filterColumns]);
119290
119286
 
119291
119287
  // 全选
@@ -119303,7 +119299,11 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
119303
119299
  // 重置
119304
119300
  var restColumns = function restColumns(e) {
119305
119301
  e.stopPropagation();
119306
- var keyNewColumns = processColumns(columns);
119302
+ var keyNewColumns = processColumns(columns).map(function (item) {
119303
+ return _extends({}, item, {
119304
+ columnFilters: (item == null ? void 0 : item.columnFilters) === undefined ? true : item == null ? void 0 : item.columnFilters
119305
+ });
119306
+ });
119307
119307
  notifyTableRender(keyNewColumns);
119308
119308
  };
119309
119309
 
@@ -119985,6 +119985,7 @@ var ToolBar = function ToolBar(props) {
119985
119985
  var toolBar = props.toolBar,
119986
119986
  fullScreenState = props.fullScreenState,
119987
119987
  switchCardView = props.switchCardView,
119988
+ actionRef = props.actionRef,
119988
119989
  _props$toolBarAutoWid = props.toolBarAutoWidth,
119989
119990
  toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid;
119990
119991
  var toolBarRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
@@ -120060,7 +120061,7 @@ var ToolBar = function ToolBar(props) {
120060
120061
  }
120061
120062
  }
120062
120063
  return result;
120063
- }, [toolBar]);
120064
+ }, [toolBar, actionRef.current]);
120064
120065
  var renderFlatShape = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function () {
120065
120066
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
120066
120067
  className: cls('content')
@@ -120689,7 +120690,7 @@ var ProTable = function ProTable(props) {
120689
120690
  });
120690
120691
 
120691
120692
  // 绑定 Actions
120692
- actionRef.current = (0,_utils__WEBPACK_IMPORTED_MODULE_7__/* .useActionType */ .tx)(actionRef, {
120693
+ (0,_utils__WEBPACK_IMPORTED_MODULE_7__/* .useActionType */ .tx)(actionRef, {
120693
120694
  fullScreen: function fullScreen() {
120694
120695
  var _actionRef$current2;
120695
120696
  var state = !fullscreenState;
@@ -120732,7 +120733,8 @@ var ProTable = function ProTable(props) {
120732
120733
  _request(_extends({}, params, (_extends2 = {}, _extends2[targetPageKey] = 1, _extends2)), undefined, undefined, true);
120733
120734
  setShowSkeleton(true);
120734
120735
  } else {
120735
- _request(params);
120736
+ var _extends3;
120737
+ _request(_extends({}, params, (_extends3 = {}, _extends3[targetPageKey] = currentPage, _extends3[targetPageSizeKey] = pageSize, _extends3)));
120736
120738
  }
120737
120739
  },
120738
120740
  request: function request(params) {
@@ -120968,8 +120970,8 @@ var ProTable = function ProTable(props) {
120968
120970
  });
120969
120971
 
120970
120972
  // 请求函数
120971
- var _request = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (params, noLoading, filterParams, isReset) {
120972
- var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current7, _actionRef$current7$p, _actionRef$current8, _actionRef$current8$p, _extends3;
120973
+ var _request = function _request(params, noLoading, filterParams, isReset) {
120974
+ var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _extends4;
120973
120975
  // 首次渲染表格,获取 urlState 上的 表头 filter 数据
120974
120976
  if (bindUrl && (bindUrlProps == null ? void 0 : bindUrlProps.headerFilters) !== false && dataRef.current.flag) {
120975
120977
  (0,_utils_util__WEBPACK_IMPORTED_MODULE_18__/* .getUrlStateFilter */ .a)(urlState != null ? urlState : {}, actionRef);
@@ -120992,7 +120994,7 @@ var ProTable = function ProTable(props) {
120992
120994
 
120993
120995
  // 格式化后的请求参数
120994
120996
  var requestData = {};
120995
- var preParams = _extends({}, !showPagination ? _extends({}, dataFilterParams, propsParams, sortParams, columnsFilterParams) : _extends({}, dataFilterParams, propsParams, sortParams, columnsFilterParams, (_extends3 = {}, _extends3[targetPageKey] = (actionRef == null ? void 0 : (_actionRef$current7 = actionRef.current) == null ? void 0 : (_actionRef$current7$p = _actionRef$current7.pageInfo) == null ? void 0 : _actionRef$current7$p.current) || currentPage, _extends3[targetPageSizeKey] = (actionRef == null ? void 0 : (_actionRef$current8 = actionRef.current) == null ? void 0 : (_actionRef$current8$p = _actionRef$current8.pageInfo) == null ? void 0 : _actionRef$current8$p.pageSize) || pageSize, _extends3)), params);
120997
+ var preParams = _extends({}, !showPagination ? _extends({}, dataFilterParams, propsParams, sortParams, columnsFilterParams) : _extends({}, dataFilterParams, propsParams, sortParams, columnsFilterParams, (_extends4 = {}, _extends4[targetPageKey] = currentPage, _extends4[targetPageSizeKey] = pageSize, _extends4)), params);
120996
120998
  if (typeof formatParams === 'string') {
120997
120999
  requestData = (0,_teamix_utils__WEBPACK_IMPORTED_MODULE_5__.getTargetValue)(formatParams, {
120998
121000
  params: preParams
@@ -121089,14 +121091,13 @@ var ProTable = function ProTable(props) {
121089
121091
  getData.run(requestData);
121090
121092
  }
121091
121093
  }
121092
- }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams, actionRef.current]);
121093
- var onSort = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (dataIndex, order) {
121094
+ };
121095
+ var onSort = function onSort(dataIndex, order) {
121094
121096
  var _nextSort;
121095
121097
  var nextSort = (_nextSort = {}, _nextSort[dataIndex] = order, _nextSort);
121096
121098
  setSort(nextSort);
121097
121099
  _request(targetFormatSort(nextSort));
121098
- }, [_request, targetFormatSort]);
121099
-
121100
+ };
121100
121101
  // 处理 dataFilter 中的 onFilter、onReset
121101
121102
  var dataFilter = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
121102
121103
  return _extends({
@@ -121110,7 +121111,7 @@ var ProTable = function ProTable(props) {
121110
121111
  return true;
121111
121112
  } : undefined,
121112
121113
  onFilter: function onFilter(values) {
121113
- var _actionRef$current9, _request8;
121114
+ var _actionRef$current7, _request8;
121114
121115
  // 全屏状态,判断全屏表单onFilter是否禁用
121115
121116
  if (fullscreenState && !filterEnableRef.current.fullscreen) {
121116
121117
  filterEnableRef.current.fullscreen = true;
@@ -121129,7 +121130,7 @@ var ProTable = function ProTable(props) {
121129
121130
  }
121130
121131
  }
121131
121132
  // 搜索变化时,暂时先清空选择
121132
- (_actionRef$current9 = actionRef.current) == null ? void 0 : _actionRef$current9.clearRowSelection == null ? void 0 : _actionRef$current9.clearRowSelection();
121133
+ (_actionRef$current7 = actionRef.current) == null ? void 0 : _actionRef$current7.clearRowSelection == null ? void 0 : _actionRef$current7.clearRowSelection();
121133
121134
  setCurrentPage(1);
121134
121135
  _request((_request8 = {}, _request8[targetPageKey] = 1, _request8[targetPageSizeKey] = pageSize, _request8), false, values);
121135
121136
  },
@@ -121168,9 +121169,9 @@ var ProTable = function ProTable(props) {
121168
121169
  mainAction: mainAction,
121169
121170
  extra: extra,
121170
121171
  toolBar: toolBar,
121171
- actionRef: {
121172
+ actionRef: _extends({}, actionRef, {
121172
121173
  current: actionRef.current
121173
- },
121174
+ }),
121174
121175
  columns: propsColumns,
121175
121176
  dataFilter: dataFilter,
121176
121177
  afterDataFilter: afterDataFilter,
@@ -121253,30 +121254,30 @@ var ProTable = function ProTable(props) {
121253
121254
  })));
121254
121255
  } else return footerAction;
121255
121256
  };
121256
- var onChangePagination = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (currentPage, params) {
121257
- var _extends4;
121257
+ var onChangePagination = function onChangePagination(currentPage, params) {
121258
+ var _extends5;
121258
121259
  if (params === void 0) {
121259
121260
  params = {};
121260
121261
  }
121261
121262
  // 翻页默认清空选择
121262
121263
  if (!reserveSelectedRecords) {
121263
- var _actionRef$current10;
121264
- (_actionRef$current10 = actionRef.current) == null ? void 0 : _actionRef$current10.clearRowSelection == null ? void 0 : _actionRef$current10.clearRowSelection();
121264
+ var _actionRef$current8;
121265
+ (_actionRef$current8 = actionRef.current) == null ? void 0 : _actionRef$current8.clearRowSelection == null ? void 0 : _actionRef$current8.clearRowSelection();
121265
121266
  }
121266
121267
  setCurrentPage(currentPage);
121267
- _request(_extends((_extends4 = {}, _extends4[targetPageKey] = currentPage, _extends4.pageSize = pageSize, _extends4), params));
121268
- }, [reserveSelectedRecords, targetPageKey, actionRef, pageSize]);
121269
- var onChangePaginationSize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (currentPageSize) {
121268
+ _request(_extends((_extends5 = {}, _extends5[targetPageKey] = currentPage, _extends5.pageSize = pageSize, _extends5), params));
121269
+ };
121270
+ var onChangePaginationSize = function onChangePaginationSize(currentPageSize) {
121270
121271
  var _request10;
121271
121272
  // 翻页默认清空选择
121272
121273
  if (!reserveSelectedRecords) {
121273
- var _actionRef$current11;
121274
- (_actionRef$current11 = actionRef.current) == null ? void 0 : _actionRef$current11.clearRowSelection == null ? void 0 : _actionRef$current11.clearRowSelection();
121274
+ var _actionRef$current9;
121275
+ (_actionRef$current9 = actionRef.current) == null ? void 0 : _actionRef$current9.clearRowSelection == null ? void 0 : _actionRef$current9.clearRowSelection();
121275
121276
  }
121276
121277
  setPageSize(currentPageSize);
121277
121278
  setCurrentPage(1);
121278
121279
  _request((_request10 = {}, _request10[targetPageSizeKey] = currentPageSize, _request10[targetPageKey] = 1, _request10));
121279
- }, [reserveSelectedRecords, actionRef.current, targetPageSizeKey, targetPageKey, currentPage]);
121280
+ };
121280
121281
  var renderFooter = function renderFooter() {
121281
121282
  function renderRowSelection() {
121282
121283
  if (rowSelection) {