@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
@@ -0,0 +1,101 @@
1
+ var _excluded = ["mode", "items", "shape", "children"];
2
+
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+
7
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+
9
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+
11
+ 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; }
12
+
13
+ import React, { useMemo } from 'react';
14
+ import { Step, Timeline } from '@alicloudfe/components';
15
+ import ProStepItem from './ProStepItem';
16
+
17
+ var ProStep = function ProStep(props) {
18
+ var mode = props.mode,
19
+ items = props.items,
20
+ shape = props.shape,
21
+ children = props.children,
22
+ others = _objectWithoutProperties(props, _excluded);
23
+
24
+ var current = props.current,
25
+ labelPlacement = props.labelPlacement,
26
+ readOnly = props.readOnly,
27
+ animation = props.animation,
28
+ size = props.size;
29
+ var fold = props.fold; // 判断渲染组件是不是 ProStepItem, 并返回筛选后的children
30
+
31
+ var renderChildren = useMemo(function () {
32
+ return React.Children.map(children, function (child, index) {
33
+ var childElement = child;
34
+ var displayName = childElement.type.displayName;
35
+
36
+ if (displayName === 'ProStepItem') {
37
+ return /*#__PURE__*/React.cloneElement(childElement, {
38
+ _size: size,
39
+ _mode: mode,
40
+ _index: index,
41
+ _current: current,
42
+ _shape: shape
43
+ });
44
+ } // 如果不是 ProStepItem
45
+
46
+
47
+ console.error('Warning: ProStep has a child which is not a ProStepItem component');
48
+ });
49
+ }, [children]); // 设置circle, 覆盖 dot 阻止重新渲染节点样式
50
+
51
+ var shapeMap = function shapeMap() {
52
+ if (shape === 'arrow') return 'arrow';
53
+ return 'circle';
54
+ }; // 渲染 ProStepItem
55
+
56
+
57
+ var renderItem = function renderItem() {
58
+ // 传递了 item 采用 item 渲染数组的方式
59
+ if (items) {
60
+ return items.map(function (item, index) {
61
+ return /*#__PURE__*/React.createElement(ProStepItem, _objectSpread({
62
+ key: index,
63
+ _mode: mode,
64
+ _shape: shape,
65
+ _index: index,
66
+ _current: current,
67
+ _size: size
68
+ }, item));
69
+ });
70
+ } else {
71
+ return renderChildren;
72
+ }
73
+ }; // 渲染 ProStep
74
+
75
+
76
+ var renderProStep = function renderProStep() {
77
+ if (mode === 'ver') {
78
+ return /*#__PURE__*/React.createElement(Timeline, _objectSpread({
79
+ fold: fold
80
+ }, others), renderItem());
81
+ }
82
+
83
+ return /*#__PURE__*/React.createElement(Step, _objectSpread({
84
+ current: current,
85
+ shape: shapeMap(),
86
+ labelPlacement: labelPlacement,
87
+ readOnly: readOnly,
88
+ animation: animation
89
+ }, others), renderItem());
90
+ };
91
+
92
+ return /*#__PURE__*/React.createElement("div", {
93
+ className: "teamix-pro-step"
94
+ }, renderProStep());
95
+ };
96
+
97
+ ProStep.Item = ProStepItem;
98
+ ProStep.defaultProps = {
99
+ mode: 'hoz'
100
+ };
101
+ export { ProStep, ProStepItem };
@@ -0,0 +1,96 @@
1
+ import { ItemProps as StepItemProps } from '@alicloudfe/components/types/step';
2
+ import { ItemProps as TimeLineItemProps } from '@alicloudfe/components/types/timeline';
3
+ import { ReactNode } from 'react';
4
+ import { ProTagItem } from '@teamix/utils';
5
+ export declare type ProStepItemStatus = 'success' | 'fail' | 'process' | 'warning' | 'wait';
6
+ export declare type ModeStatusFromProStep = {
7
+ _mode?: string | 'hoz' | 'ver';
8
+ };
9
+ export declare type FoldProps = {
10
+ foldArea: [number, number];
11
+ foldShow: boolean;
12
+ };
13
+ export declare type ProStepProps = HozStepProps | VerTimeLineProps;
14
+ export declare type ProStepBaseProps = {
15
+ /** 步骤条:节点展示类型*/
16
+ shape?: 'icon' | 'arrow' | 'dot' | 'number';
17
+ /** style */
18
+ style?: React.CSSProperties;
19
+ /** className */
20
+ className?: string;
21
+ } & React.HTMLAttributes<HTMLElement>;
22
+ export interface HozStepProps extends ProStepBaseProps {
23
+ /** 当前组件的展示形式 */
24
+ mode?: 'hoz';
25
+ /** 内部渲染自组件 */
26
+ items?: HozStepItemProps[];
27
+ /** 步骤条:当前步骤 */
28
+ current?: number;
29
+ /** 步骤条: 横向布局时( direction 为 hoz )的内容排列*/
30
+ labelPlacement?: 'hoz' | 'ver';
31
+ /** 步骤条: 是否可读模式 */
32
+ readOnly?: boolean;
33
+ /** 步骤条: 是否开启动效 */
34
+ animation?: boolean;
35
+ /**dot 形态下切换size */
36
+ size?: 'normal' | 'small';
37
+ }
38
+ export interface VerTimeLineProps extends ProStepBaseProps {
39
+ /** 当前组件的展示形式 */
40
+ mode?: 'ver';
41
+ /** 内部渲染自组件 */
42
+ items?: VerStepItemProps[];
43
+ /** 时间线: 自定义折叠选项 */
44
+ fold?: FoldProps[];
45
+ }
46
+ export interface ProStepItemBaseProps {
47
+ /**步骤条:节点展示类型 */
48
+ _shape?: 'icon' | 'arrow' | 'dot' | 'number';
49
+ /**节点索引 */
50
+ _index?: number;
51
+ /**活跃节点 */
52
+ _current?: number;
53
+ /**节点状态 */
54
+ status?: string | ProStepItemStatus;
55
+ /**节点设置为 icon 图标 */
56
+ icon?: string;
57
+ /**节点的内容 */
58
+ content?: ReactNode;
59
+ /**节点标题 */
60
+ title?: ReactNode;
61
+ /**自定义渲染 */
62
+ dotRender?: (index?: number, status?: string) => ReactNode;
63
+ /**点击事件 */
64
+ onClick?: (index: number) => void;
65
+ /**百分比展示 */
66
+ percent?: number;
67
+ /**是否禁用当前节点 */
68
+ disabled?: boolean;
69
+ }
70
+ export interface HozStepItemProps extends ProStepItemBaseProps {
71
+ /**dot 形态下切换size */
72
+ _size?: 'normal' | 'small';
73
+ }
74
+ export interface VerStepItemProps extends ProStepItemBaseProps {
75
+ /**节点副标题,在 timeline 可以展示格式化后的时间 */
76
+ subTitle?: ReactNode;
77
+ /**节点对应描述 */
78
+ discription?: ReactNode;
79
+ /**节点的 tag */
80
+ tags?: ProTagItem[] | ReactNode;
81
+ /**左侧展示内容 */
82
+ timeLeft?: ReactNode;
83
+ /**头像 */
84
+ image?: string | ReactNode;
85
+ /**是否需要 animation 动画 */
86
+ animation?: boolean;
87
+ /**卡片是否可折叠 */
88
+ collapsible?: boolean;
89
+ /**默认是否折叠,用于非受控模式 */
90
+ defaultCollapsed?: boolean;
91
+ /**是否折叠,受控模式 */
92
+ collapsed?: boolean;
93
+ /**折叠状态改变的回调函数 */
94
+ onCollapse?: (collapsed: boolean) => void;
95
+ }
96
+ export declare type ProStepItemProps = (HozStepItemProps | VerStepItemProps) & React.HTMLAttributes<HTMLElement> & StepItemProps & TimeLineItemProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -150,8 +150,6 @@ var Filter = function Filter(props) {
150
150
  setVisible(!visible);
151
151
  }
152
152
  }),
153
- //@ts-ignore
154
- v2: true,
155
153
  triggerType: ['click'],
156
154
  align: "tl bl",
157
155
  visible: visible,
@@ -189,20 +187,7 @@ var Filter = function Filter(props) {
189
187
  } // 需要带上其他所有的信息
190
188
 
191
189
 
192
- var rules = (_actionRef$current$ge5 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge5 !== void 0 ? _actionRef$current$ge5 : {};
193
- var params = Object.fromEntries([].concat(_toConsumableArray(Object.entries(rules).map(function (_ref5) {
194
- var _ref6 = _slicedToArray(_ref5, 2),
195
- k = _ref6[0],
196
- v = _ref6[1];
197
-
198
- if (v) {
199
- return [k, v.params];
200
- }
201
-
202
- return null;
203
- })), [[column.dataIndex, param]]).filter(function (item) {
204
- return item && (item === null || item === void 0 ? void 0 : item[1]);
205
- })); // 再设置所有的列筛选状态
190
+ var rules = (_actionRef$current$ge5 = (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : (_actionRef$current3$g2 = _actionRef$current3$g.call(_actionRef$current3)) === null || _actionRef$current3$g2 === void 0 ? void 0 : _actionRef$current3$g2.filterRules) !== null && _actionRef$current$ge5 !== void 0 ? _actionRef$current$ge5 : {}; // 再设置所有的列筛选状态
206
191
 
207
192
  (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$s = _actionRef$current4.setFilterRules) === null || _actionRef$current4$s === void 0 ? void 0 : _actionRef$current4$s.call(_actionRef$current4, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
208
193
  rules: selected,
@@ -220,7 +205,7 @@ var Filter = function Filter(props) {
220
205
  } // 发送请求
221
206
 
222
207
 
223
- (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$r = _actionRef$current6.request) === null || _actionRef$current6$r === void 0 ? void 0 : _actionRef$current6$r.call(_actionRef$current6, _objectSpread(_objectSpread({}, params), {}, _defineProperty({}, targetPageKey, 1)));
208
+ (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$r = _actionRef$current6.request) === null || _actionRef$current6$r === void 0 ? void 0 : _actionRef$current6$r.call(_actionRef$current6, _defineProperty({}, targetPageKey, 1));
224
209
  (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7); // 清空表格选择
225
210
 
226
211
  (_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);
@@ -1,4 +1,4 @@
1
- var _excluded = ["header", "mainAction", "extra", "actionRef", "dataFilter", "dataFilterForm", "rowSelection"];
1
+ var _excluded = ["header", "mainAction", "extra", "actionRef", "dataFilter", "dataFilterFormRef", "rowSelection"];
2
2
 
3
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
 
@@ -8,35 +8,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
8
8
 
9
9
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
10
 
11
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
-
13
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
-
15
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
-
17
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
18
-
19
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
20
-
21
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
-
23
11
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
24
12
 
25
13
  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; }
26
14
 
27
- import React, { useEffect, useState, isValidElement } from 'react';
15
+ import React, { isValidElement } from 'react';
28
16
  import { Header, baseClass } from '@teamix/utils';
29
- import { Button, Badge } from '@alicloudfe/components';
30
- import TeamixIcon from '@teamix/icon';
31
17
  import { ProActionGroup } from '../../../actions';
32
- import { SimpleFilter, AdvancedFilter, formilyReactive } from '../../../form';
33
- import { getMessage } from '@teamix/utils';
18
+ import { QueryFilter, QueryFilterLayout } from '../../../form';
34
19
  import ToolBar from '../ToolBar';
35
20
  import QuickAction from '../QuickAction';
36
- import isEmpty from 'lodash.isempty';
37
21
  import './index.scss';
38
22
  var cls = baseClass('teamix-pro-table-layout');
39
- var toJS = formilyReactive.toJS;
40
23
 
41
24
  var Layout = function Layout(props) {
42
25
  var header = props.header,
@@ -44,27 +27,10 @@ var Layout = function Layout(props) {
44
27
  extra = props.extra,
45
28
  actionRef = props.actionRef,
46
29
  dataFilter = props.dataFilter,
47
- dataFilterForm = props.dataFilterForm,
30
+ dataFilterFormRef = props.dataFilterFormRef,
48
31
  rowSelection = props.rowSelection,
49
- otherProps = _objectWithoutProperties(props, _excluded);
50
-
51
- var mode = dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.mode;
32
+ otherProps = _objectWithoutProperties(props, _excluded); // 渲染主操作区
52
33
 
53
- var _useState = useState((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand) || false),
54
- _useState2 = _slicedToArray(_useState, 2),
55
- expand = _useState2[0],
56
- setExpand = _useState2[1];
57
-
58
- var _useState3 = useState(false),
59
- _useState4 = _slicedToArray(_useState3, 2),
60
- hasDot = _useState4[0],
61
- setHasDot = _useState4[1];
62
-
63
- useEffect(function () {
64
- if (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand) {
65
- setExpand(dataFilter.expand);
66
- }
67
- }, [dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand]); // 渲染主操作区
68
34
 
69
35
  var renderMainAction = function renderMainAction() {
70
36
  var _mainAction$actions;
@@ -90,95 +56,66 @@ var Layout = function Layout(props) {
90
56
  context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context)
91
57
  })));
92
58
  } else return mainAction;
93
- }; // 渲染 mode='inline' 数据过滤区
94
-
95
-
96
- var renderInlineFilter = function renderInlineFilter() {
97
- var _dataFilter$schema;
98
-
99
- if (dataFilter && (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) > 0) {
100
- return /*#__PURE__*/React.createElement("div", {
101
- className: cls('inline-filter')
102
- }, /*#__PURE__*/React.createElement(SimpleFilter, _objectSpread({
103
- form: dataFilterForm
104
- }, dataFilter)));
105
- }
106
- }; // 渲染 mode='panel' 数据过滤区
59
+ }; // 渲染新版 QueryFilter
107
60
 
108
61
 
109
- var renderPanelFilter = function renderPanelFilter() {
62
+ var renderQueryFilter = function renderQueryFilter() {
110
63
  if (dataFilter) {
111
- var _dataFilter$schema2;
64
+ var _dataFilter$schema;
112
65
 
113
66
  if ( /*#__PURE__*/isValidElement(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content)) {
114
- return /*#__PURE__*/React.createElement("div", {
115
- className: cls('panel-filter'),
116
- style: {
117
- display: expand ? 'block' : 'none'
118
- }
119
- }, dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content);
120
- } else if ((dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) >= 0) {
121
- return /*#__PURE__*/React.createElement("div", {
122
- className: cls('panel-filter'),
123
- style: {
124
- display: expand ? 'block' : 'none'
125
- }
126
- }, /*#__PURE__*/React.createElement(AdvancedFilter, _objectSpread({
127
- form: dataFilterForm
128
- }, dataFilter)));
67
+ // 自定义渲染内容
68
+ return /*#__PURE__*/React.createElement(QueryFilterLayout, _objectSpread({
69
+ onExpand: function onExpand(expand) {
70
+ // 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
71
+ setTimeout(function () {
72
+ var _actionRef$current, _actionRef$current$ge;
73
+
74
+ if ((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge = _actionRef$current.getState) === null || _actionRef$current$ge === void 0 ? void 0 : _actionRef$current$ge.call(_actionRef$current).fullScreenState) {
75
+ var _actionRef$current2, _actionRef$current2$r;
76
+
77
+ (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2);
78
+ }
79
+ });
80
+ (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
81
+ },
82
+ panelContent: dataFilter.content,
83
+ addonBefore: renderMainAction(),
84
+ addonAfter: /*#__PURE__*/React.createElement(React.Fragment, null, extra && !header && /*#__PURE__*/React.createElement(QuickAction, {
85
+ actionRef: actionRef,
86
+ quickAction: extra,
87
+ rowSelection: rowSelection
88
+ }), /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
89
+ actionRef: actionRef
90
+ }, otherProps)))
91
+ }, dataFilter));
92
+ } else if ((dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema = dataFilter.schema) === null || _dataFilter$schema === void 0 ? void 0 : _dataFilter$schema.length) >= 0) {
93
+ return /*#__PURE__*/React.createElement(QueryFilter, _objectSpread({
94
+ formRef: dataFilterFormRef,
95
+ onExpand: function onExpand(expand) {
96
+ // 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
97
+ setTimeout(function () {
98
+ var _actionRef$current3, _actionRef$current3$g;
99
+
100
+ if ((_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : _actionRef$current3$g.call(_actionRef$current3).fullScreenState) {
101
+ var _actionRef$current4, _actionRef$current4$r;
102
+
103
+ (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$r = _actionRef$current4.resetTableMaxBodyHeight) === null || _actionRef$current4$r === void 0 ? void 0 : _actionRef$current4$r.call(_actionRef$current4);
104
+ }
105
+ });
106
+ (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
107
+ },
108
+ addonBefore: renderMainAction(),
109
+ addonAfter: /*#__PURE__*/React.createElement(React.Fragment, null, extra && !header && /*#__PURE__*/React.createElement(QuickAction, {
110
+ actionRef: actionRef,
111
+ quickAction: extra,
112
+ rowSelection: rowSelection
113
+ }), /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
114
+ actionRef: actionRef
115
+ }, otherProps)))
116
+ }, dataFilter));
129
117
  }
130
118
  }
131
- }; // 渲染过滤器按钮
132
-
133
-
134
- var renderFilterBtn = function renderFilterBtn() {
135
- var handleBtnClick = function handleBtnClick() {
136
- setExpand(!expand);
137
- var filterValues = Object.values(toJS(dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.values)).filter(function (v) {
138
- return !isEmpty(v);
139
- }); // console.log('filterValues', filterValues);
140
-
141
- if (filterValues && (filterValues === null || filterValues === void 0 ? void 0 : filterValues.length) > 0) {
142
- setHasDot(true);
143
- } else {
144
- setHasDot(false);
145
- } // 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
146
-
147
-
148
- setTimeout(function () {
149
- var _actionRef$current, _actionRef$current$ge;
150
-
151
- if ((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge = _actionRef$current.getState) === null || _actionRef$current$ge === void 0 ? void 0 : _actionRef$current$ge.call(_actionRef$current).fullScreenState) {
152
- var _actionRef$current2, _actionRef$current2$r;
153
-
154
- (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2);
155
- }
156
- });
157
- };
158
-
159
- if (mode === 'panel') {
160
- if (expand === false && hasDot) {
161
- return /*#__PURE__*/React.createElement(Badge, {
162
- dot: true,
163
- className: cls('filter-btn')
164
- }, /*#__PURE__*/React.createElement(Button, {
165
- onClick: handleBtnClick,
166
- style: {
167
- minWidth: 'unset'
168
- }
169
- }, /*#__PURE__*/React.createElement(TeamixIcon, {
170
- type: expand ? 'up-line' : 'filter-line'
171
- }), getMessage('filter')));
172
- } else return /*#__PURE__*/React.createElement(Button, {
173
- onClick: handleBtnClick,
174
- className: cls('filter-btn'),
175
- style: {
176
- minWidth: 'unset'
177
- }
178
- }, /*#__PURE__*/React.createElement(TeamixIcon, {
179
- type: expand ? 'up-line' : 'filter-line'
180
- }), getMessage('filter'));
181
- }
182
119
  }; // 区域组合渲染
183
120
 
184
121
 
@@ -194,61 +131,21 @@ var Layout = function Layout(props) {
194
131
  actionRef: actionRef,
195
132
  quickAction: extra,
196
133
  rowSelection: rowSelection
197
- }))), /*#__PURE__*/React.createElement("div", {
198
- className: cls('wrapper')
199
- }, /*#__PURE__*/React.createElement("div", {
200
- className: cls('left')
201
- }, mainAction && renderMainAction(), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/React.createElement("div", {
202
- className: cls('right')
203
- }, /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
204
- actionRef: actionRef
205
- }, otherProps)))), mode === 'panel' && renderPanelFilter());
134
+ }))), renderQueryFilter());
206
135
  } else if (header && !mainAction) {
207
136
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
208
137
  className: cls('wrapper')
209
138
  }, /*#__PURE__*/React.createElement("div", {
210
139
  className: cls('left')
211
- }, header && /*#__PURE__*/React.createElement(Header, _objectSpread({}, header)), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/React.createElement("div", {
212
- className: cls('right')
213
- }, extra && /*#__PURE__*/React.createElement(QuickAction, {
214
- actionRef: actionRef,
215
- quickAction: extra,
216
- rowSelection: rowSelection
217
- }), /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
218
- actionRef: actionRef
219
- }, otherProps)))), mode === 'panel' && renderPanelFilter());
140
+ }, header && /*#__PURE__*/React.createElement(Header, _objectSpread({}, header)), renderQueryFilter())));
220
141
  } else if (!header && mainAction) {
221
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
222
- className: cls('wrapper')
223
- }, /*#__PURE__*/React.createElement("div", {
224
- className: cls('left')
225
- }, mainAction && renderMainAction(), mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/React.createElement("div", {
226
- className: cls('right')
227
- }, extra && /*#__PURE__*/React.createElement(QuickAction, {
228
- actionRef: actionRef,
229
- quickAction: extra,
230
- rowSelection: rowSelection
231
- }), /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
232
- actionRef: actionRef
233
- }, otherProps)))), mode === 'panel' && renderPanelFilter());
142
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderQueryFilter());
234
143
  } else if (!header && !mainAction) {
235
- if (!dataFilterForm && !extra) {
144
+ if (!dataFilterFormRef && !extra) {
236
145
  return null;
237
146
  }
238
147
 
239
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
240
- className: cls('wrapper')
241
- }, /*#__PURE__*/React.createElement("div", {
242
- className: cls('left')
243
- }, mode === 'panel' && renderFilterBtn(), mode === 'inline' && renderInlineFilter()), /*#__PURE__*/React.createElement("div", {
244
- className: cls('right')
245
- }, extra && /*#__PURE__*/React.createElement(QuickAction, {
246
- actionRef: actionRef,
247
- quickAction: extra,
248
- rowSelection: rowSelection
249
- }), /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
250
- actionRef: actionRef
251
- }, otherProps)))), mode === 'panel' && renderPanelFilter());
148
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderQueryFilter());
252
149
  }
253
150
  };
254
151
 
@@ -9,9 +9,10 @@ $prefix: 'teamix-pro-table-layout';
9
9
  display: flex;
10
10
  justify-content: space-between;
11
11
  margin-bottom: 8px;
12
- &:not(:first-child) {
13
- margin-top: 8px;
14
- }
12
+ // margin-bottom: 8px;
13
+ // &:not(:first-child) {
14
+ // margin-top: 8px;
15
+ // }
15
16
  }
16
17
  &-left {
17
18
  display: flex;
@@ -1,4 +1,7 @@
1
1
  import { PaginationProps } from '@alicloudfe/components/types/pagination';
2
+ import { responsivePaginationType } from '../../typing';
2
3
  import './index.scss';
3
- declare const _default: (props: PaginationProps) => JSX.Element;
4
+ declare const _default: (props: PaginationProps & {
5
+ responsivePaginationType?: responsivePaginationType;
6
+ }) => JSX.Element;
4
7
  export default _default;