@teamix/pro 1.5.38 → 1.5.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.
package/es/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
30
30
  export * from './utils';
31
31
  export * from './timeline';
32
32
  export * from './image';
33
- declare const version = "1.5.38";
33
+ declare const version = "1.5.40";
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -37,7 +37,7 @@ export * from './sidebar';
37
37
  export * from './utils';
38
38
  export * from './timeline';
39
39
  export * from './image';
40
- var version = '1.5.38';
40
+ var version = '1.5.40';
41
41
  // By TeamixTest
42
42
  window.postMessage({
43
43
  source: 'teamix-test-devtools',
@@ -130,7 +130,7 @@ var Layout = function Layout(props) {
130
130
  }
131
131
  }, [
132
132
  //todo: 重复render 问题都在这里
133
- dataFilter, mainAction, dataFilterFormRef, afterDataFilter, rowSelection, actionRef.current]);
133
+ dataFilter, mainAction, dataFilterFormRef, afterDataFilter, rowSelection, actionRef]);
134
134
  // 区域组合渲染
135
135
  var renderLayout = function renderLayout() {
136
136
  if (header && mainAction) {
@@ -174,5 +174,4 @@ var Layout = function Layout(props) {
174
174
  }
175
175
  return /*#__PURE__*/React.createElement(React.Fragment, null);
176
176
  };
177
- // export default Layout
178
177
  export default /*#__PURE__*/React.memo(Layout);
@@ -108,7 +108,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
108
108
  });
109
109
  useEffect(function () {
110
110
  var _actionRef$current2;
111
- setNewColumns(processColumns(columns, (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.filterColumns));
111
+ setNewColumns(processColumns(newColumns, (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.filterColumns));
112
112
  }, [columns, (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.filterColumns]);
113
113
  // 全选
114
114
  var onChangeAllColumns = function onChangeAllColumns(check) {
@@ -51,6 +51,7 @@ var ToolBar = function ToolBar(props) {
51
51
  var toolBar = props.toolBar,
52
52
  fullScreenState = props.fullScreenState,
53
53
  switchCardView = props.switchCardView,
54
+ actionRef = props.actionRef,
54
55
  _props$toolBarAutoWid = props.toolBarAutoWidth,
55
56
  toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid;
56
57
  var toolBarRef = useRef(null);
@@ -125,7 +126,7 @@ var ToolBar = function ToolBar(props) {
125
126
  }
126
127
  }
127
128
  return result;
128
- }, [toolBar]);
129
+ }, [toolBar, actionRef.current]);
129
130
  var renderFlatShape = useMemo(function () {
130
131
  return /*#__PURE__*/React.createElement("div", {
131
132
  className: cls('content')
package/es/table/index.js CHANGED
@@ -545,7 +545,7 @@ var ProTable = function ProTable(props) {
545
545
  }
546
546
  });
547
547
  // 绑定 Actions
548
- actionRef.current = useActionType(actionRef, {
548
+ useActionType(actionRef, {
549
549
  fullScreen: function fullScreen() {
550
550
  var _actionRef$current2, _actionRef$current2$s;
551
551
  var state = !fullscreenState;
@@ -585,7 +585,8 @@ var ProTable = function ProTable(props) {
585
585
  _request(_objectSpread(_objectSpread({}, params), {}, _defineProperty({}, targetPageKey, 1)), undefined, undefined, true);
586
586
  setShowSkeleton(true);
587
587
  } else {
588
- _request(params);
588
+ var _objectSpread3;
589
+ _request(_objectSpread(_objectSpread({}, params), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3)));
589
590
  }
590
591
  },
591
592
  request: function request(params) {
@@ -815,7 +816,7 @@ var ProTable = function ProTable(props) {
815
816
  });
816
817
  // 请求函数
817
818
  var _request = useCallback(function (params, noLoading, filterParams, isReset) {
818
- var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread3;
819
+ var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread4;
819
820
  // 首次渲染表格,获取 urlState 上的 表头 filter 数据
820
821
  if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false && dataRef.current.flag) {
821
822
  getUrlStateFilter(urlState !== null && urlState !== void 0 ? urlState : {}, actionRef);
@@ -836,7 +837,7 @@ var ProTable = function ProTable(props) {
836
837
  var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getFilterRules) === null || _actionRef$current6$g === void 0 ? void 0 : _actionRef$current6$g.call(_actionRef$current6)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
837
838
  // 格式化后的请求参数
838
839
  var requestData = {};
839
- var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3))), params);
840
+ var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread4 = {}, _defineProperty(_objectSpread4, targetPageKey, currentPage), _defineProperty(_objectSpread4, targetPageSizeKey, pageSize), _objectSpread4))), params);
840
841
  if (typeof formatParams === 'string') {
841
842
  requestData = getTargetValue(formatParams, {
842
843
  params: preParams
@@ -929,7 +930,7 @@ var ProTable = function ProTable(props) {
929
930
  getData.run(requestData);
930
931
  }
931
932
  }
932
- }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams]);
933
+ }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams, actionRef.current]);
933
934
  var onSort = useCallback(function (dataIndex, order) {
934
935
  var nextSort = _defineProperty({}, dataIndex, order);
935
936
  setSort(nextSort);
@@ -1007,9 +1008,9 @@ var ProTable = function ProTable(props) {
1007
1008
  mainAction: mainAction,
1008
1009
  extra: extra,
1009
1010
  toolBar: toolBar,
1010
- actionRef: {
1011
+ actionRef: _objectSpread(_objectSpread({}, actionRef), {}, {
1011
1012
  current: actionRef.current
1012
- },
1013
+ }),
1013
1014
  columns: propsColumns,
1014
1015
  dataFilter: dataFilter,
1015
1016
  afterDataFilter: afterDataFilter,
@@ -1092,7 +1093,7 @@ var ProTable = function ProTable(props) {
1092
1093
  } else return footerAction;
1093
1094
  };
1094
1095
  var onChangePagination = useCallback(function (currentPage) {
1095
- var _objectSpread4;
1096
+ var _objectSpread5;
1096
1097
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1097
1098
  // 翻页默认清空选择
1098
1099
  if (!reserveSelectedRecords) {
@@ -1100,7 +1101,7 @@ var ProTable = function ProTable(props) {
1100
1101
  (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
1101
1102
  }
1102
1103
  setCurrentPage(currentPage);
1103
- _request(_objectSpread((_objectSpread4 = {}, _defineProperty(_objectSpread4, targetPageKey, currentPage), _defineProperty(_objectSpread4, "pageSize", pageSize), _objectSpread4), params));
1104
+ _request(_objectSpread((_objectSpread5 = {}, _defineProperty(_objectSpread5, targetPageKey, currentPage), _defineProperty(_objectSpread5, "pageSize", pageSize), _objectSpread5), params));
1104
1105
  }, [reserveSelectedRecords, targetPageKey, actionRef, pageSize]);
1105
1106
  var onChangePaginationSize = useCallback(function (currentPageSize) {
1106
1107
  var _request10;
@@ -1112,7 +1113,7 @@ var ProTable = function ProTable(props) {
1112
1113
  setPageSize(currentPageSize);
1113
1114
  setCurrentPage(1);
1114
1115
  _request((_request10 = {}, _defineProperty(_request10, targetPageSizeKey, currentPageSize), _defineProperty(_request10, targetPageKey, 1), _request10));
1115
- }, [reserveSelectedRecords, actionRef, targetPageSizeKey, targetPageKey, currentPage]);
1116
+ }, [reserveSelectedRecords, actionRef.current, targetPageSizeKey, targetPageKey, currentPage]);
1116
1117
  var renderFooter = function renderFooter() {
1117
1118
  function renderRowSelection() {
1118
1119
  if (rowSelection) {
package/lib/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export * from './sidebar';
30
30
  export * from './utils';
31
31
  export * from './timeline';
32
32
  export * from './image';
33
- declare const version = "1.5.38";
33
+ declare const version = "1.5.40";
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, ProImage, hooks, nocode, templates, utils, };
package/lib/index.js CHANGED
@@ -299,7 +299,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
299
299
  if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
300
300
  _icon.default.setConfig(_utils.default.getTeamixIconConfig());
301
301
  }
302
- var version = '1.5.38';
302
+ var version = '1.5.40';
303
303
  // By TeamixTest
304
304
  exports.version = version;
305
305
  window.postMessage({
@@ -139,7 +139,7 @@ var Layout = function Layout(props) {
139
139
  }
140
140
  }, [
141
141
  //todo: 重复render 问题都在这里
142
- dataFilter, mainAction, dataFilterFormRef, afterDataFilter, rowSelection, actionRef.current]);
142
+ dataFilter, mainAction, dataFilterFormRef, afterDataFilter, rowSelection, actionRef]);
143
143
  // 区域组合渲染
144
144
  var renderLayout = function renderLayout() {
145
145
  if (header && mainAction) {
@@ -183,6 +183,5 @@ var Layout = function Layout(props) {
183
183
  }
184
184
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
185
185
  };
186
- // export default Layout
187
186
  var _default = /*#__PURE__*/_react.default.memo(Layout);
188
187
  exports.default = _default;
@@ -115,7 +115,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
115
115
  });
116
116
  (0, _react.useEffect)(function () {
117
117
  var _actionRef$current2;
118
- setNewColumns(processColumns(columns, (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.filterColumns));
118
+ setNewColumns(processColumns(newColumns, (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.filterColumns));
119
119
  }, [columns, (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.filterColumns]);
120
120
  // 全选
121
121
  var onChangeAllColumns = function onChangeAllColumns(check) {
@@ -61,6 +61,7 @@ var ToolBar = function ToolBar(props) {
61
61
  var toolBar = props.toolBar,
62
62
  fullScreenState = props.fullScreenState,
63
63
  switchCardView = props.switchCardView,
64
+ actionRef = props.actionRef,
64
65
  _props$toolBarAutoWid = props.toolBarAutoWidth,
65
66
  toolBarAutoWidth = _props$toolBarAutoWid === void 0 ? true : _props$toolBarAutoWid;
66
67
  var toolBarRef = (0, _react.useRef)(null);
@@ -135,7 +136,7 @@ var ToolBar = function ToolBar(props) {
135
136
  }
136
137
  }
137
138
  return result;
138
- }, [toolBar]);
139
+ }, [toolBar, actionRef.current]);
139
140
  var renderFlatShape = (0, _react.useMemo)(function () {
140
141
  return /*#__PURE__*/_react.default.createElement("div", {
141
142
  className: cls('content')
@@ -566,7 +566,7 @@ var ProTable = function ProTable(props) {
566
566
  }
567
567
  });
568
568
  // 绑定 Actions
569
- actionRef.current = (0, _utils2.useActionType)(actionRef, {
569
+ (0, _utils2.useActionType)(actionRef, {
570
570
  fullScreen: function fullScreen() {
571
571
  var _actionRef$current2, _actionRef$current2$s;
572
572
  var state = !fullscreenState;
@@ -606,7 +606,8 @@ var ProTable = function ProTable(props) {
606
606
  _request(_objectSpread(_objectSpread({}, params), {}, _defineProperty({}, targetPageKey, 1)), undefined, undefined, true);
607
607
  setShowSkeleton(true);
608
608
  } else {
609
- _request(params);
609
+ var _objectSpread3;
610
+ _request(_objectSpread(_objectSpread({}, params), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3)));
610
611
  }
611
612
  },
612
613
  request: function request(params) {
@@ -836,7 +837,7 @@ var ProTable = function ProTable(props) {
836
837
  });
837
838
  // 请求函数
838
839
  var _request = (0, _react.useCallback)(function (params, noLoading, filterParams, isReset) {
839
- var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread3;
840
+ var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current6, _actionRef$current6$g, _objectSpread4;
840
841
  // 首次渲染表格,获取 urlState 上的 表头 filter 数据
841
842
  if (bindUrl && (bindUrlProps === null || bindUrlProps === void 0 ? void 0 : bindUrlProps.headerFilters) !== false && dataRef.current.flag) {
842
843
  (0, _util.getUrlStateFilter)(urlState !== null && urlState !== void 0 ? urlState : {}, actionRef);
@@ -857,7 +858,7 @@ var ProTable = function ProTable(props) {
857
858
  var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$g = _actionRef$current6.getFilterRules) === null || _actionRef$current6$g === void 0 ? void 0 : _actionRef$current6$g.call(_actionRef$current6)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {};
858
859
  // 格式化后的请求参数
859
860
  var requestData = {};
860
- var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3))), params);
861
+ var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams), {}, (_objectSpread4 = {}, _defineProperty(_objectSpread4, targetPageKey, currentPage), _defineProperty(_objectSpread4, targetPageSizeKey, pageSize), _objectSpread4))), params);
861
862
  if (typeof formatParams === 'string') {
862
863
  requestData = (0, _utils.getTargetValue)(formatParams, {
863
864
  params: preParams
@@ -950,7 +951,7 @@ var ProTable = function ProTable(props) {
950
951
  getData.run(requestData);
951
952
  }
952
953
  }
953
- }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams]);
954
+ }, [bindUrl, bindUrlProps, dataRef, url, customRequest, currentPage, pageSize, propsParams, actionRef.current]);
954
955
  var onSort = (0, _react.useCallback)(function (dataIndex, order) {
955
956
  var nextSort = _defineProperty({}, dataIndex, order);
956
957
  setSort(nextSort);
@@ -1028,9 +1029,9 @@ var ProTable = function ProTable(props) {
1028
1029
  mainAction: mainAction,
1029
1030
  extra: extra,
1030
1031
  toolBar: toolBar,
1031
- actionRef: {
1032
+ actionRef: _objectSpread(_objectSpread({}, actionRef), {}, {
1032
1033
  current: actionRef.current
1033
- },
1034
+ }),
1034
1035
  columns: propsColumns,
1035
1036
  dataFilter: dataFilter,
1036
1037
  afterDataFilter: afterDataFilter,
@@ -1113,7 +1114,7 @@ var ProTable = function ProTable(props) {
1113
1114
  } else return footerAction;
1114
1115
  };
1115
1116
  var onChangePagination = (0, _react.useCallback)(function (currentPage) {
1116
- var _objectSpread4;
1117
+ var _objectSpread5;
1117
1118
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1118
1119
  // 翻页默认清空选择
1119
1120
  if (!reserveSelectedRecords) {
@@ -1121,7 +1122,7 @@ var ProTable = function ProTable(props) {
1121
1122
  (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
1122
1123
  }
1123
1124
  setCurrentPage(currentPage);
1124
- _request(_objectSpread((_objectSpread4 = {}, _defineProperty(_objectSpread4, targetPageKey, currentPage), _defineProperty(_objectSpread4, "pageSize", pageSize), _objectSpread4), params));
1125
+ _request(_objectSpread((_objectSpread5 = {}, _defineProperty(_objectSpread5, targetPageKey, currentPage), _defineProperty(_objectSpread5, "pageSize", pageSize), _objectSpread5), params));
1125
1126
  }, [reserveSelectedRecords, targetPageKey, actionRef, pageSize]);
1126
1127
  var onChangePaginationSize = (0, _react.useCallback)(function (currentPageSize) {
1127
1128
  var _request10;
@@ -1133,7 +1134,7 @@ var ProTable = function ProTable(props) {
1133
1134
  setPageSize(currentPageSize);
1134
1135
  setCurrentPage(1);
1135
1136
  _request((_request10 = {}, _defineProperty(_request10, targetPageSizeKey, currentPageSize), _defineProperty(_request10, targetPageKey, 1), _request10));
1136
- }, [reserveSelectedRecords, actionRef, targetPageSizeKey, targetPageKey, currentPage]);
1137
+ }, [reserveSelectedRecords, actionRef.current, targetPageSizeKey, targetPageKey, currentPage]);
1137
1138
  var renderFooter = function renderFooter() {
1138
1139
  function renderRowSelection() {
1139
1140
  if (rowSelection) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.5.38",
3
+ "version": "1.5.40",
4
4
  "description": "TeamixPro大包",
5
5
  "keywords": [
6
6
  "aliyun",