@teamix/pro 1.4.12 → 1.4.15
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 +532 -167
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/index.scss +1 -1
- package/es/form/ProForm/index.js +14 -32
- package/es/form/ProForm/index.scss +5 -0
- package/es/form/ProForm/useAutoLayout.d.ts +9 -0
- package/es/form/ProForm/useAutoLayout.js +114 -0
- package/es/form/SchemaForm/index.js +12 -4
- package/es/form/SchemaForm/initializeDataSource.d.ts +3 -0
- package/es/form/SchemaForm/initializeDataSource.js +7 -0
- package/es/form/SchemaForm/initializeFormButton.js +4 -5
- package/es/form/typing.d.ts +4 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/ProInfoItem/index.js +33 -4
- package/es/info/components/ProInfoItem/index.scss +18 -11
- package/es/info/components/baseInfo/index.js +4 -1
- package/es/info/components/baseInfo/index.scss +4 -1
- package/es/info/components/headerInfo/index.js +4 -1
- package/es/info/components/headerInfo/index.scss +3 -0
- package/es/info/components/tableInfo/index.js +2 -1
- package/es/info/index.js +6 -3
- package/es/info/typing.d.ts +3 -1
- package/es/nocode/index.scss +2 -2
- package/es/nocode/pages/playground.js +1 -1
- package/es/nocode/pages/renderer.js +1 -1
- package/es/nocode/playground.js +1 -1
- package/es/table/components/Layout/index.js +8 -4
- package/es/table/components/QuickAction/index.js +1 -1
- package/es/table/index.js +121 -54
- package/es/table/index.scss +5 -0
- package/es/table/typing.d.ts +3 -1
- package/es/table/utils/columnRender.js +2 -1
- package/lib/actions/index.scss +1 -1
- package/lib/form/ProForm/index.js +13 -31
- package/lib/form/ProForm/index.scss +5 -0
- package/lib/form/ProForm/useAutoLayout.d.ts +9 -0
- package/lib/form/ProForm/useAutoLayout.js +124 -0
- package/lib/form/SchemaForm/index.js +11 -3
- package/lib/form/SchemaForm/initializeDataSource.d.ts +3 -0
- package/lib/form/SchemaForm/initializeDataSource.js +10 -2
- package/lib/form/SchemaForm/initializeFormButton.js +3 -4
- package/lib/form/typing.d.ts +4 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/ProInfoItem/index.js +33 -4
- package/lib/info/components/ProInfoItem/index.scss +18 -11
- package/lib/info/components/baseInfo/index.js +4 -1
- package/lib/info/components/baseInfo/index.scss +4 -1
- package/lib/info/components/headerInfo/index.js +4 -1
- package/lib/info/components/headerInfo/index.scss +3 -0
- package/lib/info/components/tableInfo/index.js +3 -1
- package/lib/info/index.js +5 -2
- package/lib/info/typing.d.ts +3 -1
- package/lib/nocode/index.scss +2 -2
- package/lib/nocode/pages/playground.js +1 -1
- package/lib/nocode/pages/renderer.js +1 -1
- package/lib/nocode/playground.js +1 -1
- package/lib/table/components/Layout/index.js +8 -4
- package/lib/table/components/QuickAction/index.js +1 -1
- package/lib/table/index.js +120 -52
- package/lib/table/index.scss +5 -0
- package/lib/table/typing.d.ts +3 -1
- package/lib/table/utils/columnRender.js +2 -1
- package/package.json +1 -1
package/es/actions/index.scss
CHANGED
package/es/form/ProForm/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["form", "initialValues", "initialRequest", "scope", "context", "components", "
|
1
|
+
var _excluded = ["form", "initialValues", "initialRequest", "scope", "context", "components", "onChange", "onChangeType", "onSubmit", "onSubmitFailed", "onInitialComplete", "className", "validateFirst", "schema", "children"];
|
2
2
|
|
3
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; }
|
4
4
|
|
@@ -10,8 +10,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
10
10
|
|
11
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
12
|
|
13
|
-
import React, { memo, useEffect, useMemo } from 'react';
|
14
|
-
import { usePrefixCls, cls, getLanguage, getGlobalConfig
|
13
|
+
import React, { memo, useEffect, useMemo, useRef } from 'react';
|
14
|
+
import { usePrefixCls, cls, getLanguage, getGlobalConfig } from '@teamix/utils';
|
15
15
|
import { createForm, onFieldValueChange, onFormValuesChange, registerValidateLocale, setValidateLanguage } from '@formily/core';
|
16
16
|
import { toJS } from '@formily/reactive';
|
17
17
|
import { Form, Upload, SelectTable, FormLayout, FormItem, ArrayCollapse, ArrayCards, ArrayItems, ArrayTable, Space, FormGrid, FormTab, FormCollapse, FormStep, Editable, FormDialog, FormDrawer, FormButtonGroup, Submit, Reset } from '@teamix/formily';
|
@@ -22,8 +22,8 @@ import FormGroup from '../Components/FormGroup';
|
|
22
22
|
import LightFilter from '../Components/LightFilter';
|
23
23
|
import Text from '../Components/Text/index';
|
24
24
|
import SchemaForm from '../SchemaForm';
|
25
|
-
import { mergeArrayValue } from '../utils';
|
26
25
|
import useAutoSubmit from './useAutoSubmit';
|
26
|
+
import useAutoLayout from './useAutoLayout';
|
27
27
|
import useInitialRequest from './useInitialRequest';
|
28
28
|
import validateLocale from '../locales/validate';
|
29
29
|
import './index.scss';
|
@@ -63,12 +63,6 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
63
63
|
scope = _ref.scope,
|
64
64
|
context = _ref.context,
|
65
65
|
components = _ref.components,
|
66
|
-
layout = _ref.layout,
|
67
|
-
labelAlign = _ref.labelAlign,
|
68
|
-
wrapperAlign = _ref.wrapperAlign,
|
69
|
-
labelCol = _ref.labelCol,
|
70
|
-
wrapperCol = _ref.wrapperCol,
|
71
|
-
breakpoints = _ref.breakpoints,
|
72
66
|
onChange = _ref.onChange,
|
73
67
|
onChangeType = _ref.onChangeType,
|
74
68
|
onSubmit = _ref.onSubmit,
|
@@ -80,7 +74,8 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
80
74
|
children = _ref.children,
|
81
75
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
82
76
|
|
83
|
-
// 获取全局配置
|
77
|
+
var formRef = useRef(); // 获取全局配置
|
78
|
+
|
84
79
|
var _ref2 = getGlobalConfig('ProForm') || {},
|
85
80
|
globalComponents = _ref2.components,
|
86
81
|
globalScope = _ref2.scope;
|
@@ -98,25 +93,10 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
98
93
|
|
99
94
|
var mergedComponents = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, globalComponents), components), formilyComponents), ProFieldComponents);
|
100
95
|
|
101
|
-
var onAutoSubmit = useAutoSubmit(onSubmit, context);
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
breakpoints: [480],
|
106
|
-
layout: mergeArrayValue(['vertical'], layout),
|
107
|
-
labelAlign: mergeArrayValue(['left'], labelAlign),
|
108
|
-
wrapperAlign: mergeArrayValue(['left'], wrapperAlign),
|
109
|
-
labelCol: mergeArrayValue([24], labelCol),
|
110
|
-
wrapperCol: mergeArrayValue([24], wrapperCol)
|
111
|
-
} : {
|
112
|
-
breakpoints: isBool(breakpoints) ? undefined : breakpoints,
|
113
|
-
layout: layout,
|
114
|
-
labelAlign: labelAlign,
|
115
|
-
wrapperAlign: wrapperAlign,
|
116
|
-
labelCol: labelCol,
|
117
|
-
wrapperCol: wrapperCol
|
118
|
-
};
|
119
|
-
}, [breakpoints, layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
96
|
+
var onAutoSubmit = useAutoSubmit(onSubmit, context);
|
97
|
+
var autoTeamixLayout = useAutoLayout(_objectSpread(_objectSpread({}, otherProps), {}, {
|
98
|
+
schema: schema
|
99
|
+
}), formRef);
|
120
100
|
useMemo(function () {
|
121
101
|
// 配置表单默认值
|
122
102
|
if (initialValues) {
|
@@ -157,7 +137,7 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
157
137
|
}, []);
|
158
138
|
return /*#__PURE__*/React.createElement(Form, _objectSpread(_objectSpread(_objectSpread({
|
159
139
|
className: cls(prefixCls(), className)
|
160
|
-
}, otherProps),
|
140
|
+
}, otherProps), autoTeamixLayout), {}, {
|
161
141
|
form: form,
|
162
142
|
onAutoSubmit: onAutoSubmit,
|
163
143
|
onAutoSubmitFailed: onSubmitFailed
|
@@ -165,7 +145,9 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
165
145
|
schema: schema,
|
166
146
|
scope: mergedScope,
|
167
147
|
components: mergedComponents
|
168
|
-
}) : null,
|
148
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
149
|
+
ref: formRef
|
150
|
+
}), children);
|
169
151
|
});
|
170
152
|
ProForm.defaultProps = {
|
171
153
|
colon: false,
|
@@ -236,6 +236,11 @@
|
|
236
236
|
}
|
237
237
|
|
238
238
|
// 按钮样式
|
239
|
+
.teamix-button-group-item.#{$form-item-cls}-layout-vertical {
|
240
|
+
> .#{$css-prefix}formily-item-label {
|
241
|
+
display: none;
|
242
|
+
}
|
243
|
+
}
|
239
244
|
.#{$css-prefix}formily-button-group {
|
240
245
|
margin-top: var(--form-element-medium-height, 32px);
|
241
246
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
declare const useAutoLayout: ({ breakpoints: outBreakpoints, layout, labelAlign, wrapperAlign, labelCol: outLabelCol, wrapperCol: outWrapperCol, autoLayout, schema, }: any, formRef: any) => {
|
2
|
+
breakpoints: any;
|
3
|
+
layout: any;
|
4
|
+
labelAlign: any;
|
5
|
+
wrapperAlign: any;
|
6
|
+
labelCol: any;
|
7
|
+
wrapperCol: any;
|
8
|
+
};
|
9
|
+
export default useAutoLayout;
|
@@ -0,0 +1,114 @@
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
+
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
6
|
+
|
7
|
+
function _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; }
|
8
|
+
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
10
|
+
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
+
|
13
|
+
import { useEffect, useMemo, useState } from 'react';
|
14
|
+
import { isPlainObj, isBool, autoWidthBySpace, getWidthByCharacterMap, isStr } from '@teamix/utils';
|
15
|
+
import { mergeArrayValue } from '../utils';
|
16
|
+
|
17
|
+
var useAutoLayout = function useAutoLayout(_ref, formRef) {
|
18
|
+
var outBreakpoints = _ref.breakpoints,
|
19
|
+
layout = _ref.layout,
|
20
|
+
labelAlign = _ref.labelAlign,
|
21
|
+
wrapperAlign = _ref.wrapperAlign,
|
22
|
+
outLabelCol = _ref.labelCol,
|
23
|
+
outWrapperCol = _ref.wrapperCol,
|
24
|
+
autoLayout = _ref.autoLayout,
|
25
|
+
schema = _ref.schema;
|
26
|
+
|
27
|
+
var _ref2 = isPlainObj(autoLayout) ? autoLayout : {
|
28
|
+
autoLabel: autoLayout
|
29
|
+
},
|
30
|
+
autoLabel = _ref2.autoLabel;
|
31
|
+
|
32
|
+
var breakpoints = useMemo(function () {
|
33
|
+
return autoLabel ? false : breakpoints;
|
34
|
+
}, []); // 当前断点不支持Col更新
|
35
|
+
|
36
|
+
var _useState = useState({
|
37
|
+
labelCol: outLabelCol,
|
38
|
+
wrapperCol: outWrapperCol
|
39
|
+
}),
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
41
|
+
autoCol = _useState2[0],
|
42
|
+
setAutoCol = _useState2[1];
|
43
|
+
|
44
|
+
var labelCol = autoCol.labelCol,
|
45
|
+
wrapperCol = autoCol.wrapperCol;
|
46
|
+
useEffect(function () {
|
47
|
+
/**
|
48
|
+
* autolayout
|
49
|
+
*/
|
50
|
+
if (autoLabel) {
|
51
|
+
var formWidth = formRef.current.getBoundingClientRect().width; // 表单宽度
|
52
|
+
|
53
|
+
var labelArray = schema.map(function (item) {
|
54
|
+
var text = item.title;
|
55
|
+
|
56
|
+
if (isStr(text)) {
|
57
|
+
var _item$decoratorProps;
|
58
|
+
|
59
|
+
if (item.required) {
|
60
|
+
text += '一'; // 必填 + 12
|
61
|
+
}
|
62
|
+
|
63
|
+
if ((_item$decoratorProps = item.decoratorProps) === null || _item$decoratorProps === void 0 ? void 0 : _item$decoratorProps.tooltip) {
|
64
|
+
text += '一'; // 提示 + 18
|
65
|
+
}
|
66
|
+
|
67
|
+
return text;
|
68
|
+
}
|
69
|
+
|
70
|
+
return '';
|
71
|
+
}); // 标题内容集合
|
72
|
+
|
73
|
+
var labelWidthArray = getWidthByCharacterMap(labelArray); // 标题宽度集合
|
74
|
+
|
75
|
+
var _autoWidthBySpace = autoWidthBySpace(labelWidthArray),
|
76
|
+
expectedWidth = _autoWidthBySpace.expectedWidth,
|
77
|
+
consoleArray = _autoWidthBySpace.consoleArray; // 智能计算预期宽度
|
78
|
+
|
79
|
+
|
80
|
+
var expectedCol = Math.ceil(expectedWidth / formWidth * 24); // 预期宽度转换为 Col 值
|
81
|
+
|
82
|
+
setAutoCol({
|
83
|
+
labelCol: expectedCol,
|
84
|
+
wrapperCol: wrapperCol
|
85
|
+
});
|
86
|
+
} else {
|
87
|
+
setAutoCol({
|
88
|
+
labelCol: outLabelCol,
|
89
|
+
wrapperCol: outWrapperCol
|
90
|
+
});
|
91
|
+
}
|
92
|
+
}, [outLabelCol, outWrapperCol]); // Layout配置By断点(配置断点后,目前不支持 Col 更新)
|
93
|
+
|
94
|
+
var autoTeamixLayout = useMemo(function () {
|
95
|
+
return breakpoints === true ? {
|
96
|
+
breakpoints: [480],
|
97
|
+
layout: mergeArrayValue(['vertical'], layout),
|
98
|
+
labelAlign: mergeArrayValue(['left'], labelAlign),
|
99
|
+
wrapperAlign: mergeArrayValue(['left'], wrapperAlign),
|
100
|
+
labelCol: mergeArrayValue([24], labelCol),
|
101
|
+
wrapperCol: mergeArrayValue([24], wrapperCol)
|
102
|
+
} : {
|
103
|
+
breakpoints: isBool(breakpoints) ? undefined : breakpoints,
|
104
|
+
layout: layout,
|
105
|
+
labelAlign: labelAlign,
|
106
|
+
wrapperAlign: wrapperAlign,
|
107
|
+
labelCol: labelCol,
|
108
|
+
wrapperCol: wrapperCol
|
109
|
+
};
|
110
|
+
}, [breakpoints, layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
111
|
+
return autoTeamixLayout;
|
112
|
+
};
|
113
|
+
|
114
|
+
export default useAutoLayout;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["
|
1
|
+
var _excluded = ["type", "name", "component", "props", "decorator", "decoratorProps", "dataSource", "reactions", "rules", "children", "items", "tooltip", "request", "data"];
|
2
2
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
4
|
|
@@ -32,7 +32,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
32
32
|
|
33
33
|
import React, { memo, useCallback, useRef, useMemo } from 'react';
|
34
34
|
import { createSchemaField } from '@formily/react';
|
35
|
-
import { isUsable } from '@teamix/utils';
|
35
|
+
import { cls, isUsable } from '@teamix/utils';
|
36
36
|
import adapterType from './adapterType';
|
37
37
|
import adapterComponent from './adapterComponent';
|
38
38
|
import adapterDecorator from './adapterDecorator';
|
@@ -134,9 +134,10 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
134
134
|
}
|
135
135
|
|
136
136
|
var _newItem2 = newItem,
|
137
|
-
component = _newItem2.component,
|
138
137
|
type = _newItem2.type,
|
139
138
|
name = _newItem2.name,
|
139
|
+
component = _newItem2.component,
|
140
|
+
props = _newItem2.props,
|
140
141
|
decorator = _newItem2.decorator,
|
141
142
|
decoratorProps = _newItem2.decoratorProps,
|
142
143
|
dataSource = _newItem2.dataSource,
|
@@ -172,7 +173,8 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
172
173
|
defaultDataSource = _initializeDataSource.dataSource,
|
173
174
|
dataSourceReactions = _initializeDataSource.reactions,
|
174
175
|
dataSourceScope = _initializeDataSource.scope,
|
175
|
-
dataSourceData = _initializeDataSource.data
|
176
|
+
dataSourceData = _initializeDataSource.data,
|
177
|
+
dataSourceProps = _initializeDataSource.props; // 初始化rules validator
|
176
178
|
|
177
179
|
|
178
180
|
var _initializeRules = initializeRules(rules, "".concat(suffix, "v")),
|
@@ -188,10 +190,16 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
188
190
|
v = _ref3[1];
|
189
191
|
|
190
192
|
schemaScopeRef.current[k] = v;
|
193
|
+
}); // 合并字段属性
|
194
|
+
|
195
|
+
var defaultProps = _objectSpread(_objectSpread(_objectSpread({}, props), dataSourceProps), {}, {
|
196
|
+
className: cls(props === null || props === void 0 ? void 0 : props.className, dataSourceProps === null || dataSourceProps === void 0 ? void 0 : dataSourceProps.className)
|
191
197
|
});
|
198
|
+
|
192
199
|
var formatParam = mapSchemaName(_objectSpread(_objectSpread({}, otherProps), {}, {
|
193
200
|
type: defaultType,
|
194
201
|
component: component,
|
202
|
+
props: defaultProps,
|
195
203
|
decorator: defaultDecorator,
|
196
204
|
decoratorProps: defaultDecoratorProps,
|
197
205
|
rules: defaultRules,
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { getTestRequestParams, getTestRequestData } from '@teamix/utils';
|
1
2
|
import { initializeRequestExpression } from '../utils';
|
2
3
|
|
3
4
|
var initializeDataSource = function initializeDataSource(dataSource, suffix) {
|
@@ -12,6 +13,12 @@ var initializeDataSource = function initializeDataSource(dataSource, suffix) {
|
|
12
13
|
scope: scope,
|
13
14
|
data: {
|
14
15
|
readOnlyOnLoading: (dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$extraConf = dataSource.extraConfig) === null || _dataSource$extraConf === void 0 ? void 0 : _dataSource$extraConf.readOnly) !== false
|
16
|
+
},
|
17
|
+
props: {
|
18
|
+
className: 'teamix-test-request',
|
19
|
+
'data-teamix-test-request': "url=".concat(dataSource === null || dataSource === void 0 ? void 0 : dataSource.url, "&formatResult=").concat(!!(dataSource === null || dataSource === void 0 ? void 0 : dataSource.formatResult)),
|
20
|
+
'data-teamix-test-params': getTestRequestParams(dataSource === null || dataSource === void 0 ? void 0 : dataSource.params),
|
21
|
+
'data-teamix-test-data': getTestRequestData('dataSource')
|
15
22
|
}
|
16
23
|
} : {
|
17
24
|
reactions: [],
|
@@ -10,7 +10,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
10
10
|
|
11
11
|
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; }
|
12
12
|
|
13
|
-
import { getMessage } from '@teamix/utils';
|
13
|
+
import { getMessage, cls } from '@teamix/utils';
|
14
14
|
|
15
15
|
var initializeButton = function initializeButton(item) {
|
16
16
|
var component = item.component,
|
@@ -45,15 +45,14 @@ var initialize = function initialize(item) {
|
|
45
45
|
return initializeButton(item);
|
46
46
|
}
|
47
47
|
|
48
|
-
var commonMode = _objectSpread(_objectSpread({
|
49
|
-
title: ' '
|
50
|
-
}, item), {}, {
|
48
|
+
var commonMode = _objectSpread(_objectSpread({}, item), {}, {
|
51
49
|
component: component,
|
52
50
|
props: otherProps,
|
53
51
|
decorator: 'FormButtonGroup.FormItem',
|
54
52
|
decoratorProps: _objectSpread({
|
55
53
|
inset: false,
|
56
|
-
fullness: true
|
54
|
+
fullness: true,
|
55
|
+
className: cls('teamix-button-group-item', decoratorProps === null || decoratorProps === void 0 ? void 0 : decoratorProps.className)
|
57
56
|
}, decoratorProps)
|
58
57
|
}); // 吸底模式
|
59
58
|
|
package/es/form/typing.d.ts
CHANGED
@@ -59,6 +59,9 @@ export interface ProFormSchemaItem {
|
|
59
59
|
data?: AnyObject;
|
60
60
|
}
|
61
61
|
export declare type ProFormSchema = ProFormSchemaItem[];
|
62
|
+
interface AutoLayout {
|
63
|
+
autoLabel?: boolean;
|
64
|
+
}
|
62
65
|
export interface ProFormProps extends Omit<IFormLayoutProps, 'breakpoints'> {
|
63
66
|
form?: FormType | false;
|
64
67
|
schema?: ProFormSchema;
|
@@ -78,6 +81,7 @@ export interface ProFormProps extends Omit<IFormLayoutProps, 'breakpoints'> {
|
|
78
81
|
onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
|
79
82
|
onInitialComplete?: (form: FormType) => void;
|
80
83
|
breakpoints?: number[] | boolean;
|
84
|
+
autoLayout?: AutoLayout | boolean;
|
81
85
|
}
|
82
86
|
export interface FilterProps extends ProFormProps {
|
83
87
|
form: FormType;
|
package/es/index.d.ts
CHANGED
@@ -28,5 +28,5 @@ export * from './table';
|
|
28
28
|
export * from './sidebar';
|
29
29
|
export * from './utils';
|
30
30
|
export * from './timeline';
|
31
|
-
declare const version = "1.4.
|
31
|
+
declare const version = "1.4.15";
|
32
32
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -36,6 +36,6 @@ export * from './table';
|
|
36
36
|
export * from './sidebar';
|
37
37
|
export * from './utils';
|
38
38
|
export * from './timeline';
|
39
|
-
var version = '1.4.
|
39
|
+
var version = '1.4.15';
|
40
40
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
41
41
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils };
|
@@ -4,7 +4,7 @@ import { usePrefixCls } from '@teamix/utils';
|
|
4
4
|
import React from 'react';
|
5
5
|
import { Ellipsis, LabelIconTip } from '../../../field';
|
6
6
|
import './index.scss';
|
7
|
-
var cls = usePrefixCls('teamix-pro-
|
7
|
+
var cls = usePrefixCls('teamix-pro-info-item');
|
8
8
|
var Row = Grid.Row,
|
9
9
|
Col = Grid.Col;
|
10
10
|
|
@@ -15,7 +15,26 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
15
15
|
headerInfoLayout = prop.headerInfoLayout,
|
16
16
|
loading = prop.loading,
|
17
17
|
tooltip = prop.tooltip,
|
18
|
-
tooltipIcon = prop.tooltipIcon
|
18
|
+
tooltipIcon = prop.tooltipIcon,
|
19
|
+
valueType = prop.valueType,
|
20
|
+
render = prop.render,
|
21
|
+
alignItems = prop.alignItems; // 判断是否需要居中
|
22
|
+
|
23
|
+
var isAlignItemsCenter = function isAlignItemsCenter() {
|
24
|
+
if (typeof render !== 'function') {
|
25
|
+
var type = render === null || render === void 0 ? void 0 : render.type;
|
26
|
+
|
27
|
+
if (valueType === 'selectGroup') {
|
28
|
+
return true;
|
29
|
+
}
|
30
|
+
|
31
|
+
if (type === 'tag' || type === 'statusIconTag' || type === 'eventLevelTag' || type === 'warningLevelTag') {
|
32
|
+
return true;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
return false;
|
37
|
+
};
|
19
38
|
|
20
39
|
if (baseInfoLayout) {
|
21
40
|
var labelCol = baseInfoLayout.labelCol,
|
@@ -24,7 +43,13 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
24
43
|
className: cls('')
|
25
44
|
}, /*#__PURE__*/React.createElement(Row, {
|
26
45
|
gutter: 10,
|
27
|
-
className: cls(
|
46
|
+
className: cls({
|
47
|
+
'base-row': true,
|
48
|
+
'base-row-center': isAlignItemsCenter()
|
49
|
+
}),
|
50
|
+
style: alignItems ? {
|
51
|
+
alignItems: alignItems
|
52
|
+
} : {}
|
28
53
|
}, /*#__PURE__*/React.createElement(Col, {
|
29
54
|
span: labelCol === null || labelCol === void 0 ? void 0 : labelCol.span,
|
30
55
|
className: cls('label')
|
@@ -48,7 +73,11 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
48
73
|
return /*#__PURE__*/React.createElement("div", {
|
49
74
|
className: cls()
|
50
75
|
}, /*#__PURE__*/React.createElement(Row, {
|
51
|
-
className: cls(
|
76
|
+
className: cls({
|
77
|
+
'header-row': true,
|
78
|
+
'header-row-center': isAlignItemsCenter()
|
79
|
+
}),
|
80
|
+
style: {}
|
52
81
|
}, /*#__PURE__*/React.createElement("div", {
|
53
82
|
className: cls('header-label')
|
54
83
|
}, /*#__PURE__*/React.createElement(LabelIconTip, {
|
@@ -14,43 +14,50 @@ $header-text-size: var(--font-size-body-1, 12px);
|
|
14
14
|
|
15
15
|
$item-padding-bottom: 8px;
|
16
16
|
|
17
|
-
.teamix-pro-
|
17
|
+
.teamix-pro-info-item {
|
18
18
|
width: 100%;
|
19
19
|
padding-bottom: $item-padding-bottom;
|
20
20
|
&-header-row {
|
21
21
|
display: flex;
|
22
|
-
align-items:
|
22
|
+
align-items: flex-start;
|
23
|
+
|
24
|
+
&-center {
|
25
|
+
align-items: center;
|
26
|
+
}
|
23
27
|
}
|
24
28
|
&-base-row {
|
25
29
|
display: flex;
|
26
|
-
align-items:
|
30
|
+
align-items: flex-start;
|
31
|
+
&-center {
|
32
|
+
align-items: center;
|
33
|
+
}
|
27
34
|
}
|
28
35
|
}
|
29
36
|
|
30
|
-
.teamix-pro-
|
37
|
+
.teamix-pro-info-item-label {
|
31
38
|
color: $label-color;
|
32
39
|
font-size: $label-size;
|
33
40
|
// font-weight: $label-weight;
|
34
41
|
display: unset;
|
35
42
|
}
|
36
43
|
|
37
|
-
.teamix-pro-
|
44
|
+
.teamix-pro-info-item-value {
|
38
45
|
color: $text-color;
|
39
46
|
font-size: $text-size;
|
40
|
-
display: unset;
|
47
|
+
//display: unset;
|
41
48
|
width: 100%;
|
42
49
|
padding-right: 20px;
|
43
50
|
}
|
44
51
|
|
45
|
-
.teamix-pro-
|
52
|
+
.teamix-pro-info-item-header-label {
|
46
53
|
color: $header-label-color;
|
47
54
|
font-size: $header-label-size;
|
48
55
|
// font-weight: $header-label-weight;
|
49
56
|
display: inline-block;
|
50
|
-
white-space:nowrap;
|
57
|
+
white-space: nowrap;
|
51
58
|
}
|
52
59
|
|
53
|
-
.teamix-pro-
|
60
|
+
.teamix-pro-info-item-header-value {
|
54
61
|
color: $header-text-color;
|
55
62
|
font-size: $header-text-size;
|
56
63
|
display: inline-block;
|
@@ -58,9 +65,9 @@ $item-padding-bottom: 8px;
|
|
58
65
|
padding-right: 20px;
|
59
66
|
}
|
60
67
|
|
61
|
-
.teamix-pro-
|
68
|
+
.teamix-pro-info-item-base-skeleton-box {
|
62
69
|
width: 100%;
|
63
|
-
height:
|
70
|
+
height: 18px;
|
64
71
|
display: flex;
|
65
72
|
align-items: center;
|
66
73
|
span {
|
@@ -78,7 +78,10 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
78
78
|
}),
|
79
79
|
baseInfoLayout: getFormItemLayout((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 0),
|
80
80
|
tooltip: item.tooltip,
|
81
|
-
tooltipIcon: item.tooltipIcon
|
81
|
+
tooltipIcon: item.tooltipIcon,
|
82
|
+
render: item.render,
|
83
|
+
valueType: item.valueType,
|
84
|
+
alignItems: item.alignItems
|
82
85
|
}));
|
83
86
|
});
|
84
87
|
};
|
@@ -55,7 +55,10 @@ var ProHeaderInfo = function ProHeaderInfo(props) {
|
|
55
55
|
}),
|
56
56
|
headerInfoLayout: layout !== null && layout !== void 0 ? layout : defaultLayout,
|
57
57
|
tooltip: item.tooltip,
|
58
|
-
tooltipIcon: item.tooltipIcon
|
58
|
+
tooltipIcon: item.tooltipIcon,
|
59
|
+
render: item.render,
|
60
|
+
valueType: item.valueType,
|
61
|
+
alignItems: item.alignItems
|
59
62
|
}));
|
60
63
|
});
|
61
64
|
};
|
@@ -24,6 +24,7 @@ import { LabelIconTip } from '../../../field';
|
|
24
24
|
import InfoValueItem from '../InfoValueItem';
|
25
25
|
import { ProSkeletonRaw } from '../../..';
|
26
26
|
import { getDataIndexValue } from '../../utils';
|
27
|
+
import cloneDeep from 'lodash.clonedeep';
|
27
28
|
|
28
29
|
var ProTableInfo = function ProTableInfo(props) {
|
29
30
|
var columns = props.columns,
|
@@ -72,7 +73,7 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
72
73
|
|
73
74
|
var newDataSource = useMemo(function () {
|
74
75
|
var nResult = [];
|
75
|
-
var columnsCopy =
|
76
|
+
var columnsCopy = cloneDeep(columns); // 取当前行的数据。直到取完
|
76
77
|
|
77
78
|
while (columnsCopy.length > 0) {
|
78
79
|
var filterColumns = [];
|
package/es/info/index.js
CHANGED
@@ -30,7 +30,7 @@ import ProBaseInfo from './components/baseInfo';
|
|
30
30
|
import ProInfoGroup from './components/InfoGroup';
|
31
31
|
import './index.scss';
|
32
32
|
import { ProInfoGroupContext, useActionType } from './utils';
|
33
|
-
import { doCommonRequest } from '@teamix/utils';
|
33
|
+
import { doCommonRequest, cls, getTestRequestData, getTestRequestParams } from '@teamix/utils';
|
34
34
|
import { useSize } from '@teamix/hooks';
|
35
35
|
import { ProCard } from '..';
|
36
36
|
export * from './typing';
|
@@ -162,8 +162,11 @@ var ProInfo = function ProInfo(props) {
|
|
162
162
|
|
163
163
|
return /*#__PURE__*/React.createElement("div", {
|
164
164
|
ref: ref,
|
165
|
-
|
166
|
-
|
165
|
+
style: style,
|
166
|
+
className: cls('teamix-pro-info', className, 'teamix-test-request'),
|
167
|
+
"data-teamix-test-request": "url=".concat(url, "&formatResult=").concat(!!formatResult),
|
168
|
+
"data-teamix-test-params": getTestRequestParams(params),
|
169
|
+
"data-teamix-test-data": getTestRequestData(columns)
|
167
170
|
}, /*#__PURE__*/React.createElement(ProCard, _objectSpread(_objectSpread(_objectSpread({
|
168
171
|
compacted: true,
|
169
172
|
hoveredShadow: false,
|
package/es/info/typing.d.ts
CHANGED
@@ -96,6 +96,8 @@ export interface ProInfoColumnsProps {
|
|
96
96
|
extra?: React.ReactNode;
|
97
97
|
/** 其他 ProField 配置 */
|
98
98
|
props?: any;
|
99
|
+
/** 对齐方式 **/
|
100
|
+
alignItems?: 'center' | 'flex-start' | 'flex-end' | string;
|
99
101
|
}
|
100
102
|
export declare type ProInfoActionType = {
|
101
103
|
/** 刷新Info */
|
@@ -113,7 +115,7 @@ export declare type IProProInfoItem = {
|
|
113
115
|
headerInfoLayout?: ProHeaderInfoLayoutProps;
|
114
116
|
/** loading 状态 */
|
115
117
|
loading?: boolean;
|
116
|
-
} & Pick<ProInfoColumnsProps, 'tooltip' | 'tooltipIcon'>;
|
118
|
+
} & Pick<ProInfoColumnsProps, 'tooltip' | 'tooltipIcon' | 'render' | 'valueType' | 'alignItems'>;
|
117
119
|
/** header info 定义 */
|
118
120
|
export declare type IProHeaderInfo = {
|
119
121
|
/** 布局值 */
|
package/es/nocode/index.scss
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
.teamix-nocode {
|
1
|
+
.teamix-pro-nocode {
|
2
2
|
&-empty {
|
3
3
|
display: flex;
|
4
4
|
flex-direction: column;
|
@@ -75,7 +75,7 @@
|
|
75
75
|
right: 20px;
|
76
76
|
bottom: 20px;
|
77
77
|
|
78
|
-
|
78
|
+
& > i {
|
79
79
|
cursor: pointer;
|
80
80
|
color: var(--color-text1-8, #848484);
|
81
81
|
background-color: rgba(0, 0, 0, 0.06);
|
@@ -26,7 +26,7 @@ import { useAction } from '../../actions';
|
|
26
26
|
import { initConfigurator } from '../configurators';
|
27
27
|
import { ComponentConfiguratorMap } from '../configurators/map';
|
28
28
|
import { PlayGroundLayout } from '../playground';
|
29
|
-
var cls = usePrefixCls('teamix-nocode');
|
29
|
+
var cls = usePrefixCls('teamix-pro-nocode');
|
30
30
|
export var PagePlayground = function PagePlayground(props) {
|
31
31
|
var _useState = useState(undefined),
|
32
32
|
_useState2 = _slicedToArray(_useState, 2),
|