@vtx/components 4.0.0-beta.7 → 4.0.0-beta.8
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-color-picker/index.js +138 -33
- package/es/vtx-color-picker/style/index.js +36 -12
- package/es/vtx-combogrid/Combogrid.js +11 -6
- package/es/vtx-combogrid/style/index.js +4 -4
- package/es/vtx-datagrid/Store/Provide.js +5 -4
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -2
- package/es/vtx-datagrid/ToolBar/index.js +2 -2
- package/es/vtx-datagrid/index.js +14 -9
- package/es/vtx-form-layout/FormItem.js +2 -1
- package/es/vtx-import2/index.js +1 -1
- package/es/vtx-input/TextArea/index.js +11 -6
- package/es/vtx-modal/style/index.js +5 -3
- package/es/vtx-page-layout/Content.js +1 -1
- package/es/vtx-page-layout/TabLayout.js +1 -7
- package/es/vtx-page-layout/TableLayout.js +14 -4
- package/es/vtx-page-layout/TableWrap.js +3 -2
- package/es/vtx-page-layout/TreeLayout.js +2 -8
- package/es/vtx-page-layout/container.js +6 -5
- package/es/vtx-provider/index.js +14 -8
- package/es/vtx-provider/locale/en_US.js +10 -2
- package/es/vtx-provider/locale/zh_CN.js +20 -2
- package/es/vtx-provider/useStyle/index.js +8 -4
- package/es/vtx-scrollable-row/index.js +38 -28
- package/es/vtx-search/index.js +5 -4
- package/es/vtx-select/index.js +25 -11
- package/es/vtx-tree/index.js +14 -13
- package/es/vtx-tree-select/index.js +4 -0
- package/es/vtx-wang-editor/index.js +227 -102
- package/es/vtx-wang-editor/wangEditorUtil.js +55 -9
- package/lib/vtx-color-picker/index.js +139 -34
- package/lib/vtx-color-picker/style/index.js +36 -12
- package/lib/vtx-combogrid/Combogrid.js +11 -6
- package/lib/vtx-combogrid/style/index.js +4 -4
- package/lib/vtx-datagrid/Store/Provide.js +5 -4
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +4 -3
- package/lib/vtx-datagrid/ToolBar/index.js +2 -2
- package/lib/vtx-datagrid/index.js +15 -9
- package/lib/vtx-form-layout/FormItem.js +2 -1
- package/lib/vtx-import2/index.js +1 -1
- package/lib/vtx-input/TextArea/index.js +11 -6
- package/lib/vtx-modal/style/index.js +5 -3
- package/lib/vtx-page-layout/Content.js +1 -1
- package/lib/vtx-page-layout/TabLayout.js +3 -9
- package/lib/vtx-page-layout/TableLayout.js +14 -4
- package/lib/vtx-page-layout/TableWrap.js +3 -2
- package/lib/vtx-page-layout/TreeLayout.js +4 -10
- package/lib/vtx-page-layout/container.js +6 -5
- package/lib/vtx-provider/index.js +13 -8
- package/lib/vtx-provider/locale/en_US.js +10 -2
- package/lib/vtx-provider/locale/zh_CN.js +20 -2
- package/lib/vtx-provider/useStyle/index.js +8 -4
- package/lib/vtx-scrollable-row/index.js +38 -28
- package/lib/vtx-search/index.js +5 -4
- package/lib/vtx-select/index.js +25 -11
- package/lib/vtx-tree/index.js +14 -13
- package/lib/vtx-tree-select/index.js +4 -0
- package/lib/vtx-wang-editor/index.js +226 -103
- package/lib/vtx-wang-editor/wangEditorUtil.js +55 -10
- package/package.json +5 -3
|
@@ -1,70 +1,175 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["value", "onChange", "className", "style", "disabled"];
|
|
2
|
+
var _excluded = ["value", "onChange", "className", "style", "disabled", "format", "input", "panelStyle"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
-
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."); }
|
|
10
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
8
|
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; }
|
|
15
9
|
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; }
|
|
16
|
-
import {
|
|
10
|
+
import React, { forwardRef, useContext, useMemo, useState, useCallback } from 'react';
|
|
11
|
+
import { Input, Space, ColorPicker, Row, Col } from 'antd';
|
|
17
12
|
import classnames from 'classnames';
|
|
18
|
-
import
|
|
19
|
-
import { useStyle } from "./style
|
|
13
|
+
import PropTypes from 'prop-types';
|
|
14
|
+
import { useStyle } from "./style";
|
|
20
15
|
import { getPlaceholder } from "../utils";
|
|
16
|
+
import { useIntl, VtxProvider } from "../vtx-provider";
|
|
21
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
19
|
var VtxColorPicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
20
|
+
var intl = useIntl();
|
|
24
21
|
var value = props.value,
|
|
25
|
-
|
|
22
|
+
_onChange = props.onChange,
|
|
26
23
|
className = props.className,
|
|
27
24
|
style = props.style,
|
|
28
25
|
disabled = props.disabled,
|
|
26
|
+
_props$format = props.format,
|
|
27
|
+
format = _props$format === void 0 ? 'hex' : _props$format,
|
|
28
|
+
_props$input = props.input,
|
|
29
|
+
input = _props$input === void 0 ? true : _props$input,
|
|
30
|
+
panelStyle = props.panelStyle,
|
|
29
31
|
rest = _objectWithoutProperties(props, _excluded);
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
var
|
|
32
|
+
var getVtxPresets = function getVtxPresets() {
|
|
33
|
+
return [{
|
|
34
|
+
label: intl.getMessage('colorPicker.basic', '基础颜色'),
|
|
35
|
+
key: 'basic',
|
|
36
|
+
colors: ['#0EBF37', '#1890FF', '#FAAD14', '#FF4D4F', '#898989', '#13C2C2', '#FA8C16', '#722ED1', '#EB2F96', '#2F54EB']
|
|
37
|
+
}, {
|
|
38
|
+
label: intl.getMessage('colorPicker.chart', '图表颜色'),
|
|
39
|
+
key: 'chart',
|
|
40
|
+
colors: ['#249AF8', '#1FC678', '#FFB737', '#4ABEFF', '#FD6865', '#A09CF7', '#1BCEBF', '#F58E44', '#27AD8E', '#F18F86', '#7996FF', '#5AD8A6', '#E9C140', '#79C2E6', '#FF9E9E', '#D396DE', '#3CBDCB', '#F29F64', '#85ACD7', '#FDA3C7']
|
|
41
|
+
}];
|
|
42
|
+
};
|
|
43
|
+
var getNormalPresets = function getNormalPresets() {
|
|
44
|
+
return [{
|
|
45
|
+
label: '',
|
|
46
|
+
key: '1',
|
|
47
|
+
colors: ['#F5222D', '#FA8C16', '#FAAD14', '#52C41A', '#389E0D', '#CF1322', '#1677FF', '#5B83FB', '#9254DE', '#5D7092']
|
|
48
|
+
}];
|
|
49
|
+
};
|
|
50
|
+
var getHorizontalPresets = function getHorizontalPresets(token) {
|
|
51
|
+
return [{
|
|
52
|
+
label: intl.getMessage('colorPicker.primary', '主要'),
|
|
53
|
+
key: '主要',
|
|
54
|
+
colors: ['#E6F4FF', '#BAE0FF', '#91CAFF', '#69B1FF', '#4096FF', '#1677FF', '#0958D9', '#003EB3', '#002C8C', '#001D66']
|
|
55
|
+
}, {
|
|
56
|
+
label: intl.getMessage('colorPicker.danger', '红色'),
|
|
57
|
+
key: '红色',
|
|
58
|
+
colors: ['#FFF1F0', '#FFCCC7', '#FFA39E', '#FF7875', '#FF4D4F', '#F5222D', '#CF1322', '#A8071A', '#820014', '#5C0011']
|
|
59
|
+
}, {
|
|
60
|
+
label: intl.getMessage('colorPicker.success', '绿色'),
|
|
61
|
+
key: '绿色',
|
|
62
|
+
colors: ['#F6FFED', '#D9F7BE', '#B7EB8F', '#95DE64', '#73D13D', '#52C41A', '#389E0D', '#237804', '#135200', '#092B00']
|
|
63
|
+
}, {
|
|
64
|
+
label: intl.getMessage('colorPicker.info', '青色'),
|
|
65
|
+
key: '青色',
|
|
66
|
+
colors: ['#E6FFFB', '#B5F5EC', '#87E8DE', '#5CDBD3', '#36CFC9', '#13C2C2', '#08979C', '#006D75', '#00474F', '#002329']
|
|
67
|
+
}];
|
|
68
|
+
};
|
|
69
|
+
var _useContext = useContext(VtxProvider),
|
|
42
70
|
getPrefixCls = _useContext.getPrefixCls;
|
|
43
|
-
var prefixCls = getPrefixCls('
|
|
71
|
+
var prefixCls = getPrefixCls('color-picker', props.prefixCls);
|
|
44
72
|
var _useStyle = useStyle(prefixCls),
|
|
45
73
|
wrapSSR = _useStyle.wrapSSR,
|
|
46
74
|
hashId = _useStyle.hashId;
|
|
75
|
+
var getChangeFun = useCallback(function () {
|
|
76
|
+
switch (format) {
|
|
77
|
+
case 'hsb':
|
|
78
|
+
return 'toHsbString';
|
|
79
|
+
case 'rgb':
|
|
80
|
+
return 'toRgbString';
|
|
81
|
+
default:
|
|
82
|
+
return 'toHexString';
|
|
83
|
+
}
|
|
84
|
+
}, [format]);
|
|
85
|
+
var horizontalPanelRender = function horizontalPanelRender(_, _ref) {
|
|
86
|
+
var _ref$components = _ref.components,
|
|
87
|
+
Picker = _ref$components.Picker,
|
|
88
|
+
Presets = _ref$components.Presets;
|
|
89
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
90
|
+
className: classnames("".concat(prefixCls, "-horizontal")),
|
|
91
|
+
children: [/*#__PURE__*/_jsx(Presets, {}), /*#__PURE__*/_jsx("div", {
|
|
92
|
+
children: /*#__PURE__*/_jsx(Picker, {})
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
var verticalPanelRender = function verticalPanelRender(_, _ref2) {
|
|
97
|
+
var _ref2$components = _ref2.components,
|
|
98
|
+
Picker = _ref2$components.Picker,
|
|
99
|
+
Presets = _ref2$components.Presets;
|
|
100
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
101
|
+
className: classnames("".concat(prefixCls, "-vertical")),
|
|
102
|
+
children: [/*#__PURE__*/_jsx(Picker, {}), /*#__PURE__*/_jsx(Presets, {})]
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
var panelStyleProps = _objectSpread(_objectSpread(_objectSpread({}, panelStyle === 'vtx' ? {
|
|
106
|
+
presets: getVtxPresets(),
|
|
107
|
+
styles: {
|
|
108
|
+
popupOverlayInner: {
|
|
109
|
+
width: 460
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
panelRender: horizontalPanelRender
|
|
113
|
+
} : {}), panelStyle === 'normal' ? {
|
|
114
|
+
presets: getNormalPresets(),
|
|
115
|
+
styles: {
|
|
116
|
+
popupOverlayInner: {
|
|
117
|
+
width: 258
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
panelRender: verticalPanelRender
|
|
121
|
+
} : {}), panelStyle === 'horizontal' ? {
|
|
122
|
+
presets: getHorizontalPresets(),
|
|
123
|
+
styles: {
|
|
124
|
+
popupOverlayInner: {
|
|
125
|
+
width: 504
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
panelRender: horizontalPanelRender
|
|
129
|
+
} : {});
|
|
47
130
|
return wrapSSR( /*#__PURE__*/_jsxs(Space.Compact, {
|
|
48
131
|
style: {
|
|
49
132
|
width: '100%'
|
|
50
133
|
},
|
|
51
|
-
children: [/*#__PURE__*/_jsx(Input, {
|
|
134
|
+
children: [input && /*#__PURE__*/_jsx(Input, {
|
|
52
135
|
ref: ref,
|
|
53
|
-
value:
|
|
136
|
+
value: value,
|
|
54
137
|
placeholder: getPlaceholder(props.placeholder),
|
|
55
138
|
readOnly: true,
|
|
56
139
|
disabled: disabled,
|
|
57
|
-
className: classnames(prefixCls,
|
|
140
|
+
className: classnames("".concat(prefixCls, "-input"), hashId),
|
|
58
141
|
style: style
|
|
59
|
-
}),
|
|
142
|
+
}), /*#__PURE__*/_jsx(ColorPicker, _objectSpread(_objectSpread({
|
|
60
143
|
animation: "slide-up",
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
onChange:
|
|
64
|
-
|
|
65
|
-
|
|
144
|
+
allowClear: true,
|
|
145
|
+
className: classnames(prefixCls, className, hashId),
|
|
146
|
+
onChange: function onChange(e, css) {
|
|
147
|
+
var _e$colors;
|
|
148
|
+
var res = undefined;
|
|
149
|
+
if (((_e$colors = e.colors) === null || _e$colors === void 0 ? void 0 : _e$colors.length) > 1) {
|
|
150
|
+
res = e === null || e === void 0 ? void 0 : e.toCssString();
|
|
151
|
+
} else {
|
|
152
|
+
var _e$getChangeFun;
|
|
153
|
+
res = e === null || e === void 0 || (_e$getChangeFun = e[getChangeFun(format)]) === null || _e$getChangeFun === void 0 ? void 0 : _e$getChangeFun.call(e);
|
|
154
|
+
}
|
|
155
|
+
if (e.cleared) {
|
|
156
|
+
res = undefined;
|
|
157
|
+
}
|
|
158
|
+
_onChange === null || _onChange === void 0 || _onChange(res, css);
|
|
159
|
+
},
|
|
160
|
+
value: value,
|
|
161
|
+
disabled: disabled
|
|
162
|
+
}, panelStyleProps), rest))]
|
|
66
163
|
}));
|
|
67
164
|
});
|
|
68
165
|
VtxColorPicker.displayName = 'VtxColorPicker';
|
|
166
|
+
VtxColorPicker.propTypes = {
|
|
167
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
168
|
+
onChange: PropTypes.func,
|
|
169
|
+
className: PropTypes.string,
|
|
170
|
+
style: PropTypes.object,
|
|
171
|
+
disabled: PropTypes.bool,
|
|
172
|
+
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
|
|
173
|
+
};
|
|
69
174
|
export { VtxColorPicker };
|
|
70
175
|
export default VtxColorPicker;
|
|
@@ -4,21 +4,45 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import 'rc-color-picker/assets/index.css';
|
|
8
7
|
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
9
8
|
var genVtxColorPickerStyle = function genVtxColorPickerStyle(token) {
|
|
10
9
|
var componentCls = token.componentCls;
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
return {
|
|
11
|
+
'.ant-color-picker-inner': _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty({}, "&-vertical, &-horizontal", {
|
|
12
|
+
'.ant-color-picker-presets': {
|
|
13
|
+
paddingTop: 4,
|
|
14
|
+
'.ant-color-picker-presets-items': {
|
|
15
|
+
'.ant-color-picker-presets-color': {
|
|
16
|
+
width: 18,
|
|
17
|
+
height: 18,
|
|
18
|
+
'&::before': {
|
|
19
|
+
width: "calc(18px + var(--ant-line-width) * 4)",
|
|
20
|
+
height: "calc(18px + var(--ant-line-width) * 4)"
|
|
21
|
+
},
|
|
22
|
+
'&::affter': {
|
|
23
|
+
width: "calc(18px / 13 * 5)",
|
|
24
|
+
height: "calc(18px / 13 * 8)"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}), "&-vertical", {
|
|
30
|
+
'.ant-collapse-header': {
|
|
31
|
+
display: 'none'
|
|
32
|
+
}
|
|
33
|
+
}), "&-horizontal", {
|
|
34
|
+
display: 'flex',
|
|
35
|
+
gap: 12,
|
|
36
|
+
'.ant-color-picker-presets': {
|
|
37
|
+
flex: 1
|
|
38
|
+
},
|
|
39
|
+
'>div': {
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexDirection: 'column',
|
|
42
|
+
width: 234
|
|
43
|
+
}
|
|
44
|
+
}))
|
|
45
|
+
};
|
|
22
46
|
};
|
|
23
47
|
export function useStyle(prefixCls) {
|
|
24
48
|
return useAntdStyle('VtxColorPicker', function (token) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["setPopoverVisible", "multiple", "onChange", "getTableData", "columns", "searchForms", "selectedRowKeys", "setSelectedRowKeys", "spread", "defaultPageSize", "customEnumText"];
|
|
2
|
+
var _excluded = ["setPopoverVisible", "multiple", "onChange", "getTableData", "columns", "searchForms", "selectedRowKeys", "setSelectedRowKeys", "spread", "defaultPageSize", "customEnumText", "headFootHeight", "popoverWidth"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -27,10 +27,6 @@ function VtxCombogrid(props, ref) {
|
|
|
27
27
|
var intl = useIntl();
|
|
28
28
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
29
29
|
getPrefixCls = _useContext.getPrefixCls;
|
|
30
|
-
var prefixCls = getPrefixCls('', 'vtx-combogrid');
|
|
31
|
-
var _useStyle = useStyle(prefixCls),
|
|
32
|
-
wrapSSR = _useStyle.wrapSSR,
|
|
33
|
-
hashId = _useStyle.hashId;
|
|
34
30
|
var _useState = useState(!!props.defaultExpandSearch),
|
|
35
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
32
|
more = _useState2[0],
|
|
@@ -51,7 +47,16 @@ function VtxCombogrid(props, ref) {
|
|
|
51
47
|
defaultPageSize = props.defaultPageSize,
|
|
52
48
|
_props$customEnumText = props.customEnumText,
|
|
53
49
|
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
|
|
50
|
+
_props$headFootHeight = props.headFootHeight,
|
|
51
|
+
headFootHeight = _props$headFootHeight === void 0 ? 95 : _props$headFootHeight,
|
|
52
|
+
popoverWidth = props.popoverWidth,
|
|
54
53
|
rest = _objectWithoutProperties(props, _excluded);
|
|
54
|
+
var prefixCls = getPrefixCls('', 'vtx-combogrid');
|
|
55
|
+
var _useStyle = useStyle(prefixCls, {
|
|
56
|
+
popoverWidth: popoverWidth
|
|
57
|
+
}),
|
|
58
|
+
wrapSSR = _useStyle.wrapSSR,
|
|
59
|
+
hashId = _useStyle.hashId;
|
|
55
60
|
var TextEnum = _objectSpread({
|
|
56
61
|
indexTitle: intl.getMessage('indexTitle', '序号'),
|
|
57
62
|
actionMoreText: intl.getMessage('actionMoreText', '更多'),
|
|
@@ -86,7 +91,7 @@ function VtxCombogrid(props, ref) {
|
|
|
86
91
|
columns: columns,
|
|
87
92
|
startIndex: (current - 1) * pageSize + 1,
|
|
88
93
|
size: 'small',
|
|
89
|
-
headFootHeight:
|
|
94
|
+
headFootHeight: headFootHeight,
|
|
90
95
|
indexTitle: TextEnum.indexTitle,
|
|
91
96
|
onRowSelectionClear: clearSelectedRow,
|
|
92
97
|
pagination: _objectSpread(_objectSpread({}, pagination), {}, {
|
|
@@ -5,10 +5,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { useStyle as useAntdStyle } from "../../vtx-provider";
|
|
8
|
-
var genVtxStyle = function genVtxStyle(token) {
|
|
8
|
+
var genVtxStyle = function genVtxStyle(token, options) {
|
|
9
9
|
var componentCls = token.componentCls;
|
|
10
10
|
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&-popover", {
|
|
11
|
-
width: 550,
|
|
11
|
+
width: options.popoverWidth || 550,
|
|
12
12
|
'.ant-form-item': {
|
|
13
13
|
marginBottom: 12
|
|
14
14
|
}
|
|
@@ -32,11 +32,11 @@ var genVtxStyle = function genVtxStyle(token) {
|
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
34
34
|
};
|
|
35
|
-
export function useStyle(prefixCls) {
|
|
35
|
+
export function useStyle(prefixCls, options) {
|
|
36
36
|
return useAntdStyle(prefixCls, function (token) {
|
|
37
37
|
var vtxToken = _objectSpread(_objectSpread({}, token), {}, {
|
|
38
38
|
componentCls: ".".concat(prefixCls)
|
|
39
39
|
});
|
|
40
|
-
return [genVtxStyle(vtxToken)];
|
|
40
|
+
return [genVtxStyle(vtxToken, options)];
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -38,13 +38,14 @@ function useContainer() {
|
|
|
38
38
|
_props$indexFixed = props.indexFixed,
|
|
39
39
|
indexFixed = _props$indexFixed === void 0 ? false : _props$indexFixed,
|
|
40
40
|
_props$indexTitle = props.indexTitle,
|
|
41
|
-
indexTitle = _props$indexTitle === void 0 ? '序号' : _props$indexTitle,
|
|
41
|
+
indexTitle = _props$indexTitle === void 0 ? intl.getMessage('indexTitle', '序号') : _props$indexTitle,
|
|
42
42
|
_props$indexWidth = props.indexWidth,
|
|
43
43
|
indexWidth = _props$indexWidth === void 0 ? 70 : _props$indexWidth,
|
|
44
44
|
onColumnsSave = props.onColumnsSave,
|
|
45
45
|
disabledColumnKeys = props.disabledColumnKeys,
|
|
46
46
|
hideColumnSetting = props.hideColumnSetting,
|
|
47
|
-
customEnumText = props.customEnumText
|
|
47
|
+
_props$customEnumText = props.customEnumText,
|
|
48
|
+
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText;
|
|
48
49
|
var TextEnum = _objectSpread({
|
|
49
50
|
refreshText: intl.getMessage('tableToolBar.reload', '刷新'),
|
|
50
51
|
densityDefaultText: intl.getMessage('tableToolBar.densityDefault', '默认'),
|
|
@@ -73,8 +74,8 @@ function useContainer() {
|
|
|
73
74
|
noFixedTitle: intl.getMessage('tableToolBar.noFixedTitle', '不固定'),
|
|
74
75
|
rightFixedTitle: intl.getMessage('tableToolBar.rightFixedTitle', '固定在右侧'),
|
|
75
76
|
columnAll: intl.getMessage('tableToolBar.columnAll', '全部'),
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
paginationTotalText: intl.getMessage('pagination.total.total', '共'),
|
|
78
|
+
paginationItemText: intl.getMessage('pagination.total.item', '条')
|
|
78
79
|
}, customEnumText);
|
|
79
80
|
var isFirst = useRef(true);
|
|
80
81
|
var actionRef = useRef();
|
|
@@ -29,6 +29,7 @@ import { VtxProvider } from "../../../../vtx-provider";
|
|
|
29
29
|
import { TableContext } from "../../../Store/Provide";
|
|
30
30
|
import VtxIcon from "../../../../vtx-icon";
|
|
31
31
|
import { useStyle } from "./style";
|
|
32
|
+
// omit 用于从对象中排除指定的属性,返回一个新对象
|
|
32
33
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
34
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
35
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -360,7 +361,6 @@ export default function ColumnSetting(props) {
|
|
|
360
361
|
var _useStyle = useStyle(prefixCls),
|
|
361
362
|
wrapSSR = _useStyle.wrapSSR,
|
|
362
363
|
hashId = _useStyle.hashId;
|
|
363
|
-
var localColumns = props.columns;
|
|
364
364
|
var _useContext8 = useContext(TableContext),
|
|
365
365
|
uniqueKey = _useContext8.uniqueKey,
|
|
366
366
|
columnsMap = _useContext8.columnsMap,
|
|
@@ -368,7 +368,9 @@ export default function ColumnSetting(props) {
|
|
|
368
368
|
defaultColumnKeyMap = _useContext8.defaultColumnKeyMap,
|
|
369
369
|
setSortKeyColumns = _useContext8.setSortKeyColumns,
|
|
370
370
|
saveColumns = _useContext8.saveColumns,
|
|
371
|
-
TextEnum = _useContext8.TextEnum
|
|
371
|
+
TextEnum = _useContext8.TextEnum,
|
|
372
|
+
tableColumn = _useContext8.tableColumn;
|
|
373
|
+
var localColumns = props.localColumns;
|
|
372
374
|
var checkedColumnKeys = props.checkedColumnKeys,
|
|
373
375
|
onColumnsSave = props.onColumnsSave;
|
|
374
376
|
|
|
@@ -21,9 +21,9 @@ function ToolBar(props) {
|
|
|
21
21
|
onRefresh = props.onRefresh,
|
|
22
22
|
hideColumnHeight = props.hideColumnHeight,
|
|
23
23
|
hideColumnSetting = props.hideColumnSetting,
|
|
24
|
-
columns = props.columns,
|
|
25
24
|
onColumnsSave = props.onColumnsSave,
|
|
26
25
|
uniqueKey = props.uniqueKey,
|
|
26
|
+
columns = props.columns,
|
|
27
27
|
TextEnum = props.TextEnum;
|
|
28
28
|
var _useStyle = useStyle("".concat(prefix, "-toolbar")),
|
|
29
29
|
wrapSSR = _useStyle.wrapSSR,
|
|
@@ -72,7 +72,7 @@ function ToolBar(props) {
|
|
|
72
72
|
}), !hideColumnSetting && /*#__PURE__*/_jsx("div", {
|
|
73
73
|
className: "".concat(prefix, "-toolbar-setting-item"),
|
|
74
74
|
children: /*#__PURE__*/_jsx(ColumnSetting, {
|
|
75
|
-
|
|
75
|
+
localColumns: columns,
|
|
76
76
|
uniqueKey: uniqueKey,
|
|
77
77
|
onColumnsSave: onColumnsSave
|
|
78
78
|
})
|
package/es/vtx-datagrid/index.js
CHANGED
|
@@ -25,12 +25,19 @@ import ToolBar from "./ToolBar";
|
|
|
25
25
|
import { Container, TableContext } from "./Store/Provide";
|
|
26
26
|
import { useStyle } from "./style/index";
|
|
27
27
|
import { useAntdColumnResize } from 'react-antd-column-resize';
|
|
28
|
+
import { useIntl } from "../vtx-provider";
|
|
28
29
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
30
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
31
|
var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
|
|
31
32
|
export var indexColumnKey = '_serialNum';
|
|
33
|
+
export var DEFAULT_HEIGHTS = {
|
|
34
|
+
HEAD_FOOT: 115,
|
|
35
|
+
ALERT: 49,
|
|
36
|
+
TOOLBAR: 56
|
|
37
|
+
};
|
|
32
38
|
function VtxTable(props) {
|
|
33
39
|
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection3, _rest$rowSelection4;
|
|
40
|
+
var intl = useIntl();
|
|
34
41
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
35
42
|
getPrefixCls = _useContext.getPrefixCls;
|
|
36
43
|
var prefixCls = getPrefixCls('', 'vtx-datagrid');
|
|
@@ -66,7 +73,7 @@ function VtxTable(props) {
|
|
|
66
73
|
toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
|
|
67
74
|
toolbarClassName = props.toolbarClassName,
|
|
68
75
|
_props$toolbarTilte = props.toolbarTilte,
|
|
69
|
-
toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
|
|
76
|
+
toolbarTilte = _props$toolbarTilte === void 0 ? intl.getMessage('datagrid.queryResults', '查询结果') : _props$toolbarTilte,
|
|
70
77
|
buttonGroup = props.buttonGroup,
|
|
71
78
|
_props$refreshIconVis = props.refreshIconVisible,
|
|
72
79
|
refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
|
|
@@ -80,14 +87,14 @@ function VtxTable(props) {
|
|
|
80
87
|
_props$autoFit = props.autoFit,
|
|
81
88
|
autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
|
|
82
89
|
_props$headFootHeight = props.headFootHeight,
|
|
83
|
-
headFootHeight = _props$headFootHeight === void 0 ?
|
|
90
|
+
headFootHeight = _props$headFootHeight === void 0 ? DEFAULT_HEIGHTS.HEAD_FOOT : _props$headFootHeight,
|
|
84
91
|
_props$columnResizabl = props.columnResizable,
|
|
85
92
|
columnResizable = _props$columnResizabl === void 0 ? true : _props$columnResizabl,
|
|
86
93
|
components = props.components,
|
|
87
94
|
className = props.className,
|
|
88
95
|
style = props.style,
|
|
89
96
|
_props$emptyText = props.emptyText,
|
|
90
|
-
emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
|
|
97
|
+
emptyText = _props$emptyText === void 0 ? intl.getMessage('select.empty', '暂无数据') : _props$emptyText,
|
|
91
98
|
onRowSelectionClear = props.onRowSelectionClear,
|
|
92
99
|
onColumnsSave = props.onColumnsSave,
|
|
93
100
|
uniqueKey = props.uniqueKey,
|
|
@@ -123,14 +130,12 @@ function VtxTable(props) {
|
|
|
123
130
|
var resizeObserver = new ResizeObserver(function () {
|
|
124
131
|
calculateHeight();
|
|
125
132
|
});
|
|
126
|
-
// componentDidMount
|
|
127
133
|
if (autoFit && rootDomRef.current) {
|
|
128
134
|
resizeObserver.observe(rootDomRef.current, {
|
|
129
135
|
box: 'border-box'
|
|
130
136
|
});
|
|
131
137
|
}
|
|
132
138
|
return function () {
|
|
133
|
-
// componentWillUnmount
|
|
134
139
|
if (autoFit) {
|
|
135
140
|
resizeObserver.disconnect();
|
|
136
141
|
}
|
|
@@ -152,7 +157,7 @@ function VtxTable(props) {
|
|
|
152
157
|
showSizeChanger: true,
|
|
153
158
|
showQuickJumper: true,
|
|
154
159
|
showTotal: function showTotal(total) {
|
|
155
|
-
return "".concat(TextEnum.
|
|
160
|
+
return "".concat(TextEnum.paginationTotalText, " ").concat(total, " ").concat(TextEnum.paginationItemText);
|
|
156
161
|
}
|
|
157
162
|
}, pagination);
|
|
158
163
|
};
|
|
@@ -227,8 +232,8 @@ function VtxTable(props) {
|
|
|
227
232
|
selectedRowKeys: (_rest$rowSelection4 = rest.rowSelection) === null || _rest$rowSelection4 === void 0 ? void 0 : _rest$rowSelection4.selectedRowKeys,
|
|
228
233
|
onRowSelectionClear: onRowSelectionClear
|
|
229
234
|
}) : null;
|
|
230
|
-
alertHeight.current = !hideSelectionClear && hasAlert ?
|
|
231
|
-
toolbarHeight.current = toolbar ?
|
|
235
|
+
alertHeight.current = !hideSelectionClear && hasAlert ? DEFAULT_HEIGHTS.ALERT : 0;
|
|
236
|
+
toolbarHeight.current = toolbar ? DEFAULT_HEIGHTS.TOOLBAR : 0;
|
|
232
237
|
var _useAntdColumnResize = useAntdColumnResize(function () {
|
|
233
238
|
return {
|
|
234
239
|
columns: columns,
|
|
@@ -279,7 +284,7 @@ function VtxTable(props) {
|
|
|
279
284
|
hideColumnHeight: hideColumnHeight,
|
|
280
285
|
hideColumnSetting: hideColumnSetting,
|
|
281
286
|
onRefresh: onRefresh,
|
|
282
|
-
columns:
|
|
287
|
+
columns: tableColumn,
|
|
283
288
|
onColumnsSave: onColumnsSave,
|
|
284
289
|
uniqueKey: uniqueKey,
|
|
285
290
|
prefixUrl: prefixUrl,
|
|
@@ -100,7 +100,8 @@ export default function FormItem(props) {
|
|
|
100
100
|
children: label
|
|
101
101
|
}),
|
|
102
102
|
required: required,
|
|
103
|
-
hidden: hidden
|
|
103
|
+
hidden: hidden,
|
|
104
|
+
colon: label ? true : false
|
|
104
105
|
}, formItemLayout), {}, {
|
|
105
106
|
children: [/*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread(_objectSpread({
|
|
106
107
|
noStyle: true
|
package/es/vtx-import2/index.js
CHANGED
|
@@ -215,7 +215,7 @@ var VtxImport2 = function VtxImport2(props) {
|
|
|
215
215
|
if (xhr.status === 200) {
|
|
216
216
|
var res = JSON.parse(xhr.responseText);
|
|
217
217
|
if ((res === null || res === void 0 ? void 0 : res.result) == 0) {
|
|
218
|
-
message.success('上传成功');
|
|
218
|
+
message.success(intl.getMessage('import.success', '上传成功'));
|
|
219
219
|
chunkUpload(res.data);
|
|
220
220
|
} else {
|
|
221
221
|
message.error((res === null || res === void 0 ? void 0 : res.msg) || intl.getMessage('import.error', '上传失败'));
|
|
@@ -45,12 +45,17 @@ var TextArea = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
45
45
|
}));
|
|
46
46
|
|
|
47
47
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
var wrapper = null;
|
|
49
|
+
if (showCount && 'value' in props) {
|
|
50
|
+
wrapper = function wrapper(element) {
|
|
51
|
+
return /*#__PURE__*/_jsx("div", {
|
|
52
|
+
className: classnames(prefixCls, hashId),
|
|
53
|
+
"data-count": "".concat(len, "/").concat(maxLength),
|
|
54
|
+
children: element
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return wrapSSR(wrapper ? wrapper(render) : render);
|
|
54
59
|
});
|
|
55
60
|
export default TextArea;
|
|
56
61
|
TextArea.propTypes = {
|
|
@@ -19,11 +19,13 @@ var genVtxModalStyle = function genVtxModalStyle(token) {
|
|
|
19
19
|
padding: 0
|
|
20
20
|
},
|
|
21
21
|
'.ant-modal-body': {
|
|
22
|
-
|
|
22
|
+
height: 'calc(100% - 108px)',
|
|
23
23
|
padding: '12px 20px 8px 20px',
|
|
24
|
-
overflowY: 'auto'
|
|
25
|
-
height: '100%'
|
|
24
|
+
overflowY: 'auto'
|
|
26
25
|
}
|
|
26
|
+
},
|
|
27
|
+
'.ant-modal-container': {
|
|
28
|
+
padding: 0
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
}, '&-title', _defineProperty(_defineProperty(_defineProperty({
|
|
@@ -19,7 +19,7 @@ function Content(props) {
|
|
|
19
19
|
height = props.height;
|
|
20
20
|
var contentClass = classnames(_defineProperty(_defineProperty(_defineProperty({}, 'vtx-page-content-absolute', !relative), 'vtx-page-content-relative', relative), 'vtx-page-content-scroll-y', scrollY), className);
|
|
21
21
|
var newStyle = style;
|
|
22
|
-
if (
|
|
22
|
+
if (height !== undefined) {
|
|
23
23
|
newStyle = _objectSpread(_objectSpread({}, newStyle), {}, {
|
|
24
24
|
height: height
|
|
25
25
|
});
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
1
|
import { ConfigProvider } from 'antd';
|
|
8
2
|
import classsnames from 'classnames';
|
|
9
3
|
import PropTypes from 'prop-types';
|
|
@@ -50,7 +44,7 @@ var Content = function Content(props) {
|
|
|
50
44
|
hashId = _useStyle2.hashId;
|
|
51
45
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
52
46
|
className: classsnames("".concat(prefix, "-tab-content"), className, hashId),
|
|
53
|
-
style:
|
|
47
|
+
style: style,
|
|
54
48
|
children: props.children
|
|
55
49
|
}));
|
|
56
50
|
};
|
|
@@ -124,15 +124,25 @@ Content.propTypes = {
|
|
|
124
124
|
*/
|
|
125
125
|
var Table = function Table(props) {
|
|
126
126
|
var className = props.className,
|
|
127
|
-
style = props.style
|
|
127
|
+
style = props.style,
|
|
128
|
+
children = props.children;
|
|
128
129
|
var _useContext3 = useContext(StoreCtx),
|
|
129
130
|
searchCollapseEvent$ = _useContext3.searchCollapseEvent$;
|
|
131
|
+
|
|
132
|
+
// 安全检查:如果不是有效的 React 元素,直接渲染不注入 props
|
|
133
|
+
if (! /*#__PURE__*/React.isValidElement(children)) {
|
|
134
|
+
return /*#__PURE__*/_jsx("div", {
|
|
135
|
+
className: classsnames('vtx-page-table-wrap', className),
|
|
136
|
+
style: style,
|
|
137
|
+
children: children
|
|
138
|
+
});
|
|
139
|
+
}
|
|
130
140
|
return /*#__PURE__*/_jsx("div", {
|
|
131
|
-
className: classsnames('vtx-page-table-wrap', className
|
|
141
|
+
className: classsnames('vtx-page-table-wrap', className),
|
|
132
142
|
style: style,
|
|
133
|
-
children: /*#__PURE__*/React.cloneElement(
|
|
143
|
+
children: /*#__PURE__*/React.cloneElement(children, {
|
|
134
144
|
searchCollapseEvent$: searchCollapseEvent$
|
|
135
|
-
})
|
|
145
|
+
})
|
|
136
146
|
});
|
|
137
147
|
};
|
|
138
148
|
Table.propTypes = {
|