@para-ui/core 2.2.4 → 2.2.5-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.d.ts +12 -6
- package/AutoBox/index.js +203 -15
- package/AutoTips/index.d.ts +12 -6
- package/AutoTips/index.js +84 -15
- package/Breadcrumbs/index.d.ts +13 -7
- package/Breadcrumbs/index.js +227 -15
- package/Button/index.d.ts +92 -11
- package/Button/index.js +348 -14
- package/ButtonGroup/index.d.ts +21 -9
- package/ButtonGroup/index.js +128 -14
- package/Carousel/index.d.ts +17 -11
- package/Carousel/index.js +74 -15
- package/Cascader/index.d.ts +12 -7
- package/Cascader/index.js +166 -15
- package/Checkbox/index.d.ts +13 -7
- package/Checkbox/index.js +105 -14
- package/CheckboxGroup/index.d.ts +15 -9
- package/CheckboxGroup/index.js +138 -14
- package/Collapse/index.d.ts +49 -14
- package/Collapse/index.js +171 -15
- package/CollapseBox/index.d.ts +11 -5
- package/CollapseBox/index.js +164 -15
- package/ColorPicker/index.d.ts +4 -4
- package/ColorPicker/index.js +4 -1
- package/ComboSelect/index.d.ts +306 -6
- package/ComboSelect/index.js +1803 -14
- package/Container/index.d.ts +13 -8
- package/Container/index.js +239 -15
- package/DatePicker/index.d.ts +30 -17
- package/DatePicker/index.js +733 -14
- package/Desktop/index.d.ts +14 -6
- package/Desktop/index.js +853 -14
- package/Drawer/index.d.ts +92 -6
- package/Drawer/index.js +186 -14
- package/Dropdown/index.d.ts +29 -0
- package/Dropdown/index.js +67 -0
- package/Empty/index.d.ts +16 -10
- package/Empty/index.js +644 -14
- package/Form/index.d.ts +11 -9
- package/Form/index.js +384 -14
- package/FormItem/index.d.ts +5 -152
- package/FormItem/index.js +81 -14
- package/FunctionModal/index.d.ts +14 -3
- package/FunctionModal/index.js +39 -14
- package/GlobalContext/index.d.ts +38 -8
- package/GlobalContext/index.js +41 -16
- package/Help/index.d.ts +16 -10
- package/Help/index.js +39 -15
- package/HelperText/index.d.ts +11 -5
- package/HelperText/index.js +29 -15
- package/InputLang/index.d.ts +13 -7
- package/InputLang/index.js +270 -14
- package/InputNumber/index.d.ts +16 -10
- package/InputNumber/index.js +308 -14
- package/Label/index.d.ts +12 -6
- package/Label/index.js +81 -14
- package/Loading/index.d.ts +12 -6
- package/Loading/index.js +47 -15
- package/Menu/index.d.ts +123 -5
- package/Menu/index.js +1232 -14
- package/Message/index.d.ts +11 -5
- package/Message/index.js +222 -15
- package/Modal/index.d.ts +142 -40
- package/Modal/index.js +443 -14
- package/MultiBox/index.d.ts +13 -7
- package/MultiBox/index.js +231 -14
- package/Notification/index.d.ts +22 -16
- package/Notification/index.js +266 -15
- package/OperateBtn/index.d.ts +16 -10
- package/OperateBtn/index.js +260 -14
- package/PageHeader/index.d.ts +178 -5
- package/PageHeader/index.js +1171 -14
- package/Pagination/index.d.ts +12 -6
- package/Pagination/index.js +469 -14
- package/ParauiProvider/index.d.ts +9 -8
- package/ParauiProvider/index.js +53 -15
- package/PopConfirm/index.d.ts +23 -10
- package/PopConfirm/index.js +189 -14
- package/Popover/index.d.ts +18 -11
- package/Popover/index.js +66 -15
- package/Progress/index.d.ts +18 -12
- package/Progress/index.js +358 -20
- package/Querying/index.d.ts +15 -9
- package/Querying/index.js +762 -14
- package/Radio/index.d.ts +13 -7
- package/Radio/index.js +94 -14
- package/RadioGroup/index.d.ts +15 -9
- package/RadioGroup/index.js +128 -14
- package/Search/index.d.ts +18 -12
- package/Search/index.js +220 -14
- package/Select/index.d.ts +13 -7
- package/Select/index.js +1288 -14
- package/SelectInput/index.d.ts +11 -5
- package/SelectInput/index.js +51 -14
- package/SingleBox/index.d.ts +13 -7
- package/SingleBox/index.js +194 -14
- package/Slider/index.d.ts +104 -7
- package/Slider/index.js +125 -15
- package/Split/index.d.ts +8 -3
- package/Split/index.js +134 -15
- package/Stepper/index.d.ts +41 -25
- package/Stepper/index.js +99 -15
- package/Switch/index.d.ts +16 -10
- package/Switch/index.js +73 -14
- package/Table/index.d.ts +12 -4
- package/Table/index.js +2725 -14
- package/Tabs/index.d.ts +64 -29
- package/Tabs/index.js +218 -14
- package/Tag/index.d.ts +78 -12
- package/Tag/index.js +286 -14
- package/Test/index.d.ts +3 -2
- package/Test/index.js +9 -16
- package/TextField/index.d.ts +22 -16
- package/TextField/index.js +686 -14
- package/TimePicker/index.d.ts +20 -10
- package/TimePicker/index.js +77 -14
- package/Timeline/index.d.ts +49 -13
- package/Timeline/index.js +150 -15
- package/ToggleButton/index.d.ts +61 -10
- package/ToggleButton/index.js +200 -14
- package/Tooltip/index.d.ts +12 -10
- package/Tooltip/index.js +335 -15
- package/Transfer/index.d.ts +8 -3
- package/Transfer/index.js +343 -14
- package/Tree/index.d.ts +8 -5
- package/Tree/index.js +35 -14
- package/Upload/index.d.ts +179 -8
- package/Upload/index.js +1542 -14
- package/_verture/defineProperty-0590dc61.js +16 -0
- package/_verture/index-0d8e1d07.js +4 -0
- package/_verture/index-14a47097.js +4 -0
- package/_verture/index-342379c6.js +391 -0
- package/_verture/index-458032d7.js +10 -0
- package/_verture/index-46bfb2f0.js +778 -0
- package/_verture/index-50401de7.js +4 -0
- package/_verture/index-5b08df83.js +4 -0
- package/_verture/index-6190b129.js +4 -0
- package/_verture/index-7ef1e3b6.js +1553 -0
- package/_verture/index-a369ca3f.js +4 -0
- package/_verture/index-c60911dc.js +39 -0
- package/_verture/index-e2881a53.js +16 -0
- package/_verture/index-ff4c2a27.js +200 -0
- package/{Tree/interface.d.ts → _verture/interface-128abdd3.js} +15 -25
- package/_verture/interface-a77a851e.js +25 -0
- package/{Table/interface.d.ts → _verture/interface-a9b7c716.js} +20 -28
- package/_verture/intl-336570e4.js +65 -0
- package/_verture/modalContext-25890584.js +228 -0
- package/_verture/modalContext-639f2787.js +58 -0
- package/_verture/slicedToArray-d7722f4b.js +62 -0
- package/_verture/style-inject.es-300983ab.js +28 -0
- package/_verture/toConsumableArray-f8047a75.js +19 -0
- package/_verture/tslib.es6-55ed4bd2.js +38 -0
- package/_verture/typeof-498dd2b1.js +11 -0
- package/_verture/useFormatMessage-ac9d6acf.js +20 -0
- package/_verture/useGlobalProps-af9a2af6.js +12 -0
- package/index.d.ts +88 -128
- package/index.js +160 -19
- package/package.json +59 -22
- package/Button/SplitButton.d.ts +0 -61
- package/Button/lang/en_US.d.ts +0 -4
- package/Button/lang/index.d.ts +0 -9
- package/Button/lang/zh_CN.d.ts +0 -4
- 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/Collapse/collapsePanel.d.ts +0 -30
- package/Collapse/motion.d.ts +0 -5
- package/Collapse/util.d.ts +0 -11
- package/CollapseBox/util.d.ts +0 -5
- package/ComboSelect/WithTabsCombo/index.d.ts +0 -11
- package/ComboSelect/WithTabsCombo/interface.d.ts +0 -141
- package/ComboSelect/interface.d.ts +0 -143
- package/ComboSelect/lang/en_US.d.ts +0 -8
- package/ComboSelect/lang/index.d.ts +0 -17
- package/ComboSelect/lang/zh_CN.d.ts +0 -8
- package/ComboSelect/utils.d.ts +0 -12
- package/DatePicker/PickerButton.d.ts +0 -3
- package/DatePicker/PickerTag.d.ts +0 -3
- package/DatePicker/generatePicker/generateRangePicker.d.ts +0 -4
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +0 -11
- package/DatePicker/generatePicker/index.d.ts +0 -77
- package/DatePicker/lang/en_US.d.ts +0 -3
- package/DatePicker/lang/index.d.ts +0 -7
- package/DatePicker/lang/zh_CN.d.ts +0 -3
- package/DatePicker/util.d.ts +0 -20
- package/Drawer/interface.d.ts +0 -83
- package/Drawer/lang/en_US.d.ts +0 -5
- package/Drawer/lang/index.d.ts +0 -11
- package/Drawer/lang/zh_CN.d.ts +0 -5
- package/Empty/images/index.d.ts +0 -2
- package/Empty/lang/en_US.d.ts +0 -6
- package/Empty/lang/index.d.ts +0 -13
- package/Empty/lang/zh_CN.d.ts +0 -6
- package/FormItem/compoments/defaultCompoments/index.d.ts +0 -19
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +0 -8
- package/FormItem/compoments/formFile/index.d.ts +0 -38
- package/FormItem/compoments/formRadioGroup/index.d.ts +0 -8
- package/FormItem/compoments/formSelect/index.d.ts +0 -18
- package/FormItem/errorTips.d.ts +0 -12
- package/FormItem/itemType.d.ts +0 -42
- package/FormItem/validateFunction.d.ts +0 -15
- package/FunctionModal/dialog.d.ts +0 -58
- package/FunctionModal/modalContext.d.ts +0 -14
- package/GlobalContext/componentsProps.d.ts +0 -19
- package/GlobalContext/confirmLocale.d.ts +0 -7
- package/GlobalContext/intl.d.ts +0 -34
- package/GlobalContext/useFormatMessage.d.ts +0 -3
- package/Hooks/useGlobalProps.d.ts +0 -1
- package/Menu/footerExpansion.d.ts +0 -9
- package/Menu/interface.d.ts +0 -139
- package/Menu/logo.d.ts +0 -9
- package/Menu/verticalMenuList.d.ts +0 -14
- package/Modal/Confirm/index.d.ts +0 -66
- package/Modal/lang/en_US.d.ts +0 -5
- package/Modal/lang/index.d.ts +0 -11
- package/Modal/lang/zh_CN.d.ts +0 -5
- package/OperateBtn/lang/en_US.d.ts +0 -4
- package/OperateBtn/lang/index.d.ts +0 -9
- package/OperateBtn/lang/zh_CN.d.ts +0 -4
- package/PageHeader/horizontalMeun.d.ts +0 -9
- package/PageHeader/horizontalMeunRight.d.ts +0 -9
- package/PageHeader/interface.d.ts +0 -167
- package/Pagination/lang/en_US.d.ts +0 -8
- package/Pagination/lang/index.d.ts +0 -17
- package/Pagination/lang/zh_CN.d.ts +0 -8
- package/PopConfirm/lang/en_US.d.ts +0 -5
- package/PopConfirm/lang/index.d.ts +0 -11
- package/PopConfirm/lang/zh_CN.d.ts +0 -5
- package/Popper/index.d.ts +0 -13
- package/Popper/index.js +0 -16
- package/Progress/Line.d.ts +0 -47
- package/Progress/Steps.d.ts +0 -17
- package/Progress/utils.d.ts +0 -6
- package/Querying/images/index.d.ts +0 -2
- package/Querying/lang/en_US.d.ts +0 -4
- package/Querying/lang/index.d.ts +0 -9
- package/Querying/lang/zh_CN.d.ts +0 -4
- package/README.md +0 -489
- package/Select/lang/en_US.d.ts +0 -5
- package/Select/lang/index.d.ts +0 -11
- package/Select/lang/zh_CN.d.ts +0 -5
- package/Slider/interface.d.ts +0 -102
- package/Stepper/icons.d.ts +0 -5
- package/Table/lang/en_US.d.ts +0 -6
- package/Table/lang/index.d.ts +0 -13
- package/Table/lang/zh_CN.d.ts +0 -6
- package/Table/tableBody.d.ts +0 -9
- package/Table/tableBodyElement/index.d.ts +0 -15
- package/Table/tableBodyInterface.d.ts +0 -67
- package/Table/tableContainer/index.d.ts +0 -16
- package/Table/tableElement/index.d.ts +0 -17
- package/Table/tableHead.d.ts +0 -9
- package/Table/tableHeadElement/index.d.ts +0 -15
- package/Table/tableHeadInterface.d.ts +0 -30
- package/Table/tablePagination.d.ts +0 -9
- package/Table/tablePaginationInterFace.d.ts +0 -24
- package/Table/tdElement/index.d.ts +0 -15
- package/Table/thElement/index.d.ts +0 -15
- package/Table/trElement/index.d.ts +0 -15
- package/Table/util.d.ts +0 -16
- package/Tag/TagGroup.d.ts +0 -66
- package/TimePicker/locale/en_US.d.ts +0 -3
- package/TimePicker/locale/zh_CN.d.ts +0 -3
- package/TimePicker/style/index.d.ts +0 -1
- package/ToggleButton/ToggleButtonGroup.d.ts +0 -49
- package/Transfer/lang/en_US.d.ts +0 -6
- package/Transfer/lang/index.d.ts +0 -13
- package/Transfer/lang/zh_CN.d.ts +0 -6
- package/Tree/OperateBar/index.d.ts +0 -13
- package/Tree/Tree.d.ts +0 -4
- package/Tree/lang/en_US.d.ts +0 -8
- package/Tree/lang/index.d.ts +0 -17
- package/Tree/lang/zh_CN.d.ts +0 -8
- package/Tree/utils/closestPolyfill.d.ts +0 -0
- package/Tree/utils/tools.d.ts +0 -26
- package/Tree/utils/treeUtil.d.ts +0 -15
- package/Upload/Dragger/index.d.ts +0 -10
- package/Upload/ErroTip/index.d.ts +0 -13
- package/Upload/ImageUpload/index.d.ts +0 -14
- package/Upload/ImgCrop/EasyCrop.d.ts +0 -17
- package/Upload/ImgCrop/constants.d.ts +0 -7
- package/Upload/ImgCrop/index.d.ts +0 -6
- package/Upload/ImgCrop/interface.d.ts +0 -24
- package/Upload/UploadList/index.d.ts +0 -5
- package/Upload/interface.d.ts +0 -134
- package/Upload/lang/en_US.d.ts +0 -12
- package/Upload/lang/index.d.ts +0 -25
- package/Upload/lang/zh_CN.d.ts +0 -12
- package/cdn/AutoBox/index.js +0 -29
- package/cdn/AutoTips/index.js +0 -40
- package/cdn/Breadcrumbs/index.js +0 -53
- package/cdn/Button/index.js +0 -79
- package/cdn/ButtonGroup/index.js +0 -79
- package/cdn/Carousel/index.js +0 -6
- package/cdn/Cascader/index.js +0 -42
- package/cdn/Checkbox/index.js +0 -53
- package/cdn/CheckboxGroup/index.js +0 -53
- package/cdn/Collapse/index.js +0 -27
- package/cdn/CollapseBox/index.js +0 -1
- package/cdn/ColorPicker/index.js +0 -1
- package/cdn/ComboSelect/index.js +0 -438
- package/cdn/Container/index.js +0 -1
- package/cdn/DatePicker/index.js +0 -185
- package/cdn/Desktop/index.js +0 -24
- package/cdn/Drawer/index.js +0 -84
- package/cdn/Empty/index.js +0 -1
- package/cdn/Form/index.js +0 -477
- package/cdn/FormItem/index.js +0 -477
- package/cdn/FunctionModal/index.js +0 -144
- package/cdn/GlobalContext/index.js +0 -1
- package/cdn/Help/index.js +0 -53
- package/cdn/HelperText/index.js +0 -1
- package/cdn/InputLang/index.js +0 -144
- package/cdn/InputNumber/index.js +0 -118
- package/cdn/Label/index.js +0 -53
- package/cdn/Loading/index.js +0 -14
- package/cdn/Menu/index.js +0 -40
- package/cdn/Message/index.js +0 -53
- package/cdn/Modal/index.js +0 -144
- package/cdn/MultiBox/index.js +0 -131
- package/cdn/Notification/index.js +0 -66
- package/cdn/OperateBtn/index.js +0 -92
- package/cdn/PageHeader/index.js +0 -92
- package/cdn/Pagination/index.js +0 -214
- package/cdn/ParauiProvider/index.js +0 -9
- package/cdn/PopConfirm/index.js +0 -131
- package/cdn/Popover/index.js +0 -16
- package/cdn/Popper/index.js +0 -26
- package/cdn/Progress/index.js +0 -58
- package/cdn/Querying/index.js +0 -1
- package/cdn/Radio/index.js +0 -53
- package/cdn/RadioGroup/index.js +0 -53
- package/cdn/Search/index.js +0 -144
- package/cdn/Select/index.js +0 -131
- package/cdn/SelectInput/index.js +0 -131
- package/cdn/SingleBox/index.js +0 -131
- package/cdn/Slider/index.js +0 -16
- package/cdn/Split/index.js +0 -1
- package/cdn/Stepper/index.js +0 -154
- package/cdn/Switch/index.js +0 -71
- package/cdn/Table/index.js +0 -292
- package/cdn/Tabs/index.js +0 -165
- package/cdn/Tag/index.js +0 -27
- package/cdn/Test/index.js +0 -1
- package/cdn/TextField/index.js +0 -105
- package/cdn/TimePicker/index.js +0 -185
- package/cdn/Timeline/index.js +0 -16
- package/cdn/ToggleButton/index.js +0 -79
- package/cdn/Tooltip/index.js +0 -40
- package/cdn/Transfer/index.js +0 -170
- package/cdn/Tree/index.js +0 -170
- package/cdn/Upload/index.js +0 -252
- package/style.css +0 -72
package/AutoBox/index.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
+
import React__default, { ReactNode, FunctionComponent } from 'react';
|
|
2
|
+
import styleInject from './node_modules/style-inject/dist/style-inject.es.js';
|
|
3
|
+
|
|
4
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-auto-box {\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n}\n.paraui-auto-box > .auto-box-more {\n display: inline-block;\n height: 100%;\n cursor: pointer;\n}\n\n.paraui-auto-box-popover .auto-box-popover-content {\n display: flex;\n flex-direction: column;\n}";
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* @author linhd
|
|
3
9
|
* @date 2021/8/9 16:16
|
|
4
10
|
* @description 超出自适应盒子
|
|
5
11
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export interface AutoBoxProps {
|
|
12
|
+
|
|
13
|
+
interface AutoBoxProps {
|
|
9
14
|
/** 样式class */
|
|
10
15
|
className?: string;
|
|
11
16
|
/** style */
|
|
12
|
-
style?:
|
|
17
|
+
style?: React__default.CSSProperties;
|
|
13
18
|
/** list选项 */
|
|
14
19
|
list?: any[];
|
|
15
20
|
/** 指定渲染几项,存在这个参数,则不自适应 */
|
|
@@ -30,5 +35,6 @@ export interface AutoBoxProps {
|
|
|
30
35
|
onShowMore?: (bol: boolean) => void;
|
|
31
36
|
[name: string]: any;
|
|
32
37
|
}
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
declare const AutoBox: FunctionComponent<AutoBoxProps>;
|
|
39
|
+
|
|
40
|
+
export { AutoBox, AutoBoxProps, AutoBox as default };
|
package/AutoBox/index.js
CHANGED
|
@@ -1,15 +1,203 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect, useMemo, Fragment } from 'react';
|
|
4
|
+
import { Popover } from '../Popover/index.js';
|
|
5
|
+
import More from '@para-ui/icons/More';
|
|
6
|
+
import { UUID } from '@paraview/lib';
|
|
7
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
8
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
9
|
+
import '../Tooltip/index.js';
|
|
10
|
+
import 'rc-tooltip';
|
|
11
|
+
import 'rc-tooltip/lib/placements';
|
|
12
|
+
import 'clsx';
|
|
13
|
+
|
|
14
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-auto-box {\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n}\n.paraui-auto-box > .auto-box-more {\n display: inline-block;\n height: 100%;\n cursor: pointer;\n}\n\n.paraui-auto-box-popover .auto-box-popover-content {\n display: flex;\n flex-direction: column;\n}";
|
|
15
|
+
styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
var AutoBox = function AutoBox(props) {
|
|
18
|
+
var className = props.className,
|
|
19
|
+
_props$list = props.list,
|
|
20
|
+
list = _props$list === void 0 ? [] : _props$list,
|
|
21
|
+
popoverClassName = props.popoverClassName,
|
|
22
|
+
moreCustomize = props.moreCustomize,
|
|
23
|
+
anchorEl = props.anchorEl,
|
|
24
|
+
_props$hideMore = props.hideMore,
|
|
25
|
+
hideMore = _props$hideMore === void 0 ? false : _props$hideMore,
|
|
26
|
+
showNum = props.showNum,
|
|
27
|
+
onCloseMore = props.onCloseMore,
|
|
28
|
+
onShowMore = props.onShowMore,
|
|
29
|
+
style = props.style;
|
|
30
|
+
|
|
31
|
+
var _useState = useState('auto-box-' + UUID()),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
33
|
+
classOne = _useState2[0]; // 唯一class
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var _useState3 = useState(null),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
morePos = _useState4[0],
|
|
39
|
+
setMorePos = _useState4[1]; // 超出在原始位置
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var _useState5 = useState(false),
|
|
43
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
44
|
+
openMoreCom = _useState6[0],
|
|
45
|
+
setOpenMoreCom = _useState6[1]; // 显示更多
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
var _useState7 = useState(null),
|
|
49
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
50
|
+
anchorElCom = _useState8[0],
|
|
51
|
+
setAnchorElCom = _useState8[1]; // 更多定位元素
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
var _useState9 = useState({}),
|
|
55
|
+
_useState10 = _slicedToArray(_useState9, 1),
|
|
56
|
+
timer = _useState10[0];
|
|
57
|
+
|
|
58
|
+
var posDom = useRef(); // 监听打开更多
|
|
59
|
+
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
if (props.openMore !== undefined) {
|
|
62
|
+
setOpenMoreCom(props.openMore);
|
|
63
|
+
}
|
|
64
|
+
}, [props.openMore]); // 监听更多定位元素
|
|
65
|
+
|
|
66
|
+
useEffect(function () {
|
|
67
|
+
if (anchorEl) setAnchorElCom(anchorEl);
|
|
68
|
+
}, [anchorEl]);
|
|
69
|
+
useEffect(function () {
|
|
70
|
+
if (props.showNum !== undefined) return;
|
|
71
|
+
changeSize();
|
|
72
|
+
window.addEventListener("resize", changeSize);
|
|
73
|
+
return function () {
|
|
74
|
+
window.removeEventListener("resize", changeSize);
|
|
75
|
+
clearTimeout(timer.timer);
|
|
76
|
+
};
|
|
77
|
+
}, [list]);
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
if (showNum !== undefined) {
|
|
80
|
+
setMorePos(showNum);
|
|
81
|
+
window.removeEventListener("resize", changeSize);
|
|
82
|
+
}
|
|
83
|
+
}, [showNum]);
|
|
84
|
+
useEffect(function () {
|
|
85
|
+
if (morePos !== null && list.length > morePos) {
|
|
86
|
+
onShowMore && onShowMore(true);
|
|
87
|
+
} else {
|
|
88
|
+
onShowMore && onShowMore(false);
|
|
89
|
+
}
|
|
90
|
+
}, [list, morePos, onShowMore]); // 关闭显示更多
|
|
91
|
+
|
|
92
|
+
var closeMore = function closeMore() {
|
|
93
|
+
setOpenMoreCom(false);
|
|
94
|
+
onCloseMore && onCloseMore();
|
|
95
|
+
}; // 点击显示更多
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
var clickMore = function clickMore(e) {
|
|
99
|
+
setOpenMoreCom(true);
|
|
100
|
+
setAnchorElCom(posDom.current);
|
|
101
|
+
}; // 关闭显示更多
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
var handleCloseMore = function handleCloseMore() {
|
|
105
|
+
closeMore();
|
|
106
|
+
}; // 不换行 计算
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
var handMultiline = function handMultiline(index) {
|
|
110
|
+
if (index === null || index === 0) return;
|
|
111
|
+
if (index === undefined) index = list.length;
|
|
112
|
+
var boxDom = document.querySelector('.' + classOne);
|
|
113
|
+
if (!boxDom) return;
|
|
114
|
+
|
|
115
|
+
if (boxDom.scrollWidth > boxDom.clientWidth) {
|
|
116
|
+
var num = Number(index) - 1; // 超出
|
|
117
|
+
|
|
118
|
+
setMorePos(num);
|
|
119
|
+
handMultiline(num);
|
|
120
|
+
} else {
|
|
121
|
+
// 一个
|
|
122
|
+
if (list.length <= index) handleCloseMore();
|
|
123
|
+
}
|
|
124
|
+
}; // 多选 不换行
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
var changeSize = function changeSize() {
|
|
128
|
+
clearTimeout(timer.timer);
|
|
129
|
+
closeMore();
|
|
130
|
+
timer.timer = setTimeout(function () {
|
|
131
|
+
setMorePos(list.length);
|
|
132
|
+
handMultiline();
|
|
133
|
+
}, 100);
|
|
134
|
+
}; // 处理class
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
var handClass = function handClass() {
|
|
138
|
+
var str = 'auto-box paraui-auto-box';
|
|
139
|
+
if (classOne) str += ' ' + classOne;
|
|
140
|
+
if (className) str += ' ' + className;
|
|
141
|
+
return str;
|
|
142
|
+
}; // 处理handClassPopover
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
var handClassPopover = function handClassPopover() {
|
|
146
|
+
var str = 'auto-box-popover paraui-auto-box-popover';
|
|
147
|
+
if (popoverClassName) str += ' ' + popoverClassName;
|
|
148
|
+
return str;
|
|
149
|
+
};
|
|
150
|
+
/* 更多下拉 */
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
var MoreMemo = useMemo(function () {
|
|
154
|
+
return openMoreCom && jsx(Popover, Object.assign({
|
|
155
|
+
open: openMoreCom,
|
|
156
|
+
anchorEl: anchorElCom,
|
|
157
|
+
onClose: closeMore,
|
|
158
|
+
anchorOrigin: {
|
|
159
|
+
vertical: 'bottom',
|
|
160
|
+
horizontal: 'left'
|
|
161
|
+
},
|
|
162
|
+
transformOrigin: {
|
|
163
|
+
vertical: 'top',
|
|
164
|
+
horizontal: 'left'
|
|
165
|
+
},
|
|
166
|
+
className: handClassPopover()
|
|
167
|
+
}, {
|
|
168
|
+
children: jsx("div", Object.assign({
|
|
169
|
+
className: "auto-box-popover-content"
|
|
170
|
+
}, {
|
|
171
|
+
children: list && list.map(function (item, index) {
|
|
172
|
+
if (morePos !== null && morePos > index) return null;
|
|
173
|
+
return jsx(Fragment, {
|
|
174
|
+
children: item
|
|
175
|
+
}, index);
|
|
176
|
+
})
|
|
177
|
+
}))
|
|
178
|
+
}));
|
|
179
|
+
}, [openMoreCom, anchorElCom, list, morePos, popoverClassName]);
|
|
180
|
+
return jsxs("div", Object.assign({
|
|
181
|
+
className: handClass(),
|
|
182
|
+
style: style
|
|
183
|
+
}, {
|
|
184
|
+
children: [list.map(function (item, index) {
|
|
185
|
+
if (morePos !== null && morePos <= index) return null;
|
|
186
|
+
return jsx(Fragment, {
|
|
187
|
+
children: item
|
|
188
|
+
}, index);
|
|
189
|
+
}), function () {
|
|
190
|
+
if (morePos !== null && list.length > morePos && !hideMore) {
|
|
191
|
+
return jsx("div", Object.assign({
|
|
192
|
+
className: "auto-box-more",
|
|
193
|
+
ref: posDom,
|
|
194
|
+
onClick: clickMore
|
|
195
|
+
}, {
|
|
196
|
+
children: moreCustomize ? moreCustomize : jsx(More, {})
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
|
+
}(), MoreMemo]
|
|
200
|
+
}));
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export { AutoBox, AutoBox as default };
|
package/AutoTips/index.d.ts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
import React__default, { FunctionComponent } from 'react';
|
|
2
|
+
import styleInject from './node_modules/style-inject/dist/style-inject.es.js';
|
|
3
|
+
|
|
4
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2021/11/1 20:28\n* @description 文字隐藏...\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-auto-tips {\n max-width: 100%;\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-auto-tips > .auto-tips-content {\n display: inline;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.paraui-auto-tips-tooltip > div {\n max-height: calc(100vh - 25px);\n overflow: auto;\n}";
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* @author linhd
|
|
3
9
|
* @date 2021/8/9 15:15
|
|
4
10
|
* @description 超出...
|
|
5
11
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export interface AutoTipsProps {
|
|
12
|
+
|
|
13
|
+
interface AutoTipsProps {
|
|
9
14
|
/** 样式class */
|
|
10
15
|
className?: string;
|
|
11
16
|
/** style */
|
|
12
|
-
style?:
|
|
17
|
+
style?: React__default.CSSProperties;
|
|
13
18
|
/** 超出显示的内容 */
|
|
14
|
-
tips?:
|
|
19
|
+
tips?: React__default.ReactNode;
|
|
15
20
|
/** 文字下拉提示箭头 */
|
|
16
21
|
arrow?: boolean;
|
|
17
22
|
/** 显示文字还是元素 */
|
|
@@ -24,4 +29,5 @@ export interface AutoTipsProps {
|
|
|
24
29
|
[name: string]: any;
|
|
25
30
|
}
|
|
26
31
|
declare const AutoTips: FunctionComponent<AutoTipsProps>;
|
|
27
|
-
|
|
32
|
+
|
|
33
|
+
export { AutoTipsProps, AutoTips as default };
|
package/AutoTips/index.js
CHANGED
|
@@ -1,15 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useState, useEffect } from 'react';
|
|
4
|
+
import { Tooltip } from '../Tooltip/index.js';
|
|
5
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
6
|
+
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
7
|
+
import 'rc-tooltip';
|
|
8
|
+
import 'rc-tooltip/lib/placements';
|
|
9
|
+
import 'clsx';
|
|
10
|
+
|
|
11
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2021/11/1 20:28\n* @description 文字隐藏...\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-auto-tips {\n max-width: 100%;\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-auto-tips > .auto-tips-content {\n display: inline;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.paraui-auto-tips-tooltip > div {\n max-height: calc(100vh - 25px);\n overflow: auto;\n}";
|
|
12
|
+
styleInject(css_248z);
|
|
13
|
+
|
|
14
|
+
var AutoTips = function AutoTips(props) {
|
|
15
|
+
var children = props.children,
|
|
16
|
+
_props$arrow = props.arrow,
|
|
17
|
+
arrow = _props$arrow === void 0 ? false : _props$arrow,
|
|
18
|
+
_props$placement = props.placement,
|
|
19
|
+
placement = _props$placement === void 0 ? "bottom-start" : _props$placement,
|
|
20
|
+
_props$tips = props.tips,
|
|
21
|
+
tips = _props$tips === void 0 ? '' : _props$tips,
|
|
22
|
+
_props$className = props.className,
|
|
23
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
24
|
+
_props$beyondText = props.beyondText,
|
|
25
|
+
beyondText = _props$beyondText === void 0 ? true : _props$beyondText,
|
|
26
|
+
_props$interactive = props.interactive,
|
|
27
|
+
interactive = _props$interactive === void 0 ? true : _props$interactive,
|
|
28
|
+
style = props.style;
|
|
29
|
+
var tipsElm = useRef();
|
|
30
|
+
|
|
31
|
+
var _useState = useState(''),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
tTips = _useState2[0],
|
|
34
|
+
setTTips = _useState2[1];
|
|
35
|
+
|
|
36
|
+
useEffect(function () {
|
|
37
|
+
setTTips(tips);
|
|
38
|
+
}, [tips]); // 鼠标移入事件
|
|
39
|
+
|
|
40
|
+
var mouseHover = function mouseHover() {
|
|
41
|
+
var val = '';
|
|
42
|
+
|
|
43
|
+
if (tipsElm.current && tipsElm.current.scrollWidth > tipsElm.current.offsetWidth) {
|
|
44
|
+
if (tips) {
|
|
45
|
+
val = tips;
|
|
46
|
+
} else {
|
|
47
|
+
val = beyondText ? tipsElm.current.innerText : children;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
setTTips(val);
|
|
52
|
+
}; // 处理class
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
var handClass = function handClass() {
|
|
56
|
+
var str = 'paraui-auto-tips';
|
|
57
|
+
if (className) str += ' ' + className;
|
|
58
|
+
return str;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return jsx("div", Object.assign({
|
|
62
|
+
ref: tipsElm,
|
|
63
|
+
className: handClass(),
|
|
64
|
+
onMouseOver: mouseHover,
|
|
65
|
+
style: style
|
|
66
|
+
}, {
|
|
67
|
+
children: jsx(Tooltip, Object.assign({
|
|
68
|
+
arrow: arrow,
|
|
69
|
+
title: tTips,
|
|
70
|
+
placement: placement,
|
|
71
|
+
interactive: interactive,
|
|
72
|
+
boundariesElement: 'viewport',
|
|
73
|
+
className: 'paraui-auto-tips-tooltip'
|
|
74
|
+
}, {
|
|
75
|
+
children: jsx("div", Object.assign({
|
|
76
|
+
className: "auto-tips-content"
|
|
77
|
+
}, {
|
|
78
|
+
children: children
|
|
79
|
+
}))
|
|
80
|
+
}))
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { AutoTips as default };
|
package/Breadcrumbs/index.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import React__default, { ReactNode, FunctionComponent } from 'react';
|
|
2
|
+
import styleInject from './node_modules/style-inject/dist/style-inject.es.js';
|
|
3
|
+
|
|
4
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n * @author linhd\n * @date 2021年10月25日 14:58:12\n * @description 面包屑\n */\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-breadcrumbs {\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n line-height: 0;\n height: 17px;\n}\n.paraui-breadcrumbs.paraui-breadcrumbs-shrink {\n white-space: nowrap;\n}\n.paraui-breadcrumbs > div {\n display: inline-block;\n line-height: 17px;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div svg {\n font-size: 14px;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div span {\n display: inline-block;\n line-height: 0;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div .paraui-auto-tips {\n line-height: 0;\n}\n.paraui-breadcrumbs > div .paraui-auto-tips .auto-tips-content {\n line-height: 17px;\n}\n.paraui-breadcrumbs > div .paraui-auto-tips span {\n line-height: 17px;\n}\n.paraui-breadcrumbs > .breadcrumbs-separator {\n user-select: none;\n margin: 0 8px;\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click {\n cursor: pointer;\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover svg {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover span {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-disabled {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-breadcrumbs > .more-breadcrumbs {\n cursor: pointer;\n}\n.paraui-breadcrumbs > .current-breadcrumbs {\n color: rgba(46, 55, 67, 0.7);\n font-weight: 700;\n}\n\n.paraui-breadcrumbs-popover > .paraui-popover-content > .paraui-popover-inner {\n display: flex;\n align-items: center;\n height: 36px;\n line-height: 0;\n padding: 0 12px;\n}";
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* @author linhd
|
|
3
9
|
* @date 2021/8/3 10:59
|
|
4
10
|
* @description 面包屑
|
|
5
11
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export interface listOptions {
|
|
12
|
+
|
|
13
|
+
interface listOptions {
|
|
9
14
|
/** 每一项显示名 */
|
|
10
15
|
label: ReactNode;
|
|
11
16
|
/** 每一项最大宽度 */
|
|
@@ -14,11 +19,11 @@ export interface listOptions {
|
|
|
14
19
|
disabled?: boolean;
|
|
15
20
|
[name: string]: any;
|
|
16
21
|
}
|
|
17
|
-
|
|
22
|
+
interface BreadcrumbsProps {
|
|
18
23
|
/** 样式class */
|
|
19
24
|
className?: string;
|
|
20
25
|
/** style */
|
|
21
|
-
style?:
|
|
26
|
+
style?: React__default.CSSProperties;
|
|
22
27
|
/** 每一项最大宽度 */
|
|
23
28
|
maxWidth?: string;
|
|
24
29
|
/** 初始化数据 */
|
|
@@ -35,5 +40,6 @@ export interface BreadcrumbsProps {
|
|
|
35
40
|
*/
|
|
36
41
|
onClickItem?: (ops: listOptions) => void;
|
|
37
42
|
}
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
declare const Breadcrumbs: FunctionComponent<BreadcrumbsProps>;
|
|
44
|
+
|
|
45
|
+
export { Breadcrumbs, BreadcrumbsProps, Breadcrumbs as default, listOptions };
|