@geneui/components 3.0.0-next-9ffcb93-16102024 → 3.0.0-next-48d0ef7-31102024
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/Avatar.js +63 -0
- package/CHANGELOG.md +7 -0
- package/Divider.js +23 -0
- package/{GeneUIProvider/index.js → GeneUIProvider.js} +52 -65
- package/HelperText.js +69 -0
- package/Info.js +64 -0
- package/Label.js +38 -0
- package/Loader.js +21 -0
- package/Pill.js +64 -0
- package/TextLink.js +20 -0
- package/{index-65217440.js → Tooltip.js} +104 -80
- package/{lib → components}/atoms/Avatar/Avatar.d.ts +7 -6
- package/components/atoms/Avatar/index.d.ts +1 -0
- package/{lib → components}/atoms/Divider/Divider.d.ts +5 -5
- package/components/atoms/Divider/index.d.ts +1 -0
- package/{lib → components}/atoms/HelperText/HelperText.d.ts +6 -5
- package/components/atoms/HelperText/index.d.ts +1 -0
- package/{lib → components}/atoms/Info/Info.d.ts +5 -5
- package/components/atoms/Info/index.d.ts +1 -0
- package/{lib → components}/atoms/Label/Label.d.ts +3 -3
- package/components/atoms/Label/index.d.ts +1 -0
- package/{lib → components}/atoms/Loader/Loader.d.ts +5 -5
- package/components/atoms/Loader/index.d.ts +1 -0
- package/{lib → components}/atoms/Pill/Pill.d.ts +7 -6
- package/components/atoms/Pill/index.d.ts +1 -0
- package/{lib → components}/atoms/TextLink/TextLink.d.ts +5 -5
- package/components/atoms/TextLink/index.d.ts +1 -0
- package/{lib → components}/molecules/Tooltip/Tooltip.d.ts +26 -21
- package/components/molecules/Tooltip/index.d.ts +1 -0
- package/components/providers/GeneUIProvider/GeneUIProvider.d.ts +30 -0
- package/components/providers/GeneUIProvider/index.d.ts +1 -0
- package/hooks/index.d.ts +2 -20
- package/hooks/useDebounceCallback/index.d.ts +1 -0
- package/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
- package/hooks/useEllipsisDetection/index.d.ts +1 -1
- package/hooks/useEllipsisDetection/useEllipsisDetection.d.ts +2 -2
- package/{index-031ff73c.js → index-ce02421b.js} +4 -4
- package/index.d.ts +11 -121
- package/index.js +12 -159
- package/package.json +24 -43
- package/tokens-0abb4e1b.js +6 -0
- package/types/index.d.ts +0 -3
- package/useEllipsisDetection-46d712b6.js +34 -0
- package/ActionableList/index.js +0 -1694
- package/AdvancedSearch/index.js +0 -892
- package/Alert/index.js +0 -98
- package/Avatar/index.js +0 -58
- package/Badge/index.js +0 -29
- package/Breadcrumb/index.js +0 -130
- package/BusyLoader/index.js +0 -31
- package/Button/index.js +0 -30
- package/Card/index.js +0 -502
- package/CardList/index.js +0 -662
- package/CellMeasurerCache-80be385d.js +0 -229
- package/Charts/index.js +0 -17662
- package/Checkbox/index.js +0 -229
- package/CheckboxGroup/index.js +0 -203
- package/CheckboxGroupWithSearch/index.js +0 -280
- package/Collapse/index.js +0 -195
- package/ColorPicker/index.js +0 -210
- package/ComboBox/index.js +0 -524
- package/Copy/index.js +0 -56
- package/Counter/index.js +0 -312
- package/DateFilter/index.js +0 -183
- package/DatePicker/index.js +0 -1229
- package/DatePickerInput/index.js +0 -883
- package/Divider/index.js +0 -23
- package/Drawer/index.js +0 -261
- package/Dropdown/index.js +0 -43
- package/Editor/index.js +0 -22975
- package/Empty/index.js +0 -76
- package/ExtendedInput/index.js +0 -590
- package/Form/index.js +0 -85
- package/FormContainer/index.js +0 -189
- package/FormableCheckbox/index.js +0 -24
- package/FormableDatePicker/index.js +0 -43
- package/FormableDropdown/index.js +0 -50
- package/FormableEditor/index.js +0 -26
- package/FormableHOC-85f89a81.js +0 -83
- package/FormableMultiSelectDropdown/index.js +0 -50
- package/FormableNumberInput/index.js +0 -34
- package/FormableRadio/index.js +0 -22
- package/FormableSwitcher/index.js +0 -22
- package/FormableTextInput/index.js +0 -34
- package/FormableUploader/index.js +0 -44
- package/Grid/index.js +0 -167
- package/HelperText/index.js +0 -86
- package/Holder/index.js +0 -261
- package/Icon/index.js +0 -62
- package/Image/index.js +0 -45
- package/ImagePreview/index.js +0 -217
- package/Info/index.js +0 -41
- package/InfoOutline-dd2e89d9.js +0 -29
- package/InteractiveWidget/index.js +0 -78
- package/KeyValue/index.js +0 -22
- package/Label/index.js +0 -48
- package/LinkButton/index.js +0 -34
- package/Loader/index.js +0 -23
- package/Menu/index.js +0 -281
- package/MobileNavigation/index.js +0 -94
- package/MobilePopup/index.js +0 -182
- package/Modal/index.js +0 -251
- package/ModuleTitle/index.js +0 -141
- package/NavigationMenu/index.js +0 -222
- package/Notification/index.js +0 -120
- package/Option/index.js +0 -184
- package/Overlay/index.js +0 -187
- package/Overspread/index.js +0 -291
- package/Pagination/index.js +0 -261
- package/Paper/index.js +0 -96
- package/Pill/index.js +0 -67
- package/Popover/index.js +0 -725
- package/PopoverV2/index.js +0 -19
- package/Portal/index.js +0 -58
- package/Products/index.js +0 -115
- package/Profile/index.js +0 -589
- package/Progress/index.js +0 -200
- package/QRCode/index.js +0 -814
- package/Radio/index.js +0 -151
- package/RadioGroup/index.js +0 -104
- package/Range/index.js +0 -191
- package/Rating/index.js +0 -174
- package/RichEditor/index.js +0 -13
- package/RichEditor-78c2617e.js +0 -228
- package/Scrollbar/index.js +0 -1585
- package/Search/index.js +0 -75
- package/SearchWithDropdown/index.js +0 -140
- package/Section/index.js +0 -61
- package/SkeletonLoader/index.js +0 -81
- package/Slider/index.js +0 -261
- package/Status/index.js +0 -97
- package/Steps/index.js +0 -314
- package/SuggestionList/index.js +0 -385
- package/Switcher/index.js +0 -193
- package/Table/index.js +0 -57
- package/TableCompositions/index.js +0 -16995
- package/Tabs/index.js +0 -235
- package/Tag/index.js +0 -102
- package/TextLink/index.js +0 -20
- package/Textarea/index.js +0 -242
- package/Time/index.js +0 -62
- package/TimePicker/index.js +0 -575
- package/Timeline/index.js +0 -113
- package/Title/index.js +0 -65
- package/Toaster/index.js +0 -116
- package/Tooltip/index.js +0 -6
- package/TransferList/index.js +0 -493
- package/Uploader/index.js +0 -992
- package/ValidatableCheckbox/index.js +0 -123
- package/ValidatableDatePicker/index.js +0 -316
- package/ValidatableDropdown/index.js +0 -141
- package/ValidatableElements/index.js +0 -67
- package/ValidatableMultiSelectDropdown/index.js +0 -152
- package/ValidatableNumberInput/index.js +0 -204
- package/ValidatableRadio/index.js +0 -116
- package/ValidatableSwitcher/index.js +0 -93
- package/ValidatableTextInput/index.js +0 -167
- package/ValidatableTimeInput/index.js +0 -174
- package/ValidatableUploader/index.js +0 -98
- package/Widget/index.js +0 -225
- package/_commonjsHelpers-24198af3.js +0 -35
- package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
- package/callAfterDelay-7272faca.js +0 -12
- package/checkTimeValidation-e56771be.js +0 -16
- package/checkboxRadioSwitcher-5b69d7bd.js +0 -4
- package/clsx.m-2bb6df4b.js +0 -3
- package/config-1053d64d.js +0 -20
- package/configs-00612ce0.js +0 -103
- package/configs.js +0 -111
- package/dateValidation-67caec66.js +0 -225
- package/debounce-4419bc2f.js +0 -17
- package/guid-8ddf77b3.js +0 -16
- package/hooks/useBodyScroll.js +0 -16
- package/hooks/useClick.js +0 -18
- package/hooks/useClickOutside.js +0 -25
- package/hooks/useDebounce.js +0 -28
- package/hooks/useDeviceType.js +0 -17
- package/hooks/useDidMount.js +0 -15
- package/hooks/useForceUpdate.js +0 -8
- package/hooks/useHover.js +0 -20
- package/hooks/useImgDownload.js +0 -18
- package/hooks/useKeyDown.js +0 -21
- package/hooks/useMount.js +0 -13
- package/hooks/useMutationObserver.js +0 -21
- package/hooks/usePrevious.js +0 -10
- package/hooks/useThrottle.js +0 -16
- package/hooks/useToggle.js +0 -11
- package/hooks/useUpdatableRef.js +0 -14
- package/hooks/useUpdate.js +0 -10
- package/hooks/useWidth.js +0 -16
- package/hooks/useWindowSize.js +0 -40
- package/index-122432cd.js +0 -270
- package/index-262edd7a.js +0 -77
- package/index-2f5aa51e.js +0 -6483
- package/index-370f9acd.js +0 -4
- package/index-45eafea6.js +0 -90
- package/index-480fd7d9.js +0 -10032
- package/index-5f37f281.js +0 -168
- package/index-73aaa093.js +0 -1940
- package/index.mobile.d.ts +0 -14
- package/lib/atoms/Avatar/index.d.ts +0 -1
- package/lib/atoms/Badge/Badge.d.ts +0 -36
- package/lib/atoms/Badge/index.d.ts +0 -1
- package/lib/atoms/BusyLoader/BusyLoader.d.ts +0 -32
- package/lib/atoms/BusyLoader/BusyLoaderHolderHOC.d.ts +0 -8
- package/lib/atoms/BusyLoader/index.d.ts +0 -1
- package/lib/atoms/Button/Button.d.ts +0 -70
- package/lib/atoms/Button/index.d.ts +0 -1
- package/lib/atoms/Divider/index.d.ts +0 -1
- package/lib/atoms/Empty/Empty.d.ts +0 -39
- package/lib/atoms/Empty/index.d.ts +0 -1
- package/lib/atoms/Empty/utils.d.ts +0 -9
- package/lib/atoms/HelperText/index.d.ts +0 -1
- package/lib/atoms/Image/Image.d.ts +0 -51
- package/lib/atoms/Image/index.d.ts +0 -1
- package/lib/atoms/ImagePreview/ImagePreview.d.ts +0 -56
- package/lib/atoms/ImagePreview/ImagePreviewHOC.d.ts +0 -4
- package/lib/atoms/ImagePreview/Magnifier.d.ts +0 -40
- package/lib/atoms/ImagePreview/index.d.ts +0 -1
- package/lib/atoms/Info/index.d.ts +0 -1
- package/lib/atoms/KeyValue/KeyValue.d.ts +0 -29
- package/lib/atoms/KeyValue/index.d.ts +0 -1
- package/lib/atoms/Label/index.d.ts +0 -1
- package/lib/atoms/LinkButton/LinkButton.d.ts +0 -46
- package/lib/atoms/LinkButton/index.d.ts +0 -1
- package/lib/atoms/Loader/index.d.ts +0 -1
- package/lib/atoms/Pill/index.d.ts +0 -1
- package/lib/atoms/Rating/DefaultSvg.d.ts +0 -3
- package/lib/atoms/Rating/Rating.d.ts +0 -49
- package/lib/atoms/Rating/index.d.ts +0 -1
- package/lib/atoms/TextLink/index.d.ts +0 -1
- package/lib/molecules/Copy/Copy.d.ts +0 -38
- package/lib/molecules/Copy/index.d.ts +0 -1
- package/lib/molecules/InteractiveWidget/InteractiveWidget.d.ts +0 -70
- package/lib/molecules/InteractiveWidget/InteractiveWidgetIcon.d.ts +0 -8
- package/lib/molecules/InteractiveWidget/index.d.ts +0 -1
- package/lib/molecules/Tooltip/index.d.ts +0 -1
- package/lib/providers/GeneUIProvider/GeneUIProvider.d.ts +0 -30
- package/lib/providers/GeneUIProvider/index.d.ts +0 -1
- package/localization-4ba17032.js +0 -46
- package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
- package/rangeAndSlider-693a3d41.js +0 -8684
- package/react-beautiful-dnd.esm-b637016a.js +0 -10116
- package/react-lifecycles-compat.es-6e1f3768.js +0 -158
- package/redux-e591c1b8.js +0 -536
- package/tokens-8ab1179c.js +0 -6
- package/tslib.es6-f211516f.js +0 -35
- package/useEllipsisDetection-c1c9ad94.js +0 -38
package/Menu/index.js
DELETED
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
2
|
-
import React__default, { forwardRef, useMemo, useState, useRef, useEffect, useCallback } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
5
|
-
import { s as screenTypes } from '../configs-00612ce0.js';
|
|
6
|
-
import Option from '../Option/index.js';
|
|
7
|
-
import CustomScrollbar from '../Scrollbar/index.js';
|
|
8
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
9
|
-
import '../dateValidation-67caec66.js';
|
|
10
|
-
import '../_commonjsHelpers-24198af3.js';
|
|
11
|
-
import 'react-dom';
|
|
12
|
-
import '../hooks/useDeviceType.js';
|
|
13
|
-
import '../hooks/useWindowSize.js';
|
|
14
|
-
import '../hooks/useDebounce.js';
|
|
15
|
-
import '../useEllipsisDetection-c1c9ad94.js';
|
|
16
|
-
import '../Icon/index.js';
|
|
17
|
-
import '../index-65217440.js';
|
|
18
|
-
import '../tslib.es6-f211516f.js';
|
|
19
|
-
import '../GeneUIProvider/index.js';
|
|
20
|
-
|
|
21
|
-
const findDeep = function (data, indexStack) {
|
|
22
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
23
|
-
return index < indexStack.length ? findDeep(data[indexStack[index]].children, indexStack, index + 1) : data;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var css_248z = "[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper{min-width:18rem;overflow:hidden;white-space:nowrap;width:100%}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper>ul{display:flex;min-width:100%;transform:translateX(calc(var(--translate-x)*-1));transition:transform .3s}html[dir=rtl] .menu-items-wrapper>ul{transform:translateX(var(--translate-x))}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper>ul.reversed>li:first-child{order:0}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper>ul.reversed>li:nth-child(2){order:2}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper>ul.reversed>li:nth-child(3){order:1}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper>ul>li{display:flex;flex-direction:column;flex-shrink:0;width:100%}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .divider.type-horizontal{margin:0;width:100%}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .divider.type-horizontal.full-width{margin:1rem 0;width:100%}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-item{align-items:center;cursor:pointer;display:flex;font:600 1.4rem/2rem var(--font-family);padding:1rem 1.4rem;transition:color .3s,background .3s}[data-gene-ui-version=\"2.16.3\"] .popover-positioner.mobile-view .menu-items-wrapper .menu-item{padding:1.4rem 2rem}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-item.highlighted{color:var(--hero)}@media (hover:hover){[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-item:hover{background:rgba(var(--background-sc-rgb),.05)}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-item.act-direction:hover{background:var(--hero);color:var(--hero-sc)}}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-item .icon{margin:-.2rem 0}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-item .icon.menu-custom-icon{margin-inline-end:1rem}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-item.header{flex-direction:row-reverse}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-text{flex:auto}[data-gene-ui-version=\"2.16.3\"] .menu-items-wrapper .menu-text .small-text{font-size:1.2rem;line-height:1.4rem;opacity:.7}";
|
|
27
|
-
styleInject(css_248z);
|
|
28
|
-
|
|
29
|
-
const findHeaderByIndexStack = (data, indexStack) => {
|
|
30
|
-
var _data$currentIndex;
|
|
31
|
-
if (!data || !Array.isArray(data) || data.length === 0) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
const [currentIndex, ...nextIndexStack] = indexStack;
|
|
35
|
-
const nextData = (_data$currentIndex = data[currentIndex]) === null || _data$currentIndex === void 0 ? void 0 : _data$currentIndex.children;
|
|
36
|
-
return indexStack.length === 1 ? data[currentIndex] : findHeaderByIndexStack(nextData, nextIndexStack);
|
|
37
|
-
};
|
|
38
|
-
const Menu = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
39
|
-
var _activeElementRef$cur2;
|
|
40
|
-
let {
|
|
41
|
-
data,
|
|
42
|
-
onBack,
|
|
43
|
-
toggle,
|
|
44
|
-
onNext,
|
|
45
|
-
onSelect,
|
|
46
|
-
screenType,
|
|
47
|
-
scrollToActiveElement,
|
|
48
|
-
initialIndexStack,
|
|
49
|
-
...restProps
|
|
50
|
-
} = _ref;
|
|
51
|
-
const initialHeader = useMemo(() => initialIndexStack === null || initialIndexStack === void 0 ? void 0 : initialIndexStack.reduce((headerItem, stackIndex, index) => {
|
|
52
|
-
const nextItem = headerItem ? headerItem[stackIndex] : data[stackIndex];
|
|
53
|
-
const isLast = index === initialIndexStack.length - 1;
|
|
54
|
-
return isLast ? nextItem : nextItem.children;
|
|
55
|
-
}, null), [initialIndexStack, data]);
|
|
56
|
-
const [header, setHeader] = useState(initialHeader);
|
|
57
|
-
const [indexStack, setIndexStack] = useState(initialIndexStack !== null && initialIndexStack !== void 0 ? initialIndexStack : []);
|
|
58
|
-
const listRef = useRef(null);
|
|
59
|
-
const activeElementRef = useRef(null);
|
|
60
|
-
const [scrollTopGap, setScrollTopGap] = useState(0);
|
|
61
|
-
const layer = useMemo(() => findDeep(data === null || data === void 0 ? void 0 : data.filter(item => item), indexStack), [data, indexStack]);
|
|
62
|
-
|
|
63
|
-
// Scroll to active element
|
|
64
|
-
const [activeElementTop, setActiveElementTop] = useState(null);
|
|
65
|
-
const [allowScroll, setAllowScroll] = useState(false);
|
|
66
|
-
const [isScrolled, setIsScrolled] = useState(false);
|
|
67
|
-
const [scrollWithArrowKey, setScrollWithArrowKey] = useState(false);
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
if (allowScroll || scrollWithArrowKey) {
|
|
70
|
-
var _activeElementRef$cur;
|
|
71
|
-
setActiveElementTop((activeElementRef === null || activeElementRef === void 0 ? void 0 : (_activeElementRef$cur = activeElementRef.current) === null || _activeElementRef$cur === void 0 ? void 0 : _activeElementRef$cur.offsetTop) - scrollTopGap);
|
|
72
|
-
setAllowScroll(false);
|
|
73
|
-
setScrollWithArrowKey(false);
|
|
74
|
-
}
|
|
75
|
-
}, [allowScroll, indexStack, activeElementRef === null || activeElementRef === void 0 ? void 0 : (_activeElementRef$cur2 = activeElementRef.current) === null || _activeElementRef$cur2 === void 0 ? void 0 : _activeElementRef$cur2.offsetTop, scrollTopGap, scrollWithArrowKey]);
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
var _listRef$current;
|
|
78
|
-
if (!isScrolled && (listRef === null || listRef === void 0 ? void 0 : (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.container.firstChild.children.length) === layer.length) {
|
|
79
|
-
setAllowScroll(true);
|
|
80
|
-
setIsScrolled(true);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
const handleClick = useCallback((e, item, isHeader, index) => {
|
|
84
|
-
setWithSmoothScroll(false);
|
|
85
|
-
setAllowScroll(true);
|
|
86
|
-
setHoverIndex(null);
|
|
87
|
-
setScrollTopGap(item !== null && item !== void 0 && item.scrollTopGap ? item === null || item === void 0 ? void 0 : item.scrollTopGap : 0);
|
|
88
|
-
const newIndexStack = indexStack.slice(0, -1);
|
|
89
|
-
if (isHeader) {
|
|
90
|
-
setIndexStack(newIndexStack);
|
|
91
|
-
onBack && onBack(e, item);
|
|
92
|
-
setHeader(findHeaderByIndexStack(data, newIndexStack));
|
|
93
|
-
} else {
|
|
94
|
-
const {
|
|
95
|
-
onClick,
|
|
96
|
-
children
|
|
97
|
-
} = item;
|
|
98
|
-
if (children) {
|
|
99
|
-
setIndexStack([...indexStack, index]);
|
|
100
|
-
setHeader(item);
|
|
101
|
-
onNext && onNext(e, item);
|
|
102
|
-
} else {
|
|
103
|
-
onSelect && onSelect(e, item);
|
|
104
|
-
}
|
|
105
|
-
onClick && onClick(e, item);
|
|
106
|
-
}
|
|
107
|
-
}, [indexStack]);
|
|
108
|
-
const isOtherLayoutExists = layer === null || layer === void 0 ? void 0 : layer.some(item => !!item.children);
|
|
109
|
-
|
|
110
|
-
// key accessibility
|
|
111
|
-
const [hoverIndex, setHoverIndex] = useState(null);
|
|
112
|
-
const [allowHoverOnActiveElement, setAllowHoverOnActiveElement] = useState(false);
|
|
113
|
-
const [withHeader, setWithHeader] = useState(false);
|
|
114
|
-
const [hoveredHeader, setHoveredHeader] = useState(false);
|
|
115
|
-
const [withSmoothScroll, setWithSmoothScroll] = useState(false);
|
|
116
|
-
const handleMenuFocus = () => setHoverIndex(0);
|
|
117
|
-
const keyDownHandler = e => {
|
|
118
|
-
setWithSmoothScroll(true);
|
|
119
|
-
switch (e.key) {
|
|
120
|
-
case 'ArrowDown':
|
|
121
|
-
{
|
|
122
|
-
if (hoveredHeader) {
|
|
123
|
-
setHoverIndex(0);
|
|
124
|
-
setHoveredHeader(false);
|
|
125
|
-
} else {
|
|
126
|
-
setHoverIndex(prev => prev >= layer.length - 1 ? layer.length - 1 : prev + 1);
|
|
127
|
-
setScrollWithArrowKey(true);
|
|
128
|
-
}
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
case 'ArrowUp':
|
|
132
|
-
{
|
|
133
|
-
if (hoverIndex <= 0) {
|
|
134
|
-
setHoverIndex(null);
|
|
135
|
-
if (withHeader) {
|
|
136
|
-
setHoveredHeader(true);
|
|
137
|
-
} else {
|
|
138
|
-
setScrollWithArrowKey(true);
|
|
139
|
-
}
|
|
140
|
-
} else {
|
|
141
|
-
setHoverIndex(prev => prev - 1);
|
|
142
|
-
setScrollWithArrowKey(true);
|
|
143
|
-
}
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
case 'Enter':
|
|
147
|
-
{
|
|
148
|
-
setAllowHoverOnActiveElement(true);
|
|
149
|
-
const selectedItem = layer[hoverIndex];
|
|
150
|
-
if (selectedItem) {
|
|
151
|
-
handleClick(e, selectedItem, false, hoverIndex);
|
|
152
|
-
setHoverIndex(0);
|
|
153
|
-
}
|
|
154
|
-
if (hoveredHeader) handleClick(e, header, true);
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
case 'Tab':
|
|
158
|
-
case 'Escape':
|
|
159
|
-
toggle && toggle(false);
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
const omitLayoutProps = obj => {
|
|
164
|
-
let result = obj;
|
|
165
|
-
if (obj !== null && obj !== void 0 && obj.maxHeight) {
|
|
166
|
-
const {
|
|
167
|
-
maxHeight,
|
|
168
|
-
...restProps
|
|
169
|
-
} = result;
|
|
170
|
-
result = restProps;
|
|
171
|
-
}
|
|
172
|
-
if (obj !== null && obj !== void 0 && obj.scrollTopGap) {
|
|
173
|
-
const {
|
|
174
|
-
scrollTopGap,
|
|
175
|
-
...restProps
|
|
176
|
-
} = result;
|
|
177
|
-
result = restProps;
|
|
178
|
-
}
|
|
179
|
-
return result;
|
|
180
|
-
};
|
|
181
|
-
const contentListMemo = useMemo(() => layer === null || layer === void 0 ? void 0 : layer.map((item, index) => {
|
|
182
|
-
const itemProps = omitLayoutProps(item);
|
|
183
|
-
if (allowHoverOnActiveElement && item.active) {
|
|
184
|
-
setHoverIndex(index);
|
|
185
|
-
setAllowHoverOnActiveElement(false);
|
|
186
|
-
}
|
|
187
|
-
return item.component || /*#__PURE__*/React__default.createElement(Option, _extends({
|
|
188
|
-
key: "".concat(item.header).concat(index),
|
|
189
|
-
title: item.title,
|
|
190
|
-
onClick: e => handleClick(e, item, false, index),
|
|
191
|
-
forwardMark: !!item.children,
|
|
192
|
-
screenType: screenType
|
|
193
|
-
}, scrollToActiveElement && item.active && allowScroll || index === hoverIndex ? {
|
|
194
|
-
forwardedRef: activeElementRef
|
|
195
|
-
} : {}, itemProps, {
|
|
196
|
-
className: classnames({
|
|
197
|
-
hovered: index === hoverIndex
|
|
198
|
-
}, itemProps.className)
|
|
199
|
-
}));
|
|
200
|
-
}), [indexStack, layer, hoverIndex]);
|
|
201
|
-
const headerMemo = useMemo(() => {
|
|
202
|
-
const headerProps = omitLayoutProps(header);
|
|
203
|
-
setWithHeader(!!headerProps);
|
|
204
|
-
return header && /*#__PURE__*/React__default.createElement(Option, _extends({
|
|
205
|
-
onClick: e => handleClick(e, header, true),
|
|
206
|
-
icon: "bc-icon-arrow-left",
|
|
207
|
-
border: "bottom",
|
|
208
|
-
className: classnames({
|
|
209
|
-
hovered: hoveredHeader
|
|
210
|
-
}),
|
|
211
|
-
screenType: screenType
|
|
212
|
-
}, headerProps, {
|
|
213
|
-
title: header.title
|
|
214
|
-
}));
|
|
215
|
-
}, [header, screenType, header === null || header === void 0 ? void 0 : header.maxHeight, indexStack, hoveredHeader]);
|
|
216
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
217
|
-
className: "menu-items-wrapper popover-top-bottom-padding",
|
|
218
|
-
onKeyDown: keyDownHandler,
|
|
219
|
-
onFocus: handleMenuFocus,
|
|
220
|
-
tabIndex: 0,
|
|
221
|
-
ref: ref
|
|
222
|
-
}, restProps), /*#__PURE__*/React__default.createElement("ul", {
|
|
223
|
-
style: {
|
|
224
|
-
'--translate-x': "".concat(indexStack.length * 100, "%")
|
|
225
|
-
}
|
|
226
|
-
}, indexStack.map((_, index) => /*#__PURE__*/React__default.createElement("li", {
|
|
227
|
-
key: index
|
|
228
|
-
})), /*#__PURE__*/React__default.createElement("li", null, headerMemo, header !== null && header !== void 0 && header.maxHeight ? /*#__PURE__*/React__default.createElement(CustomScrollbar, {
|
|
229
|
-
style: {
|
|
230
|
-
height: "".concat(header.maxHeight, "px")
|
|
231
|
-
},
|
|
232
|
-
ref: listRef,
|
|
233
|
-
scrollTop: activeElementTop,
|
|
234
|
-
withSmoothScroll: withSmoothScroll
|
|
235
|
-
}, contentListMemo) : contentListMemo), isOtherLayoutExists && /*#__PURE__*/React__default.createElement("li", null)));
|
|
236
|
-
});
|
|
237
|
-
Menu.defaultProps = {
|
|
238
|
-
screenType: screenTypes[0]
|
|
239
|
-
};
|
|
240
|
-
Menu.propTypes = {
|
|
241
|
-
/**
|
|
242
|
-
* This is an array where you send menu options, if you send a component,
|
|
243
|
-
* then your component will be rendered, and if parameters, they will be
|
|
244
|
-
* used for the atoms/Option component.<br/>
|
|
245
|
-
* Add <code>maxHeight</code> to data to add scrollbar with maxHeight(px)
|
|
246
|
-
*/
|
|
247
|
-
data: PropTypes.arrayOf(PropTypes.shape({
|
|
248
|
-
component: PropTypes.node,
|
|
249
|
-
maxHeight: PropTypes.number,
|
|
250
|
-
...Option.propTypes
|
|
251
|
-
})),
|
|
252
|
-
/**
|
|
253
|
-
* Fires event when user click on header elements;
|
|
254
|
-
* (event: Event, item: Object) => void
|
|
255
|
-
*/
|
|
256
|
-
onBack: PropTypes.func,
|
|
257
|
-
/**
|
|
258
|
-
* Fires event when user click on option elements;
|
|
259
|
-
* (event: Event, item: Object) => void
|
|
260
|
-
*/
|
|
261
|
-
onNext: PropTypes.func,
|
|
262
|
-
/**
|
|
263
|
-
* Fires event when user click on elements;
|
|
264
|
-
* (event: Event, item: Object) => void
|
|
265
|
-
*/
|
|
266
|
-
onSelect: PropTypes.func,
|
|
267
|
-
/**
|
|
268
|
-
* Controls screen type
|
|
269
|
-
*/
|
|
270
|
-
screenType: PropTypes.oneOf(screenTypes),
|
|
271
|
-
/**
|
|
272
|
-
* auto scroll to activeElement
|
|
273
|
-
*/
|
|
274
|
-
scrollToActiveElement: PropTypes.bool,
|
|
275
|
-
/**
|
|
276
|
-
* Initial selected options indexes array
|
|
277
|
-
*/
|
|
278
|
-
initialIndexStack: PropTypes.arrayOf(PropTypes.string)
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
export { Menu as default };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
5
|
-
import Badge from '../Badge/index.js';
|
|
6
|
-
import Icon from '../Icon/index.js';
|
|
7
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
8
|
-
import '../tslib.es6-f211516f.js';
|
|
9
|
-
|
|
10
|
-
var css_248z = "[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar{background:var(--background);border-top:1px solid rgba(var(--background-sc-rgb),.06);bottom:0;font:600 1rem/1.4rem var(--font-family);left:0;position:fixed;text-align:center;width:100%;z-index:200}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul{display:table;table-layout:fixed;width:100%}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul>li{display:table-cell;overflow:hidden;padding:.8rem 0 .4rem;position:relative;transition:color .3s,opacity .3s}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul>li .badge{margin:0 auto;position:absolute;top:.8rem;width:5.2rem}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul>li .badge-right .badge{right:calc(50% - 2.5rem)}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul>li .badge-left .badge{left:calc(50% - 2.5rem)}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul>li:before{background:var(--hero);border-radius:0 0 .5rem .5rem;content:\"\";display:block;height:.3rem;left:calc(50% - 2.6rem);position:absolute;top:0;transform:translateY(-100%);transition:transform .3s;width:5.2rem}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul>li.active{color:var(--hero)}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul>li.active:before{transform:translateY(0)}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar>ul>li.disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.16.3\"] .mob-navigation-bar .icon{margin:0 0 .2rem}";
|
|
11
|
-
styleInject(css_248z);
|
|
12
|
-
|
|
13
|
-
function MobileNavigation(_ref) {
|
|
14
|
-
let {
|
|
15
|
-
list,
|
|
16
|
-
activeSlug,
|
|
17
|
-
onChange,
|
|
18
|
-
className,
|
|
19
|
-
...restProps
|
|
20
|
-
} = _ref;
|
|
21
|
-
const handleClick = event => {
|
|
22
|
-
const {
|
|
23
|
-
index
|
|
24
|
-
} = event.currentTarget.dataset;
|
|
25
|
-
const item = list[index];
|
|
26
|
-
onChange && onChange(item);
|
|
27
|
-
};
|
|
28
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
29
|
-
className: classnames('mob-navigation-bar', className)
|
|
30
|
-
}, restProps), /*#__PURE__*/React__default.createElement("ul", null, list.map((item, index) => /*#__PURE__*/React__default.createElement("li", {
|
|
31
|
-
key: item.slug,
|
|
32
|
-
"data-index": index,
|
|
33
|
-
className: classnames({
|
|
34
|
-
active: item.slug === activeSlug,
|
|
35
|
-
disabled: item.disabled
|
|
36
|
-
}),
|
|
37
|
-
onClick: !item.disabled ? handleClick : null
|
|
38
|
-
}, item.badge && /*#__PURE__*/React__default.createElement("div", {
|
|
39
|
-
className: "badge-".concat(item.badge.position || 'right')
|
|
40
|
-
}, /*#__PURE__*/React__default.createElement(Badge, {
|
|
41
|
-
size: "default",
|
|
42
|
-
maxCount: item.badge.maxCount,
|
|
43
|
-
count: item.badge.count
|
|
44
|
-
})), /*#__PURE__*/React__default.createElement(Icon, {
|
|
45
|
-
type: item.icon
|
|
46
|
-
}), /*#__PURE__*/React__default.createElement("p", {
|
|
47
|
-
className: "ellipsis-text"
|
|
48
|
-
}, item.title)))));
|
|
49
|
-
}
|
|
50
|
-
MobileNavigation.propTypes = {
|
|
51
|
-
/**
|
|
52
|
-
* Array of menu items data
|
|
53
|
-
*/
|
|
54
|
-
list: PropTypes.arrayOf(PropTypes.shape({
|
|
55
|
-
/**
|
|
56
|
-
* Title for navigation item
|
|
57
|
-
*/
|
|
58
|
-
title: PropTypes.string,
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
*/
|
|
62
|
-
slug: PropTypes.string,
|
|
63
|
-
/**
|
|
64
|
-
* Icon for navigation item
|
|
65
|
-
*/
|
|
66
|
-
icon: PropTypes.string,
|
|
67
|
-
/**
|
|
68
|
-
* Notification Badge
|
|
69
|
-
* count - the value of badge
|
|
70
|
-
* maxCount - if the count is greater than the max count, the Badge shows maxCount+
|
|
71
|
-
* position - position of Badge
|
|
72
|
-
*/
|
|
73
|
-
badge: PropTypes.shape({
|
|
74
|
-
count: PropTypes.number,
|
|
75
|
-
maxCount: PropTypes.number,
|
|
76
|
-
position: PropTypes.oneOf(['left', 'right'])
|
|
77
|
-
})
|
|
78
|
-
}).isRequired),
|
|
79
|
-
/**
|
|
80
|
-
* Initially selected item
|
|
81
|
-
*/
|
|
82
|
-
activeSlug: PropTypes.string,
|
|
83
|
-
/**
|
|
84
|
-
* CSS class name for element
|
|
85
|
-
*/
|
|
86
|
-
className: PropTypes.string,
|
|
87
|
-
/**
|
|
88
|
-
* Fires event when user click on one of the items
|
|
89
|
-
* (item: Object) => void
|
|
90
|
-
*/
|
|
91
|
-
onChange: PropTypes.func
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export { MobileNavigation as default };
|
package/MobilePopup/index.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
2
|
-
import React__default, { useState, useCallback, forwardRef } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
5
|
-
import { n as noop } from '../index-5f37f281.js';
|
|
6
|
-
import Icon from '../Icon/index.js';
|
|
7
|
-
import Portal from '../Portal/index.js';
|
|
8
|
-
import '../dateValidation-67caec66.js';
|
|
9
|
-
import 'react-dom';
|
|
10
|
-
import '../configs-00612ce0.js';
|
|
11
|
-
import useClickOutside from '../hooks/useClickOutside.js';
|
|
12
|
-
import Popover from '../Popover/index.js';
|
|
13
|
-
import Menu from '../Menu/index.js';
|
|
14
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
15
|
-
import '../GeneUIProvider/index.js';
|
|
16
|
-
import '../_commonjsHelpers-24198af3.js';
|
|
17
|
-
import '../index-122432cd.js';
|
|
18
|
-
import '../hooks/useDeviceType.js';
|
|
19
|
-
import '../hooks/useWindowSize.js';
|
|
20
|
-
import '../hooks/useDebounce.js';
|
|
21
|
-
import '../hooks/useUpdatableRef.js';
|
|
22
|
-
import '../hooks/useForceUpdate.js';
|
|
23
|
-
import '../Scrollbar/index.js';
|
|
24
|
-
import '../guid-8ddf77b3.js';
|
|
25
|
-
import '../Option/index.js';
|
|
26
|
-
import '../useEllipsisDetection-c1c9ad94.js';
|
|
27
|
-
import '../index-65217440.js';
|
|
28
|
-
import '../tslib.es6-f211516f.js';
|
|
29
|
-
|
|
30
|
-
function ActionMenu(_ref) {
|
|
31
|
-
let {
|
|
32
|
-
action,
|
|
33
|
-
children
|
|
34
|
-
} = _ref;
|
|
35
|
-
const [isOpened, setIsOpened] = useState(false);
|
|
36
|
-
const toggleMenu = useCallback(() => setIsOpened(status => !status), []);
|
|
37
|
-
const handleOutsideClick = useClickOutside(toggleMenu);
|
|
38
|
-
if (action.menuOptions) {
|
|
39
|
-
return /*#__PURE__*/React__default.createElement(Popover, {
|
|
40
|
-
swipeable: true,
|
|
41
|
-
align: "end",
|
|
42
|
-
screenType: "mobile",
|
|
43
|
-
isOpen: isOpened,
|
|
44
|
-
onSwipedDown: toggleMenu,
|
|
45
|
-
contentRef: handleOutsideClick,
|
|
46
|
-
Content: /*#__PURE__*/React__default.createElement(Menu, {
|
|
47
|
-
screenType: "mobile",
|
|
48
|
-
onClick: toggleMenu,
|
|
49
|
-
data: [...action.menuOptions, {
|
|
50
|
-
title: 'Cancel',
|
|
51
|
-
icon: 'bc-icon-clear',
|
|
52
|
-
border: 'top'
|
|
53
|
-
}]
|
|
54
|
-
})
|
|
55
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
56
|
-
onClick: toggleMenu
|
|
57
|
-
}, children));
|
|
58
|
-
}
|
|
59
|
-
return children;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var css_248z = "[data-gene-ui-version=\"2.16.3\"] .m-popup-holder{height:100%;left:0;overflow:hidden;position:fixed;top:0;width:100%;z-index:400}[data-gene-ui-version=\"2.16.3\"] .m-popup-backdrop{animation:m-popup-backdrop-reveal .3s forwards;background-color:#0003;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}@keyframes m-popup-backdrop-reveal{to{opacity:1}}[data-gene-ui-version=\"2.16.3\"] .m-popup-c{animation:m-popup-c-reveal .4s .25s forwards;background:var(--background);border-radius:1rem 1rem 0 0;bottom:0;box-shadow:0 -1px .2rem 0 #0000000d;display:flex;flex-direction:column;left:0;max-height:calc(100% - 2rem);padding:0 1.6rem;position:absolute;right:0;transform:translate3d(0,100%,0)}@keyframes m-popup-c-reveal{to{transform:translateZ(0)}}[data-gene-ui-version=\"2.16.3\"] .m-popup-head{border-bottom:1px solid rgba(var(--background-sc-rgb),.1);display:grid;font-weight:700;grid-template-columns:1fr auto 1fr;height:5.1rem;position:relative}[data-gene-ui-version=\"2.16.3\"] .m-popup-head>li{align-items:center;display:flex;overflow:hidden}[data-gene-ui-version=\"2.16.3\"] .m-popup-head>li:first-child .mp-action .icon{margin-inline-end:1rem}[data-gene-ui-version=\"2.16.3\"] .m-popup-head>li:last-child .mp-action{flex-direction:row-reverse}[data-gene-ui-version=\"2.16.3\"] .m-popup-head>li:last-child .mp-action .icon{margin-inline-start:1rem}[data-gene-ui-version=\"2.16.3\"] .m-popup-head>li:nth-child(2){padding:0 1rem}[data-gene-ui-version=\"2.16.3\"] .m-popup-head>li:not(:nth-child(2)){min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}[data-gene-ui-version=\"2.16.3\"] .m-popup-head>li:nth-child(3){justify-content:flex-end}[data-gene-ui-version=\"2.16.3\"] .m-popup-head>li .mp-action{align-items:center;color:var(--hero);cursor:pointer;display:flex;font:600 1.4rem/3.6rem var(--font-family);overflow:hidden}[data-gene-ui-version=\"2.16.3\"] .m-popup-content{-webkit-overflow-scrolling:auto;flex:auto;margin:0 -1.6rem;overflow-y:auto;padding:0 1.6rem env(safe-area-inset-bottom);transition:padding .4s;width:calc(100% + 3.2rem)}";
|
|
63
|
-
styleInject(css_248z);
|
|
64
|
-
|
|
65
|
-
const MobilePopUp = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
66
|
-
let {
|
|
67
|
-
onBackdropClick,
|
|
68
|
-
rightActionClick,
|
|
69
|
-
leftActionClick,
|
|
70
|
-
portalContainer,
|
|
71
|
-
rightAction,
|
|
72
|
-
leftAction,
|
|
73
|
-
className,
|
|
74
|
-
isOpened,
|
|
75
|
-
children,
|
|
76
|
-
title,
|
|
77
|
-
...restProps
|
|
78
|
-
} = _ref;
|
|
79
|
-
const generateAction = (action, onClick) => {
|
|
80
|
-
if (action) {
|
|
81
|
-
if ( /*#__PURE__*/React__default.isValidElement(action)) {
|
|
82
|
-
return action;
|
|
83
|
-
}
|
|
84
|
-
return /*#__PURE__*/React__default.createElement(ActionMenu, {
|
|
85
|
-
action: action
|
|
86
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
87
|
-
className: "mp-action",
|
|
88
|
-
onClick: onClick
|
|
89
|
-
}, action.iconType && /*#__PURE__*/React__default.createElement(Icon, {
|
|
90
|
-
type: action.iconType
|
|
91
|
-
}), action.text && /*#__PURE__*/React__default.createElement("p", {
|
|
92
|
-
className: "ellipsis-text"
|
|
93
|
-
}, action.text)));
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
const handleBackdropClick = useCallback(event => {
|
|
97
|
-
onBackdropClick(event, true);
|
|
98
|
-
}, [onBackdropClick]);
|
|
99
|
-
return /*#__PURE__*/React__default.createElement(Portal, {
|
|
100
|
-
isOpen: isOpened,
|
|
101
|
-
container: portalContainer
|
|
102
|
-
}, /*#__PURE__*/React__default.createElement("div", _extends({}, restProps, {
|
|
103
|
-
className: classnames('m-popup-holder', className)
|
|
104
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
105
|
-
className: "m-popup-backdrop",
|
|
106
|
-
onClick: handleBackdropClick
|
|
107
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
108
|
-
className: "m-popup-c"
|
|
109
|
-
}, /*#__PURE__*/React__default.createElement("ul", {
|
|
110
|
-
className: "m-popup-head"
|
|
111
|
-
}, /*#__PURE__*/React__default.createElement("li", null, generateAction(leftAction, leftActionClick)), /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("div", {
|
|
112
|
-
className: "ellipsis-text"
|
|
113
|
-
}, title)), /*#__PURE__*/React__default.createElement("li", null, generateAction(rightAction, rightActionClick))), /*#__PURE__*/React__default.createElement("div", {
|
|
114
|
-
className: "m-popup-content",
|
|
115
|
-
ref: ref
|
|
116
|
-
}, children))));
|
|
117
|
-
});
|
|
118
|
-
MobilePopUp.propTypes = {
|
|
119
|
-
/**
|
|
120
|
-
* Fires event when user clicks on right action button
|
|
121
|
-
* (event: SyntheticEvent) => void
|
|
122
|
-
*/
|
|
123
|
-
rightActionClick: PropTypes.func,
|
|
124
|
-
/**
|
|
125
|
-
* Fires event when user clicks on left action button
|
|
126
|
-
* (event: SyntheticEvent) => void
|
|
127
|
-
*/
|
|
128
|
-
leftActionClick: PropTypes.func,
|
|
129
|
-
/**
|
|
130
|
-
* Container for portal
|
|
131
|
-
*/
|
|
132
|
-
portalContainer: PropTypes.any,
|
|
133
|
-
/**
|
|
134
|
-
* Props for right action
|
|
135
|
-
* iconType: String
|
|
136
|
-
* text: String
|
|
137
|
-
* menuOptions: Option atom's props
|
|
138
|
-
*/
|
|
139
|
-
rightAction: PropTypes.oneOfType([PropTypes.any, PropTypes.shape({
|
|
140
|
-
iconType: PropTypes.string,
|
|
141
|
-
text: PropTypes.string,
|
|
142
|
-
menuOptions: PropTypes.arrayOf(PropTypes.object)
|
|
143
|
-
})]),
|
|
144
|
-
/**
|
|
145
|
-
* Props for left action
|
|
146
|
-
* iconType: String
|
|
147
|
-
* text: String
|
|
148
|
-
* menuOptions: Option atom's props
|
|
149
|
-
*/
|
|
150
|
-
leftAction: PropTypes.oneOfType([PropTypes.any, PropTypes.shape({
|
|
151
|
-
iconType: PropTypes.string,
|
|
152
|
-
text: PropTypes.string,
|
|
153
|
-
menuOptions: PropTypes.arrayOf(PropTypes.object)
|
|
154
|
-
})]),
|
|
155
|
-
/**
|
|
156
|
-
* Additional classname
|
|
157
|
-
*/
|
|
158
|
-
className: PropTypes.string,
|
|
159
|
-
/**
|
|
160
|
-
* Displays popup if [true]
|
|
161
|
-
*/
|
|
162
|
-
isOpened: PropTypes.bool,
|
|
163
|
-
/**
|
|
164
|
-
* Valid React elements for popup body
|
|
165
|
-
*/
|
|
166
|
-
children: PropTypes.node,
|
|
167
|
-
/**
|
|
168
|
-
* Custom title for popup
|
|
169
|
-
*/
|
|
170
|
-
title: PropTypes.string,
|
|
171
|
-
/*
|
|
172
|
-
* Backdrop click event handler
|
|
173
|
-
*/
|
|
174
|
-
onBackdropClick: PropTypes.func
|
|
175
|
-
};
|
|
176
|
-
MobilePopUp.defaultProps = {
|
|
177
|
-
onBackdropClick: noop,
|
|
178
|
-
leftActionClick: noop,
|
|
179
|
-
rightActionClick: noop
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export { MobilePopUp as default };
|