@teamix/pro 1.2.24 → 1.2.26

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 (75) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +1043 -94
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/dialog.js +1 -1
  6. package/es/actions/index.d.ts +13 -9
  7. package/es/actions/index.js +63 -18
  8. package/es/actions/index.scss +12 -1
  9. package/es/form/SchemaForm/index.js +8 -6
  10. package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
  11. package/es/form/SchemaForm/initializeDataSource.js +2 -2
  12. package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
  13. package/es/form/SchemaForm/initializeRequest.js +2 -2
  14. package/es/form/SchemaForm/initializeRules.d.ts +1 -1
  15. package/es/form/SchemaForm/initializeRules.js +3 -3
  16. package/es/form/typing.d.ts +0 -9
  17. package/es/form/utils.d.ts +2 -2
  18. package/es/form/utils.js +2 -2
  19. package/es/index.d.ts +5 -2
  20. package/es/index.js +6 -3
  21. package/es/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
  22. package/es/step/ProStepItem/components/HozStepItem/index.js +235 -0
  23. package/es/step/ProStepItem/components/HozStepItem/index.scss +279 -0
  24. package/es/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
  25. package/es/step/ProStepItem/components/VerStepItem/index.js +295 -0
  26. package/es/step/ProStepItem/components/VerStepItem/index.scss +287 -0
  27. package/es/step/ProStepItem/index.d.ts +4 -0
  28. package/es/step/ProStepItem/index.js +57 -0
  29. package/es/step/index.d.ts +9 -0
  30. package/es/step/index.js +101 -0
  31. package/es/step/typing.d.ts +96 -0
  32. package/es/step/typing.js +1 -0
  33. package/es/table/components/Filter/index.js +2 -17
  34. package/es/table/index.js +7 -3
  35. package/es/table/typing.d.ts +11 -2
  36. package/es/table/utils/index.d.ts +7 -0
  37. package/es/table/utils/index.js +36 -0
  38. package/es/utils/index.d.ts +1 -0
  39. package/es/utils/index.js +1 -0
  40. package/lib/actions/dialog.js +1 -1
  41. package/lib/actions/index.d.ts +13 -9
  42. package/lib/actions/index.js +63 -18
  43. package/lib/actions/index.scss +12 -1
  44. package/lib/form/SchemaForm/index.js +8 -6
  45. package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
  46. package/lib/form/SchemaForm/initializeDataSource.js +2 -2
  47. package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
  48. package/lib/form/SchemaForm/initializeRequest.js +2 -2
  49. package/lib/form/SchemaForm/initializeRules.d.ts +1 -1
  50. package/lib/form/SchemaForm/initializeRules.js +3 -3
  51. package/lib/form/typing.d.ts +0 -9
  52. package/lib/form/utils.d.ts +2 -2
  53. package/lib/form/utils.js +2 -2
  54. package/lib/index.d.ts +5 -2
  55. package/lib/index.js +35 -3
  56. package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
  57. package/lib/step/ProStepItem/components/HozStepItem/index.js +258 -0
  58. package/lib/step/ProStepItem/components/HozStepItem/index.scss +279 -0
  59. package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
  60. package/lib/step/ProStepItem/components/VerStepItem/index.js +315 -0
  61. package/lib/step/ProStepItem/components/VerStepItem/index.scss +287 -0
  62. package/lib/step/ProStepItem/index.d.ts +4 -0
  63. package/lib/step/ProStepItem/index.js +69 -0
  64. package/lib/step/index.d.ts +9 -0
  65. package/lib/step/index.js +124 -0
  66. package/lib/step/typing.d.ts +96 -0
  67. package/lib/step/typing.js +5 -0
  68. package/lib/table/components/Filter/index.js +2 -17
  69. package/lib/table/index.js +6 -2
  70. package/lib/table/typing.d.ts +11 -2
  71. package/lib/table/utils/index.d.ts +7 -0
  72. package/lib/table/utils/index.js +38 -0
  73. package/lib/utils/index.d.ts +1 -0
  74. package/lib/utils/index.js +13 -0
  75. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
5
5
  import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
6
- import { QueryFilterProps } from '../form';
6
+ import { IFilterProps } from '../form';
7
7
  import { ProActionGroupProps, ProActionButtonProps } from '../actions';
8
8
  import { PaginationProps } from '@alicloudfe/components/types/pagination';
9
9
  import { HeaderProps as ProTableHeaderProps } from '@teamix/utils';
@@ -125,6 +125,10 @@ export declare type ProTableProps = {
125
125
  data: any[];
126
126
  total?: number;
127
127
  }>;
128
+ /** 默认漏斗过滤条件 */
129
+ defaultFilterParams?: {
130
+ [key: string]: any[] | any;
131
+ };
128
132
  } & Omit<TableProps, 'columns'> & ProTableTopAreaProps;
129
133
  export declare type rowSelectionType = {
130
134
  getProps?: (record: any, index: number) => any;
@@ -215,12 +219,17 @@ export declare type ProTableActionTypeState = {
215
219
  [key: string]: any;
216
220
  };
217
221
  export declare type ProTableDataFilterProps = {
222
+ /** 展示形式 */
223
+ mode?: 'inline' | 'panel';
224
+ /** mode='panel' 时是否默认展开 */
225
+ expand?: boolean;
226
+ /** 搜索时是否传入值为undefined的参数,默认不传 */
218
227
  searchUndefined?: boolean;
219
228
  /** 搜索时是否传入值为空字符串的参数,默认不传 */
220
229
  searchEmptyString?: boolean;
221
230
  /** 自定义内容 */
222
231
  content?: React.ReactNode;
223
- } & QueryFilterProps;
232
+ } & IFilterProps;
224
233
  export declare type dataFilterProps = ProTableDataFilterProps;
225
234
  export declare type ProTableTopAreaProps = {
226
235
  /** 标题区 */
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ProTableActionType } from '../typing';
3
+ import { ProTableProps, ProTableColumnProps } from '..';
3
4
  export declare function initActionRef(): void;
4
5
  /** table 组件内监听 不对外暴露 */
5
6
  export declare function on(fun: any, key: string): void;
@@ -9,3 +10,9 @@ export declare function off(key: string): void;
9
10
  export declare function emit(key: string, ...args: any): void;
10
11
  export declare function useActionType<T>(ref: React.MutableRefObject<ProTableActionType | undefined>, action: ProTableActionType): void;
11
12
  export declare function cloneDeep<T>(obj: T): T;
13
+ /**
14
+ * 处理默认过滤参数
15
+ * @param columns
16
+ * @param ref
17
+ */
18
+ export declare function processDefaultFilter(columns: ProTableColumnProps[], ref: React.MutableRefObject<ProTableActionType | undefined>, defaultFilterParams: ProTableProps['defaultFilterParams']): void;
@@ -8,6 +8,7 @@ exports.emit = emit;
8
8
  exports.initActionRef = initActionRef;
9
9
  exports.off = off;
10
10
  exports.on = on;
11
+ exports.processDefaultFilter = processDefaultFilter;
11
12
  exports.useActionType = useActionType;
12
13
 
13
14
  var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
@@ -193,4 +194,41 @@ function useActionType(ref, action) {
193
194
 
194
195
  function cloneDeep(obj) {
195
196
  return (0, _lodash.default)(obj);
197
+ }
198
+ /**
199
+ * 处理默认过滤参数
200
+ * @param columns
201
+ * @param ref
202
+ */
203
+
204
+
205
+ function processDefaultFilter(columns, ref, defaultFilterParams) {
206
+ columns.forEach(function (column) {
207
+ var _column$dataIndex$toS, _column$dataIndex;
208
+
209
+ var defaultRules = defaultFilterParams === null || defaultFilterParams === void 0 ? void 0 : defaultFilterParams[(_column$dataIndex$toS = column === null || column === void 0 ? void 0 : (_column$dataIndex = column.dataIndex) === null || _column$dataIndex === void 0 ? void 0 : _column$dataIndex.toString()) !== null && _column$dataIndex$toS !== void 0 ? _column$dataIndex$toS : ''];
210
+
211
+ if (defaultRules) {
212
+ var _ref$current$getState, _ref$current, _ref$current$getState2, _ref$current$getState3, _ref$current2, _ref$current2$setFilt;
213
+
214
+ var params = '';
215
+ var rules = [];
216
+
217
+ if (Array.isArray(defaultRules)) {
218
+ params = defaultRules.join(',');
219
+ rules = defaultRules;
220
+ } else {
221
+ params = defaultRules;
222
+ rules = [defaultRules];
223
+ } // 需要带上其他所有的信息
224
+
225
+
226
+ var otherRules = (_ref$current$getState = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : (_ref$current$getState2 = _ref$current.getState) === null || _ref$current$getState2 === void 0 ? void 0 : (_ref$current$getState3 = _ref$current$getState2.call(_ref$current)) === null || _ref$current$getState3 === void 0 ? void 0 : _ref$current$getState3.filterRules) !== null && _ref$current$getState !== void 0 ? _ref$current$getState : {}; // 再设置所有的列筛选状态
227
+
228
+ (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : (_ref$current2$setFilt = _ref$current2.setFilterRules) === null || _ref$current2$setFilt === void 0 ? void 0 : _ref$current2$setFilt.call(_ref$current2, _objectSpread(_objectSpread({}, otherRules), {}, _defineProperty({}, column.dataIndex, {
229
+ rules: rules,
230
+ params: params
231
+ })));
232
+ }
233
+ });
196
234
  }
@@ -1,2 +1,3 @@
1
1
  import * as utils from '@teamix/utils';
2
+ export * from '@teamix/utils';
2
3
  export default utils;
@@ -5,10 +5,23 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ var _exportNames = {};
8
9
  exports.default = void 0;
9
10
 
10
11
  var utils = _interopRequireWildcard(require("@teamix/utils"));
11
12
 
13
+ Object.keys(utils).forEach(function (key) {
14
+ if (key === "default" || key === "__esModule") return;
15
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
16
+ if (key in exports && exports[key] === utils[key]) return;
17
+ Object.defineProperty(exports, key, {
18
+ enumerable: true,
19
+ get: function get() {
20
+ return utils[key];
21
+ }
22
+ });
23
+ });
24
+
12
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
26
 
14
27
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.2.24",
3
+ "version": "1.2.26",
4
4
  "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",