@teamix/pro 1.1.36 → 1.1.40
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/README.md +14 -10
- package/dist/pro.css +1 -1
- package/dist/pro.js +2555 -3791
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.d.ts +5 -5
- package/es/actions/dialog-form.js +1 -5
- package/es/actions/dialog.d.ts +12 -0
- package/es/actions/dialog.js +104 -27
- package/es/actions/index.d.ts +54 -47
- package/es/actions/index.js +28 -22
- package/es/actions/index.scss +48 -2
- package/es/actions/link.js +4 -2
- package/es/actions/request.d.ts +1 -1
- package/es/actions/request.js +2 -2
- package/es/card/index.d.ts +17 -5
- package/es/card/index.js +16 -11
- package/es/form/Components/ProField/index.d.ts +1 -161
- package/es/form/Components/ProField/index.js +34 -40
- package/es/form/Filter/index.js +2 -2
- package/es/form/ProForm/index.d.ts +2 -2
- package/es/form/ProForm/index.js +1 -6
- package/es/form/ProForm/index.scss +19 -1
- package/es/form/ProForm/useFieldRequest.d.ts +5 -0
- package/es/form/ProForm/useFieldRequest.js +26 -0
- package/es/form/SchemaForm/adapterDecorator.js +2 -2
- package/es/form/SchemaForm/index.d.ts +2 -2
- package/es/form/SchemaForm/index.js +12 -21
- package/es/form/SchemaForm/initializeArrayCards.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayItems.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayTable.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.js +2 -2
- package/es/form/SchemaForm/initializeFormButton.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormStep.d.ts +3 -3
- package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.js +2 -2
- package/es/form/SchemaForm/initializeRules.js +44 -16
- package/es/form/SchemaForm/reactions.d.ts +5 -5
- package/es/form/SchemaForm/reactions.js +20 -18
- package/es/form/fieldTypeMap.d.ts +4 -0
- package/es/form/fieldTypeMap.js +41 -0
- package/es/form/index.d.ts +92 -4
- package/es/form/index.js +18 -5
- package/es/form/schemaNameMap.js +3 -0
- package/es/form/typing.d.ts +49 -26
- package/es/form/utils.d.ts +3 -1
- package/es/form/utils.js +38 -1
- package/es/form/warning.d.ts +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/InfoGroup/index.js +73 -15
- package/es/info/components/InfoGroup/index.scss +45 -3
- package/es/info/components/InfoValueItem/index.js +9 -4
- package/es/info/components/InfoValueItem/index.scss +5 -1
- package/es/info/components/ProInfoItem/index.js +3 -3
- package/es/info/components/ProInfoItem/index.scss +1 -0
- package/es/info/components/baseInfo/index.d.ts +2 -3
- package/es/info/components/baseInfo/index.js +29 -10
- package/es/info/components/headerInfo/index.d.ts +2 -3
- package/es/info/components/tableInfo/index.d.ts +2 -3
- package/es/info/components/tableInfo/index.js +2 -2
- package/es/info/index.js +75 -51
- package/es/info/typing.d.ts +54 -36
- package/es/info/utils/index.d.ts +2 -2
- package/es/info/utils/utils.d.ts +1 -1
- package/es/nocode/pages/renderer.js +2 -2
- package/es/page-header/index.d.ts +42 -25
- package/es/page-header/index.js +56 -32
- package/es/page-header/index.scss +2 -1
- package/es/table/components/EmptyContent/index.d.ts +2 -0
- package/es/table/components/EmptyContent/index.js +11 -0
- package/es/table/components/Filter/index.d.ts +2 -2
- package/es/table/components/Filter/index.js +23 -10
- package/es/table/components/Filter/index.scss +1 -1
- package/es/table/components/Layout/index.js +2 -2
- package/es/table/components/QuickAction/index.d.ts +2 -2
- package/es/table/components/QuickAction/index.js +3 -3
- package/es/table/components/ToolBar/Fullscreen.js +1 -0
- package/es/table/index.js +76 -14
- package/es/table/index.scss +4 -0
- package/es/table/typing.d.ts +29 -14
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +2 -2
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +1 -1
- package/es/table/utils/index.js +33 -11
- package/es/templates/List/index.d.ts +2 -2
- package/es/utils/message.d.ts +3 -0
- package/es/utils/message.js +19 -0
- package/lib/actions/dialog-form.d.ts +5 -5
- package/lib/actions/dialog-form.js +1 -5
- package/lib/actions/dialog.d.ts +12 -0
- package/lib/actions/dialog.js +108 -26
- package/lib/actions/index.d.ts +54 -47
- package/lib/actions/index.js +37 -30
- package/lib/actions/index.scss +48 -2
- package/lib/actions/link.js +5 -2
- package/lib/actions/request.d.ts +1 -1
- package/lib/actions/request.js +2 -2
- package/lib/card/index.d.ts +17 -5
- package/lib/card/index.js +18 -12
- package/lib/form/Components/ProField/index.d.ts +1 -161
- package/lib/form/Components/ProField/index.js +32 -38
- package/lib/form/Filter/index.js +2 -2
- package/lib/form/ProForm/index.d.ts +2 -2
- package/lib/form/ProForm/index.js +1 -7
- package/lib/form/ProForm/index.scss +19 -1
- package/lib/form/ProForm/useFieldRequest.d.ts +5 -0
- package/lib/form/ProForm/useFieldRequest.js +37 -0
- package/lib/form/SchemaForm/adapterDecorator.js +4 -2
- package/lib/form/SchemaForm/index.d.ts +2 -2
- package/lib/form/SchemaForm/index.js +11 -22
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.js +2 -2
- package/lib/form/SchemaForm/initializeFormButton.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -3
- package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.js +1 -1
- package/lib/form/SchemaForm/initializeRules.js +41 -13
- package/lib/form/SchemaForm/reactions.d.ts +5 -5
- package/lib/form/SchemaForm/reactions.js +22 -20
- package/lib/form/fieldTypeMap.d.ts +4 -0
- package/lib/form/fieldTypeMap.js +48 -0
- package/lib/form/index.d.ts +92 -4
- package/lib/form/index.js +17 -31
- package/lib/form/schemaNameMap.js +3 -0
- package/lib/form/typing.d.ts +49 -26
- package/lib/form/utils.d.ts +3 -1
- package/lib/form/utils.js +43 -1
- package/lib/form/warning.d.ts +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/InfoGroup/index.js +76 -14
- package/lib/info/components/InfoGroup/index.scss +45 -3
- package/lib/info/components/InfoValueItem/index.js +8 -3
- package/lib/info/components/InfoValueItem/index.scss +5 -1
- package/lib/info/components/ProInfoItem/index.js +2 -2
- package/lib/info/components/ProInfoItem/index.scss +1 -0
- package/lib/info/components/baseInfo/index.d.ts +2 -3
- package/lib/info/components/baseInfo/index.js +29 -10
- package/lib/info/components/headerInfo/index.d.ts +2 -3
- package/lib/info/components/tableInfo/index.d.ts +2 -3
- package/lib/info/components/tableInfo/index.js +1 -1
- package/lib/info/index.js +73 -49
- package/lib/info/typing.d.ts +54 -36
- package/lib/info/utils/index.d.ts +2 -2
- package/lib/info/utils/utils.d.ts +1 -1
- package/lib/nocode/pages/renderer.js +1 -1
- package/lib/page-header/index.d.ts +42 -25
- package/lib/page-header/index.js +54 -30
- package/lib/page-header/index.scss +2 -1
- package/lib/table/components/EmptyContent/index.d.ts +2 -0
- package/lib/table/components/EmptyContent/index.js +25 -0
- package/lib/table/components/Filter/index.d.ts +2 -2
- package/lib/table/components/Filter/index.js +23 -10
- package/lib/table/components/Filter/index.scss +1 -1
- package/lib/table/components/Layout/index.js +1 -1
- package/lib/table/components/QuickAction/index.d.ts +2 -2
- package/lib/table/components/QuickAction/index.js +1 -1
- package/lib/table/components/ToolBar/Fullscreen.js +1 -0
- package/lib/table/index.js +77 -14
- package/lib/table/index.scss +4 -0
- package/lib/table/typing.d.ts +29 -14
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +1 -1
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +2 -2
- package/lib/table/utils/index.js +33 -11
- package/lib/templates/List/index.d.ts +2 -2
- package/lib/utils/message.d.ts +3 -0
- package/lib/utils/message.js +32 -0
- package/package.json +4 -4
- package/es/form/Components/Search/index.d.ts +0 -11
- package/es/form/Components/Search/index.js +0 -89
- package/es/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayIcon.js +0 -62
- package/es/form/SchemaForm/initializeProField.d.ts +0 -5
- package/es/form/SchemaForm/initializeProField.js +0 -70
- package/es/info/utils/useInfoRequest.d.ts +0 -14
- package/es/info/utils/useInfoRequest.js +0 -76
- package/lib/form/Components/Search/index.d.ts +0 -11
- package/lib/form/Components/Search/index.js +0 -103
- package/lib/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
- package/lib/form/SchemaForm/initializeArrayIcon.js +0 -73
- package/lib/form/SchemaForm/initializeProField.d.ts +0 -5
- package/lib/form/SchemaForm/initializeProField.js +0 -77
- package/lib/info/utils/useInfoRequest.d.ts +0 -14
- package/lib/info/utils/useInfoRequest.js +0 -85
@@ -1,6 +1,6 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ProFormRequestConfig } from '../';
|
2
2
|
interface IInitializeDataSource {
|
3
|
-
(requestConfig?:
|
3
|
+
(requestConfig?: ProFormRequestConfig | any): {
|
4
4
|
dataSource?: any[];
|
5
5
|
reactions: any[];
|
6
6
|
scope: {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
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
2
|
|
3
3
|
import { isPlainObj } from '@teamix/utils';
|
4
|
-
import {
|
4
|
+
import { $request, $dataSource } from './reactions';
|
5
5
|
import { getRandomName } from '../utils';
|
6
6
|
|
7
7
|
var initializeDataSource = function initializeDataSource(dataSource) {
|
@@ -13,7 +13,7 @@ var initializeDataSource = function initializeDataSource(dataSource) {
|
|
13
13
|
var dataSourceScopeName = getRandomName('$dataSource');
|
14
14
|
return {
|
15
15
|
reactions: ["{{".concat(dataSourceScopeName, "(").concat(requestScopeName, ",").concat(requestConfig.onComplete, ")}}")],
|
16
|
-
scope: (_scope = {}, _defineProperty(_scope, requestScopeName,
|
16
|
+
scope: (_scope = {}, _defineProperty(_scope, requestScopeName, $request(requestConfig)), _defineProperty(_scope, dataSourceScopeName, $dataSource), _scope)
|
17
17
|
};
|
18
18
|
}
|
19
19
|
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
2
|
-
declare const initialize:
|
1
|
+
import type { ProFormInitializeItem } from '../typing';
|
2
|
+
declare const initialize: ProFormInitializeItem;
|
3
3
|
export default initialize;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
2
|
-
declare const initialize:
|
1
|
+
import type { ProFormInitializeItem } from '../typing';
|
2
|
+
declare const initialize: ProFormInitializeItem;
|
3
3
|
export default initialize;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
2
|
-
declare const initialize: (item:
|
1
|
+
import type { ProFormSchemaItem } from '../typing';
|
2
|
+
declare const initialize: (item: ProFormSchemaItem) => ProFormSchemaItem;
|
3
3
|
export default initialize;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
declare const initialize: (item:
|
1
|
+
import type { ProFormSchemaItem } from '../typing';
|
2
|
+
declare const initialize: (item: ProFormSchemaItem & {
|
3
3
|
col?: number;
|
4
|
-
}) =>
|
4
|
+
}) => ProFormSchemaItem;
|
5
5
|
export default initialize;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
2
|
-
declare const initialize: (item:
|
1
|
+
import type { ProFormSchemaItem } from '../typing';
|
2
|
+
declare const initialize: (item: ProFormSchemaItem) => ProFormSchemaItem;
|
3
3
|
export default initialize;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
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
2
|
|
3
|
-
import {
|
3
|
+
import { $request } from '../SchemaForm/reactions';
|
4
4
|
import { getRandomName } from '../utils';
|
5
5
|
|
6
6
|
var initializeRequest = function initializeRequest(requestConfig) {
|
@@ -8,7 +8,7 @@ var initializeRequest = function initializeRequest(requestConfig) {
|
|
8
8
|
var requestScopeName = getRandomName('$request');
|
9
9
|
return {
|
10
10
|
reactions: ["{{".concat(requestScopeName, "}}")],
|
11
|
-
scope: _defineProperty({}, requestScopeName,
|
11
|
+
scope: _defineProperty({}, requestScopeName, $request(requestConfig))
|
12
12
|
};
|
13
13
|
}
|
14
14
|
|
@@ -1,33 +1,61 @@
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
+
|
3
|
+
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."); }
|
4
|
+
|
5
|
+
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); }
|
6
|
+
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
8
|
+
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
10
|
+
|
11
|
+
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; }
|
12
|
+
|
1
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
2
14
|
|
3
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
16
|
|
5
17
|
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
18
|
|
7
|
-
import { isPlainObj } from '@teamix/utils';
|
8
|
-
import {
|
19
|
+
import { isArr, isPlainObj } from '@teamix/utils';
|
20
|
+
import { $request } from '../SchemaForm/reactions';
|
9
21
|
import { getRandomName } from '../utils';
|
10
|
-
import {
|
22
|
+
import { $validator } from './reactions';
|
11
23
|
|
12
24
|
var initializeRules = function initializeRules(rules) {
|
13
|
-
|
14
|
-
|
25
|
+
var initializeValidator = function initializeValidator(rule) {
|
26
|
+
if (isPlainObj(rule === null || rule === void 0 ? void 0 : rule.validator)) {
|
27
|
+
var _scope;
|
28
|
+
|
29
|
+
var validator = rule.validator;
|
30
|
+
var requestScopeName = getRandomName('$request');
|
31
|
+
var validatorScopeName = getRandomName('$validator');
|
32
|
+
return {
|
33
|
+
rules: _objectSpread(_objectSpread({}, rule), {}, {
|
34
|
+
validator: "{{".concat(validatorScopeName, "(").concat(requestScopeName, ",").concat(validator.onComplete, ")}}")
|
35
|
+
}),
|
36
|
+
scope: (_scope = {}, _defineProperty(_scope, requestScopeName, $request(validator)), _defineProperty(_scope, validatorScopeName, $validator), _scope)
|
37
|
+
};
|
38
|
+
}
|
15
39
|
|
16
|
-
var validator = rules.validator;
|
17
|
-
var requestScopeName = getRandomName('$request');
|
18
|
-
var validatorScopeName = getRandomName('$validator');
|
19
40
|
return {
|
20
|
-
rules:
|
21
|
-
|
22
|
-
}),
|
23
|
-
scope: (_scope = {}, _defineProperty(_scope, requestScopeName, useRequest(validator)), _defineProperty(_scope, validatorScopeName, useValidator), _scope)
|
41
|
+
rules: rule,
|
42
|
+
scope: {}
|
24
43
|
};
|
44
|
+
};
|
45
|
+
|
46
|
+
if (isArr(rules)) {
|
47
|
+
return rules.reduce(function (prev, current) {
|
48
|
+
var result = initializeValidator(current);
|
49
|
+
prev.rules = [].concat(_toConsumableArray(prev.rules), [result.rules]);
|
50
|
+
prev.scope = _objectSpread(_objectSpread({}, prev.scope), result.scope);
|
51
|
+
return prev;
|
52
|
+
}, {
|
53
|
+
rules: [],
|
54
|
+
scope: {}
|
55
|
+
});
|
25
56
|
}
|
26
57
|
|
27
|
-
return
|
28
|
-
rules: rules,
|
29
|
-
scope: []
|
30
|
-
};
|
58
|
+
return initializeValidator(rules);
|
31
59
|
};
|
32
60
|
|
33
61
|
export default initializeRules;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
declare const
|
3
|
-
declare const
|
4
|
-
declare const
|
5
|
-
export {
|
1
|
+
import type { ProFormRequestConfig } from '../typing';
|
2
|
+
declare const $request: (requestConfig: ProFormRequestConfig) => (field: any) => Promise<unknown>;
|
3
|
+
declare const $validator: (services: any, onComplete?: any) => (value: any, rules: any, { field }: any) => any;
|
4
|
+
declare const $dataSource: (services: any, onComplete?: any) => (field: any) => any;
|
5
|
+
export { $request, $dataSource, $validator };
|
@@ -4,45 +4,45 @@ 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, doCommonRequest } from '@teamix/utils'; // 配置请求
|
7
|
+
import { isFn, isPlainObj, doCommonRequest } from '@teamix/utils'; // 配置请求
|
8
8
|
|
9
|
-
var
|
9
|
+
var $request = function $request(requestConfig) {
|
10
10
|
return function (field) {
|
11
|
-
var _field$
|
11
|
+
var _field$data;
|
12
12
|
|
13
|
+
var refresh = field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
13
14
|
var beforeRequest = requestConfig.beforeRequest,
|
14
15
|
onSuccess = requestConfig.onSuccess;
|
16
|
+
var refreshResult = isPlainObj(refresh) ? refresh : {};
|
15
17
|
var beforeRequestResult = isFn(beforeRequest) ? beforeRequest(field) : {};
|
16
18
|
return doCommonRequest(_objectSpread(_objectSpread({}, requestConfig), {}, {
|
17
|
-
params: _objectSpread(_objectSpread({}, requestConfig.params), beforeRequestResult),
|
19
|
+
params: _objectSpread(_objectSpread(_objectSpread({}, requestConfig.params), beforeRequestResult), refreshResult),
|
18
20
|
beforeRequest: function beforeRequest() {
|
19
21
|
return beforeRequestResult;
|
20
22
|
},
|
21
23
|
onSuccess: isFn(onSuccess) ? function (res) {
|
22
24
|
return onSuccess(res, field);
|
23
25
|
} : onSuccess
|
24
|
-
}),
|
25
|
-
$self: field,
|
26
|
-
$form: field === null || field === void 0 ? void 0 : field.form,
|
27
|
-
$values: field === null || field === void 0 ? void 0 : (_field$form = field.form) === null || _field$form === void 0 ? void 0 : _field$form.values
|
28
|
-
});
|
26
|
+
}), field);
|
29
27
|
};
|
30
28
|
}; // 配置校验
|
31
29
|
|
32
30
|
|
33
|
-
var
|
34
|
-
return function (value) {
|
35
|
-
|
36
|
-
|
31
|
+
var $validator = function $validator(services, onComplete) {
|
32
|
+
return function (value, rules, _ref) {
|
33
|
+
var field = _ref.field;
|
34
|
+
return services(field).then(function (res) {
|
35
|
+
return onComplete && onComplete(res, field);
|
37
36
|
});
|
38
37
|
};
|
39
38
|
}; // 配置DataSource
|
40
39
|
|
41
40
|
|
42
|
-
var
|
41
|
+
var $dataSource = function $dataSource(services, onComplete) {
|
43
42
|
return function (field) {
|
44
43
|
field.setState({
|
45
|
-
loading: true
|
44
|
+
loading: true,
|
45
|
+
readOnly: true
|
46
46
|
});
|
47
47
|
return services(field).then(function (res) {
|
48
48
|
var _res$map;
|
@@ -55,15 +55,17 @@ var useAsyncDataSource = function useAsyncDataSource(services, onComplete) {
|
|
55
55
|
};
|
56
56
|
field.setState(_objectSpread({
|
57
57
|
dataSource: res,
|
58
|
-
loading: false
|
58
|
+
loading: false,
|
59
|
+
readOnly: false
|
59
60
|
}, clearValue));
|
60
61
|
return onComplete && onComplete(res, field);
|
61
62
|
}).catch(function () {
|
62
63
|
field.setState({
|
63
|
-
loading: false
|
64
|
+
loading: false,
|
65
|
+
readOnly: false
|
64
66
|
});
|
65
67
|
});
|
66
68
|
};
|
67
69
|
};
|
68
70
|
|
69
|
-
export {
|
71
|
+
export { $request, $dataSource, $validator };
|
@@ -0,0 +1,41 @@
|
|
1
|
+
var fieldTypeMap = {
|
2
|
+
Input: 'text',
|
3
|
+
Password: 'password',
|
4
|
+
TextArea: 'textArea',
|
5
|
+
NumberPicker: 'number',
|
6
|
+
Percent: 'percent',
|
7
|
+
Money: 'money',
|
8
|
+
Select: 'select',
|
9
|
+
MultipleSelect: 'multipleSelect',
|
10
|
+
TreeSelect: 'treeSelect',
|
11
|
+
Cascader: 'cascader',
|
12
|
+
MultipleCascader: 'multipleCascader',
|
13
|
+
ArbitraryCascader: 'arbitraryCascader',
|
14
|
+
Radio: 'radio',
|
15
|
+
Checkbox: 'checkbox',
|
16
|
+
Switch: 'switch',
|
17
|
+
DatePicker: 'date',
|
18
|
+
TimePicker: 'time',
|
19
|
+
DateTimePicker: 'dateTime',
|
20
|
+
WeekPicker: 'dateWeek',
|
21
|
+
MonthPicker: 'dateMonth',
|
22
|
+
YearPicker: 'dateYear',
|
23
|
+
QuarterPicker: 'dateQuarter',
|
24
|
+
DateRangePicker: 'dateRange',
|
25
|
+
TimeRangePicker: 'timeRange',
|
26
|
+
DateTimeRangePicker: 'dateTimeRange',
|
27
|
+
WeekRangePicker: 'dateWeekRange',
|
28
|
+
MonthRangePicker: 'dateMonthRange',
|
29
|
+
YearRangePicker: 'dateYearRange',
|
30
|
+
QuarterRangePicker: 'dateQuarterRange',
|
31
|
+
Transfer: 'transfer',
|
32
|
+
ColorPicker: 'color',
|
33
|
+
ColorRadio: 'colorRadio',
|
34
|
+
IconPicker: 'icon',
|
35
|
+
JsonInput: 'json',
|
36
|
+
TagPicker: 'tagPicker',
|
37
|
+
MultipleTagPicker: 'multipleTagPicker',
|
38
|
+
Range: 'range',
|
39
|
+
Search: 'search'
|
40
|
+
};
|
41
|
+
export default fieldTypeMap;
|
package/es/form/index.d.ts
CHANGED
@@ -6,17 +6,105 @@ export * from './typing';
|
|
6
6
|
* 使用别名导出formily相关内容
|
7
7
|
*/
|
8
8
|
export * as formilyCore from '@formily/core';
|
9
|
-
export * as formilyReact from '@formily/react';
|
10
9
|
export * as formilyReactive from '@formily/reactive';
|
11
10
|
export * as formilyTeamix from '@teamix/formily';
|
11
|
+
import * as originalFormilyReact from '@formily/react';
|
12
|
+
declare const formilyReact: {
|
13
|
+
useFieldRequest: () => {
|
14
|
+
refresh: () => void;
|
15
|
+
field: any;
|
16
|
+
};
|
17
|
+
useFormDisplayValues: () => any;
|
18
|
+
Schema: typeof originalFormilyReact.Schema;
|
19
|
+
FormProvider: import("react").FC<originalFormilyReact.IProviderProps>;
|
20
|
+
FormConsumer: import("react").FC<originalFormilyReact.IFormSpyProps>;
|
21
|
+
ArrayField: {
|
22
|
+
<D extends originalFormilyReact.JSXComponent, C extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.IFieldProps<D, C, import("@formily/core").ArrayField<any, any>>): JSX.Element;
|
23
|
+
displayName: string;
|
24
|
+
};
|
25
|
+
ObjectField: {
|
26
|
+
<D_1 extends originalFormilyReact.JSXComponent, C_1 extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.IFieldProps<D_1, C_1, import("@formily/core").ObjectField<any, any>>): JSX.Element;
|
27
|
+
displayName: string;
|
28
|
+
};
|
29
|
+
VoidField: {
|
30
|
+
<D_2 extends originalFormilyReact.JSXComponent, C_2 extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.IVoidFieldProps<D_2, C_2, import("@formily/core").VoidField<any, any, any>>): JSX.Element;
|
31
|
+
displayName: string;
|
32
|
+
};
|
33
|
+
RecursionField: import("react").FC<originalFormilyReact.IRecursionFieldProps>;
|
34
|
+
createSchemaField<Components extends originalFormilyReact.SchemaReactComponents>(options?: originalFormilyReact.ISchemaFieldReactFactoryOptions<Components> | undefined): {
|
35
|
+
<Decorator extends originalFormilyReact.JSXComponent, Component extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.ISchemaFieldProps<Decorator, Component, import("@formily/core").ObjectField<Decorator, Component>>): JSX.Element;
|
36
|
+
displayName: string;
|
37
|
+
Markup: {
|
38
|
+
<Decorator_1 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_1 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaMarkupFieldProps<Components, Component_1, Decorator_1>): JSX.Element;
|
39
|
+
displayName: string;
|
40
|
+
};
|
41
|
+
String: {
|
42
|
+
<Decorator_2 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_2 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaTypeFieldProps<Components, Component_2, Decorator_2>): JSX.Element;
|
43
|
+
displayName: string;
|
44
|
+
};
|
45
|
+
Object: {
|
46
|
+
<Decorator_3 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_3 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaTypeFieldProps<Components, Component_3, Decorator_3>): JSX.Element;
|
47
|
+
displayName: string;
|
48
|
+
};
|
49
|
+
Array: {
|
50
|
+
<Decorator_4 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_4 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaTypeFieldProps<Components, Component_4, Decorator_4>): JSX.Element;
|
51
|
+
displayName: string;
|
52
|
+
};
|
53
|
+
Boolean: {
|
54
|
+
<Decorator_5 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_5 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaTypeFieldProps<Components, Component_5, Decorator_5>): JSX.Element;
|
55
|
+
displayName: string;
|
56
|
+
};
|
57
|
+
Date: {
|
58
|
+
<Decorator_6 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_6 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaTypeFieldProps<Components, Component_6, Decorator_6>): JSX.Element;
|
59
|
+
displayName: string;
|
60
|
+
};
|
61
|
+
DateTime: {
|
62
|
+
<Decorator_7 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_7 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaTypeFieldProps<Components, Component_7, Decorator_7>): JSX.Element;
|
63
|
+
displayName: string;
|
64
|
+
};
|
65
|
+
Void: {
|
66
|
+
<Decorator_8 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_8 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaTypeFieldProps<Components, Component_8, Decorator_8>): JSX.Element;
|
67
|
+
displayName: string;
|
68
|
+
};
|
69
|
+
Number: {
|
70
|
+
<Decorator_9 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>, Component_9 extends originalFormilyReact.ReactComponentPath<Components, Exclude<keyof Components, "displayName" | "defaultProps" | "propTypes" | "contextTypes">>>(props: originalFormilyReact.ISchemaTypeFieldProps<Components, Component_9, Decorator_9>): JSX.Element;
|
71
|
+
displayName: string;
|
72
|
+
};
|
73
|
+
};
|
74
|
+
Field: {
|
75
|
+
<D_3 extends originalFormilyReact.JSXComponent, C_3 extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.IFieldProps<D_3, C_3, import("@formily/core").Field<any, any, any, any>>): JSX.Element;
|
76
|
+
displayName: string;
|
77
|
+
};
|
78
|
+
FormContext: import("react").Context<import("@formily/core").Form<any>>;
|
79
|
+
FieldContext: import("react").Context<import("@formily/core").GeneralField>;
|
80
|
+
SchemaMarkupContext: import("react").Context<originalFormilyReact.Schema<any, any, any, any, any, any, any, any, any>>;
|
81
|
+
SchemaContext: import("react").Context<originalFormilyReact.Schema<any, any, any, any, any, any, any, any, any>>;
|
82
|
+
SchemaExpressionScopeContext: import("react").Context<any>;
|
83
|
+
SchemaOptionsContext: import("react").Context<originalFormilyReact.ISchemaFieldReactFactoryOptions<any>>;
|
84
|
+
ContextCleaner: ({ children }: {
|
85
|
+
children: any;
|
86
|
+
}) => any;
|
87
|
+
mapProps<T extends originalFormilyReact.JSXComponent>(...args: originalFormilyReact.IStateMapper<import("react").ComponentProps<T>>[]): (target: T) => import("react").MemoExoticComponent<import("react").FunctionComponent<any>>;
|
88
|
+
mapReadPretty<T_1 extends originalFormilyReact.JSXComponent, C_4 extends originalFormilyReact.JSXComponent>(component: C_4, readPrettyProps?: import("react").ComponentProps<C_4> | undefined): (target: T_1) => import("react").MemoExoticComponent<import("react").FunctionComponent<{
|
89
|
+
ref?: import("react").RefAttributes<any> | undefined;
|
90
|
+
}>>;
|
91
|
+
connect<T_2 extends originalFormilyReact.JSXComponent>(target: T_2, ...args: originalFormilyReact.IComponentMapper<T_2>[]): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<Partial<import("react").ComponentProps<T_2>>> & import("react").RefAttributes<unknown>>;
|
92
|
+
observer: typeof originalFormilyReact.observer;
|
93
|
+
Observer: import("react").MemoExoticComponent<import("react").FunctionComponent<import("@formily/reactive-react").IObserverProps>>;
|
94
|
+
useForm: <T_3 extends object = any>() => import("@formily/core").Form<T_3>;
|
95
|
+
useField: <T_4 = import("@formily/core").GeneralField>() => T_4;
|
96
|
+
useParentForm: () => import("@formily/core").Form<any> | import("@formily/core").ObjectField<any, any>;
|
97
|
+
useFieldSchema: () => originalFormilyReact.Schema<any, any, any, any, any, any, any, any, any>;
|
98
|
+
useFormEffects: (effects?: ((form: import("@formily/core").Form<any>) => void) | undefined) => void;
|
99
|
+
};
|
100
|
+
export { formilyReact };
|
12
101
|
/**
|
13
|
-
* 导出常用formily
|
102
|
+
* 导出常用formily内容
|
14
103
|
*/
|
15
104
|
import { createForm, registerValidateRules as registerRules, registerValidateFormats as registerFormats, registerValidateLocale, setValidateLanguage } from '@formily/core';
|
16
105
|
import { FormConsumer, useForm } from '@formily/react';
|
17
106
|
import { FormDialog, FormDrawer, FormStep, FormTab, FormCollapse } from '@teamix/formily';
|
18
|
-
|
19
|
-
export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, FormCollapse, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, useForm, useFormDisplayValues, };
|
107
|
+
export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, FormCollapse, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, useForm, };
|
20
108
|
/**
|
21
109
|
* 导出 Filter 组件
|
22
110
|
*/
|
package/es/form/index.js
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
|
+
|
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
|
+
|
1
7
|
/**
|
2
8
|
* 导出ProForm的TS
|
3
9
|
*/
|
@@ -8,21 +14,28 @@ export * from './typing';
|
|
8
14
|
|
9
15
|
import * as _formilyCore from '@formily/core';
|
10
16
|
export { _formilyCore as formilyCore };
|
11
|
-
import * as _formilyReact from '@formily/react';
|
12
|
-
export { _formilyReact as formilyReact };
|
13
17
|
import * as _formilyReactive from '@formily/reactive';
|
14
18
|
export { _formilyReactive as formilyReactive };
|
15
19
|
import * as _formilyTeamix from '@teamix/formily';
|
16
20
|
export { _formilyTeamix as formilyTeamix };
|
21
|
+
import * as originalFormilyReact from '@formily/react';
|
22
|
+
import useFormDisplayValues from './ProForm/useFormDisplayValues';
|
23
|
+
import useFieldRequest from './ProForm/useFieldRequest';
|
24
|
+
|
25
|
+
var formilyReact = _objectSpread(_objectSpread({}, originalFormilyReact), {}, {
|
26
|
+
useFieldRequest: useFieldRequest,
|
27
|
+
useFormDisplayValues: useFormDisplayValues
|
28
|
+
});
|
29
|
+
|
30
|
+
export { formilyReact };
|
17
31
|
/**
|
18
|
-
* 导出常用formily
|
32
|
+
* 导出常用formily内容
|
19
33
|
*/
|
20
34
|
|
21
35
|
import { createForm, registerValidateRules as registerRules, registerValidateFormats as registerFormats, registerValidateLocale, setValidateLanguage } from '@formily/core';
|
22
36
|
import { FormConsumer, useForm } from '@formily/react';
|
23
37
|
import { FormDialog, FormDrawer, FormStep, FormTab, FormCollapse } from '@teamix/formily';
|
24
|
-
|
25
|
-
export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, FormCollapse, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, useForm, useFormDisplayValues };
|
38
|
+
export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, FormCollapse, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, useForm };
|
26
39
|
/**
|
27
40
|
* 导出 Filter 组件
|
28
41
|
*/
|
package/es/form/schemaNameMap.js
CHANGED
package/es/form/typing.d.ts
CHANGED
@@ -2,68 +2,91 @@ 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
|
-
|
5
|
+
interface AnyObject {
|
6
6
|
[propName: string]: any;
|
7
7
|
}
|
8
8
|
declare type FieldDisplayTypes = 'none' | 'hidden' | 'visible';
|
9
|
-
export
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
export interface ProFormInitializeItem {
|
10
|
+
(item: ProFormSchemaItem, props?: any): ProFormSchemaItem;
|
11
|
+
}
|
12
|
+
declare type IBaseComponent = 'Input' | 'Password' | 'TextArea' | 'NumberPicker' | 'Percent' | 'Money' | 'Select' | 'MultipleSelect' | 'TreeSelect' | 'Cascader' | 'MultipleCascader' | 'ArbitraryCascader' | 'Radio' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker' | 'DateTimePicker' | 'WeekPicker' | 'MonthPicker' | 'YearPicker' | 'QuarterPicker' | 'DateRangePicker' | 'TimeRangePicker' | 'DateTimeRangePicker' | 'WeekRangePicker' | 'MonthRangePicker' | 'YearRangePicker' | 'QuarterRangePicker' | 'Transfer' | 'Upload' | 'ColorPicker' | 'ColorRadio' | 'IconPicker' | 'JsonInput' | 'TagPicker' | 'MultipleTagPicker' | 'Range' | 'Search';
|
13
|
+
declare type IButtonComponent = 'Submit' | 'Reset';
|
14
|
+
declare type IComboComponent = 'ArrayCards' | 'ArrayCards.Addition' | 'ArrayCards.Remove' | 'ArrayCards.MoveUp' | 'ArrayCards.MoveDown' | 'ArrayCards.Index' | 'ArrayCollapse' | 'ArrayCollapse.CollapsePanel' | 'ArrayCollapse.Addition' | 'ArrayCollapse.Remove' | 'ArrayCollapse.MoveUp' | 'ArrayCollapse.MoveDown' | 'ArrayCollapse.Index' | 'ArrayTable' | 'ArrayTable.Column' | 'ArrayTable.SortHandle' | 'ArrayTable.Addition' | 'ArrayTable.Remove' | 'ArrayTable.MoveDown' | 'ArrayTable.MoveUp' | 'ArrayTable.Index' | 'ArrayItems' | 'ArrayItems.Item' | 'ArrayItems.SortHandle' | 'ArrayItems.Addition' | 'ArrayItems.Remove' | 'ArrayItems.MoveDown' | 'ArrayItems.MoveUp' | 'ArrayItems.Index' | 'Editable' | 'Editable.Popover' | 'Editable.Dialog' | 'Editable.Drawer';
|
15
|
+
declare type ILayoutComponent = 'FormFlex' | 'FormGrid' | 'FormGroup' | 'FormGroup.GroupPanel' | 'Search' | 'Search.SearchPanel' | 'FormTab' | 'FormTab.TabPane' | 'FormStep' | 'FormStep.StepPane' | 'FormCollapse' | 'FormCollapse.CollapsePanel' | 'FormButtonGroup' | 'FormDialog' | 'FormDrawer' | 'FormDialog.Footer' | 'FormDrawer.Footer';
|
16
|
+
export interface ProFormRequestConfig extends CommonRequestConfig {
|
14
17
|
beforeRequest?: (field?: any) => any;
|
15
18
|
onSuccess?: (res?: any, field?: any) => any;
|
16
19
|
onComplete?: (res?: any, field?: any) => any;
|
17
20
|
}
|
18
|
-
export interface
|
21
|
+
export interface ProFormSchemaItem {
|
19
22
|
type?: string;
|
20
23
|
name?: string;
|
21
24
|
description?: React.ReactNode;
|
22
25
|
title?: string;
|
23
26
|
component?: IBaseComponent | IButtonComponent | IComboComponent | ILayoutComponent | 'ProField' | any;
|
24
|
-
props?:
|
27
|
+
props?: AnyObject | any;
|
25
28
|
decorator?: string | null;
|
26
|
-
decoratorProps?:
|
27
|
-
dataSource?: any[] |
|
29
|
+
decoratorProps?: AnyObject;
|
30
|
+
dataSource?: any[] | string | ProFormRequestConfig;
|
28
31
|
reactions?: any;
|
29
32
|
rules?: any;
|
30
|
-
items?:
|
31
|
-
children?:
|
33
|
+
items?: ProFormSchemaItem;
|
34
|
+
children?: ProFormSchemaItem[];
|
32
35
|
content?: any;
|
33
36
|
tooltip?: string;
|
34
37
|
required?: boolean;
|
35
38
|
display?: FieldDisplayTypes;
|
36
|
-
visible?: boolean;
|
37
|
-
hidden?: boolean;
|
38
|
-
disabled?: boolean;
|
39
|
-
readOnly?: boolean;
|
40
|
-
readPretty?: boolean;
|
39
|
+
visible?: boolean | string;
|
40
|
+
hidden?: boolean | string;
|
41
|
+
disabled?: boolean | string;
|
42
|
+
readOnly?: boolean | string;
|
43
|
+
readPretty?: boolean | string;
|
41
44
|
pattern?: FieldPatternTypes;
|
42
45
|
default?: any;
|
43
|
-
request?:
|
44
|
-
|
45
|
-
export declare type IFormSchema = IFormSchemaItem[];
|
46
|
-
export interface IInitializeItem {
|
47
|
-
(item: IFormSchemaItem, props?: any): IFormSchemaItem;
|
46
|
+
request?: ProFormRequestConfig;
|
47
|
+
data?: AnyObject;
|
48
48
|
}
|
49
|
-
export
|
49
|
+
export declare type ProFormSchema = ProFormSchemaItem[];
|
50
|
+
export interface ProFormProps extends IFormLayoutProps {
|
50
51
|
form?: FormType | false;
|
51
|
-
schema:
|
52
|
+
schema: ProFormSchema;
|
52
53
|
scope?: any;
|
53
54
|
components?: {
|
54
55
|
[key: string]: React.FC | React.ComponentClass;
|
55
56
|
};
|
56
57
|
children?: React.ReactNode;
|
57
|
-
initialValues?:
|
58
|
+
initialValues?: AnyObject;
|
58
59
|
initialRequest?: CommonRequestConfig;
|
59
60
|
previewTextPlaceholder?: ReactNode;
|
60
61
|
onChange?: (values: any, displayValues?: any) => any;
|
61
62
|
onSubmit?: ((values: any) => any) | CommonRequestConfig;
|
62
63
|
onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
|
63
64
|
}
|
64
|
-
export interface
|
65
|
+
export interface QueryFilterProps extends ProFormProps {
|
66
|
+
onFilter?: (values: any) => void;
|
67
|
+
onReset?: (payload?: any) => void;
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* 兼容性导出
|
71
|
+
*/
|
72
|
+
export interface IFilterProps extends ProFormProps {
|
65
73
|
triggerType?: 'keydown' | 'change' | 'submit';
|
66
74
|
onFilter?: (values: any) => void;
|
67
75
|
onReset?: (payload?: any) => void;
|
68
76
|
}
|
77
|
+
/**
|
78
|
+
* @deprecated 将在未来移除,建议使用 ProFormSchemaItem 代替
|
79
|
+
*/
|
80
|
+
export interface IFormSchemaItem extends ProFormSchemaItem {
|
81
|
+
}
|
82
|
+
/**
|
83
|
+
* @deprecated 将在未来移除,建议使用 ProFormSchema 代替
|
84
|
+
*/
|
85
|
+
export interface IFormSchema extends ProFormSchema {
|
86
|
+
}
|
87
|
+
/**
|
88
|
+
* @deprecated 将在未来移除,建议使用 ProFormProps 代替
|
89
|
+
*/
|
90
|
+
export interface IFormProps extends ProFormProps {
|
91
|
+
}
|
69
92
|
export {};
|
package/es/form/utils.d.ts
CHANGED
@@ -12,6 +12,8 @@ declare const mapSize: (props: any, field: any) => any;
|
|
12
12
|
* @returns 映射后的字段属性
|
13
13
|
*/
|
14
14
|
declare const mapStatus: (props: any, field: any) => any;
|
15
|
+
declare const mapDataSource: (props: any, field: any) => any;
|
16
|
+
declare const mapMode: (props: any, field: any) => any;
|
15
17
|
/**
|
16
18
|
* 为未配置name的字段添加随机字段名称
|
17
19
|
* @param prefix 随机字段名称前缀,默认为name
|
@@ -34,4 +36,4 @@ declare const mapSchemaName: (obj: any) => any;
|
|
34
36
|
* @returns 合并数组或合并其他值
|
35
37
|
*/
|
36
38
|
declare const mergeArrayValue: (arr: any[], v?: any) => any[];
|
37
|
-
export {
|
39
|
+
export { mapSize, mapStatus, mapDataSource, mapMode, mergeArrayValue, getRandomName, mapSchemaName, };
|