@teamix/pro 1.2.11 → 1.2.12

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 (42) hide show
  1. package/dist/212.js +1 -1
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +1382 -644
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/es/actions/index.scss +14 -0
  7. package/es/form/Filter/index.d.ts +2 -5
  8. package/es/form/Filter/index.js +3 -44
  9. package/es/form/Filter/index.scss +71 -0
  10. package/es/form/Filter/index2.d.ts +8 -0
  11. package/es/form/Filter/index2.js +318 -0
  12. package/es/form/ProForm/index.scss +1 -19
  13. package/es/form/ProForm/useFormDisplayValues.d.ts +3 -5
  14. package/es/form/ProForm/useFormDisplayValues.js +44 -38
  15. package/es/form/index.d.ts +2 -1
  16. package/es/form/index.js +3 -2
  17. package/es/form/typing.d.ts +3 -0
  18. package/es/index.d.ts +1 -1
  19. package/es/index.js +1 -1
  20. package/es/table/components/Filter/index.js +8 -6
  21. package/es/table/components/Filter/index.scss +7 -3
  22. package/es/table/components/Layout/index.js +10 -1
  23. package/es/table/index.js +2 -3
  24. package/lib/actions/index.scss +14 -0
  25. package/lib/form/Filter/index.d.ts +2 -5
  26. package/lib/form/Filter/index.js +4 -45
  27. package/lib/form/Filter/index.scss +71 -0
  28. package/lib/form/Filter/index2.d.ts +8 -0
  29. package/lib/form/Filter/index2.js +342 -0
  30. package/lib/form/ProForm/index.scss +1 -19
  31. package/lib/form/ProForm/useFormDisplayValues.d.ts +3 -5
  32. package/lib/form/ProForm/useFormDisplayValues.js +51 -44
  33. package/lib/form/index.d.ts +2 -1
  34. package/lib/form/index.js +5 -3
  35. package/lib/form/typing.d.ts +3 -0
  36. package/lib/index.d.ts +1 -1
  37. package/lib/index.js +1 -1
  38. package/lib/table/components/Filter/index.js +8 -6
  39. package/lib/table/components/Filter/index.scss +7 -3
  40. package/lib/table/components/Layout/index.js +10 -1
  41. package/lib/table/index.js +1 -2
  42. package/package.json +4 -4
@@ -2,6 +2,7 @@ import type { ReactNode } from 'react';
2
2
  import type { IFormFeedback, Form as FormType, FieldPatternTypes } from '@formily/core';
3
3
  import type { IFormLayoutProps } from '@teamix/formily';
4
4
  import { CommonRequestConfig } from '@teamix/utils';
5
+ import React from 'react';
5
6
  interface AnyObject {
6
7
  [propName: string]: any;
7
8
  }
@@ -64,6 +65,8 @@ export interface ProFormProps extends IFormLayoutProps {
64
65
  onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
65
66
  }
66
67
  export interface QueryFilterProps extends ProFormProps {
68
+ addonBefore?: ReactNode;
69
+ addonAfter?: ReactNode;
67
70
  onFilter?: (values: any) => void;
68
71
  onReset?: (payload?: any) => void;
69
72
  }
package/es/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.10";
24
+ declare const version = "1.2.11";
25
25
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -27,7 +27,7 @@ export * from './page-header';
27
27
  export * from './skeleton';
28
28
  export * from './table'; // export * from './sidebar';
29
29
 
30
- var version = '1.2.10';
30
+ var version = '1.2.11';
31
31
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
32
32
  ProPageContainer, ProPageHeader, ProSkeleton, ProTable, // ProSidebar,
33
33
  hooks, nocode, templates, utils };
@@ -171,7 +171,7 @@ var Filter = function Filter(props) {
171
171
  btn: true
172
172
  }),
173
173
  onClick: function onClick() {
174
- var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge5, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current5, _actionRef$current5$s, _actionRef$current6, _actionRef$current6$r, _actionRef$current7, _actionRef$current7$r;
174
+ var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge5, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current5, _actionRef$current5$s, _actionRef$current6, _actionRef$current6$r, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$c;
175
175
 
176
176
  (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
177
177
 
@@ -214,7 +214,9 @@ var Filter = function Filter(props) {
214
214
  }))); // 发送请求
215
215
 
216
216
  (_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)));
217
- (_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);
217
+ (_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); // 清空表格选择
218
+
219
+ (_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);
218
220
  setVisible(false);
219
221
  }
220
222
  }, getMessage('ok')), /*#__PURE__*/React.createElement(Button, {
@@ -224,15 +226,15 @@ var Filter = function Filter(props) {
224
226
  btn: true
225
227
  }),
226
228
  onClick: function onClick() {
227
- var _actionRef$current$ge6, _actionRef$current8, _actionRef$current8$g, _actionRef$current8$g2, _actionRef$current9, _actionRef$current9$s, _actionRef$current10, _actionRef$current10$;
229
+ var _actionRef$current$ge6, _actionRef$current9, _actionRef$current9$g, _actionRef$current9$g2, _actionRef$current10, _actionRef$current10$, _actionRef$current11, _actionRef$current11$;
228
230
 
229
231
  setSelected([]);
230
- var rules = (_actionRef$current$ge6 = (_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$g = _actionRef$current8.getState) === null || _actionRef$current8$g === void 0 ? void 0 : (_actionRef$current8$g2 = _actionRef$current8$g.call(_actionRef$current8)) === null || _actionRef$current8$g2 === void 0 ? void 0 : _actionRef$current8$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {};
231
- (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$s = _actionRef$current9.setFilterRules) === null || _actionRef$current9$s === void 0 ? void 0 : _actionRef$current9$s.call(_actionRef$current9, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
232
+ var rules = (_actionRef$current$ge6 = (_actionRef$current9 = actionRef.current) === null || _actionRef$current9 === void 0 ? void 0 : (_actionRef$current9$g = _actionRef$current9.getState) === null || _actionRef$current9$g === void 0 ? void 0 : (_actionRef$current9$g2 = _actionRef$current9$g.call(_actionRef$current9)) === null || _actionRef$current9$g2 === void 0 ? void 0 : _actionRef$current9$g2.filterRules) !== null && _actionRef$current$ge6 !== void 0 ? _actionRef$current$ge6 : {};
233
+ (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.setFilterRules) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10, _objectSpread(_objectSpread({}, rules), {}, _defineProperty({}, column.dataIndex, {
232
234
  rules: [],
233
235
  params: ''
234
236
  })));
235
- (_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.filterDataSource) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10, column.dataIndex); // setVisible(!visible);
237
+ (_actionRef$current11 = actionRef.current) === null || _actionRef$current11 === void 0 ? void 0 : (_actionRef$current11$ = _actionRef$current11.filterDataSource) === null || _actionRef$current11$ === void 0 ? void 0 : _actionRef$current11$.call(_actionRef$current11, column.dataIndex); // setVisible(!visible);
236
238
  }
237
239
  }, getMessage('reset'))))));
238
240
  };
@@ -12,12 +12,16 @@
12
12
  }
13
13
  .teamix-pro-table-toolbar-filter-btn-box {
14
14
  display: flex;
15
- justify-content: space-around;
15
+ justify-content: center;
16
16
  margin-top: 10px;
17
17
  padding-bottom: 5px;
18
+ padding-left: 4px;
19
+ padding-right: 4px;
18
20
  }
19
21
  .teamix-pro-table-toolbar-filter-btn.teamix-pro-table-toolbar-filter-btn {
20
- width: 48px !important;
21
- min-width: unset !important;
22
+ min-width: 48px !important;
23
+ &:first-child {
24
+ margin-right: 8px;
25
+ }
22
26
  }
23
27
  }
@@ -70,7 +70,16 @@ var Layout = function Layout(props) {
70
70
  var _mainAction$actions;
71
71
 
72
72
  if (_typeof(mainAction) === 'object' && (mainAction === null || mainAction === void 0 ? void 0 : (_mainAction$actions = mainAction.actions) === null || _mainAction$actions === void 0 ? void 0 : _mainAction$actions.length) > 0) {
73
- // 默认 context
73
+ // 判断 actions 是否 visible 都为 false,是的话也不渲染
74
+ var isEmptyActions = mainAction === null || mainAction === void 0 ? void 0 : mainAction.actions.every(function (action) {
75
+ return (action === null || action === void 0 ? void 0 : action.visible) === false;
76
+ });
77
+
78
+ if (isEmptyActions) {
79
+ return;
80
+ } // 默认 context
81
+
82
+
74
83
  var defaultContext = {
75
84
  action: actionRef.current,
76
85
  rowSelection: rowSelection
package/es/table/index.js CHANGED
@@ -33,7 +33,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
33
33
  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; }
34
34
 
35
35
  import React, { useState, useEffect, useRef, useMemo } from 'react';
36
- import { Table, Pagination, Message, Checkbox } from '@alicloudfe/components';
36
+ import { Table, Pagination, Checkbox } from '@alicloudfe/components';
37
37
  import genProColumnToColumn from './utils/genProColumnToColumn';
38
38
  import { baseClass, useRequest, request as utilResquest, getDeepValue, getMessage, pickProps } from '@teamix/utils';
39
39
  import { ProSkeletonRaw as Skeleton } from '../skeleton';
@@ -481,8 +481,7 @@ var ProTable = function ProTable(props) {
481
481
 
482
482
  if (props.onError) {
483
483
  props.onError(error);
484
- } else {
485
- Message.error(error.toString());
484
+ } else {// Message.error(error.toString());
486
485
  } // 重新计算是否需要吸底
487
486
 
488
487
 
@@ -96,3 +96,17 @@
96
96
  margin-bottom: 0px;
97
97
  }
98
98
  }
99
+
100
+ .next-dialog-body {
101
+ .teamix-pro-info {
102
+ .next-card-content-container {
103
+ margin-top: 10px;
104
+ padding-bottom: 10px;
105
+ .next-col.next-col-24:last-child {
106
+ .teamix-pro-field-info-form-item:last-child {
107
+ padding-bottom: 0px;
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
@@ -1,16 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { IFilterProps } from '../typing';
3
+ import './index.scss';
3
4
  /**
4
5
  * 简单筛选
5
6
  */
6
7
  declare const SimpleFilter: React.FC<IFilterProps>;
7
- /**
8
- * 查询筛选
9
- */
10
- declare const QueryFilter: React.FC<IFilterProps>;
11
8
  /**
12
9
  * 高级筛选
13
10
  */
14
11
  declare const AdvancedFilter: React.FC<IFilterProps>;
15
- export { AdvancedFilter, SimpleFilter, QueryFilter };
12
+ export { AdvancedFilter, SimpleFilter };
16
13
  export default AdvancedFilter;
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.SimpleFilter = exports.QueryFilter = exports.AdvancedFilter = void 0;
8
+ exports.default = exports.SimpleFilter = exports.AdvancedFilter = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -19,8 +19,9 @@ var _ProForm = _interopRequireDefault(require("../ProForm"));
19
19
 
20
20
  var _utils2 = require("../utils");
21
21
 
22
- var _excluded = ["schema", "triggerType", "onFilter"],
23
- _excluded2 = ["schema", "triggerType", "onFilter"];
22
+ require("./index.scss");
23
+
24
+ var _excluded = ["schema", "triggerType", "onFilter"];
24
25
 
25
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
27
 
@@ -110,52 +111,10 @@ exports.SimpleFilter = SimpleFilter;
110
111
  SimpleFilter.defaultProps = {
111
112
  triggerType: 'change'
112
113
  };
113
- /**
114
- * 查询筛选
115
- */
116
-
117
- var QueryFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
118
- var schema = props.schema,
119
- triggerType = props.triggerType,
120
- onFilter = props.onFilter,
121
- otherProps = _objectWithoutProperties(props, _excluded2);
122
-
123
- var prefixCls = (0, _utils.usePrefixCls)('', {
124
- prefix: 'teamix-pro-form-filter-query'
125
- });
126
- var querySchema = (0, _react.useMemo)(function () {
127
- return [{
128
- component: 'QueryFilter',
129
- props: {
130
- placeholder: 'placeholder'
131
- },
132
- children: schema
133
- }, {
134
- type: 'void',
135
- decorator: null,
136
- component: 'Submit',
137
- props: {
138
- style: _objectSpread({}, triggerType === 'submit' ? {} : {
139
- display: 'none'
140
- })
141
- }
142
- }];
143
- }, []);
144
- var eventProps = getEventProps(triggerType, onFilter);
145
- return /*#__PURE__*/_react.default.createElement(_ProForm.default, _objectSpread(_objectSpread(_objectSpread({
146
- feedbackLayout: "none",
147
- breakpoints: [],
148
- bordered: false
149
- }, otherProps), eventProps), {}, {
150
- className: (0, _classnames.default)(prefixCls, props.className),
151
- schema: querySchema
152
- }));
153
- });
154
114
  /**
155
115
  * 高级筛选
156
116
  */
157
117
 
158
- exports.QueryFilter = QueryFilter;
159
118
  var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
160
119
  var form = (0, _react.useMemo)(function () {
161
120
  return (props === null || props === void 0 ? void 0 : props.form) || (0, _core.createForm)();
@@ -0,0 +1,71 @@
1
+ @import '../global.scss';
2
+
3
+ $query-filter: #{$teamix-pro-form}-query-filter;
4
+
5
+ .#{$query-filter} {
6
+ .#{$query-filter}-inline {
7
+ display: flex;
8
+ justify-content: space-between;
9
+ }
10
+ .#{$query-filter}-left {
11
+ display: flex;
12
+ }
13
+ .#{$query-filter}-addonBefore {
14
+ flex: 0 1 auto;
15
+ margin-right: 8px;
16
+ }
17
+ .#{$query-filter}-simple {
18
+ flex: 0 0 auto;
19
+ margin-right: -8px;
20
+ margin-bottom: 8px;
21
+ }
22
+ .#{$query-filter}-toggle {
23
+ margin-bottom: 8px;
24
+ }
25
+ .#{$query-filter}-addonAfter {
26
+ flex: 0 1 auto;
27
+ margin-left: 8px;
28
+ }
29
+ .#{$query-filter}-tag-title {
30
+ margin-right: 12px;
31
+ color: var(--color-text1-8, #848484);
32
+ }
33
+ .#{$query-filter}-tag-content {
34
+ color: var(--color-text1-2, #5a5a5a);
35
+ font-weight: bold;
36
+ }
37
+ .#{$query-filter}-tag-hidden {
38
+ display: none;
39
+ }
40
+ .#{$query-filter}-advanced {
41
+ padding: 16px;
42
+ background-color: var(--color-fill1-2, #f7f7f7);
43
+ }
44
+ .#{$query-filter}-advanced-hidden {
45
+ display: none;
46
+ }
47
+ }
48
+
49
+ // 筛选
50
+ .#{$teamix-pro-form}-filter-advanced,
51
+ .#{$teamix-pro-form}-filter-simple {
52
+ .#{$form-item-cls}-feedback-layout-popover {
53
+ margin-bottom: 0;
54
+ }
55
+ .#{$css-prefix}date-picker2-input {
56
+ .#{$css-prefix}input {
57
+ width: inherit;
58
+ input {
59
+ width: inherit;
60
+ }
61
+ }
62
+ }
63
+ }
64
+
65
+ // 筛选和抽屉按钮
66
+ .#{$teamix-pro-form}-filter-advanced,
67
+ .#{$css-prefix}drawer-footer {
68
+ .#{$css-prefix}formily-button-group {
69
+ margin-top: 0;
70
+ }
71
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { QueryFilterProps } from '../typing';
3
+ import './index.scss';
4
+ /**
5
+ * 查询筛选
6
+ */
7
+ declare const QueryFilter: React.FC<QueryFilterProps>;
8
+ export { QueryFilter };