@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.
Files changed (108) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +13477 -2159
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/dist/pro.min.js.LICENSE.txt +9 -0
  6. package/es/actions/dialog-form.js +8 -5
  7. package/es/actions/dialog.js +2 -4
  8. package/es/card/index.d.ts +1 -1
  9. package/es/card/index.js +9 -1
  10. package/es/card/index.scss +4 -0
  11. package/es/form/ProForm/useFormDisplayValues.js +2 -2
  12. package/es/form/SchemaForm/index.js +5 -4
  13. package/es/form/SchemaForm/initializeDataSource.d.ts +1 -0
  14. package/es/form/SchemaForm/initializeDataSource.js +7 -1
  15. package/es/form/SchemaForm/reactions.d.ts +1 -1
  16. package/es/form/SchemaForm/reactions.js +16 -7
  17. package/es/form/docs/ActionResponse.d.ts +7 -0
  18. package/es/form/docs/ActionResponse.js +11 -0
  19. package/es/form/docs/ActionResponse.less +25 -0
  20. package/es/form/index.d.ts +1 -0
  21. package/es/form/typing.d.ts +1 -0
  22. package/es/form/utils.js +3 -1
  23. package/es/index.d.ts +4 -2
  24. package/es/index.js +5 -5
  25. package/es/info/components/ProInfoItem/index.js +6 -2
  26. package/es/info/components/ProInfoItem/index.scss +3 -0
  27. package/es/info/components/baseInfo/index.js +2 -1
  28. package/es/info/components/baseInfo/index.scss +0 -3
  29. package/es/info/typing.d.ts +2 -0
  30. package/es/info/utils/index.d.ts +8 -0
  31. package/es/info/utils/index.js +28 -1
  32. package/es/sidebar/components/sidebar-container/index.js +114 -9
  33. package/es/sidebar/components/sidebar-container/index.scss +53 -5
  34. package/es/sidebar/components/tree/index.d.ts +2 -0
  35. package/es/sidebar/components/tree/index.js +222 -76
  36. package/es/sidebar/components/tree/index.scss +10 -0
  37. package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
  38. package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +62 -0
  39. package/es/sidebar/components/tree-node/components/HoverTooltip/index.scss +7 -0
  40. package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +12 -0
  41. package/es/sidebar/components/tree-node/components/IconAction/index.js +105 -0
  42. package/es/sidebar/components/tree-node/components/IconAction/index.scss +7 -0
  43. package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +23 -0
  44. package/es/sidebar/components/tree-node/components/IconSwitch/index.js +73 -0
  45. package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +7 -0
  46. package/es/sidebar/components/tree-node/index.d.ts +7 -0
  47. package/es/sidebar/components/tree-node/index.js +225 -0
  48. package/es/sidebar/components/tree-node/index.scss +58 -0
  49. package/es/sidebar/index.d.ts +2 -0
  50. package/es/sidebar/index.js +147 -12
  51. package/es/sidebar/index.scss +24 -1
  52. package/es/sidebar/typing.d.ts +83 -13
  53. package/es/sidebar/utils/action-ref.d.ts +3 -0
  54. package/es/sidebar/utils/action-ref.js +15 -0
  55. package/es/sidebar/utils/index.d.ts +71 -0
  56. package/es/sidebar/utils/index.js +228 -0
  57. package/lib/actions/dialog-form.js +8 -5
  58. package/lib/actions/dialog.js +1 -3
  59. package/lib/card/index.d.ts +1 -1
  60. package/lib/card/index.js +10 -1
  61. package/lib/card/index.scss +4 -0
  62. package/lib/form/ProForm/useFormDisplayValues.js +1 -1
  63. package/lib/form/SchemaForm/index.js +5 -4
  64. package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -0
  65. package/lib/form/SchemaForm/initializeDataSource.js +7 -1
  66. package/lib/form/SchemaForm/reactions.d.ts +1 -1
  67. package/lib/form/SchemaForm/reactions.js +16 -7
  68. package/lib/form/docs/ActionResponse.d.ts +7 -0
  69. package/lib/form/docs/ActionResponse.js +24 -0
  70. package/lib/form/docs/ActionResponse.less +25 -0
  71. package/lib/form/index.d.ts +1 -0
  72. package/lib/form/typing.d.ts +1 -0
  73. package/lib/form/utils.js +3 -1
  74. package/lib/index.d.ts +4 -2
  75. package/lib/index.js +22 -2
  76. package/lib/info/components/ProInfoItem/index.js +6 -2
  77. package/lib/info/components/ProInfoItem/index.scss +3 -0
  78. package/lib/info/components/baseInfo/index.js +1 -0
  79. package/lib/info/components/baseInfo/index.scss +0 -3
  80. package/lib/info/typing.d.ts +2 -0
  81. package/lib/info/utils/index.d.ts +8 -0
  82. package/lib/info/utils/index.js +32 -1
  83. package/lib/sidebar/components/sidebar-container/index.js +120 -8
  84. package/lib/sidebar/components/sidebar-container/index.scss +53 -5
  85. package/lib/sidebar/components/tree/index.d.ts +2 -0
  86. package/lib/sidebar/components/tree/index.js +230 -76
  87. package/lib/sidebar/components/tree/index.scss +10 -0
  88. package/lib/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
  89. package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +80 -0
  90. package/lib/sidebar/components/tree-node/components/HoverTooltip/index.scss +7 -0
  91. package/lib/sidebar/components/tree-node/components/IconAction/index.d.ts +12 -0
  92. package/lib/sidebar/components/tree-node/components/IconAction/index.js +127 -0
  93. package/lib/sidebar/components/tree-node/components/IconAction/index.scss +7 -0
  94. package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +23 -0
  95. package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +94 -0
  96. package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +7 -0
  97. package/lib/sidebar/components/tree-node/index.d.ts +7 -0
  98. package/lib/sidebar/components/tree-node/index.js +252 -0
  99. package/lib/sidebar/components/tree-node/index.scss +58 -0
  100. package/lib/sidebar/index.d.ts +2 -0
  101. package/lib/sidebar/index.js +173 -10
  102. package/lib/sidebar/index.scss +24 -1
  103. package/lib/sidebar/typing.d.ts +83 -13
  104. package/lib/sidebar/utils/action-ref.d.ts +3 -0
  105. package/lib/sidebar/utils/action-ref.js +22 -0
  106. package/lib/sidebar/utils/index.d.ts +71 -0
  107. package/lib/sidebar/utils/index.js +247 -0
  108. package/package.json +1 -1
@@ -26,6 +26,15 @@ object-assign
26
26
 
27
27
  /*! js-cookie v3.0.1 | MIT */
28
28
 
29
+ /**
30
+ * @license
31
+ * Lodash <https://lodash.com/>
32
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
33
+ * Released under MIT license <https://lodash.com/license>
34
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
35
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
36
+ */
37
+
29
38
  /** @license React v16.13.1
30
39
  * react-is.production.min.js
31
40
  *
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["schema"],
2
- _excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish", "beforeRequest", "formRef"];
2
+ _excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish", "beforeRequest", "formRef", "extendParams"];
3
3
 
4
4
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
5
5
 
@@ -147,6 +147,7 @@ export function useDialogFormAction(action, context) {
147
147
  _onFinish = action.onFinish,
148
148
  propsBeforeRequest = action.beforeRequest,
149
149
  propsFormRef = action.formRef,
150
+ propsExtendParams = action.extendParams,
150
151
  others = _objectWithoutProperties(action, _excluded2);
151
152
 
152
153
  var innerFormRef = /*#__PURE__*/createRef();
@@ -167,10 +168,12 @@ export function useDialogFormAction(action, context) {
167
168
  formRef: propsFormRef
168
169
  }, dialogFormProps));
169
170
  },
170
- extendParams: useFieldValuesForRequest ? '{{fields}}' : undefined,
171
+ extendParams: useFieldValuesForRequest ? ['{{fields}}', propsExtendParams] : propsExtendParams,
171
172
  beforeRequest: function beforeRequest(context) {
172
173
  return new Promise(function (resolve, reject) {
173
174
  innerFormRef.current.validate().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
175
+ var _innerFormRef$current;
176
+
174
177
  var beforeRequestContext, requestContext;
175
178
  return regeneratorRuntime.wrap(function _callee$(_context) {
176
179
  while (1) {
@@ -206,7 +209,7 @@ export function useDialogFormAction(action, context) {
206
209
 
207
210
  case 13:
208
211
  requestContext = Object.assign({
209
- fields: innerFormRef.current.values
212
+ fields: (_innerFormRef$current = innerFormRef.current) === null || _innerFormRef$current === void 0 ? void 0 : _innerFormRef$current.values
210
213
  }, _typeof(beforeRequestContext) === 'object' ? beforeRequestContext : {});
211
214
  resolve(requestContext);
212
215
 
@@ -222,9 +225,9 @@ export function useDialogFormAction(action, context) {
222
225
  });
223
226
  },
224
227
  onFinish: function onFinish() {
225
- var _innerFormRef$current;
228
+ var _innerFormRef$current2;
226
229
 
227
- _onFinish && _onFinish((_innerFormRef$current = innerFormRef.current) === null || _innerFormRef$current === void 0 ? void 0 : _innerFormRef$current.values);
230
+ _onFinish && _onFinish((_innerFormRef$current2 = innerFormRef.current) === null || _innerFormRef$current2 === void 0 ? void 0 : _innerFormRef$current2.values);
228
231
  }
229
232
  }, others), context);
230
233
  }
@@ -32,7 +32,7 @@ import classnames from 'classnames';
32
32
  import { useHistory } from 'react-router-dom';
33
33
  import { Dialog, Drawer } from '@alicloudfe/components';
34
34
  import PopConfirm from '@teamix/pop-confirm';
35
- import { getTargetValue, uuid, getMessage } from '@teamix/utils';
35
+ import { getTargetValue, getMessage } from '@teamix/utils';
36
36
  import ProForm, { createForm } from '../form';
37
37
  import { renderProMessage } from '../utils/message';
38
38
  import { eventHandler } from './base';
@@ -210,9 +210,7 @@ export function useDialogAction(action, actionContext) {
210
210
  var dialogContext = Object.assign({}, context, {
211
211
  hide: hide
212
212
  });
213
- var dialogContent = Component ? /*#__PURE__*/React.createElement(Component, _objectSpread({
214
- key: uuid()
215
- }, addContext(componentProps, dialogContext))) : addContextForReactNode(content, dialogContext);
213
+ var dialogContent = Component ? /*#__PURE__*/React.createElement(Component, _objectSpread({}, addContext(componentProps, dialogContext))) : addContextForReactNode(content, dialogContext);
216
214
 
217
215
  var quickShowProps = _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(isPop ? 'onConfirm' : 'onOk'), onOk), _defineProperty(_objectSpread2, "title", addContextForReactNode(title, dialogContext)), _defineProperty(_objectSpread2, "content", /*#__PURE__*/React.createElement(React.Fragment, null, beforeContent && /*#__PURE__*/React.createElement("div", {
218
216
  className: "teamix-pro-dialog-before-content"
@@ -90,7 +90,7 @@ export declare const ProCard: {
90
90
  Selectable: {
91
91
  (props: import("./selectable").ProCardSelectableProps): JSX.Element;
92
92
  defaultProps: {
93
- hoveredShadow: boolean; /** 标签组 */
93
+ hoveredShadow: boolean;
94
94
  };
95
95
  isProCard: boolean;
96
96
  };
package/es/card/index.js CHANGED
@@ -37,6 +37,7 @@ import ProCardDivider from './divider';
37
37
  import ProCardSelectable from './selectable';
38
38
  import ProCardTab from './tab';
39
39
  import './index.scss';
40
+ import ProField from '@teamix/pro-field';
40
41
  export * from './card-container';
41
42
  var cls = baseClass('teamix-pro-card');
42
43
 
@@ -219,7 +220,14 @@ export var ProCard = function ProCard(props) {
219
220
  trigger: tooltipTrigger
220
221
  }, tooltip)), tags && renderTags(tags, 'small'), description && /*#__PURE__*/React.createElement("div", {
221
222
  className: cls('title-description')
222
- }, description));
223
+ }, /*#__PURE__*/React.createElement(ProField, {
224
+ value: description,
225
+ type: "text",
226
+ render: {
227
+ ellipsis: true,
228
+ tooltip: description
229
+ }
230
+ })));
223
231
  };
224
232
 
225
233
  return /*#__PURE__*/React.createElement(BasicCard, _objectSpread({
@@ -52,6 +52,10 @@
52
52
  }
53
53
  }
54
54
 
55
+ &-name{
56
+ flex-shrink: 0;
57
+ }
58
+
55
59
  &-collapse {
56
60
  cursor: pointer;
57
61
 
@@ -12,7 +12,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  import { useForm } from '@formily/react';
14
14
  import { toJS } from '@formily/reactive';
15
- import { isArr, isPlainObj, isSignificative, getValueByValue } from '@teamix/utils';
15
+ import { isArr, isPlainObj, isUsable, getValueByValue } from '@teamix/utils';
16
16
  import fieldTypeMap from '../fieldTypeMap';
17
17
  /**
18
18
  * 获取表单值的可显示值
@@ -44,7 +44,7 @@ var getDisplayValues = function getDisplayValues(form, values) {
44
44
 
45
45
  var isFieldValue = Object.keys(fieldTypeMap).includes(field === null || field === void 0 ? void 0 : field.component[0]); // 判断值的类型,递归获取每个值在该结构中的完整路径
46
46
 
47
- if (!isSignificative(values)) {
47
+ if (!isUsable(values)) {
48
48
  displayValues = {};
49
49
  } else if (isPlainObj(values) && !isFieldValue) {
50
50
  // 如果值是布局对象的值
@@ -220,7 +220,8 @@ export default /*#__PURE__*/memo(function (_ref) {
220
220
  var _initializeDataSource = initializeDataSource(dataSource, "".concat(suffix, "d")),
221
221
  defaultDataSource = _initializeDataSource.dataSource,
222
222
  dataSourceReactions = _initializeDataSource.reactions,
223
- dataSourceScope = _initializeDataSource.scope; // 初始化rules validator
223
+ dataSourceScope = _initializeDataSource.scope,
224
+ dataSourceData = _initializeDataSource.data; // 初始化rules validator
224
225
 
225
226
 
226
227
  var _initializeRules = initializeRules(rules, "".concat(suffix, "v")),
@@ -245,9 +246,9 @@ export default /*#__PURE__*/memo(function (_ref) {
245
246
  rules: defaultRules,
246
247
  reactions: defaultReactions,
247
248
  dataSource: defaultDataSource,
248
- data: data || {
249
- placeholder: true
250
- }
249
+ data: _objectSpread(_objectSpread(_objectSpread({}, data), dataSourceData), {}, {
250
+ __placeholder: true
251
+ })
251
252
  })); // 递归子组件
252
253
 
253
254
  var recursiveProperties = (children === null || children === void 0 ? void 0 : children.length) ? {
@@ -6,6 +6,7 @@ interface IInitializeDataSource {
6
6
  scope: {
7
7
  [x: string]: any;
8
8
  };
9
+ data?: any;
9
10
  };
10
11
  }
11
12
  declare const initializeDataSource: IInitializeDataSource;
@@ -4,11 +4,17 @@ import { isPlainObj } from '@teamix/utils';
4
4
 
5
5
  var initializeDataSource = function initializeDataSource(dataSource, suffix) {
6
6
  if (isPlainObj(dataSource)) {
7
+ var _requestConfig$extraC;
8
+
7
9
  var requestConfig = dataSource;
8
10
  var requestConfigName = "$requestConfig_".concat(suffix);
9
11
  return {
10
12
  reactions: ["{{$dataSource($request,".concat(requestConfigName, ",context)}}")],
11
- scope: _defineProperty({}, requestConfigName, requestConfig)
13
+ scope: _defineProperty({}, requestConfigName, requestConfig),
14
+ // dataSource请求时,默认配置字段为只读
15
+ data: {
16
+ readOnlyOnLoading: (requestConfig === null || requestConfig === void 0 ? void 0 : (_requestConfig$extraC = requestConfig.extraConfig) === null || _requestConfig$extraC === void 0 ? void 0 : _requestConfig$extraC.readOnly) !== false
17
+ }
12
18
  };
13
19
  }
14
20
 
@@ -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;
@@ -1,14 +1,23 @@
1
+ var _excluded = ["extraConfig"];
2
+
1
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
4
 
3
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
6
 
5
7
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
8
 
9
+ 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; }
10
+
11
+ 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; }
12
+
7
13
  import { isFn, isPureObj, doCommonRequest, getValueByValue } from '@teamix/utils'; // 配置请求
8
14
 
9
- var $request = function $request(field, requestConfig, context, type) {
15
+ var $request = function $request(field, _ref, context, type) {
10
16
  var _field$data;
11
17
 
18
+ var extraConfig = _ref.extraConfig,
19
+ requestConfig = _objectWithoutProperties(_ref, _excluded);
20
+
12
21
  var params = requestConfig.params,
13
22
  beforeRequest = requestConfig.beforeRequest,
14
23
  formatResult = requestConfig.formatResult,
@@ -48,8 +57,8 @@ var $common = function $common(services, requestConfig, context) {
48
57
 
49
58
 
50
59
  var $validator = function $validator(services, requestConfig, context) {
51
- return function (value, rules, _ref) {
52
- var field = _ref.field;
60
+ return function (value, rules, _ref2) {
61
+ var field = _ref2.field;
53
62
  return services(field, requestConfig, context, 'validator').then(function (res) {
54
63
  var _requestConfig$onComp2;
55
64
 
@@ -65,16 +74,16 @@ var $dataSource = function $dataSource(services, requestConfig, context) {
65
74
  loading: true
66
75
  });
67
76
  return services(field, requestConfig, context, 'dataSource').then(function (res) {
68
- var _requestConfig$onComp3;
77
+ var _requestConfig$extraC, _requestConfig$onComp3;
69
78
 
70
79
  var isValueInDataSource = getValueByValue(res, field.value);
71
- var clearValue = isValueInDataSource ? {} : {
80
+ 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 ? {
72
81
  value: undefined
73
- };
82
+ } : {};
74
83
  field.setState(_objectSpread({
75
84
  dataSource: res,
76
85
  loading: false
77
- }, clearValue));
86
+ }, clearResult));
78
87
  return (_requestConfig$onComp3 = requestConfig.onComplete) === null || _requestConfig$onComp3 === void 0 ? void 0 : _requestConfig$onComp3.call(requestConfig, res, field, context);
79
88
  }).catch(function () {
80
89
  field.setState({
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './ActionResponse.less';
3
+ declare type ActionResponseProps = {
4
+ response?: React.ReactNode;
5
+ };
6
+ export declare const ActionResponse: React.FC<ActionResponseProps>;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import './ActionResponse.less';
3
+ export var ActionResponse = function ActionResponse(props) {
4
+ return /*#__PURE__*/React.createElement("div", {
5
+ className: "as-wrapper"
6
+ }, /*#__PURE__*/React.createElement("div", {
7
+ className: "as-actions"
8
+ }, props.children), props.response && /*#__PURE__*/React.createElement("div", {
9
+ className: "as-response"
10
+ }, "Response\uFF1A", props.response));
11
+ };
@@ -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
+ }
@@ -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;
@@ -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/es/form/utils.js CHANGED
@@ -55,6 +55,8 @@ var mapSize = function mapSize(props, field) {
55
55
 
56
56
 
57
57
  var mapStatus = function mapStatus(props, field) {
58
+ var _field$data;
59
+
58
60
  var takeStatus = function takeStatus() {
59
61
  var _field$warnings, _field$decoratorProps, _field$decoratorProps2;
60
62
 
@@ -77,7 +79,7 @@ var mapStatus = function mapStatus(props, field) {
77
79
  state: state
78
80
  }; // 当组件处于loading状态时,仅可读不可写。
79
81
 
80
- if (state === 'loading') {
82
+ if (state === 'loading' && ((_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.readOnlyOnLoading)) {
81
83
  result.readOnly = true;
82
84
  }
83
85
 
package/es/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.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/es/index.js CHANGED
@@ -9,8 +9,8 @@ import ProPageContainer from './page-container';
9
9
  import ProPageHeader from './page-header';
10
10
  import ProTable from './table';
11
11
  import ProSkeleton from './skeleton';
12
- import utils from './utils'; // import ProSidebar from './sidebar'
13
-
12
+ import utils from './utils';
13
+ import ProSidebar from './sidebar';
14
14
  import { ProTimeline } from './timeline';
15
15
  import * as nocode from './nocode';
16
16
  import * as templates from './templates';
@@ -27,10 +27,10 @@ export * from './page-container';
27
27
  export * from './page-header';
28
28
  export * from './skeleton';
29
29
  export * from './table';
30
+ export * from './sidebar';
30
31
  export * from './utils'; // export * from './sidebar';
31
32
 
32
33
  export * from './timeline';
33
- var version = '1.3.3';
34
+ var version = '1.3.6';
34
35
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
35
- ProPageContainer, ProPageHeader, ProSkeleton, ProTable, // ProSidebar,
36
- ProTimeline, hooks, nocode, templates, utils };
36
+ ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils };
@@ -14,13 +14,17 @@ var ProInfoItem = function ProInfoItem(prop) {
14
14
  headerInfoLayout = prop.headerInfoLayout,
15
15
  loading = prop.loading,
16
16
  tooltip = prop.tooltip,
17
- tooltipIcon = prop.tooltipIcon;
17
+ tooltipIcon = prop.tooltipIcon,
18
+ _isLastRow = prop._isLastRow;
18
19
 
19
20
  if (baseInfoLayout) {
20
21
  var labelCol = baseInfoLayout.labelCol,
21
22
  wrapperCol = baseInfoLayout.wrapperCol;
22
23
  return /*#__PURE__*/React.createElement("div", {
23
- className: cls()
24
+ className: cls({
25
+ '': true,
26
+ isLastRow: _isLastRow
27
+ })
24
28
  }, /*#__PURE__*/React.createElement(Row, {
25
29
  gutter: 10,
26
30
  className: cls('base-row')
@@ -17,6 +17,9 @@ $item-padding-bottom: 8px;
17
17
  .teamix-pro-field-info-form-item {
18
18
  width: 100%;
19
19
  padding-bottom: $item-padding-bottom;
20
+ &-isLastRow{
21
+ padding-bottom: unset;
22
+ }
20
23
 
21
24
  &-header-row {
22
25
  display: flex;
@@ -5,7 +5,7 @@ import './index.scss';
5
5
  import { getLayout } from '../../utils/utils';
6
6
  import defaultLayoutMap from '../../utils/layout';
7
7
  import InfoValueItem from '../InfoValueItem';
8
- import { getDataIndexValue } from '../../utils';
8
+ import { getDataIndexValue, isLastRow } from '../../utils';
9
9
  var Row = Grid.Row,
10
10
  Col = Grid.Col;
11
11
 
@@ -65,6 +65,7 @@ var ProBaseInfo = function ProBaseInfo(props) {
65
65
  }, /*#__PURE__*/React.createElement(ProInfoItem, {
66
66
  label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
67
67
  loading: loading,
68
+ _isLastRow: !!isLastRow(columns.length, layoutSpan, index),
68
69
  value: /*#__PURE__*/React.createElement(InfoValueItem, {
69
70
  type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
70
71
  value: getDataIndexValue(item.dataIndex, (_ref = dataSource !== null && dataSource !== void 0 ? dataSource : result) !== null && _ref !== void 0 ? _ref : {}),
@@ -1,6 +1,3 @@
1
- $item-padding-bottom: -8px;
2
- // /** 消除 baseInfo 被其他组件包裹后没有居中的问题*/
3
1
  .teamix-pro-info {
4
2
  width: 100%;
5
- margin-bottom: $item-padding-bottom;
6
3
  }
@@ -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;
@@ -30,4 +30,31 @@ export function getDataIndexValue(dataIndex, dataSource) {
30
30
  }
31
31
 
32
32
  return getDeepValue(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
33
- }
33
+ }
34
+ /**
35
+ * 是否是最后一样的元素
36
+ * @param columnsLength
37
+ * @param layoutSpan
38
+ * @params itemIndex
39
+ * @returns
40
+ */
41
+
42
+ export var isLastRow = function isLastRow(columnsLength, layoutSpan, itemIndex) {
43
+ if (!columnsLength || !layoutSpan) return;
44
+ var lastRowColumnsIndexList = [];
45
+ var rowCount = 24 / layoutSpan;
46
+
47
+ if (columnsLength % rowCount === 0) {
48
+ while (rowCount--) {
49
+ lastRowColumnsIndexList.push(columnsLength--);
50
+ }
51
+ } else {
52
+ var lastRowCount = columnsLength % rowCount;
53
+
54
+ while (lastRowCount--) {
55
+ lastRowColumnsIndexList.push(columnsLength--);
56
+ }
57
+ }
58
+
59
+ return lastRowColumnsIndexList.includes(itemIndex + 1);
60
+ };