@teamix/pro 1.5.35 → 1.5.36

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.35";
33
+ declare const version = "1.5.36";
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.35';
40
+ var version = '1.5.36';
41
41
  // By TeamixTest
42
42
  window.postMessage({
43
43
  source: 'teamix-test-devtools',
@@ -190,13 +190,14 @@ var processBuriedPoint = function processBuriedPoint() {
190
190
  };
191
191
  var equalColumns = function equalColumns(prevProps, nextProps) {
192
192
  var preValue = prevProps.value;
193
- var nextValue = nextProps.value;
193
+ var nextValue = nextProps.value,
194
+ item = nextProps.item;
194
195
  // columns 强制更新参数
195
- if (nextProps === null || nextProps === void 0 ? void 0 : nextProps.forcedUpdate) {
196
+ if (item === null || item === void 0 ? void 0 : item.forcedUpdate) {
196
197
  return false;
197
198
  }
198
- // 操作列的时候强制刷新
199
- if (preValue === false && nextValue === false) {
199
+ // 操作列的时候强制刷新 || 当 value 值拿不到的时候
200
+ if (preValue === false && nextValue === false || nextValue === undefined) {
200
201
  return false;
201
202
  }
202
203
  if (preValue === nextValue) {
package/es/table/index.js CHANGED
@@ -836,7 +836,7 @@ var ProTable = function ProTable(props) {
836
836
  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
837
  // 格式化后的请求参数
838
838
  var requestData = {};
839
- var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3), dataFilterParams), propsParams), sortParams), columnsFilterParams)), params);
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
840
  if (typeof formatParams === 'string') {
841
841
  requestData = getTargetValue(formatParams, {
842
842
  params: preParams
@@ -949,7 +949,7 @@ var ProTable = function ProTable(props) {
949
949
  return true;
950
950
  } : undefined,
951
951
  onFilter: function onFilter(values) {
952
- var _actionRef$current7, _actionRef$current7$c;
952
+ var _actionRef$current7, _actionRef$current7$c, _request8;
953
953
  // 全屏状态,判断全屏表单onFilter是否禁用
954
954
  if (fullscreenState && !filterEnableRef.current.fullscreen) {
955
955
  filterEnableRef.current.fullscreen = true;
@@ -970,17 +970,17 @@ var ProTable = function ProTable(props) {
970
970
  // 搜索变化时,暂时先清空选择
971
971
  (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
972
972
  setCurrentPage(1);
973
- _request(_defineProperty({}, targetPageKey, 1), false, values);
973
+ _request((_request8 = {}, _defineProperty(_request8, targetPageKey, 1), _defineProperty(_request8, targetPageSizeKey, pageSize), _request8), false, values);
974
974
  },
975
975
  onReset: function onReset(values) {
976
- var _dataFilterFormRef$cu3;
976
+ var _dataFilterFormRef$cu3, _request9;
977
977
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
978
978
  (_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
979
979
  setCurrentPage(1);
980
- _request(_defineProperty({}, targetPageKey, 1), false, values);
980
+ _request((_request9 = {}, _defineProperty(_request9, targetPageKey, 1), _defineProperty(_request9, targetPageSizeKey, pageSize), _request9), false, values);
981
981
  }
982
982
  });
983
- }, [propsDataFilter, fullscreenState, filterEnableRef, actionRef]);
983
+ }, [propsDataFilter, fullscreenState, filterEnableRef, actionRef, pageSize]);
984
984
  var isLoading = useMemo(function () {
985
985
  if (!customRequest) {
986
986
  return showLoading && !showSkeleton && (getData.loading || props.loading);
@@ -24,6 +24,8 @@ declare type TDataService = {
24
24
  };
25
25
  export declare type responsivePaginationType = 'mini' | 'small' | 'simple' | 'normal';
26
26
  export declare type ProTableColumnProps = {
27
+ /** 是否强制刷新 */
28
+ forcedUpdate?: boolean;
27
29
  /** 是否开启了自动计算宽度 */
28
30
  isAutoWidth?: boolean;
29
31
  /** 自动计算宽度时的被挤占的情况 */
@@ -9,5 +9,5 @@ declare type FixedColumnProps = ColumnProps & {
9
9
  */
10
10
  export default function genProColumnToColumn(columns: ProTableColumnProps[],
11
11
  /** 是否渲染骨架屏 */
12
- showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps'], forcedUpdate?: boolean): FixedColumnProps[];
12
+ showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps']): FixedColumnProps[];
13
13
  export {};
@@ -21,9 +21,6 @@ showSkeleton, actionRef) {
21
21
  dataTeamixSpm = arguments.length > 4 ? arguments[4] : undefined;
22
22
  var bindUrl = arguments.length > 5 ? arguments[5] : undefined;
23
23
  var bindUrlProps = arguments.length > 6 ? arguments[6] : undefined;
24
- var
25
- // 是否强制刷新
26
- forcedUpdate = arguments.length > 7 ? arguments[7] : undefined;
27
24
  return columns.map(function (columnProps) {
28
25
  var filters = columnProps.filters,
29
26
  dataIndex = columnProps.dataIndex,
@@ -72,8 +69,7 @@ showSkeleton, actionRef) {
72
69
  record: record,
73
70
  actionRef: actionRef,
74
71
  context: context,
75
- dataTeamixSpm: dataTeamixSpm,
76
- forcedUpdate: forcedUpdate
72
+ dataTeamixSpm: dataTeamixSpm
77
73
  });
78
74
  // return renderCell(
79
75
  // value,
@@ -94,6 +94,9 @@ function useTableSelection() {
94
94
  // console.log('propResult', propResult, selectedRowKeys);
95
95
  var resultProps = _objectSpread(_objectSpread({}, record), propResult);
96
96
  var primaryKey = record === null || record === void 0 ? void 0 : record[resultProps === null || resultProps === void 0 ? void 0 : resultProps['_primaryKey']];
97
+ if ((config === null || config === void 0 ? void 0 : config.mode) === 'single') {
98
+ return resultProps;
99
+ }
97
100
  return _objectSpread(_objectSpread({}, resultProps), {}, {
98
101
  isPreview: true,
99
102
  renderPreview: function renderPreview() {
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.35";
33
+ declare const version = "1.5.36";
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.35';
302
+ var version = '1.5.36';
303
303
  // By TeamixTest
304
304
  exports.version = version;
305
305
  window.postMessage({
@@ -194,13 +194,14 @@ var processBuriedPoint = function processBuriedPoint() {
194
194
  };
195
195
  var equalColumns = function equalColumns(prevProps, nextProps) {
196
196
  var preValue = prevProps.value;
197
- var nextValue = nextProps.value;
197
+ var nextValue = nextProps.value,
198
+ item = nextProps.item;
198
199
  // columns 强制更新参数
199
- if (nextProps === null || nextProps === void 0 ? void 0 : nextProps.forcedUpdate) {
200
+ if (item === null || item === void 0 ? void 0 : item.forcedUpdate) {
200
201
  return false;
201
202
  }
202
- // 操作列的时候强制刷新
203
- if (preValue === false && nextValue === false) {
203
+ // 操作列的时候强制刷新 || 当 value 值拿不到的时候
204
+ if (preValue === false && nextValue === false || nextValue === undefined) {
204
205
  return false;
205
206
  }
206
207
  if (preValue === nextValue) {
@@ -857,7 +857,7 @@ var ProTable = function ProTable(props) {
857
857
  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
858
  // 格式化后的请求参数
859
859
  var requestData = {};
860
- var preParams = _objectSpread(_objectSpread({}, !showPagination ? _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, dataFilterParams), propsParams), sortParams), columnsFilterParams) : _objectSpread(_objectSpread(_objectSpread(_objectSpread((_objectSpread3 = {}, _defineProperty(_objectSpread3, targetPageKey, currentPage), _defineProperty(_objectSpread3, targetPageSizeKey, pageSize), _objectSpread3), dataFilterParams), propsParams), sortParams), columnsFilterParams)), params);
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
861
  if (typeof formatParams === 'string') {
862
862
  requestData = (0, _utils.getTargetValue)(formatParams, {
863
863
  params: preParams
@@ -970,7 +970,7 @@ var ProTable = function ProTable(props) {
970
970
  return true;
971
971
  } : undefined,
972
972
  onFilter: function onFilter(values) {
973
- var _actionRef$current7, _actionRef$current7$c;
973
+ var _actionRef$current7, _actionRef$current7$c, _request8;
974
974
  // 全屏状态,判断全屏表单onFilter是否禁用
975
975
  if (fullscreenState && !filterEnableRef.current.fullscreen) {
976
976
  filterEnableRef.current.fullscreen = true;
@@ -991,17 +991,17 @@ var ProTable = function ProTable(props) {
991
991
  // 搜索变化时,暂时先清空选择
992
992
  (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
993
993
  setCurrentPage(1);
994
- _request(_defineProperty({}, targetPageKey, 1), false, values);
994
+ _request((_request8 = {}, _defineProperty(_request8, targetPageKey, 1), _defineProperty(_request8, targetPageSizeKey, pageSize), _request8), false, values);
995
995
  },
996
996
  onReset: function onReset(values) {
997
- var _dataFilterFormRef$cu3;
997
+ var _dataFilterFormRef$cu3, _request9;
998
998
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
999
999
  (_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
1000
1000
  setCurrentPage(1);
1001
- _request(_defineProperty({}, targetPageKey, 1), false, values);
1001
+ _request((_request9 = {}, _defineProperty(_request9, targetPageKey, 1), _defineProperty(_request9, targetPageSizeKey, pageSize), _request9), false, values);
1002
1002
  }
1003
1003
  });
1004
- }, [propsDataFilter, fullscreenState, filterEnableRef, actionRef]);
1004
+ }, [propsDataFilter, fullscreenState, filterEnableRef, actionRef, pageSize]);
1005
1005
  var isLoading = (0, _react.useMemo)(function () {
1006
1006
  if (!customRequest) {
1007
1007
  return showLoading && !showSkeleton && (getData.loading || props.loading);
@@ -24,6 +24,8 @@ declare type TDataService = {
24
24
  };
25
25
  export declare type responsivePaginationType = 'mini' | 'small' | 'simple' | 'normal';
26
26
  export declare type ProTableColumnProps = {
27
+ /** 是否强制刷新 */
28
+ forcedUpdate?: boolean;
27
29
  /** 是否开启了自动计算宽度 */
28
30
  isAutoWidth?: boolean;
29
31
  /** 自动计算宽度时的被挤占的情况 */
@@ -9,5 +9,5 @@ declare type FixedColumnProps = ColumnProps & {
9
9
  */
10
10
  export default function genProColumnToColumn(columns: ProTableColumnProps[],
11
11
  /** 是否渲染骨架屏 */
12
- showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps'], forcedUpdate?: boolean): FixedColumnProps[];
12
+ showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any, dataTeamixSpm?: string, bindUrl?: ProTableProps['bindUrl'], bindUrlProps?: ProTableProps['bindUrlProps']): FixedColumnProps[];
13
13
  export {};
@@ -28,9 +28,6 @@ showSkeleton, actionRef) {
28
28
  dataTeamixSpm = arguments.length > 4 ? arguments[4] : undefined;
29
29
  var bindUrl = arguments.length > 5 ? arguments[5] : undefined;
30
30
  var bindUrlProps = arguments.length > 6 ? arguments[6] : undefined;
31
- var
32
- // 是否强制刷新
33
- forcedUpdate = arguments.length > 7 ? arguments[7] : undefined;
34
31
  return columns.map(function (columnProps) {
35
32
  var filters = columnProps.filters,
36
33
  dataIndex = columnProps.dataIndex,
@@ -79,8 +76,7 @@ showSkeleton, actionRef) {
79
76
  record: record,
80
77
  actionRef: actionRef,
81
78
  context: context,
82
- dataTeamixSpm: dataTeamixSpm,
83
- forcedUpdate: forcedUpdate
79
+ dataTeamixSpm: dataTeamixSpm
84
80
  });
85
81
  // return renderCell(
86
82
  // value,
@@ -99,6 +99,9 @@ function useTableSelection() {
99
99
  // console.log('propResult', propResult, selectedRowKeys);
100
100
  var resultProps = _objectSpread(_objectSpread({}, record), propResult);
101
101
  var primaryKey = record === null || record === void 0 ? void 0 : record[resultProps === null || resultProps === void 0 ? void 0 : resultProps['_primaryKey']];
102
+ if ((config === null || config === void 0 ? void 0 : config.mode) === 'single') {
103
+ return resultProps;
104
+ }
102
105
  return _objectSpread(_objectSpread({}, resultProps), {}, {
103
106
  isPreview: true,
104
107
  renderPreview: function renderPreview() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.5.35",
3
+ "version": "1.5.36",
4
4
  "description": "TeamixPro大包",
5
5
  "keywords": [
6
6
  "aliyun",