@consta/uikit 5.31.0 → 5.32.0
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/ColorPicker/index.d.ts +1 -0
- package/ColorPicker/index.js +1 -0
- package/__internal__/src/components/Attachment/Attachment.css +1 -1
- package/__internal__/src/components/Attachment/types.d.ts +1 -1
- package/__internal__/src/components/Attachment/types.js.map +1 -1
- package/__internal__/src/components/AttachmentDeprecated/Attachment.css +1 -1
- package/__internal__/src/components/AttachmentDeprecated/AttachmentDeprecated.js.map +1 -1
- package/__internal__/src/components/AttachmentDeprecated/types.d.ts +1 -1
- package/__internal__/src/components/AttachmentDeprecated/types.js.map +1 -1
- package/__internal__/src/components/Avatar/Avatar.d.ts +2 -2
- package/__internal__/src/components/Avatar/Avatar.js.map +1 -1
- package/__internal__/src/components/AvatarGroup/types.d.ts +2 -2
- package/__internal__/src/components/AvatarGroup/types.js.map +1 -1
- package/__internal__/src/components/Badge/Badge.css +2 -2
- package/__internal__/src/components/Badge/maps.js.map +1 -1
- package/__internal__/src/components/Badge/types.d.ts +4 -4
- package/__internal__/src/components/Badge/types.js.map +1 -1
- package/__internal__/src/components/Banner/Banner.d.ts +4 -4
- package/__internal__/src/components/Banner/Banner.js.map +1 -1
- package/__internal__/src/components/BookmarkTabs/BookmarkTabs.js.map +1 -1
- package/__internal__/src/components/BookmarkTabs/types.d.ts +3 -3
- package/__internal__/src/components/BookmarkTabs/types.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/types.d.ts +2 -2
- package/__internal__/src/components/Breadcrumbs/types.js.map +1 -1
- package/__internal__/src/components/Button/Button.d.ts +4 -4
- package/__internal__/src/components/Button/Button.js.map +1 -1
- package/__internal__/src/components/Card/Card.d.ts +3 -3
- package/__internal__/src/components/Card/Card.js.map +1 -1
- package/__internal__/src/components/Checkbox/Checkbox.css +2 -2
- package/__internal__/src/components/Checkbox/Checkbox.d.ts +3 -3
- package/__internal__/src/components/Checkbox/Checkbox.js.map +1 -1
- package/__internal__/src/components/CheckboxDeprecated/Checkbox.css +2 -2
- package/__internal__/src/components/CheckboxDeprecated/CheckboxDeprecated.d.ts +3 -3
- package/__internal__/src/components/CheckboxDeprecated/CheckboxDeprecated.js.map +1 -1
- package/__internal__/src/components/CheckboxGroup/types.d.ts +4 -4
- package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
- package/__internal__/src/components/Chips/ChipsItem/ChipsItem.css +2 -2
- package/__internal__/src/components/Chips/types.d.ts +2 -2
- package/__internal__/src/components/Chips/types.js.map +1 -1
- package/__internal__/src/components/ChoiceGroup/ChoiceGroup.js.map +1 -1
- package/__internal__/src/components/ChoiceGroup/types.d.ts +4 -4
- package/__internal__/src/components/ChoiceGroup/types.js.map +1 -1
- package/__internal__/src/components/Collapse/types.d.ts +7 -7
- package/__internal__/src/components/Collapse/types.js.map +1 -1
- package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.css +7 -0
- package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.d.ts +6 -0
- package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorControl/ColorControl.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorControl/index.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/ColorControl/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorControl/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorControl/types.d.ts +6 -0
- package/__internal__/src/components/ColorPicker/ColorControl/types.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorControl/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.d.ts +4 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/ColorInputTypeChanger.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.d.ts +6 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorInputTypeChanger/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.d.ts +16 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/ColorMarker.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorMarker/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.d.ts +13 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/ColorPalette.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPalette/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.d.ts +3 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/ColorPicker.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/index.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/types.d.ts +25 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/types.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPicker/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.d.ts +12 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/ColorPickerAlpha.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerAlpha/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.d.ts +12 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/ColorPickerBase.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerBase/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.d.ts +12 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/ColorPickerHue.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerHue/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.css +3 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.d.ts +5 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/ColorPickerInput.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.d.ts +12 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/helpers.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/index.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/types.d.ts +25 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/types.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInput/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.d.ts +15 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/ColorPickerInteractive.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerInteractive/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.d.ts +8 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/ColorPickerPoint.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerPoint/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.d.ts +16 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/ColorPickerRoot.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerRoot/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.css +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.d.ts +13 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/ColorPickerSaturation.js.map +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.js +2 -0
- package/__internal__/src/components/ColorPicker/ColorPickerSaturation/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.js +2 -0
- package/__internal__/src/components/ColorPicker/hooks/useColorManipulation.js.map +1 -0
- package/__internal__/src/components/ColorPicker/hooks/useEventCallback.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/hooks/useEventCallback.js +2 -0
- package/__internal__/src/components/ColorPicker/hooks/useEventCallback.js.map +1 -0
- package/__internal__/src/components/ColorPicker/index.d.ts +10 -0
- package/__internal__/src/components/ColorPicker/index.js +2 -0
- package/__internal__/src/components/ColorPicker/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hexAlphaModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hexAlphaModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hexAlphaModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hexModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hexModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hexModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hslModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hslModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hslModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hslStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hslStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hslStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hslaModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hslaModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hslaModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hslaStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hslaStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hslaStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hsvModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hsvStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hsvaModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvaModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvaModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/hsvaStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvaStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/hsvaStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/index.d.ts +14 -0
- package/__internal__/src/components/ColorPicker/models/index.js +2 -0
- package/__internal__/src/components/ColorPicker/models/index.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/rgbModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/rgbStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/rgbaModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbaModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbaModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/models/rgbaStringModel.d.ts +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbaStringModel.js +2 -0
- package/__internal__/src/components/ColorPicker/models/rgbaStringModel.js.map +1 -0
- package/__internal__/src/components/ColorPicker/types.d.ts +33 -0
- package/__internal__/src/components/ColorPicker/types.js +2 -0
- package/__internal__/src/components/ColorPicker/types.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/clamp.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/utils/clamp.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/clamp.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/compare.d.ts +4 -0
- package/__internal__/src/components/ColorPicker/utils/compare.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/compare.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/convert.d.ts +32 -0
- package/__internal__/src/components/ColorPicker/utils/convert.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/convert.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/format.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/utils/format.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/format.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/round.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/utils/round.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/round.js.map +1 -0
- package/__internal__/src/components/ColorPicker/utils/validate.d.ts +1 -0
- package/__internal__/src/components/ColorPicker/utils/validate.js +2 -0
- package/__internal__/src/components/ColorPicker/utils/validate.js.map +1 -0
- package/__internal__/src/components/ContextMenu/ContextMenuLevel/ContextMenuLevel.js.map +1 -1
- package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js.map +1 -1
- package/__internal__/src/components/ContextMenu/types.d.ts +3 -3
- package/__internal__/src/components/ContextMenu/types.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.d.ts +1 -0
- package/__internal__/src/components/DatePicker/DatePickerDropdown/DatePickerDropdown.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDate/DatePickerTypeDate.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateRange/DatePickerTypeDateRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTime/DatePickerTypeDateTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeDateTimeRange/DatePickerTypeDateTimeRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonth/DatePickerTypeMonth.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerTypeMonthRange/DatePickerTypeMonthRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/getChangeFnRange.js +1 -1
- package/__internal__/src/components/DatePicker/getChangeFnRange.js.map +1 -1
- package/__internal__/src/components/DatePicker/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/types.d.ts +6 -6
- package/__internal__/src/components/DatePicker/types.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js +1 -1
- package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js +1 -1
- package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.d.ts +1 -1
- package/__internal__/src/components/DateTime/DateTimeCell/DateTimeCell.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeGrid/DateTimeGrid.css +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeYearSlider/DateTimeYearSlider.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeYearSlider/DateTimeYearSlider.js.map +1 -1
- package/__internal__/src/components/DateTime/helpers/index.js +1 -1
- package/__internal__/src/components/DateTime/helpers/index.js.map +1 -1
- package/__internal__/src/components/DateTime/helpers/types.d.ts +4 -3
- package/__internal__/src/components/DateTime/helpers/types.js.map +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.css +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/types.d.ts +1 -1
- package/__internal__/src/components/DragNDropFieldCanary/types.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.css +4 -2
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/FieldControlLayout.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.d.ts +5 -2
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/helpers.js.map +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.d.ts +1 -0
- package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.js +1 -1
- package/__internal__/src/components/FieldComponents/FieldControlLayout/maps.js.map +1 -1
- package/__internal__/src/components/FieldGroup/getForm.js +1 -1
- package/__internal__/src/components/FieldGroup/getForm.js.map +1 -1
- package/__internal__/src/components/FileCanary/types.d.ts +1 -1
- package/__internal__/src/components/FileCanary/types.js.map +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelect.css +8 -8
- package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.d.ts +1 -1
- package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.js.map +1 -1
- package/__internal__/src/components/Grid/types.d.ts +4 -4
- package/__internal__/src/components/Grid/types.js.map +1 -1
- package/__internal__/src/components/GridDeprecated/Grid.css +1 -1
- package/__internal__/src/components/GridDeprecated/GridDeprecated.d.ts +4 -4
- package/__internal__/src/components/GridDeprecated/GridDeprecated.js.map +1 -1
- package/__internal__/src/components/Informer/Informer.d.ts +3 -3
- package/__internal__/src/components/Informer/Informer.js.map +1 -1
- package/__internal__/src/components/Layout/Layout.d.ts +3 -3
- package/__internal__/src/components/Layout/Layout.js.map +1 -1
- package/__internal__/src/components/Layout/useFixed.d.ts +2 -2
- package/__internal__/src/components/Layout/useFixed.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListCanary.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListItemGrid/ListItemGrid.css +1 -1
- package/__internal__/src/components/ListCanary/types.d.ts +4 -4
- package/__internal__/src/components/ListCanary/types.js.map +1 -1
- package/__internal__/src/components/LoaderDeprecated/Loader.css +2 -2
- package/__internal__/src/components/LoaderDeprecated/LoaderDeprecated.d.ts +1 -1
- package/__internal__/src/components/LoaderDeprecated/LoaderDeprecated.js.map +1 -1
- package/__internal__/src/components/Modal/ModalLayout/ModalLayout.css +4 -4
- package/__internal__/src/components/ModalDeprecated/ModalDeprecated.d.ts +2 -2
- package/__internal__/src/components/ModalDeprecated/ModalDeprecated.js.map +1 -1
- package/__internal__/src/components/Notification/helpers/defaultDateFormat.js +1 -1
- package/__internal__/src/components/Notification/helpers/defaultDateFormat.js.map +1 -1
- package/__internal__/src/components/Pagination/types.d.ts +3 -3
- package/__internal__/src/components/Pagination/types.js.map +1 -1
- package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.d.ts +4 -4
- package/__internal__/src/components/PaginationDeprecated/PaginationDeprecated.js.map +1 -1
- package/__internal__/src/components/Popover/Popover.d.ts +2 -2
- package/__internal__/src/components/Popover/Popover.js.map +1 -1
- package/__internal__/src/components/ProgressLine/ProgressLine.css +1 -1
- package/__internal__/src/components/ProgressLine/types.d.ts +1 -1
- package/__internal__/src/components/ProgressLine/types.js.map +1 -1
- package/__internal__/src/components/ProgressSpin/ProgressSpin.d.ts +1 -1
- package/__internal__/src/components/ProgressSpin/ProgressSpin.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css +8 -8
- package/__internal__/src/components/ProgressStepBar/helpers.d.ts +5 -5
- package/__internal__/src/components/ProgressStepBar/helpers.js.map +1 -1
- package/__internal__/src/components/Radio/Radio.css +1 -1
- package/__internal__/src/components/Radio/Radio.d.ts +3 -3
- package/__internal__/src/components/Radio/Radio.js.map +1 -1
- package/__internal__/src/components/RadioGroup/types.d.ts +4 -4
- package/__internal__/src/components/RadioGroup/types.js.map +1 -1
- package/__internal__/src/components/Responses/Responses.d.ts +1 -1
- package/__internal__/src/components/Responses/Responses.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectCanary/SelectMultiple/SelectMultiple.css +2 -2
- package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.d.ts +1 -1
- package/__internal__/src/components/SelectCanary/SelectPopover/SelectPopover.js.map +1 -1
- package/__internal__/src/components/SelectCanary/helpers.d.ts +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.d.ts +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.css +1 -1
- package/__internal__/src/components/SelectComponents/types.d.ts +4 -4
- package/__internal__/src/components/SelectComponents/types.js.map +1 -1
- package/__internal__/src/components/SelectComponents/useSelect/useSelect.js +1 -1
- package/__internal__/src/components/SelectComponents/useSelect/useSelect.js.map +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.d.ts +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/SelectValueTag/SelectValueTag.css +1 -1
- package/__internal__/src/components/SelectComponentsDeprecated/types.d.ts +4 -4
- package/__internal__/src/components/SelectComponentsDeprecated/types.js.map +1 -1
- package/__internal__/src/components/Sidebar/types.d.ts +2 -2
- package/__internal__/src/components/Sidebar/types.js.map +1 -1
- package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.d.ts +2 -2
- package/__internal__/src/components/SidebarDeprecated/SidebarDeprecated.js.map +1 -1
- package/__internal__/src/components/Skeleton/Skeleton.css +1 -1
- package/__internal__/src/components/Slider/helper.d.ts +2 -2
- package/__internal__/src/components/Slider/helper.js.map +1 -1
- package/__internal__/src/components/SnackBar/types.d.ts +4 -4
- package/__internal__/src/components/SnackBar/types.js.map +1 -1
- package/__internal__/src/components/Spoiler/types.d.ts +2 -2
- package/__internal__/src/components/Spoiler/types.js.map +1 -1
- package/__internal__/src/components/Steps/StepsStep/StepsStep.css +1 -1
- package/__internal__/src/components/Steps/types.d.ts +1 -1
- package/__internal__/src/components/Steps/types.js.map +1 -1
- package/__internal__/src/components/Switch/Switch.css +1 -1
- package/__internal__/src/components/Switch/types.d.ts +3 -3
- package/__internal__/src/components/Switch/types.js.map +1 -1
- package/__internal__/src/components/SwitchGroup/types.d.ts +1 -1
- package/__internal__/src/components/SwitchGroup/types.js.map +1 -1
- package/__internal__/src/components/Table/Cell/TableCell.css +1 -1
- package/__internal__/src/components/Table/Cell/TableCell.d.ts +2 -2
- package/__internal__/src/components/Table/Cell/TableCell.js.map +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.d.ts +1 -1
- package/__internal__/src/components/Table/Header/TableHeader.js.map +1 -1
- package/__internal__/src/components/Table/Table.d.ts +3 -3
- package/__internal__/src/components/Table/Table.js.map +1 -1
- package/__internal__/src/components/Table/__mock__/data.mock.d.ts +10 -10
- package/__internal__/src/components/Table/__mock__/data.mock.js.map +1 -1
- package/__internal__/src/components/Table/helpers.d.ts +1 -1
- package/__internal__/src/components/Table/helpers.js.map +1 -1
- package/__internal__/src/components/Tabs/Tabs.js.map +1 -1
- package/__internal__/src/components/Tabs/types.d.ts +4 -4
- package/__internal__/src/components/Tabs/types.js.map +1 -1
- package/__internal__/src/components/Tag/Tag.d.ts +1 -1
- package/__internal__/src/components/Tag/Tag.js.map +1 -1
- package/__internal__/src/components/TagBase/TagBase.d.ts +3 -3
- package/__internal__/src/components/TagBase/TagBase.js.map +1 -1
- package/__internal__/src/components/Text/Text.d.ts +13 -13
- package/__internal__/src/components/Text/Text.js.map +1 -1
- package/__internal__/src/components/TextAreaAutoSize/TextAreaAutoSize.css +1 -1
- package/__internal__/src/components/TextDeprecated/TextDeprecated.d.ts +13 -13
- package/__internal__/src/components/TextDeprecated/TextDeprecated.js.map +1 -1
- package/__internal__/src/components/TextField/types.d.ts +4 -4
- package/__internal__/src/components/TextField/types.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeNumber/TextFieldTypeNumber.js.map +1 -1
- package/__internal__/src/components/TextFieldCanary/TextFieldTypeTextArea/TextFieldTypeTextArea.css +2 -2
- package/__internal__/src/components/TextFieldCanary/useTextField.js.map +1 -1
- package/__internal__/src/components/ThemeToggler/ThemeToggler.js.map +1 -1
- package/__internal__/src/components/ThemeToggler/types.d.ts +1 -1
- package/__internal__/src/components/ThemeToggler/types.js.map +1 -1
- package/__internal__/src/components/Timer/Timer.d.ts +1 -1
- package/__internal__/src/components/Timer/Timer.js.map +1 -1
- package/__internal__/src/components/Tooltip/types.d.ts +2 -2
- package/__internal__/src/components/Tooltip/types.js.map +1 -1
- package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.d.ts +2 -2
- package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.js.map +1 -1
- package/__internal__/src/components/User/User.css +1 -1
- package/__internal__/src/components/User/User.d.ts +4 -4
- package/__internal__/src/components/User/User.js.map +1 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.css +1 -1
- package/__internal__/src/fileIcons/FileIcon/FileIcon.d.ts +1 -1
- package/__internal__/src/fileIcons/FileIcon/FileIcon.js.map +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.d.ts +1 -1
- package/__internal__/src/hocs/withTooltip/withTooltip.js.map +1 -1
- package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.d.ts +1 -1
- package/__internal__/src/hooks/useBreakpointsDeprecated/useBreakpointsDeprecated.js.map +1 -1
- package/__internal__/src/hooks/useRefs/useRefs.js.map +1 -1
- package/__internal__/src/hooks/useStyleProps/types.js.map +1 -1
- package/__internal__/src/mixs/MixCard/MixCard.d.ts +2 -2
- package/__internal__/src/mixs/MixCard/MixCard.js.map +1 -1
- package/__internal__/src/mixs/MixFlex/MixFlex.d.ts +5 -5
- package/__internal__/src/mixs/MixFlex/MixFlex.js.map +1 -1
- package/__internal__/src/mixs/MixScrollBar/MixScrollBar.d.ts +2 -2
- package/__internal__/src/mixs/MixScrollBar/MixScrollBar.js.map +1 -1
- package/__internal__/src/mixs/MixVisuallyHidden/MixVisuallyHidden.css +1 -1
- package/__internal__/src/utils/array.js.map +1 -1
- package/__internal__/src/utils/date/index.js +1 -1
- package/__internal__/src/utils/date/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["format","isValid","parse","useCallback","useEffect","IMask","getForm","useMutableRef","getTimeNumbers","datePickerPropSeparatorDefault","datePickerPropFormatTypeDate","datePickerPropFormatTypeTime","datePickerPropFormatTypeDateTime","datePickerPropFormatTypeYear","datePickerPropFormatTypeMonth","normalizeRangeValue","dateRange","getTime","getTimeOptionsByFormat","timeOptions","timePart","includes","split","formatArray","mapTimeOptions","HH","hours","mm","minutes","ss","seconds","map","marker","hoursOptions","minutesOptions","secondsOptions","adaptFormat","adaptedFormat","shouldRemoveTimePart","timeOption","Array","isArray","length","step","timeMarkers","replace","RegExp","trim","filter","part","join","placeholderByFormat","getMaskBlocks","includeDate","includeTime","blocks","dd","mask","MaskedRange","from","to","MM","yyyy","getFormForStart","form","getFormForEnd","getPartDate","stringArray","index","indexOf","getParts","separator","withTime","date","time","getPartsDate","value","markers","isTypeWithTime","type","fieldPrefixs","getFieldName","name","rangeIndex","getDropdownZIndex","style","zIndex","useStringValue","formatProp","onChangeRef","imaskProps","stringValue","refs","setValue","setStringValue","current","ref","maskRef","updateValue","handleClear","e","valueArray","validArray","item","Date","isValidTimeByTimeOptions","isUnitValid","unit","options","allowed","isHoursValid","getHours","isMinutesValid","getMinutes","isSecondsValid","getSeconds"],"sources":["../../../../../src/components/DatePicker/helpers.ts"],"sourcesContent":["import { format, isValid, parse } from 'date-fns';\nimport { useCallback, useEffect } from 'react';\nimport { IMask, useIMask } from 'react-imask';\n\nimport { getForm } from '##/components/FieldGroup';\nimport { TextFieldPropForm } from '##/components/TextField';\nimport { useMutableRef } from '##/hooks/useMutableRef';\nimport { DateRange } from '##/utils/types/Date';\n\nimport { TimeOptions, TimeUnitOptions } from '../DateTime';\nimport { getTimeNumbers } from '../DateTime/helpers';\nimport { DatePickerPropType } from './types';\n\nexport const datePickerPropSeparatorDefault = '.';\nexport const datePickerPropFormatTypeDate = `dd${datePickerPropSeparatorDefault}MM${datePickerPropSeparatorDefault}yyyy`;\n\nexport const datePickerPropFormatTypeTime = `HH:mm:ss`;\n\nexport const datePickerPropFormatTypeDateTime = `${datePickerPropFormatTypeDate} ${datePickerPropFormatTypeTime}`;\n\nexport const datePickerPropFormatTypeYear = `yyyy`;\n\nexport const datePickerPropFormatTypeMonth = `MM${datePickerPropSeparatorDefault}yyyy`;\n\nexport const normalizeRangeValue = (dateRange: DateRange): DateRange => {\n if (\n dateRange[0] &&\n dateRange[1] &&\n dateRange[0]?.getTime() > dateRange[1]?.getTime()\n ) {\n return [dateRange[1], dateRange[0]];\n }\n return dateRange;\n};\n\nexport const getTimeOptionsByFormat = (\n format: string,\n timeOptions?: TimeOptions,\n) => {\n const markers = ['HH', 'mm', 'ss'] as const;\n const timePart = format.includes(' ') ? format.split(' ')[1] : format;\n const formatArray = timePart?.split(':');\n const mapTimeOptions = {\n HH: timeOptions?.hours,\n mm: timeOptions?.minutes,\n ss: timeOptions?.seconds,\n } as const;\n\n const [hoursOptions, minutesOptions, secondsOptions] = markers.map((marker) =>\n formatArray?.includes(marker) ? mapTimeOptions[marker] : [],\n ) as [\n TimeUnitOptions | undefined,\n TimeUnitOptions | undefined,\n TimeUnitOptions | undefined,\n ];\n\n const effectiveTimeOptions = {\n hours: hoursOptions,\n minutes: minutesOptions,\n seconds: secondsOptions,\n };\n\n return effectiveTimeOptions;\n};\n\nexport const adaptFormat = (\n format: string,\n timeOptions?: TimeOptions,\n): string => {\n const formatArray = format.split(' ');\n let adaptedFormat = formatArray[1] ?? format;\n\n const shouldRemoveTimePart = (\n timeOption: TimeUnitOptions | undefined,\n ): boolean => {\n if (timeOption && Array.isArray(timeOption) && timeOption.length === 0)\n return true;\n if (timeOption && !Array.isArray(timeOption) && timeOption.step === 0)\n return true;\n\n return false;\n };\n\n const timeMarkers = [\n { marker: 'HH', timeOption: timeOptions?.hours },\n { marker: 'mm', timeOption: timeOptions?.minutes },\n { marker: 'ss', timeOption: timeOptions?.seconds },\n ];\n\n for (const { marker, timeOption } of timeMarkers) {\n if (shouldRemoveTimePart(timeOption)) {\n adaptedFormat = adaptedFormat.replace(new RegExp(`:?${marker}`, 'g'), '');\n }\n }\n\n adaptedFormat = adaptedFormat\n .replace(/:+$/, '')\n .replace(/^:+/, '')\n .replace(/:+/g, ':')\n .replace(/\\s+/g, ' ')\n .trim();\n\n if (formatArray.length > 1) {\n formatArray[1] = adaptedFormat;\n return formatArray.filter((part) => part.length > 0).join(' ');\n }\n return adaptedFormat;\n};\n\nexport const placeholderByFormat = (format: string): string => {\n return format\n .replace(/yyyy/g, 'ГГГГ')\n .replace(/MM/g, 'ММ')\n .replace(/dd/g, 'ДД')\n .replace(/HH/g, 'ЧЧ')\n .replace(/mm/g, 'ММ')\n .replace(/ss/g, 'СС');\n};\n\ntype MaskBlock = {\n mask: typeof IMask.MaskedRange;\n from: number;\n to: number;\n};\n\ntype MaskBlocks = Partial<{\n dd: MaskBlock;\n MM: MaskBlock;\n yyyy: MaskBlock;\n HH: MaskBlock;\n mm: MaskBlock;\n ss: MaskBlock;\n}>;\n\nexport const getMaskBlocks = ({\n includeDate = true,\n includeTime = true,\n} = {}): MaskBlocks => {\n const blocks: MaskBlocks = {};\n\n if (includeDate) {\n blocks.dd = { mask: IMask.MaskedRange, from: 1, to: 31 };\n blocks.MM = { mask: IMask.MaskedRange, from: 1, to: 12 };\n blocks.yyyy = { mask: IMask.MaskedRange, from: 1, to: 9999 };\n }\n\n if (includeTime) {\n blocks.HH = { mask: IMask.MaskedRange, from: 0, to: 23 };\n blocks.mm = { mask: IMask.MaskedRange, from: 0, to: 59 };\n blocks.ss = { mask: IMask.MaskedRange, from: 0, to: 59 };\n }\n\n return blocks;\n};\n\nexport const getFormForStart = (form: TextFieldPropForm) => getForm(form, 0, 2);\nexport const getFormForEnd = (form: TextFieldPropForm) => getForm(form, 1, 2);\n\nexport const getPartDate = (\n formatArray: string[],\n stringArray: string[],\n marker: string,\n) => {\n const index = formatArray.indexOf(marker);\n\n if (\n index >= 0 &&\n stringArray[index] &&\n stringArray[index].length === marker.length\n ) {\n return stringArray[index];\n }\n\n return undefined;\n};\n\nexport const getParts = (\n format: string,\n separator: string,\n withTime?: boolean,\n) => {\n if (withTime) {\n const [date, time] = format.split(' ');\n\n return [\n ...(date ? date.split(separator) : []),\n ...(time ? time.split(':') : []),\n ];\n }\n\n return format.split(separator);\n};\n\nexport const getPartsDate = (\n value: string,\n format: string,\n separator: string,\n withTime: boolean,\n markers: string[],\n) => {\n const formatArray = getParts(format, separator, withTime);\n const stringArray = getParts(value, separator, withTime);\n\n return markers.map((marker) => getPartDate(formatArray, stringArray, marker));\n};\n\nexport const isTypeWithTime = (type: DatePickerPropType) =>\n type.indexOf('time') !== -1;\n\nconst fieldPrefixs = ['start', 'end'] as const;\n\nexport const getFieldName = (\n name: [string?, string?] | string | undefined,\n rangeIndex: 0 | 1,\n) => {\n if (!name) {\n return undefined;\n }\n\n if (Array.isArray(name)) {\n return name[rangeIndex];\n }\n\n return `${name}_${fieldPrefixs[rangeIndex]}`;\n};\n\nexport const getDropdownZIndex = (style?: React.CSSProperties) =>\n typeof style?.zIndex === 'number' ? style.zIndex + 1 : undefined;\n\ntype DatePickerFieldTypeDatePropOnChange = (\n value: Date | null,\n props: {\n e: Event;\n },\n) => void;\n\nexport const useStringValue = (\n value: Date | undefined | null,\n formatProp: string,\n separator: string,\n onChangeRef: React.MutableRefObject<\n DatePickerFieldTypeDatePropOnChange | undefined\n >,\n imaskProps: ReturnType<typeof useIMask<HTMLInputElement>>,\n) => {\n const stringValue = imaskProps.value;\n\n const refs = useMutableRef([imaskProps.setValue, value] as const);\n\n const setStringValue = useCallback((value: string) => {\n refs.current[0](value);\n if (imaskProps.ref?.current) {\n imaskProps.ref.current.value = value;\n }\n if (imaskProps.maskRef.current) {\n imaskProps.maskRef.current.updateValue();\n }\n }, []);\n\n const handleClear: React.MouseEventHandler<HTMLButtonElement> = useCallback(\n (e) => {\n setStringValue('');\n\n if (refs.current[1]) {\n onChangeRef.current?.(null, { e: e as unknown as Event });\n }\n },\n [],\n );\n\n useEffect(() => {\n if (value && isValid(value)) {\n setStringValue(format(value, formatProp));\n }\n\n if (!value && stringValue) {\n const formatArray = getParts(formatProp, separator, false);\n const valueArray = getParts(stringValue, separator, false);\n const validArray = formatArray\n .map((marker) => getPartDate(formatArray, valueArray, marker))\n .filter((item) => Boolean(item));\n\n const date =\n formatArray.length === validArray.length\n ? parse(\n valueArray.join(datePickerPropSeparatorDefault),\n formatArray.join(datePickerPropSeparatorDefault),\n new Date(),\n )\n : undefined;\n\n if (isValid(date)) {\n setStringValue('');\n }\n }\n }, [value?.getTime()]);\n\n return handleClear;\n};\n\nexport const isValidTimeByTimeOptions = (\n date: Date,\n timeOptions?: TimeOptions,\n): boolean => {\n const isUnitValid = (\n unit: 'hours' | 'minutes' | 'seconds',\n value: number,\n options?: TimeUnitOptions,\n ): boolean => {\n if (!options) return true;\n\n const allowed = getTimeNumbers(unit, options);\n if (allowed.length === 0) return true;\n\n return allowed.includes(value);\n };\n\n if (!timeOptions) return true;\n const isHoursValid = isUnitValid('hours', date.getHours(), timeOptions.hours);\n const isMinutesValid = isUnitValid(\n 'minutes',\n date.getMinutes(),\n timeOptions.minutes,\n );\n const isSecondsValid = isUnitValid(\n 'seconds',\n date.getSeconds(),\n timeOptions.seconds,\n );\n\n return isHoursValid && isMinutesValid && isSecondsValid;\n};\n"],"mappings":"0IAAA,OAASA,MAAT,CAAiBC,OAAjB,CAA0BC,KAA1B,KAAuC,UAAvC,CACA,OAASC,WAAT,CAAsBC,SAAtB,KAAuC,OAAvC,CACA,OAASC,KAAT,KAAgC,aAAhC,CAEA,OAASC,OAAT,qBAEA,OAASC,aAAT,iCAIA,OAASC,cAAT,2BAGA,MAAO,IAAMC,+BAA8B,CAAG,GAAvC,CACP,MAAO,IAAMC,6BAA4B,yCAAlC,CAEP,MAAO,IAAMC,6BAA4B,WAAlC,CAEP,MAAO,IAAMC,iCAAgC,WAAMF,4BAAN,wBAAtC,CAEP,MAAO,IAAMG,6BAA4B,OAAlC,CAEP,MAAO,IAAMC,8BAA6B,wBAAnC,CAEP,MAAO,IAAMC,oBAAmB,CAAG,SAACC,CAAD,CAAqC,eAEpEA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AFgC,CAGhChG,CAAW,CAACW,OAHoB,CArBtB,CA2BZ,MAAOgF,EAAY,EAAIE,CAAhB,EAAkCE,CAC1C,CA/BM"}
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["format","isValid","parse","useCallback","useEffect","IMask","getForm","useMutableRef","getTimeNumbers","datePickerPropSeparatorDefault","datePickerPropFormatTypeDate","datePickerPropFormatTypeTime","datePickerPropFormatTypeDateTime","datePickerPropFormatTypeYear","datePickerPropFormatTypeMonth","normalizeRangeValue","dateRange","getTime","getTimeOptionsByFormat","timeOptions","timePart","includes","split","formatArray","mapTimeOptions","HH","hours","mm","minutes","ss","seconds","map","marker","hoursOptions","minutesOptions","secondsOptions","adaptFormat","adaptedFormat","shouldRemoveTimePart","timeOption","Array","isArray","length","step","timeMarkers","replace","RegExp","trim","filter","part","join","placeholderByFormat","getMaskBlocks","includeDate","includeTime","blocks","dd","mask","MaskedRange","from","to","MM","yyyy","getFormForStart","form","getFormForEnd","getPartDate","stringArray","index","indexOf","getParts","separator","withTime","date","time","getPartsDate","value","markers","isTypeWithTime","type","fieldPrefixs","getFieldName","name","rangeIndex","getDropdownZIndex","style","zIndex","useStringValue","formatProp","onChangeRef","imaskProps","stringValue","refs","setValue","setStringValue","current","ref","maskRef","updateValue","handleClear","e","valueArray","validArray","item","Date","isValidTimeByTimeOptions","isUnitValid","unit","options","allowed","isHoursValid","getHours","isMinutesValid","getMinutes","isSecondsValid","getSeconds"],"sources":["../../../../../src/components/DatePicker/helpers.ts"],"sourcesContent":["import { format, isValid, parse } from 'date-fns';\nimport { useCallback, useEffect } from 'react';\nimport { IMask, useIMask } from 'react-imask';\n\nimport { getForm } from '##/components/FieldGroup';\nimport { TextFieldPropForm } from '##/components/TextField';\nimport { useMutableRef } from '##/hooks/useMutableRef';\nimport { DateRange } from '##/utils/types/Date';\n\nimport { TimeOptions, TimeUnitOptions } from '../DateTime';\nimport { getTimeNumbers } from '../DateTime/helpers';\nimport { DatePickerPropType } from './types';\n\nexport const datePickerPropSeparatorDefault = '.';\nexport const datePickerPropFormatTypeDate = `dd${datePickerPropSeparatorDefault}MM${datePickerPropSeparatorDefault}yyyy`;\n\nexport const datePickerPropFormatTypeTime = `HH:mm:ss`;\n\nexport const datePickerPropFormatTypeDateTime = `${datePickerPropFormatTypeDate} ${datePickerPropFormatTypeTime}`;\n\nexport const datePickerPropFormatTypeYear = `yyyy`;\n\nexport const datePickerPropFormatTypeMonth = `MM${datePickerPropSeparatorDefault}yyyy`;\n\nexport const normalizeRangeValue = (dateRange: DateRange): DateRange => {\n if (\n dateRange[0] &&\n dateRange[1] &&\n dateRange[0]?.getTime() > dateRange[1]?.getTime()\n ) {\n return [dateRange[1], dateRange[0]];\n }\n return dateRange;\n};\n\nexport const getTimeOptionsByFormat = (\n format: string,\n timeOptions?: TimeOptions,\n) => {\n const markers = ['HH', 'mm', 'ss'] as const;\n const timePart = format.includes(' ') ? format.split(' ')[1] : format;\n const formatArray = timePart?.split(':');\n const mapTimeOptions = {\n HH: timeOptions?.hours,\n mm: timeOptions?.minutes,\n ss: timeOptions?.seconds,\n } as const;\n\n const [hoursOptions, minutesOptions, secondsOptions] = markers.map(\n (marker) => (formatArray?.includes(marker) ? mapTimeOptions[marker] : []),\n ) as [\n TimeUnitOptions | undefined,\n TimeUnitOptions | undefined,\n TimeUnitOptions | undefined,\n ];\n\n const effectiveTimeOptions = {\n hours: hoursOptions,\n minutes: minutesOptions,\n seconds: secondsOptions,\n };\n\n return effectiveTimeOptions;\n};\n\nexport const adaptFormat = (\n format: string,\n timeOptions?: TimeOptions,\n): string => {\n const formatArray = format.split(' ');\n let adaptedFormat = formatArray[1] ?? format;\n\n const shouldRemoveTimePart = (\n timeOption: TimeUnitOptions | undefined,\n ): boolean => {\n if (timeOption && Array.isArray(timeOption) && timeOption.length === 0)\n return true;\n if (timeOption && !Array.isArray(timeOption) && timeOption.step === 0)\n return true;\n\n return false;\n };\n\n const timeMarkers = [\n { marker: 'HH', timeOption: timeOptions?.hours },\n { marker: 'mm', timeOption: timeOptions?.minutes },\n { marker: 'ss', timeOption: timeOptions?.seconds },\n ];\n\n for (const { marker, timeOption } of timeMarkers) {\n if (shouldRemoveTimePart(timeOption)) {\n adaptedFormat = adaptedFormat.replace(new RegExp(`:?${marker}`, 'g'), '');\n }\n }\n\n adaptedFormat = adaptedFormat\n .replace(/:+$/, '')\n .replace(/^:+/, '')\n .replace(/:+/g, ':')\n .replace(/\\s+/g, ' ')\n .trim();\n\n if (formatArray.length > 1) {\n formatArray[1] = adaptedFormat;\n return formatArray.filter((part) => part.length > 0).join(' ');\n }\n return adaptedFormat;\n};\n\nexport const placeholderByFormat = (format: string): string => {\n return format\n .replace(/yyyy/g, 'ГГГГ')\n .replace(/MM/g, 'ММ')\n .replace(/dd/g, 'ДД')\n .replace(/HH/g, 'ЧЧ')\n .replace(/mm/g, 'ММ')\n .replace(/ss/g, 'СС');\n};\n\ntype MaskBlock = {\n mask: typeof IMask.MaskedRange;\n from: number;\n to: number;\n};\n\ntype MaskBlocks = Partial<{\n dd: MaskBlock;\n MM: MaskBlock;\n yyyy: MaskBlock;\n HH: MaskBlock;\n mm: MaskBlock;\n ss: MaskBlock;\n}>;\n\nexport const getMaskBlocks = ({\n includeDate = true,\n includeTime = true,\n} = {}): MaskBlocks => {\n const blocks: MaskBlocks = {};\n\n if (includeDate) {\n blocks.dd = { mask: IMask.MaskedRange, from: 1, to: 31 };\n blocks.MM = { mask: IMask.MaskedRange, from: 1, to: 12 };\n blocks.yyyy = { mask: IMask.MaskedRange, from: 1, to: 9999 };\n }\n\n if (includeTime) {\n blocks.HH = { mask: IMask.MaskedRange, from: 0, to: 23 };\n blocks.mm = { mask: IMask.MaskedRange, from: 0, to: 59 };\n blocks.ss = { mask: IMask.MaskedRange, from: 0, to: 59 };\n }\n\n return blocks;\n};\n\nexport const getFormForStart = (form: TextFieldPropForm) => getForm(form, 0, 2);\nexport const getFormForEnd = (form: TextFieldPropForm) => getForm(form, 1, 2);\n\nexport const getPartDate = (\n formatArray: string[],\n stringArray: string[],\n marker: string,\n) => {\n const index = formatArray.indexOf(marker);\n\n if (\n index >= 0 &&\n stringArray[index] &&\n stringArray[index].length === marker.length\n ) {\n return stringArray[index];\n }\n\n return undefined;\n};\n\nexport const getParts = (\n format: string,\n separator: string,\n withTime?: boolean,\n) => {\n if (withTime) {\n const [date, time] = format.split(' ');\n\n return [\n ...(date ? date.split(separator) : []),\n ...(time ? time.split(':') : []),\n ];\n }\n\n return format.split(separator);\n};\n\nexport const getPartsDate = (\n value: string,\n format: string,\n separator: string,\n withTime: boolean,\n markers: string[],\n) => {\n const formatArray = getParts(format, separator, withTime);\n const stringArray = getParts(value, separator, withTime);\n\n return markers.map((marker) => getPartDate(formatArray, stringArray, marker));\n};\n\nexport const isTypeWithTime = (type: DatePickerPropType) =>\n type.indexOf('time') !== -1;\n\nconst fieldPrefixs = ['start', 'end'] as const;\n\nexport const getFieldName = (\n name: [string?, string?] | string | undefined,\n rangeIndex: 0 | 1,\n) => {\n if (!name) {\n return undefined;\n }\n\n if (Array.isArray(name)) {\n return name[rangeIndex];\n }\n\n return `${name}_${fieldPrefixs[rangeIndex]}`;\n};\n\nexport const getDropdownZIndex = (style?: React.CSSProperties) =>\n typeof style?.zIndex === 'number' ? style.zIndex + 1 : undefined;\n\ntype DatePickerFieldTypeDatePropOnChange = (\n value: Date | null,\n props: {\n e: Event;\n },\n) => void;\n\nexport const useStringValue = (\n value: Date | undefined | null,\n formatProp: string,\n separator: string,\n onChangeRef: React.MutableRefObject<\n DatePickerFieldTypeDatePropOnChange | undefined\n >,\n imaskProps: ReturnType<typeof useIMask<HTMLInputElement>>,\n) => {\n const stringValue = imaskProps.value;\n\n const refs = useMutableRef([imaskProps.setValue, value] as const);\n\n const setStringValue = useCallback((value: string) => {\n refs.current[0](value);\n if (imaskProps.ref?.current) {\n imaskProps.ref.current.value = value;\n }\n if (imaskProps.maskRef.current) {\n imaskProps.maskRef.current.updateValue();\n }\n }, []);\n\n const handleClear: React.MouseEventHandler<HTMLButtonElement> = useCallback(\n (e) => {\n setStringValue('');\n\n if (refs.current[1]) {\n onChangeRef.current?.(null, { e: e as unknown as Event });\n }\n },\n [],\n );\n\n useEffect(() => {\n if (value && isValid(value)) {\n setStringValue(format(value, formatProp));\n }\n\n if (!value && stringValue) {\n const formatArray = getParts(formatProp, separator, false);\n const valueArray = getParts(stringValue, separator, false);\n const validArray = formatArray\n .map((marker) => getPartDate(formatArray, valueArray, marker))\n .filter((item) => Boolean(item));\n\n const date =\n formatArray.length === validArray.length\n ? parse(\n valueArray.join(datePickerPropSeparatorDefault),\n formatArray.join(datePickerPropSeparatorDefault),\n new Date(),\n )\n : undefined;\n\n if (isValid(date)) {\n setStringValue('');\n }\n }\n }, [value?.getTime()]);\n\n return handleClear;\n};\n\nexport const isValidTimeByTimeOptions = (\n date: Date,\n timeOptions?: TimeOptions,\n): boolean => {\n const isUnitValid = (\n unit: 'hours' | 'minutes' | 'seconds',\n value: number,\n options?: TimeUnitOptions,\n ): boolean => {\n if (!options) return true;\n\n const allowed = getTimeNumbers(unit, options);\n if (allowed.length === 0) return true;\n\n return allowed.includes(value);\n };\n\n if (!timeOptions) return true;\n const isHoursValid = isUnitValid('hours', date.getHours(), timeOptions.hours);\n const isMinutesValid = isUnitValid(\n 'minutes',\n date.getMinutes(),\n timeOptions.minutes,\n );\n const isSecondsValid = isUnitValid(\n 'seconds',\n date.getSeconds(),\n timeOptions.seconds,\n );\n\n return isHoursValid && isMinutesValid && isSecondsValid;\n};\n"],"mappings":"0IAAA,OAASA,MAAT,CAAiBC,OAAjB,CAA0BC,KAA1B,KAAuC,UAAvC,CACA,OAASC,WAAT,CAAsBC,SAAtB,KAAuC,OAAvC,CACA,OAASC,KAAT,KAAgC,aAAhC,CAEA,OAASC,OAAT,qBAEA,OAASC,aAAT,iCAIA,OAASC,cAAT,2BAGA,MAAO,IAAMC,+BAA8B,CAAG,GAAvC,CACP,MAAO,IAAMC,6BAA4B,yCAAlC,CAEP,MAA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CAACO,KAAvC,CAfpB,CAgBNsF,CAAc,CAAGN,CAAW,CAChC,SADgC,CAEhCjC,CAAI,CAACwC,UAAL,EAFgC,CAGhC9F,CAAW,CAACS,OAHoB,CAhBtB,CAqBNsF,CAAc,CAAGR,CAAW,CAChC,SADgC,CAEhCjC,CAAI,CAAC0C,UAAL,EAFgC,CAGhChG,CAAW,CAACW,OAHoB,CArBtB,CA2BZ,MAAOgF,EAAY,EAAIE,CAAhB,EAAkCE,CAC1C,CA/BM"}
|
|
@@ -5,7 +5,7 @@ import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAt
|
|
|
5
5
|
import { DateTimePropDisableDates, DateTimePropView, TimeOptions } from '../DateTime/helpers';
|
|
6
6
|
import { TextFieldPropForm, TextFieldPropSize, TextFieldPropStatus, TextFieldPropView } from '../TextField/TextField';
|
|
7
7
|
export declare const datePickerPropType: readonly ["date", "date-range", "date-time", "date-time-range", "time", "year", "year-range", "month", "month-range"];
|
|
8
|
-
export type DatePickerPropType = typeof datePickerPropType[number];
|
|
8
|
+
export type DatePickerPropType = (typeof datePickerPropType)[number];
|
|
9
9
|
export declare const datePickerPropTypeDefault: "date";
|
|
10
10
|
export type DatePickerPropDateTimeView = DateTimePropView;
|
|
11
11
|
export declare const datePickerPropDateTimeViewDefault: "classic";
|
|
@@ -18,7 +18,7 @@ export type DatePickerPropOnChange<TYPE extends DatePickerPropType> = (value: Da
|
|
|
18
18
|
e: React.MouseEvent<HTMLButtonElement, MouseEvent> | Event;
|
|
19
19
|
}) => void;
|
|
20
20
|
export declare const datePickerPropDropdownForm: readonly ["default", "brick", "round"];
|
|
21
|
-
export type DatePickerPropDropdownForm = typeof datePickerPropDropdownForm[number];
|
|
21
|
+
export type DatePickerPropDropdownForm = (typeof datePickerPropDropdownForm)[number];
|
|
22
22
|
export declare const datePickerPropDropdownFormDefault: "default";
|
|
23
23
|
type DatePickerPropInputRef<TYPE> = TYPE extends Range ? [React.Ref<HTMLInputElement>?, React.Ref<HTMLInputElement>?] : React.Ref<HTMLInputElement>;
|
|
24
24
|
type DatePickerPropSide<TYPE> = TYPE extends Range ? [(string | IconComponent)?, (string | IconComponent)?] | string | IconComponent : string | IconComponent;
|
|
@@ -101,7 +101,7 @@ export type DatePickerProps<TYPE extends DatePickerPropType = 'date'> = PropsWit
|
|
|
101
101
|
export type DatePickerComponent = <TYPE extends DatePickerPropType = 'date'>(props: DatePickerProps<TYPE>) => React.ReactNode | null;
|
|
102
102
|
export type DatePickerTypeComponent<TYPE extends DatePickerPropType> = (props: Omit<DatePickerProps<TYPE>, 'type'>) => React.ReactNode | null;
|
|
103
103
|
export type DatePickerPropOnError = (props: {
|
|
104
|
-
type: typeof datePickerErrorTypes[0];
|
|
104
|
+
type: (typeof datePickerErrorTypes)[0];
|
|
105
105
|
stringValue: string;
|
|
106
106
|
dd?: string;
|
|
107
107
|
MM?: string;
|
|
@@ -111,7 +111,7 @@ export type DatePickerPropOnError = (props: {
|
|
|
111
111
|
HH?: string;
|
|
112
112
|
date: Date;
|
|
113
113
|
} | {
|
|
114
|
-
type: typeof datePickerErrorTypes[1];
|
|
114
|
+
type: (typeof datePickerErrorTypes)[1];
|
|
115
115
|
stringValue: string;
|
|
116
116
|
dd?: string;
|
|
117
117
|
MM?: string;
|
|
@@ -120,10 +120,10 @@ export type DatePickerPropOnError = (props: {
|
|
|
120
120
|
mm?: string;
|
|
121
121
|
HH?: string;
|
|
122
122
|
} | {
|
|
123
|
-
type: typeof datePickerErrorTypes[2];
|
|
123
|
+
type: (typeof datePickerErrorTypes)[2];
|
|
124
124
|
date: [Date, Date];
|
|
125
125
|
} | {
|
|
126
|
-
type: typeof datePickerErrorTypes[3];
|
|
126
|
+
type: (typeof datePickerErrorTypes)[3];
|
|
127
127
|
stringValue: string;
|
|
128
128
|
date: Date;
|
|
129
129
|
HH?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["dateTimePropViewDefault","datePickerPropType","datePickerPropTypeDefault","datePickerPropDateTimeViewDefault","datePickerErrorTypes","datePickerPropDropdownForm","datePickerPropDropdownFormDefault"],"sources":["../../../../../src/components/DatePicker/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport { Locale } from 'date-fns';\n\nimport { DateRange } from '../../utils/types/Date';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport {\n DateTimePropDisableDates,\n DateTimePropView,\n dateTimePropViewDefault,\n TimeOptions,\n} from '../DateTime/helpers';\nimport {\n TextFieldPropForm,\n TextFieldPropSize,\n TextFieldPropStatus,\n TextFieldPropView,\n} from '../TextField/TextField';\n\nexport const datePickerPropType = [\n 'date',\n 'date-range',\n 'date-time',\n 'date-time-range',\n 'time',\n 'year',\n 'year-range',\n 'month',\n 'month-range',\n] as const;\n\nexport type DatePickerPropType = typeof datePickerPropType[number];\nexport const datePickerPropTypeDefault = datePickerPropType[0];\n\nexport type DatePickerPropDateTimeView = DateTimePropView;\nexport const datePickerPropDateTimeViewDefault = dateTimePropViewDefault;\n\ntype Range = 'date-range' | 'date-time-range' | 'year-range' | 'month-range';\ntype Time = 'time' | 'date-time' | 'date-time-range';\n\nexport const datePickerErrorTypes = [\n 'outOfRange',\n 'invalidInputAttempt',\n 'startDateIsGreaterThanEndDate',\n 'invalidTimeByTimeOptions',\n] as const;\n\nexport type DatePickerPropValue<TYPE extends DatePickerPropType> =\n | (TYPE extends Range ? DateRange : Date)\n | null;\n\nexport type DatePickerPropPlaceholder<TYPE> = TYPE extends Range\n ? [string?, string?] | string\n : string;\n\nexport type DatePickerPropOnChange<TYPE extends DatePickerPropType> = (\n value: DatePickerPropValue<TYPE>,\n props: {\n e: React.MouseEvent<HTMLButtonElement, MouseEvent> | Event;\n },\n) => void;\n\nexport const datePickerPropDropdownForm = [\n 'default',\n 'brick',\n 'round',\n] as const;\nexport type DatePickerPropDropdownForm =\n typeof datePickerPropDropdownForm[number];\nexport const datePickerPropDropdownFormDefault = datePickerPropDropdownForm[0];\n\ntype DatePickerPropInputRef<TYPE> = TYPE extends Range\n ? [React.Ref<HTMLInputElement>?, React.Ref<HTMLInputElement>?]\n : React.Ref<HTMLInputElement>;\n\ntype DatePickerPropSide<TYPE> = TYPE extends Range\n ?\n | [(string | IconComponent)?, (string | IconComponent)?]\n | string\n | IconComponent\n : string | IconComponent;\n\ntype DatePickerPropOnFocus<TYPE> = TYPE extends Range\n ?\n | [\n React.FocusEventHandler<HTMLElement>?,\n React.FocusEventHandler<HTMLElement>?,\n ]\n | React.FocusEventHandler<HTMLElement>\n : React.FocusEventHandler<HTMLElement>;\n\ntype DatePickerPropName<TYPE> = TYPE extends Range\n ? [string?, string?] | string\n : string;\n\nexport type DatePickerAdditionalControlRenderFn = (props: {\n currentVisibleDate?: Date;\n}) => React.ReactNode | React.ReactNode[];\n\nexport type DatePickerAdditionalControlRenderProp =\n | React.ReactNode\n | DatePickerAdditionalControlRenderFn;\n\nexport type DatePickerProps<TYPE extends DatePickerPropType = 'date'> =\n PropsWithHTMLAttributesAndRef<\n {\n type?: TYPE;\n value?: DatePickerPropValue<TYPE>;\n onChange?: DatePickerPropOnChange<TYPE>;\n minDate?: Date;\n maxDate?: Date;\n renderAdditionalControls?: DatePickerAdditionalControlRenderProp;\n events?: Date[];\n dateTimeView?: DatePickerPropDateTimeView;\n locale?: Locale;\n children?: never;\n onError?: DatePickerPropOnError;\n id?: string;\n name?: DatePickerPropName<TYPE>;\n disabled?: boolean;\n disableDates?: DateTimePropDisableDates;\n dropdownClassName?: string;\n dropdownRef?: React.Ref<HTMLDivElement>;\n size?: TextFieldPropSize;\n view?: TextFieldPropView;\n form?: TextFieldPropForm;\n status?: TextFieldPropStatus;\n onFocus?: DatePickerPropOnFocus<TYPE>;\n onBlur?: DatePickerPropOnFocus<TYPE>;\n autoFocus?: boolean;\n placeholder?: DatePickerPropPlaceholder<TYPE>;\n readOnly?: boolean;\n required?: boolean;\n tabIndex?: number;\n inputRef?: DatePickerPropInputRef<TYPE>;\n ariaLabel?: string;\n iconSize?: IconPropSize;\n format?: string;\n separator?: string;\n dropdownForm?: DatePickerPropDropdownForm;\n leftSide?: DatePickerPropSide<TYPE>;\n rightSide?: DatePickerPropSide<TYPE>;\n label?: string;\n labelIcon?: IconComponent;\n caption?: string;\n labelPosition?: 'top' | 'left';\n onChangeCurrentVisibleDate?: (date: Date) => void;\n currentVisibleDate?: Date;\n timeOptions?: TYPE extends Time ? TimeOptions : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity*, оставив только работу с timeOptions.\n */\n multiplicitySeconds?: TYPE extends Time ? number : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity*, оставив только работу с timeOptions.\n */\n multiplicityMinutes?: TYPE extends Time ? number : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity*, оставив только работу с timeOptions.\n */\n multiplicityHours?: TYPE extends Time ? number : never;\n isMobile?: number;\n withClearButton?: boolean;\n onDropdownOpen?: (isOpen: boolean) => void;\n dropdownOpen?: boolean;\n ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;\n dropdownViewportRef?: React.RefObject<HTMLElement>;\n dropdownContainer?: Element;\n },\n HTMLDivElement\n >;\n\nexport type DatePickerComponent = <TYPE extends DatePickerPropType = 'date'>(\n props: DatePickerProps<TYPE>,\n) => React.ReactNode | null;\n\nexport type DatePickerTypeComponent<TYPE extends DatePickerPropType> = (\n props: Omit<DatePickerProps<TYPE>, 'type'>,\n) => React.ReactNode | null;\n\nexport type DatePickerPropOnError = (\n props:\n | {\n type: typeof datePickerErrorTypes[0];\n stringValue: string;\n dd?: string;\n MM?: string;\n yyyy?: string;\n ss?: string;\n mm?: string;\n HH?: string;\n date: Date;\n }\n | {\n type: typeof datePickerErrorTypes[1];\n stringValue: string;\n dd?: string;\n MM?: string;\n yyyy?: string;\n ss?: string;\n mm?: string;\n HH?: string;\n }\n | {\n type: typeof datePickerErrorTypes[2];\n date: [Date, Date];\n }\n | {\n type: typeof datePickerErrorTypes[3];\n stringValue: string;\n date: Date;\n HH?: string;\n mm?: string;\n ss?: string;\n },\n) => void;\n"],"mappings":"AAKA,OAGEA,uBAHF,2BAaA,MAAO,IAAMC,mBAAkB,CAAG,CAChC,MADgC,CAEhC,YAFgC,CAGhC,WAHgC,CAIhC,iBAJgC,CAKhC,MALgC,CAMhC,MANgC,CAOhC,YAPgC,CAQhC,OARgC,CAShC,aATgC,CAA3B,CAaP,MAAO,IAAMC,0BAAyB,CAAGD,kBAAkB,CAAC,CAAD,CAApD,CAGP,MAAO,IAAME,kCAAiC,CAAGH,uBAA1C,CAKP,MAAO,IAAMI,qBAAoB,CAAG,CAClC,YADkC,CAElC,qBAFkC,CAGlC,+BAHkC,CAIlC,0BAJkC,CAA7B,CAsBP,MAAO,IAAMC,2BAA0B,CAAG,CACxC,SADwC,CAExC,OAFwC,CAGxC,OAHwC,CAAnC,CAOP,MAAO,IAAMC,kCAAiC,CAAGD,0BAA0B,CAAC,CAAD,CAApE"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["dateTimePropViewDefault","datePickerPropType","datePickerPropTypeDefault","datePickerPropDateTimeViewDefault","datePickerErrorTypes","datePickerPropDropdownForm","datePickerPropDropdownFormDefault"],"sources":["../../../../../src/components/DatePicker/types.ts"],"sourcesContent":["import { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport { Locale } from 'date-fns';\n\nimport { DateRange } from '../../utils/types/Date';\nimport { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport {\n DateTimePropDisableDates,\n DateTimePropView,\n dateTimePropViewDefault,\n TimeOptions,\n} from '../DateTime/helpers';\nimport {\n TextFieldPropForm,\n TextFieldPropSize,\n TextFieldPropStatus,\n TextFieldPropView,\n} from '../TextField/TextField';\n\nexport const datePickerPropType = [\n 'date',\n 'date-range',\n 'date-time',\n 'date-time-range',\n 'time',\n 'year',\n 'year-range',\n 'month',\n 'month-range',\n] as const;\n\nexport type DatePickerPropType = (typeof datePickerPropType)[number];\nexport const datePickerPropTypeDefault = datePickerPropType[0];\n\nexport type DatePickerPropDateTimeView = DateTimePropView;\nexport const datePickerPropDateTimeViewDefault = dateTimePropViewDefault;\n\ntype Range = 'date-range' | 'date-time-range' | 'year-range' | 'month-range';\ntype Time = 'time' | 'date-time' | 'date-time-range';\n\nexport const datePickerErrorTypes = [\n 'outOfRange',\n 'invalidInputAttempt',\n 'startDateIsGreaterThanEndDate',\n 'invalidTimeByTimeOptions',\n] as const;\n\nexport type DatePickerPropValue<TYPE extends DatePickerPropType> =\n | (TYPE extends Range ? DateRange : Date)\n | null;\n\nexport type DatePickerPropPlaceholder<TYPE> = TYPE extends Range\n ? [string?, string?] | string\n : string;\n\nexport type DatePickerPropOnChange<TYPE extends DatePickerPropType> = (\n value: DatePickerPropValue<TYPE>,\n props: {\n e: React.MouseEvent<HTMLButtonElement, MouseEvent> | Event;\n },\n) => void;\n\nexport const datePickerPropDropdownForm = [\n 'default',\n 'brick',\n 'round',\n] as const;\nexport type DatePickerPropDropdownForm =\n (typeof datePickerPropDropdownForm)[number];\nexport const datePickerPropDropdownFormDefault = datePickerPropDropdownForm[0];\n\ntype DatePickerPropInputRef<TYPE> = TYPE extends Range\n ? [React.Ref<HTMLInputElement>?, React.Ref<HTMLInputElement>?]\n : React.Ref<HTMLInputElement>;\n\ntype DatePickerPropSide<TYPE> = TYPE extends Range\n ?\n | [(string | IconComponent)?, (string | IconComponent)?]\n | string\n | IconComponent\n : string | IconComponent;\n\ntype DatePickerPropOnFocus<TYPE> = TYPE extends Range\n ?\n | [\n React.FocusEventHandler<HTMLElement>?,\n React.FocusEventHandler<HTMLElement>?,\n ]\n | React.FocusEventHandler<HTMLElement>\n : React.FocusEventHandler<HTMLElement>;\n\ntype DatePickerPropName<TYPE> = TYPE extends Range\n ? [string?, string?] | string\n : string;\n\nexport type DatePickerAdditionalControlRenderFn = (props: {\n currentVisibleDate?: Date;\n}) => React.ReactNode | React.ReactNode[];\n\nexport type DatePickerAdditionalControlRenderProp =\n | React.ReactNode\n | DatePickerAdditionalControlRenderFn;\n\nexport type DatePickerProps<TYPE extends DatePickerPropType = 'date'> =\n PropsWithHTMLAttributesAndRef<\n {\n type?: TYPE;\n value?: DatePickerPropValue<TYPE>;\n onChange?: DatePickerPropOnChange<TYPE>;\n minDate?: Date;\n maxDate?: Date;\n renderAdditionalControls?: DatePickerAdditionalControlRenderProp;\n events?: Date[];\n dateTimeView?: DatePickerPropDateTimeView;\n locale?: Locale;\n children?: never;\n onError?: DatePickerPropOnError;\n id?: string;\n name?: DatePickerPropName<TYPE>;\n disabled?: boolean;\n disableDates?: DateTimePropDisableDates;\n dropdownClassName?: string;\n dropdownRef?: React.Ref<HTMLDivElement>;\n size?: TextFieldPropSize;\n view?: TextFieldPropView;\n form?: TextFieldPropForm;\n status?: TextFieldPropStatus;\n onFocus?: DatePickerPropOnFocus<TYPE>;\n onBlur?: DatePickerPropOnFocus<TYPE>;\n autoFocus?: boolean;\n placeholder?: DatePickerPropPlaceholder<TYPE>;\n readOnly?: boolean;\n required?: boolean;\n tabIndex?: number;\n inputRef?: DatePickerPropInputRef<TYPE>;\n ariaLabel?: string;\n iconSize?: IconPropSize;\n format?: string;\n separator?: string;\n dropdownForm?: DatePickerPropDropdownForm;\n leftSide?: DatePickerPropSide<TYPE>;\n rightSide?: DatePickerPropSide<TYPE>;\n label?: string;\n labelIcon?: IconComponent;\n caption?: string;\n labelPosition?: 'top' | 'left';\n onChangeCurrentVisibleDate?: (date: Date) => void;\n currentVisibleDate?: Date;\n timeOptions?: TYPE extends Time ? TimeOptions : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity*, оставив только работу с timeOptions.\n */\n multiplicitySeconds?: TYPE extends Time ? number : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity*, оставив только работу с timeOptions.\n */\n multiplicityMinutes?: TYPE extends Time ? number : never;\n /**\n * @deprecated Use timeOptions instead.\n * TODO: major - удалить при мажорном релизе все свойства multiplicity*, оставив только работу с timeOptions.\n */\n multiplicityHours?: TYPE extends Time ? number : never;\n isMobile?: number;\n withClearButton?: boolean;\n onDropdownOpen?: (isOpen: boolean) => void;\n dropdownOpen?: boolean;\n ignoreOutsideClicksRefs?: ReadonlyArray<React.RefObject<HTMLElement>>;\n dropdownViewportRef?: React.RefObject<HTMLElement>;\n dropdownContainer?: Element;\n },\n HTMLDivElement\n >;\n\nexport type DatePickerComponent = <TYPE extends DatePickerPropType = 'date'>(\n props: DatePickerProps<TYPE>,\n) => React.ReactNode | null;\n\nexport type DatePickerTypeComponent<TYPE extends DatePickerPropType> = (\n props: Omit<DatePickerProps<TYPE>, 'type'>,\n) => React.ReactNode | null;\n\nexport type DatePickerPropOnError = (\n props:\n | {\n type: (typeof datePickerErrorTypes)[0];\n stringValue: string;\n dd?: string;\n MM?: string;\n yyyy?: string;\n ss?: string;\n mm?: string;\n HH?: string;\n date: Date;\n }\n | {\n type: (typeof datePickerErrorTypes)[1];\n stringValue: string;\n dd?: string;\n MM?: string;\n yyyy?: string;\n ss?: string;\n mm?: string;\n HH?: string;\n }\n | {\n type: (typeof datePickerErrorTypes)[2];\n date: [Date, Date];\n }\n | {\n type: (typeof datePickerErrorTypes)[3];\n stringValue: string;\n date: Date;\n HH?: string;\n mm?: string;\n ss?: string;\n },\n) => void;\n"],"mappings":"AAKA,OAGEA,uBAHF,2BAaA,MAAO,IAAMC,mBAAkB,CAAG,CAChC,MADgC,CAEhC,YAFgC,CAGhC,WAHgC,CAIhC,iBAJgC,CAKhC,MALgC,CAMhC,MANgC,CAOhC,YAPgC,CAQhC,OARgC,CAShC,aATgC,CAA3B,CAaP,MAAO,IAAMC,0BAAyB,CAAGD,kBAAkB,CAAC,CAAD,CAApD,CAGP,MAAO,IAAME,kCAAiC,CAAGH,uBAA1C,CAKP,MAAO,IAAMI,qBAAoB,CAAG,CAClC,YADkC,CAElC,qBAFkC,CAGlC,+BAHkC,CAIlC,0BAJkC,CAA7B,CAsBP,MAAO,IAAMC,2BAA0B,CAAG,CACxC,SADwC,CAExC,OAFwC,CAGxC,OAHwC,CAAnC,CAOP,MAAO,IAAMC,kCAAiC,CAAGD,0BAA0B,CAAC,CAAD,CAApE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["currentVisibleDate","className","onChange","value","locale"];import"./DateTime100YearSlider.css";import{addYears,format,getDecade}from"date-fns";import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["currentVisibleDate","className","onChange","value","locale"];import"./DateTime100YearSlider.css";import{addYears,format,getDecade}from"date-fns";import{ru}from"date-fns/locale";import React from"react";import{range}from"../../../utils/array";import{cn}from"../../../utils/bem";import{endOfCentury,getCentury,startOfCentury}from"../../../utils/date";import{DateTimeSlider}from"../DateTimeSlider/DateTimeSlider";import{getSliderValueRange}from"../helpers/getSliderValueRange";export var cnDateTime100YearSlider=cn("DateTime100YearSlider");var isCurrentVisibleCentury=function(a,b){return getCentury(a)===getCentury(b)},isCurrentVisibleDecade=function(a,b){return isCurrentVisibleCentury(a,b)&&getDecade(a)===getDecade(b)},getCenturyItems=function(a,b,c){return range(10).map(function(d){var e=addYears(b,10*d);return{date:e,label:format(e,"yyyy",{locale:c}),current:isCurrentVisibleDecade(a,e)}})},getSliderData=function(a,b,c){var d=startOfCentury(a);return[addYears(d,-100),d,addYears(d,100),addYears(d,200)].map(function(d){return{label:"".concat(format(d,"yyyy",{locale:c}),"-").concat(format(addYears(d,100),"yyyy",{locale:c})),date:d,items:getCenturyItems(a,d,c),current:isCurrentVisibleCentury(a,d),valueRange:getSliderValueRange(d,b,startOfCentury,endOfCentury)}})};export var DateTime100YearSlider=function(a){var b=a.currentVisibleDate,c=a.className,d=a.onChange,e=a.value,f=a.locale,g=void 0===f?ru:f,h=_objectWithoutProperties(a,_excluded),i=getSliderData(b,e,g);return React.createElement(DateTimeSlider,Object.assign({className:cnDateTime100YearSlider(null,[c]),onNext:function handleNext(){return d(addYears(b,100))},onPrev:function handlePrev(){return d(addYears(b,-100))},data:i,onChange:d},h))};
|
|
2
2
|
//# sourceMappingURL=DateTime100YearSlider.js.map
|
package/__internal__/src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime100YearSlider.js","names":["addYears","format","getDecade","
|
|
1
|
+
{"version":3,"file":"DateTime100YearSlider.js","names":["addYears","format","getDecade","ru","React","range","cn","endOfCentury","getCentury","startOfCentury","DateTimeSlider","getSliderValueRange","cnDateTime100YearSlider","isCurrentVisibleCentury","currentDate","century","isCurrentVisibleDecade","decade","getCenturyItems","currentVisibleDate","locale","map","year","yearDate","date","label","current","getSliderData","value","currentCentury","items","valueRange","DateTime100YearSlider","props","className","onChange","otherProps","data","handleNext","handlePrev"],"sources":["../../../../../../src/components/DateTime/DateTime100YearSlider/DateTime100YearSlider.tsx"],"sourcesContent":["import './DateTime100YearSlider.css';\n\nimport { addYears, format, getDecade, Locale } from 'date-fns';\nimport { ru } from 'date-fns/locale';\nimport React from 'react';\n\nimport { range } from '../../../utils/array';\nimport { cn } from '../../../utils/bem';\nimport { endOfCentury, getCentury, startOfCentury } from '../../../utils/date';\nimport { DateRange } from '../../../utils/types/Date';\nimport { PropsWithHTMLAttributes } from '../../../utils/types/PropsWithHTMLAttributes';\nimport { DateTimeSlider } from '../DateTimeSlider/DateTimeSlider';\nimport { getSliderValueRange } from '../helpers/getSliderValueRange';\n\nexport type DateTime100YearSliderProps = PropsWithHTMLAttributes<\n {\n currentVisibleDate: Date;\n onChange: (date: Date) => void;\n children?: never;\n value?: Date | DateRange;\n locale?: Locale;\n },\n HTMLDivElement\n>;\n\nexport const cnDateTime100YearSlider = cn('DateTime100YearSlider');\n\nconst isCurrentVisibleCentury = (currentDate: Date, century: Date) =>\n getCentury(currentDate) === getCentury(century);\n\nconst isCurrentVisibleDecade = (currentDate: Date, decade: Date) =>\n isCurrentVisibleCentury(currentDate, decade) &&\n getDecade(currentDate) === getDecade(decade);\n\nconst getCenturyItems = (\n currentVisibleDate: Date,\n decade: Date,\n locale: Locale,\n) =>\n range(10).map((year) => {\n const yearDate = addYears(decade, year * 10);\n\n return {\n date: yearDate,\n label: format(yearDate, 'yyyy', { locale }),\n current: isCurrentVisibleDecade(currentVisibleDate, yearDate),\n };\n });\n\nconst getSliderData = (\n currentVisibleDate: Date,\n value: Date | DateRange | undefined,\n locale: Locale,\n) => {\n const currentCentury = startOfCentury(currentVisibleDate);\n\n return [\n addYears(currentCentury, -100),\n currentCentury,\n addYears(currentCentury, 100),\n addYears(currentCentury, 200),\n ].map((date) => ({\n label: `${format(date, 'yyyy', { locale })}-${format(\n addYears(date, 100),\n 'yyyy',\n { locale },\n )}`,\n date,\n items: getCenturyItems(currentVisibleDate, date, locale),\n current: isCurrentVisibleCentury(currentVisibleDate, date),\n valueRange: getSliderValueRange(date, value, startOfCentury, endOfCentury),\n }));\n};\n\nexport const DateTime100YearSlider: React.FC<DateTime100YearSliderProps> = (\n props,\n) => {\n const {\n currentVisibleDate,\n className,\n onChange,\n value,\n locale = ru,\n ...otherProps\n } = props;\n\n const handlePrev = () => onChange(addYears(currentVisibleDate, -100));\n const handleNext = () => onChange(addYears(currentVisibleDate, 100));\n\n const data = getSliderData(currentVisibleDate, value, locale);\n\n return (\n <DateTimeSlider\n className={cnDateTime100YearSlider(null, [className])}\n onNext={handleNext}\n onPrev={handlePrev}\n data={data}\n onChange={onChange}\n {...otherProps}\n />\n );\n};\n"],"mappings":"kKAAA,oCAEA,OAASA,QAAT,CAAmBC,MAAnB,CAA2BC,SAA3B,KAAoD,UAApD,CACA,OAASC,EAAT,KAAmB,iBAAnB,CACA,MAA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E,QAAQ,CAAEF,CALZ,EAMMC,CANN,EASH,CA3BM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["currentVisibleDate","className","onChange","value","locale"];import"./DateTime10YearSlider.css";import{addYears,endOfDecade,format,getDecade,getYear,startOfDecade}from"date-fns";import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["currentVisibleDate","className","onChange","value","locale"];import"./DateTime10YearSlider.css";import{addYears,endOfDecade,format,getDecade,getYear,startOfDecade}from"date-fns";import{ru}from"date-fns/locale";import React from"react";import{range}from"../../../utils/array";import{cn}from"../../../utils/bem";import{DateTimeSlider}from"../DateTimeSlider/DateTimeSlider";import{getSliderValueRange}from"../helpers/getSliderValueRange";export var cnDateTime10YearSlider=cn("DateTime10YearSlider");var isCurrentVisibleDecade=function(a,b){return getDecade(a)===getDecade(b)},isCurrentVisibleYear=function(a,b){return isCurrentVisibleDecade(a,b)&&getYear(a)===getYear(b)},getDecadeItems=function(a,b,c){return range(10).map(function(d){var e=addYears(b,d);return{date:e,label:format(e,"yyyy",{locale:c}),current:isCurrentVisibleYear(a,e)}})},getSliderData=function(a,b,c){var d=startOfDecade(a);return[addYears(d,-10),d,addYears(d,10),addYears(d,20)].map(function(d){return{label:"".concat(format(d,"yyyy",{locale:c}),"-").concat(format(addYears(d,10),"yyyy",{locale:c})),date:d,items:getDecadeItems(a,d,c),current:isCurrentVisibleDecade(a,d),valueRange:getSliderValueRange(d,b,startOfDecade,endOfDecade)}})};export var DateTime10YearSlider=function(a){var b=a.currentVisibleDate,c=a.className,d=a.onChange,e=a.value,f=a.locale,g=void 0===f?ru:f,h=_objectWithoutProperties(a,_excluded),i=getSliderData(b,e,g);return React.createElement(DateTimeSlider,Object.assign({className:cnDateTime10YearSlider(null,[c]),onNext:function handleNext(){return d(addYears(b,10))},onPrev:function handlePrev(){return d(addYears(b,-10))},data:i,onChange:d},h))};
|
|
2
2
|
//# sourceMappingURL=DateTime10YearSlider.js.map
|
package/__internal__/src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime10YearSlider.js","names":["addYears","endOfDecade","format","getDecade","getYear","startOfDecade","
|
|
1
|
+
{"version":3,"file":"DateTime10YearSlider.js","names":["addYears","endOfDecade","format","getDecade","getYear","startOfDecade","ru","React","range","cn","DateTimeSlider","getSliderValueRange","cnDateTime10YearSlider","isCurrentVisibleDecade","currentDate","decade","isCurrentVisibleYear","year","getDecadeItems","currentVisibleDate","locale","map","yearDate","date","label","current","getSliderData","value","currentDecade","items","valueRange","DateTime10YearSlider","props","className","onChange","otherProps","data","handleNext","handlePrev"],"sources":["../../../../../../src/components/DateTime/DateTime10YearSlider/DateTime10YearSlider.tsx"],"sourcesContent":["import './DateTime10YearSlider.css';\n\nimport {\n addYears,\n endOfDecade,\n format,\n getDecade,\n getYear,\n Locale,\n startOfDecade,\n} from 'date-fns';\nimport { ru } from 'date-fns/locale';\nimport React from 'react';\n\nimport { range } from '../../../utils/array';\nimport { cn } from '../../../utils/bem';\nimport { DateRange } from '../../../utils/types/Date';\nimport { PropsWithHTMLAttributes } from '../../../utils/types/PropsWithHTMLAttributes';\nimport { DateTimeSlider } from '../DateTimeSlider/DateTimeSlider';\nimport { getSliderValueRange } from '../helpers/getSliderValueRange';\n\nexport type DateTime10YearSliderProps = PropsWithHTMLAttributes<\n {\n currentVisibleDate: Date;\n onChange: (date: Date) => void;\n children?: never;\n value?: Date | DateRange;\n locale?: Locale;\n },\n HTMLDivElement\n>;\n\nexport const cnDateTime10YearSlider = cn('DateTime10YearSlider');\n\nconst isCurrentVisibleDecade = (currentDate: Date, decade: Date) =>\n getDecade(currentDate) === getDecade(decade);\n\nconst isCurrentVisibleYear = (currentDate: Date, year: Date) =>\n isCurrentVisibleDecade(currentDate, year) &&\n getYear(currentDate) === getYear(year);\n\nconst getDecadeItems = (\n currentVisibleDate: Date,\n decade: Date,\n locale: Locale,\n) =>\n range(10).map((year) => {\n const yearDate = addYears(decade, year);\n\n return {\n date: yearDate,\n label: format(yearDate, 'yyyy', { locale }),\n current: isCurrentVisibleYear(currentVisibleDate, yearDate),\n };\n });\n\nconst getSliderData = (\n currentVisibleDate: Date,\n value: Date | DateRange | undefined,\n locale: Locale,\n) => {\n const currentDecade = startOfDecade(currentVisibleDate);\n\n return [\n addYears(currentDecade, -10),\n currentDecade,\n addYears(currentDecade, 10),\n addYears(currentDecade, 20),\n ].map((date) => ({\n label: `${format(date, 'yyyy', { locale })}-${format(\n addYears(date, 10),\n 'yyyy',\n { locale },\n )}`,\n date,\n items: getDecadeItems(currentVisibleDate, date, locale),\n current: isCurrentVisibleDecade(currentVisibleDate, date),\n valueRange: getSliderValueRange(date, value, startOfDecade, endOfDecade),\n }));\n};\n\nexport const DateTime10YearSlider: React.FC<DateTime10YearSliderProps> = (\n props,\n) => {\n const {\n currentVisibleDate,\n className,\n onChange,\n value,\n locale = ru,\n ...otherProps\n } = props;\n\n const handlePrev = () => onChange(addYears(currentVisibleDate, -10));\n const handleNext = () => onChange(addYears(currentVisibleDate, 10));\n\n const data = getSliderData(currentVisibleDate, value, locale);\n\n return (\n <DateTimeSlider\n className={cnDateTime10YearSlider(null, [className])}\n onNext={handleNext}\n onPrev={handlePrev}\n data={data}\n onChange={onChange}\n {...otherProps}\n />\n );\n};\n"],"mappings":"kKAAA,mCAEA,OACEA,QADF,CAEEC,WAFF,CAGEC,MAHF,CAIEC,SAJF,CAKEC,OALF,CAOEC,aAPF,KAQO,UARP,CASA,OAASC,EAAT,KAAmB,iBAAnB,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,KAAT,4BACA,OAASC,EAAT,0BAGA,OAASC,cAAT,wCACA,OAASC,mBAAT,sCAaA,MAAO,IAAMC,uBAAsB,CAAGH,EAAE,CAAC,sBAAD,CAAjC,C,GAEDI,uBAAs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D,CAA/C,CADU,CAMfG,IAAI,CAAJA,CANe,CAOfM,KAAK,CAAEX,cAAc,CAACC,CAAD,CAAqBI,CAArB,CAA2BH,CAA3B,CAPN,CAQfK,OAAO,CAAEZ,sBAAsB,CAACM,CAAD,CAAqBI,CAArB,CARhB,CASfO,UAAU,CAAEnB,mBAAmB,CAACY,CAAD,CAAOI,CAAP,CAActB,aAAd,CAA6BJ,WAA7B,CAThB,CAAX,CALC,CAgBR,C,CAED,MAAO,IAAM8B,qBAAyD,CAAG,SACvEC,CADuE,CAEpE,IAEDb,EAFC,CAQCa,CARD,CAEDb,kBAFC,CAGDc,CAHC,CAQCD,CARD,CAGDC,SAHC,CAIDC,CAJC,CAQCF,CARD,CAIDE,QAJC,CAKDP,CALC,CAQCK,CARD,CAKDL,KALC,GAQCK,CARD,CAMDZ,MANC,CAMDA,CANC,YAMQd,EANR,GAOE6B,CAPF,0BAQCH,CARD,YAaGI,CAAI,CAAGV,aAAa,CAACP,CAAD,CAAqBQ,CAArB,CAA4BP,CAA5B,CAbvB,CAeH,MACE,qBAAC,cAAD,gBACE,SAAS,CAAER,sBAAsB,CAAC,IAAD,CAAO,CAACqB,CAAD,CAAP,CADnC,CAEE,MAAM,CAPS,QAAbI,WAAa,SAAMH,EAAQ,CAAClC,QAAQ,CAACmB,CAAD,CAAqB,EAArB,CAAT,CAAd,CAKjB,CAGE,MAAM,CATS,QAAbmB,WAAa,SAAMJ,EAAQ,CAAClC,QAAQ,CAACmB,CAAD,CAAqB,CAAC,EAAtB,CAAT,CAAd,CAMjB,CAIE,IAAI,CAAEiB,CAJR,CAKE,QAAQ,CAAEF,CALZ,EAMMC,CANN,EASH,CA3BM"}
|
|
@@ -2,7 +2,7 @@ import './DateTimeCell.css';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PropsWithJsxAttributes } from '../../../utils/types/PropsWithJsxAttributes';
|
|
4
4
|
export declare const DateTimeCellPropRange: readonly ["first", "last", true, false];
|
|
5
|
-
export type DateTimeCellPropRange = typeof DateTimeCellPropRange[number];
|
|
5
|
+
export type DateTimeCellPropRange = (typeof DateTimeCellPropRange)[number];
|
|
6
6
|
export type DateTimeCellProps = PropsWithJsxAttributes<{
|
|
7
7
|
range?: DateTimeCellPropRange;
|
|
8
8
|
}, 'div'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeCell.js","names":["React","cn","DateTimeCellPropRange","cnDateTimeCell","DateTimeCell","forwardRef","props","ref","range","children","className","otherProps"],"sources":["../../../../../../src/components/DateTime/DateTimeCell/DateTimeCell.tsx"],"sourcesContent":["import './DateTimeCell.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { PropsWithJsxAttributes } from '../../../utils/types/PropsWithJsxAttributes';\n\nexport const DateTimeCellPropRange = ['first', 'last', true, false] as const;\nexport type DateTimeCellPropRange = typeof DateTimeCellPropRange[number];\n\nexport type DateTimeCellProps = PropsWithJsxAttributes<\n {\n range?: DateTimeCellPropRange;\n },\n 'div'\n>;\n\nexport const cnDateTimeCell = cn('DateTimeCell');\n\nexport const DateTimeCell = React.forwardRef<HTMLDivElement, DateTimeCellProps>(\n (props, ref) => {\n const { range, children, className, ...otherProps } = props;\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnDateTimeCell({ range }, [className])}\n >\n {children}\n </div>\n );\n },\n);\n"],"mappings":"oIAAA,2BAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BAGA,MAAO,IAAMC,sBAAqB,CAAG,CAAC,OAAD,CAAU,MAAV,OAA9B,CAUP,MAAO,IAAMC,eAAc,CAAGF,EAAE,CAAC,cAAD,CAAzB,CAEP,MAAO,IAAMG,aAAY,CAAGJ,KAAK,CAACK,UAAN,CAC1B,SAACC,CAAD,CAAQC,CAAR,CAAgB,CACd,GAAQC,EAAR,CAAsDF,CAAtD,CAAQE,KAAR,CAAeC,CAAf,CAAsDH,CAAtD,CAAeG,QAAf,CAAyBC,CAAzB,CAAsDJ,CAAtD,CAAyBI,SAAzB,CAAuCC,CAAvC,0BAAsDL,CAAtD,YAEA,MACE,4CACMK,CADN,EAEE,GAAG,CAAEJ,CAFP,CAGE,SAAS,CAAEJ,cAAc,CAAC,CAAEK,KAAK,CAALA,CAAF,CAAD,CAAY,CAACE,CAAD,CAAZ,CAH3B,GAKGD,CALH,CAQH,CAbyB,CAArB"}
|
|
1
|
+
{"version":3,"file":"DateTimeCell.js","names":["React","cn","DateTimeCellPropRange","cnDateTimeCell","DateTimeCell","forwardRef","props","ref","range","children","className","otherProps"],"sources":["../../../../../../src/components/DateTime/DateTimeCell/DateTimeCell.tsx"],"sourcesContent":["import './DateTimeCell.css';\n\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { PropsWithJsxAttributes } from '../../../utils/types/PropsWithJsxAttributes';\n\nexport const DateTimeCellPropRange = ['first', 'last', true, false] as const;\nexport type DateTimeCellPropRange = (typeof DateTimeCellPropRange)[number];\n\nexport type DateTimeCellProps = PropsWithJsxAttributes<\n {\n range?: DateTimeCellPropRange;\n },\n 'div'\n>;\n\nexport const cnDateTimeCell = cn('DateTimeCell');\n\nexport const DateTimeCell = React.forwardRef<HTMLDivElement, DateTimeCellProps>(\n (props, ref) => {\n const { range, children, className, ...otherProps } = props;\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnDateTimeCell({ range }, [className])}\n >\n {children}\n </div>\n );\n },\n);\n"],"mappings":"oIAAA,2BAEA,MAAOA,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BAGA,MAAO,IAAMC,sBAAqB,CAAG,CAAC,OAAD,CAAU,MAAV,OAA9B,CAUP,MAAO,IAAMC,eAAc,CAAGF,EAAE,CAAC,cAAD,CAAzB,CAEP,MAAO,IAAMG,aAAY,CAAGJ,KAAK,CAACK,UAAN,CAC1B,SAACC,CAAD,CAAQC,CAAR,CAAgB,CACd,GAAQC,EAAR,CAAsDF,CAAtD,CAAQE,KAAR,CAAeC,CAAf,CAAsDH,CAAtD,CAAeG,QAAf,CAAyBC,CAAzB,CAAsDJ,CAAtD,CAAyBI,SAAzB,CAAuCC,CAAvC,0BAAsDL,CAAtD,YAEA,MACE,4CACMK,CADN,EAEE,GAAG,CAAEJ,CAFP,CAGE,SAAS,CAAEJ,cAAc,CAAC,CAAEK,KAAK,CAALA,CAAF,CAAD,CAAY,CAACE,CAAD,CAAZ,CAH3B,GAKGD,CALH,CAQH,CAbyB,CAArB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.DateTimeGrid{
|
|
1
|
+
.DateTimeGrid{display:grid;grid-template-columns:repeat(var(--date-time-grid-columns),var(--date-time-cell-width));justify-content:start;row-gap:var(--date-time-grid-row-gap)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","minDate","maxDate","value","disableDates","onChange","onChangeRange","currentVisibleDate","events","locale","view","onMove","onChangeCurrentVisibleDate"];import{addMonths,startOfMonth}from"date-fns";import
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","minDate","maxDate","value","disableDates","onChange","onChangeRange","currentVisibleDate","events","locale","view","onMove","onChangeCurrentVisibleDate"];import{addMonths,startOfMonth}from"date-fns";import{ru}from"date-fns/locale";import React,{forwardRef,useEffect}from"react";import{useFlag}from"../../../hooks/useFlag/useFlag";import{DateTimeLabel}from"../DateTimeLabel/DateTimeLabel";import{DateTimeMonth}from"../DateTimeMonth/DateTimeMonth";import{DateTimeToggler}from"../DateTimeToggler/DateTimeToggler";import{DateTimeTypeMonth}from"../DateTimeTypeMonth/DateTimeTypeMonth";import{DateTimeYearSlider}from"../DateTimeYearSlider/DateTimeYearSlider";import{getDaysOfMonth,getDaysOfWeek,getHandleSelectDate,getMouthLabelWithYear,isEqualDay,moveTypes,useCurrentVisibleDate}from"../helpers";import{dateTimePropView,dateTimePropViewDefault}from"../helpers/types";import{cnDateTimeMixLayout}from"../mixs";export var DateTimeTypeDate=forwardRef(function(a,b){var c=a.className,d=a.minDate,e=a.maxDate,f=a.value,g=a.disableDates,h=a.onChange,i=a.onChangeRange,j=a.currentVisibleDate,k=a.events,l=a.locale,m=void 0===l?ru:l,n=a.view,o=void 0===n?dateTimePropViewDefault:n,p=a.onMove,q=a.onChangeCurrentVisibleDate,r=_objectWithoutProperties(a,_excluded),s=useFlag(),t=_slicedToArray(s,2),u=t[0],v=t[1];useEffect(function(){u||(null===p||void 0===p?void 0:p(moveTypes[2]))},[u]);var w=useCurrentVisibleDate({currentVisibleDate:j,maxDate:e,minDate:d,value:f,startOfUnit:startOfMonth,onChangeCurrentVisibleDate:q}),x=_slicedToArray(w,2),y=x[0],z=x[1];if(u)return React.createElement(DateTimeTypeMonth,Object.assign({},r,{ref:b,className:c,minDate:d,maxDate:e,locale:m,events:k,currentVisibleDate:y,view:o,onChange:function(a){z(a),v.off()},onMove:p}));var A=getHandleSelectDate({minDate:d,maxDate:e,value:f,onChange:h,onChangeRange:i,isEqualUnit:isEqualDay}),B=getDaysOfMonth({date:y,disableDates:g,handleDayClick:A,value:f,events:k,minDate:d,maxDate:e,locale:m}),C=getMouthLabelWithYear(y,m),D=getDaysOfWeek(m),E=function(){return z(addMonths(y,1))},F=function(){return z(addMonths(y,-1))};if(o===dateTimePropView[0])return React.createElement("div",Object.assign({},r,{ref:b,className:cnDateTimeMixLayout({view:o},[c])}),React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),prevOnClick:F,nextOnClick:E,label:C,onLabelClick:v.on}),React.createElement(DateTimeMonth,{daysOfWeek:D,daysOfMonth:B}));var G=addMonths(y,1),H=getDaysOfMonth({date:G,disableDates:g,handleDayClick:A,value:f,events:k,minDate:d,maxDate:e,locale:m}),I=getMouthLabelWithYear(G,m);return o===dateTimePropView[1]?React.createElement("div",Object.assign({},r,{ref:b,className:cnDateTimeMixLayout({view:o},[c])}),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),prevOnClick:F,label:C,onLabelClick:v.on}),React.createElement(DateTimeMonth,{daysOfWeek:D,daysOfMonth:B})),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),nextOnClick:E,label:I,onLabelClick:v.on}),React.createElement(DateTimeMonth,{daysOfWeek:D,daysOfMonth:H}))):React.createElement("div",Object.assign({},r,{ref:b,className:cnDateTimeMixLayout({view:o},[c])}),React.createElement(DateTimeYearSlider,{className:cnDateTimeMixLayout("Slider"),currentVisibleDate:y,onChange:z,value:f,locale:m}),React.createElement("div",{className:cnDateTimeMixLayout("PageWrapper")},React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeLabel,{className:cnDateTimeMixLayout("Label"),label:C,onClick:v.on,cursor:"pointer"}),React.createElement(DateTimeMonth,{daysOfWeek:D,daysOfMonth:B})),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeLabel,{className:cnDateTimeMixLayout("Label"),label:I,onClick:v.on,cursor:"pointer"}),React.createElement(DateTimeMonth,{daysOfWeek:D,daysOfMonth:H}))))});
|
|
2
2
|
//# sourceMappingURL=DateTimeTypeDate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeTypeDate.js","names":["addMonths","startOfMonth","ruLocale","React","forwardRef","useEffect","useFlag","DateTimeLabel","DateTimeMonth","DateTimeToggler","DateTimeTypeMonth","DateTimeYearSlider","getDaysOfMonth","getDaysOfWeek","getHandleSelectDate","getMouthLabelWithYear","isEqualDay","moveTypes","useCurrentVisibleDate","dateTimePropView","dateTimePropViewDefault","cnDateTimeMixLayout","DateTimeTypeDate","props","ref","className","minDate","maxDate","value","disableDates","onChange","onChangeRange","currentVisibleDateProp","currentVisibleDate","events","locale","view","onMove","onChangeCurrentVisibleDate","otherProps","changeMonth","setChangeMonth","startOfUnit","setCurrentVisibleDate","off","handleSelectDate","isEqualUnit","pageOneDaysOfMonth","date","handleDayClick","pageOneLabel","daysOfWeek","nextMonthHandle","prevMonthHandle","on","pageTwoCurrentVisibleDate","pageTwoDaysOfMonth","pageTwoLabel"],"sources":["../../../../../../src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.tsx"],"sourcesContent":["import { addMonths, startOfMonth } from 'date-fns';\nimport ruLocale from 'date-fns/locale/ru';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport { useFlag } from '../../../hooks/useFlag/useFlag';\nimport { DateTimeLabel } from '../DateTimeLabel/DateTimeLabel';\nimport { DateTimeMonth } from '../DateTimeMonth/DateTimeMonth';\nimport { DateTimeToggler } from '../DateTimeToggler/DateTimeToggler';\nimport { DateTimeTypeMonth } from '../DateTimeTypeMonth/DateTimeTypeMonth';\nimport { DateTimeYearSlider } from '../DateTimeYearSlider/DateTimeYearSlider';\nimport {\n DateTimeTypeComponent,\n getDaysOfMonth,\n getDaysOfWeek,\n getHandleSelectDate,\n getMouthLabelWithYear,\n isEqualDay,\n moveTypes,\n useCurrentVisibleDate,\n} from '../helpers';\nimport { dateTimePropView, dateTimePropViewDefault } from '../helpers/types';\nimport { cnDateTimeMixLayout } from '../mixs';\n\nexport const DateTimeTypeDate: DateTimeTypeComponent<'date'> = forwardRef(\n (props, ref) => {\n const {\n className,\n minDate,\n maxDate,\n value,\n disableDates,\n onChange,\n onChangeRange,\n currentVisibleDate: currentVisibleDateProp,\n events,\n locale = ruLocale,\n view = dateTimePropViewDefault,\n onMove,\n onChangeCurrentVisibleDate,\n ...otherProps\n } = props;\n\n const [changeMonth, setChangeMonth] = useFlag();\n\n useEffect(() => {\n !changeMonth && onMove?.(moveTypes[2]);\n }, [changeMonth]);\n\n const [currentVisibleDate, setCurrentVisibleDate] = useCurrentVisibleDate({\n currentVisibleDate: currentVisibleDateProp,\n maxDate,\n minDate,\n value,\n startOfUnit: startOfMonth,\n onChangeCurrentVisibleDate,\n });\n\n if (changeMonth) {\n return (\n <DateTimeTypeMonth\n {...otherProps}\n ref={ref}\n className={className}\n minDate={minDate}\n maxDate={maxDate}\n locale={locale}\n events={events}\n currentVisibleDate={currentVisibleDate}\n view={view}\n onChange={(value) => {\n setCurrentVisibleDate(value);\n setChangeMonth.off();\n }}\n onMove={onMove}\n />\n );\n }\n\n const handleSelectDate = getHandleSelectDate({\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n isEqualUnit: isEqualDay,\n });\n\n const pageOneDaysOfMonth = getDaysOfMonth({\n date: currentVisibleDate,\n disableDates,\n handleDayClick: handleSelectDate,\n value,\n events,\n minDate,\n maxDate,\n locale,\n });\n\n const pageOneLabel = getMouthLabelWithYear(currentVisibleDate, locale);\n\n const daysOfWeek = getDaysOfWeek(locale);\n\n const nextMonthHandle = () =>\n setCurrentVisibleDate(addMonths(currentVisibleDate, 1));\n const prevMonthHandle = () =>\n setCurrentVisibleDate(addMonths(currentVisibleDate, -1));\n\n if (view === dateTimePropView[0]) {\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnDateTimeMixLayout({ view }, [className])}\n >\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={prevMonthHandle}\n nextOnClick={nextMonthHandle}\n label={pageOneLabel}\n onLabelClick={setChangeMonth.on}\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageOneDaysOfMonth}\n />\n </div>\n );\n }\n\n const pageTwoCurrentVisibleDate = addMonths(currentVisibleDate, 1);\n\n const pageTwoDaysOfMonth = getDaysOfMonth({\n date: pageTwoCurrentVisibleDate,\n disableDates,\n handleDayClick: handleSelectDate,\n value,\n events,\n minDate,\n maxDate,\n locale,\n });\n\n const pageTwoLabel = getMouthLabelWithYear(\n pageTwoCurrentVisibleDate,\n locale,\n );\n\n if (view === dateTimePropView[1]) {\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnDateTimeMixLayout({ view }, [className])}\n >\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={prevMonthHandle}\n label={pageOneLabel}\n onLabelClick={setChangeMonth.on}\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageOneDaysOfMonth}\n />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n nextOnClick={nextMonthHandle}\n label={pageTwoLabel}\n onLabelClick={setChangeMonth.on}\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageTwoDaysOfMonth}\n />\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnDateTimeMixLayout({ view }, [className])}\n >\n <DateTimeYearSlider\n className={cnDateTimeMixLayout('Slider')}\n currentVisibleDate={currentVisibleDate}\n onChange={setCurrentVisibleDate}\n value={value}\n locale={locale}\n />\n <div className={cnDateTimeMixLayout('PageWrapper')}>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageOneLabel}\n onClick={setChangeMonth.on}\n cursor=\"pointer\"\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageOneDaysOfMonth}\n />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageTwoLabel}\n onClick={setChangeMonth.on}\n cursor=\"pointer\"\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageTwoDaysOfMonth}\n />\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":"4UAAA,OAASA,SAAT,CAAoBC,YAApB,KAAwC,UAAxC,CACA,MAAOC,SAAP,KAAqB,oBAArB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,KAA6C,OAA7C,CAEA,OAAS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,UAAU,CAAEH,CADd,CAEE,WAAW,CAAEJ,CAFf,EAPF,CADF,CAaE,2BAAK,SAAS,CAAE1B,mBAAmB,CAAC,MAAD,CAAnC,EACE,oBAAC,aAAD,EACE,SAAS,CAAEA,mBAAmB,CAAC,OAAD,CADhC,CAEE,KAAK,CAAEoC,CAFT,CAGE,OAAO,CAAEhB,CAAc,CAACa,EAH1B,CAIE,MAAM,CAAC,SAJT,EADF,CAOE,oBAAC,aAAD,EACE,UAAU,CAAEH,CADd,CAEE,WAAW,CAAEK,CAFf,EAPF,CAbF,CAZF,CAwCH,CAxMsE,CAAlE"}
|
|
1
|
+
{"version":3,"file":"DateTimeTypeDate.js","names":["addMonths","startOfMonth","ru","React","forwardRef","useEffect","useFlag","DateTimeLabel","DateTimeMonth","DateTimeToggler","DateTimeTypeMonth","DateTimeYearSlider","getDaysOfMonth","getDaysOfWeek","getHandleSelectDate","getMouthLabelWithYear","isEqualDay","moveTypes","useCurrentVisibleDate","dateTimePropView","dateTimePropViewDefault","cnDateTimeMixLayout","DateTimeTypeDate","props","ref","className","minDate","maxDate","value","disableDates","onChange","onChangeRange","currentVisibleDateProp","currentVisibleDate","events","locale","view","onMove","onChangeCurrentVisibleDate","otherProps","changeMonth","setChangeMonth","startOfUnit","setCurrentVisibleDate","off","handleSelectDate","isEqualUnit","pageOneDaysOfMonth","date","handleDayClick","pageOneLabel","daysOfWeek","nextMonthHandle","prevMonthHandle","on","pageTwoCurrentVisibleDate","pageTwoDaysOfMonth","pageTwoLabel"],"sources":["../../../../../../src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.tsx"],"sourcesContent":["import { addMonths, startOfMonth } from 'date-fns';\nimport { ru } from 'date-fns/locale';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport { useFlag } from '../../../hooks/useFlag/useFlag';\nimport { DateTimeLabel } from '../DateTimeLabel/DateTimeLabel';\nimport { DateTimeMonth } from '../DateTimeMonth/DateTimeMonth';\nimport { DateTimeToggler } from '../DateTimeToggler/DateTimeToggler';\nimport { DateTimeTypeMonth } from '../DateTimeTypeMonth/DateTimeTypeMonth';\nimport { DateTimeYearSlider } from '../DateTimeYearSlider/DateTimeYearSlider';\nimport {\n DateTimeTypeComponent,\n getDaysOfMonth,\n getDaysOfWeek,\n getHandleSelectDate,\n getMouthLabelWithYear,\n isEqualDay,\n moveTypes,\n useCurrentVisibleDate,\n} from '../helpers';\nimport { dateTimePropView, dateTimePropViewDefault } from '../helpers/types';\nimport { cnDateTimeMixLayout } from '../mixs';\n\nexport const DateTimeTypeDate: DateTimeTypeComponent<'date'> = forwardRef(\n (props, ref) => {\n const {\n className,\n minDate,\n maxDate,\n value,\n disableDates,\n onChange,\n onChangeRange,\n currentVisibleDate: currentVisibleDateProp,\n events,\n locale = ru,\n view = dateTimePropViewDefault,\n onMove,\n onChangeCurrentVisibleDate,\n ...otherProps\n } = props;\n\n const [changeMonth, setChangeMonth] = useFlag();\n\n useEffect(() => {\n !changeMonth && onMove?.(moveTypes[2]);\n }, [changeMonth]);\n\n const [currentVisibleDate, setCurrentVisibleDate] = useCurrentVisibleDate({\n currentVisibleDate: currentVisibleDateProp,\n maxDate,\n minDate,\n value,\n startOfUnit: startOfMonth,\n onChangeCurrentVisibleDate,\n });\n\n if (changeMonth) {\n return (\n <DateTimeTypeMonth\n {...otherProps}\n ref={ref}\n className={className}\n minDate={minDate}\n maxDate={maxDate}\n locale={locale}\n events={events}\n currentVisibleDate={currentVisibleDate}\n view={view}\n onChange={(value) => {\n setCurrentVisibleDate(value);\n setChangeMonth.off();\n }}\n onMove={onMove}\n />\n );\n }\n\n const handleSelectDate = getHandleSelectDate({\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n isEqualUnit: isEqualDay,\n });\n\n const pageOneDaysOfMonth = getDaysOfMonth({\n date: currentVisibleDate,\n disableDates,\n handleDayClick: handleSelectDate,\n value,\n events,\n minDate,\n maxDate,\n locale,\n });\n\n const pageOneLabel = getMouthLabelWithYear(currentVisibleDate, locale);\n\n const daysOfWeek = getDaysOfWeek(locale);\n\n const nextMonthHandle = () =>\n setCurrentVisibleDate(addMonths(currentVisibleDate, 1));\n const prevMonthHandle = () =>\n setCurrentVisibleDate(addMonths(currentVisibleDate, -1));\n\n if (view === dateTimePropView[0]) {\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnDateTimeMixLayout({ view }, [className])}\n >\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={prevMonthHandle}\n nextOnClick={nextMonthHandle}\n label={pageOneLabel}\n onLabelClick={setChangeMonth.on}\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageOneDaysOfMonth}\n />\n </div>\n );\n }\n\n const pageTwoCurrentVisibleDate = addMonths(currentVisibleDate, 1);\n\n const pageTwoDaysOfMonth = getDaysOfMonth({\n date: pageTwoCurrentVisibleDate,\n disableDates,\n handleDayClick: handleSelectDate,\n value,\n events,\n minDate,\n maxDate,\n locale,\n });\n\n const pageTwoLabel = getMouthLabelWithYear(\n pageTwoCurrentVisibleDate,\n locale,\n );\n\n if (view === dateTimePropView[1]) {\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnDateTimeMixLayout({ view }, [className])}\n >\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={prevMonthHandle}\n label={pageOneLabel}\n onLabelClick={setChangeMonth.on}\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageOneDaysOfMonth}\n />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n nextOnClick={nextMonthHandle}\n label={pageTwoLabel}\n onLabelClick={setChangeMonth.on}\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageTwoDaysOfMonth}\n />\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnDateTimeMixLayout({ view }, [className])}\n >\n <DateTimeYearSlider\n className={cnDateTimeMixLayout('Slider')}\n currentVisibleDate={currentVisibleDate}\n onChange={setCurrentVisibleDate}\n value={value}\n locale={locale}\n />\n <div className={cnDateTimeMixLayout('PageWrapper')}>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageOneLabel}\n onClick={setChangeMonth.on}\n cursor=\"pointer\"\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageOneDaysOfMonth}\n />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageTwoLabel}\n onClick={setChangeMonth.on}\n cursor=\"pointer\"\n />\n <DateTimeMonth\n daysOfWeek={daysOfWeek}\n daysOfMonth={pageTwoDaysOfMonth}\n />\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":"4UAAA,OAASA,SAAT,CAAoBC,YAApB,KAAwC,UAAxC,CACA,OAASC,EAAT,KAAmB,iBAAnB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,KAA6C,OAA7C,CAEA,OAASC,OAAT,sCACA,OAASC,aAAT,sCACA,OAASC,aAAT,sCACA,OAASC,eAAT,0CACA,OAASC,iBAAT,8CACA,OAASC,kBAAT,gDACA,OAEEC,cAFF,CAGEC,aAHF,CAIEC,mBAJF,CAKEC,qBALF,CAMEC,UANF,CAOEC,SAPF,CAQEC,qBARF,kBAUA,OAASC,gBAAT,CAA2BC,uBAA3B,wBACA,OAASC,mBAAT,eAEA,MAAO,IAAMC,iBAA+C,CAAGlB,UAAU,CACvE,SAACmB,CAAD,CAAQC,CAAR,CAAgB,IAEZC,EAFY,CAgBVF,CAhBU,CAEZE,SAFY,CAGZC,CAHY,CAgBVH,CAhBU,CAGZG,OAHY,CAIZC,CAJY,CAgBVJ,CAhBU,CAIZI,OAJY,CAKZC,CALY,CAgBVL,CAhBU,CAKZK,KALY,C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AEhB,CAAc,CAACa,EAJ/B,EADF,CAOE,oBAAC,aAAD,EACE,UAAU,CAAEH,CADd,CAEE,WAAW,CAAEK,CAFf,EAPF,CAjBF,CA7HU,CA+JZ,2CACMjB,CADN,EAEE,GAAG,CAAEf,CAFP,CAGE,SAAS,CAAEH,mBAAmB,CAAC,CAAEe,IAAI,CAAJA,CAAF,CAAD,CAAW,CAACX,CAAD,CAAX,CAHhC,GAKE,oBAAC,kBAAD,EACE,SAAS,CAAEJ,mBAAmB,CAAC,QAAD,CADhC,CAEE,kBAAkB,CAAEY,CAFtB,CAGE,QAAQ,CAAEU,CAHZ,CAIE,KAAK,CAAEf,CAJT,CAKE,MAAM,CAAEO,CALV,EALF,CAYE,2BAAK,SAAS,CAAEd,mBAAmB,CAAC,aAAD,CAAnC,EACE,2BAAK,SAAS,CAAEA,mBAAmB,CAAC,MAAD,CAAnC,EACE,oBAAC,aAAD,EACE,SAAS,CAAEA,mBAAmB,CAAC,OAAD,CADhC,CAEE,KAAK,CAAE6B,CAFT,CAGE,OAAO,CAAET,CAAc,CAACa,EAH1B,CAIE,MAAM,CAAC,SAJT,EADF,CAOE,oBAAC,aAAD,EACE,UAAU,CAAEH,CADd,CAEE,WAAW,CAAEJ,CAFf,EAPF,CADF,CAaE,2BAAK,SAAS,CAAE1B,mBAAmB,CAAC,MAAD,CAAnC,EACE,oBAAC,aAAD,EACE,SAAS,CAAEA,mBAAmB,CAAC,OAAD,CADhC,CAEE,KAAK,CAAEoC,CAFT,CAGE,OAAO,CAAEhB,CAAc,CAACa,EAH1B,CAIE,MAAM,CAAC,SAJT,EADF,CAOE,oBAAC,aAAD,EACE,UAAU,CAAEH,CADd,CAEE,WAAW,CAAEK,CAFf,EAPF,CAbF,CAZF,CAwCH,CAxMsE,CAAlE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate"];import{addYears,startOfYear}from"date-fns";import
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate"];import{addYears,startOfYear}from"date-fns";import{ru}from"date-fns/locale";import React,{forwardRef,useEffect}from"react";import{useFlag}from"../../../hooks/useFlag/useFlag";import{DateTime10Years}from"../DateTime10Years/DateTime10Years";import{DateTime10YearSlider}from"../DateTime10YearSlider/DateTime10YearSlider";import{DateTimeLabel}from"../DateTimeLabel/DateTimeLabel";import{DateTimeToggler}from"../DateTimeToggler/DateTimeToggler";import{DateTimeTypeYear}from"../DateTimeTypeYear/DateTimeTypeYear";import{DateTimeYear}from"../DateTimeYear/DateTimeYear";import{getHandleSelectDate,getMonthsOfYear,getYearTitle,isEqualMount,moveTypes,useCurrentVisibleDate}from"../helpers";import{dateTimePropView,dateTimePropViewDefault}from"../helpers/types";import{cnDateTimeMixLayout}from"../mixs";export var DateTimeTypeMonth=forwardRef(function(a,b){var c=a.minDate,d=a.maxDate,e=a.value,f=a.onChange,g=a.onChangeRange,h=a.disableDates,i=a.currentVisibleDate,j=a.events,k=a.locale,l=void 0===k?ru:k,m=a.className,n=a.view,o=void 0===n?dateTimePropViewDefault:n,p=a.onMove,q=a.onChangeCurrentVisibleDate,r=_objectWithoutProperties(a,_excluded),s=useFlag(),t=_slicedToArray(s,2),u=t[0],v=t[1],w=v.on,x=v.off;useEffect(function(){u||(null===p||void 0===p?void 0:p(moveTypes[1]))},[u]);var y=useCurrentVisibleDate({currentVisibleDate:i,maxDate:d,minDate:c,value:e,startOfUnit:startOfYear,onChangeCurrentVisibleDate:q}),z=_slicedToArray(y,2),A=z[0],B=z[1];if(u)return React.createElement(DateTimeTypeYear,Object.assign({},r,{ref:b,className:m,currentVisibleDate:A,minDate:c,maxDate:d,locale:l,events:j,view:o,onChange:function(a){B(a),x()},onMove:p}));var C=getHandleSelectDate({minDate:c,maxDate:d,value:e,onChange:f,onChangeRange:g,isEqualUnit:isEqualMount}),D=getMonthsOfYear({date:A,onChange:C,value:e,events:j,disableDates:h,minDate:c,maxDate:d,locale:l}),E=getYearTitle(A),F=function(){return B(addYears(A,1))},G=function(){return B(addYears(A,-1))};if(o===dateTimePropView[0])return React.createElement("div",Object.assign({},r,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),prevOnClick:G,nextOnClick:F,label:E,onLabelClick:w}),React.createElement(DateTimeYear,{years:D}));var H=addYears(A,1),I=getYearTitle(H),J=getMonthsOfYear({date:H,onChange:C,value:e,events:j,disableDates:h,minDate:c,maxDate:d,locale:l});return o===dateTimePropView[1]?React.createElement("div",Object.assign({},r,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),prevOnClick:G,label:E,onLabelClick:w}),React.createElement(DateTime10Years,{years:D})),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),nextOnClick:F,label:I,onLabelClick:w}),React.createElement(DateTime10Years,{years:J}))):React.createElement("div",Object.assign({},r,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement(DateTime10YearSlider,{className:cnDateTimeMixLayout("Slider"),currentVisibleDate:A,onChange:B,value:e,locale:l}),React.createElement("div",{className:cnDateTimeMixLayout("PageWrapper")},React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeLabel,{className:cnDateTimeMixLayout("Label"),label:E,onClick:w,cursor:"pointer"}),React.createElement(DateTime10Years,{years:D})),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeLabel,{className:cnDateTimeMixLayout("Label"),label:I,onClick:w,cursor:"pointer"}),React.createElement(DateTime10Years,{years:J}))))});
|
|
2
2
|
//# sourceMappingURL=DateTimeTypeMonth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeTypeMonth.js","names":["addYears","startOfYear","ruLocale","React","forwardRef","useEffect","useFlag","DateTime10Years","DateTime10YearSlider","DateTimeLabel","DateTimeToggler","DateTimeTypeYear","DateTimeYear","getHandleSelectDate","getMonthsOfYear","getYearTitle","isEqualMount","moveTypes","useCurrentVisibleDate","dateTimePropView","dateTimePropViewDefault","cnDateTimeMixLayout","DateTimeTypeMonth","props","ref","minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDateProp","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate","otherProps","changeYear","on","off","startOfUnit","setCurrentVisibleDate","handleSelectDate","isEqualUnit","pageOneMonthsOfYear","date","pageOneLabel","handleNext","handlePrev","pageTwoCurrentVisibleDate","pageTwoLabel","pageTwoMonthsOfYear"],"sources":["../../../../../../src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.tsx"],"sourcesContent":["import { addYears, startOfYear } from 'date-fns';\nimport ruLocale from 'date-fns/locale/ru';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport { useFlag } from '../../../hooks/useFlag/useFlag';\nimport { DateTime10Years } from '../DateTime10Years/DateTime10Years';\nimport { DateTime10YearSlider } from '../DateTime10YearSlider/DateTime10YearSlider';\nimport { DateTimeLabel } from '../DateTimeLabel/DateTimeLabel';\nimport { DateTimeToggler } from '../DateTimeToggler/DateTimeToggler';\nimport { DateTimeTypeYear } from '../DateTimeTypeYear/DateTimeTypeYear';\nimport { DateTimeYear } from '../DateTimeYear/DateTimeYear';\nimport {\n DateTimeTypeComponent,\n getHandleSelectDate,\n getMonthsOfYear,\n getYearTitle,\n isEqualMount,\n moveTypes,\n useCurrentVisibleDate,\n} from '../helpers';\nimport { dateTimePropView, dateTimePropViewDefault } from '../helpers/types';\nimport { cnDateTimeMixLayout } from '../mixs';\n\nexport const DateTimeTypeMonth: DateTimeTypeComponent<'month'> = forwardRef(\n (props, ref) => {\n const {\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n disableDates,\n currentVisibleDate: currentVisibleDateProp,\n events,\n locale = ruLocale,\n className,\n view = dateTimePropViewDefault,\n onMove,\n onChangeCurrentVisibleDate,\n ...otherProps\n } = props;\n\n const [changeYear, { on, off }] = useFlag();\n\n useEffect(() => {\n !changeYear && onMove?.(moveTypes[1]);\n }, [changeYear]);\n\n const [currentVisibleDate, setCurrentVisibleDate] = useCurrentVisibleDate({\n currentVisibleDate: currentVisibleDateProp,\n maxDate,\n minDate,\n value,\n startOfUnit: startOfYear,\n onChangeCurrentVisibleDate,\n });\n\n if (changeYear) {\n return (\n <DateTimeTypeYear\n {...otherProps}\n ref={ref}\n className={className}\n currentVisibleDate={currentVisibleDate}\n minDate={minDate}\n maxDate={maxDate}\n locale={locale}\n events={events}\n view={view}\n onChange={(value) => {\n setCurrentVisibleDate(value);\n off();\n }}\n onMove={onMove}\n />\n );\n }\n\n const handleSelectDate = getHandleSelectDate({\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n isEqualUnit: isEqualMount,\n });\n\n const pageOneMonthsOfYear = getMonthsOfYear({\n date: currentVisibleDate,\n onChange: handleSelectDate,\n value,\n events,\n disableDates,\n minDate,\n maxDate,\n locale,\n });\n\n const pageOneLabel = getYearTitle(currentVisibleDate);\n\n const handleNext = () =>\n setCurrentVisibleDate(addYears(currentVisibleDate, 1));\n const handlePrev = () =>\n setCurrentVisibleDate(addYears(currentVisibleDate, -1));\n\n if (view === dateTimePropView[0]) {\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={handlePrev}\n nextOnClick={handleNext}\n label={pageOneLabel}\n onLabelClick={on}\n />\n <DateTimeYear years={pageOneMonthsOfYear} />\n </div>\n );\n }\n\n const pageTwoCurrentVisibleDate = addYears(currentVisibleDate, 1);\n\n const pageTwoLabel = getYearTitle(pageTwoCurrentVisibleDate);\n\n const pageTwoMonthsOfYear = getMonthsOfYear({\n date: pageTwoCurrentVisibleDate,\n onChange: handleSelectDate,\n value,\n events,\n disableDates,\n minDate,\n maxDate,\n locale,\n });\n\n if (view === dateTimePropView[1]) {\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={handlePrev}\n label={pageOneLabel}\n onLabelClick={on}\n />\n <DateTime10Years years={pageOneMonthsOfYear} />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n nextOnClick={handleNext}\n label={pageTwoLabel}\n onLabelClick={on}\n />\n <DateTime10Years years={pageTwoMonthsOfYear} />\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <DateTime10YearSlider\n className={cnDateTimeMixLayout('Slider')}\n currentVisibleDate={currentVisibleDate}\n onChange={setCurrentVisibleDate}\n value={value}\n locale={locale}\n />\n <div className={cnDateTimeMixLayout('PageWrapper')}>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageOneLabel}\n onClick={on}\n cursor=\"pointer\"\n />\n <DateTime10Years years={pageOneMonthsOfYear} />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageTwoLabel}\n onClick={on}\n cursor=\"pointer\"\n />\n <DateTime10Years years={pageTwoMonthsOfYear} />\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":"4UAAA,OAASA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M,CAAxB,EAPF,CADF,CAUE,2BAAK,SAAS,CAAE1B,mBAAmB,CAAC,MAAD,CAAnC,EACE,oBAAC,aAAD,EACE,SAAS,CAAEA,mBAAmB,CAAC,OAAD,CADhC,CAEE,KAAK,CAAEgC,CAFT,CAGE,OAAO,CAAEZ,CAHX,CAIE,MAAM,CAAC,SAJT,EADF,CAOE,oBAAC,eAAD,EAAiB,KAAK,CAAEa,CAAxB,EAPF,CAVF,CAZF,CAkCH,CApLwE,CAApE"}
|
|
1
|
+
{"version":3,"file":"DateTimeTypeMonth.js","names":["addYears","startOfYear","ru","React","forwardRef","useEffect","useFlag","DateTime10Years","DateTime10YearSlider","DateTimeLabel","DateTimeToggler","DateTimeTypeYear","DateTimeYear","getHandleSelectDate","getMonthsOfYear","getYearTitle","isEqualMount","moveTypes","useCurrentVisibleDate","dateTimePropView","dateTimePropViewDefault","cnDateTimeMixLayout","DateTimeTypeMonth","props","ref","minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDateProp","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate","otherProps","changeYear","on","off","startOfUnit","setCurrentVisibleDate","handleSelectDate","isEqualUnit","pageOneMonthsOfYear","date","pageOneLabel","handleNext","handlePrev","pageTwoCurrentVisibleDate","pageTwoLabel","pageTwoMonthsOfYear"],"sources":["../../../../../../src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.tsx"],"sourcesContent":["import { addYears, startOfYear } from 'date-fns';\nimport { ru } from 'date-fns/locale';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport { useFlag } from '../../../hooks/useFlag/useFlag';\nimport { DateTime10Years } from '../DateTime10Years/DateTime10Years';\nimport { DateTime10YearSlider } from '../DateTime10YearSlider/DateTime10YearSlider';\nimport { DateTimeLabel } from '../DateTimeLabel/DateTimeLabel';\nimport { DateTimeToggler } from '../DateTimeToggler/DateTimeToggler';\nimport { DateTimeTypeYear } from '../DateTimeTypeYear/DateTimeTypeYear';\nimport { DateTimeYear } from '../DateTimeYear/DateTimeYear';\nimport {\n DateTimeTypeComponent,\n getHandleSelectDate,\n getMonthsOfYear,\n getYearTitle,\n isEqualMount,\n moveTypes,\n useCurrentVisibleDate,\n} from '../helpers';\nimport { dateTimePropView, dateTimePropViewDefault } from '../helpers/types';\nimport { cnDateTimeMixLayout } from '../mixs';\n\nexport const DateTimeTypeMonth: DateTimeTypeComponent<'month'> = forwardRef(\n (props, ref) => {\n const {\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n disableDates,\n currentVisibleDate: currentVisibleDateProp,\n events,\n locale = ru,\n className,\n view = dateTimePropViewDefault,\n onMove,\n onChangeCurrentVisibleDate,\n ...otherProps\n } = props;\n\n const [changeYear, { on, off }] = useFlag();\n\n useEffect(() => {\n !changeYear && onMove?.(moveTypes[1]);\n }, [changeYear]);\n\n const [currentVisibleDate, setCurrentVisibleDate] = useCurrentVisibleDate({\n currentVisibleDate: currentVisibleDateProp,\n maxDate,\n minDate,\n value,\n startOfUnit: startOfYear,\n onChangeCurrentVisibleDate,\n });\n\n if (changeYear) {\n return (\n <DateTimeTypeYear\n {...otherProps}\n ref={ref}\n className={className}\n currentVisibleDate={currentVisibleDate}\n minDate={minDate}\n maxDate={maxDate}\n locale={locale}\n events={events}\n view={view}\n onChange={(value) => {\n setCurrentVisibleDate(value);\n off();\n }}\n onMove={onMove}\n />\n );\n }\n\n const handleSelectDate = getHandleSelectDate({\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n isEqualUnit: isEqualMount,\n });\n\n const pageOneMonthsOfYear = getMonthsOfYear({\n date: currentVisibleDate,\n onChange: handleSelectDate,\n value,\n events,\n disableDates,\n minDate,\n maxDate,\n locale,\n });\n\n const pageOneLabel = getYearTitle(currentVisibleDate);\n\n const handleNext = () =>\n setCurrentVisibleDate(addYears(currentVisibleDate, 1));\n const handlePrev = () =>\n setCurrentVisibleDate(addYears(currentVisibleDate, -1));\n\n if (view === dateTimePropView[0]) {\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={handlePrev}\n nextOnClick={handleNext}\n label={pageOneLabel}\n onLabelClick={on}\n />\n <DateTimeYear years={pageOneMonthsOfYear} />\n </div>\n );\n }\n\n const pageTwoCurrentVisibleDate = addYears(currentVisibleDate, 1);\n\n const pageTwoLabel = getYearTitle(pageTwoCurrentVisibleDate);\n\n const pageTwoMonthsOfYear = getMonthsOfYear({\n date: pageTwoCurrentVisibleDate,\n onChange: handleSelectDate,\n value,\n events,\n disableDates,\n minDate,\n maxDate,\n locale,\n });\n\n if (view === dateTimePropView[1]) {\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={handlePrev}\n label={pageOneLabel}\n onLabelClick={on}\n />\n <DateTime10Years years={pageOneMonthsOfYear} />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n nextOnClick={handleNext}\n label={pageTwoLabel}\n onLabelClick={on}\n />\n <DateTime10Years years={pageTwoMonthsOfYear} />\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <DateTime10YearSlider\n className={cnDateTimeMixLayout('Slider')}\n currentVisibleDate={currentVisibleDate}\n onChange={setCurrentVisibleDate}\n value={value}\n locale={locale}\n />\n <div className={cnDateTimeMixLayout('PageWrapper')}>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageOneLabel}\n onClick={on}\n cursor=\"pointer\"\n />\n <DateTime10Years years={pageOneMonthsOfYear} />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageTwoLabel}\n onClick={on}\n cursor=\"pointer\"\n />\n <DateTime10Years years={pageTwoMonthsOfYear} />\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":"4UAAA,OAASA,QAAT,CAAmBC,WAAnB,KAAsC,UAAtC,CACA,OAASC,EAAT,KAAmB,iBAAnB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,KAA6C,OAA7C,CAEA,OAASC,OAAT,sCACA,OAASC,eAAT,0CACA,OAASC,oBAAT,oDACA,OAASC,aAAT,sCACA,OAASC,eAAT,0CACA,OAASC,gBAAT,4CACA,OAASC,YAAT,oCACA,OAEEC,mBAFF,CAGEC,eAHF,CAIEC,YAJF,CAKEC,YALF,CAMEC,SANF,CAOEC,qBAPF,kBASA,OAASC,gBAAT,CAA2BC,uBAA3B,wBACA,OAASC,mBAAT,eAEA,MAAO,IAAMC,kBAAiD,CAAGlB,UAAU,CACzE,SAACmB,CAAD,CAAQC,CAAR,CAAgB,IAEZC,EAFY,CAgBVF,CAhBU,CAEZE,OAFY,CAGZC,CAHY,CAgBVH,CAhBU,CAGZG,OAHY,CAIZC,CAJY,CAgBVJ,CAhBU,CAIZI,KAJY,CAKZC,CALY,CAgBVL,CAhBU,CAKZK,QALY,CAMZC,CANY,CAgBVN,CAhBU,CAMZM,aANY,CAOZC,CAPY,CAgBVP,CAhBU,CAOZO,YAPY,CAQQC,CARR,CAgBVR,CAhBU,CAQZS,kBARY,CASZC,CATY,CAgBVV,CAhBU,CASZU,MATY,GAgBVV,CAhBU,CAUZW,MAVY,CAUZA,CAVY,YAUHhC,EAVG,GAWZiC,CAXY,CAgBVZ,CAhBU,CAWZY,SAXY,GAgBVZ,CAhBU,CAYZa,IAZY,CAYZA,CAZY,YAYLhB,uBAZK,GAaZiB,CAbY,CAgBVd,CAhBU,CAaZc,MAbY,CAcZC,CAdY,CAgBVf,CAhBU,CAcZe,0BAdY,CAeTC,CAfS,0BAgBVhB,CAhBU,cAk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mB,CAAC,OAAD,CADhC,CAEE,KAAK,CAAE4B,CAFT,CAGE,OAAO,CAAER,CAHX,CAIE,MAAM,CAAC,SAJT,EADF,CAOE,oBAAC,eAAD,EAAiB,KAAK,CAAEM,CAAxB,EAPF,CADF,CAUE,2BAAK,SAAS,CAAE1B,mBAAmB,CAAC,MAAD,CAAnC,EACE,oBAAC,aAAD,EACE,SAAS,CAAEA,mBAAmB,CAAC,OAAD,CADhC,CAEE,KAAK,CAAEgC,CAFT,CAGE,OAAO,CAAEZ,CAHX,CAIE,MAAM,CAAC,SAJT,EADF,CAOE,oBAAC,eAAD,EAAiB,KAAK,CAAEa,CAAxB,EAPF,CAVF,CAZF,CAkCH,CApLwE,CAApE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate"];import{addYears,startOfDecade}from"date-fns";import
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate"];import{addYears,startOfDecade}from"date-fns";import{ru}from"date-fns/locale";import React,{forwardRef,useEffect}from"react";import{DateTime10Years}from"../DateTime10Years/DateTime10Years";import{DateTime100YearSlider}from"../DateTime100YearSlider/DateTime100YearSlider";import{DateTimeLabel}from"../DateTimeLabel/DateTimeLabel";import{DateTimeToggler}from"../DateTimeToggler/DateTimeToggler";import{getDecadeTitle,getHandleSelectDate,getYearsOfDecade,isEqualYear,moveTypes,useCurrentVisibleDate}from"../helpers";import{dateTimePropView,dateTimePropViewDefault}from"../helpers/types";import{cnDateTimeMixLayout}from"../mixs";export var DateTimeTypeYear=forwardRef(function(a,b){var c=a.minDate,d=a.maxDate,e=a.value,f=a.onChange,g=a.onChangeRange,h=a.disableDates,i=a.currentVisibleDate,j=a.events,k=a.locale,l=void 0===k?ru:k,m=a.className,n=a.view,o=void 0===n?dateTimePropViewDefault:n,p=a.onMove,q=a.onChangeCurrentVisibleDate,r=_objectWithoutProperties(a,_excluded);useEffect(function(){null===p||void 0===p?void 0:p(moveTypes[0])},[]);var s=useCurrentVisibleDate({currentVisibleDate:i,maxDate:d,minDate:c,value:e,startOfUnit:startOfDecade,onChangeCurrentVisibleDate:q}),t=_slicedToArray(s,2),u=t[0],v=t[1],w=getHandleSelectDate({minDate:c,maxDate:d,value:e,onChange:f,onChangeRange:g,isEqualUnit:isEqualYear}),x=getYearsOfDecade({date:u,onChange:w,value:e,disableDates:h,events:j,minDate:c,maxDate:d,locale:l}),y=getDecadeTitle(u),z=function(){return v(addYears(u,10))},A=function(){return v(addYears(u,-10))};if(o===dateTimePropView[0])return React.createElement("div",Object.assign({},r,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),prevOnClick:A,nextOnClick:z,label:y}),React.createElement(DateTime10Years,{years:x}));var B=addYears(u,10),C=getYearsOfDecade({date:B,onChange:w,value:e,events:j,disableDates:h,minDate:c,maxDate:d,locale:l}),D=getDecadeTitle(B);return o===dateTimePropView[1]?React.createElement("div",Object.assign({},r,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),prevOnClick:A,label:y}),React.createElement(DateTime10Years,{years:x})),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeToggler,{className:cnDateTimeMixLayout("Label"),nextOnClick:z,label:D}),React.createElement(DateTime10Years,{years:C}))):React.createElement("div",Object.assign({},r,{className:cnDateTimeMixLayout({view:o},[m]),ref:b}),React.createElement(DateTime100YearSlider,{className:cnDateTimeMixLayout("Slider"),currentVisibleDate:u,onChange:v,value:e,locale:l}),React.createElement("div",{className:cnDateTimeMixLayout("PageWrapper")},React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeLabel,{className:cnDateTimeMixLayout("Label"),label:y}),React.createElement(DateTime10Years,{years:x})),React.createElement("div",{className:cnDateTimeMixLayout("Page")},React.createElement(DateTimeLabel,{className:cnDateTimeMixLayout("Label"),label:D}),React.createElement(DateTime10Years,{years:C}))))});
|
|
2
2
|
//# sourceMappingURL=DateTimeTypeYear.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeTypeYear.js","names":["addYears","startOfDecade","
|
|
1
|
+
{"version":3,"file":"DateTimeTypeYear.js","names":["addYears","startOfDecade","ru","React","forwardRef","useEffect","DateTime10Years","DateTime100YearSlider","DateTimeLabel","DateTimeToggler","getDecadeTitle","getHandleSelectDate","getYearsOfDecade","isEqualYear","moveTypes","useCurrentVisibleDate","dateTimePropView","dateTimePropViewDefault","cnDateTimeMixLayout","DateTimeTypeYear","props","ref","minDate","maxDate","value","onChange","onChangeRange","disableDates","currentVisibleDateProp","currentVisibleDate","events","locale","className","view","onMove","onChangeCurrentVisibleDate","otherProps","startOfUnit","setCurrentVisibleDate","handleSelectDate","isEqualUnit","pageOneYearsOfDecade","date","pageOneLabel","handleNext","handlePrev","pageTwoCurrentVisibleDate","pageTwoYearsOfDecade","pageTwoLabel"],"sources":["../../../../../../src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.tsx"],"sourcesContent":["import { addYears, startOfDecade } from 'date-fns';\nimport { ru } from 'date-fns/locale';\nimport React, { forwardRef, useEffect } from 'react';\n\nimport { DateTime10Years } from '../DateTime10Years/DateTime10Years';\nimport { DateTime100YearSlider } from '../DateTime100YearSlider/DateTime100YearSlider';\nimport { DateTimeLabel } from '../DateTimeLabel/DateTimeLabel';\nimport { DateTimeToggler } from '../DateTimeToggler/DateTimeToggler';\nimport {\n DateTimeTypeComponent,\n getDecadeTitle,\n getHandleSelectDate,\n getYearsOfDecade,\n isEqualYear,\n moveTypes,\n useCurrentVisibleDate,\n} from '../helpers';\nimport { dateTimePropView, dateTimePropViewDefault } from '../helpers/types';\nimport { cnDateTimeMixLayout } from '../mixs';\n\nexport const DateTimeTypeYear: DateTimeTypeComponent<'year'> = forwardRef(\n (props, ref) => {\n const {\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n disableDates,\n currentVisibleDate: currentVisibleDateProp,\n events,\n locale = ru,\n className,\n view = dateTimePropViewDefault,\n onMove,\n onChangeCurrentVisibleDate,\n ...otherProps\n } = props;\n\n useEffect(() => {\n onMove?.(moveTypes[0]);\n }, []);\n\n const [currentVisibleDate, setCurrentVisibleDate] = useCurrentVisibleDate({\n currentVisibleDate: currentVisibleDateProp,\n maxDate,\n minDate,\n value,\n startOfUnit: startOfDecade,\n onChangeCurrentVisibleDate,\n });\n\n const handleSelectDate = getHandleSelectDate({\n minDate,\n maxDate,\n value,\n onChange,\n onChangeRange,\n isEqualUnit: isEqualYear,\n });\n\n const pageOneYearsOfDecade = getYearsOfDecade({\n date: currentVisibleDate,\n onChange: handleSelectDate,\n value,\n disableDates,\n events,\n minDate,\n maxDate,\n locale,\n });\n\n const pageOneLabel = getDecadeTitle(currentVisibleDate);\n\n const handleNext = () =>\n setCurrentVisibleDate(addYears(currentVisibleDate, 10));\n const handlePrev = () =>\n setCurrentVisibleDate(addYears(currentVisibleDate, -10));\n\n if (view === dateTimePropView[0]) {\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={handlePrev}\n nextOnClick={handleNext}\n label={pageOneLabel}\n />\n <DateTime10Years years={pageOneYearsOfDecade} />\n </div>\n );\n }\n\n const pageTwoCurrentVisibleDate = addYears(currentVisibleDate, 10);\n\n const pageTwoYearsOfDecade = getYearsOfDecade({\n date: pageTwoCurrentVisibleDate,\n onChange: handleSelectDate,\n value,\n events,\n disableDates,\n minDate,\n maxDate,\n locale,\n });\n\n const pageTwoLabel = getDecadeTitle(pageTwoCurrentVisibleDate);\n\n if (view === dateTimePropView[1]) {\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n prevOnClick={handlePrev}\n label={pageOneLabel}\n />\n <DateTime10Years years={pageOneYearsOfDecade} />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeToggler\n className={cnDateTimeMixLayout('Label')}\n nextOnClick={handleNext}\n label={pageTwoLabel}\n />\n <DateTime10Years years={pageTwoYearsOfDecade} />\n </div>\n </div>\n );\n }\n\n return (\n <div\n {...otherProps}\n className={cnDateTimeMixLayout({ view }, [className])}\n ref={ref}\n >\n <DateTime100YearSlider\n className={cnDateTimeMixLayout('Slider')}\n currentVisibleDate={currentVisibleDate}\n onChange={setCurrentVisibleDate}\n value={value}\n locale={locale}\n />\n <div className={cnDateTimeMixLayout('PageWrapper')}>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageOneLabel}\n />\n <DateTime10Years years={pageOneYearsOfDecade} />\n </div>\n <div className={cnDateTimeMixLayout('Page')}>\n <DateTimeLabel\n className={cnDateTimeMixLayout('Label')}\n label={pageTwoLabel}\n />\n <DateTime10Years years={pageTwoYearsOfDecade} />\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":"4UAAA,OAASA,QAAT,CAAmBC,aAAnB,KAAwC,UAAxC,CACA,OAASC,EAAT,KAAmB,iBAAnB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,SAA5B,KAA6C,OAA7C,CAEA,OAASC,eAAT,0CACA,OAASC,qBAAT,sDACA,OAASC,aAAT,sCACA,OAASC,eAAT,0CACA,OAEEC,cAFF,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CAKE,MAAM,CAAEO,CALV,EALF,CAYE,2BAAK,SAAS,CAAEb,mBAAmB,CAAC,aAAD,CAAnC,EACE,2BAAK,SAAS,CAAEA,mBAAmB,CAAC,MAAD,CAAnC,EACE,oBAAC,aAAD,EACE,SAAS,CAAEA,mBAAmB,CAAC,OAAD,CADhC,CAEE,KAAK,CAAEyB,CAFT,EADF,CAKE,oBAAC,eAAD,EAAiB,KAAK,CAAEF,CAAxB,EALF,CADF,CAQE,2BAAK,SAAS,CAAEvB,mBAAmB,CAAC,MAAD,CAAnC,EACE,oBAAC,aAAD,EACE,SAAS,CAAEA,mBAAmB,CAAC,OAAD,CADhC,CAEE,KAAK,CAAE8B,CAFT,EADF,CAKE,oBAAC,eAAD,EAAiB,KAAK,CAAED,CAAxB,EALF,CARF,CAZF,CA8BH,CAtJsE,CAAlE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["currentVisibleDate","className","onChange","value","locale"];import"./DateTimeYearSlider.css";import{addMonths,addYears,endOfYear,format,getMonth,getYear,startOfYear}from"date-fns";import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["currentVisibleDate","className","onChange","value","locale"];import"./DateTimeYearSlider.css";import{addMonths,addYears,endOfYear,format,getMonth,getYear,startOfYear}from"date-fns";import{ru}from"date-fns/locale";import React from"react";import{range}from"../../../utils/array";import{cn}from"../../../utils/bem";import{DateTimeSlider}from"../DateTimeSlider/DateTimeSlider";import{getMonthTitleAbbreviated}from"../helpers";import{getSliderValueRange}from"../helpers/getSliderValueRange";export var cnDateTimeYearSlider=cn("DateTimeYearSlider");var isCurrentVisibleYear=function(a,b){return getYear(a)===getYear(b)},isCurrentVisibleMonth=function(a,b){return isCurrentVisibleYear(a,b)&&getMonth(a)===getMonth(b)},getYearItems=function(a,b,c){return range(12).map(function(d){var e=addMonths(b,d);return{date:e,label:getMonthTitleAbbreviated(e,c),current:isCurrentVisibleMonth(a,e)}})},getSliderData=function(a,b,c){var d=startOfYear(a);return[addYears(d,-1),d,addYears(d,1),addYears(d,2)].map(function(d){return{label:format(d,"yyyy",{locale:c}),date:d,items:getYearItems(a,d,c),current:isCurrentVisibleYear(a,d),valueRange:getSliderValueRange(d,b,startOfYear,endOfYear)}})};export var DateTimeYearSlider=function(a){var b=a.currentVisibleDate,c=a.className,d=a.onChange,e=a.value,f=a.locale,g=void 0===f?ru:f,h=_objectWithoutProperties(a,_excluded),i=getSliderData(b,e,g);return React.createElement(DateTimeSlider,Object.assign({className:cnDateTimeYearSlider(null,[c]),onNext:function handleNext(){return d(addYears(b,1))},onPrev:function handlePrev(){return d(addYears(b,-1))},data:i,onChange:d},h))};
|
|
2
2
|
//# sourceMappingURL=DateTimeYearSlider.js.map
|