@vtx/components 3.1.89 → 3.1.91
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 +15 -7
- package/lib/_util/getToken.js.map +1 -1
- 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 +29 -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 +58 -31
- 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 +14 -5
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +80 -37
- 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 +190 -116
- 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 +61 -28
- 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 +100 -59
- package/lib/vtx-export-async/History.js.map +1 -1
- package/lib/vtx-export-async/index.js +105 -64
- 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 +13 -2
- 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 +78 -45
- 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 +107 -51
- 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 +82 -49
- 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 +60 -30
- 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 +57 -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 +93 -58
- 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 +91 -39
- 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 +1 -0
- package/lib/vtx-statistics-column/style/css.js.map +1 -1
- package/lib/vtx-statistics-column/style/index.js +1 -0
- 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-tree/index.js +114 -49
- package/lib/vtx-tree/index.js.map +1 -1
- package/lib/vtx-tree/style/css.js +2 -0
- package/lib/vtx-tree/style/css.js.map +1 -1
- package/lib/vtx-tree/style/index.js +2 -0
- package/lib/vtx-tree/style/index.js.map +1 -1
- package/lib/vtx-tree/utils.js +27 -6
- package/lib/vtx-tree/utils.js.map +1 -1
- package/lib/vtx-tree-select/index.js +71 -27
- package/lib/vtx-tree-select/index.js.map +1 -1
- package/lib/vtx-tree-select/style/css.js +3 -0
- package/lib/vtx-tree-select/style/css.js.map +1 -1
- package/lib/vtx-tree-select/style/index.js +3 -0
- package/lib/vtx-tree-select/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 +151 -78
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +6 -0
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +6 -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 +119 -69
- 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.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 +144 -77
- 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.css +5 -0
- 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 +109 -107
- package/package.json +121 -121
|
@@ -1,125 +1,170 @@
|
|
|
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 _ahooks = require("ahooks");
|
|
27
|
-
|
|
47
|
+
|
|
48
|
+
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
|
+
|
|
28
50
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
-
|
|
30
|
-
function
|
|
51
|
+
|
|
52
|
+
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); }
|
|
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
|
+
|
|
31
56
|
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
|
+
|
|
32
58
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
59
|
+
|
|
33
60
|
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
|
+
|
|
34
62
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
63
|
+
|
|
35
64
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
function
|
|
40
|
-
|
|
65
|
+
|
|
66
|
+
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; }
|
|
67
|
+
|
|
68
|
+
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; }
|
|
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
|
+
|
|
41
72
|
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
|
+
|
|
42
74
|
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
|
+
|
|
43
76
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
77
|
+
|
|
44
78
|
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
|
+
|
|
45
80
|
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); }
|
|
46
|
-
|
|
47
|
-
function
|
|
81
|
+
|
|
82
|
+
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; }
|
|
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
|
+
|
|
48
86
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
87
|
+
|
|
49
88
|
var isMac = navigator.userAgent.indexOf('Mac OS') !== -1;
|
|
89
|
+
|
|
50
90
|
function VtxDatagrid(props) {
|
|
51
|
-
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection2, _dataSource2, _rest$rowSelection3, _dataSource3;
|
|
91
|
+
var _rest$dataSource, _rest$rowSelection, _rest$rowSelection2, _dataSource2, _classnames, _rest$rowSelection3, _dataSource3;
|
|
92
|
+
|
|
52
93
|
var _useSet = (0, _useSet3["default"])({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
94
|
+
// 显示列
|
|
95
|
+
visibleColumns: [],
|
|
96
|
+
// 列设置选中的列
|
|
97
|
+
checkedColumnKeys: [],
|
|
98
|
+
// 列设置选项
|
|
99
|
+
columnSettingOptions: [],
|
|
100
|
+
datagridId: "vtx-datagrid-".concat(new Date().getTime()),
|
|
101
|
+
scrollY: 0,
|
|
102
|
+
size: 'middle',
|
|
103
|
+
projectKey: ''
|
|
104
|
+
}),
|
|
105
|
+
_useSet2 = _slicedToArray(_useSet, 2),
|
|
106
|
+
state = _useSet2[0],
|
|
107
|
+
setState = _useSet2[1];
|
|
108
|
+
|
|
67
109
|
var visibleColumns = state.visibleColumns,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var datagridRef = (0, _react.useRef)(null);
|
|
74
|
-
|
|
75
|
-
var alertHeight = (0, _react.useRef)(0);
|
|
76
|
-
|
|
77
|
-
var toolbarHeight = (0, _react.useRef)(0);
|
|
78
|
-
|
|
110
|
+
checkedColumnKeys = state.checkedColumnKeys,
|
|
111
|
+
columnSettingOptions = state.columnSettingOptions,
|
|
112
|
+
datagridId = state.datagridId,
|
|
113
|
+
scrollY = state.scrollY,
|
|
114
|
+
size = state.size;
|
|
115
|
+
var datagridRef = (0, _react.useRef)(null); // 列设置提示高度
|
|
116
|
+
|
|
117
|
+
var alertHeight = (0, _react.useRef)(0); // 工具栏高度
|
|
118
|
+
|
|
119
|
+
var toolbarHeight = (0, _react.useRef)(0); // 列接口显示字段
|
|
120
|
+
|
|
79
121
|
var settingRef = (0, _react.useRef)();
|
|
122
|
+
|
|
80
123
|
var _props$prefixCls = props.prefixCls,
|
|
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
|
-
|
|
124
|
+
prefixCls = _props$prefixCls === void 0 ? 'vtx-datagrid' : _props$prefixCls,
|
|
125
|
+
_props$toolbar = props.toolbar,
|
|
126
|
+
toolbar = _props$toolbar === void 0 ? true : _props$toolbar,
|
|
127
|
+
toolbarClassName = props.toolbarClassName,
|
|
128
|
+
_props$toolbarTilte = props.toolbarTilte,
|
|
129
|
+
toolbarTilte = _props$toolbarTilte === void 0 ? '查询结果' : _props$toolbarTilte,
|
|
130
|
+
buttonGroup = props.buttonGroup,
|
|
131
|
+
_props$refreshIconVis = props.refreshIconVisible,
|
|
132
|
+
refreshIconVisible = _props$refreshIconVis === void 0 ? true : _props$refreshIconVis,
|
|
133
|
+
hideColumnSetting = props.hideColumnSetting,
|
|
134
|
+
hideColumnHeight = props.hideColumnHeight,
|
|
135
|
+
visibleColumnKeys = props.visibleColumnKeys,
|
|
136
|
+
defaultVisibleColumnKeys = props.defaultVisibleColumnKeys,
|
|
137
|
+
onVisibleColumnsChange = props.onVisibleColumnsChange,
|
|
138
|
+
onRefresh = props.onRefresh,
|
|
139
|
+
_props$indexColumn = props.indexColumn,
|
|
140
|
+
indexColumn = _props$indexColumn === void 0 ? true : _props$indexColumn,
|
|
141
|
+
_props$indexFixed = props.indexFixed,
|
|
142
|
+
indexFixed = _props$indexFixed === void 0 ? false : _props$indexFixed,
|
|
143
|
+
_props$bordered = props.bordered,
|
|
144
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
145
|
+
_props$indexTitle = props.indexTitle,
|
|
146
|
+
indexTitle = _props$indexTitle === void 0 ? '序号' : _props$indexTitle,
|
|
147
|
+
_props$startIndex = props.startIndex,
|
|
148
|
+
startIndex = _props$startIndex === void 0 ? 1 : _props$startIndex,
|
|
149
|
+
_props$autoFit = props.autoFit,
|
|
150
|
+
autoFit = _props$autoFit === void 0 ? true : _props$autoFit,
|
|
151
|
+
_props$headFootHeight = props.headFootHeight,
|
|
152
|
+
headFootHeight = _props$headFootHeight === void 0 ? 115 : _props$headFootHeight,
|
|
153
|
+
columnResizable = props.columnResizable,
|
|
154
|
+
components = props.components,
|
|
155
|
+
className = props.className,
|
|
156
|
+
style = props.style,
|
|
157
|
+
_props$emptyText = props.emptyText,
|
|
158
|
+
emptyText = _props$emptyText === void 0 ? '暂无数据' : _props$emptyText,
|
|
159
|
+
onRowSelectionClear = props.onRowSelectionClear,
|
|
160
|
+
disabledColumnKeys = props.disabledColumnKeys,
|
|
161
|
+
onColumnsSave = props.onColumnsSave,
|
|
162
|
+
uniqueKey = props.uniqueKey,
|
|
163
|
+
prefixUrl = props.prefixUrl,
|
|
164
|
+
_props$customEnumText = props.customEnumText,
|
|
165
|
+
customEnumText = _props$customEnumText === void 0 ? {} : _props$customEnumText,
|
|
166
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
167
|
+
|
|
123
168
|
var TextEnum = _objectSpread({
|
|
124
169
|
refreshText: '刷新',
|
|
125
170
|
densityDefaultText: '默认',
|
|
@@ -136,17 +181,19 @@ function VtxDatagrid(props) {
|
|
|
136
181
|
alartAlreadyChooseUnitText: '项',
|
|
137
182
|
messageSuccessText: '操作成功',
|
|
138
183
|
messageWarningOneText: '至少勾选一列保存'
|
|
139
|
-
}, customEnumText);
|
|
184
|
+
}, customEnumText); // 规则,菜单根目录_页面路由
|
|
185
|
+
|
|
140
186
|
|
|
141
|
-
// 规则,菜单根目录_页面路由
|
|
142
187
|
function getUniqueKey() {
|
|
143
188
|
var route = location.href.match(/#\/(\S*)\?/);
|
|
189
|
+
|
|
144
190
|
if (route) {
|
|
145
191
|
(0, _axios["default"])({
|
|
146
192
|
method: 'GET',
|
|
147
193
|
url: "".concat(location.pathname, "resources/json/menu.json")
|
|
148
194
|
}).then(function (res) {
|
|
149
195
|
var _res$data;
|
|
196
|
+
|
|
150
197
|
if ((res === null || res === void 0 ? void 0 : res.status) == 200 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.key) {
|
|
151
198
|
setState({
|
|
152
199
|
projectKey: "".concat(res.data.key, "_").concat(route ? route[1] : 'test')
|
|
@@ -154,41 +201,46 @@ function VtxDatagrid(props) {
|
|
|
154
201
|
}
|
|
155
202
|
});
|
|
156
203
|
}
|
|
157
|
-
}
|
|
204
|
+
} // 高度计算
|
|
205
|
+
|
|
158
206
|
|
|
159
|
-
// 高度计算
|
|
160
207
|
var _useThrottleFn = (0, _ahooks.useThrottleFn)(function () {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
208
|
+
var _datagridRef$current;
|
|
209
|
+
|
|
210
|
+
if (!datagridRef.current) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
var bodyHeight = ((_datagridRef$current = datagridRef.current) === null || _datagridRef$current === void 0 ? void 0 : _datagridRef$current.clientHeight) - headFootHeight - toolbarHeight.current - alertHeight.current;
|
|
215
|
+
var divs = datagridRef.current.getElementsByTagName('div');
|
|
216
|
+
var bodyDiv = Array.prototype.filter.call(divs, function (dom) {
|
|
217
|
+
return dom.className.includes('ant-table-body') || dom.className.includes('ant-table-content');
|
|
218
|
+
})[0];
|
|
219
|
+
bodyDiv.style.minHeight = "".concat(bodyHeight - (rest.scrollY || 0), "px");
|
|
220
|
+
setState({
|
|
221
|
+
scrollY: bodyHeight
|
|
222
|
+
});
|
|
223
|
+
}, {
|
|
224
|
+
wait: 350
|
|
225
|
+
}),
|
|
226
|
+
calculateHeight = _useThrottleFn.run;
|
|
227
|
+
|
|
178
228
|
(0, _react.useEffect)(function () {
|
|
179
229
|
// 当没有传入唯一值而且没有自定义列保存的时候根据规则自动生成唯一值
|
|
180
230
|
if (!uniqueKey && !onColumnsSave) {
|
|
181
231
|
getUniqueKey();
|
|
182
232
|
}
|
|
233
|
+
|
|
183
234
|
var resizeObserver = new ResizeObserver(function () {
|
|
184
235
|
calculateHeight();
|
|
185
|
-
});
|
|
186
|
-
|
|
236
|
+
}); // componentDidMount
|
|
237
|
+
|
|
187
238
|
if (autoFit && datagridRef.current) {
|
|
188
239
|
resizeObserver.observe(datagridRef.current, {
|
|
189
240
|
box: 'border-box'
|
|
190
241
|
});
|
|
191
242
|
}
|
|
243
|
+
|
|
192
244
|
return function () {
|
|
193
245
|
// componentWillUnmount
|
|
194
246
|
if (autoFit) {
|
|
@@ -203,6 +255,7 @@ function VtxDatagrid(props) {
|
|
|
203
255
|
}, [(_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(',')]);
|
|
204
256
|
(0, _react.useEffect)(function () {
|
|
205
257
|
var _rest$columns;
|
|
258
|
+
|
|
206
259
|
parseColumns();
|
|
207
260
|
setState({
|
|
208
261
|
columnSettingOptions: (_rest$columns = rest.columns) === null || _rest$columns === void 0 ? void 0 : _rest$columns.map(function (col) {
|
|
@@ -212,12 +265,15 @@ function VtxDatagrid(props) {
|
|
|
212
265
|
})
|
|
213
266
|
});
|
|
214
267
|
}, [rest.columns]);
|
|
268
|
+
|
|
215
269
|
var parseColumns = function parseColumns(type) {
|
|
216
270
|
// 显示工具栏的同时并显示列设置
|
|
217
271
|
if (toolbar && !hideColumnSetting) {
|
|
218
272
|
var _settingRef$current;
|
|
273
|
+
|
|
219
274
|
if (defaultVisibleColumnKeys || visibleColumnKeys || (_settingRef$current = settingRef.current) !== null && _settingRef$current !== void 0 && _settingRef$current.showColumns) {
|
|
220
275
|
var _settingRef$current2, _rest$columns2;
|
|
276
|
+
|
|
221
277
|
var columnKeys = type === 'reset' ? defaultVisibleColumnKeys : ((_settingRef$current2 = settingRef.current) === null || _settingRef$current2 === void 0 ? void 0 : _settingRef$current2.showColumns) || visibleColumnKeys || defaultVisibleColumnKeys;
|
|
222
278
|
setState({
|
|
223
279
|
checkedColumnKeys: columnKeys,
|
|
@@ -227,6 +283,7 @@ function VtxDatagrid(props) {
|
|
|
227
283
|
});
|
|
228
284
|
} else {
|
|
229
285
|
var _rest$columns3;
|
|
286
|
+
|
|
230
287
|
setState({
|
|
231
288
|
checkedColumnKeys: (_rest$columns3 = rest.columns) === null || _rest$columns3 === void 0 ? void 0 : _rest$columns3.map(function (item) {
|
|
232
289
|
return item.dataIndex || item.key;
|
|
@@ -240,13 +297,14 @@ function VtxDatagrid(props) {
|
|
|
240
297
|
});
|
|
241
298
|
}
|
|
242
299
|
};
|
|
300
|
+
|
|
243
301
|
var hasAlert = (((_rest$rowSelection2 = rest.rowSelection) === null || _rest$rowSelection2 === void 0 ? void 0 : _rest$rowSelection2.selectedRowKeys) || []).length > 0;
|
|
244
302
|
alertHeight.current = hasAlert ? 49 : 0;
|
|
245
|
-
toolbarHeight.current = toolbar ? 56 : 0;
|
|
303
|
+
toolbarHeight.current = toolbar ? 56 : 0; // 列设置回调
|
|
246
304
|
|
|
247
|
-
// 列设置回调
|
|
248
305
|
var handleChangeColumns = function handleChangeColumns(keys) {
|
|
249
306
|
var _rest$columns4;
|
|
307
|
+
|
|
250
308
|
var columnKeys = keys || ((_rest$columns4 = rest.columns) === null || _rest$columns4 === void 0 ? void 0 : _rest$columns4.map(function (item) {
|
|
251
309
|
return item.dataIndex || item.key;
|
|
252
310
|
}));
|
|
@@ -257,10 +315,11 @@ function VtxDatagrid(props) {
|
|
|
257
315
|
})
|
|
258
316
|
});
|
|
259
317
|
onVisibleColumnsChange && onVisibleColumnsChange(columnKeys);
|
|
260
|
-
};
|
|
318
|
+
}; // 工具栏
|
|
319
|
+
|
|
261
320
|
|
|
262
|
-
// 工具栏
|
|
263
321
|
var toolbarRender;
|
|
322
|
+
|
|
264
323
|
if (toolbar) {
|
|
265
324
|
toolbarRender = /*#__PURE__*/_react["default"].createElement("div", {
|
|
266
325
|
className: (0, _classnames2["default"])("".concat(prefixCls, "-toolbar"), toolbarClassName)
|
|
@@ -315,19 +374,21 @@ function VtxDatagrid(props) {
|
|
|
315
374
|
disabledColumnKeys: disabledColumnKeys,
|
|
316
375
|
onColumnsSave: onColumnsSave,
|
|
317
376
|
uniqueKey: uniqueKey || state.projectKey,
|
|
377
|
+
prefixUrl: prefixUrl,
|
|
318
378
|
columns: rest.columns,
|
|
319
379
|
settingRef: settingRef,
|
|
320
380
|
TextEnum: TextEnum
|
|
321
381
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
322
382
|
title: TextEnum.columnSettingText
|
|
323
383
|
}, /*#__PURE__*/_react["default"].createElement(_SettingOutlined["default"], null)))))));
|
|
324
|
-
}
|
|
384
|
+
} // 分页
|
|
385
|
+
|
|
325
386
|
|
|
326
|
-
// 分页
|
|
327
387
|
var getPagination = function getPagination(pagination) {
|
|
328
388
|
if (typeof pagination === 'boolean' && !pagination) {
|
|
329
389
|
return pagination;
|
|
330
390
|
}
|
|
391
|
+
|
|
331
392
|
return _objectSpread({
|
|
332
393
|
pageSizeOptions: ['10', '20', '30', '40', '50'],
|
|
333
394
|
showSizeChanger: true,
|
|
@@ -336,17 +397,20 @@ function VtxDatagrid(props) {
|
|
|
336
397
|
return "\u5171 ".concat(total, " \u6761");
|
|
337
398
|
}
|
|
338
399
|
}, pagination);
|
|
339
|
-
};
|
|
400
|
+
}; // 处理操作按钮
|
|
401
|
+
|
|
340
402
|
|
|
341
|
-
// 处理操作按钮
|
|
342
403
|
var columns = (visibleColumns || []).map(function (column) {
|
|
343
404
|
var newColumn = _objectSpread({}, column);
|
|
405
|
+
|
|
344
406
|
if (newColumn.renderButtons) {
|
|
345
407
|
delete newColumn.renderButtons;
|
|
346
408
|
}
|
|
409
|
+
|
|
347
410
|
if (newColumn.renderButtonsVisibleNum) {
|
|
348
411
|
delete newColumn.renderButtonsVisibleNum;
|
|
349
412
|
}
|
|
413
|
+
|
|
350
414
|
return _objectSpread(_objectSpread({}, newColumn), {}, {
|
|
351
415
|
render: (0, _isFunction["default"])(column.renderButtons) ? function (text, record, index) {
|
|
352
416
|
return (0, _renderColumnButtons["default"])(column.renderButtons, column.renderButtonsVisibleNum, text, record, index, TextEnum);
|
|
@@ -354,8 +418,8 @@ function VtxDatagrid(props) {
|
|
|
354
418
|
return ['', null, undefined].includes(text) ? '-' : text;
|
|
355
419
|
}
|
|
356
420
|
});
|
|
357
|
-
});
|
|
358
|
-
|
|
421
|
+
}); // 配置了列可伸缩
|
|
422
|
+
|
|
359
423
|
if (columnResizable) {
|
|
360
424
|
columns = columns.map(function (col, index) {
|
|
361
425
|
return _objectSpread(_objectSpread({}, col), {}, {
|
|
@@ -367,12 +431,15 @@ function VtxDatagrid(props) {
|
|
|
367
431
|
}
|
|
368
432
|
});
|
|
369
433
|
});
|
|
434
|
+
|
|
370
435
|
var handleResize = function handleResize(index) {
|
|
371
436
|
return function (e, _ref2) {
|
|
372
437
|
var size = _ref2.size;
|
|
373
438
|
setState(function (_ref3) {
|
|
374
439
|
var visibleColumns = _ref3.visibleColumns;
|
|
440
|
+
|
|
375
441
|
var nextColumns = _toConsumableArray(visibleColumns);
|
|
442
|
+
|
|
376
443
|
nextColumns[index] = _objectSpread(_objectSpread({}, nextColumns[index]), {}, {
|
|
377
444
|
width: size.width
|
|
378
445
|
});
|
|
@@ -382,12 +449,14 @@ function VtxDatagrid(props) {
|
|
|
382
449
|
});
|
|
383
450
|
};
|
|
384
451
|
};
|
|
385
|
-
}
|
|
452
|
+
} // 序号添加
|
|
453
|
+
|
|
386
454
|
|
|
387
|
-
// 序号添加
|
|
388
455
|
var dataSource = rest.dataSource;
|
|
456
|
+
|
|
389
457
|
if (indexColumn) {
|
|
390
458
|
var _dataSource;
|
|
459
|
+
|
|
391
460
|
columns = [{
|
|
392
461
|
title: indexTitle,
|
|
393
462
|
dataIndex: '_serialNum',
|
|
@@ -401,15 +470,18 @@ function VtxDatagrid(props) {
|
|
|
401
470
|
});
|
|
402
471
|
});
|
|
403
472
|
}
|
|
473
|
+
|
|
404
474
|
var scroll;
|
|
475
|
+
|
|
405
476
|
if (autoFit) {
|
|
406
477
|
scroll = _objectSpread(_objectSpread({}, rest.scroll || {}), {}, {
|
|
407
478
|
y: scrollY - (rest.scrollY || 0)
|
|
408
479
|
});
|
|
409
480
|
}
|
|
481
|
+
|
|
410
482
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
411
483
|
id: datagridId,
|
|
412
|
-
className: (0, _classnames2["default"])(prefixCls, className,
|
|
484
|
+
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)),
|
|
413
485
|
style: style,
|
|
414
486
|
ref: datagridRef
|
|
415
487
|
}, toolbarRender, hasAlert && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -442,6 +514,7 @@ function VtxDatagrid(props) {
|
|
|
442
514
|
}) : components
|
|
443
515
|
})));
|
|
444
516
|
}
|
|
517
|
+
|
|
445
518
|
VtxDatagrid.propTypes = {
|
|
446
519
|
prefixCls: _propTypes["default"].string,
|
|
447
520
|
refreshIconVisible: _propTypes["default"].bool,
|
|
@@ -472,6 +545,7 @@ VtxDatagrid.propTypes = {
|
|
|
472
545
|
onColumnsSave: _propTypes["default"].func,
|
|
473
546
|
components: _propTypes["default"].object,
|
|
474
547
|
customEnumText: _propTypes["default"].object,
|
|
475
|
-
uniqueKey: _propTypes["default"].string
|
|
548
|
+
uniqueKey: _propTypes["default"].string,
|
|
549
|
+
prefixUrl: _propTypes["default"].string
|
|
476
550
|
};
|
|
477
551
|
//# sourceMappingURL=index.js.map
|