@teamix/pro 1.2.18 → 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 (113) hide show
  1. package/dist/212.js +49 -49
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +3581 -990
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/es/actions/base.d.ts +2 -1
  7. package/es/actions/base.js +1 -1
  8. package/es/actions/danger-pop-confirm.d.ts +5 -0
  9. package/es/actions/danger-pop-confirm.js +10 -0
  10. package/es/actions/dialog.d.ts +1 -1
  11. package/es/actions/dialog.js +42 -55
  12. package/es/actions/index.d.ts +13 -0
  13. package/es/actions/index.js +21 -16
  14. package/es/actions/pop-confirm.d.ts +9 -0
  15. package/es/actions/pop-confirm.js +9 -0
  16. package/es/form/Components/LightFilter/componentMap.d.ts +2 -1
  17. package/es/form/Components/LightFilter/componentMap.js +4 -2
  18. package/es/form/Components/LightFilter/index.d.ts +1 -0
  19. package/es/form/Components/LightFilter/index.js +34 -16
  20. package/es/form/Components/LightFilter/index.scss +14 -4
  21. package/es/form/Filter/AdvancedFilter.d.ts +7 -0
  22. package/es/form/Filter/AdvancedFilter.js +114 -0
  23. package/es/form/Filter/LightFilter.d.ts +7 -0
  24. package/es/form/Filter/LightFilter.js +79 -0
  25. package/es/form/Filter/SimpleFilter.d.ts +7 -0
  26. package/es/form/Filter/SimpleFilter.js +74 -0
  27. package/es/form/Filter/index2.js +288 -235
  28. package/es/form/Filter/index2.scss +3 -0
  29. package/es/form/ProForm/index.js +11 -7
  30. package/es/form/ProForm/index.scss +40 -6
  31. package/es/form/ProForm/useFormDisplayValues.js +4 -2
  32. package/es/form/SchemaForm/index.js +16 -10
  33. package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
  34. package/es/form/SchemaForm/initializeDataSource.js +4 -9
  35. package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
  36. package/es/form/SchemaForm/initializeRequest.js +4 -10
  37. package/es/form/SchemaForm/initializeRules.d.ts +7 -1
  38. package/es/form/SchemaForm/initializeRules.js +9 -13
  39. package/es/form/SchemaForm/reactions.d.ts +5 -5
  40. package/es/form/SchemaForm/reactions.js +27 -29
  41. package/es/form/global.scss +1 -0
  42. package/es/form/typing.d.ts +11 -2
  43. package/es/form/utils.d.ts +8 -7
  44. package/es/form/utils.js +5 -4
  45. package/es/index.d.ts +1 -1
  46. package/es/index.js +1 -1
  47. package/es/table/components/Filter/index.js +1 -0
  48. package/es/table/components/Layout/index.js +21 -12
  49. package/es/table/components/Pagination/index.d.ts +4 -0
  50. package/es/table/components/Pagination/index.js +154 -0
  51. package/es/table/components/Pagination/index.scss +22 -0
  52. package/es/table/components/ToolBar/FilterColumnIcon.js +42 -8
  53. package/es/table/components/ToolBar/index.scss +17 -6
  54. package/es/table/index.js +118 -34
  55. package/es/table/index.scss +7 -1
  56. package/es/table/typing.d.ts +6 -2
  57. package/es/table/utils/columnRender.js +2 -1
  58. package/es/table/utils/index.d.ts +7 -0
  59. package/es/table/utils/index.js +38 -4
  60. package/lib/actions/base.d.ts +2 -1
  61. package/lib/actions/base.js +1 -1
  62. package/lib/actions/danger-pop-confirm.d.ts +5 -0
  63. package/lib/actions/danger-pop-confirm.js +22 -0
  64. package/lib/actions/dialog.d.ts +1 -1
  65. package/lib/actions/dialog.js +42 -54
  66. package/lib/actions/index.d.ts +13 -0
  67. package/lib/actions/index.js +23 -16
  68. package/lib/actions/pop-confirm.d.ts +9 -0
  69. package/lib/actions/pop-confirm.js +23 -0
  70. package/lib/form/Components/LightFilter/componentMap.d.ts +2 -1
  71. package/lib/form/Components/LightFilter/componentMap.js +6 -4
  72. package/lib/form/Components/LightFilter/index.d.ts +1 -0
  73. package/lib/form/Components/LightFilter/index.js +31 -14
  74. package/lib/form/Components/LightFilter/index.scss +14 -4
  75. package/lib/form/Filter/AdvancedFilter.d.ts +7 -0
  76. package/lib/form/Filter/AdvancedFilter.js +134 -0
  77. package/lib/form/Filter/LightFilter.d.ts +7 -0
  78. package/lib/form/Filter/LightFilter.js +99 -0
  79. package/lib/form/Filter/SimpleFilter.d.ts +7 -0
  80. package/lib/form/Filter/SimpleFilter.js +93 -0
  81. package/lib/form/Filter/index2.js +291 -234
  82. package/lib/form/Filter/index2.scss +3 -0
  83. package/lib/form/ProForm/index.js +10 -6
  84. package/lib/form/ProForm/index.scss +40 -6
  85. package/lib/form/ProForm/useFormDisplayValues.js +3 -1
  86. package/lib/form/SchemaForm/index.js +16 -9
  87. package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
  88. package/lib/form/SchemaForm/initializeDataSource.js +4 -11
  89. package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
  90. package/lib/form/SchemaForm/initializeRequest.js +4 -11
  91. package/lib/form/SchemaForm/initializeRules.d.ts +7 -1
  92. package/lib/form/SchemaForm/initializeRules.js +9 -16
  93. package/lib/form/SchemaForm/reactions.d.ts +5 -5
  94. package/lib/form/SchemaForm/reactions.js +29 -31
  95. package/lib/form/global.scss +1 -0
  96. package/lib/form/typing.d.ts +11 -2
  97. package/lib/form/utils.d.ts +8 -7
  98. package/lib/form/utils.js +6 -5
  99. package/lib/index.d.ts +1 -1
  100. package/lib/index.js +1 -1
  101. package/lib/table/components/Layout/index.js +20 -11
  102. package/lib/table/components/Pagination/index.d.ts +4 -0
  103. package/lib/table/components/Pagination/index.js +174 -0
  104. package/lib/table/components/Pagination/index.scss +22 -0
  105. package/lib/table/components/ToolBar/FilterColumnIcon.js +41 -7
  106. package/lib/table/components/ToolBar/index.scss +17 -6
  107. package/lib/table/index.js +115 -32
  108. package/lib/table/index.scss +7 -1
  109. package/lib/table/typing.d.ts +6 -2
  110. package/lib/table/utils/columnRender.js +2 -1
  111. package/lib/table/utils/index.d.ts +7 -0
  112. package/lib/table/utils/index.js +46 -4
  113. package/package.json +3 -3
@@ -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 = {
@@ -235,6 +237,8 @@ export declare type ProTableTopAreaProps = {
235
237
  dataFilter?: ProTableDataFilterProps;
236
238
  /** 数据过滤区 form 表单模型 */
237
239
  dataFilterForm?: FormType;
240
+ /** 排序、筛选列展示状态 */
241
+ filterColumnType?: 'dialog' | 'dropdown' | 'auto';
238
242
  };
239
243
  /** 单个工具栏 */
240
244
  export declare type ProTableToolBarItem = React.ReactNode | 'refresh' | 'density' | 'filterColumn' | 'fullscreen';
@@ -220,7 +220,8 @@ var processRenderFunction = function processRenderFunction() {
220
220
  var value = arguments.length > 1 ? arguments[1] : undefined;
221
221
  var index = arguments.length > 2 ? arguments[2] : undefined;
222
222
  var record = arguments.length > 3 ? arguments[3] : undefined;
223
- var external = ['linkOnClick', 'link', 'value'];
223
+ // ProField render 类型为 function 时。需要表格预先处理以塞入 record
224
+ var external = ['linkOnClick', 'link', 'value', 'renderEdit', 'descriptionRenderEdit', 'editPopConfirmProps', 'descriptionEditPopConfirmProps', 'editOnClick', 'descriptionEditOnClick'];
224
225
  return Object.fromEntries(Object.entries(render).map(function (_ref3) {
225
226
  var _ref4 = _slicedToArray(_ref3, 2),
226
227
  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;
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.cloneDeep = cloneDeep;
7
+ exports.emit = emit;
8
+ exports.initActionRef = initActionRef;
9
+ exports.off = off;
10
+ exports.on = on;
7
11
  exports.useActionType = useActionType;
8
12
 
9
13
  var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
@@ -28,19 +32,23 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
28
32
 
29
33
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
34
 
31
- // 组件内全局状态
35
+ // 组件内全局状态 每次初始化 ActionRef 会重新深拷贝对象
32
36
  var state = {
33
37
  fullScreenState: false,
34
38
  filterRules: {},
35
39
  filterColumns: []
36
40
  };
37
41
 
38
- var _initState = (0, _lodash.default)(state); // 组件内全局监听事件
42
+ var _initState = (0, _lodash.default)(state); // state监听事件 每次初始化 ActionRef 会重新深拷贝对象
39
43
 
40
44
 
41
45
  var callback = {
42
46
  fullScreenState: {}
43
- }; // 组件内对全局状态的更改
47
+ };
48
+ var initCallback = (0, _lodash.default)(callback); // 所有 ProTable 组件公用一套组件内事件转发机制
49
+
50
+ var tableCallback = {}; // 组件内监听事件
51
+ // 组件内对全局状态的更改
44
52
 
45
53
  var mutations = {
46
54
  getState: function getState() {
@@ -140,7 +148,41 @@ var useOn = function useOn(state) {
140
148
  }
141
149
  });
142
150
  }
143
- };
151
+ }; // 初始化 actionRef
152
+
153
+
154
+ function initActionRef() {
155
+ state = (0, _lodash.default)(_initState);
156
+ callback = (0, _lodash.default)(initCallback);
157
+ }
158
+ /** table 组件内监听 不对外暴露 */
159
+
160
+
161
+ function on(fun, key) {
162
+ tableCallback[key] = fun;
163
+ }
164
+ /** table 组件内销毁监听 不对外暴露 */
165
+
166
+
167
+ function off(key) {
168
+ if (tableCallback[key]) {
169
+ delete tableCallback[key];
170
+ }
171
+ }
172
+ /** table 组件内触发事件 不对外暴露 */
173
+
174
+
175
+ function emit(key) {
176
+ var fun = tableCallback[key];
177
+
178
+ if (fun) {
179
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
180
+ args[_key2 - 1] = arguments[_key2];
181
+ }
182
+
183
+ fun.apply(void 0, args);
184
+ }
185
+ }
144
186
 
145
187
  function useActionType(ref, action) {
146
188
  // 合并自定义事件
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.2.18",
3
+ "version": "1.2.22",
4
4
  "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",
@@ -24,9 +24,9 @@
24
24
  "dependencies": {
25
25
  "@formily/core": "2.0.5",
26
26
  "@formily/react": "2.0.5",
27
- "@teamix/formily": "2.0.5-1",
27
+ "@teamix/formily": "2.0.5-2",
28
28
  "@teamix/hooks": "^0.1.0",
29
- "@teamix/pop-confirm": "^1.2.2",
29
+ "@teamix/pop-confirm": "^1.2.4",
30
30
  "@teamix/pro-field": "^1.0.0",
31
31
  "@teamix/pro-page-container": "^1.0.0",
32
32
  "@teamix/pro-skeleton": "^1.0.0",