@para-ui/core 3.0.28 → 3.0.30
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/AutoBox/index.js +48 -88
- package/AutoTips/index.js +25 -32
- package/Breadcrumbs/index.js +43 -63
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +88 -118
- package/ButtonGroup/index.js +27 -36
- package/Carousel/index.d.ts +2 -2
- package/Carousel/index.js +27 -28
- package/Cascader/index.js +52 -64
- package/Checkbox/index.js +23 -39
- package/CheckboxGroup/index.js +31 -48
- package/Collapse/collapsePanel.d.ts +1 -1
- package/Collapse/index.d.ts +1 -1
- package/Collapse/index.js +9 -29
- package/Collapse/util.d.ts +2 -2
- package/CollapseBox/index.js +45 -56
- package/CollapseLayout/index.js +35 -54
- package/ComboSelect/index.js +222 -349
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.js +17 -20
- package/DatePicker/generatePicker/index.d.ts +17 -17
- package/DatePicker/index.d.ts +4 -4
- package/DatePicker/index.js +111 -167
- package/Desktop/index.js +62 -173
- package/Drawer/index.js +65 -58
- package/Drawer/interface.d.ts +7 -3
- package/Dropdown/index.d.ts +1 -1
- package/Dropdown/index.js +3 -3
- package/Empty/index.js +17 -22
- package/Form/index.d.ts +1 -1
- package/Form/index.js +38 -80
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +11 -11
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/index.js +11 -11
- package/GlobalContext/index.js +3 -3
- package/GlobalContext/usePopupContainer.d.ts +1 -1
- package/Help/index.js +11 -11
- package/HelperText/index.js +11 -12
- package/InputLang/index.js +47 -80
- package/InputNumber/index.js +65 -100
- package/Label/index.js +15 -16
- package/Loading/index.js +6 -7
- package/Menu/index.js +148 -328
- package/Menu/interface.d.ts +2 -2
- package/Menu/verticalMenuList.d.ts +1 -1
- package/Message/index.d.ts +1 -1
- package/Message/index.js +45 -64
- package/Modal/Confirm/index.d.ts +2 -2
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +119 -152
- package/MultiBox/index.js +44 -76
- package/Notification/index.d.ts +2 -2
- package/Notification/index.js +51 -72
- package/OperateBtn/index.js +42 -70
- package/PageHeader/index.js +120 -286
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +2 -2
- package/Pagination/index.js +79 -131
- package/ParauiProvider/index.js +2 -3
- package/PasswordRules/index.js +12 -30
- package/PopConfirm/index.d.ts +1 -1
- package/PopConfirm/index.js +52 -59
- package/Popover/index.js +8 -9
- package/Progress/index.d.ts +6 -6
- package/Progress/index.js +50 -89
- package/Querying/index.js +14 -17
- package/README.md +813 -800
- package/Radio/index.js +21 -33
- package/RadioGroup/index.js +32 -47
- package/Search/index.js +44 -66
- package/Select/index.js +176 -343
- package/SelectInput/index.js +8 -9
- package/Selector/index.js +285 -681
- package/SelectorPicker/index.js +62 -97
- package/SingleBox/index.js +30 -55
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +29 -41
- package/Slider/interface.d.ts +2 -2
- package/Split/index.js +10 -23
- package/Status/index.js +8 -7
- package/Stepper/index.d.ts +1 -1
- package/Stepper/index.js +20 -25
- package/Styles/form.scss +5 -5
- package/Styles/index.scss +37 -37
- package/Styles/normalize.scss +348 -348
- package/Styles/scrollbar.scss +223 -223
- package/Styles/theme.scss +74 -74
- package/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +568 -1019
- package/Table/interface.d.ts +5 -5
- package/Tabs/index.d.ts +3 -3
- package/Tabs/index.js +47 -65
- package/Tag/TagGroup.d.ts +1 -1
- package/Tag/index.d.ts +2 -2
- package/Tag/index.js +72 -107
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +81 -105
- package/TextField/index.js +141 -220
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +12 -15
- package/Timeline/index.js +42 -52
- package/Title/index.js +10 -9
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.js +50 -70
- package/Tooltip/index.js +64 -98
- package/Tooltip/interface.d.ts +1 -1
- package/Transfer/index.d.ts +1 -1
- package/Transfer/index.js +114 -137
- package/Transfer/useClick.d.ts +1 -1
- package/Tree/index.js +10 -10
- package/Tree/interface.d.ts +6 -6
- package/Upload/Dragger/index.d.ts +1 -1
- package/Upload/ImageUpload/index.d.ts +1 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +283 -475
- package/Upload/interface.d.ts +2 -2
- package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
- package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
- package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
- package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
- package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
- package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
- package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
- package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
- package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
- package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
- package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
- package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
- package/index.d.ts +2 -4
- package/index.js +15 -16
- package/package.json +167 -168
- package/Test/index.d.ts +0 -3
- package/Test/index.js +0 -9
- package/_verture/defineProperty-0590dc61.js +0 -16
package/Tooltip/index.js
CHANGED
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import RcTooltip from 'rc-tooltip';
|
|
6
6
|
import { placements } from 'rc-tooltip/lib/placements';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-
|
|
8
|
+
import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
9
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
10
|
|
|
11
|
+
//自动调整位置
|
|
11
12
|
var autoAdjustOverflowEnabled = {
|
|
12
13
|
adjustX: 1,
|
|
13
14
|
adjustY: 1
|
|
14
|
-
};
|
|
15
|
-
|
|
15
|
+
};
|
|
16
|
+
//非自动调整位置
|
|
16
17
|
var autoAdjustOverflowDisabled = {
|
|
17
18
|
adjustX: 0,
|
|
18
19
|
adjustY: 0
|
|
19
20
|
};
|
|
20
|
-
var targetOffset = [0, 0];
|
|
21
|
-
|
|
21
|
+
var targetOffset = [0, 0];
|
|
22
|
+
//获得调整位置选项
|
|
22
23
|
function getOverflowOptions(autoAdjustOverflow) {
|
|
23
24
|
if (typeof autoAdjustOverflow === 'boolean') {
|
|
24
25
|
return autoAdjustOverflow ? autoAdjustOverflowEnabled : autoAdjustOverflowDisabled;
|
|
25
26
|
}
|
|
26
|
-
|
|
27
27
|
return Object.assign(Object.assign({}, autoAdjustOverflowDisabled), autoAdjustOverflow);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
}
|
|
29
|
+
//tooltip placement
|
|
31
30
|
function getPlacements(config) {
|
|
32
31
|
var _config$arrowWidth = config.arrowWidth,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
arrowWidth = _config$arrowWidth === void 0 ? 4 : _config$arrowWidth,
|
|
33
|
+
_config$horizontalArr = config.horizontalArrowShift,
|
|
34
|
+
horizontalArrowShift = _config$horizontalArr === void 0 ? 16 : _config$horizontalArr,
|
|
35
|
+
_config$verticalArrow = config.verticalArrowShift,
|
|
36
|
+
verticalArrowShift = _config$verticalArrow === void 0 ? 8 : _config$verticalArrow,
|
|
37
|
+
autoAdjustOverflow = config.autoAdjustOverflow,
|
|
38
|
+
arrowPointAtCenter = config.arrowPointAtCenter;
|
|
40
39
|
var placementMap = {
|
|
41
40
|
left: {
|
|
42
41
|
points: ['cr', 'cl'],
|
|
@@ -99,7 +98,6 @@ function getPlacements(config) {
|
|
|
99
98
|
});
|
|
100
99
|
return placementMap;
|
|
101
100
|
}
|
|
102
|
-
|
|
103
101
|
var splitObject = function splitObject(obj, keys) {
|
|
104
102
|
var picked = {};
|
|
105
103
|
var omitted = Object.assign({}, obj);
|
|
@@ -113,19 +111,16 @@ var splitObject = function splitObject(obj, keys) {
|
|
|
113
111
|
picked: picked,
|
|
114
112
|
omitted: omitted
|
|
115
113
|
};
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
};
|
|
115
|
+
//兼容禁用title
|
|
119
116
|
function getDisabledCompatibleChildren(child) {
|
|
120
117
|
var element = /*#__PURE__*/React__default.isValidElement(child) ? child : jsx("span", {
|
|
121
118
|
children: child
|
|
122
119
|
});
|
|
123
|
-
|
|
124
120
|
if (element.type === 'button' && element.props.disabled) {
|
|
125
121
|
var _splitObject = splitObject(element.props.style, ['position', 'left', 'right', 'top', 'bottom', 'float', 'display', 'zIndex']),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
122
|
+
picked = _splitObject.picked,
|
|
123
|
+
omitted = _splitObject.omitted;
|
|
129
124
|
var spanStyle = Object.assign(Object.assign({
|
|
130
125
|
display: 'inline-block'
|
|
131
126
|
}, picked), {
|
|
@@ -135,12 +130,10 @@ function getDisabledCompatibleChildren(child) {
|
|
|
135
130
|
var buttonStyle = Object.assign(Object.assign({}, omitted), {
|
|
136
131
|
pointerEvents: 'none'
|
|
137
132
|
});
|
|
138
|
-
|
|
139
133
|
var _child = /*#__PURE__*/React__default.cloneElement(element, {
|
|
140
134
|
style: buttonStyle,
|
|
141
135
|
className: null
|
|
142
136
|
});
|
|
143
|
-
|
|
144
137
|
return jsx("span", Object.assign({
|
|
145
138
|
style: spanStyle,
|
|
146
139
|
className: clsx(element.props.className, "".concat($rcPrefixCls, "-tooltip-disabled-compatible-wrapper"))
|
|
@@ -148,10 +141,9 @@ function getDisabledCompatibleChildren(child) {
|
|
|
148
141
|
children: _child
|
|
149
142
|
}));
|
|
150
143
|
}
|
|
151
|
-
|
|
152
144
|
return element;
|
|
153
|
-
}
|
|
154
|
-
|
|
145
|
+
}
|
|
146
|
+
//映射placement
|
|
155
147
|
function mapLegacyPlacement(place) {
|
|
156
148
|
var legacyPlacement = {
|
|
157
149
|
'bottom-end': 'bottomRight',
|
|
@@ -164,8 +156,8 @@ function mapLegacyPlacement(place) {
|
|
|
164
156
|
'top-start': 'topLeft'
|
|
165
157
|
};
|
|
166
158
|
return legacyPlacement[place] || place;
|
|
167
|
-
}
|
|
168
|
-
|
|
159
|
+
}
|
|
160
|
+
//浮层偏移量
|
|
169
161
|
function getAlignOffset(place) {
|
|
170
162
|
var mPlace = mapLegacyPlacement(place);
|
|
171
163
|
var offsetMap = {
|
|
@@ -212,108 +204,88 @@ function getAlignOffset(place) {
|
|
|
212
204
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/5/25 下午7:17\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-tooltip {\n color: rgb(255, 255, 255);\n font-size: 14px;\n line-height: 1.5715;\n position: absolute;\n z-index: 1500;\n display: block;\n width: max-content;\n visibility: visible;\n}\n.paraui-v3-tooltip .component-tooltip-content {\n position: relative;\n}\n.paraui-v3-tooltip.component-tooltip-hidden {\n display: none;\n}\n.paraui-v3-tooltip.paraui-v3-tooltip-hide-arrow .component-tooltip-arrow {\n display: none;\n}\n.paraui-v3-tooltip .component-tooltip-inner {\n min-width: 30px;\n min-height: 32px;\n padding: 5px 12px;\n color: rgb(255, 255, 255);\n text-align: left;\n text-decoration: none;\n word-wrap: break-word;\n background-color: rgba(46, 55, 67, 0.7);\n border-radius: 4px;\n line-height: 22px;\n}\n.paraui-v3-tooltip .component-tooltip-arrow {\n position: absolute;\n z-index: 2;\n display: block;\n width: 22px;\n height: 22px;\n overflow: hidden;\n background: transparent;\n pointer-events: none;\n}\n.paraui-v3-tooltip .component-tooltip-arrow-content {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: 11.3137085px;\n height: 11.3137085px;\n margin: auto;\n content: \"\";\n border-radius: 0 0 2px;\n pointer-events: none;\n background: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-tooltip .component-tooltip-arrow-content::before {\n position: absolute;\n top: -11.3137085px;\n left: -11.3137085px;\n width: 33.9411255px;\n height: 33.9411255px;\n background-repeat: no-repeat;\n background-position: -10px -10px;\n content: \"\";\n clip-path: path(\"M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z\");\n}\n.paraui-v3-tooltip.component-tooltip-placement-top .component-tooltip-arrow, .paraui-v3-tooltip.component-tooltip-placement-topLeft .component-tooltip-arrow, .paraui-v3-tooltip.component-tooltip-placement-topRight .component-tooltip-arrow {\n bottom: 0;\n transform: translateY(100%);\n}\n.paraui-v3-tooltip.component-tooltip-placement-top .component-tooltip-arrow-content, .paraui-v3-tooltip.component-tooltip-placement-topLeft .component-tooltip-arrow-content, .paraui-v3-tooltip.component-tooltip-placement-topRight .component-tooltip-arrow-content {\n box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n transform: translateY(-11px) rotate(45deg);\n}\n.paraui-v3-tooltip.component-tooltip-placement-top .component-tooltip-arrow {\n left: 50%;\n transform: translateY(100%) translateX(-50%);\n}\n.paraui-v3-tooltip.component-tooltip-placement-topLeft .component-tooltip-arrow {\n left: 13px;\n}\n.paraui-v3-tooltip.component-tooltip-placement-topRight .component-tooltip-arrow {\n right: 13px;\n}\n.paraui-v3-tooltip.component-tooltip-placement-right .component-tooltip-arrow, .paraui-v3-tooltip.component-tooltip-placement-rightTop .component-tooltip-arrow, .paraui-v3-tooltip.component-tooltip-placement-rightBottom .component-tooltip-arrow {\n left: 0;\n transform: translateX(-100%);\n}\n.paraui-v3-tooltip.component-tooltip-placement-right .component-tooltip-arrow-content, .paraui-v3-tooltip.component-tooltip-placement-rightTop .component-tooltip-arrow-content, .paraui-v3-tooltip.component-tooltip-placement-rightBottom .component-tooltip-arrow-content {\n box-shadow: -3px 3px 7px rgba(0, 0, 0, 0.07);\n transform: translateX(11px) rotate(135deg);\n}\n.paraui-v3-tooltip.component-tooltip-placement-right .component-tooltip-arrow {\n top: 50%;\n transform: translateX(-100%) translateY(-50%);\n}\n.paraui-v3-tooltip.component-tooltip-placement-rightTop .component-tooltip-arrow {\n top: 5px;\n}\n.paraui-v3-tooltip.component-tooltip-placement-rightBottom .component-tooltip-arrow {\n bottom: 5px;\n}\n.paraui-v3-tooltip.component-tooltip-placement-left .component-tooltip-arrow, .paraui-v3-tooltip.component-tooltip-placement-leftTop .component-tooltip-arrow, .paraui-v3-tooltip.component-tooltip-placement-leftBottom .component-tooltip-arrow {\n right: 0;\n transform: translateX(100%);\n}\n.paraui-v3-tooltip.component-tooltip-placement-left .component-tooltip-arrow-content, .paraui-v3-tooltip.component-tooltip-placement-leftTop .component-tooltip-arrow-content, .paraui-v3-tooltip.component-tooltip-placement-leftBottom .component-tooltip-arrow-content {\n box-shadow: 3px -3px 7px rgba(0, 0, 0, 0.07);\n transform: translateX(-11px) rotate(315deg);\n}\n.paraui-v3-tooltip.component-tooltip-placement-left .component-tooltip-arrow {\n top: 50%;\n transform: translateX(100%) translateY(-50%);\n}\n.paraui-v3-tooltip.component-tooltip-placement-leftTop .component-tooltip-arrow {\n top: 5px;\n}\n.paraui-v3-tooltip.component-tooltip-placement-leftBottom .component-tooltip-arrow {\n bottom: 5px;\n}\n.paraui-v3-tooltip.component-tooltip-placement-bottom .component-tooltip-arrow, .paraui-v3-tooltip.component-tooltip-placement-bottomLeft .component-tooltip-arrow, .paraui-v3-tooltip.component-tooltip-placement-bottomRight .component-tooltip-arrow {\n top: 0;\n transform: translateY(-100%);\n}\n.paraui-v3-tooltip.component-tooltip-placement-bottom .component-tooltip-arrow-content, .paraui-v3-tooltip.component-tooltip-placement-bottomLeft .component-tooltip-arrow-content, .paraui-v3-tooltip.component-tooltip-placement-bottomRight .component-tooltip-arrow-content {\n box-shadow: -3px -3px 7px rgba(0, 0, 0, 0.07);\n transform: translateY(11px) rotate(225deg);\n}\n.paraui-v3-tooltip.component-tooltip-placement-bottom .component-tooltip-arrow {\n left: 50%;\n transform: translateY(-100%) translateX(-50%);\n}\n.paraui-v3-tooltip.component-tooltip-placement-bottomLeft .component-tooltip-arrow {\n left: 13px;\n}\n.paraui-v3-tooltip.component-tooltip-placement-bottomRight .component-tooltip-arrow {\n right: 13px;\n}\n\n.component-tooltip-zoom-big-fast-enter,\n.component-tooltip-zoom-big-fast-appear {\n animation-duration: 0.1s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.component-tooltip-zoom-big-fast-leave {\n animation-duration: 0.1s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.component-tooltip-zoom-big-fast-enter.component-tooltip-zoom-big-fast-enter-active,\n.component-tooltip-zoom-big-fast-appear.component-tooltip-zoom-big-fast-appear-active {\n animation-name: componentTooltipZoomBigIn;\n animation-play-state: running;\n}\n\n.component-tooltip-zoom-big-fast-leave.component-tooltip-zoom-big-fast-leave-active {\n animation-name: componentTooltipZoomBigOut;\n animation-play-state: running;\n pointer-events: none;\n}\n\n.component-tooltip-zoom-big-fast-enter,\n.component-tooltip-zoom-big-fast-appear {\n transform: scale(0);\n opacity: 0;\n animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);\n}\n\n.component-tooltip-zoom-big-fast-enter-prepare,\n.component-tooltip-zoom-big-fast-appear-prepare {\n transform: none;\n}\n\n.component-tooltip-zoom-big-fast-leave {\n animation-timing-function: cubic-bezier(0.78, 0.14, 0.15, 0.86);\n}\n\n@keyframes componentTooltipZoomBigIn {\n 0% {\n transform: scale(0.8);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n@keyframes componentTooltipZoomBigOut {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(0.8);\n opacity: 0;\n }\n}";
|
|
213
205
|
styleInject(css_248z);
|
|
214
206
|
|
|
207
|
+
//tooltip
|
|
215
208
|
var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
216
209
|
var _a;
|
|
217
|
-
|
|
218
210
|
var _React$useState = React__default.useState(props.defaultVisible),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
211
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
212
|
+
visible = _React$useState2[0],
|
|
213
|
+
setVisible = _React$useState2[1]; //是否显示
|
|
224
214
|
var wrapRef = React__default.useRef(); //锚点
|
|
225
|
-
|
|
226
215
|
var tRef = React__default.useRef(); //实例
|
|
227
|
-
|
|
228
216
|
var _React$useState3 = React__default.useState([0, 0]),
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
217
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
218
|
+
targetOffset = _React$useState4[0],
|
|
219
|
+
setTargetOffset = _React$useState4[1];
|
|
233
220
|
React__default.useEffect(function () {
|
|
234
221
|
var _a;
|
|
235
|
-
|
|
236
222
|
if ('visible' in props || 'open' in props) {
|
|
237
223
|
setVisible(!!((_a = props.visible) !== null && _a !== void 0 ? _a : props.open));
|
|
238
224
|
}
|
|
239
|
-
}, [(_a = props.visible) !== null && _a !== void 0 ? _a : props.open]);
|
|
240
|
-
|
|
225
|
+
}, [(_a = props.visible) !== null && _a !== void 0 ? _a : props.open]);
|
|
226
|
+
//no title
|
|
241
227
|
var isUntitled = function isUntitled() {
|
|
242
228
|
var title = props.title;
|
|
243
229
|
return !title && title !== 0;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
|
|
230
|
+
};
|
|
231
|
+
//浮层切换时回调
|
|
247
232
|
var onVisibleChange = function onVisibleChange(vis) {
|
|
248
233
|
var _a;
|
|
249
|
-
|
|
250
234
|
if (!('visible' in props || 'open' in props)) {
|
|
251
235
|
setVisible(isUntitled() ? false : vis);
|
|
252
236
|
}
|
|
253
|
-
|
|
254
237
|
if (!isUntitled()) {
|
|
255
238
|
(_a = props.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(props, vis);
|
|
256
239
|
}
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
|
|
240
|
+
};
|
|
241
|
+
//tooltip 弹出位置
|
|
260
242
|
var getTooltipPlacements = function getTooltipPlacements() {
|
|
261
243
|
var builtinPlacements = props.builtinPlacements,
|
|
262
|
-
|
|
263
|
-
|
|
244
|
+
arrowPointAtCenter = props.arrowPointAtCenter,
|
|
245
|
+
autoAdjustOverflow = props.autoAdjustOverflow;
|
|
264
246
|
return builtinPlacements || getPlacements({
|
|
265
247
|
arrowPointAtCenter: arrowPointAtCenter,
|
|
266
248
|
autoAdjustOverflow: autoAdjustOverflow
|
|
267
249
|
});
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
|
|
250
|
+
};
|
|
251
|
+
// 动态设置动画点
|
|
271
252
|
var onPopupAlign = function onPopupAlign(domNode, align) {
|
|
272
|
-
var placements = getTooltipPlacements();
|
|
273
|
-
|
|
253
|
+
var placements = getTooltipPlacements();
|
|
254
|
+
// 当前返回的位置
|
|
274
255
|
var placement = Object.keys(placements).find(function (key) {
|
|
275
256
|
return placements[key].points[0] === align.points[0] && placements[key].points[1] === align.points[1];
|
|
276
257
|
});
|
|
277
|
-
|
|
278
258
|
if (!placement) {
|
|
279
259
|
return;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
260
|
+
}
|
|
261
|
+
// 根据当前坐标设置动画点
|
|
283
262
|
var rect = domNode.getBoundingClientRect();
|
|
284
263
|
var transformOrigin = {
|
|
285
264
|
top: '50%',
|
|
286
265
|
left: '50%'
|
|
287
266
|
};
|
|
288
|
-
|
|
289
267
|
if (placement.indexOf('top') >= 0 || placement.indexOf('Bottom') >= 0) {
|
|
290
268
|
transformOrigin.top = "".concat(rect.height - align.offset[1], "px");
|
|
291
269
|
} else if (placement.indexOf('Top') >= 0 || placement.indexOf('bottom') >= 0) {
|
|
292
270
|
transformOrigin.top = "".concat(-align.offset[1], "px");
|
|
293
271
|
}
|
|
294
|
-
|
|
295
272
|
if (placement.indexOf('left') >= 0 || placement.indexOf('Right') >= 0) {
|
|
296
273
|
transformOrigin.left = "".concat(rect.width - align.offset[0], "px");
|
|
297
274
|
} else if (placement.indexOf('right') >= 0 || placement.indexOf('Left') >= 0) {
|
|
298
275
|
transformOrigin.left = "".concat(-align.offset[0], "px");
|
|
299
276
|
}
|
|
300
|
-
|
|
301
277
|
domNode.style.transformOrigin = "".concat(transformOrigin.left, " ").concat(transformOrigin.top);
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
|
|
278
|
+
};
|
|
279
|
+
//跟随光标
|
|
305
280
|
var handleMouseMove = function handleMouseMove(e) {
|
|
306
281
|
var _a, _b, _c, _d;
|
|
307
|
-
|
|
308
282
|
if (wrapRef.current) {
|
|
309
283
|
var popupHeight = ((_d = (_c = (_b = (_a = tRef.current) === null || _a === void 0 ? void 0 : _a.popupRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.getElement()) === null || _d === void 0 ? void 0 : _d.offsetHeight) || 0;
|
|
310
284
|
var cursorSpace = popupHeight === 0 ? 60 : 30;
|
|
311
|
-
|
|
312
285
|
var _wrapRef$current$getB = wrapRef.current.getBoundingClientRect(),
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
286
|
+
x = _wrapRef$current$getB.x,
|
|
287
|
+
y = _wrapRef$current$getB.y,
|
|
288
|
+
width = _wrapRef$current$getB.width;
|
|
317
289
|
var newX = e.clientX - (x + width / 2);
|
|
318
290
|
var newY = e.clientY - y + popupHeight + cursorSpace;
|
|
319
291
|
setTimeout(function () {
|
|
@@ -321,36 +293,30 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
321
293
|
});
|
|
322
294
|
}
|
|
323
295
|
};
|
|
324
|
-
|
|
325
296
|
var _props$prefixCls = props.prefixCls,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
297
|
+
prefixCls = _props$prefixCls === void 0 ? "".concat($rcPrefixCls, "-tooltip") : _props$prefixCls,
|
|
298
|
+
getPopupContainer = props.getPopupContainer,
|
|
299
|
+
overlayClassName = props.overlayClassName,
|
|
300
|
+
overlayInnerStyle = props.overlayInnerStyle,
|
|
301
|
+
overlayStyle = props.overlayStyle,
|
|
302
|
+
children = props.children,
|
|
303
|
+
title = props.title,
|
|
304
|
+
placement = props.placement,
|
|
305
|
+
isPopover = props.isPopover,
|
|
306
|
+
followCursor = props.followCursor,
|
|
307
|
+
maxWidth = props.maxWidth,
|
|
308
|
+
restProps = __rest(props, ["prefixCls", "getPopupContainer", "overlayClassName", "overlayInnerStyle", "overlayStyle", "children", "title", "placement", "isPopover", "followCursor", "maxWidth"]);
|
|
339
309
|
var tempVisible = visible;
|
|
340
|
-
|
|
341
310
|
if (!('visible' in props || 'open' in props) && isUntitled()) {
|
|
342
311
|
//没有title必然不可见
|
|
343
312
|
tempVisible = false;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
313
|
+
}
|
|
314
|
+
//overlayCls
|
|
347
315
|
var overlayCls = clsx(!isPopover && "".concat($prefixCls, "-tooltip"), overlayClassName, !props.arrow && "".concat($prefixCls, "-tooltip-hide-arrow"));
|
|
348
316
|
var mergeOverlayStyle = Object.assign({}, overlayStyle);
|
|
349
|
-
|
|
350
317
|
if (maxWidth) {
|
|
351
318
|
mergeOverlayStyle.maxWidth = maxWidth;
|
|
352
319
|
}
|
|
353
|
-
|
|
354
320
|
return jsx(RcTooltip, Object.assign({}, restProps, {
|
|
355
321
|
prefixCls: prefixCls,
|
|
356
322
|
placement: followCursor ? 'top' : mapLegacyPlacement(placement),
|
package/Tooltip/interface.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { TooltipProps as RcTooltipProps } from "rc-tooltip/lib/Tooltip";
|
|
8
|
-
export
|
|
8
|
+
export type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom' | 'bottom-end' | 'bottom-start' | 'left-end' | 'left-start' | 'right-end' | 'right-start' | 'top-end' | 'top-start';
|
|
9
9
|
export interface TooltipProps extends Partial<Omit<RcTooltipProps, 'children'>> {
|
|
10
10
|
/** 提示文字 */
|
|
11
11
|
title?: React.ReactNode;
|
package/Transfer/index.d.ts
CHANGED
|
@@ -28,5 +28,5 @@ interface TransferProps {
|
|
|
28
28
|
}
|
|
29
29
|
export declare const Transfer: (props: TransferProps) => JSX.Element;
|
|
30
30
|
export default Transfer;
|
|
31
|
-
export
|
|
31
|
+
export type IItemDataProps = ItemDataProps;
|
|
32
32
|
export declare const SSortablejs: typeof import("sortablejs");
|