@consta/uikit 3.6.0 → 3.9.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/Attach/package.json +1 -1
- package/Attachment/package.json +1 -1
- package/Avatar/package.json +1 -1
- package/Badge/package.json +1 -1
- package/BasicSelectDeprecated/package.json +1 -1
- package/Breadcrumbs/package.json +1 -1
- package/Button/package.json +1 -1
- package/CHANGELOG.md +49 -41
- package/Calendar/package.json +1 -1
- package/Card/package.json +1 -1
- package/Checkbox/package.json +1 -1
- package/CheckboxGroup/package.json +1 -1
- package/ChoiceGroup/package.json +1 -1
- package/Collapse/package.json +1 -1
- package/CollapseGroup/package.json +1 -1
- package/Combobox/package.json +1 -1
- package/ComboboxDeprecated/package.json +1 -1
- package/ContextMenu/package.json +1 -1
- package/DatePickerCanary/es.js +1 -0
- package/DatePickerCanary/index.d.ts +1 -0
- package/DatePickerCanary/index.js +4 -0
- package/DatePickerCanary/package.json +9 -0
- package/DateTimeCanary/package.json +1 -1
- package/DragNDropField/package.json +1 -1
- package/EventInterceptor/package.json +1 -1
- package/FieldCaption/package.json +1 -1
- package/FieldLabel/package.json +1 -1
- package/File/package.json +1 -1
- package/FileField/package.json +1 -1
- package/FileIcon/package.json +1 -1
- package/FileIconAvi/package.json +1 -1
- package/FileIconBmp/package.json +1 -1
- package/FileIconCsv/package.json +1 -1
- package/FileIconDoc/package.json +1 -1
- package/FileIconExe/package.json +1 -1
- package/FileIconGif/package.json +1 -1
- package/FileIconJpg/package.json +1 -1
- package/FileIconJson/package.json +1 -1
- package/FileIconLoading/package.json +1 -1
- package/FileIconMov/package.json +1 -1
- package/FileIconMp3/package.json +1 -1
- package/FileIconMp4/package.json +1 -1
- package/FileIconPdf/package.json +1 -1
- package/FileIconPng/package.json +1 -1
- package/FileIconPtt/package.json +1 -1
- package/FileIconRar/package.json +1 -1
- package/FileIconRtf/package.json +1 -1
- package/FileIconTiff/package.json +1 -1
- package/FileIconTxt/package.json +1 -1
- package/FileIconUndefined/package.json +1 -1
- package/FileIconWav/package.json +1 -1
- package/FileIconXls/package.json +1 -1
- package/FileIconZip/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Header/package.json +1 -1
- package/Icon/package.json +1 -1
- package/IconAdd/package.json +1 -1
- package/IconAddToComparison/package.json +1 -1
- package/IconAlert/package.json +1 -1
- package/IconAlignBlocksLeft/package.json +1 -1
- package/IconAlignBlocksRight/package.json +1 -1
- package/IconAlignCenter/package.json +1 -1
- package/IconAlignJustify/package.json +1 -1
- package/IconAlignLeft/package.json +1 -1
- package/IconAlignRight/package.json +1 -1
- package/IconAllDone/package.json +1 -1
- package/IconArrowDown/package.json +1 -1
- package/IconArrowLeft/package.json +1 -1
- package/IconArrowRight/package.json +1 -1
- package/IconArrowUp/package.json +1 -1
- package/IconArtBrush/package.json +1 -1
- package/IconAttach/package.json +1 -1
- package/IconBackward/package.json +1 -1
- package/IconBag/package.json +1 -1
- package/IconBarrier/package.json +1 -1
- package/IconBento/package.json +1 -1
- package/IconBold/package.json +1 -1
- package/IconBook/package.json +1 -1
- package/IconBookmarkFilled/package.json +1 -1
- package/IconBookmarkStroked/package.json +1 -1
- package/IconCalculator/package.json +1 -1
- package/IconCalendar/package.json +1 -1
- package/IconCamera/package.json +1 -1
- package/IconCancel/package.json +1 -1
- package/IconCards/package.json +1 -1
- package/IconChat/package.json +1 -1
- package/IconCheck/package.json +1 -1
- package/IconClose/package.json +1 -1
- package/IconCollapse/package.json +1 -1
- package/IconColorFill/package.json +1 -1
- package/IconColorText/package.json +1 -1
- package/IconColumns/package.json +1 -1
- package/IconComment/package.json +1 -1
- package/IconConnection/package.json +1 -1
- package/IconCopy/package.json +1 -1
- package/IconCrown/package.json +1 -1
- package/IconCursorMouse/package.json +1 -1
- package/IconDataNull/package.json +1 -1
- package/IconDiamond/package.json +1 -1
- package/IconDinosaur/package.json +1 -1
- package/IconDisconnection/package.json +1 -1
- package/IconDocAdd/package.json +1 -1
- package/IconDocBlank/package.json +1 -1
- package/IconDocDelete/package.json +1 -1
- package/IconDocExport/package.json +1 -1
- package/IconDocFilled/package.json +1 -1
- package/IconDown/package.json +1 -1
- package/IconDownload/package.json +1 -1
- package/IconDrag/package.json +1 -1
- package/IconDraggable/package.json +1 -1
- package/IconDrillingRig/package.json +1 -1
- package/IconDrop/package.json +1 -1
- package/IconEdit/package.json +1 -1
- package/IconExit/package.json +1 -1
- package/IconExpand/package.json +1 -1
- package/IconEye/package.json +1 -1
- package/IconEyeClose/package.json +1 -1
- package/IconFavorite/package.json +1 -1
- package/IconFilter/package.json +1 -1
- package/IconFitToDefault/package.json +1 -1
- package/IconFlagFilled/package.json +1 -1
- package/IconFlagStroked/package.json +1 -1
- package/IconFolders/package.json +1 -1
- package/IconForward/package.json +1 -1
- package/IconFunnel/package.json +1 -1
- package/IconGas/package.json +1 -1
- package/IconGeo/package.json +1 -1
- package/IconGrouping/package.json +1 -1
- package/IconHamburger/package.json +1 -1
- package/IconHand/package.json +1 -1
- package/IconHealth/package.json +1 -1
- package/IconInComparison/package.json +1 -1
- package/IconInfo/package.json +1 -1
- package/IconIntroduction/package.json +1 -1
- package/IconIpad/package.json +1 -1
- package/IconItalic/package.json +1 -1
- package/IconKebab/package.json +1 -1
- package/IconLaptop/package.json +1 -1
- package/IconLayers/package.json +1 -1
- package/IconLeaf/package.json +1 -1
- package/IconLightningBolt/package.json +1 -1
- package/IconLineAndBarChart/package.json +1 -1
- package/IconLink/package.json +1 -1
- package/IconList/package.json +1 -1
- package/IconListNumbered/package.json +1 -1
- package/IconLock/package.json +1 -1
- package/IconLogicalElement/package.json +1 -1
- package/IconMBU/package.json +1 -1
- package/IconMGRP/package.json +1 -1
- package/IconMLSP/package.json +1 -1
- package/IconMMP/package.json +1 -1
- package/IconMail/package.json +1 -1
- package/IconMap/package.json +1 -1
- package/IconMaxHeight/package.json +1 -1
- package/IconMaxWidth/package.json +1 -1
- package/IconMeatball/package.json +1 -1
- package/IconMic/package.json +1 -1
- package/IconMolecules/package.json +1 -1
- package/IconMoon/package.json +1 -1
- package/IconNodeEnd/package.json +1 -1
- package/IconNodeStart/package.json +1 -1
- package/IconNodeStep/package.json +1 -1
- package/IconNodes/package.json +1 -1
- package/IconOpenInNew/package.json +1 -1
- package/IconPanelBottom/package.json +1 -1
- package/IconPanelLeft/package.json +1 -1
- package/IconPanelRight/package.json +1 -1
- package/IconPanelTop/package.json +1 -1
- package/IconPaste/package.json +1 -1
- package/IconPause/package.json +1 -1
- package/IconPhone/package.json +1 -1
- package/IconPhoto/package.json +1 -1
- package/IconPlay/package.json +1 -1
- package/IconPressure/package.json +1 -1
- package/IconProcessing/package.json +1 -1
- package/IconQuestion/package.json +1 -1
- package/IconQuote/package.json +1 -1
- package/IconRUO/package.json +1 -1
- package/IconRUS/package.json +1 -1
- package/IconRecord/package.json +1 -1
- package/IconRemove/package.json +1 -1
- package/IconRemoveFromComparison/package.json +1 -1
- package/IconReply/package.json +1 -1
- package/IconResize/package.json +1 -1
- package/IconRestart/package.json +1 -1
- package/IconRevert/package.json +1 -1
- package/IconRing/package.json +1 -1
- package/IconRouble/package.json +1 -1
- package/IconRuler/package.json +1 -1
- package/IconScreen/package.json +1 -1
- package/IconSearch/package.json +1 -1
- package/IconSelect/package.json +1 -1
- package/IconSelectOpen/package.json +1 -1
- package/IconSettings/package.json +1 -1
- package/IconShape/package.json +1 -1
- package/IconShuffle/package.json +1 -1
- package/IconSmile/package.json +1 -1
- package/IconSortDown/package.json +1 -1
- package/IconSortDownCenter/package.json +1 -1
- package/IconSortUp/package.json +1 -1
- package/IconSortUpCenter/package.json +1 -1
- package/IconStop/package.json +1 -1
- package/IconStorage/package.json +1 -1
- package/IconStrikethrough/package.json +1 -1
- package/IconSun/package.json +1 -1
- package/IconTable/package.json +1 -1
- package/IconTarget/package.json +1 -1
- package/IconTeam/package.json +1 -1
- package/IconTest/package.json +1 -1
- package/IconThumbUp/package.json +1 -1
- package/IconTie/package.json +1 -1
- package/IconTop/package.json +1 -1
- package/IconTrash/package.json +1 -1
- package/IconType/package.json +1 -1
- package/IconUnderline/package.json +1 -1
- package/IconUnlock/package.json +1 -1
- package/IconUnsort/package.json +1 -1
- package/IconUnsortCenter/package.json +1 -1
- package/IconUpload/package.json +1 -1
- package/IconUser/package.json +1 -1
- package/IconVZD/package.json +1 -1
- package/IconVideo/package.json +1 -1
- package/IconWarning/package.json +1 -1
- package/IconWatch/package.json +1 -1
- package/IconWideScreen/package.json +1 -1
- package/IconWorld/package.json +1 -1
- package/Informer/package.json +1 -1
- package/LayoutCanary/package.json +1 -1
- package/Loader/package.json +1 -1
- package/MixCard/package.json +1 -1
- package/MixFocus/package.json +1 -1
- package/MixVisuallyHidden/package.json +1 -1
- package/Modal/package.json +1 -1
- package/MultiComboboxDeprecated/package.json +1 -1
- package/Pagination/package.json +1 -1
- package/Popover/package.json +1 -1
- package/PortalWithTheme/package.json +1 -1
- package/ProgressSpin/package.json +1 -1
- package/ProgressStepBarCanary/es.js +1 -0
- package/ProgressStepBarCanary/index.d.ts +1 -0
- package/ProgressStepBarCanary/index.js +4 -0
- package/ProgressStepBarCanary/package.json +9 -0
- package/Radio/package.json +1 -1
- package/RadioGroup/package.json +1 -1
- package/Responses/package.json +1 -1
- package/Responses403/package.json +1 -1
- package/Responses404/package.json +1 -1
- package/Responses500/package.json +1 -1
- package/Responses503/package.json +1 -1
- package/ResponsesConnectionError/package.json +1 -1
- package/ResponsesDeleted/package.json +1 -1
- package/ResponsesEmptyBox/package.json +1 -1
- package/ResponsesEmptyPockets/package.json +1 -1
- package/ResponsesImage/package.json +1 -1
- package/ResponsesImage403/package.json +1 -1
- package/ResponsesImage404/package.json +1 -1
- package/ResponsesImage500/package.json +1 -1
- package/ResponsesImage503/package.json +1 -1
- package/ResponsesImageConnectionError/package.json +1 -1
- package/ResponsesImageDeleted/package.json +1 -1
- package/ResponsesImageEmptyBox/package.json +1 -1
- package/ResponsesImageEmptyPockets/package.json +1 -1
- package/ResponsesImageNothingFound/package.json +1 -1
- package/ResponsesImageSuccess/package.json +1 -1
- package/ResponsesNothingFound/package.json +1 -1
- package/ResponsesSuccess/package.json +1 -1
- package/Select/package.json +1 -1
- package/Sidebar/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/Steps/package.json +1 -1
- package/Switch/package.json +1 -1
- package/SwitchGroup/package.json +1 -1
- package/Table/package.json +1 -1
- package/Tabs/package.json +1 -1
- package/Tag/package.json +1 -1
- package/TagBase/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextField/package.json +1 -1
- package/Theme/package.json +1 -1
- package/ThemeToggler/package.json +1 -1
- package/Timer/package.json +1 -1
- package/Tooltip/package.json +1 -1
- package/User/package.json +1 -1
- package/UserSelect/package.json +1 -1
- package/UserSelectDeprecated/package.json +1 -1
- package/__internal__/cjs-src/components/Calendar/CalendarDay/CalendarDay.d.ts +1 -1
- package/__internal__/cjs-src/components/Combobox/Combobox.js +4 -4
- package/__internal__/cjs-src/components/Combobox/helpers.d.ts +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerCanary.d.ts +3 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerCanary.js +20 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.css +68 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts +26 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js +22 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +36 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +144 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +43 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +16 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.css +11 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +58 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.js +96 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts +31 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.js +35 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.d.ts +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.js +60 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.d.ts +2 -0
- package/__internal__/cjs-src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.js +126 -0
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.d.ts +185 -0
- package/__internal__/cjs-src/components/DatePickerCanary/helpers.js +28 -0
- package/__internal__/cjs-src/components/DateTimeCanary/DateTimeItem/DateTimeItem.d.ts +1 -1
- package/__internal__/cjs-src/components/DateTimeCanary/DateTimeTypeDate/DateTimeTypeDate.js +4 -4
- package/__internal__/cjs-src/components/DateTimeCanary/helpers/getDaysOfMonth.js +1 -1
- package/__internal__/cjs-src/components/DateTimeCanary/helpers/getMonthsOfYear.js +1 -1
- package/__internal__/cjs-src/components/DateTimeCanary/helpers/getYearsOfDecade.js +1 -1
- package/__internal__/cjs-src/components/DateTimeCanary/helpers/isDateInRange.d.ts +1 -1
- package/__internal__/cjs-src/components/DateTimeCanary/helpers/isDateInRange.js +7 -2
- package/__internal__/cjs-src/components/EventInterceptor/eventInterceptorMap.d.ts +41 -1
- package/__internal__/cjs-src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +41 -1
- package/__internal__/cjs-src/components/FieldLabel/FieldLabel.css +4 -0
- package/__internal__/cjs-src/components/FieldLabel/FieldLabel.d.ts +2 -0
- package/__internal__/cjs-src/components/FieldLabel/FieldLabel.js +5 -2
- package/__internal__/cjs-src/components/Header/Login/HeaderLogin.d.ts +1 -1
- package/__internal__/cjs-src/components/Modal/Modal.css +5 -0
- package/__internal__/cjs-src/components/Modal/Modal.js +1 -1
- package/__internal__/cjs-src/components/ProgressSpin/ProgressSpin.d.ts +1 -1
- package/__internal__/cjs-src/components/ProgressSpin/ProgressSpin.js +14 -4
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBar.css +25 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.d.ts +3 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +59 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +170 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.d.ts +3 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +69 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.css +54 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.d.ts +11 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js +45 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.d.ts +121 -0
- package/__internal__/cjs-src/components/ProgressStepBarCanary/helpers.js +51 -0
- package/__internal__/cjs-src/components/Select/Select.js +4 -4
- package/__internal__/cjs-src/components/Select/helpers.d.ts +2 -0
- package/__internal__/cjs-src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +3 -1
- package/__internal__/cjs-src/components/SelectComponents/SelectContainer/SelectContainer.js +2 -2
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +1 -0
- package/__internal__/cjs-src/components/SelectComponents/SelectDropdown/SelectDropdown.js +2 -2
- package/__internal__/cjs-src/components/Table/Header/TableHeader.js +8 -1
- package/__internal__/cjs-src/components/Table/Table.d.ts +5 -1
- package/__internal__/cjs-src/components/Table/TextFilter/TableTextFilter.js +2 -1
- package/__internal__/cjs-src/components/Table/helpers.d.ts +2 -0
- package/__internal__/cjs-src/components/TextField/TextField.css +85 -0
- package/__internal__/cjs-src/components/TextField/TextField.js +45 -9
- package/__internal__/cjs-src/components/TextField/helpers.d.ts +11 -4
- package/__internal__/cjs-src/components/Timer/Timer.css +18 -1
- package/__internal__/cjs-src/components/Timer/Timer.d.ts +2 -2
- package/__internal__/cjs-src/components/Timer/Timer.js +2 -2
- package/__internal__/cjs-src/components/UserSelect/UserSelect.js +4 -4
- package/__internal__/cjs-src/components/UserSelect/helpers.d.ts +2 -0
- package/__internal__/cjs-src/hooks/useSelect/useSelect.d.ts +1 -0
- package/__internal__/cjs-src/hooks/useSelect/useSelect.js +13 -1
- package/__internal__/cjs-src/icons/Icon/Icon.css +4 -0
- package/__internal__/cjs-src/icons/Icon/Icon.d.ts +1 -1
- package/__internal__/cjs-src/utils/date/index.d.ts +5 -0
- package/__internal__/cjs-src/utils/date/index.js +9 -0
- package/__internal__/src/components/Calendar/CalendarDay/CalendarDay.d.ts +1 -1
- package/__internal__/src/components/Combobox/Combobox.js +4 -4
- package/__internal__/src/components/Combobox/helpers.d.ts +2 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerCanary.d.ts +3 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerCanary.js +17 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.css +68 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts +26 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.js +19 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +36 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +141 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.d.ts +43 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDate/helpers.js +13 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.css +11 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.d.ts +58 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/DatePickerFieldTypeDateRange.js +93 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.d.ts +31 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerFieldTypeDateRange/helpers.js +32 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.d.ts +2 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDate/DatePickerTypeDate.js +57 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.d.ts +2 -0
- package/__internal__/src/components/DatePickerCanary/DatePickerTypeDateRange/DatePickerTypeDateRange.js +123 -0
- package/__internal__/src/components/DatePickerCanary/helpers.d.ts +185 -0
- package/__internal__/src/components/DatePickerCanary/helpers.js +25 -0
- package/__internal__/src/components/DateTimeCanary/DateTimeItem/DateTimeItem.d.ts +1 -1
- package/__internal__/src/components/DateTimeCanary/DateTimeTypeDate/DateTimeTypeDate.js +4 -4
- package/__internal__/src/components/DateTimeCanary/helpers/getDaysOfMonth.js +1 -1
- package/__internal__/src/components/DateTimeCanary/helpers/getMonthsOfYear.js +1 -1
- package/__internal__/src/components/DateTimeCanary/helpers/getYearsOfDecade.js +1 -1
- package/__internal__/src/components/DateTimeCanary/helpers/isDateInRange.d.ts +1 -1
- package/__internal__/src/components/DateTimeCanary/helpers/isDateInRange.js +7 -2
- package/__internal__/src/components/EventInterceptor/eventInterceptorMap.d.ts +41 -1
- package/__internal__/src/components/EventInterceptor/propsHandlers/useTextFieldEventsHandler.d.ts +41 -1
- package/__internal__/src/components/FieldLabel/FieldLabel.css +4 -0
- package/__internal__/src/components/FieldLabel/FieldLabel.d.ts +2 -0
- package/__internal__/src/components/FieldLabel/FieldLabel.js +5 -2
- package/__internal__/src/components/Header/Login/HeaderLogin.d.ts +1 -1
- package/__internal__/src/components/Modal/Modal.css +5 -0
- package/__internal__/src/components/Modal/Modal.js +1 -1
- package/__internal__/src/components/ProgressSpin/ProgressSpin.d.ts +1 -1
- package/__internal__/src/components/ProgressSpin/ProgressSpin.js +14 -4
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBar.css +25 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.d.ts +3 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarCanary.js +56 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.css +170 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.d.ts +3 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarItem/ProgressStepBarItem.js +66 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.css +54 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.d.ts +11 -0
- package/__internal__/src/components/ProgressStepBarCanary/ProgressStepBarLine/ProgressStepBarLine.js +42 -0
- package/__internal__/src/components/ProgressStepBarCanary/helpers.d.ts +121 -0
- package/__internal__/src/components/ProgressStepBarCanary/helpers.js +47 -0
- package/__internal__/src/components/Select/Select.js +4 -4
- package/__internal__/src/components/Select/helpers.d.ts +2 -0
- package/__internal__/src/components/SelectComponents/SelectContainer/SelectContainer.d.ts +3 -1
- package/__internal__/src/components/SelectComponents/SelectContainer/SelectContainer.js +2 -2
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +1 -0
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +2 -2
- package/__internal__/src/components/Table/Header/TableHeader.js +8 -1
- package/__internal__/src/components/Table/Table.d.ts +5 -1
- package/__internal__/src/components/Table/TextFilter/TableTextFilter.js +2 -1
- package/__internal__/src/components/Table/helpers.d.ts +2 -0
- package/__internal__/src/components/TextField/TextField.css +85 -0
- package/__internal__/src/components/TextField/TextField.js +45 -9
- package/__internal__/src/components/TextField/helpers.d.ts +11 -4
- package/__internal__/src/components/Timer/Timer.css +18 -1
- package/__internal__/src/components/Timer/Timer.d.ts +2 -2
- package/__internal__/src/components/Timer/Timer.js +2 -2
- package/__internal__/src/components/UserSelect/UserSelect.js +4 -4
- package/__internal__/src/components/UserSelect/helpers.d.ts +2 -0
- package/__internal__/src/hooks/useSelect/useSelect.d.ts +1 -0
- package/__internal__/src/hooks/useSelect/useSelect.js +13 -1
- package/__internal__/src/icons/Icon/Icon.css +4 -0
- package/__internal__/src/icons/Icon/Icon.d.ts +1 -1
- package/__internal__/src/utils/date/index.d.ts +5 -0
- package/__internal__/src/utils/date/index.js +8 -0
- package/createIcon/package.json +1 -1
- package/createResponsesImage/package.json +1 -1
- package/package.json +4 -1
- package/useChoiceGroup/package.json +1 -1
- package/useChoiceGroupIndexed/package.json +1 -1
- package/useClickOutside/package.json +1 -1
- package/useComponentSize/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useFlag/package.json +1 -1
- package/useForkRef/package.json +1 -1
- package/useGlobalKeys/package.json +1 -1
- package/useKeys/package.json +1 -1
- package/useMutableRef/package.json +1 -1
- package/usePrevious/package.json +1 -1
- package/useResizeObserved/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSelect/package.json +1 -1
- package/useThemeVars/package.json +1 -1
- package/useTimer/package.json +1 -1
- package/withTooltip/package.json +1 -1
|
@@ -19,7 +19,7 @@ function ComboboxRender(props, ref) {
|
|
|
19
19
|
var controlInnerRef = useRef(null);
|
|
20
20
|
var helperInputFakeElement = useRef(null);
|
|
21
21
|
var controlRef = useRef(null);
|
|
22
|
-
var _a = withDefaultGetters(props), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemLabel = _a.getItemLabel, getItemKey = _a.getItemKey, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, renderValueProp = _a.renderValue, onCreate = _a.onCreate, inputRefProp = _a.inputRef, _g = _a.labelForNotFound, labelForNotFound = _g === void 0 ? defaultlabelForNotFound : _g, _h = _a.labelForCreate, labelForCreate = _h === void 0 ? defaultlabelForCreate : _h, searchFunction = _a.searchFunction, _j = _a.multiple, multiple = _j === void 0 ? false : _j, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "disabled", "ariaLabel", "id", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "onCreate", "inputRef", "labelForNotFound", "labelForCreate", "searchFunction", "multiple"]);
|
|
22
|
+
var _a = withDefaultGetters(props), placeholder = _a.placeholder, onBlur = _a.onBlur, onFocus = _a.onFocus, items = _a.items, onChange = _a.onChange, value = _a.value, disabled = _a.disabled, ariaLabel = _a.ariaLabel, id = _a.id, required = _a.required, _b = _a.dropdownRef, dropdownRef = _b === void 0 ? defaultDropdownRef : _b, _c = _a.form, form = _c === void 0 ? defaultPropForm : _c, _d = _a.view, view = _d === void 0 ? defaultPropView : _d, _e = _a.size, size = _e === void 0 ? defaultPropSize : _e, dropdownClassName = _a.dropdownClassName, name = _a.name, _f = _a.groups, groups = _f === void 0 ? [] : _f, getItemLabel = _a.getItemLabel, getItemKey = _a.getItemKey, getItemGroupKey = _a.getItemGroupKey, getItemDisabled = _a.getItemDisabled, getGroupKey = _a.getGroupKey, getGroupLabel = _a.getGroupLabel, renderItem = _a.renderItem, renderValueProp = _a.renderValue, onCreate = _a.onCreate, inputRefProp = _a.inputRef, _g = _a.labelForNotFound, labelForNotFound = _g === void 0 ? defaultlabelForNotFound : _g, _h = _a.labelForCreate, labelForCreate = _h === void 0 ? defaultlabelForCreate : _h, searchFunction = _a.searchFunction, _j = _a.multiple, multiple = _j === void 0 ? false : _j, restProps = __rest(_a, ["placeholder", "onBlur", "onFocus", "items", "onChange", "value", "disabled", "ariaLabel", "id", "required", "dropdownRef", "form", "view", "size", "dropdownClassName", "name", "groups", "getItemLabel", "getItemKey", "getItemGroupKey", "getItemDisabled", "getGroupKey", "getGroupLabel", "renderItem", "renderValue", "onCreate", "inputRef", "labelForNotFound", "labelForCreate", "searchFunction", "multiple"]);
|
|
23
23
|
var _k = useSelect({
|
|
24
24
|
items: items,
|
|
25
25
|
groups: groups,
|
|
@@ -38,7 +38,7 @@ function ComboboxRender(props, ref) {
|
|
|
38
38
|
onFocus: onFocus,
|
|
39
39
|
onCreate: onCreate,
|
|
40
40
|
searchFunction: searchFunction
|
|
41
|
-
}), getKeyProps = _k.getKeyProps, getOptionProps = _k.getOptionProps, isOpen = _k.isOpen, visibleItems = _k.visibleItems, isFocused = _k.isFocused, handleInputFocus = _k.handleInputFocus, handleInputBlur = _k.handleInputBlur, handleToggleDropdown = _k.handleToggleDropdown, inputRef = _k.inputRef, handleInputClick = _k.handleInputClick, handleInputChange = _k.handleInputChange, searchValue = _k.searchValue, clearValue = _k.clearValue, getHandleRemoveValue = _k.getHandleRemoveValue;
|
|
41
|
+
}), getKeyProps = _k.getKeyProps, getOptionProps = _k.getOptionProps, isOpen = _k.isOpen, visibleItems = _k.visibleItems, isFocused = _k.isFocused, handleInputFocus = _k.handleInputFocus, handleInputBlur = _k.handleInputBlur, handleToggleDropdown = _k.handleToggleDropdown, inputRef = _k.inputRef, handleInputClick = _k.handleInputClick, handleInputChange = _k.handleInputChange, searchValue = _k.searchValue, clearValue = _k.clearValue, getHandleRemoveValue = _k.getHandleRemoveValue, notFound = _k.notFound;
|
|
42
42
|
var dropdownForm = getSelectDropdownForm(form);
|
|
43
43
|
var renderItemDefault = function (props) {
|
|
44
44
|
var item = props.item, active = props.active, hovered = props.hovered, onClick = props.onClick, onMouseEnter = props.onMouseEnter;
|
|
@@ -66,7 +66,7 @@ function ComboboxRender(props, ref) {
|
|
|
66
66
|
(!value || (Array.isArray(value) && value.length === 0)) && !searchValue && placeholder && (React.createElement("span", { className: cnSelect('Placeholder'), title: "placeholder" }, placeholder)),
|
|
67
67
|
React.createElement("input", __assign({}, getKeyProps(), { type: "text", name: name, onFocus: handleInputFocus, onBlur: handleInputBlur, "aria-label": ariaLabel, onChange: handleInputChange, ref: inputRefForRender, className: cnSelect('Input', { size: size, hide: !multiple && !!value, multiple: multiple }), value: searchValue, style: { width: width } }))));
|
|
68
68
|
};
|
|
69
|
-
return (React.createElement(SelectContainer, __assign({ focused: isFocused, disabled: disabled, size: size, view: view, form: form, multiple: multiple, ref: ref }, restProps),
|
|
69
|
+
return (React.createElement(SelectContainer, __assign({ focused: isFocused, disabled: disabled, size: size, view: view, required: required, form: form, multiple: multiple, ref: ref }, restProps),
|
|
70
70
|
React.createElement("div", { className: cnSelect('Control', { hasInput: true }), ref: controlRef, "aria-expanded": isOpen, "aria-haspopup": "listbox", id: id },
|
|
71
71
|
React.createElement("div", { className: cnSelect('ControlInner'), onClick: handleInputClick, role: "button", ref: controlInnerRef, "aria-hidden": "true" },
|
|
72
72
|
React.createElement("div", { className: cnSelect('ControlValueContainer') }, multiple ? (React.createElement("div", { className: cnSelect('ControlValue') }, renderControlValue())) : (renderControlValue()))),
|
|
@@ -76,7 +76,7 @@ function ComboboxRender(props, ref) {
|
|
|
76
76
|
React.createElement("span", { className: cnSelect('Delimiter') }),
|
|
77
77
|
React.createElement("button", { type: "button", className: cnSelect('IndicatorsDropdown'), tabIndex: -1, onClick: handleToggleDropdown },
|
|
78
78
|
React.createElement(IconSelect, { size: "xs", className: cnSelect('DropdownIndicatorIcon') })))),
|
|
79
|
-
React.createElement(SelectDropdown, { isOpen: isOpen, size: size, controlRef: controlRef, getOptionProps: getOptionProps, dropdownRef: dropdownRef, form: dropdownForm, className: dropdownClassName, renderItem: renderItem || renderItemDefault, getGroupLabel: getGroupLabel, visibleItems: visibleItems, labelForNotFound: labelForNotFound, labelForCreate: labelForCreate }),
|
|
79
|
+
React.createElement(SelectDropdown, { isOpen: isOpen, size: size, controlRef: controlRef, getOptionProps: getOptionProps, dropdownRef: dropdownRef, form: dropdownForm, className: dropdownClassName, renderItem: renderItem || renderItemDefault, getGroupLabel: getGroupLabel, visibleItems: visibleItems, labelForNotFound: labelForNotFound, labelForCreate: labelForCreate, notFound: notFound }),
|
|
80
80
|
React.createElement("div", { className: cnSelect('HelperInputFakeElement'), ref: helperInputFakeElement }, searchValue)));
|
|
81
81
|
}
|
|
82
82
|
export var Combobox = forwardRef(ComboboxRender);
|
|
@@ -52,6 +52,7 @@ export declare type ComboboxProps<ITEM = DefaultItem, GROUP = DefaultGroup, MULT
|
|
|
52
52
|
}) => void;
|
|
53
53
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
54
54
|
labelForNotFound?: string;
|
|
55
|
+
required?: boolean;
|
|
55
56
|
labelForCreate?: string;
|
|
56
57
|
searchFunction?: PropSearchFunction<ITEM>;
|
|
57
58
|
multiple?: MULTIPLE;
|
|
@@ -115,6 +116,7 @@ export declare function withDefaultGetters<ITEM = DefaultItem, GROUP = DefaultGr
|
|
|
115
116
|
}) => void) | undefined;
|
|
116
117
|
inputRef?: React.RefObject<HTMLInputElement> | undefined;
|
|
117
118
|
labelForNotFound?: string | undefined;
|
|
119
|
+
required?: boolean | undefined;
|
|
118
120
|
labelForCreate?: string | undefined;
|
|
119
121
|
searchFunction?: PropSearchFunction<ITEM> | undefined;
|
|
120
122
|
multiple?: MULTIPLE | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import { maxDateDefault, minDateDefault } from '../../utils/date';
|
|
4
|
+
import { DatePickerTypeDate } from './DatePickerTypeDate/DatePickerTypeDate';
|
|
5
|
+
import { DatePickerTypeDateRange } from './DatePickerTypeDateRange/DatePickerTypeDateRange';
|
|
6
|
+
import { datePickerPropTypeDefault, isDateRangeParams, isNotDateRangeParams, } from './helpers';
|
|
7
|
+
export var DatePicker = forwardRef(function (props, ref) {
|
|
8
|
+
var propsWidthDefault = __assign(__assign({}, props), { type: props.type || datePickerPropTypeDefault, minDate: props.minDate || minDateDefault, maxDate: props.maxDate || maxDateDefault });
|
|
9
|
+
if (isNotDateRangeParams(propsWidthDefault)) {
|
|
10
|
+
return React.createElement(DatePickerTypeDate, __assign({}, propsWidthDefault, { ref: ref }));
|
|
11
|
+
}
|
|
12
|
+
if (isDateRangeParams(propsWidthDefault)) {
|
|
13
|
+
return React.createElement(DatePickerTypeDateRange, __assign({}, propsWidthDefault, { ref: ref }));
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
});
|
|
17
|
+
export * from './helpers';
|
package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.css
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.DatePickerDropdown {
|
|
2
|
+
--transition-spase: var(--space-2xs);
|
|
3
|
+
padding: var(--space-l);
|
|
4
|
+
background: var(--color-bg-default);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
-webkit-box-shadow: var(--shadow-layer);
|
|
7
|
+
box-shadow: var(--shadow-layer);
|
|
8
|
+
-webkit-transform: translateY(var(--transition-spase));
|
|
9
|
+
transform: translateY(var(--transition-spase));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.DatePickerDropdown_form_default {
|
|
13
|
+
border-radius: var(--control-radius);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.DatePickerDropdown_form_brick {
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.DatePickerDropdown_form_round {
|
|
21
|
+
border-radius: var(--space-l);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.DatePickerDropdown_animate_appear,
|
|
25
|
+
.DatePickerDropdown_animate_appearActive,
|
|
26
|
+
.DatePickerDropdown_animate_appearDone,
|
|
27
|
+
.DatePickerDropdown_animate_enter,
|
|
28
|
+
.DatePickerDropdown_animate_enterActive,
|
|
29
|
+
.DatePickerDropdown_animate_enterDone,
|
|
30
|
+
.DatePickerDropdown_animate_exit,
|
|
31
|
+
.DatePickerDropdown_animate_exitActive,
|
|
32
|
+
.DatePickerDropdown_animate_exitDone {
|
|
33
|
+
-webkit-transition: 0.2s ease;
|
|
34
|
+
transition: 0.2s ease;
|
|
35
|
+
-webkit-transition-property: opacity, -webkit-transform;
|
|
36
|
+
transition-property: opacity, -webkit-transform;
|
|
37
|
+
transition-property: opacity, transform;
|
|
38
|
+
transition-property: opacity, transform, -webkit-transform;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.DatePickerDropdown_animate_appear,
|
|
42
|
+
.DatePickerDropdown_animate_enter {
|
|
43
|
+
opacity: 0;
|
|
44
|
+
-webkit-transform: translateY(var(--transition-spase));
|
|
45
|
+
transform: translateY(var(--transition-spase));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.DatePickerDropdown_animate_enterActive,
|
|
49
|
+
.DatePickerDropdown_animate_appearActive,
|
|
50
|
+
.DatePickerDropdown_animate_appearDone,
|
|
51
|
+
.DatePickerDropdown_animate_enterDone {
|
|
52
|
+
opacity: 1;
|
|
53
|
+
-webkit-transform: translateY(0);
|
|
54
|
+
transform: translateY(0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.DatePickerDropdown_animate_exit {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
-webkit-transform: translateY(0);
|
|
60
|
+
transform: translateY(0);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.DatePickerDropdown_animate_exitActive,
|
|
64
|
+
.DatePickerDropdown_animate_exitDone {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
-webkit-transform: translateY(var(--transition-spase));
|
|
67
|
+
transform: translateY(var(--transition-spase));
|
|
68
|
+
}
|
package/__internal__/src/components/DatePickerCanary/DatePickerDropdown/DatePickerDropdown.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import './DatePickerDropdown.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { DateRange } from '../../../utils/types/Date';
|
|
4
|
+
import { PropsWithHTMLAttributesAndRef } from '../../../utils/types/PropsWithHTMLAttributes';
|
|
5
|
+
import { DateTimePropOnChange, DateTimePropType } from '../../DateTimeCanary/DateTimeCanary';
|
|
6
|
+
import { DatePickerPropDateTimeView, DatePickerPropDropdownForm } from '../helpers';
|
|
7
|
+
export declare type DatePickerDropdownPropOnChange = DateTimePropOnChange;
|
|
8
|
+
export declare type DatePickerDropdownProps = PropsWithHTMLAttributesAndRef<{
|
|
9
|
+
anchorRef: React.RefObject<HTMLElement>;
|
|
10
|
+
currentVisibleDate?: Date;
|
|
11
|
+
type?: DateTimePropType;
|
|
12
|
+
value?: Date | DateRange;
|
|
13
|
+
onChange?: DatePickerDropdownPropOnChange;
|
|
14
|
+
minDate?: Date;
|
|
15
|
+
maxDate?: Date;
|
|
16
|
+
events?: Date[];
|
|
17
|
+
view?: DatePickerPropDateTimeView;
|
|
18
|
+
locale?: Locale;
|
|
19
|
+
children?: never;
|
|
20
|
+
form?: DatePickerPropDropdownForm;
|
|
21
|
+
isOpen?: boolean;
|
|
22
|
+
onChangeCurrentVisibleDate?: (date: Date) => void;
|
|
23
|
+
}, HTMLDivElement>;
|
|
24
|
+
declare type DatePickerDropdownComponent = (props: DatePickerDropdownProps) => React.ReactElement | null;
|
|
25
|
+
export declare const DatePickerDropdown: DatePickerDropdownComponent;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './DatePickerDropdown.css';
|
|
3
|
+
import React, { forwardRef, useRef } from 'react';
|
|
4
|
+
import { CSSTransition } from 'react-transition-group';
|
|
5
|
+
import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
|
|
6
|
+
import { cn } from '../../../utils/bem';
|
|
7
|
+
import { cnForCssTransition } from '../../../utils/cnForCssTransition';
|
|
8
|
+
import { DateTime, } from '../../DateTimeCanary/DateTimeCanary';
|
|
9
|
+
import { Popover } from '../../Popover/Popover';
|
|
10
|
+
import { datePickerPropDropdownFormDefault, } from '../helpers';
|
|
11
|
+
var cnDatePickerDropdown = cn('DatePickerDropdown');
|
|
12
|
+
var cnDatePickerDropdownCssTransition = cnForCssTransition(cnDatePickerDropdown);
|
|
13
|
+
export var DatePickerDropdown = forwardRef(function (props, ref) {
|
|
14
|
+
var _a = props.form, form = _a === void 0 ? datePickerPropDropdownFormDefault : _a, anchorRef = props.anchorRef, isOpen = props.isOpen, value = props.value, className = props.className, onChange = props.onChange, otherProps = __rest(props, ["form", "anchorRef", "isOpen", "value", "className", "onChange"]);
|
|
15
|
+
var rootRef = useRef(null);
|
|
16
|
+
return (React.createElement(CSSTransition, { "in": isOpen, unmountOnExit: true, appear: true, classNames: cnDatePickerDropdownCssTransition, timeout: 200, nodeRef: rootRef },
|
|
17
|
+
React.createElement(Popover, { ref: useForkRef([ref, rootRef]), anchorRef: anchorRef, className: cnDatePickerDropdown({ form: form }, [className]), direction: "downStartLeft", spareDirection: "downStartLeft", possibleDirections: ['downStartLeft', 'upStartLeft', 'downStartRight', 'upStartRight'] },
|
|
18
|
+
React.createElement(DateTime, __assign({}, otherProps, { onChange: onChange, type: "date", value: value || undefined })))));
|
|
19
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const DatePickerFieldTypeDate: React.ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
value?: Date | null | undefined;
|
|
5
|
+
onChange?: ((props: {
|
|
6
|
+
e: Event;
|
|
7
|
+
value: Date | null;
|
|
8
|
+
}) => void) | undefined;
|
|
9
|
+
onError?: import("../helpers").DatePickerPropOnError | undefined;
|
|
10
|
+
id?: string | undefined;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
14
|
+
view?: "default" | "clear" | undefined;
|
|
15
|
+
form?: "default" | "round" | "brick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "defaultBrick" | "brickDefault" | "brickClear" | "clearBrick" | "clearClear" | "brickRound" | "roundBrick" | undefined;
|
|
16
|
+
status?: "alert" | "success" | "warning" | undefined;
|
|
17
|
+
width?: "default" | "full" | undefined;
|
|
18
|
+
onFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
19
|
+
onBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
20
|
+
autoFocus?: boolean | undefined;
|
|
21
|
+
placeholder?: string | undefined;
|
|
22
|
+
leftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
|
|
23
|
+
rightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
|
|
24
|
+
readOnly?: boolean | undefined;
|
|
25
|
+
required?: boolean | undefined;
|
|
26
|
+
tabIndex?: number | undefined;
|
|
27
|
+
inputRef?: ((instance: HTMLInputElement | HTMLTextAreaElement | null) => void) | React.RefObject<HTMLInputElement | HTMLTextAreaElement> | null | undefined;
|
|
28
|
+
ariaLabel?: string | undefined;
|
|
29
|
+
iconSize?: "xs" | "s" | "m" | undefined;
|
|
30
|
+
children?: undefined;
|
|
31
|
+
format?: string | undefined;
|
|
32
|
+
separator?: string | undefined;
|
|
33
|
+
minDate?: Date | undefined;
|
|
34
|
+
maxDate?: Date | undefined;
|
|
35
|
+
focused?: boolean | undefined;
|
|
36
|
+
} & Pick<React.HTMLAttributes<HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "slot" | "spellCheck" | "style" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { format, isValid, isWithinInterval, parse } from 'date-fns';
|
|
4
|
+
import IMask from 'imask';
|
|
5
|
+
import { useForkRef } from '../../../hooks/useForkRef/useForkRef';
|
|
6
|
+
import { useMutableRef } from '../../../hooks/useMutableRef/useMutableRef';
|
|
7
|
+
import { leapYear, maxDateDefault, minDateDefault } from '../../../utils/date';
|
|
8
|
+
import { TextField } from '../../TextField/TextField';
|
|
9
|
+
import { datePickerErrorTypes, datePickerPropFormatDefault, datePickerPropPlaceholderDefault, datePickerPropSeparatorDefault, } from '../helpers';
|
|
10
|
+
import { getPartsDate } from './helpers';
|
|
11
|
+
export var DatePickerFieldTypeDate = React.forwardRef(function (props, ref) {
|
|
12
|
+
var _a = props.format, formatProp = _a === void 0 ? datePickerPropFormatDefault : _a, _b = props.separator, separator = _b === void 0 ? datePickerPropSeparatorDefault : _b, _c = props.placeholder, placeholder = _c === void 0 ? datePickerPropPlaceholderDefault : _c, onChange = props.onChange, onError = props.onError, _d = props.minDate, minDate = _d === void 0 ? minDateDefault : _d, _e = props.maxDate, maxDate = _e === void 0 ? maxDateDefault : _e, value = props.value, inputRefProp = props.inputRef, otherProps = __rest(props, ["format", "separator", "placeholder", "onChange", "onError", "minDate", "maxDate", "value", "inputRef"]);
|
|
13
|
+
var inputRef = useRef(null);
|
|
14
|
+
var imaskRef = useRef(null);
|
|
15
|
+
var onChangeRef = useMutableRef(onChange);
|
|
16
|
+
var _f = __read(useState(value && isValid(value) ? format(value, formatProp) : null), 2), stringValue = _f[0], setStringValue = _f[1];
|
|
17
|
+
var handleChange = useCallback(function (e, stringValue) {
|
|
18
|
+
setStringValue(stringValue);
|
|
19
|
+
var onChange = onChangeRef.current;
|
|
20
|
+
if (onChange) {
|
|
21
|
+
if (!stringValue) {
|
|
22
|
+
onChange({ e: e, value: null });
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
var _a = __read(getPartsDate(stringValue, formatProp, separator), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
26
|
+
if (dd && MM && yyyy) {
|
|
27
|
+
var date = parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatDefault, new Date());
|
|
28
|
+
if (!isWithinInterval(date, { start: minDate, end: maxDate })) {
|
|
29
|
+
onError &&
|
|
30
|
+
onError({
|
|
31
|
+
type: datePickerErrorTypes[0],
|
|
32
|
+
stringValue: stringValue,
|
|
33
|
+
dd: dd,
|
|
34
|
+
MM: MM,
|
|
35
|
+
yyyy: yyyy,
|
|
36
|
+
date: date
|
|
37
|
+
});
|
|
38
|
+
onChange({ e: e, value: null });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
onChange({ e: e, value: date });
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
onChange({ e: e, value: null });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}, [minDate === null || minDate === void 0 ? void 0 : minDate.getTime(), maxDate === null || maxDate === void 0 ? void 0 : maxDate.getTime(), formatProp, separator]);
|
|
48
|
+
// при изменении value, нужно обновить stringValue
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
if (value && isValid(value)) {
|
|
51
|
+
setStringValue(format(value, formatProp));
|
|
52
|
+
}
|
|
53
|
+
else if ((stringValue === null || stringValue === void 0 ? void 0 : stringValue.length) === formatProp.length) {
|
|
54
|
+
// если количество введенных символов меньше чем в формате маски
|
|
55
|
+
// то не нужно мешать вводу с клавиатуры
|
|
56
|
+
// если дата была введена полностью и value пришел null,
|
|
57
|
+
// то можно считать что поле нуждается в очистке
|
|
58
|
+
setStringValue('');
|
|
59
|
+
}
|
|
60
|
+
}, [value === null || value === void 0 ? void 0 : value.getTime()]);
|
|
61
|
+
// задаем маску и сохраняем обьект маски в ref
|
|
62
|
+
// обнавляем при смене формата
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
if (inputRef.current) {
|
|
65
|
+
imaskRef.current = IMask(inputRef.current, {
|
|
66
|
+
mask: Date,
|
|
67
|
+
pattern: formatProp,
|
|
68
|
+
blocks: {
|
|
69
|
+
yyyy: {
|
|
70
|
+
mask: IMask.MaskedRange,
|
|
71
|
+
from: 1,
|
|
72
|
+
to: 9999
|
|
73
|
+
},
|
|
74
|
+
MM: {
|
|
75
|
+
mask: IMask.MaskedRange,
|
|
76
|
+
from: 1,
|
|
77
|
+
to: 12
|
|
78
|
+
},
|
|
79
|
+
dd: {
|
|
80
|
+
mask: IMask.MaskedRange,
|
|
81
|
+
from: 1,
|
|
82
|
+
to: 31
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
lazy: true,
|
|
86
|
+
autofix: true,
|
|
87
|
+
format: function (date) { return format(date, formatProp); },
|
|
88
|
+
parse: function (string) { return parse(string, formatProp, new Date()); },
|
|
89
|
+
validate: function (string) {
|
|
90
|
+
var _a = __read(getPartsDate(string, formatProp, separator), 3), dd = _a[0], MM = _a[1], yyyy = _a[2];
|
|
91
|
+
if (dd &&
|
|
92
|
+
MM &&
|
|
93
|
+
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + leapYear, datePickerPropFormatDefault, new Date()))) {
|
|
94
|
+
onError &&
|
|
95
|
+
onError({
|
|
96
|
+
type: datePickerErrorTypes[1],
|
|
97
|
+
stringValue: string,
|
|
98
|
+
dd: dd,
|
|
99
|
+
MM: MM,
|
|
100
|
+
yyyy: yyyy
|
|
101
|
+
});
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
if (dd &&
|
|
105
|
+
MM &&
|
|
106
|
+
yyyy &&
|
|
107
|
+
!isValid(parse("" + dd + datePickerPropSeparatorDefault + MM + datePickerPropSeparatorDefault + yyyy, datePickerPropFormatDefault, new Date()))) {
|
|
108
|
+
onError &&
|
|
109
|
+
onError({
|
|
110
|
+
type: datePickerErrorTypes[1],
|
|
111
|
+
stringValue: string,
|
|
112
|
+
dd: dd,
|
|
113
|
+
MM: MM,
|
|
114
|
+
yyyy: yyyy
|
|
115
|
+
});
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}, [formatProp, separator]);
|
|
123
|
+
// задаем нативный oninput, так как с маской по другому не будет работать
|
|
124
|
+
// обнавляем oninput при смене handleChange
|
|
125
|
+
useEffect(function () {
|
|
126
|
+
if (inputRef.current) {
|
|
127
|
+
inputRef.current.oninput = function (e) {
|
|
128
|
+
var _a;
|
|
129
|
+
handleChange(e, ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) || '');
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}, [handleChange]);
|
|
133
|
+
// Нужно для синхранизации value c Imask,
|
|
134
|
+
// так как value мы можем задать через пропс без самого ввода,
|
|
135
|
+
// и Imask требует ручной синхронихации в этом случае
|
|
136
|
+
useEffect(function () {
|
|
137
|
+
var _a;
|
|
138
|
+
(_a = imaskRef.current) === null || _a === void 0 ? void 0 : _a.updateValue();
|
|
139
|
+
}, [stringValue]);
|
|
140
|
+
return (React.createElement(TextField, __assign({}, otherProps, { type: "text", ref: ref, inputRef: useForkRef([inputRef, inputRefProp]), value: stringValue, placeholder: placeholder })));
|
|
141
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconProps, IconPropSize } from '../../../icons/Icon/Icon';
|
|
3
|
+
import { PropsWithHTMLAttributes } from '../../../utils/types/PropsWithHTMLAttributes';
|
|
4
|
+
import { TextFieldPropForm, TextFieldPropSize, TextFieldPropStatus, TextFieldPropView, TextFieldPropWidth } from '../../TextField/TextField';
|
|
5
|
+
import { DatePickerPropOnError } from '../helpers';
|
|
6
|
+
declare type DatePickerFieldTypeDatePropOnChange = (props: {
|
|
7
|
+
e: Event;
|
|
8
|
+
value: Date | null;
|
|
9
|
+
}) => void;
|
|
10
|
+
export declare type DatePickerFieldTypeDateProps = PropsWithHTMLAttributes<{
|
|
11
|
+
className?: string;
|
|
12
|
+
value?: Date | null;
|
|
13
|
+
onChange?: DatePickerFieldTypeDatePropOnChange;
|
|
14
|
+
onError?: DatePickerPropOnError;
|
|
15
|
+
id?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
size?: TextFieldPropSize;
|
|
19
|
+
view?: TextFieldPropView;
|
|
20
|
+
form?: TextFieldPropForm;
|
|
21
|
+
status?: TextFieldPropStatus;
|
|
22
|
+
width?: TextFieldPropWidth;
|
|
23
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
24
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
25
|
+
autoFocus?: boolean;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
leftSide?: string | React.FC<IconProps>;
|
|
28
|
+
rightSide?: string | React.FC<IconProps>;
|
|
29
|
+
readOnly?: boolean;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
tabIndex?: number;
|
|
32
|
+
inputRef?: React.Ref<HTMLTextAreaElement | HTMLInputElement>;
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
iconSize?: IconPropSize;
|
|
35
|
+
children?: never;
|
|
36
|
+
format?: string;
|
|
37
|
+
separator?: string;
|
|
38
|
+
minDate?: Date;
|
|
39
|
+
maxDate?: Date;
|
|
40
|
+
focused?: boolean;
|
|
41
|
+
}, HTMLDivElement>;
|
|
42
|
+
export declare const getPartsDate: (value: string, format: string, separator: string, markers?: string[]) => (string | undefined)[];
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var getPartDate = function (formatArray, stringArray, marker) {
|
|
2
|
+
var index = formatArray.indexOf(marker);
|
|
3
|
+
if (index >= 0 && stringArray[index] && stringArray[index].length === marker.length) {
|
|
4
|
+
return stringArray[index];
|
|
5
|
+
}
|
|
6
|
+
return undefined;
|
|
7
|
+
};
|
|
8
|
+
export var getPartsDate = function (value, format, separator, markers) {
|
|
9
|
+
if (markers === void 0) { markers = ['dd', 'MM', 'yyyy']; }
|
|
10
|
+
var formatArray = format.split(separator);
|
|
11
|
+
var valueArray = value.split(separator);
|
|
12
|
+
return markers.map(function (marker) { return getPartDate(formatArray, valueArray, marker); });
|
|
13
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import './DatePickerFieldTypeDateRange.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const DatePickerFieldTypeDateRange: React.ForwardRefExoticComponent<Pick<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<{
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
value?: Date | null | undefined;
|
|
6
|
+
onChange?: ((props: {
|
|
7
|
+
e: Event;
|
|
8
|
+
value: Date | null;
|
|
9
|
+
}) => void) | undefined;
|
|
10
|
+
onError?: import("../helpers").DatePickerPropOnError | undefined;
|
|
11
|
+
id?: string | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
size?: "xs" | "s" | "m" | "l" | undefined;
|
|
15
|
+
view?: "default" | "clear" | undefined;
|
|
16
|
+
form?: "default" | "round" | "brick" | "clearRound" | "roundClear" | "clearDefault" | "defaultClear" | "defaultBrick" | "brickDefault" | "brickClear" | "clearBrick" | "clearClear" | "brickRound" | "roundBrick" | undefined;
|
|
17
|
+
status?: "alert" | "success" | "warning" | undefined;
|
|
18
|
+
width?: "default" | "full" | undefined;
|
|
19
|
+
onFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
20
|
+
onBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
21
|
+
autoFocus?: boolean | undefined;
|
|
22
|
+
placeholder?: string | undefined;
|
|
23
|
+
leftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
|
|
24
|
+
rightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
|
|
25
|
+
readOnly?: boolean | undefined;
|
|
26
|
+
required?: boolean | undefined;
|
|
27
|
+
tabIndex?: number | undefined;
|
|
28
|
+
inputRef?: ((instance: HTMLInputElement | HTMLTextAreaElement | null) => void) | React.RefObject<HTMLInputElement | HTMLTextAreaElement> | null | undefined;
|
|
29
|
+
ariaLabel?: string | undefined;
|
|
30
|
+
iconSize?: "xs" | "s" | "m" | undefined;
|
|
31
|
+
children?: undefined;
|
|
32
|
+
format?: string | undefined;
|
|
33
|
+
separator?: string | undefined;
|
|
34
|
+
minDate?: Date | undefined;
|
|
35
|
+
maxDate?: Date | undefined;
|
|
36
|
+
focused?: boolean | undefined;
|
|
37
|
+
}, HTMLDivElement>, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "view" | "size" | "form" | "name" | "width" | "format" | "autoFocus" | "readOnly" | "required" | "status" | "focused" | "ariaLabel" | "iconSize" | "separator" | "minDate" | "maxDate"> & {
|
|
38
|
+
onChange?: ((props: {
|
|
39
|
+
e: Event;
|
|
40
|
+
value: import("../../../utils/types/Date").DateRange | null;
|
|
41
|
+
}) => void) | undefined;
|
|
42
|
+
value?: import("../../../utils/types/Date").DateRange | null | undefined;
|
|
43
|
+
startFieldInputRef?: ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined;
|
|
44
|
+
endFieldInputRef?: ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined;
|
|
45
|
+
startFieldLeftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
|
|
46
|
+
startFieldRightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
|
|
47
|
+
endFieldLeftSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
|
|
48
|
+
endFieldRightSide?: string | React.FC<import("../../../utils/types/PropsWithHTMLAttributes").PropsWithHTMLAttributes<import("../../../icons/Icon/Icon").Props, HTMLSpanElement>> | undefined;
|
|
49
|
+
startFieldRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
50
|
+
endFieldRef?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
51
|
+
startFieldOnFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
52
|
+
endFieldOnFocus?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
53
|
+
startFieldOnBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
54
|
+
endFieldOnBlur?: ((event: React.FocusEvent<HTMLElement>) => void) | undefined;
|
|
55
|
+
startFocused?: boolean | undefined;
|
|
56
|
+
endFocused?: boolean | undefined;
|
|
57
|
+
id?: string | undefined;
|
|
58
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import './DatePickerFieldTypeDateRange.css';
|
|
3
|
+
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import isBefore from 'date-fns/isBefore';
|
|
5
|
+
import isEqual from 'date-fns/isEqual';
|
|
6
|
+
import { cn } from '../../../utils/bem';
|
|
7
|
+
import { getSizeByMap } from '../../../utils/getSizeByMap';
|
|
8
|
+
import { DatePickerFieldTypeDate } from '../DatePickerFieldTypeDate/DatePickerFieldTypeDate';
|
|
9
|
+
import { datePickerErrorTypes } from '../helpers';
|
|
10
|
+
import { mapFormForEnd, mapFormForStart } from './helpers';
|
|
11
|
+
var cnDatePickerFieldTypeDateRange = cn('DatePickerFieldTypeDateRange');
|
|
12
|
+
export var DatePickerFieldTypeDateRange = forwardRef(function (props, ref) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
var className = props.className, _c = props.form, form = _c === void 0 ? 'default' : _c, startFieldInputRef = props.startFieldInputRef, startFieldLeftSide = props.startFieldLeftSide, startFieldRightSide = props.startFieldRightSide, endFieldInputRef = props.endFieldInputRef, endFieldLeftSide = props.endFieldLeftSide, endFieldRightSide = props.endFieldRightSide, _d = props.value, value = _d === void 0 ? [] : _d, onChange = props.onChange, onError = props.onError, name = props.name, disabled = props.disabled, size = props.size, view = props.view, status = props.status, autoFocus = props.autoFocus, placeholder = props.placeholder, readOnly = props.readOnly, required = props.required, tabIndex = props.tabIndex, ariaLabel = props.ariaLabel, iconSize = props.iconSize, format = props.format, separator = props.separator, minDate = props.minDate, maxDate = props.maxDate, startFieldOnBlur = props.startFieldOnBlur, startFieldOnFocus = props.startFieldOnFocus, endFieldOnBlur = props.endFieldOnBlur, endFieldOnFocus = props.endFieldOnFocus, startFieldRef = props.startFieldRef, endFieldRef = props.endFieldRef, startFocused = props.startFocused, endFocused = props.endFocused, otherProps = __rest(props, ["className", "form", "startFieldInputRef", "startFieldLeftSide", "startFieldRightSide", "endFieldInputRef", "endFieldLeftSide", "endFieldRightSide", "value", "onChange", "onError", "name", "disabled", "size", "view", "status", "autoFocus", "placeholder", "readOnly", "required", "tabIndex", "ariaLabel", "iconSize", "format", "separator", "minDate", "maxDate", "startFieldOnBlur", "startFieldOnFocus", "endFieldOnBlur", "endFieldOnFocus", "startFieldRef", "endFieldRef", "startFocused", "endFocused"]);
|
|
15
|
+
var commonProps = {
|
|
16
|
+
className: cnDatePickerFieldTypeDateRange('Field'),
|
|
17
|
+
disabled: disabled,
|
|
18
|
+
name: name,
|
|
19
|
+
onError: onError,
|
|
20
|
+
size: size,
|
|
21
|
+
view: view,
|
|
22
|
+
status: status,
|
|
23
|
+
autoFocus: autoFocus,
|
|
24
|
+
placeholder: placeholder,
|
|
25
|
+
readOnly: readOnly,
|
|
26
|
+
required: required,
|
|
27
|
+
tabIndex: tabIndex,
|
|
28
|
+
ariaLabel: ariaLabel,
|
|
29
|
+
iconSize: iconSize,
|
|
30
|
+
format: format,
|
|
31
|
+
separator: separator,
|
|
32
|
+
minDate: minDate,
|
|
33
|
+
maxDate: maxDate
|
|
34
|
+
};
|
|
35
|
+
var _e = __read(useState(value === null || value === void 0 ? void 0 : value[0]), 2), startDate = _e[0], setStartDate = _e[1];
|
|
36
|
+
var _f = __read(useState(value === null || value === void 0 ? void 0 : value[1]), 2), endDate = _f[0], setEndDate = _f[1];
|
|
37
|
+
var eventRef = useRef();
|
|
38
|
+
var handleChange = function (e, ownStartDate, ownEndDate) {
|
|
39
|
+
var start = ownStartDate || startDate;
|
|
40
|
+
var end = ownEndDate || endDate;
|
|
41
|
+
if (!onChange) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (start && end) {
|
|
45
|
+
if (isBefore(start, end) || isEqual(start, end)) {
|
|
46
|
+
onChange({ e: e, value: [start, end] });
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
onChange({ e: e, value: [start, undefined] });
|
|
50
|
+
onError && onError({ type: datePickerErrorTypes[2], date: [start, end] });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (start) {
|
|
54
|
+
onChange({ e: e, value: [start, undefined] });
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (end) {
|
|
58
|
+
onChange({ e: e, value: [undefined, end] });
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
onChange({ e: e, value: null });
|
|
62
|
+
};
|
|
63
|
+
var handleStartDateChange = function (props) {
|
|
64
|
+
var _a;
|
|
65
|
+
if (((_a = props.value) === null || _a === void 0 ? void 0 : _a.getTime()) === (startDate === null || startDate === void 0 ? void 0 : startDate.getTime())) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
eventRef.current = props.e;
|
|
69
|
+
setStartDate(props.value);
|
|
70
|
+
};
|
|
71
|
+
var handleEndDateChange = function (props) {
|
|
72
|
+
var _a;
|
|
73
|
+
if (((_a = props.value) === null || _a === void 0 ? void 0 : _a.getTime()) === (endDate === null || endDate === void 0 ? void 0 : endDate.getTime())) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
eventRef.current = props.e;
|
|
77
|
+
setEndDate(props.value);
|
|
78
|
+
};
|
|
79
|
+
useEffect(function () {
|
|
80
|
+
if (eventRef.current) {
|
|
81
|
+
handleChange(eventRef.current, startDate, endDate);
|
|
82
|
+
}
|
|
83
|
+
}, [eventRef.current]);
|
|
84
|
+
useEffect(function () {
|
|
85
|
+
setStartDate(value === null || value === void 0 ? void 0 : value[0]);
|
|
86
|
+
}, [(_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.getTime()]);
|
|
87
|
+
useEffect(function () {
|
|
88
|
+
setEndDate(value === null || value === void 0 ? void 0 : value[1]);
|
|
89
|
+
}, [(_b = value === null || value === void 0 ? void 0 : value[1]) === null || _b === void 0 ? void 0 : _b.getTime()]);
|
|
90
|
+
return (React.createElement("div", __assign({}, otherProps, { className: cnDatePickerFieldTypeDateRange(null, [className]), ref: ref }),
|
|
91
|
+
React.createElement(DatePickerFieldTypeDate, __assign({}, commonProps, { inputRef: startFieldInputRef, ref: startFieldRef, leftSide: startFieldLeftSide, rightSide: startFieldRightSide, form: getSizeByMap(mapFormForStart, form), value: startDate, onChange: handleStartDateChange, onFocus: startFieldOnFocus, onBlur: startFieldOnBlur, focused: startFocused })),
|
|
92
|
+
React.createElement(DatePickerFieldTypeDate, __assign({}, commonProps, { inputRef: endFieldInputRef, ref: endFieldRef, leftSide: endFieldLeftSide, rightSide: endFieldRightSide, form: getSizeByMap(mapFormForEnd, form), value: endDate, onChange: handleEndDateChange, onFocus: endFieldOnFocus, onBlur: endFieldOnBlur, focused: endFocused }))));
|
|
93
|
+
});
|