@teamix/pro 1.5.26-beta-3 → 1.5.26-beta-5

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.26-beta-2";
33
+ declare const version = "1.5.26-beta-5";
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,8 @@ export * from './sidebar';
37
37
  export * from './utils';
38
38
  export * from './timeline';
39
39
  export * from './image';
40
- var version = '1.5.26-beta-2';
40
+ var version = '1.5.26-beta-5';
41
+ console.log('Pro版本', version);
41
42
  // By TeamixTest
42
43
  window.postMessage({
43
44
  source: 'teamix-test-devtools',
@@ -48,14 +49,6 @@ window.postMessage({
48
49
  moduleType: 'TeamixPro',
49
50
  componentName: 'TeamixPro'
50
51
  }, '*');
51
- // window.TeamixMaterial = {
52
- // ...window.TeamixMaterial,
53
- // ProTable: ProTable
54
- // }
55
- // window.TeamixPro = {
56
- // ...window.TeamixPro,
57
- // ProTable: ProTable
58
- // }
59
52
  // console.log('TeamixPro')
60
53
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo,
61
54
  // ProLayout,
@@ -186,6 +186,24 @@ var processBuriedPoint = function processBuriedPoint() {
186
186
  }))];
187
187
  }))));
188
188
  };
189
- export default /*#__PURE__*/React.memo(Cell, function () {
190
- return true;
191
- });
189
+ var equalColumns = function equalColumns(prevProps, nextProps) {
190
+ var preValue = prevProps.value;
191
+ var nextValue = nextProps.value;
192
+ if (preValue === nextValue) {
193
+ return true;
194
+ }
195
+ // 针对 value 是数组类型的判断 value 是否和原来相等,相等则不渲染
196
+ if (Array.isArray(nextValue) && Array.isArray(preValue)) {
197
+ var nextValueStr = nextValue.map(function (item) {
198
+ return item.TagValue;
199
+ });
200
+ var preValueStr = preValue.map(function (item) {
201
+ return item.TagValue;
202
+ });
203
+ if (nextValueStr.toString() === preValueStr.toString()) {
204
+ return true;
205
+ }
206
+ }
207
+ return false;
208
+ };
209
+ export default /*#__PURE__*/React.memo(Cell, equalColumns);
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
1
  import { EmptyContentProps } from '@teamix/pro-field';
3
2
  import { TableProps } from '@alicloudfe/components/types/table';
4
3
  export interface ITableContentProps extends TableProps {
5
4
  emptyProps?: EmptyContentProps;
6
5
  }
7
- declare const _default: React.MemoExoticComponent<(props: ITableContentProps) => JSX.Element>;
8
- export default _default;
6
+ declare const TableContent: (props: ITableContentProps) => JSX.Element;
7
+ export default TableContent;
@@ -20,4 +20,4 @@ var TableContent = function TableContent(props) {
20
20
  emptyContent: memorizedEmptyContent
21
21
  }, rest));
22
22
  };
23
- export default /*#__PURE__*/React.memo(TableContent);
23
+ export default TableContent;
package/es/table/index.js CHANGED
@@ -53,7 +53,6 @@ var globalFormatSort = function globalFormatSort(sort) {
53
53
  };
54
54
  var ProTable = function ProTable(props) {
55
55
  var _urlState$currentPage, _rowSelection$selecte;
56
- console.log('ProTable 代理成功');
57
56
  var header = props.header,
58
57
  className = props.className,
59
58
  tableClassName = props.tableClassName,
@@ -714,7 +713,9 @@ var ProTable = function ProTable(props) {
714
713
  if (Number.isInteger(time) && time >= 1000) {
715
714
  autoRefreshTimerRef.current = setTimeout(function () {
716
715
  // 自动刷新不显示 loading
717
- _request({}, true);
716
+ // 当表格自适应时,自动刷新要显示 loading ,否则表格自适应会出问题
717
+ // setShowLoading(true)
718
+ _request({}, !autoWidth);
718
719
  }, Number(time));
719
720
  emit('PRO_TABLE_REFRESH_TIMER_FLAG', Number(time));
720
721
  }
@@ -903,7 +904,7 @@ var ProTable = function ProTable(props) {
903
904
  if (Number.isInteger(time) && time >= 1000) {
904
905
  autoRefreshTimerRef.current = setTimeout(function () {
905
906
  // 自动刷新不显示 loading
906
- _request(params, true);
907
+ _request(params, !autoWidth);
907
908
  }, Number(time));
908
909
  emit('PRO_TABLE_REFRESH_TIMER_FLAG', Number(time));
909
910
  }
@@ -968,10 +969,9 @@ var ProTable = function ProTable(props) {
968
969
  }
969
970
  }, [customRequest, showLoading, showSkeleton, customTableLoading, props.loading, getData]);
970
971
  var memorizedGenProColumnToColumn = useMemo(function () {
971
- return genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps);
972
- }, [
973
- // filteredColumns,
974
- showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps]);
972
+ var result = genProColumnToColumn(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps);
973
+ return result;
974
+ }, [filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps]);
975
975
  var renderTable = function renderTable(isFullScreen) {
976
976
  if (propsColumns) {
977
977
  return /*#__PURE__*/React.createElement("div", {
@@ -103,7 +103,7 @@ $fullscreenPadding: 24px;
103
103
  pointer-events: none;
104
104
  display: flex;
105
105
  }
106
-
106
+
107
107
  // sort icon
108
108
  .next-table-sort.next-table-header-icon {
109
109
  line-height: 16px;
@@ -54,7 +54,7 @@ export function genAutoWidthColumns(fileteredColumns, ref, data, size, useRowSel
54
54
  var shrink = fieldTypeShrink[finalType];
55
55
  column.shrink = column.shrink || (shrink !== undefined ? shrink : 1);
56
56
  if (column.isAutoWidth === true) {
57
- console.log(column.title, 'isAutoWidth');
57
+ // console.log(column.title, 'isAutoWidth')
58
58
  finalColumns.push(column);
59
59
  return;
60
60
  }
@@ -105,6 +105,7 @@ export function genAutoWidthColumns(fileteredColumns, ref, data, size, useRowSel
105
105
  // fixedWidthTypeList[finalType],
106
106
  // );
107
107
  // 固定宽度
108
+ // console.log(column.title, '固定宽度')
108
109
  column.isAutoWidth = true;
109
110
  column.width = defaultPaddingFixer(
110
111
  // @ts-ignore
@@ -112,17 +113,19 @@ export function genAutoWidthColumns(fileteredColumns, ref, data, size, useRowSel
112
113
  // @ts-ignore
113
114
  } else if (computeableWidthTypeList[finalType]) {
114
115
  // 可计算宽度
116
+ // console.log(column.title, '可计算宽度')
115
117
  column.isAutoWidth = true;
116
118
  column.width = defaultPaddingFixer(
117
119
  // @ts-ignore
118
120
  Math.max(titleWidth, computeableWidthTypeList[finalType](data, render)), size, index === 0 && useRowSelection);
119
121
  } else {
120
122
  // 直接根据 dom 计算
123
+ // console.log(column.title, '可计算 dom')
121
124
  column.isAutoWidth = true;
122
125
  column.width = defaultPaddingFixer(Math.max(titleWidth,
123
126
  // @ts-ignore
124
127
  calcWidthWithParentDOM(childNodes[index], column.shrink)), size, index === 0 && useRowSelection);
125
- if ((column === null || column === void 0 ? void 0 : column.sortable) && (column === null || column === void 0 ? void 0 : column.tooltip)) {
128
+ if ((column === null || column === void 0 ? void 0 : column.sortable) && ((column === null || column === void 0 ? void 0 : column.tooltip) || (column === null || column === void 0 ? void 0 : column.filters))) {
126
129
  // 检测有 sortable 和 tooltip 的时候增加宽度
127
130
  column.width = column.width + 40;
128
131
  }
@@ -162,8 +165,12 @@ export var shadowContainer = function shadowContainer(props) {
162
165
  //@ts-ignore
163
166
  !fixedWidthTypeList[valueType] && data.map(function (item, index) {
164
167
  // @ts-ignore
165
- column.smartWidth = renderCellSmartWidth(getValueFromRecord(dataIndex, item), column, index, item);
166
- return renderCell(getValueFromRecord(dataIndex, item), column, index, item);
168
+ var newColumn = _.cloneDeep(column);
169
+ newColumn.smartWidth = renderCellSmartWidth(getValueFromRecord(dataIndex, item), column, index, item);
170
+ newColumn.render = _objectSpread(_objectSpread({}, column.render), {}, {
171
+ description: ''
172
+ });
173
+ return renderCell(getValueFromRecord(dataIndex, item), newColumn, index, item);
167
174
  }));
168
175
  }
169
176
  }));
@@ -326,7 +333,8 @@ function defaultPaddingFixer(width) {
326
333
  }
327
334
  function sum() {
328
335
  var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
329
- return list.reduce(function (a, b) {
336
+ if (list.length === 0) return 0;
337
+ return list === null || list === void 0 ? void 0 : list.reduce(function (a, b) {
330
338
  return a + b;
331
339
  });
332
340
  }
@@ -54,6 +54,15 @@ showSkeleton, actionRef) {
54
54
  context: context,
55
55
  dataTeamixSpm: dataTeamixSpm
56
56
  });
57
+ // return renderCell(
58
+ // value,
59
+ // columnProps,
60
+ // index,
61
+ // record,
62
+ // actionRef,
63
+ // context,
64
+ // dataTeamixSpm
65
+ // )
57
66
  }
58
67
  });
59
68
  });
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.26-beta-2";
33
+ declare const version = "1.5.26-beta-5";
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,9 +299,10 @@ 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.26-beta-2';
303
- // By TeamixTest
302
+ var version = '1.5.26-beta-5';
304
303
  exports.version = version;
304
+ console.log('Pro版本', version);
305
+ // By TeamixTest
305
306
  window.postMessage({
306
307
  source: 'teamix-test-devtools',
307
308
  url: window.location.href,
@@ -311,12 +312,4 @@ window.postMessage({
311
312
  moduleType: 'TeamixPro',
312
313
  componentName: 'TeamixPro'
313
314
  }, '*');
314
- // window.TeamixMaterial = {
315
- // ...window.TeamixMaterial,
316
- // ProTable: ProTable
317
- // }
318
- // window.TeamixPro = {
319
- // ...window.TeamixPro,
320
- // ProTable: ProTable
321
- // }
322
315
  // console.log('TeamixPro')
@@ -190,7 +190,25 @@ var processBuriedPoint = function processBuriedPoint() {
190
190
  }))];
191
191
  }))));
192
192
  };
193
- var _default = /*#__PURE__*/_react.default.memo(Cell, function () {
194
- return true;
195
- });
193
+ var equalColumns = function equalColumns(prevProps, nextProps) {
194
+ var preValue = prevProps.value;
195
+ var nextValue = nextProps.value;
196
+ if (preValue === nextValue) {
197
+ return true;
198
+ }
199
+ // 针对 value 是数组类型的判断 value 是否和原来相等,相等则不渲染
200
+ if (Array.isArray(nextValue) && Array.isArray(preValue)) {
201
+ var nextValueStr = nextValue.map(function (item) {
202
+ return item.TagValue;
203
+ });
204
+ var preValueStr = preValue.map(function (item) {
205
+ return item.TagValue;
206
+ });
207
+ if (nextValueStr.toString() === preValueStr.toString()) {
208
+ return true;
209
+ }
210
+ }
211
+ return false;
212
+ };
213
+ var _default = /*#__PURE__*/_react.default.memo(Cell, equalColumns);
196
214
  exports.default = _default;
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
1
  import { EmptyContentProps } from '@teamix/pro-field';
3
2
  import { TableProps } from '@alicloudfe/components/types/table';
4
3
  export interface ITableContentProps extends TableProps {
5
4
  emptyProps?: EmptyContentProps;
6
5
  }
7
- declare const _default: React.MemoExoticComponent<(props: ITableContentProps) => JSX.Element>;
8
- export default _default;
6
+ declare const TableContent: (props: ITableContentProps) => JSX.Element;
7
+ export default TableContent;
@@ -30,5 +30,5 @@ var TableContent = function TableContent(props) {
30
30
  emptyContent: memorizedEmptyContent
31
31
  }, rest));
32
32
  };
33
- var _default = /*#__PURE__*/_react.default.memo(TableContent);
33
+ var _default = TableContent;
34
34
  exports.default = _default;
@@ -74,7 +74,6 @@ var globalFormatSort = function globalFormatSort(sort) {
74
74
  };
75
75
  var ProTable = function ProTable(props) {
76
76
  var _urlState$currentPage, _rowSelection$selecte;
77
- console.log('ProTable 代理成功');
78
77
  var header = props.header,
79
78
  className = props.className,
80
79
  tableClassName = props.tableClassName,
@@ -735,7 +734,9 @@ var ProTable = function ProTable(props) {
735
734
  if (Number.isInteger(time) && time >= 1000) {
736
735
  autoRefreshTimerRef.current = setTimeout(function () {
737
736
  // 自动刷新不显示 loading
738
- _request({}, true);
737
+ // 当表格自适应时,自动刷新要显示 loading ,否则表格自适应会出问题
738
+ // setShowLoading(true)
739
+ _request({}, !autoWidth);
739
740
  }, Number(time));
740
741
  (0, _utils2.emit)('PRO_TABLE_REFRESH_TIMER_FLAG', Number(time));
741
742
  }
@@ -924,7 +925,7 @@ var ProTable = function ProTable(props) {
924
925
  if (Number.isInteger(time) && time >= 1000) {
925
926
  autoRefreshTimerRef.current = setTimeout(function () {
926
927
  // 自动刷新不显示 loading
927
- _request(params, true);
928
+ _request(params, !autoWidth);
928
929
  }, Number(time));
929
930
  (0, _utils2.emit)('PRO_TABLE_REFRESH_TIMER_FLAG', Number(time));
930
931
  }
@@ -989,10 +990,9 @@ var ProTable = function ProTable(props) {
989
990
  }
990
991
  }, [customRequest, showLoading, showSkeleton, customTableLoading, props.loading, getData]);
991
992
  var memorizedGenProColumnToColumn = (0, _react.useMemo)(function () {
992
- return (0, _genProColumnToColumn.default)(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps);
993
- }, [
994
- // filteredColumns,
995
- showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps]);
993
+ var result = (0, _genProColumnToColumn.default)(filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps);
994
+ return result;
995
+ }, [filteredColumns, showSkeleton, actionRef, context, dataTeamixSpm, bindUrl, bindUrlProps]);
996
996
  var renderTable = function renderTable(isFullScreen) {
997
997
  if (propsColumns) {
998
998
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -103,7 +103,7 @@ $fullscreenPadding: 24px;
103
103
  pointer-events: none;
104
104
  display: flex;
105
105
  }
106
-
106
+
107
107
  // sort icon
108
108
  .next-table-sort.next-table-header-icon {
109
109
  line-height: 16px;
@@ -64,7 +64,7 @@ function genAutoWidthColumns(fileteredColumns, ref, data, size, useRowSelection,
64
64
  var shrink = fieldTypeShrink[finalType];
65
65
  column.shrink = column.shrink || (shrink !== undefined ? shrink : 1);
66
66
  if (column.isAutoWidth === true) {
67
- console.log(column.title, 'isAutoWidth');
67
+ // console.log(column.title, 'isAutoWidth')
68
68
  finalColumns.push(column);
69
69
  return;
70
70
  }
@@ -115,6 +115,7 @@ function genAutoWidthColumns(fileteredColumns, ref, data, size, useRowSelection,
115
115
  // fixedWidthTypeList[finalType],
116
116
  // );
117
117
  // 固定宽度
118
+ // console.log(column.title, '固定宽度')
118
119
  column.isAutoWidth = true;
119
120
  column.width = defaultPaddingFixer(
120
121
  // @ts-ignore
@@ -122,17 +123,19 @@ function genAutoWidthColumns(fileteredColumns, ref, data, size, useRowSelection,
122
123
  // @ts-ignore
123
124
  } else if (computeableWidthTypeList[finalType]) {
124
125
  // 可计算宽度
126
+ // console.log(column.title, '可计算宽度')
125
127
  column.isAutoWidth = true;
126
128
  column.width = defaultPaddingFixer(
127
129
  // @ts-ignore
128
130
  Math.max(titleWidth, computeableWidthTypeList[finalType](data, render)), size, index === 0 && useRowSelection);
129
131
  } else {
130
132
  // 直接根据 dom 计算
133
+ // console.log(column.title, '可计算 dom')
131
134
  column.isAutoWidth = true;
132
135
  column.width = defaultPaddingFixer(Math.max(titleWidth,
133
136
  // @ts-ignore
134
137
  calcWidthWithParentDOM(childNodes[index], column.shrink)), size, index === 0 && useRowSelection);
135
- if ((column === null || column === void 0 ? void 0 : column.sortable) && (column === null || column === void 0 ? void 0 : column.tooltip)) {
138
+ if ((column === null || column === void 0 ? void 0 : column.sortable) && ((column === null || column === void 0 ? void 0 : column.tooltip) || (column === null || column === void 0 ? void 0 : column.filters))) {
136
139
  // 检测有 sortable 和 tooltip 的时候增加宽度
137
140
  column.width = column.width + 40;
138
141
  }
@@ -172,8 +175,12 @@ var shadowContainer = function shadowContainer(props) {
172
175
  //@ts-ignore
173
176
  !fixedWidthTypeList[valueType] && data.map(function (item, index) {
174
177
  // @ts-ignore
175
- column.smartWidth = (0, _columnRender.renderCellSmartWidth)(getValueFromRecord(dataIndex, item), column, index, item);
176
- return (0, _pureColumnRender.renderCell)(getValueFromRecord(dataIndex, item), column, index, item);
178
+ var newColumn = _.cloneDeep(column);
179
+ newColumn.smartWidth = (0, _columnRender.renderCellSmartWidth)(getValueFromRecord(dataIndex, item), column, index, item);
180
+ newColumn.render = _objectSpread(_objectSpread({}, column.render), {}, {
181
+ description: ''
182
+ });
183
+ return (0, _pureColumnRender.renderCell)(getValueFromRecord(dataIndex, item), newColumn, index, item);
177
184
  }));
178
185
  }
179
186
  }));
@@ -341,7 +348,8 @@ function defaultPaddingFixer(width) {
341
348
  }
342
349
  function sum() {
343
350
  var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
344
- return list.reduce(function (a, b) {
351
+ if (list.length === 0) return 0;
352
+ return list === null || list === void 0 ? void 0 : list.reduce(function (a, b) {
345
353
  return a + b;
346
354
  });
347
355
  }
@@ -61,6 +61,15 @@ showSkeleton, actionRef) {
61
61
  context: context,
62
62
  dataTeamixSpm: dataTeamixSpm
63
63
  });
64
+ // return renderCell(
65
+ // value,
66
+ // columnProps,
67
+ // index,
68
+ // record,
69
+ // actionRef,
70
+ // context,
71
+ // dataTeamixSpm
72
+ // )
64
73
  }
65
74
  });
66
75
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.5.26-beta-3",
3
+ "version": "1.5.26-beta-5",
4
4
  "description": "TeamixPro大包",
5
5
  "keywords": [
6
6
  "aliyun",