@teamix/pro 1.4.4 → 1.4.7
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-without-icon.min.css +1 -0
- package/dist/pro-without-icon.min.js +2 -0
- package/dist/pro-without-icon.min.js.LICENSE.txt +34 -0
- package/dist/pro.css +1 -1
- package/dist/pro.js +1073 -776
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.js +18 -11
- package/es/card/index.js +2 -3
- package/es/card/index.scss +2 -2
- package/es/form/Components/LightFilter/index.js +7 -2
- package/es/form/Components/LightFilter/index.scss +5 -0
- package/es/form/Filter/index.js +5 -4
- package/es/form/ProForm/index.js +1 -1
- package/es/form/ProForm/index.scss +13 -4
- package/es/form/SchemaForm/index.js +8 -4
- package/es/form/SchemaForm/initializeFormButton.js +4 -4
- package/es/form/index.d.ts +8 -7
- package/es/index-without-icon.d.ts +32 -0
- package/es/index-without-icon.js +35 -0
- package/es/index.d.ts +3 -2
- package/es/index.js +2 -2
- package/es/page-header/index.js +3 -1
- package/es/table/components/Pagination/index.js +3 -3
- package/es/table/index.js +1 -1
- package/es/table/utils/genProColumnToColumn.d.ts +5 -1
- package/es/table/utils/genProColumnToColumn.js +3 -1
- package/lib/actions/dialog-form.js +17 -10
- package/lib/card/index.js +2 -3
- package/lib/card/index.scss +2 -2
- package/lib/form/Components/LightFilter/index.js +6 -1
- package/lib/form/Components/LightFilter/index.scss +5 -0
- package/lib/form/Filter/index.js +5 -4
- package/lib/form/ProForm/index.js +1 -1
- package/lib/form/ProForm/index.scss +13 -4
- package/lib/form/SchemaForm/index.js +11 -6
- package/lib/form/SchemaForm/initializeFormButton.js +4 -5
- package/lib/form/index.d.ts +8 -7
- package/lib/index-without-icon.d.ts +32 -0
- package/lib/index-without-icon.js +316 -0
- package/lib/index.d.ts +3 -2
- package/lib/index.js +9 -2
- package/lib/page-header/index.js +3 -1
- package/lib/table/components/Pagination/index.js +3 -3
- package/lib/table/index.js +1 -1
- package/lib/table/utils/genProColumnToColumn.d.ts +5 -1
- package/lib/table/utils/genProColumnToColumn.js +4 -1
- package/package.json +3 -5
@@ -29,7 +29,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
29
29
|
|
30
30
|
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; }
|
31
31
|
|
32
|
-
import React, { useState, useEffect, createRef } from 'react';
|
32
|
+
import React, { useState, useEffect, createRef, useMemo } from 'react';
|
33
33
|
import { useHistory } from 'react-router-dom';
|
34
34
|
import { Loading } from '@alicloudfe/components';
|
35
35
|
import ProForm, { createForm } from '../form';
|
@@ -93,15 +93,22 @@ var DialogForm = function DialogForm(props) {
|
|
93
93
|
innerFormRef = props.innerFormRef,
|
94
94
|
_props$validateFirst = props.validateFirst,
|
95
95
|
validateFirst = _props$validateFirst === void 0 ? true : _props$validateFirst;
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
96
|
+
var form = useMemo(function () {
|
97
|
+
return createForm({
|
98
|
+
initialValues: getTargetValue(initialValues, context),
|
99
|
+
validateFirst: validateFirst
|
100
|
+
});
|
101
|
+
}, [validateFirst, initialValues, context]);
|
102
|
+
|
103
|
+
var _useMemo = useMemo(function () {
|
104
|
+
return getSchemaAndFormProps(schema, formProps);
|
105
|
+
}, [schema, formProps]),
|
106
|
+
formSchema = _useMemo.schema,
|
107
|
+
others = _objectWithoutProperties(_useMemo, _excluded);
|
108
|
+
|
109
|
+
var otherFormProps = useMemo(function () {
|
110
|
+
return addContext(getTargetValue(others, context), context);
|
111
|
+
}, [context, JSON.stringify(others)]);
|
105
112
|
|
106
113
|
var _useState = useState(false),
|
107
114
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -134,7 +141,7 @@ var DialogForm = function DialogForm(props) {
|
|
134
141
|
}, /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({
|
135
142
|
form: form,
|
136
143
|
schema: formSchema
|
137
|
-
}, getDefaultFormPropsByDialogSize(size)),
|
144
|
+
}, getDefaultFormPropsByDialogSize(size)), otherFormProps)));
|
138
145
|
};
|
139
146
|
|
140
147
|
export function useDialogFormAction(action, context) {
|
package/es/card/index.js
CHANGED
@@ -226,8 +226,7 @@ export var ProCard = function ProCard(props) {
|
|
226
226
|
value: description,
|
227
227
|
type: "text",
|
228
228
|
render: {
|
229
|
-
ellipsis: true
|
230
|
-
tooltip: description
|
229
|
+
ellipsis: true
|
231
230
|
}
|
232
231
|
})));
|
233
232
|
};
|
@@ -249,7 +248,7 @@ export var ProCard = function ProCard(props) {
|
|
249
248
|
padding: 0,
|
250
249
|
margin: 0
|
251
250
|
} : {}
|
252
|
-
}, (loading || contentLoading) && /*#__PURE__*/React.createElement(ProSkeletonRaw.Card.Content, null), !loading && /*#__PURE__*/React.createElement("div", {
|
251
|
+
}, (loading || contentLoading) && /*#__PURE__*/React.createElement(ProSkeletonRaw.Card.Content, null), !(loading || contentLoading) && /*#__PURE__*/React.createElement("div", {
|
253
252
|
className: cardContentClassName,
|
254
253
|
style: cardContentStyle
|
255
254
|
}, empty && /*#__PURE__*/React.createElement("div", {
|
package/es/card/index.scss
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
$grid-columns: 24;
|
33
33
|
@for $i from 1 through $grid-columns {
|
34
34
|
&-#{$i} {
|
35
|
-
$width: percentage($i
|
35
|
+
$width: percentage($i / $grid-columns);
|
36
36
|
flex: 0 0 $width;
|
37
37
|
width: $width;
|
38
38
|
max-width: $width;
|
@@ -52,7 +52,7 @@
|
|
52
52
|
}
|
53
53
|
}
|
54
54
|
|
55
|
-
&-name{
|
55
|
+
&-name {
|
56
56
|
flex-shrink: 0;
|
57
57
|
}
|
58
58
|
|
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
16
16
|
|
17
17
|
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; }
|
18
18
|
|
19
|
-
import React, { useState, useCallback, useContext } from 'react';
|
19
|
+
import React, { useState, useCallback, useContext, useEffect } from 'react';
|
20
20
|
import { observer, useFieldSchema, RecursionField, SchemaExpressionScopeContext } from '@formily/react';
|
21
21
|
import { Select, Button } from '@alicloudfe/components';
|
22
22
|
import TeamixIcon from '@teamix/icon';
|
@@ -113,6 +113,11 @@ var LightFilter = observer(function (props) {
|
|
113
113
|
setActive(value);
|
114
114
|
onFilterChange && onFilterChange(value);
|
115
115
|
}, [onFilterChange]);
|
116
|
+
useEffect(function () {
|
117
|
+
if (!filterItems.length) {
|
118
|
+
setActive(undefined);
|
119
|
+
}
|
120
|
+
}, [filterItems.length]);
|
116
121
|
return /*#__PURE__*/React.createElement("span", {
|
117
122
|
className: cls(basePrefix(size), prefixCls({
|
118
123
|
'': true,
|
@@ -121,7 +126,7 @@ var LightFilter = observer(function (props) {
|
|
121
126
|
}, /*#__PURE__*/React.createElement("span", {
|
122
127
|
className: prefixCls('main')
|
123
128
|
}, /*#__PURE__*/React.createElement(Select, _objectSpread(_objectSpread({}, filterProps), {}, {
|
124
|
-
className: cls(prefixCls('select'), filterProps === null || filterProps === void 0 ? void 0 : filterProps.className),
|
129
|
+
className: cls(prefixCls('select'), _defineProperty({}, prefixCls('select-none'), !content.length), filterProps === null || filterProps === void 0 ? void 0 : filterProps.className),
|
125
130
|
dataSource: filterItems,
|
126
131
|
onChange: onSelectChange,
|
127
132
|
value: active
|
package/es/form/Filter/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["addonAfter", "addonBefore", "mode", "purePanel", "expand", "formRef", "defaultFilterValue", "filterValues", "filterDebounce", "bindUrl", "onFilter", "onInit", "onReset", "onExpand", "onChange"];
|
1
|
+
var _excluded = ["addonAfter", "addonBefore", "mode", "purePanel", "expand", "formRef", "defaultFilterValue", "filterValues", "filterDebounce", "bindUrl", "onFilter", "onInit", "onReset", "onExpand", "onChange", "form"];
|
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
|
|
@@ -70,6 +70,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
70
70
|
outerReset = props.onReset,
|
71
71
|
onExpand = props.onExpand,
|
72
72
|
onChange = props.onChange,
|
73
|
+
form = props.form,
|
73
74
|
otherProps = _objectWithoutProperties(props, _excluded);
|
74
75
|
|
75
76
|
var _useSpecialProps = useSpecialProps(props),
|
@@ -288,7 +289,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
288
289
|
});
|
289
290
|
}
|
290
291
|
});
|
291
|
-
}, []); // 创建轻量筛选表单实例
|
292
|
+
}, [form]); // 创建轻量筛选表单实例
|
292
293
|
|
293
294
|
var lightForm = useMemo(function () {
|
294
295
|
return createForm({
|
@@ -299,7 +300,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
299
300
|
});
|
300
301
|
}
|
301
302
|
});
|
302
|
-
}, []); // 创建高级筛选表单实例
|
303
|
+
}, [form]); // 创建高级筛选表单实例
|
303
304
|
|
304
305
|
var advancedForm = useMemo(function () {
|
305
306
|
return createForm({
|
@@ -319,7 +320,7 @@ var QueryFilter = /*#__PURE__*/memo(function (props) {
|
|
319
320
|
});
|
320
321
|
}
|
321
322
|
});
|
322
|
-
}, []);
|
323
|
+
}, [form]);
|
323
324
|
var formMap = {
|
324
325
|
simple: simpleForm,
|
325
326
|
light: lightForm,
|
package/es/form/ProForm/index.js
CHANGED
@@ -89,7 +89,7 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
89
89
|
return outerForm || createForm({
|
90
90
|
validateFirst: validateFirst
|
91
91
|
});
|
92
|
-
}, []);
|
92
|
+
}, [outerForm]);
|
93
93
|
var prefixCls = usePrefixCls('teamix-pro-form'); // 由于Actions需要,解构context供使用。原context键名的上下文继续保留。
|
94
94
|
|
95
95
|
var mergedScope = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, context), globalScope), scope), {}, {
|
@@ -111,15 +111,19 @@
|
|
111
111
|
// 尺寸 - small
|
112
112
|
.#{$form-item-cls}-size-small {
|
113
113
|
// 预览态行高
|
114
|
-
.#{$
|
115
|
-
|
114
|
+
.#{$teamix-pro-field} {
|
115
|
+
.#{$css-prefix}form-preview {
|
116
|
+
line-height: var(--form-element-small-height, 24px);
|
117
|
+
}
|
116
118
|
}
|
117
119
|
}
|
118
120
|
// 尺寸 - large
|
119
121
|
.#{$form-item-cls}-size-large {
|
120
122
|
// 预览态行高
|
121
|
-
.#{$
|
122
|
-
|
123
|
+
.#{$teamix-pro-field} {
|
124
|
+
.#{$css-prefix}form-preview {
|
125
|
+
line-height: var(--form-element-large-height, 36px);
|
126
|
+
}
|
123
127
|
}
|
124
128
|
}
|
125
129
|
|
@@ -328,6 +332,11 @@
|
|
328
332
|
}
|
329
333
|
}
|
330
334
|
|
335
|
+
// ArrayTable
|
336
|
+
.#{$form-array}-table-status-select {
|
337
|
+
display: none;
|
338
|
+
}
|
339
|
+
|
331
340
|
// SelectTable
|
332
341
|
.#{$teamix-pro-form}-select-table-column-tree
|
333
342
|
> .#{$css-prefix}table-cell-wrapper {
|
@@ -32,6 +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
36
|
import adapterType from './adapterType';
|
36
37
|
import adapterComponent from './adapterComponent';
|
37
38
|
import adapterDecorator from './adapterDecorator';
|
@@ -135,8 +136,7 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
135
136
|
var _newItem2 = newItem,
|
136
137
|
component = _newItem2.component,
|
137
138
|
type = _newItem2.type,
|
138
|
-
|
139
|
-
name = _newItem2$name === void 0 ? getFieldName(component === null || component === void 0 ? void 0 : component.replace(/\./g, ''), suffix) : _newItem2$name,
|
139
|
+
name = _newItem2.name,
|
140
140
|
decorator = _newItem2.decorator,
|
141
141
|
decoratorProps = _newItem2.decoratorProps,
|
142
142
|
dataSource = _newItem2.dataSource,
|
@@ -147,9 +147,11 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
147
147
|
tooltip = _newItem2.tooltip,
|
148
148
|
request = _newItem2.request,
|
149
149
|
data = _newItem2.data,
|
150
|
-
otherProps = _objectWithoutProperties(_newItem2, _excluded); //
|
150
|
+
otherProps = _objectWithoutProperties(_newItem2, _excluded); // 默认字段名
|
151
151
|
|
152
152
|
|
153
|
+
var defaultName = !name ? getFieldName(component === null || component === void 0 ? void 0 : component.replace(/\./g, ''), suffix) : name; // 默认类型
|
154
|
+
|
153
155
|
var defaultType = adapterType(type, originalComponent); // 默认装饰组件
|
154
156
|
|
155
157
|
var defaultDecorator = adapterDecorator(decorator, originalComponent); // 默认装饰组件属性
|
@@ -207,7 +209,9 @@ export default /*#__PURE__*/memo(function (_ref) {
|
|
207
209
|
|
208
210
|
var recursiveItems = items ? formatSchema([items], suffix) : {}; // 配置组件属性
|
209
211
|
|
210
|
-
|
212
|
+
if (isUsable(item)) {
|
213
|
+
schemaProperties[defaultName] = _objectSpread(_objectSpread(_objectSpread({}, formatParam), recursiveProperties), recursiveItems);
|
214
|
+
}
|
211
215
|
});
|
212
216
|
return schemaProperties;
|
213
217
|
}, []);
|
@@ -11,15 +11,15 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
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
13
|
import { getMessage } from '@teamix/utils';
|
14
|
-
var buttonTextMap = {
|
15
|
-
Submit: getMessage('submit'),
|
16
|
-
Reset: getMessage('reset')
|
17
|
-
};
|
18
14
|
|
19
15
|
var initializeButton = function initializeButton(item) {
|
20
16
|
var component = item.component,
|
21
17
|
_item$props = item.props,
|
22
18
|
props = _item$props === void 0 ? {} : _item$props;
|
19
|
+
var buttonTextMap = {
|
20
|
+
Submit: getMessage('submit'),
|
21
|
+
Reset: getMessage('reset')
|
22
|
+
};
|
23
23
|
return _objectSpread(_objectSpread({}, item), {}, {
|
24
24
|
component: component,
|
25
25
|
props: _objectSpread({
|
package/es/form/index.d.ts
CHANGED
@@ -16,8 +16,8 @@ declare const formilyReact: {
|
|
16
16
|
};
|
17
17
|
useFormDisplayValues: () => any;
|
18
18
|
Schema: typeof originalFormilyReact.Schema;
|
19
|
-
FormProvider:
|
20
|
-
FormConsumer:
|
19
|
+
FormProvider: originalFormilyReact.ReactFC<originalFormilyReact.IProviderProps>;
|
20
|
+
FormConsumer: originalFormilyReact.ReactFC<originalFormilyReact.IFormSpyProps>;
|
21
21
|
ArrayField: {
|
22
22
|
<D extends originalFormilyReact.JSXComponent, C extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.IFieldProps<D, C, import("@formily/core").ArrayField<any, any>>): JSX.Element;
|
23
23
|
displayName: string;
|
@@ -30,8 +30,8 @@ declare const formilyReact: {
|
|
30
30
|
<D_2 extends originalFormilyReact.JSXComponent, C_2 extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.IVoidFieldProps<D_2, C_2, import("@formily/core").VoidField<any, any, any>>): JSX.Element;
|
31
31
|
displayName: string;
|
32
32
|
};
|
33
|
-
RecursionField:
|
34
|
-
ExpressionScope:
|
33
|
+
RecursionField: originalFormilyReact.ReactFC<originalFormilyReact.IRecursionFieldProps>;
|
34
|
+
ExpressionScope: originalFormilyReact.ReactFC<originalFormilyReact.IExpressionScopeProps>;
|
35
35
|
createSchemaField<Components extends originalFormilyReact.SchemaReactComponents>(options?: originalFormilyReact.ISchemaFieldReactFactoryOptions<Components> | undefined): {
|
36
36
|
<Decorator extends originalFormilyReact.JSXComponent, Component extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.ISchemaFieldProps<Decorator, Component, import("@formily/core").ObjectField<Decorator, Component>>): JSX.Element;
|
37
37
|
displayName: string;
|
@@ -81,17 +81,18 @@ declare const formilyReact: {
|
|
81
81
|
SchemaMarkupContext: import("react").Context<originalFormilyReact.Schema<any, any, any, any, any, any, any, any, any>>;
|
82
82
|
SchemaContext: import("react").Context<originalFormilyReact.Schema<any, any, any, any, any, any, any, any, any>>;
|
83
83
|
SchemaExpressionScopeContext: import("react").Context<any>;
|
84
|
+
SchemaComponentsContext: import("react").Context<originalFormilyReact.SchemaReactComponents>;
|
84
85
|
SchemaOptionsContext: import("react").Context<originalFormilyReact.ISchemaFieldReactFactoryOptions<any>>;
|
85
86
|
ContextCleaner: ({ children }: {
|
86
87
|
children: any;
|
87
88
|
}) => any;
|
88
|
-
mapProps<T extends originalFormilyReact.JSXComponent>(...args: originalFormilyReact.IStateMapper<import("react").ComponentProps<T>>[]): (target: T) => import("react").MemoExoticComponent<
|
89
|
-
mapReadPretty<T_1 extends originalFormilyReact.JSXComponent, C_4 extends originalFormilyReact.JSXComponent>(component: C_4, readPrettyProps?: import("react").ComponentProps<C_4> | undefined): (target: T_1) => import("react").MemoExoticComponent<
|
89
|
+
mapProps<T extends originalFormilyReact.JSXComponent>(...args: originalFormilyReact.IStateMapper<import("react").ComponentProps<T>>[]): (target: T) => import("react").MemoExoticComponent<originalFormilyReact.ReactFC<any>>;
|
90
|
+
mapReadPretty<T_1 extends originalFormilyReact.JSXComponent, C_4 extends originalFormilyReact.JSXComponent>(component: C_4, readPrettyProps?: import("react").ComponentProps<C_4> | undefined): (target: T_1) => import("react").MemoExoticComponent<originalFormilyReact.ReactFC<{
|
90
91
|
ref?: import("react").RefAttributes<any> | undefined;
|
91
92
|
}>>;
|
92
93
|
connect<T_2 extends originalFormilyReact.JSXComponent>(target: T_2, ...args: originalFormilyReact.IComponentMapper<T_2>[]): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<Partial<import("react").ComponentProps<T_2>>> & import("react").RefAttributes<unknown>>;
|
93
94
|
observer: typeof originalFormilyReact.observer;
|
94
|
-
Observer: import("react").MemoExoticComponent<
|
95
|
+
Observer: import("react").MemoExoticComponent<originalFormilyReact.ReactFC<import("@formily/reactive-react").IObserverProps>>;
|
95
96
|
useForm: <T_3 extends object = any>() => import("@formily/core").Form<T_3>;
|
96
97
|
useField: <T_4 = import("@formily/core").GeneralField>() => T_4;
|
97
98
|
useParentForm: () => import("@formily/core").Form<any> | import("@formily/core").ObjectField<any, any>;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import ProAction from './actions';
|
2
|
+
import ProCard from './card';
|
3
|
+
import ProField from './field';
|
4
|
+
import ProForm from './form';
|
5
|
+
import hooks from './hooks';
|
6
|
+
import ProInfo from './info';
|
7
|
+
import ProPageContainer from './page-container';
|
8
|
+
import ProPageHeader from './page-header';
|
9
|
+
import ProTable from './table';
|
10
|
+
import ProSkeleton from './skeleton';
|
11
|
+
import utils from './utils';
|
12
|
+
import ProSidebar from './sidebar';
|
13
|
+
import { ProTimeline } from './timeline';
|
14
|
+
import * as nocode from './nocode';
|
15
|
+
import * as templates from './templates';
|
16
|
+
import TeamixIcon from '@teamix/icon';
|
17
|
+
import './global.scss';
|
18
|
+
export * from './actions';
|
19
|
+
export * from './card';
|
20
|
+
export * from './field';
|
21
|
+
export * from './form';
|
22
|
+
export * from './info';
|
23
|
+
export * from './nocode';
|
24
|
+
export * from './page-container';
|
25
|
+
export * from './page-header';
|
26
|
+
export * from './skeleton';
|
27
|
+
export * from './table';
|
28
|
+
export * from './sidebar';
|
29
|
+
export * from './utils';
|
30
|
+
export * from './timeline';
|
31
|
+
declare const version = "1.4.7";
|
32
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils, };
|
@@ -0,0 +1,35 @@
|
|
1
|
+
// 不带有设置图标源的入口文件
|
2
|
+
import ProAction from './actions';
|
3
|
+
import ProCard from './card';
|
4
|
+
import ProField from './field';
|
5
|
+
import ProForm from './form';
|
6
|
+
import hooks from './hooks';
|
7
|
+
import ProInfo from './info'; // import ProLayout from './layout';
|
8
|
+
|
9
|
+
import ProPageContainer from './page-container';
|
10
|
+
import ProPageHeader from './page-header';
|
11
|
+
import ProTable from './table';
|
12
|
+
import ProSkeleton from './skeleton';
|
13
|
+
import utils from './utils';
|
14
|
+
import ProSidebar from './sidebar';
|
15
|
+
import { ProTimeline } from './timeline';
|
16
|
+
import * as nocode from './nocode';
|
17
|
+
import * as templates from './templates';
|
18
|
+
import TeamixIcon from '@teamix/icon';
|
19
|
+
import './global.scss';
|
20
|
+
export * from './actions';
|
21
|
+
export * from './card';
|
22
|
+
export * from './field';
|
23
|
+
export * from './form';
|
24
|
+
export * from './info';
|
25
|
+
export * from './nocode';
|
26
|
+
export * from './page-container';
|
27
|
+
export * from './page-header';
|
28
|
+
export * from './skeleton';
|
29
|
+
export * from './table';
|
30
|
+
export * from './sidebar';
|
31
|
+
export * from './utils';
|
32
|
+
export * from './timeline';
|
33
|
+
var version = '1.4.7';
|
34
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
35
|
+
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils };
|
package/es/index.d.ts
CHANGED
@@ -13,6 +13,7 @@ import ProSidebar from './sidebar';
|
|
13
13
|
import { ProTimeline } from './timeline';
|
14
14
|
import * as nocode from './nocode';
|
15
15
|
import * as templates from './templates';
|
16
|
+
import TeamixIcon from '@teamix/icon';
|
16
17
|
import './global.scss';
|
17
18
|
export * from './actions';
|
18
19
|
export * from './card';
|
@@ -27,5 +28,5 @@ export * from './table';
|
|
27
28
|
export * from './sidebar';
|
28
29
|
export * from './utils';
|
29
30
|
export * from './timeline';
|
30
|
-
declare const version = "1.4.
|
31
|
-
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
|
31
|
+
declare const version = "1.4.7";
|
32
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -31,6 +31,6 @@ export * from './table';
|
|
31
31
|
export * from './sidebar';
|
32
32
|
export * from './utils';
|
33
33
|
export * from './timeline';
|
34
|
-
var version = '1.4.
|
34
|
+
var version = '1.4.7';
|
35
35
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
36
|
-
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils };
|
36
|
+
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils };
|
package/es/page-header/index.js
CHANGED
@@ -161,11 +161,13 @@ var ProPageHeader = function ProPageHeader(props) {
|
|
161
161
|
var backgroundImage = image ? "url('".concat(image, "')") : undefined;
|
162
162
|
|
163
163
|
var showList = function showList(list) {
|
164
|
+
var _list$actions;
|
165
|
+
|
164
166
|
if (loading) {
|
165
167
|
return !!list;
|
166
168
|
}
|
167
169
|
|
168
|
-
return list && list.length > 0;
|
170
|
+
return list && (list.length > 0 || (list === null || list === void 0 ? void 0 : (_list$actions = list.actions) === null || _list$actions === void 0 ? void 0 : _list$actions.length) > 0);
|
169
171
|
};
|
170
172
|
|
171
173
|
var renderTitle = function renderTitle() {
|
@@ -98,7 +98,7 @@ export default (function (props) {
|
|
98
98
|
lineHeight: '18px'
|
99
99
|
}
|
100
100
|
}, getMessage('total', {
|
101
|
-
total: total
|
101
|
+
total: new Intl.NumberFormat().format(total)
|
102
102
|
}))
|
103
103
|
}, /*#__PURE__*/React.createElement("div", {
|
104
104
|
className: prefixCls('custom-total-content')
|
@@ -216,7 +216,7 @@ export default (function (props) {
|
|
216
216
|
return /*#__PURE__*/React.createElement(Pagination, _objectSpread(_objectSpread({}, commonPaginationProps), {}, {
|
217
217
|
totalRender: function totalRender(total) {
|
218
218
|
return getMessage('total', {
|
219
|
-
total: total
|
219
|
+
total: new Intl.NumberFormat().format(total)
|
220
220
|
});
|
221
221
|
}
|
222
222
|
}, otherProps));
|
@@ -226,7 +226,7 @@ export default (function (props) {
|
|
226
226
|
pageShowCount: 3,
|
227
227
|
totalRender: function totalRender(total) {
|
228
228
|
return getMessage('total', {
|
229
|
-
total: total
|
229
|
+
total: new Intl.NumberFormat().format(total)
|
230
230
|
});
|
231
231
|
}
|
232
232
|
}, otherProps));
|
package/es/table/index.js
CHANGED
@@ -936,7 +936,7 @@ var ProTable = function ProTable(props) {
|
|
936
936
|
// pageSizePosition="end"
|
937
937
|
totalRender: function totalRender(total) {
|
938
938
|
return getMessage('total', {
|
939
|
-
total: total
|
939
|
+
total: new Intl.NumberFormat().format(total)
|
940
940
|
});
|
941
941
|
},
|
942
942
|
pageSize: pageSize,
|
@@ -1,9 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
3
3
|
import { ColumnProps } from '@alicloudfe/components/types/table';
|
4
|
+
declare type FixedColumnProps = ColumnProps & {
|
5
|
+
wordBreak?: string;
|
6
|
+
};
|
4
7
|
/**
|
5
8
|
* ProColumn => Column
|
6
9
|
*/
|
7
10
|
export default function genProColumnToColumn(columns: ProTableColumnProps[],
|
8
11
|
/** 是否渲染骨架屏 */
|
9
|
-
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any):
|
12
|
+
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>, context?: any): FixedColumnProps[];
|
13
|
+
export {};
|
@@ -13,6 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
13
13
|
import React from 'react';
|
14
14
|
import { renderColumnsTitle, renderCell } from './columnRender';
|
15
15
|
import { ProSkeletonRaw as Skeleton } from '../../skeleton';
|
16
|
+
import { getLanguage } from '@teamix/utils';
|
16
17
|
/**
|
17
18
|
* ProColumn => Column
|
18
19
|
*/
|
@@ -40,7 +41,8 @@ showSkeleton, actionRef) {
|
|
40
41
|
|
41
42
|
return _objectSpread(_objectSpread({
|
42
43
|
// 金钱样式默认右对齐
|
43
|
-
align: columnProps.valueType === 'money' ? 'right' : 'left'
|
44
|
+
align: columnProps.valueType === 'money' ? 'right' : 'left',
|
45
|
+
wordBreak: getLanguage() === 'en-us' ? 'word' : 'all'
|
44
46
|
}, others), {}, {
|
45
47
|
dataIndex: dataIndex === null || dataIndex === void 0 ? void 0 : dataIndex.toString(),
|
46
48
|
title: renderColumnsTitle(columnProps, actionRef),
|
@@ -114,15 +114,22 @@ var DialogForm = function DialogForm(props) {
|
|
114
114
|
innerFormRef = props.innerFormRef,
|
115
115
|
_props$validateFirst = props.validateFirst,
|
116
116
|
validateFirst = _props$validateFirst === void 0 ? true : _props$validateFirst;
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
117
|
+
var form = (0, _react.useMemo)(function () {
|
118
|
+
return (0, _form.createForm)({
|
119
|
+
initialValues: (0, _utils.getTargetValue)(initialValues, context),
|
120
|
+
validateFirst: validateFirst
|
121
|
+
});
|
122
|
+
}, [validateFirst, initialValues, context]);
|
123
|
+
|
124
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
125
|
+
return getSchemaAndFormProps(schema, formProps);
|
126
|
+
}, [schema, formProps]),
|
127
|
+
formSchema = _useMemo.schema,
|
128
|
+
others = _objectWithoutProperties(_useMemo, _excluded);
|
129
|
+
|
130
|
+
var otherFormProps = (0, _react.useMemo)(function () {
|
131
|
+
return (0, _utils2.addContext)((0, _utils.getTargetValue)(others, context), context);
|
132
|
+
}, [context, JSON.stringify(others)]);
|
126
133
|
|
127
134
|
var _useState = (0, _react.useState)(false),
|
128
135
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -155,7 +162,7 @@ var DialogForm = function DialogForm(props) {
|
|
155
162
|
}, /*#__PURE__*/_react.default.createElement(_form.default, _objectSpread(_objectSpread({
|
156
163
|
form: form,
|
157
164
|
schema: formSchema
|
158
|
-
}, getDefaultFormPropsByDialogSize(size)),
|
165
|
+
}, getDefaultFormPropsByDialogSize(size)), otherFormProps)));
|
159
166
|
};
|
160
167
|
|
161
168
|
function useDialogFormAction(action, context) {
|
package/lib/card/index.js
CHANGED
@@ -267,8 +267,7 @@ var ProCard = function ProCard(props) {
|
|
267
267
|
value: description,
|
268
268
|
type: "text",
|
269
269
|
render: {
|
270
|
-
ellipsis: true
|
271
|
-
tooltip: description
|
270
|
+
ellipsis: true
|
272
271
|
}
|
273
272
|
})));
|
274
273
|
};
|
@@ -290,7 +289,7 @@ var ProCard = function ProCard(props) {
|
|
290
289
|
padding: 0,
|
291
290
|
margin: 0
|
292
291
|
} : {}
|
293
|
-
}, (loading || contentLoading) && /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Card.Content, null), !loading && /*#__PURE__*/_react.default.createElement("div", {
|
292
|
+
}, (loading || contentLoading) && /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Card.Content, null), !(loading || contentLoading) && /*#__PURE__*/_react.default.createElement("div", {
|
294
293
|
className: cardContentClassName,
|
295
294
|
style: cardContentStyle
|
296
295
|
}, empty && /*#__PURE__*/_react.default.createElement("div", {
|
package/lib/card/index.scss
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
$grid-columns: 24;
|
33
33
|
@for $i from 1 through $grid-columns {
|
34
34
|
&-#{$i} {
|
35
|
-
$width: percentage($i
|
35
|
+
$width: percentage($i / $grid-columns);
|
36
36
|
flex: 0 0 $width;
|
37
37
|
width: $width;
|
38
38
|
max-width: $width;
|
@@ -52,7 +52,7 @@
|
|
52
52
|
}
|
53
53
|
}
|
54
54
|
|
55
|
-
&-name{
|
55
|
+
&-name {
|
56
56
|
flex-shrink: 0;
|
57
57
|
}
|
58
58
|
|
@@ -135,6 +135,11 @@ var LightFilter = (0, _react2.observer)(function (props) {
|
|
135
135
|
setActive(value);
|
136
136
|
onFilterChange && onFilterChange(value);
|
137
137
|
}, [onFilterChange]);
|
138
|
+
(0, _react.useEffect)(function () {
|
139
|
+
if (!filterItems.length) {
|
140
|
+
setActive(undefined);
|
141
|
+
}
|
142
|
+
}, [filterItems.length]);
|
138
143
|
return /*#__PURE__*/_react.default.createElement("span", {
|
139
144
|
className: (0, _classnames.default)(basePrefix(size), prefixCls({
|
140
145
|
'': true,
|
@@ -143,7 +148,7 @@ var LightFilter = (0, _react2.observer)(function (props) {
|
|
143
148
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
144
149
|
className: prefixCls('main')
|
145
150
|
}, /*#__PURE__*/_react.default.createElement(_components.Select, _objectSpread(_objectSpread({}, filterProps), {}, {
|
146
|
-
className: (0, _classnames.default)(prefixCls('select'), filterProps === null || filterProps === void 0 ? void 0 : filterProps.className),
|
151
|
+
className: (0, _classnames.default)(prefixCls('select'), _defineProperty({}, prefixCls('select-none'), !content.length), filterProps === null || filterProps === void 0 ? void 0 : filterProps.className),
|
147
152
|
dataSource: filterItems,
|
148
153
|
onChange: onSelectChange,
|
149
154
|
value: active
|