@teamix/pro 1.2.29 → 1.2.33

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 (89) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +737 -1579
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/dialog-form.js +58 -9
  6. package/es/common.scss +22 -0
  7. package/es/form/Filter/SimpleFilter.js +10 -3
  8. package/es/form/Filter/index.d.ts +5 -9
  9. package/es/form/Filter/index.js +371 -154
  10. package/es/form/Filter/index.scss +33 -11
  11. package/es/form/Filter/index2.d.ts +9 -5
  12. package/es/form/Filter/index2.js +154 -370
  13. package/es/form/Filter/index2.scss +11 -33
  14. package/es/form/ProForm/index.scss +5 -0
  15. package/es/form/SchemaForm/index.js +4 -4
  16. package/es/form/index.d.ts +3 -3
  17. package/es/form/index.js +3 -3
  18. package/es/form/typing.d.ts +6 -1
  19. package/es/index.d.ts +1 -1
  20. package/es/index.js +1 -1
  21. package/es/info/components/InfoValueItem/index.js +38 -12
  22. package/es/info/components/InfoValueItem/index.scss +1 -0
  23. package/es/info/components/ProInfoItem/index.js +6 -3
  24. package/es/info/components/ProInfoItem/index.scss +9 -0
  25. package/es/info/components/baseInfo/index.js +4 -2
  26. package/es/info/components/headerInfo/index.js +2 -1
  27. package/es/info/components/tableInfo/index.js +2 -1
  28. package/es/info/index.scss +2 -0
  29. package/es/info/typing.d.ts +3 -0
  30. package/es/table/components/Filter/index.js +6 -6
  31. package/es/table/components/Layout/index.js +39 -18
  32. package/es/table/components/Layout/index.scss +7 -0
  33. package/es/table/components/ToolBar/Fullscreen.js +7 -11
  34. package/es/table/components/ToolBar/index.scss +1 -0
  35. package/es/table/index.js +82 -29
  36. package/es/table/index.scss +4 -0
  37. package/es/table/typing.d.ts +2 -2
  38. package/es/table/utils/columnRender.js +1 -1
  39. package/es/table/utils/index.d.ts +2 -1
  40. package/es/table/utils/index.js +62 -113
  41. package/lib/actions/dialog-form.js +57 -10
  42. package/lib/common.scss +22 -0
  43. package/lib/form/Filter/SimpleFilter.js +8 -1
  44. package/lib/form/Filter/index.d.ts +5 -9
  45. package/lib/form/Filter/index.js +384 -154
  46. package/lib/form/Filter/index.scss +33 -11
  47. package/lib/form/Filter/index2.d.ts +9 -5
  48. package/lib/form/Filter/index2.js +154 -383
  49. package/lib/form/Filter/index2.scss +11 -33
  50. package/lib/form/ProForm/index.scss +5 -0
  51. package/lib/form/SchemaForm/index.js +4 -4
  52. package/lib/form/index.d.ts +3 -3
  53. package/lib/form/index.js +8 -8
  54. package/lib/form/typing.d.ts +6 -1
  55. package/lib/index.d.ts +1 -1
  56. package/lib/index.js +1 -1
  57. package/lib/info/components/InfoValueItem/index.js +38 -12
  58. package/lib/info/components/InfoValueItem/index.scss +1 -0
  59. package/lib/info/components/ProInfoItem/index.js +6 -3
  60. package/lib/info/components/ProInfoItem/index.scss +9 -0
  61. package/lib/info/components/baseInfo/index.js +4 -2
  62. package/lib/info/components/headerInfo/index.js +2 -1
  63. package/lib/info/components/tableInfo/index.js +2 -1
  64. package/lib/info/index.scss +2 -0
  65. package/lib/info/typing.d.ts +3 -0
  66. package/lib/table/components/Filter/index.js +6 -6
  67. package/lib/table/components/Layout/index.js +39 -18
  68. package/lib/table/components/Layout/index.scss +7 -0
  69. package/lib/table/components/ToolBar/Fullscreen.js +7 -11
  70. package/lib/table/components/ToolBar/index.scss +1 -0
  71. package/lib/table/index.js +81 -28
  72. package/lib/table/index.scss +4 -0
  73. package/lib/table/typing.d.ts +2 -2
  74. package/lib/table/utils/columnRender.js +1 -1
  75. package/lib/table/utils/index.d.ts +2 -1
  76. package/lib/table/utils/index.js +63 -112
  77. package/package.json +1 -1
  78. package/dist/212.js +0 -155705
  79. package/dist/fonts/codicon.ttf +0 -0
  80. package/es/form/Components/SelectTable/index.d.ts +0 -24
  81. package/es/form/Components/SelectTable/index.js +0 -135
  82. package/es/form/Components/SelectTable/index.scss +0 -28
  83. package/es/form/Components/SelectTable/table.d.ts +0 -6
  84. package/es/form/Components/SelectTable/table.js +0 -64
  85. package/lib/form/Components/SelectTable/index.d.ts +0 -24
  86. package/lib/form/Components/SelectTable/index.js +0 -157
  87. package/lib/form/Components/SelectTable/index.scss +0 -28
  88. package/lib/form/Components/SelectTable/table.d.ts +0 -6
  89. package/lib/form/Components/SelectTable/table.js +0 -76
@@ -1,5 +1,11 @@
1
1
  var _excluded = ["schema"],
2
- _excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish"];
2
+ _excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish", "beforeRequest"];
3
+
4
+ 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); }
5
+
6
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
7
+
8
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3
9
 
4
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
11
 
@@ -27,7 +33,7 @@ import React, { useState, useEffect, createRef } from 'react';
27
33
  import { useHistory } from 'react-router-dom';
28
34
  import { Loading } from '@alicloudfe/components';
29
35
  import ProForm, { createForm } from '../form';
30
- import { getTargetValue } from '@teamix/utils';
36
+ import { getTargetValue, resolveMaybePromiseMethod } from '@teamix/utils';
31
37
  import { doRequest } from './request';
32
38
  import useDialogAction from './dialog';
33
39
  import { addContext } from './utils';
@@ -134,6 +140,7 @@ export function useDialogFormAction(action, context) {
134
140
  _action$size = action.size,
135
141
  size = _action$size === void 0 ? 'small' : _action$size,
136
142
  _onFinish = action.onFinish,
143
+ propsBeforeRequest = action.beforeRequest,
137
144
  others = _objectWithoutProperties(action, _excluded2);
138
145
 
139
146
  var formRef = /*#__PURE__*/createRef();
@@ -154,13 +161,55 @@ export function useDialogFormAction(action, context) {
154
161
  }, dialogFormProps));
155
162
  },
156
163
  extendParams: useFieldValuesForRequest ? '{{fields}}' : undefined,
157
- beforeRequest: function beforeRequest() {
158
- return new Promise(function (resolve) {
159
- formRef.current.validate().then(function () {
160
- resolve({
161
- fields: formRef.current.values
162
- });
163
- }).catch(function () {
164
+ beforeRequest: function beforeRequest(context) {
165
+ return new Promise(function (resolve, reject) {
166
+ formRef.current.validate().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
167
+ var beforeRequestContext, requestContext;
168
+ return regeneratorRuntime.wrap(function _callee$(_context) {
169
+ while (1) {
170
+ switch (_context.prev = _context.next) {
171
+ case 0:
172
+ if (!propsBeforeRequest) {
173
+ _context.next = 13;
174
+ break;
175
+ }
176
+
177
+ _context.prev = 1;
178
+ _context.next = 4;
179
+ return resolveMaybePromiseMethod(propsBeforeRequest, context);
180
+
181
+ case 4:
182
+ beforeRequestContext = _context.sent;
183
+ _context.next = 10;
184
+ break;
185
+
186
+ case 7:
187
+ _context.prev = 7;
188
+ _context.t0 = _context["catch"](1);
189
+ beforeRequestContext = false;
190
+
191
+ case 10:
192
+ if (!(beforeRequestContext === false)) {
193
+ _context.next = 13;
194
+ break;
195
+ }
196
+
197
+ reject(false);
198
+ return _context.abrupt("return");
199
+
200
+ case 13:
201
+ requestContext = Object.assign({
202
+ fields: formRef.current.values
203
+ }, _typeof(beforeRequestContext) === 'object' ? beforeRequestContext : {});
204
+ resolve(requestContext);
205
+
206
+ case 15:
207
+ case "end":
208
+ return _context.stop();
209
+ }
210
+ }
211
+ }, _callee, null, [[1, 7]]);
212
+ }))).catch(function () {
164
213
  resolve(false);
165
214
  });
166
215
  });
package/es/common.scss ADDED
@@ -0,0 +1,22 @@
1
+ // 容器滚动条样式
2
+ @mixin hybridcloud-scrollbar {
3
+ &::-webkit-scrollbar {
4
+ width: 12px;
5
+ height: 12px;
6
+ }
7
+ &::-webkit-scrollbar-thumb {
8
+ border-color: transparent;
9
+ border-style: solid;
10
+ border-width: 4px;
11
+ background-clip: content-box;
12
+ border-radius: 6px;
13
+ background-color: var(--scrollbar-thumb-bg);
14
+ &:hover {
15
+ border-width: 3px;
16
+ background-color: var(--scrollbar-thumb-hover-bg);
17
+ }
18
+ }
19
+ &::-webkit-scrollbar-track {
20
+ background-color: transparent;
21
+ }
22
+ }
@@ -10,13 +10,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
10
10
 
11
11
  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; }
12
12
 
13
- import React, { memo, useCallback, useMemo, useRef } from 'react';
13
+ import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';
14
14
  import cls from 'classnames';
15
- import { usePrefixCls } from '@teamix/utils';
15
+ import { usePrefixCls, isValid } from '@teamix/utils';
16
16
  import ProForm from '../ProForm'; // 初始化Search组件,内置部分属性
17
17
 
18
18
  var initializeSearch = function initializeSearch(schema) {
19
- var searchName;
19
+ var searchName = '';
20
20
  var initializedSchema = schema.map(function (item) {
21
21
  if (item.component === 'Search') {
22
22
  searchName = item.name;
@@ -85,6 +85,13 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
85
85
  onChange === null || onChange === void 0 ? void 0 : onChange(values, name, value);
86
86
  }
87
87
  }, [searchName, searchValue.current]);
88
+ useEffect(function () {
89
+ var _props$form$initialVa, _props$form$initialVa2;
90
+
91
+ // 处理Search组件,缓存input的默认值
92
+ var searchDefaultValue = (_props$form$initialVa = props.form.initialValues) === null || _props$form$initialVa === void 0 ? void 0 : (_props$form$initialVa2 = _props$form$initialVa[searchName]) === null || _props$form$initialVa2 === void 0 ? void 0 : _props$form$initialVa2[1];
93
+ searchValue.current = isValid(searchDefaultValue) ? searchDefaultValue : '';
94
+ }, []);
88
95
  return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({}, otherProps), {}, {
89
96
  className: cls(prefixCls, props.className),
90
97
  schema: simpleSchema,
@@ -1,13 +1,9 @@
1
1
  import React from 'react';
2
- import type { IFilterProps } from '../typing';
2
+ import { QueryFilterLayout } from './Layout';
3
+ import type { QueryFilterProps } from '../typing';
3
4
  import './index.scss';
4
5
  /**
5
- * 简单筛选
6
+ * 查询筛选
6
7
  */
7
- declare const SimpleFilter: React.FC<IFilterProps>;
8
- /**
9
- * 高级筛选
10
- */
11
- declare const AdvancedFilter: React.FC<IFilterProps>;
12
- export { AdvancedFilter, SimpleFilter };
13
- export default AdvancedFilter;
8
+ declare const QueryFilter: React.FC<QueryFilterProps>;
9
+ export { QueryFilter, QueryFilterLayout };