@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
|
@@ -1,35 +1,36 @@
|
|
|
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 { P as PopoverV2 } from '
|
|
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 { P as PopoverV2 } from '../index-462461c0.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 '../index-122432cd.js';
|
|
20
|
+
import '../hooks/useClickOutside.js';
|
|
21
|
+
import '../Scrollbar/index.js';
|
|
22
|
+
import '../GeneUIProvider/index.js';
|
|
23
|
+
import '../debounce-4419bc2f.js';
|
|
24
|
+
import '../hooks/useEllipsisDetection.js';
|
|
25
|
+
import '../Icon/index.js';
|
|
26
|
+
import '../SuggestionList/index.js';
|
|
27
|
+
import '../config-0ca92874.js';
|
|
28
|
+
import '../Tooltip/index.js';
|
|
29
|
+
import '../Popover-f4d1cac0.js';
|
|
30
|
+
import '../guid-8ddf77b3.js';
|
|
31
|
+
import '../Button/index.js';
|
|
16
32
|
|
|
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%}";
|
|
33
|
+
var css_248z = "[data-gene-ui-version=\"2.12.2\"] .mobile-date-ranges-holder{width:100%}[data-gene-ui-version=\"2.12.2\"] .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.2\"] .default-cursor{cursor:default!important}[data-gene-ui-version=\"2.12.2\"] .text-cursor{cursor:text}[data-gene-ui-version=\"2.12.2\"] .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.2\"] .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.2\"] .mobile-date-ranges-picker .m-start-date{grid-area:m-start-date}[data-gene-ui-version=\"2.12.2\"] .mobile-date-ranges-picker .m-end-date{grid-area:m-end-date}[data-gene-ui-version=\"2.12.2\"] .mobile-date-ranges-picker .m-start-time{grid-area:m-start-time}[data-gene-ui-version=\"2.12.2\"] .mobile-date-ranges-picker .m-end-time{grid-area:m-end-time}[data-gene-ui-version=\"2.12.2\"] .mobile-date-ranges-picker i[class*=calendar],[data-gene-ui-version=\"2.12.2\"] .mobile-single-date-picker i[class*=calendar]{order:-2;pointer-events:none}[data-gene-ui-version=\"2.12.2\"] .mobile-date-ranges-picker i[class*=clear],[data-gene-ui-version=\"2.12.2\"] .mobile-single-date-picker i[class*=clear]{order:-1}[data-gene-ui-version=\"2.12.2\"] .date-input .input-structure>label{height:var(--input-element-height)}[data-gene-ui-version=\"2.12.2\"] .date-input .input-structure>.icon+label input{padding-inline:2rem 4.4rem}[data-gene-ui-version=\"2.12.2\"] .date-input .input-structure .input-element-relative{left:0;position:absolute;width:100%}[data-gene-ui-version=\"2.12.2\"] .date-input .input-structure .input-element-relative>input{padding-inline:2rem 1.5rem;padding-inline-end:6.4rem}[data-gene-ui-version=\"2.12.2\"] .date-input .input-structure .input-element-relative>.read-only{padding-inline:2rem 1.5rem}[data-gene-ui-version=\"2.12.2\"] .date-input i[class*=calendar]{order:-2}[data-gene-ui-version=\"2.12.2\"] .date-input i[class*=clear]{order:-1}[data-gene-ui-version=\"2.12.2\"] .mobile-date-ranges-picker .bc-icon-calendar,[data-gene-ui-version=\"2.12.2\"] .mobile-date-ranges-picker .bc-icon.clock,[data-gene-ui-version=\"2.12.2\"] .mobile-single-date-picker .bc-icon-calendar,[data-gene-ui-version=\"2.12.2\"] .mobile-single-date-picker .bc-icon.clock{pointer-events:none}";
|
|
33
34
|
styleInject(css_248z);
|
|
34
35
|
|
|
35
36
|
const getLastValidValue$1 = (date, validFormat) => date && date.isValid() ? date.format(validFormat) : '';
|
|
@@ -80,6 +81,10 @@ function DatePickerInput(_ref) {
|
|
|
80
81
|
const inputRef = useRef();
|
|
81
82
|
const handleChange = useCallback(value => {
|
|
82
83
|
const date = dayjsWithPlugins(value);
|
|
84
|
+
if (!withTime) {
|
|
85
|
+
setPopoverState(false);
|
|
86
|
+
inputRef.current.blur();
|
|
87
|
+
}
|
|
83
88
|
setDate(date);
|
|
84
89
|
onChange(date.toDate());
|
|
85
90
|
setInputValue(date.format(validFormat));
|
|
@@ -116,6 +121,9 @@ function DatePickerInput(_ref) {
|
|
|
116
121
|
}, [frozenDateRange, validFormat, onChange, required]);
|
|
117
122
|
const checkDateInerval = useCallback(() => {
|
|
118
123
|
let value = getLastValidValue$1(date, validFormat);
|
|
124
|
+
if (!value) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
119
127
|
const minUnix = minDate && minDate.valueOf();
|
|
120
128
|
const maxUnix = maxDate && maxDate.valueOf();
|
|
121
129
|
const dateUnix = date && dayjs(date, validFormat).valueOf();
|
|
@@ -144,10 +152,10 @@ function DatePickerInput(_ref) {
|
|
|
144
152
|
const handleIconClick = useCallback((e, isBlurInitiatorCalendarIcon) => {
|
|
145
153
|
e.stopPropagation();
|
|
146
154
|
e.preventDefault();
|
|
147
|
-
if (!popoverOpened && !isBlurInitiatorCalendarIcon) {
|
|
155
|
+
if (!popoverOpened && !isBlurInitiatorCalendarIcon || withoutPicker) {
|
|
148
156
|
inputRef.current.focus();
|
|
149
157
|
}
|
|
150
|
-
}, [popoverOpened]);
|
|
158
|
+
}, [popoverOpened, withoutPicker]);
|
|
151
159
|
useEffect(() => {
|
|
152
160
|
const date = dayjsWithPlugins(value);
|
|
153
161
|
if (value) {
|
|
@@ -219,8 +227,7 @@ function DatePickerInput(_ref) {
|
|
|
219
227
|
className: readOnly ? 'pointer-events-none' : ''
|
|
220
228
|
}, pickerProps, {
|
|
221
229
|
markedDate: markedDate,
|
|
222
|
-
frozenDateRange: frozenDateRange
|
|
223
|
-
autocomplete: "off"
|
|
230
|
+
frozenDateRange: frozenDateRange
|
|
224
231
|
}))
|
|
225
232
|
}, /*#__PURE__*/React__default.createElement(ExtendedInput, _extends({
|
|
226
233
|
clickableIcon: true,
|
|
@@ -232,8 +239,9 @@ function DatePickerInput(_ref) {
|
|
|
232
239
|
onChange: handleInputChange,
|
|
233
240
|
icon: readOnly ? '' : 'bc-icon-calendar',
|
|
234
241
|
className: classnames(className, 'date-input', {
|
|
235
|
-
'default-cursor': readOnly,
|
|
236
|
-
'clearable-date-picker': clearable
|
|
242
|
+
'default-cursor': readOnly || disabled,
|
|
243
|
+
'clearable-date-picker': clearable,
|
|
244
|
+
'text-cursor': withoutPicker
|
|
237
245
|
})
|
|
238
246
|
}, sharedProps)));
|
|
239
247
|
}
|
|
@@ -246,96 +254,96 @@ DatePickerInput.propTypes = {
|
|
|
246
254
|
/**
|
|
247
255
|
* Controls alignment of popover
|
|
248
256
|
*/
|
|
249
|
-
popoverAlign:
|
|
257
|
+
popoverAlign: PropTypes.oneOf(popoverConfig.align),
|
|
250
258
|
/**
|
|
251
259
|
* Controls flexibility of input element
|
|
252
260
|
*/
|
|
253
|
-
flexibility:
|
|
261
|
+
flexibility: PropTypes.oneOf(flexibility$1),
|
|
254
262
|
/**
|
|
255
263
|
* Controls appearance of input element
|
|
256
264
|
*/
|
|
257
|
-
appearance:
|
|
265
|
+
appearance: PropTypes.oneOf(appearances$1),
|
|
258
266
|
/**
|
|
259
267
|
* Placeholder text for input
|
|
260
268
|
*/
|
|
261
|
-
placeholder:
|
|
269
|
+
placeholder: PropTypes.string,
|
|
262
270
|
/**
|
|
263
271
|
* Disables datepicker when input is focused
|
|
264
272
|
*/
|
|
265
|
-
withoutPicker:
|
|
273
|
+
withoutPicker: PropTypes.bool,
|
|
266
274
|
/**
|
|
267
275
|
* Accepts same props as DatePicker component(organisms)
|
|
268
276
|
*/
|
|
269
|
-
pickerProps:
|
|
277
|
+
pickerProps: PropTypes.object,
|
|
270
278
|
/**
|
|
271
279
|
* Min specifies the minimum value allowed for datepicker
|
|
272
280
|
*/
|
|
273
|
-
min:
|
|
281
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(dayjsWithPlugins), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
274
282
|
/**
|
|
275
283
|
* Max specifies the maximum value allowed for datepicker
|
|
276
284
|
*/
|
|
277
|
-
max:
|
|
285
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(dayjsWithPlugins), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
278
286
|
/**
|
|
279
287
|
* The value of the input element, required for a controlled component.
|
|
280
288
|
*/
|
|
281
|
-
value:
|
|
289
|
+
value: PropTypes.oneOfType([PropTypes.instanceOf(dayjsWithPlugins), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
282
290
|
/**
|
|
283
291
|
* The CSS class name of the wrapper element.
|
|
284
292
|
*/
|
|
285
|
-
className:
|
|
293
|
+
className: PropTypes.string,
|
|
286
294
|
/**
|
|
287
295
|
* Controls input size
|
|
288
296
|
*/
|
|
289
|
-
size:
|
|
297
|
+
size: PropTypes.oneOf(size$1),
|
|
290
298
|
/**
|
|
291
299
|
* Custom date format
|
|
292
300
|
*/
|
|
293
|
-
format:
|
|
301
|
+
format: PropTypes.string,
|
|
294
302
|
/**
|
|
295
303
|
* If true, the input element will be disabled.
|
|
296
304
|
*/
|
|
297
|
-
disabled:
|
|
305
|
+
disabled: PropTypes.bool,
|
|
298
306
|
/**
|
|
299
307
|
* It prevents the user from changing the value of the field.
|
|
300
308
|
*/
|
|
301
|
-
readOnly:
|
|
309
|
+
readOnly: PropTypes.bool,
|
|
302
310
|
/**
|
|
303
311
|
* If true, the input element will show icon which can reset selected date.
|
|
304
312
|
*/
|
|
305
|
-
clearable:
|
|
313
|
+
clearable: PropTypes.bool,
|
|
306
314
|
/**
|
|
307
315
|
* Callback fired when the value is changed.
|
|
308
316
|
* function(date: Date) => void
|
|
309
317
|
*/
|
|
310
|
-
onChange:
|
|
318
|
+
onChange: PropTypes.func,
|
|
311
319
|
/**
|
|
312
320
|
* Callback fired when the input looses focus.
|
|
313
321
|
* function(e: Event) => void
|
|
314
322
|
*/
|
|
315
|
-
onBlur:
|
|
323
|
+
onBlur: PropTypes.func,
|
|
316
324
|
/**
|
|
317
325
|
* Callback fired when the input get focused.
|
|
318
326
|
* function(e: Event) => void
|
|
319
327
|
*/
|
|
320
|
-
onFocus:
|
|
328
|
+
onFocus: PropTypes.func,
|
|
321
329
|
/**
|
|
322
330
|
* If false, the input will indicate an error.
|
|
323
331
|
*/
|
|
324
|
-
isValid:
|
|
332
|
+
isValid: PropTypes.bool,
|
|
325
333
|
/**
|
|
326
334
|
* Title for input
|
|
327
335
|
*/
|
|
328
|
-
title:
|
|
336
|
+
title: PropTypes.string,
|
|
329
337
|
/**
|
|
330
338
|
* MarkedDate specifies the default mark date
|
|
331
339
|
*/
|
|
332
|
-
markedDate:
|
|
340
|
+
markedDate: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]),
|
|
333
341
|
/**
|
|
334
342
|
* Prop is responsible for disabling selected range
|
|
335
343
|
*/
|
|
336
|
-
frozenDateRange:
|
|
337
|
-
from:
|
|
338
|
-
to:
|
|
344
|
+
frozenDateRange: PropTypes.arrayOf(PropTypes.shape({
|
|
345
|
+
from: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]).isRequired,
|
|
346
|
+
to: PropTypes.oneOfType([PropTypes.instanceOf(dayjs), PropTypes.instanceOf(Date), PropTypes.string, PropTypes.number]).isRequired
|
|
339
347
|
}))
|
|
340
348
|
};
|
|
341
349
|
DatePickerInput.defaultProps = {
|
|
@@ -466,10 +474,14 @@ function DateRangePickerInput(_ref) {
|
|
|
466
474
|
const end = dayjsWithPlugins(endDate);
|
|
467
475
|
setStartDate(start);
|
|
468
476
|
setEndDate(end);
|
|
477
|
+
if (!withTime) {
|
|
478
|
+
inputRef.current.blur();
|
|
479
|
+
setPopoverState(false);
|
|
480
|
+
}
|
|
469
481
|
setInputValue("".concat(start.format(validFormat)).concat(rangeSeparator).concat(end.format(validFormat)));
|
|
470
482
|
onChange(value);
|
|
471
483
|
}
|
|
472
|
-
}, [validFormat, rangeSeparator, onChange]);
|
|
484
|
+
}, [validFormat, rangeSeparator, onChange, withTime]);
|
|
473
485
|
const handleInputChange = useCallback(e => {
|
|
474
486
|
var _value, _value2, _value3;
|
|
475
487
|
let {
|
|
@@ -569,10 +581,10 @@ function DateRangePickerInput(_ref) {
|
|
|
569
581
|
const handleIconClick = useCallback((e, isBlurInitiatorCalendarIcon) => {
|
|
570
582
|
e.stopPropagation();
|
|
571
583
|
e.preventDefault();
|
|
572
|
-
if (!popoverOpened && !isBlurInitiatorCalendarIcon) {
|
|
584
|
+
if (!popoverOpened && !isBlurInitiatorCalendarIcon || withoutPicker) {
|
|
573
585
|
inputRef.current.focus();
|
|
574
586
|
}
|
|
575
|
-
}, [popoverOpened]);
|
|
587
|
+
}, [popoverOpened, withoutPicker]);
|
|
576
588
|
useEffect(() => {
|
|
577
589
|
const [first, second] = value;
|
|
578
590
|
const startDate = dayjsWithPlugins(first);
|
|
@@ -701,10 +713,11 @@ function DateRangePickerInput(_ref) {
|
|
|
701
713
|
icon: readOnly ? '' : 'bc-icon-calendar',
|
|
702
714
|
onIconClick: handleIconClick,
|
|
703
715
|
className: classnames(className, 'date-input', {
|
|
704
|
-
'default-cursor': readOnly,
|
|
705
|
-
'clearable-date-picker': clearable
|
|
716
|
+
'default-cursor': readOnly || disabled,
|
|
717
|
+
'clearable-date-picker': clearable,
|
|
718
|
+
'text-cursor': withoutPicker
|
|
706
719
|
}),
|
|
707
|
-
|
|
720
|
+
autocomplete: "off"
|
|
708
721
|
}, sharedProps)));
|
|
709
722
|
}
|
|
710
723
|
const {
|
|
@@ -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.2\"] .divider{background:rgba(var(--background-sc-rgb),.05);height:2.6rem;width:1px}[data-gene-ui-version=\"2.12.2\"] .divider:not(.divider-withNoSpace){margin:0 1.5rem}[data-gene-ui-version=\"2.12.2\"] .divider:not(.divider-withNoSpace).type-horizontal{margin:1.5rem 0}[data-gene-ui-version=\"2.12.2\"] .divider.type-horizontal{height:1px;width:2.6rem}[data-gene-ui-version=\"2.12.2\"] .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',
|