@geneui/components 2.11.2 → 2.12.1
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} +291 -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 +40 -0
- package/{Card.js → Card/index.js} +82 -94
- package/{CardList.js → CardList/index.js} +118 -165
- package/{CellMeasurerCache-b786dd93.js → CellMeasurerCache-bc2163c1.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} +46 -43
- package/{DatePicker.js → DatePicker/index.js} +106 -108
- package/{index-0199942c.js → DatePickerInput/index.js} +103 -89
- 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 +86 -0
- package/{FormContainer.js → FormContainer/index.js} +25 -26
- package/FormableCheckbox/index.js +26 -0
- package/FormableDatePicker/index.js +42 -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 +287 -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/{index-5e96cb4d.js → PopoverV2/index.js} +57 -1006
- 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-8b9c3afa.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} +132 -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 +556 -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} +45 -42
- package/ValidatableDropdown/index.js +139 -0
- package/ValidatableElements/index.js +68 -0
- package/ValidatableMultiSelectDropdown/index.js +150 -0
- package/{ValidatableNumberInput.js → ValidatableNumberInput/index.js} +34 -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-45eafea6.js +90 -0
- package/index-583e0b30.js +4 -0
- package/{index-8c98317a.js → index-78d2ea5b.js} +678 -752
- package/{index-ac59cb10.js → index-a0e4e333.js} +6 -6
- package/{index-e8776f3d.js → index-b1e429a7.js} +1 -1
- package/index-bd525a3a.js +10054 -0
- package/index.d.ts +115 -0
- package/index.js +138 -113
- package/index.mobile.d.ts +16 -0
- package/jsx-runtime-57b40d9e.js +957 -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
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as noop, s as stopEvent } from '
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { g as getBrowserDateFormat } from '
|
|
1
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
2
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
3
|
+
import React__default, { useMemo, useState, useRef, useCallback, useEffect } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { d as dayjsWithPlugins, a as dayjs } from '../dateValidation-67caec66.js';
|
|
6
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
7
|
+
import { e as popoverConfig, i as inputConfig } from '../configs-fed6ac34.js';
|
|
8
|
+
import { n as noop, s as stopEvent } from '../index-a0e4e333.js';
|
|
9
|
+
import useClick from '../hooks/useClick.js';
|
|
10
|
+
import useKeyDown from '../hooks/useKeyDown.js';
|
|
11
|
+
import useDeviceType from '../hooks/useDeviceType.js';
|
|
12
|
+
import PopoverV2 from '../PopoverV2/index.js';
|
|
13
|
+
import ExtendedInput from '../ExtendedInput/index.js';
|
|
14
|
+
import DatePicker from '../DatePicker/index.js';
|
|
15
|
+
import { g as getBrowserDateFormat } from '../localization-4ba17032.js';
|
|
16
|
+
import '../_commonjsHelpers-24198af3.js';
|
|
17
|
+
import 'react-dom';
|
|
18
|
+
import '../hooks/useWindowSize.js';
|
|
19
|
+
import '../jsx-runtime-57b40d9e.js';
|
|
20
|
+
import '../index-122432cd.js';
|
|
21
|
+
import '../hooks/useClickOutside.js';
|
|
22
|
+
import '../Scrollbar/index.js';
|
|
23
|
+
import '../GeneUIProvider/index.js';
|
|
24
|
+
import '../debounce-4419bc2f.js';
|
|
25
|
+
import '../hooks/useEllipsisDetection.js';
|
|
26
|
+
import '../Icon/index.js';
|
|
27
|
+
import '../SuggestionList/index.js';
|
|
28
|
+
import '../config-0ca92874.js';
|
|
29
|
+
import '../Tooltip/index.js';
|
|
30
|
+
import '../Popover-f4d1cac0.js';
|
|
31
|
+
import '../guid-8ddf77b3.js';
|
|
32
|
+
import '../Button/index.js';
|
|
16
33
|
|
|
17
|
-
|
|
18
|
-
const ref = useRef();
|
|
19
|
-
const handleClick = useCallback(e => {
|
|
20
|
-
if (ref.current && ref.current.contains(e.target)) {
|
|
21
|
-
callback && callback(e);
|
|
22
|
-
}
|
|
23
|
-
}, [ref.current, callback]);
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
document.addEventListener('mousedown', handleClick);
|
|
26
|
-
return () => document.removeEventListener('mousedown', handleClick);
|
|
27
|
-
}, [handleClick]);
|
|
28
|
-
const setRef = node => ref.current = node;
|
|
29
|
-
return setRef;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var css_248z = "[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-holder{width:100%}[data-gene-ui-version=\"1.0.0\"] .md-range-title{font:600 1.6rem/2.2rem var(--font-family);margin:0 0 1.5rem;padding:0 1rem}[data-gene-ui-version=\"1.0.0\"] .default-cursor{cursor:default!important}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker{grid-column-gap:2rem;grid-row-gap:2rem;display:grid;grid-template-areas:\"m-start-date m-end-date\";grid-template-columns:repeat(2,calc(50% - 1rem));width:100%}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker.with-time{grid-template-areas:\"m-start-date m-start-time\" \"m-end-date m-end-time\";grid-template-columns:calc(55% - 1rem) calc(45% - 1rem)}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker .m-start-date{grid-area:m-start-date}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker .m-end-date{grid-area:m-end-date}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker .m-start-time{grid-area:m-start-time}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker .m-end-time{grid-area:m-end-time}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker i[class*=calendar],[data-gene-ui-version=\"1.0.0\"] .mobile-single-date-picker i[class*=calendar]{order:-2;pointer-events:none}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker i[class*=clear],[data-gene-ui-version=\"1.0.0\"] .mobile-single-date-picker i[class*=clear]{order:-1}[data-gene-ui-version=\"1.0.0\"] .date-input .input-structure>label{height:var(--input-element-height)}[data-gene-ui-version=\"1.0.0\"] .date-input .input-structure>.icon+label input{padding-inline:2rem 4.4rem}[data-gene-ui-version=\"1.0.0\"] .date-input .input-structure .input-element-relative{inset-inline-start:0;position:absolute;top:0;width:90%}[data-gene-ui-version=\"1.0.0\"] .date-input .input-structure .input-element-relative>input{padding-inline:2rem 1.5rem;padding-inline-end:2.4rem}[data-gene-ui-version=\"1.0.0\"] .date-input .input-structure .input-element-relative>.read-only{padding-inline:2rem 1.5rem}[data-gene-ui-version=\"1.0.0\"] .date-input i[class*=calendar]{order:-2}[data-gene-ui-version=\"1.0.0\"] .date-input i[class*=clear]{order:-1}[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker .bc-icon-calendar,[data-gene-ui-version=\"1.0.0\"] .mobile-date-ranges-picker .bc-icon.clock,[data-gene-ui-version=\"1.0.0\"] .mobile-single-date-picker .bc-icon-calendar,[data-gene-ui-version=\"1.0.0\"] .mobile-single-date-picker .bc-icon.clock{pointer-events:none}[data-gene-ui-version=\"1.0.0\"] .clearable-date-picker input{width:85%}";
|
|
34
|
+
var css_248z = "[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-holder{width:100%}[data-gene-ui-version=\"2.12.1\"] .md-range-title{font:600 1.6rem/2.2rem var(--font-family);margin:0 0 1.5rem;padding:0 1rem}[data-gene-ui-version=\"2.12.1\"] .default-cursor{cursor:default!important}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker{grid-column-gap:2rem;grid-row-gap:2rem;display:grid;grid-template-areas:\"m-start-date m-end-date\";grid-template-columns:repeat(2,calc(50% - 1rem));width:100%}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker.with-time{grid-template-areas:\"m-start-date m-start-time\" \"m-end-date m-end-time\";grid-template-columns:calc(55% - 1rem) calc(45% - 1rem)}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker .m-start-date{grid-area:m-start-date}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker .m-end-date{grid-area:m-end-date}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker .m-start-time{grid-area:m-start-time}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker .m-end-time{grid-area:m-end-time}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker i[class*=calendar],[data-gene-ui-version=\"2.12.1\"] .mobile-single-date-picker i[class*=calendar]{order:-2;pointer-events:none}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker i[class*=clear],[data-gene-ui-version=\"2.12.1\"] .mobile-single-date-picker i[class*=clear]{order:-1}[data-gene-ui-version=\"2.12.1\"] .date-input .input-structure>label{height:var(--input-element-height)}[data-gene-ui-version=\"2.12.1\"] .date-input .input-structure>.icon+label input{padding-inline:2rem 4.4rem}[data-gene-ui-version=\"2.12.1\"] .date-input .input-structure .input-element-relative{inset-inline-start:0;position:absolute;top:0;width:90%}[data-gene-ui-version=\"2.12.1\"] .date-input .input-structure .input-element-relative>input{padding-inline:2rem 1.5rem;padding-inline-end:2.4rem}[data-gene-ui-version=\"2.12.1\"] .date-input .input-structure .input-element-relative>.read-only{padding-inline:2rem 1.5rem}[data-gene-ui-version=\"2.12.1\"] .date-input i[class*=calendar]{order:-2}[data-gene-ui-version=\"2.12.1\"] .date-input i[class*=clear]{order:-1}[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker .bc-icon-calendar,[data-gene-ui-version=\"2.12.1\"] .mobile-date-ranges-picker .bc-icon.clock,[data-gene-ui-version=\"2.12.1\"] .mobile-single-date-picker .bc-icon-calendar,[data-gene-ui-version=\"2.12.1\"] .mobile-single-date-picker .bc-icon.clock{pointer-events:none}[data-gene-ui-version=\"2.12.1\"] .clearable-date-picker input{width:85%}";
|
|
33
35
|
styleInject(css_248z);
|
|
34
36
|
|
|
35
37
|
const getLastValidValue$1 = (date, validFormat) => date && date.isValid() ? date.format(validFormat) : '';
|
|
@@ -80,6 +82,10 @@ function DatePickerInput(_ref) {
|
|
|
80
82
|
const inputRef = useRef();
|
|
81
83
|
const handleChange = useCallback(value => {
|
|
82
84
|
const date = dayjsWithPlugins(value);
|
|
85
|
+
if (!withTime) {
|
|
86
|
+
setPopoverState(false);
|
|
87
|
+
inputRef.current.blur();
|
|
88
|
+
}
|
|
83
89
|
setDate(date);
|
|
84
90
|
onChange(date.toDate());
|
|
85
91
|
setInputValue(date.format(validFormat));
|
|
@@ -116,6 +122,9 @@ function DatePickerInput(_ref) {
|
|
|
116
122
|
}, [frozenDateRange, validFormat, onChange, required]);
|
|
117
123
|
const checkDateInerval = useCallback(() => {
|
|
118
124
|
let value = getLastValidValue$1(date, validFormat);
|
|
125
|
+
if (!value) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
119
128
|
const minUnix = minDate && minDate.valueOf();
|
|
120
129
|
const maxUnix = maxDate && maxDate.valueOf();
|
|
121
130
|
const dateUnix = date && dayjs(date, validFormat).valueOf();
|
|
@@ -246,96 +255,96 @@ DatePickerInput.propTypes = {
|
|
|
246
255
|
/**
|
|
247
256
|
* Controls alignment of popover
|
|
248
257
|
*/
|
|
249
|
-
popoverAlign:
|
|
258
|
+
popoverAlign: PropTypes.oneOf(popoverConfig.align),
|
|
250
259
|
/**
|
|
251
260
|
* Controls flexibility of input element
|
|
252
261
|
*/
|
|
253
|
-
flexibility:
|
|
262
|
+
flexibility: PropTypes.oneOf(flexibility$1),
|
|
254
263
|
/**
|
|
255
264
|
* Controls appearance of input element
|
|
256
265
|
*/
|
|
257
|
-
appearance:
|
|
266
|
+
appearance: PropTypes.oneOf(appearances$1),
|
|
258
267
|
/**
|
|
259
268
|
* Placeholder text for input
|
|
260
269
|
*/
|
|
261
|
-
placeholder:
|
|
270
|
+
placeholder: PropTypes.string,
|
|
262
271
|
/**
|
|
263
272
|
* Disables datepicker when input is focused
|
|
264
273
|
*/
|
|
265
|
-
withoutPicker:
|
|
274
|
+
withoutPicker: PropTypes.bool,
|
|
266
275
|
/**
|
|
267
276
|
* Accepts same props as DatePicker component(organisms)
|
|
268
277
|
*/
|
|
269
|
-
pickerProps:
|
|
278
|
+
pickerProps: PropTypes.object,
|
|
270
279
|
/**
|
|
271
280
|
* Min specifies the minimum value allowed for datepicker
|
|
272
281
|
*/
|
|
273
|
-
min:
|
|
282
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(dayjsWithPlugins), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
274
283
|
/**
|
|
275
284
|
* Max specifies the maximum value allowed for datepicker
|
|
276
285
|
*/
|
|
277
|
-
max:
|
|
286
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(dayjsWithPlugins), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
278
287
|
/**
|
|
279
288
|
* The value of the input element, required for a controlled component.
|
|
280
289
|
*/
|
|
281
|
-
value:
|
|
290
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(dayjsWithPlugins), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
282
291
|
/**
|
|
283
292
|
* The CSS class name of the wrapper element.
|
|
284
293
|
*/
|
|
285
|
-
className:
|
|
294
|
+
className: PropTypes.string,
|
|
286
295
|
/**
|
|
287
296
|
* Controls input size
|
|
288
297
|
*/
|
|
289
|
-
size:
|
|
298
|
+
size: PropTypes.oneOf(size$1),
|
|
290
299
|
/**
|
|
291
300
|
* Custom date format
|
|
292
301
|
*/
|
|
293
|
-
format:
|
|
302
|
+
format: PropTypes.string,
|
|
294
303
|
/**
|
|
295
304
|
* If true, the input element will be disabled.
|
|
296
305
|
*/
|
|
297
|
-
disabled:
|
|
306
|
+
disabled: PropTypes.bool,
|
|
298
307
|
/**
|
|
299
308
|
* It prevents the user from changing the value of the field.
|
|
300
309
|
*/
|
|
301
|
-
readOnly:
|
|
310
|
+
readOnly: PropTypes.bool,
|
|
302
311
|
/**
|
|
303
312
|
* If true, the input element will show icon which can reset selected date.
|
|
304
313
|
*/
|
|
305
|
-
clearable:
|
|
314
|
+
clearable: PropTypes.bool,
|
|
306
315
|
/**
|
|
307
316
|
* Callback fired when the value is changed.
|
|
308
317
|
* function(date: Date) => void
|
|
309
318
|
*/
|
|
310
|
-
onChange:
|
|
319
|
+
onChange: PropTypes.func,
|
|
311
320
|
/**
|
|
312
321
|
* Callback fired when the input looses focus.
|
|
313
322
|
* function(e: Event) => void
|
|
314
323
|
*/
|
|
315
|
-
onBlur:
|
|
324
|
+
onBlur: PropTypes.func,
|
|
316
325
|
/**
|
|
317
326
|
* Callback fired when the input get focused.
|
|
318
327
|
* function(e: Event) => void
|
|
319
328
|
*/
|
|
320
|
-
onFocus:
|
|
329
|
+
onFocus: PropTypes.func,
|
|
321
330
|
/**
|
|
322
331
|
* If false, the input will indicate an error.
|
|
323
332
|
*/
|
|
324
|
-
isValid:
|
|
333
|
+
isValid: PropTypes.bool,
|
|
325
334
|
/**
|
|
326
335
|
* Title for input
|
|
327
336
|
*/
|
|
328
|
-
title:
|
|
337
|
+
title: PropTypes.string,
|
|
329
338
|
/**
|
|
330
339
|
* MarkedDate specifies the default mark date
|
|
331
340
|
*/
|
|
332
|
-
markedDate:
|
|
341
|
+
markedDate: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
333
342
|
/**
|
|
334
343
|
* Prop is responsible for disabling selected range
|
|
335
344
|
*/
|
|
336
|
-
frozenDateRange:
|
|
337
|
-
from:
|
|
338
|
-
to:
|
|
345
|
+
frozenDateRange: PropTypes.arrayOf(PropTypes.shape({
|
|
346
|
+
from: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]).isRequired,
|
|
347
|
+
to: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]).isRequired
|
|
339
348
|
}))
|
|
340
349
|
};
|
|
341
350
|
DatePickerInput.defaultProps = {
|
|
@@ -466,10 +475,14 @@ function DateRangePickerInput(_ref) {
|
|
|
466
475
|
const end = dayjsWithPlugins(endDate);
|
|
467
476
|
setStartDate(start);
|
|
468
477
|
setEndDate(end);
|
|
478
|
+
if (!withTime) {
|
|
479
|
+
inputRef.current.blur();
|
|
480
|
+
setPopoverState(false);
|
|
481
|
+
}
|
|
469
482
|
setInputValue("".concat(start.format(validFormat)).concat(rangeSeparator).concat(end.format(validFormat)));
|
|
470
483
|
onChange(value);
|
|
471
484
|
}
|
|
472
|
-
}, [validFormat, rangeSeparator, onChange]);
|
|
485
|
+
}, [validFormat, rangeSeparator, onChange, withTime]);
|
|
473
486
|
const handleInputChange = useCallback(e => {
|
|
474
487
|
var _value, _value2, _value3;
|
|
475
488
|
let {
|
|
@@ -716,128 +729,128 @@ DateRangePickerInput.propTypes = {
|
|
|
716
729
|
/**
|
|
717
730
|
* Controls appearance of input element
|
|
718
731
|
*/
|
|
719
|
-
appearance:
|
|
732
|
+
appearance: PropTypes.oneOf(appearances),
|
|
720
733
|
/**
|
|
721
734
|
* Placeholder text for input
|
|
722
735
|
*/
|
|
723
|
-
placeholder:
|
|
736
|
+
placeholder: PropTypes.string,
|
|
724
737
|
/**
|
|
725
738
|
* Title for input
|
|
726
739
|
*/
|
|
727
|
-
title:
|
|
740
|
+
title: PropTypes.string,
|
|
728
741
|
/**
|
|
729
742
|
* The CSS class name of the wrapper element.
|
|
730
743
|
*/
|
|
731
|
-
className:
|
|
744
|
+
className: PropTypes.string,
|
|
732
745
|
/**
|
|
733
746
|
* Custom date format
|
|
734
747
|
*/
|
|
735
|
-
format:
|
|
748
|
+
format: PropTypes.string,
|
|
736
749
|
/**
|
|
737
750
|
* Controls flexibility of input element
|
|
738
751
|
*/
|
|
739
|
-
flexibility:
|
|
752
|
+
flexibility: PropTypes.oneOf(flexibility),
|
|
740
753
|
/**
|
|
741
754
|
* Define range picker is with time or no.
|
|
742
755
|
*/
|
|
743
|
-
withTime:
|
|
756
|
+
withTime: PropTypes.bool,
|
|
744
757
|
/**
|
|
745
758
|
* If true, the input element will show icon which can reset selected date.
|
|
746
759
|
*/
|
|
747
|
-
clearable:
|
|
760
|
+
clearable: PropTypes.bool,
|
|
748
761
|
/**
|
|
749
762
|
* If true, the input element will be disabled.
|
|
750
763
|
*/
|
|
751
|
-
disabled:
|
|
764
|
+
disabled: PropTypes.bool,
|
|
752
765
|
/**
|
|
753
766
|
* It prevents the user from changing the value of the field.
|
|
754
767
|
*/
|
|
755
|
-
readOnly:
|
|
768
|
+
readOnly: PropTypes.bool,
|
|
756
769
|
/**
|
|
757
770
|
* Callback fired when the value is changed.
|
|
758
771
|
* function([startDate: Date, endDate: Date) => void
|
|
759
772
|
*/
|
|
760
|
-
onChange:
|
|
773
|
+
onChange: PropTypes.func,
|
|
761
774
|
/**
|
|
762
775
|
* Callback fired when the input looses focus.
|
|
763
776
|
* function(e: Event) => void
|
|
764
777
|
*/
|
|
765
|
-
onBlur:
|
|
778
|
+
onBlur: PropTypes.func,
|
|
766
779
|
/**
|
|
767
780
|
* Callback fired when the input get focused.
|
|
768
781
|
* function(e: Event) => void
|
|
769
782
|
*/
|
|
770
|
-
onFocus:
|
|
783
|
+
onFocus: PropTypes.func,
|
|
771
784
|
/**
|
|
772
785
|
* The value of the input element, required for a controlled component.
|
|
773
786
|
*/
|
|
774
|
-
value:
|
|
787
|
+
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.instanceOf(dayjsWithPlugins)), PropTypes.arrayOf(PropTypes.instanceOf(Date)), PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)]),
|
|
775
788
|
/**
|
|
776
789
|
* If false, the input will indicate an error.
|
|
777
790
|
*/
|
|
778
|
-
isValid:
|
|
791
|
+
isValid: PropTypes.bool,
|
|
779
792
|
/**
|
|
780
793
|
* Disables datepicker when input is focused
|
|
781
794
|
*/
|
|
782
|
-
withoutPicker:
|
|
795
|
+
withoutPicker: PropTypes.bool,
|
|
783
796
|
/**
|
|
784
797
|
* Accepts same props as DatePicker component(organisms)
|
|
785
798
|
*/
|
|
786
|
-
pickerProps:
|
|
799
|
+
pickerProps: PropTypes.object,
|
|
787
800
|
/**
|
|
788
801
|
* Min specifies the minimum value allowed for datepicker
|
|
789
802
|
*/
|
|
790
|
-
min:
|
|
803
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(dayjsWithPlugins), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
791
804
|
/**
|
|
792
805
|
* Max specifies the maximum value allowed for datepicker
|
|
793
806
|
*/
|
|
794
|
-
max:
|
|
807
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(dayjsWithPlugins), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
795
808
|
/**
|
|
796
809
|
* Controls input size
|
|
797
810
|
*/
|
|
798
|
-
size:
|
|
811
|
+
size: PropTypes.oneOf(size),
|
|
799
812
|
/**
|
|
800
813
|
* Controls alignment of popover
|
|
801
814
|
*/
|
|
802
|
-
popoverAlign:
|
|
815
|
+
popoverAlign: PropTypes.oneOf(popoverConfig.align),
|
|
803
816
|
/**
|
|
804
817
|
* Placeholder text for start date input, which is used in mobile version
|
|
805
818
|
*/
|
|
806
|
-
startDatePlaceholder:
|
|
819
|
+
startDatePlaceholder: PropTypes.string,
|
|
807
820
|
/**
|
|
808
821
|
* Placeholder text for end date input, which is used in mobile version
|
|
809
822
|
*/
|
|
810
|
-
endDatePlaceholder:
|
|
823
|
+
endDatePlaceholder: PropTypes.string,
|
|
811
824
|
/**
|
|
812
825
|
* Placeholder text for start time input, which is used in mobile version
|
|
813
826
|
*/
|
|
814
|
-
startTimePlaceholder:
|
|
827
|
+
startTimePlaceholder: PropTypes.string,
|
|
815
828
|
/**
|
|
816
829
|
* Placeholder text for end time input, which is used in mobile version
|
|
817
830
|
*/
|
|
818
|
-
endTimePlaceholder:
|
|
831
|
+
endTimePlaceholder: PropTypes.string,
|
|
819
832
|
/**
|
|
820
833
|
* Set default start time when date changed
|
|
821
834
|
*/
|
|
822
|
-
defaultStartTime:
|
|
835
|
+
defaultStartTime: PropTypes.string,
|
|
823
836
|
/**
|
|
824
837
|
* Set default end time when date changed
|
|
825
838
|
*/
|
|
826
|
-
defaultEndTime:
|
|
839
|
+
defaultEndTime: PropTypes.string,
|
|
827
840
|
/**
|
|
828
841
|
* Prop is responsible for add one second to end date time value in case of true parameter
|
|
829
842
|
*/
|
|
830
|
-
isIncludeEndDateLastSecond:
|
|
843
|
+
isIncludeEndDateLastSecond: PropTypes.bool,
|
|
831
844
|
/**
|
|
832
845
|
* MarkedDate specifies the default mark date
|
|
833
846
|
*/
|
|
834
|
-
markedDate:
|
|
847
|
+
markedDate: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
835
848
|
/**
|
|
836
849
|
* Prop is responsible for disabling selected range
|
|
837
850
|
*/
|
|
838
|
-
frozenDateRange:
|
|
839
|
-
from:
|
|
840
|
-
to:
|
|
851
|
+
frozenDateRange: PropTypes.arrayOf(PropTypes.shape({
|
|
852
|
+
from: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]).isRequired,
|
|
853
|
+
to: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]).isRequired
|
|
841
854
|
}))
|
|
842
855
|
};
|
|
843
856
|
DateRangePickerInput.defaultProps = {
|
|
@@ -862,6 +875,7 @@ DateRangePickerInput.defaultProps = {
|
|
|
862
875
|
clearable: false
|
|
863
876
|
};
|
|
864
877
|
|
|
878
|
+
// Styles
|
|
865
879
|
DatePickerInput.WithRange = DateRangePickerInput;
|
|
866
880
|
|
|
867
|
-
export { DatePickerInput as
|
|
881
|
+
export { DatePickerInput as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { _ as _extends } from '
|
|
1
|
+
import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
2
|
import React__default, { useMemo } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import { c as classnames } from '
|
|
5
|
-
import '
|
|
6
|
-
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classnames } from '../index-6ff23041.js';
|
|
5
|
+
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
7
6
|
|
|
8
|
-
var css_248z = "[data-gene-ui-version=\"
|
|
7
|
+
var css_248z = "[data-gene-ui-version=\"2.12.1\"] .divider{background:rgba(var(--background-sc-rgb),.05);height:2.6rem;width:1px}[data-gene-ui-version=\"2.12.1\"] .divider:not(.divider-withNoSpace){margin:0 1.5rem}[data-gene-ui-version=\"2.12.1\"] .divider:not(.divider-withNoSpace).type-horizontal{margin:1.5rem 0}[data-gene-ui-version=\"2.12.1\"] .divider.type-horizontal{height:1px;width:2.6rem}[data-gene-ui-version=\"2.12.1\"] .divider.type-horizontal.full-width{width:100%}";
|
|
9
8
|
styleInject(css_248z);
|
|
10
9
|
|
|
11
10
|
function Divider(_ref) {
|
|
@@ -33,19 +32,19 @@ Divider.propTypes = {
|
|
|
33
32
|
/**
|
|
34
33
|
* Divider direction
|
|
35
34
|
*/
|
|
36
|
-
type:
|
|
35
|
+
type: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
37
36
|
/**
|
|
38
37
|
* Divider additional className
|
|
39
38
|
*/
|
|
40
|
-
className:
|
|
39
|
+
className: PropTypes.string,
|
|
41
40
|
/**
|
|
42
41
|
* Divider size will be applied to height(when "type" is set to "vertical") or to width(when "type" is set to "horizontal")
|
|
43
42
|
*/
|
|
44
|
-
size:
|
|
43
|
+
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
45
44
|
/**
|
|
46
45
|
* withSpace by default true. If you want to remove the divider`s spacing, switch to false
|
|
47
46
|
*/
|
|
48
|
-
withSpace:
|
|
47
|
+
withSpace: PropTypes.bool
|
|
49
48
|
};
|
|
50
49
|
Divider.defaultProps = {
|
|
51
50
|
type: 'vertical',
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import React__default, { useRef, useState, useEffect, useCallback, useMemo, Fragment } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { c as clsx } from '
|
|
4
|
-
import { n as noop } from '
|
|
5
|
-
import '
|
|
6
|
-
import
|
|
7
|
-
import Icon from '
|
|
8
|
-
import Tooltip from '
|
|
9
|
-
import { s as styleInject } from '
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { c as clsx } from '../clsx.m-2bb6df4b.js';
|
|
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 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
12
|
import 'react-dom';
|
|
13
|
-
import '
|
|
14
|
-
import '
|
|
15
|
-
import '
|
|
16
|
-
import '
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
19
|
-
import './GeneUIProvider.js';
|
|
13
|
+
import '../_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
14
|
+
import '../index-6ff23041.js';
|
|
15
|
+
import '../Popover-f4d1cac0.js';
|
|
16
|
+
import '../hooks/useDeviceType.js';
|
|
17
|
+
import '../hooks/useWindowSize.js';
|
|
18
|
+
import '../GeneUIProvider/index.js';
|
|
20
19
|
|
|
21
|
-
var css_248z = "[data-gene-ui-version=\"
|
|
20
|
+
var css_248z = "[data-gene-ui-version=\"2.12.1\"] .bc-drawer{--width:7.2rem;--head-justify:center;--item-width:4.2rem;--item-padding:0;--item-justify:center;--item-title-display:none;--item-icon-margin:0;background:var(--background);border-right:1px solid rgba(var(--background-sc-rgb),.1);left:0;overflow:hidden;top:0;transition:width .15s cubic-bezier(.4,0,.2,1);width:var(--width);z-index:200}[data-gene-ui-version=\"2.12.1\"] .bc-drawer.open{--width:30rem;--head-justify:space-between;--item-width:100%;--item-padding:0 14px;--item-justify:flex-start;--item-title-display:block;--item-icon-margin:17px}[data-gene-ui-version=\"2.12.1\"] .bc-drawer.open .bc-drawer-head:after{background-color:#1473e6;bottom:0;content:\"\";height:3px;left:20px;margin:17px 198px 0 0;position:absolute;width:34px}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-head{align-items:center;border-bottom:1px solid rgba(var(--background-sc-rgb),.1);display:flex;height:64px;justify-content:var(--head-justify);padding:20px;position:relative;width:var(--width)}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-head .bc-drawer-head-title{font-size:16px;font-weight:600}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-head .bc-drawer-head-icon{cursor:pointer}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-head .bc-drawer-head-icon:hover{color:#1473e6}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-content{display:flex;flex-direction:column;height:calc(100% - 64px);overflow-x:hidden;overflow-y:auto;padding:10px 12px;width:var(--width)}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item{align-items:center;border-radius:21px;cursor:pointer;display:flex;height:42px;justify-content:var(--item-justify);min-height:42px;overflow:hidden;padding:var(--item-padding);position:relative;transition:width .15s cubic-bezier(.4,0,.2,1);transition:color .3s,background .3s,opacity .2s;width:var(--item-width)}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item:hover{background-color:#00000008}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item.disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item.active:not(.nested){background-color:#1473e6;color:#fff}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item.active.nested{background-color:#1473e608;color:#1473e6}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item.nested{padding-left:57px}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item .bc-drawer-item-icon{margin-right:var(--item-icon-margin)}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item .bc-drawer-item-title{display:var(--item-title-display);font-weight:600}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item .bc-drawer-item-arrow{position:absolute;right:17px;transition:.15s cubic-bezier(.4,0,.2,1)}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item .bc-drawer-item-arrow.open{transform:rotate(-180deg)}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item-nested-list{max-height:0;overflow:hidden;transition:.15s cubic-bezier(.4,0,.2,1);width:100%}[data-gene-ui-version=\"2.12.1\"] .bc-drawer .bc-drawer-item-nested-list.open{max-height:100%}";
|
|
22
21
|
styleInject(css_248z);
|
|
23
22
|
|
|
24
23
|
function Drawer(_ref) {
|
|
@@ -179,33 +178,33 @@ Drawer.propTypes = {
|
|
|
179
178
|
/**
|
|
180
179
|
* Date for display the menu
|
|
181
180
|
*/
|
|
182
|
-
menu:
|
|
183
|
-
title:
|
|
184
|
-
icon:
|
|
185
|
-
id:
|
|
186
|
-
disabled:
|
|
187
|
-
nested:
|
|
188
|
-
title:
|
|
189
|
-
id:
|
|
190
|
-
disabled:
|
|
181
|
+
menu: PropTypes.arrayOf(PropTypes.shape({
|
|
182
|
+
title: PropTypes.string,
|
|
183
|
+
icon: PropTypes.string,
|
|
184
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
185
|
+
disabled: PropTypes.bool,
|
|
186
|
+
nested: PropTypes.arrayOf(PropTypes.shape({
|
|
187
|
+
title: PropTypes.string,
|
|
188
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
189
|
+
disabled: PropTypes.bool
|
|
191
190
|
}))
|
|
192
191
|
})),
|
|
193
192
|
/**
|
|
194
193
|
* If you want to control the selected item in the menu, you must date id of one of the 'menu' items.
|
|
195
194
|
*/
|
|
196
|
-
value:
|
|
195
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
197
196
|
/**
|
|
198
197
|
* If you want not to control the menu from the top but have a default value, you can send it using defaultValue
|
|
199
198
|
*/
|
|
200
|
-
defaultValue:
|
|
199
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
201
200
|
/**
|
|
202
201
|
* Label is displayed at the top in the driver
|
|
203
202
|
*/
|
|
204
|
-
title:
|
|
203
|
+
title: PropTypes.string,
|
|
205
204
|
/**
|
|
206
205
|
* Override or extend the className applied to the component.
|
|
207
206
|
*/
|
|
208
|
-
className:
|
|
207
|
+
className: PropTypes.string,
|
|
209
208
|
/**
|
|
210
209
|
* Callback fired when a menu item is selected.
|
|
211
210
|
Signature:
|
|
@@ -213,52 +212,52 @@ Drawer.propTypes = {
|
|
|
213
212
|
item: Item is the element that was select from the menu
|
|
214
213
|
nested: If you select an item from the submenu, it will be sent as the second argument, and the first will be the item of its parent.
|
|
215
214
|
*/
|
|
216
|
-
onChange:
|
|
215
|
+
onChange: PropTypes.func,
|
|
217
216
|
/**
|
|
218
217
|
* Callback fired when a drawer is opened.
|
|
219
218
|
Signature:
|
|
220
219
|
function(event: object) => void
|
|
221
220
|
event: The event source of the callback.
|
|
222
221
|
*/
|
|
223
|
-
onOpen:
|
|
222
|
+
onOpen: PropTypes.func,
|
|
224
223
|
/**
|
|
225
224
|
* Callback fired when a drawer is closed.
|
|
226
225
|
Signature:
|
|
227
226
|
function(event: object) => void
|
|
228
227
|
event: The event source of the callback.
|
|
229
228
|
*/
|
|
230
|
-
onClose:
|
|
229
|
+
onClose: PropTypes.func,
|
|
231
230
|
/**
|
|
232
231
|
* If true, the component is shown by default.
|
|
233
232
|
*/
|
|
234
|
-
defaultOpen:
|
|
233
|
+
defaultOpen: PropTypes.bool,
|
|
235
234
|
/**
|
|
236
235
|
* Height for the component
|
|
237
236
|
by default: 100vh
|
|
238
237
|
*/
|
|
239
|
-
height:
|
|
238
|
+
height: PropTypes.string,
|
|
240
239
|
/**
|
|
241
240
|
* The positioning type. The behavior of the different options is described in the MDN web docs.
|
|
242
241
|
'absolute' | 'fixed' | 'relative' | 'static' | 'sticky'
|
|
243
242
|
*/
|
|
244
|
-
position:
|
|
243
|
+
position: PropTypes.string,
|
|
245
244
|
/**
|
|
246
245
|
* With this prop you can control Drawer opening and closing from parent component
|
|
247
246
|
*/
|
|
248
|
-
isOpen:
|
|
247
|
+
isOpen: PropTypes.bool,
|
|
249
248
|
/**
|
|
250
249
|
* Drawer to close after item select
|
|
251
250
|
*/
|
|
252
|
-
closeAfterSelect:
|
|
251
|
+
closeAfterSelect: PropTypes.bool,
|
|
253
252
|
/**
|
|
254
253
|
* Closes when click outside
|
|
255
254
|
*/
|
|
256
|
-
closeWithOutsideClick:
|
|
255
|
+
closeWithOutsideClick: PropTypes.bool,
|
|
257
256
|
/**
|
|
258
257
|
* Callback fired when a outside click.
|
|
259
258
|
* (event: MouseEvent) => void.
|
|
260
259
|
*/
|
|
261
|
-
onOutsideClick:
|
|
260
|
+
onOutsideClick: PropTypes.func
|
|
262
261
|
};
|
|
263
262
|
|
|
264
263
|
export { Drawer as default };
|