@teamix/pro 1.2.4 → 1.2.8

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 (126) hide show
  1. package/dist/212.js +1 -1
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +1182 -512
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/es/actions/dialog-component.js +2 -1
  7. package/es/actions/dialog-form.js +2 -1
  8. package/es/actions/dialog.js +2 -1
  9. package/es/actions/index.js +3 -2
  10. package/es/actions/index.scss +3 -0
  11. package/es/actions/utils.d.ts +1 -0
  12. package/es/actions/utils.js +27 -0
  13. package/es/card/card-container.d.ts +18 -0
  14. package/es/card/card-container.js +24 -0
  15. package/es/card/divider.d.ts +6 -0
  16. package/es/card/divider.js +16 -0
  17. package/es/card/index.d.ts +68 -32
  18. package/es/card/index.js +194 -107
  19. package/es/card/index.scss +174 -9
  20. package/es/card/selectable.d.ts +13 -0
  21. package/es/card/selectable.js +45 -0
  22. package/es/card/utils.d.ts +9 -0
  23. package/es/card/utils.js +30 -0
  24. package/es/form/Components/ProField/index.js +2 -7
  25. package/es/form/Filter/index.js +5 -5
  26. package/es/form/ProForm/index.js +43 -17
  27. package/es/form/ProForm/index.scss +0 -1
  28. package/es/form/ProForm/useAutoSubmit.d.ts +1 -1
  29. package/es/form/ProForm/useAutoSubmit.js +3 -3
  30. package/es/form/ProForm/useInitialRequest.d.ts +1 -1
  31. package/es/form/ProForm/useInitialRequest.js +2 -2
  32. package/es/form/SchemaForm/initializeDataSource.js +1 -1
  33. package/es/form/SchemaForm/initializeFormButton.js +3 -2
  34. package/es/form/SchemaForm/initializeRequest.js +6 -3
  35. package/es/form/SchemaForm/initializeRules.js +1 -1
  36. package/es/form/SchemaForm/reactions.d.ts +5 -4
  37. package/es/form/SchemaForm/reactions.js +20 -11
  38. package/es/form/locales/validate.d.ts +159 -0
  39. package/es/form/locales/validate.js +158 -0
  40. package/es/form/typing.d.ts +4 -3
  41. package/es/index.d.ts +1 -1
  42. package/es/index.js +7 -4
  43. package/es/info/components/InfoGroup/index.js +5 -2
  44. package/es/info/components/InfoValueItem/index.js +4 -6
  45. package/es/info/components/baseInfo/index.js +4 -2
  46. package/es/info/components/tableInfo/index.js +10 -6
  47. package/es/info/index.js +25 -11
  48. package/es/info/typing.d.ts +6 -0
  49. package/es/nocode/configurators/Card.js +39 -12
  50. package/es/sidebar/components/sidebar-container/index.d.ts +5 -0
  51. package/es/sidebar/components/sidebar-container/index.js +77 -0
  52. package/es/sidebar/components/sidebar-container/index.scss +18 -0
  53. package/es/sidebar/components/tree/index.d.ts +4 -0
  54. package/es/sidebar/components/tree/index.js +95 -0
  55. package/es/sidebar/index.d.ts +5 -0
  56. package/es/sidebar/index.js +66 -0
  57. package/es/sidebar/index.scss +3 -0
  58. package/es/sidebar/typing.d.ts +51 -0
  59. package/es/sidebar/typing.js +1 -0
  60. package/es/table/components/Layout/index.js +1 -1
  61. package/es/table/components/ToolBar/FilterColumnIcon.js +2 -24
  62. package/es/table/components/ToolBar/index.scss +0 -3
  63. package/es/table/index.js +26 -9
  64. package/es/table/index.scss +1 -0
  65. package/es/table/typing.d.ts +6 -4
  66. package/lib/actions/dialog-component.js +3 -1
  67. package/lib/actions/dialog-form.js +3 -1
  68. package/lib/actions/dialog.js +3 -1
  69. package/lib/actions/index.js +3 -2
  70. package/lib/actions/index.scss +3 -0
  71. package/lib/actions/utils.d.ts +1 -0
  72. package/lib/actions/utils.js +33 -0
  73. package/lib/card/card-container.d.ts +18 -0
  74. package/lib/card/card-container.js +37 -0
  75. package/lib/card/divider.d.ts +6 -0
  76. package/lib/card/divider.js +26 -0
  77. package/lib/card/index.d.ts +68 -32
  78. package/lib/card/index.js +215 -110
  79. package/lib/card/index.scss +174 -9
  80. package/lib/card/selectable.d.ts +13 -0
  81. package/lib/card/selectable.js +60 -0
  82. package/lib/card/utils.d.ts +9 -0
  83. package/lib/card/utils.js +41 -0
  84. package/lib/form/Components/ProField/index.js +1 -6
  85. package/lib/form/Filter/index.js +5 -6
  86. package/lib/form/ProForm/index.js +41 -14
  87. package/lib/form/ProForm/index.scss +0 -1
  88. package/lib/form/ProForm/useAutoSubmit.d.ts +1 -1
  89. package/lib/form/ProForm/useAutoSubmit.js +3 -3
  90. package/lib/form/ProForm/useInitialRequest.d.ts +1 -1
  91. package/lib/form/ProForm/useInitialRequest.js +2 -2
  92. package/lib/form/SchemaForm/initializeDataSource.js +1 -1
  93. package/lib/form/SchemaForm/initializeFormButton.js +5 -2
  94. package/lib/form/SchemaForm/initializeRequest.js +5 -2
  95. package/lib/form/SchemaForm/initializeRules.js +1 -1
  96. package/lib/form/SchemaForm/reactions.d.ts +5 -4
  97. package/lib/form/SchemaForm/reactions.js +23 -12
  98. package/lib/form/locales/validate.d.ts +159 -0
  99. package/lib/form/locales/validate.js +165 -0
  100. package/lib/form/typing.d.ts +4 -3
  101. package/lib/index.d.ts +1 -1
  102. package/lib/index.js +3 -1
  103. package/lib/info/components/InfoGroup/index.js +5 -2
  104. package/lib/info/components/InfoValueItem/index.js +4 -6
  105. package/lib/info/components/baseInfo/index.js +4 -2
  106. package/lib/info/components/tableInfo/index.js +10 -6
  107. package/lib/info/index.js +24 -10
  108. package/lib/info/typing.d.ts +6 -0
  109. package/lib/nocode/configurators/Card.js +39 -12
  110. package/lib/sidebar/components/sidebar-container/index.d.ts +5 -0
  111. package/lib/sidebar/components/sidebar-container/index.js +93 -0
  112. package/lib/sidebar/components/sidebar-container/index.scss +18 -0
  113. package/lib/sidebar/components/tree/index.d.ts +4 -0
  114. package/lib/sidebar/components/tree/index.js +112 -0
  115. package/lib/sidebar/index.d.ts +5 -0
  116. package/lib/sidebar/index.js +87 -0
  117. package/lib/sidebar/index.scss +3 -0
  118. package/lib/sidebar/typing.d.ts +51 -0
  119. package/lib/sidebar/typing.js +5 -0
  120. package/lib/table/components/Layout/index.js +1 -1
  121. package/lib/table/components/ToolBar/FilterColumnIcon.js +2 -24
  122. package/lib/table/components/ToolBar/index.scss +0 -3
  123. package/lib/table/index.js +27 -9
  124. package/lib/table/index.scss +1 -0
  125. package/lib/table/typing.d.ts +6 -4
  126. package/package.json +4 -4
@@ -40,6 +40,8 @@ var _lodash = _interopRequireDefault(require("lodash.debounce"));
40
40
 
41
41
  var _classnames = _interopRequireDefault(require("classnames"));
42
42
 
43
+ var _pageContainer = _interopRequireDefault(require("../page-container"));
44
+
43
45
  var _typing = require("./typing");
44
46
 
45
47
  Object.keys(_typing).forEach(function (key) {
@@ -53,7 +55,7 @@ Object.keys(_typing).forEach(function (key) {
53
55
  }
54
56
  });
55
57
  });
56
- var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest"];
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"];
57
59
 
58
60
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
59
61
 
@@ -139,6 +141,7 @@ var ProTable = function ProTable(props) {
139
141
  getRowSelection = props.getRowSelection,
140
142
  primaryKey = props.primaryKey,
141
143
  footerAction = props.footerAction,
144
+ footer = props.footer,
142
145
  url = props.url,
143
146
  pageKey = props.pageKey,
144
147
  pageSizeKey = props.pageSizeKey,
@@ -279,10 +282,10 @@ var ProTable = function ProTable(props) {
279
282
 
280
283
  var dataFilterForm = (0, _react.useMemo)(function () {
281
284
  return (0, _form.createForm)();
282
- }, []); // 获取内容区是否超出一屏(仅支持全家桶)
285
+ }, []); // TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
283
286
 
284
287
  var getFooterSuctionState = function getFooterSuctionState() {
285
- var containerDom = document.querySelector('.teamix-pro-page-container');
288
+ var containerDom = document.querySelector('.teamix-pro-page-container-scroll-container');
286
289
 
287
290
  if (containerDom) {
288
291
  var offsetHeight = containerDom.offsetHeight;
@@ -293,6 +296,11 @@ var ProTable = function ProTable(props) {
293
296
  } else {
294
297
  setFooterSuctionState(false);
295
298
  }
299
+ } else {
300
+ // 非全家桶用户暂时不判断滚动条逻辑
301
+ if (footerSuction) {
302
+ setFooterSuctionState(true);
303
+ }
296
304
  }
297
305
  }; // rowSelection 相关
298
306
 
@@ -408,7 +416,9 @@ var ProTable = function ProTable(props) {
408
416
  return _request(params);
409
417
  },
410
418
  request: function request(params) {
411
- return _request(params);
419
+ if (dataFilterForm.validate()) {
420
+ _request(params);
421
+ }
412
422
  },
413
423
  reset: function reset() {
414
424
  var _actionRef$current, _actionRef$current$se;
@@ -695,7 +705,7 @@ var ProTable = function ProTable(props) {
695
705
  var renderFooterAction = function renderFooterAction() {
696
706
  var _footerAction$actions;
697
707
 
698
- if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (_footerAction$actions = footerAction.actions) === null || _footerAction$actions === void 0 ? void 0 : _footerAction$actions.length) > 0) {
708
+ if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (_footerAction$actions = footerAction.actions) === null || _footerAction$actions === void 0 ? void 0 : _footerAction$actions.length) >= 0) {
699
709
  // 默认 context
700
710
  var defaultContext = {
701
711
  action: actionRef.current,
@@ -757,7 +767,7 @@ var ProTable = function ProTable(props) {
757
767
  }
758
768
  }
759
769
 
760
- if (showPagination || footerAction) {
770
+ if (showPagination) {
761
771
  return /*#__PURE__*/_react.default.createElement("div", {
762
772
  className: cls('footer', {
763
773
  'footer-has-rowSelection': rowSelection
@@ -786,6 +796,14 @@ var ProTable = function ProTable(props) {
786
796
  return onChangePaginationSize(number);
787
797
  }
788
798
  }, props.paginationProps))));
799
+ } else if (!showPagination) {
800
+ return /*#__PURE__*/_react.default.createElement("div", {
801
+ className: cls('footer', {
802
+ 'footer-has-rowSelection': rowSelection
803
+ })
804
+ }, renderRowSelection(), /*#__PURE__*/_react.default.createElement("div", {
805
+ className: cls('footer-right-wrapper')
806
+ }, showSkeleton ? /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Footer.Pagination, null) : footer));
789
807
  }
790
808
  };
791
809
 
@@ -795,11 +813,11 @@ var ProTable = function ProTable(props) {
795
813
  }, /*#__PURE__*/_react.default.createElement("div", {
796
814
  className: cls({
797
815
  '': true,
798
- fullscreen: fullscreenState,
799
- 'footer-suction': footerSuctionState && footerSuction
816
+ fullscreen: fullscreenState // 'footer-suction': footerSuctionState && footerSuction,
817
+
800
818
  }),
801
819
  ref: tableRef
802
- }, renderTable(), renderFooter()));
820
+ }, renderTable(), footerSuctionState && footerSuction && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && renderFooter()));
803
821
  };
804
822
 
805
823
  var _default = ProTable;
@@ -13,6 +13,7 @@ $fullscreenPadding: 24px;
13
13
  --checkbox-semi-select-icon-content: '\ead5';
14
14
  &-footer {
15
15
  padding: 8px 0;
16
+ width: 100%;
16
17
  }
17
18
  &-footer-fixed {
18
19
  position: fixed;
@@ -4,7 +4,7 @@
4
4
  import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
5
5
  import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
6
6
  import { IFilterProps } from '../form';
7
- import { ActionGroupProps, ProActionButtonProps } from '../actions';
7
+ import { ProActionGroupProps, ProActionButtonProps } from '../actions';
8
8
  import { PaginationProps } from '@alicloudfe/components/types/pagination';
9
9
  import { HeaderProps as ProTableHeaderProps } from '@teamix/utils';
10
10
  import { Method } from 'axios';
@@ -50,7 +50,7 @@ export declare type ProTableColumnProps = {
50
50
  /** 表头的过滤菜单宽度 */
51
51
  filtersWidth?: string | number;
52
52
  /** 操作组配置 */
53
- actionSchema?: ActionGroupProps;
53
+ actionSchema?: ProActionGroupProps;
54
54
  /** 指定列对应的字段,支持`a.b`形式的快速取值 和 数组取值 */
55
55
  dataIndex?: string | string[];
56
56
  /** 指定 valueType 为日期时间格式时,可以格式化日期时间 */
@@ -99,7 +99,9 @@ export declare type ProTableProps = {
99
99
  /** 获取内置 rowSelection */
100
100
  getRowSelection?: (rowSelection: rowSelectionType) => void;
101
101
  /** 表格底部(左侧)配置 */
102
- footerAction?: ActionGroupProps | React.ReactNode;
102
+ footerAction?: ProActionGroupProps | React.ReactNode;
103
+ /** 表格底部(右层)配置 */
104
+ footer?: React.ReactNode;
103
105
  /** 筛选区自动搜索的防抖时间(毫秒) */
104
106
  filterDebounce?: number;
105
107
  /** ProTable action 的引用,便于手动触发一些方法 */
@@ -211,7 +213,7 @@ export declare type ProTableTopAreaProps = {
211
213
  /** 标题区 */
212
214
  header?: ProTableHeaderProps;
213
215
  /** 主操作区 */
214
- mainAction?: ActionGroupProps | React.ReactNode;
216
+ mainAction?: ProActionGroupProps | React.ReactNode;
215
217
  /** 工具栏区 */
216
218
  toolBar?: boolean | ProTableToolBarItem[];
217
219
  /** 快捷操作区 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.2.4",
3
+ "version": "1.2.8",
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.2",
26
- "@formily/react": "2.0.2",
27
- "@teamix/formily": "2.0.2",
25
+ "@formily/core": "2.0.4",
26
+ "@formily/react": "2.0.4",
27
+ "@teamix/formily": "2.0.4",
28
28
  "@teamix/hooks": "^0.1.0",
29
29
  "@teamix/pop-confirm": "^1.2.2",
30
30
  "@teamix/pro-field": "^1.0.0",