@vtx/components 3.1.24 → 3.1.26
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 +54 -43
- package/lib/_util/filterSpecialCharacters.js.map +1 -1
- package/lib/_util/getComponentProps.js +0 -3
- package/lib/_util/getComponentProps.js.map +1 -1
- package/lib/_util/getUrlParam.js +0 -6
- 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 +1 -10
- 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 +14 -32
- package/lib/_util/useSet.js.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/index.js +0 -26
- package/lib/index.js.map +1 -1
- package/lib/vtx-color-picker/index.js +5 -21
- 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 +34 -74
- package/lib/vtx-combogrid/Combogrid.js.map +1 -1
- package/lib/vtx-combogrid/index.js +20 -45
- 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 +3 -11
- package/lib/vtx-datagrid/Alert.js.map +1 -1
- package/lib/vtx-datagrid/ColumnSetting.js +19 -44
- package/lib/vtx-datagrid/ColumnSetting.js.map +1 -1
- package/lib/vtx-datagrid/ResizeableTitle.js +2 -13
- package/lib/vtx-datagrid/ResizeableTitle.js.map +1 -1
- package/lib/vtx-datagrid/index.js +77 -142
- package/lib/vtx-datagrid/index.js.map +1 -1
- package/lib/vtx-datagrid/renderColumnButtons.js +5 -35
- 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 +16 -46
- package/lib/vtx-date-picker/QdatePicker.js.map +1 -1
- package/lib/vtx-date-picker/generatePicker.js +6 -47
- package/lib/vtx-date-picker/generatePicker.js.map +1 -1
- package/lib/vtx-date-picker/index.js +0 -5
- 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-editor/index.js +5 -23
- 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-ellipsis-text/index.js +6 -20
- 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-export/index.js +25 -58
- 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-form-layout/Card.js +5 -26
- package/lib/vtx-form-layout/Card.js.map +1 -1
- package/lib/vtx-form-layout/Divider.js +0 -8
- package/lib/vtx-form-layout/Divider.js.map +1 -1
- package/lib/vtx-form-layout/FormItem.js +8 -30
- package/lib/vtx-form-layout/FormItem.js.map +1 -1
- package/lib/vtx-form-layout/Pane.js +2 -7
- package/lib/vtx-form-layout/Pane.js.map +1 -1
- package/lib/vtx-form-layout/Row.js +0 -6
- package/lib/vtx-form-layout/Row.js.map +1 -1
- package/lib/vtx-form-layout/context.js +0 -2
- package/lib/vtx-form-layout/context.js.map +1 -1
- package/lib/vtx-form-layout/index.js +8 -22
- 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-image/Image.js +56 -92
- package/lib/vtx-image/Image.js.map +1 -1
- package/lib/vtx-image/Preview.js +20 -51
- package/lib/vtx-image/Preview.js.map +1 -1
- package/lib/vtx-image/PreviewGroup.js +11 -40
- package/lib/vtx-image/PreviewGroup.js.map +1 -1
- package/lib/vtx-image/index.js +0 -6
- 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 +37 -72
- package/lib/vtx-import/index.js.map +1 -1
- package/lib/vtx-import/result.js +7 -24
- 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-import2/CheckResult.js +0 -6
- package/lib/vtx-import2/CheckResult.js.map +1 -1
- package/lib/vtx-import2/Content.js +4 -25
- package/lib/vtx-import2/Content.js.map +1 -1
- package/lib/vtx-import2/DownloadSvg.js +0 -4
- package/lib/vtx-import2/DownloadSvg.js.map +1 -1
- package/lib/vtx-import2/ImportResult.js +5 -11
- package/lib/vtx-import2/ImportResult.js.map +1 -1
- package/lib/vtx-import2/UploadSvg.js +0 -4
- package/lib/vtx-import2/UploadSvg.js.map +1 -1
- package/lib/vtx-import2/index.js +38 -92
- 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-input/TextArea.js +6 -22
- package/lib/vtx-input/TextArea.js.map +1 -1
- package/lib/vtx-input/index.js +11 -37
- 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/useLength.js +4 -16
- package/lib/vtx-input/useLength.js.map +1 -1
- package/lib/vtx-modal/Title.js +1 -6
- package/lib/vtx-modal/Title.js.map +1 -1
- package/lib/vtx-modal/index.js +30 -70
- 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 +2 -6
- package/lib/vtx-page-layout/Basic.js.map +1 -1
- package/lib/vtx-page-layout/Content.js +7 -19
- package/lib/vtx-page-layout/Content.js.map +1 -1
- package/lib/vtx-page-layout/Pane.js +2 -10
- package/lib/vtx-page-layout/Pane.js.map +1 -1
- package/lib/vtx-page-layout/TableLayout.js +17 -47
- package/lib/vtx-page-layout/TableLayout.js.map +1 -1
- package/lib/vtx-page-layout/TableWrap.js +3 -15
- package/lib/vtx-page-layout/TableWrap.js.map +1 -1
- package/lib/vtx-page-layout/container.js +4 -34
- package/lib/vtx-page-layout/container.js.map +1 -1
- package/lib/vtx-page-layout/index.js +0 -8
- package/lib/vtx-page-layout/index.js.map +1 -1
- package/lib/vtx-rps-frame/index.js +27 -45
- package/lib/vtx-rps-frame/index.js.map +1 -1
- package/lib/vtx-scrollable-row/index.js +19 -57
- package/lib/vtx-scrollable-row/index.js.map +1 -1
- package/lib/vtx-search/VtxCol.js +0 -21
- package/lib/vtx-search/VtxCol.js.map +1 -1
- package/lib/vtx-search/VtxRow.js +6 -12
- package/lib/vtx-search/VtxRow.js.map +1 -1
- package/lib/vtx-search/index.js +40 -93
- 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 +42 -73
- 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 +20 -65
- 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-signature/index.js +14 -28
- 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-split-pane/Pane.js +2 -14
- package/lib/vtx-split-pane/Pane.js.map +1 -1
- package/lib/vtx-split-pane/Resizer.js +9 -29
- package/lib/vtx-split-pane/Resizer.js.map +1 -1
- package/lib/vtx-split-pane/SplitPane.js +39 -94
- package/lib/vtx-split-pane/SplitPane.js.map +1 -1
- package/lib/vtx-split-pane/index.js +0 -4
- 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-statistics-column/Back.js +1 -7
- package/lib/vtx-statistics-column/Back.js.map +1 -1
- package/lib/vtx-statistics-column/Item.js +5 -22
- package/lib/vtx-statistics-column/Item.js.map +1 -1
- package/lib/vtx-statistics-column/Total.js +5 -22
- package/lib/vtx-statistics-column/Total.js.map +1 -1
- package/lib/vtx-statistics-column/context.js +0 -2
- package/lib/vtx-statistics-column/context.js.map +1 -1
- package/lib/vtx-statistics-column/index.js +0 -16
- package/lib/vtx-statistics-column/index.js.map +1 -1
- package/lib/vtx-time-picker/index.js +3 -16
- package/lib/vtx-time-picker/index.js.map +1 -1
- package/lib/vtx-upload/FilePreview.js +9 -28
- package/lib/vtx-upload/FilePreview.js.map +1 -1
- package/lib/vtx-upload/index.js +67 -137
- package/lib/vtx-upload/index.js.map +1 -1
- package/lib/vtx-upload/style/css.js +0 -5
- package/lib/vtx-upload/style/css.js.map +1 -1
- package/lib/vtx-upload/style/index.js +0 -5
- package/lib/vtx-upload/style/index.js.map +1 -1
- package/lib/vtx-wang-editor/index.js +36 -66
- 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/wangEditorUtil.js +30 -88
- package/lib/vtx-wang-editor/wangEditorUtil.js.map +1 -1
- package/lib/vtx-ztree/index.js +49 -101
- 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-select/index.js +43 -99
- 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/package.json +126 -126
- package/CHANGELOG.md +0 -1248
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["vtx-import2/style/index.js"],"sourcesContent":["import 'antd/lib/modal/style';\nimport 'antd/lib/button/style';\nimport 'antd/lib/message/style';\nimport './index.less';\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["vtx-import2/style/index.js"],"sourcesContent":["import 'antd/lib/modal/style';\nimport 'antd/lib/button/style';\nimport 'antd/lib/message/style';\nimport './index.less';\n"],"mappings":";;AAAA;AACA;AACA;AACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["vtx-import2/style/index.js"],"sourcesContent":["import 'antd/lib/modal/style';\nimport 'antd/lib/button/style';\nimport 'antd/lib/message/style';\nimport './index.less';\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["vtx-import2/style/index.js"],"sourcesContent":["import 'antd/lib/modal/style';\nimport 'antd/lib/button/style';\nimport 'antd/lib/message/style';\nimport './index.less';\n"],"mappings":";;AAAA;AACA;AACA;AACA"}
|
|
@@ -1,54 +1,38 @@
|
|
|
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
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
15
|
-
|
|
16
11
|
var _useLength = _interopRequireDefault(require("./useLength"));
|
|
17
|
-
|
|
18
12
|
var _excluded = ["maxLength", "showCount", "placeholder"];
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
14
|
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); }
|
|
23
|
-
|
|
24
15
|
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; }
|
|
25
|
-
|
|
26
16
|
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); }
|
|
27
|
-
|
|
28
17
|
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; }
|
|
29
|
-
|
|
30
18
|
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; }
|
|
31
|
-
|
|
32
19
|
var TextArea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
33
20
|
var _props$maxLength = props.maxLength,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
maxLength = _props$maxLength === void 0 ? 200 : _props$maxLength,
|
|
22
|
+
_props$showCount = props.showCount,
|
|
23
|
+
showCount = _props$showCount === void 0 ? true : _props$showCount,
|
|
24
|
+
_props$placeholder = props.placeholder,
|
|
25
|
+
placeholder = _props$placeholder === void 0 ? '请输入' : _props$placeholder,
|
|
26
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
41
27
|
var len = (0, _useLength["default"])(props.value, {
|
|
42
28
|
showCount: showCount
|
|
43
29
|
});
|
|
44
|
-
|
|
45
30
|
var render = /*#__PURE__*/_react["default"].createElement(_input["default"].TextArea, _extends({
|
|
46
31
|
placeholder: placeholder,
|
|
47
32
|
maxLength: maxLength
|
|
48
33
|
}, rest, {
|
|
49
34
|
ref: ref
|
|
50
35
|
}));
|
|
51
|
-
|
|
52
36
|
showCount && 'value' in props && (render = /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
37
|
className: "vtx-input-textarea",
|
|
54
38
|
"data-count": "".concat(len, "/").concat(maxLength)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","names":["TextArea","forwardRef","props","ref","maxLength","showCount","placeholder","rest","len","useLength","value","render","propTypes","PropTypes","number","string","bool"],"sources":["vtx-input/TextArea.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Input from 'antd/lib/input';\nimport useLength from './useLength';\n\nconst TextArea = forwardRef((props, ref) => {\n const { maxLength = 200, showCount = true, placeholder = '请输入', ...rest } = props;\n const len = useLength(props.value, { showCount });\n\n let render = (\n <Input.TextArea placeholder={placeholder} maxLength={maxLength} {...rest} ref={ref} />\n );\n\n showCount &&\n 'value' in props &&\n (render = (\n <div className=\"vtx-input-textarea\" data-count={`${len}/${maxLength}`}>\n {render}\n </div>\n ));\n return render;\n});\n\nexport default TextArea;\n\nTextArea.propTypes = {\n maxLength: PropTypes.number,\n value: PropTypes.string,\n showCount: PropTypes.bool,\n placeholder: PropTypes.string,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextArea.js","names":["TextArea","forwardRef","props","ref","maxLength","showCount","placeholder","rest","len","useLength","value","render","propTypes","PropTypes","number","string","bool"],"sources":["vtx-input/TextArea.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Input from 'antd/lib/input';\nimport useLength from './useLength';\n\nconst TextArea = forwardRef((props, ref) => {\n const { maxLength = 200, showCount = true, placeholder = '请输入', ...rest } = props;\n const len = useLength(props.value, { showCount });\n\n let render = (\n <Input.TextArea placeholder={placeholder} maxLength={maxLength} {...rest} ref={ref} />\n );\n\n showCount &&\n 'value' in props &&\n (render = (\n <div className=\"vtx-input-textarea\" data-count={`${len}/${maxLength}`}>\n {render}\n </div>\n ));\n return render;\n});\n\nexport default TextArea;\n\nTextArea.propTypes = {\n maxLength: PropTypes.number,\n value: PropTypes.string,\n showCount: PropTypes.bool,\n placeholder: PropTypes.string,\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AAAoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEpC,IAAMA,QAAQ,gBAAG,IAAAC,iBAAU,EAAC,UAACC,KAAK,EAAEC,GAAG,EAAK;EACxC,uBAA4ED,KAAK,CAAzEE,SAAS;IAATA,SAAS,iCAAG,GAAG;IAAA,mBAAqDF,KAAK,CAAxDG,SAAS;IAATA,SAAS,iCAAG,IAAI;IAAA,qBAAmCH,KAAK,CAAtCI,WAAW;IAAXA,WAAW,mCAAG,KAAK;IAAKC,IAAI,4BAAKL,KAAK;EACjF,IAAMM,GAAG,GAAG,IAAAC,qBAAS,EAACP,KAAK,CAACQ,KAAK,EAAE;IAAEL,SAAS,EAATA;EAAU,CAAC,CAAC;EAEjD,IAAIM,MAAM,gBACN,gCAAC,iBAAK,CAAC,QAAQ;IAAC,WAAW,EAAEL,WAAY;IAAC,SAAS,EAAEF;EAAU,GAAKG,IAAI;IAAE,GAAG,EAAEJ;EAAI,GACtF;EAEDE,SAAS,IACL,OAAO,IAAIH,KAAK,KACfS,MAAM,gBACH;IAAK,SAAS,EAAC,oBAAoB;IAAC,wBAAeH,GAAG,cAAIJ,SAAS;EAAG,GACjEO,MAAM,CAEd,CAAC;EACN,OAAOA,MAAM;AACjB,CAAC,CAAC;AAAC,eAEYX,QAAQ;AAAA;AAEvBA,QAAQ,CAACY,SAAS,GAAG;EACjBR,SAAS,EAAES,qBAAS,CAACC,MAAM;EAC3BJ,KAAK,EAAEG,qBAAS,CAACE,MAAM;EACvBV,SAAS,EAAEQ,qBAAS,CAACG,IAAI;EACzBV,WAAW,EAAEO,qBAAS,CAACE;AAC3B,CAAC"}
|
package/lib/vtx-input/index.js
CHANGED
|
@@ -1,66 +1,44 @@
|
|
|
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
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _input = _interopRequireDefault(require("antd/lib/input"));
|
|
15
|
-
|
|
16
11
|
var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
|
|
17
|
-
|
|
18
12
|
var _TextArea = _interopRequireDefault(require("./TextArea"));
|
|
19
|
-
|
|
20
13
|
var _useLength = _interopRequireDefault(require("./useLength"));
|
|
21
|
-
|
|
22
14
|
var _getComponentProps = _interopRequireDefault(require("../_util/getComponentProps"));
|
|
23
|
-
|
|
24
15
|
var _filterSpecialCharacters = _interopRequireDefault(require("../_util/filterSpecialCharacters"));
|
|
25
|
-
|
|
26
16
|
var _excluded = ["showCount", "maxLength", "specialCharactersFilter", "trim", "onChange", "onBlur", "placeholder"];
|
|
27
|
-
|
|
28
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
-
|
|
30
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); }
|
|
31
|
-
|
|
32
19
|
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; }
|
|
33
|
-
|
|
34
20
|
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); }
|
|
35
|
-
|
|
36
21
|
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; }
|
|
37
|
-
|
|
38
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; }
|
|
39
|
-
|
|
40
23
|
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; }
|
|
41
|
-
|
|
42
24
|
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; }
|
|
43
|
-
|
|
44
25
|
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; }
|
|
45
|
-
|
|
46
26
|
var VtxInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
47
27
|
var showCount = props.showCount,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
28
|
+
_props$maxLength = props.maxLength,
|
|
29
|
+
maxLength = _props$maxLength === void 0 ? 32 : _props$maxLength,
|
|
30
|
+
_props$specialCharact = props.specialCharactersFilter,
|
|
31
|
+
specialCharactersFilter = _props$specialCharact === void 0 ? true : _props$specialCharact,
|
|
32
|
+
_props$trim = props.trim,
|
|
33
|
+
trim = _props$trim === void 0 ? true : _props$trim,
|
|
34
|
+
onChange = props.onChange,
|
|
35
|
+
_onBlur = props.onBlur,
|
|
36
|
+
_props$placeholder = props.placeholder,
|
|
37
|
+
placeholder = _props$placeholder === void 0 ? '请输入' : _props$placeholder,
|
|
38
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
60
39
|
var len = (0, _useLength["default"])(props.value, {
|
|
61
40
|
showCount: showCount
|
|
62
41
|
});
|
|
63
|
-
|
|
64
42
|
var newProps = _objectSpread({
|
|
65
43
|
ref: ref,
|
|
66
44
|
maxLength: maxLength,
|
|
@@ -68,22 +46,18 @@ var VtxInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
68
46
|
onBlur: function onBlur(e) {
|
|
69
47
|
var value = e.target.value;
|
|
70
48
|
var $e = e;
|
|
71
|
-
|
|
72
49
|
if (trim) {
|
|
73
50
|
value = value.trim();
|
|
74
51
|
}
|
|
75
|
-
|
|
76
52
|
if (specialCharactersFilter && value) {
|
|
77
53
|
$e = (0, _lodash["default"])(e);
|
|
78
54
|
$e.target.value = (0, _filterSpecialCharacters["default"])(value, (0, _getComponentProps["default"])(specialCharactersFilter));
|
|
79
55
|
onChange && onChange($e);
|
|
80
56
|
}
|
|
81
|
-
|
|
82
57
|
_onBlur && _onBlur($e);
|
|
83
58
|
},
|
|
84
59
|
onChange: onChange
|
|
85
60
|
}, rest);
|
|
86
|
-
|
|
87
61
|
showCount && 'value' in props && (newProps = _objectSpread({
|
|
88
62
|
suffix: "".concat(len, "/").concat(maxLength)
|
|
89
63
|
}, newProps));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["VtxInput","forwardRef","props","ref","showCount","maxLength","specialCharactersFilter","trim","onChange","onBlur","placeholder","rest","len","useLength","value","newProps","e","target","$e","cloneDeep","filterSpecialCharacters","getComponentProps","suffix","propTypes","PropTypes","number","string","bool","func","oneOfType","object","Search","Input","Group","Password","TextArea"],"sources":["vtx-input/index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Input from 'antd/lib/input';\nimport cloneDeep from 'lodash.clonedeep';\nimport TextArea from './TextArea';\nimport useLength from './useLength';\nimport getComponentProps from '../_util/getComponentProps';\nimport filterSpecialCharacters from '../_util/filterSpecialCharacters';\n\nconst VtxInput = forwardRef((props, ref) => {\n const {\n showCount,\n maxLength = 32,\n specialCharactersFilter = true,\n trim = true,\n onChange,\n onBlur,\n placeholder = '请输入',\n ...rest\n } = props;\n\n const len = useLength(props.value, { showCount });\n\n let newProps = {\n ref,\n maxLength,\n placeholder,\n onBlur(e) {\n let value = e.target.value;\n let $e = e;\n if (trim) {\n value = value.trim();\n }\n if (specialCharactersFilter && value) {\n $e = cloneDeep(e);\n $e.target.value = filterSpecialCharacters(\n value,\n getComponentProps(specialCharactersFilter),\n );\n onChange && onChange($e);\n }\n onBlur && onBlur($e);\n },\n onChange,\n ...rest,\n };\n\n showCount &&\n 'value' in props &&\n (newProps = {\n suffix: `${len}/${maxLength}`,\n ...newProps,\n });\n\n return <Input {...newProps} autoComplete=\"off\" />;\n});\n\nVtxInput.propTypes = {\n maxLength: PropTypes.number,\n value: PropTypes.string,\n showCount: PropTypes.bool,\n onChange: PropTypes.func,\n onBlur: PropTypes.func,\n placeholder: PropTypes.string,\n trim: PropTypes.bool,\n specialCharactersFilter: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),\n};\n\nVtxInput.Search = Input.Search;\nVtxInput.Group = Input.Group;\nVtxInput.Password = Input.Password;\nVtxInput.TextArea = TextArea;\n\nexport default VtxInput;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["VtxInput","forwardRef","props","ref","showCount","maxLength","specialCharactersFilter","trim","onChange","onBlur","placeholder","rest","len","useLength","value","newProps","e","target","$e","cloneDeep","filterSpecialCharacters","getComponentProps","suffix","propTypes","PropTypes","number","string","bool","func","oneOfType","object","Search","Input","Group","Password","TextArea"],"sources":["vtx-input/index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Input from 'antd/lib/input';\nimport cloneDeep from 'lodash.clonedeep';\nimport TextArea from './TextArea';\nimport useLength from './useLength';\nimport getComponentProps from '../_util/getComponentProps';\nimport filterSpecialCharacters from '../_util/filterSpecialCharacters';\n\nconst VtxInput = forwardRef((props, ref) => {\n const {\n showCount,\n maxLength = 32,\n specialCharactersFilter = true,\n trim = true,\n onChange,\n onBlur,\n placeholder = '请输入',\n ...rest\n } = props;\n\n const len = useLength(props.value, { showCount });\n\n let newProps = {\n ref,\n maxLength,\n placeholder,\n onBlur(e) {\n let value = e.target.value;\n let $e = e;\n if (trim) {\n value = value.trim();\n }\n if (specialCharactersFilter && value) {\n $e = cloneDeep(e);\n $e.target.value = filterSpecialCharacters(\n value,\n getComponentProps(specialCharactersFilter),\n );\n onChange && onChange($e);\n }\n onBlur && onBlur($e);\n },\n onChange,\n ...rest,\n };\n\n showCount &&\n 'value' in props &&\n (newProps = {\n suffix: `${len}/${maxLength}`,\n ...newProps,\n });\n\n return <Input {...newProps} autoComplete=\"off\" />;\n});\n\nVtxInput.propTypes = {\n maxLength: PropTypes.number,\n value: PropTypes.string,\n showCount: PropTypes.bool,\n onChange: PropTypes.func,\n onBlur: PropTypes.func,\n placeholder: PropTypes.string,\n trim: PropTypes.bool,\n specialCharactersFilter: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),\n};\n\nVtxInput.Search = Input.Search;\nVtxInput.Group = Input.Group;\nVtxInput.Password = Input.Password;\nVtxInput.TextArea = TextArea;\n\nexport default VtxInput;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAuE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEvE,IAAMA,QAAQ,gBAAG,IAAAC,iBAAU,EAAC,UAACC,KAAK,EAAEC,GAAG,EAAK;EACxC,IACIC,SAAS,GAQTF,KAAK,CARLE,SAAS;IAAA,mBAQTF,KAAK,CAPLG,SAAS;IAATA,SAAS,iCAAG,EAAE;IAAA,wBAOdH,KAAK,CANLI,uBAAuB;IAAvBA,uBAAuB,sCAAG,IAAI;IAAA,cAM9BJ,KAAK,CALLK,IAAI;IAAJA,IAAI,4BAAG,IAAI;IACXC,QAAQ,GAIRN,KAAK,CAJLM,QAAQ;IACRC,OAAM,GAGNP,KAAK,CAHLO,MAAM;IAAA,qBAGNP,KAAK,CAFLQ,WAAW;IAAXA,WAAW,mCAAG,KAAK;IAChBC,IAAI,4BACPT,KAAK;EAET,IAAMU,GAAG,GAAG,IAAAC,qBAAS,EAACX,KAAK,CAACY,KAAK,EAAE;IAAEV,SAAS,EAATA;EAAU,CAAC,CAAC;EAEjD,IAAIW,QAAQ;IACRZ,GAAG,EAAHA,GAAG;IACHE,SAAS,EAATA,SAAS;IACTK,WAAW,EAAXA,WAAW;IACXD,MAAM,kBAACO,CAAC,EAAE;MACN,IAAIF,KAAK,GAAGE,CAAC,CAACC,MAAM,CAACH,KAAK;MAC1B,IAAII,EAAE,GAAGF,CAAC;MACV,IAAIT,IAAI,EAAE;QACNO,KAAK,GAAGA,KAAK,CAACP,IAAI,EAAE;MACxB;MACA,IAAID,uBAAuB,IAAIQ,KAAK,EAAE;QAClCI,EAAE,GAAG,IAAAC,kBAAS,EAACH,CAAC,CAAC;QACjBE,EAAE,CAACD,MAAM,CAACH,KAAK,GAAG,IAAAM,mCAAuB,EACrCN,KAAK,EACL,IAAAO,6BAAiB,EAACf,uBAAuB,CAAC,CAC7C;QACDE,QAAQ,IAAIA,QAAQ,CAACU,EAAE,CAAC;MAC5B;MACAT,OAAM,IAAIA,OAAM,CAACS,EAAE,CAAC;IACxB,CAAC;IACDV,QAAQ,EAARA;EAAQ,GACLG,IAAI,CACV;EAEDP,SAAS,IACL,OAAO,IAAIF,KAAK,KACfa,QAAQ;IACLO,MAAM,YAAKV,GAAG,cAAIP,SAAS;EAAE,GAC1BU,QAAQ,CACd,CAAC;EAEN,oBAAO,gCAAC,iBAAK,eAAKA,QAAQ;IAAE,YAAY,EAAC;EAAK,GAAG;AACrD,CAAC,CAAC;AAEFf,QAAQ,CAACuB,SAAS,GAAG;EACjBlB,SAAS,EAAEmB,qBAAS,CAACC,MAAM;EAC3BX,KAAK,EAAEU,qBAAS,CAACE,MAAM;EACvBtB,SAAS,EAAEoB,qBAAS,CAACG,IAAI;EACzBnB,QAAQ,EAAEgB,qBAAS,CAACI,IAAI;EACxBnB,MAAM,EAAEe,qBAAS,CAACI,IAAI;EACtBlB,WAAW,EAAEc,qBAAS,CAACE,MAAM;EAC7BnB,IAAI,EAAEiB,qBAAS,CAACG,IAAI;EACpBrB,uBAAuB,EAAEkB,qBAAS,CAACK,SAAS,CAAC,CAACL,qBAAS,CAACG,IAAI,EAAEH,qBAAS,CAACM,MAAM,CAAC;AACnF,CAAC;AAED9B,QAAQ,CAAC+B,MAAM,GAAGC,iBAAK,CAACD,MAAM;AAC9B/B,QAAQ,CAACiC,KAAK,GAAGD,iBAAK,CAACC,KAAK;AAC5BjC,QAAQ,CAACkC,QAAQ,GAAGF,iBAAK,CAACE,QAAQ;AAClClC,QAAQ,CAACmC,QAAQ,GAAGA,oBAAQ;AAAC,eAEdnC,QAAQ;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","names":[],"sources":["vtx-input/style/index.js"],"sourcesContent":["import 'antd/lib/input/style';\nimport './index.less';\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"css.js","names":[],"sources":["vtx-input/style/index.js"],"sourcesContent":["import 'antd/lib/input/style';\nimport './index.less';\n"],"mappings":";;AAAA;AACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["vtx-input/style/index.js"],"sourcesContent":["import 'antd/lib/input/style';\nimport './index.less';\n"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["vtx-input/style/index.js"],"sourcesContent":["import 'antd/lib/input/style';\nimport './index.less';\n"],"mappings":";;AAAA;AACA"}
|
|
@@ -4,38 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
-
|
|
12
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
-
|
|
14
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
-
|
|
16
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
17
|
-
|
|
18
12
|
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; }
|
|
19
|
-
|
|
20
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
|
|
22
14
|
var useLength = function useLength() {
|
|
23
15
|
var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
24
|
-
|
|
25
16
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
showCount = _ref.showCount;
|
|
28
18
|
var _useState = (0, _react.useState)(0),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
len = _useState2[0],
|
|
21
|
+
setLen = _useState2[1];
|
|
33
22
|
(0, _react.useEffect)(function () {
|
|
34
23
|
showCount && setLen(String(val !== null && val !== void 0 ? val : '').length);
|
|
35
24
|
}, [val]);
|
|
36
25
|
return len;
|
|
37
26
|
};
|
|
38
|
-
|
|
39
27
|
var _default = useLength;
|
|
40
28
|
exports["default"] = _default;
|
|
41
29
|
//# sourceMappingURL=useLength.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLength.js","names":["useLength","val","showCount","useState","len","setLen","useEffect","String","length"],"sources":["vtx-input/useLength.js"],"sourcesContent":["import { useState, useEffect } from 'react';\n\nconst useLength = (val = '', { showCount } = {}) => {\n const [len, setLen] = useState(0);\n useEffect(() => {\n showCount && setLen(String(val ?? '').length);\n }, [val]);\n return len;\n};\n\nexport default useLength;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLength.js","names":["useLength","val","showCount","useState","len","setLen","useEffect","String","length"],"sources":["vtx-input/useLength.js"],"sourcesContent":["import { useState, useEffect } from 'react';\n\nconst useLength = (val = '', { showCount } = {}) => {\n const [len, setLen] = useState(0);\n useEffect(() => {\n showCount && setLen(String(val ?? '').length);\n }, [val]);\n return len;\n};\n\nexport default useLength;\n"],"mappings":";;;;;;AAAA;AAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAE5C,IAAMA,SAAS,GAAG,SAAZA,SAAS,GAAqC;EAAA,IAAjCC,GAAG,uEAAG,EAAE;EAAA,+EAAkB,CAAC,CAAC;IAAhBC,SAAS,QAATA,SAAS;EACpC,gBAAsB,IAAAC,eAAQ,EAAC,CAAC,CAAC;IAAA;IAA1BC,GAAG;IAAEC,MAAM;EAClB,IAAAC,gBAAS,EAAC,YAAM;IACZJ,SAAS,IAAIG,MAAM,CAACE,MAAM,CAACN,GAAG,aAAHA,GAAG,cAAHA,GAAG,GAAI,EAAE,CAAC,CAACO,MAAM,CAAC;EACjD,CAAC,EAAE,CAACP,GAAG,CAAC,CAAC;EACT,OAAOG,GAAG;AACd,CAAC;AAAC,eAEaJ,SAAS;AAAA"}
|
package/lib/vtx-modal/Title.js
CHANGED
|
@@ -4,16 +4,12 @@ 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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
function Title(props) {
|
|
15
11
|
var text = props.text,
|
|
16
|
-
|
|
12
|
+
subtitle = props.subtitle;
|
|
17
13
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
18
14
|
className: "vtx-modal-header-title"
|
|
19
15
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -22,7 +18,6 @@ function Title(props) {
|
|
|
22
18
|
className: "vtx-modal-header-subtitle"
|
|
23
19
|
}, subtitle));
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
Title.propTypes = {
|
|
27
22
|
text: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]),
|
|
28
23
|
subtitle: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Title.js","names":["Title","props","text","subtitle","propTypes","PropTypes","oneOfType","string","node"],"sources":["vtx-modal/Title.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction Title(props) {\n const { text, subtitle } = props;\n return (\n <div className=\"vtx-modal-header-title\">\n <span className=\"vtx-modal-header-text\">{text}</span>\n {subtitle && <span className=\"vtx-modal-header-subtitle\">{subtitle}</span>}\n </div>\n );\n}\n\nTitle.propTypes = {\n text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n};\n\nexport default Title;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Title.js","names":["Title","props","text","subtitle","propTypes","PropTypes","oneOfType","string","node"],"sources":["vtx-modal/Title.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nfunction Title(props) {\n const { text, subtitle } = props;\n return (\n <div className=\"vtx-modal-header-title\">\n <span className=\"vtx-modal-header-text\">{text}</span>\n {subtitle && <span className=\"vtx-modal-header-subtitle\">{subtitle}</span>}\n </div>\n );\n}\n\nTitle.propTypes = {\n text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n subtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n};\n\nexport default Title;\n"],"mappings":";;;;;;AAAA;AACA;AAAmC;AAEnC,SAASA,KAAK,CAACC,KAAK,EAAE;EAClB,IAAQC,IAAI,GAAeD,KAAK,CAAxBC,IAAI;IAAEC,QAAQ,GAAKF,KAAK,CAAlBE,QAAQ;EACtB,oBACI;IAAK,SAAS,EAAC;EAAwB,gBACnC;IAAM,SAAS,EAAC;EAAuB,GAAED,IAAI,CAAQ,EACpDC,QAAQ,iBAAI;IAAM,SAAS,EAAC;EAA2B,GAAEA,QAAQ,CAAQ,CACxE;AAEd;AAEAH,KAAK,CAACI,SAAS,GAAG;EACdF,IAAI,EAAEG,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,MAAM,EAAEF,qBAAS,CAACG,IAAI,CAAC,CAAC;EAC7DL,QAAQ,EAAEE,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,MAAM,EAAEF,qBAAS,CAACG,IAAI,CAAC;AACpE,CAAC;AAAC,eAEaR,KAAK;AAAA"}
|
package/lib/vtx-modal/index.js
CHANGED
|
@@ -1,56 +1,32 @@
|
|
|
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
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _useUpdateEffect = _interopRequireDefault(require("ahooks/es/useUpdateEffect"));
|
|
15
|
-
|
|
16
11
|
var _useSetState5 = _interopRequireDefault(require("ahooks/es/useSetState"));
|
|
17
|
-
|
|
18
12
|
var _CloseOutlined = _interopRequireDefault(require("@ant-design/icons/CloseOutlined"));
|
|
19
|
-
|
|
20
13
|
var _FullscreenExitOutlined = _interopRequireDefault(require("@ant-design/icons/FullscreenExitOutlined"));
|
|
21
|
-
|
|
22
14
|
var _FullscreenOutlined = _interopRequireDefault(require("@ant-design/icons/FullscreenOutlined"));
|
|
23
|
-
|
|
24
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
-
|
|
26
16
|
var _modal = _interopRequireDefault(require("antd/lib/modal"));
|
|
27
|
-
|
|
28
17
|
var _Title = _interopRequireDefault(require("./Title"));
|
|
29
|
-
|
|
30
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
|
-
|
|
32
19
|
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
|
-
|
|
34
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; }
|
|
35
|
-
|
|
36
21
|
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; }
|
|
37
|
-
|
|
38
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; }
|
|
39
|
-
|
|
40
23
|
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; }
|
|
41
|
-
|
|
42
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
43
|
-
|
|
44
25
|
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."); }
|
|
45
|
-
|
|
46
26
|
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); }
|
|
47
|
-
|
|
48
27
|
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; }
|
|
49
|
-
|
|
50
28
|
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; }
|
|
51
|
-
|
|
52
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
|
-
|
|
54
30
|
// 对话框位置初始参数
|
|
55
31
|
var initDragArg = {
|
|
56
32
|
init_x: 0,
|
|
@@ -59,39 +35,36 @@ var initDragArg = {
|
|
|
59
35
|
y_move: 0,
|
|
60
36
|
documentMouseMove: null,
|
|
61
37
|
documentMouseUp: null
|
|
62
|
-
};
|
|
38
|
+
};
|
|
63
39
|
|
|
40
|
+
// 全屏参数
|
|
64
41
|
var initFullScreen = {
|
|
65
42
|
isFull: false,
|
|
66
43
|
className: ''
|
|
67
44
|
};
|
|
68
|
-
|
|
69
45
|
function VtxModal(props) {
|
|
70
46
|
var _useSetState = (0, _useSetState5["default"])(initFullScreen),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
47
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
48
|
+
fullScreen = _useSetState2[0],
|
|
49
|
+
setFullScreen = _useSetState2[1]; // 是否是全屏状态
|
|
76
50
|
var _useSetState3 = (0, _useSetState5["default"])(initDragArg),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
51
|
+
_useSetState4 = _slicedToArray(_useSetState3, 2),
|
|
52
|
+
dragArg = _useSetState4[0],
|
|
53
|
+
setDragArg = _useSetState4[1]; // 拖动配置
|
|
82
54
|
var classId = (0, _react.useRef)(new Date().getTime() + Math.random());
|
|
83
55
|
var _props$wrapClassName = props.wrapClassName,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
56
|
+
wrapClassName = _props$wrapClassName === void 0 ? '' : _props$wrapClassName,
|
|
57
|
+
_props$closable = props.closable,
|
|
58
|
+
closable = _props$closable === void 0 ? true : _props$closable,
|
|
59
|
+
_props$title = props.title,
|
|
60
|
+
title = _props$title === void 0 ? '' : _props$title,
|
|
61
|
+
_props$maximize = props.maximize,
|
|
62
|
+
maximize = _props$maximize === void 0 ? false : _props$maximize,
|
|
63
|
+
onModalResize = props.onModalResize,
|
|
64
|
+
_props$moveable = props.moveable,
|
|
65
|
+
moveable = _props$moveable === void 0 ? false : _props$moveable;
|
|
66
|
+
|
|
67
|
+
// 监听对话框大小变化回调(忽略首次执行)
|
|
95
68
|
(0, _useUpdateEffect["default"])(function () {
|
|
96
69
|
var timer = setTimeout(function () {
|
|
97
70
|
if (onModalResize && typeof onModalResize === 'function') {
|
|
@@ -106,15 +79,14 @@ function VtxModal(props) {
|
|
|
106
79
|
return function () {
|
|
107
80
|
return clearTimeout(timer);
|
|
108
81
|
};
|
|
109
|
-
}, [fullScreen.isFull]);
|
|
82
|
+
}, [fullScreen.isFull]);
|
|
110
83
|
|
|
84
|
+
// 拖拽
|
|
111
85
|
(0, _react.useEffect)(function () {
|
|
112
86
|
if (props.visible && moveable) {
|
|
113
87
|
var timer = setTimeout(function () {
|
|
114
88
|
var _document$getElements, _document$getElements2, _document$getElements3;
|
|
115
|
-
|
|
116
89
|
var modalHead = (_document$getElements = document.getElementsByClassName(classId.current)) === null || _document$getElements === void 0 ? void 0 : (_document$getElements2 = _document$getElements[0]) === null || _document$getElements2 === void 0 ? void 0 : (_document$getElements3 = _document$getElements2.getElementsByClassName('ant-modal-header')) === null || _document$getElements3 === void 0 ? void 0 : _document$getElements3[0];
|
|
117
|
-
|
|
118
90
|
if (modalHead) {
|
|
119
91
|
modalHead.style.cursor = 'move';
|
|
120
92
|
modalHead.onmousedown = startDrag;
|
|
@@ -125,10 +97,9 @@ function VtxModal(props) {
|
|
|
125
97
|
};
|
|
126
98
|
}
|
|
127
99
|
});
|
|
128
|
-
|
|
129
100
|
var startDrag = function startDrag(e) {
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
// 全屏模式下禁止拖拽
|
|
132
103
|
if (!fullScreen.isFull) {
|
|
133
104
|
setDragArg({
|
|
134
105
|
documentMouseUp: document.onmouseup,
|
|
@@ -136,7 +107,6 @@ function VtxModal(props) {
|
|
|
136
107
|
init_x: e.clientX - dragArg.x_move,
|
|
137
108
|
init_y: e.clientY - dragArg.y_move
|
|
138
109
|
});
|
|
139
|
-
|
|
140
110
|
document.onmousemove = function (e) {
|
|
141
111
|
setDragArg(function (prev) {
|
|
142
112
|
return {
|
|
@@ -145,28 +115,26 @@ function VtxModal(props) {
|
|
|
145
115
|
};
|
|
146
116
|
});
|
|
147
117
|
};
|
|
148
|
-
|
|
149
118
|
document.onmouseup = function () {
|
|
150
119
|
document.onmousemove = dragArg.documentMouseMove;
|
|
151
120
|
document.onmouseup = dragArg.documentMouseUp;
|
|
152
121
|
};
|
|
153
122
|
}
|
|
154
|
-
};
|
|
155
|
-
|
|
123
|
+
};
|
|
156
124
|
|
|
125
|
+
// 关闭对话框,初始化位置
|
|
157
126
|
var onCancel = function onCancel() {
|
|
158
127
|
if (props.onCancel && typeof props.onCancel === 'function') {
|
|
159
|
-
props.onCancel();
|
|
160
|
-
|
|
128
|
+
props.onCancel();
|
|
129
|
+
// TODO 关闭弹框会闪一下,待解决
|
|
161
130
|
setDragArg(initDragArg);
|
|
162
131
|
setFullScreen(initFullScreen);
|
|
163
132
|
}
|
|
164
133
|
};
|
|
134
|
+
|
|
165
135
|
/*
|
|
166
136
|
*重写title,加入对话框全屏功能
|
|
167
137
|
*/
|
|
168
|
-
|
|
169
|
-
|
|
170
138
|
title = function renderTitle() {
|
|
171
139
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
172
140
|
className: "vtx-modal-title",
|
|
@@ -180,11 +148,9 @@ function VtxModal(props) {
|
|
|
180
148
|
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
181
149
|
onClick: function onClick() {
|
|
182
150
|
var fullScreenClass = '';
|
|
183
|
-
|
|
184
151
|
if (!fullScreen.isFull) {
|
|
185
152
|
fullScreenClass = 'vtx-modal-maxClass';
|
|
186
153
|
}
|
|
187
|
-
|
|
188
154
|
setFullScreen({
|
|
189
155
|
isFull: !fullScreen.isFull,
|
|
190
156
|
className: fullScreenClass
|
|
@@ -196,21 +162,17 @@ function VtxModal(props) {
|
|
|
196
162
|
onClick: onCancel
|
|
197
163
|
}, /*#__PURE__*/_react["default"].createElement(_CloseOutlined["default"], null))) : '');
|
|
198
164
|
}();
|
|
199
|
-
|
|
200
165
|
var bodyStyle = _objectSpread({}, props.bodyStyle);
|
|
201
|
-
/* 限制最大高度 */
|
|
202
|
-
|
|
203
166
|
|
|
167
|
+
/* 限制最大高度 */
|
|
204
168
|
if (!fullScreen.isFull) {
|
|
205
169
|
bodyStyle = _objectSpread({
|
|
206
170
|
maxHeight: "".concat(window.innerHeight * 0.7, "px")
|
|
207
171
|
}, bodyStyle);
|
|
208
172
|
}
|
|
209
|
-
|
|
210
173
|
var transformStyle = {
|
|
211
174
|
transform: "translate(".concat(dragArg.x_move, "px,").concat(dragArg.y_move, "px)")
|
|
212
175
|
};
|
|
213
|
-
|
|
214
176
|
var newProps = _objectSpread(_objectSpread({
|
|
215
177
|
maskClosable: false,
|
|
216
178
|
destroyOnClose: true,
|
|
@@ -223,10 +185,8 @@ function VtxModal(props) {
|
|
|
223
185
|
onCancel: onCancel,
|
|
224
186
|
style: _objectSpread(_objectSpread({}, props.style), fullScreen.isFull ? {} : transformStyle)
|
|
225
187
|
});
|
|
226
|
-
|
|
227
188
|
return /*#__PURE__*/_react["default"].createElement(_modal["default"], newProps, props.children);
|
|
228
189
|
}
|
|
229
|
-
|
|
230
190
|
VtxModal.info = _modal["default"].info;
|
|
231
191
|
VtxModal.success = _modal["default"].success;
|
|
232
192
|
VtxModal.error = _modal["default"].error;
|