@expressms/smartapp-ui 2.8.1 → 2.8.2-alpha.10
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/build/main/assets/storybook/index.d.ts +2 -0
- package/build/main/components/Charts/ChartBar/ChartBar.d.ts +4 -0
- package/build/main/components/Charts/ChartLine/ChartLine.d.ts +4 -0
- package/build/main/components/Charts/ChartPie/ChartPie.d.ts +4 -0
- package/build/main/components/Charts/index.d.ts +3 -0
- package/build/main/components/CustomSelect/CustomSelect.d.ts +12 -0
- package/build/main/{/321/201omponents → components}/CustomSelect/types.d.ts +1 -0
- package/build/main/components/DraggablePopup/DraggablePopup.d.ts +4 -0
- package/build/main/components/DraggablePopup/index.d.ts +1 -0
- package/build/main/components/DraggablePopup/types.d.ts +60 -0
- package/build/main/{/321/201omponents → components}/ListItem/types.d.ts +2 -1
- package/build/main/{/321/201omponents → components}/Loader/Loader.d.ts +1 -1
- package/build/main/{/321/201omponents → components}/Loader/types.d.ts +2 -0
- package/build/main/components/Modal/Modal.d.ts +4 -0
- package/build/main/{/321/201omponents → components}/Modal/types.d.ts +11 -5
- package/build/main/{/321/201omponents → components}/ScrollBar/ScrollBar.d.ts +1 -1
- package/build/main/{/321/201omponents → components}/ScrollBar/types.d.ts +1 -0
- package/build/main/components/Skeleton/Skeleton.d.ts +4 -0
- package/build/main/components/Skeleton/index.d.ts +1 -0
- package/build/main/{/321/201omponents → components}/UserDropdown/helpers.d.ts +0 -1
- package/build/main/constants/constants.d.ts +6 -1
- package/build/main/hooks/useModal.d.ts +0 -1
- package/build/main/index.d.ts +34 -3
- package/package.json +66 -58
- package/build/main/assets/icons/arrow-back.svg +0 -3
- package/build/main/assets/icons/arrow-down.svg +0 -3
- package/build/main/assets/icons/arrow-up.svg +0 -3
- package/build/main/assets/icons/attachment-loader.svg +0 -3
- package/build/main/assets/icons/button-loader.svg +0 -3
- package/build/main/assets/icons/cancel-cross.svg +0 -3
- package/build/main/assets/icons/check-mark.svg +0 -4
- package/build/main/assets/icons/clear.svg +0 -3
- package/build/main/assets/icons/close-stories.svg +0 -4
- package/build/main/assets/icons/close.svg +0 -10
- package/build/main/assets/icons/contact-info.svg +0 -12
- package/build/main/assets/icons/corporate-user.svg +0 -10
- package/build/main/assets/icons/crown.svg +0 -5
- package/build/main/assets/icons/delete-chip.svg +0 -3
- package/build/main/assets/icons/download.svg +0 -4
- package/build/main/assets/icons/error.svg +0 -5
- package/build/main/assets/icons/external-link.svg +0 -3
- package/build/main/assets/icons/eye-off.svg +0 -10
- package/build/main/assets/icons/eye.svg +0 -10
- package/build/main/assets/icons/file.svg +0 -3
- package/build/main/assets/icons/info.svg +0 -5
- package/build/main/assets/icons/loader.svg +0 -3
- package/build/main/assets/icons/logout.svg +0 -4
- package/build/main/assets/icons/magnifying-glass.svg +0 -3
- package/build/main/assets/icons/mail.svg +0 -3
- package/build/main/assets/icons/my-contact-user.svg +0 -10
- package/build/main/assets/icons/notification-close.svg +0 -3
- package/build/main/assets/icons/notification-error.svg +0 -3
- package/build/main/assets/icons/notification-failure.svg +0 -3
- package/build/main/assets/icons/notification-info.svg +0 -5
- package/build/main/assets/icons/notification-success.svg +0 -4
- package/build/main/assets/icons/notification-warning.svg +0 -5
- package/build/main/assets/icons/order.svg +0 -6
- package/build/main/assets/icons/plus.svg +0 -4
- package/build/main/assets/icons/private.svg +0 -12
- package/build/main/assets/icons/refresh.svg +0 -3
- package/build/main/assets/icons/story-loader.svg +0 -3
- package/build/main/assets/icons/tick.svg +0 -10
- package/build/main/assets/icons/trash.svg +0 -3
- package/build/main/assets/icons/unread-mails.svg +0 -4
- package/build/main/assets/storybook/index.js +0 -19
- package/build/main/assets/storybook/index.js.map +0 -1
- package/build/main/constants/constants.js +0 -154
- package/build/main/constants/constants.js.map +0 -1
- package/build/main/constants/index.js +0 -3
- package/build/main/constants/index.js.map +0 -1
- package/build/main/constants/types.js +0 -2
- package/build/main/constants/types.js.map +0 -1
- package/build/main/helpers/index.js +0 -89
- package/build/main/helpers/index.js.map +0 -1
- package/build/main/hooks/useModal.js +0 -60
- package/build/main/hooks/useModal.js.map +0 -1
- package/build/main/index.js +0 -4
- package/build/main/index.js.map +0 -1
- package/build/main/styles/index.js +0 -2
- package/build/main/styles/index.js.map +0 -1
- package/build/main/styles/main.js +0 -0
- package/build/main/styles/styles.scss +0 -14
- package/build/main//321/201omponents/ActionModal/ActionModal.js +0 -55
- package/build/main//321/201omponents/ActionModal/ActionModal.js.map +0 -1
- package/build/main//321/201omponents/ActionModal/index.js +0 -2
- package/build/main//321/201omponents/ActionModal/index.js.map +0 -1
- package/build/main//321/201omponents/ActionModal/types.js +0 -2
- package/build/main//321/201omponents/ActionModal/types.js.map +0 -1
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js +0 -60
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js.map +0 -1
- package/build/main//321/201omponents/AttachedFile/index.js +0 -2
- package/build/main//321/201omponents/AttachedFile/index.js.map +0 -1
- package/build/main//321/201omponents/AttachedFile/types.js +0 -2
- package/build/main//321/201omponents/AttachedFile/types.js.map +0 -1
- package/build/main//321/201omponents/Avatar/Avatar.js +0 -131
- package/build/main//321/201omponents/Avatar/Avatar.js.map +0 -1
- package/build/main//321/201omponents/Avatar/index.js +0 -2
- package/build/main//321/201omponents/Avatar/index.js.map +0 -1
- package/build/main//321/201omponents/Avatar/types.js +0 -9
- package/build/main//321/201omponents/Avatar/types.js.map +0 -1
- package/build/main//321/201omponents/Button/Button.js +0 -57
- package/build/main//321/201omponents/Button/Button.js.map +0 -1
- package/build/main//321/201omponents/Button/index.js +0 -2
- package/build/main//321/201omponents/Button/index.js.map +0 -1
- package/build/main//321/201omponents/Button/types.js +0 -11
- package/build/main//321/201omponents/Button/types.js.map +0 -1
- package/build/main//321/201omponents/CachedImage/CachedImage.js +0 -59
- package/build/main//321/201omponents/CachedImage/CachedImage.js.map +0 -1
- package/build/main//321/201omponents/CachedImage/helpers.js +0 -40
- package/build/main//321/201omponents/CachedImage/helpers.js.map +0 -1
- package/build/main//321/201omponents/CachedImage/index.js +0 -2
- package/build/main//321/201omponents/CachedImage/index.js.map +0 -1
- package/build/main//321/201omponents/CachedImage/types.js +0 -2
- package/build/main//321/201omponents/CachedImage/types.js.map +0 -1
- package/build/main//321/201omponents/Calendar/Calendar.js +0 -48
- package/build/main//321/201omponents/Calendar/Calendar.js.map +0 -1
- package/build/main//321/201omponents/Calendar/index.js +0 -2
- package/build/main//321/201omponents/Calendar/index.js.map +0 -1
- package/build/main//321/201omponents/Calendar/types.js +0 -2
- package/build/main//321/201omponents/Calendar/types.js.map +0 -1
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.d.ts +0 -3
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.js +0 -45
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.js.map +0 -1
- package/build/main//321/201omponents/Charts/ChartLegend/ChartLegend.js +0 -71
- package/build/main//321/201omponents/Charts/ChartLegend/ChartLegend.js.map +0 -1
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.d.ts +0 -3
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.js +0 -40
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.js.map +0 -1
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.d.ts +0 -3
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.js +0 -62
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.js.map +0 -1
- package/build/main//321/201omponents/Charts/colors.js +0 -4
- package/build/main//321/201omponents/Charts/colors.js.map +0 -1
- package/build/main//321/201omponents/Charts/constants.js +0 -43
- package/build/main//321/201omponents/Charts/constants.js.map +0 -1
- package/build/main//321/201omponents/Charts/helpers.js +0 -73
- package/build/main//321/201omponents/Charts/helpers.js.map +0 -1
- package/build/main//321/201omponents/Charts/index.d.ts +0 -3
- package/build/main//321/201omponents/Charts/index.js +0 -4
- package/build/main//321/201omponents/Charts/index.js.map +0 -1
- package/build/main//321/201omponents/Charts/types.js +0 -2
- package/build/main//321/201omponents/Charts/types.js.map +0 -1
- package/build/main//321/201omponents/Charts/useEvents.js +0 -45
- package/build/main//321/201omponents/Charts/useEvents.js.map +0 -1
- package/build/main//321/201omponents/Charts/usePieEvents.js +0 -57
- package/build/main//321/201omponents/Charts/usePieEvents.js.map +0 -1
- package/build/main//321/201omponents/Checkbox/Checkbox.js +0 -38
- package/build/main//321/201omponents/Checkbox/Checkbox.js.map +0 -1
- package/build/main//321/201omponents/Checkbox/index.js +0 -2
- package/build/main//321/201omponents/Checkbox/index.js.map +0 -1
- package/build/main//321/201omponents/Checkbox/types.js +0 -2
- package/build/main//321/201omponents/Checkbox/types.js.map +0 -1
- package/build/main//321/201omponents/Chip/Chip.js +0 -35
- package/build/main//321/201omponents/Chip/Chip.js.map +0 -1
- package/build/main//321/201omponents/Chip/index.js +0 -2
- package/build/main//321/201omponents/Chip/index.js.map +0 -1
- package/build/main//321/201omponents/Chip/types.js +0 -2
- package/build/main//321/201omponents/Chip/types.js.map +0 -1
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +0 -70
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js.map +0 -1
- package/build/main//321/201omponents/ConfirmationModal/index.js +0 -2
- package/build/main//321/201omponents/ConfirmationModal/index.js.map +0 -1
- package/build/main//321/201omponents/ConfirmationModal/types.js +0 -2
- package/build/main//321/201omponents/ConfirmationModal/types.js.map +0 -1
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js +0 -75
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js.map +0 -1
- package/build/main//321/201omponents/ContextMenu/index.js +0 -2
- package/build/main//321/201omponents/ContextMenu/index.js.map +0 -1
- package/build/main//321/201omponents/ContextMenu/types.js +0 -2
- package/build/main//321/201omponents/ContextMenu/types.js.map +0 -1
- package/build/main//321/201omponents/CustomSelect/CustomSelect.d.ts +0 -4
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js +0 -173
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js.map +0 -1
- package/build/main//321/201omponents/CustomSelect/index.js +0 -2
- package/build/main//321/201omponents/CustomSelect/index.js.map +0 -1
- package/build/main//321/201omponents/CustomSelect/selectStyles.js +0 -61
- package/build/main//321/201omponents/CustomSelect/selectStyles.js.map +0 -1
- package/build/main//321/201omponents/CustomSelect/types.js +0 -2
- package/build/main//321/201omponents/CustomSelect/types.js.map +0 -1
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js +0 -57
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js.map +0 -1
- package/build/main//321/201omponents/CustomSelectProfiles/index.js +0 -2
- package/build/main//321/201omponents/CustomSelectProfiles/index.js.map +0 -1
- package/build/main//321/201omponents/CustomSelectProfiles/types.js +0 -2
- package/build/main//321/201omponents/CustomSelectProfiles/types.js.map +0 -1
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js +0 -57
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js.map +0 -1
- package/build/main//321/201omponents/DragAndDrop/index.js +0 -2
- package/build/main//321/201omponents/DragAndDrop/index.js.map +0 -1
- package/build/main//321/201omponents/DragAndDrop/types.js +0 -2
- package/build/main//321/201omponents/DragAndDrop/types.js.map +0 -1
- package/build/main//321/201omponents/Error/Error.js +0 -23
- package/build/main//321/201omponents/Error/Error.js.map +0 -1
- package/build/main//321/201omponents/Error/index.js +0 -2
- package/build/main//321/201omponents/Error/index.js.map +0 -1
- package/build/main//321/201omponents/Error/types.js +0 -2
- package/build/main//321/201omponents/Error/types.js.map +0 -1
- package/build/main//321/201omponents/Flex/Flex.js +0 -49
- package/build/main//321/201omponents/Flex/Flex.js.map +0 -1
- package/build/main//321/201omponents/Flex/HFlex/HFlex.js +0 -16
- package/build/main//321/201omponents/Flex/HFlex/HFlex.js.map +0 -1
- package/build/main//321/201omponents/Flex/HFlex/index.js +0 -2
- package/build/main//321/201omponents/Flex/HFlex/index.js.map +0 -1
- package/build/main//321/201omponents/Flex/VFlex/VFlex.js +0 -16
- package/build/main//321/201omponents/Flex/VFlex/VFlex.js.map +0 -1
- package/build/main//321/201omponents/Flex/VFlex/index.js +0 -2
- package/build/main//321/201omponents/Flex/VFlex/index.js.map +0 -1
- package/build/main//321/201omponents/Flex/index.js +0 -4
- package/build/main//321/201omponents/Flex/index.js.map +0 -1
- package/build/main//321/201omponents/Flex/types.js +0 -2
- package/build/main//321/201omponents/Flex/types.js.map +0 -1
- package/build/main//321/201omponents/Header/Header.js +0 -124
- package/build/main//321/201omponents/Header/Header.js.map +0 -1
- package/build/main//321/201omponents/Header/index.js +0 -2
- package/build/main//321/201omponents/Header/index.js.map +0 -1
- package/build/main//321/201omponents/Header/types.js +0 -2
- package/build/main//321/201omponents/Header/types.js.map +0 -1
- package/build/main//321/201omponents/Input/Input.js +0 -207
- package/build/main//321/201omponents/Input/Input.js.map +0 -1
- package/build/main//321/201omponents/Input/index.js +0 -2
- package/build/main//321/201omponents/Input/index.js.map +0 -1
- package/build/main//321/201omponents/Input/types.js +0 -2
- package/build/main//321/201omponents/Input/types.js.map +0 -1
- package/build/main//321/201omponents/ListItem/ListItem.js +0 -208
- package/build/main//321/201omponents/ListItem/ListItem.js.map +0 -1
- package/build/main//321/201omponents/ListItem/index.js +0 -2
- package/build/main//321/201omponents/ListItem/index.js.map +0 -1
- package/build/main//321/201omponents/ListItem/types.js +0 -2
- package/build/main//321/201omponents/ListItem/types.js.map +0 -1
- package/build/main//321/201omponents/Loader/Loader.js +0 -37
- package/build/main//321/201omponents/Loader/Loader.js.map +0 -1
- package/build/main//321/201omponents/Loader/index.js +0 -2
- package/build/main//321/201omponents/Loader/index.js.map +0 -1
- package/build/main//321/201omponents/Loader/types.js +0 -2
- package/build/main//321/201omponents/Loader/types.js.map +0 -1
- package/build/main//321/201omponents/Modal/Modal.d.ts +0 -4
- package/build/main//321/201omponents/Modal/Modal.js +0 -92
- package/build/main//321/201omponents/Modal/Modal.js.map +0 -1
- package/build/main//321/201omponents/Modal/index.js +0 -2
- package/build/main//321/201omponents/Modal/index.js.map +0 -1
- package/build/main//321/201omponents/Modal/types.js +0 -2
- package/build/main//321/201omponents/Modal/types.js.map +0 -1
- package/build/main//321/201omponents/Notification/Notification.js +0 -197
- package/build/main//321/201omponents/Notification/Notification.js.map +0 -1
- package/build/main//321/201omponents/Notification/index.js +0 -2
- package/build/main//321/201omponents/Notification/index.js.map +0 -1
- package/build/main//321/201omponents/Notification/types.js +0 -2
- package/build/main//321/201omponents/Notification/types.js.map +0 -1
- package/build/main//321/201omponents/Profile/Profile.js +0 -42
- package/build/main//321/201omponents/Profile/Profile.js.map +0 -1
- package/build/main//321/201omponents/Profile/index.js +0 -2
- package/build/main//321/201omponents/Profile/index.js.map +0 -1
- package/build/main//321/201omponents/Profile/types.js +0 -2
- package/build/main//321/201omponents/Profile/types.js.map +0 -1
- package/build/main//321/201omponents/ProgressBar/ProgressBar.js +0 -66
- package/build/main//321/201omponents/ProgressBar/ProgressBar.js.map +0 -1
- package/build/main//321/201omponents/ProgressBar/index.js +0 -2
- package/build/main//321/201omponents/ProgressBar/index.js.map +0 -1
- package/build/main//321/201omponents/ProgressBar/types.js +0 -2
- package/build/main//321/201omponents/ProgressBar/types.js.map +0 -1
- package/build/main//321/201omponents/RadioButton/RadioButton.js +0 -37
- package/build/main//321/201omponents/RadioButton/RadioButton.js.map +0 -1
- package/build/main//321/201omponents/RadioButton/index.js +0 -2
- package/build/main//321/201omponents/RadioButton/index.js.map +0 -1
- package/build/main//321/201omponents/RadioButton/types.js +0 -2
- package/build/main//321/201omponents/RadioButton/types.js.map +0 -1
- package/build/main//321/201omponents/ScrollBar/ScrollBar.js +0 -63
- package/build/main//321/201omponents/ScrollBar/ScrollBar.js.map +0 -1
- package/build/main//321/201omponents/ScrollBar/index.js +0 -2
- package/build/main//321/201omponents/ScrollBar/index.js.map +0 -1
- package/build/main//321/201omponents/ScrollBar/types.js +0 -2
- package/build/main//321/201omponents/ScrollBar/types.js.map +0 -1
- package/build/main//321/201omponents/Skeleton/Skeleton.d.ts +0 -3
- package/build/main//321/201omponents/Skeleton/Skeleton.js +0 -58
- package/build/main//321/201omponents/Skeleton/Skeleton.js.map +0 -1
- package/build/main//321/201omponents/Skeleton/index.d.ts +0 -1
- package/build/main//321/201omponents/Skeleton/index.js +0 -2
- package/build/main//321/201omponents/Skeleton/index.js.map +0 -1
- package/build/main//321/201omponents/Skeleton/types.js +0 -2
- package/build/main//321/201omponents/Skeleton/types.js.map +0 -1
- package/build/main//321/201omponents/Stories/Stories.js +0 -296
- package/build/main//321/201omponents/Stories/Stories.js.map +0 -1
- package/build/main//321/201omponents/Stories/index.js +0 -2
- package/build/main//321/201omponents/Stories/index.js.map +0 -1
- package/build/main//321/201omponents/Stories/types.js +0 -11
- package/build/main//321/201omponents/Stories/types.js.map +0 -1
- package/build/main//321/201omponents/Switcher/Switcher.js +0 -34
- package/build/main//321/201omponents/Switcher/Switcher.js.map +0 -1
- package/build/main//321/201omponents/Switcher/index.js +0 -2
- package/build/main//321/201omponents/Switcher/index.js.map +0 -1
- package/build/main//321/201omponents/Switcher/types.js +0 -2
- package/build/main//321/201omponents/Switcher/types.js.map +0 -1
- package/build/main//321/201omponents/SyncLoader/SyncLoader.js +0 -65
- package/build/main//321/201omponents/SyncLoader/SyncLoader.js.map +0 -1
- package/build/main//321/201omponents/SyncLoader/index.js +0 -2
- package/build/main//321/201omponents/SyncLoader/index.js.map +0 -1
- package/build/main//321/201omponents/SyncLoader/types.js +0 -2
- package/build/main//321/201omponents/SyncLoader/types.js.map +0 -1
- package/build/main//321/201omponents/Textarea/Textarea.js +0 -96
- package/build/main//321/201omponents/Textarea/Textarea.js.map +0 -1
- package/build/main//321/201omponents/Textarea/index.js +0 -2
- package/build/main//321/201omponents/Textarea/index.js.map +0 -1
- package/build/main//321/201omponents/Textarea/types.js +0 -2
- package/build/main//321/201omponents/Textarea/types.js.map +0 -1
- package/build/main//321/201omponents/Toggle/Toggle.js +0 -38
- package/build/main//321/201omponents/Toggle/Toggle.js.map +0 -1
- package/build/main//321/201omponents/Toggle/index.js +0 -2
- package/build/main//321/201omponents/Toggle/index.js.map +0 -1
- package/build/main//321/201omponents/Toggle/types.js +0 -2
- package/build/main//321/201omponents/Toggle/types.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.js +0 -31
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js +0 -70
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js +0 -23
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js +0 -81
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js +0 -40
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/Option/Option.js +0 -90
- package/build/main//321/201omponents/UserDropdown/Option/Option.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js +0 -434
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/helpers.js +0 -93
- package/build/main//321/201omponents/UserDropdown/helpers.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/index.js +0 -2
- package/build/main//321/201omponents/UserDropdown/index.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/selectStyles.js +0 -75
- package/build/main//321/201omponents/UserDropdown/selectStyles.js.map +0 -1
- package/build/main//321/201omponents/UserDropdown/types.js +0 -2
- package/build/main//321/201omponents/UserDropdown/types.js.map +0 -1
- package/build/main//321/201omponents/index.d.ts +0 -33
- package/build/main//321/201omponents/index.js +0 -34
- package/build/main//321/201omponents/index.js.map +0 -1
- package/build/main//321/201omponents/types.js +0 -2
- package/build/main//321/201omponents/types.js.map +0 -1
- /package/build/main/{/321/201omponents/ActionModal/ActionModal.d.ts" → components/ActionModal/ActionModal.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ActionModal/index.d.ts" → components/ActionModal/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ActionModal/types.d.ts" → components/ActionModal/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/AttachedFile/AttachedFile.d.ts" → components/AttachedFile/AttachedFile.d.ts} +0 -0
- /package/build/main/{/321/201omponents/AttachedFile/index.d.ts" → components/AttachedFile/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/AttachedFile/types.d.ts" → components/AttachedFile/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Avatar/Avatar.d.ts" → components/Avatar/Avatar.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Avatar/index.d.ts" → components/Avatar/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Avatar/types.d.ts" → components/Avatar/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Button/Button.d.ts" → components/Button/Button.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Button/index.d.ts" → components/Button/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Button/types.d.ts" → components/Button/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CachedImage/CachedImage.d.ts" → components/CachedImage/CachedImage.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CachedImage/helpers.d.ts" → components/CachedImage/helpers.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CachedImage/index.d.ts" → components/CachedImage/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CachedImage/types.d.ts" → components/CachedImage/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Calendar/Calendar.d.ts" → components/Calendar/Calendar.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Calendar/index.d.ts" → components/Calendar/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Calendar/types.d.ts" → components/Calendar/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Charts/ChartLegend/ChartLegend.d.ts" → components/Charts/ChartLegend/ChartLegend.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Charts/colors.d.ts" → components/Charts/colors.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Charts/constants.d.ts" → components/Charts/constants.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Charts/helpers.d.ts" → components/Charts/helpers.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Charts/types.d.ts" → components/Charts/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Charts/useEvents.d.ts" → components/Charts/useEvents.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Charts/usePieEvents.d.ts" → components/Charts/usePieEvents.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Checkbox/Checkbox.d.ts" → components/Checkbox/Checkbox.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Checkbox/index.d.ts" → components/Checkbox/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Checkbox/types.d.ts" → components/Checkbox/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Chip/Chip.d.ts" → components/Chip/Chip.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Chip/index.d.ts" → components/Chip/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Chip/types.d.ts" → components/Chip/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ConfirmationModal/ConfirmationModal.d.ts" → components/ConfirmationModal/ConfirmationModal.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ConfirmationModal/index.d.ts" → components/ConfirmationModal/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ConfirmationModal/types.d.ts" → components/ConfirmationModal/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ContextMenu/ContextMenu.d.ts" → components/ContextMenu/ContextMenu.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ContextMenu/index.d.ts" → components/ContextMenu/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ContextMenu/types.d.ts" → components/ContextMenu/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CustomSelect/index.d.ts" → components/CustomSelect/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CustomSelect/selectStyles.d.ts" → components/CustomSelect/selectStyles.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CustomSelectProfiles/CustomSelectProfiles.d.ts" → components/CustomSelectProfiles/CustomSelectProfiles.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CustomSelectProfiles/index.d.ts" → components/CustomSelectProfiles/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/CustomSelectProfiles/types.d.ts" → components/CustomSelectProfiles/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/DragAndDrop/DragAndDrop.d.ts" → components/DragAndDrop/DragAndDrop.d.ts} +0 -0
- /package/build/main/{/321/201omponents/DragAndDrop/index.d.ts" → components/DragAndDrop/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/DragAndDrop/types.d.ts" → components/DragAndDrop/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Error/Error.d.ts" → components/Error/Error.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Error/index.d.ts" → components/Error/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Error/types.d.ts" → components/Error/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Flex/Flex.d.ts" → components/Flex/Flex.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Flex/HFlex/HFlex.d.ts" → components/Flex/HFlex/HFlex.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Flex/HFlex/index.d.ts" → components/Flex/HFlex/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Flex/VFlex/VFlex.d.ts" → components/Flex/VFlex/VFlex.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Flex/VFlex/index.d.ts" → components/Flex/VFlex/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Flex/index.d.ts" → components/Flex/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Flex/types.d.ts" → components/Flex/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Header/Header.d.ts" → components/Header/Header.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Header/index.d.ts" → components/Header/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Header/types.d.ts" → components/Header/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Input/Input.d.ts" → components/Input/Input.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Input/index.d.ts" → components/Input/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Input/types.d.ts" → components/Input/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ListItem/ListItem.d.ts" → components/ListItem/ListItem.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ListItem/index.d.ts" → components/ListItem/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Loader/index.d.ts" → components/Loader/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Modal/index.d.ts" → components/Modal/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Notification/Notification.d.ts" → components/Notification/Notification.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Notification/index.d.ts" → components/Notification/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Notification/types.d.ts" → components/Notification/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Profile/Profile.d.ts" → components/Profile/Profile.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Profile/index.d.ts" → components/Profile/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Profile/types.d.ts" → components/Profile/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ProgressBar/ProgressBar.d.ts" → components/ProgressBar/ProgressBar.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ProgressBar/index.d.ts" → components/ProgressBar/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ProgressBar/types.d.ts" → components/ProgressBar/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/RadioButton/RadioButton.d.ts" → components/RadioButton/RadioButton.d.ts} +0 -0
- /package/build/main/{/321/201omponents/RadioButton/index.d.ts" → components/RadioButton/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/RadioButton/types.d.ts" → components/RadioButton/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/ScrollBar/index.d.ts" → components/ScrollBar/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Skeleton/types.d.ts" → components/Skeleton/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Stories/Stories.d.ts" → components/Stories/Stories.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Stories/index.d.ts" → components/Stories/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Stories/types.d.ts" → components/Stories/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Switcher/Switcher.d.ts" → components/Switcher/Switcher.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Switcher/index.d.ts" → components/Switcher/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Switcher/types.d.ts" → components/Switcher/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/SyncLoader/SyncLoader.d.ts" → components/SyncLoader/SyncLoader.d.ts} +0 -0
- /package/build/main/{/321/201omponents/SyncLoader/index.d.ts" → components/SyncLoader/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/SyncLoader/types.d.ts" → components/SyncLoader/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Textarea/Textarea.d.ts" → components/Textarea/Textarea.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Textarea/index.d.ts" → components/Textarea/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Textarea/types.d.ts" → components/Textarea/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Toggle/Toggle.d.ts" → components/Toggle/Toggle.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Toggle/index.d.ts" → components/Toggle/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/Toggle/types.d.ts" → components/Toggle/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.d.ts" → components/UserDropdown/ContactBottomSheet/ContactBottomSheet.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/ContactInfo/ContactInfo.d.ts" → components/UserDropdown/ContactInfo/ContactInfo.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.d.ts" → components/UserDropdown/LoadingMessage/LoadingMessage.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/MenuList/MenuList.d.ts" → components/UserDropdown/MenuList/MenuList.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.d.ts" → components/UserDropdown/MultiValueLabel/MultiValueLabel.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/Option/Option.d.ts" → components/UserDropdown/Option/Option.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/UserDropdown.d.ts" → components/UserDropdown/UserDropdown.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/index.d.ts" → components/UserDropdown/index.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/selectStyles.d.ts" → components/UserDropdown/selectStyles.d.ts} +0 -0
- /package/build/main/{/321/201omponents/UserDropdown/types.d.ts" → components/UserDropdown/types.d.ts} +0 -0
- /package/build/main/{/321/201omponents/types.d.ts" → components/types.d.ts} +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useEffect, useRef, useState } from 'react';
|
|
14
|
-
import Popup from 'reactjs-popup';
|
|
15
|
-
import classNames from 'classnames';
|
|
16
|
-
import Button from '../Button';
|
|
17
|
-
import Input from '../Input';
|
|
18
|
-
import { checkIfContentIsCentered, generateClassNames, generateColor, generateIsCloseIconHidden } from '../../helpers';
|
|
19
|
-
import { PLATFORM } from '../../constants';
|
|
20
|
-
import { ReactComponent as CloseIcon } from '../../assets/icons/cancel-cross.svg';
|
|
21
|
-
import '../../styles/styles.scss';
|
|
22
|
-
var ActionModal = function (_a) {
|
|
23
|
-
var isModalOpen = _a.isModalOpen, _b = _a.isClosableOutside, isClosableOutside = _b === void 0 ? true : _b, isCloseIconHidden = _a.isCloseIconHidden, title = _a.title, buttonName = _a.buttonName, confirmButtonFunction = _a.confirmButtonFunction, cancelButtonFunction = _a.cancelButtonFunction, _c = _a.platform, platform = _c === void 0 ? PLATFORM.web : _c, placeholder = _a.placeholder, _d = _a.defaultValue, defaultValue = _d === void 0 ? '' : _d, isWaitingResponse = _a.isWaitingResponse, isButtonDisabled = _a.isButtonDisabled, popupClassName = _a.popupClassName, className = _a.className, popupStyles = _a.popupStyles, styles = _a.styles, titleStyles = _a.titleStyles, iconColor = _a.iconColor, _e = _a.buttonWidth, buttonWidth = _e === void 0 ? 100 : _e, backgroundColor = _a.backgroundColor, inputFillType = _a.inputFillType;
|
|
24
|
-
var isCloseIconInvisible = generateIsCloseIconHidden(platform, isCloseIconHidden);
|
|
25
|
-
var ref = useRef(null);
|
|
26
|
-
var titleRef = useRef(null);
|
|
27
|
-
var _f = useState(defaultValue), value = _f[0], setValue = _f[1];
|
|
28
|
-
var handleConfirmClick = function () {
|
|
29
|
-
confirmButtonFunction(value);
|
|
30
|
-
setValue('');
|
|
31
|
-
};
|
|
32
|
-
var handleCloseModal = function () {
|
|
33
|
-
setValue('');
|
|
34
|
-
cancelButtonFunction();
|
|
35
|
-
};
|
|
36
|
-
var handleChange = function (value) { return setValue(value); };
|
|
37
|
-
useEffect(function () {
|
|
38
|
-
document.documentElement.style.setProperty('--action-modal-background', generateColor(backgroundColor));
|
|
39
|
-
}, [backgroundColor]);
|
|
40
|
-
useEffect(function () {
|
|
41
|
-
var checkIfClickedOutside = function (e) {
|
|
42
|
-
if (isModalOpen && isClosableOutside && ref.current && !ref.current.contains(e.target) && !value.length) {
|
|
43
|
-
handleCloseModal();
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
document === null || document === void 0 ? void 0 : document.addEventListener('click', checkIfClickedOutside, true);
|
|
47
|
-
return function () {
|
|
48
|
-
document === null || document === void 0 ? void 0 : document.removeEventListener('click', checkIfClickedOutside, true);
|
|
49
|
-
};
|
|
50
|
-
// eslint-disable-next-line
|
|
51
|
-
}, [isModalOpen, isClosableOutside, cancelButtonFunction, value]);
|
|
52
|
-
return (_jsx(Popup, __assign({ className: classNames('action-modal', popupClassName), overlayStyle: popupStyles, closeOnDocumentClick: isClosableOutside, modal: true, open: isModalOpen, closeOnEscape: isClosableOutside, onClose: handleCloseModal }, { children: _jsx("div", __assign({ ref: ref, className: classNames('smartapp-action-modal', className), style: styles }, { children: _jsxs("div", __assign({ className: "smartapp-action-modal__content" }, { children: [_jsxs("div", { children: [!isCloseIconInvisible && (_jsx("div", { className: classNames('close-icon-space', { 'close-icon-space__centered': checkIfContentIsCentered(titleRef) }) })), _jsx("p", __assign({ ref: titleRef, className: generateClassNames({ className: 'smartapp-action-modal__content--title', delimiter: '__', additionalClassName: platform }), style: titleStyles }, { children: title }))] }), !isCloseIconInvisible && (_jsx("div", __assign({ onClick: handleCloseModal, className: "smartapp-action-modal__content--cancel-cross" }, { children: _jsx(CloseIcon, { style: { color: generateColor(iconColor) } }) }))), _jsx("div", __assign({ className: "smartapp-action-modal__content--input" }, { children: _jsx(Input, { defaultValue: value, placeholder: placeholder, fillType: inputFillType, disabled: isWaitingResponse, onChange: handleChange }) })), _jsx("div", __assign({ className: "smartapp-action-modal__content--buttons" }, { children: _jsx(Button, { width: buttonWidth, isWaitingResponse: isWaitingResponse, disabled: isButtonDisabled, title: buttonName, onClick: handleConfirmClick }) }))] })) })) })));
|
|
53
|
-
};
|
|
54
|
-
export default ActionModal;
|
|
55
|
-
//# sourceMappingURL=ActionModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionModal.js","sourceRoot":"","sources":["../../../../src/сomponents/ActionModal/ActionModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,KAAK,MAAM,eAAe,CAAA;AACjC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AACtH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAA;AACjF,OAAO,0BAA0B,CAAA;AAEjC,IAAM,WAAW,GAAG,UAAC,EAsBD;QArBlB,WAAW,iBAAA,EACX,yBAAwB,EAAxB,iBAAiB,mBAAG,IAAI,KAAA,EACxB,iBAAiB,uBAAA,EACjB,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,qBAAqB,2BAAA,EACrB,oBAAoB,0BAAA,EACpB,gBAAuB,EAAvB,QAAQ,mBAAG,QAAQ,CAAC,GAAG,KAAA,EACvB,WAAW,iBAAA,EACX,oBAAiB,EAAjB,YAAY,mBAAG,EAAE,KAAA,EACjB,iBAAiB,uBAA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AAK,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,GAAI,IACrD,CACP,EACD,uBAAK,SAAS,EAAC,uCAAuC,gBACpD,KAAC,KAAK,IAAC,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,GAAI,IAClI,EACN,uBAAK,SAAS,EAAC,yCAAyC,gBACtD,KAAC,MAAM,IACL,KAAK,EAAE,WAAW,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,kBAAkB,GAC3B,IACE,KACF,IACF,IACA,CACT,CAAA;AACH,CAAC,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/ActionModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/ActionModal/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import classNames from 'classnames';
|
|
14
|
-
import { ReactComponent as FileIcon } from '../../assets/icons/file.svg';
|
|
15
|
-
import { ReactComponent as RemoveIcon } from '../../assets/icons/close.svg';
|
|
16
|
-
import { ReactComponent as DownloadIcon } from '../../assets/icons/download.svg';
|
|
17
|
-
import { ReactComponent as LoaderIcon } from '../../assets/icons/attachment-loader.svg';
|
|
18
|
-
import { generateColor, generateDefaultGrayColorForIcon } from '../../helpers';
|
|
19
|
-
import { COLORS, THEME } from '../../constants';
|
|
20
|
-
import '../../styles/styles.scss';
|
|
21
|
-
export var DISPLAY_SIZE;
|
|
22
|
-
(function (DISPLAY_SIZE) {
|
|
23
|
-
DISPLAY_SIZE["small"] = "small";
|
|
24
|
-
DISPLAY_SIZE["normal"] = "normal";
|
|
25
|
-
})(DISPLAY_SIZE || (DISPLAY_SIZE = {}));
|
|
26
|
-
var AttachedFile = function (_a) {
|
|
27
|
-
var _b = _a.theme, theme = _b === void 0 ? THEME.default : _b, fileName = _a.fileName, weight = _a.weight, weightType = _a.weightType, _c = _a.isIconEnclosedWithinBorders, isIconEnclosedWithinBorders = _c === void 0 ? false : _c, _d = _a.isSpaceBetween, isSpaceBetween = _d === void 0 ? false : _d, _e = _a.isRemovable, isRemovable = _e === void 0 ? false : _e, _f = _a.isDownloadable, isDownloadable = _f === void 0 ? false : _f, _g = _a.isDisabled, isDisabled = _g === void 0 ? false : _g, _h = _a.isLoading, isLoading = _h === void 0 ? false : _h, _j = _a.width, width = _j === void 0 ? 100 : _j, _k = _a.displaySize, displaySize = _k === void 0 ? DISPLAY_SIZE.normal : _k, className = _a.className, styles = _a.styles, fileColor = _a.fileColor, downloadColor = _a.downloadColor, removeColor = _a.removeColor, fileIcon = _a.fileIcon, onClick = _a.onClick, onRemove = _a.onRemove, onDownload = _a.onDownload;
|
|
28
|
-
var handleAttachmentClick = function () { return !isLoading && !isDisabled && onClick && onClick(fileName); };
|
|
29
|
-
var handleAttachmentRemove = function (event) {
|
|
30
|
-
if (onRemove) {
|
|
31
|
-
event.stopPropagation();
|
|
32
|
-
onRemove(fileName);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var handleAttachmentDownload = function (event) {
|
|
36
|
-
if (!isLoading && !isDisabled && onDownload) {
|
|
37
|
-
event.stopPropagation();
|
|
38
|
-
onDownload(fileName);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
return (_jsxs("div", __assign({ style: __assign({ width: "".concat(width, "%") }, styles), className: classNames('smartapp-attached-file', "smartapp-attached-file__".concat(theme), {
|
|
42
|
-
'smartapp-attached-file__clickable': onClick,
|
|
43
|
-
'smartapp-attached-file__disabled': isDisabled,
|
|
44
|
-
'smartapp-attached-file__loading': isLoading,
|
|
45
|
-
}, className), onClick: handleAttachmentClick }, { children: [_jsxs("div", __assign({ className: classNames('smartapp-attached-file__icon', "smartapp-attached-file__icon--".concat(displaySize), {
|
|
46
|
-
'smartapp-attached-file__icon--bordered': isIconEnclosedWithinBorders,
|
|
47
|
-
'smartapp-attached-file__icon--disabled': isDisabled,
|
|
48
|
-
'smartapp-attached-file__icon--loading': isLoading && !isIconEnclosedWithinBorders,
|
|
49
|
-
}) }, { children: [fileIcon || _jsx(FileIcon, { style: { color: generateColor(fileColor, generateDefaultGrayColorForIcon(theme)) } }), isLoading && (_jsx("div", __assign({ className: classNames('smartapp-attached-file__icon--loader', "smartapp-attached-file__icon--loader__".concat(displaySize)) }, { children: _jsx(LoaderIcon, {}) })))] })), _jsxs("div", __assign({ className: classNames('smartapp-attached-file__value', { 'justify-space-between': isSpaceBetween }) }, { children: [_jsxs("div", __assign({ className: classNames('smartapp-attached-file__value--info', {
|
|
50
|
-
'smartapp-attached-file__value--info__paddings': isIconEnclosedWithinBorders && displaySize === DISPLAY_SIZE.normal,
|
|
51
|
-
}) }, { children: [_jsx("p", __assign({ className: classNames('smartapp-attached-file__value--info__name', "smartapp-attached-file__value--info__name--".concat(displaySize), {
|
|
52
|
-
'smartapp-attached-file__value--info__name--disabled': isDisabled,
|
|
53
|
-
'smartapp-attached-file__value--info__name--loading': isLoading,
|
|
54
|
-
}) }, { children: fileName })), _jsx("p", __assign({ className: "smartapp-attached-file__value--info__weight" }, { children: "".concat(weight, " ").concat(weightType) }))] })), _jsxs("div", __assign({ className: "smartapp-attached-file__value--icons" }, { children: [isRemovable && (_jsx("div", __assign({ onClick: handleAttachmentRemove, className: "smartapp-attached-file__value--icons__close" }, { children: _jsx(RemoveIcon, { style: { color: generateColor(removeColor, generateDefaultGrayColorForIcon(theme)) } }) }))), isDownloadable && (_jsx("div", __assign({ onClick: handleAttachmentDownload, className: classNames('smartapp-attached-file__value--icons__download', {
|
|
55
|
-
'smartapp-attached-file__value--icons__download--disabled': isDisabled,
|
|
56
|
-
'smartapp-attached-file__value--icons__download--loading': isLoading,
|
|
57
|
-
}) }, { children: _jsx(DownloadIcon, { style: { color: generateColor(downloadColor, COLORS.blue) } }) })))] }))] }))] }), weight));
|
|
58
|
-
};
|
|
59
|
-
export default AttachedFile;
|
|
60
|
-
//# sourceMappingURL=AttachedFile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachedFile.js","sourceRoot":"","sources":["../../../../src/сomponents/AttachedFile/AttachedFile.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,EAAE,cAAc,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAChF,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,0CAA0C,CAAA;AACvF,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAE/C,OAAO,0BAA0B,CAAA;AAEjC,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB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AAE,IAAK,KACtF,EACN,wBAAK,SAAS,EAAC,sCAAsC,iBAClD,WAAW,IAAI,CACd,uBAAK,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAC,6CAA6C,gBAC3F,KAAC,UAAU,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,WAAW,EAAE,+BAA+B,CAAC,KAAK,CAAC,CAAC,EAAE,GAAI,IAChG,CACP,EACA,cAAc,IAAI,CACjB,uBACE,OAAO,EAAE,wBAAwB,EACjC,SAAS,EAAE,UAAU,CAAC,gDAAgD,EAAE;oCACtE,0DAA0D,EAAE,UAAU;oCACtE,yDAAyD,EAAE,SAAS;iCACrE,CAAC,gBAEF,KAAC,YAAY,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,GAAI,IACzE,CACP,KACG,KACF,MA9DD,MAAM,CA+DP,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/AttachedFile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/AttachedFile/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import classNames from 'classnames';
|
|
14
|
-
import { calculatePercentageOfValue, createInitials, isDarkTheme, userNameToColor } from '../../helpers';
|
|
15
|
-
import { AvatarFontSizes } from './types';
|
|
16
|
-
import { COLORS, MAX_NUMBER_OF_CHARACTERS_IN_INITIALS, THEME } from '../../constants';
|
|
17
|
-
import { ReactComponent as TickIcon } from '../../assets/icons/tick.svg';
|
|
18
|
-
import { ReactComponent as InfoIcon } from '../../assets/icons/info.svg';
|
|
19
|
-
import { ReactComponent as CrownIcon } from '../../assets/icons/crown.svg';
|
|
20
|
-
import { ReactComponent as PrivateIcon } from '../../assets/icons/private.svg';
|
|
21
|
-
import '../../styles/styles.scss';
|
|
22
|
-
var PERCENTS;
|
|
23
|
-
(function (PERCENTS) {
|
|
24
|
-
PERCENTS[PERCENTS["pct_5"] = 5] = "pct_5";
|
|
25
|
-
PERCENTS[PERCENTS["pct_8"] = 8] = "pct_8";
|
|
26
|
-
PERCENTS[PERCENTS["pct_10"] = 10] = "pct_10";
|
|
27
|
-
PERCENTS[PERCENTS["pct_15"] = 15] = "pct_15";
|
|
28
|
-
PERCENTS[PERCENTS["pct_25"] = 25] = "pct_25";
|
|
29
|
-
PERCENTS[PERCENTS["pct_40"] = 40] = "pct_40";
|
|
30
|
-
PERCENTS[PERCENTS["pct_50"] = 50] = "pct_50";
|
|
31
|
-
PERCENTS[PERCENTS["pct_57"] = 57] = "pct_57";
|
|
32
|
-
PERCENTS[PERCENTS["pct_60"] = 60] = "pct_60";
|
|
33
|
-
PERCENTS[PERCENTS["pct_62_5"] = 62.5] = "pct_62_5";
|
|
34
|
-
PERCENTS[PERCENTS["pct_65"] = 65] = "pct_65";
|
|
35
|
-
PERCENTS[PERCENTS["pct_75"] = 75] = "pct_75";
|
|
36
|
-
})(PERCENTS || (PERCENTS = {}));
|
|
37
|
-
var AVATAR_OPACITY = 0.5;
|
|
38
|
-
var USER_INITIALS_OPACITY = 0.3;
|
|
39
|
-
var Avatar = function (_a) {
|
|
40
|
-
var _b = _a.theme, theme = _b === void 0 ? THEME.default : _b, className = _a.className, styles = _a.styles, avatarRef = _a.avatarRef, isSelected = _a.isSelected, isHighlighted = _a.isHighlighted, isInactive = _a.isInactive, isSpam = _a.isSpam, isCrown = _a.isCrown, isEye = _a.isEye, _c = _a.size, size = _c === void 0 ? 44 : _c, _d = _a.username, username = _d === void 0 ? '' : _d, initials = _a.initials, avatar = _a.avatar, _e = _a.counter, counter = _e === void 0 ? 0 : _e, icon = _a.icon, _f = _a.outlineDefaultBackground, outlineDefaultBackground = _f === void 0 ? COLORS.white : _f, _g = _a.outlineDarkBackground, outlineDarkBackground = _g === void 0 ? COLORS.brightBlack : _g, _h = _a.onClick, onClick = _h === void 0 ? function () { return undefined; } : _h, onMouseDown = _a.onMouseDown;
|
|
41
|
-
var inactiveOpacity = avatar ? AVATAR_OPACITY : USER_INITIALS_OPACITY;
|
|
42
|
-
var outlineBackground = isDarkTheme(theme) ? outlineDarkBackground : outlineDefaultBackground;
|
|
43
|
-
var outlineWidth = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_5, shouldBeRounded: false });
|
|
44
|
-
var generateFontSizeAvatar = function () {
|
|
45
|
-
switch (size) {
|
|
46
|
-
case 20:
|
|
47
|
-
case 24: {
|
|
48
|
-
return AvatarFontSizes.lowest;
|
|
49
|
-
}
|
|
50
|
-
case 32:
|
|
51
|
-
case 40: {
|
|
52
|
-
return AvatarFontSizes.small;
|
|
53
|
-
}
|
|
54
|
-
case 44:
|
|
55
|
-
case 48: {
|
|
56
|
-
return AvatarFontSizes.average;
|
|
57
|
-
}
|
|
58
|
-
case 56: {
|
|
59
|
-
return AvatarFontSizes.high;
|
|
60
|
-
}
|
|
61
|
-
case 100: {
|
|
62
|
-
return AvatarFontSizes.greatest;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var renderUserInitials = function () { return (initials === null || initials === void 0 ? void 0 : initials.slice(0, MAX_NUMBER_OF_CHARACTERS_IN_INITIALS).toUpperCase()) || createInitials(username); };
|
|
67
|
-
var renderContent = function () {
|
|
68
|
-
if (isSelected) {
|
|
69
|
-
var tickSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_57 });
|
|
70
|
-
return _jsx(TickIcon, { width: tickSize, height: tickSize });
|
|
71
|
-
}
|
|
72
|
-
if (isSpam) {
|
|
73
|
-
var infoSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_60 });
|
|
74
|
-
return _jsx(InfoIcon, { width: infoSize, height: infoSize });
|
|
75
|
-
}
|
|
76
|
-
if (icon) {
|
|
77
|
-
var iconSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_62_5 });
|
|
78
|
-
var iconSizeInPx = "".concat(iconSize, "px");
|
|
79
|
-
return (_jsx("div", __assign({ className: "smartapp-avatar__content--icon", style: { width: iconSizeInPx, height: iconSizeInPx } }, { children: icon })));
|
|
80
|
-
}
|
|
81
|
-
return avatar ? _jsx("img", { src: avatar, alt: "avatar" }) : renderUserInitials();
|
|
82
|
-
};
|
|
83
|
-
var renderCounter = function () {
|
|
84
|
-
var isSingleDigitNumber = counter <= 9;
|
|
85
|
-
var counterText = isSingleDigitNumber ? counter : '9+';
|
|
86
|
-
var width = calculatePercentageOfValue({ value: size, percentage: isSingleDigitNumber ? PERCENTS.pct_40 : PERCENTS.pct_50 });
|
|
87
|
-
var height = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_40 });
|
|
88
|
-
var fontSize = calculatePercentageOfValue({ value: height, percentage: PERCENTS.pct_75 });
|
|
89
|
-
var top = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_10 });
|
|
90
|
-
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_15 });
|
|
91
|
-
var borderWidth = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_5, shouldBeRounded: false });
|
|
92
|
-
var borderRadius = isSingleDigitNumber ? '50%' : "".concat(height * 1.5625, "px");
|
|
93
|
-
return (_jsx("div", __assign({ className: "smartapp-avatar__content--counter", style: {
|
|
94
|
-
width: "".concat(width, "px"),
|
|
95
|
-
height: "".concat(height, "px"),
|
|
96
|
-
top: "-".concat(top, "px"),
|
|
97
|
-
right: "-".concat(right, "px"),
|
|
98
|
-
fontSize: "".concat(fontSize, "px"),
|
|
99
|
-
border: "".concat(borderWidth, "px solid ").concat(outlineBackground),
|
|
100
|
-
borderRadius: borderRadius,
|
|
101
|
-
} }, { children: counterText })));
|
|
102
|
-
};
|
|
103
|
-
var renderEye = function () {
|
|
104
|
-
var top = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_8 });
|
|
105
|
-
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_25 });
|
|
106
|
-
var eyeSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_65 });
|
|
107
|
-
return (_jsx(PrivateIcon, { className: "smartapp-avatar__content--eye", width: eyeSize, height: eyeSize, color: outlineBackground, style: { top: "-".concat(top, "px"), right: "-".concat(right, "px") } }));
|
|
108
|
-
};
|
|
109
|
-
var renderCrown = function () {
|
|
110
|
-
var bottom = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_10 });
|
|
111
|
-
var right = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_15 });
|
|
112
|
-
var crownSize = calculatePercentageOfValue({ value: size, percentage: PERCENTS.pct_50 });
|
|
113
|
-
return (_jsx(CrownIcon, { className: "smartapp-avatar__content--crown", width: crownSize, height: crownSize, color: outlineBackground, style: { bottom: "-".concat(bottom, "px"), right: "-".concat(right, "px") } }));
|
|
114
|
-
};
|
|
115
|
-
var generateAvatarContentStyles = function () { return ({
|
|
116
|
-
width: "".concat(size, "px"),
|
|
117
|
-
minWidth: "".concat(size, "px"),
|
|
118
|
-
height: "".concat(size, "px"),
|
|
119
|
-
fontSize: generateFontSizeAvatar(),
|
|
120
|
-
background: isInactive
|
|
121
|
-
? "linear-gradient(180deg, ".concat(COLORS.inactiveAvatarGradientStart, " 0%, ").concat(COLORS.inactiveAvatarGradientEnd, " 100%)")
|
|
122
|
-
: userNameToColor(initials || username),
|
|
123
|
-
opacity: isInactive ? inactiveOpacity : 1,
|
|
124
|
-
}); };
|
|
125
|
-
return (_jsx("div", __assign({ ref: avatarRef, className: classNames('smartapp-avatar', "smartapp-avatar__".concat(theme), { 'smartapp-avatar__outline': isHighlighted }, className), style: __assign({ '--avatar-outline-width': "".concat(outlineWidth, "px") }, styles), onClick: onClick, onMouseDown: onMouseDown }, { children: _jsxs("div", __assign({ style: generateAvatarContentStyles(), className: classNames('smartapp-avatar__content', {
|
|
126
|
-
'smartapp-avatar__content--spam': isSpam,
|
|
127
|
-
'smartapp-avatar__content--inactive': isInactive,
|
|
128
|
-
}) }, { children: [!!counter && renderCounter(), isEye && renderEye(), renderContent(), isCrown && renderCrown()] })) })));
|
|
129
|
-
};
|
|
130
|
-
export default Avatar;
|
|
131
|
-
//# sourceMappingURL=Avatar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../../src/сomponents/Avatar/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACxG,OAAO,EAAE,eAAe,EAAgB,MAAM,SAAS,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,oCAAoC,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACrF,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,cAAc,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,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AQ,IAAI,QAAQ,CAAC;QACzC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;KAC1C,CAAC,EATwC,CASxC,CAAA;IAEF,OAAO,CACL,uBACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,2BAAoB,KAAK,CAAE,EAAE,EAAE,0BAA0B,EAAE,aAAa,EAAE,EAAE,SAAS,CAAC,EAC/H,KAAK,EAAE,WAAE,wBAAwB,EAAE,UAAG,YAAY,OAAI,IAAK,MAAM,CAAyB,EAC1F,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,gBAExB,wBACE,KAAK,EAAE,2BAA2B,EAAE,EACpC,SAAS,EAAE,UAAU,CAAC,0BAA0B,EAAE;gBAChD,gCAAgC,EAAE,MAAM;gBACxC,oCAAoC,EAAE,UAAU;aACjD,CAAC,iBAED,CAAC,CAAC,OAAO,IAAI,aAAa,EAAE,EAC5B,KAAK,IAAI,SAAS,EAAE,EACpB,aAAa,EAAE,EACf,OAAO,IAAI,WAAW,EAAE,KACrB,IACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/Avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export var AvatarFontSizes;
|
|
2
|
-
(function (AvatarFontSizes) {
|
|
3
|
-
AvatarFontSizes["lowest"] = "12px";
|
|
4
|
-
AvatarFontSizes["small"] = "14px";
|
|
5
|
-
AvatarFontSizes["average"] = "18px";
|
|
6
|
-
AvatarFontSizes["high"] = "24px";
|
|
7
|
-
AvatarFontSizes["greatest"] = "42px";
|
|
8
|
-
})(AvatarFontSizes || (AvatarFontSizes = {}));
|
|
9
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/Avatar/types.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,iCAAc,CAAA;IACd,mCAAgB,CAAA;IAChB,gCAAa,CAAA;IACb,oCAAiB,CAAA;AACnB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { useEffect, useRef } from 'react';
|
|
25
|
-
import classNames from 'classnames';
|
|
26
|
-
import { isNil } from 'lodash';
|
|
27
|
-
import { ReactComponent as LoaderIcon } from '../../assets/icons/button-loader.svg';
|
|
28
|
-
import { TButtonVariant, TButtonAppearance } from './types';
|
|
29
|
-
import '../../styles/styles.scss';
|
|
30
|
-
var Button = function (_a) {
|
|
31
|
-
var title = _a.title, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.isDisabledClickable, isDisabledClickable = _c === void 0 ? false : _c, _d = _a.isWaitingResponse, isWaitingResponse = _d === void 0 ? false : _d, _e = _a.variant, variant = _e === void 0 ? TButtonVariant.primary : _e, _f = _a.appearance, appearance = _f === void 0 ? TButtonAppearance.accent : _f, icon = _a.icon, _g = _a.width, width = _g === void 0 ? 100 : _g, className = _a.className, styles = _a.styles, onClick = _a.onClick, props = __rest(_a, ["title", "disabled", "isDisabledClickable", "isWaitingResponse", "variant", "appearance", "icon", "width", "className", "styles", "onClick"]);
|
|
32
|
-
var buttonTitleRef = useRef(null);
|
|
33
|
-
var buttonTitleRefCurrent = buttonTitleRef.current;
|
|
34
|
-
var changeTransitionDelay = function (transitionDelay) {
|
|
35
|
-
return buttonTitleRefCurrent && (buttonTitleRefCurrent.style.transitionDelay = "".concat(transitionDelay, "ms"));
|
|
36
|
-
};
|
|
37
|
-
var handleButtonClick = function (event) { return (!disabled || (disabled && isDisabledClickable)) && (onClick === null || onClick === void 0 ? void 0 : onClick(event)); };
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
if (isWaitingResponse) {
|
|
40
|
-
buttonTitleRefCurrent === null || buttonTitleRefCurrent === void 0 ? void 0 : buttonTitleRefCurrent.classList.add('smartapp-button__title--hidden');
|
|
41
|
-
setTimeout(function () { return changeTransitionDelay(300); }, 150);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
buttonTitleRefCurrent === null || buttonTitleRefCurrent === void 0 ? void 0 : buttonTitleRefCurrent.classList.remove('smartapp-button__title--hidden');
|
|
45
|
-
setTimeout(function () { return changeTransitionDelay(0); }, 150);
|
|
46
|
-
}
|
|
47
|
-
// eslint-disable-next-line
|
|
48
|
-
}, [isWaitingResponse]);
|
|
49
|
-
return (_jsxs("div", __assign({ className: classNames('smartapp-button', "smartapp-button__".concat(appearance), className), style: { width: "".concat(width, "%") } }, { children: [_jsxs("button", __assign({ className: classNames("smartapp-button__".concat(variant), "smartapp-button__".concat(variant, "--").concat(appearance), {
|
|
50
|
-
'smartapp-button__disabled': disabled,
|
|
51
|
-
'smartapp-button__with-icon': !isNil(icon),
|
|
52
|
-
}), style: styles, disabled: disabled && !isDisabledClickable, onClick: handleButtonClick }, props, { children: [icon && _jsx("div", { children: icon }), _jsx("span", __assign({ ref: buttonTitleRef, className: "smartapp-button__title" }, { children: title }))] })), _jsx("div", __assign({ className: classNames('smartapp-button__loader', "smartapp-button__loader--".concat(variant), {
|
|
53
|
-
'smartapp-button__loader--hidden': !isWaitingResponse,
|
|
54
|
-
}) }, { children: _jsx(LoaderIcon, {}) }))] })));
|
|
55
|
-
};
|
|
56
|
-
export default Button;
|
|
57
|
-
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAAO,EAAgB,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,0BAA0B,CAAA;AAEjC,IAAM,MAAM,GAAG,UAAC,EAaD;IAZb,IAAA,KAAK,WAAA,EACL,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,2BAA2B,EAA3B,mBAAmB,mBAAG,KAAK,KAAA,EAC3B,yBAAyB,EAAzB,iBAAiB,mBAAG,KAAK,KA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AEvB,OAAO,CACL,wBAAK,SAAS,EAAE,UAAU,CAAC,iBAAiB,EAAE,2BAAoB,UAAU,CAAE,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAG,KAAK,MAAG,EAAE,iBACvH,2BACE,SAAS,EAAE,UAAU,CAAC,2BAAoB,OAAO,CAAE,EAAE,2BAAoB,OAAO,eAAK,UAAU,CAAE,EAAE;oBACjG,2BAA2B,EAAE,QAAQ;oBACrC,4BAA4B,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;iBAC3C,CAAC,EACF,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,IAAI,CAAC,mBAAmB,EAC1C,OAAO,EAAE,iBAAiB,IACtB,KAAK,eAER,IAAI,IAAI,wBAAM,IAAI,GAAO,EAC1B,wBAAM,GAAG,EAAE,cAAc,EAAE,SAAS,EAAC,wBAAwB,gBAC1D,KAAK,IACD,KACA,EACT,uBACE,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,mCAA4B,OAAO,CAAE,EAAE;oBACtF,iCAAiC,EAAE,CAAC,iBAAiB;iBACtD,CAAC,gBAEF,KAAC,UAAU,KAAG,IACV,KACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export var TButtonVariant;
|
|
2
|
-
(function (TButtonVariant) {
|
|
3
|
-
TButtonVariant["primary"] = "primary";
|
|
4
|
-
TButtonVariant["secondary"] = "secondary";
|
|
5
|
-
})(TButtonVariant || (TButtonVariant = {}));
|
|
6
|
-
export var TButtonAppearance;
|
|
7
|
-
(function (TButtonAppearance) {
|
|
8
|
-
TButtonAppearance["accent"] = "accent";
|
|
9
|
-
TButtonAppearance["negative"] = "negative";
|
|
10
|
-
})(TButtonAppearance || (TButtonAppearance = {}));
|
|
11
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/Button/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,yCAAuB,CAAA;AACzB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;AACvB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { useEffect, useLayoutEffect, useState } from 'react';
|
|
14
|
-
import classNames from 'classnames';
|
|
15
|
-
import { isBlobUrl, tryToLoadImageFromCache, tryToSaveImageToCache } from './helpers';
|
|
16
|
-
import '../../styles/styles.scss';
|
|
17
|
-
var IMAGE_LOADING_STATE;
|
|
18
|
-
(function (IMAGE_LOADING_STATE) {
|
|
19
|
-
IMAGE_LOADING_STATE[IMAGE_LOADING_STATE["pending"] = 0] = "pending";
|
|
20
|
-
IMAGE_LOADING_STATE[IMAGE_LOADING_STATE["success"] = 1] = "success";
|
|
21
|
-
IMAGE_LOADING_STATE[IMAGE_LOADING_STATE["error"] = -1] = "error";
|
|
22
|
-
})(IMAGE_LOADING_STATE || (IMAGE_LOADING_STATE = {}));
|
|
23
|
-
var CachedImage = function (_a) {
|
|
24
|
-
var src = _a.src, alt = _a.alt, className = _a.className, styles = _a.styles, width = _a.width, height = _a.height, borderRadius = _a.borderRadius;
|
|
25
|
-
var _b = useState(''), url = _b[0], setUrl = _b[1];
|
|
26
|
-
var _c = useState(IMAGE_LOADING_STATE.pending), loadingState = _c[0], setLoadingState = _c[1];
|
|
27
|
-
useLayoutEffect(function () {
|
|
28
|
-
setUrl(src);
|
|
29
|
-
}, [src]);
|
|
30
|
-
// Очистка URL объекта после ошибки загрузки изображения
|
|
31
|
-
useEffect(function () {
|
|
32
|
-
if (loadingState === IMAGE_LOADING_STATE.error && isBlobUrl(url))
|
|
33
|
-
URL.revokeObjectURL(url);
|
|
34
|
-
return function () { return void 0; };
|
|
35
|
-
}, [loadingState, url]);
|
|
36
|
-
var isImageLoadingStatePending = function () { return loadingState === IMAGE_LOADING_STATE.pending; };
|
|
37
|
-
// Обработчик успешной загрузки изображения
|
|
38
|
-
var handleOnLoad = function () {
|
|
39
|
-
if (!isImageLoadingStatePending())
|
|
40
|
-
return;
|
|
41
|
-
setLoadingState(IMAGE_LOADING_STATE.success);
|
|
42
|
-
tryToSaveImageToCache(src);
|
|
43
|
-
};
|
|
44
|
-
// Обработчик ошибки загрузки изображения
|
|
45
|
-
var handleOnError = function () {
|
|
46
|
-
if (!isImageLoadingStatePending())
|
|
47
|
-
return;
|
|
48
|
-
setLoadingState(IMAGE_LOADING_STATE.error);
|
|
49
|
-
tryToLoadImageFromCache(src).then(function (blobUrl) { return blobUrl && setUrl(blobUrl); });
|
|
50
|
-
};
|
|
51
|
-
var generateImageStyles = function () {
|
|
52
|
-
var widthValue = width ? "".concat(width, "px") : '100%';
|
|
53
|
-
var heightValue = height ? "".concat(height, "px") : '100%';
|
|
54
|
-
return __assign({ minWidth: widthValue, minHeight: heightValue, width: widthValue, height: heightValue, borderRadius: "".concat(borderRadius, "px") }, styles);
|
|
55
|
-
};
|
|
56
|
-
return (_jsx("img", { className: classNames('smartapp-cached-image', className), style: generateImageStyles(), src: url, alt: alt, onLoad: handleOnLoad, onError: handleOnError }));
|
|
57
|
-
};
|
|
58
|
-
export default CachedImage;
|
|
59
|
-
//# sourceMappingURL=CachedImage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CachedImage.js","sourceRoot":"","sources":["../../../../src/сomponents/CachedImage/CachedImage.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAc,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAErF,OAAO,0BAA0B,CAAA;AAEjC,IAAK,mBAIJ;AAJD,WAAK,mBAAmB;IACtB,mEAAa,CAAA;IACb,mEAAa,CAAA;IACb,gEAAY,CAAA;AACd,CAAC,EAJI,mBAAmB,KAAnB,mBAAmB,QAIvB;AAED,IAAM,WAAW,GAAG,UAAC,EAA+E;QAA7E,GAAG,SAAA,EAAE,GAAG,SAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,YAAY,kBAAA;IACvE,IAAA,KAAgB,QAAQ,CAAC,EAAE,CAAC,EAA3B,GAAG,QAAA,EAAE,MAAM,QAAgB,CAAA;IAC5B,IAAA,KAAkC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAtE,YAAY,QAAA,EAAE,eAAe,QAAyC,CAAA;IAE7E,eAAe,CAAC;QACd,MAAM,CAAC,GAAG,CAAC,CAAA;IACb,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAET,wDAAwD;IACxD,SAAS,CAAC;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AAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,SAAS,CAAC,EACzD,KAAK,EAAE,mBAAmB,EAAE,EAC5B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,aAAa,GACtB,CACH,CAAA;AACH,CAAC,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var SMARTAPP_CACHE_STORAGE = 'smartapp-cache-storage';
|
|
2
|
-
var NETWORK_RESPONSE_ERROR = 'Network response was not ok';
|
|
3
|
-
var FAILED_TO_SAVE_IMAGE_TO_CACHE = 'Failed to save image to cache';
|
|
4
|
-
// Загрузка изображения из кэша
|
|
5
|
-
export var tryToLoadImageFromCache = function (url) {
|
|
6
|
-
return caches
|
|
7
|
-
.open(SMARTAPP_CACHE_STORAGE)
|
|
8
|
-
.then(function (cache) { return cache.match(url); })
|
|
9
|
-
.then(function (response) { return (response === null || response === void 0 ? void 0 : response.blob()) || null; })
|
|
10
|
-
.then(function (blob) { return (blob ? URL.createObjectURL(blob) : null); })
|
|
11
|
-
.catch(function () { return null; });
|
|
12
|
-
};
|
|
13
|
-
// Сохранение изображения в кэш
|
|
14
|
-
var saveImageToCache = function (url) {
|
|
15
|
-
return fetch(url, {
|
|
16
|
-
credentials: 'include',
|
|
17
|
-
})
|
|
18
|
-
.then(function (response) {
|
|
19
|
-
if (!response.ok)
|
|
20
|
-
throw new Error(NETWORK_RESPONSE_ERROR);
|
|
21
|
-
return caches.open(SMARTAPP_CACHE_STORAGE).then(function (cache) { return cache.put(url, response); });
|
|
22
|
-
})
|
|
23
|
-
.catch(function (error) { return console.error("".concat(FAILED_TO_SAVE_IMAGE_TO_CACHE, ":"), error); });
|
|
24
|
-
};
|
|
25
|
-
// Проверка наличия изображения в кэше и сохранение его при отсутствии
|
|
26
|
-
export var tryToSaveImageToCache = function (url) {
|
|
27
|
-
if (!url)
|
|
28
|
-
return Promise.resolve();
|
|
29
|
-
return caches
|
|
30
|
-
.open(SMARTAPP_CACHE_STORAGE)
|
|
31
|
-
.then(function (cache) { return cache.match(url); })
|
|
32
|
-
.then(function (response) {
|
|
33
|
-
if (!response)
|
|
34
|
-
return saveImageToCache(url);
|
|
35
|
-
return Promise.resolve();
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
// Функция для проверки, является ли URL объектом Blob
|
|
39
|
-
export var isBlobUrl = function (url) { return url.indexOf('blob:') === 0; };
|
|
40
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/сomponents/CachedImage/helpers.ts"],"names":[],"mappings":"AAAA,IAAM,sBAAsB,GAAG,wBAAwB,CAAA;AACvD,IAAM,sBAAsB,GAAG,6BAA6B,CAAA;AAC5D,IAAM,6BAA6B,GAAG,+BAA+B,CAAA;AAErE,+BAA+B;AAC/B,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,GAAW;IACjD,OAAA,MAAM;SACH,IAAI,CAAC,sBAAsB,CAAC;SAC5B,IAAI,CAAC,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAhB,CAAgB,CAAC;SACjC,IAAI,CAAC,UAAC,QAAQ,IAAK,OAAA,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,EAAE,KAAI,IAAI,EAAxB,CAAwB,CAAC;SAC5C,IAAI,CAAC,UAAC,IAAI,IAAK,OAAA,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAzC,CAAyC,CAAC;SACzD,KAAK,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;AALpB,CAKoB,CAAA;AAEtB,+BAA+B;AAC/B,IAAM,gBAAgB,GAAG,UAAC,GAAW;IACnC,OAAA,K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,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/CachedImage/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { useState } from 'react';
|
|
14
|
-
import classNames from 'classnames';
|
|
15
|
-
import DatePicker, { registerLocale } from 'react-datepicker';
|
|
16
|
-
import ru from 'date-fns/locale/ru';
|
|
17
|
-
import en from 'date-fns/locale/en-US';
|
|
18
|
-
import '../../styles/styles.scss';
|
|
19
|
-
registerLocale('ru', ru);
|
|
20
|
-
registerLocale('en', en);
|
|
21
|
-
var CalendarDatepicker = function (_a) {
|
|
22
|
-
var _b = _a.placeholder, placeholder = _b === void 0 ? 'Введите дату' : _b, initialCurrentDate = _a.initialCurrentDate, initialCurrentDateRange = _a.initialCurrentDateRange, _c = _a.minDate, minDate = _c === void 0 ? null : _c, _d = _a.onChangeCurrentDate, onChangeCurrentDate = _d === void 0 ? function () { return undefined; } : _d, _e = _a.onChangeCurrentDateRange, onChangeCurrentDateRange = _e === void 0 ? function () { return undefined; } : _e, calendarComponentClassName = _a.calendarComponentClassName, calendarInputClassName = _a.calendarInputClassName, _f = _a.isRange, isRange = _f === void 0 ? false : _f, width = _a.width;
|
|
23
|
-
var _g = useState(initialCurrentDate ? initialCurrentDate : null), currentDate = _g[0], setCurrentDate = _g[1];
|
|
24
|
-
var _h = useState(initialCurrentDateRange ? initialCurrentDateRange : [null, null]), currentDateRange = _h[0], setCurrentDateRange = _h[1];
|
|
25
|
-
var startDate = currentDateRange[0], endDate = currentDateRange[1];
|
|
26
|
-
var handleChangeDate = function (date) {
|
|
27
|
-
if (date) {
|
|
28
|
-
setCurrentDate(date);
|
|
29
|
-
onChangeCurrentDate(date);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
var handleChangeDateRange = function (period) {
|
|
33
|
-
setCurrentDateRange(period);
|
|
34
|
-
onChangeCurrentDateRange(period);
|
|
35
|
-
};
|
|
36
|
-
return (_jsx("div", __assign({ className: classNames({
|
|
37
|
-
'smartapp-calendar-component': !calendarInputClassName,
|
|
38
|
-
calendarInputClassName: calendarInputClassName,
|
|
39
|
-
}), style: { width: "".concat(width, "%") } }, { children: isRange ? (_jsx(DatePicker, { selectsRange: true, startDate: startDate, endDate: endDate, dateFormat: "dd.MM.yyyy", placeholderText: placeholder, locale: ru, className: classNames({
|
|
40
|
-
'smartapp-calendar-input': !calendarComponentClassName,
|
|
41
|
-
calendarComponentClassName: calendarComponentClassName,
|
|
42
|
-
}), onChange: function (period) { return handleChangeDateRange(period); } })) : (_jsx(DatePicker, { selected: currentDate, dateFormat: "dd.MM.yyyy", locale: ru, placeholderText: placeholder, minDate: minDate, className: classNames({
|
|
43
|
-
'smartapp-calendar-input': !calendarComponentClassName,
|
|
44
|
-
calendarComponentClassName: calendarComponentClassName,
|
|
45
|
-
}), onChange: function (date) { return handleChangeDate(date); } })) })));
|
|
46
|
-
};
|
|
47
|
-
export default CalendarDatepicker;
|
|
48
|
-
//# sourceMappingURL=Calendar.js.map
|