@teamix/pro 1.2.21 → 1.2.22

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 (45) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +1506 -334
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/dialog.js +10 -21
  6. package/es/actions/index.d.ts +10 -0
  7. package/es/actions/index.js +11 -16
  8. package/es/form/Filter/AdvancedFilter.js +1 -0
  9. package/es/form/ProForm/index.scss +37 -6
  10. package/es/form/global.scss +1 -0
  11. package/es/index.d.ts +1 -1
  12. package/es/index.js +1 -1
  13. package/es/table/components/Layout/index.js +21 -12
  14. package/es/table/components/Pagination/index.d.ts +1 -0
  15. package/es/table/components/Pagination/index.js +81 -9
  16. package/es/table/components/Pagination/index.scss +22 -0
  17. package/es/table/components/ToolBar/FilterColumnIcon.js +24 -3
  18. package/es/table/components/ToolBar/index.scss +9 -4
  19. package/es/table/index.js +72 -21
  20. package/es/table/index.scss +1 -1
  21. package/es/table/typing.d.ts +4 -2
  22. package/es/table/utils/columnRender.js +2 -1
  23. package/es/table/utils/index.d.ts +7 -0
  24. package/es/table/utils/index.js +38 -4
  25. package/lib/actions/dialog.js +9 -20
  26. package/lib/actions/index.d.ts +10 -0
  27. package/lib/actions/index.js +11 -16
  28. package/lib/form/Filter/AdvancedFilter.js +1 -0
  29. package/lib/form/ProForm/index.scss +37 -6
  30. package/lib/form/global.scss +1 -0
  31. package/lib/index.d.ts +1 -1
  32. package/lib/index.js +1 -1
  33. package/lib/table/components/Layout/index.js +20 -11
  34. package/lib/table/components/Pagination/index.d.ts +1 -0
  35. package/lib/table/components/Pagination/index.js +88 -9
  36. package/lib/table/components/Pagination/index.scss +22 -0
  37. package/lib/table/components/ToolBar/FilterColumnIcon.js +23 -2
  38. package/lib/table/components/ToolBar/index.scss +9 -4
  39. package/lib/table/index.js +71 -20
  40. package/lib/table/index.scss +1 -1
  41. package/lib/table/typing.d.ts +4 -2
  42. package/lib/table/utils/columnRender.js +2 -1
  43. package/lib/table/utils/index.d.ts +7 -0
  44. package/lib/table/utils/index.js +46 -4
  45. package/package.json +1 -1
package/es/table/index.js CHANGED
@@ -40,7 +40,7 @@ import { baseClass, useRequest, request as utilResquest, getDeepValue, getMessag
40
40
  import { ProSkeletonRaw as Skeleton } from '../skeleton';
41
41
  import './index.scss';
42
42
  import Layout from './components/Layout';
43
- import { useActionType } from './utils';
43
+ import { emit, initActionRef, useActionType } from './utils';
44
44
  import getTableProps from './utils/getTableProps';
45
45
  import getTableSortIcons from './utils/getTableSortIcons';
46
46
  import useTableSelection from './utils/useTableSelection';
@@ -66,6 +66,8 @@ var processColumns = function processColumns(columns, initialColumns) {
66
66
  }); // 处理只剩一列批量选择的情况下宽度错乱问题
67
67
 
68
68
  if (filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) {
69
+ var _initialColumns$;
70
+
69
71
  if ((filterColumns === null || filterColumns === void 0 ? void 0 : filterColumns.length) === 1) {
70
72
  var _filterColumns$, _filterColumns$2;
71
73
 
@@ -76,14 +78,14 @@ var processColumns = function processColumns(columns, initialColumns) {
76
78
  if ((_filterColumns$2 = filterColumns[0]) === null || _filterColumns$2 === void 0 ? void 0 : _filterColumns$2.lock) {
77
79
  filterColumns[0].lock = false;
78
80
  }
79
- } else {
80
- var _initialColumns$, _initialColumns$2;
81
+ } else if (((_initialColumns$ = initialColumns[0]) === null || _initialColumns$ === void 0 ? void 0 : _initialColumns$.columnFilters) !== false) {
82
+ var _initialColumns$2, _initialColumns$3;
81
83
 
82
- if ((_initialColumns$ = initialColumns[0]) === null || _initialColumns$ === void 0 ? void 0 : _initialColumns$.width) {
84
+ if ((_initialColumns$2 = initialColumns[0]) === null || _initialColumns$2 === void 0 ? void 0 : _initialColumns$2.width) {
83
85
  filterColumns[0].width = initialColumns[0].width;
84
86
  }
85
87
 
86
- if ((_initialColumns$2 = initialColumns[0]) === null || _initialColumns$2 === void 0 ? void 0 : _initialColumns$2.lock) {
88
+ if ((_initialColumns$3 = initialColumns[0]) === null || _initialColumns$3 === void 0 ? void 0 : _initialColumns$3.lock) {
87
89
  filterColumns[0].lock = initialColumns[0].lock;
88
90
  }
89
91
  }
@@ -204,8 +206,10 @@ var ProTable = function ProTable(props) {
204
206
  var _useState13 = useState(true),
205
207
  _useState14 = _slicedToArray(_useState13, 2),
206
208
  customTableLoading = _useState14[0],
207
- setCustomTableLoading = _useState14[1];
209
+ setCustomTableLoading = _useState14[1]; // 用于存放 Search 组件之前值的 ref
210
+
208
211
 
212
+ var searchValueRef = useRef('');
209
213
  var tableRef = useRef(null);
210
214
  var actionRef = useRef(); // 传给 table 的过滤后的 columns
211
215
 
@@ -404,9 +408,14 @@ var ProTable = function ProTable(props) {
404
408
  setColumn: function setColumn(newColumns) {
405
409
  var _actionRef$current2, _actionRef$current2$s;
406
410
 
411
+ var update = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
407
412
  var columns = processColumns(newColumns, propsColumns);
408
413
  setFilteredColumns(columns);
409
414
  (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setState) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, 'filterColumns', columns);
415
+
416
+ if (update) {
417
+ emit('refreshFilterState', newColumns);
418
+ }
410
419
  },
411
420
  setSize: function setSize(mode) {
412
421
  _setSize(mode);
@@ -610,10 +619,8 @@ var ProTable = function ProTable(props) {
610
619
  }
611
620
 
612
621
  useEffect(function () {
613
- var _actionRef$current5, _actionRef$current5$i;
614
-
615
- // 初始化 state 状态
616
- actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$i = _actionRef$current5.initState) === null || _actionRef$current5$i === void 0 ? void 0 : _actionRef$current5$i.call(_actionRef$current5); // 监听 浏览器变化 更吸底状态
622
+ // 初始化 actionRef state、callback 此时 actionRef 已初始化完成
623
+ initActionRef(); // 监听 浏览器变化 更吸底状态
617
624
 
618
625
  if (footerSuction) {
619
626
  getFooterSuctionState();
@@ -627,6 +634,14 @@ var ProTable = function ProTable(props) {
627
634
  _request();
628
635
  }
629
636
 
637
+ var searchName = getSearchName();
638
+
639
+ if (searchName) {
640
+ // 如果有初始值,需要赋值
641
+ var initialValues = toJS(dataFilterForm.initialValues);
642
+ searchValueRef.current = initialValues[searchName][1];
643
+ }
644
+
630
645
  return function () {
631
646
  if (autoRefreshTimerRef.current) {
632
647
  clearTimeout(autoRefreshTimerRef.current);
@@ -646,18 +661,54 @@ var ProTable = function ProTable(props) {
646
661
  setSort(nextSort);
647
662
 
648
663
  _request(targetFormatSort(nextSort));
649
- } // 处理 dataFilter 中的 onFilter、onReset
664
+ } // 找到 Search 组件对应的 name
665
+
666
+
667
+ var getSearchName = function getSearchName() {
668
+ var _dataFilter$schema;
669
+
670
+ 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) {
671
+ var searchSchema = dataFilter.schema.find(function (item) {
672
+ return item.component === 'Search';
673
+ });
674
+
675
+ if (searchSchema) {
676
+ var searchName = searchSchema.name;
677
+ return searchName;
678
+ }
679
+ }
680
+ }; // 处理 dataFilter 中的 onFilter、onReset
650
681
 
651
682
 
652
- var dataFilter = _objectSpread(_objectSpread({}, propsDataFilter), {}, {
653
- onFilter: debounce(function () {
654
- (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(_objectSpread({}, toJS(dataFilterForm.values))));
683
+ var dataFilter = _objectSpread(_objectSpread({
684
+ mode: 'inline'
685
+ }, propsDataFilter), {}, {
686
+ onFilter: debounce(function (values) {
687
+ (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onFilter(values));
655
688
 
656
689
  if (dataFilterForm.validate()) {
657
- var _actionRef$current6, _actionRef$current6$c;
690
+ var _actionRef$current5, _actionRef$current5$c;
691
+
692
+ /**
693
+ * 针对 inline 模式下的 Search 组件做特殊处理
694
+ * 当切换条件且输入内容为空的时候,类似[a, ''] => [b, ''] 不触发请求
695
+ */
696
+ if (dataFilter.mode === 'inline') {
697
+ var searchName = getSearchName();
698
+
699
+ if (searchName) {
700
+ var searchValue = values[searchName][1];
658
701
 
659
- // 搜索变化时,暂时先清空选择
660
- (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$c = _actionRef$current6.clearRowSelection) === null || _actionRef$current6$c === void 0 ? void 0 : _actionRef$current6$c.call(_actionRef$current6);
702
+ if (searchValue === (searchValueRef === null || searchValueRef === void 0 ? void 0 : searchValueRef.current)) {
703
+ return;
704
+ }
705
+
706
+ searchValueRef.current = searchValue;
707
+ }
708
+ } // 搜索变化时,暂时先清空选择
709
+
710
+
711
+ (_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);
661
712
  setCurrentPage(1);
662
713
 
663
714
  _request(_defineProperty({}, targetPageKey, 1));
@@ -752,21 +803,21 @@ var ProTable = function ProTable(props) {
752
803
 
753
804
  var renderFooter = function renderFooter() {
754
805
  function onChangePagination(currentPage) {
755
- var _actionRef$current7, _actionRef$current7$c;
806
+ var _actionRef$current6, _actionRef$current6$c;
756
807
 
757
808
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
758
809
  // 翻页暂时先清空选择
759
- (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
810
+ (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$c = _actionRef$current6.clearRowSelection) === null || _actionRef$current6$c === void 0 ? void 0 : _actionRef$current6$c.call(_actionRef$current6);
760
811
  setCurrentPage(currentPage);
761
812
 
762
813
  _request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
763
814
  }
764
815
 
765
816
  function onChangePaginationSize(currentPageSize) {
766
- var _actionRef$current8, _actionRef$current8$c, _request5;
817
+ var _actionRef$current7, _actionRef$current7$c, _request5;
767
818
 
768
819
  // 翻页暂时先清空选择
769
- (_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);
820
+ (_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$c = _actionRef$current7.clearRowSelection) === null || _actionRef$current7$c === void 0 ? void 0 : _actionRef$current7$c.call(_actionRef$current7);
770
821
  setPageSize(currentPageSize);
771
822
  setCurrentPage(1);
772
823
 
@@ -40,7 +40,7 @@ $fullscreenPadding: 24px;
40
40
  justify-content: flex-end;
41
41
  width: 100%;
42
42
  }
43
- .pagination-wrapper {
43
+ .teamix-pro-pagination-wrapper {
44
44
  display: flex;
45
45
  justify-content: flex-end;
46
46
  width: 100%;
@@ -12,7 +12,7 @@ import React from 'react';
12
12
  import type { Form as FormType } from '@formily/core';
13
13
  declare type IFieldRenderProps = keyof ProFieldRenderProps;
14
14
  /** 列record函数 */
15
- declare type ProTableCellFunProp = (value: any, index: number, record: any) => any;
15
+ declare type ProTableCellFunProp = (value: any, index: number, record: any, ...others: any) => any;
16
16
  declare type ITableCellRender = {
17
17
  [key in IFieldRenderProps]?: ProFieldRenderProps[key] | ProTableCellFunProp;
18
18
  } | ((...other: any) => React.ReactNode);
@@ -146,7 +146,7 @@ export declare type ProTableActionType = {
146
146
  /** 全屏展示 */
147
147
  fullScreen?: () => boolean;
148
148
  /** 设置显示列 */
149
- setColumn?: (newColumns: ProColumnProps[]) => void;
149
+ setColumn?: (newColumns: ProColumnProps[], update?: boolean) => void;
150
150
  /** 设置表格大小 */
151
151
  setSize?: (mode: 'small' | 'medium') => void;
152
152
  /** 刷新表格 */
@@ -220,6 +220,8 @@ export declare type ProTableDataFilterProps = {
220
220
  searchUndefined?: boolean;
221
221
  /** 搜索时是否传入值为空字符串的参数,默认不传 */
222
222
  searchEmptyString?: boolean;
223
+ /** 自定义内容 */
224
+ content?: React.ReactNode;
223
225
  } & IFilterProps;
224
226
  export declare type dataFilterProps = ProTableDataFilterProps;
225
227
  export declare type ProTableTopAreaProps = {
@@ -204,7 +204,8 @@ var processRenderFunction = function processRenderFunction() {
204
204
  var value = arguments.length > 1 ? arguments[1] : undefined;
205
205
  var index = arguments.length > 2 ? arguments[2] : undefined;
206
206
  var record = arguments.length > 3 ? arguments[3] : undefined;
207
- var external = ['linkOnClick', 'link', 'value'];
207
+ // ProField render 类型为 function 时。需要表格预先处理以塞入 record
208
+ var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick'];
208
209
  return Object.fromEntries(Object.entries(render).map(function (_ref3) {
209
210
  var _ref4 = _slicedToArray(_ref3, 2),
210
211
  k = _ref4[0],
@@ -1,4 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { ProTableActionType } from '../typing';
3
+ export declare function initActionRef(): void;
4
+ /** table 组件内监听 不对外暴露 */
5
+ export declare function on(fun: any, key: string): void;
6
+ /** table 组件内销毁监听 不对外暴露 */
7
+ export declare function off(key: string): void;
8
+ /** table 组件内触发事件 不对外暴露 */
9
+ export declare function emit(key: string, ...args: any): void;
3
10
  export declare function useActionType<T>(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): void;
4
11
  export declare function cloneDeep<T>(obj: T): T;
@@ -16,7 +16,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
16
16
 
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
- import cloneDeepLodash from 'lodash.clonedeep'; // 组件内全局状态
19
+ import cloneDeepLodash from 'lodash.clonedeep'; // 组件内全局状态 每次初始化 ActionRef 会重新深拷贝对象
20
20
 
21
21
  var state = {
22
22
  fullScreenState: false,
@@ -24,12 +24,16 @@ var state = {
24
24
  filterColumns: []
25
25
  };
26
26
 
27
- var _initState = cloneDeepLodash(state); // 组件内全局监听事件
27
+ var _initState = cloneDeepLodash(state); // state监听事件 每次初始化 ActionRef 会重新深拷贝对象
28
28
 
29
29
 
30
30
  var callback = {
31
31
  fullScreenState: {}
32
- }; // 组件内对全局状态的更改
32
+ };
33
+ var initCallback = cloneDeepLodash(callback); // 所有 ProTable 组件公用一套组件内事件转发机制
34
+
35
+ var tableCallback = {}; // 组件内监听事件
36
+ // 组件内对全局状态的更改
33
37
 
34
38
  var mutations = {
35
39
  getState: function getState() {
@@ -129,8 +133,38 @@ var useOn = function useOn(state) {
129
133
  }
130
134
  });
131
135
  }
132
- };
136
+ }; // 初始化 actionRef
137
+
138
+
139
+ export function initActionRef() {
140
+ state = cloneDeepLodash(_initState);
141
+ callback = cloneDeepLodash(initCallback);
142
+ }
143
+ /** table 组件内监听 不对外暴露 */
144
+
145
+ export function on(fun, key) {
146
+ tableCallback[key] = fun;
147
+ }
148
+ /** table 组件内销毁监听 不对外暴露 */
133
149
 
150
+ export function off(key) {
151
+ if (tableCallback[key]) {
152
+ delete tableCallback[key];
153
+ }
154
+ }
155
+ /** table 组件内触发事件 不对外暴露 */
156
+
157
+ export function emit(key) {
158
+ var fun = tableCallback[key];
159
+
160
+ if (fun) {
161
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
162
+ args[_key2 - 1] = arguments[_key2];
163
+ }
164
+
165
+ fun.apply(void 0, args);
166
+ }
167
+ }
134
168
  export function useActionType(ref, action) {
135
169
  // 合并自定义事件
136
170
  var userAction = _objectSpread(_objectSpread({}, action), mutations);
@@ -187,45 +187,34 @@ function useDialogAction(action, actionContext) {
187
187
  while (1) {
188
188
  switch (_context.prev = _context.next) {
189
189
  case 0:
190
- if (!link) {
191
- _context.next = 5;
192
- break;
193
- }
194
-
195
- (0, _utils.goToLink)(link, history);
196
- onFinish && onFinish();
197
- resolve(true);
198
- return _context.abrupt("return");
199
-
200
- case 5:
201
190
  setLoading(true);
202
191
  footerDescriptionValues = Object.assign({}, footerDescriptionRef === null || footerDescriptionRef === void 0 ? void 0 : (_footerDescriptionRef = footerDescriptionRef.current) === null || _footerDescriptionRef === void 0 ? void 0 : _footerDescriptionRef.values);
203
- _context.prev = 7;
192
+ _context.prev = 2;
204
193
  requestContext = Object.assign({
205
194
  footer: footerDescriptionValues
206
195
  }, context);
207
- _context.next = 11;
196
+ _context.next = 6;
208
197
  return (0, _request.doRequest)(action, requestContext, history, footerDescriptionValues);
209
198
 
210
- case 11:
199
+ case 6:
211
200
  onFinish && onFinish();
212
201
  resolve(true);
213
- _context.next = 20;
202
+ _context.next = 15;
214
203
  break;
215
204
 
216
- case 15:
217
- _context.prev = 15;
218
- _context.t0 = _context["catch"](7);
205
+ case 10:
206
+ _context.prev = 10;
207
+ _context.t0 = _context["catch"](2);
219
208
  setLoading(false);
220
209
  resolve(false);
221
210
  return _context.abrupt("return");
222
211
 
223
- case 20:
212
+ case 15:
224
213
  case "end":
225
214
  return _context.stop();
226
215
  }
227
216
  }
228
- }, _callee, null, [[7, 15]]);
217
+ }, _callee, null, [[2, 10]]);
229
218
  }));
230
219
 
231
220
  return function (_x) {
@@ -46,11 +46,21 @@ export interface ProActionMenuButtonProps extends MenuButtonProps {
46
46
  export declare const ProActionMenuButton: (props: ProActionMenuButtonProps) => JSX.Element;
47
47
  export declare type ProActionProps = ProActionButtonProps | ProActionMenuButtonProps;
48
48
  export declare type ProActionGroupProps = {
49
+ /** 操作组类型:按钮、文字按钮 */
49
50
  type?: 'button' | 'text';
51
+ /** 上下文 */
50
52
  context?: any;
53
+ /** 操作项配置 */
51
54
  actions: ProActionProps[];
55
+ /** 操作按钮最长数量,超出后折叠,默认为4 */
52
56
  max?: number;
57
+ /**
58
+ * @deprecated 建议使用 more 代替
59
+ */
53
60
  moreText?: string;
61
+ /** 更多按钮的配置,只有在actions数量超过max时才有效 */
62
+ more?: string | ProActionButtonProps;
63
+ /** 是否有分割线,只有type="text"时生效,默认有分割线 */
54
64
  divider?: boolean;
55
65
  } & React.HTMLAttributes<HTMLElement>;
56
66
  export declare function ProActionGroup(props: ProActionGroupProps): JSX.Element;
@@ -60,7 +60,7 @@ var _excluded = ["type"],
60
60
  _excluded5 = ["context", "text"],
61
61
  _excluded6 = ["key", "actions"],
62
62
  _excluded7 = ["key", "config"],
63
- _excluded8 = ["type", "divider", "max", "moreText", "context", "actions", "className"];
63
+ _excluded8 = ["type", "divider", "max", "moreText", "more", "context", "actions", "className"];
64
64
 
65
65
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
66
66
 
@@ -329,25 +329,19 @@ function renderCommonActionButton(button, context, isTypeText) {
329
329
  return /*#__PURE__*/_react.default.createElement(ProActionMenuButton, _objectSpread({}, buttonProps));
330
330
  }
331
331
 
332
- function getDefaultMoreButton(type, moreText) {
333
- if (type === 'button') {
334
- return {
335
- label: moreText || (0, _utils.getMessage)('more')
336
- };
337
- }
338
-
339
- if (moreText) {
340
- return {
341
- label: moreText
342
- };
343
- }
344
-
345
- return {
332
+ function getDefaultMoreButton(type, more) {
333
+ var moreConfig = typeof more === 'string' ? {
334
+ children: more
335
+ } : more;
336
+ var defaultConfig = type === 'button' ? {
337
+ children: (0, _utils.getMessage)('more')
338
+ } : {
346
339
  icon: 'more-line',
347
340
  // iconSize: 'small',
348
341
  autoWidth: false,
349
342
  className: 'teamix-pro-actions-text-menu-btn-no-arrow'
350
343
  };
344
+ return Object.assign(defaultConfig, moreConfig);
351
345
  }
352
346
 
353
347
  var MAX_ACTTIONS = 4;
@@ -392,6 +386,7 @@ function ProActionGroup(props) {
392
386
  _props$max = props.max,
393
387
  max = _props$max === void 0 ? MAX_ACTTIONS : _props$max,
394
388
  moreText = props.moreText,
389
+ more = props.more,
395
390
  context = props.context,
396
391
  _props$actions = props.actions,
397
392
  actions = _props$actions === void 0 ? [] : _props$actions,
@@ -404,7 +399,7 @@ function ProActionGroup(props) {
404
399
  }).filter(function (action) {
405
400
  return action.visible !== false;
406
401
  });
407
- var formatedActions = formatGroupActions(filteredActions, max, getDefaultMoreButton(type, moreText));
402
+ var formatedActions = formatGroupActions(filteredActions, max, getDefaultMoreButton(type, more || moreText));
408
403
  return /*#__PURE__*/_react.default.createElement("div", _objectSpread({
409
404
  className: (0, _classnames.default)('teamix-pro-actions', "teamix-pro-actions-type-".concat(type), className, {
410
405
  'teamix-pro-actions-divider': type === 'button' ? false : divider
@@ -72,6 +72,7 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
72
72
  props: {
73
73
  breakpoints: [480, 720, 990, 1200, Infinity],
74
74
  maxColumns: [1, 2, 3, 3, 4],
75
+ maxWidth: [480, 360, 330, 330, 300],
75
76
  columnGap: 16,
76
77
  rowGap: 12
77
78
  },
@@ -186,13 +186,13 @@
186
186
  }
187
187
 
188
188
  // 数组类组件添加按钮
189
- .#{$css-prefix}formily-array-base-addition {
189
+ .#{$form-array}-base-addition {
190
190
  .#{$css-prefix}formily-icon {
191
191
  margin-right: 4px;
192
192
  }
193
193
  }
194
194
  // 数组类ArrayItem Icon 居中
195
- .#{$css-prefix}formily-array-items-item-inner {
195
+ .#{$form-array}-items-item-inner {
196
196
  > .#{$css-prefix}box {
197
197
  > .#{$css-prefix}space-item {
198
198
  > .#{$css-prefix}formily-icon {
@@ -209,7 +209,7 @@
209
209
 
210
210
  // 折叠面板
211
211
  .#{$css-prefix}formily-collapse,
212
- .#{$css-prefix}formily-array-collapse-item {
212
+ .#{$form-array}-collapse-item {
213
213
  .#{$css-prefix}collapse-panel-hidden {
214
214
  .#{$css-prefix}collapse-panel-content {
215
215
  padding-top: 4px;
@@ -261,7 +261,7 @@
261
261
  }
262
262
 
263
263
  // ArrayItems
264
- .#{$css-prefix}formily-array-items {
264
+ .#{$form-array}-items {
265
265
  .#{$css-prefix}formily-grid-layout {
266
266
  > div:last-child {
267
267
  display: flex;
@@ -269,8 +269,39 @@
269
269
  align-items: center;
270
270
  }
271
271
  }
272
- .#{$css-prefix}formily-array-base-remove {
273
- cursor: pointer;
272
+ }
273
+ .#{$form-array}-base-remove,
274
+ .#{$form-array}-base-addition,
275
+ .#{$form-array}-base-move-down,
276
+ .#{$form-array}-base-move-up,
277
+ .#{$form-array}-base-sort-handle,
278
+ .form-array-base-icon {
279
+ color: var(--color-fill1-6, #848484);
280
+ &:hover {
281
+ color: var(--color-brand1-6, #0064c8);
282
+ }
283
+ }
284
+ .form-array-base-icon {
285
+ cursor: pointer;
286
+ }
287
+
288
+ // ArrayCard
289
+ .#{$form-array}-cards-item {
290
+ .#{$css-prefix}card-head {
291
+ padding: 16px 20px;
292
+ background-color: var(--color-fill1-2, #f7f7f7);
293
+ .#{$css-prefix}card-head-main {
294
+ margin-top: 0;
295
+ border-bottom: 0;
296
+ height: 22px;
297
+ line-height: 22px;
298
+ .#{$css-prefix}card-title {
299
+ padding-left: 0;
300
+ &::before {
301
+ display: none;
302
+ }
303
+ }
304
+ }
274
305
  }
275
306
  }
276
307
 
@@ -1,6 +1,7 @@
1
1
  @import '~@alicloudfe/components/lib/common-var.scss';
2
2
 
3
3
  $form-item-cls: #{$css-prefix}formily-item;
4
+ $form-array: #{$css-prefix}formily-array;
4
5
  $teamix-pro-form: teamix-pro-form;
5
6
  $teamix-pro-field: teamix-pro-field;
6
7
 
package/lib/index.d.ts CHANGED
@@ -21,5 +21,5 @@ export * from './page-container';
21
21
  export * from './page-header';
22
22
  export * from './skeleton';
23
23
  export * from './table';
24
- declare const version = "1.2.20";
24
+ declare const version = "1.2.21";
25
25
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
package/lib/index.js CHANGED
@@ -253,5 +253,5 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
253
253
  _icon.default.setConfig(_utils.default.getTeamixIconConfig());
254
254
 
255
255
  // export * from './sidebar';
256
- var version = '1.2.20';
256
+ var version = '1.2.21';
257
257
  exports.version = version;
@@ -70,7 +70,7 @@ var Layout = function Layout(props) {
70
70
  rowSelection = props.rowSelection,
71
71
  otherProps = _objectWithoutProperties(props, _excluded);
72
72
 
73
- var mode = (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.mode) || 'inline';
73
+ var mode = dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.mode;
74
74
 
75
75
  var _useState = (0, _react.useState)((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.expand) || false),
76
76
  _useState2 = _slicedToArray(_useState, 2),
@@ -129,17 +129,26 @@ var Layout = function Layout(props) {
129
129
 
130
130
 
131
131
  var renderPanelFilter = function renderPanelFilter() {
132
- var _dataFilter$schema2;
132
+ if (dataFilter) {
133
+ var _dataFilter$schema2;
133
134
 
134
- if (dataFilter && (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) >= 0) {
135
- return /*#__PURE__*/_react.default.createElement("div", {
136
- className: cls('panel-filter'),
137
- style: {
138
- display: expand ? 'block' : 'none'
139
- }
140
- }, /*#__PURE__*/_react.default.createElement(_form.AdvancedFilter, _objectSpread({
141
- form: dataFilterForm
142
- }, dataFilter)));
135
+ if ( /*#__PURE__*/(0, _react.isValidElement)(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content)) {
136
+ return /*#__PURE__*/_react.default.createElement("div", {
137
+ className: cls('panel-filter'),
138
+ style: {
139
+ display: expand ? 'block' : 'none'
140
+ }
141
+ }, dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.content);
142
+ } else if ((dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) >= 0) {
143
+ return /*#__PURE__*/_react.default.createElement("div", {
144
+ className: cls('panel-filter'),
145
+ style: {
146
+ display: expand ? 'block' : 'none'
147
+ }
148
+ }, /*#__PURE__*/_react.default.createElement(_form.AdvancedFilter, _objectSpread({
149
+ form: dataFilterForm
150
+ }, dataFilter)));
151
+ }
143
152
  }
144
153
  }; // 渲染过滤器按钮
145
154
 
@@ -1,3 +1,4 @@
1
1
  import { PaginationProps } from '@alicloudfe/components/types/pagination';
2
+ import './index.scss';
2
3
  declare const _default: (props: PaginationProps) => JSX.Element;
3
4
  export default _default;