@teamix/pro 1.1.37 → 1.1.38
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 +687 -96
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog.d.ts +9 -0
- package/es/actions/dialog.js +96 -26
- package/es/actions/index.scss +31 -0
- package/es/actions/request.d.ts +1 -1
- package/es/actions/request.js +2 -2
- package/es/form/Components/ProField/index.d.ts +1 -84
- package/es/form/typing.d.ts +5 -5
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/{headerInfo → HeaderInfo}/index.d.ts +0 -0
- package/es/info/components/{headerInfo → HeaderInfo}/index.js +0 -0
- package/es/info/components/{headerInfo → HeaderInfo}/index.scss +0 -0
- package/es/info/components/InfoValueItem/index.js +3 -0
- package/es/info/components/{tableInfo → TableInfo}/index.d.ts +0 -0
- package/es/info/components/{tableInfo → TableInfo}/index.js +0 -0
- package/es/info/components/{tableInfo → TableInfo}/index.scss +0 -0
- package/es/info/components/baseInfo/index.js +29 -10
- package/es/info/index.js +28 -7
- package/es/info/typing.d.ts +3 -1
- package/es/table/components/Filter/index.js +7 -2
- package/es/table/components/Filter/index.scss +1 -1
- package/es/table/typing.d.ts +2 -0
- package/lib/actions/dialog.d.ts +9 -0
- package/lib/actions/dialog.js +99 -25
- package/lib/actions/index.scss +31 -0
- package/lib/actions/request.d.ts +1 -1
- package/lib/actions/request.js +2 -2
- package/lib/form/Components/ProField/index.d.ts +1 -84
- package/lib/form/typing.d.ts +5 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/{headerInfo → HeaderInfo}/index.d.ts +0 -0
- package/lib/info/components/{headerInfo → HeaderInfo}/index.js +0 -0
- package/lib/info/components/{headerInfo → HeaderInfo}/index.scss +0 -0
- package/lib/info/components/InfoValueItem/index.js +3 -0
- package/lib/info/components/{tableInfo → TableInfo}/index.d.ts +0 -0
- package/lib/info/components/{tableInfo → TableInfo}/index.js +0 -0
- package/lib/info/components/{tableInfo → TableInfo}/index.scss +0 -0
- package/lib/info/components/baseInfo/index.js +29 -10
- package/lib/info/index.js +27 -6
- package/lib/info/typing.d.ts +3 -1
- package/lib/table/components/Filter/index.js +7 -2
- package/lib/table/components/Filter/index.scss +1 -1
- package/lib/table/typing.d.ts +2 -0
- package/package.json +1 -1
package/es/info/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header", "onError", "className", "style", "columns", "layout", "dataSource"];
|
1
|
+
var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header", "onError", "className", "style", "columns", "layout", "dataSource", "loading", "extra"];
|
2
2
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
4
4
|
|
@@ -22,7 +22,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
22
22
|
|
23
23
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
24
24
|
|
25
|
-
import React, { useContext, useEffect, useRef, useState } from 'react';
|
25
|
+
import React, { isValidElement, useContext, useEffect, useRef, useState } from 'react';
|
26
26
|
import ProTableInfo from './components/tableInfo';
|
27
27
|
import ProHeaderInfo from './components/headerInfo';
|
28
28
|
import ProBaseInfo from './components/baseInfo';
|
@@ -51,6 +51,8 @@ var ProInfo = function ProInfo(props) {
|
|
51
51
|
columns = props.columns,
|
52
52
|
layout = props.layout,
|
53
53
|
dataSource = props.dataSource,
|
54
|
+
userLoading = props.loading,
|
55
|
+
extra = props.extra,
|
54
56
|
others = _objectWithoutProperties(props, _excluded);
|
55
57
|
|
56
58
|
var _useContext = useContext(ProInfoGroupContext),
|
@@ -127,19 +129,38 @@ var ProInfo = function ProInfo(props) {
|
|
127
129
|
getData.run({});
|
128
130
|
}
|
129
131
|
});
|
132
|
+
|
133
|
+
var getExtra = function getExtra() {
|
134
|
+
if (!extra) {
|
135
|
+
return undefined;
|
136
|
+
}
|
137
|
+
|
138
|
+
if ( /*#__PURE__*/isValidElement(extra)) {
|
139
|
+
return extra;
|
140
|
+
}
|
141
|
+
|
142
|
+
return _objectSpread(_objectSpread({}, extra), {}, {
|
143
|
+
context: {
|
144
|
+
record: dataSource !== null && dataSource !== void 0 ? dataSource : getDataSource(getData.data)
|
145
|
+
}
|
146
|
+
});
|
147
|
+
};
|
148
|
+
|
130
149
|
return /*#__PURE__*/React.createElement("div", {
|
131
150
|
ref: ref,
|
132
151
|
className: "teamix-pro-info ".concat(className !== null && className !== void 0 ? className : ''),
|
133
152
|
style: style
|
134
|
-
}, /*#__PURE__*/React.createElement(ProCard, _objectSpread(_objectSpread({
|
153
|
+
}, /*#__PURE__*/React.createElement(ProCard, _objectSpread(_objectSpread(_objectSpread({
|
135
154
|
compacted: true,
|
136
155
|
hoveredShadow: false,
|
137
156
|
bordered: false,
|
138
157
|
backgroundColor: "transparent"
|
139
|
-
}, header), others),
|
158
|
+
}, header), others), {}, {
|
159
|
+
extra: getExtra()
|
160
|
+
}), type === 'table' && /*#__PURE__*/React.createElement(ProTableInfo, {
|
140
161
|
dataSource: dataSource,
|
141
162
|
columns: columns,
|
142
|
-
loading: loading || getData.loading,
|
163
|
+
loading: userLoading || loading || getData.loading,
|
143
164
|
result: getDataSource(getData.data),
|
144
165
|
actionRef: actionRef,
|
145
166
|
layout: layout
|
@@ -147,7 +168,7 @@ var ProInfo = function ProInfo(props) {
|
|
147
168
|
dataSource: dataSource,
|
148
169
|
columns: columns,
|
149
170
|
header: header,
|
150
|
-
loading: loading || getData.loading,
|
171
|
+
loading: userLoading || loading || getData.loading,
|
151
172
|
result: getDataSource(getData.data),
|
152
173
|
actionRef: actionRef,
|
153
174
|
layout: layout,
|
@@ -155,7 +176,7 @@ var ProInfo = function ProInfo(props) {
|
|
155
176
|
}), type === 'base' && /*#__PURE__*/React.createElement(ProBaseInfo, {
|
156
177
|
dataSource: dataSource,
|
157
178
|
columns: columns,
|
158
|
-
loading: loading || getData.loading,
|
179
|
+
loading: userLoading || loading || getData.loading,
|
159
180
|
result: getDataSource(getData.data),
|
160
181
|
actionRef: actionRef,
|
161
182
|
layout: layout,
|
package/es/info/typing.d.ts
CHANGED
@@ -41,6 +41,8 @@ export declare type ProInfoBaseProps = {
|
|
41
41
|
};
|
42
42
|
/** 布局值 */
|
43
43
|
layout?: BaseInfoLayoutProps;
|
44
|
+
/** 加载动画 */
|
45
|
+
loading?: boolean;
|
44
46
|
} & ProInfoHeaderProps;
|
45
47
|
/** ProInfoItemProps info 单元格 定义 */
|
46
48
|
export interface ProInfoItemProps {
|
@@ -147,7 +149,7 @@ export declare type InfoValueItemProps = {
|
|
147
149
|
render?: ProInfoCellRender;
|
148
150
|
dataSource?: IProFieldOptionItem[] | ProInfoCellFunProp;
|
149
151
|
} & Omit<IProFieldProps, 'render' | 'dataSource'>;
|
150
|
-
export declare type ProInfoHeaderProps = CardProps
|
152
|
+
export declare type ProInfoHeaderProps = Omit<CardProps, 'loading'>;
|
151
153
|
/** ProInfoGroupContextProps */
|
152
154
|
export declare type ProInfoGroupContextProps = {
|
153
155
|
/** 因为其他数据都为异步。visible 只用作标识 */
|
@@ -35,7 +35,9 @@ var RadioItem = Menu.RadioItem;
|
|
35
35
|
|
36
36
|
var Filter = function Filter(props) {
|
37
37
|
var column = props.column,
|
38
|
-
actionRef = props.actionRef;
|
38
|
+
actionRef = props.actionRef;
|
39
|
+
var _column$filtersWidth = column.filtersWidth,
|
40
|
+
filtersWidth = _column$filtersWidth === void 0 ? 130 : _column$filtersWidth; // 选中过滤项
|
39
41
|
|
40
42
|
var _useState = useState([]),
|
41
43
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -154,7 +156,10 @@ var Filter = function Filter(props) {
|
|
154
156
|
return setVisible(false);
|
155
157
|
}
|
156
158
|
}, /*#__PURE__*/React.createElement("div", {
|
157
|
-
className: cls()
|
159
|
+
className: cls(),
|
160
|
+
style: {
|
161
|
+
width: filtersWidth
|
162
|
+
}
|
158
163
|
}, /*#__PURE__*/React.createElement(Menu, null, renderSelect(), /*#__PURE__*/React.createElement("div", {
|
159
164
|
className: cls({
|
160
165
|
'btn-box': true
|
package/es/table/typing.d.ts
CHANGED
@@ -47,6 +47,8 @@ export declare type ProColumnProps = {
|
|
47
47
|
filtersMode?: 'single' | 'multiple';
|
48
48
|
/** 表头的过滤菜单项在搜索之前的参数操作 */
|
49
49
|
beforeFilter?: (rules: string[]) => string;
|
50
|
+
/** 表头的过滤菜单宽度 */
|
51
|
+
filtersWidth?: string | number;
|
50
52
|
/** 操作组配置 */
|
51
53
|
actionSchema?: ActionGroupProps;
|
52
54
|
/** 指定列对应的字段,支持`a.b`形式的快速取值 和 数组取值 */
|
package/lib/actions/dialog.d.ts
CHANGED
@@ -1,14 +1,23 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { QuickShowConfig } from '@alicloudfe/components/types/dialog';
|
3
3
|
import { quickShowDrawerProps } from '@alicloudfe/components/types/drawer';
|
4
|
+
import { IFormSchema, IFormSchemaItem } from '../form';
|
4
5
|
import { RequestAction } from './request';
|
5
6
|
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | 'onOk' | 'onCancel' | 'onError'> {
|
7
|
+
/** 点击「确认按钮」后的数据请求地址,非必填,不填就不发请求 */
|
6
8
|
url?: string;
|
9
|
+
/** 弹窗类型,支持普通弹窗和抽屉两种模式,默认为普通弹窗 */
|
7
10
|
dialogType?: 'dialog' | 'drawer';
|
11
|
+
/** 弹窗快捷调用类型 */
|
8
12
|
dialogQuickShowType?: 'alert' | 'confirm';
|
13
|
+
/** 弹窗消息类型 */
|
9
14
|
messageType?: 'success' | 'warning' | 'error' | 'notice' | 'help' | 'loading';
|
15
|
+
/** 位于弹窗内容上方的自定义内容区 */
|
10
16
|
beforeContent?: React.ReactNode;
|
17
|
+
/** 位于弹窗内容下方的自定义内容区 */
|
11
18
|
afterContent?: React.ReactNode;
|
19
|
+
/** 弹窗页脚描述区,位于按钮组的对面 */
|
20
|
+
footerDescription?: React.ReactNode | IFormSchema | IFormSchemaItem;
|
12
21
|
}
|
13
22
|
export declare function useDialogAction(action: DialogAction, context?: any): {
|
14
23
|
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
package/lib/actions/dialog.js
CHANGED
@@ -10,18 +10,25 @@ exports.useDialogAction = useDialogAction;
|
|
10
10
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
12
12
|
|
13
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
14
|
+
|
13
15
|
var _reactRouterDom = require("react-router-dom");
|
14
16
|
|
15
17
|
var _components = require("@alicloudfe/components");
|
16
18
|
|
17
19
|
var _utils = require("@teamix/utils");
|
18
20
|
|
21
|
+
var _form = _interopRequireWildcard(require("../form"));
|
22
|
+
|
19
23
|
var _base = require("./base");
|
20
24
|
|
21
25
|
var _request = require("./request");
|
22
26
|
|
23
27
|
var _excluded = ["url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
|
24
|
-
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent"]
|
28
|
+
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "footerDescription", "footerAlign", "overlayProps"],
|
29
|
+
_excluded3 = ["className"];
|
30
|
+
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
32
|
|
26
33
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
27
34
|
|
@@ -31,16 +38,16 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
31
38
|
|
32
39
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
33
40
|
|
34
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
35
|
-
|
36
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
37
|
-
|
38
41
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
39
42
|
|
40
43
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
41
44
|
|
42
45
|
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; }
|
43
46
|
|
47
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
48
|
+
|
49
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
50
|
+
|
44
51
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
45
52
|
|
46
53
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -59,6 +66,27 @@ function addContextForReactNode(content, context) {
|
|
59
66
|
}
|
60
67
|
|
61
68
|
return content;
|
69
|
+
}
|
70
|
+
|
71
|
+
var FooterForm = function FooterForm(props) {
|
72
|
+
var schema = props.schema,
|
73
|
+
context = props.context,
|
74
|
+
formRef = props.formRef;
|
75
|
+
var form = (0, _form.createForm)();
|
76
|
+
(0, _react.useEffect)(function () {
|
77
|
+
formRef.current = form;
|
78
|
+
}, []);
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_form.default, {
|
80
|
+
layout: "inline",
|
81
|
+
feedbackLayout: "none",
|
82
|
+
form: form,
|
83
|
+
schema: (0, _utils.getTargetValue)(schema, context)
|
84
|
+
});
|
85
|
+
};
|
86
|
+
|
87
|
+
function getFooterAlignClass(isDrawer, align) {
|
88
|
+
var footerAlign = align ? align : isDrawer ? 'left' : 'right';
|
89
|
+
return "footer-align-".concat(footerAlign);
|
62
90
|
} // 弹窗 -> 请求(点击确认,发送数据请求)
|
63
91
|
|
64
92
|
|
@@ -68,8 +96,10 @@ function useDialogAction(action, context) {
|
|
68
96
|
loading = _useState2[0],
|
69
97
|
setLoading = _useState2[1];
|
70
98
|
|
99
|
+
var footerDescriptionRef = (0, _react.useRef)();
|
71
100
|
var history = (0, _reactRouterDom.useHistory)();
|
72
|
-
|
101
|
+
|
102
|
+
var onActionStart = function onActionStart() {
|
73
103
|
var url = action.url,
|
74
104
|
method = action.method,
|
75
105
|
params = action.params,
|
@@ -98,19 +128,54 @@ function useDialogAction(action, context) {
|
|
98
128
|
link = _getTargetValue.link,
|
99
129
|
beforeContent = _getTargetValue.beforeContent,
|
100
130
|
afterContent = _getTargetValue.afterContent,
|
101
|
-
|
131
|
+
footerDescription = _getTargetValue.footerDescription,
|
132
|
+
footerAlign = _getTargetValue.footerAlign,
|
133
|
+
_getTargetValue$overl = _getTargetValue.overlayProps,
|
134
|
+
overlayProps = _getTargetValue$overl === void 0 ? {} : _getTargetValue$overl,
|
135
|
+
containerProps = _objectWithoutProperties(_getTargetValue, _excluded2);
|
136
|
+
|
137
|
+
var isDrawer = dialogType === 'drawer';
|
138
|
+
var container = isDrawer ? _components.Drawer : _components.Dialog;
|
139
|
+
|
140
|
+
var overlayClassName = overlayProps.className,
|
141
|
+
overlayOtherProps = _objectWithoutProperties(overlayProps, _excluded3);
|
102
142
|
|
103
|
-
var
|
104
|
-
var dialogProps = dialogType === 'drawer' ? {} : {
|
143
|
+
var dialogOnlyProps = {
|
105
144
|
type: dialogQuickShowType,
|
106
145
|
messageProps: {
|
107
146
|
type: messageType
|
147
|
+
},
|
148
|
+
overlayProps: _objectSpread({
|
149
|
+
className: (0, _classnames.default)('teamix-pro-action-dialog', overlayClassName, {
|
150
|
+
'has-footer-description': !!footerDescription
|
151
|
+
})
|
152
|
+
}, overlayOtherProps)
|
153
|
+
};
|
154
|
+
var containerOtherProps = isDrawer ? {} : dialogOnlyProps;
|
155
|
+
|
156
|
+
var renderDialogFooterDescription = function renderDialogFooterDescription(footer) {
|
157
|
+
if (footer instanceof Array || footer.component) {
|
158
|
+
var _schema = footer instanceof Array ? footer : [footer];
|
159
|
+
|
160
|
+
return /*#__PURE__*/_react.default.createElement(FooterForm, {
|
161
|
+
formRef: footerDescriptionRef,
|
162
|
+
context: context,
|
163
|
+
schema: [{
|
164
|
+
component: 'FormFlex',
|
165
|
+
children: _schema
|
166
|
+
}]
|
167
|
+
});
|
108
168
|
}
|
169
|
+
|
170
|
+
return footer;
|
109
171
|
};
|
110
172
|
|
111
173
|
var onOk = function onOk() {
|
112
174
|
return new Promise( /*#__PURE__*/function () {
|
113
175
|
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve) {
|
176
|
+
var _footerDescriptionRef;
|
177
|
+
|
178
|
+
var footerDescriptionValues, requestContext;
|
114
179
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
115
180
|
while (1) {
|
116
181
|
switch (_context.prev = _context.next) {
|
@@ -130,29 +195,33 @@ function useDialogAction(action, context) {
|
|
130
195
|
|
131
196
|
case 5:
|
132
197
|
setLoading(true);
|
133
|
-
|
134
|
-
_context.
|
135
|
-
|
136
|
-
|
137
|
-
|
198
|
+
footerDescriptionValues = Object.assign({}, footerDescriptionRef === null || footerDescriptionRef === void 0 ? void 0 : (_footerDescriptionRef = footerDescriptionRef.current) === null || _footerDescriptionRef === void 0 ? void 0 : _footerDescriptionRef.values);
|
199
|
+
_context.prev = 7;
|
200
|
+
requestContext = Object.assign({
|
201
|
+
footer: footerDescriptionValues
|
202
|
+
}, context);
|
203
|
+
_context.next = 11;
|
204
|
+
return (0, _request.doRequest)(action, requestContext, history, footerDescriptionValues);
|
205
|
+
|
206
|
+
case 11:
|
138
207
|
onFinish && onFinish();
|
139
208
|
resolve(true);
|
140
|
-
_context.next =
|
209
|
+
_context.next = 20;
|
141
210
|
break;
|
142
211
|
|
143
|
-
case
|
144
|
-
_context.prev =
|
145
|
-
_context.t0 = _context["catch"](
|
212
|
+
case 15:
|
213
|
+
_context.prev = 15;
|
214
|
+
_context.t0 = _context["catch"](7);
|
146
215
|
setLoading(false);
|
147
216
|
resolve(false);
|
148
217
|
return _context.abrupt("return");
|
149
218
|
|
150
|
-
case
|
219
|
+
case 20:
|
151
220
|
case "end":
|
152
221
|
return _context.stop();
|
153
222
|
}
|
154
223
|
}
|
155
|
-
}, _callee, null, [[
|
224
|
+
}, _callee, null, [[7, 15]]);
|
156
225
|
}));
|
157
226
|
|
158
227
|
return function (_x) {
|
@@ -176,7 +245,7 @@ function useDialogAction(action, context) {
|
|
176
245
|
var dialogContent = Component ? /*#__PURE__*/_react.default.createElement(Component, _objectSpread({
|
177
246
|
key: (0, _utils.uuid)()
|
178
247
|
}, componentProps)) : addContextForReactNode(content, dialogContext);
|
179
|
-
var ret =
|
248
|
+
var ret = container.show(_objectSpread(_objectSpread({
|
180
249
|
// @ts-ignore
|
181
250
|
onOk: onOk,
|
182
251
|
title: addContextForReactNode(title, dialogContext),
|
@@ -184,11 +253,16 @@ function useDialogAction(action, context) {
|
|
184
253
|
className: "teamix-pro-dialog-before-content"
|
185
254
|
}, beforeContent), dialogContent, afterContent && /*#__PURE__*/_react.default.createElement("div", {
|
186
255
|
className: "teamix-pro-dialog-after-content"
|
187
|
-
}, afterContent)
|
188
|
-
|
189
|
-
|
256
|
+
}, afterContent), footerDescription && /*#__PURE__*/_react.default.createElement("div", {
|
257
|
+
className: (0, _classnames.default)('teamix-pro-dialog-footer-description', getFooterAlignClass(isDrawer, footerAlign))
|
258
|
+
}, renderDialogFooterDescription(footerDescription))),
|
259
|
+
closeable: !loading,
|
260
|
+
footerAlign: footerAlign
|
261
|
+
}, containerOtherProps), containerProps));
|
190
262
|
store.hide = ret.hide;
|
191
|
-
}
|
263
|
+
};
|
264
|
+
|
265
|
+
return _objectSpread({}, (0, _base.eventHandler)(action, onActionStart));
|
192
266
|
}
|
193
267
|
|
194
268
|
var _default = useDialogAction;
|
package/lib/actions/index.scss
CHANGED
@@ -29,6 +29,31 @@
|
|
29
29
|
}
|
30
30
|
}
|
31
31
|
|
32
|
+
.teamix-pro-dialog-footer-description {
|
33
|
+
position: absolute;
|
34
|
+
z-index: 5;
|
35
|
+
display: flex;
|
36
|
+
align-items: center;
|
37
|
+
bottom: var(--dialog-footer-padding-top, 16px);
|
38
|
+
height: var(--btn-size-m-height, 32px);
|
39
|
+
|
40
|
+
&.footer-align-right {
|
41
|
+
left: var(--dialog-footer-padding-left-right, 20px);
|
42
|
+
}
|
43
|
+
&.footer-align-center {
|
44
|
+
left: var(--dialog-footer-padding-left-right, 20px);
|
45
|
+
}
|
46
|
+
&.footer-align-left {
|
47
|
+
right: var(--dialog-footer-padding-left-right, 20px);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
.teamix-pro-action-dialog.has-footer-description {
|
52
|
+
.next-message {
|
53
|
+
position: static;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
32
57
|
.teamix-pro-dialog-before-content {
|
33
58
|
margin-bottom: var(--s-2);
|
34
59
|
}
|
@@ -40,3 +65,9 @@
|
|
40
65
|
.next-menu-divider + .next-menu-divider {
|
41
66
|
display: none;
|
42
67
|
}
|
68
|
+
|
69
|
+
.next-dialog-body {
|
70
|
+
.teamix-pro-form {
|
71
|
+
margin-bottom: -20px;
|
72
|
+
}
|
73
|
+
}
|
package/lib/actions/request.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { CommonRequestConfig } from '@teamix/utils';
|
|
2
2
|
import { BaseAction } from './base';
|
3
3
|
export interface RequestAction extends CommonRequestConfig, BaseAction {
|
4
4
|
}
|
5
|
-
export declare function doRequest(action: RequestAction, context?: any, history?: any): Promise<unknown>;
|
5
|
+
export declare function doRequest(action: RequestAction, context?: any, history?: any, extraParams?: any): Promise<unknown>;
|
6
6
|
export declare function useRequestAction(action: RequestAction, context?: any): {
|
7
7
|
loading: boolean;
|
8
8
|
};
|
package/lib/actions/request.js
CHANGED
@@ -41,14 +41,14 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
41
41
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
42
42
|
|
43
43
|
// action 里的数据请求都默认是 post 类型
|
44
|
-
function doRequest(action, context, history) {
|
44
|
+
function doRequest(action, context, history, extraParams) {
|
45
45
|
var _action$method = action.method,
|
46
46
|
method = _action$method === void 0 ? 'post' : _action$method,
|
47
47
|
others = _objectWithoutProperties(action, _excluded);
|
48
48
|
|
49
49
|
return (0, _utils.doCommonRequest)(_objectSpread({
|
50
50
|
method: method
|
51
|
-
}, others), context, history);
|
51
|
+
}, others), context, history, extraParams);
|
52
52
|
}
|
53
53
|
|
54
54
|
function useRequestAction(action, context) {
|
@@ -1,162 +1,79 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
declare const _default: React.ForwardRefExoticComponent<(Partial<import("@teamix/pro-field/lib/components/FieldText").IProFieldText & {
|
3
3
|
type: "text";
|
4
|
-
} & {
|
5
|
-
children?: React.ReactNode;
|
6
4
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTextArea").IProFieldTextArea & {
|
7
5
|
type: "textarea";
|
8
|
-
} & {
|
9
|
-
children?: React.ReactNode;
|
10
6
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldMoney").IProFieldMoney & {
|
11
7
|
type: "money";
|
12
|
-
} & {
|
13
|
-
children?: React.ReactNode;
|
14
8
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldCheckBox").IProFieldCheckBox & {
|
15
9
|
type: "checkbox";
|
16
|
-
} & {
|
17
|
-
children?: React.ReactNode;
|
18
10
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldRadio").IProFieldRadio & {
|
19
11
|
type: "radio";
|
20
|
-
} & {
|
21
|
-
children?: React.ReactNode;
|
22
12
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldSelect").IProFieldSelect & {
|
23
13
|
type: "select";
|
24
|
-
} & {
|
25
|
-
children?: React.ReactNode;
|
26
14
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldMultipleSelect").IProFieldMultipleSelect & {
|
27
15
|
type: "multipleSelect";
|
28
|
-
} & {
|
29
|
-
children?: React.ReactNode;
|
30
16
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDate & {
|
31
17
|
type: "date";
|
32
|
-
} & {
|
33
|
-
children?: React.ReactNode;
|
34
18
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateWeek & {
|
35
19
|
type: "dateWeek";
|
36
|
-
} & {
|
37
|
-
children?: React.ReactNode;
|
38
20
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateMonth & {
|
39
21
|
type: "dateMonth";
|
40
|
-
} & {
|
41
|
-
children?: React.ReactNode;
|
42
22
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateYear & {
|
43
23
|
type: "dateYear";
|
44
|
-
} & {
|
45
|
-
children?: React.ReactNode;
|
46
24
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateQuarter & {
|
47
25
|
type: "dateQuarter";
|
48
|
-
} & {
|
49
|
-
children?: React.ReactNode;
|
50
26
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateRange & {
|
51
27
|
type: "dateRange";
|
52
|
-
} & {
|
53
|
-
children?: React.ReactNode;
|
54
28
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateWeekRange & {
|
55
29
|
type: "dateWeekRange";
|
56
|
-
} & {
|
57
|
-
children?: React.ReactNode;
|
58
30
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateMonthRange & {
|
59
31
|
type: "dateMonthRange";
|
60
|
-
} & {
|
61
|
-
children?: React.ReactNode;
|
62
32
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateYearRange & {
|
63
33
|
type: "dateYearRange";
|
64
|
-
} & {
|
65
|
-
children?: React.ReactNode;
|
66
34
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateQuarterRange & {
|
67
35
|
type: "dateQuarterRange";
|
68
|
-
} & {
|
69
|
-
children?: React.ReactNode;
|
70
36
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateTime & {
|
71
37
|
type: "dateTime";
|
72
|
-
} & {
|
73
|
-
children?: React.ReactNode;
|
74
38
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateTimeRange & {
|
75
39
|
type: "dateTimeRange";
|
76
|
-
} & {
|
77
|
-
children?: React.ReactNode;
|
78
40
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldTime & {
|
79
41
|
type: "time";
|
80
|
-
} & {
|
81
|
-
children?: React.ReactNode;
|
82
42
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldTimeRange & {
|
83
43
|
type: "timeRange";
|
84
|
-
} & {
|
85
|
-
children?: React.ReactNode;
|
86
44
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldNumber").IProFieldNumber & {
|
87
45
|
type: "number";
|
88
|
-
} & {
|
89
|
-
children?: React.ReactNode;
|
90
46
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldPercent").IProFieldPercent & {
|
91
47
|
type: "percent";
|
92
|
-
} & {
|
93
|
-
children?: React.ReactNode;
|
94
48
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldCascader & {
|
95
49
|
type: "cascader";
|
96
|
-
} & {
|
97
|
-
children?: React.ReactNode;
|
98
50
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldMultipleCascader & {
|
99
51
|
type: "multipleCascader";
|
100
|
-
} & {
|
101
|
-
children?: React.ReactNode;
|
102
52
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldArbitraryCascader & {
|
103
53
|
type: "arbitraryCascader";
|
104
|
-
} & {
|
105
|
-
children?: React.ReactNode;
|
106
54
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldSwitch").IProFieldSwitch & {
|
107
55
|
type: "switch";
|
108
|
-
} & {
|
109
|
-
children?: React.ReactNode;
|
110
56
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldColor").IProFieldColor & {
|
111
57
|
type: "color" | "colorSwatches" | "colorRadio" | "colorTwitter";
|
112
|
-
} & {
|
113
|
-
children?: React.ReactNode;
|
114
58
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldIcon").IProFieldIcon & {
|
115
59
|
type: "icon";
|
116
|
-
} & {
|
117
|
-
children?: React.ReactNode;
|
118
60
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTreeSelect").IProFieldTreeSelect & {
|
119
61
|
type: "treeSelect";
|
120
|
-
} & {
|
121
|
-
children?: React.ReactNode;
|
122
62
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldJson").IProFieldJson & {
|
123
63
|
type: "json";
|
124
|
-
} & {
|
125
|
-
children?: React.ReactNode;
|
126
64
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTransfer").IProFieldTransfer & {
|
127
65
|
type: "transfer";
|
128
|
-
} & {
|
129
|
-
children?: React.ReactNode;
|
130
66
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldRange").IProFieldRange & {
|
131
67
|
type: "range";
|
132
|
-
} & {
|
133
|
-
children?: React.ReactNode;
|
134
68
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldPassword").IProFieldPassword & {
|
135
69
|
type: "password";
|
136
|
-
} & {
|
137
|
-
children?: React.ReactNode;
|
138
70
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldSearch").IProFieldSearch & {
|
139
71
|
type: "search";
|
140
|
-
} & {
|
141
|
-
children?: React.ReactNode;
|
142
72
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTagFilter").IProFieldTagFilter & {
|
143
73
|
type: "tagFilter";
|
144
|
-
} & {
|
145
|
-
children?: React.ReactNode;
|
146
74
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTagFilter").IProFieldMultipleTagFilter & {
|
147
75
|
type: "multipleTagPicker";
|
148
|
-
} & {
|
149
|
-
children?: React.ReactNode;
|
150
76
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldMenuSelect").IProFieldMenuSelect & {
|
151
77
|
type: "menuSelect";
|
152
|
-
} &
|
153
|
-
children?: React.ReactNode;
|
154
|
-
}> | Pick<Partial<{
|
155
|
-
[key: string]: any;
|
156
|
-
type: string;
|
157
|
-
value?: any;
|
158
|
-
initValue?: any;
|
159
|
-
} & import("@teamix/pro-field").IProBaseField & {
|
160
|
-
children?: React.ReactNode;
|
161
|
-
}>, string | number>) & React.RefAttributes<unknown>>;
|
78
|
+
}> | Pick<Partial<import("@teamix/pro-field").IProFieldCustom>, keyof import("@teamix/pro-field").IProFieldCustom>) & React.RefAttributes<unknown>>;
|
162
79
|
export default _default;
|
package/lib/form/typing.d.ts
CHANGED
@@ -33,11 +33,11 @@ export interface IFormSchemaItem {
|
|
33
33
|
tooltip?: string;
|
34
34
|
required?: boolean;
|
35
35
|
display?: FieldDisplayTypes;
|
36
|
-
visible?: boolean;
|
37
|
-
hidden?: boolean;
|
38
|
-
disabled?: boolean;
|
39
|
-
readOnly?: boolean;
|
40
|
-
readPretty?: boolean;
|
36
|
+
visible?: boolean | string;
|
37
|
+
hidden?: boolean | string;
|
38
|
+
disabled?: boolean | string;
|
39
|
+
readOnly?: boolean | string;
|
40
|
+
readPretty?: boolean | string;
|
41
41
|
pattern?: FieldPatternTypes;
|
42
42
|
default?: any;
|
43
43
|
request?: IRequestConfig;
|
package/lib/index.d.ts
CHANGED
@@ -21,5 +21,5 @@ export * from './page-container';
|
|
21
21
|
export * from './page-header';
|
22
22
|
export * from './skeleton';
|
23
23
|
export * from './table';
|
24
|
-
declare const version = "1.1.
|
24
|
+
declare const version = "1.1.37";
|
25
25
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
File without changes
|
File without changes
|