@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
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
5
|
+
import { d as moduleTitleConfig } from '../configs-fed6ac34.js';
|
|
6
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
7
|
+
import Icon from '../Icon/index.js';
|
|
8
|
+
import Tooltip from '../Tooltip/index.js';
|
|
9
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
10
|
+
import '../dateValidation-67caec66.js';
|
|
11
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
12
|
+
import 'react-dom';
|
|
13
|
+
import '../Popover-f4d1cac0.js';
|
|
14
|
+
import '../hooks/useDeviceType.js';
|
|
15
|
+
import '../hooks/useWindowSize.js';
|
|
16
|
+
import '../GeneUIProvider/index.js';
|
|
17
|
+
|
|
18
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .module-header{background:var(--background);display:flex;flex-shrink:0;height:5rem;padding:0 .5rem 0 2rem;width:100%}html[dir=rtl] .module-header{padding:0 2rem 0 .5rem}[data-gene-ui-version=\"2.12.2\"] .module-header.headerBorder.p-top{border-bottom:1px solid rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.12.2\"] .module-header.headerBorder.p-top.cr-position-radius{border-radius:2rem 2rem 0 0}[data-gene-ui-version=\"2.12.2\"] .module-header.headerBorder.p-bottom{border-top:1px solid rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.12.2\"] .module-header.headerBorder.p-bottom.cr-position-radius{border-radius:0 0 2rem 2rem}[data-gene-ui-version=\"2.12.2\"] .module-header.cr-full-radius{border-radius:2rem}[data-gene-ui-version=\"2.12.2\"] .module-header>li{align-items:center;display:flex}[data-gene-ui-version=\"2.12.2\"] .module-header>li.left-content{flex:auto;overflow:hidden;position:relative}[data-gene-ui-version=\"2.12.2\"] .module-header>li.left-content .left-inner{max-width:100%}[data-gene-ui-version=\"2.12.2\"] .module-header>li.left-content .left-inner:nth-last-child(2){max-width:calc(100% - 3.2rem)}[data-gene-ui-version=\"2.12.2\"] .module-header>li.left-content .left-inner-icon{margin-inline-start:.8rem}[data-gene-ui-version=\"2.12.2\"] .module-header>li.right-content{flex-shrink:0}[data-gene-ui-version=\"2.12.2\"] .module-header.s-small{height:3rem}[data-gene-ui-version=\"2.12.2\"] .module-header.s-small .module-description-title .m-title,[data-gene-ui-version=\"2.12.2\"] .module-header.s-small .module-title{font-size:1.2rem;line-height:normal}[data-gene-ui-version=\"2.12.2\"] .module-header.s-medium{height:4rem}[data-gene-ui-version=\"2.12.2\"] .module-header.s-extra-big{height:6rem}[data-gene-ui-version=\"2.12.2\"] .module-title{font:600 1.4rem/1.8rem var(--font-family)}[data-gene-ui-version=\"2.12.2\"] .module-title:before{background:var(--hero);content:\"\";display:block;height:.3rem;position:absolute;width:3.4rem}html:not([dir=rtl]) .module-title:before{left:0}html[dir=rtl] .module-title:before{right:0}[data-gene-ui-version=\"2.12.2\"] .p-top .module-title:before{bottom:0}[data-gene-ui-version=\"2.12.2\"] .p-bottom .module-title:before{top:0}[data-gene-ui-version=\"2.12.2\"] .module-title-without-border{font:600 1.4rem/1.8rem var(--font-family)}[data-gene-ui-version=\"2.12.2\"] .module-description-title{width:100%}[data-gene-ui-version=\"2.12.2\"] .module-description-title .m-description{font:600 1.2rem/1.6rem var(--font-family)}[data-gene-ui-version=\"2.12.2\"] .module-description-title .m-title{font:600 1.6rem/2.8rem var(--font-family)}";
|
|
19
|
+
styleInject(css_248z);
|
|
20
|
+
|
|
21
|
+
function IconWithTooltip(_ref) {
|
|
22
|
+
let {
|
|
23
|
+
toolTip,
|
|
24
|
+
children
|
|
25
|
+
} = _ref;
|
|
26
|
+
return toolTip ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
27
|
+
title: toolTip
|
|
28
|
+
}, children) : children;
|
|
29
|
+
}
|
|
30
|
+
function ModuleTitle(_ref2) {
|
|
31
|
+
let {
|
|
32
|
+
size,
|
|
33
|
+
title,
|
|
34
|
+
color,
|
|
35
|
+
hideBeforeBorder,
|
|
36
|
+
position,
|
|
37
|
+
children,
|
|
38
|
+
className,
|
|
39
|
+
description,
|
|
40
|
+
cornerRadius,
|
|
41
|
+
headerBorder,
|
|
42
|
+
titleIcon,
|
|
43
|
+
titleIconTooltip,
|
|
44
|
+
onTitleIconClick,
|
|
45
|
+
...restProps
|
|
46
|
+
} = _ref2;
|
|
47
|
+
return /*#__PURE__*/React__default.createElement("ul", _extends({
|
|
48
|
+
className: classnames('module-header', "cr-".concat(cornerRadius), "p-".concat(position), "s-".concat(size), className, {
|
|
49
|
+
headerBorder
|
|
50
|
+
})
|
|
51
|
+
}, restProps), /*#__PURE__*/React__default.createElement("li", {
|
|
52
|
+
className: "left-content",
|
|
53
|
+
style: {
|
|
54
|
+
'--hero': color || ''
|
|
55
|
+
}
|
|
56
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
57
|
+
className: "left-inner"
|
|
58
|
+
}, description ? /*#__PURE__*/React__default.createElement("div", {
|
|
59
|
+
className: "module-description-title"
|
|
60
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
61
|
+
className: "m-description ellipsis-text"
|
|
62
|
+
}, description), /*#__PURE__*/React__default.createElement("div", {
|
|
63
|
+
className: "m-title ellipsis-text"
|
|
64
|
+
}, title)) : title && /*#__PURE__*/React__default.createElement("div", {
|
|
65
|
+
className: classnames('ellipsis-text', {
|
|
66
|
+
'module-title-without-border': hideBeforeBorder,
|
|
67
|
+
'module-title': !hideBeforeBorder
|
|
68
|
+
}),
|
|
69
|
+
title: typeof title === 'string' ? title : ''
|
|
70
|
+
}, title)), titleIcon && /*#__PURE__*/React__default.createElement(IconWithTooltip, {
|
|
71
|
+
toolTip: titleIconTooltip
|
|
72
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
73
|
+
className: "left-inner-icon"
|
|
74
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
75
|
+
type: titleIcon,
|
|
76
|
+
onClick: onTitleIconClick
|
|
77
|
+
})))), /*#__PURE__*/React__default.createElement("li", {
|
|
78
|
+
className: "right-content"
|
|
79
|
+
}, children));
|
|
80
|
+
}
|
|
81
|
+
ModuleTitle.propTypes = {
|
|
82
|
+
/**
|
|
83
|
+
* Title property. Any valid React node.
|
|
84
|
+
*/
|
|
85
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
86
|
+
/**
|
|
87
|
+
* Additonal description. Any valid React node
|
|
88
|
+
*/
|
|
89
|
+
description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
90
|
+
/**
|
|
91
|
+
* ModuleTitle sizing
|
|
92
|
+
*/
|
|
93
|
+
size: PropTypes.oneOf(moduleTitleConfig.size),
|
|
94
|
+
/**
|
|
95
|
+
* Addional className
|
|
96
|
+
*/
|
|
97
|
+
className: PropTypes.string,
|
|
98
|
+
/**
|
|
99
|
+
* Hide border after title
|
|
100
|
+
*/
|
|
101
|
+
hideBeforeBorder: PropTypes.bool,
|
|
102
|
+
/**
|
|
103
|
+
* Hide header main border
|
|
104
|
+
*/
|
|
105
|
+
headerBorder: PropTypes.bool,
|
|
106
|
+
/**
|
|
107
|
+
* ModuleTitle positioning
|
|
108
|
+
*/
|
|
109
|
+
position: PropTypes.oneOf(moduleTitleConfig.position),
|
|
110
|
+
/**
|
|
111
|
+
* ModuleTitle corner radius
|
|
112
|
+
*/
|
|
113
|
+
cornerRadius: PropTypes.oneOf(moduleTitleConfig.cornerRadius),
|
|
114
|
+
/**
|
|
115
|
+
* Module title content can be passed as child. Any valid React node.
|
|
116
|
+
*/
|
|
117
|
+
children: PropTypes.node,
|
|
118
|
+
/**
|
|
119
|
+
* Use this prop to override ModuleTitle's underline color. Will not work when "descroiption" prop is specified
|
|
120
|
+
*/
|
|
121
|
+
color: PropTypes.string,
|
|
122
|
+
/**
|
|
123
|
+
* Will add an "Icon" atom to the left side of ModuleTitle. Valid values are the same as "type" prop for "Icon" atom
|
|
124
|
+
*/
|
|
125
|
+
titleIcon: PropTypes.string,
|
|
126
|
+
/**
|
|
127
|
+
* Tooltip for icon
|
|
128
|
+
*/
|
|
129
|
+
titleIconTooltip: PropTypes.string,
|
|
130
|
+
/**
|
|
131
|
+
* Title Icon onClick event
|
|
132
|
+
*/
|
|
133
|
+
onTitleIconClick: PropTypes.func
|
|
134
|
+
};
|
|
135
|
+
ModuleTitle.defaultProps = {
|
|
136
|
+
onTitleIconClick: noop,
|
|
137
|
+
headerBorder: true,
|
|
138
|
+
size: moduleTitleConfig.size[2],
|
|
139
|
+
position: moduleTitleConfig.position[0],
|
|
140
|
+
cornerRadius: moduleTitleConfig.cornerRadius[0]
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export { ModuleTitle as default };
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import React__default, { memo, useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { n as noop } from '
|
|
4
|
-
import
|
|
5
|
-
import Icon from '
|
|
6
|
-
import Option from '
|
|
7
|
-
import
|
|
8
|
-
import { _ as _extends } from '
|
|
9
|
-
import '
|
|
10
|
-
import { d as debounce } from '
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { n as noop } from '../index-a0e4e333.js';
|
|
4
|
+
import useDeviceType from '../hooks/useDeviceType.js';
|
|
5
|
+
import Icon from '../Icon/index.js';
|
|
6
|
+
import Option from '../Option/index.js';
|
|
7
|
+
import Popover from '../Popover/index.js';
|
|
8
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
9
|
+
import '../dateValidation-67caec66.js';
|
|
10
|
+
import { d as debounce } from '../debounce-4419bc2f.js';
|
|
11
11
|
import 'react-dom';
|
|
12
|
-
import Menu from '
|
|
13
|
-
import { s as styleInject } from '
|
|
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 '
|
|
12
|
+
import Menu from '../Menu/index.js';
|
|
13
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
14
|
+
import '../configs-fed6ac34.js';
|
|
15
|
+
import '../hooks/useWindowSize.js';
|
|
16
|
+
import '../index-6ff23041.js';
|
|
17
|
+
import '../hooks/useEllipsisDetection.js';
|
|
18
|
+
import '../Tooltip/index.js';
|
|
19
|
+
import '../Popover-f4d1cac0.js';
|
|
20
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
21
|
+
import '../GeneUIProvider/index.js';
|
|
22
|
+
import '../index-122432cd.js';
|
|
23
|
+
import '../hooks/useUpdatableRef.js';
|
|
24
|
+
import '../hooks/useForceUpdate.js';
|
|
25
|
+
import '../Portal/index.js';
|
|
26
|
+
import '../Scrollbar/index.js';
|
|
27
|
+
import '../guid-8ddf77b3.js';
|
|
27
28
|
|
|
28
29
|
const getTitle = (id, data) => {
|
|
29
30
|
if (data) {
|
|
@@ -138,7 +139,7 @@ NavigationMenuContent.defaultProps = {
|
|
|
138
139
|
};
|
|
139
140
|
var NavigationMenuContent$1 = /*#__PURE__*/memo(NavigationMenuContent);
|
|
140
141
|
|
|
141
|
-
var css_248z = "[data-gene-ui-version=\"
|
|
142
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu{--size:3.6rem;align-items:center;border:1px solid #0000;border-radius:var(--button-external-size,var(--size));color:#fff;cursor:pointer;display:flex;font:600 1.4rem/2rem var(--font-family);justify-content:center;min-height:var(--button-external-size,var(--size));min-width:var(--button-external-size,var(--size));padding:0 1rem;position:relative;transition:color .3s,background .3s,opacity .2s;-webkit-user-select:none;user-select:none}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu:hover{background:#ffffff1a}}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu.active{background:#ffffff1a}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu:disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_head{align-items:center;display:flex;justify-content:center;pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_layer{align-items:center;display:flex;margin:0 .8rem;opacity:.7}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_layer.active,[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_layer:last-child{opacity:1}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_content{display:flex;padding:1rem 0}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_content-menu{width:25.8rem}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_content-menu:not(.bc-navigation-menu_content-menu:last-child){border-right:1px solid #0000001a}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_title-wrapper{align-items:center;display:flex;justify-content:center}[data-gene-ui-version=\"2.12.2\"] .bc-navigation-menu_title-wrapper:not(.bc-navigation-menu_title-wrapper:last-child):after{background-color:#fff;content:\"\";display:block;height:2.3rem;margin-inline:.6rem;transform:rotate(15deg);width:1px}";
|
|
142
143
|
styleInject(css_248z);
|
|
143
144
|
|
|
144
145
|
function NavigationMenu(_ref) {
|
|
@@ -194,24 +195,24 @@ NavigationMenu.propTypes = {
|
|
|
194
195
|
* nested options, send the date to the option in the same structure as the options.
|
|
195
196
|
* example => data={[{ id: 'item_1', title: 'Item 1', isHidden: false, data: [ { id: 'item_1_1', title: 'Item 1.1', isHidden: false } ]}]}
|
|
196
197
|
*/
|
|
197
|
-
data:
|
|
198
|
+
data: PropTypes.arrayOf(PropTypes.shape(Option.propTypes)).isRequired,
|
|
198
199
|
/**
|
|
199
200
|
* For value you need to send id selectable options id,
|
|
200
201
|
* and if you select the nested option, then you need to send the id to the hierarchy.
|
|
201
202
|
* example => 'item_1/item_1_1'
|
|
202
203
|
*/
|
|
203
|
-
value:
|
|
204
|
+
value: PropTypes.string.isRequired,
|
|
204
205
|
/**
|
|
205
206
|
* onChange handler is called by clicking on the option
|
|
206
207
|
* This callback gives you the option you clicked on and its id and
|
|
207
208
|
* if it is nested then the give and parent option id are associated with a forward slash.
|
|
208
209
|
* (id: NavigationMenu.value, item: Option) => void
|
|
209
210
|
*/
|
|
210
|
-
onChange:
|
|
211
|
+
onChange: PropTypes.func,
|
|
211
212
|
/**
|
|
212
213
|
* Disabled status for the navigation menu button
|
|
213
214
|
*/
|
|
214
|
-
disabled:
|
|
215
|
+
disabled: PropTypes.bool
|
|
215
216
|
};
|
|
216
217
|
NavigationMenu.defaultProps = {
|
|
217
218
|
onChange: noop
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import '../dateValidation-67caec66.js';
|
|
6
|
+
import 'react-dom';
|
|
7
|
+
import useDeviceType from '../hooks/useDeviceType.js';
|
|
8
|
+
import { s as screenTypes } from '../configs-fed6ac34.js';
|
|
9
|
+
import Icon from '../Icon/index.js';
|
|
10
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
11
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
12
|
+
import '../hooks/useWindowSize.js';
|
|
13
|
+
|
|
14
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .notifier-block{align-items:flex-start;background:var(--background);border:1px solid rgba(var(--background-sc-rgb),.1);border-radius:1rem;box-shadow:0 .2rem .4rem 0 #0000001a;cursor:pointer;display:flex;height:8.5rem;transition:border-color .3s;width:100%}[data-gene-ui-version=\"2.12.2\"] .notifier-block.mobile-view{border-radius:0;border-width:0 0 1px;box-shadow:none}[data-gene-ui-version=\"2.12.2\"] .notifier-block>li{flex-shrink:0}[data-gene-ui-version=\"2.12.2\"] .notifier-block>li.notifier-icon{align-self:stretch}[data-gene-ui-version=\"2.12.2\"] .notifier-block>li.notifier-content{flex:auto;overflow:hidden;padding:1.2rem 1.4rem;width:10rem}[data-gene-ui-version=\"2.12.2\"] .notifier-block>li.notifier-action{padding:1rem 1.5rem 0 0}html[dir=rtl] .notifier-block>li.notifier-action{padding:1rem 0 0 1.5rem}[data-gene-ui-version=\"2.12.2\"] .notifier-block>li.notifier-action .icon{cursor:pointer}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .notifier-block>li.notifier-action .icon:hover{color:var(--hero)}[data-gene-ui-version=\"2.12.2\"] .notifier-block:hover{border-color:var(--hero)}}[data-gene-ui-version=\"2.12.2\"] .notifier-icon{align-items:center;background:rgba(var(--hero-rgb),.28);border-radius:.9rem 0 0 .9rem;color:var(--background);display:flex;font-size:4.2rem;justify-content:center;width:8.5rem}html[dir=rtl] .notifier-icon{border-radius:0 .9rem .9rem 0}[data-gene-ui-version=\"2.12.2\"] .notifier-block.mobile-view .notifier-icon{border-radius:0}[data-gene-ui-version=\"2.12.2\"] .type-clean .notifier-icon{background:none;color:rgba(var(--hero-rgb),.48)}html:not([dir=rtl]) .type-clean .notifier-icon{border-right:1px solid rgba(var(--background-sc-rgb),.1)}html[dir=rtl] .type-clean .notifier-icon{border-left:1px solid rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.12.2\"] .notifier-title{font:600 1.4rem/1.36 var(--font-family);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[data-gene-ui-version=\"2.12.2\"] .notifier-c-t{margin:.8rem 0 0}[data-gene-ui-version=\"2.12.2\"] .notifier-c-t>ul{display:grid;font:600 1.2rem/1.42 var(--font-family);grid-template-areas:\"c1 c2\";grid-template-columns:auto 1fr}[data-gene-ui-version=\"2.12.2\"] .notifier-c-t>ul>li{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[data-gene-ui-version=\"2.12.2\"] .notifier-c-t>ul>li:first-child{grid-area:c1;opacity:.5;width:6.4rem}[data-gene-ui-version=\"2.12.2\"] .notifier-c-t>ul>li:nth-child(2){grid-area:c2}";
|
|
15
|
+
styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
const notificationTypes = ['default', 'clean'];
|
|
18
|
+
function Notification(_ref) {
|
|
19
|
+
let {
|
|
20
|
+
type,
|
|
21
|
+
onClose,
|
|
22
|
+
closable,
|
|
23
|
+
content,
|
|
24
|
+
title,
|
|
25
|
+
heading,
|
|
26
|
+
className,
|
|
27
|
+
screenType,
|
|
28
|
+
additionalHeading,
|
|
29
|
+
notificationIcon,
|
|
30
|
+
onContentClick,
|
|
31
|
+
description,
|
|
32
|
+
additionalDescription,
|
|
33
|
+
...restProps
|
|
34
|
+
} = _ref;
|
|
35
|
+
const {
|
|
36
|
+
isMobile
|
|
37
|
+
} = useDeviceType(screenType);
|
|
38
|
+
return /*#__PURE__*/React__default.createElement("ul", _extends({
|
|
39
|
+
onClick: onContentClick,
|
|
40
|
+
className: classnames('notifier-block', className, "type-".concat(type), {
|
|
41
|
+
'mobile-view': isMobile
|
|
42
|
+
})
|
|
43
|
+
}, restProps), type && /*#__PURE__*/React__default.createElement("li", {
|
|
44
|
+
className: classnames('notifier-icon', notificationIcon)
|
|
45
|
+
}), /*#__PURE__*/React__default.createElement("li", {
|
|
46
|
+
className: "notifier-content"
|
|
47
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
48
|
+
className: "notifier-title"
|
|
49
|
+
}, title), content || /*#__PURE__*/React__default.createElement("div", {
|
|
50
|
+
className: "notifier-c-t"
|
|
51
|
+
}, heading && /*#__PURE__*/React__default.createElement("ul", null, /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("span", null, heading)), /*#__PURE__*/React__default.createElement("li", null, description)), additionalHeading && /*#__PURE__*/React__default.createElement("ul", null, /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("span", null, additionalHeading)), /*#__PURE__*/React__default.createElement("li", null, additionalDescription)))), closable && /*#__PURE__*/React__default.createElement("li", {
|
|
52
|
+
className: "notifier-action",
|
|
53
|
+
onClick: onClose
|
|
54
|
+
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
55
|
+
type: "bc-icon-close"
|
|
56
|
+
})));
|
|
57
|
+
}
|
|
58
|
+
Notification.propTypes = {
|
|
59
|
+
/**
|
|
60
|
+
* Type of the Notification component.
|
|
61
|
+
*/
|
|
62
|
+
type: PropTypes.oneOf(notificationTypes),
|
|
63
|
+
/**
|
|
64
|
+
* If true displays close button
|
|
65
|
+
*/
|
|
66
|
+
closable: PropTypes.bool,
|
|
67
|
+
/**
|
|
68
|
+
* CSS class name for element
|
|
69
|
+
*/
|
|
70
|
+
className: PropTypes.string,
|
|
71
|
+
/**
|
|
72
|
+
* Fires event when user clicks on close button
|
|
73
|
+
* (event: Event) => void
|
|
74
|
+
*/
|
|
75
|
+
onClose: PropTypes.func,
|
|
76
|
+
/**
|
|
77
|
+
* Custom content form notification
|
|
78
|
+
*/
|
|
79
|
+
content: PropTypes.element,
|
|
80
|
+
/**
|
|
81
|
+
* Fires when user click on notification modal
|
|
82
|
+
* (event: Event) => void
|
|
83
|
+
*/
|
|
84
|
+
onContentClick: PropTypes.func,
|
|
85
|
+
/**
|
|
86
|
+
* Heading text for notification modal
|
|
87
|
+
*/
|
|
88
|
+
heading: PropTypes.string,
|
|
89
|
+
/**
|
|
90
|
+
* Descriptions text fro notification
|
|
91
|
+
*/
|
|
92
|
+
description: PropTypes.string,
|
|
93
|
+
/**
|
|
94
|
+
* Controls screen type
|
|
95
|
+
*/
|
|
96
|
+
screenType: PropTypes.oneOf(screenTypes),
|
|
97
|
+
/**
|
|
98
|
+
* Additional heading text for notification
|
|
99
|
+
*/
|
|
100
|
+
additionalHeading: PropTypes.string,
|
|
101
|
+
/**
|
|
102
|
+
* Notification icon
|
|
103
|
+
*/
|
|
104
|
+
notificationIcon: PropTypes.string.isRequired,
|
|
105
|
+
/**
|
|
106
|
+
* Additional info for notification
|
|
107
|
+
*/
|
|
108
|
+
additionalDescription: PropTypes.string,
|
|
109
|
+
/**
|
|
110
|
+
* Title for notification
|
|
111
|
+
*/
|
|
112
|
+
title: PropTypes.string.isRequired
|
|
113
|
+
};
|
|
114
|
+
Notification.defaultProps = {
|
|
115
|
+
type: notificationTypes[0],
|
|
116
|
+
closable: false
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { Notification as default, notificationTypes };
|
package/Option/index.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
+
import React__default, { useRef } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
5
|
+
import { o as optionConfig, s as screenTypes } from '../configs-fed6ac34.js';
|
|
6
|
+
import '../dateValidation-67caec66.js';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
import useDeviceType from '../hooks/useDeviceType.js';
|
|
9
|
+
import useEllipsisDetection from '../hooks/useEllipsisDetection.js';
|
|
10
|
+
import Icon from '../Icon/index.js';
|
|
11
|
+
import Tooltip from '../Tooltip/index.js';
|
|
12
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
13
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
14
|
+
import '../hooks/useWindowSize.js';
|
|
15
|
+
import '../Popover-f4d1cac0.js';
|
|
16
|
+
import '../index-a0e4e333.js';
|
|
17
|
+
import '../GeneUIProvider/index.js';
|
|
18
|
+
|
|
19
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .option-container{align-items:center;cursor:pointer;display:flex;min-height:4rem;overflow:hidden;padding:0 1.4rem;position:relative;transition:background .4s;-webkit-user-select:none;user-select:none;width:100%;z-index:0}[data-gene-ui-version=\"2.12.2\"] .option-container>*{transition:color .4s}[data-gene-ui-version=\"2.12.2\"] .option-container.mobile-view{min-height:4.8rem;padding:0 2rem}[data-gene-ui-version=\"2.12.2\"] .option-container.border-top{border-top:1px solid}[data-gene-ui-version=\"2.12.2\"] .option-container.border-bottom{border-bottom:1px solid}[data-gene-ui-version=\"2.12.2\"] .option-container.border-bottom,[data-gene-ui-version=\"2.12.2\"] .option-container.border-top{border-color:rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.12.2\"] .option-container.sticky-bottom,[data-gene-ui-version=\"2.12.2\"] .option-container.sticky-top{position:-webkit-sticky;position:sticky;z-index:1}[data-gene-ui-version=\"2.12.2\"] .option-container.sticky-top{top:0}[data-gene-ui-version=\"2.12.2\"] .option-container.sticky-bottom{bottom:0}@media (hover:hover){[data-gene-ui-version=\"2.12.2\"] .option-container.hovered:hover,[data-gene-ui-version=\"2.12.2\"] .option-container:hover:hover{background:rgba(var(--background-sc-rgb),.05)}}[data-gene-ui-version=\"2.12.2\"] .option-container.hovered{background:rgba(var(--background-sc-rgb),.05)}[data-gene-ui-version=\"2.12.2\"] .option-container.active,[data-gene-ui-version=\"2.12.2\"] .option-container.c-hero{color:var(--hero)}[data-gene-ui-version=\"2.12.2\"] .option-container.disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .option-container a{display:block;line-height:4rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[data-gene-ui-version=\"2.12.2\"] .option-container a.active~*{color:var(--hero)}[data-gene-ui-version=\"2.12.2\"] .option-container-relative{position:relative}[data-gene-ui-version=\"2.12.2\"] .option-left-elements{align-items:center;display:flex;flex-shrink:0;justify-content:center;margin-inline-end:1.2rem;min-height:2.4rem;min-width:2.4rem}[data-gene-ui-version=\"2.12.2\"] .option-right-elements{flex-shrink:0;margin-inline-start:1.2rem}[data-gene-ui-version=\"2.12.2\"] .option-right-elements .bc-icon-selected{transition:transform .4s}[data-gene-ui-version=\"2.12.2\"] .option-container:not(.mobile-view) .option-right-elements .bc-icon-selected{margin-inline-end:-.4rem}[data-gene-ui-version=\"2.12.2\"] .option-container:not(.active) .option-right-elements .bc-icon-selected{transform:scale(0)}[data-gene-ui-version=\"2.12.2\"] .mobile-view .bc-icon-selected{margin-inline-end:.8rem!important}[data-gene-ui-version=\"2.12.2\"] .option-texts{align-items:center;display:flex;flex:auto;font:600 1.4rem/2rem var(--font-family);overflow:hidden}[data-gene-ui-version=\"2.12.2\"] .option-texts>li{flex-shrink:0}[data-gene-ui-version=\"2.12.2\"] .option-texts>li:first-child{flex:auto;overflow:hidden}[data-gene-ui-version=\"2.12.2\"] .option-texts>li.assigned-value{margin-inline-start:1rem;opacity:.7}[data-gene-ui-version=\"2.12.2\"] .option-description{font:600 1.2rem/1.6rem var(--font-family);opacity:.7}[data-gene-ui-version=\"2.12.2\"] .option-title-center{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}[data-gene-ui-version=\"2.12.2\"] .option-title-end{text-align:end}";
|
|
20
|
+
styleInject(css_248z);
|
|
21
|
+
|
|
22
|
+
function Option(props) {
|
|
23
|
+
const {
|
|
24
|
+
title,
|
|
25
|
+
description,
|
|
26
|
+
className,
|
|
27
|
+
icon,
|
|
28
|
+
color,
|
|
29
|
+
active,
|
|
30
|
+
checkMark,
|
|
31
|
+
forwardMark,
|
|
32
|
+
leftCustomElement,
|
|
33
|
+
rightCustomElement,
|
|
34
|
+
assignedValue,
|
|
35
|
+
border,
|
|
36
|
+
sticky,
|
|
37
|
+
content,
|
|
38
|
+
onClick,
|
|
39
|
+
screenType,
|
|
40
|
+
forwardedRef,
|
|
41
|
+
disabled,
|
|
42
|
+
titlePosition,
|
|
43
|
+
...restProps
|
|
44
|
+
} = props;
|
|
45
|
+
const titleRef = useRef(null);
|
|
46
|
+
const hasTooltip = useEllipsisDetection(titleRef);
|
|
47
|
+
const descriptionRef = useRef(null);
|
|
48
|
+
const hasDescriptionTooltip = useEllipsisDetection(descriptionRef);
|
|
49
|
+
const {
|
|
50
|
+
isMobile
|
|
51
|
+
} = useDeviceType(screenType);
|
|
52
|
+
return /*#__PURE__*/React__default.createElement("label", _extends({
|
|
53
|
+
className: classnames('option-container', className, "border-".concat(border), "sticky-".concat(sticky), "c-".concat(color), {
|
|
54
|
+
'mobile-view': isMobile,
|
|
55
|
+
'option-container-relative': titlePosition === optionConfig.titlePosition.center,
|
|
56
|
+
active,
|
|
57
|
+
disabled
|
|
58
|
+
}),
|
|
59
|
+
onClick: onClick,
|
|
60
|
+
ref: forwardedRef
|
|
61
|
+
}, restProps), content, (icon || leftCustomElement) && /*#__PURE__*/React__default.createElement("div", {
|
|
62
|
+
className: "option-left-elements"
|
|
63
|
+
}, icon && /*#__PURE__*/React__default.createElement(Icon, {
|
|
64
|
+
type: icon
|
|
65
|
+
}), leftCustomElement), /*#__PURE__*/React__default.createElement("ul", {
|
|
66
|
+
className: "option-texts"
|
|
67
|
+
}, /*#__PURE__*/React__default.createElement("li", null, title && /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
68
|
+
text: title,
|
|
69
|
+
isVisible: hasTooltip
|
|
70
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
71
|
+
className: classnames('option-title', 'ellipsis-text', {
|
|
72
|
+
'option-title-center': titlePosition === optionConfig.titlePosition.center,
|
|
73
|
+
'option-title-end': titlePosition === optionConfig.titlePosition.end
|
|
74
|
+
}),
|
|
75
|
+
ref: titleRef
|
|
76
|
+
}, title)), description && /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
77
|
+
text: description,
|
|
78
|
+
isVisible: hasDescriptionTooltip
|
|
79
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
80
|
+
ref: descriptionRef,
|
|
81
|
+
className: "option-description ellipsis-text"
|
|
82
|
+
}, description))), assignedValue && /*#__PURE__*/React__default.createElement("li", {
|
|
83
|
+
className: "assigned-value"
|
|
84
|
+
}, assignedValue)), (checkMark || forwardMark || rightCustomElement) && /*#__PURE__*/React__default.createElement("div", {
|
|
85
|
+
className: "option-right-elements"
|
|
86
|
+
}, checkMark && /*#__PURE__*/React__default.createElement(Icon, {
|
|
87
|
+
type: "bc-icon-selected"
|
|
88
|
+
}), forwardMark && /*#__PURE__*/React__default.createElement(Icon, {
|
|
89
|
+
type: "bc-icon-arrow-right"
|
|
90
|
+
}), rightCustomElement));
|
|
91
|
+
}
|
|
92
|
+
Option.defaultProps = {
|
|
93
|
+
color: optionConfig.color[0],
|
|
94
|
+
border: optionConfig.border[0],
|
|
95
|
+
sticky: optionConfig.sticky[0],
|
|
96
|
+
titlePosition: optionConfig.titlePosition.start,
|
|
97
|
+
screenType: screenTypes[0]
|
|
98
|
+
};
|
|
99
|
+
Option.propTypes = {
|
|
100
|
+
/**
|
|
101
|
+
* Title of the option
|
|
102
|
+
*/
|
|
103
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
104
|
+
/**
|
|
105
|
+
* Description of the option which is displayed on the bottom of the title with small caps
|
|
106
|
+
*/
|
|
107
|
+
description: PropTypes.string,
|
|
108
|
+
/**
|
|
109
|
+
* Adds additional className to the option
|
|
110
|
+
*/
|
|
111
|
+
className: PropTypes.string,
|
|
112
|
+
/**
|
|
113
|
+
* Adds icon on the right side of the option
|
|
114
|
+
*/
|
|
115
|
+
icon: PropTypes.string,
|
|
116
|
+
/**
|
|
117
|
+
* Changes text colors
|
|
118
|
+
*/
|
|
119
|
+
color: PropTypes.oneOf(optionConfig.color),
|
|
120
|
+
/**
|
|
121
|
+
* Changes color to hero
|
|
122
|
+
*/
|
|
123
|
+
active: PropTypes.bool,
|
|
124
|
+
/**
|
|
125
|
+
* Adds check icon and displays it when the option is active
|
|
126
|
+
*/
|
|
127
|
+
checkMark: PropTypes.bool,
|
|
128
|
+
/**
|
|
129
|
+
* Adds to right arrow icon
|
|
130
|
+
*/
|
|
131
|
+
forwardMark: PropTypes.bool,
|
|
132
|
+
/**
|
|
133
|
+
* Any element you can add to the left side
|
|
134
|
+
*/
|
|
135
|
+
leftCustomElement: PropTypes.any,
|
|
136
|
+
/**
|
|
137
|
+
* Any element you can add to the right side
|
|
138
|
+
*/
|
|
139
|
+
rightCustomElement: PropTypes.any,
|
|
140
|
+
/**
|
|
141
|
+
* Information you can display on the right side of the option
|
|
142
|
+
*/
|
|
143
|
+
assignedValue: PropTypes.string,
|
|
144
|
+
/**
|
|
145
|
+
* Adds border to the option
|
|
146
|
+
*/
|
|
147
|
+
border: PropTypes.oneOf(optionConfig.border),
|
|
148
|
+
/**
|
|
149
|
+
* Makes item sticky to scrolling element based on the position you choose
|
|
150
|
+
*/
|
|
151
|
+
sticky: PropTypes.oneOf(optionConfig.sticky),
|
|
152
|
+
/**
|
|
153
|
+
* Additional elements for rendering in option
|
|
154
|
+
*/
|
|
155
|
+
content: PropTypes.any,
|
|
156
|
+
/**
|
|
157
|
+
* Fires event when user click on one of the menu items;
|
|
158
|
+
* (event: Event, item: Object) => void
|
|
159
|
+
*/
|
|
160
|
+
onClick: PropTypes.func,
|
|
161
|
+
/**
|
|
162
|
+
* Controls screen type
|
|
163
|
+
*/
|
|
164
|
+
screenType: PropTypes.oneOf(screenTypes),
|
|
165
|
+
/**
|
|
166
|
+
* Controls button disable state
|
|
167
|
+
*/
|
|
168
|
+
disabled: PropTypes.bool,
|
|
169
|
+
/**
|
|
170
|
+
* ref for label
|
|
171
|
+
*/
|
|
172
|
+
forwardedRef: PropTypes.oneOfType([PropTypes.func,
|
|
173
|
+
// for callback ref
|
|
174
|
+
PropTypes.shape({
|
|
175
|
+
current: PropTypes.instanceOf(Element)
|
|
176
|
+
}) // for createRef() object
|
|
177
|
+
]),
|
|
178
|
+
/**
|
|
179
|
+
* Chose position for title
|
|
180
|
+
*/
|
|
181
|
+
titlePosition: PropTypes.oneOf(['start', 'center', 'end'])
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export { Option as default };
|