@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,38 +1,8 @@
|
|
1
1
|
@import '../global.scss';
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
.#{$
|
6
|
-
.#{$query-filter}-inline {
|
7
|
-
margin-right: 8px;
|
8
|
-
margin-bottom: 8px;
|
9
|
-
}
|
10
|
-
.#{$query-filter}-inline-hidden {
|
11
|
-
display: none;
|
12
|
-
}
|
13
|
-
.#{$query-filter}-tag-title {
|
14
|
-
margin-right: 12px;
|
15
|
-
color: var(--color-text1-8, #848484);
|
16
|
-
}
|
17
|
-
.#{$query-filter}-tag-content {
|
18
|
-
.#{$teamix-pro-field} {
|
19
|
-
display: inline-block;
|
20
|
-
.#{$css-prefix}form-preview {
|
21
|
-
color: var(--color-text1-2, #5a5a5a);
|
22
|
-
font-weight: bold;
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
.#{$query-filter}-advanced {
|
29
|
-
.#{$css-prefix}formily-button-group {
|
30
|
-
margin-top: 0;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
.#{$query-filter}-advanced,
|
34
|
-
.#{$query-filter}-simple,
|
35
|
-
.#{$query-filter}-light {
|
3
|
+
// 筛选
|
4
|
+
.#{$teamix-pro-form}-filter-advanced,
|
5
|
+
.#{$teamix-pro-form}-filter-simple {
|
36
6
|
.#{$form-item-cls}-feedback-layout-popover {
|
37
7
|
margin-bottom: 0;
|
38
8
|
}
|
@@ -45,3 +15,11 @@ $query-filter: #{$teamix-pro-form}-query-filter;
|
|
45
15
|
}
|
46
16
|
}
|
47
17
|
}
|
18
|
+
|
19
|
+
// 筛选和抽屉按钮
|
20
|
+
.#{$teamix-pro-form}-filter-advanced,
|
21
|
+
.#{$css-prefix}drawer-footer {
|
22
|
+
.#{$css-prefix}formily-button-group {
|
23
|
+
margin-top: 0;
|
24
|
+
}
|
25
|
+
}
|
@@ -11,8 +11,9 @@ var _utils = require("@teamix/utils");
|
|
11
11
|
var useSpecialProps = function useSpecialProps(props) {
|
12
12
|
var initialValues = props.initialValues,
|
13
13
|
initialRequest = props.initialRequest;
|
14
|
-
var
|
15
|
-
|
14
|
+
var hasChangeDefault = !!initialValues || !!initialRequest; // 会触发onChange的默认值
|
15
|
+
|
16
|
+
var hasDefault = hasChangeDefault;
|
16
17
|
var hasRequired = false;
|
17
18
|
|
18
19
|
var hasDefaultOrRule = function hasDefaultOrRule(schema) {
|
@@ -20,13 +21,12 @@ var useSpecialProps = function useSpecialProps(props) {
|
|
20
21
|
var value = item.default,
|
21
22
|
required = item.required,
|
22
23
|
rules = item.rules,
|
23
|
-
request = item.request,
|
24
24
|
dataSource = item.dataSource,
|
25
|
-
children = item.children;
|
26
|
-
|
25
|
+
children = item.children; // 字符串变量配置default值会触发onChange
|
26
|
+
|
27
|
+
hasChangeDefault = hasChangeDefault || !!((0, _utils.isPureObj)(dataSource) && (0, _utils.isStr)(value) && value.indexOf('.dataSource'));
|
28
|
+
hasDefault = hasDefault || (0, _utils.isUsable)(value);
|
27
29
|
hasRequired = hasRequired || required || !!rules;
|
28
|
-
hasAsyncDefault = hasAsyncDefault || !!request || // 如果dataSource是异步且default取自dataSource
|
29
|
-
!!((0, _utils.isPlainObj)(dataSource) && (0, _utils.isStr)(value) && value.indexOf('.dataSource'));
|
30
30
|
|
31
31
|
if (children === null || children === void 0 ? void 0 : children.length) {
|
32
32
|
hasDefaultOrRule(children);
|
@@ -37,7 +37,7 @@ var useSpecialProps = function useSpecialProps(props) {
|
|
37
37
|
hasDefaultOrRule(props.schema);
|
38
38
|
return {
|
39
39
|
hasDefault: hasDefault,
|
40
|
-
|
40
|
+
hasChangeDefault: hasChangeDefault,
|
41
41
|
hasRequired: hasRequired
|
42
42
|
};
|
43
43
|
};
|
@@ -31,7 +31,7 @@ var _validate = _interopRequireDefault(require("../locales/validate"));
|
|
31
31
|
|
32
32
|
require("./index.scss");
|
33
33
|
|
34
|
-
var _excluded = ["form", "initialValues", "initialRequest", "schema", "scope", "context", "components", "children", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "onChange", "onSubmit", "onSubmitFailed", "className"];
|
34
|
+
var _excluded = ["form", "initialValues", "initialRequest", "schema", "scope", "context", "components", "children", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "onChange", "onSubmit", "onSubmitFailed", "onInitialComplete", "className"];
|
35
35
|
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
37
37
|
|
@@ -68,6 +68,7 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
68
68
|
onChange = _ref.onChange,
|
69
69
|
onSubmit = _ref.onSubmit,
|
70
70
|
onSubmitFailed = _ref.onSubmitFailed,
|
71
|
+
onInitialComplete = _ref.onInitialComplete,
|
71
72
|
className = _ref.className,
|
72
73
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
73
74
|
|
@@ -118,13 +119,12 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
118
119
|
(0, _react.useEffect)(function () {
|
119
120
|
if (initialValues) {
|
120
121
|
form.setInitialValues(initialValues);
|
122
|
+
onInitialComplete === null || onInitialComplete === void 0 ? void 0 : onInitialComplete(form);
|
121
123
|
} else if (initialRequest) {
|
122
124
|
(0, _useInitialRequest.default)(initialRequest).then(function (values) {
|
123
125
|
form.setInitialValues(values);
|
124
126
|
}).finally(function () {
|
125
|
-
|
126
|
-
form: form
|
127
|
-
});
|
127
|
+
onInitialComplete === null || onInitialComplete === void 0 ? void 0 : onInitialComplete(form);
|
128
128
|
});
|
129
129
|
}
|
130
130
|
}, []); // 配置国际化
|
@@ -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 {
|
@@ -242,18 +242,18 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
242
242
|
var defaultDecoratorProps = _objectSpread(_objectSpread({}, tooltipProps), decoratorProps); // 初始化request
|
243
243
|
|
244
244
|
|
245
|
-
var _initializeRequest = (0, _initializeRequest2.default)(request, suffix),
|
245
|
+
var _initializeRequest = (0, _initializeRequest2.default)(request, "".concat(suffix, "r")),
|
246
246
|
requestReactions = _initializeRequest.reactions,
|
247
|
-
requestScope = _initializeRequest.scope; // 初始化dataSource
|
247
|
+
requestScope = _initializeRequest.scope; // 初始化dataSource,如果readPretty为字符串表达式将失去loading等状态,仍可配置dataSource
|
248
248
|
|
249
249
|
|
250
|
-
var _initializeDataSource = (0, _initializeDataSource2.default)(dataSource, suffix),
|
250
|
+
var _initializeDataSource = (0, _initializeDataSource2.default)(dataSource, "".concat(suffix, "d"), newItem.readPretty),
|
251
251
|
defaultDataSource = _initializeDataSource.dataSource,
|
252
252
|
dataSourceReactions = _initializeDataSource.reactions,
|
253
|
-
dataSourceScope = _initializeDataSource.scope; // 初始化rules
|
253
|
+
dataSourceScope = _initializeDataSource.scope; // 初始化rules validator
|
254
254
|
|
255
255
|
|
256
|
-
var _initializeRules = (0, _initializeRules2.default)(rules, suffix),
|
256
|
+
var _initializeRules = (0, _initializeRules2.default)(rules, "".concat(suffix, "v")),
|
257
257
|
defaultRules = _initializeRules.rules,
|
258
258
|
rulesScope = _initializeRules.scope; // 合并reactions,初始化reactions
|
259
259
|
|
@@ -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: {
|
@@ -9,12 +9,12 @@ var _utils = require("@teamix/utils");
|
|
9
9
|
|
10
10
|
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; }
|
11
11
|
|
12
|
-
var initializeDataSource = function initializeDataSource(dataSource, suffix) {
|
12
|
+
var initializeDataSource = function initializeDataSource(dataSource, suffix, readPretty) {
|
13
13
|
if ((0, _utils.isPlainObj)(dataSource)) {
|
14
14
|
var requestConfig = dataSource;
|
15
15
|
var requestConfigName = "$requestConfig_".concat(suffix);
|
16
16
|
return {
|
17
|
-
reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context)}}")],
|
17
|
+
reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context,").concat(readPretty, ")}}")],
|
18
18
|
scope: _defineProperty({}, requestConfigName, requestConfig)
|
19
19
|
};
|
20
20
|
}
|
@@ -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;
|
@@ -5,15 +5,50 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
+
var _utils = require("@teamix/utils");
|
9
|
+
|
10
|
+
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; }
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
8
14
|
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; }
|
9
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
|
+
|
10
28
|
var initializeRequest = function initializeRequest(requestConfig, suffix) {
|
11
29
|
if (requestConfig) {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
30
|
+
if ((0, _utils.isArr)(requestConfig)) {
|
31
|
+
var reactionsMap = [];
|
32
|
+
var scopeMap = {};
|
33
|
+
requestConfig.forEach(function (item, index) {
|
34
|
+
var _initializeRequest = initializeRequest(item, "".concat(suffix).concat(index)),
|
35
|
+
reactions = _initializeRequest.reactions,
|
36
|
+
scope = _initializeRequest.scope;
|
37
|
+
|
38
|
+
reactionsMap = [].concat(_toConsumableArray(reactionsMap), _toConsumableArray(reactions));
|
39
|
+
scopeMap = _objectSpread(_objectSpread({}, scopeMap), scope);
|
40
|
+
});
|
41
|
+
return {
|
42
|
+
reactions: reactionsMap,
|
43
|
+
scope: scopeMap
|
44
|
+
};
|
45
|
+
} else {
|
46
|
+
var requestConfigName = "$requestConfig_".concat(suffix);
|
47
|
+
return {
|
48
|
+
reactions: ["{{$common($request,".concat(requestConfigName, ",context)}}")],
|
49
|
+
scope: _defineProperty({}, requestConfigName, requestConfig)
|
50
|
+
};
|
51
|
+
}
|
17
52
|
}
|
18
53
|
|
19
54
|
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 };
|
@@ -14,14 +14,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
14
14
|
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; }
|
15
15
|
|
16
16
|
// 配置请求
|
17
|
-
var $request = function $request(field, requestConfig, context) {
|
17
|
+
var $request = function $request(field, requestConfig, context, type) {
|
18
18
|
var _field$data;
|
19
19
|
|
20
|
-
var refresh = field === null || field === void 0 ? void 0 : (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
21
20
|
var beforeRequest = requestConfig.beforeRequest,
|
22
21
|
onSuccess = requestConfig.onSuccess;
|
23
|
-
var refreshResult = (0, _utils.isPlainObj)(refresh) ? refresh : {};
|
24
22
|
var beforeRequestResult = (0, _utils.isFn)(beforeRequest) ? beforeRequest(field, context) : {};
|
23
|
+
/**
|
24
|
+
* // 主动触发的请求刷新
|
25
|
+
*/
|
26
|
+
// 触发所有配置的请求
|
27
|
+
|
28
|
+
var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
29
|
+
var refreshResult = (0, _utils.isPureObj)(refresh) ? refresh : {};
|
25
30
|
return (0, _utils.doCommonRequest)(_objectSpread(_objectSpread({}, requestConfig), {}, {
|
26
31
|
params: _objectSpread(_objectSpread(_objectSpread({}, requestConfig.params), beforeRequestResult), refreshResult),
|
27
32
|
beforeRequest: function beforeRequest() {
|
@@ -38,7 +43,7 @@ exports.$request = $request;
|
|
38
43
|
|
39
44
|
var $common = function $common(services, requestConfig, context) {
|
40
45
|
return function (field) {
|
41
|
-
return services(field, requestConfig, context).then(function (res) {
|
46
|
+
return services(field, requestConfig, context, 'request').then(function (res) {
|
42
47
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
43
48
|
});
|
44
49
|
};
|
@@ -50,7 +55,7 @@ exports.$common = $common;
|
|
50
55
|
var $validator = function $validator(services, requestConfig, context) {
|
51
56
|
return function (value, rules, _ref) {
|
52
57
|
var field = _ref.field;
|
53
|
-
return services(field, requestConfig, context).then(function (res) {
|
58
|
+
return services(field, requestConfig, context, 'validator').then(function (res) {
|
54
59
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
55
60
|
});
|
56
61
|
};
|
@@ -59,28 +64,41 @@ var $validator = function $validator(services, requestConfig, context) {
|
|
59
64
|
|
60
65
|
exports.$validator = $validator;
|
61
66
|
|
62
|
-
var $dataSource = function $dataSource(services, requestConfig, context) {
|
67
|
+
var $dataSource = function $dataSource(services, requestConfig, context, readPretty) {
|
63
68
|
return function (field) {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
if (!readPretty) {
|
70
|
+
field.setState({
|
71
|
+
loading: true,
|
72
|
+
readOnly: true
|
73
|
+
});
|
74
|
+
}
|
75
|
+
|
76
|
+
return services(field, requestConfig, context, 'dataSource').then(function (res) {
|
69
77
|
var isValueInDataSource = (0, _utils.getValueByValue)(res, field.value);
|
70
78
|
var clearValue = isValueInDataSource ? {} : {
|
71
79
|
value: undefined
|
72
80
|
};
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
81
|
+
|
82
|
+
if (!readPretty) {
|
83
|
+
field.setState(_objectSpread({
|
84
|
+
dataSource: res,
|
85
|
+
loading: false,
|
86
|
+
readOnly: false
|
87
|
+
}, clearValue));
|
88
|
+
} else {
|
89
|
+
field.setState({
|
90
|
+
dataSource: res
|
91
|
+
});
|
92
|
+
}
|
93
|
+
|
78
94
|
return requestConfig.onComplete && requestConfig.onComplete(res, field, context);
|
79
95
|
}).catch(function () {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
96
|
+
if (!readPretty) {
|
97
|
+
field.setState({
|
98
|
+
loading: false,
|
99
|
+
readOnly: false
|
100
|
+
});
|
101
|
+
}
|
84
102
|
});
|
85
103
|
};
|
86
104
|
};
|
package/lib/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/lib/form/index.js
CHANGED
@@ -23,15 +23,15 @@ var _exportNames = {
|
|
23
23
|
FormConsumer: true,
|
24
24
|
useForm: true,
|
25
25
|
customComponent: true,
|
26
|
-
AdvancedFilter: true,
|
27
|
-
SimpleFilter: true,
|
28
26
|
QueryFilter: true,
|
29
|
-
QueryFilterLayout: true
|
27
|
+
QueryFilterLayout: true,
|
28
|
+
AdvancedFilter: true,
|
29
|
+
SimpleFilter: true
|
30
30
|
};
|
31
31
|
Object.defineProperty(exports, "AdvancedFilter", {
|
32
32
|
enumerable: true,
|
33
33
|
get: function get() {
|
34
|
-
return
|
34
|
+
return _index.AdvancedFilter;
|
35
35
|
}
|
36
36
|
});
|
37
37
|
Object.defineProperty(exports, "FormCollapse", {
|
@@ -73,7 +73,7 @@ Object.defineProperty(exports, "FormTab", {
|
|
73
73
|
Object.defineProperty(exports, "QueryFilter", {
|
74
74
|
enumerable: true,
|
75
75
|
get: function get() {
|
76
|
-
return
|
76
|
+
return _Filter.QueryFilter;
|
77
77
|
}
|
78
78
|
});
|
79
79
|
Object.defineProperty(exports, "QueryFilterLayout", {
|
@@ -85,7 +85,7 @@ Object.defineProperty(exports, "QueryFilterLayout", {
|
|
85
85
|
Object.defineProperty(exports, "SimpleFilter", {
|
86
86
|
enumerable: true,
|
87
87
|
get: function get() {
|
88
|
-
return
|
88
|
+
return _index.SimpleFilter;
|
89
89
|
}
|
90
90
|
});
|
91
91
|
Object.defineProperty(exports, "createForm", {
|
@@ -168,10 +168,10 @@ var _customComponent = require("./ProForm/customComponent");
|
|
168
168
|
|
169
169
|
var _Filter = require("./Filter");
|
170
170
|
|
171
|
-
var _index = require("./Filter/index2");
|
172
|
-
|
173
171
|
var _Layout = require("./Filter/Layout");
|
174
172
|
|
173
|
+
var _index = require("./Filter/index2");
|
174
|
+
|
175
175
|
var _ProForm = _interopRequireDefault(require("./ProForm"));
|
176
176
|
|
177
177
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/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/lib/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/lib/index.js
CHANGED
@@ -18,7 +18,7 @@ var _exportNames = {
|
|
18
18
|
ProTable: true,
|
19
19
|
ProSkeleton: true,
|
20
20
|
utils: true,
|
21
|
-
|
21
|
+
ProTimeline: true,
|
22
22
|
nocode: true,
|
23
23
|
templates: true
|
24
24
|
};
|
@@ -70,16 +70,16 @@ Object.defineProperty(exports, "ProSkeleton", {
|
|
70
70
|
return _skeleton.default;
|
71
71
|
}
|
72
72
|
});
|
73
|
-
Object.defineProperty(exports, "
|
73
|
+
Object.defineProperty(exports, "ProTable", {
|
74
74
|
enumerable: true,
|
75
75
|
get: function get() {
|
76
|
-
return
|
76
|
+
return _table.default;
|
77
77
|
}
|
78
78
|
});
|
79
|
-
Object.defineProperty(exports, "
|
79
|
+
Object.defineProperty(exports, "ProTimeline", {
|
80
80
|
enumerable: true,
|
81
81
|
get: function get() {
|
82
|
-
return
|
82
|
+
return _timeline.ProTimeline;
|
83
83
|
}
|
84
84
|
});
|
85
85
|
Object.defineProperty(exports, "hooks", {
|
@@ -239,16 +239,16 @@ Object.keys(_utils).forEach(function (key) {
|
|
239
239
|
});
|
240
240
|
});
|
241
241
|
|
242
|
-
var
|
242
|
+
var _timeline = require("./timeline");
|
243
243
|
|
244
|
-
Object.keys(
|
244
|
+
Object.keys(_timeline).forEach(function (key) {
|
245
245
|
if (key === "default" || key === "__esModule") return;
|
246
246
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
247
|
-
if (key in exports && exports[key] ===
|
247
|
+
if (key in exports && exports[key] === _timeline[key]) return;
|
248
248
|
Object.defineProperty(exports, key, {
|
249
249
|
enumerable: true,
|
250
250
|
get: function get() {
|
251
|
-
return
|
251
|
+
return _timeline[key];
|
252
252
|
}
|
253
253
|
});
|
254
254
|
});
|
@@ -285,5 +285,5 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
285
285
|
// 设置图标源
|
286
286
|
_icon.default.setConfig(_utils.default.getTeamixIconConfig());
|
287
287
|
|
288
|
-
var version = '1.
|
288
|
+
var version = '1.3.0';
|
289
289
|
exports.version = version;
|
@@ -36,7 +36,8 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement("div", {
|
37
37
|
className: cls()
|
38
38
|
}, /*#__PURE__*/_react.default.createElement(Row, {
|
39
|
-
gutter: 10
|
39
|
+
gutter: 10,
|
40
|
+
className: cls('base-row')
|
40
41
|
}, /*#__PURE__*/_react.default.createElement(Col, {
|
41
42
|
span: labelCol === null || labelCol === void 0 ? void 0 : labelCol.span,
|
42
43
|
className: cls('label')
|
@@ -88,11 +88,11 @@ var schema = [{
|
|
88
88
|
}, {
|
89
89
|
name: 'iconColor',
|
90
90
|
title: '图标颜色',
|
91
|
-
component: '
|
91
|
+
component: 'ColorPicker'
|
92
92
|
}, {
|
93
93
|
name: 'iconBackgroundColor',
|
94
94
|
title: '图标背景颜色',
|
95
|
-
component: '
|
95
|
+
component: 'ColorPicker'
|
96
96
|
}, {
|
97
97
|
name: 'iconBackgroundType',
|
98
98
|
title: '图标背景形状',
|
package/lib/page-header/index.js
CHANGED
@@ -88,8 +88,8 @@ var getColorAndStyle = function getColorAndStyle(color, backgroundColor, backgro
|
|
88
88
|
var isColorPresetColor = (0, _utils.isPresetColor)(color);
|
89
89
|
var isBgColorPresetColor = (0, _utils.isPresetColor)(backgroundColor);
|
90
90
|
var className = (0, _classnames2.default)((_classnames = {}, _defineProperty(_classnames, "".concat((0, _utils.getColorClassName)(color)), isColorPresetColor), _defineProperty(_classnames, "".concat((0, _utils.getBackgroundColorClassName)(backgroundColor)), isBgColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-type-".concat(backgroundType))), !!backgroundType), _classnames));
|
91
|
-
var styleColor = isColorPresetColor ?
|
92
|
-
var styleBgColor = isBgColorPresetColor ?
|
91
|
+
var styleColor = isColorPresetColor ? (0, _utils.getColor)(color) : color;
|
92
|
+
var styleBgColor = isBgColorPresetColor ? (0, _utils.getColor)(color) : backgroundColor;
|
93
93
|
var style = {
|
94
94
|
color: styleColor,
|
95
95
|
backgroundColor: styleBgColor
|