@para-ui/core 3.0.86 → 4.0.0-beta
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 +18 -19
- package/AutoTips/index.js +5 -4
- package/Breadcrumbs/index.js +5 -4
- package/Button/SplitButton.d.ts +13 -0
- package/Button/index.d.ts +1 -1
- package/Button/index.js +54 -12
- package/ButtonGroup/index.js +6 -5
- package/Carousel/index.d.ts +5 -5
- package/Carousel/index.js +21 -9
- package/Cascader/Cascader.d.ts +99 -0
- package/Cascader/OptionList/CacheContent.d.ts +7 -0
- package/Cascader/OptionList/Column.d.ts +21 -0
- package/Cascader/OptionList/index.d.ts +4 -0
- package/Cascader/OptionList/useActive.d.ts +6 -0
- package/Cascader/context.d.ts +23 -0
- package/Cascader/hooks/useDisplayValues.d.ts +10 -0
- package/Cascader/hooks/useEntities.d.ts +10 -0
- package/Cascader/hooks/useMissingValues.d.ts +3 -0
- package/Cascader/index.d.ts +3 -58
- package/Cascader/index.js +28 -177
- package/Cascader/utils/commonUtil.d.ts +18 -0
- package/Cascader/utils/treeUtil.d.ts +55 -0
- package/Checkbox/index.d.ts +7 -0
- package/Checkbox/index.js +50 -29
- package/CheckboxGroup/index.d.ts +3 -1
- package/CheckboxGroup/index.js +48 -18
- package/Collapse/index.js +2 -2
- package/Collapse/motion.d.ts +0 -2
- package/CollapseBox/index.js +3 -3
- package/CollapseLayout/index.d.ts +5 -0
- package/CollapseLayout/index.js +144 -22
- package/ColorPicker/chromePicker/index.d.ts +9 -0
- package/ColorPicker/compactPicker/index.d.ts +9 -0
- package/ColorPicker/config.d.ts +5 -0
- package/ColorPicker/index.d.ts +4 -1
- package/ColorPicker/index.js +7 -3
- package/ColorPicker/sketchPicker/index.d.ts +11 -0
- package/ColorPicker/swatchesPicker/index.d.ts +9 -0
- package/ComboSelect/index.js +14 -12
- package/Container/index.js +2 -2
- package/CopyText/index.d.ts +33 -0
- package/CopyText/index.js +180 -0
- package/DatePicker/generatePicker/generateRangePicker.d.ts +9 -2
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +8 -8
- package/DatePicker/generatePicker/index.d.ts +32 -26
- package/DatePicker/generatePicker/interface.d.ts +12 -0
- package/DatePicker/index.d.ts +12 -8
- package/DatePicker/index.js +367 -454
- package/DatePicker/util.d.ts +40 -4
- package/Desktop/index.d.ts +16 -3
- package/Desktop/index.js +177 -68
- package/Desktop/lang/en_US.d.ts +6 -0
- package/Desktop/lang/index.d.ts +13 -0
- package/Desktop/lang/zh_CN.d.ts +6 -0
- package/DragVerify/index.js +9 -100
- package/Drawer/index.js +8 -8
- package/Drawer/interface.d.ts +2 -2
- package/Dropdown/index.js +2 -2
- package/DynamicMultiBox/index.js +57 -41
- package/DynamicMultiBox/interface.d.ts +4 -4
- package/Empty/index.js +2 -2
- package/Form/index.d.ts +20 -26
- package/Form/index.js +48 -69
- package/FormItem/index.js +15 -15
- package/FunctionModal/index.js +11 -9
- package/GlobalContext/constant.d.ts +1 -1
- package/GlobalContext/index.js +2 -2
- package/Help/index.js +4 -3
- package/HelperText/index.js +2 -2
- package/InputLang/index.d.ts +5 -0
- package/InputLang/index.js +35 -29
- package/InputNumber/index.d.ts +5 -0
- package/InputNumber/index.js +95 -80
- package/Label/index.js +4 -3
- package/Loading/index.js +2 -2
- package/Menu/index.js +114 -39
- package/Menu/interface.d.ts +8 -0
- package/Message/index.d.ts +4 -4
- package/Message/index.js +13 -11
- package/Modal/index.js +29 -15
- package/MultiBox/index.js +9 -8
- package/Notification/index.d.ts +9 -1
- package/Notification/index.js +29 -15
- package/OperateBtn/index.js +28 -11
- package/PageHeader/index.js +270 -74
- package/PageHeader/interface.d.ts +17 -0
- package/Pagination/index.d.ts +4 -3
- package/Pagination/index.js +117 -95
- package/Pagination/lang/en_US.d.ts +3 -2
- package/Pagination/lang/index.d.ts +6 -4
- package/Pagination/lang/zh_CN.d.ts +3 -2
- package/ParauiProvider/index.js +4 -4
- package/PasswordRules/index.js +5 -5
- package/PopConfirm/index.d.ts +15 -5
- package/PopConfirm/index.js +62 -16
- package/Popover/index.js +4 -3
- package/Progress/index.js +10 -9
- package/Querying/index.js +7 -7
- package/README.md +40 -1120
- package/Radio/index.d.ts +7 -0
- package/Radio/index.js +49 -27
- package/RadioGroup/index.d.ts +3 -1
- package/RadioGroup/index.js +48 -21
- package/Search/index.d.ts +3 -15
- package/Search/index.js +21 -83
- package/Select/index.d.ts +7 -2
- package/Select/index.js +114 -91
- package/Select/lang/en_US.d.ts +1 -1
- package/Select/lang/index.d.ts +2 -2
- package/Select/lang/zh_CN.d.ts +1 -1
- package/SelectInput/index.js +8 -7
- package/Selector/index.js +30 -22
- package/SelectorPicker/index.d.ts +5 -0
- package/SelectorPicker/index.js +47 -32
- package/SelectorPicker/lang/en_US.d.ts +1 -0
- package/SelectorPicker/lang/index.d.ts +2 -0
- package/SelectorPicker/lang/zh_CN.d.ts +1 -0
- package/SingleBox/index.js +8 -7
- package/Slider/index.js +5 -5
- package/Status/index.d.ts +6 -5
- package/Status/index.js +27 -4
- package/Stepper/index.d.ts +9 -10
- package/Stepper/index.js +69 -29
- package/Styles/index.scss +4 -0
- package/Styles/scrollbar.scss +24 -24
- package/Styles/theme.scss +104 -57
- package/Switch/index.d.ts +34 -14
- package/Switch/index.js +97 -30
- package/Table/index.js +33 -27
- package/Table/interface.d.ts +3 -1
- package/Table/tableHeadInterface.d.ts +1 -1
- package/Table/tablePaginationInterface.d.ts +5 -5
- package/Tabs/index.d.ts +11 -1
- package/Tabs/index.js +49 -16
- package/Tag/TagGroup.d.ts +11 -7
- package/Tag/index.d.ts +22 -7
- package/Tag/index.js +1382 -53
- package/TextEditor/index.js +4 -3
- package/TextField/index.d.ts +5 -0
- package/TextField/index.js +50 -32
- package/TimePicker/index.d.ts +5 -0
- package/TimePicker/index.js +39 -23
- package/Timeline/TimelineItem.d.ts +1 -1
- package/Timeline/index.d.ts +5 -5
- package/Timeline/index.js +21 -18
- package/Title/index.d.ts +15 -3
- package/Title/index.js +95 -29
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -0
- package/ToggleButton/index.d.ts +4 -0
- package/ToggleButton/index.js +14 -52
- package/Tooltip/index.js +28 -34
- package/Tooltip/interface.d.ts +4 -10
- package/Tooltip/utils.d.ts +1 -3
- package/Transfer/index.d.ts +3 -3
- package/Transfer/index.js +72 -68
- package/Tree/Tree.d.ts +2 -2
- package/Tree/index.js +10 -9
- package/Tree/utils/treeUtil.d.ts +0 -7
- package/Upload/index.js +16 -14
- package/_verture/{constant-66aa48a1.js → constant-0d9802f7.js} +1 -1
- package/_verture/{defineProperty-62acccfc.js → defineProperty-1d116156.js} +1 -1
- package/_verture/index-5c77417d.js +150 -0
- package/_verture/index-68db2bc3.js +10530 -0
- package/_verture/{index-9738004e.js → index-7ec72724.js} +44 -38
- package/_verture/index-d63bd287.js +327 -0
- package/_verture/{index-fa8a0124.js → index-e6f85fd5.js} +7 -8
- package/_verture/{index-77f9e0fb.js → index-e9007d6a.js} +6 -6
- package/_verture/{intl-4a9f1b44.js → intl-5c1ec055.js} +1 -1
- package/_verture/{modalContext-20780c9a.js → modalContext-c12ca3e8.js} +3 -3
- package/_verture/slicedToArray-a8206399.js +43 -0
- package/_verture/{toConsumableArray-81040c9e.js → toConsumableArray-8f4c9589.js} +1 -1
- package/_verture/typeof-adeedc13.js +11 -0
- package/_verture/typeof-b240b062.js +16 -0
- package/_verture/{utils-c9b9a157.js → utils-f0e81540.js} +8 -8
- package/index.d.ts +2 -2
- package/index.js +32 -27
- package/locale/en-US.d.ts +10 -6
- package/locale/index.d.ts +20 -12
- package/locale/index.js +33 -25
- package/locale/zh-CN.d.ts +10 -6
- package/package.json +25 -10
- package/umd/AutoBox.js +20 -21
- package/umd/AutoTips.js +31 -4
- package/umd/Breadcrumbs.js +7 -7
- package/umd/Button.js +7 -8
- package/umd/ButtonGroup.js +7 -8
- package/umd/Carousel.js +29 -1
- package/umd/Cascader.js +20 -21
- package/umd/Checkbox.js +7 -7
- package/umd/CheckboxGroup.js +7 -7
- package/umd/Collapse.js +19 -21
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +7 -7
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +42 -0
- package/umd/DatePicker.js +7 -7
- package/umd/Desktop.js +7 -7
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +7 -8
- package/umd/Dropdown.js +3 -3
- package/umd/DynamicMultiBox.js +7 -7
- package/umd/Empty.js +1 -1
- package/umd/Form.js +6 -6
- package/umd/FormItem.js +6 -6
- package/umd/FunctionModal.js +7 -7
- package/umd/Help.js +7 -7
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +7 -7
- package/umd/InputNumber.js +7 -7
- package/umd/Label.js +7 -7
- package/umd/Loading.js +4 -5
- package/umd/Menu.js +4 -4
- package/umd/Message.js +3 -4
- package/umd/Modal.js +7 -7
- package/umd/MultiBox.js +7 -7
- package/umd/Notification.js +5 -6
- package/umd/OperateBtn.js +7 -7
- package/umd/PageHeader.js +7 -7
- package/umd/Pagination.js +7 -7
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +3 -4
- package/umd/PopConfirm.js +7 -7
- package/umd/Popover.js +31 -4
- package/umd/Progress.js +4 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +7 -7
- package/umd/RadioGroup.js +7 -7
- package/umd/Search.js +7 -7
- package/umd/Select.js +7 -7
- package/umd/SelectInput.js +7 -7
- package/umd/Selector.js +7 -7
- package/umd/SelectorPicker.js +7 -7
- package/umd/SingleBox.js +7 -7
- package/umd/Slider.js +3 -3
- package/umd/Status.js +29 -1
- package/umd/Stepper.js +20 -20
- package/umd/Switch.js +7 -7
- package/umd/Table.js +7 -7
- package/umd/Tabs.js +7 -7
- package/umd/Tag.js +7 -8
- package/umd/TextEditor.js +19 -19
- package/umd/TextField.js +7 -7
- package/umd/TimePicker.js +7 -7
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +42 -1
- package/umd/ToggleButton.js +7 -8
- package/umd/Tooltip.js +31 -4
- package/umd/Transfer.js +8 -8
- package/umd/Tree.js +7 -7
- package/umd/Upload.js +8 -8
- package/umd/locale.js +1 -1
- package/Cascader/lang/en_US.d.ts +0 -4
- package/Cascader/lang/index.d.ts +0 -9
- package/Cascader/lang/zh_CN.d.ts +0 -4
- package/Split/index.d.ts +0 -7
- package/Split/index.js +0 -123
- package/_verture/index-a369ca3f.js +0 -4
- package/_verture/index-beef914f.js +0 -340
- package/_verture/slicedToArray-76060636.js +0 -43
- package/_verture/typeof-498dd2b1.js +0 -11
- package/umd/Split.js +0 -1
package/Title/index.d.ts
CHANGED
|
@@ -3,11 +3,23 @@
|
|
|
3
3
|
* @date 2022/8/11 2:54 PM
|
|
4
4
|
* @description 标题
|
|
5
5
|
*/
|
|
6
|
-
import React, { FC, ReactNode } from
|
|
7
|
-
import
|
|
6
|
+
import React, { FC, ReactNode } from "react";
|
|
7
|
+
import "./index.scss";
|
|
8
8
|
export interface TitleProps {
|
|
9
9
|
/** 标题 **/
|
|
10
10
|
title: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* 标题帮住提示
|
|
13
|
+
*/
|
|
14
|
+
titleTooltip?: ReactNode;
|
|
15
|
+
/** 帮组提示方向 */
|
|
16
|
+
placement?: "bottom-end" | "bottom-start" | "bottom" | "left-end" | "left-start" | "left" | "right-end" | "right-start" | "right" | "top-end" | "top-start" | "top";
|
|
17
|
+
/** 提示箭头 */
|
|
18
|
+
arrow?: boolean;
|
|
19
|
+
/** 提示信息icon */
|
|
20
|
+
titoleTooltipIcon?: ReactNode;
|
|
21
|
+
/** 折叠内容 */
|
|
22
|
+
collapseContent?: ReactNode;
|
|
11
23
|
/** 副标题 **/
|
|
12
24
|
subTitle?: ReactNode;
|
|
13
25
|
/** 图标 **/
|
|
@@ -20,7 +32,7 @@ export interface TitleProps {
|
|
|
20
32
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
21
33
|
};
|
|
22
34
|
/** 尺寸,仅在 icon 存在时有效 **/
|
|
23
|
-
size?:
|
|
35
|
+
size?: "small" | "medium" | "large";
|
|
24
36
|
/** cls */
|
|
25
37
|
className?: string;
|
|
26
38
|
/** style */
|
package/Title/index.js
CHANGED
|
@@ -1,49 +1,115 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useState, useEffect } from 'react';
|
|
2
4
|
import clsx from 'clsx';
|
|
3
|
-
import
|
|
5
|
+
import AutoTips from '../AutoTips/index.js';
|
|
6
|
+
import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
|
|
7
|
+
import Help from '../Help/index.js';
|
|
8
|
+
import { Collapse } from '../Collapse/index.js';
|
|
4
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
|
+
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
11
|
+
import '../Tooltip/index.js';
|
|
12
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
13
|
+
import 'rc-tooltip';
|
|
14
|
+
import 'rc-tooltip/lib/placements';
|
|
15
|
+
import '@para-ui/icons/Forbid';
|
|
16
|
+
import '@paraview/lib';
|
|
17
|
+
import '@para-ui/icons/Help';
|
|
18
|
+
import 'rc-collapse';
|
|
19
|
+
import '@para-ui/icons/Right';
|
|
5
20
|
|
|
6
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/8/11 2:55 PM\n* @description 标题\n*/\n/**\n* @author
|
|
21
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/8/11 2:55 PM\n* @description 标题\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-title-collapse {\n border-bottom: none;\n}\n.paraui-v4-title-collapse > .component-collapse-item {\n border-top: none;\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-header {\n flex-direction: row-reverse;\n justify-content: space-between;\n padding: 0;\n padding-right: 16px;\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-header .paraui-v4-title-content {\n max-width: calc(100% - 32px);\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-header .collapse-svg-box {\n color: rgb(29, 33, 38);\n margin-right: 0;\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-header:hover {\n position: relative;\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-header:hover > div {\n z-index: 1;\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-header:hover > .collapse-svg-box:hover {\n background-color: rgb(234, 236, 241);\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-header:hover .title-link:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-header:hover::after {\n position: absolute;\n background-color: rgb(247, 248, 250);\n content: \"\";\n width: 100%;\n height: calc(100% + 4px);\n left: -10px;\n border-radius: 4px;\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-content {\n margin-top: 20px;\n}\n.paraui-v4-title-collapse > .component-collapse-item > .component-collapse-content > .component-collapse-content-box {\n padding-left: 20px;\n}\n\n.paraui-v4-title .paraui-v4-title-content {\n display: flex;\n align-items: center;\n line-height: 20px;\n}\n.paraui-v4-title .paraui-v4-title-content .title-ink {\n width: 4px;\n height: 14px;\n background-color: rgb(46, 101, 230);\n border-radius: 2px;\n}\n.paraui-v4-title .paraui-v4-title-content .title-icon {\n display: inline-flex;\n}\n.paraui-v4-title .paraui-v4-title-content .title-text {\n margin-left: 8px;\n font-size: 14px;\n font-weight: 700;\n color: rgb(29, 33, 38);\n display: flex;\n align-items: center;\n white-space: nowrap;\n}\n.paraui-v4-title .paraui-v4-title-content .title-text .paraui-v4-help {\n line-height: 11px;\n font-size: 14px;\n margin-left: 4px;\n}\n.paraui-v4-title .paraui-v4-title-content .title-subtext {\n margin-left: 10px;\n font-size: 14px;\n font-weight: 400;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-title .paraui-v4-title-content .title-link {\n margin-left: 10px;\n text-decoration: none;\n outline: none;\n font-size: 14px;\n font-weight: 400;\n white-space: nowrap;\n color: rgb(46, 101, 230);\n}\n.paraui-v4-title .paraui-v4-title-content.paraui-v4-title-content-large .title-icon svg {\n font-size: 30px;\n}\n.paraui-v4-title .paraui-v4-title-content.paraui-v4-title-content-large .title-text {\n font-size: 18px;\n}\n.paraui-v4-title .paraui-v4-title-content.paraui-v4-title-content-medium .title-icon svg {\n font-size: 24px;\n}\n.paraui-v4-title .paraui-v4-title-content.paraui-v4-title-content-medium .title-text {\n font-size: 500;\n}\n.paraui-v4-title .paraui-v4-title-content.paraui-v4-title-content-small .title-icon svg {\n font-size: 20px;\n}\n.paraui-v4-title .paraui-v4-title-content.paraui-v4-title-content-small .title-text {\n margin-left: 4px;\n}";
|
|
7
22
|
styleInject(css_248z);
|
|
8
23
|
|
|
24
|
+
var Panel = Collapse.Panel;
|
|
25
|
+
var MARGIN_WIDTH = 20 + 12;
|
|
9
26
|
//标题
|
|
10
27
|
var Title = function Title(props) {
|
|
11
28
|
var title = props.title,
|
|
12
29
|
subTitle = props.subTitle,
|
|
30
|
+
collapseContent = props.collapseContent,
|
|
13
31
|
icon = props.icon,
|
|
14
32
|
link = props.link,
|
|
15
33
|
_props$size = props.size,
|
|
16
|
-
size = _props$size === void 0 ?
|
|
34
|
+
size = _props$size === void 0 ? "medium" : _props$size,
|
|
17
35
|
className = props.className,
|
|
36
|
+
titleTooltip = props.titleTooltip,
|
|
37
|
+
titoleTooltipIcon = props.titoleTooltipIcon,
|
|
38
|
+
placement = props.placement,
|
|
39
|
+
arrow = props.arrow,
|
|
18
40
|
style = props.style;
|
|
41
|
+
var titleTextRef = useRef(null);
|
|
42
|
+
var linkTextRef = useRef(null);
|
|
43
|
+
var _useState = useState("calc(100% - 20px)"),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
descWith = _useState2[0],
|
|
46
|
+
setDescWith = _useState2[1];
|
|
19
47
|
//cls
|
|
20
|
-
var makeCls = clsx("".concat($prefixCls, "-title"), className, icon && "".concat($prefixCls, "-title-").concat(size));
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
var makeCls = clsx("".concat($prefixCls, "-title-content"), className, icon && "".concat($prefixCls, "-title-content-").concat(size));
|
|
49
|
+
var calcDescWidth = function calcDescWidth(titleWidth, linkWidth) {
|
|
50
|
+
var width = titleWidth + linkWidth + MARGIN_WIDTH;
|
|
51
|
+
setDescWith("calc(100% - ".concat(width, "px)"));
|
|
52
|
+
};
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
var titleWidth = ((_a = titleTextRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
|
|
56
|
+
var linkWidth = ((_b = linkTextRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth) || 0;
|
|
57
|
+
calcDescWidth(titleWidth, linkWidth);
|
|
58
|
+
}, [title, subTitle, link, collapseContent]);
|
|
59
|
+
var titleContent = function titleContent() {
|
|
60
|
+
return jsxs("div", Object.assign({
|
|
61
|
+
className: makeCls,
|
|
62
|
+
style: style
|
|
33
63
|
}, {
|
|
34
|
-
children:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
64
|
+
children: [icon ? jsx("span", Object.assign({
|
|
65
|
+
className: "title-icon"
|
|
66
|
+
}, {
|
|
67
|
+
children: icon
|
|
68
|
+
})) : jsx("span", {
|
|
69
|
+
className: "title-ink"
|
|
70
|
+
}), jsxs("span", Object.assign({
|
|
71
|
+
className: "title-text",
|
|
72
|
+
ref: titleTextRef
|
|
73
|
+
}, {
|
|
74
|
+
children: [title, titleTooltip && jsx(Help, Object.assign({
|
|
75
|
+
title: titleTooltip,
|
|
76
|
+
placement: placement,
|
|
77
|
+
arrow: arrow
|
|
78
|
+
}, {
|
|
79
|
+
children: titoleTooltipIcon
|
|
80
|
+
}))]
|
|
81
|
+
})), subTitle && jsx("span", Object.assign({
|
|
82
|
+
className: "title-subtext",
|
|
83
|
+
style: {
|
|
84
|
+
maxWidth: descWith
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
children: jsx(AutoTips, {
|
|
88
|
+
children: subTitle
|
|
89
|
+
})
|
|
90
|
+
})), link && jsx("a", Object.assign({
|
|
91
|
+
className: "title-link",
|
|
92
|
+
target: link.target || "_blank",
|
|
93
|
+
href: link.href,
|
|
94
|
+
onClick: link.onClick,
|
|
95
|
+
ref: linkTextRef
|
|
96
|
+
}, {
|
|
97
|
+
children: link.text
|
|
98
|
+
}))]
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
return jsx("div", Object.assign({
|
|
102
|
+
className: "".concat($prefixCls, "-title")
|
|
103
|
+
}, {
|
|
104
|
+
children: collapseContent ? jsx(Collapse, Object.assign({
|
|
105
|
+
className: "".concat($prefixCls, "-title-collapse")
|
|
44
106
|
}, {
|
|
45
|
-
children:
|
|
46
|
-
|
|
107
|
+
children: jsx(Panel, Object.assign({
|
|
108
|
+
header: titleContent()
|
|
109
|
+
}, {
|
|
110
|
+
children: collapseContent
|
|
111
|
+
}), "1")
|
|
112
|
+
})) : titleContent()
|
|
47
113
|
}));
|
|
48
114
|
};
|
|
49
115
|
|
package/ToggleButton/index.d.ts
CHANGED
package/ToggleButton/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-
|
|
1
|
+
import { _ as _defineProperty } from '../_verture/defineProperty-1d116156.js';
|
|
2
2
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useRef } from 'react';
|
|
5
5
|
import { Button } from '../Button/index.js';
|
|
6
6
|
import { UUID } from '@paraview/lib';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
8
|
+
import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
|
|
9
9
|
import AutoTips from '../AutoTips/index.js';
|
|
10
10
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
11
|
-
import '../_verture/typeof-
|
|
12
|
-
import '../_verture/slicedToArray-
|
|
11
|
+
import '../_verture/typeof-adeedc13.js';
|
|
12
|
+
import '../_verture/slicedToArray-a8206399.js';
|
|
13
13
|
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
14
14
|
import '@para-ui/icons/LoadingF';
|
|
15
15
|
import '@para-ui/icons/Forbid';
|
|
@@ -17,14 +17,14 @@ import '../Tooltip/index.js';
|
|
|
17
17
|
import 'rc-tooltip';
|
|
18
18
|
import 'rc-tooltip/lib/placements';
|
|
19
19
|
import '@para-ui/icons/Down';
|
|
20
|
-
import '../_verture/index-
|
|
20
|
+
import '../_verture/index-e9007d6a.js';
|
|
21
21
|
import 'rc-dropdown';
|
|
22
22
|
import '../_verture/usePopupContainer-87febeb9.js';
|
|
23
23
|
import 'dayjs';
|
|
24
24
|
import '../_verture/useFormatMessage-703f8b20.js';
|
|
25
25
|
import '@para-ui/core/GlobalContext';
|
|
26
26
|
|
|
27
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/23 上午9:50\n* @description\n*/\n/**\n* @author
|
|
27
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/23 上午9:50\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-toggle-button.paraui-v4-button-text {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button.paraui-v4-button-text:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-toggle-button.paraui-v4-button-text:hover[disabled] {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button-wrap {\n display: inline-block;\n}\n.paraui-v4-toggle-button .toggle-button-text {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-selected {\n border-color: rgb(46, 101, 230);\n color: rgb(46, 101, 230);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-selected:hover {\n border-color: rgb(46, 101, 230);\n color: rgb(46, 101, 230);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-selected[disabled] {\n color: rgb(29, 33, 38);\n background-color: rgb(247, 248, 250);\n border: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-selected[disabled]:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-selected[disabled]::before {\n border-color: rgb(29, 33, 38);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-selected::before {\n content: \" \";\n position: absolute;\n bottom: 0;\n right: 0;\n border: 8px solid rgb(46, 101, 230);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button.paraui-v4-toggle-button-selected::after {\n content: \" \";\n position: absolute;\n bottom: 2px;\n right: 2px;\n width: 3px;\n height: 6px;\n border: 2px solid rgb(255, 255, 255);\n border-top: 0;\n border-left: 0;\n border-radius: 2px;\n transform: rotate(45deg);\n}\n.paraui-v4-toggle-button-disabled.paraui-v4-toggle-button {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button-disabled.paraui-v4-toggle-button:hover {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-toggle-button .toggle-button-badge {\n position: absolute;\n right: 0;\n bottom: 16px;\n}\n.paraui-v4-toggle-button .toggle-button-badge > div {\n position: absolute;\n top: 0;\n right: 0;\n border: 8px solid rgb(46, 101, 230);\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.paraui-v4-toggle-button .toggle-button-badge > svg {\n position: absolute;\n top: 7px;\n right: 1px;\n color: #fff;\n font-weight: 600;\n width: 8px;\n height: 8px;\n}\n\n.paraui-v4-togglebutton-group {\n display: flex;\n flex-flow: row wrap;\n}\n.paraui-v4-togglebutton-group .paraui-v4-toggle-button {\n margin: 0 10px;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button {\n margin: 0;\n padding: 0 16px;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button[disabled] {\n color: rgb(29, 33, 38);\n background-color: transparent;\n border: 0;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button ~ .paraui-v4-toggle-button::before {\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n content: \"\";\n width: 1px;\n height: 14px;\n background-color: rgb(212, 218, 227);\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected {\n color: rgb(46, 101, 230);\n border: 0;\n font-weight: 700;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected[disabled] {\n color: rgb(29, 33, 38);\n background-color: transparent;\n border: 0;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected[disabled]:hover {\n background-color: transparent;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected:first-child:before {\n display: none;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected:not(:first-child)::before {\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n content: \"\";\n width: 1px;\n height: 14px;\n background-color: rgb(212, 218, 227);\n border: 0;\n}\n.paraui-v4-togglebutton-group-text .paraui-v4-toggle-button-selected::after {\n display: none;\n}";
|
|
28
28
|
styleInject(css_248z);
|
|
29
29
|
|
|
30
30
|
//切换按钮组
|
|
@@ -47,6 +47,9 @@ var ToggleButtonGroup = function ToggleButtonGroup(props) {
|
|
|
47
47
|
//多选
|
|
48
48
|
var handleChange = function handleChange(evt, buttonValue) {
|
|
49
49
|
if (!onChange) return;
|
|
50
|
+
if (!Array.isArray(value)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
50
53
|
var index = value && (value === null || value === void 0 ? void 0 : value.indexOf(buttonValue));
|
|
51
54
|
var newValue;
|
|
52
55
|
if (value && index >= 0) {
|
|
@@ -109,14 +112,14 @@ var ToggleButton = function ToggleButton(props) {
|
|
|
109
112
|
children = props.children,
|
|
110
113
|
_props$disabled = props.disabled,
|
|
111
114
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
115
|
+
toolTipTitle = props.toolTipTitle,
|
|
112
116
|
_props$selected = props.selected,
|
|
113
117
|
selected = _props$selected === void 0 ? false : _props$selected,
|
|
114
118
|
value = props.value;
|
|
115
119
|
props.autoToolTipOverflow;
|
|
116
|
-
var
|
|
117
|
-
width = _props$width === void 0 ? 120 : _props$width,
|
|
120
|
+
var width = props.width,
|
|
118
121
|
onClick = props.onClick,
|
|
119
|
-
restProps = __rest(props, ["className", "style", "children", "disabled", "selected", "value", "autoToolTipOverflow", "width", "onClick"]);
|
|
122
|
+
restProps = __rest(props, ["className", "style", "children", "disabled", "toolTipTitle", "selected", "value", "autoToolTipOverflow", "width", "onClick"]);
|
|
120
123
|
// const [hasTip, setHasTip] = useState<boolean>(false);
|
|
121
124
|
var id = useRef(UUID()).current;
|
|
122
125
|
var prefixCls = "".concat($prefixCls, "-toggle-button");
|
|
@@ -126,57 +129,16 @@ var ToggleButton = function ToggleButton(props) {
|
|
|
126
129
|
var handleClick = function handleClick(evt) {
|
|
127
130
|
if (onClick) onClick(evt, value);
|
|
128
131
|
};
|
|
129
|
-
// useLayoutEffect(() => {
|
|
130
|
-
// if (!autoToolTipOverflow) return;
|
|
131
|
-
// let btn: HTMLButtonElement | null = document.querySelector(`[data-id="${id}"]`);
|
|
132
|
-
// if (!btn) return;
|
|
133
|
-
// let span: any = document.createElement('span');
|
|
134
|
-
// span.textContent = children;
|
|
135
|
-
// document.body.appendChild(span);
|
|
136
|
-
// if (span.offsetWidth > (btn.offsetWidth - 16 * 2)) {
|
|
137
|
-
// setHasTip(true);
|
|
138
|
-
// }
|
|
139
|
-
// span?.remove();
|
|
140
|
-
// }, []);
|
|
141
|
-
//渲染
|
|
142
|
-
// const renderToggleButton = () => {
|
|
143
|
-
// let btn = (
|
|
144
|
-
// <Button
|
|
145
|
-
// data-id={id}
|
|
146
|
-
// variant={'outlined'}
|
|
147
|
-
// size={'medium'}
|
|
148
|
-
// {...restProps}
|
|
149
|
-
// style={{ width, ...style }}
|
|
150
|
-
// className={makeCls}
|
|
151
|
-
// disabled={disabled}
|
|
152
|
-
// value={value}
|
|
153
|
-
// onClick={handleClick}>
|
|
154
|
-
// <span className={'toggle-button-text'}>
|
|
155
|
-
// {children}
|
|
156
|
-
// </span>
|
|
157
|
-
// </Button>
|
|
158
|
-
// );
|
|
159
|
-
// if (hasTip) {
|
|
160
|
-
// return (
|
|
161
|
-
// <Tooltip title={children as string}>
|
|
162
|
-
// <span className={`${prefixCls}-wrap`}>
|
|
163
|
-
// {btn}
|
|
164
|
-
// </span>
|
|
165
|
-
// </Tooltip>
|
|
166
|
-
// );
|
|
167
|
-
// }
|
|
168
|
-
// return btn;
|
|
169
|
-
// };
|
|
170
132
|
return jsx(Button, Object.assign({
|
|
171
133
|
"data-id": id,
|
|
172
|
-
variant: 'outlined'
|
|
173
|
-
size: 'medium'
|
|
134
|
+
variant: 'outlined'
|
|
174
135
|
}, restProps, {
|
|
175
136
|
style: Object.assign({
|
|
176
137
|
width: width
|
|
177
138
|
}, style),
|
|
178
139
|
className: makeCls,
|
|
179
140
|
disabled: disabled,
|
|
141
|
+
toolTipTitle: toolTipTitle,
|
|
180
142
|
value: value,
|
|
181
143
|
onClick: handleClick
|
|
182
144
|
}, {
|
package/Tooltip/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
2
2
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { jsx, jsxs, Fragment } 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-0d9802f7.js';
|
|
9
|
+
import Forbid from '@para-ui/icons/Forbid';
|
|
9
10
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
11
|
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
11
12
|
|
|
@@ -19,7 +20,6 @@ var autoAdjustOverflowDisabled = {
|
|
|
19
20
|
adjustX: 0,
|
|
20
21
|
adjustY: 0
|
|
21
22
|
};
|
|
22
|
-
var targetOffset = [0, 0];
|
|
23
23
|
//获得调整位置选项
|
|
24
24
|
function getOverflowOptions(autoAdjustOverflow) {
|
|
25
25
|
if (typeof autoAdjustOverflow === 'boolean') {
|
|
@@ -29,14 +29,11 @@ function getOverflowOptions(autoAdjustOverflow) {
|
|
|
29
29
|
}
|
|
30
30
|
//tooltip placement
|
|
31
31
|
function getPlacements(config) {
|
|
32
|
-
var _config$
|
|
33
|
-
arrowWidth = _config$arrowWidth === void 0 ? 4 : _config$arrowWidth,
|
|
34
|
-
_config$horizontalArr = config.horizontalArrowShift,
|
|
32
|
+
var _config$horizontalArr = config.horizontalArrowShift,
|
|
35
33
|
horizontalArrowShift = _config$horizontalArr === void 0 ? 16 : _config$horizontalArr,
|
|
36
34
|
_config$verticalArrow = config.verticalArrowShift,
|
|
37
35
|
verticalArrowShift = _config$verticalArrow === void 0 ? 8 : _config$verticalArrow,
|
|
38
|
-
autoAdjustOverflow = config.autoAdjustOverflow
|
|
39
|
-
arrowPointAtCenter = config.arrowPointAtCenter;
|
|
36
|
+
autoAdjustOverflow = config.autoAdjustOverflow;
|
|
40
37
|
var placementMap = {
|
|
41
38
|
left: {
|
|
42
39
|
points: ['cr', 'cl'],
|
|
@@ -56,42 +53,39 @@ function getPlacements(config) {
|
|
|
56
53
|
},
|
|
57
54
|
topLeft: {
|
|
58
55
|
points: ['bl', 'tc'],
|
|
59
|
-
offset: [-
|
|
56
|
+
offset: [-horizontalArrowShift, -8]
|
|
60
57
|
},
|
|
61
58
|
leftTop: {
|
|
62
59
|
points: ['tr', 'cl'],
|
|
63
|
-
offset: [-8, -
|
|
60
|
+
offset: [-8, -verticalArrowShift]
|
|
64
61
|
},
|
|
65
62
|
topRight: {
|
|
66
63
|
points: ['br', 'tc'],
|
|
67
|
-
offset: [horizontalArrowShift
|
|
64
|
+
offset: [horizontalArrowShift, -8]
|
|
68
65
|
},
|
|
69
66
|
rightTop: {
|
|
70
67
|
points: ['tl', 'cr'],
|
|
71
|
-
offset: [8, -
|
|
68
|
+
offset: [8, -verticalArrowShift]
|
|
72
69
|
},
|
|
73
70
|
bottomRight: {
|
|
74
71
|
points: ['tr', 'bc'],
|
|
75
|
-
offset: [horizontalArrowShift
|
|
72
|
+
offset: [horizontalArrowShift, 8]
|
|
76
73
|
},
|
|
77
74
|
rightBottom: {
|
|
78
75
|
points: ['bl', 'cr'],
|
|
79
|
-
offset: [8, verticalArrowShift
|
|
76
|
+
offset: [8, verticalArrowShift]
|
|
80
77
|
},
|
|
81
78
|
bottomLeft: {
|
|
82
79
|
points: ['tl', 'bc'],
|
|
83
|
-
offset: [-
|
|
80
|
+
offset: [-horizontalArrowShift, 8]
|
|
84
81
|
},
|
|
85
82
|
leftBottom: {
|
|
86
83
|
points: ['br', 'cl'],
|
|
87
|
-
offset: [-8, verticalArrowShift
|
|
84
|
+
offset: [-8, verticalArrowShift]
|
|
88
85
|
}
|
|
89
86
|
};
|
|
90
87
|
Object.keys(placementMap).forEach(function (key) {
|
|
91
|
-
placementMap[key] =
|
|
92
|
-
overflow: getOverflowOptions(autoAdjustOverflow),
|
|
93
|
-
targetOffset: targetOffset
|
|
94
|
-
}) : Object.assign(Object.assign({}, placements[key]), {
|
|
88
|
+
placementMap[key] = Object.assign(Object.assign({}, placements[key]), {
|
|
95
89
|
offset: getAlignOffset(key).offset,
|
|
96
90
|
overflow: getOverflowOptions(autoAdjustOverflow)
|
|
97
91
|
});
|
|
@@ -202,7 +196,7 @@ function getAlignOffset(place) {
|
|
|
202
196
|
return offsetMap[mPlace];
|
|
203
197
|
}
|
|
204
198
|
|
|
205
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/5/25 下午7:17\n* @description\n*/\n/**\n* @author
|
|
199
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/5/25 下午7:17\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-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-v4-tooltip .component-tooltip-content {\n position: relative;\n}\n.paraui-v4-tooltip.component-tooltip-hidden {\n display: none;\n}\n.paraui-v4-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-break: break-all;\n background-color: rgba(29, 33, 38, 0.9);\n border-radius: 4px;\n line-height: 21px;\n}\n.paraui-v4-tooltip .component-tooltip-inner .disabled-svg {\n font-size: 12px;\n position: relative;\n top: 1px;\n margin-right: 4px;\n color: rgb(255, 255, 255);\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}";
|
|
206
200
|
styleInject(css_248z);
|
|
207
201
|
|
|
208
202
|
//tooltip
|
|
@@ -242,10 +236,8 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
242
236
|
//tooltip 弹出位置
|
|
243
237
|
var getTooltipPlacements = function getTooltipPlacements() {
|
|
244
238
|
var builtinPlacements = props.builtinPlacements,
|
|
245
|
-
arrowPointAtCenter = props.arrowPointAtCenter,
|
|
246
239
|
autoAdjustOverflow = props.autoAdjustOverflow;
|
|
247
240
|
return builtinPlacements || getPlacements({
|
|
248
|
-
arrowPointAtCenter: arrowPointAtCenter,
|
|
249
241
|
autoAdjustOverflow: autoAdjustOverflow
|
|
250
242
|
});
|
|
251
243
|
};
|
|
@@ -306,14 +298,15 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
306
298
|
isPopover = props.isPopover,
|
|
307
299
|
followCursor = props.followCursor,
|
|
308
300
|
maxWidth = props.maxWidth,
|
|
309
|
-
|
|
301
|
+
disabled = props.disabled,
|
|
302
|
+
restProps = __rest(props, ["prefixCls", "getPopupContainer", "overlayClassName", "overlayInnerStyle", "overlayStyle", "children", "title", "placement", "isPopover", "followCursor", "maxWidth", "disabled"]);
|
|
310
303
|
var tempVisible = visible;
|
|
311
304
|
if (!('visible' in props || 'open' in props) && isUntitled()) {
|
|
312
305
|
//没有title必然不可见
|
|
313
306
|
tempVisible = false;
|
|
314
307
|
}
|
|
315
308
|
//overlayCls
|
|
316
|
-
var overlayCls = clsx(!isPopover && "".concat($prefixCls, "-tooltip"), overlayClassName
|
|
309
|
+
var overlayCls = clsx(!isPopover && "".concat($prefixCls, "-tooltip"), overlayClassName);
|
|
317
310
|
var mergeOverlayStyle = Object.assign({}, overlayStyle);
|
|
318
311
|
if (maxWidth) {
|
|
319
312
|
mergeOverlayStyle.maxWidth = maxWidth;
|
|
@@ -325,7 +318,11 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
325
318
|
getTooltipContainer: getPopupContainer,
|
|
326
319
|
ref: ref || tRef,
|
|
327
320
|
builtinPlacements: getTooltipPlacements(),
|
|
328
|
-
overlay:
|
|
321
|
+
overlay: jsxs(Fragment, {
|
|
322
|
+
children: [disabled && jsx(Forbid, {
|
|
323
|
+
className: 'disabled-svg'
|
|
324
|
+
}), title]
|
|
325
|
+
}),
|
|
329
326
|
visible: tempVisible,
|
|
330
327
|
align: {
|
|
331
328
|
targetOffset: targetOffset
|
|
@@ -334,9 +331,7 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
334
331
|
onPopupAlign: onPopupAlign,
|
|
335
332
|
overlayStyle: mergeOverlayStyle,
|
|
336
333
|
overlayInnerStyle: overlayInnerStyle,
|
|
337
|
-
arrowContent:
|
|
338
|
-
className: "".concat($rcPrefixCls, "-tooltip-arrow-content")
|
|
339
|
-
}) : null,
|
|
334
|
+
arrowContent: null,
|
|
340
335
|
motion: {
|
|
341
336
|
motionName: "".concat($rcPrefixCls, "-tooltip-zoom-big-fast"),
|
|
342
337
|
motionDeadline: 1000
|
|
@@ -355,14 +350,13 @@ var Tooltip = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
355
350
|
});
|
|
356
351
|
Tooltip.displayName = 'Tooltip';
|
|
357
352
|
Tooltip.defaultProps = {
|
|
358
|
-
placement: '
|
|
353
|
+
placement: 'topLeft',
|
|
359
354
|
mouseEnterDelay: 0.1,
|
|
360
355
|
mouseLeaveDelay: 0.1,
|
|
361
|
-
arrowPointAtCenter: false,
|
|
362
356
|
autoAdjustOverflow: true,
|
|
363
|
-
arrow: false,
|
|
364
357
|
defaultVisible: false,
|
|
365
|
-
followCursor: false
|
|
358
|
+
followCursor: false,
|
|
359
|
+
maxWidth: 500
|
|
366
360
|
};
|
|
367
361
|
|
|
368
362
|
export { Tooltip, Tooltip as default };
|
package/Tooltip/interface.d.ts
CHANGED
|
@@ -3,33 +3,27 @@
|
|
|
3
3
|
* @date 2022/5/25 下午7:16
|
|
4
4
|
* @description
|
|
5
5
|
*/
|
|
6
|
-
import React from
|
|
7
|
-
import { TooltipProps as RcTooltipProps } from
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { TooltipProps as RcTooltipProps } from 'rc-tooltip/lib/Tooltip';
|
|
8
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;
|
|
12
|
-
/** style */
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
/** cls */
|
|
15
|
-
className?: string;
|
|
16
12
|
/** 位置 */
|
|
17
13
|
placement?: TooltipPlacement;
|
|
18
|
-
/** 箭头是否指向目标元素中心 */
|
|
19
|
-
arrowPointAtCenter?: boolean;
|
|
20
14
|
/** 被遮挡时自动调整位置 */
|
|
21
15
|
autoAdjustOverflow?: boolean;
|
|
22
16
|
/** 渲染容器 */
|
|
23
17
|
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
24
18
|
/** 子节点 */
|
|
25
19
|
children?: React.ReactNode;
|
|
26
|
-
/** 是否显示箭头 */
|
|
27
|
-
arrow?: boolean;
|
|
28
20
|
/** 控制浮层是否显示 */
|
|
29
21
|
open?: boolean;
|
|
30
22
|
/** 跟随光标移动 */
|
|
31
23
|
followCursor?: boolean;
|
|
32
24
|
/** 容器最大宽度 */
|
|
33
25
|
maxWidth?: number | string;
|
|
26
|
+
/** 禁用标志 */
|
|
27
|
+
disabled?: boolean;
|
|
34
28
|
[name: string]: any;
|
|
35
29
|
}
|
package/Tooltip/utils.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { BuildInPlacements } from 'rc-trigger';
|
|
2
|
-
import React from
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { TooltipPlacement } from './interface';
|
|
4
4
|
interface AdjustOverflow {
|
|
5
5
|
adjustX?: 0 | 1;
|
|
6
6
|
adjustY?: 0 | 1;
|
|
7
7
|
}
|
|
8
8
|
interface PlacementsConfig {
|
|
9
|
-
arrowWidth?: number;
|
|
10
9
|
horizontalArrowShift?: number;
|
|
11
10
|
verticalArrowShift?: number;
|
|
12
|
-
arrowPointAtCenter?: boolean;
|
|
13
11
|
autoAdjustOverflow?: boolean | AdjustOverflow;
|
|
14
12
|
}
|
|
15
13
|
export default function getPlacements(config: PlacementsConfig): BuildInPlacements;
|
package/Transfer/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="sortablejs" />
|
|
2
|
-
import { CSSProperties, ReactNode } from
|
|
3
|
-
import { ItemDataProps } from
|
|
4
|
-
import
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import { ItemDataProps } from './box';
|
|
4
|
+
import './style/index.scss';
|
|
5
5
|
/**
|
|
6
6
|
* @description: 穿梭框
|
|
7
7
|
* @param className{string} 类名
|