@teamix/pro 1.1.37 → 1.2.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/README.md +14 -10
- package/dist/pro.css +1 -1
- package/dist/pro.js +2486 -3754
- 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/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 +34 -21
- package/es/page-header/index.js +39 -30
- 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/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 +34 -21
- package/lib/page-header/index.js +37 -28
- 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
@@ -7,62 +7,56 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var _core = require("@formily/core");
|
11
|
-
|
12
10
|
var _react2 = require("@formily/react");
|
13
11
|
|
12
|
+
var _utils = require("../../utils");
|
13
|
+
|
14
14
|
var _field = _interopRequireDefault(require("../../../field"));
|
15
15
|
|
16
|
-
var
|
16
|
+
var _fieldTypeMap = _interopRequireDefault(require("../../fieldTypeMap"));
|
17
17
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
19
|
|
20
|
-
function
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
21
21
|
|
22
|
-
function
|
23
|
-
|
24
|
-
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; }
|
22
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
25
23
|
|
26
|
-
var
|
27
|
-
var dataSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
24
|
+
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); }
|
28
25
|
|
29
|
-
|
30
|
-
var result = _objectSpread({}, data);
|
26
|
+
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; }
|
31
27
|
|
32
|
-
|
33
|
-
delete result.children;
|
34
|
-
} else {
|
35
|
-
result.children = result.children.map(removeEmptyChildren);
|
36
|
-
}
|
28
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
37
29
|
|
38
|
-
|
39
|
-
};
|
30
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
40
31
|
|
41
|
-
|
42
|
-
};
|
32
|
+
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; }
|
43
33
|
|
44
|
-
var
|
45
|
-
var _props$dataSource;
|
34
|
+
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; }
|
46
35
|
|
47
|
-
|
48
|
-
return props;
|
49
|
-
}
|
36
|
+
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; }
|
50
37
|
|
51
|
-
|
52
|
-
|
53
|
-
|
38
|
+
var componentBuilder = function componentBuilder(type) {
|
39
|
+
return (0, _react2.connect)(function (props) {
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_field.default, _objectSpread(_objectSpread({}, props), {}, {
|
41
|
+
type: type
|
42
|
+
}));
|
43
|
+
}, (0, _react2.mapProps)(_utils.mapSize, _utils.mapStatus, _utils.mapDataSource, _utils.mapMode), (0, _react2.mapReadPretty)(function (props) {
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_field.default, _objectSpread(_objectSpread({}, props), {}, {
|
45
|
+
mode: "read"
|
46
|
+
}));
|
47
|
+
}));
|
54
48
|
};
|
55
49
|
|
56
|
-
var
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
50
|
+
var _default = function () {
|
51
|
+
var components = {};
|
52
|
+
Object.entries(_fieldTypeMap.default).forEach(function (_ref) {
|
53
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
54
|
+
name = _ref2[0],
|
55
|
+
type = _ref2[1];
|
61
56
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
}));
|
57
|
+
components[name] = componentBuilder(type);
|
58
|
+
});
|
59
|
+
return components;
|
60
|
+
}();
|
67
61
|
|
68
62
|
exports.default = _default;
|
package/lib/form/Filter/index.js
CHANGED
@@ -100,7 +100,7 @@ var SimpleFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
100
100
|
}, []);
|
101
101
|
var eventProps = getEventProps(triggerType, onFilter);
|
102
102
|
return /*#__PURE__*/_react.default.createElement(_ProForm.default, _objectSpread(_objectSpread(_objectSpread({
|
103
|
-
feedbackLayout: "
|
103
|
+
feedbackLayout: "popover",
|
104
104
|
breakpoints: [],
|
105
105
|
inset: true
|
106
106
|
}, otherProps), eventProps), {}, {
|
@@ -229,7 +229,7 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
229
229
|
}, [layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
230
230
|
var eventProps = getEventProps(triggerType, onFilter);
|
231
231
|
return /*#__PURE__*/_react.default.createElement(_ProForm.default, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
232
|
-
feedbackLayout: "
|
232
|
+
feedbackLayout: "popover"
|
233
233
|
}, props), eventProps), getTeamixLayout), {}, {
|
234
234
|
form: form,
|
235
235
|
className: (0, _classnames.default)(prefixCls, props.className),
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import type {
|
2
|
+
import type { ProFormProps } from '../typing';
|
3
3
|
import './index.scss';
|
4
|
-
declare const ProForm: React.FC<
|
4
|
+
declare const ProForm: React.FC<ProFormProps>;
|
5
5
|
export default ProForm;
|
@@ -17,8 +17,6 @@ var _reactive = require("@formily/reactive");
|
|
17
17
|
|
18
18
|
var _formily = require("@teamix/formily");
|
19
19
|
|
20
|
-
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
21
|
-
|
22
20
|
var _utils = require("@teamix/utils");
|
23
21
|
|
24
22
|
var _SchemaForm = _interopRequireDefault(require("../SchemaForm"));
|
@@ -136,11 +134,7 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
136
134
|
});
|
137
135
|
ProForm.defaultProps = {
|
138
136
|
colon: false,
|
139
|
-
labelAlign: 'left'
|
140
|
-
tooltipIcon: /*#__PURE__*/_react.default.createElement(_icon.default, {
|
141
|
-
type: "info-circle-line",
|
142
|
-
size: "small"
|
143
|
-
})
|
137
|
+
labelAlign: 'left'
|
144
138
|
};
|
145
139
|
var _default = ProForm;
|
146
140
|
exports.default = _default;
|
@@ -109,6 +109,11 @@
|
|
109
109
|
}
|
110
110
|
}
|
111
111
|
|
112
|
+
// Icon
|
113
|
+
.#{$css-prefix}formily-icon {
|
114
|
+
transform: translate(0, -1px);
|
115
|
+
}
|
116
|
+
|
112
117
|
// 撑满模式
|
113
118
|
.#{$form-item-cls}-fullness {
|
114
119
|
> .#{$form-item-cls}-control {
|
@@ -179,10 +184,20 @@
|
|
179
184
|
|
180
185
|
// 数组类组件添加按钮
|
181
186
|
.#{$css-prefix}formily-array-base-addition {
|
182
|
-
|
187
|
+
.#{$css-prefix}formily-icon {
|
183
188
|
margin-right: 4px;
|
184
189
|
}
|
185
190
|
}
|
191
|
+
// 数组类ArrayItem Icon 居中
|
192
|
+
.#{$css-prefix}formily-array-items-item-inner {
|
193
|
+
> .#{$css-prefix}box {
|
194
|
+
> .#{$css-prefix}space-item {
|
195
|
+
> .#{$css-prefix}formily-icon {
|
196
|
+
margin-top: 9px;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
186
201
|
|
187
202
|
// Editable预览态行高
|
188
203
|
.#{$css-prefix}formily-editable-content {
|
@@ -248,6 +263,9 @@
|
|
248
263
|
// 高级筛选
|
249
264
|
.#{$teamix-pro-form}-filter-advanced,
|
250
265
|
.#{$teamix-pro-form}-filter-simple {
|
266
|
+
.#{$form-item-cls}-feedback-layout-popover {
|
267
|
+
margin-bottom: 0;
|
268
|
+
}
|
251
269
|
.#{$css-prefix}date-picker2-input {
|
252
270
|
.#{$css-prefix}input {
|
253
271
|
width: inherit;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = require("@formily/react");
|
9
|
+
|
10
|
+
var _utils = require("@teamix/utils");
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
14
|
+
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; }
|
15
|
+
|
16
|
+
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; }
|
17
|
+
|
18
|
+
var _default = function _default() {
|
19
|
+
var field = (0, _react.useField)();
|
20
|
+
|
21
|
+
var refresh = function refresh() {
|
22
|
+
if (!(0, _utils.isPlainObj)(field.data)) {
|
23
|
+
field.data = {
|
24
|
+
refresh: {}
|
25
|
+
};
|
26
|
+
} else {
|
27
|
+
field.data.refresh = _objectSpread({}, field.data.refresh);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
|
31
|
+
return {
|
32
|
+
refresh: refresh,
|
33
|
+
field: field
|
34
|
+
};
|
35
|
+
};
|
36
|
+
|
37
|
+
exports.default = _default;
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _fieldTypeMap = _interopRequireDefault(require("../fieldTypeMap"));
|
9
|
+
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
9
11
|
|
10
12
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
11
13
|
|
@@ -24,7 +26,7 @@ var _default = function _default(decorator, component) {
|
|
24
26
|
return decorator;
|
25
27
|
}
|
26
28
|
|
27
|
-
if ([].concat(_toConsumableArray(Object.keys(
|
29
|
+
if ([].concat(_toConsumableArray(Object.keys(_fieldTypeMap.default)), ['Upload', 'ArrayCards', 'ArrayCollapse', 'ArrayTable', 'ArrayItems']).includes(component)) {
|
28
30
|
return 'FormItem';
|
29
31
|
}
|
30
32
|
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import type {
|
3
|
-
declare const _default: React.MemoExoticComponent<({ schema, scope, components }:
|
2
|
+
import type { ProFormProps } from '../typing';
|
3
|
+
declare const _default: React.MemoExoticComponent<({ schema, scope, components }: ProFormProps) => JSX.Element>;
|
4
4
|
export default _default;
|
@@ -19,8 +19,6 @@ var _ProField = _interopRequireDefault(require("../Components/ProField"));
|
|
19
19
|
|
20
20
|
var _Editable = require("../Components/Editable");
|
21
21
|
|
22
|
-
var _Search = _interopRequireDefault(require("../Components/Search"));
|
23
|
-
|
24
22
|
var _FormGroup = _interopRequireDefault(require("../Components/FormGroup"));
|
25
23
|
|
26
24
|
var _QueryFilter = _interopRequireDefault(require("../Components/QueryFilter"));
|
@@ -41,8 +39,6 @@ var _initializeDataSource2 = _interopRequireDefault(require("./initializeDataSou
|
|
41
39
|
|
42
40
|
var _initializeRules2 = _interopRequireDefault(require("./initializeRules"));
|
43
41
|
|
44
|
-
var _initializeProField = _interopRequireWildcard(require("./initializeProField"));
|
45
|
-
|
46
42
|
var _initializeArrayCards = _interopRequireDefault(require("./initializeArrayCards"));
|
47
43
|
|
48
44
|
var _initializeArrayCollapse = _interopRequireDefault(require("./initializeArrayCollapse"));
|
@@ -61,13 +57,13 @@ var _initializeFormTab = _interopRequireDefault(require("./initializeFormTab"));
|
|
61
57
|
|
62
58
|
var _initializeFormCollapse = _interopRequireDefault(require("./initializeFormCollapse"));
|
63
59
|
|
64
|
-
var
|
60
|
+
var _fieldTypeMap = _interopRequireDefault(require("../fieldTypeMap"));
|
65
61
|
|
66
62
|
var _utils = require("../utils");
|
67
63
|
|
68
64
|
var _warning = _interopRequireDefault(require("../warning"));
|
69
65
|
|
70
|
-
var _excluded = ["component", "type", "name", "decorator", "decoratorProps", "dataSource", "reactions", "rules", "children", "items", "tooltip", "request"];
|
66
|
+
var _excluded = ["component", "type", "name", "decorator", "decoratorProps", "dataSource", "reactions", "rules", "children", "items", "tooltip", "request", "data"];
|
71
67
|
|
72
68
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
73
69
|
|
@@ -111,8 +107,7 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
111
107
|
components = _ref.components;
|
112
108
|
var SchemaField = (0, _react.useMemo)(function () {
|
113
109
|
return (0, _react2.createSchemaField)({
|
114
|
-
components: {
|
115
|
-
ProField: _ProField.default,
|
110
|
+
components: _objectSpread(_objectSpread({}, _ProField.default), {}, {
|
116
111
|
FormLayout: _formily.FormLayout,
|
117
112
|
FormItem: _formily.FormItem,
|
118
113
|
ArrayCollapse: _formily.ArrayCollapse,
|
@@ -134,12 +129,11 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
134
129
|
EditableDrawer: _Editable.EditableDrawer,
|
135
130
|
EditablePopover: _Editable.EditablePopover,
|
136
131
|
FormGroup: _FormGroup.default,
|
137
|
-
Search: _Search.default,
|
138
132
|
QueryFilter: _QueryFilter.default,
|
139
133
|
Upload: _formily.Upload,
|
140
134
|
Affix: _components.Affix,
|
141
135
|
Text: _index.default
|
142
|
-
}
|
136
|
+
})
|
143
137
|
});
|
144
138
|
}, []); // 合并schema中request的scope
|
145
139
|
|
@@ -155,9 +149,7 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
155
149
|
originalComponent = _newItem.component; // 根据component的不同,初始化为内置的item
|
156
150
|
|
157
151
|
if (originalComponent) {
|
158
|
-
if (Object.keys(
|
159
|
-
// ProField接管组件
|
160
|
-
newItem = (0, _initializeProField.default)(newItem);
|
152
|
+
if (Object.keys(_fieldTypeMap.default).includes(originalComponent)) {// ProField接管组件
|
161
153
|
} else {
|
162
154
|
// 未接管组件,判断是否为Formily组件别名
|
163
155
|
newItem = _objectSpread(_objectSpread({}, newItem), {}, {
|
@@ -208,11 +200,6 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
208
200
|
|
209
201
|
if (['FormCollapse'].includes(originalComponent)) {
|
210
202
|
newItem = (0, _initializeFormCollapse.default)(newItem);
|
211
|
-
} // Array组件的Icon替换
|
212
|
-
|
213
|
-
|
214
|
-
if (/\.(Addition|Remove|MoveUp|MoveDown|SortHandle){1}$/g.test(originalComponent)) {
|
215
|
-
newItem = (0, _initializeArrayIcon.default)(newItem);
|
216
203
|
}
|
217
204
|
}
|
218
205
|
|
@@ -230,6 +217,7 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
230
217
|
items = _newItem2.items,
|
231
218
|
tooltip = _newItem2.tooltip,
|
232
219
|
request = _newItem2.request,
|
220
|
+
data = _newItem2.data,
|
233
221
|
otherProps = _objectWithoutProperties(_newItem2, _excluded); // 默认类型
|
234
222
|
|
235
223
|
|
@@ -276,7 +264,8 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
276
264
|
decoratorProps: defaultDecoratorProps,
|
277
265
|
rules: defaultRules,
|
278
266
|
reactions: defaultReactions,
|
279
|
-
dataSource: defaultDataSource
|
267
|
+
dataSource: defaultDataSource,
|
268
|
+
data: data
|
280
269
|
})); // 递归子组件
|
281
270
|
|
282
271
|
var recursiveProperties = (children === null || children === void 0 ? void 0 : children.length) ? {
|
@@ -295,13 +284,13 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
295
284
|
type: 'object',
|
296
285
|
properties: formatSchema(schema)
|
297
286
|
};
|
298
|
-
}, [
|
287
|
+
}, []); // console.log(schemaPro);
|
299
288
|
|
300
|
-
return /*#__PURE__*/_react.default.createElement(
|
289
|
+
return /*#__PURE__*/_react.default.createElement(SchemaField, {
|
301
290
|
schema: schemaPro,
|
302
291
|
components: components,
|
303
292
|
scope: mergedScope
|
304
|
-
})
|
293
|
+
});
|
305
294
|
});
|
306
295
|
|
307
296
|
exports.default = _default;
|
@@ -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:
|
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,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: {
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _utils = require("@teamix/utils");
|
9
9
|
|
10
|
-
var _reactions = require("
|
10
|
+
var _reactions = require("./reactions");
|
11
11
|
|
12
12
|
var _utils2 = require("../utils");
|
13
13
|
|
@@ -22,7 +22,7 @@ var initializeDataSource = function initializeDataSource(dataSource) {
|
|
22
22
|
var dataSourceScopeName = (0, _utils2.getRandomName)('$dataSource');
|
23
23
|
return {
|
24
24
|
reactions: ["{{".concat(dataSourceScopeName, "(").concat(requestScopeName, ",").concat(requestConfig.onComplete, ")}}")],
|
25
|
-
scope: (_scope = {}, _defineProperty(_scope, requestScopeName, (0, _reactions
|
25
|
+
scope: (_scope = {}, _defineProperty(_scope, requestScopeName, (0, _reactions.$request)(requestConfig)), _defineProperty(_scope, dataSourceScopeName, _reactions.$dataSource), _scope)
|
26
26
|
};
|
27
27
|
}
|
28
28
|
|
@@ -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;
|
@@ -16,7 +16,7 @@ var initializeRequest = function initializeRequest(requestConfig) {
|
|
16
16
|
var requestScopeName = (0, _utils.getRandomName)('$request');
|
17
17
|
return {
|
18
18
|
reactions: ["{{".concat(requestScopeName, "}}")],
|
19
|
-
scope: _defineProperty({}, requestScopeName, (0, _reactions
|
19
|
+
scope: _defineProperty({}, requestScopeName, (0, _reactions.$request)(requestConfig))
|
20
20
|
};
|
21
21
|
}
|
22
22
|
|
@@ -13,6 +13,18 @@ var _utils2 = require("../utils");
|
|
13
13
|
|
14
14
|
var _reactions2 = require("./reactions");
|
15
15
|
|
16
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
17
|
+
|
18
|
+
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."); }
|
19
|
+
|
20
|
+
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); }
|
21
|
+
|
22
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
23
|
+
|
24
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
16
28
|
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; }
|
17
29
|
|
18
30
|
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; }
|
@@ -20,24 +32,40 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
20
32
|
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; }
|
21
33
|
|
22
34
|
var initializeRules = function initializeRules(rules) {
|
23
|
-
|
24
|
-
|
35
|
+
var initializeValidator = function initializeValidator(rule) {
|
36
|
+
if ((0, _utils.isPlainObj)(rule === null || rule === void 0 ? void 0 : rule.validator)) {
|
37
|
+
var _scope;
|
38
|
+
|
39
|
+
var validator = rule.validator;
|
40
|
+
var requestScopeName = (0, _utils2.getRandomName)('$request');
|
41
|
+
var validatorScopeName = (0, _utils2.getRandomName)('$validator');
|
42
|
+
return {
|
43
|
+
rules: _objectSpread(_objectSpread({}, rule), {}, {
|
44
|
+
validator: "{{".concat(validatorScopeName, "(").concat(requestScopeName, ",").concat(validator.onComplete, ")}}")
|
45
|
+
}),
|
46
|
+
scope: (_scope = {}, _defineProperty(_scope, requestScopeName, (0, _reactions.$request)(validator)), _defineProperty(_scope, validatorScopeName, _reactions2.$validator), _scope)
|
47
|
+
};
|
48
|
+
}
|
25
49
|
|
26
|
-
var validator = rules.validator;
|
27
|
-
var requestScopeName = (0, _utils2.getRandomName)('$request');
|
28
|
-
var validatorScopeName = (0, _utils2.getRandomName)('$validator');
|
29
50
|
return {
|
30
|
-
rules:
|
31
|
-
|
32
|
-
}),
|
33
|
-
scope: (_scope = {}, _defineProperty(_scope, requestScopeName, (0, _reactions.useRequest)(validator)), _defineProperty(_scope, validatorScopeName, _reactions2.useValidator), _scope)
|
51
|
+
rules: rule,
|
52
|
+
scope: {}
|
34
53
|
};
|
54
|
+
};
|
55
|
+
|
56
|
+
if ((0, _utils.isArr)(rules)) {
|
57
|
+
return rules.reduce(function (prev, current) {
|
58
|
+
var result = initializeValidator(current);
|
59
|
+
prev.rules = [].concat(_toConsumableArray(prev.rules), [result.rules]);
|
60
|
+
prev.scope = _objectSpread(_objectSpread({}, prev.scope), result.scope);
|
61
|
+
return prev;
|
62
|
+
}, {
|
63
|
+
rules: [],
|
64
|
+
scope: {}
|
65
|
+
});
|
35
66
|
}
|
36
67
|
|
37
|
-
return
|
38
|
-
rules: rules,
|
39
|
-
scope: []
|
40
|
-
};
|
68
|
+
return initializeValidator(rules);
|
41
69
|
};
|
42
70
|
|
43
71
|
var _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 };
|