@vtx/components 3.1.95 → 3.1.97
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 +55 -44
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +1 -4
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getToken.js +7 -15
- package/lib/_util/getToken.js.map +1 -1
- package/lib/_util/getUrlParam.js +1 -8
- package/lib/_util/getUrlParam.js.map +1 -1
- package/lib/_util/isFunction.js +0 -1
- package/lib/_util/isFunction.js.map +1 -1
- package/lib/_util/isObject.js +0 -1
- package/lib/_util/isObject.js.map +1 -1
- package/lib/_util/useColSize.js +2 -12
- package/lib/_util/useColSize.js.map +1 -1
- package/lib/_util/useInterval.js +0 -3
- package/lib/_util/useInterval.js.map +1 -1
- package/lib/_util/useSet.js +23 -39
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js +1 -2
- package/lib/config.js.map +1 -1
- package/lib/index.js +0 -29
- 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 +9 -26
- package/lib/vtx-color-picker/index.js.map +1 -1
- package/lib/vtx-color-picker/style/css.js +0 -2
- package/lib/vtx-color-picker/style/css.js.map +1 -1
- package/lib/vtx-color-picker/style/index.js +0 -2
- package/lib/vtx-color-picker/style/index.js.map +1 -1
- package/lib/vtx-combogrid/Combogrid.js +46 -86
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +32 -58
- package/lib/vtx-combogrid/index.js.map +1 -1
- package/lib/vtx-combogrid/style/css.js +0 -7
- package/lib/vtx-combogrid/style/css.js.map +1 -1
- package/lib/vtx-combogrid/style/index.js +0 -7
- package/lib/vtx-combogrid/style/index.js.map +1 -1
- package/lib/vtx-datagrid/Alert.js +5 -14
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +37 -76
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +3 -15
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +117 -188
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +7 -38
- package/lib/vtx-datagrid/renderColumnButtons.js.map +1 -1
- package/lib/vtx-datagrid/style/css.js +0 -10
- package/lib/vtx-datagrid/style/css.js.map +1 -1
- package/lib/vtx-datagrid/style/index.js +0 -10
- package/lib/vtx-datagrid/style/index.js.map +1 -1
- package/lib/vtx-date-picker/QdatePicker.js +21 -51
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +24 -65
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +1 -7
- package/lib/vtx-date-picker/index.js.map +1 -1
- package/lib/vtx-date-picker/style/css.js +0 -1
- package/lib/vtx-date-picker/style/css.js.map +1 -1
- package/lib/vtx-date-picker/style/index.js +0 -1
- 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 +9 -28
- package/lib/vtx-editor/index.js.map +1 -1
- package/lib/vtx-editor/style/css.js +0 -1
- package/lib/vtx-editor/style/css.js.map +1 -1
- package/lib/vtx-editor/style/index.js +0 -1
- 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 +14 -27
- package/lib/vtx-ellipsis-text/index.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/css.js +0 -1
- package/lib/vtx-ellipsis-text/style/css.js.map +1 -1
- package/lib/vtx-ellipsis-text/style/index.js +0 -1
- 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 +41 -65
- package/lib/vtx-export/index.js.map +1 -1
- package/lib/vtx-export/style/css.js +0 -5
- package/lib/vtx-export/style/css.js.map +1 -1
- package/lib/vtx-export/style/index.js +0 -5
- package/lib/vtx-export/style/index.js.map +1 -1
- package/lib/vtx-export-async/History.js +59 -100
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +64 -105
- 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 +2 -13
- package/lib/vtx-export-async/util.js.map +1 -1
- package/lib/vtx-form-layout/Card.js +11 -33
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +5 -11
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +12 -34
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +3 -9
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +1 -8
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +1 -4
- 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 +9 -24
- package/lib/vtx-form-layout/index.js.map +1 -1
- package/lib/vtx-form-layout/style/css.js +0 -7
- package/lib/vtx-form-layout/style/css.js.map +1 -1
- package/lib/vtx-form-layout/style/index.js +0 -7
- 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 +73 -113
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +30 -59
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +17 -47
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +4 -11
- package/lib/vtx-image/index.js.map +1 -1
- package/lib/vtx-image/style/css.js +0 -1
- package/lib/vtx-image/style/css.js.map +1 -1
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-image/style/index.js.map +1 -1
- package/lib/vtx-import/index.js +45 -78
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +10 -28
- package/lib/vtx-import/result.js.map +1 -1
- package/lib/vtx-import/style/css.js +0 -3
- package/lib/vtx-import/style/css.js.map +1 -1
- package/lib/vtx-import/style/index.js +0 -3
- 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 +1 -8
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +11 -33
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +1 -6
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +7 -14
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +1 -6
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +51 -107
- package/lib/vtx-import2/index.js.map +1 -1
- package/lib/vtx-import2/style/css.js +0 -3
- package/lib/vtx-import2/style/css.js.map +1 -1
- package/lib/vtx-import2/style/index.js +0 -3
- 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 +10 -27
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +20 -45
- package/lib/vtx-input/index.js.map +1 -1
- package/lib/vtx-input/style/css.js +0 -1
- package/lib/vtx-input/style/css.js.map +1 -1
- package/lib/vtx-input/style/index.js +0 -1
- 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 +7 -20
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +2 -8
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +49 -82
- package/lib/vtx-modal/index.js.map +1 -1
- package/lib/vtx-modal/style/css.js +0 -1
- package/lib/vtx-modal/style/css.js.map +1 -1
- package/lib/vtx-modal/style/index.js +0 -1
- package/lib/vtx-modal/style/index.js.map +1 -1
- package/lib/vtx-page-layout/Basic.js +3 -8
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +15 -26
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +3 -12
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +30 -60
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +11 -22
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +23 -51
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +1 -10
- 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 +38 -58
- 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 +30 -64
- 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 +7 -26
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +7 -14
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +61 -106
- package/lib/vtx-search/index.js.map +1 -1
- package/lib/vtx-search/style/css.js +0 -4
- package/lib/vtx-search/style/css.js.map +1 -1
- package/lib/vtx-search/style/index.js +0 -4
- package/lib/vtx-search/style/index.js.map +1 -1
- package/lib/vtx-search-map-input/index.js +58 -93
- package/lib/vtx-search-map-input/index.js.map +1 -1
- package/lib/vtx-search-map-input/style/css.js +0 -2
- package/lib/vtx-search-map-input/style/css.js.map +1 -1
- package/lib/vtx-search-map-input/style/index.js +0 -2
- package/lib/vtx-search-map-input/style/index.js.map +1 -1
- package/lib/vtx-select/index.js +39 -91
- package/lib/vtx-select/index.js.map +1 -1
- package/lib/vtx-select/style/css.js +0 -8
- package/lib/vtx-select/style/css.js.map +1 -1
- package/lib/vtx-select/style/index.js +0 -8
- 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 +18 -33
- package/lib/vtx-signature/index.js.map +1 -1
- package/lib/vtx-signature/style/css.js +0 -2
- package/lib/vtx-signature/style/css.js.map +1 -1
- package/lib/vtx-signature/style/index.js +0 -2
- 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 +11 -22
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +19 -39
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +51 -107
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +1 -6
- package/lib/vtx-split-pane/index.js.map +1 -1
- package/lib/vtx-split-pane/style/css.js +0 -3
- package/lib/vtx-split-pane/style/css.js.map +1 -1
- package/lib/vtx-split-pane/style/index.js +0 -3
- 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 +2 -9
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +14 -30
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +14 -30
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +1 -4
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +1 -18
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-statistics-column/style/css.js +0 -1
- package/lib/vtx-statistics-column/style/css.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.js +0 -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 +4 -18
- 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-tree/index.js +49 -114
- package/lib/vtx-tree/index.js.map +1 -1
- package/lib/vtx-tree/style/css.js +0 -2
- package/lib/vtx-tree/style/css.js.map +1 -1
- package/lib/vtx-tree/style/index.js +0 -2
- package/lib/vtx-tree/style/index.js.map +1 -1
- package/lib/vtx-tree/utils.js +6 -27
- package/lib/vtx-tree/utils.js.map +1 -1
- package/lib/vtx-tree-select/index.js +27 -71
- package/lib/vtx-tree-select/index.js.map +1 -1
- package/lib/vtx-tree-select/style/css.js +0 -3
- package/lib/vtx-tree-select/style/css.js.map +1 -1
- package/lib/vtx-tree-select/style/index.js +0 -3
- package/lib/vtx-tree-select/style/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +15 -33
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +79 -156
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +0 -6
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +0 -6
- 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 +74 -116
- package/lib/vtx-wang-editor/index.js.map +1 -1
- package/lib/vtx-wang-editor/style/css.js +0 -1
- package/lib/vtx-wang-editor/style/css.js.map +1 -1
- package/lib/vtx-wang-editor/style/index.js +0 -1
- 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 +75 -136
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +69 -119
- package/lib/vtx-ztree/index.js.map +1 -1
- package/lib/vtx-ztree/style/css.js +0 -1
- package/lib/vtx-ztree/style/css.js.map +1 -1
- package/lib/vtx-ztree/style/index.js +0 -1
- 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 +74 -142
- package/lib/vtx-ztree-select/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/css.js +0 -3
- package/lib/vtx-ztree-select/style/css.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.js +0 -3
- package/lib/vtx-ztree-select/style/index.js.map +1 -1
- package/lib/vtx-ztree-select/style/index.less +109 -109
- package/package.json +121 -121
|
@@ -4,30 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _reactResizable = require("react-resizable");
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _excluded = ["onResize", "width"];
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
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
|
-
|
|
20
13
|
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
|
-
|
|
22
14
|
var ResizeableTitle = function ResizeableTitle(props) {
|
|
23
15
|
var onResize = props.onResize,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
width = props.width,
|
|
17
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
27
18
|
if (!width) {
|
|
28
19
|
return /*#__PURE__*/_react["default"].createElement("th", restProps);
|
|
29
20
|
}
|
|
30
|
-
|
|
31
21
|
return /*#__PURE__*/_react["default"].createElement(_reactResizable.Resizable, {
|
|
32
22
|
width: width,
|
|
33
23
|
height: 0,
|
|
@@ -37,11 +27,9 @@ var ResizeableTitle = function ResizeableTitle(props) {
|
|
|
37
27
|
}
|
|
38
28
|
}, /*#__PURE__*/_react["default"].createElement("th", restProps));
|
|
39
29
|
};
|
|
40
|
-
|
|
41
30
|
ResizeableTitle.propTypes = {
|
|
42
31
|
onResize: _propTypes["default"].func,
|
|
43
32
|
width: _propTypes["default"].number
|
|
44
33
|
};
|
|
45
|
-
var _default = ResizeableTitle;
|
|
46
|
-
exports["default"] = _default;
|
|
34
|
+
var _default = exports["default"] = ResizeableTitle;
|
|
47
35
|
//# sourceMappingURL=ResizeableTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
1
|
+
{"version":3,"file":"ResizeableTitle.js","names":["_react","_interopRequireDefault","require","_reactResizable","_propTypes","_excluded","obj","__esModule","_objectWithoutProperties","source","excluded","target","_objectWithoutPropertiesLoose","key","i","Object","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","prototype","propertyIsEnumerable","call","sourceKeys","keys","ResizeableTitle","props","onResize","width","restProps","createElement","Resizable","height","draggableOpts","enableUserSelectHack","propTypes","PropTypes","func","number","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAmC,IAAAG,SAAA;AAAA,SAAAJ,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,MAAA,EAAAC,QAAA,QAAAD,MAAA,yBAAAE,MAAA,GAAAC,6BAAA,CAAAH,MAAA,EAAAC,QAAA,OAAAG,GAAA,EAAAC,CAAA,MAAAC,MAAA,CAAAC,qBAAA,QAAAC,gBAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAP,MAAA,QAAAK,CAAA,MAAAA,CAAA,GAAAG,gBAAA,CAAAC,MAAA,EAAAJ,CAAA,MAAAD,GAAA,GAAAI,gBAAA,CAAAH,CAAA,OAAAJ,QAAA,CAAAS,OAAA,CAAAN,GAAA,uBAAAE,MAAA,CAAAK,SAAA,CAAAC,oBAAA,CAAAC,IAAA,CAAAb,MAAA,EAAAI,GAAA,aAAAF,MAAA,CAAAE,GAAA,IAAAJ,MAAA,CAAAI,GAAA,cAAAF,MAAA;AAAA,SAAAC,8BAAAH,MAAA,EAAAC,QAAA,QAAAD,MAAA,yBAAAE,MAAA,WAAAY,UAAA,GAAAR,MAAA,CAAAS,IAAA,CAAAf,MAAA,OAAAI,GAAA,EAAAC,CAAA,OAAAA,CAAA,MAAAA,CAAA,GAAAS,UAAA,CAAAL,MAAA,EAAAJ,CAAA,MAAAD,GAAA,GAAAU,UAAA,CAAAT,CAAA,OAAAJ,QAAA,CAAAS,OAAA,CAAAN,GAAA,kBAAAF,MAAA,CAAAE,GAAA,IAAAJ,MAAA,CAAAI,GAAA,YAAAF,MAAA;AAEnC,IAAMc,eAAe,GAAG,SAAlBA,eAAeA,CAAGC,KAAK,EAAI;EAC7B,IAAQC,QAAQ,GAA0BD,KAAK,CAAvCC,QAAQ;IAAEC,KAAK,GAAmBF,KAAK,CAA7BE,KAAK;IAAKC,SAAS,GAAArB,wBAAA,CAAKkB,KAAK,EAAArB,SAAA;EAE/C,IAAI,CAACuB,KAAK,EAAE;IACR,oBAAO5B,MAAA,YAAA8B,aAAA,OAAQD,SAAY,CAAC;EAChC;EAEA,oBACI7B,MAAA,YAAA8B,aAAA,CAAC3B,eAAA,CAAA4B,SAAS;IACNH,KAAK,EAAEA,KAAM;IACbI,MAAM,EAAE,CAAE;IACVL,QAAQ,EAAEA,QAAS;IACnBM,aAAa,EAAE;MAAEC,oBAAoB,EAAE;IAAM;EAAE,gBAE/ClC,MAAA,YAAA8B,aAAA,OAAQD,SAAY,CACb,CAAC;AAEpB,CAAC;AAEDJ,eAAe,CAACU,SAAS,GAAG;EACxBR,QAAQ,EAAES,qBAAS,CAACC,IAAI;EACxBT,KAAK,EAAEQ,qBAAS,CAACE;AACrB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEaf,eAAe","ignoreList":[]}
|
|
@@ -1,170 +1,126 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = VtxDatagrid;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
11
|
var _table = _interopRequireDefault(require("antd/lib/table"));
|
|
17
|
-
|
|
18
12
|
var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
|
|
19
|
-
|
|
20
13
|
var _dropdown = _interopRequireDefault(require("antd/lib/dropdown"));
|
|
21
|
-
|
|
22
14
|
var _menu = _interopRequireDefault(require("antd/lib/menu"));
|
|
23
|
-
|
|
24
15
|
var _empty = _interopRequireDefault(require("antd/lib/empty"));
|
|
25
|
-
|
|
26
16
|
var _RedoOutlined = _interopRequireDefault(require("@ant-design/icons/RedoOutlined"));
|
|
27
|
-
|
|
28
17
|
var _ColumnHeightOutlined = _interopRequireDefault(require("@ant-design/icons/ColumnHeightOutlined"));
|
|
29
|
-
|
|
30
18
|
var _SettingOutlined = _interopRequireDefault(require("@ant-design/icons/SettingOutlined"));
|
|
31
|
-
|
|
32
19
|
var _Alert = _interopRequireDefault(require("./Alert"));
|
|
33
|
-
|
|
34
20
|
var _ColumnSetting = _interopRequireDefault(require("./ColumnSetting"));
|
|
35
|
-
|
|
36
21
|
var _ResizeableTitle = _interopRequireDefault(require("./ResizeableTitle"));
|
|
37
|
-
|
|
38
22
|
var _renderColumnButtons = _interopRequireDefault(require("./renderColumnButtons"));
|
|
39
|
-
|
|
40
23
|
var _useSet3 = _interopRequireDefault(require("../_util/useSet"));
|
|
41
|
-
|
|
42
24
|
var _isFunction = _interopRequireDefault(require("../_util/isFunction"));
|
|
43
|
-
|
|
44
25
|
var _axios = _interopRequireDefault(require("axios"));
|
|
45
|
-
|
|
46
26
|
var _ahooks = require("ahooks");
|
|
47
|
-
|
|
48
27
|
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", "disabledColumnKeys", "onColumnsSave", "uniqueKey", "prefixUrl", "customEnumText"];
|
|
49
|
-
|
|
50
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
51
|
-
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
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; }
|
|
55
|
-
|
|
29
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
30
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
56
31
|
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); }
|
|
57
|
-
|
|
58
32
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
59
|
-
|
|
60
33
|
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."); }
|
|
61
|
-
|
|
62
34
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
63
|
-
|
|
64
35
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
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; }
|
|
71
|
-
|
|
36
|
+
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; }
|
|
37
|
+
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; }
|
|
38
|
+
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; }
|
|
39
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
40
|
+
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); }
|
|
72
41
|
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; }
|
|
73
|
-
|
|
74
42
|
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; }
|
|
75
|
-
|
|
76
43
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
77
|
-
|
|
78
44
|
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."); }
|
|
79
|
-
|
|
80
45
|
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); }
|
|
81
|
-
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
-
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; }
|
|
85
|
-
|
|
46
|
+
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; }
|
|
47
|
+
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; } }
|
|
86
48
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
87
|
-
|
|
88
49
|
var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
|
|
89
|
-
|
|
90
50
|
function VtxDatagrid(props) {
|
|
91
|
-
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection2, _dataSource2,
|
|
92
|
-
|
|
51
|
+
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection2, _dataSource2, _rest$rowSelection3, _dataSource3;
|
|
93
52
|
var _useSet = (0, _useSet3["default"])({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
53
|
+
// 显示列
|
|
54
|
+
visibleColumns: [],
|
|
55
|
+
// 列设置选中的列
|
|
56
|
+
checkedColumnKeys: [],
|
|
57
|
+
// 列设置选项
|
|
58
|
+
columnSettingOptions: [],
|
|
59
|
+
datagridId: "vtx-datagrid-".concat(new Date().getTime()),
|
|
60
|
+
scrollY: 0,
|
|
61
|
+
size: 'middle',
|
|
62
|
+
projectKey: ''
|
|
63
|
+
}),
|
|
64
|
+
_useSet2 = _slicedToArray(_useSet, 2),
|
|
65
|
+
state = _useSet2[0],
|
|
66
|
+
setState = _useSet2[1];
|
|
109
67
|
var visibleColumns = state.visibleColumns,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var datagridRef = (0, _react.useRef)(null);
|
|
116
|
-
|
|
117
|
-
var alertHeight = (0, _react.useRef)(0);
|
|
118
|
-
|
|
119
|
-
var toolbarHeight = (0, _react.useRef)(0);
|
|
120
|
-
|
|
68
|
+
checkedColumnKeys = state.checkedColumnKeys,
|
|
69
|
+
columnSettingOptions = state.columnSettingOptions,
|
|
70
|
+
datagridId = state.datagridId,
|
|
71
|
+
scrollY = state.scrollY,
|
|
72
|
+
size = state.size;
|
|
73
|
+
var datagridRef = (0, _react.useRef)(null);
|
|
74
|
+
// 列设置提示高度
|
|
75
|
+
var alertHeight = (0, _react.useRef)(0);
|
|
76
|
+
// 工具栏高度
|
|
77
|
+
var toolbarHeight = (0, _react.useRef)(0);
|
|
78
|
+
// 列接口显示字段
|
|
121
79
|
var settingRef = (0, _react.useRef)();
|
|
122
|
-
|
|
123
80
|
var _props$prefixCls = props.prefixCls,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
81
|
+
prefixCls = _props$prefixCls === void 0 ? 'vtx-datagrid' : _props$prefixCls,
|
|
82
|
+
_props$toolbar = props.toolbar,
|
|
83
|
+
toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
|
|
84
|
+
toolbarClassName = props.toolbarClassName,
|
|
85
|
+
_props$toolbarTilte = props.toolbarTilte,
|
|
86
|
+
toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
|
|
87
|
+
buttonGroup = props.buttonGroup,
|
|
88
|
+
_props$refreshIconVis = props.refreshIconVisible,
|
|
89
|
+
refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
|
|
90
|
+
hideColumnSetting = props.hideColumnSetting,
|
|
91
|
+
hideColumnHeight = props.hideColumnHeight,
|
|
92
|
+
visibleColumnKeys = props.visibleColumnKeys,
|
|
93
|
+
defaultVisibleColumnKeys = props.defaultVisibleColumnKeys,
|
|
94
|
+
onVisibleColumnsChange = props.onVisibleColumnsChange,
|
|
95
|
+
onRefresh = props.onRefresh,
|
|
96
|
+
_props$indexColumn = props.indexColumn,
|
|
97
|
+
indexColumn = _props$indexColumn === void 0 ? true : _props$indexColumn,
|
|
98
|
+
_props$indexFixed = props.indexFixed,
|
|
99
|
+
indexFixed = _props$indexFixed === void 0 ? false : _props$indexFixed,
|
|
100
|
+
_props$bordered = props.bordered,
|
|
101
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
102
|
+
_props$indexTitle = props.indexTitle,
|
|
103
|
+
indexTitle = _props$indexTitle === void 0 ? '序号' : _props$indexTitle,
|
|
104
|
+
_props$startIndex = props.startIndex,
|
|
105
|
+
startIndex = _props$startIndex === void 0 ? 1 : _props$startIndex,
|
|
106
|
+
_props$autoFit = props.autoFit,
|
|
107
|
+
autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
|
|
108
|
+
_props$headFootHeight = props.headFootHeight,
|
|
109
|
+
headFootHeight = _props$headFootHeight === void 0 ? 115 : _props$headFootHeight,
|
|
110
|
+
columnResizable = props.columnResizable,
|
|
111
|
+
components = props.components,
|
|
112
|
+
className = props.className,
|
|
113
|
+
style = props.style,
|
|
114
|
+
_props$emptyText = props.emptyText,
|
|
115
|
+
emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
|
|
116
|
+
onRowSelectionClear = props.onRowSelectionClear,
|
|
117
|
+
disabledColumnKeys = props.disabledColumnKeys,
|
|
118
|
+
onColumnsSave = props.onColumnsSave,
|
|
119
|
+
uniqueKey = props.uniqueKey,
|
|
120
|
+
prefixUrl = props.prefixUrl,
|
|
121
|
+
_props$customEnumText = props.customEnumText,
|
|
122
|
+
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
|
|
123
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
168
124
|
var TextEnum = _objectSpread({
|
|
169
125
|
refreshText: '刷新',
|
|
170
126
|
densityDefaultText: '默认',
|
|
@@ -181,19 +137,17 @@ function VtxDatagrid(props) {
|
|
|
181
137
|
alartAlreadyChooseUnitText: '项',
|
|
182
138
|
messageSuccessText: '操作成功',
|
|
183
139
|
messageWarningOneText: '至少勾选一列保存'
|
|
184
|
-
}, customEnumText);
|
|
185
|
-
|
|
140
|
+
}, customEnumText);
|
|
186
141
|
|
|
142
|
+
// 规则,菜单根目录_页面路由
|
|
187
143
|
function getUniqueKey() {
|
|
188
144
|
var route = location.href.match(/#\/(\S*)\?/);
|
|
189
|
-
|
|
190
145
|
if (route) {
|
|
191
146
|
(0, _axios["default"])({
|
|
192
147
|
method: 'GET',
|
|
193
148
|
url: "".concat(location.pathname, "resources/json/menu.json")
|
|
194
149
|
}).then(function (res) {
|
|
195
150
|
var _res$data;
|
|
196
|
-
|
|
197
151
|
if ((res === null || res === void 0 ? void 0 : res.status) == 200 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.key) {
|
|
198
152
|
setState({
|
|
199
153
|
projectKey: "".concat(res.data.key, "_").concat(route ? route[1] : 'test')
|
|
@@ -201,46 +155,41 @@ function VtxDatagrid(props) {
|
|
|
201
155
|
}
|
|
202
156
|
});
|
|
203
157
|
}
|
|
204
|
-
}
|
|
205
|
-
|
|
158
|
+
}
|
|
206
159
|
|
|
160
|
+
// 高度计算
|
|
207
161
|
var _useThrottleFn = (0, _ahooks.useThrottleFn)(function () {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}),
|
|
226
|
-
calculateHeight = _useThrottleFn.run;
|
|
227
|
-
|
|
162
|
+
var _datagridRef$current;
|
|
163
|
+
if (!datagridRef.current) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
var bodyHeight = ((_datagridRef$current = datagridRef.current) === null || _datagridRef$current === void 0 ? void 0 : _datagridRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
|
|
167
|
+
var divs = datagridRef.current.getElementsByTagName('div');
|
|
168
|
+
var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
|
|
169
|
+
return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content');
|
|
170
|
+
})[0];
|
|
171
|
+
bodyDiv.style.minHeight = "".concat(bodyHeight - (rest.scrollY || 0), "px");
|
|
172
|
+
setState({
|
|
173
|
+
scrollY: bodyHeight
|
|
174
|
+
});
|
|
175
|
+
}, {
|
|
176
|
+
wait: 350
|
|
177
|
+
}),
|
|
178
|
+
calculateHeight = _useThrottleFn.run;
|
|
228
179
|
(0, _react.useEffect)(function () {
|
|
229
180
|
// 当没有传入唯一值而且没有自定义列保存的时候根据规则自动生成唯一值
|
|
230
181
|
if (!uniqueKey && !onColumnsSave) {
|
|
231
182
|
getUniqueKey();
|
|
232
183
|
}
|
|
233
|
-
|
|
234
184
|
var resizeObserver = new ResizeObserver(function () {
|
|
235
185
|
calculateHeight();
|
|
236
|
-
});
|
|
237
|
-
|
|
186
|
+
});
|
|
187
|
+
// componentDidMount
|
|
238
188
|
if (autoFit && datagridRef.current) {
|
|
239
189
|
resizeObserver.observe(datagridRef.current, {
|
|
240
190
|
box: 'border-box'
|
|
241
191
|
});
|
|
242
192
|
}
|
|
243
|
-
|
|
244
193
|
return function () {
|
|
245
194
|
// componentWillUnmount
|
|
246
195
|
if (autoFit) {
|
|
@@ -255,7 +204,6 @@ function VtxDatagrid(props) {
|
|
|
255
204
|
}, [(_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(',')]);
|
|
256
205
|
(0, _react.useEffect)(function () {
|
|
257
206
|
var _rest$columns;
|
|
258
|
-
|
|
259
207
|
parseColumns();
|
|
260
208
|
setState({
|
|
261
209
|
columnSettingOptions: (_rest$columns = rest.columns) === null || _rest$columns === void 0 ? void 0 : _rest$columns.map(function (col) {
|
|
@@ -265,15 +213,12 @@ function VtxDatagrid(props) {
|
|
|
265
213
|
})
|
|
266
214
|
});
|
|
267
215
|
}, [rest.columns]);
|
|
268
|
-
|
|
269
216
|
var parseColumns = function parseColumns(type) {
|
|
270
217
|
// 显示工具栏的同时并显示列设置
|
|
271
218
|
if (toolbar && !hideColumnSetting) {
|
|
272
219
|
var _settingRef$current;
|
|
273
|
-
|
|
274
220
|
if (defaultVisibleColumnKeys || visibleColumnKeys || (_settingRef$current = settingRef.current) !== null && _settingRef$current !== void 0 && _settingRef$current.showColumns) {
|
|
275
221
|
var _settingRef$current2, _rest$columns2;
|
|
276
|
-
|
|
277
222
|
var columnKeys = type === 'reset' ? defaultVisibleColumnKeys : ((_settingRef$current2 = settingRef.current) === null || _settingRef$current2 === void 0 ? void 0 : _settingRef$current2.showColumns) || visibleColumnKeys || defaultVisibleColumnKeys;
|
|
278
223
|
setState({
|
|
279
224
|
checkedColumnKeys: columnKeys,
|
|
@@ -283,7 +228,6 @@ function VtxDatagrid(props) {
|
|
|
283
228
|
});
|
|
284
229
|
} else {
|
|
285
230
|
var _rest$columns3;
|
|
286
|
-
|
|
287
231
|
setState({
|
|
288
232
|
checkedColumnKeys: (_rest$columns3 = rest.columns) === null || _rest$columns3 === void 0 ? void 0 : _rest$columns3.map(function (item) {
|
|
289
233
|
return item.dataIndex || item.key;
|
|
@@ -297,14 +241,13 @@ function VtxDatagrid(props) {
|
|
|
297
241
|
});
|
|
298
242
|
}
|
|
299
243
|
};
|
|
300
|
-
|
|
301
244
|
var hasAlert = (((_rest$rowSelection2 = rest.rowSelection) === null || _rest$rowSelection2 === void 0 ? void 0 : _rest$rowSelection2.selectedRowKeys) || []).length > 0;
|
|
302
245
|
alertHeight.current = hasAlert ? 49 : 0;
|
|
303
|
-
toolbarHeight.current = toolbar ? 56 : 0;
|
|
246
|
+
toolbarHeight.current = toolbar ? 56 : 0;
|
|
304
247
|
|
|
248
|
+
// 列设置回调
|
|
305
249
|
var handleChangeColumns = function handleChangeColumns(keys) {
|
|
306
250
|
var _rest$columns4;
|
|
307
|
-
|
|
308
251
|
var columnKeys = keys || ((_rest$columns4 = rest.columns) === null || _rest$columns4 === void 0 ? void 0 : _rest$columns4.map(function (item) {
|
|
309
252
|
return item.dataIndex || item.key;
|
|
310
253
|
}));
|
|
@@ -315,11 +258,10 @@ function VtxDatagrid(props) {
|
|
|
315
258
|
})
|
|
316
259
|
});
|
|
317
260
|
onVisibleColumnsChange && onVisibleColumnsChange(columnKeys);
|
|
318
|
-
};
|
|
319
|
-
|
|
261
|
+
};
|
|
320
262
|
|
|
263
|
+
// 工具栏
|
|
321
264
|
var toolbarRender;
|
|
322
|
-
|
|
323
265
|
if (toolbar) {
|
|
324
266
|
toolbarRender = /*#__PURE__*/_react["default"].createElement("div", {
|
|
325
267
|
className: (0, _classnames2["default"])("".concat(prefixCls, "-toolbar"), toolbarClassName)
|
|
@@ -381,14 +323,13 @@ function VtxDatagrid(props) {
|
|
|
381
323
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
382
324
|
title: TextEnum.columnSettingText
|
|
383
325
|
}, /*#__PURE__*/_react["default"].createElement(_SettingOutlined["default"], null)))))));
|
|
384
|
-
}
|
|
385
|
-
|
|
326
|
+
}
|
|
386
327
|
|
|
328
|
+
// 分页
|
|
387
329
|
var getPagination = function getPagination(pagination) {
|
|
388
330
|
if (typeof pagination === 'boolean' && !pagination) {
|
|
389
331
|
return pagination;
|
|
390
332
|
}
|
|
391
|
-
|
|
392
333
|
return _objectSpread({
|
|
393
334
|
pageSizeOptions: ['10', '20', '30', '40', '50'],
|
|
394
335
|
showSizeChanger: true,
|
|
@@ -397,20 +338,17 @@ function VtxDatagrid(props) {
|
|
|
397
338
|
return "\u5171 ".concat(total, " \u6761");
|
|
398
339
|
}
|
|
399
340
|
}, pagination);
|
|
400
|
-
};
|
|
401
|
-
|
|
341
|
+
};
|
|
402
342
|
|
|
343
|
+
// 处理操作按钮
|
|
403
344
|
var columns = (visibleColumns || []).map(function (column) {
|
|
404
345
|
var newColumn = _objectSpread({}, column);
|
|
405
|
-
|
|
406
346
|
if (newColumn.renderButtons) {
|
|
407
347
|
delete newColumn.renderButtons;
|
|
408
348
|
}
|
|
409
|
-
|
|
410
349
|
if (newColumn.renderButtonsVisibleNum) {
|
|
411
350
|
delete newColumn.renderButtonsVisibleNum;
|
|
412
351
|
}
|
|
413
|
-
|
|
414
352
|
return _objectSpread(_objectSpread({}, newColumn), {}, {
|
|
415
353
|
render: (0, _isFunction["default"])(column.renderButtons) ? function (text, record, index) {
|
|
416
354
|
return (0, _renderColumnButtons["default"])(column.renderButtons, column.renderButtonsVisibleNum, text, record, index, TextEnum);
|
|
@@ -418,8 +356,8 @@ function VtxDatagrid(props) {
|
|
|
418
356
|
return ['', null, undefined].includes(text) ? '-' : text;
|
|
419
357
|
}
|
|
420
358
|
});
|
|
421
|
-
});
|
|
422
|
-
|
|
359
|
+
});
|
|
360
|
+
// 配置了列可伸缩
|
|
423
361
|
if (columnResizable) {
|
|
424
362
|
columns = columns.map(function (col, index) {
|
|
425
363
|
return _objectSpread(_objectSpread({}, col), {}, {
|
|
@@ -431,15 +369,12 @@ function VtxDatagrid(props) {
|
|
|
431
369
|
}
|
|
432
370
|
});
|
|
433
371
|
});
|
|
434
|
-
|
|
435
372
|
var handleResize = function handleResize(index) {
|
|
436
373
|
return function (e, _ref2) {
|
|
437
374
|
var size = _ref2.size;
|
|
438
375
|
setState(function (_ref3) {
|
|
439
376
|
var visibleColumns = _ref3.visibleColumns;
|
|
440
|
-
|
|
441
377
|
var nextColumns = _toConsumableArray(visibleColumns);
|
|
442
|
-
|
|
443
378
|
nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
|
|
444
379
|
width: size.width
|
|
445
380
|
});
|
|
@@ -449,14 +384,12 @@ function VtxDatagrid(props) {
|
|
|
449
384
|
});
|
|
450
385
|
};
|
|
451
386
|
};
|
|
452
|
-
}
|
|
453
|
-
|
|
387
|
+
}
|
|
454
388
|
|
|
389
|
+
// 序号添加
|
|
455
390
|
var dataSource = rest.dataSource;
|
|
456
|
-
|
|
457
391
|
if (indexColumn) {
|
|
458
392
|
var _dataSource;
|
|
459
|
-
|
|
460
393
|
columns = [{
|
|
461
394
|
title: indexTitle,
|
|
462
395
|
dataIndex: '_serialNum',
|
|
@@ -470,18 +403,15 @@ function VtxDatagrid(props) {
|
|
|
470
403
|
});
|
|
471
404
|
});
|
|
472
405
|
}
|
|
473
|
-
|
|
474
|
-
var scroll;
|
|
475
|
-
|
|
406
|
+
var scroll = rest.scroll || {};
|
|
476
407
|
if (autoFit) {
|
|
477
|
-
scroll = _objectSpread(_objectSpread({},
|
|
408
|
+
scroll = _objectSpread(_objectSpread({}, scroll), {}, {
|
|
478
409
|
y: scrollY - (rest.scrollY || 0)
|
|
479
410
|
});
|
|
480
411
|
}
|
|
481
|
-
|
|
482
412
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
483
413
|
id: datagridId,
|
|
484
|
-
className: (0, _classnames2["default"])(prefixCls, className, (
|
|
414
|
+
className: (0, _classnames2["default"])(prefixCls, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-fit"), autoFit), "".concat(prefixCls, "-noFit"), !autoFit), "".concat(prefixCls, "-nodata"), !((_dataSource2 = dataSource) !== null && _dataSource2 !== void 0 && _dataSource2.length)), "".concat(prefixCls, "-userAgent-mac"), isMac)),
|
|
485
415
|
style: style,
|
|
486
416
|
ref: datagridRef
|
|
487
417
|
}, toolbarRender, hasAlert && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -514,7 +444,6 @@ function VtxDatagrid(props) {
|
|
|
514
444
|
}) : components
|
|
515
445
|
})));
|
|
516
446
|
}
|
|
517
|
-
|
|
518
447
|
VtxDatagrid.propTypes = {
|
|
519
448
|
prefixCls: _propTypes["default"].string,
|
|
520
449
|
refreshIconVisible: _propTypes["default"].bool,
|