@geneui/components 2.11.2 → 2.12.2
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/{ActionableList.js → ActionableList/index.js} +83 -152
- package/{AdvancedSearch.js → AdvancedSearch/index.js} +290 -304
- package/Alert/index.js +97 -0
- package/Avatar/index.js +30 -0
- package/Badge/index.js +75 -0
- package/{Breadcrumb.js → Breadcrumb/index.js} +32 -31
- package/BusyLoader/index.js +68 -0
- package/Button/index.js +129 -0
- package/CHANGELOG.md +53 -0
- package/{Card.js → Card/index.js} +82 -94
- package/{CardList.js → CardList/index.js} +120 -165
- package/{CellMeasurerCache-b786dd93.js → CellMeasurerCache-3741d716.js} +2 -2
- package/{index-9164a86d.js → Charts/index.js} +17103 -30447
- package/{Checkbox.js → Checkbox/index.js} +37 -38
- package/{CheckboxGroup.js → CheckboxGroup/index.js} +41 -42
- package/{CheckboxGroupWithSearch.js → CheckboxGroupWithSearch/index.js} +64 -65
- package/{Collapse.js → Collapse/index.js} +28 -29
- package/{ColorPicker.js → ColorPicker/index.js} +16 -16
- package/ComboBox/index.js +525 -0
- package/Counter/index.js +310 -0
- package/{DateFilter.js → DateFilter/index.js} +45 -43
- package/{DatePicker.js → DatePicker/index.js} +106 -108
- package/{index-0199942c.js → DatePickerInput/index.js} +114 -100
- package/{Divider.js → Divider/index.js} +9 -10
- package/{Drawer.js → Drawer/index.js} +40 -41
- package/Dropdown/index.js +41 -0
- package/{Editor.js → Editor/index.js} +165 -164
- package/{Empty.js → Empty/index.js} +12 -13
- package/{ExtendedInput.js → ExtendedInput/index.js} +81 -71
- package/Form/index.js +83 -0
- package/{FormContainer.js → FormContainer/index.js} +25 -26
- package/FormableCheckbox/index.js +26 -0
- package/FormableDatePicker/index.js +41 -0
- package/FormableDropdown/index.js +48 -0
- package/FormableEditor/index.js +24 -0
- package/{FormableHOC-21051057.js → FormableHOC-55263162.js} +3 -3
- package/FormableMultiSelectDropdown/index.js +48 -0
- package/FormableNumberInput/index.js +32 -0
- package/FormableRadio/index.js +22 -0
- package/FormableSwitcher/index.js +22 -0
- package/FormableTextInput/index.js +32 -0
- package/FormableUploader/index.js +42 -0
- package/GeneUIProvider/index.js +282 -0
- package/{Grid.js → Grid/index.js} +27 -27
- package/Holder/index.js +261 -0
- package/{Icon.js → Icon/index.js} +9 -10
- package/Image/index.js +129 -0
- package/ImagePreview/index.js +481 -0
- package/{KeyValue.js → KeyValue/index.js} +11 -12
- package/LICENSE +21 -0
- package/Label/index.js +57 -0
- package/LinkButton/index.js +67 -0
- package/{Menu.js → Menu/index.js} +27 -28
- package/MobileNavigation/index.js +94 -0
- package/{MobilePopup.js → MobilePopup/index.js} +42 -41
- package/{Modal.js → Modal/index.js} +39 -40
- package/ModuleTitle/index.js +143 -0
- package/{NavigationMenu.js → NavigationMenu/index.js} +30 -29
- package/Notification/index.js +119 -0
- package/Option/index.js +184 -0
- package/Overlay/index.js +189 -0
- package/Overspread/index.js +289 -0
- package/{Pagination.js → Pagination/index.js} +35 -34
- package/Paper/index.js +96 -0
- package/{index-084588e9.js → Popover/index.js} +48 -58
- package/PopoverV2/index.js +18 -0
- package/{Portal.js → Portal/index.js} +7 -8
- package/{Products.js → Products/index.js} +20 -21
- package/Profile/index.js +585 -0
- package/Progress/index.js +199 -0
- package/{QRCode.js → QRCode/index.js} +4 -6
- package/{Radio.js → Radio/index.js} +25 -26
- package/{RadioGroup.js → RadioGroup/index.js} +17 -18
- package/{index-00fe8887.js → Range/index.js} +29 -32
- package/RichEditor/index.js +13 -0
- package/{RichEditor-98accead.js → RichEditor-8b0f7ccd.js} +18 -18
- package/{Scrollbar.js → Scrollbar/index.js} +15 -17
- package/{Search.js → Search/index.js} +25 -24
- package/SearchWithDropdown/index.js +138 -0
- package/Section/index.js +61 -0
- package/{SkeletonLoader.js → SkeletonLoader/index.js} +13 -14
- package/{Slider.js → Slider/index.js} +46 -43
- package/Status/index.js +103 -0
- package/Steps/index.js +313 -0
- package/{index-897d8240.js → SuggestionList/index.js} +15 -38
- package/{Switcher.js → Switcher/index.js} +30 -31
- package/Table/index.js +53 -0
- package/{TableCompositions.js → TableCompositions/index.js} +131 -168
- package/Tabs/index.js +235 -0
- package/Tag/index.js +102 -0
- package/{TextLink.js → TextLink/index.js} +3 -3
- package/{Textarea.js → Textarea/index.js} +66 -65
- package/{Time.js → Time/index.js} +13 -14
- package/TimePicker/index.js +555 -0
- package/Timeline/index.js +113 -0
- package/Title/index.js +65 -0
- package/{Toaster.js → Toaster/index.js} +19 -20
- package/{Tooltip.js → Tooltip/index.js} +27 -28
- package/{TransferList.js → TransferList/index.js} +44 -55
- package/{index-135b9d17.js → Uploader/index.js} +119 -116
- package/{ValidatableCheckbox.js → ValidatableCheckbox/index.js} +23 -24
- package/{ValidatableDatePicker.js → ValidatableDatePicker/index.js} +44 -42
- package/ValidatableDropdown/index.js +139 -0
- package/ValidatableElements/index.js +65 -0
- package/ValidatableMultiSelectDropdown/index.js +150 -0
- package/{ValidatableNumberInput.js → ValidatableNumberInput/index.js} +41 -33
- package/{ValidatableRadio.js → ValidatableRadio/index.js} +19 -20
- package/{ValidatableSwitcher.js → ValidatableSwitcher/index.js} +19 -20
- package/{ValidatableTextInput.js → ValidatableTextInput/index.js} +32 -31
- package/{ValidatableTimeInput.js → ValidatableTimeInput/index.js} +31 -30
- package/{ValidatableUploader.js → ValidatableUploader/index.js} +36 -34
- package/Widget/index.js +227 -0
- package/config-0ca92874.js +31 -0
- package/{configs-91c86664.js → configs-fed6ac34.js} +28 -1
- package/hooks/useBodyScroll.js +16 -0
- package/hooks/useClick.js +18 -0
- package/{useClickOutside-5183e396.js → hooks/useClickOutside.js} +1 -1
- package/hooks/useDebounceHook.js +16 -0
- package/{useDeviceType-dd51db38.js → hooks/useDeviceType.js} +4 -3
- package/hooks/useDidMount.js +15 -0
- package/{useEllipsisDetection-ef536015.js → hooks/useEllipsisDetection.js} +1 -1
- package/hooks/useForceUpdate.js +8 -0
- package/hooks/useImgDownload.js +18 -0
- package/{useKeyDown-38102ae7.js → hooks/useKeyDown.js} +1 -1
- package/hooks/useMount.js +13 -0
- package/hooks/useMutationObserver.js +21 -0
- package/hooks/usePrevious.js +10 -0
- package/hooks/useThrottle.js +16 -0
- package/hooks/useToggle.js +11 -0
- package/hooks/useUpdatableRef.js +14 -0
- package/hooks/useUpdate.js +10 -0
- package/{useWidth-9f4647f8.js → hooks/useWidth.js} +2 -2
- package/{useWindowSize-80369d76.js → hooks/useWindowSize.js} +1 -1
- package/{index-8c98317a.js → index-11eea761.js} +678 -752
- package/index-2ad83e03.js +4 -0
- package/index-34e47647.js +10054 -0
- package/index-45eafea6.js +90 -0
- package/{index-5e96cb4d.js → index-462461c0.js} +50 -48
- package/{index-ac59cb10.js → index-a0e4e333.js} +6 -6
- package/{index-e8776f3d.js → index-b1e429a7.js} +1 -1
- package/index.d.ts +115 -0
- package/index.js +137 -113
- package/index.mobile.d.ts +16 -0
- package/lib/atoms/Avatar/Avatar.d.ts +34 -0
- package/lib/atoms/Avatar/index.d.ts +1 -0
- package/lib/atoms/LinkButton/LinkButton.d.ts +46 -0
- package/lib/atoms/LinkButton/index.d.ts +1 -0
- package/{objectWithoutPropertiesLoose-299691d8.js → objectWithoutPropertiesLoose-d8a4a68c.js} +12 -12
- package/package.json +42 -22
- package/{rangeAndSlider-20599da4.js → rangeAndSlider-0301a458.js} +220 -375
- package/{react-beautiful-dnd.esm-38c37304.js → react-beautiful-dnd.esm-04c14563.js} +9 -9
- package/react-lifecycles-compat.es-6e1f3768.js +158 -0
- package/Alert.js +0 -98
- package/Avatar.js +0 -77
- package/Badge.js +0 -76
- package/BusyLoader.js +0 -69
- package/Button.js +0 -130
- package/Charts.js +0 -99
- package/ComboBox.js +0 -99
- package/Counter.js +0 -99
- package/DatePickerInput.js +0 -30
- package/Dropdown.js +0 -99
- package/Form.js +0 -116
- package/FormableCheckbox.js +0 -27
- package/FormableDatePicker.js +0 -39
- package/FormableDropdown.js +0 -105
- package/FormableEditor.js +0 -24
- package/FormableMultiSelectDropdown.js +0 -105
- package/FormableNumberInput.js +0 -31
- package/FormableRadio.js +0 -23
- package/FormableSwitcher.js +0 -23
- package/FormableTextInput.js +0 -31
- package/FormableUploader.js +0 -40
- package/GeneUIProvider.js +0 -256
- package/Holder.js +0 -99
- package/Image.js +0 -130
- package/ImagePreview.js +0 -99
- package/Label.js +0 -58
- package/LinkButton.js +0 -104
- package/MobileNavigation.js +0 -95
- package/ModuleTitle.js +0 -99
- package/Notification.js +0 -120
- package/Option.js +0 -186
- package/Overlay.js +0 -99
- package/Overspread.js +0 -343
- package/Paper.js +0 -97
- package/Popover.js +0 -20
- package/PopoverV2.js +0 -19
- package/Profile.js +0 -99
- package/Progress.js +0 -200
- package/Range.js +0 -14
- package/RichEditor.js +0 -13
- package/SearchWithDropdown.js +0 -195
- package/Section.js +0 -62
- package/Status.js +0 -104
- package/Steps.js +0 -312
- package/SuggestionList.js +0 -15
- package/Table.js +0 -102
- package/Tabs.js +0 -236
- package/Tag.js +0 -103
- package/TimePicker.js +0 -99
- package/Timeline.js +0 -114
- package/Title.js +0 -66
- package/Uploader.js +0 -32
- package/ValidatableDropdown.js +0 -99
- package/ValidatableElements.js +0 -99
- package/ValidatableMultiSelectDropdown.js +0 -99
- package/Widget.js +0 -99
- package/globalStyling-9c60a159.js +0 -4
- package/index-2030e31c.js +0 -4
- package/index-b7a33c58.js +0 -11
- package/index-e0af0caf.js +0 -1182
- package/useMount-6fef51a5.js +0 -9
package/Overlay/index.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default, { useState, useMemo, useCallback, useEffect } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
5
|
+
import { p as positions } from '../configs-fed6ac34.js';
|
|
6
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
7
|
+
import useKeyDown from '../hooks/useKeyDown.js';
|
|
8
|
+
import useClickOutside from '../hooks/useClickOutside.js';
|
|
9
|
+
import CustomScrollbar from '../Scrollbar/index.js';
|
|
10
|
+
import Button from '../Button/index.js';
|
|
11
|
+
import Divider from '../Divider/index.js';
|
|
12
|
+
import ModuleTitle from '../ModuleTitle/index.js';
|
|
13
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
14
|
+
import '../dateValidation-67caec66.js';
|
|
15
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
16
|
+
import 'react-dom';
|
|
17
|
+
import '../Icon/index.js';
|
|
18
|
+
import '../Tooltip/index.js';
|
|
19
|
+
import '../Popover-f4d1cac0.js';
|
|
20
|
+
import '../hooks/useDeviceType.js';
|
|
21
|
+
import '../hooks/useWindowSize.js';
|
|
22
|
+
import '../GeneUIProvider/index.js';
|
|
23
|
+
|
|
24
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .overlay-back-drop{animation:fadeIn 1s forwards;background:rgba(var(--background-rgb),.6);height:100%;left:0;opacity:0;position:fixed;top:0;width:100%;z-index:299}@keyframes fadeIn{to{opacity:1}}[data-gene-ui-version=\"2.12.2\"] .overlay-holder{display:flex;flex-direction:column;position:fixed;transition:width .4s,height .4s;z-index:300}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-horizontal{animation:slideInX .4s linear forwards;background:var(--background);bottom:0;top:var(--header-height,0)}@keyframes slideInX{to{transform:translateX(0)}}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-horizontal.p-left{box-shadow:.5rem 0 .6rem 0 #0000000d;transform:translateX(-120%)}html:not([dir=rtl]) .overlay-holder.t-horizontal.p-left{left:0}html[dir=rtl] .overlay-holder.t-horizontal.p-left{box-shadow:-.5rem 0 .6rem 0 #0000000d;right:0;transform:translateX(120%)}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-horizontal.p-left .overlay-close{border-radius:0 .4rem .4rem 0;box-shadow:.5rem 0 .6rem 0 #0000000d}html:not([dir=rtl]) .overlay-holder.t-horizontal.p-left .overlay-close{left:100%}html[dir=rtl] .overlay-holder.t-horizontal.p-left .overlay-close{border-radius:.4rem 0 0 .4rem;box-shadow:-.5rem 0 .6rem 0 #0000000d;right:100%}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-horizontal.p-right{box-shadow:-.5rem 0 .6rem 0 #0000000d;transform:translateX(120%)}html:not([dir=rtl]) .overlay-holder.t-horizontal.p-right{right:0}html[dir=rtl] .overlay-holder.t-horizontal.p-right{box-shadow:.5rem 0 .6rem 0 #0000000d;left:0;transform:translateX(-120%)}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-horizontal.p-right .overlay-close{border-radius:.4rem 0 0 .4rem;box-shadow:-.5rem 0 .6rem 0 #0000000d}html:not([dir=rtl]) .overlay-holder.t-horizontal.p-right .overlay-close{right:100%}html[dir=rtl] .overlay-holder.t-horizontal.p-right .overlay-close{border-radius:0 .4rem .4rem 0;box-shadow:.5rem 0 .6rem 0 #0000000d;left:100%}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-horizontal.s-half{width:50%}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-horizontal.s-wide{width:75%}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-horizontal.s-minimal{width:30rem}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-vertical{animation:slideInY .4s linear forwards;background:var(--background);height:25vh;left:0;width:100%}@keyframes slideInY{to{transform:translateY(0)}}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-vertical.s-extended{height:50vh}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-vertical.p-top{border-radius:0 0 2rem 2rem;box-shadow:0 .3rem .6rem 0 #0000000d;top:0;transform:translateY(-120%)}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-vertical.p-top .extend-reduce{box-shadow:0 .3rem .6rem 0 #0000000d;top:100%;transform:translate(-50%,-50%)}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-vertical.p-bottom{border-radius:2rem 2rem 0 0;bottom:0;box-shadow:0 -.3rem .6rem 0 #0000000d;flex-direction:column-reverse;transform:translateY(120%)}[data-gene-ui-version=\"2.12.2\"] .overlay-holder.t-vertical.p-bottom .extend-reduce{bottom:100%;box-shadow:0 -.3rem .6rem 0 #0000000d;transform:translate(-50%,50%)}[data-gene-ui-version=\"2.12.2\"] .overlay-head{flex-shrink:0;position:relative;z-index:1}[data-gene-ui-version=\"2.12.2\"] .overlay-close{align-items:center;background:var(--background);display:flex;height:6rem;justify-content:center;position:absolute;top:0;width:6rem}[data-gene-ui-version=\"2.12.2\"] .overlay-body{display:flex;flex:auto;flex-direction:column;position:relative}[data-gene-ui-version=\"2.12.2\"] .overlay-body>.scroll-holder{height:100%;left:0;position:absolute!important;top:0;width:100%}[data-gene-ui-version=\"2.12.2\"] .overlay-body>.scroll-holder>.scroll-content{align-items:stretch;display:flex;flex-direction:column;justify-content:flex-start}[data-gene-ui-version=\"2.12.2\"] .overlay-body .overlay-content{flex:auto;padding:2.1rem 1.9rem}[data-gene-ui-version=\"2.12.2\"] .overlay-body .overlay-footer{display:flex;flex-shrink:0;justify-content:flex-end}[data-gene-ui-version=\"2.12.2\"] .overlay-body .overlay-footer>*{margin:1rem}[data-gene-ui-version=\"2.12.2\"] .extend-reduce{background:var(--background);border-radius:3.6rem;color:var(--hero);cursor:pointer;font:600 1.4rem/1.8rem var(--font-family);height:3.6rem;left:50%;min-width:14rem;padding:0 2rem;position:absolute;text-align:center;transition:color .3s,background .3s}[data-gene-ui-version=\"2.12.2\"] .extend-reduce:hover{background:var(--hero);color:var(--hero-sc)}";
|
|
25
|
+
styleInject(css_248z);
|
|
26
|
+
|
|
27
|
+
const horizontalSizes = ['half', 'wide', 'minimal'];
|
|
28
|
+
function Overlay(_ref) {
|
|
29
|
+
let {
|
|
30
|
+
position,
|
|
31
|
+
title,
|
|
32
|
+
description,
|
|
33
|
+
horizontalSize,
|
|
34
|
+
headerActions,
|
|
35
|
+
footer,
|
|
36
|
+
children,
|
|
37
|
+
onClose,
|
|
38
|
+
onClickOutside,
|
|
39
|
+
className,
|
|
40
|
+
closeText,
|
|
41
|
+
reduceText,
|
|
42
|
+
extendText,
|
|
43
|
+
withBackDrop,
|
|
44
|
+
onToggle,
|
|
45
|
+
isExtended,
|
|
46
|
+
...restProps
|
|
47
|
+
} = _ref;
|
|
48
|
+
const setRef = useClickOutside(onClickOutside);
|
|
49
|
+
const [extended, setExtended] = useState(!!isExtended);
|
|
50
|
+
const isControlled = useMemo(() => typeof isExtended === 'boolean', [isExtended]);
|
|
51
|
+
const isVertical = useMemo(() => position === 'top' || position === 'bottom', [position]);
|
|
52
|
+
const toggleExtended = useCallback(() => setExtended(prev => !prev), []);
|
|
53
|
+
const handleToggle = useCallback(event => {
|
|
54
|
+
isControlled ? onToggle(event, extended) : toggleExtended();
|
|
55
|
+
}, [onToggle, extended]);
|
|
56
|
+
useKeyDown(e => onClose(e), [], {
|
|
57
|
+
current: window
|
|
58
|
+
}, ['Escape']);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
setExtended(isExtended);
|
|
61
|
+
}, [isExtended]);
|
|
62
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
63
|
+
className: classnames(className, 'overlay-holder', "p-".concat(position), {
|
|
64
|
+
't-vertical': isVertical,
|
|
65
|
+
't-horizontal': !isVertical,
|
|
66
|
+
's-extended': isVertical && extended,
|
|
67
|
+
["s-".concat(horizontalSize)]: !isVertical
|
|
68
|
+
})
|
|
69
|
+
}, restProps, {
|
|
70
|
+
ref: setRef
|
|
71
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
72
|
+
className: "overlay-head"
|
|
73
|
+
}, /*#__PURE__*/React__default.createElement(ModuleTitle, {
|
|
74
|
+
size: "extra-big",
|
|
75
|
+
title: title,
|
|
76
|
+
description: description,
|
|
77
|
+
position: isVertical ? position : 'top',
|
|
78
|
+
cornerRadius: isVertical ? 'position-radius' : 'no-radius'
|
|
79
|
+
}, headerActions, isVertical && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Divider, {
|
|
80
|
+
type: "vertical"
|
|
81
|
+
}), /*#__PURE__*/React__default.createElement(Button, {
|
|
82
|
+
onClick: onClose,
|
|
83
|
+
appearance: "minimal"
|
|
84
|
+
}, closeText))), !isVertical && /*#__PURE__*/React__default.createElement("div", {
|
|
85
|
+
className: "overlay-close"
|
|
86
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
87
|
+
onClick: onClose,
|
|
88
|
+
icon: "bc-icon-close",
|
|
89
|
+
appearance: "minimal",
|
|
90
|
+
color: "default"
|
|
91
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
92
|
+
className: "overlay-body"
|
|
93
|
+
}, /*#__PURE__*/React__default.createElement(CustomScrollbar, null, /*#__PURE__*/React__default.createElement("div", {
|
|
94
|
+
className: "overlay-content"
|
|
95
|
+
}, children), isVertical && /*#__PURE__*/React__default.createElement("div", {
|
|
96
|
+
className: "overlay-footer"
|
|
97
|
+
}, footer)), isVertical && /*#__PURE__*/React__default.createElement("button", {
|
|
98
|
+
onClick: handleToggle,
|
|
99
|
+
className: "extend-reduce"
|
|
100
|
+
}, extended ? reduceText : extendText))), withBackDrop && /*#__PURE__*/React__default.createElement("div", {
|
|
101
|
+
className: "overlay-back-drop"
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
Overlay.propTypes = {
|
|
105
|
+
/**
|
|
106
|
+
* Controls position of the element
|
|
107
|
+
*/
|
|
108
|
+
position: PropTypes.oneOf(positions),
|
|
109
|
+
/**
|
|
110
|
+
* Title for element
|
|
111
|
+
*/
|
|
112
|
+
title: PropTypes.string,
|
|
113
|
+
/**
|
|
114
|
+
* Description text for element
|
|
115
|
+
*/
|
|
116
|
+
description: PropTypes.string,
|
|
117
|
+
/**
|
|
118
|
+
* Controls size of the element
|
|
119
|
+
*/
|
|
120
|
+
horizontalSize: PropTypes.oneOf(horizontalSizes),
|
|
121
|
+
/**
|
|
122
|
+
* Header action bar,
|
|
123
|
+
* React valid elements
|
|
124
|
+
*/
|
|
125
|
+
headerActions: PropTypes.node,
|
|
126
|
+
/**
|
|
127
|
+
* Overlay footer
|
|
128
|
+
* React valid elements
|
|
129
|
+
*/
|
|
130
|
+
footer: PropTypes.node,
|
|
131
|
+
/**
|
|
132
|
+
* Overlay content
|
|
133
|
+
* Valid React elements
|
|
134
|
+
*/
|
|
135
|
+
children: PropTypes.node,
|
|
136
|
+
/**
|
|
137
|
+
* Fires event when user click on close button
|
|
138
|
+
* (event: Event) => void
|
|
139
|
+
*/
|
|
140
|
+
onClose: PropTypes.func,
|
|
141
|
+
/**
|
|
142
|
+
* CSS class for element
|
|
143
|
+
*/
|
|
144
|
+
className: PropTypes.string,
|
|
145
|
+
/**
|
|
146
|
+
* Custom text for close button
|
|
147
|
+
*/
|
|
148
|
+
closeText: PropTypes.string,
|
|
149
|
+
/**
|
|
150
|
+
* Custom text for reduce button
|
|
151
|
+
*/
|
|
152
|
+
reduceText: PropTypes.string,
|
|
153
|
+
/**
|
|
154
|
+
* Custom text for extend button
|
|
155
|
+
*/
|
|
156
|
+
extendText: PropTypes.string,
|
|
157
|
+
/**
|
|
158
|
+
* Fires event when user click on outside of content
|
|
159
|
+
* (event: Event) => void
|
|
160
|
+
*/
|
|
161
|
+
onClickOutside: PropTypes.func,
|
|
162
|
+
/**
|
|
163
|
+
* Adds a white layer on the background when Overlay opens
|
|
164
|
+
*/
|
|
165
|
+
withBackDrop: PropTypes.bool,
|
|
166
|
+
/**
|
|
167
|
+
* with onToggle prop you wash the event listener pressing the open and close button
|
|
168
|
+
* (event: Event, extend: Boolean) => void
|
|
169
|
+
*/
|
|
170
|
+
onToggle: PropTypes.func,
|
|
171
|
+
/**
|
|
172
|
+
* using isExtended props you can control the opening of the component
|
|
173
|
+
* if you add this prop then the component becomes controlled from outside
|
|
174
|
+
*/
|
|
175
|
+
isExtended: PropTypes.bool
|
|
176
|
+
};
|
|
177
|
+
Overlay.defaultProps = {
|
|
178
|
+
position: positions[2],
|
|
179
|
+
horizontalSize: horizontalSizes[0],
|
|
180
|
+
closeText: 'Close',
|
|
181
|
+
reduceText: 'Reduce',
|
|
182
|
+
onClickOutside: noop,
|
|
183
|
+
extendText: 'Extend',
|
|
184
|
+
onClose: noop,
|
|
185
|
+
onToggle: noop,
|
|
186
|
+
withBackDrop: false
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export { Overlay as default };
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default, { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
5
|
+
import '../configs-fed6ac34.js';
|
|
6
|
+
import useClickOutside from '../hooks/useClickOutside.js';
|
|
7
|
+
import Icon from '../Icon/index.js';
|
|
8
|
+
import Portal from '../Portal/index.js';
|
|
9
|
+
import Popover from '../Popover/index.js';
|
|
10
|
+
import Menu from '../Menu/index.js';
|
|
11
|
+
import { D as Dropdown } from '../index-34e47647.js';
|
|
12
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
13
|
+
import '../dateValidation-67caec66.js';
|
|
14
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
15
|
+
import 'react-dom';
|
|
16
|
+
import '../index-6ff23041.js';
|
|
17
|
+
import '../GeneUIProvider/index.js';
|
|
18
|
+
import '../Popover-f4d1cac0.js';
|
|
19
|
+
import '../index-122432cd.js';
|
|
20
|
+
import '../hooks/useDeviceType.js';
|
|
21
|
+
import '../hooks/useWindowSize.js';
|
|
22
|
+
import '../hooks/useUpdatableRef.js';
|
|
23
|
+
import '../hooks/useForceUpdate.js';
|
|
24
|
+
import '../Scrollbar/index.js';
|
|
25
|
+
import '../guid-8ddf77b3.js';
|
|
26
|
+
import '../Option/index.js';
|
|
27
|
+
import '../hooks/useEllipsisDetection.js';
|
|
28
|
+
import '../Tooltip/index.js';
|
|
29
|
+
import '../objectWithoutPropertiesLoose-d8a4a68c.js';
|
|
30
|
+
import '../react-lifecycles-compat.es-6e1f3768.js';
|
|
31
|
+
import '../clsx.m-2bb6df4b.js';
|
|
32
|
+
import '../hooks/useMount.js';
|
|
33
|
+
import '../hooks/useClick.js';
|
|
34
|
+
import '../hooks/useKeyDown.js';
|
|
35
|
+
import '../BusyLoader/index.js';
|
|
36
|
+
import '../Empty/index.js';
|
|
37
|
+
import '../index-462461c0.js';
|
|
38
|
+
import '../debounce-4419bc2f.js';
|
|
39
|
+
import '../ExtendedInput/index.js';
|
|
40
|
+
import '../SuggestionList/index.js';
|
|
41
|
+
import '../config-0ca92874.js';
|
|
42
|
+
import '../Checkbox/index.js';
|
|
43
|
+
import '../checkboxRadioSwitcher-5b69d7bd.js';
|
|
44
|
+
import '../index-2ad83e03.js';
|
|
45
|
+
import '../Tag/index.js';
|
|
46
|
+
|
|
47
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .overspread-container{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:300}[data-gene-ui-version=\"2.12.2\"] .overspread-holder{animation:overspread-reveal .5s forwards;background:var(--background);display:grid;grid-template-columns:100%;grid-template-rows:auto 1fr;height:100%;transform:translate3d(0,100%,0);width:100%}@keyframes overspread-reveal{to{transform:translateZ(0)}}[data-gene-ui-version=\"2.12.2\"] .overspread-head{border-bottom:1px solid rgba(var(--background-sc-rgb),.05);display:grid;grid-template-areas:\"left center right\";grid-template-columns:1fr auto 1fr;padding:0 1rem;position:relative;width:100%}[data-gene-ui-version=\"2.12.2\"] .overspread-head>li{align-items:center;display:flex;height:4.6rem;overflow:hidden}[data-gene-ui-version=\"2.12.2\"] .overspread-head>li.over-h-act{font:600 1.5rem/2.3rem var(--font-family);grid-area:left;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;width:100%}[data-gene-ui-version=\"2.12.2\"] .overspread-head>li.over-h-act:last-child{grid-area:right;justify-content:flex-end}[data-gene-ui-version=\"2.12.2\"] .overspread-head>li.over-h-tt{font:600 1.7rem/2.3rem var(--font-family);grid-area:center}[data-gene-ui-version=\"2.12.2\"] .overspread-head>li>*{margin:0 .5rem}[data-gene-ui-version=\"2.12.2\"] .overspread-head>li .color-hero{color:var(--hero)}[data-gene-ui-version=\"2.12.2\"] .overspread-head button{transition:opacity .4s}[data-gene-ui-version=\"2.12.2\"] .overspread-head button:disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .overspread-body{-webkit-overflow-scrolling:touch;overflow-y:auto;padding:1.5rem}[data-gene-ui-version=\"2.12.2\"] .overspread-search{position:relative}[data-gene-ui-version=\"2.12.2\"] .overspread-search:not(:focus-within,.show-search) input{height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}[data-gene-ui-version=\"2.12.2\"] .overspread-search:not(:focus-within,.show-search) .bc-icon-search{pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .overspread-search:not(:focus-within,.show-search) .bc-icon-close{display:none}[data-gene-ui-version=\"2.12.2\"] .overspread-search.show-search,[data-gene-ui-version=\"2.12.2\"] .overspread-search:focus-within{background:var(--background);display:flex;left:0;margin:0;padding:0 1rem;position:absolute;top:50%;transform:translateY(-50%);width:100%;z-index:10}[data-gene-ui-version=\"2.12.2\"] .overspread-search.show-search>*,[data-gene-ui-version=\"2.12.2\"] .overspread-search:focus-within>*{padding:0 .5rem}[data-gene-ui-version=\"2.12.2\"] .overspread-search.show-search .bc-icon-search,[data-gene-ui-version=\"2.12.2\"] .overspread-search:focus-within .bc-icon-search{display:none}[data-gene-ui-version=\"2.12.2\"] .overspread-search.show-search input,[data-gene-ui-version=\"2.12.2\"] .overspread-search:focus-within input{font:600 1.4rem var(--font-family);height:2.4rem;width:100%}[data-gene-ui-version=\"2.12.2\"] .overspread-search.show-search input::input-placeholder,[data-gene-ui-version=\"2.12.2\"] .overspread-search:focus-within input::input-placeholder{color:rgba(var(--background-sc-rgb),.5);font-size:1.4rem;font-weight:600}[data-gene-ui-version=\"2.12.2\"] .overspread-search.show-search input:placeholder,[data-gene-ui-version=\"2.12.2\"] .overspread-search:focus-within input:placeholder{color:rgba(var(--background-sc-rgb),.5);font-size:1.4rem;font-weight:600}[data-gene-ui-version=\"2.12.2\"] .overspread-search.show-search input::placeholder,[data-gene-ui-version=\"2.12.2\"] .overspread-search:focus-within input::placeholder{color:rgba(var(--background-sc-rgb),.5);font-size:1.4rem;font-weight:600}[data-gene-ui-version=\"2.12.2\"] .overspread-search.show-search input:input-placeholder,[data-gene-ui-version=\"2.12.2\"] .overspread-search:focus-within input:input-placeholder{color:rgba(var(--background-sc-rgb),.5);font-size:1.4rem;font-weight:600}[data-gene-ui-version=\"2.12.2\"] .back-button-holder{align-items:center;cursor:pointer;display:flex}";
|
|
48
|
+
styleInject(css_248z);
|
|
49
|
+
|
|
50
|
+
function Overspread(props) {
|
|
51
|
+
const {
|
|
52
|
+
opened,
|
|
53
|
+
title,
|
|
54
|
+
hasDone,
|
|
55
|
+
disabledDone,
|
|
56
|
+
children,
|
|
57
|
+
hasSearch,
|
|
58
|
+
hasOptions,
|
|
59
|
+
titleHasOptions,
|
|
60
|
+
searchOutput,
|
|
61
|
+
hasBack,
|
|
62
|
+
doneText,
|
|
63
|
+
backWithIcon,
|
|
64
|
+
backText,
|
|
65
|
+
doneWithIcon,
|
|
66
|
+
onClose,
|
|
67
|
+
onDone,
|
|
68
|
+
onBack,
|
|
69
|
+
onSelectingOption,
|
|
70
|
+
onSelectingTitleOption,
|
|
71
|
+
dataForOptions,
|
|
72
|
+
dataForTitleWithOptions,
|
|
73
|
+
defaultValueForTitleWithOptions,
|
|
74
|
+
onAnimationEnd,
|
|
75
|
+
...restProps
|
|
76
|
+
} = props;
|
|
77
|
+
const isControlled = ('opened' in props);
|
|
78
|
+
const [isOpen, setIsOpen] = useState(opened);
|
|
79
|
+
const [optionsPopoverIsOpen, setOptionsPopoverIsOpen] = useState(false);
|
|
80
|
+
const portalRef = useRef(null);
|
|
81
|
+
useEffect(() => setIsOpen(opened), [opened]);
|
|
82
|
+
const handleSearchOutput = useCallback(e => {
|
|
83
|
+
searchOutput && searchOutput(e.target.value);
|
|
84
|
+
}, [searchOutput]);
|
|
85
|
+
const handleClose = useCallback(e => {
|
|
86
|
+
!isControlled && setIsOpen(isOpen => !isOpen);
|
|
87
|
+
onClose && onClose(e);
|
|
88
|
+
}, [onClose, isControlled]);
|
|
89
|
+
const handleDone = useCallback(e => {
|
|
90
|
+
!isControlled && setIsOpen(isOpen => !isOpen);
|
|
91
|
+
onDone && onDone(e);
|
|
92
|
+
}, [onDone, isControlled]);
|
|
93
|
+
const outsideClickHandler = useCallback(() => {
|
|
94
|
+
setOptionsPopoverIsOpen(false);
|
|
95
|
+
}, []);
|
|
96
|
+
const outsideClickRef = useClickOutside(outsideClickHandler);
|
|
97
|
+
const onAnimationEndHandler = useCallback(() => {
|
|
98
|
+
onAnimationEnd && onAnimationEnd();
|
|
99
|
+
}, [onAnimationEnd]);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
var _portalRef$current;
|
|
102
|
+
portalRef === null || portalRef === void 0 ? void 0 : (_portalRef$current = portalRef.current) === null || _portalRef$current === void 0 ? void 0 : _portalRef$current.addEventListener('animationend', onAnimationEndHandler);
|
|
103
|
+
}, [portalRef.current, isOpen]);
|
|
104
|
+
const cleanup = () => {
|
|
105
|
+
var _portalRef$current2;
|
|
106
|
+
portalRef === null || portalRef === void 0 ? void 0 : (_portalRef$current2 = portalRef.current) === null || _portalRef$current2 === void 0 ? void 0 : _portalRef$current2.removeEventListener('animationend', onAnimationEndHandler);
|
|
107
|
+
};
|
|
108
|
+
useEffect(() => cleanup, []);
|
|
109
|
+
return /*#__PURE__*/React__default.createElement(Portal, {
|
|
110
|
+
isOpen: isOpen
|
|
111
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
112
|
+
className: "overspread-container"
|
|
113
|
+
}, restProps), /*#__PURE__*/React__default.createElement("div", {
|
|
114
|
+
className: "overspread-holder",
|
|
115
|
+
ref: portalRef
|
|
116
|
+
}, /*#__PURE__*/React__default.createElement("ul", {
|
|
117
|
+
className: "overspread-head"
|
|
118
|
+
}, /*#__PURE__*/React__default.createElement("li", {
|
|
119
|
+
className: "over-h-act"
|
|
120
|
+
}, hasBack ? /*#__PURE__*/React__default.createElement("p", {
|
|
121
|
+
onClick: onBack,
|
|
122
|
+
className: "back-button-holder cursor-pointer"
|
|
123
|
+
}, backWithIcon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
124
|
+
type: "bc-icon-arrow-left"
|
|
125
|
+
}), /*#__PURE__*/React__default.createElement("span", null, backText)) : /*#__PURE__*/React__default.createElement(Icon, {
|
|
126
|
+
type: "bc-icon-close",
|
|
127
|
+
onClick: handleClose,
|
|
128
|
+
className: "cursor-pointer"
|
|
129
|
+
})), /*#__PURE__*/React__default.createElement("li", {
|
|
130
|
+
className: "over-h-tt"
|
|
131
|
+
}, titleHasOptions ? /*#__PURE__*/React__default.createElement(Dropdown, {
|
|
132
|
+
hasSearch: false,
|
|
133
|
+
value: defaultValueForTitleWithOptions.value,
|
|
134
|
+
data: dataForTitleWithOptions,
|
|
135
|
+
placeholder: " ",
|
|
136
|
+
appearance: "light",
|
|
137
|
+
onChange: onSelectingTitleOption,
|
|
138
|
+
flexibility: "content-size"
|
|
139
|
+
}) : /*#__PURE__*/React__default.createElement("p", {
|
|
140
|
+
className: "ellipsis-text"
|
|
141
|
+
}, title)), /*#__PURE__*/React__default.createElement("li", {
|
|
142
|
+
className: "over-h-act"
|
|
143
|
+
}, hasSearch && /*#__PURE__*/React__default.createElement("div", {
|
|
144
|
+
className: "overspread-search cursor-pointer"
|
|
145
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
146
|
+
type: "bc-icon-close"
|
|
147
|
+
}), /*#__PURE__*/React__default.createElement("input", {
|
|
148
|
+
onChange: handleSearchOutput,
|
|
149
|
+
placeholder: "Search"
|
|
150
|
+
}), /*#__PURE__*/React__default.createElement(Icon, {
|
|
151
|
+
type: "bc-icon-search"
|
|
152
|
+
})), hasOptions && /*#__PURE__*/React__default.createElement(Popover, {
|
|
153
|
+
isOpen: optionsPopoverIsOpen,
|
|
154
|
+
extendTargetWidth: false,
|
|
155
|
+
Content: /*#__PURE__*/React__default.createElement(Menu, {
|
|
156
|
+
ref: outsideClickRef,
|
|
157
|
+
data: dataForOptions,
|
|
158
|
+
onSelect: function () {
|
|
159
|
+
setOptionsPopoverIsOpen(false);
|
|
160
|
+
onSelectingOption(...arguments);
|
|
161
|
+
}
|
|
162
|
+
}),
|
|
163
|
+
align: "end"
|
|
164
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
165
|
+
type: "bc-icon-more-vertical",
|
|
166
|
+
onClick: () => setOptionsPopoverIsOpen(true)
|
|
167
|
+
})), hasDone && /*#__PURE__*/React__default.createElement("button", {
|
|
168
|
+
disabled: disabledDone,
|
|
169
|
+
onClick: handleDone,
|
|
170
|
+
className: "color-hero cursor-pointer"
|
|
171
|
+
}, doneWithIcon ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
172
|
+
type: "bc-icon-checkbox-checked"
|
|
173
|
+
}) : doneText))), children && /*#__PURE__*/React__default.createElement("div", {
|
|
174
|
+
className: "overspread-body"
|
|
175
|
+
}, children))));
|
|
176
|
+
}
|
|
177
|
+
Overspread.propTypes = {
|
|
178
|
+
title: PropTypes.string,
|
|
179
|
+
/**
|
|
180
|
+
* Enables title's dropdown,
|
|
181
|
+
*/
|
|
182
|
+
titleHasOptions: PropTypes.bool,
|
|
183
|
+
/**
|
|
184
|
+
* Fires event for handling change of value/selected option
|
|
185
|
+
* ((event: Event) => void)
|
|
186
|
+
*/
|
|
187
|
+
onSelectingTitleOption: PropTypes.func,
|
|
188
|
+
/**
|
|
189
|
+
* Title's dropdown data
|
|
190
|
+
*/
|
|
191
|
+
dataForTitleWithOptions: PropTypes.array,
|
|
192
|
+
/**
|
|
193
|
+
* Default value for title's dropdown
|
|
194
|
+
*/
|
|
195
|
+
defaultValueForTitleWithOptions: PropTypes.object,
|
|
196
|
+
/**
|
|
197
|
+
* Enables search,
|
|
198
|
+
*/
|
|
199
|
+
hasSearch: PropTypes.bool,
|
|
200
|
+
/**
|
|
201
|
+
* Fires event when user types in search field
|
|
202
|
+
* (event: Event) => void
|
|
203
|
+
*/
|
|
204
|
+
searchOutput: PropTypes.func,
|
|
205
|
+
/**
|
|
206
|
+
* Displays dropdown on the right corner,
|
|
207
|
+
*/
|
|
208
|
+
hasOptions: PropTypes.bool,
|
|
209
|
+
/**
|
|
210
|
+
* Right corner dropdown's data
|
|
211
|
+
*/
|
|
212
|
+
dataForOptions: PropTypes.array,
|
|
213
|
+
/**
|
|
214
|
+
* Fires event for handling change of value/selected option
|
|
215
|
+
* ((event: Event) => void)
|
|
216
|
+
*/
|
|
217
|
+
onSelectingOption: PropTypes.func,
|
|
218
|
+
/** Opened state */
|
|
219
|
+
opened: PropTypes.bool,
|
|
220
|
+
/**
|
|
221
|
+
* Any valid node
|
|
222
|
+
*/
|
|
223
|
+
children: PropTypes.node,
|
|
224
|
+
/**
|
|
225
|
+
* Enables done button on the right corner,
|
|
226
|
+
*/
|
|
227
|
+
hasDone: PropTypes.bool,
|
|
228
|
+
/**
|
|
229
|
+
* Shows done icon instead of text
|
|
230
|
+
*/
|
|
231
|
+
doneWithIcon: PropTypes.bool,
|
|
232
|
+
/**
|
|
233
|
+
* Done button disabled state
|
|
234
|
+
*/
|
|
235
|
+
disabledDone: PropTypes.bool,
|
|
236
|
+
/**
|
|
237
|
+
* Custom text for done button
|
|
238
|
+
*/
|
|
239
|
+
doneText: PropTypes.string,
|
|
240
|
+
/**
|
|
241
|
+
* Fires event when done button is clicked
|
|
242
|
+
* ((event: Event) => void)
|
|
243
|
+
*/
|
|
244
|
+
onDone: PropTypes.func,
|
|
245
|
+
/**
|
|
246
|
+
* Enables back button on the left corner,
|
|
247
|
+
*/
|
|
248
|
+
hasBack: PropTypes.bool,
|
|
249
|
+
/**
|
|
250
|
+
* Custom text for back button
|
|
251
|
+
*/
|
|
252
|
+
backText: PropTypes.string,
|
|
253
|
+
/**
|
|
254
|
+
* Displays chevron icon in back button
|
|
255
|
+
*/
|
|
256
|
+
backWithIcon: PropTypes.bool,
|
|
257
|
+
/**
|
|
258
|
+
* Fires event when back button is clicked
|
|
259
|
+
* ((event: Event) => void)
|
|
260
|
+
*/
|
|
261
|
+
onBack: PropTypes.func,
|
|
262
|
+
/**
|
|
263
|
+
* Fires event when close icon is clicked
|
|
264
|
+
* ((event: Event) => void)
|
|
265
|
+
*/
|
|
266
|
+
onClose: PropTypes.func,
|
|
267
|
+
/**
|
|
268
|
+
* Function calls when the animation ends.
|
|
269
|
+
*/
|
|
270
|
+
onAnimationEnd: PropTypes.func
|
|
271
|
+
};
|
|
272
|
+
Overspread.defaultProps = {
|
|
273
|
+
hasSearch: false,
|
|
274
|
+
hasBack: false,
|
|
275
|
+
hasOptions: false,
|
|
276
|
+
doneText: 'Done',
|
|
277
|
+
titleHasOptions: false,
|
|
278
|
+
backWithIcon: false,
|
|
279
|
+
doneWithIcon: false,
|
|
280
|
+
hasDone: true,
|
|
281
|
+
onDone: noop,
|
|
282
|
+
onBack: noop,
|
|
283
|
+
onClose: noop,
|
|
284
|
+
onSelectingOption: noop,
|
|
285
|
+
onSelectingTitleOption: noop,
|
|
286
|
+
onAnimationEnd: noop
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
export { Overspread as default };
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import React__default, { useState, useCallback } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { c as classnames } from '
|
|
4
|
-
import { a as conflictPropsLog, k as keyboardHandler } from '
|
|
5
|
-
import Button from '
|
|
6
|
-
import Divider from '
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import '
|
|
10
|
-
import
|
|
11
|
-
import '
|
|
12
|
-
import './_commonjsHelpers-24198af3.js';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
4
|
+
import { a as conflictPropsLog, k as keyboardHandler } from '../index-a0e4e333.js';
|
|
5
|
+
import Button from '../Button/index.js';
|
|
6
|
+
import Divider from '../Divider/index.js';
|
|
7
|
+
import Tooltip from '../Tooltip/index.js';
|
|
8
|
+
import TextInput from '../ValidatableTextInput/index.js';
|
|
9
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
10
|
+
import '../dateValidation-67caec66.js';
|
|
11
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
13
12
|
import 'react-dom';
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
-
import '
|
|
21
|
-
import '
|
|
22
|
-
import '
|
|
23
|
-
import '
|
|
24
|
-
import '
|
|
25
|
-
import '
|
|
26
|
-
import '
|
|
13
|
+
import '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
14
|
+
import '../Icon/index.js';
|
|
15
|
+
import '../Popover-f4d1cac0.js';
|
|
16
|
+
import '../configs-fed6ac34.js';
|
|
17
|
+
import '../hooks/useDeviceType.js';
|
|
18
|
+
import '../hooks/useWindowSize.js';
|
|
19
|
+
import '../GeneUIProvider/index.js';
|
|
20
|
+
import '../hooks/useMount.js';
|
|
21
|
+
import '../ExtendedInput/index.js';
|
|
22
|
+
import '../hooks/useEllipsisDetection.js';
|
|
23
|
+
import '../SuggestionList/index.js';
|
|
24
|
+
import '../hooks/useKeyDown.js';
|
|
25
|
+
import '../hooks/useClickOutside.js';
|
|
26
|
+
import '../config-0ca92874.js';
|
|
27
|
+
import '../Scrollbar/index.js';
|
|
27
28
|
|
|
28
|
-
var css_248z = "[data-gene-ui-version=\"
|
|
29
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .pagination-holder{align-items:center;display:flex}[data-gene-ui-version=\"2.12.2\"] .pagination-holder .icon{cursor:pointer}[data-gene-ui-version=\"2.12.2\"] .pagination-holder .defaultCursor{cursor:default}[data-gene-ui-version=\"2.12.2\"] .pagination-holder .input-element{text-align:center}";
|
|
29
30
|
styleInject(css_248z);
|
|
30
31
|
|
|
31
32
|
const drawCount = 5;
|
|
@@ -215,37 +216,37 @@ Pagination.propTypes = {
|
|
|
215
216
|
* Fires event when user changes the page
|
|
216
217
|
* (page: Number) => void
|
|
217
218
|
*/
|
|
218
|
-
onChange:
|
|
219
|
+
onChange: PropTypes.func,
|
|
219
220
|
/**
|
|
220
221
|
* Initially selected page
|
|
221
222
|
*/
|
|
222
|
-
selected:
|
|
223
|
+
selected: PropTypes.number,
|
|
223
224
|
/**
|
|
224
225
|
* Custom text if element will indicate error
|
|
225
226
|
*/
|
|
226
|
-
errorText:
|
|
227
|
+
errorText: PropTypes.string,
|
|
227
228
|
/**
|
|
228
229
|
* Turn on/off pagination's autofocus
|
|
229
230
|
*/
|
|
230
|
-
autoFocus:
|
|
231
|
+
autoFocus: PropTypes.bool,
|
|
231
232
|
/**
|
|
232
233
|
* Initially selected page
|
|
233
234
|
*/
|
|
234
|
-
defaultSelected:
|
|
235
|
+
defaultSelected: PropTypes.number,
|
|
235
236
|
/**
|
|
236
237
|
* Total pages count
|
|
237
238
|
*/
|
|
238
|
-
count:
|
|
239
|
+
count: PropTypes.number.isRequired,
|
|
239
240
|
/**
|
|
240
241
|
* Text for next icon tooltip.
|
|
241
242
|
*/
|
|
242
|
-
nextIconTooltipText:
|
|
243
|
+
nextIconTooltipText: PropTypes.string,
|
|
243
244
|
/**
|
|
244
245
|
* Text for previous icon tooltip.
|
|
245
246
|
*/
|
|
246
|
-
previousIconTooltipText:
|
|
247
|
+
previousIconTooltipText: PropTypes.string,
|
|
247
248
|
// TODO: bad naming
|
|
248
|
-
supportedKeyCodes:
|
|
249
|
+
supportedKeyCodes: PropTypes.arrayOf(PropTypes.number)
|
|
249
250
|
};
|
|
250
251
|
Pagination.defaultProps = {
|
|
251
252
|
count: 1,
|