@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,10 +1,11 @@
|
|
1
|
-
import {
|
1
|
+
import { isUsable, isStr, isPureObj } from '@teamix/utils'; // 获取Schema是否包含默认值、异步默认值、必选校验等
|
2
2
|
|
3
3
|
var useSpecialProps = function useSpecialProps(props) {
|
4
4
|
var initialValues = props.initialValues,
|
5
5
|
initialRequest = props.initialRequest;
|
6
|
-
var
|
7
|
-
|
6
|
+
var hasChangeDefault = !!initialValues || !!initialRequest; // 会触发onChange的默认值
|
7
|
+
|
8
|
+
var hasDefault = hasChangeDefault;
|
8
9
|
var hasRequired = false;
|
9
10
|
|
10
11
|
var hasDefaultOrRule = function hasDefaultOrRule(schema) {
|
@@ -12,13 +13,12 @@ var useSpecialProps = function useSpecialProps(props) {
|
|
12
13
|
var value = item.default,
|
13
14
|
required = item.required,
|
14
15
|
rules = item.rules,
|
15
|
-
request = item.request,
|
16
16
|
dataSource = item.dataSource,
|
17
|
-
children = item.children;
|
18
|
-
|
17
|
+
children = item.children; // 字符串变量配置default值会触发onChange
|
18
|
+
|
19
|
+
hasChangeDefault = hasChangeDefault || !!(isPureObj(dataSource) && isStr(value) && value.indexOf('.dataSource'));
|
20
|
+
hasDefault = hasDefault || isUsable(value);
|
19
21
|
hasRequired = hasRequired || required || !!rules;
|
20
|
-
hasAsyncDefault = hasAsyncDefault || !!request || // 如果dataSource是异步且default取自dataSource
|
21
|
-
!!(isPlainObj(dataSource) && isStr(value) && value.indexOf('.dataSource'));
|
22
22
|
|
23
23
|
if (children === null || children === void 0 ? void 0 : children.length) {
|
24
24
|
hasDefaultOrRule(children);
|
@@ -29,7 +29,7 @@ var useSpecialProps = function useSpecialProps(props) {
|
|
29
29
|
hasDefaultOrRule(props.schema);
|
30
30
|
return {
|
31
31
|
hasDefault: hasDefault,
|
32
|
-
|
32
|
+
hasChangeDefault: hasChangeDefault,
|
33
33
|
hasRequired: hasRequired
|
34
34
|
};
|
35
35
|
};
|
package/es/form/ProForm/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["form", "initialValues", "initialRequest", "schema", "scope", "context", "components", "children", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "onChange", "onSubmit", "onSubmitFailed", "className"];
|
1
|
+
var _excluded = ["form", "initialValues", "initialRequest", "schema", "scope", "context", "components", "children", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "onChange", "onSubmit", "onSubmitFailed", "onInitialComplete", "className"];
|
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
|
|
@@ -41,6 +41,7 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
41
41
|
onChange = _ref.onChange,
|
42
42
|
onSubmit = _ref.onSubmit,
|
43
43
|
onSubmitFailed = _ref.onSubmitFailed,
|
44
|
+
onInitialComplete = _ref.onInitialComplete,
|
44
45
|
className = _ref.className,
|
45
46
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
46
47
|
|
@@ -91,13 +92,12 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
91
92
|
useEffect(function () {
|
92
93
|
if (initialValues) {
|
93
94
|
form.setInitialValues(initialValues);
|
95
|
+
onInitialComplete === null || onInitialComplete === void 0 ? void 0 : onInitialComplete(form);
|
94
96
|
} else if (initialRequest) {
|
95
97
|
useInitialRequest(initialRequest).then(function (values) {
|
96
98
|
form.setInitialValues(values);
|
97
99
|
}).finally(function () {
|
98
|
-
|
99
|
-
form: form
|
100
|
-
});
|
100
|
+
onInitialComplete === null || onInitialComplete === void 0 ? void 0 : onInitialComplete(form);
|
101
101
|
});
|
102
102
|
}
|
103
103
|
}, []); // 配置国际化
|
@@ -143,6 +143,11 @@
|
|
143
143
|
height: $inset-font-weight-medium;
|
144
144
|
line-height: $inset-font-weight-medium;
|
145
145
|
}
|
146
|
+
.#{$css-prefix}select-multiple {
|
147
|
+
.#{$css-prefix}input.#{$css-prefix}medium {
|
148
|
+
height: auto;
|
149
|
+
}
|
150
|
+
}
|
146
151
|
}
|
147
152
|
}
|
148
153
|
}
|
@@ -192,14 +197,14 @@
|
|
192
197
|
margin-right: 4px;
|
193
198
|
}
|
194
199
|
}
|
195
|
-
// 数组类ArrayItem Icon
|
196
|
-
.#{$form-array}-items-item-inner {
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
}
|
200
|
+
// 数组类ArrayItem Icon 居中(移除,通过align:center配置)
|
201
|
+
// .#{$form-array}-items-item-inner {
|
202
|
+
// .#{$css-prefix}space-item {
|
203
|
+
// > .#{$css-prefix}formily-icon {
|
204
|
+
// margin-top: 9px;
|
205
|
+
// }
|
206
|
+
// }
|
207
|
+
// }
|
203
208
|
|
204
209
|
// Editable预览态行高
|
205
210
|
.#{$css-prefix}formily-editable-content {
|
@@ -198,18 +198,18 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
198
198
|
var defaultDecoratorProps = _objectSpread(_objectSpread({}, tooltipProps), decoratorProps); // 初始化request
|
199
199
|
|
200
200
|
|
201
|
-
var _initializeRequest = initializeRequest(request, suffix),
|
201
|
+
var _initializeRequest = initializeRequest(request, "".concat(suffix, "r")),
|
202
202
|
requestReactions = _initializeRequest.reactions,
|
203
|
-
requestScope = _initializeRequest.scope; // 初始化dataSource
|
203
|
+
requestScope = _initializeRequest.scope; // 初始化dataSource,如果readPretty为字符串表达式将失去loading等状态,仍可配置dataSource
|
204
204
|
|
205
205
|
|
206
|
-
var _initializeDataSource = initializeDataSource(dataSource, suffix),
|
206
|
+
var _initializeDataSource = initializeDataSource(dataSource, "".concat(suffix, "d"), newItem.readPretty),
|
207
207
|
defaultDataSource = _initializeDataSource.dataSource,
|
208
208
|
dataSourceReactions = _initializeDataSource.reactions,
|
209
|
-
dataSourceScope = _initializeDataSource.scope; // 初始化rules
|
209
|
+
dataSourceScope = _initializeDataSource.scope; // 初始化rules validator
|
210
210
|
|
211
211
|
|
212
|
-
var _initializeRules = initializeRules(rules, suffix),
|
212
|
+
var _initializeRules = initializeRules(rules, "".concat(suffix, "v")),
|
213
213
|
defaultRules = _initializeRules.rules,
|
214
214
|
rulesScope = _initializeRules.scope; // 合并reactions,初始化reactions
|
215
215
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ProFormRequestConfig } from '../typing';
|
2
2
|
interface IInitializeDataSource {
|
3
|
-
(requestConfig?: ProFormRequestConfig | any, suffix?: string): {
|
3
|
+
(requestConfig?: ProFormRequestConfig | any, suffix?: string, readPretty?: string | boolean): {
|
4
4
|
dataSource?: any[];
|
5
5
|
reactions: any[];
|
6
6
|
scope: {
|
@@ -2,12 +2,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
2
2
|
|
3
3
|
import { isPlainObj } from '@teamix/utils';
|
4
4
|
|
5
|
-
var initializeDataSource = function initializeDataSource(dataSource, suffix) {
|
5
|
+
var initializeDataSource = function initializeDataSource(dataSource, suffix, readPretty) {
|
6
6
|
if (isPlainObj(dataSource)) {
|
7
7
|
var requestConfig = dataSource;
|
8
8
|
var requestConfigName = "$requestConfig_".concat(suffix);
|
9
9
|
return {
|
10
|
-
reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context)}}")],
|
10
|
+
reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context,").concat(readPretty, ")}}")],
|
11
11
|
scope: _defineProperty({}, requestConfigName, requestConfig)
|
12
12
|
};
|
13
13
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ProFormRequestConfig } from '../typing';
|
2
2
|
interface IInitializeRequest {
|
3
|
-
(requestConfig?: ProFormRequestConfig, suffix?: string): {
|
3
|
+
(requestConfig?: ProFormRequestConfig | ProFormRequestConfig[], suffix?: string): {
|
4
4
|
reactions: any[];
|
5
5
|
scope: {
|
6
6
|
[x: string]: any;
|
@@ -1,12 +1,47 @@
|
|
1
|
+
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; }
|
2
|
+
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
+
|
1
5
|
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; }
|
2
6
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
8
|
+
|
9
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
10
|
+
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
12
|
+
|
13
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
14
|
+
|
15
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
16
|
+
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
18
|
+
|
19
|
+
import { isArr } from '@teamix/utils';
|
20
|
+
|
3
21
|
var initializeRequest = function initializeRequest(requestConfig, suffix) {
|
4
22
|
if (requestConfig) {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
23
|
+
if (isArr(requestConfig)) {
|
24
|
+
var reactionsMap = [];
|
25
|
+
var scopeMap = {};
|
26
|
+
requestConfig.forEach(function (item, index) {
|
27
|
+
var _initializeRequest = initializeRequest(item, "".concat(suffix).concat(index)),
|
28
|
+
reactions = _initializeRequest.reactions,
|
29
|
+
scope = _initializeRequest.scope;
|
30
|
+
|
31
|
+
reactionsMap = [].concat(_toConsumableArray(reactionsMap), _toConsumableArray(reactions));
|
32
|
+
scopeMap = _objectSpread(_objectSpread({}, scopeMap), scope);
|
33
|
+
});
|
34
|
+
return {
|
35
|
+
reactions: reactionsMap,
|
36
|
+
scope: scopeMap
|
37
|
+
};
|
38
|
+
} else {
|
39
|
+
var requestConfigName = "$requestConfig_".concat(suffix);
|
40
|
+
return {
|
41
|
+
reactions: ["{{$common($request,".concat(requestConfigName, ",context)}}")],
|
42
|
+
scope: _defineProperty({}, requestConfigName, requestConfig)
|
43
|
+
};
|
44
|
+
}
|
10
45
|
}
|
11
46
|
|
12
47
|
return {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ProFormRequestConfig } from '../typing';
|
2
|
-
declare const $request: (field: any, requestConfig: ProFormRequestConfig, context: any) => Promise<unknown>;
|
2
|
+
declare const $request: (field: any, requestConfig: ProFormRequestConfig, context: any, type: 'request' | 'validator' | 'dataSource') => Promise<unknown>;
|
3
3
|
declare const $common: (services: any, requestConfig: ProFormRequestConfig, context: any) => (field: any) => any;
|
4
4
|
declare const $validator: (services: any, requestConfig: ProFormRequestConfig, context: any) => (value: any, rules: any, { field }: any) => any;
|
5
|
-
declare const $dataSource: (services: any, requestConfig: ProFormRequestConfig, context: any) => (field: any) => any;
|
5
|
+
declare const $dataSource: (services: any, requestConfig: ProFormRequestConfig, context: any, readPretty: any) => (field: any) => any;
|
6
6
|
export { $request, $common, $dataSource, $validator };
|
@@ -4,16 +4,21 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
4
4
|
|
5
5
|
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; }
|
6
6
|
|
7
|
-
import { isFn,
|
7
|
+
import { isFn, isPureObj, doCommonRequest, getValueByValue } from '@teamix/utils'; // 配置请求
|
8
8
|
|
9
|
-
var $request = function $request(field, requestConfig, context) {
|
9
|
+
var $request = function $request(field, requestConfig, context, type) {
|
10
10
|
var _field$data;
|
11
11
|
|
12
|
-
var refresh = field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
13
12
|
var beforeRequest = requestConfig.beforeRequest,
|
14
13
|
onSuccess = requestConfig.onSuccess;
|
15
|
-
var refreshResult = isPlainObj(refresh) ? refresh : {};
|
16
14
|
var beforeRequestResult = isFn(beforeRequest) ? beforeRequest(field, context) : {};
|
15
|
+
/**
|
16
|
+
* // 主动触发的请求刷新
|
17
|
+
*/
|
18
|
+
// 触发所有配置的请求
|
19
|
+
|
20
|
+
var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
21
|
+
var refreshResult = isPureObj(refresh) ? refresh : {};
|
17
22
|
return doCommonRequest(_objectSpread(_objectSpread({}, requestConfig), {}, {
|
18
23
|
params: _objectSpread(_objectSpread(_objectSpread({}, requestConfig.params), beforeRequestResult), refreshResult),
|
19
24
|
beforeRequest: function beforeRequest() {
|
@@ -28,7 +33,7 @@ var $request = function $request(field, requestConfig, context) {
|
|
28
33
|
|
29
34
|
var $common = function $common(services, requestConfig, context) {
|
30
35
|
return function (field) {
|
31
|
-
return services(field, requestConfig, context).then(function (res) {
|
36
|
+
return services(field, requestConfig, context, 'request').then(function (res) {
|
32
37
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
33
38
|
});
|
34
39
|
};
|
@@ -38,35 +43,48 @@ var $common = function $common(services, requestConfig, context) {
|
|
38
43
|
var $validator = function $validator(services, requestConfig, context) {
|
39
44
|
return function (value, rules, _ref) {
|
40
45
|
var field = _ref.field;
|
41
|
-
return services(field, requestConfig, context).then(function (res) {
|
46
|
+
return services(field, requestConfig, context, 'validator').then(function (res) {
|
42
47
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
43
48
|
});
|
44
49
|
};
|
45
50
|
}; // 配置DataSource
|
46
51
|
|
47
52
|
|
48
|
-
var $dataSource = function $dataSource(services, requestConfig, context) {
|
53
|
+
var $dataSource = function $dataSource(services, requestConfig, context, readPretty) {
|
49
54
|
return function (field) {
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
+
if (!readPretty) {
|
56
|
+
field.setState({
|
57
|
+
loading: true,
|
58
|
+
readOnly: true
|
59
|
+
});
|
60
|
+
}
|
61
|
+
|
62
|
+
return services(field, requestConfig, context, 'dataSource').then(function (res) {
|
55
63
|
var isValueInDataSource = getValueByValue(res, field.value);
|
56
64
|
var clearValue = isValueInDataSource ? {} : {
|
57
65
|
value: undefined
|
58
66
|
};
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
67
|
+
|
68
|
+
if (!readPretty) {
|
69
|
+
field.setState(_objectSpread({
|
70
|
+
dataSource: res,
|
71
|
+
loading: false,
|
72
|
+
readOnly: false
|
73
|
+
}, clearValue));
|
74
|
+
} else {
|
75
|
+
field.setState({
|
76
|
+
dataSource: res
|
77
|
+
});
|
78
|
+
}
|
79
|
+
|
64
80
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
65
81
|
}).catch(function () {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
82
|
+
if (!readPretty) {
|
83
|
+
field.setState({
|
84
|
+
loading: false,
|
85
|
+
readOnly: false
|
86
|
+
});
|
87
|
+
}
|
70
88
|
});
|
71
89
|
};
|
72
90
|
};
|
package/es/form/index.d.ts
CHANGED
@@ -109,10 +109,10 @@ export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, Fo
|
|
109
109
|
/**
|
110
110
|
* 导出 Filter 组件
|
111
111
|
*/
|
112
|
-
import {
|
113
|
-
import { QueryFilter } from './Filter/index2';
|
112
|
+
import { QueryFilter } from './Filter';
|
114
113
|
import { QueryFilterLayout } from './Filter/Layout';
|
115
|
-
|
114
|
+
import { AdvancedFilter, SimpleFilter } from './Filter/index2';
|
115
|
+
export { QueryFilter, QueryFilterLayout, AdvancedFilter, SimpleFilter };
|
116
116
|
/**
|
117
117
|
* 导出 ProForm 组件,支持快速搭建表单
|
118
118
|
*/
|
package/es/form/index.js
CHANGED
@@ -41,10 +41,10 @@ export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, Fo
|
|
41
41
|
* 导出 Filter 组件
|
42
42
|
*/
|
43
43
|
|
44
|
-
import {
|
45
|
-
import { QueryFilter } from './Filter/index2';
|
44
|
+
import { QueryFilter } from './Filter';
|
46
45
|
import { QueryFilterLayout } from './Filter/Layout';
|
47
|
-
|
46
|
+
import { AdvancedFilter, SimpleFilter } from './Filter/index2';
|
47
|
+
export { QueryFilter, QueryFilterLayout, AdvancedFilter, SimpleFilter };
|
48
48
|
/**
|
49
49
|
* 导出 ProForm 组件,支持快速搭建表单
|
50
50
|
*/
|
package/es/form/typing.d.ts
CHANGED
@@ -44,7 +44,7 @@ export interface ProFormSchemaItem {
|
|
44
44
|
readPretty?: boolean | string;
|
45
45
|
pattern?: FieldPatternTypes;
|
46
46
|
default?: any;
|
47
|
-
request?: ProFormRequestConfig;
|
47
|
+
request?: ProFormRequestConfig | ProFormRequestConfig[];
|
48
48
|
data?: AnyObject;
|
49
49
|
}
|
50
50
|
export declare type ProFormSchema = ProFormSchemaItem[];
|
@@ -63,12 +63,14 @@ export interface ProFormProps extends IFormLayoutProps {
|
|
63
63
|
onChange?: (values: any, fieldValue?: any, fieldName?: any) => any;
|
64
64
|
onSubmit?: ((values: any) => any) | CommonRequestConfig;
|
65
65
|
onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
|
66
|
+
onInitialComplete?: (form: FormType) => void;
|
66
67
|
}
|
67
68
|
export interface FilterProps extends ProFormProps {
|
68
69
|
form: FormType;
|
69
70
|
defaultFilterValue?: string;
|
71
|
+
activeFilterValueRef?: React.MutableRefObject<any>;
|
72
|
+
forceClear?: boolean;
|
70
73
|
onReset?: (payload?: any) => void;
|
71
|
-
onResetClick?: () => void;
|
72
74
|
}
|
73
75
|
export interface QueryFilterLayoutProps {
|
74
76
|
prefixCls?: string;
|
@@ -88,8 +90,12 @@ export interface QueryFilterProps extends ProFormProps {
|
|
88
90
|
triggerType?: 'keydown' | 'change' | 'submit';
|
89
91
|
/** 表单展示形式 */
|
90
92
|
mode?: 'inline' | 'panel';
|
93
|
+
/** 面板模式下是否仅展示面板 */
|
94
|
+
purePanel?: boolean;
|
91
95
|
/** 面板是否默认展开,仅在 mode='panel' 时生效 */
|
92
96
|
expand?: boolean;
|
97
|
+
/** 是否强制清除 */
|
98
|
+
forceClear?: boolean;
|
93
99
|
/** 顶部筛选区前缀 */
|
94
100
|
addonBefore?: ReactNode;
|
95
101
|
/** 顶部筛选区后缀 */
|
@@ -112,6 +118,9 @@ export interface QueryFilterProps extends ProFormProps {
|
|
112
118
|
/**
|
113
119
|
* 兼容性导出
|
114
120
|
*/
|
121
|
+
/**
|
122
|
+
* @deprecated 将在未来移除该组件,建议使用 QueryFilter 代替
|
123
|
+
*/
|
115
124
|
export interface IFilterProps extends ProFormProps {
|
116
125
|
triggerType?: 'keydown' | 'change' | 'submit';
|
117
126
|
onFilter?: (values: any) => void;
|
package/es/index.d.ts
CHANGED
@@ -9,7 +9,7 @@ import ProPageHeader from './page-header';
|
|
9
9
|
import ProTable from './table';
|
10
10
|
import ProSkeleton from './skeleton';
|
11
11
|
import utils from './utils';
|
12
|
-
import {
|
12
|
+
import { ProTimeline } from './timeline';
|
13
13
|
import * as nocode from './nocode';
|
14
14
|
import * as templates from './templates';
|
15
15
|
export * from './actions';
|
@@ -23,6 +23,6 @@ export * from './page-header';
|
|
23
23
|
export * from './skeleton';
|
24
24
|
export * from './table';
|
25
25
|
export * from './utils';
|
26
|
-
export * from './
|
27
|
-
declare const version = "1.
|
28
|
-
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable,
|
26
|
+
export * from './timeline';
|
27
|
+
declare const version = "1.3.0";
|
28
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProTimeline, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -11,7 +11,7 @@ import ProTable from './table';
|
|
11
11
|
import ProSkeleton from './skeleton';
|
12
12
|
import utils from './utils'; // import ProSidebar from './sidebar'
|
13
13
|
|
14
|
-
import {
|
14
|
+
import { ProTimeline } from './timeline';
|
15
15
|
import * as nocode from './nocode';
|
16
16
|
import * as templates from './templates';
|
17
17
|
import TeamixIcon from '@teamix/icon'; // 设置图标源
|
@@ -29,8 +29,8 @@ export * from './skeleton';
|
|
29
29
|
export * from './table';
|
30
30
|
export * from './utils'; // export * from './sidebar';
|
31
31
|
|
32
|
-
export * from './
|
33
|
-
var version = '1.
|
32
|
+
export * from './timeline';
|
33
|
+
var version = '1.3.0';
|
34
34
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
35
35
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, // ProSidebar,
|
36
|
-
|
36
|
+
ProTimeline, hooks, nocode, templates, utils };
|
@@ -22,7 +22,8 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
22
22
|
return /*#__PURE__*/React.createElement("div", {
|
23
23
|
className: cls()
|
24
24
|
}, /*#__PURE__*/React.createElement(Row, {
|
25
|
-
gutter: 10
|
25
|
+
gutter: 10,
|
26
|
+
className: cls('base-row')
|
26
27
|
}, /*#__PURE__*/React.createElement(Col, {
|
27
28
|
span: labelCol === null || labelCol === void 0 ? void 0 : labelCol.span,
|
28
29
|
className: cls('label')
|
@@ -80,11 +80,11 @@ var schema = [{
|
|
80
80
|
}, {
|
81
81
|
name: 'iconColor',
|
82
82
|
title: '图标颜色',
|
83
|
-
component: '
|
83
|
+
component: 'ColorPicker'
|
84
84
|
}, {
|
85
85
|
name: 'iconBackgroundColor',
|
86
86
|
title: '图标背景颜色',
|
87
|
-
component: '
|
87
|
+
component: 'ColorPicker'
|
88
88
|
}, {
|
89
89
|
name: 'iconBackgroundType',
|
90
90
|
title: '图标背景形状',
|
package/es/page-header/index.js
CHANGED
@@ -17,7 +17,7 @@ import { useHistory } from 'react-router-dom';
|
|
17
17
|
import classnames from 'classnames';
|
18
18
|
import TeamixIcon from '@teamix/icon';
|
19
19
|
import { Breadcrumb } from '@alicloudfe/components';
|
20
|
-
import { baseClass, goToLink, renderTags, isPresetColor, getColorClassName, getBackgroundColorClassName } from '@teamix/utils';
|
20
|
+
import { baseClass, goToLink, renderTags, isPresetColor, getColor, getColorClassName, getBackgroundColorClassName } from '@teamix/utils';
|
21
21
|
import { ProActionGroup } from '../actions';
|
22
22
|
import { ProSkeletonRaw } from '../skeleton';
|
23
23
|
import ProInfo from '../info';
|
@@ -69,8 +69,8 @@ var getColorAndStyle = function getColorAndStyle(color, backgroundColor, backgro
|
|
69
69
|
var isColorPresetColor = isPresetColor(color);
|
70
70
|
var isBgColorPresetColor = isPresetColor(backgroundColor);
|
71
71
|
var className = classnames((_classnames = {}, _defineProperty(_classnames, "".concat(getColorClassName(color)), isColorPresetColor), _defineProperty(_classnames, "".concat(getBackgroundColorClassName(backgroundColor)), isBgColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-type-".concat(backgroundType))), !!backgroundType), _classnames));
|
72
|
-
var styleColor = isColorPresetColor ?
|
73
|
-
var styleBgColor = isBgColorPresetColor ?
|
72
|
+
var styleColor = isColorPresetColor ? getColor(color) : color;
|
73
|
+
var styleBgColor = isBgColorPresetColor ? getColor(color) : backgroundColor;
|
74
74
|
var style = {
|
75
75
|
color: styleColor,
|
76
76
|
backgroundColor: styleBgColor
|
@@ -56,6 +56,19 @@ var Layout = function Layout(props) {
|
|
56
56
|
context: _objectSpread(_objectSpread({}, defaultContext), mainAction.context)
|
57
57
|
})));
|
58
58
|
} else return mainAction;
|
59
|
+
}; // 渲染 addonAfter
|
60
|
+
|
61
|
+
|
62
|
+
var renderAddonAfter = function renderAddonAfter() {
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
64
|
+
className: cls('addon-after-wrapper')
|
65
|
+
}, extra && !header && /*#__PURE__*/React.createElement(QuickAction, {
|
66
|
+
actionRef: actionRef,
|
67
|
+
quickAction: extra,
|
68
|
+
rowSelection: rowSelection
|
69
|
+
}), /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
|
70
|
+
actionRef: actionRef
|
71
|
+
}, otherProps)));
|
59
72
|
}; // 渲染新版 QueryFilter
|
60
73
|
|
61
74
|
|
@@ -83,13 +96,7 @@ var Layout = function Layout(props) {
|
|
83
96
|
},
|
84
97
|
panelContent: dataFilter.content,
|
85
98
|
addonBefore: renderMainAction(),
|
86
|
-
addonAfter:
|
87
|
-
actionRef: actionRef,
|
88
|
-
quickAction: extra,
|
89
|
-
rowSelection: rowSelection
|
90
|
-
}), /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
|
91
|
-
actionRef: actionRef
|
92
|
-
}, otherProps)))
|
99
|
+
addonAfter: renderAddonAfter()
|
93
100
|
}, dataFilter));
|
94
101
|
} else if ((dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) >= 0) {
|
95
102
|
return /*#__PURE__*/React.createElement(QueryFilter, _objectSpread({
|
@@ -108,27 +115,18 @@ var Layout = function Layout(props) {
|
|
108
115
|
(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
|
109
116
|
},
|
110
117
|
addonBefore: renderMainAction(),
|
111
|
-
addonAfter:
|
112
|
-
actionRef: actionRef,
|
113
|
-
quickAction: extra,
|
114
|
-
rowSelection: rowSelection
|
115
|
-
}), /*#__PURE__*/React.createElement(ToolBar, _objectSpread({
|
116
|
-
actionRef: actionRef
|
117
|
-
}, otherProps)))
|
118
|
+
addonAfter: renderAddonAfter()
|
118
119
|
}, dataFilter));
|
119
120
|
}
|
120
121
|
} else if (mainAction) {
|
121
122
|
// 没传 dataFilter 但是传了 mainAction
|
122
123
|
return /*#__PURE__*/React.createElement(QueryFilterLayout, {
|
123
|
-
className: "mb8",
|
124
124
|
addonBefore: renderMainAction(),
|
125
|
-
addonAfter:
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
actionRef: actionRef
|
131
|
-
}, otherProps)))
|
125
|
+
addonAfter: renderAddonAfter()
|
126
|
+
});
|
127
|
+
} else {
|
128
|
+
return /*#__PURE__*/React.createElement(QueryFilterLayout, {
|
129
|
+
addonAfter: renderAddonAfter()
|
132
130
|
});
|
133
131
|
}
|
134
132
|
}; // 区域组合渲染
|
@@ -148,11 +146,19 @@ var Layout = function Layout(props) {
|
|
148
146
|
rowSelection: rowSelection
|
149
147
|
}))), renderQueryFilter());
|
150
148
|
} else if (header && !mainAction) {
|
149
|
+
var _dataFilter$schema3, _dataFilter$schema4;
|
150
|
+
|
151
151
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
152
152
|
className: cls('wrapper')
|
153
153
|
}, /*#__PURE__*/React.createElement("div", {
|
154
154
|
className: cls('left')
|
155
|
-
}, header && /*#__PURE__*/React.createElement(Header, _objectSpread({}, header)),
|
155
|
+
}, header && /*#__PURE__*/React.createElement(Header, _objectSpread({}, header))), /*#__PURE__*/React.createElement("div", {
|
156
|
+
className: cls('right')
|
157
|
+
}, extra && /*#__PURE__*/React.createElement(QuickAction, {
|
158
|
+
actionRef: actionRef,
|
159
|
+
quickAction: extra,
|
160
|
+
rowSelection: rowSelection
|
161
|
+
}), !(dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema3 = dataFilter.schema) === null || _dataFilter$schema3 === void 0 ? void 0 : _dataFilter$schema3.length) && renderQueryFilter())), (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema4 = dataFilter.schema) === null || _dataFilter$schema4 === void 0 ? void 0 : _dataFilter$schema4.length) && renderQueryFilter());
|
156
162
|
} else if (!header && mainAction) {
|
157
163
|
return /*#__PURE__*/React.createElement(React.Fragment, null, renderQueryFilter());
|
158
164
|
} else if (!header && !mainAction) {
|