@teamix/pro 1.4.6 → 1.4.9
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 +197 -129
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.js +22 -17
- package/es/actions/dialog.d.ts +5 -1
- package/es/actions/dialog.js +19 -11
- package/es/card/index.js +1 -2
- 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 +2 -2
- package/es/form/ProForm/index.scss +5 -0
- package/es/form/SchemaForm/index.js +8 -4
- package/es/index-without-icon.d.ts +32 -0
- package/es/index-without-icon.js +35 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +7 -2
- package/es/page-header/index.js +3 -1
- package/es/table/components/Filter/index.js +9 -15
- package/es/table/utils/genProColumnToColumn.d.ts +5 -1
- package/es/table/utils/genProColumnToColumn.js +3 -1
- package/lib/actions/dialog-form.js +22 -16
- package/lib/actions/dialog.d.ts +5 -1
- package/lib/actions/dialog.js +18 -10
- package/lib/card/index.js +1 -2
- 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 +2 -2
- package/lib/form/ProForm/index.scss +5 -0
- package/lib/form/SchemaForm/index.js +11 -6
- package/lib/index-without-icon.d.ts +32 -0
- package/lib/index-without-icon.js +316 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +6 -3
- package/lib/page-header/index.js +3 -1
- package/lib/table/components/Filter/index.js +9 -15
- package/lib/table/utils/genProColumnToColumn.d.ts +5 -1
- package/lib/table/utils/genProColumnToColumn.js +4 -1
- package/package.json +1 -1
@@ -32,11 +32,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
32
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
|
-
import ProForm, { createForm } from '../form';
|
35
|
+
import ProForm, { createForm, formilyReactive } from '../form';
|
36
36
|
import { getTargetValue, resolveMaybePromiseMethod } from '@teamix/utils';
|
37
37
|
import { doRequest } from './request';
|
38
38
|
import useDialogAction from './dialog';
|
39
39
|
import { addContext } from './utils';
|
40
|
+
var toJS = formilyReactive.toJS;
|
40
41
|
|
41
42
|
function getDefaultFormPropsByDialogSize(size) {
|
42
43
|
if (size === 'small') {
|
@@ -184,51 +185,55 @@ export function useDialogFormAction(action, context) {
|
|
184
185
|
innerFormRef.current.validate().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
185
186
|
var _innerFormRef$current;
|
186
187
|
|
187
|
-
var beforeRequestContext, requestContext;
|
188
|
+
var beforeRequestContext, fields, requestContext;
|
188
189
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
189
190
|
while (1) {
|
190
191
|
switch (_context.prev = _context.next) {
|
191
192
|
case 0:
|
193
|
+
fields = toJS((_innerFormRef$current = innerFormRef.current) === null || _innerFormRef$current === void 0 ? void 0 : _innerFormRef$current.values);
|
194
|
+
|
192
195
|
if (!propsBeforeRequest) {
|
193
|
-
_context.next =
|
196
|
+
_context.next = 14;
|
194
197
|
break;
|
195
198
|
}
|
196
199
|
|
197
|
-
_context.prev =
|
198
|
-
_context.next =
|
199
|
-
return resolveMaybePromiseMethod(propsBeforeRequest, context)
|
200
|
+
_context.prev = 2;
|
201
|
+
_context.next = 5;
|
202
|
+
return resolveMaybePromiseMethod(propsBeforeRequest, _objectSpread(_objectSpread({}, context), {}, {
|
203
|
+
fields: fields
|
204
|
+
}));
|
200
205
|
|
201
|
-
case
|
206
|
+
case 5:
|
202
207
|
beforeRequestContext = _context.sent;
|
203
|
-
_context.next =
|
208
|
+
_context.next = 11;
|
204
209
|
break;
|
205
210
|
|
206
|
-
case
|
207
|
-
_context.prev =
|
208
|
-
_context.t0 = _context["catch"](
|
211
|
+
case 8:
|
212
|
+
_context.prev = 8;
|
213
|
+
_context.t0 = _context["catch"](2);
|
209
214
|
beforeRequestContext = false;
|
210
215
|
|
211
|
-
case
|
216
|
+
case 11:
|
212
217
|
if (!(beforeRequestContext === false)) {
|
213
|
-
_context.next =
|
218
|
+
_context.next = 14;
|
214
219
|
break;
|
215
220
|
}
|
216
221
|
|
217
222
|
reject(false);
|
218
223
|
return _context.abrupt("return");
|
219
224
|
|
220
|
-
case
|
225
|
+
case 14:
|
221
226
|
requestContext = Object.assign({
|
222
|
-
fields:
|
227
|
+
fields: fields
|
223
228
|
}, _typeof(beforeRequestContext) === 'object' ? beforeRequestContext : {});
|
224
229
|
resolve(requestContext);
|
225
230
|
|
226
|
-
case
|
231
|
+
case 16:
|
227
232
|
case "end":
|
228
233
|
return _context.stop();
|
229
234
|
}
|
230
235
|
}
|
231
|
-
}, _callee, null, [[
|
236
|
+
}, _callee, null, [[2, 8]]);
|
232
237
|
}))).catch(function () {
|
233
238
|
resolve(false);
|
234
239
|
});
|
package/es/actions/dialog.d.ts
CHANGED
@@ -4,7 +4,7 @@ import { quickShowDrawerProps } from '@alicloudfe/components/types/drawer';
|
|
4
4
|
import { ProFormSchema, ProFormSchemaItem } from '../form';
|
5
5
|
import { ProMessageProps } from '../utils/message';
|
6
6
|
import { RequestAction } from './request';
|
7
|
-
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | '
|
7
|
+
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | 'onError'> {
|
8
8
|
/** 点击「确认按钮」后的数据请求地址,非必填,不填就不发请求 */
|
9
9
|
url?: string;
|
10
10
|
/** 弹窗类型,支持普通弹窗和抽屉两种模式,默认为普通弹窗 */
|
@@ -25,6 +25,10 @@ export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShow
|
|
25
25
|
schema?: any;
|
26
26
|
/** 弹窗内容区的组件 */
|
27
27
|
component?: any;
|
28
|
+
/** 点击确定自定义回调函数 */
|
29
|
+
onOk?: any;
|
30
|
+
/** 点击取消自定义回调函数 */
|
31
|
+
onCancel?: any;
|
28
32
|
}
|
29
33
|
export declare function useDialogAction(action: DialogAction, actionContext?: any, hasForm?: boolean): {
|
30
34
|
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
package/es/actions/dialog.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["trigger", "url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
|
1
|
+
var _excluded = ["trigger", "url", "customRequest", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError", "onOk", "onCancel"],
|
2
2
|
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "popType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "message", "footerDescription", "footerAlign", "className"];
|
3
3
|
|
4
4
|
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; }
|
@@ -27,7 +27,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
27
27
|
|
28
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
29
29
|
|
30
|
-
import React, { useState, useEffect, useRef } from 'react';
|
30
|
+
import React, { useState, useEffect, useMemo, useRef } from 'react';
|
31
31
|
import classnames from 'classnames';
|
32
32
|
import { useHistory } from 'react-router-dom';
|
33
33
|
import { Dialog, Drawer } from '@alicloudfe/components';
|
@@ -51,7 +51,9 @@ var FooterForm = function FooterForm(props) {
|
|
51
51
|
var schema = props.schema,
|
52
52
|
context = props.context,
|
53
53
|
formRef = props.formRef;
|
54
|
-
var form =
|
54
|
+
var form = useMemo(function () {
|
55
|
+
return createForm();
|
56
|
+
}, []);
|
55
57
|
useEffect(function () {
|
56
58
|
formRef.current = form;
|
57
59
|
}, []);
|
@@ -84,6 +86,7 @@ export function useDialogAction(action, actionContext, hasForm) {
|
|
84
86
|
|
85
87
|
var trigger = action.trigger,
|
86
88
|
url = action.url,
|
89
|
+
customRequest = action.customRequest,
|
87
90
|
method = action.method,
|
88
91
|
params = action.params,
|
89
92
|
data = action.data,
|
@@ -94,6 +97,8 @@ export function useDialogAction(action, actionContext, hasForm) {
|
|
94
97
|
formatResult = action.formatResult,
|
95
98
|
onSuccess = action.onSuccess,
|
96
99
|
onError = action.onError,
|
100
|
+
propsOnOk = action.onOk,
|
101
|
+
propsOnCancel = action.onCancel,
|
97
102
|
others = _objectWithoutProperties(action, _excluded);
|
98
103
|
|
99
104
|
var _getTargetValue = getTargetValue(others, context),
|
@@ -174,33 +179,34 @@ export function useDialogAction(action, actionContext, hasForm) {
|
|
174
179
|
|
175
180
|
case 6:
|
176
181
|
onFinish && onFinish();
|
182
|
+
propsOnOk && propsOnOk(context);
|
177
183
|
resolve(true);
|
178
|
-
_context.next =
|
184
|
+
_context.next = 19;
|
179
185
|
break;
|
180
186
|
|
181
|
-
case
|
182
|
-
_context.prev =
|
187
|
+
case 11:
|
188
|
+
_context.prev = 11;
|
183
189
|
_context.t0 = _context["catch"](2);
|
184
190
|
setLoading(false); // 如果 beforeRequest 中返回了 false 并且不是 dialog-form,则直接关闭弹窗
|
185
191
|
|
186
192
|
if (!(beforeRequest && !hasForm)) {
|
187
|
-
_context.next =
|
193
|
+
_context.next = 17;
|
188
194
|
break;
|
189
195
|
}
|
190
196
|
|
191
197
|
resolve(true);
|
192
198
|
return _context.abrupt("return");
|
193
199
|
|
194
|
-
case
|
200
|
+
case 17:
|
195
201
|
resolve(false);
|
196
202
|
return _context.abrupt("return");
|
197
203
|
|
198
|
-
case
|
204
|
+
case 19:
|
199
205
|
case "end":
|
200
206
|
return _context.stop();
|
201
207
|
}
|
202
208
|
}
|
203
|
-
}, _callee, null, [[2,
|
209
|
+
}, _callee, null, [[2, 11]]);
|
204
210
|
}));
|
205
211
|
|
206
212
|
return function (_x) {
|
@@ -223,7 +229,9 @@ export function useDialogAction(action, actionContext, hasForm) {
|
|
223
229
|
});
|
224
230
|
var dialogContent = Component ? /*#__PURE__*/React.createElement(Component, _objectSpread({}, addContext(componentProps, dialogContext))) : addContextForReactNode(content, dialogContext);
|
225
231
|
|
226
|
-
var quickShowProps = _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(isPop ? 'onConfirm' : 'onOk'), onOk), _defineProperty(_objectSpread2, "
|
232
|
+
var quickShowProps = _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(isPop ? 'onConfirm' : 'onOk'), onOk), _defineProperty(_objectSpread2, "onCancel", function onCancel() {
|
233
|
+
propsOnCancel && propsOnCancel(context);
|
234
|
+
}), _defineProperty(_objectSpread2, "title", addContextForReactNode(title, dialogContext)), _defineProperty(_objectSpread2, "content", /*#__PURE__*/React.createElement(React.Fragment, null, beforeContent && /*#__PURE__*/React.createElement("div", {
|
227
235
|
className: "teamix-pro-dialog-before-content"
|
228
236
|
}, addContextForReactNode(beforeContent, dialogContext)), message && /*#__PURE__*/React.createElement("div", {
|
229
237
|
className: "teamix-pro-dialog-message"
|
package/es/card/index.js
CHANGED
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), {}, {
|
@@ -150,7 +150,7 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
150
150
|
});
|
151
151
|
});
|
152
152
|
}
|
153
|
-
}, [onChange]);
|
153
|
+
}, [onChange, form]);
|
154
154
|
useEffect(function () {
|
155
155
|
// 配置国际化
|
156
156
|
setValidateLanguage(getLanguage() || 'zh-cn');
|
@@ -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
|
}, []);
|
@@ -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
@@ -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.9";
|
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
@@ -1,3 +1,5 @@
|
|
1
|
+
var _window;
|
2
|
+
|
1
3
|
import ProAction from './actions';
|
2
4
|
import ProCard from './card';
|
3
5
|
import ProField from './field';
|
@@ -17,7 +19,10 @@ import * as templates from './templates';
|
|
17
19
|
import TeamixIcon from '@teamix/icon';
|
18
20
|
import './global.scss'; // 设置图标源
|
19
21
|
|
20
|
-
|
22
|
+
if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
|
23
|
+
TeamixIcon.setConfig(utils.getTeamixIconConfig());
|
24
|
+
}
|
25
|
+
|
21
26
|
export * from './actions';
|
22
27
|
export * from './card';
|
23
28
|
export * from './field';
|
@@ -31,6 +36,6 @@ export * from './table';
|
|
31
36
|
export * from './sidebar';
|
32
37
|
export * from './utils';
|
33
38
|
export * from './timeline';
|
34
|
-
var version = '1.4.
|
39
|
+
var version = '1.4.9';
|
35
40
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
36
41
|
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() {
|
@@ -172,7 +172,7 @@ var Filter = function Filter(props) {
|
|
172
172
|
btn: true
|
173
173
|
}),
|
174
174
|
onClick: function onClick() {
|
175
|
-
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s;
|
175
|
+
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s, _actionRef$current5, _actionRef$current6, _actionRef$current6$r, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$c;
|
176
176
|
|
177
177
|
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
|
178
178
|
|
@@ -193,24 +193,18 @@ var Filter = function Filter(props) {
|
|
193
193
|
rules: selected,
|
194
194
|
params: param
|
195
195
|
})));
|
196
|
+
var targetPageKey = 'currentPage';
|
197
|
+
var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
|
196
198
|
|
197
|
-
if (
|
198
|
-
|
199
|
+
if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
|
200
|
+
targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
|
201
|
+
} // 发送请求
|
199
202
|
|
200
|
-
var targetPageKey = 'currentPage';
|
201
|
-
var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
|
202
203
|
|
203
|
-
|
204
|
-
|
205
|
-
} // 发送请求
|
206
|
-
|
207
|
-
|
208
|
-
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$r = _actionRef$current6.request) === null || _actionRef$current6$r === void 0 ? void 0 : _actionRef$current6$r.call(_actionRef$current6, _defineProperty({}, targetPageKey, 1));
|
209
|
-
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7); // 清空表格选择
|
210
|
-
|
211
|
-
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
|
212
|
-
}
|
204
|
+
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$r = _actionRef$current6.request) === null || _actionRef$current6$r === void 0 ? void 0 : _actionRef$current6$r.call(_actionRef$current6, _defineProperty({}, targetPageKey, 1));
|
205
|
+
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7); // 清空表格选择
|
213
206
|
|
207
|
+
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
|
214
208
|
setVisible(false);
|
215
209
|
}
|
216
210
|
}, getMessage('ok')), /*#__PURE__*/React.createElement(Button, {
|
@@ -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),
|