@teamix/pro 1.2.34 → 1.3.2

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 (101) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +1542 -1149
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/dialog-form.d.ts +9 -4
  6. package/es/actions/dialog-form.js +16 -9
  7. package/es/form/Components/ProField/mapDateFormat.d.ts +3 -0
  8. package/es/form/Components/ProField/mapDateFormat.js +113 -0
  9. package/es/form/Filter/AdvancedFilter.js +4 -4
  10. package/es/form/Filter/LightFilter.js +22 -15
  11. package/es/form/Filter/index.js +171 -133
  12. package/es/form/Filter/useSpecialProps.d.ts +1 -1
  13. package/es/form/Filter/useSpecialProps.js +9 -9
  14. package/es/form/ProForm/customComponent.js +2 -1
  15. package/es/form/ProForm/index.scss +8 -8
  16. package/es/form/SchemaForm/index.js +2 -2
  17. package/es/form/SchemaForm/initializeRequest.js +1 -2
  18. package/es/form/SchemaForm/reactions.d.ts +2 -2
  19. package/es/form/SchemaForm/reactions.js +32 -21
  20. package/es/form/fieldTypeMap.d.ts +3 -0
  21. package/es/form/fieldTypeMap.js +3 -0
  22. package/es/form/typing.d.ts +8 -1
  23. package/es/index.d.ts +4 -4
  24. package/es/index.js +4 -4
  25. package/es/nocode/configurators/PageHeader.js +2 -2
  26. package/es/page-header/index.js +7 -3
  27. package/es/table/components/Layout/index.js +2 -2
  28. package/es/table/components/Pagination/index.js +11 -1
  29. package/es/table/components/ToolBar/DensityIcon.js +5 -3
  30. package/es/table/components/ToolBar/FilterColumnIcon.js +12 -3
  31. package/es/table/components/ToolBar/Fullscreen.js +6 -6
  32. package/es/table/components/ToolBar/index.scss +2 -2
  33. package/es/table/index.js +40 -21
  34. package/es/table/index.scss +6 -0
  35. package/es/table/typing.d.ts +13 -6
  36. package/es/table/utils/columnRender.js +6 -0
  37. package/es/timeline/ProTimeLineItem/index.d.ts +5 -0
  38. package/es/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.js +59 -72
  39. package/es/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.scss +34 -86
  40. package/es/timeline/index.d.ts +10 -0
  41. package/es/{step → timeline}/index.js +33 -57
  42. package/es/timeline/index.scss +7 -0
  43. package/es/timeline/typing.d.ts +101 -0
  44. package/es/{step → timeline}/typing.js +0 -0
  45. package/lib/actions/dialog-form.d.ts +9 -4
  46. package/lib/actions/dialog-form.js +16 -9
  47. package/lib/form/Components/ProField/mapDateFormat.d.ts +3 -0
  48. package/lib/form/Components/ProField/mapDateFormat.js +125 -0
  49. package/lib/form/Filter/AdvancedFilter.js +4 -4
  50. package/lib/form/Filter/LightFilter.js +21 -15
  51. package/lib/form/Filter/index.js +170 -132
  52. package/lib/form/Filter/useSpecialProps.d.ts +1 -1
  53. package/lib/form/Filter/useSpecialProps.js +8 -8
  54. package/lib/form/ProForm/customComponent.js +3 -1
  55. package/lib/form/ProForm/index.scss +8 -8
  56. package/lib/form/SchemaForm/index.js +2 -2
  57. package/lib/form/SchemaForm/initializeRequest.js +1 -2
  58. package/lib/form/SchemaForm/reactions.d.ts +2 -2
  59. package/lib/form/SchemaForm/reactions.js +31 -20
  60. package/lib/form/fieldTypeMap.d.ts +3 -0
  61. package/lib/form/fieldTypeMap.js +5 -1
  62. package/lib/form/typing.d.ts +8 -1
  63. package/lib/index.d.ts +4 -4
  64. package/lib/index.js +10 -10
  65. package/lib/nocode/configurators/PageHeader.js +2 -2
  66. package/lib/page-header/index.js +6 -2
  67. package/lib/table/components/Layout/index.js +2 -2
  68. package/lib/table/components/Pagination/index.js +10 -0
  69. package/lib/table/components/ToolBar/DensityIcon.js +5 -3
  70. package/lib/table/components/ToolBar/FilterColumnIcon.js +11 -2
  71. package/lib/table/components/ToolBar/Fullscreen.js +6 -6
  72. package/lib/table/components/ToolBar/index.scss +2 -2
  73. package/lib/table/index.js +40 -21
  74. package/lib/table/index.scss +6 -0
  75. package/lib/table/typing.d.ts +13 -6
  76. package/lib/table/utils/columnRender.js +6 -0
  77. package/lib/timeline/ProTimeLineItem/index.d.ts +5 -0
  78. package/lib/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.js +58 -72
  79. package/lib/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.scss +34 -86
  80. package/lib/timeline/index.d.ts +10 -0
  81. package/lib/{step → timeline}/index.js +38 -58
  82. package/lib/timeline/index.scss +7 -0
  83. package/lib/timeline/typing.d.ts +101 -0
  84. package/lib/{step → timeline}/typing.js +0 -0
  85. package/package.json +1 -1
  86. package/es/step/ProStepItem/components/HozStepItem/index.d.ts +0 -5
  87. package/es/step/ProStepItem/components/HozStepItem/index.js +0 -235
  88. package/es/step/ProStepItem/components/HozStepItem/index.scss +0 -279
  89. package/es/step/ProStepItem/components/VerStepItem/index.d.ts +0 -5
  90. package/es/step/ProStepItem/index.d.ts +0 -4
  91. package/es/step/ProStepItem/index.js +0 -57
  92. package/es/step/index.d.ts +0 -9
  93. package/es/step/typing.d.ts +0 -96
  94. package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +0 -5
  95. package/lib/step/ProStepItem/components/HozStepItem/index.js +0 -258
  96. package/lib/step/ProStepItem/components/HozStepItem/index.scss +0 -279
  97. package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +0 -5
  98. package/lib/step/ProStepItem/index.d.ts +0 -4
  99. package/lib/step/ProStepItem/index.js +0 -69
  100. package/lib/step/index.d.ts +0 -9
  101. package/lib/step/typing.d.ts +0 -96
@@ -4,25 +4,24 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  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; }
6
6
 
7
- import { isFn, isPlainObj, doCommonRequest, getValueByValue } from '@teamix/utils'; // 配置请求
7
+ import { isFn, isPureObj, doCommonRequest, getValueByValue } from '@teamix/utils'; // 配置请求
8
8
 
9
9
  var $request = function $request(field, requestConfig, context, type) {
10
10
  var _field$data;
11
11
 
12
- // let refresh
13
- // if(isStr(type)){
14
- // refresh = field.data?.refreshMap?.[type]
15
- // }else if(isNum(type)){
16
- // }else{
17
- // refresh = field.data?.refresh;
18
- // }
19
- var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
20
- var beforeRequest = requestConfig.beforeRequest,
12
+ var params = requestConfig.params,
13
+ beforeRequest = requestConfig.beforeRequest,
21
14
  onSuccess = requestConfig.onSuccess;
22
- var refreshResult = isPlainObj(refresh) ? refresh : {};
23
15
  var beforeRequestResult = isFn(beforeRequest) ? beforeRequest(field, context) : {};
16
+ /**
17
+ * 主动触发的请求刷新
18
+ */
19
+ // 触发所有配置的请求
20
+
21
+ var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
22
+ var refreshResult = isPureObj(refresh) ? refresh : {};
24
23
  return doCommonRequest(_objectSpread(_objectSpread({}, requestConfig), {}, {
25
- params: _objectSpread(_objectSpread(_objectSpread({}, requestConfig.params), beforeRequestResult), refreshResult),
24
+ params: _objectSpread(_objectSpread(_objectSpread({}, params), beforeRequestResult), refreshResult),
26
25
  beforeRequest: function beforeRequest() {
27
26
  return beforeRequestResult;
28
27
  },
@@ -33,10 +32,12 @@ var $request = function $request(field, requestConfig, context, type) {
33
32
  }; // 通用请求配置上下文
34
33
 
35
34
 
36
- var $common = function $common(services, requestConfig, context, index) {
35
+ var $common = function $common(services, requestConfig, context) {
37
36
  return function (field) {
38
- return services(field, requestConfig, context, index || 'common').then(function (res) {
39
- return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
37
+ return services(field, requestConfig, context, 'request').then(function (res) {
38
+ var _requestConfig$onComp;
39
+
40
+ return (_requestConfig$onComp = requestConfig.onComplete) === null || _requestConfig$onComp === void 0 ? void 0 : _requestConfig$onComp.call(requestConfig, res, field, context);
40
41
  });
41
42
  };
42
43
  }; // 配置校验
@@ -46,7 +47,9 @@ var $validator = function $validator(services, requestConfig, context) {
46
47
  return function (value, rules, _ref) {
47
48
  var field = _ref.field;
48
49
  return services(field, requestConfig, context, 'validator').then(function (res) {
49
- return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
50
+ var _requestConfig$onComp2;
51
+
52
+ return (_requestConfig$onComp2 = requestConfig.onComplete) === null || _requestConfig$onComp2 === void 0 ? void 0 : _requestConfig$onComp2.call(requestConfig, res, field, context);
50
53
  });
51
54
  };
52
55
  }; // 配置DataSource
@@ -55,23 +58,31 @@ var $validator = function $validator(services, requestConfig, context) {
55
58
  var $dataSource = function $dataSource(services, requestConfig, context) {
56
59
  return function (field) {
57
60
  field.setState({
58
- loading: true,
61
+ loading: true
62
+ });
63
+ field.setComponentProps({
59
64
  readOnly: true
60
65
  });
61
66
  return services(field, requestConfig, context, 'dataSource').then(function (res) {
67
+ var _requestConfig$onComp3;
68
+
62
69
  var isValueInDataSource = getValueByValue(res, field.value);
63
70
  var clearValue = isValueInDataSource ? {} : {
64
71
  value: undefined
65
72
  };
66
73
  field.setState(_objectSpread({
67
74
  dataSource: res,
68
- loading: false,
69
- readOnly: false
75
+ loading: false
70
76
  }, clearValue));
71
- return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
77
+ field.setComponentProps({
78
+ readOnly: false
79
+ });
80
+ return (_requestConfig$onComp3 = requestConfig.onComplete) === null || _requestConfig$onComp3 === void 0 ? void 0 : _requestConfig$onComp3.call(requestConfig, res, field, context);
72
81
  }).catch(function () {
73
82
  field.setState({
74
- loading: false,
83
+ loading: false
84
+ });
85
+ field.setComponentProps({
75
86
  readOnly: false
76
87
  });
77
88
  });
@@ -1,4 +1,7 @@
1
1
  declare const fieldTypeMap: {
2
2
  [x: string]: string;
3
3
  };
4
+ declare const datePicker2TypeArray: string[];
5
+ declare const timePicker2TypeArray: string[];
6
+ export { datePicker2TypeArray, timePicker2TypeArray };
4
7
  export default fieldTypeMap;
@@ -40,4 +40,7 @@ var fieldTypeMap = {
40
40
  Search: 'search',
41
41
  SelectGroup: 'selectGroup'
42
42
  };
43
+ var datePicker2TypeArray = ['DatePicker', 'DateTimePicker', 'WeekPicker', 'MonthPicker', 'YearPicker', 'QuarterPicker', 'DateRangePicker', 'DateTimeRangePicker', 'WeekRangePicker', 'MonthRangePicker', 'YearRangePicker', 'QuarterRangePicker'];
44
+ var timePicker2TypeArray = ['TimePicker', 'TimeRangePicker'];
45
+ export { datePicker2TypeArray, timePicker2TypeArray };
43
46
  export default fieldTypeMap;
@@ -10,6 +10,10 @@ declare type FieldDisplayTypes = 'none' | 'hidden' | 'visible';
10
10
  export interface ProFormInitializeItem {
11
11
  (item: ProFormSchemaItem, props?: any): ProFormSchemaItem;
12
12
  }
13
+ /**
14
+ * ProForm 实例类型
15
+ */
16
+ export declare type ProFormType = FormType;
13
17
  declare type IBaseComponent = 'Input' | 'Password' | 'TextArea' | 'NumberPicker' | 'Percent' | 'Money' | 'Select' | 'MultipleSelect' | 'TreeSelect' | 'Cascader' | 'MultipleCascader' | 'ArbitraryCascader' | 'Radio' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker' | 'DateTimePicker' | 'WeekPicker' | 'MonthPicker' | 'YearPicker' | 'QuarterPicker' | 'DateRangePicker' | 'TimeRangePicker' | 'DateTimeRangePicker' | 'WeekRangePicker' | 'MonthRangePicker' | 'YearRangePicker' | 'QuarterRangePicker' | 'Transfer' | 'Upload' | 'ColorPicker' | 'ColorRadio' | 'IconPicker' | 'JsonInput' | 'TagPicker' | 'MultipleTagPicker' | 'Range' | 'Search' | 'SelectGroup';
14
18
  declare type IButtonComponent = 'Submit' | 'Reset';
15
19
  declare type IComboComponent = 'ArrayCards' | 'ArrayCards.Addition' | 'ArrayCards.Remove' | 'ArrayCards.MoveUp' | 'ArrayCards.MoveDown' | 'ArrayCards.Index' | 'ArrayCollapse' | 'ArrayCollapse.CollapsePanel' | 'ArrayCollapse.Addition' | 'ArrayCollapse.Remove' | 'ArrayCollapse.MoveUp' | 'ArrayCollapse.MoveDown' | 'ArrayCollapse.Index' | 'ArrayTable' | 'ArrayTable.Column' | 'ArrayTable.SortHandle' | 'ArrayTable.Addition' | 'ArrayTable.Remove' | 'ArrayTable.MoveDown' | 'ArrayTable.MoveUp' | 'ArrayTable.Index' | 'ArrayItems' | 'ArrayItems.Item' | 'ArrayItems.SortHandle' | 'ArrayItems.Addition' | 'ArrayItems.Remove' | 'ArrayItems.MoveDown' | 'ArrayItems.MoveUp' | 'ArrayItems.Index' | 'Editable' | 'Editable.Popover' | 'Editable.Dialog' | 'Editable.Drawer';
@@ -68,8 +72,9 @@ export interface ProFormProps extends IFormLayoutProps {
68
72
  export interface FilterProps extends ProFormProps {
69
73
  form: FormType;
70
74
  defaultFilterValue?: string;
75
+ activeFilterValueRef?: React.MutableRefObject<any>;
76
+ forceClear?: boolean;
71
77
  onReset?: (payload?: any) => void;
72
- onResetClick?: () => void;
73
78
  }
74
79
  export interface QueryFilterLayoutProps {
75
80
  prefixCls?: string;
@@ -93,6 +98,8 @@ export interface QueryFilterProps extends ProFormProps {
93
98
  purePanel?: boolean;
94
99
  /** 面板是否默认展开,仅在 mode='panel' 时生效 */
95
100
  expand?: boolean;
101
+ /** 是否强制清除 */
102
+ forceClear?: boolean;
96
103
  /** 顶部筛选区前缀 */
97
104
  addonBefore?: ReactNode;
98
105
  /** 顶部筛选区后缀 */
package/es/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import ProPageHeader from './page-header';
9
9
  import ProTable from './table';
10
10
  import ProSkeleton from './skeleton';
11
11
  import utils from './utils';
12
- import { ProStep } from './step';
12
+ import { ProTimeline } from './timeline';
13
13
  import * as nocode from './nocode';
14
14
  import * as templates from './templates';
15
15
  export * from './actions';
@@ -23,6 +23,6 @@ export * from './page-header';
23
23
  export * from './skeleton';
24
24
  export * from './table';
25
25
  export * from './utils';
26
- export * from './step';
27
- declare const version = "1.2.34";
28
- export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProStep, hooks, nocode, templates, utils, };
26
+ export * from './timeline';
27
+ declare const version = "1.3.2";
28
+ export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProTimeline, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -11,7 +11,7 @@ import ProTable from './table';
11
11
  import ProSkeleton from './skeleton';
12
12
  import utils from './utils'; // import ProSidebar from './sidebar'
13
13
 
14
- import { ProStep } from './step';
14
+ import { ProTimeline } from './timeline';
15
15
  import * as nocode from './nocode';
16
16
  import * as templates from './templates';
17
17
  import TeamixIcon from '@teamix/icon'; // 设置图标源
@@ -29,8 +29,8 @@ export * from './skeleton';
29
29
  export * from './table';
30
30
  export * from './utils'; // export * from './sidebar';
31
31
 
32
- export * from './step';
33
- var version = '1.2.34';
32
+ export * from './timeline';
33
+ var version = '1.3.2';
34
34
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
35
35
  ProPageContainer, ProPageHeader, ProSkeleton, ProTable, // ProSidebar,
36
- ProStep, hooks, nocode, templates, utils };
36
+ ProTimeline, hooks, nocode, templates, utils };
@@ -80,11 +80,11 @@ var schema = [{
80
80
  }, {
81
81
  name: 'iconColor',
82
82
  title: '图标颜色',
83
- component: 'ColorSwatches'
83
+ component: 'ColorPicker'
84
84
  }, {
85
85
  name: 'iconBackgroundColor',
86
86
  title: '图标背景颜色',
87
- component: 'ColorSwatches'
87
+ component: 'ColorPicker'
88
88
  }, {
89
89
  name: 'iconBackgroundType',
90
90
  title: '图标背景形状',
@@ -17,7 +17,7 @@ import { useHistory } from 'react-router-dom';
17
17
  import classnames from 'classnames';
18
18
  import TeamixIcon from '@teamix/icon';
19
19
  import { Breadcrumb } from '@alicloudfe/components';
20
- import { baseClass, goToLink, renderTags, isPresetColor, getColorClassName, getBackgroundColorClassName } from '@teamix/utils';
20
+ import { baseClass, goToLink, renderTags, isPresetColor, getColor, getColorClassName, getBackgroundColorClassName } from '@teamix/utils';
21
21
  import { ProActionGroup } from '../actions';
22
22
  import { ProSkeletonRaw } from '../skeleton';
23
23
  import ProInfo from '../info';
@@ -69,8 +69,12 @@ var getColorAndStyle = function getColorAndStyle(color, backgroundColor, backgro
69
69
  var isColorPresetColor = isPresetColor(color);
70
70
  var isBgColorPresetColor = isPresetColor(backgroundColor);
71
71
  var className = classnames((_classnames = {}, _defineProperty(_classnames, "".concat(getColorClassName(color)), isColorPresetColor), _defineProperty(_classnames, "".concat(getBackgroundColorClassName(backgroundColor)), isBgColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-type-".concat(backgroundType))), !!backgroundType), _classnames));
72
- var styleColor = isColorPresetColor ? undefined : color;
73
- var styleBgColor = isBgColorPresetColor ? undefined : backgroundColor;
72
+ var styleColor = isColorPresetColor ? getColor(color) : color;
73
+ var styleBgColor = isBgColorPresetColor ? getColor(backgroundColor) : backgroundColor; // debugger;
74
+ // console.log('color', color);
75
+ // console.log('backgroundColor', backgroundColor);
76
+ // console.log('styleBgColor', styleBgColor);
77
+
74
78
  var style = {
75
79
  color: styleColor,
76
80
  backgroundColor: styleBgColor
@@ -152,13 +152,13 @@ var Layout = function Layout(props) {
152
152
  className: cls('wrapper')
153
153
  }, /*#__PURE__*/React.createElement("div", {
154
154
  className: cls('left')
155
- }, header && /*#__PURE__*/React.createElement(Header, _objectSpread({}, header)), (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema3 = dataFilter.schema) === null || _dataFilter$schema3 === void 0 ? void 0 : _dataFilter$schema3.length) && renderQueryFilter()), /*#__PURE__*/React.createElement("div", {
155
+ }, header && /*#__PURE__*/React.createElement(Header, _objectSpread({}, header))), /*#__PURE__*/React.createElement("div", {
156
156
  className: cls('right')
157
157
  }, extra && /*#__PURE__*/React.createElement(QuickAction, {
158
158
  actionRef: actionRef,
159
159
  quickAction: extra,
160
160
  rowSelection: rowSelection
161
- }), !(dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema4 = dataFilter.schema) === null || _dataFilter$schema4 === void 0 ? void 0 : _dataFilter$schema4.length) && renderQueryFilter())));
161
+ }), !(dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema3 = dataFilter.schema) === null || _dataFilter$schema3 === void 0 ? void 0 : _dataFilter$schema3.length) && renderQueryFilter())), (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema4 = dataFilter.schema) === null || _dataFilter$schema4 === void 0 ? void 0 : _dataFilter$schema4.length) && renderQueryFilter());
162
162
  } else if (!header && mainAction) {
163
163
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderQueryFilter());
164
164
  } else if (!header && !mainAction) {
@@ -23,7 +23,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
23
23
  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; }
24
24
 
25
25
  // 自适应宽度的翻页器
26
- import React, { useState } from 'react';
26
+ import React, { useState, useEffect } from 'react';
27
27
  import { Pagination, Balloon, Select, Button, Input, Icon } from '@alicloudfe/components';
28
28
  import { getMessage, baseClass } from '@teamix/utils';
29
29
  import { useResponsiveProps } from '@teamix/hooks';
@@ -46,6 +46,13 @@ export default (function (props) {
46
46
  responsiveProps = _useResponsiveProps.responsiveProps,
47
47
  paginationWrapperRef = _useResponsiveProps.ref;
48
48
 
49
+ useEffect(function () {
50
+ // size='mini' 模式下 current 受控
51
+ if (responsiveProps === 'mini') {
52
+ setCurrentPage(current);
53
+ }
54
+ }, [current]);
55
+
49
56
  var _useState = useState(false),
50
57
  _useState2 = _slicedToArray(_useState, 2),
51
58
  visible = _useState2[0],
@@ -82,6 +89,9 @@ export default (function (props) {
82
89
  text: true,
83
90
  onMouseEnter: function onMouseEnter() {
84
91
  return setVisible(true);
92
+ },
93
+ style: {
94
+ lineHeight: '18px'
85
95
  }
86
96
  }, getMessage('total', {
87
97
  total: total
@@ -22,9 +22,11 @@ var RadioItem = Menu.RadioItem;
22
22
  var cls = baseClass('teamix-pro-table-toolbar-icon');
23
23
 
24
24
  var DensityIcon = function DensityIcon(props) {
25
+ var _actionRef$current;
26
+
25
27
  var actionRef = props.actionRef;
26
28
 
27
- var _useState = useState('medium'),
29
+ var _useState = useState(((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.size) || 'medium'),
28
30
  _useState2 = _slicedToArray(_useState, 2),
29
31
  size = _useState2[0],
30
32
  setSize = _useState2[1]; // const [fullscreen, setFullscreen] = useState<boolean>(false);
@@ -44,10 +46,10 @@ var DensityIcon = function DensityIcon(props) {
44
46
 
45
47
 
46
48
  var radioOnchange = function radioOnchange(mode) {
47
- var _actionRef$current, _actionRef$current$se;
49
+ var _actionRef$current2, _actionRef$current2$s;
48
50
 
49
51
  setSize(mode);
50
- (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setSize) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, mode);
52
+ (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setSize) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, mode);
51
53
  }; // // 销毁监听函数
52
54
  // useEffect(() => {
53
55
  // return () => {
@@ -33,13 +33,22 @@ import { baseClass, getMessage } from '@teamix/utils';
33
33
  import React, { useState, useEffect } from 'react';
34
34
  import { cloneDeep, off, on } from '../../utils';
35
35
  import './index.scss';
36
- import { Ellipsis } from '@teamix/utils';
36
+ import { Ellipsis, getCookie } from '@teamix/utils';
37
37
  var CheckboxItem = Menu.CheckboxItem;
38
38
  var Row = Grid.Row,
39
39
  Col = Grid.Col;
40
- var cls = baseClass('teamix-pro-table-toolbar-filter-column');
40
+ var cls = baseClass('teamix-pro-table-toolbar-filter-column'); // 判断是否是 root 组织
41
+
42
+ var isRoot = getCookie('organizationId') === '1';
41
43
 
42
44
  var processColumns = function processColumns(columns) {
45
+ if (isRoot) {
46
+ // root 组织下不显示标签管理
47
+ columns = columns.filter(function (item) {
48
+ return item.valueType !== 'selectGroup';
49
+ });
50
+ }
51
+
43
52
  return columns.map(function (item) {
44
53
  if (item.columnFilters === false) {
45
54
  return item;
@@ -296,7 +305,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
296
305
  return onChangeColumns(check, dataIndex);
297
306
  },
298
307
  disabled: columnFiltersDisabled
299
- }, title, !lock && /*#__PURE__*/React.createElement("div", {
308
+ }, title, !lock && !columnFiltersDisabled && /*#__PURE__*/React.createElement("div", {
300
309
  className: cls({
301
310
  sort: true
302
311
  })
@@ -30,15 +30,15 @@ var FullScreen = function FullScreen(props) {
30
30
 
31
31
  var afterClose = function afterClose() {
32
32
  // 判断全屏前后筛选表单值是否有改变
33
- var n = JSON.stringify(getValidValues(normalDataFilterForm.values));
34
- var f = JSON.stringify(getValidValues(fullscreenDataFilterForm.values));
33
+ var n = JSON.stringify(getValidValues(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values));
34
+ var f = JSON.stringify(getValidValues(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values));
35
35
 
36
36
  if (n === f) {
37
37
  // 关闭全屏后,表单值未变化,开启普通表单onFilter
38
38
  filterEnableRef.current.normal = true;
39
39
  } else {
40
40
  // 关闭全屏后,表单值有变化,修改表单值
41
- normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.setValues(fullscreenDataFilterForm.values);
41
+ normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.setValues(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values);
42
42
  } // 关闭全屏后,关闭全屏表单onFilter
43
43
 
44
44
 
@@ -48,15 +48,15 @@ var FullScreen = function FullScreen(props) {
48
48
 
49
49
  var afterOpen = function afterOpen() {
50
50
  // 判断全屏前后筛选表单值是否有改变
51
- var n = JSON.stringify(getValidValues(normalDataFilterForm.values));
52
- var f = JSON.stringify(getValidValues(fullscreenDataFilterForm.values));
51
+ var n = JSON.stringify(getValidValues(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values));
52
+ var f = JSON.stringify(getValidValues(fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.values));
53
53
 
54
54
  if (n === f) {
55
55
  // 全屏后,表单值未变化,开启全屏表单onFilter
56
56
  filterEnableRef.current.fullscreen = true;
57
57
  } else {
58
58
  // 全屏后,表单值变化,修改表单值
59
- fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.setValues(normalDataFilterForm.values);
59
+ fullscreenDataFilterForm === null || fullscreenDataFilterForm === void 0 ? void 0 : fullscreenDataFilterForm.setValues(normalDataFilterForm === null || normalDataFilterForm === void 0 ? void 0 : normalDataFilterForm.values);
60
60
  } // 全屏后,关闭普通表单onFilter
61
61
 
62
62
 
@@ -29,7 +29,7 @@
29
29
  }
30
30
  &-reset {
31
31
  position: absolute;
32
- right: 16px;
32
+ right: 0px;
33
33
  top: 6px;
34
34
  }
35
35
  // .next-menu {
@@ -59,7 +59,7 @@
59
59
  .teamix-pro-table-toolbar-filter-column-sort {
60
60
  visibility: hidden;
61
61
  position: absolute;
62
- right: 16px;
62
+ right: 0px;
63
63
  top: 0;
64
64
  color: var(--color-text1-7);
65
65
  i {
package/es/table/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 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"];
1
+ 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", "reserveSelectedRecords", "size", "disableSelectAll"];
2
2
 
3
3
  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); }
4
4
 
@@ -176,6 +176,11 @@ var ProTable = function ProTable(props) {
176
176
  _props$filterColumnTy = props.filterColumnType,
177
177
  filterColumnType = _props$filterColumnTy === void 0 ? 'auto' : _props$filterColumnTy,
178
178
  defaultFilterParams = props.defaultFilterParams,
179
+ _props$reserveSelecte = props.reserveSelectedRecords,
180
+ reserveSelectedRecords = _props$reserveSelecte === void 0 ? false : _props$reserveSelecte,
181
+ _props$size = props.size,
182
+ propsSize = _props$size === void 0 ? 'medium' : _props$size,
183
+ disableSelectAll = props.disableSelectAll,
179
184
  otherProps = _objectWithoutProperties(props, _excluded);
180
185
 
181
186
  var targetPageKey = pageKey || globalPageKey;
@@ -229,7 +234,7 @@ var ProTable = function ProTable(props) {
229
234
  filteredColumns = _useState16[0],
230
235
  setFilteredColumns = _useState16[1];
231
236
 
232
- var _useState17 = useState('medium'),
237
+ var _useState17 = useState(propsSize),
233
238
  _useState18 = _slicedToArray(_useState17, 2),
234
239
  size = _useState18[0],
235
240
  _setSize = _useState18[1];
@@ -300,8 +305,8 @@ var ProTable = function ProTable(props) {
300
305
  var normalDataFilterForm = normalDataFilterFormRef.current;
301
306
  var fullscreenDataFilterForm = fullscreenDataFilterFormRef.current; // 传给 QueryFilter 的 formRef
302
307
 
303
- var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef;
304
- var dataFilterForm = dataFilterFormRef.current; // 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
308
+ var dataFilterFormRef = !fullscreenState ? normalDataFilterFormRef : fullscreenDataFilterFormRef; // let dataFilterForm = dataFilterFormRef.current;
309
+ // 整个内容区是否超过一屏。用于表格在非全屏模式下的吸底
305
310
 
306
311
  var _useState29 = useState(false),
307
312
  _useState30 = _slicedToArray(_useState29, 2),
@@ -339,7 +344,7 @@ var ProTable = function ProTable(props) {
339
344
  result = propsRowSelection.getProps(record, index);
340
345
  }
341
346
 
342
- if (showSkeleton) {
347
+ if (showSkeleton && result) {
343
348
  result.disabled = true;
344
349
  }
345
350
 
@@ -352,7 +357,7 @@ var ProTable = function ProTable(props) {
352
357
  result = propsRowSelection.titleProps();
353
358
  }
354
359
 
355
- if (showSkeleton) {
360
+ if (showSkeleton || disableSelectAll) {
356
361
  result.disabled = true;
357
362
  }
358
363
 
@@ -387,7 +392,7 @@ var ProTable = function ProTable(props) {
387
392
  return selectedRowKeys.includes(k);
388
393
  });
389
394
  return {
390
- disabled: showLoading && !showSkeleton && (getData.loading || props.loading),
395
+ disabled: disableSelectAll || showLoading && !showSkeleton && (getData.loading || props.loading),
391
396
  onChange: function onChange(check) {
392
397
  if (check) {
393
398
  var result = selectedRowKeys.concat([]);
@@ -491,6 +496,7 @@ var ProTable = function ProTable(props) {
491
496
  emit('refreshFilterState', newColumns);
492
497
  }
493
498
  },
499
+ size: size,
494
500
  setSize: function setSize(mode) {
495
501
  _setSize(mode);
496
502
  },
@@ -510,12 +516,12 @@ var ProTable = function ProTable(props) {
510
516
  _request(params);
511
517
  },
512
518
  reset: function reset() {
513
- var _actionRef$current4, _actionRef$current4$s;
519
+ var _actionRef$current4, _actionRef$current4$s, _dataFilterFormRef$cu;
514
520
 
515
521
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset()); // 清空列过滤参数
516
522
 
517
523
  (_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, {});
518
- dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.reset();
524
+ (_dataFilterFormRef$cu = dataFilterFormRef.current) === null || _dataFilterFormRef$cu === void 0 ? void 0 : _dataFilterFormRef$cu.reset();
519
525
  setCurrentPage(1);
520
526
 
521
527
  _request(_defineProperty({}, targetPageKey, 1));
@@ -537,7 +543,8 @@ var ProTable = function ProTable(props) {
537
543
  pageSize: pageSize
538
544
  },
539
545
  data: data,
540
- dataFilterForm: dataFilterForm,
546
+ dataFilterForm: dataFilterFormRef.current,
547
+ dataFilterFormRef: dataFilterFormRef,
541
548
  normalDataFilterForm: normalDataFilterForm,
542
549
  fullscreenDataFilterForm: fullscreenDataFilterForm,
543
550
  filterEnableRef: filterEnableRef,
@@ -630,7 +637,7 @@ var ProTable = function ProTable(props) {
630
637
  }); // 请求函数
631
638
 
632
639
  function _request(params, noLoading, filterParams) {
633
- var _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
640
+ var _dataFilterFormRef$cu2, _actionRef$current$ge, _actionRef$current5, _actionRef$current5$g, _objectSpread2;
634
641
 
635
642
  // 如果没有传 url 且没有 customRequest,直接返回
636
643
  if (!url && !customRequest) {
@@ -643,7 +650,7 @@ var ProTable = function ProTable(props) {
643
650
 
644
651
  var sortParams = targetFormatSort(sort); // 筛选区请求参数
645
652
 
646
- var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.values; // 列过滤请求参数
653
+ var dataFilterParams = filterParams !== null && filterParams !== void 0 ? filterParams : (_dataFilterFormRef$cu2 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu2 === void 0 ? void 0 : _dataFilterFormRef$cu2.values; // 列过滤请求参数
647
654
 
648
655
  var columnsFilterParams = (_actionRef$current$ge = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : (_actionRef$current5$g = _actionRef$current5.getFilterRules) === null || _actionRef$current5$g === void 0 ? void 0 : _actionRef$current5$g.call(_actionRef$current5)) !== null && _actionRef$current$ge !== void 0 ? _actionRef$current$ge : {}; // 格式化后的请求参数
649
656
 
@@ -737,7 +744,8 @@ var ProTable = function ProTable(props) {
737
744
 
738
745
 
739
746
  var dataFilter = _objectSpread(_objectSpread({
740
- mode: 'inline'
747
+ mode: 'inline',
748
+ forceClear: true
741
749
  }, propsDataFilter), {}, {
742
750
  onInit: function onInit(values) {
743
751
  // 表单初始化请求处理
@@ -768,8 +776,10 @@ var ProTable = function ProTable(props) {
768
776
  _request(_defineProperty({}, targetPageKey, 1), false, values);
769
777
  },
770
778
  onReset: function onReset(values) {
779
+ var _dataFilterFormRef$cu3;
780
+
771
781
  (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onReset());
772
- dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.reset();
782
+ (_dataFilterFormRef$cu3 = dataFilterFormRef.current) === null || _dataFilterFormRef$cu3 === void 0 ? void 0 : _dataFilterFormRef$cu3.reset();
773
783
  setCurrentPage(1);
774
784
 
775
785
  _request(_defineProperty({}, targetPageKey, 1), false, values);
@@ -856,21 +866,30 @@ var ProTable = function ProTable(props) {
856
866
 
857
867
  var renderFooter = function renderFooter() {
858
868
  function onChangePagination(currentPage) {
859
- var _actionRef$current7, _actionRef$current7$c;
860
-
861
869
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
862
- // 翻页暂时先清空选择
863
- (_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);
870
+
871
+ // 翻页默认清空选择
872
+ if (!reserveSelectedRecords) {
873
+ var _actionRef$current7, _actionRef$current7$c;
874
+
875
+ (_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);
876
+ }
877
+
864
878
  setCurrentPage(currentPage);
865
879
 
866
880
  _request(_objectSpread(_defineProperty({}, targetPageKey, currentPage), params));
867
881
  }
868
882
 
869
883
  function onChangePaginationSize(currentPageSize) {
870
- var _actionRef$current8, _actionRef$current8$c, _request5;
884
+ var _request5;
885
+
886
+ // 翻页默认清空选择
887
+ if (!reserveSelectedRecords) {
888
+ var _actionRef$current8, _actionRef$current8$c;
889
+
890
+ (_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);
891
+ }
871
892
 
872
- // 翻页暂时先清空选择
873
- (_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);
874
893
  setPageSize(currentPageSize);
875
894
  setCurrentPage(1);
876
895
 
@@ -118,4 +118,10 @@ $fullscreenPadding: 24px;
118
118
 
119
119
  .mb8 {
120
120
  margin-bottom: 8px;
121
+ }
122
+
123
+ .next-table {
124
+ .next-form-preview.next-form-preview {
125
+ line-height: unset;
126
+ }
121
127
  }