@vtx/components 3.1.30 → 3.1.32
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/CHANGELOG.md +1325 -0
- package/lib/_util/filterSpecialCharacters.js +43 -54
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +3 -0
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getUrlParam.js +6 -0
- 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 +10 -1
- 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 +32 -14
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/index.js +26 -0
- package/lib/index.js.map +1 -1
- package/lib/vtx-color-picker/index.js +21 -5
- 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 +74 -34
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +45 -20
- 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 +11 -3
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +44 -19
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +13 -2
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +142 -77
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +35 -5
- 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.css +0 -3
- package/lib/vtx-datagrid/style/index.js +10 -0
- package/lib/vtx-datagrid/style/index.js.map +1 -1
- package/lib/vtx-datagrid/style/index.less +1 -1
- package/lib/vtx-date-picker/QdatePicker.js +46 -16
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +47 -6
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +5 -0
- 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-editor/index.js +23 -5
- 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-ellipsis-text/index.js +20 -6
- 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-export/index.js +58 -25
- 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-form-layout/Card.js +26 -5
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +8 -0
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +30 -8
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +7 -2
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +6 -0
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +2 -0
- package/lib/vtx-form-layout/context.js.map +1 -1
- package/lib/vtx-form-layout/index.js +22 -8
- 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-image/Image.js +98 -59
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +51 -20
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +40 -11
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +6 -0
- 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.css +19 -0
- package/lib/vtx-image/style/index.js +1 -0
- package/lib/vtx-image/style/index.js.map +1 -1
- package/lib/vtx-image/style/index.less +76 -63
- package/lib/vtx-import/index.js +72 -37
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +24 -7
- 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-import2/CheckResult.js +6 -0
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +25 -4
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +4 -0
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +11 -5
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +4 -0
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +92 -38
- 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-input/TextArea.js +22 -6
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +37 -11
- 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/useLength.js +16 -4
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +6 -1
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +70 -30
- 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 +6 -2
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +19 -7
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +10 -2
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +47 -17
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +15 -3
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +34 -4
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +8 -0
- package/lib/vtx-page-layout/index.js.map +1 -1
- package/lib/vtx-rps-frame/index.js +44 -21
- package/lib/vtx-rps-frame/index.js.map +1 -1
- package/lib/vtx-scrollable-row/index.js +57 -19
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-search/VtxCol.js +21 -0
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +12 -6
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +93 -40
- 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 +73 -42
- 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 +65 -20
- 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-signature/index.js +28 -14
- 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-split-pane/Pane.js +14 -2
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +29 -9
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +94 -39
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +4 -0
- 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-statistics-column/Back.js +7 -1
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +22 -5
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +22 -5
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +2 -0
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +16 -0
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-time-picker/index.js +16 -3
- package/lib/vtx-time-picker/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +28 -9
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +138 -67
- 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-wang-editor/index.js +66 -27
- 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/wangEditorUtil.js +88 -30
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +101 -49
- 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-select/index.js +99 -43
- 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/package.json +126 -126
|
@@ -1,30 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
10
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
11
16
|
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); }
|
|
17
|
+
|
|
12
18
|
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; }
|
|
19
|
+
|
|
13
20
|
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; }
|
|
21
|
+
|
|
14
22
|
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; }
|
|
23
|
+
|
|
15
24
|
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; }
|
|
25
|
+
|
|
16
26
|
var Pane = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
17
27
|
var children = props.children,
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
size = props.size,
|
|
29
|
+
dragging = props.dragging;
|
|
20
30
|
var style = {
|
|
21
31
|
width: size
|
|
22
32
|
};
|
|
33
|
+
|
|
23
34
|
if (!dragging) {
|
|
24
35
|
style = _objectSpread(_objectSpread({}, style), {}, {
|
|
25
36
|
transition: 'width 200ms cubic-bezier(0.1, 0, 0, 1) 0s'
|
|
26
37
|
});
|
|
27
38
|
}
|
|
39
|
+
|
|
28
40
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
29
41
|
className: 'vtx-split-pane-item',
|
|
30
42
|
style: style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pane.js","names":["Pane","forwardRef","props","ref","children","size","dragging","style","width","transition","propTypes","PropTypes","node","isRequired","oneOfType","string","number","bool","defaultProps"],"sources":["vtx-split-pane/Pane.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\n\nconst Pane = forwardRef((props, ref) => {\n const { children, size, dragging } = props;\n let style = { width: size };\n if (!dragging) {\n style = {\n ...style,\n transition: 'width 200ms cubic-bezier(0.1, 0, 0, 1) 0s',\n };\n }\n return (\n <div className={'vtx-split-pane-item'} style={style} ref={ref}>\n {children}\n </div>\n );\n});\n\nPane.propTypes = {\n children: PropTypes.node.isRequired,\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n dragging: PropTypes.bool,\n};\n\nPane.defaultProps = {};\n\nexport default Pane;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pane.js","names":["Pane","forwardRef","props","ref","children","size","dragging","style","width","transition","propTypes","PropTypes","node","isRequired","oneOfType","string","number","bool","defaultProps"],"sources":["vtx-split-pane/Pane.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\n\nconst Pane = forwardRef((props, ref) => {\n const { children, size, dragging } = props;\n let style = { width: size };\n if (!dragging) {\n style = {\n ...style,\n transition: 'width 200ms cubic-bezier(0.1, 0, 0, 1) 0s',\n };\n }\n return (\n <div className={'vtx-split-pane-item'} style={style} ref={ref}>\n {children}\n </div>\n );\n});\n\nPane.propTypes = {\n children: PropTypes.node.isRequired,\n size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n dragging: PropTypes.bool,\n};\n\nPane.defaultProps = {};\n\nexport default Pane;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,IAAI,gBAAG,IAAAC,iBAAA,EAAW,UAACC,KAAD,EAAQC,GAAR,EAAgB;EACpC,IAAQC,QAAR,GAAqCF,KAArC,CAAQE,QAAR;EAAA,IAAkBC,IAAlB,GAAqCH,KAArC,CAAkBG,IAAlB;EAAA,IAAwBC,QAAxB,GAAqCJ,KAArC,CAAwBI,QAAxB;EACA,IAAIC,KAAK,GAAG;IAAEC,KAAK,EAAEH;EAAT,CAAZ;;EACA,IAAI,CAACC,QAAL,EAAe;IACXC,KAAK,mCACEA,KADF;MAEDE,UAAU,EAAE;IAFX,EAAL;EAIH;;EACD,oBACI;IAAK,SAAS,EAAE,qBAAhB;IAAuC,KAAK,EAAEF,KAA9C;IAAqD,GAAG,EAAEJ;EAA1D,GACKC,QADL,CADJ;AAKH,CAdY,CAAb;AAgBAJ,IAAI,CAACU,SAAL,GAAiB;EACbN,QAAQ,EAAEO,qBAAA,CAAUC,IAAV,CAAeC,UADZ;EAEbR,IAAI,EAAEM,qBAAA,CAAUG,SAAV,CAAoB,CAACH,qBAAA,CAAUI,MAAX,EAAmBJ,qBAAA,CAAUK,MAA7B,CAApB,CAFO;EAGbV,QAAQ,EAAEK,qBAAA,CAAUM;AAHP,CAAjB;AAMAjB,IAAI,CAACkB,YAAL,GAAoB,EAApB;eAEelB,I"}
|
|
@@ -1,34 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
10
14
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
|
|
12
18
|
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); }
|
|
19
|
+
|
|
13
20
|
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; }
|
|
21
|
+
|
|
14
22
|
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); }
|
|
23
|
+
|
|
15
24
|
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; }
|
|
25
|
+
|
|
16
26
|
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; }
|
|
27
|
+
|
|
17
28
|
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; }
|
|
29
|
+
|
|
18
30
|
var Resizer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
19
31
|
var _classnames;
|
|
32
|
+
|
|
20
33
|
var className = props.className,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
_onClick = props.onClick,
|
|
35
|
+
_onDoubleClick = props.onDoubleClick,
|
|
36
|
+
_onMouseDown = props.onMouseDown,
|
|
37
|
+
_onTouchEnd = props.onTouchEnd,
|
|
38
|
+
_onTouchStart = props.onTouchStart,
|
|
39
|
+
style = props.style,
|
|
40
|
+
children = props.children,
|
|
41
|
+
primary = props.primary,
|
|
42
|
+
primaryShow = props.primaryShow;
|
|
30
43
|
var events = {};
|
|
44
|
+
|
|
31
45
|
var newStyle = _objectSpread({}, style);
|
|
46
|
+
|
|
32
47
|
if (primaryShow) {
|
|
33
48
|
newStyle = _objectSpread(_objectSpread({}, newStyle), {}, {
|
|
34
49
|
cursor: 'col-resize'
|
|
@@ -39,10 +54,12 @@ var Resizer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
39
54
|
},
|
|
40
55
|
onTouchStart: function onTouchStart(event) {
|
|
41
56
|
event.preventDefault();
|
|
57
|
+
|
|
42
58
|
_onTouchStart(event);
|
|
43
59
|
},
|
|
44
60
|
onTouchEnd: function onTouchEnd(event) {
|
|
45
61
|
event.preventDefault();
|
|
62
|
+
|
|
46
63
|
_onTouchEnd(event);
|
|
47
64
|
}
|
|
48
65
|
};
|
|
@@ -51,6 +68,7 @@ var Resizer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
51
68
|
cursor: 'pointer'
|
|
52
69
|
});
|
|
53
70
|
}
|
|
71
|
+
|
|
54
72
|
return /*#__PURE__*/_react["default"].createElement("span", _extends({
|
|
55
73
|
ref: ref,
|
|
56
74
|
role: "presentation",
|
|
@@ -59,12 +77,14 @@ var Resizer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
59
77
|
onClick: function onClick(event) {
|
|
60
78
|
if (_onClick) {
|
|
61
79
|
event.preventDefault();
|
|
80
|
+
|
|
62
81
|
_onClick(event);
|
|
63
82
|
}
|
|
64
83
|
},
|
|
65
84
|
onDoubleClick: function onDoubleClick(event) {
|
|
66
85
|
if (_onDoubleClick) {
|
|
67
86
|
event.preventDefault();
|
|
87
|
+
|
|
68
88
|
_onDoubleClick(event);
|
|
69
89
|
}
|
|
70
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resizer.js","names":["Resizer","forwardRef","props","ref","className","onClick","onDoubleClick","onMouseDown","onTouchEnd","onTouchStart","style","children","primary","primaryShow","events","newStyle","cursor","event","preventDefault","classnames","propTypes","PropTypes","string","isRequired","func","object","node","bool","defaultProps"],"sources":["vtx-split-pane/Resizer.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nconst Resizer = forwardRef((props, ref) => {\n const {\n className,\n onClick,\n onDoubleClick,\n onMouseDown,\n onTouchEnd,\n onTouchStart,\n style,\n children,\n primary,\n primaryShow,\n } = props;\n\n let events = {};\n let newStyle = { ...style };\n if (primaryShow) {\n newStyle = { ...newStyle, cursor: 'col-resize' };\n events = {\n onMouseDown: event => onMouseDown(event),\n onTouchStart: event => {\n event.preventDefault();\n onTouchStart(event);\n },\n onTouchEnd: event => {\n event.preventDefault();\n onTouchEnd(event);\n },\n };\n } else {\n newStyle = { ...newStyle, cursor: 'pointer' };\n }\n\n return (\n <span\n ref={ref}\n role=\"presentation\"\n className={classnames(\n 'vtx-split-pane-resizer',\n {\n ['vtx-split-pane-resizer-left']: primary === 'first',\n ['vtx-split-pane-resizer-right']: primary === 'second',\n },\n className,\n )}\n style={newStyle}\n onClick={event => {\n if (onClick) {\n event.preventDefault();\n onClick(event);\n }\n }}\n onDoubleClick={event => {\n if (onDoubleClick) {\n event.preventDefault();\n onDoubleClick(event);\n }\n }}\n {...events}\n >\n {children}\n </span>\n );\n});\n\nResizer.propTypes = {\n className: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n onDoubleClick: PropTypes.func,\n onMouseDown: PropTypes.func.isRequired,\n onTouchStart: PropTypes.func.isRequired,\n onTouchEnd: PropTypes.func.isRequired,\n style: PropTypes.object,\n children: PropTypes.node,\n primary: PropTypes.string,\n primaryShow: PropTypes.bool,\n};\n\nResizer.defaultProps = {};\n\nexport default Resizer;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Resizer.js","names":["Resizer","forwardRef","props","ref","className","onClick","onDoubleClick","onMouseDown","onTouchEnd","onTouchStart","style","children","primary","primaryShow","events","newStyle","cursor","event","preventDefault","classnames","propTypes","PropTypes","string","isRequired","func","object","node","bool","defaultProps"],"sources":["vtx-split-pane/Resizer.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nconst Resizer = forwardRef((props, ref) => {\n const {\n className,\n onClick,\n onDoubleClick,\n onMouseDown,\n onTouchEnd,\n onTouchStart,\n style,\n children,\n primary,\n primaryShow,\n } = props;\n\n let events = {};\n let newStyle = { ...style };\n if (primaryShow) {\n newStyle = { ...newStyle, cursor: 'col-resize' };\n events = {\n onMouseDown: event => onMouseDown(event),\n onTouchStart: event => {\n event.preventDefault();\n onTouchStart(event);\n },\n onTouchEnd: event => {\n event.preventDefault();\n onTouchEnd(event);\n },\n };\n } else {\n newStyle = { ...newStyle, cursor: 'pointer' };\n }\n\n return (\n <span\n ref={ref}\n role=\"presentation\"\n className={classnames(\n 'vtx-split-pane-resizer',\n {\n ['vtx-split-pane-resizer-left']: primary === 'first',\n ['vtx-split-pane-resizer-right']: primary === 'second',\n },\n className,\n )}\n style={newStyle}\n onClick={event => {\n if (onClick) {\n event.preventDefault();\n onClick(event);\n }\n }}\n onDoubleClick={event => {\n if (onDoubleClick) {\n event.preventDefault();\n onDoubleClick(event);\n }\n }}\n {...events}\n >\n {children}\n </span>\n );\n});\n\nResizer.propTypes = {\n className: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n onDoubleClick: PropTypes.func,\n onMouseDown: PropTypes.func.isRequired,\n onTouchStart: PropTypes.func.isRequired,\n onTouchEnd: PropTypes.func.isRequired,\n style: PropTypes.object,\n children: PropTypes.node,\n primary: PropTypes.string,\n primaryShow: PropTypes.bool,\n};\n\nResizer.defaultProps = {};\n\nexport default Resizer;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;AAEA,IAAMA,OAAO,gBAAG,IAAAC,iBAAA,EAAW,UAACC,KAAD,EAAQC,GAAR,EAAgB;EAAA;;EACvC,IACIC,SADJ,GAWIF,KAXJ,CACIE,SADJ;EAAA,IAEIC,QAFJ,GAWIH,KAXJ,CAEIG,OAFJ;EAAA,IAGIC,cAHJ,GAWIJ,KAXJ,CAGII,aAHJ;EAAA,IAIIC,YAJJ,GAWIL,KAXJ,CAIIK,WAJJ;EAAA,IAKIC,WALJ,GAWIN,KAXJ,CAKIM,UALJ;EAAA,IAMIC,aANJ,GAWIP,KAXJ,CAMIO,YANJ;EAAA,IAOIC,KAPJ,GAWIR,KAXJ,CAOIQ,KAPJ;EAAA,IAQIC,QARJ,GAWIT,KAXJ,CAQIS,QARJ;EAAA,IASIC,OATJ,GAWIV,KAXJ,CASIU,OATJ;EAAA,IAUIC,WAVJ,GAWIX,KAXJ,CAUIW,WAVJ;EAaA,IAAIC,MAAM,GAAG,EAAb;;EACA,IAAIC,QAAQ,qBAAQL,KAAR,CAAZ;;EACA,IAAIG,WAAJ,EAAiB;IACbE,QAAQ,mCAAQA,QAAR;MAAkBC,MAAM,EAAE;IAA1B,EAAR;IACAF,MAAM,GAAG;MACLP,WAAW,EAAE,qBAAAU,KAAK;QAAA,OAAIV,YAAW,CAACU,KAAD,CAAf;MAAA,CADb;MAELR,YAAY,EAAE,sBAAAQ,KAAK,EAAI;QACnBA,KAAK,CAACC,cAAN;;QACAT,aAAY,CAACQ,KAAD,CAAZ;MACH,CALI;MAMLT,UAAU,EAAE,oBAAAS,KAAK,EAAI;QACjBA,KAAK,CAACC,cAAN;;QACAV,WAAU,CAACS,KAAD,CAAV;MACH;IATI,CAAT;EAWH,CAbD,MAaO;IACHF,QAAQ,mCAAQA,QAAR;MAAkBC,MAAM,EAAE;IAA1B,EAAR;EACH;;EAED,oBACI;IACI,GAAG,EAAEb,GADT;IAEI,IAAI,EAAC,cAFT;IAGI,SAAS,EAAE,IAAAgB,uBAAA,EACP,wBADO,kDAGF,6BAHE,EAG8BP,OAAO,KAAK,OAH1C,gCAIF,8BAJE,EAI+BA,OAAO,KAAK,QAJ3C,iBAMPR,SANO,CAHf;IAWI,KAAK,EAAEW,QAXX;IAYI,OAAO,EAAE,iBAAAE,KAAK,EAAI;MACd,IAAIZ,QAAJ,EAAa;QACTY,KAAK,CAACC,cAAN;;QACAb,QAAO,CAACY,KAAD,CAAP;MACH;IACJ,CAjBL;IAkBI,aAAa,EAAE,uBAAAA,KAAK,EAAI;MACpB,IAAIX,cAAJ,EAAmB;QACfW,KAAK,CAACC,cAAN;;QACAZ,cAAa,CAACW,KAAD,CAAb;MACH;IACJ;EAvBL,GAwBQH,MAxBR,GA0BKH,QA1BL,CADJ;AA8BH,CA/De,CAAhB;AAiEAX,OAAO,CAACoB,SAAR,GAAoB;EAChBhB,SAAS,EAAEiB,qBAAA,CAAUC,MAAV,CAAiBC,UADZ;EAEhBlB,OAAO,EAAEgB,qBAAA,CAAUG,IAFH;EAGhBlB,aAAa,EAAEe,qBAAA,CAAUG,IAHT;EAIhBjB,WAAW,EAAEc,qBAAA,CAAUG,IAAV,CAAeD,UAJZ;EAKhBd,YAAY,EAAEY,qBAAA,CAAUG,IAAV,CAAeD,UALb;EAMhBf,UAAU,EAAEa,qBAAA,CAAUG,IAAV,CAAeD,UANX;EAOhBb,KAAK,EAAEW,qBAAA,CAAUI,MAPD;EAQhBd,QAAQ,EAAEU,qBAAA,CAAUK,IARJ;EAShBd,OAAO,EAAES,qBAAA,CAAUC,MATH;EAUhBT,WAAW,EAAEQ,qBAAA,CAAUM;AAVP,CAApB;AAaA3B,OAAO,CAAC4B,YAAR,GAAuB,EAAvB;eAEe5B,O"}
|
|
@@ -1,61 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
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"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
9
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
10
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
11
16
|
var _button = _interopRequireDefault(require("antd/lib/button"));
|
|
17
|
+
|
|
12
18
|
var _tooltip = _interopRequireDefault(require("antd/lib/tooltip"));
|
|
19
|
+
|
|
13
20
|
var _LeftOutlined = _interopRequireDefault(require("@ant-design/icons/LeftOutlined"));
|
|
21
|
+
|
|
14
22
|
var _RightOutlined = _interopRequireDefault(require("@ant-design/icons/RightOutlined"));
|
|
23
|
+
|
|
15
24
|
var _SwapOutlined = _interopRequireDefault(require("@ant-design/icons/SwapOutlined"));
|
|
25
|
+
|
|
16
26
|
var _Pane = _interopRequireDefault(require("./Pane"));
|
|
27
|
+
|
|
17
28
|
var _Resizer = _interopRequireDefault(require("./Resizer"));
|
|
29
|
+
|
|
18
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
|
+
|
|
19
32
|
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); }
|
|
33
|
+
|
|
20
34
|
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; }
|
|
35
|
+
|
|
21
36
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
+
|
|
22
38
|
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."); }
|
|
39
|
+
|
|
23
40
|
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); }
|
|
41
|
+
|
|
24
42
|
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; }
|
|
43
|
+
|
|
25
44
|
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; }
|
|
45
|
+
|
|
26
46
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
+
|
|
27
48
|
function unFocus(document, window) {
|
|
28
49
|
if (document.selection) {
|
|
29
50
|
document.selection.empty();
|
|
30
51
|
} else {
|
|
31
52
|
try {
|
|
32
|
-
window.getSelection().removeAllRanges();
|
|
33
|
-
// eslint-disable-next-line no-empty
|
|
53
|
+
window.getSelection().removeAllRanges(); // eslint-disable-next-line no-empty
|
|
34
54
|
} catch (e) {}
|
|
35
55
|
}
|
|
36
56
|
}
|
|
57
|
+
|
|
37
58
|
function getDefaultSize(defaultSize, minSize, maxSize, draggedSize) {
|
|
38
59
|
if (typeof draggedSize === 'number') {
|
|
39
60
|
var min = typeof minSize === 'number' ? minSize : 0;
|
|
40
61
|
var max = typeof maxSize === 'number' && maxSize >= 0 ? maxSize : Infinity;
|
|
41
62
|
return Math.max(min, Math.min(max, draggedSize));
|
|
42
63
|
}
|
|
64
|
+
|
|
43
65
|
if (defaultSize !== undefined) {
|
|
44
66
|
return defaultSize;
|
|
45
67
|
}
|
|
68
|
+
|
|
46
69
|
return minSize;
|
|
47
70
|
}
|
|
71
|
+
|
|
48
72
|
function removeNullChildren(children) {
|
|
49
73
|
return _react["default"].Children.toArray(children).filter(function (c) {
|
|
50
74
|
return c;
|
|
51
75
|
});
|
|
52
76
|
}
|
|
77
|
+
|
|
53
78
|
function VtxSplitPane(props) {
|
|
54
79
|
var size = props.size,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
initPrimary = props.primary,
|
|
81
|
+
defaultSize = props.defaultSize,
|
|
82
|
+
minSize = props.minSize,
|
|
83
|
+
maxSize = props.maxSize;
|
|
59
84
|
var active = (0, _react.useRef)(false);
|
|
60
85
|
var position = (0, _react.useRef)();
|
|
61
86
|
var draggedSize = (0, _react.useRef)();
|
|
@@ -64,21 +89,25 @@ function VtxSplitPane(props) {
|
|
|
64
89
|
var pane1 = (0, _react.useRef)();
|
|
65
90
|
var pane2 = (0, _react.useRef)();
|
|
66
91
|
var resizerRef = (0, _react.useRef)();
|
|
92
|
+
|
|
67
93
|
var _useState = (0, _react.useState)({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
94
|
+
pane1: 0,
|
|
95
|
+
pane2: 0
|
|
96
|
+
}),
|
|
97
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
98
|
+
paneSize = _useState2[0],
|
|
99
|
+
setPaneSize = _useState2[1];
|
|
100
|
+
|
|
74
101
|
var _useState3 = (0, _react.useState)(true),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
102
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
103
|
+
primaryShow = _useState4[0],
|
|
104
|
+
setPrimaryShow = _useState4[1];
|
|
105
|
+
|
|
78
106
|
var _useState5 = (0, _react.useState)(initPrimary),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
107
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
108
|
+
primary = _useState6[0],
|
|
109
|
+
setPrimary = _useState6[1];
|
|
110
|
+
|
|
82
111
|
(0, _react.useEffect)(function () {
|
|
83
112
|
document.addEventListener('mouseup', onMouseUp);
|
|
84
113
|
document.addEventListener('mousemove', onMouseMove);
|
|
@@ -87,6 +116,7 @@ function VtxSplitPane(props) {
|
|
|
87
116
|
var initialSize = size !== undefined ? size : getDefaultSize(defaultSize, minSize, maxSize, null);
|
|
88
117
|
var splitPaneWidth = splitPane.current.clientWidth;
|
|
89
118
|
var resizerWidth = resizerRef.current.offsetWidth + 1; // +1避免因为小数问题
|
|
119
|
+
|
|
90
120
|
setPaneSize({
|
|
91
121
|
pane1: primary === 'first' ? initialSize : splitPaneWidth - initialSize - resizerWidth,
|
|
92
122
|
pane2: primary === 'second' ? initialSize : splitPaneWidth - initialSize - resizerWidth
|
|
@@ -99,10 +129,10 @@ function VtxSplitPane(props) {
|
|
|
99
129
|
window.onresize = '';
|
|
100
130
|
};
|
|
101
131
|
}, [primary]);
|
|
102
|
-
|
|
103
132
|
/**
|
|
104
133
|
* 监听窗口变化,自适应大小
|
|
105
134
|
*/
|
|
135
|
+
|
|
106
136
|
window.onresize = function () {
|
|
107
137
|
var splitPaneWidth = splitPane.current.clientWidth;
|
|
108
138
|
var resizerWidth = resizerRef.current.offsetWidth + 1;
|
|
@@ -111,6 +141,7 @@ function VtxSplitPane(props) {
|
|
|
111
141
|
pane2: primary === 'first' ? splitPaneWidth - resizerWidth - paneSize.pane1 : paneSize.pane2
|
|
112
142
|
});
|
|
113
143
|
};
|
|
144
|
+
|
|
114
145
|
function onMouseDown(event) {
|
|
115
146
|
var eventWithTouches = Object.assign({}, event, {
|
|
116
147
|
touches: [{
|
|
@@ -120,19 +151,24 @@ function VtxSplitPane(props) {
|
|
|
120
151
|
});
|
|
121
152
|
onTouchStart(eventWithTouches);
|
|
122
153
|
}
|
|
154
|
+
|
|
123
155
|
function onTouchStart(event) {
|
|
124
156
|
var allowResize = props.allowResize,
|
|
125
|
-
|
|
157
|
+
onDragStarted = props.onDragStarted;
|
|
158
|
+
|
|
126
159
|
if (allowResize) {
|
|
127
160
|
unFocus(document, window);
|
|
128
161
|
var initPosition = event.touches[0].clientX;
|
|
162
|
+
|
|
129
163
|
if (typeof onDragStarted === 'function') {
|
|
130
164
|
onDragStarted();
|
|
131
165
|
}
|
|
166
|
+
|
|
132
167
|
active.current = true;
|
|
133
168
|
position.current = initPosition;
|
|
134
169
|
}
|
|
135
170
|
}
|
|
171
|
+
|
|
136
172
|
function onMouseMove(event) {
|
|
137
173
|
var eventWithTouches = Object.assign({}, event, {
|
|
138
174
|
touches: [{
|
|
@@ -142,45 +178,57 @@ function VtxSplitPane(props) {
|
|
|
142
178
|
});
|
|
143
179
|
onTouchMove(eventWithTouches);
|
|
144
180
|
}
|
|
181
|
+
|
|
145
182
|
function onTouchMove(event) {
|
|
146
183
|
var allowResize = props.allowResize,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
184
|
+
maxSize = props.maxSize,
|
|
185
|
+
minSize = props.minSize,
|
|
186
|
+
onChange = props.onChange,
|
|
187
|
+
step = props.step;
|
|
188
|
+
|
|
151
189
|
if (allowResize && active.current) {
|
|
152
190
|
unFocus(document, window);
|
|
153
191
|
var isPrimaryFirst = primary === 'first';
|
|
154
192
|
var ref = isPrimaryFirst ? pane1.current : pane2.current;
|
|
155
193
|
var ref2 = isPrimaryFirst ? pane2.current : pane1.current;
|
|
194
|
+
|
|
156
195
|
if (ref) {
|
|
157
196
|
var node = ref;
|
|
158
197
|
var node2 = ref2;
|
|
198
|
+
|
|
159
199
|
if (node.getBoundingClientRect) {
|
|
160
200
|
var width = node.getBoundingClientRect().width;
|
|
161
201
|
var current = event.touches[0].clientX;
|
|
162
202
|
var _size = width;
|
|
163
203
|
var positionDelta = position.current - current;
|
|
204
|
+
|
|
164
205
|
if (step) {
|
|
165
206
|
if (Math.abs(positionDelta) < step) {
|
|
166
207
|
return;
|
|
167
|
-
}
|
|
168
|
-
// Integer division
|
|
208
|
+
} // Integer division
|
|
169
209
|
// eslint-disable-next-line no-bitwise
|
|
210
|
+
|
|
211
|
+
|
|
170
212
|
positionDelta = ~~(positionDelta / step) * step;
|
|
171
213
|
}
|
|
214
|
+
|
|
172
215
|
var sizeDelta = isPrimaryFirst ? positionDelta : -positionDelta;
|
|
173
216
|
var pane1Order = parseInt(window.getComputedStyle(node).order);
|
|
174
217
|
var pane2Order = parseInt(window.getComputedStyle(node2).order);
|
|
218
|
+
|
|
175
219
|
if (pane1Order > pane2Order) {
|
|
176
220
|
sizeDelta = -sizeDelta;
|
|
177
221
|
}
|
|
222
|
+
|
|
178
223
|
var newMaxSize = maxSize;
|
|
224
|
+
|
|
179
225
|
if (maxSize !== undefined && maxSize <= 0) {
|
|
180
226
|
newMaxSize = splitPane.getBoundingClientRect().width + maxSize;
|
|
181
227
|
}
|
|
228
|
+
|
|
182
229
|
var newSize = _size - sizeDelta;
|
|
183
230
|
var newPosition = position.current - positionDelta;
|
|
231
|
+
|
|
184
232
|
if (newSize < minSize) {
|
|
185
233
|
newSize = minSize;
|
|
186
234
|
} else if (maxSize !== undefined && newSize > newMaxSize) {
|
|
@@ -189,6 +237,7 @@ function VtxSplitPane(props) {
|
|
|
189
237
|
position.current = newPosition;
|
|
190
238
|
resized.current = true;
|
|
191
239
|
}
|
|
240
|
+
|
|
192
241
|
if (onChange) onChange(newSize);
|
|
193
242
|
draggedSize.current = newSize;
|
|
194
243
|
var splitPaneWidth = splitPane.current.clientWidth;
|
|
@@ -201,35 +250,38 @@ function VtxSplitPane(props) {
|
|
|
201
250
|
}
|
|
202
251
|
}
|
|
203
252
|
}
|
|
253
|
+
|
|
204
254
|
function onMouseUp() {
|
|
205
255
|
var allowResize = props.allowResize,
|
|
206
|
-
|
|
256
|
+
onDragFinished = props.onDragFinished;
|
|
257
|
+
|
|
207
258
|
if (allowResize && active.current) {
|
|
208
259
|
if (typeof onDragFinished === 'function') {
|
|
209
260
|
onDragFinished(draggedSize.current);
|
|
210
261
|
}
|
|
262
|
+
|
|
211
263
|
active.current = false;
|
|
212
264
|
}
|
|
213
265
|
}
|
|
266
|
+
|
|
214
267
|
var allowResize = props.allowResize,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
268
|
+
children = props.children,
|
|
269
|
+
className = props.className,
|
|
270
|
+
onResizerClick = props.onResizerClick,
|
|
271
|
+
onResizerDoubleClick = props.onResizerDoubleClick,
|
|
272
|
+
resizerClassName = props.resizerClassName,
|
|
273
|
+
resizerStyle = props.resizerStyle,
|
|
274
|
+
style = props.style,
|
|
275
|
+
showSwitch = props.showSwitch,
|
|
276
|
+
showToggle = props.showToggle;
|
|
224
277
|
var notNullChildren = removeNullChildren(children);
|
|
225
|
-
|
|
226
278
|
/**
|
|
227
279
|
* 收缩面板宽度变化,并能还原到原先的位置
|
|
228
280
|
*/
|
|
281
|
+
|
|
229
282
|
var pane1Size = primary === 'first' ? primaryShow ? paneSize.pane1 : 0 : primaryShow ? paneSize.pane1 : paneSize.pane1 + paneSize.pane2;
|
|
230
|
-
var pane2Size = primary === 'first' ? primaryShow ? paneSize.pane2 : paneSize.pane1 + paneSize.pane2 : primaryShow ? paneSize.pane2 : 0;
|
|
283
|
+
var pane2Size = primary === 'first' ? primaryShow ? paneSize.pane2 : paneSize.pane1 + paneSize.pane2 : primaryShow ? paneSize.pane2 : 0; // 是否在拖动
|
|
231
284
|
|
|
232
|
-
// 是否在拖动
|
|
233
285
|
var dragging = active.current;
|
|
234
286
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
235
287
|
className: (0, _classnames["default"])('vtx-split-pane', className),
|
|
@@ -246,6 +298,7 @@ function VtxSplitPane(props) {
|
|
|
246
298
|
if (!primaryShow) {
|
|
247
299
|
setPrimaryShow(true);
|
|
248
300
|
}
|
|
301
|
+
|
|
249
302
|
onResizerClick && onResizerClick(e);
|
|
250
303
|
},
|
|
251
304
|
className: (0, _classnames["default"])({
|
|
@@ -290,6 +343,7 @@ function VtxSplitPane(props) {
|
|
|
290
343
|
if (prev === 'first') {
|
|
291
344
|
return 'second';
|
|
292
345
|
}
|
|
346
|
+
|
|
293
347
|
if (prev === 'second') {
|
|
294
348
|
return 'first';
|
|
295
349
|
}
|
|
@@ -302,6 +356,7 @@ function VtxSplitPane(props) {
|
|
|
302
356
|
dragging: dragging
|
|
303
357
|
}, primary === 'first' ? notNullChildren[1] : notNullChildren[0]));
|
|
304
358
|
}
|
|
359
|
+
|
|
305
360
|
VtxSplitPane.propTypes = {
|
|
306
361
|
allowResize: _propTypes["default"].bool,
|
|
307
362
|
children: _propTypes["default"].arrayOf(_propTypes["default"].node).isRequired,
|