@teamix/pro 1.2.22 → 1.2.27

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.
Files changed (145) hide show
  1. package/dist/212.js +129 -129
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +18718 -15882
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/dist/pro.min.js.LICENSE.txt +2 -0
  7. package/es/actions/dialog.js +4 -3
  8. package/es/actions/index.d.ts +13 -9
  9. package/es/actions/index.js +63 -18
  10. package/es/actions/index.scss +12 -1
  11. package/es/form/Components/SelectTable/index.d.ts +24 -0
  12. package/es/form/Components/SelectTable/index.js +135 -0
  13. package/es/form/Components/SelectTable/index.scss +28 -0
  14. package/es/form/Components/SelectTable/table.d.ts +6 -0
  15. package/es/form/Components/SelectTable/table.js +64 -0
  16. package/es/form/Filter/AdvancedFilter.js +1 -1
  17. package/es/form/Filter/Layout.d.ts +5 -0
  18. package/es/form/Filter/Layout.js +82 -0
  19. package/es/form/Filter/SimpleFilter.js +30 -6
  20. package/es/form/Filter/index2.d.ts +2 -1
  21. package/es/form/Filter/index2.js +97 -116
  22. package/es/form/Filter/index2.scss +16 -45
  23. package/es/form/Filter/layout.scss +36 -0
  24. package/es/form/Filter/useSpecialProps.d.ts +6 -0
  25. package/es/form/Filter/useSpecialProps.js +37 -0
  26. package/es/form/ProForm/customComponent.d.ts +3 -0
  27. package/es/form/ProForm/customComponent.js +20 -0
  28. package/es/form/ProForm/index.scss +5 -6
  29. package/es/form/ProForm/useFormDisplayValues.js +14 -24
  30. package/es/form/SchemaForm/adapterType.js +1 -0
  31. package/es/form/SchemaForm/index.js +8 -6
  32. package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
  33. package/es/form/SchemaForm/initializeDataSource.js +2 -2
  34. package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
  35. package/es/form/SchemaForm/initializeRequest.js +2 -2
  36. package/es/form/SchemaForm/initializeRules.d.ts +1 -1
  37. package/es/form/SchemaForm/initializeRules.js +3 -3
  38. package/es/form/fieldTypeMap.js +2 -1
  39. package/es/form/index.d.ts +4 -2
  40. package/es/form/index.js +4 -2
  41. package/es/form/typing.d.ts +25 -1
  42. package/es/form/utils.d.ts +2 -2
  43. package/es/form/utils.js +2 -2
  44. package/es/index.d.ts +5 -2
  45. package/es/index.js +6 -3
  46. package/es/info/index.scss +1 -1
  47. package/es/nocode/pages/renderer.js +1 -1
  48. package/es/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
  49. package/es/step/ProStepItem/components/HozStepItem/index.js +235 -0
  50. package/es/step/ProStepItem/components/HozStepItem/index.scss +279 -0
  51. package/es/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
  52. package/es/step/ProStepItem/components/VerStepItem/index.js +295 -0
  53. package/es/step/ProStepItem/components/VerStepItem/index.scss +287 -0
  54. package/es/step/ProStepItem/index.d.ts +4 -0
  55. package/es/step/ProStepItem/index.js +57 -0
  56. package/es/step/index.d.ts +9 -0
  57. package/es/step/index.js +101 -0
  58. package/es/step/typing.d.ts +96 -0
  59. package/es/step/typing.js +1 -0
  60. package/es/table/components/Filter/index.js +2 -17
  61. package/es/table/components/Layout/index.js +63 -166
  62. package/es/table/components/Layout/index.scss +4 -3
  63. package/es/table/components/Pagination/index.d.ts +4 -1
  64. package/es/table/components/Pagination/index.js +105 -14
  65. package/es/table/components/Pagination/index.scss +33 -0
  66. package/es/table/components/ToolBar/FullScreenIcon.js +4 -9
  67. package/es/table/components/ToolBar/Fullscreen.js +21 -11
  68. package/es/table/index.js +77 -102
  69. package/es/table/index.scss +5 -5
  70. package/es/table/typing.d.ts +19 -10
  71. package/es/table/utils/columnRender.js +21 -3
  72. package/es/table/utils/index.d.ts +7 -0
  73. package/es/table/utils/index.js +36 -0
  74. package/es/utils/index.d.ts +1 -0
  75. package/es/utils/index.js +1 -0
  76. package/lib/actions/dialog.js +4 -3
  77. package/lib/actions/index.d.ts +13 -9
  78. package/lib/actions/index.js +63 -18
  79. package/lib/actions/index.scss +12 -1
  80. package/lib/form/Components/SelectTable/index.d.ts +24 -0
  81. package/lib/form/Components/SelectTable/index.js +157 -0
  82. package/lib/form/Components/SelectTable/index.scss +28 -0
  83. package/lib/form/Components/SelectTable/table.d.ts +6 -0
  84. package/lib/form/Components/SelectTable/table.js +76 -0
  85. package/lib/form/Filter/AdvancedFilter.js +1 -1
  86. package/lib/form/Filter/Layout.d.ts +5 -0
  87. package/lib/form/Filter/Layout.js +102 -0
  88. package/lib/form/Filter/SimpleFilter.js +29 -4
  89. package/lib/form/Filter/index2.d.ts +2 -1
  90. package/lib/form/Filter/index2.js +101 -114
  91. package/lib/form/Filter/index2.scss +16 -45
  92. package/lib/form/Filter/layout.scss +36 -0
  93. package/lib/form/Filter/useSpecialProps.d.ts +6 -0
  94. package/lib/form/Filter/useSpecialProps.js +46 -0
  95. package/lib/form/ProForm/customComponent.d.ts +3 -0
  96. package/lib/form/ProForm/customComponent.js +28 -0
  97. package/lib/form/ProForm/index.scss +5 -6
  98. package/lib/form/ProForm/useFormDisplayValues.js +17 -24
  99. package/lib/form/SchemaForm/adapterType.js +1 -0
  100. package/lib/form/SchemaForm/index.js +8 -6
  101. package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
  102. package/lib/form/SchemaForm/initializeDataSource.js +2 -2
  103. package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
  104. package/lib/form/SchemaForm/initializeRequest.js +2 -2
  105. package/lib/form/SchemaForm/initializeRules.d.ts +1 -1
  106. package/lib/form/SchemaForm/initializeRules.js +3 -3
  107. package/lib/form/fieldTypeMap.js +2 -1
  108. package/lib/form/index.d.ts +4 -2
  109. package/lib/form/index.js +19 -1
  110. package/lib/form/typing.d.ts +25 -1
  111. package/lib/form/utils.d.ts +2 -2
  112. package/lib/form/utils.js +2 -2
  113. package/lib/index.d.ts +5 -2
  114. package/lib/index.js +35 -3
  115. package/lib/info/index.scss +1 -1
  116. package/lib/nocode/pages/renderer.js +1 -1
  117. package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
  118. package/lib/step/ProStepItem/components/HozStepItem/index.js +258 -0
  119. package/lib/step/ProStepItem/components/HozStepItem/index.scss +279 -0
  120. package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
  121. package/lib/step/ProStepItem/components/VerStepItem/index.js +315 -0
  122. package/lib/step/ProStepItem/components/VerStepItem/index.scss +287 -0
  123. package/lib/step/ProStepItem/index.d.ts +4 -0
  124. package/lib/step/ProStepItem/index.js +69 -0
  125. package/lib/step/index.d.ts +9 -0
  126. package/lib/step/index.js +124 -0
  127. package/lib/step/typing.d.ts +96 -0
  128. package/lib/step/typing.js +5 -0
  129. package/lib/table/components/Filter/index.js +2 -17
  130. package/lib/table/components/Layout/index.js +61 -166
  131. package/lib/table/components/Layout/index.scss +4 -3
  132. package/lib/table/components/Pagination/index.d.ts +4 -1
  133. package/lib/table/components/Pagination/index.js +104 -13
  134. package/lib/table/components/Pagination/index.scss +33 -0
  135. package/lib/table/components/ToolBar/FullScreenIcon.js +4 -9
  136. package/lib/table/components/ToolBar/Fullscreen.js +22 -11
  137. package/lib/table/index.js +74 -98
  138. package/lib/table/index.scss +5 -5
  139. package/lib/table/typing.d.ts +19 -10
  140. package/lib/table/utils/columnRender.js +21 -3
  141. package/lib/table/utils/index.d.ts +7 -0
  142. package/lib/table/utils/index.js +38 -0
  143. package/lib/utils/index.d.ts +1 -0
  144. package/lib/utils/index.js +13 -0
  145. package/package.json +4 -4
@@ -10,6 +10,8 @@ var _react = _interopRequireWildcard(require("react"));
10
10
 
11
11
  var _components = require("@alicloudfe/components");
12
12
 
13
+ var _Pagination = _interopRequireDefault(require("./components/Pagination"));
14
+
13
15
  var _genProColumnToColumn = _interopRequireDefault(require("./utils/genProColumnToColumn"));
14
16
 
15
17
  var _utils = require("@teamix/utils");
@@ -36,8 +38,6 @@ var _form = require("../form");
36
38
 
37
39
  var _actions = require("../actions");
38
40
 
39
- var _lodash = _interopRequireDefault(require("lodash.debounce"));
40
-
41
41
  var _classnames = _interopRequireDefault(require("classnames"));
42
42
 
43
43
  var _pageContainer = _interopRequireDefault(require("../page-container"));
@@ -55,7 +55,7 @@ Object.keys(_typing).forEach(function (key) {
55
55
  }
56
56
  });
57
57
  });
58
- var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType"];
58
+ var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams"];
59
59
 
60
60
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61
61
 
@@ -96,7 +96,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
96
96
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
97
97
 
98
98
  var cls = (0, _utils.baseClass)('teamix-pro-table');
99
- var toJS = _form.formilyReactive.toJS;
99
+ var toJS = _form.formilyReactive.toJS; // 判断是否是 root 组织
100
+
101
+ var isRoot = (0, _utils.getCookie)('organizationId') === '1';
100
102
  /**
101
103
  * 处理原生传入的 columns 以便于 选择列 方便处理
102
104
  * @param columns 原生传入的 columns
@@ -104,14 +106,24 @@ var toJS = _form.formilyReactive.toJS;
104
106
  */
105
107
 
106
108
  var processColumns = function processColumns(columns, initialColumns) {
109
+ var _filterColumns;
110
+
107
111
  var filterColumns = columns.filter(function (item) {
108
112
  return item.columnFilters !== false;
109
- }); // 处理只剩一列批量选择的情况下宽度错乱问题
113
+ });
110
114
 
111
- if (filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) {
112
- var _initialColumns$;
115
+ if (isRoot) {
116
+ // root 组织下不显示标签管理
117
+ filterColumns = filterColumns.filter(function (item) {
118
+ return item.valueType !== 'selectGroup';
119
+ });
120
+ } // 处理只剩一列批量选择的情况下宽度错乱问题
121
+
122
+
123
+ if ((_filterColumns = filterColumns) === null || _filterColumns === void 0 ? void 0 : _filterColumns.length) {
124
+ var _filterColumns2, _initialColumns$;
113
125
 
114
- if ((filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) === 1) {
126
+ if (((_filterColumns2 = filterColumns) === null || _filterColumns2 === void 0 ? void 0 : _filterColumns2.length) === 1) {
115
127
  var _filterColumns$, _filterColumns$2;
116
128
 
117
129
  if ((_filterColumns$ = filterColumns[0]) === null || _filterColumns$ === void 0 ? void 0 : _filterColumns$.width) {
@@ -189,6 +201,7 @@ var ProTable = function ProTable(props) {
189
201
  showPagination = _props$showPagination === void 0 ? true : _props$showPagination,
190
202
  _props$pageSizeList = props.pageSizeList,
191
203
  pageSizeList = _props$pageSizeList === void 0 ? [5, 10, 20, 50, 100] : _props$pageSizeList,
204
+ responsivePaginationType = props.responsivePaginationType,
192
205
  _props$showSkeleton = props.showSkeleton,
193
206
  propsShowSkeleton = _props$showSkeleton === void 0 ? true : _props$showSkeleton,
194
207
  _props$skeletonSize = props.skeletonSize,
@@ -206,6 +219,7 @@ var ProTable = function ProTable(props) {
206
219
  customRequest = props.customRequest,
207
220
  _props$filterColumnTy = props.filterColumnType,
208
221
  filterColumnType = _props$filterColumnTy === void 0 ? 'auto' : _props$filterColumnTy,
222
+ defaultFilterParams = props.defaultFilterParams,
209
223
  otherProps = _objectWithoutProperties(props, _excluded);
210
224
 
211
225
  var targetPageKey = pageKey || globalPageKey;
@@ -249,10 +263,8 @@ var ProTable = function ProTable(props) {
249
263
  var _useState13 = (0, _react.useState)(true),
250
264
  _useState14 = _slicedToArray(_useState13, 2),
251
265
  customTableLoading = _useState14[0],
252
- setCustomTableLoading = _useState14[1]; // 用于存放 Search 组件之前值的 ref
266
+ setCustomTableLoading = _useState14[1];
253
267
 
254
-
255
- var searchValueRef = (0, _react.useRef)('');
256
268
  var tableRef = (0, _react.useRef)(null);
257
269
  var actionRef = (0, _react.useRef)(); // 传给 table 的过滤后的 columns
258
270
 
@@ -302,19 +314,22 @@ var ProTable = function ProTable(props) {
302
314
  var _useState23 = (0, _react.useState)(false),
303
315
  _useState24 = _slicedToArray(_useState23, 2),
304
316
  fullscreenState = _useState24[0],
305
- setFullscreenState = _useState24[1]; // 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
317
+ setFullscreenState = _useState24[1]; // 非全屏状态下的
318
+
306
319
 
320
+ var normalDataFilterFormRef = (0, _react.useRef)();
321
+ var fullscreenDataFilterFormRef = (0, _react.useRef)();
322
+ var normalDataFilterForm = normalDataFilterFormRef.current;
323
+ var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current; // 传给 QueryFilter 的 formRef
324
+
325
+ var dataFilterFormRef = fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
326
+ var dataFilterForm = dataFilterFormRef.current; // 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
307
327
 
308
328
  var _useState25 = (0, _react.useState)(false),
309
329
  _useState26 = _slicedToArray(_useState25, 2),
310
330
  footerSuctionState = _useState26[0],
311
- setFooterSuctionState = _useState26[1];
312
- /** 筛选区域 form */
313
-
331
+ setFooterSuctionState = _useState26[1]; // TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
314
332
 
315
- var dataFilterForm = (0, _react.useMemo)(function () {
316
- return (0, _form.createForm)();
317
- }, []); // TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
318
333
 
319
334
  var getFooterSuctionState = function getFooterSuctionState() {
320
335
  var containerDom = document.querySelector('.teamix-pro-page-container-scroll-container');
@@ -467,18 +482,16 @@ var ProTable = function ProTable(props) {
467
482
  return _request(params);
468
483
  },
469
484
  request: function request(params) {
470
- if (dataFilterForm.validate()) {
471
- // 如果请求中还有翻页相关信息,需要自动设置到指定页
472
- if (params === null || params === void 0 ? void 0 : params[targetPageKey]) {
473
- setCurrentPage(params[targetPageKey]);
474
- }
475
-
476
- if (params === null || params === void 0 ? void 0 : params[targetPageSizeKey]) {
477
- setPageSize(params[targetPageSizeKey]);
478
- }
485
+ // 如果请求中还有翻页相关信息,需要自动设置到指定页
486
+ if (params === null || params === void 0 ? void 0 : params[targetPageKey]) {
487
+ setCurrentPage(params[targetPageKey]);
488
+ }
479
489
 
480
- _request(params);
490
+ if (params === null || params === void 0 ? void 0 : params[targetPageSizeKey]) {
491
+ setPageSize(params[targetPageSizeKey]);
481
492
  }
493
+
494
+ _request(params);
482
495
  },
483
496
  reset: function reset() {
484
497
  var _actionRef$current3, _actionRef$current3$s;
@@ -486,7 +499,7 @@ var ProTable = function ProTable(props) {
486
499
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
487
500
 
488
501
  (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$s = _actionRef$current3.setFilterRules) === null || _actionRef$current3$s === void 0 ? void 0 : _actionRef$current3$s.call(_actionRef$current3, {});
489
- dataFilterForm.reset();
502
+ dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.reset();
490
503
  setCurrentPage(1);
491
504
 
492
505
  _request(_defineProperty({}, targetPageKey, 1));
@@ -509,6 +522,8 @@ var ProTable = function ProTable(props) {
509
522
  },
510
523
  data: data,
511
524
  dataFilterForm: dataFilterForm,
525
+ normalDataFilterForm: normalDataFilterForm,
526
+ fullscreenDataFilterForm: fullscreenDataFilterForm,
512
527
  resetTableMaxBodyHeight: function resetTableMaxBodyHeight() {
513
528
  getHeaderHeight().then(function (height) {
514
529
  setHeaderHeight(height);
@@ -611,7 +626,7 @@ var ProTable = function ProTable(props) {
611
626
 
612
627
  var sortParams = targetFormatSort(sort); // 筛选区请求参数
613
628
 
614
- var dataFilterParams = toJS(dataFilterForm.values); // 列过滤请求参数
629
+ var dataFilterParams = toJS(dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.values); // 列过滤请求参数
615
630
 
616
631
  var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$g = _actionRef$current4.getFilterRules) === null || _actionRef$current4$g === void 0 ? void 0 : _actionRef$current4$g.call(_actionRef$current4)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {}; // 格式化后的请求参数
617
632
 
@@ -674,15 +689,10 @@ var ProTable = function ProTable(props) {
674
689
  }
675
690
 
676
691
  if (requestWhenMount) {
677
- _request();
678
- }
679
-
680
- var searchName = getSearchName();
692
+ // 在请求发送之前 处理漏斗默认数据
693
+ (0, _utils2.processDefaultFilter)(propsColumns, actionRef, defaultFilterParams);
681
694
 
682
- if (searchName) {
683
- // 如果有初始值,需要赋值
684
- var initialValues = toJS(dataFilterForm.initialValues);
685
- searchValueRef.current = initialValues[searchName][1];
695
+ _request();
686
696
  }
687
697
 
688
698
  return function () {
@@ -704,62 +714,25 @@ var ProTable = function ProTable(props) {
704
714
  setSort(nextSort);
705
715
 
706
716
  _request(targetFormatSort(nextSort));
707
- } // 找到 Search 组件对应的 name
708
-
709
-
710
- var getSearchName = function getSearchName() {
711
- var _dataFilter$schema;
712
-
713
- if ((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.schema) && ((_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) > 0) {
714
- var searchSchema = dataFilter.schema.find(function (item) {
715
- return item.component === 'Search';
716
- });
717
-
718
- if (searchSchema) {
719
- var searchName = searchSchema.name;
720
- return searchName;
721
- }
722
- }
723
- }; // 处理 dataFilter 中的 onFilter、onReset
717
+ } // 处理 dataFilter 中的 onFilter、onReset
724
718
 
725
719
 
726
720
  var dataFilter = _objectSpread(_objectSpread({
727
721
  mode: 'inline'
728
722
  }, propsDataFilter), {}, {
729
- onFilter: (0, _lodash.default)(function (values) {
730
- (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
731
-
732
- if (dataFilterForm.validate()) {
733
- var _actionRef$current5, _actionRef$current5$c;
734
-
735
- /**
736
- * 针对 inline 模式下的 Search 组件做特殊处理
737
- * 当切换条件且输入内容为空的时候,类似[a, ''] => [b, ''] 不触发请求
738
- */
739
- if (dataFilter.mode === 'inline') {
740
- var searchName = getSearchName();
723
+ onFilter: function onFilter(values) {
724
+ var _actionRef$current5, _actionRef$current5$c;
741
725
 
742
- if (searchName) {
743
- var searchValue = values[searchName][1];
726
+ (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values)); // 搜索变化时,暂时先清空选择
744
727
 
745
- if (searchValue === (searchValueRef === null || searchValueRef === void 0 ? void 0 : searchValueRef.current)) {
746
- return;
747
- }
748
-
749
- searchValueRef.current = searchValue;
750
- }
751
- } // 搜索变化时,暂时先清空选择
752
-
753
-
754
- (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$c = _actionRef$current5.clearRowSelection) === null || _actionRef$current5$c === void 0 ? void 0 : _actionRef$current5$c.call(_actionRef$current5);
755
- setCurrentPage(1);
728
+ (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$c = _actionRef$current5.clearRowSelection) === null || _actionRef$current5$c === void 0 ? void 0 : _actionRef$current5$c.call(_actionRef$current5);
729
+ setCurrentPage(1);
756
730
 
757
- _request(_defineProperty({}, targetPageKey, 1));
758
- }
759
- }, filterDebounce),
731
+ _request(_defineProperty({}, targetPageKey, 1));
732
+ },
760
733
  onReset: function onReset() {
761
734
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
762
- dataFilterForm.reset();
735
+ dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.reset();
763
736
  setCurrentPage(1);
764
737
 
765
738
  _request(_defineProperty({}, targetPageKey, 1));
@@ -774,7 +747,7 @@ var ProTable = function ProTable(props) {
774
747
  }
775
748
  };
776
749
 
777
- var renderTable = function renderTable() {
750
+ var renderTable = function renderTable(isFullScreen) {
778
751
  if (propsColumns) {
779
752
  return /*#__PURE__*/_react.default.createElement("div", {
780
753
  className: (0, _classnames.default)('teamix-pro-table-container', className)
@@ -786,7 +759,7 @@ var ProTable = function ProTable(props) {
786
759
  actionRef: actionRef,
787
760
  columns: propsColumns,
788
761
  dataFilter: dataFilter,
789
- dataFilterForm: dataFilterForm,
762
+ dataFilterFormRef: isFullScreen ? fullscreenDataFilterFormRef : normalDataFilterFormRef,
790
763
  rowSelection: rowSelection,
791
764
  filterColumnType: filterColumnType
792
765
  }), /*#__PURE__*/_react.default.createElement(_components.Table.StickyLock, _objectSpread({
@@ -828,7 +801,7 @@ var ProTable = function ProTable(props) {
828
801
 
829
802
  var targetActions = footerAction.actions.map(function (action) {
830
803
  return _objectSpread(_objectSpread({}, action), {}, {
831
- disabled: action.disabled || selectedCount === 0
804
+ disabled: (action === null || action === void 0 ? void 0 : action.disabled) || selectedCount === 0
832
805
  });
833
806
  });
834
807
 
@@ -894,14 +867,15 @@ var ProTable = function ProTable(props) {
894
867
  })
895
868
  }, renderRowSelection(), /*#__PURE__*/_react.default.createElement("div", {
896
869
  className: cls('footer-right-wrapper')
897
- }, showSkeleton ? /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Footer.Pagination, null) : /*#__PURE__*/_react.default.createElement(_components.Pagination, _objectSpread({
870
+ }, showSkeleton ? /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Footer.Pagination, null) : /*#__PURE__*/_react.default.createElement(_Pagination.default, _objectSpread({
898
871
  className: cls('pagination'),
899
872
  onChange: function onChange(number) {
900
873
  return onChangePagination(number);
901
874
  },
902
875
  total: total,
903
- shape: "arrow-only",
904
- pageSizePosition: "end",
876
+ responsivePaginationType: responsivePaginationType,
877
+ // shape="arrow-only"
878
+ // pageSizePosition="end"
905
879
  totalRender: function totalRender(total) {
906
880
  return (0, _utils.getMessage)('total', {
907
881
  total: total
@@ -930,14 +904,16 @@ var ProTable = function ProTable(props) {
930
904
  return /*#__PURE__*/_react.default.createElement(_Fullscreen.default, {
931
905
  visible: fullscreenState,
932
906
  actionRef: actionRef
933
- }, /*#__PURE__*/_react.default.createElement("div", {
934
- className: cls({
935
- '': true,
936
- fullscreen: fullscreenState // 'footer-suction': footerSuctionState && footerSuction,
937
-
938
- }),
939
- ref: tableRef
940
- }, renderTable(), footerSuctionState && footerSuction && !fullscreenState && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && !fullscreenState && renderFooter(), fullscreenState && renderFooter()));
907
+ }, function (isFullScreen) {
908
+ return /*#__PURE__*/_react.default.createElement("div", {
909
+ className: cls({
910
+ '': true,
911
+ fullscreen: fullscreenState // 'footer-suction': footerSuctionState && footerSuction,
912
+
913
+ }),
914
+ ref: tableRef
915
+ }, renderTable(isFullScreen), footerSuctionState && footerSuction && !fullscreenState && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && !fullscreenState && renderFooter(), fullscreenState && renderFooter());
916
+ });
941
917
  };
942
918
 
943
919
  var _default = ProTable;
@@ -40,11 +40,6 @@ $fullscreenPadding: 24px;
40
40
  justify-content: flex-end;
41
41
  width: 100%;
42
42
  }
43
- .teamix-pro-pagination-wrapper {
44
- display: flex;
45
- justify-content: flex-end;
46
- width: 100%;
47
- }
48
43
  &-footer-action {
49
44
  margin-left: 16px;
50
45
  }
@@ -114,4 +109,9 @@ $fullscreenPadding: 24px;
114
109
 
115
110
  .next-table-empty {
116
111
  --table-empty-padding: 48px;
112
+ }
113
+
114
+ // 后面在基础组件里面覆盖
115
+ .next-table.next-table td .next-table-cell-wrapper {
116
+ text-overflow: unset;
117
117
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
5
5
  import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
6
- import { IFilterProps } from '../form';
6
+ import { QueryFilterProps } from '../form';
7
7
  import { ProActionGroupProps, ProActionButtonProps } from '../actions';
8
8
  import { PaginationProps } from '@alicloudfe/components/types/pagination';
9
9
  import { HeaderProps as ProTableHeaderProps } from '@teamix/utils';
@@ -22,6 +22,7 @@ declare type TDataService = {
22
22
  /** 表格数据 */
23
23
  data?: any;
24
24
  };
25
+ export declare type responsivePaginationType = 'mini' | 'small' | 'simple' | 'normal';
25
26
  export declare type ProTableColumnProps = {
26
27
  /**
27
28
  * 会在 title 之后展示一个 icon,hover 之后提示一些信息
@@ -55,6 +56,8 @@ export declare type ProTableColumnProps = {
55
56
  dataIndex?: string | string[];
56
57
  /** 指定 valueType 为日期时间格式时,可以格式化日期时间 */
57
58
  format?: string;
59
+ /** ProField 其他配置项 */
60
+ props?: any;
58
61
  } & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode'>;
59
62
  export declare type ProColumnProps = ProTableColumnProps;
60
63
  export declare type ProTableProps = {
@@ -92,6 +95,8 @@ export declare type ProTableProps = {
92
95
  paginationProps?: PaginationProps;
93
96
  /** 是否显示翻页器 */
94
97
  showPagination?: boolean;
98
+ /** 手动指定响应式翻页器的 type */
99
+ responsivePaginationType?: responsivePaginationType;
95
100
  /** 是否使用内置的 rowSelection */
96
101
  useRowSelection?: boolean;
97
102
  /** 内置 rowSelection 变化时的回调 */
@@ -102,7 +107,10 @@ export declare type ProTableProps = {
102
107
  footerAction?: ProActionGroupProps | React.ReactNode;
103
108
  /** 表格底部(右层)配置 */
104
109
  footer?: React.ReactNode;
105
- /** 筛选区自动搜索的防抖时间(毫秒) */
110
+ /**
111
+ * @deprecated 已废弃 建议用 dataFilter 中的 filterDebounce 代替
112
+ * 筛选区自动搜索的防抖时间(毫秒)
113
+ */
106
114
  filterDebounce?: number;
107
115
  /** ProTable action 的引用,便于手动触发一些方法 */
108
116
  actionRef?: React.MutableRefObject<ProTableActionType | undefined>;
@@ -122,6 +130,10 @@ export declare type ProTableProps = {
122
130
  data: any[];
123
131
  total?: number;
124
132
  }>;
133
+ /** 默认漏斗过滤条件 */
134
+ defaultFilterParams?: {
135
+ [key: string]: any[] | any;
136
+ };
125
137
  } & Omit<TableProps, 'columns'> & ProTableTopAreaProps;
126
138
  export declare type rowSelectionType = {
127
139
  getProps?: (record: any, index: number) => any;
@@ -178,6 +190,8 @@ export declare type ProTableActionType = {
178
190
  resetPage?: () => void;
179
191
  /** 获取数据过滤区表单实例 */
180
192
  dataFilterForm?: FormType;
193
+ normalDataFilterForm?: FormType;
194
+ fullscreenDataFilterForm?: FormType;
181
195
  /** 表格当前的数据 */
182
196
  data?: any[];
183
197
  } & ProTableActionTypeMutations;
@@ -212,17 +226,12 @@ export declare type ProTableActionTypeState = {
212
226
  [key: string]: any;
213
227
  };
214
228
  export declare type ProTableDataFilterProps = {
215
- /** 展示形式 */
216
- mode?: 'inline' | 'panel';
217
- /** mode='panel' 时是否默认展开 */
218
- expand?: boolean;
219
- /** 搜索时是否传入值为undefined的参数,默认不传 */
220
229
  searchUndefined?: boolean;
221
230
  /** 搜索时是否传入值为空字符串的参数,默认不传 */
222
231
  searchEmptyString?: boolean;
223
232
  /** 自定义内容 */
224
233
  content?: React.ReactNode;
225
- } & IFilterProps;
234
+ } & QueryFilterProps;
226
235
  export declare type dataFilterProps = ProTableDataFilterProps;
227
236
  export declare type ProTableTopAreaProps = {
228
237
  /** 标题区 */
@@ -235,8 +244,8 @@ export declare type ProTableTopAreaProps = {
235
244
  extra?: ProActionButtonProps | React.ReactNode | React.ReactNode[];
236
245
  /** 数据过滤区 */
237
246
  dataFilter?: ProTableDataFilterProps;
238
- /** 数据过滤区 form 表单模型 */
239
- dataFilterForm?: FormType;
247
+ /** 传给 QueryFilter formRef */
248
+ dataFilterFormRef?: any;
240
249
  /** 排序、筛选列展示状态 */
241
250
  filterColumnType?: 'dialog' | 'dropdown' | 'auto';
242
251
  };
@@ -145,7 +145,8 @@ var renderCell = function renderCell(value, item, index, record, actionRef) {
145
145
  }
146
146
 
147
147
  var newRender = null;
148
- var newDataSource = null; // 如果 render 直接传函数
148
+ var newDataSource = null;
149
+ var props = item.props; // 如果 render 直接传函数
149
150
 
150
151
  if (typeof render === 'function') {
151
152
  newRender = function newRender() {
@@ -153,6 +154,23 @@ var renderCell = function renderCell(value, item, index, record, actionRef) {
153
154
  };
154
155
  } else {
155
156
  newRender = processBuriedPoint(processRenderFunction(render, value, index, record), record, value, index);
157
+
158
+ if (valueType === 'selectGroup') {
159
+ newRender = _objectSpread(_objectSpread({
160
+ maxShowNumber: 1,
161
+ foldText: 'more',
162
+ editOnClick: function editOnClick() {},
163
+ edit: true
164
+ }, newRender), {}, {
165
+ ellipsis: false
166
+ });
167
+ props = _objectSpread({
168
+ valueAlias: {
169
+ value: 'TagValue',
170
+ key: 'TagKey'
171
+ }
172
+ }, props);
173
+ }
156
174
  } // 渲染操作组
157
175
 
158
176
 
@@ -195,13 +213,13 @@ var renderCell = function renderCell(value, item, index, record, actionRef) {
195
213
  } // 渲染 ProField
196
214
 
197
215
 
198
- return /*#__PURE__*/_react.default.createElement(_field.default, {
216
+ return /*#__PURE__*/_react.default.createElement(_field.default, _objectSpread({
199
217
  type: valueType || 'text',
200
218
  value: value,
201
219
  render: newRender,
202
220
  dataSource: newDataSource,
203
221
  format: format
204
- });
222
+ }, props));
205
223
  };
206
224
  /**
207
225
  * 处理 render 配置项是函数的情况
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ProTableActionType } from '../typing';
3
+ import { ProTableProps, ProTableColumnProps } from '..';
3
4
  export declare function initActionRef(): void;
4
5
  /** table 组件内监听 不对外暴露 */
5
6
  export declare function on(fun: any, key: string): void;
@@ -9,3 +10,9 @@ export declare function off(key: string): void;
9
10
  export declare function emit(key: string, ...args: any): void;
10
11
  export declare function useActionType<T>(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): void;
11
12
  export declare function cloneDeep<T>(obj: T): T;
13
+ /**
14
+ * 处理默认过滤参数
15
+ * @param columns
16
+ * @param ref
17
+ */
18
+ export declare function processDefaultFilter(columns: ProTableColumnProps[], ref: React.MutableRefObject<ProTableActionType | undefined>, defaultFilterParams: ProTableProps['defaultFilterParams']): void;
@@ -8,6 +8,7 @@ exports.emit = emit;
8
8
  exports.initActionRef = initActionRef;
9
9
  exports.off = off;
10
10
  exports.on = on;
11
+ exports.processDefaultFilter = processDefaultFilter;
11
12
  exports.useActionType = useActionType;
12
13
 
13
14
  var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
@@ -193,4 +194,41 @@ function useActionType(ref, action) {
193
194
 
194
195
  function cloneDeep(obj) {
195
196
  return (0, _lodash.default)(obj);
197
+ }
198
+ /**
199
+ * 处理默认过滤参数
200
+ * @param columns
201
+ * @param ref
202
+ */
203
+
204
+
205
+ function processDefaultFilter(columns, ref, defaultFilterParams) {
206
+ columns.forEach(function (column) {
207
+ var _column$dataIndex$toS, _column$dataIndex;
208
+
209
+ var defaultRules = defaultFilterParams === null || defaultFilterParams === void 0 ? void 0 : defaultFilterParams[(_column$dataIndex$toS = column === null || column === void 0 ? void 0 : (_column$dataIndex = column.dataIndex) === null || _column$dataIndex === void 0 ? void 0 : _column$dataIndex.toString()) !== null && _column$dataIndex$toS !== void 0 ? _column$dataIndex$toS : ''];
210
+
211
+ if (defaultRules) {
212
+ var _ref$current$getState, _ref$current, _ref$current$getState2, _ref$current$getState3, _ref$current2, _ref$current2$setFilt;
213
+
214
+ var params = '';
215
+ var rules = [];
216
+
217
+ if (Array.isArray(defaultRules)) {
218
+ params = defaultRules.join(',');
219
+ rules = defaultRules;
220
+ } else {
221
+ params = defaultRules;
222
+ rules = [defaultRules];
223
+ } // 需要带上其他所有的信息
224
+
225
+
226
+ var otherRules = (_ref$current$getState = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$getState2 = _ref$current.getState) === null || _ref$current$getState2 === void 0 ? void 0 : (_ref$current$getState3 = _ref$current$getState2.call(_ref$current)) === null || _ref$current$getState3 === void 0 ? void 0 : _ref$current$getState3.filterRules) !== null && _ref$current$getState !== void 0 ? _ref$current$getState : {}; // 再设置所有的列筛选状态
227
+
228
+ (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : (_ref$current2$setFilt = _ref$current2.setFilterRules) === null || _ref$current2$setFilt === void 0 ? void 0 : _ref$current2$setFilt.call(_ref$current2, _objectSpread(_objectSpread({}, otherRules), {}, _defineProperty({}, column.dataIndex, {
229
+ rules: rules,
230
+ params: params
231
+ })));
232
+ }
233
+ });
196
234
  }
@@ -1,2 +1,3 @@
1
1
  import * as utils from '@teamix/utils';
2
+ export * from '@teamix/utils';
2
3
  export default utils;
@@ -5,10 +5,23 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ var _exportNames = {};
8
9
  exports.default = void 0;
9
10
 
10
11
  var utils = _interopRequireWildcard(require("@teamix/utils"));
11
12
 
13
+ Object.keys(utils).forEach(function (key) {
14
+ if (key === "default" || key === "__esModule") return;
15
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
16
+ if (key in exports && exports[key] === utils[key]) return;
17
+ Object.defineProperty(exports, key, {
18
+ enumerable: true,
19
+ get: function get() {
20
+ return utils[key];
21
+ }
22
+ });
23
+ });
24
+
12
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
26
 
14
27
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.2.22",
3
+ "version": "1.2.27",
4
4
  "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",
@@ -22,9 +22,9 @@
22
22
  ],
23
23
  "private": false,
24
24
  "dependencies": {
25
- "@formily/core": "2.0.5",
26
- "@formily/react": "2.0.5",
27
- "@teamix/formily": "2.0.5-2",
25
+ "@formily/core": "2.0.8",
26
+ "@formily/react": "2.0.8",
27
+ "@teamix/formily": "2.0.8",
28
28
  "@teamix/hooks": "^0.1.0",
29
29
  "@teamix/pop-confirm": "^1.2.4",
30
30
  "@teamix/pro-field": "^1.0.0",