@vtx/components 3.1.71 → 3.1.73
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/lib/_util/filterSpecialCharacters.js +44 -55
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +4 -1
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getToken.js +41 -0
- package/lib/_util/getToken.js.map +1 -0
- package/lib/_util/getUrlParam.js +8 -1
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/isFunction.js +1 -0
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js +1 -0
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/useColSize.js +12 -2
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js +3 -0
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +39 -23
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js +2 -1
- package/lib/config.js.map +1 -1
- package/lib/index.js +27 -0
- package/lib/index.js.map +1 -1
- package/lib/style/index.less +2 -2
- package/lib/style/themes/compact.less +1 -1
- package/lib/style/themes/dark.less +9 -9
- package/lib/style/themes/default.less +7 -7
- package/lib/style/themes/index.less +1 -1
- package/lib/style/themes/variable.less +5 -5
- package/lib/vtx-color-picker/index.js +26 -9
- package/lib/vtx-color-picker/index.js.map +1 -1
- package/lib/vtx-color-picker/style/css.js +2 -0
- package/lib/vtx-color-picker/style/css.js.map +1 -1
- package/lib/vtx-color-picker/style/index.js +2 -0
- package/lib/vtx-color-picker/style/index.js.map +1 -1
- package/lib/vtx-combogrid/Combogrid.js +86 -46
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +54 -28
- package/lib/vtx-combogrid/index.js.map +1 -1
- package/lib/vtx-combogrid/style/css.js +7 -0
- package/lib/vtx-combogrid/style/css.js.map +1 -1
- package/lib/vtx-combogrid/style/index.js +7 -0
- package/lib/vtx-combogrid/style/index.js.map +1 -1
- package/lib/vtx-datagrid/Alert.js +13 -4
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +77 -38
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +15 -3
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +169 -100
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +38 -7
- package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
- package/lib/vtx-datagrid/style/css.js +10 -0
- package/lib/vtx-datagrid/style/css.js.map +1 -1
- package/lib/vtx-datagrid/style/index.js +10 -0
- package/lib/vtx-datagrid/style/index.js.map +1 -1
- package/lib/vtx-date-picker/QdatePicker.js +51 -21
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +65 -24
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +7 -1
- package/lib/vtx-date-picker/index.js.map +1 -1
- package/lib/vtx-date-picker/style/css.js +1 -0
- package/lib/vtx-date-picker/style/css.js.map +1 -1
- package/lib/vtx-date-picker/style/index.js +1 -0
- package/lib/vtx-date-picker/style/index.js.map +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-editor/index.js +28 -9
- package/lib/vtx-editor/index.js.map +1 -1
- package/lib/vtx-editor/style/css.js +1 -0
- package/lib/vtx-editor/style/css.js.map +1 -1
- package/lib/vtx-editor/style/index.js +1 -0
- package/lib/vtx-editor/style/index.js.map +1 -1
- package/lib/vtx-editor/style/index.less +8 -8
- package/lib/vtx-ellipsis-text/index.js +27 -14
- package/lib/vtx-ellipsis-text/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/css.js +1 -0
- package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.js +1 -0
- package/lib/vtx-ellipsis-text/style/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.less +13 -13
- package/lib/vtx-export/index.js +65 -33
- package/lib/vtx-export/index.js.map +1 -1
- package/lib/vtx-export/style/css.js +5 -0
- package/lib/vtx-export/style/css.js.map +1 -1
- package/lib/vtx-export/style/index.js +5 -0
- package/lib/vtx-export/style/index.js.map +1 -1
- package/lib/vtx-export-async/History.js +93 -56
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +97 -56
- package/lib/vtx-export-async/index.js.map +1 -1
- package/lib/vtx-export-async/style/css.js.map +1 -1
- package/lib/vtx-export-async/style/index.js.map +1 -1
- package/lib/vtx-export-async/util.js +15 -5
- package/lib/vtx-export-async/util.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +33 -11
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +11 -5
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +33 -11
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +9 -3
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +8 -1
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +4 -1
- package/lib/vtx-form-layout/context.js.map +1 -1
- package/lib/vtx-form-layout/demo/Modal.less +43 -43
- package/lib/vtx-form-layout/index.js +24 -9
- package/lib/vtx-form-layout/index.js.map +1 -1
- package/lib/vtx-form-layout/style/css.js +7 -0
- package/lib/vtx-form-layout/style/css.js.map +1 -1
- package/lib/vtx-form-layout/style/index.js +7 -0
- package/lib/vtx-form-layout/style/index.js.map +1 -1
- package/lib/vtx-form-layout/style/index.less +216 -216
- package/lib/vtx-image/Image.js +113 -73
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +59 -30
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +47 -17
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +11 -4
- package/lib/vtx-image/index.js.map +1 -1
- package/lib/vtx-image/style/css.js +1 -0
- package/lib/vtx-image/style/css.js.map +1 -1
- package/lib/vtx-image/style/index.js +1 -0
- package/lib/vtx-image/style/index.js.map +1 -1
- package/lib/vtx-import/index.js +80 -48
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +28 -10
- package/lib/vtx-import/result.js.map +1 -1
- package/lib/vtx-import/style/css.js +3 -0
- package/lib/vtx-import/style/css.js.map +1 -1
- package/lib/vtx-import/style/index.js +3 -0
- package/lib/vtx-import/style/index.js.map +1 -1
- package/lib/vtx-import/style/index.less +8 -8
- package/lib/vtx-import2/CheckResult.js +8 -1
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +33 -11
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +6 -1
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +14 -7
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +6 -1
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +110 -53
- package/lib/vtx-import2/index.js.map +1 -1
- package/lib/vtx-import2/style/css.js +3 -0
- package/lib/vtx-import2/style/css.js.map +1 -1
- package/lib/vtx-import2/style/index.js +3 -0
- package/lib/vtx-import2/style/index.js.map +1 -1
- package/lib/vtx-import2/style/index.less +102 -102
- package/lib/vtx-input/TextArea.js +27 -10
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +45 -20
- package/lib/vtx-input/index.js.map +1 -1
- package/lib/vtx-input/style/css.js +1 -0
- package/lib/vtx-input/style/css.js.map +1 -1
- package/lib/vtx-input/style/index.js +1 -0
- package/lib/vtx-input/style/index.js.map +1 -1
- package/lib/vtx-input/style/index.less +24 -24
- package/lib/vtx-input/useLength.js +20 -7
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +8 -2
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +84 -51
- package/lib/vtx-modal/index.js.map +1 -1
- package/lib/vtx-modal/style/css.js +1 -0
- package/lib/vtx-modal/style/css.js.map +1 -1
- package/lib/vtx-modal/style/index.js +1 -0
- package/lib/vtx-modal/style/index.js.map +1 -1
- package/lib/vtx-page-layout/Basic.js +8 -3
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +26 -15
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +12 -3
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +70 -40
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +22 -11
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +51 -23
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +10 -1
- package/lib/vtx-page-layout/index.js.map +1 -1
- package/lib/vtx-page-layout/style/css.js.map +1 -1
- package/lib/vtx-page-layout/style/index.js.map +1 -1
- package/lib/vtx-page-layout/style/index.less +138 -138
- package/lib/vtx-rps-frame/index.js +58 -37
- package/lib/vtx-rps-frame/index.js.map +1 -1
- package/lib/vtx-rps-frame/style/css.js.map +1 -1
- package/lib/vtx-rps-frame/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/index.js +64 -30
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/css.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.js.map +1 -1
- package/lib/vtx-scrollable-row/style/index.less +113 -113
- package/lib/vtx-search/VtxCol.js +26 -7
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +14 -7
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +106 -61
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/css.js +4 -0
- package/lib/vtx-search/style/css.js.map +1 -1
- package/lib/vtx-search/style/index.js +4 -0
- package/lib/vtx-search/style/index.js.map +1 -1
- package/lib/vtx-search-map-input/index.js +89 -56
- package/lib/vtx-search-map-input/index.js.map +1 -1
- package/lib/vtx-search-map-input/style/css.js +2 -0
- package/lib/vtx-search-map-input/style/css.js.map +1 -1
- package/lib/vtx-search-map-input/style/index.js +2 -0
- package/lib/vtx-search-map-input/style/index.js.map +1 -1
- package/lib/vtx-select/index.js +87 -37
- package/lib/vtx-select/index.js.map +1 -1
- package/lib/vtx-select/style/css.js +8 -0
- package/lib/vtx-select/style/css.js.map +1 -1
- package/lib/vtx-select/style/index.js +8 -0
- package/lib/vtx-select/style/index.js.map +1 -1
- package/lib/vtx-select/style/index.less +68 -68
- package/lib/vtx-signature/index.js +33 -18
- package/lib/vtx-signature/index.js.map +1 -1
- package/lib/vtx-signature/style/css.js +2 -0
- package/lib/vtx-signature/style/css.js.map +1 -1
- package/lib/vtx-signature/style/index.js +2 -0
- package/lib/vtx-signature/style/index.js.map +1 -1
- package/lib/vtx-signature/style/index.less +33 -33
- package/lib/vtx-split-pane/Pane.js +22 -11
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +39 -19
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +107 -51
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +6 -1
- package/lib/vtx-split-pane/index.js.map +1 -1
- package/lib/vtx-split-pane/style/css.js +3 -0
- package/lib/vtx-split-pane/style/css.js.map +1 -1
- package/lib/vtx-split-pane/style/index.js +3 -0
- package/lib/vtx-split-pane/style/index.js.map +1 -1
- package/lib/vtx-split-pane/style/index.less +76 -76
- package/lib/vtx-statistics-column/Back.js +9 -2
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +30 -14
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +30 -14
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +4 -1
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +18 -1
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/css.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.less +59 -59
- package/lib/vtx-time-picker/index.js +18 -4
- package/lib/vtx-time-picker/index.js.map +1 -1
- package/lib/vtx-time-picker/style/css.js.map +1 -1
- package/lib/vtx-time-picker/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +33 -15
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +153 -80
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +5 -0
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +5 -0
- package/lib/vtx-upload/style/index.js.map +1 -1
- package/lib/vtx-upload/style/index.less +61 -61
- package/lib/vtx-wang-editor/index.js +116 -74
- package/lib/vtx-wang-editor/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/css.js +1 -0
- package/lib/vtx-wang-editor/style/css.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.js +1 -0
- package/lib/vtx-wang-editor/style/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +136 -75
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +121 -71
- package/lib/vtx-ztree/index.js.map +1 -1
- package/lib/vtx-ztree/style/css.js +1 -0
- package/lib/vtx-ztree/style/css.js.map +1 -1
- package/lib/vtx-ztree/style/index.css +1 -1
- package/lib/vtx-ztree/style/index.js +1 -0
- package/lib/vtx-ztree/style/index.js.map +1 -1
- package/lib/vtx-ztree/style/index.less +45 -45
- package/lib/vtx-ztree-select/index.js +142 -73
- package/lib/vtx-ztree-select/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/css.js +3 -0
- package/lib/vtx-ztree-select/style/css.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.js +3 -0
- package/lib/vtx-ztree-select/style/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.less +107 -107
- package/package.json +126 -126
|
@@ -4,20 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactResizable = require("react-resizable");
|
|
11
|
+
|
|
9
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
10
14
|
var _excluded = ["onResize", "width"];
|
|
15
|
+
|
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
12
18
|
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; }
|
|
19
|
+
|
|
13
20
|
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; }
|
|
21
|
+
|
|
14
22
|
var ResizeableTitle = function ResizeableTitle(props) {
|
|
15
23
|
var onResize = props.onResize,
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
width = props.width,
|
|
25
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
|
|
18
27
|
if (!width) {
|
|
19
28
|
return /*#__PURE__*/_react["default"].createElement("th", restProps);
|
|
20
29
|
}
|
|
30
|
+
|
|
21
31
|
return /*#__PURE__*/_react["default"].createElement(_reactResizable.Resizable, {
|
|
22
32
|
width: width,
|
|
23
33
|
height: 0,
|
|
@@ -27,9 +37,11 @@ var ResizeableTitle = function ResizeableTitle(props) {
|
|
|
27
37
|
}
|
|
28
38
|
}, /*#__PURE__*/_react["default"].createElement("th", restProps));
|
|
29
39
|
};
|
|
40
|
+
|
|
30
41
|
ResizeableTitle.propTypes = {
|
|
31
42
|
onResize: _propTypes["default"].func,
|
|
32
43
|
width: _propTypes["default"].number
|
|
33
44
|
};
|
|
34
|
-
var _default =
|
|
45
|
+
var _default = ResizeableTitle;
|
|
46
|
+
exports["default"] = _default;
|
|
35
47
|
//# sourceMappingURL=ResizeableTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeableTitle.js","names":["
|
|
1
|
+
{"version":3,"file":"ResizeableTitle.js","names":["ResizeableTitle","props","onResize","width","restProps","enableUserSelectHack","propTypes","PropTypes","func","number"],"sources":["vtx-datagrid/ResizeableTitle.jsx"],"sourcesContent":["import React from 'react';\nimport { Resizable } from 'react-resizable';\nimport PropTypes from 'prop-types';\n\nconst ResizeableTitle = props => {\n const { onResize, width, ...restProps } = props;\n\n if (!width) {\n return <th {...restProps} />;\n }\n\n return (\n <Resizable\n width={width}\n height={0}\n onResize={onResize}\n draggableOpts={{ enableUserSelectHack: false }}\n >\n <th {...restProps} />\n </Resizable>\n );\n};\n\nResizeableTitle.propTypes = {\n onResize: PropTypes.func,\n width: PropTypes.number,\n};\n\nexport default ResizeableTitle;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,KAAK,EAAI;EAC7B,IAAQC,QAAR,GAA0CD,KAA1C,CAAQC,QAAR;EAAA,IAAkBC,KAAlB,GAA0CF,KAA1C,CAAkBE,KAAlB;EAAA,IAA4BC,SAA5B,4BAA0CH,KAA1C;;EAEA,IAAI,CAACE,KAAL,EAAY;IACR,oBAAO,sCAAQC,SAAR,CAAP;EACH;;EAED,oBACI,gCAAC,yBAAD;IACI,KAAK,EAAED,KADX;IAEI,MAAM,EAAE,CAFZ;IAGI,QAAQ,EAAED,QAHd;IAII,aAAa,EAAE;MAAEG,oBAAoB,EAAE;IAAxB;EAJnB,gBAMI,sCAAQD,SAAR,CANJ,CADJ;AAUH,CAjBD;;AAmBAJ,eAAe,CAACM,SAAhB,GAA4B;EACxBJ,QAAQ,EAAEK,qBAAA,CAAUC,IADI;EAExBL,KAAK,EAAEI,qBAAA,CAAUE;AAFO,CAA5B;eAKeT,e"}
|
|
@@ -1,135 +1,179 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = VtxDatagrid;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
10
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
11
16
|
var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
17
|
+
|
|
12
18
|
var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
|
|
19
|
+
|
|
13
20
|
var _dropdown = _interopRequireDefault(require("antd/lib/dropdown"));
|
|
21
|
+
|
|
14
22
|
var _menu = _interopRequireDefault(require("antd/lib/menu"));
|
|
23
|
+
|
|
15
24
|
var _empty = _interopRequireDefault(require("antd/lib/empty"));
|
|
25
|
+
|
|
16
26
|
var _RedoOutlined = _interopRequireDefault(require("@ant-design/icons/RedoOutlined"));
|
|
27
|
+
|
|
17
28
|
var _ColumnHeightOutlined = _interopRequireDefault(require("@ant-design/icons/ColumnHeightOutlined"));
|
|
29
|
+
|
|
18
30
|
var _SettingOutlined = _interopRequireDefault(require("@ant-design/icons/SettingOutlined"));
|
|
31
|
+
|
|
19
32
|
var _Alert = _interopRequireDefault(require("./Alert"));
|
|
33
|
+
|
|
20
34
|
var _ColumnSetting = _interopRequireDefault(require("./ColumnSetting"));
|
|
35
|
+
|
|
21
36
|
var _ResizeableTitle = _interopRequireDefault(require("./ResizeableTitle"));
|
|
37
|
+
|
|
22
38
|
var _renderColumnButtons = _interopRequireDefault(require("./renderColumnButtons"));
|
|
39
|
+
|
|
23
40
|
var _useSet3 = _interopRequireDefault(require("../_util/useSet"));
|
|
41
|
+
|
|
24
42
|
var _isFunction = _interopRequireDefault(require("../_util/isFunction"));
|
|
43
|
+
|
|
25
44
|
var _axios = _interopRequireDefault(require("axios"));
|
|
45
|
+
|
|
26
46
|
var _excluded = ["prefixCls", "toolbar", "toolbarClassName", "toolbarTilte", "buttonGroup", "refreshIconVisible", "hideColumnSetting", "hideColumnHeight", "visibleColumnKeys", "defaultVisibleColumnKeys", "onVisibleColumnsChange", "onRefresh", "indexColumn", "indexFixed", "bordered", "indexTitle", "startIndex", "autoFit", "headFootHeight", "columnResizable", "components", "className", "style", "emptyText", "onRowSelectionClear", "searchCollapseEvent$", "disabledColumnKeys", "onColumnsSave", "uniqueKey", "customEnumText"];
|
|
47
|
+
|
|
27
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
28
|
-
|
|
29
|
-
function
|
|
49
|
+
|
|
50
|
+
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); }
|
|
51
|
+
|
|
52
|
+
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; }
|
|
53
|
+
|
|
30
54
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
55
|
+
|
|
31
56
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
57
|
+
|
|
32
58
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
59
|
+
|
|
33
60
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
61
|
+
|
|
34
62
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
63
|
+
|
|
64
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
65
|
+
|
|
66
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
67
|
+
|
|
68
|
+
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; }
|
|
69
|
+
|
|
40
70
|
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; }
|
|
71
|
+
|
|
41
72
|
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; }
|
|
73
|
+
|
|
42
74
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
75
|
+
|
|
43
76
|
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."); }
|
|
77
|
+
|
|
44
78
|
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); }
|
|
45
|
-
|
|
46
|
-
function
|
|
79
|
+
|
|
80
|
+
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; }
|
|
81
|
+
|
|
82
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
83
|
+
|
|
47
84
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
85
|
+
|
|
48
86
|
var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
|
|
87
|
+
|
|
49
88
|
function VtxDatagrid(props) {
|
|
50
|
-
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection2, _dataSource2, _rest$rowSelection3, _dataSource3;
|
|
89
|
+
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection2, _dataSource2, _classnames, _rest$rowSelection3, _dataSource3;
|
|
90
|
+
|
|
51
91
|
var _useSet = (0, _useSet3["default"])({
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
92
|
+
// 显示列
|
|
93
|
+
visibleColumns: [],
|
|
94
|
+
// 列设置选中的列
|
|
95
|
+
checkedColumnKeys: [],
|
|
96
|
+
// 列设置选项
|
|
97
|
+
columnSettingOptions: [],
|
|
98
|
+
datagridId: "vtx-datagrid-".concat(new Date().getTime()),
|
|
99
|
+
scrollY: 0,
|
|
100
|
+
size: 'middle',
|
|
101
|
+
projectKey: ''
|
|
102
|
+
}),
|
|
103
|
+
_useSet2 = _slicedToArray(_useSet, 2),
|
|
104
|
+
state = _useSet2[0],
|
|
105
|
+
setState = _useSet2[1];
|
|
106
|
+
|
|
66
107
|
var visibleColumns = state.visibleColumns,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var datagridRef = (0, _react.useRef)(null);
|
|
73
|
-
|
|
74
|
-
var alertHeight = (0, _react.useRef)(0);
|
|
75
|
-
|
|
76
|
-
var toolbarHeight = (0, _react.useRef)(0);
|
|
77
|
-
|
|
108
|
+
checkedColumnKeys = state.checkedColumnKeys,
|
|
109
|
+
columnSettingOptions = state.columnSettingOptions,
|
|
110
|
+
datagridId = state.datagridId,
|
|
111
|
+
scrollY = state.scrollY,
|
|
112
|
+
size = state.size;
|
|
113
|
+
var datagridRef = (0, _react.useRef)(null); // 列设置提示高度
|
|
114
|
+
|
|
115
|
+
var alertHeight = (0, _react.useRef)(0); // 工具栏高度
|
|
116
|
+
|
|
117
|
+
var toolbarHeight = (0, _react.useRef)(0); // 列接口显示字段
|
|
118
|
+
|
|
78
119
|
var settingRef = (0, _react.useRef)();
|
|
120
|
+
|
|
79
121
|
var _props$prefixCls = props.prefixCls,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
prefixCls = _props$prefixCls === void 0 ? 'vtx-datagrid' : _props$prefixCls,
|
|
123
|
+
_props$toolbar = props.toolbar,
|
|
124
|
+
toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
|
|
125
|
+
toolbarClassName = props.toolbarClassName,
|
|
126
|
+
_props$toolbarTilte = props.toolbarTilte,
|
|
127
|
+
toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
|
|
128
|
+
buttonGroup = props.buttonGroup,
|
|
129
|
+
_props$refreshIconVis = props.refreshIconVisible,
|
|
130
|
+
refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
|
|
131
|
+
hideColumnSetting = props.hideColumnSetting,
|
|
132
|
+
hideColumnHeight = props.hideColumnHeight,
|
|
133
|
+
visibleColumnKeys = props.visibleColumnKeys,
|
|
134
|
+
defaultVisibleColumnKeys = props.defaultVisibleColumnKeys,
|
|
135
|
+
onVisibleColumnsChange = props.onVisibleColumnsChange,
|
|
136
|
+
onRefresh = props.onRefresh,
|
|
137
|
+
_props$indexColumn = props.indexColumn,
|
|
138
|
+
indexColumn = _props$indexColumn === void 0 ? true : _props$indexColumn,
|
|
139
|
+
_props$indexFixed = props.indexFixed,
|
|
140
|
+
indexFixed = _props$indexFixed === void 0 ? false : _props$indexFixed,
|
|
141
|
+
_props$bordered = props.bordered,
|
|
142
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
143
|
+
_props$indexTitle = props.indexTitle,
|
|
144
|
+
indexTitle = _props$indexTitle === void 0 ? '序号' : _props$indexTitle,
|
|
145
|
+
_props$startIndex = props.startIndex,
|
|
146
|
+
startIndex = _props$startIndex === void 0 ? 1 : _props$startIndex,
|
|
147
|
+
_props$autoFit = props.autoFit,
|
|
148
|
+
autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
|
|
149
|
+
_props$headFootHeight = props.headFootHeight,
|
|
150
|
+
headFootHeight = _props$headFootHeight === void 0 ? 115 : _props$headFootHeight,
|
|
151
|
+
columnResizable = props.columnResizable,
|
|
152
|
+
components = props.components,
|
|
153
|
+
className = props.className,
|
|
154
|
+
style = props.style,
|
|
155
|
+
_props$emptyText = props.emptyText,
|
|
156
|
+
emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
|
|
157
|
+
onRowSelectionClear = props.onRowSelectionClear,
|
|
158
|
+
searchCollapseEvent$ = props.searchCollapseEvent$,
|
|
159
|
+
disabledColumnKeys = props.disabledColumnKeys,
|
|
160
|
+
onColumnsSave = props.onColumnsSave,
|
|
161
|
+
uniqueKey = props.uniqueKey,
|
|
162
|
+
_props$customEnumText = props.customEnumText,
|
|
163
|
+
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
|
|
164
|
+
rest = _objectWithoutProperties(props, _excluded); // 规则,菜单根目录_页面路由
|
|
165
|
+
|
|
166
|
+
|
|
125
167
|
function getUniqueKey() {
|
|
126
168
|
var route = location.href.match(/#\/(\S*)\?/);
|
|
169
|
+
|
|
127
170
|
if (route) {
|
|
128
171
|
(0, _axios["default"])({
|
|
129
172
|
method: 'GET',
|
|
130
173
|
url: "".concat(location.pathname, "resources/json/menu.json")
|
|
131
174
|
}).then(function (res) {
|
|
132
175
|
var _res$data;
|
|
176
|
+
|
|
133
177
|
if ((res === null || res === void 0 ? void 0 : res.status) == 200 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.key) {
|
|
134
178
|
setState({
|
|
135
179
|
projectKey: "".concat(res.data.key, "_").concat(route ? route[1] : 'test')
|
|
@@ -138,15 +182,18 @@ function VtxDatagrid(props) {
|
|
|
138
182
|
});
|
|
139
183
|
}
|
|
140
184
|
}
|
|
185
|
+
|
|
141
186
|
(0, _react.useEffect)(function () {
|
|
142
187
|
// 当没有传入唯一值而且没有自定义列保存的时候根据规则自动生成唯一值
|
|
143
188
|
if (!uniqueKey && !onColumnsSave) {
|
|
144
189
|
getUniqueKey();
|
|
145
|
-
}
|
|
146
|
-
|
|
190
|
+
} // componentDidMount
|
|
191
|
+
|
|
192
|
+
|
|
147
193
|
if (autoFit) {
|
|
148
194
|
window.addEventListener('resize', calculateHeight, false);
|
|
149
195
|
}
|
|
196
|
+
|
|
150
197
|
return function () {
|
|
151
198
|
// componentWillUnmount
|
|
152
199
|
if (autoFit) {
|
|
@@ -158,9 +205,8 @@ function VtxDatagrid(props) {
|
|
|
158
205
|
if (autoFit) {
|
|
159
206
|
calculateHeight();
|
|
160
207
|
}
|
|
161
|
-
}, [(_rest$dataSource = rest.dataSource) === null || _rest$dataSource === void 0 ? void 0 : _rest$dataSource.length, (((_rest$rowSelection = rest.rowSelection) === null || _rest$rowSelection === void 0 ? void 0 : _rest$rowSelection.selectedRowKeys) || []).join(',')]);
|
|
208
|
+
}, [(_rest$dataSource = rest.dataSource) === null || _rest$dataSource === void 0 ? void 0 : _rest$dataSource.length, (((_rest$rowSelection = rest.rowSelection) === null || _rest$rowSelection === void 0 ? void 0 : _rest$rowSelection.selectedRowKeys) || []).join(',')]); // 只有被TableLayout.Page包裹时才会存在searchCollapseEvent$这个参数
|
|
162
209
|
|
|
163
|
-
// 只有被TableLayout.Page包裹时才会存在searchCollapseEvent$这个参数
|
|
164
210
|
if (searchCollapseEvent$) {
|
|
165
211
|
// eslint-disable-next-line react/prop-types
|
|
166
212
|
searchCollapseEvent$.useSubscription(function () {
|
|
@@ -172,8 +218,10 @@ function VtxDatagrid(props) {
|
|
|
172
218
|
}, 350);
|
|
173
219
|
});
|
|
174
220
|
}
|
|
221
|
+
|
|
175
222
|
(0, _react.useEffect)(function () {
|
|
176
223
|
var _rest$columns;
|
|
224
|
+
|
|
177
225
|
parseColumns();
|
|
178
226
|
setState({
|
|
179
227
|
columnSettingOptions: (_rest$columns = rest.columns) === null || _rest$columns === void 0 ? void 0 : _rest$columns.map(function (col) {
|
|
@@ -183,12 +231,15 @@ function VtxDatagrid(props) {
|
|
|
183
231
|
})
|
|
184
232
|
});
|
|
185
233
|
}, [rest.columns]);
|
|
234
|
+
|
|
186
235
|
var parseColumns = function parseColumns(type) {
|
|
187
236
|
// 显示工具栏的同时并显示列设置
|
|
188
237
|
if (toolbar && !hideColumnSetting) {
|
|
189
238
|
var _settingRef$current;
|
|
239
|
+
|
|
190
240
|
if (defaultVisibleColumnKeys || visibleColumnKeys || (_settingRef$current = settingRef.current) !== null && _settingRef$current !== void 0 && _settingRef$current.showColumns) {
|
|
191
241
|
var _settingRef$current2, _rest$columns2;
|
|
242
|
+
|
|
192
243
|
var columnKeys = type === 'reset' ? defaultVisibleColumnKeys : ((_settingRef$current2 = settingRef.current) === null || _settingRef$current2 === void 0 ? void 0 : _settingRef$current2.showColumns) || visibleColumnKeys || defaultVisibleColumnKeys;
|
|
193
244
|
setState({
|
|
194
245
|
checkedColumnKeys: columnKeys,
|
|
@@ -198,6 +249,7 @@ function VtxDatagrid(props) {
|
|
|
198
249
|
});
|
|
199
250
|
} else {
|
|
200
251
|
var _rest$columns3;
|
|
252
|
+
|
|
201
253
|
setState({
|
|
202
254
|
checkedColumnKeys: (_rest$columns3 = rest.columns) === null || _rest$columns3 === void 0 ? void 0 : _rest$columns3.map(function (item) {
|
|
203
255
|
return item.dataIndex || item.key;
|
|
@@ -211,15 +263,18 @@ function VtxDatagrid(props) {
|
|
|
211
263
|
});
|
|
212
264
|
}
|
|
213
265
|
};
|
|
266
|
+
|
|
214
267
|
var hasAlert = (((_rest$rowSelection2 = rest.rowSelection) === null || _rest$rowSelection2 === void 0 ? void 0 : _rest$rowSelection2.selectedRowKeys) || []).length > 0;
|
|
215
268
|
alertHeight.current = hasAlert ? 49 : 0;
|
|
216
|
-
toolbarHeight.current = toolbar ? 56 : 0;
|
|
217
|
-
|
|
269
|
+
toolbarHeight.current = toolbar ? 56 : 0; // 高度计算
|
|
270
|
+
|
|
218
271
|
var calculateHeight = function calculateHeight() {
|
|
219
272
|
var _datagridRef$current;
|
|
273
|
+
|
|
220
274
|
if (!datagridRef.current) {
|
|
221
275
|
return null;
|
|
222
276
|
}
|
|
277
|
+
|
|
223
278
|
var bodyHeight = ((_datagridRef$current = datagridRef.current) === null || _datagridRef$current === void 0 ? void 0 : _datagridRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
|
|
224
279
|
var divs = datagridRef.current.getElementsByTagName('div');
|
|
225
280
|
var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
|
|
@@ -229,9 +284,9 @@ function VtxDatagrid(props) {
|
|
|
229
284
|
setState({
|
|
230
285
|
scrollY: bodyHeight
|
|
231
286
|
});
|
|
232
|
-
};
|
|
287
|
+
}; // 列设置回调
|
|
288
|
+
|
|
233
289
|
|
|
234
|
-
// 列设置回调
|
|
235
290
|
var handleChangeColumns = function handleChangeColumns(keys) {
|
|
236
291
|
setState({
|
|
237
292
|
checkedColumnKeys: keys,
|
|
@@ -240,10 +295,11 @@ function VtxDatagrid(props) {
|
|
|
240
295
|
})
|
|
241
296
|
});
|
|
242
297
|
onVisibleColumnsChange && onVisibleColumnsChange(keys);
|
|
243
|
-
};
|
|
298
|
+
}; // 工具栏
|
|
299
|
+
|
|
244
300
|
|
|
245
|
-
// 工具栏
|
|
246
301
|
var toolbarRender;
|
|
302
|
+
|
|
247
303
|
if (toolbar) {
|
|
248
304
|
toolbarRender = /*#__PURE__*/_react["default"].createElement("div", {
|
|
249
305
|
className: (0, _classnames2["default"])("".concat(prefixCls, "-toolbar"), toolbarClassName)
|
|
@@ -303,13 +359,14 @@ function VtxDatagrid(props) {
|
|
|
303
359
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
304
360
|
title: (customEnumText === null || customEnumText === void 0 ? void 0 : customEnumText.columnSettingText) || "列设置"
|
|
305
361
|
}, /*#__PURE__*/_react["default"].createElement(_SettingOutlined["default"], null)))))));
|
|
306
|
-
}
|
|
362
|
+
} // 分页
|
|
363
|
+
|
|
307
364
|
|
|
308
|
-
// 分页
|
|
309
365
|
var getPagination = function getPagination(pagination) {
|
|
310
366
|
if (typeof pagination === 'boolean' && !pagination) {
|
|
311
367
|
return pagination;
|
|
312
368
|
}
|
|
369
|
+
|
|
313
370
|
return _objectSpread({
|
|
314
371
|
pageSizeOptions: ['10', '20', '30', '40', '50'],
|
|
315
372
|
showSizeChanger: true,
|
|
@@ -318,17 +375,20 @@ function VtxDatagrid(props) {
|
|
|
318
375
|
return "\u5171 ".concat(total, " \u6761");
|
|
319
376
|
}
|
|
320
377
|
}, pagination);
|
|
321
|
-
};
|
|
378
|
+
}; // 处理操作按钮
|
|
379
|
+
|
|
322
380
|
|
|
323
|
-
// 处理操作按钮
|
|
324
381
|
var columns = (visibleColumns || []).map(function (column) {
|
|
325
382
|
var newColumn = _objectSpread({}, column);
|
|
383
|
+
|
|
326
384
|
if (newColumn.renderButtons) {
|
|
327
385
|
delete newColumn.renderButtons;
|
|
328
386
|
}
|
|
387
|
+
|
|
329
388
|
if (newColumn.renderButtonsVisibleNum) {
|
|
330
389
|
delete newColumn.renderButtonsVisibleNum;
|
|
331
390
|
}
|
|
391
|
+
|
|
332
392
|
return _objectSpread(_objectSpread({}, newColumn), {}, {
|
|
333
393
|
render: (0, _isFunction["default"])(column.renderButtons) ? function (text, record, index) {
|
|
334
394
|
return (0, _renderColumnButtons["default"])(column.renderButtons, column.renderButtonsVisibleNum, text, record, index, customEnumText);
|
|
@@ -336,8 +396,8 @@ function VtxDatagrid(props) {
|
|
|
336
396
|
return ['', null, undefined].includes(text) ? '-' : text;
|
|
337
397
|
}
|
|
338
398
|
});
|
|
339
|
-
});
|
|
340
|
-
|
|
399
|
+
}); // 配置了列可伸缩
|
|
400
|
+
|
|
341
401
|
if (columnResizable) {
|
|
342
402
|
columns = columns.map(function (col, index) {
|
|
343
403
|
return _objectSpread(_objectSpread({}, col), {}, {
|
|
@@ -349,12 +409,15 @@ function VtxDatagrid(props) {
|
|
|
349
409
|
}
|
|
350
410
|
});
|
|
351
411
|
});
|
|
412
|
+
|
|
352
413
|
var handleResize = function handleResize(index) {
|
|
353
414
|
return function (e, _ref2) {
|
|
354
415
|
var size = _ref2.size;
|
|
355
416
|
setState(function (_ref3) {
|
|
356
417
|
var visibleColumns = _ref3.visibleColumns;
|
|
418
|
+
|
|
357
419
|
var nextColumns = _toConsumableArray(visibleColumns);
|
|
420
|
+
|
|
358
421
|
nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
|
|
359
422
|
width: size.width
|
|
360
423
|
});
|
|
@@ -364,12 +427,14 @@ function VtxDatagrid(props) {
|
|
|
364
427
|
});
|
|
365
428
|
};
|
|
366
429
|
};
|
|
367
|
-
}
|
|
430
|
+
} // 序号添加
|
|
431
|
+
|
|
368
432
|
|
|
369
|
-
// 序号添加
|
|
370
433
|
var dataSource = rest.dataSource;
|
|
434
|
+
|
|
371
435
|
if (indexColumn) {
|
|
372
436
|
var _dataSource;
|
|
437
|
+
|
|
373
438
|
columns = [{
|
|
374
439
|
title: indexTitle,
|
|
375
440
|
dataIndex: '_serialNum',
|
|
@@ -383,15 +448,18 @@ function VtxDatagrid(props) {
|
|
|
383
448
|
});
|
|
384
449
|
});
|
|
385
450
|
}
|
|
451
|
+
|
|
386
452
|
var scroll;
|
|
453
|
+
|
|
387
454
|
if (autoFit) {
|
|
388
455
|
scroll = _objectSpread(_objectSpread({}, rest.scroll || {}), {}, {
|
|
389
456
|
y: scrollY
|
|
390
457
|
});
|
|
391
458
|
}
|
|
459
|
+
|
|
392
460
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
393
461
|
id: datagridId,
|
|
394
|
-
className: (0, _classnames2["default"])(prefixCls, className,
|
|
462
|
+
className: (0, _classnames2["default"])(prefixCls, className, (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-fit"), autoFit), _defineProperty(_classnames, "".concat(prefixCls, "-noFit"), !autoFit), _defineProperty(_classnames, "".concat(prefixCls, "-nodata"), !((_dataSource2 = dataSource) !== null && _dataSource2 !== void 0 && _dataSource2.length)), _defineProperty(_classnames, "".concat(prefixCls, "-userAgent-mac"), isMac), _classnames)),
|
|
395
463
|
style: style,
|
|
396
464
|
ref: datagridRef
|
|
397
465
|
}, toolbarRender, hasAlert && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -423,6 +491,7 @@ function VtxDatagrid(props) {
|
|
|
423
491
|
}) : components
|
|
424
492
|
})));
|
|
425
493
|
}
|
|
494
|
+
|
|
426
495
|
VtxDatagrid.propTypes = {
|
|
427
496
|
prefixCls: _propTypes["default"].string,
|
|
428
497
|
refreshIconVisible: _propTypes["default"].bool,
|