@teamix/pro 1.3.3 → 1.3.6
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 +13477 -2159
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +9 -0
- package/es/actions/dialog-form.js +8 -5
- package/es/actions/dialog.js +2 -4
- package/es/card/index.d.ts +1 -1
- package/es/card/index.js +9 -1
- package/es/card/index.scss +4 -0
- package/es/form/ProForm/useFormDisplayValues.js +2 -2
- package/es/form/SchemaForm/index.js +5 -4
- package/es/form/SchemaForm/initializeDataSource.d.ts +1 -0
- package/es/form/SchemaForm/initializeDataSource.js +7 -1
- package/es/form/SchemaForm/reactions.d.ts +1 -1
- package/es/form/SchemaForm/reactions.js +16 -7
- package/es/form/docs/ActionResponse.d.ts +7 -0
- package/es/form/docs/ActionResponse.js +11 -0
- package/es/form/docs/ActionResponse.less +25 -0
- package/es/form/index.d.ts +1 -0
- package/es/form/typing.d.ts +1 -0
- package/es/form/utils.js +3 -1
- package/es/index.d.ts +4 -2
- package/es/index.js +5 -5
- package/es/info/components/ProInfoItem/index.js +6 -2
- package/es/info/components/ProInfoItem/index.scss +3 -0
- package/es/info/components/baseInfo/index.js +2 -1
- package/es/info/components/baseInfo/index.scss +0 -3
- package/es/info/typing.d.ts +2 -0
- package/es/info/utils/index.d.ts +8 -0
- package/es/info/utils/index.js +28 -1
- package/es/sidebar/components/sidebar-container/index.js +114 -9
- package/es/sidebar/components/sidebar-container/index.scss +53 -5
- package/es/sidebar/components/tree/index.d.ts +2 -0
- package/es/sidebar/components/tree/index.js +222 -76
- package/es/sidebar/components/tree/index.scss +10 -0
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +62 -0
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.scss +7 -0
- package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +12 -0
- package/es/sidebar/components/tree-node/components/IconAction/index.js +105 -0
- package/es/sidebar/components/tree-node/components/IconAction/index.scss +7 -0
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +23 -0
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +73 -0
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +7 -0
- package/es/sidebar/components/tree-node/index.d.ts +7 -0
- package/es/sidebar/components/tree-node/index.js +225 -0
- package/es/sidebar/components/tree-node/index.scss +58 -0
- package/es/sidebar/index.d.ts +2 -0
- package/es/sidebar/index.js +147 -12
- package/es/sidebar/index.scss +24 -1
- package/es/sidebar/typing.d.ts +83 -13
- package/es/sidebar/utils/action-ref.d.ts +3 -0
- package/es/sidebar/utils/action-ref.js +15 -0
- package/es/sidebar/utils/index.d.ts +71 -0
- package/es/sidebar/utils/index.js +228 -0
- package/lib/actions/dialog-form.js +8 -5
- package/lib/actions/dialog.js +1 -3
- package/lib/card/index.d.ts +1 -1
- package/lib/card/index.js +10 -1
- package/lib/card/index.scss +4 -0
- package/lib/form/ProForm/useFormDisplayValues.js +1 -1
- package/lib/form/SchemaForm/index.js +5 -4
- package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -0
- package/lib/form/SchemaForm/initializeDataSource.js +7 -1
- package/lib/form/SchemaForm/reactions.d.ts +1 -1
- package/lib/form/SchemaForm/reactions.js +16 -7
- package/lib/form/docs/ActionResponse.d.ts +7 -0
- package/lib/form/docs/ActionResponse.js +24 -0
- package/lib/form/docs/ActionResponse.less +25 -0
- package/lib/form/index.d.ts +1 -0
- package/lib/form/typing.d.ts +1 -0
- package/lib/form/utils.js +3 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +22 -2
- package/lib/info/components/ProInfoItem/index.js +6 -2
- package/lib/info/components/ProInfoItem/index.scss +3 -0
- package/lib/info/components/baseInfo/index.js +1 -0
- package/lib/info/components/baseInfo/index.scss +0 -3
- package/lib/info/typing.d.ts +2 -0
- package/lib/info/utils/index.d.ts +8 -0
- package/lib/info/utils/index.js +32 -1
- package/lib/sidebar/components/sidebar-container/index.js +120 -8
- package/lib/sidebar/components/sidebar-container/index.scss +53 -5
- package/lib/sidebar/components/tree/index.d.ts +2 -0
- package/lib/sidebar/components/tree/index.js +230 -76
- package/lib/sidebar/components/tree/index.scss +10 -0
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +80 -0
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.scss +7 -0
- package/lib/sidebar/components/tree-node/components/IconAction/index.d.ts +12 -0
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +127 -0
- package/lib/sidebar/components/tree-node/components/IconAction/index.scss +7 -0
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +23 -0
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +94 -0
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +7 -0
- package/lib/sidebar/components/tree-node/index.d.ts +7 -0
- package/lib/sidebar/components/tree-node/index.js +252 -0
- package/lib/sidebar/components/tree-node/index.scss +58 -0
- package/lib/sidebar/index.d.ts +2 -0
- package/lib/sidebar/index.js +173 -10
- package/lib/sidebar/index.scss +24 -1
- package/lib/sidebar/typing.d.ts +83 -13
- package/lib/sidebar/utils/action-ref.d.ts +3 -0
- package/lib/sidebar/utils/action-ref.js +22 -0
- package/lib/sidebar/utils/index.d.ts +71 -0
- package/lib/sidebar/utils/index.js +247 -0
- package/package.json +1 -1
@@ -23,7 +23,7 @@ var _dialog = _interopRequireDefault(require("./dialog"));
|
|
23
23
|
var _utils2 = require("./utils");
|
24
24
|
|
25
25
|
var _excluded = ["schema"],
|
26
|
-
_excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish", "beforeRequest", "formRef"];
|
26
|
+
_excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish", "beforeRequest", "formRef", "extendParams"];
|
27
27
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
29
|
|
@@ -168,6 +168,7 @@ function useDialogFormAction(action, context) {
|
|
168
168
|
_onFinish = action.onFinish,
|
169
169
|
propsBeforeRequest = action.beforeRequest,
|
170
170
|
propsFormRef = action.formRef,
|
171
|
+
propsExtendParams = action.extendParams,
|
171
172
|
others = _objectWithoutProperties(action, _excluded2);
|
172
173
|
|
173
174
|
var innerFormRef = /*#__PURE__*/(0, _react.createRef)();
|
@@ -188,10 +189,12 @@ function useDialogFormAction(action, context) {
|
|
188
189
|
formRef: propsFormRef
|
189
190
|
}, dialogFormProps));
|
190
191
|
},
|
191
|
-
extendParams: useFieldValuesForRequest ? '{{fields}}' :
|
192
|
+
extendParams: useFieldValuesForRequest ? ['{{fields}}', propsExtendParams] : propsExtendParams,
|
192
193
|
beforeRequest: function beforeRequest(context) {
|
193
194
|
return new Promise(function (resolve, reject) {
|
194
195
|
innerFormRef.current.validate().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
196
|
+
var _innerFormRef$current;
|
197
|
+
|
195
198
|
var beforeRequestContext, requestContext;
|
196
199
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
197
200
|
while (1) {
|
@@ -227,7 +230,7 @@ function useDialogFormAction(action, context) {
|
|
227
230
|
|
228
231
|
case 13:
|
229
232
|
requestContext = Object.assign({
|
230
|
-
fields: innerFormRef.current.values
|
233
|
+
fields: (_innerFormRef$current = innerFormRef.current) === null || _innerFormRef$current === void 0 ? void 0 : _innerFormRef$current.values
|
231
234
|
}, _typeof(beforeRequestContext) === 'object' ? beforeRequestContext : {});
|
232
235
|
resolve(requestContext);
|
233
236
|
|
@@ -243,9 +246,9 @@ function useDialogFormAction(action, context) {
|
|
243
246
|
});
|
244
247
|
},
|
245
248
|
onFinish: function onFinish() {
|
246
|
-
var _innerFormRef$
|
249
|
+
var _innerFormRef$current2;
|
247
250
|
|
248
|
-
_onFinish && _onFinish((_innerFormRef$
|
251
|
+
_onFinish && _onFinish((_innerFormRef$current2 = innerFormRef.current) === null || _innerFormRef$current2 === void 0 ? void 0 : _innerFormRef$current2.values);
|
249
252
|
}
|
250
253
|
}, others), context);
|
251
254
|
}
|
package/lib/actions/dialog.js
CHANGED
@@ -236,9 +236,7 @@ function useDialogAction(action, actionContext) {
|
|
236
236
|
var dialogContext = Object.assign({}, context, {
|
237
237
|
hide: hide
|
238
238
|
});
|
239
|
-
var dialogContent = Component ? /*#__PURE__*/_react.default.createElement(Component, _objectSpread({
|
240
|
-
key: (0, _utils.uuid)()
|
241
|
-
}, (0, _utils2.addContext)(componentProps, dialogContext))) : addContextForReactNode(content, dialogContext);
|
239
|
+
var dialogContent = Component ? /*#__PURE__*/_react.default.createElement(Component, _objectSpread({}, (0, _utils2.addContext)(componentProps, dialogContext))) : addContextForReactNode(content, dialogContext);
|
242
240
|
|
243
241
|
var quickShowProps = _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(isPop ? 'onConfirm' : 'onOk'), onOk), _defineProperty(_objectSpread2, "title", addContextForReactNode(title, dialogContext)), _defineProperty(_objectSpread2, "content", /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, beforeContent && /*#__PURE__*/_react.default.createElement("div", {
|
244
242
|
className: "teamix-pro-dialog-before-content"
|
package/lib/card/index.d.ts
CHANGED
package/lib/card/index.js
CHANGED
@@ -36,6 +36,8 @@ var _tab = _interopRequireDefault(require("./tab"));
|
|
36
36
|
|
37
37
|
require("./index.scss");
|
38
38
|
|
39
|
+
var _proField = _interopRequireDefault(require("@teamix/pro-field"));
|
40
|
+
|
39
41
|
var _cardContainer = require("./card-container");
|
40
42
|
|
41
43
|
Object.keys(_cardContainer).forEach(function (key) {
|
@@ -258,7 +260,14 @@ var ProCard = function ProCard(props) {
|
|
258
260
|
trigger: tooltipTrigger
|
259
261
|
}, tooltip)), tags && (0, _utils.renderTags)(tags, 'small'), description && /*#__PURE__*/_react.default.createElement("div", {
|
260
262
|
className: cls('title-description')
|
261
|
-
},
|
263
|
+
}, /*#__PURE__*/_react.default.createElement(_proField.default, {
|
264
|
+
value: description,
|
265
|
+
type: "text",
|
266
|
+
render: {
|
267
|
+
ellipsis: true,
|
268
|
+
tooltip: description
|
269
|
+
}
|
270
|
+
})));
|
262
271
|
};
|
263
272
|
|
264
273
|
return /*#__PURE__*/_react.default.createElement(_components.Card, _objectSpread({
|
package/lib/card/index.scss
CHANGED
@@ -56,7 +56,7 @@ var getDisplayValues = function getDisplayValues(form, values) {
|
|
56
56
|
|
57
57
|
var isFieldValue = Object.keys(_fieldTypeMap.default).includes(field === null || field === void 0 ? void 0 : field.component[0]); // 判断值的类型,递归获取每个值在该结构中的完整路径
|
58
58
|
|
59
|
-
if (!(0, _utils.
|
59
|
+
if (!(0, _utils.isUsable)(values)) {
|
60
60
|
displayValues = {};
|
61
61
|
} else if ((0, _utils.isPlainObj)(values) && !isFieldValue) {
|
62
62
|
// 如果值是布局对象的值
|
@@ -266,7 +266,8 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
266
266
|
var _initializeDataSource = (0, _initializeDataSource2.default)(dataSource, "".concat(suffix, "d")),
|
267
267
|
defaultDataSource = _initializeDataSource.dataSource,
|
268
268
|
dataSourceReactions = _initializeDataSource.reactions,
|
269
|
-
dataSourceScope = _initializeDataSource.scope
|
269
|
+
dataSourceScope = _initializeDataSource.scope,
|
270
|
+
dataSourceData = _initializeDataSource.data; // 初始化rules validator
|
270
271
|
|
271
272
|
|
272
273
|
var _initializeRules = (0, _initializeRules2.default)(rules, "".concat(suffix, "v")),
|
@@ -291,9 +292,9 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
291
292
|
rules: defaultRules,
|
292
293
|
reactions: defaultReactions,
|
293
294
|
dataSource: defaultDataSource,
|
294
|
-
data: data
|
295
|
-
|
296
|
-
}
|
295
|
+
data: _objectSpread(_objectSpread(_objectSpread({}, data), dataSourceData), {}, {
|
296
|
+
__placeholder: true
|
297
|
+
})
|
297
298
|
})); // 递归子组件
|
298
299
|
|
299
300
|
var recursiveProperties = (children === null || children === void 0 ? void 0 : children.length) ? {
|
@@ -11,11 +11,17 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
11
11
|
|
12
12
|
var initializeDataSource = function initializeDataSource(dataSource, suffix) {
|
13
13
|
if ((0, _utils.isPlainObj)(dataSource)) {
|
14
|
+
var _requestConfig$extraC;
|
15
|
+
|
14
16
|
var requestConfig = dataSource;
|
15
17
|
var requestConfigName = "$requestConfig_".concat(suffix);
|
16
18
|
return {
|
17
19
|
reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context)}}")],
|
18
|
-
scope: _defineProperty({}, requestConfigName, requestConfig)
|
20
|
+
scope: _defineProperty({}, requestConfigName, requestConfig),
|
21
|
+
// dataSource请求时,默认配置字段为只读
|
22
|
+
data: {
|
23
|
+
readOnlyOnLoading: (requestConfig === null || requestConfig === void 0 ? void 0 : (_requestConfig$extraC = requestConfig.extraConfig) === null || _requestConfig$extraC === void 0 ? void 0 : _requestConfig$extraC.readOnly) !== false
|
24
|
+
}
|
19
25
|
};
|
20
26
|
}
|
21
27
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ProFormRequestConfig } from '../typing';
|
2
|
-
declare const $request: (field: any, requestConfig: ProFormRequestConfig, context: any, type: 'request' | 'validator' | 'dataSource') => Promise<unknown>;
|
2
|
+
declare const $request: (field: any, { extraConfig, ...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
5
|
declare const $dataSource: (services: any, requestConfig: ProFormRequestConfig, context: any) => (field: any) => any;
|
@@ -7,16 +7,25 @@ exports.$validator = exports.$request = exports.$dataSource = exports.$common =
|
|
7
7
|
|
8
8
|
var _utils = require("@teamix/utils");
|
9
9
|
|
10
|
+
var _excluded = ["extraConfig"];
|
11
|
+
|
10
12
|
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
13
|
|
12
14
|
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
15
|
|
14
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; }
|
15
17
|
|
18
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
19
|
+
|
20
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
21
|
+
|
16
22
|
// 配置请求
|
17
|
-
var $request = function $request(field,
|
23
|
+
var $request = function $request(field, _ref, context, type) {
|
18
24
|
var _field$data;
|
19
25
|
|
26
|
+
var extraConfig = _ref.extraConfig,
|
27
|
+
requestConfig = _objectWithoutProperties(_ref, _excluded);
|
28
|
+
|
20
29
|
var params = requestConfig.params,
|
21
30
|
beforeRequest = requestConfig.beforeRequest,
|
22
31
|
formatResult = requestConfig.formatResult,
|
@@ -60,8 +69,8 @@ var $common = function $common(services, requestConfig, context) {
|
|
60
69
|
exports.$common = $common;
|
61
70
|
|
62
71
|
var $validator = function $validator(services, requestConfig, context) {
|
63
|
-
return function (value, rules,
|
64
|
-
var field =
|
72
|
+
return function (value, rules, _ref2) {
|
73
|
+
var field = _ref2.field;
|
65
74
|
return services(field, requestConfig, context, 'validator').then(function (res) {
|
66
75
|
var _requestConfig$onComp2;
|
67
76
|
|
@@ -79,16 +88,16 @@ var $dataSource = function $dataSource(services, requestConfig, context) {
|
|
79
88
|
loading: true
|
80
89
|
});
|
81
90
|
return services(field, requestConfig, context, 'dataSource').then(function (res) {
|
82
|
-
var _requestConfig$onComp3;
|
91
|
+
var _requestConfig$extraC, _requestConfig$onComp3;
|
83
92
|
|
84
93
|
var isValueInDataSource = (0, _utils.getValueByValue)(res, field.value);
|
85
|
-
var
|
94
|
+
var clearResult = !isValueInDataSource && (requestConfig === null || requestConfig === void 0 ? void 0 : (_requestConfig$extraC = requestConfig.extraConfig) === null || _requestConfig$extraC === void 0 ? void 0 : _requestConfig$extraC.clearInvalidValue) !== false ? {
|
86
95
|
value: undefined
|
87
|
-
};
|
96
|
+
} : {};
|
88
97
|
field.setState(_objectSpread({
|
89
98
|
dataSource: res,
|
90
99
|
loading: false
|
91
|
-
},
|
100
|
+
}, clearResult));
|
92
101
|
return (_requestConfig$onComp3 = requestConfig.onComplete) === null || _requestConfig$onComp3 === void 0 ? void 0 : _requestConfig$onComp3.call(requestConfig, res, field, context);
|
93
102
|
}).catch(function () {
|
94
103
|
field.setState({
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ActionResponse = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
require("./ActionResponse.less");
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
var ActionResponse = function ActionResponse(props) {
|
15
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
16
|
+
className: "as-wrapper"
|
17
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
18
|
+
className: "as-actions"
|
19
|
+
}, props.children), props.response && /*#__PURE__*/_react.default.createElement("div", {
|
20
|
+
className: "as-response"
|
21
|
+
}, "Response\uFF1A", props.response));
|
22
|
+
};
|
23
|
+
|
24
|
+
exports.ActionResponse = ActionResponse;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
.as-wrapper {
|
2
|
+
.as-actions {
|
3
|
+
& button {
|
4
|
+
margin-right: 5px;
|
5
|
+
background-color: #fff;
|
6
|
+
border: 2px solid #d4bbbb;
|
7
|
+
border-radius: 6px;
|
8
|
+
outline: none;
|
9
|
+
padding: 8px 20px;
|
10
|
+
cursor: pointer;
|
11
|
+
transition: all 0.15s ease-in-out;
|
12
|
+
&:hover {
|
13
|
+
border: 2px solid #9db8f3;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.as-response {
|
19
|
+
border: 2px dashed #f0bdbd;
|
20
|
+
font-size: 14px;
|
21
|
+
border-radius: 6px;
|
22
|
+
padding: 8px 20px;
|
23
|
+
margin-top: 10px;
|
24
|
+
}
|
25
|
+
}
|
package/lib/form/index.d.ts
CHANGED
@@ -31,6 +31,7 @@ declare const formilyReact: {
|
|
31
31
|
displayName: string;
|
32
32
|
};
|
33
33
|
RecursionField: import("react").FC<originalFormilyReact.IRecursionFieldProps>;
|
34
|
+
ExpressionScope: import("react").FC<originalFormilyReact.IExpressionScopeProps>;
|
34
35
|
createSchemaField<Components extends originalFormilyReact.SchemaReactComponents>(options?: originalFormilyReact.ISchemaFieldReactFactoryOptions<Components> | undefined): {
|
35
36
|
<Decorator extends originalFormilyReact.JSXComponent, Component extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.ISchemaFieldProps<Decorator, Component, import("@formily/core").ObjectField<Decorator, Component>>): JSX.Element;
|
36
37
|
displayName: string;
|
package/lib/form/typing.d.ts
CHANGED
@@ -23,6 +23,7 @@ export interface ProFormRequestConfig extends CommonRequestConfig {
|
|
23
23
|
formatResult?: (res?: any, field?: any, context?: any) => any;
|
24
24
|
onSuccess?: (res?: any, field?: any, context?: any) => any;
|
25
25
|
onComplete?: (res?: any, field?: any, context?: any) => any;
|
26
|
+
extraConfig?: AnyObject;
|
26
27
|
}
|
27
28
|
export interface ProFormSchemaItem {
|
28
29
|
type?: string;
|
package/lib/form/utils.js
CHANGED
@@ -69,6 +69,8 @@ var mapSize = function mapSize(props, field) {
|
|
69
69
|
exports.mapSize = mapSize;
|
70
70
|
|
71
71
|
var mapStatus = function mapStatus(props, field) {
|
72
|
+
var _field$data;
|
73
|
+
|
72
74
|
var takeStatus = function takeStatus() {
|
73
75
|
var _field$warnings, _field$decoratorProps, _field$decoratorProps2;
|
74
76
|
|
@@ -91,7 +93,7 @@ var mapStatus = function mapStatus(props, field) {
|
|
91
93
|
state: state
|
92
94
|
}; // 当组件处于loading状态时,仅可读不可写。
|
93
95
|
|
94
|
-
if (state === 'loading') {
|
96
|
+
if (state === 'loading' && ((_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.readOnlyOnLoading)) {
|
95
97
|
result.readOnly = true;
|
96
98
|
}
|
97
99
|
|
package/lib/index.d.ts
CHANGED
@@ -9,6 +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 ProSidebar from './sidebar';
|
12
13
|
import { ProTimeline } from './timeline';
|
13
14
|
import * as nocode from './nocode';
|
14
15
|
import * as templates from './templates';
|
@@ -22,7 +23,8 @@ export * from './page-container';
|
|
22
23
|
export * from './page-header';
|
23
24
|
export * from './skeleton';
|
24
25
|
export * from './table';
|
26
|
+
export * from './sidebar';
|
25
27
|
export * from './utils';
|
26
28
|
export * from './timeline';
|
27
|
-
declare const version = "1.3.
|
28
|
-
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProTimeline, hooks, nocode, templates, utils, };
|
29
|
+
declare const version = "1.3.6";
|
30
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
@@ -18,6 +18,7 @@ var _exportNames = {
|
|
18
18
|
ProTable: true,
|
19
19
|
ProSkeleton: true,
|
20
20
|
utils: true,
|
21
|
+
ProSidebar: true,
|
21
22
|
ProTimeline: true,
|
22
23
|
nocode: true,
|
23
24
|
templates: true
|
@@ -64,6 +65,12 @@ Object.defineProperty(exports, "ProPageHeader", {
|
|
64
65
|
return _pageHeader.default;
|
65
66
|
}
|
66
67
|
});
|
68
|
+
Object.defineProperty(exports, "ProSidebar", {
|
69
|
+
enumerable: true,
|
70
|
+
get: function get() {
|
71
|
+
return _sidebar.default;
|
72
|
+
}
|
73
|
+
});
|
67
74
|
Object.defineProperty(exports, "ProSkeleton", {
|
68
75
|
enumerable: true,
|
69
76
|
get: function get() {
|
@@ -239,6 +246,20 @@ Object.keys(_utils).forEach(function (key) {
|
|
239
246
|
});
|
240
247
|
});
|
241
248
|
|
249
|
+
var _sidebar = _interopRequireWildcard(require("./sidebar"));
|
250
|
+
|
251
|
+
Object.keys(_sidebar).forEach(function (key) {
|
252
|
+
if (key === "default" || key === "__esModule") return;
|
253
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
254
|
+
if (key in exports && exports[key] === _sidebar[key]) return;
|
255
|
+
Object.defineProperty(exports, key, {
|
256
|
+
enumerable: true,
|
257
|
+
get: function get() {
|
258
|
+
return _sidebar[key];
|
259
|
+
}
|
260
|
+
});
|
261
|
+
});
|
262
|
+
|
242
263
|
var _timeline = require("./timeline");
|
243
264
|
|
244
265
|
Object.keys(_timeline).forEach(function (key) {
|
@@ -281,9 +302,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
281
302
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
282
303
|
|
283
304
|
// import ProLayout from './layout';
|
284
|
-
// import ProSidebar from './sidebar'
|
285
305
|
// 设置图标源
|
286
306
|
_icon.default.setConfig(_utils.default.getTeamixIconConfig());
|
287
307
|
|
288
|
-
var version = '1.3.
|
308
|
+
var version = '1.3.6';
|
289
309
|
exports.version = version;
|
@@ -28,13 +28,17 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
28
28
|
headerInfoLayout = prop.headerInfoLayout,
|
29
29
|
loading = prop.loading,
|
30
30
|
tooltip = prop.tooltip,
|
31
|
-
tooltipIcon = prop.tooltipIcon
|
31
|
+
tooltipIcon = prop.tooltipIcon,
|
32
|
+
_isLastRow = prop._isLastRow;
|
32
33
|
|
33
34
|
if (baseInfoLayout) {
|
34
35
|
var labelCol = baseInfoLayout.labelCol,
|
35
36
|
wrapperCol = baseInfoLayout.wrapperCol;
|
36
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
37
|
-
className: cls(
|
38
|
+
className: cls({
|
39
|
+
'': true,
|
40
|
+
isLastRow: _isLastRow
|
41
|
+
})
|
38
42
|
}, /*#__PURE__*/_react.default.createElement(Row, {
|
39
43
|
gutter: 10,
|
40
44
|
className: cls('base-row')
|
@@ -84,6 +84,7 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
84
84
|
}, /*#__PURE__*/_react.default.createElement(_ProInfoItem.default, {
|
85
85
|
label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
|
86
86
|
loading: loading,
|
87
|
+
_isLastRow: !!(0, _utils2.isLastRow)(columns.length, layoutSpan, index),
|
87
88
|
value: /*#__PURE__*/_react.default.createElement(_InfoValueItem.default, {
|
88
89
|
type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
|
89
90
|
value: (0, _utils2.getDataIndexValue)(item.dataIndex, (_ref = dataSource !== null && dataSource !== void 0 ? dataSource : result) !== null && _ref !== void 0 ? _ref : {}),
|
package/lib/info/typing.d.ts
CHANGED
@@ -113,6 +113,8 @@ export declare type IProProInfoItem = {
|
|
113
113
|
headerInfoLayout?: ProHeaderInfoLayoutProps;
|
114
114
|
/** loading 状态 */
|
115
115
|
loading?: boolean;
|
116
|
+
/** isLastRow 是否是最后一行的元素 */
|
117
|
+
_isLastRow?: boolean;
|
116
118
|
} & Pick<ProInfoColumnsProps, 'tooltip' | 'tooltipIcon'>;
|
117
119
|
/** header info 定义 */
|
118
120
|
export declare type IProHeaderInfo = {
|
@@ -10,3 +10,11 @@ export declare const ProInfoGroupContext: React.Context<ProInfoGroupContextProps
|
|
10
10
|
* @returns
|
11
11
|
*/
|
12
12
|
export declare function getDataIndexValue(dataIndex: ProInfoColumnsProps['dataIndex'], dataSource: object): any;
|
13
|
+
/**
|
14
|
+
* 是否是最后一样的元素
|
15
|
+
* @param columnsLength
|
16
|
+
* @param layoutSpan
|
17
|
+
* @params itemIndex
|
18
|
+
* @returns
|
19
|
+
*/
|
20
|
+
export declare const isLastRow: (columnsLength: number, layoutSpan: number, itemIndex: number) => boolean | undefined;
|
package/lib/info/utils/index.js
CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.ProInfoGroupContext = void 0;
|
7
7
|
exports.getDataIndexValue = getDataIndexValue;
|
8
|
+
exports.isLastRow = void 0;
|
8
9
|
exports.useActionType = useActionType;
|
9
10
|
|
10
11
|
var _utils = require("@teamix/utils");
|
@@ -47,4 +48,34 @@ function getDataIndexValue(dataIndex, dataSource) {
|
|
47
48
|
}
|
48
49
|
|
49
50
|
return (0, _utils.getDeepValue)(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
|
50
|
-
}
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* 是否是最后一样的元素
|
54
|
+
* @param columnsLength
|
55
|
+
* @param layoutSpan
|
56
|
+
* @params itemIndex
|
57
|
+
* @returns
|
58
|
+
*/
|
59
|
+
|
60
|
+
|
61
|
+
var isLastRow = function isLastRow(columnsLength, layoutSpan, itemIndex) {
|
62
|
+
if (!columnsLength || !layoutSpan) return;
|
63
|
+
var lastRowColumnsIndexList = [];
|
64
|
+
var rowCount = 24 / layoutSpan;
|
65
|
+
|
66
|
+
if (columnsLength % rowCount === 0) {
|
67
|
+
while (rowCount--) {
|
68
|
+
lastRowColumnsIndexList.push(columnsLength--);
|
69
|
+
}
|
70
|
+
} else {
|
71
|
+
var lastRowCount = columnsLength % rowCount;
|
72
|
+
|
73
|
+
while (lastRowCount--) {
|
74
|
+
lastRowColumnsIndexList.push(columnsLength--);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
return lastRowColumnsIndexList.includes(itemIndex + 1);
|
79
|
+
};
|
80
|
+
|
81
|
+
exports.isLastRow = isLastRow;
|