@teamix/pro 1.2.32 → 1.3.0
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.
- package/dist/pro.css +1 -1
- package/dist/pro.js +16443 -17407
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.js +58 -9
- package/es/form/Filter/AdvancedFilter.js +4 -4
- package/es/form/Filter/LightFilter.js +22 -15
- package/es/form/Filter/index.d.ts +5 -9
- package/es/form/Filter/index.js +463 -152
- package/es/form/Filter/index.scss +33 -11
- package/es/form/Filter/index2.d.ts +9 -5
- package/es/form/Filter/index2.js +154 -370
- package/es/form/Filter/index2.scss +11 -33
- package/es/form/Filter/useSpecialProps.d.ts +1 -1
- package/es/form/Filter/useSpecialProps.js +9 -9
- package/es/form/ProForm/index.js +4 -4
- package/es/form/ProForm/index.scss +13 -8
- package/es/form/SchemaForm/index.js +5 -5
- package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/es/form/SchemaForm/initializeDataSource.js +2 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/es/form/SchemaForm/initializeRequest.js +40 -5
- package/es/form/SchemaForm/reactions.d.ts +2 -2
- package/es/form/SchemaForm/reactions.js +39 -21
- package/es/form/index.d.ts +3 -3
- package/es/form/index.js +3 -3
- package/es/form/typing.d.ts +11 -2
- package/es/index.d.ts +4 -4
- package/es/index.js +4 -4
- package/es/info/components/ProInfoItem/index.js +2 -1
- package/es/info/components/ProInfoItem/index.scss +4 -0
- package/es/nocode/configurators/PageHeader.js +2 -2
- package/es/page-header/index.js +3 -3
- package/es/table/components/Layout/index.js +29 -23
- package/es/table/components/Layout/index.scss +7 -0
- package/es/table/components/Pagination/index.js +11 -1
- package/es/table/components/ToolBar/Fullscreen.js +32 -4
- package/es/table/components/ToolBar/index.scss +1 -0
- package/es/table/index.js +50 -31
- package/es/table/typing.d.ts +3 -0
- package/es/table/utils/columnRender.js +1 -1
- package/es/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/es/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.js +59 -72
- package/es/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.scss +34 -86
- package/es/timeline/index.d.ts +10 -0
- package/es/{step → timeline}/index.js +33 -57
- package/es/timeline/index.scss +7 -0
- package/es/timeline/typing.d.ts +101 -0
- package/es/{step → timeline}/typing.js +0 -0
- package/lib/actions/dialog-form.js +57 -10
- package/lib/form/Filter/AdvancedFilter.js +4 -4
- package/lib/form/Filter/LightFilter.js +21 -15
- package/lib/form/Filter/index.d.ts +5 -9
- package/lib/form/Filter/index.js +478 -154
- package/lib/form/Filter/index.scss +33 -11
- package/lib/form/Filter/index2.d.ts +9 -5
- package/lib/form/Filter/index2.js +154 -383
- package/lib/form/Filter/index2.scss +11 -33
- package/lib/form/Filter/useSpecialProps.d.ts +1 -1
- package/lib/form/Filter/useSpecialProps.js +8 -8
- package/lib/form/ProForm/index.js +4 -4
- package/lib/form/ProForm/index.scss +13 -8
- package/lib/form/SchemaForm/index.js +5 -5
- package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/lib/form/SchemaForm/initializeDataSource.js +2 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRequest.js +40 -5
- package/lib/form/SchemaForm/reactions.d.ts +2 -2
- package/lib/form/SchemaForm/reactions.js +38 -20
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +8 -8
- package/lib/form/typing.d.ts +11 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +10 -10
- package/lib/info/components/ProInfoItem/index.js +2 -1
- package/lib/info/components/ProInfoItem/index.scss +4 -0
- package/lib/nocode/configurators/PageHeader.js +2 -2
- package/lib/page-header/index.js +2 -2
- package/lib/table/components/Layout/index.js +29 -23
- package/lib/table/components/Layout/index.scss +7 -0
- package/lib/table/components/Pagination/index.js +10 -0
- package/lib/table/components/ToolBar/Fullscreen.js +30 -3
- package/lib/table/components/ToolBar/index.scss +1 -0
- package/lib/table/index.js +50 -31
- package/lib/table/typing.d.ts +3 -0
- package/lib/table/utils/columnRender.js +1 -1
- package/lib/timeline/ProTimeLineItem/index.d.ts +5 -0
- package/lib/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.js +58 -72
- package/lib/{step/ProStepItem/components/VerStepItem → timeline/ProTimeLineItem}/index.scss +34 -86
- package/lib/timeline/index.d.ts +10 -0
- package/lib/{step → timeline}/index.js +38 -58
- package/lib/timeline/index.scss +7 -0
- package/lib/timeline/typing.d.ts +101 -0
- package/lib/{step → timeline}/typing.js +0 -0
- package/package.json +1 -1
- package/dist/212.js +0 -155705
- package/dist/fonts/codicon.ttf +0 -0
- package/es/step/ProStepItem/components/HozStepItem/index.d.ts +0 -5
- package/es/step/ProStepItem/components/HozStepItem/index.js +0 -235
- package/es/step/ProStepItem/components/HozStepItem/index.scss +0 -279
- package/es/step/ProStepItem/components/VerStepItem/index.d.ts +0 -5
- package/es/step/ProStepItem/index.d.ts +0 -4
- package/es/step/ProStepItem/index.js +0 -57
- package/es/step/index.d.ts +0 -9
- package/es/step/typing.d.ts +0 -96
- package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +0 -5
- package/lib/step/ProStepItem/components/HozStepItem/index.js +0 -258
- package/lib/step/ProStepItem/components/HozStepItem/index.scss +0 -279
- package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +0 -5
- package/lib/step/ProStepItem/index.d.ts +0 -4
- package/lib/step/ProStepItem/index.js +0 -69
- package/lib/step/index.d.ts +0 -9
- package/lib/step/typing.d.ts +0 -96
@@ -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
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
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
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["schema", "onSubmit", "onReset", "
|
1
|
+
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "forceClear"];
|
2
2
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
4
4
|
|
@@ -35,12 +35,12 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
35
35
|
var schema = props.schema,
|
36
36
|
onSubmit = props.onSubmit,
|
37
37
|
onReset = props.onReset,
|
38
|
-
onResetClick = props.onResetClick,
|
39
38
|
layout = props.layout,
|
40
39
|
labelAlign = props.labelAlign,
|
41
40
|
wrapperAlign = props.wrapperAlign,
|
42
41
|
labelCol = props.labelCol,
|
43
42
|
wrapperCol = props.wrapperCol,
|
43
|
+
forceClear = props.forceClear,
|
44
44
|
otherProps = _objectWithoutProperties(props, _excluded);
|
45
45
|
|
46
46
|
var prefixCls = usePrefixCls('', {
|
@@ -71,7 +71,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
71
71
|
component: 'Reset',
|
72
72
|
props: {
|
73
73
|
onResetValidateSuccess: onReset,
|
74
|
-
|
74
|
+
forceClear: !!forceClear,
|
75
75
|
children: getMessage('reset')
|
76
76
|
}
|
77
77
|
}, {
|
@@ -86,7 +86,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
86
86
|
}]
|
87
87
|
}])
|
88
88
|
}];
|
89
|
-
}, [schema, onReset
|
89
|
+
}, [schema, onReset]);
|
90
90
|
var getTeamixLayout = useMemo(function () {
|
91
91
|
return {
|
92
92
|
breakpoints: [990],
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["form", "schema", "onSubmit", "onChange", "defaultFilterValue"];
|
1
|
+
var _excluded = ["form", "schema", "onSubmit", "onChange", "defaultFilterValue", "activeFilterValueRef"];
|
2
2
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
4
4
|
|
@@ -10,9 +10,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
10
10
|
|
11
11
|
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; }
|
12
12
|
|
13
|
-
import React, { memo, useMemo, useCallback, useRef } from 'react';
|
13
|
+
import React, { memo, useMemo, useCallback, useRef, useEffect } from 'react';
|
14
14
|
import cls from 'classnames';
|
15
|
-
import { toJS } from '@formily/reactive';
|
16
15
|
import { usePrefixCls } from '@teamix/utils';
|
17
16
|
import ProForm from '../ProForm';
|
18
17
|
/**
|
@@ -27,24 +26,32 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
27
26
|
onSubmit = props.onSubmit,
|
28
27
|
onChange = props.onChange,
|
29
28
|
defaultFilterValue = props.defaultFilterValue,
|
29
|
+
activeFilterValueRef = props.activeFilterValueRef,
|
30
30
|
otherProps = _objectWithoutProperties(props, _excluded);
|
31
31
|
|
32
32
|
var filterValue = useRef(defaultFilterValue || ((_schema$ = schema[0]) === null || _schema$ === void 0 ? void 0 : _schema$.name));
|
33
33
|
var prefixCls = usePrefixCls('', {
|
34
34
|
prefix: 'teamix-pro-form-query-filter-light'
|
35
|
-
});
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
});
|
36
|
+
useEffect(function () {
|
37
|
+
if (activeFilterValueRef) {
|
38
|
+
activeFilterValueRef.current = filterValue.current;
|
39
|
+
}
|
40
|
+
}, []); // 筛选提交切换
|
40
41
|
|
41
42
|
var onFilterChange = useCallback(function (value) {
|
42
43
|
filterValue.current = value;
|
43
|
-
}, [form]); // onChange
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
if (activeFilterValueRef) {
|
46
|
+
activeFilterValueRef.current = value;
|
47
|
+
}
|
48
|
+
}, [form]); // 实际输出onFilter
|
49
|
+
|
50
|
+
var onFilter = useCallback(function () {
|
51
|
+
var key = filterValue.current;
|
52
|
+
var value = form.values[key];
|
53
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_defineProperty({}, key, value));
|
54
|
+
}, [onChange]);
|
48
55
|
var LightSchema = useMemo(function () {
|
49
56
|
return [{
|
50
57
|
component: 'LightFilter',
|
@@ -52,7 +59,7 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
52
59
|
defaultFilterValue: defaultFilterValue,
|
53
60
|
onFilterChange: onFilterChange,
|
54
61
|
buttonProps: {
|
55
|
-
onClick:
|
62
|
+
onClick: onFilter
|
56
63
|
}
|
57
64
|
},
|
58
65
|
children: schema
|
@@ -64,7 +71,7 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
64
71
|
}
|
65
72
|
}
|
66
73
|
}];
|
67
|
-
}, [schema,
|
74
|
+
}, [schema, onFilter, onFilterChange, defaultFilterValue]);
|
68
75
|
return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({}, otherProps), {}, {
|
69
76
|
form: form,
|
70
77
|
className: cls(prefixCls, props.className),
|
@@ -73,7 +80,7 @@ var LightFilter = /*#__PURE__*/memo(function (props) {
|
|
73
80
|
breakpoints: [],
|
74
81
|
bordered: false,
|
75
82
|
onSubmit: onSubmit,
|
76
|
-
onChange:
|
83
|
+
onChange: onFilter
|
77
84
|
}));
|
78
85
|
});
|
79
86
|
export default LightFilter;
|
@@ -1,13 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import
|
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
|
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 };
|