@teamix/pro 1.3.4 → 1.3.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.css +1 -1
- package/dist/pro.js +57871 -57067
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.d.ts +2 -0
- package/es/actions/dialog-form.js +5 -2
- package/es/actions/index.d.ts +5 -1
- package/es/actions/index.js +30 -9
- package/es/card/index.d.ts +1 -1
- package/es/card/index.js +9 -1
- package/es/card/index.scss +4 -0
- package/es/form/Filter/useSpecialProps.js +2 -2
- package/es/form/ProForm/index.js +5 -3
- package/es/form/ProForm/index.scss +16 -8
- package/es/form/SchemaForm/reactions.js +2 -2
- package/es/form/docs/ActionResponse.d.ts +7 -0
- package/es/form/docs/ActionResponse.js +11 -0
- package/es/form/docs/ActionResponse.less +25 -0
- package/es/form/index.d.ts +1 -1
- package/es/form/typing.d.ts +1 -0
- package/es/index.d.ts +4 -2
- package/es/index.js +5 -5
- package/es/info/components/ProInfoItem/index.js +1 -1
- package/es/info/components/ProInfoItem/index.scss +0 -1
- package/es/info/components/baseInfo/index.scss +0 -3
- package/es/sidebar/components/sidebar-container/index.js +114 -9
- package/es/sidebar/components/sidebar-container/index.scss +53 -5
- package/es/sidebar/components/tree/index.d.ts +2 -0
- package/es/sidebar/components/tree/index.js +222 -76
- package/es/sidebar/components/tree/index.scss +10 -0
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.js +62 -0
- package/es/sidebar/components/tree-node/components/HoverTooltip/index.scss +7 -0
- package/es/sidebar/components/tree-node/components/IconAction/index.d.ts +12 -0
- package/es/sidebar/components/tree-node/components/IconAction/index.js +105 -0
- package/es/sidebar/components/tree-node/components/IconAction/index.scss +7 -0
- package/es/sidebar/components/tree-node/components/IconSwitch/index.d.ts +23 -0
- package/es/sidebar/components/tree-node/components/IconSwitch/index.js +73 -0
- package/es/sidebar/components/tree-node/components/IconSwitch/index.scss +7 -0
- package/es/sidebar/components/tree-node/index.d.ts +7 -0
- package/es/sidebar/components/tree-node/index.js +225 -0
- package/es/sidebar/components/tree-node/index.scss +58 -0
- package/es/sidebar/index.d.ts +2 -0
- package/es/sidebar/index.js +147 -12
- package/es/sidebar/index.scss +24 -1
- package/es/sidebar/typing.d.ts +83 -13
- package/es/sidebar/utils/action-ref.d.ts +3 -0
- package/es/sidebar/utils/action-ref.js +15 -0
- package/es/sidebar/utils/index.d.ts +71 -0
- package/es/sidebar/utils/index.js +228 -0
- package/es/table/components/Pagination/index.js +4 -4
- package/es/table/components/ToolBar/FilterColumnIcon.js +5 -1
- package/es/table/index.js +9 -4
- package/es/table/typing.d.ts +3 -1
- package/lib/actions/dialog-form.d.ts +2 -0
- package/lib/actions/dialog-form.js +5 -2
- package/lib/actions/index.d.ts +5 -1
- package/lib/actions/index.js +29 -7
- package/lib/card/index.d.ts +1 -1
- package/lib/card/index.js +10 -1
- package/lib/card/index.scss +4 -0
- package/lib/form/Filter/useSpecialProps.js +1 -1
- package/lib/form/ProForm/index.js +5 -3
- package/lib/form/ProForm/index.scss +16 -8
- package/lib/form/SchemaForm/reactions.js +1 -1
- package/lib/form/docs/ActionResponse.d.ts +7 -0
- package/lib/form/docs/ActionResponse.js +24 -0
- package/lib/form/docs/ActionResponse.less +25 -0
- package/lib/form/index.d.ts +1 -1
- package/lib/form/typing.d.ts +1 -0
- package/lib/index.d.ts +4 -2
- package/lib/index.js +22 -2
- package/lib/info/components/ProInfoItem/index.js +1 -1
- package/lib/info/components/ProInfoItem/index.scss +0 -1
- package/lib/info/components/baseInfo/index.scss +0 -3
- package/lib/sidebar/components/sidebar-container/index.js +120 -8
- package/lib/sidebar/components/sidebar-container/index.scss +53 -5
- package/lib/sidebar/components/tree/index.d.ts +2 -0
- package/lib/sidebar/components/tree/index.js +230 -76
- package/lib/sidebar/components/tree/index.scss +10 -0
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.d.ts +15 -0
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.js +80 -0
- package/lib/sidebar/components/tree-node/components/HoverTooltip/index.scss +7 -0
- package/lib/sidebar/components/tree-node/components/IconAction/index.d.ts +12 -0
- package/lib/sidebar/components/tree-node/components/IconAction/index.js +127 -0
- package/lib/sidebar/components/tree-node/components/IconAction/index.scss +7 -0
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.d.ts +23 -0
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.js +94 -0
- package/lib/sidebar/components/tree-node/components/IconSwitch/index.scss +7 -0
- package/lib/sidebar/components/tree-node/index.d.ts +7 -0
- package/lib/sidebar/components/tree-node/index.js +252 -0
- package/lib/sidebar/components/tree-node/index.scss +58 -0
- package/lib/sidebar/index.d.ts +2 -0
- package/lib/sidebar/index.js +173 -10
- package/lib/sidebar/index.scss +24 -1
- package/lib/sidebar/typing.d.ts +83 -13
- package/lib/sidebar/utils/action-ref.d.ts +3 -0
- package/lib/sidebar/utils/action-ref.js +22 -0
- package/lib/sidebar/utils/index.d.ts +71 -0
- package/lib/sidebar/utils/index.js +247 -0
- package/lib/table/components/Pagination/index.js +3 -3
- package/lib/table/components/ToolBar/FilterColumnIcon.js +5 -1
- package/lib/table/index.js +8 -3
- package/lib/table/typing.d.ts +3 -1
- package/package.json +18 -4
@@ -25,7 +25,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
25
25
|
// 自适应宽度的翻页器
|
26
26
|
import React, { useState, useEffect } from 'react';
|
27
27
|
import { Pagination, Balloon, Select, Button, Input, Icon } from '@alicloudfe/components';
|
28
|
-
import { getMessage, baseClass } from '@teamix/utils';
|
28
|
+
import { getMessage, baseClass, usePrefixCls } from '@teamix/utils';
|
29
29
|
import { useResponsiveProps } from '@teamix/hooks';
|
30
30
|
import './index.scss';
|
31
31
|
var cls = baseClass('teamix-pro-pagination');
|
@@ -160,7 +160,7 @@ export default (function (props) {
|
|
160
160
|
return /*#__PURE__*/React.createElement("div", {
|
161
161
|
className: cls('custom-jumper')
|
162
162
|
}, /*#__PURE__*/React.createElement(Button, {
|
163
|
-
className: "
|
163
|
+
className: "".concat(usePrefixCls(), "prev ").concat(usePrefixCls(), "pagination-item"),
|
164
164
|
onClick: handlePrevClick,
|
165
165
|
disabled: Number(currentPage) <= 1
|
166
166
|
}, /*#__PURE__*/React.createElement(Icon, {
|
@@ -182,7 +182,7 @@ export default (function (props) {
|
|
182
182
|
marginRight: 4
|
183
183
|
}
|
184
184
|
}, "/"), getTotalPage(total, pageSize)), /*#__PURE__*/React.createElement(Button, {
|
185
|
-
className: "next
|
185
|
+
className: "".concat(usePrefixCls(), "next ").concat(usePrefixCls(), "pagination-item"),
|
186
186
|
onClick: handleNextClick,
|
187
187
|
//@ts-ignore
|
188
188
|
disabled: total && Number(currentPage) >= getTotalPage(total, pageSize)
|
@@ -200,7 +200,7 @@ export default (function (props) {
|
|
200
200
|
}, otherProps));
|
201
201
|
} else {
|
202
202
|
return /*#__PURE__*/React.createElement("div", {
|
203
|
-
className: "".concat(cls('custom-mini-pagination'), "
|
203
|
+
className: "".concat(cls('custom-mini-pagination'), " ").concat(usePrefixCls(), "pagination")
|
204
204
|
}, customTotalRender(total), customJumpRender());
|
205
205
|
}
|
206
206
|
}
|
@@ -47,8 +47,12 @@ var processColumns = function processColumns(columns) {
|
|
47
47
|
columns = columns.filter(function (item) {
|
48
48
|
return item.valueType !== 'selectGroup';
|
49
49
|
});
|
50
|
-
}
|
50
|
+
} // hidden 为 true 时不展示
|
51
|
+
|
51
52
|
|
53
|
+
columns = columns.filter(function (item) {
|
54
|
+
return (item === null || item === void 0 ? void 0 : item.hidden) !== true;
|
55
|
+
});
|
52
56
|
return columns.map(function (item) {
|
53
57
|
if (item.columnFilters === false) {
|
54
58
|
return item;
|
package/es/table/index.js
CHANGED
@@ -36,7 +36,7 @@ import React, { useState, useEffect, useRef } from 'react';
|
|
36
36
|
import { Table, Checkbox } from '@alicloudfe/components';
|
37
37
|
import Pagination from './components/Pagination';
|
38
38
|
import genProColumnToColumn from './utils/genProColumnToColumn';
|
39
|
-
import { baseClass, useRequest, request as utilResquest, getDeepValue, getMessage, pickProps, getCookie } from '@teamix/utils';
|
39
|
+
import { baseClass, useRequest, request as utilResquest, getDeepValue, getMessage, pickProps, getCookie, usePrefixCls } from '@teamix/utils';
|
40
40
|
import { ProSkeletonRaw as Skeleton } from '../skeleton';
|
41
41
|
import './index.scss';
|
42
42
|
import Layout from './components/Layout';
|
@@ -65,7 +65,7 @@ var processColumns = function processColumns(columns, initialColumns) {
|
|
65
65
|
var _filterColumns;
|
66
66
|
|
67
67
|
var filterColumns = columns.filter(function (item) {
|
68
|
-
return item.columnFilters !== false;
|
68
|
+
return item.columnFilters !== false && (item === null || item === void 0 ? void 0 : item.hidden) !== true;
|
69
69
|
});
|
70
70
|
|
71
71
|
if (isRoot) {
|
@@ -269,7 +269,7 @@ var ProTable = function ProTable(props) {
|
|
269
269
|
|
270
270
|
var tableDom = tableRef.current;
|
271
271
|
var headerDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements = tableDom.getElementsByClassName('teamix-pro-table-layout')) === null || _tableDom$getElements === void 0 ? void 0 : _tableDom$getElements[0];
|
272
|
-
var tableHeaderDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements2 = tableDom.getElementsByClassName(
|
272
|
+
var tableHeaderDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements2 = tableDom.getElementsByClassName("".concat(usePrefixCls(), "table-header-inner"))) === null || _tableDom$getElements2 === void 0 ? void 0 : _tableDom$getElements2[0];
|
273
273
|
return new Promise(function (resolve) {
|
274
274
|
setTimeout(function () {
|
275
275
|
var _headerDom$offsetHeig, _tableHeaderDom$offse;
|
@@ -692,6 +692,11 @@ var ProTable = function ProTable(props) {
|
|
692
692
|
setTotal(total || (data === null || data === void 0 ? void 0 : data.length));
|
693
693
|
setShowSkeleton(false);
|
694
694
|
setCustomTableLoading(false);
|
695
|
+
} // 重新计算是否需要吸底
|
696
|
+
|
697
|
+
|
698
|
+
if (footerSuction) {
|
699
|
+
getFooterSuctionState();
|
695
700
|
}
|
696
701
|
});
|
697
702
|
} else {
|
@@ -750,7 +755,7 @@ var ProTable = function ProTable(props) {
|
|
750
755
|
onInit: function onInit(values) {
|
751
756
|
// 表单初始化请求处理
|
752
757
|
(propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit) && (propsDataFilter === null || propsDataFilter === void 0 ? void 0 : propsDataFilter.onInit(values));
|
753
|
-
!fullscreenState && _request({}, false, values);
|
758
|
+
!fullscreenState && requestWhenMount && _request({}, false, values);
|
754
759
|
return true;
|
755
760
|
},
|
756
761
|
onFilter: function onFilter(values) {
|
package/es/table/typing.d.ts
CHANGED
@@ -33,7 +33,9 @@ export declare type ProTableColumnProps = {
|
|
33
33
|
tooltipIcon?: React.ReactNode;
|
34
34
|
/** 对应 ProField 里面的 type */
|
35
35
|
valueType?: ProFieldType;
|
36
|
-
/**
|
36
|
+
/** 是否隐藏表格列,列配置也不显示 */
|
37
|
+
hidden?: boolean;
|
38
|
+
/** 【列配置】是否默认隐藏表格列,但列配置显示 */
|
37
39
|
columnFilters?: boolean;
|
38
40
|
/** 【列配置】是否禁用隐藏列 */
|
39
41
|
columnFiltersDisabled?: boolean;
|
@@ -20,6 +20,8 @@ export interface DialogFormAction extends DialogAction {
|
|
20
20
|
schema: ProFormSchema | Omit<ProFormProps, 'form'>;
|
21
21
|
/** 外部传来的 formRef,用于获取内置 form 实例 */
|
22
22
|
formRef?: React.MutableRefObject<ProFormType | undefined>;
|
23
|
+
/** 是否开启懒惰校验,只校验第一个非法规则,默认开启 */
|
24
|
+
validateFirst?: boolean;
|
23
25
|
}
|
24
26
|
export declare function useDialogFormAction(action: DialogFormAction, context?: any): {
|
25
27
|
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
@@ -111,14 +111,17 @@ var DialogForm = function DialogForm(props) {
|
|
111
111
|
formProps = props.formProps,
|
112
112
|
context = props.context,
|
113
113
|
formRef = props.formRef,
|
114
|
-
innerFormRef = props.innerFormRef
|
114
|
+
innerFormRef = props.innerFormRef,
|
115
|
+
_props$validateFirst = props.validateFirst,
|
116
|
+
validateFirst = _props$validateFirst === void 0 ? true : _props$validateFirst;
|
115
117
|
|
116
118
|
var _getSchemaAndFormProp = getSchemaAndFormProps(schema, formProps),
|
117
119
|
formSchema = _getSchemaAndFormProp.schema,
|
118
120
|
others = _objectWithoutProperties(_getSchemaAndFormProp, _excluded);
|
119
121
|
|
120
122
|
var form = (0, _form.createForm)({
|
121
|
-
initialValues: (0, _utils.getTargetValue)(initialValues, context)
|
123
|
+
initialValues: (0, _utils.getTargetValue)(initialValues, context),
|
124
|
+
validateFirst: validateFirst
|
122
125
|
});
|
123
126
|
|
124
127
|
var _useState = (0, _react.useState)(false),
|
package/lib/actions/index.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { ReactNode } from 'react';
|
2
2
|
import { ButtonProps } from '@alicloudfe/components/types/button';
|
3
3
|
import { MenuButtonProps } from '@alicloudfe/components/types/menu-button';
|
4
|
+
import { TooltipProps } from '@alicloudfe/components/types/balloon';
|
4
5
|
import { LinkAction } from './link';
|
5
6
|
import { RequestAction } from './request';
|
6
7
|
import { DialogAction } from './dialog';
|
@@ -29,7 +30,10 @@ export declare function useAction(config?: ProActionConfig, context?: any): any;
|
|
29
30
|
export interface ProActionButtonProps extends ProActionCommonProps, ButtonProps {
|
30
31
|
config?: ProActionConfig;
|
31
32
|
disabled?: any;
|
33
|
+
tooltip?: ReactNode;
|
34
|
+
disabledTooltip?: ReactNode;
|
32
35
|
icon?: string;
|
36
|
+
tooltipProps?: TooltipProps;
|
33
37
|
onClick?: (event: React.MouseEvent<Element, MouseEvent>, context?: any) => void;
|
34
38
|
}
|
35
39
|
export declare const ProActionButton: (props: ProActionButtonProps) => JSX.Element;
|
package/lib/actions/index.js
CHANGED
@@ -54,7 +54,7 @@ var _dangerPopConfirm = require("./danger-pop-confirm");
|
|
54
54
|
require("./index.scss");
|
55
55
|
|
56
56
|
var _excluded = ["type"],
|
57
|
-
_excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "onClick"],
|
57
|
+
_excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "disabled", "onClick", "tooltip", "disabledTooltip", "tooltipProps"],
|
58
58
|
_excluded3 = ["loading"],
|
59
59
|
_excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type", "className", "noArrow"],
|
60
60
|
_excluded5 = ["context", "text"],
|
@@ -202,18 +202,40 @@ var ProActionButton = function ProActionButton(props) {
|
|
202
202
|
context = props.context,
|
203
203
|
children = props.children,
|
204
204
|
visible = props.visible,
|
205
|
+
disabled = props.disabled,
|
205
206
|
_onClick = props.onClick,
|
207
|
+
tooltip = props.tooltip,
|
208
|
+
disabledTooltip = props.disabledTooltip,
|
209
|
+
tooltipProps = props.tooltipProps,
|
206
210
|
others = _objectWithoutProperties(props, _excluded2);
|
207
211
|
|
208
212
|
var actionProps = useAction(config, context);
|
209
|
-
var buttonProps = _onClick ? _objectSpread(_objectSpread(_objectSpread({
|
213
|
+
var buttonProps = _onClick ? _objectSpread(_objectSpread(_objectSpread({
|
214
|
+
disabled: disabled
|
215
|
+
}, actionProps), others), {}, {
|
210
216
|
onClick: function onClick(e) {
|
211
217
|
return _onClick(e, context);
|
212
218
|
}
|
213
|
-
}) : _objectSpread(_objectSpread({
|
214
|
-
|
219
|
+
}) : _objectSpread(_objectSpread({
|
220
|
+
disabled: disabled
|
221
|
+
}, actionProps), others);
|
222
|
+
|
223
|
+
var content = /*#__PURE__*/_react.default.createElement(_components.Button, _objectSpread({
|
215
224
|
type: type
|
216
225
|
}, buttonProps), buttonContent(children, icon, iconSize, context));
|
226
|
+
|
227
|
+
var baseToolTipProps = _objectSpread({
|
228
|
+
triggerType: 'hover',
|
229
|
+
align: 't',
|
230
|
+
trigger: content
|
231
|
+
}, tooltipProps);
|
232
|
+
|
233
|
+
if (tooltip || disabledTooltip) {
|
234
|
+
var showToolTip = disabled ? disabledTooltip : tooltip;
|
235
|
+
content = /*#__PURE__*/_react.default.createElement(_components.Balloon.Tooltip, _objectSpread({}, baseToolTipProps), showToolTip);
|
236
|
+
}
|
237
|
+
|
238
|
+
return content;
|
217
239
|
};
|
218
240
|
|
219
241
|
exports.ProActionButton = ProActionButton;
|
@@ -241,9 +263,7 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
241
263
|
}
|
242
264
|
}) : _objectSpread({}, menuItemProps);
|
243
265
|
return /*#__PURE__*/_react.default.createElement("div", _objectSpread({
|
244
|
-
className: (0, _classnames.default)('teamix-pro-action-menu-item',
|
245
|
-
'next-disabled': disabled
|
246
|
-
})
|
266
|
+
className: (0, _classnames.default)('teamix-pro-action-menu-item', "".concat((0, _utils.usePrefixCls)(), "menu-item"), _defineProperty({}, "".concat((0, _utils.usePrefixCls)(), "disabled"), disabled))
|
247
267
|
}, buttonProps), buttonContent(children, icon, undefined, context));
|
248
268
|
};
|
249
269
|
|
@@ -405,6 +425,8 @@ function getActionConfig(action, index, context) {
|
|
405
425
|
key: getKey(index, _key),
|
406
426
|
actions: actions.map(function (a, j) {
|
407
427
|
return getActionConfig(a, j, context);
|
428
|
+
}).filter(function (action) {
|
429
|
+
return action.visible !== false;
|
408
430
|
})
|
409
431
|
}, (0, _utils.getTargetValue)(_others, context));
|
410
432
|
}
|
package/lib/card/index.d.ts
CHANGED
package/lib/card/index.js
CHANGED
@@ -36,6 +36,8 @@ var _tab = _interopRequireDefault(require("./tab"));
|
|
36
36
|
|
37
37
|
require("./index.scss");
|
38
38
|
|
39
|
+
var _proField = _interopRequireDefault(require("@teamix/pro-field"));
|
40
|
+
|
39
41
|
var _cardContainer = require("./card-container");
|
40
42
|
|
41
43
|
Object.keys(_cardContainer).forEach(function (key) {
|
@@ -258,7 +260,14 @@ var ProCard = function ProCard(props) {
|
|
258
260
|
trigger: tooltipTrigger
|
259
261
|
}, tooltip)), tags && (0, _utils.renderTags)(tags, 'small'), description && /*#__PURE__*/_react.default.createElement("div", {
|
260
262
|
className: cls('title-description')
|
261
|
-
},
|
263
|
+
}, /*#__PURE__*/_react.default.createElement(_proField.default, {
|
264
|
+
value: description,
|
265
|
+
type: "text",
|
266
|
+
render: {
|
267
|
+
ellipsis: true,
|
268
|
+
tooltip: description
|
269
|
+
}
|
270
|
+
})));
|
262
271
|
};
|
263
272
|
|
264
273
|
return /*#__PURE__*/_react.default.createElement(_components.Card, _objectSpread({
|
package/lib/card/index.scss
CHANGED
@@ -24,7 +24,7 @@ var useSpecialProps = function useSpecialProps(props) {
|
|
24
24
|
dataSource = item.dataSource,
|
25
25
|
children = item.children; // 字符串变量配置default值会触发onChange
|
26
26
|
|
27
|
-
hasChangeDefault = hasChangeDefault || !!((0, _utils.
|
27
|
+
hasChangeDefault = hasChangeDefault || !!((0, _utils.isPlainObj)(dataSource) && (0, _utils.isStr)(value) && value.indexOf('.dataSource'));
|
28
28
|
hasDefault = hasDefault || (0, _utils.isUsable)(value);
|
29
29
|
hasRequired = hasRequired || required || !!rules;
|
30
30
|
|
@@ -31,7 +31,7 @@ var _validate = _interopRequireDefault(require("../locales/validate"));
|
|
31
31
|
|
32
32
|
require("./index.scss");
|
33
33
|
|
34
|
-
var _excluded = ["form", "initialValues", "initialRequest", "schema", "scope", "context", "components", "children", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "onChange", "onSubmit", "onSubmitFailed", "onInitialComplete", "className"];
|
34
|
+
var _excluded = ["form", "initialValues", "initialRequest", "schema", "scope", "context", "components", "children", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "onChange", "onSubmit", "onSubmitFailed", "onInitialComplete", "className", "validateFirst"];
|
35
35
|
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
37
37
|
|
@@ -70,11 +70,12 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
70
70
|
onSubmitFailed = _ref.onSubmitFailed,
|
71
71
|
onInitialComplete = _ref.onInitialComplete,
|
72
72
|
className = _ref.className,
|
73
|
+
validateFirst = _ref.validateFirst,
|
73
74
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
74
75
|
|
75
76
|
var form = (0, _react.useMemo)(function () {
|
76
77
|
return outerForm || (0, _core.createForm)({
|
77
|
-
validateFirst:
|
78
|
+
validateFirst: validateFirst
|
78
79
|
});
|
79
80
|
}, []);
|
80
81
|
var prefixCls = (0, _utils.usePrefixCls)('', {
|
@@ -146,7 +147,8 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
146
147
|
});
|
147
148
|
ProForm.defaultProps = {
|
148
149
|
colon: false,
|
149
|
-
labelAlign: 'left'
|
150
|
+
labelAlign: 'left',
|
151
|
+
validateFirst: true
|
150
152
|
};
|
151
153
|
var _default = ProForm;
|
152
154
|
exports.default = _default;
|
@@ -197,14 +197,15 @@
|
|
197
197
|
margin-right: 4px;
|
198
198
|
}
|
199
199
|
}
|
200
|
-
// 数组类ArrayItem Icon
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
200
|
+
// 数组类ArrayItem Icon text 居中
|
201
|
+
.#{$form-array}-items-item-inner {
|
202
|
+
.#{$css-prefix}space-item {
|
203
|
+
> .#{$css-prefix}formily-icon.#{$css-prefix}btn-text {
|
204
|
+
line-height: inherit !important;
|
205
|
+
margin-right: 0;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
208
209
|
|
209
210
|
// Editable预览态行高
|
210
211
|
.#{$css-prefix}formily-editable-content {
|
@@ -212,6 +213,13 @@
|
|
212
213
|
}
|
213
214
|
|
214
215
|
// 折叠面板
|
216
|
+
.#{$css-prefix}formily-collapse {
|
217
|
+
.#{$css-prefix}collapse-panel-title {
|
218
|
+
.#{$css-prefix}badge-count {
|
219
|
+
transform: translateX(4px);
|
220
|
+
}
|
221
|
+
}
|
222
|
+
}
|
215
223
|
.#{$css-prefix}formily-collapse,
|
216
224
|
.#{$form-array}-collapse-item {
|
217
225
|
.#{$css-prefix}collapse-panel-hidden {
|
@@ -37,7 +37,7 @@ var $request = function $request(field, _ref, context, type) {
|
|
37
37
|
// 触发所有配置的请求
|
38
38
|
|
39
39
|
var refresh = (_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.refresh;
|
40
|
-
var refreshResult = (0, _utils.
|
40
|
+
var refreshResult = (0, _utils.isPlainObj)(refresh) ? refresh : {};
|
41
41
|
return (0, _utils.doCommonRequest)(_objectSpread(_objectSpread({}, requestConfig), {}, {
|
42
42
|
params: _objectSpread(_objectSpread(_objectSpread({}, params), beforeRequestResult), refreshResult),
|
43
43
|
beforeRequest: function beforeRequest() {
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ActionResponse = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
require("./ActionResponse.less");
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
var ActionResponse = function ActionResponse(props) {
|
15
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
16
|
+
className: "as-wrapper"
|
17
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
18
|
+
className: "as-actions"
|
19
|
+
}, props.children), props.response && /*#__PURE__*/_react.default.createElement("div", {
|
20
|
+
className: "as-response"
|
21
|
+
}, "Response\uFF1A", props.response));
|
22
|
+
};
|
23
|
+
|
24
|
+
exports.ActionResponse = ActionResponse;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
.as-wrapper {
|
2
|
+
.as-actions {
|
3
|
+
& button {
|
4
|
+
margin-right: 5px;
|
5
|
+
background-color: #fff;
|
6
|
+
border: 2px solid #d4bbbb;
|
7
|
+
border-radius: 6px;
|
8
|
+
outline: none;
|
9
|
+
padding: 8px 20px;
|
10
|
+
cursor: pointer;
|
11
|
+
transition: all 0.15s ease-in-out;
|
12
|
+
&:hover {
|
13
|
+
border: 2px solid #9db8f3;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.as-response {
|
19
|
+
border: 2px dashed #f0bdbd;
|
20
|
+
font-size: 14px;
|
21
|
+
border-radius: 6px;
|
22
|
+
padding: 8px 20px;
|
23
|
+
margin-top: 10px;
|
24
|
+
}
|
25
|
+
}
|
package/lib/form/index.d.ts
CHANGED
@@ -91,7 +91,7 @@ declare const formilyReact: {
|
|
91
91
|
}>>;
|
92
92
|
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
93
|
observer: typeof originalFormilyReact.observer;
|
94
|
-
Observer: import("react").MemoExoticComponent<import("react").FunctionComponent<import("
|
94
|
+
Observer: import("react").MemoExoticComponent<import("react").FunctionComponent<import("@formily/reactive-react").IObserverProps>>;
|
95
95
|
useForm: <T_3 extends object = any>() => import("@formily/core").Form<T_3>;
|
96
96
|
useField: <T_4 = import("@formily/core").GeneralField>() => T_4;
|
97
97
|
useParentForm: () => import("@formily/core").Form<any> | import("@formily/core").ObjectField<any, any>;
|
package/lib/form/typing.d.ts
CHANGED
@@ -66,6 +66,7 @@ export interface ProFormProps extends IFormLayoutProps {
|
|
66
66
|
initialValues?: AnyObject;
|
67
67
|
initialRequest?: ProFormRequestConfig;
|
68
68
|
previewTextPlaceholder?: ReactNode;
|
69
|
+
validateFirst?: boolean;
|
69
70
|
onChange?: (values: any, fieldValue?: any, fieldName?: any) => any;
|
70
71
|
onSubmit?: ((values: any) => any) | CommonRequestConfig;
|
71
72
|
onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
|
package/lib/index.d.ts
CHANGED
@@ -9,6 +9,7 @@ import ProPageHeader from './page-header';
|
|
9
9
|
import ProTable from './table';
|
10
10
|
import ProSkeleton from './skeleton';
|
11
11
|
import utils from './utils';
|
12
|
+
import ProSidebar from './sidebar';
|
12
13
|
import { ProTimeline } from './timeline';
|
13
14
|
import * as nocode from './nocode';
|
14
15
|
import * as templates from './templates';
|
@@ -22,7 +23,8 @@ export * from './page-container';
|
|
22
23
|
export * from './page-header';
|
23
24
|
export * from './skeleton';
|
24
25
|
export * from './table';
|
26
|
+
export * from './sidebar';
|
25
27
|
export * from './utils';
|
26
28
|
export * from './timeline';
|
27
|
-
declare const version = "1.3.
|
28
|
-
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProTimeline, hooks, nocode, templates, utils, };
|
29
|
+
declare const version = "1.3.7";
|
30
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
@@ -18,6 +18,7 @@ var _exportNames = {
|
|
18
18
|
ProTable: true,
|
19
19
|
ProSkeleton: true,
|
20
20
|
utils: true,
|
21
|
+
ProSidebar: true,
|
21
22
|
ProTimeline: true,
|
22
23
|
nocode: true,
|
23
24
|
templates: true
|
@@ -64,6 +65,12 @@ Object.defineProperty(exports, "ProPageHeader", {
|
|
64
65
|
return _pageHeader.default;
|
65
66
|
}
|
66
67
|
});
|
68
|
+
Object.defineProperty(exports, "ProSidebar", {
|
69
|
+
enumerable: true,
|
70
|
+
get: function get() {
|
71
|
+
return _sidebar.default;
|
72
|
+
}
|
73
|
+
});
|
67
74
|
Object.defineProperty(exports, "ProSkeleton", {
|
68
75
|
enumerable: true,
|
69
76
|
get: function get() {
|
@@ -239,6 +246,20 @@ Object.keys(_utils).forEach(function (key) {
|
|
239
246
|
});
|
240
247
|
});
|
241
248
|
|
249
|
+
var _sidebar = _interopRequireWildcard(require("./sidebar"));
|
250
|
+
|
251
|
+
Object.keys(_sidebar).forEach(function (key) {
|
252
|
+
if (key === "default" || key === "__esModule") return;
|
253
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
254
|
+
if (key in exports && exports[key] === _sidebar[key]) return;
|
255
|
+
Object.defineProperty(exports, key, {
|
256
|
+
enumerable: true,
|
257
|
+
get: function get() {
|
258
|
+
return _sidebar[key];
|
259
|
+
}
|
260
|
+
});
|
261
|
+
});
|
262
|
+
|
242
263
|
var _timeline = require("./timeline");
|
243
264
|
|
244
265
|
Object.keys(_timeline).forEach(function (key) {
|
@@ -281,9 +302,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
281
302
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
282
303
|
|
283
304
|
// import ProLayout from './layout';
|
284
|
-
// import ProSidebar from './sidebar'
|
285
305
|
// 设置图标源
|
286
306
|
_icon.default.setConfig(_utils.default.getTeamixIconConfig());
|
287
307
|
|
288
|
-
var version = '1.3.
|
308
|
+
var version = '1.3.7';
|
289
309
|
exports.version = version;
|
@@ -34,7 +34,7 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
34
34
|
var labelCol = baseInfoLayout.labelCol,
|
35
35
|
wrapperCol = baseInfoLayout.wrapperCol;
|
36
36
|
return /*#__PURE__*/_react.default.createElement("div", {
|
37
|
-
className: cls()
|
37
|
+
className: cls('')
|
38
38
|
}, /*#__PURE__*/_react.default.createElement(Row, {
|
39
39
|
gutter: 10,
|
40
40
|
className: cls('base-row')
|