@vtx/components 4.0.0-beta.56 → 4.0.0-beta.58
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/es/vtx-export/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import PropTypes from 'prop-types';
|
|
|
12
12
|
import { ConfigProvider, Tooltip, Col, Form } from 'antd';
|
|
13
13
|
import classnames from 'classnames';
|
|
14
14
|
import { StoreCtx } from "./context";
|
|
15
|
+
import { useIntl } from "../vtx-provider";
|
|
15
16
|
|
|
16
17
|
// 24 栅格
|
|
17
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -19,6 +20,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
20
|
var SPAN = 24;
|
|
20
21
|
export default function FormItem(props) {
|
|
21
22
|
var _rest$rules;
|
|
23
|
+
var intl = useIntl();
|
|
22
24
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
23
25
|
getPrefixCls = _useContext.getPrefixCls;
|
|
24
26
|
var prefixCls = getPrefixCls('', 'vtx-form-layout-item');
|
|
@@ -59,33 +61,34 @@ export default function FormItem(props) {
|
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
var initPlaceholder = function initPlaceholder(placeholder, label, type) {
|
|
64
|
+
console.log('label, placeholder', placeholder, type === null || type === void 0 ? void 0 : type.displayName);
|
|
62
65
|
if (placeholder) {
|
|
63
66
|
return placeholder;
|
|
64
67
|
}
|
|
65
|
-
if (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return undefined;
|
|
76
|
-
}
|
|
68
|
+
if (['Input', 'InputNumber', 'VtxInput', 'TextArea', 'VtxEditor'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
69
|
+
// return '请输入' + label
|
|
70
|
+
return intl.getMessage('tableForm.inputPlaceholder', '请输入');
|
|
71
|
+
}
|
|
72
|
+
if (['Select', 'VtxColorPicker', 'VtxSelect', 'VtxCombogrid', 'VtxTreeSelect', 'VtxZtreeSelect', 'VtxSearchMapInput'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
73
|
+
// return '请选择' + label
|
|
74
|
+
return intl.getMessage('tableForm.selectPlaceholder', '请选择');
|
|
75
|
+
}
|
|
76
|
+
if (['DatePicker', 'RangePicker', 'TimePicker', 'VtxDatePicker', 'VtxRangePicker', 'VtxTimePicker', 'VtxTimeRangePicker'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
77
|
+
return undefined;
|
|
77
78
|
}
|
|
78
79
|
return null;
|
|
79
80
|
};
|
|
80
81
|
var renderItem = function renderItem(child) {
|
|
81
82
|
if ( /*#__PURE__*/isValidElement(child)) {
|
|
82
83
|
var _child$props;
|
|
83
|
-
|
|
84
|
+
console.log('initPlaceholder', child, label);
|
|
85
|
+
return /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
|
|
84
86
|
placeholder: initPlaceholder(child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.placeholder, label, child === null || child === void 0 ? void 0 : child.type)
|
|
85
|
-
});
|
|
87
|
+
}));
|
|
86
88
|
}
|
|
87
89
|
return child;
|
|
88
90
|
};
|
|
91
|
+
console.log('disableHtmlFor', disableHtmlFor, props.children);
|
|
89
92
|
return /*#__PURE__*/_jsx(Col, {
|
|
90
93
|
span: SPAN * weights / cols,
|
|
91
94
|
className: "".concat(prefixCls, "-col"),
|
package/es/vtx-modal/index.js
CHANGED
|
@@ -195,18 +195,20 @@ function VtxModal(props) {
|
|
|
195
195
|
destroyOnHidden: (_props$destroyOnClose = props.destroyOnClose) !== null && _props$destroyOnClose !== void 0 ? _props$destroyOnClose : true
|
|
196
196
|
};
|
|
197
197
|
var newProps = _objectSpread(_objectSpread(_objectSpread({
|
|
198
|
-
// maskClosable: false,
|
|
199
198
|
mask: {
|
|
200
199
|
closable: false
|
|
201
200
|
},
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
width: 700,
|
|
202
|
+
focusable: {
|
|
203
|
+
autoFocusButton: null,
|
|
204
|
+
focusTriggerAfterClose: true,
|
|
205
|
+
trap: false
|
|
206
|
+
}
|
|
204
207
|
}, props), legacyProps), {}, {
|
|
205
208
|
closable: false,
|
|
206
209
|
open: open,
|
|
207
210
|
title: title,
|
|
208
211
|
wrapClassName: classnames(prefixCls, hashId, wrapClassName, _defineProperty({}, "".concat(prefixCls, "-maxClass"), isFull ? true : false), classId.current),
|
|
209
|
-
// bodyStyle,
|
|
210
212
|
onCancel: onCancel,
|
|
211
213
|
style: _objectSpread(_objectSpread({}, props.style), isFull ? {} : transformStyle)
|
|
212
214
|
});
|
package/lib/vtx-export/index.js
CHANGED
|
@@ -114,6 +114,7 @@ var VtxExport = exports.VtxExport = function VtxExport(props) {
|
|
|
114
114
|
var status = false;
|
|
115
115
|
document.body.appendChild(div);
|
|
116
116
|
(0, _downloadFile.default)(downloadURL, {
|
|
117
|
+
timeout: timeout,
|
|
117
118
|
data: postData,
|
|
118
119
|
extraHeader: headers,
|
|
119
120
|
success: function success() {
|
|
@@ -10,6 +10,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _antd = require("antd");
|
|
11
11
|
var _classnames7 = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _context = require("./context");
|
|
13
|
+
var _vtxProvider = require("../vtx-provider");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
var _excluded = ["weights", "label", "inline", "hideTooltip", "disableHtmlFor", "tooltip", "hidden", "nameExtra"]; // 24 栅格
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -25,6 +26,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
25
26
|
var SPAN = 24;
|
|
26
27
|
function FormItem(props) {
|
|
27
28
|
var _rest$rules;
|
|
29
|
+
var intl = (0, _vtxProvider.useIntl)();
|
|
28
30
|
var _useContext = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext),
|
|
29
31
|
getPrefixCls = _useContext.getPrefixCls;
|
|
30
32
|
var prefixCls = getPrefixCls('', 'vtx-form-layout-item');
|
|
@@ -65,33 +67,34 @@ function FormItem(props) {
|
|
|
65
67
|
}
|
|
66
68
|
});
|
|
67
69
|
var initPlaceholder = function initPlaceholder(placeholder, label, type) {
|
|
70
|
+
console.log('label, placeholder', placeholder, type === null || type === void 0 ? void 0 : type.displayName);
|
|
68
71
|
if (placeholder) {
|
|
69
72
|
return placeholder;
|
|
70
73
|
}
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return undefined;
|
|
82
|
-
}
|
|
74
|
+
if (['Input', 'InputNumber', 'VtxInput', 'TextArea', 'VtxEditor'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
75
|
+
// return '请输入' + label
|
|
76
|
+
return intl.getMessage('tableForm.inputPlaceholder', '请输入');
|
|
77
|
+
}
|
|
78
|
+
if (['Select', 'VtxColorPicker', 'VtxSelect', 'VtxCombogrid', 'VtxTreeSelect', 'VtxZtreeSelect', 'VtxSearchMapInput'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
79
|
+
// return '请选择' + label
|
|
80
|
+
return intl.getMessage('tableForm.selectPlaceholder', '请选择');
|
|
81
|
+
}
|
|
82
|
+
if (['DatePicker', 'RangePicker', 'TimePicker', 'VtxDatePicker', 'VtxRangePicker', 'VtxTimePicker', 'VtxTimeRangePicker'].includes(type === null || type === void 0 ? void 0 : type.displayName)) {
|
|
83
|
+
return undefined;
|
|
83
84
|
}
|
|
84
85
|
return null;
|
|
85
86
|
};
|
|
86
87
|
var renderItem = function renderItem(child) {
|
|
87
88
|
if ( /*#__PURE__*/(0, _react.isValidElement)(child)) {
|
|
88
89
|
var _child$props;
|
|
89
|
-
|
|
90
|
+
console.log('initPlaceholder', child, label);
|
|
91
|
+
return /*#__PURE__*/_react.default.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
|
|
90
92
|
placeholder: initPlaceholder(child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.placeholder, label, child === null || child === void 0 ? void 0 : child.type)
|
|
91
|
-
});
|
|
93
|
+
}));
|
|
92
94
|
}
|
|
93
95
|
return child;
|
|
94
96
|
};
|
|
97
|
+
console.log('disableHtmlFor', disableHtmlFor, props.children);
|
|
95
98
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Col, {
|
|
96
99
|
span: SPAN * weights / cols,
|
|
97
100
|
className: "".concat(prefixCls, "-col"),
|
package/lib/vtx-modal/index.js
CHANGED
|
@@ -202,18 +202,20 @@ function VtxModal(props) {
|
|
|
202
202
|
destroyOnHidden: (_props$destroyOnClose = props.destroyOnClose) !== null && _props$destroyOnClose !== void 0 ? _props$destroyOnClose : true
|
|
203
203
|
};
|
|
204
204
|
var newProps = _objectSpread(_objectSpread(_objectSpread({
|
|
205
|
-
// maskClosable: false,
|
|
206
205
|
mask: {
|
|
207
206
|
closable: false
|
|
208
207
|
},
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
width: 700,
|
|
209
|
+
focusable: {
|
|
210
|
+
autoFocusButton: null,
|
|
211
|
+
focusTriggerAfterClose: true,
|
|
212
|
+
trap: false
|
|
213
|
+
}
|
|
211
214
|
}, props), legacyProps), {}, {
|
|
212
215
|
closable: false,
|
|
213
216
|
open: open,
|
|
214
217
|
title: title,
|
|
215
218
|
wrapClassName: (0, _classnames2.default)(prefixCls, hashId, wrapClassName, _defineProperty({}, "".concat(prefixCls, "-maxClass"), isFull ? true : false), classId.current),
|
|
216
|
-
// bodyStyle,
|
|
217
219
|
onCancel: onCancel,
|
|
218
220
|
style: _objectSpread(_objectSpread({}, props.style), isFull ? {} : transformStyle)
|
|
219
221
|
});
|