@expressms/smartapp-ui 2.9.4-alpha.1 → 2.9.4
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/icons/arrow-back.svg +3 -0
- package/build/main/assets/icons/arrow-down.svg +3 -0
- package/build/main/assets/icons/arrow-up.svg +3 -0
- package/build/main/assets/icons/attachment-loader.svg +3 -0
- package/build/main/assets/icons/avatar-loader.svg +3 -0
- package/build/main/assets/icons/button-loader.svg +3 -0
- package/build/main/assets/icons/cancel-cross.svg +3 -0
- package/build/main/assets/icons/check-mark.svg +4 -0
- package/build/main/assets/icons/clear.svg +3 -0
- package/build/main/assets/icons/close-stories.svg +4 -0
- package/build/main/assets/icons/close.svg +10 -0
- package/build/main/assets/icons/contact-info.svg +12 -0
- package/build/main/assets/icons/corporate-user.svg +10 -0
- package/build/main/assets/icons/crown.svg +5 -0
- package/build/main/assets/icons/delete-chip.svg +3 -0
- package/build/main/assets/icons/distribution.svg +12 -0
- package/build/main/assets/icons/download.svg +4 -0
- package/build/main/assets/icons/error.svg +5 -0
- package/build/main/assets/icons/external-link.svg +3 -0
- package/build/main/assets/icons/eye-off.svg +10 -0
- package/build/main/assets/icons/eye.svg +10 -0
- package/build/main/assets/icons/file.svg +3 -0
- package/build/main/assets/icons/group.svg +3 -0
- package/build/main/assets/icons/info.svg +5 -0
- package/build/main/assets/icons/loader.svg +3 -0
- package/build/main/assets/icons/logout.svg +4 -0
- package/build/main/assets/icons/magnifying-glass.svg +3 -0
- package/build/main/assets/icons/mail.svg +3 -0
- package/build/main/assets/icons/meeting-room.svg +3 -0
- package/build/main/assets/icons/meeting-rooms-list.svg +5 -0
- package/build/main/assets/icons/more.svg +3 -0
- package/build/main/assets/icons/my-contact-user.svg +10 -0
- package/build/main/assets/icons/notification-close.svg +3 -0
- package/build/main/assets/icons/notification-error.svg +3 -0
- package/build/main/assets/icons/notification-failure.svg +3 -0
- package/build/main/assets/icons/notification-info.svg +5 -0
- package/build/main/assets/icons/notification-success.svg +4 -0
- package/build/main/assets/icons/notification-warning.svg +5 -0
- package/build/main/assets/icons/order.svg +6 -0
- package/build/main/assets/icons/plus.svg +4 -0
- package/build/main/assets/icons/private.svg +12 -0
- package/build/main/assets/icons/refresh.svg +3 -0
- package/build/main/assets/icons/search.svg +3 -0
- package/build/main/assets/icons/story-loader.svg +3 -0
- package/build/main/assets/icons/tick.svg +10 -0
- package/build/main/assets/icons/trash.svg +3 -0
- package/build/main/assets/icons/unread-mails.svg +4 -0
- package/build/main/assets/icons/warning-avatar.svg +4 -0
- package/build/main/assets/storybook/index.d.ts +22 -0
- package/build/main/assets/storybook/index.js +23 -0
- package/build/main/assets/storybook/index.js.map +1 -0
- package/build/main/constants/constants.d.ts +164 -0
- package/build/main/constants/constants.js +184 -0
- package/build/main/constants/constants.js.map +1 -0
- package/build/main/constants/index.d.ts +2 -0
- package/build/main/constants/index.js +3 -0
- package/build/main/constants/index.js.map +1 -0
- package/build/main/constants/types.d.ts +29 -0
- package/build/main/constants/types.js +2 -0
- package/build/main/constants/types.js.map +1 -0
- package/build/main/helpers/index.d.ts +25 -0
- package/build/main/helpers/index.js +113 -0
- package/build/main/helpers/index.js.map +1 -0
- package/build/main/hooks/useLongTap.d.ts +12 -0
- package/build/main/hooks/useLongTap.js +29 -0
- package/build/main/hooks/useLongTap.js.map +1 -0
- package/build/main/hooks/useModal.d.ts +21 -0
- package/build/main/hooks/useModal.js +60 -0
- package/build/main/hooks/useModal.js.map +1 -0
- package/build/main/index.d.ts +36 -0
- package/build/main/index.js +37 -0
- package/build/main/index.js.map +1 -0
- package/build/main/styles/index.d.ts +1 -0
- package/build/main/styles/index.js +2 -0
- package/build/main/styles/index.js.map +1 -0
- package/build/main/styles/main.js +0 -0
- package/build/main/styles/styles.scss +14 -0
- package/build/main//321/201omponents/ActionModal/ActionModal.d.ts +4 -0
- package/build/main//321/201omponents/ActionModal/ActionModal.js +55 -0
- package/build/main//321/201omponents/ActionModal/ActionModal.js.map +1 -0
- package/build/main//321/201omponents/ActionModal/index.d.ts +1 -0
- package/build/main//321/201omponents/ActionModal/index.js +2 -0
- package/build/main//321/201omponents/ActionModal/index.js.map +1 -0
- package/build/main//321/201omponents/ActionModal/types.d.ts +24 -0
- package/build/main//321/201omponents/ActionModal/types.js +2 -0
- package/build/main//321/201omponents/ActionModal/types.js.map +1 -0
- package/build/main//321/201omponents/AttachedFile/AttachedFile.d.ts +8 -0
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js +60 -0
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js.map +1 -0
- package/build/main//321/201omponents/AttachedFile/index.d.ts +1 -0
- package/build/main//321/201omponents/AttachedFile/index.js +2 -0
- package/build/main//321/201omponents/AttachedFile/index.js.map +1 -0
- package/build/main//321/201omponents/AttachedFile/types.d.ts +25 -0
- package/build/main//321/201omponents/AttachedFile/types.js +2 -0
- package/build/main//321/201omponents/AttachedFile/types.js.map +1 -0
- package/build/main//321/201omponents/Avatar/Avatar.d.ts +4 -0
- package/build/main//321/201omponents/Avatar/Avatar.js +151 -0
- package/build/main//321/201omponents/Avatar/Avatar.js.map +1 -0
- package/build/main//321/201omponents/Avatar/index.d.ts +1 -0
- package/build/main//321/201omponents/Avatar/index.js +2 -0
- package/build/main//321/201omponents/Avatar/index.js.map +1 -0
- package/build/main//321/201omponents/Avatar/types.d.ts +59 -0
- package/build/main//321/201omponents/Avatar/types.js +29 -0
- package/build/main//321/201omponents/Avatar/types.js.map +1 -0
- package/build/main//321/201omponents/Button/Button.d.ts +4 -0
- package/build/main//321/201omponents/Button/Button.js +63 -0
- package/build/main//321/201omponents/Button/Button.js.map +1 -0
- package/build/main//321/201omponents/Button/index.d.ts +1 -0
- package/build/main//321/201omponents/Button/index.js +2 -0
- package/build/main//321/201omponents/Button/index.js.map +1 -0
- package/build/main//321/201omponents/Button/types.d.ts +28 -0
- package/build/main//321/201omponents/Button/types.js +11 -0
- package/build/main//321/201omponents/Button/types.js.map +1 -0
- package/build/main//321/201omponents/CachedImage/CachedImage.d.ts +4 -0
- package/build/main//321/201omponents/CachedImage/CachedImage.js +59 -0
- package/build/main//321/201omponents/CachedImage/CachedImage.js.map +1 -0
- package/build/main//321/201omponents/CachedImage/helpers.d.ts +3 -0
- package/build/main//321/201omponents/CachedImage/helpers.js +40 -0
- package/build/main//321/201omponents/CachedImage/helpers.js.map +1 -0
- package/build/main//321/201omponents/CachedImage/index.d.ts +1 -0
- package/build/main//321/201omponents/CachedImage/index.js +2 -0
- package/build/main//321/201omponents/CachedImage/index.js.map +1 -0
- package/build/main//321/201omponents/CachedImage/types.d.ts +10 -0
- package/build/main//321/201omponents/CachedImage/types.js +2 -0
- package/build/main//321/201omponents/CachedImage/types.js.map +1 -0
- package/build/main//321/201omponents/Calendar/Calendar.d.ts +4 -0
- package/build/main//321/201omponents/Calendar/Calendar.js +97 -0
- package/build/main//321/201omponents/Calendar/Calendar.js.map +1 -0
- package/build/main//321/201omponents/Calendar/index.d.ts +1 -0
- package/build/main//321/201omponents/Calendar/index.js +2 -0
- package/build/main//321/201omponents/Calendar/index.js.map +1 -0
- package/build/main//321/201omponents/Calendar/types.d.ts +13 -0
- package/build/main//321/201omponents/Calendar/types.js +2 -0
- package/build/main//321/201omponents/Calendar/types.js.map +1 -0
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.d.ts +4 -0
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.js +46 -0
- package/build/main//321/201omponents/Charts/ChartBar/ChartBar.js.map +1 -0
- package/build/main//321/201omponents/Charts/ChartLegend/ChartLegend.d.ts +4 -0
- package/build/main//321/201omponents/Charts/ChartLegend/ChartLegend.js +71 -0
- package/build/main//321/201omponents/Charts/ChartLegend/ChartLegend.js.map +1 -0
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.d.ts +4 -0
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.js +41 -0
- package/build/main//321/201omponents/Charts/ChartLine/ChartLine.js.map +1 -0
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.d.ts +4 -0
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.js +63 -0
- package/build/main//321/201omponents/Charts/ChartPie/ChartPie.js.map +1 -0
- package/build/main//321/201omponents/Charts/colors.d.ts +3 -0
- package/build/main//321/201omponents/Charts/colors.js +4 -0
- package/build/main//321/201omponents/Charts/colors.js.map +1 -0
- package/build/main//321/201omponents/Charts/constants.d.ts +46 -0
- package/build/main//321/201omponents/Charts/constants.js +43 -0
- package/build/main//321/201omponents/Charts/constants.js.map +1 -0
- package/build/main//321/201omponents/Charts/helpers.d.ts +17 -0
- package/build/main//321/201omponents/Charts/helpers.js +73 -0
- package/build/main//321/201omponents/Charts/helpers.js.map +1 -0
- package/build/main//321/201omponents/Charts/index.d.ts +3 -0
- package/build/main//321/201omponents/Charts/index.js +4 -0
- package/build/main//321/201omponents/Charts/index.js.map +1 -0
- package/build/main//321/201omponents/Charts/types.d.ts +88 -0
- package/build/main//321/201omponents/Charts/types.js +2 -0
- package/build/main//321/201omponents/Charts/types.js.map +1 -0
- package/build/main//321/201omponents/Charts/useEvents.d.ts +5 -0
- package/build/main//321/201omponents/Charts/useEvents.js +45 -0
- package/build/main//321/201omponents/Charts/useEvents.js.map +1 -0
- package/build/main//321/201omponents/Charts/usePieEvents.d.ts +6 -0
- package/build/main//321/201omponents/Charts/usePieEvents.js +57 -0
- package/build/main//321/201omponents/Charts/usePieEvents.js.map +1 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.d.ts +4 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.js +38 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.js.map +1 -0
- package/build/main//321/201omponents/Checkbox/index.d.ts +1 -0
- package/build/main//321/201omponents/Checkbox/index.js +2 -0
- package/build/main//321/201omponents/Checkbox/index.js.map +1 -0
- package/build/main//321/201omponents/Checkbox/types.d.ts +12 -0
- package/build/main//321/201omponents/Checkbox/types.js +2 -0
- package/build/main//321/201omponents/Checkbox/types.js.map +1 -0
- package/build/main//321/201omponents/Chip/Chip.d.ts +4 -0
- package/build/main//321/201omponents/Chip/Chip.js +74 -0
- package/build/main//321/201omponents/Chip/Chip.js.map +1 -0
- package/build/main//321/201omponents/Chip/index.d.ts +1 -0
- package/build/main//321/201omponents/Chip/index.js +2 -0
- package/build/main//321/201omponents/Chip/index.js.map +1 -0
- package/build/main//321/201omponents/Chip/types.d.ts +21 -0
- package/build/main//321/201omponents/Chip/types.js +2 -0
- package/build/main//321/201omponents/Chip/types.js.map +1 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.d.ts +4 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +70 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js.map +1 -0
- package/build/main//321/201omponents/ConfirmationModal/index.d.ts +1 -0
- package/build/main//321/201omponents/ConfirmationModal/index.js +2 -0
- package/build/main//321/201omponents/ConfirmationModal/index.js.map +1 -0
- package/build/main//321/201omponents/ConfirmationModal/types.d.ts +28 -0
- package/build/main//321/201omponents/ConfirmationModal/types.js +2 -0
- package/build/main//321/201omponents/ConfirmationModal/types.js.map +1 -0
- package/build/main//321/201omponents/ContextMenu/ContextMenu.d.ts +4 -0
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js +81 -0
- package/build/main//321/201omponents/ContextMenu/ContextMenu.js.map +1 -0
- package/build/main//321/201omponents/ContextMenu/index.d.ts +1 -0
- package/build/main//321/201omponents/ContextMenu/index.js +2 -0
- package/build/main//321/201omponents/ContextMenu/index.js.map +1 -0
- package/build/main//321/201omponents/ContextMenu/types.d.ts +34 -0
- package/build/main//321/201omponents/ContextMenu/types.js +2 -0
- package/build/main//321/201omponents/ContextMenu/types.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.d.ts +12 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js +243 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/index.d.ts +1 -0
- package/build/main//321/201omponents/CustomSelect/index.js +2 -0
- package/build/main//321/201omponents/CustomSelect/index.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/selectStyles.d.ts +16 -0
- package/build/main//321/201omponents/CustomSelect/selectStyles.js +67 -0
- package/build/main//321/201omponents/CustomSelect/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/types.d.ts +65 -0
- package/build/main//321/201omponents/CustomSelect/types.js +2 -0
- package/build/main//321/201omponents/CustomSelect/types.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.d.ts +4 -0
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js +58 -0
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/index.d.ts +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/index.js +2 -0
- package/build/main//321/201omponents/CustomSelectProfiles/index.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.d.ts +12 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.js +2 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.js.map +1 -0
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.d.ts +4 -0
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js +57 -0
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js.map +1 -0
- package/build/main//321/201omponents/DragAndDrop/index.d.ts +1 -0
- package/build/main//321/201omponents/DragAndDrop/index.js +2 -0
- package/build/main//321/201omponents/DragAndDrop/index.js.map +1 -0
- package/build/main//321/201omponents/DragAndDrop/types.d.ts +24 -0
- package/build/main//321/201omponents/DragAndDrop/types.js +2 -0
- package/build/main//321/201omponents/DragAndDrop/types.js.map +1 -0
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.d.ts +4 -0
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.js +223 -0
- package/build/main//321/201omponents/DraggablePopup/DraggablePopup.js.map +1 -0
- package/build/main//321/201omponents/DraggablePopup/index.d.ts +1 -0
- package/build/main//321/201omponents/DraggablePopup/index.js +2 -0
- package/build/main//321/201omponents/DraggablePopup/index.js.map +1 -0
- package/build/main//321/201omponents/DraggablePopup/types.d.ts +88 -0
- package/build/main//321/201omponents/DraggablePopup/types.js +2 -0
- package/build/main//321/201omponents/DraggablePopup/types.js.map +1 -0
- package/build/main//321/201omponents/Error/Error.d.ts +4 -0
- package/build/main//321/201omponents/Error/Error.js +23 -0
- package/build/main//321/201omponents/Error/Error.js.map +1 -0
- package/build/main//321/201omponents/Error/index.d.ts +1 -0
- package/build/main//321/201omponents/Error/index.js +2 -0
- package/build/main//321/201omponents/Error/index.js.map +1 -0
- package/build/main//321/201omponents/Error/types.d.ts +10 -0
- package/build/main//321/201omponents/Error/types.js +2 -0
- package/build/main//321/201omponents/Error/types.js.map +1 -0
- package/build/main//321/201omponents/Flex/Flex.d.ts +2 -0
- package/build/main//321/201omponents/Flex/Flex.js +49 -0
- package/build/main//321/201omponents/Flex/Flex.js.map +1 -0
- package/build/main//321/201omponents/Flex/HFlex/HFlex.d.ts +5 -0
- package/build/main//321/201omponents/Flex/HFlex/HFlex.js +16 -0
- package/build/main//321/201omponents/Flex/HFlex/HFlex.js.map +1 -0
- package/build/main//321/201omponents/Flex/HFlex/index.d.ts +1 -0
- package/build/main//321/201omponents/Flex/HFlex/index.js +2 -0
- package/build/main//321/201omponents/Flex/HFlex/index.js.map +1 -0
- package/build/main//321/201omponents/Flex/VFlex/VFlex.d.ts +5 -0
- package/build/main//321/201omponents/Flex/VFlex/VFlex.js +16 -0
- package/build/main//321/201omponents/Flex/VFlex/VFlex.js.map +1 -0
- package/build/main//321/201omponents/Flex/VFlex/index.d.ts +1 -0
- package/build/main//321/201omponents/Flex/VFlex/index.js +2 -0
- package/build/main//321/201omponents/Flex/VFlex/index.js.map +1 -0
- package/build/main//321/201omponents/Flex/index.d.ts +3 -0
- package/build/main//321/201omponents/Flex/index.js +4 -0
- package/build/main//321/201omponents/Flex/index.js.map +1 -0
- package/build/main//321/201omponents/Flex/types.d.ts +15 -0
- package/build/main//321/201omponents/Flex/types.js +2 -0
- package/build/main//321/201omponents/Flex/types.js.map +1 -0
- package/build/main//321/201omponents/Header/Header.d.ts +5 -0
- package/build/main//321/201omponents/Header/Header.js +125 -0
- package/build/main//321/201omponents/Header/Header.js.map +1 -0
- package/build/main//321/201omponents/Header/index.d.ts +1 -0
- package/build/main//321/201omponents/Header/index.js +2 -0
- package/build/main//321/201omponents/Header/index.js.map +1 -0
- package/build/main//321/201omponents/Header/types.d.ts +46 -0
- package/build/main//321/201omponents/Header/types.js +2 -0
- package/build/main//321/201omponents/Header/types.js.map +1 -0
- package/build/main//321/201omponents/Input/Input.d.ts +4 -0
- package/build/main//321/201omponents/Input/Input.js +207 -0
- package/build/main//321/201omponents/Input/Input.js.map +1 -0
- package/build/main//321/201omponents/Input/index.d.ts +1 -0
- package/build/main//321/201omponents/Input/index.js +2 -0
- package/build/main//321/201omponents/Input/index.js.map +1 -0
- package/build/main//321/201omponents/Input/types.d.ts +29 -0
- package/build/main//321/201omponents/Input/types.js +2 -0
- package/build/main//321/201omponents/Input/types.js.map +1 -0
- package/build/main//321/201omponents/ListItem/ListItem.d.ts +23 -0
- package/build/main//321/201omponents/ListItem/ListItem.js +208 -0
- package/build/main//321/201omponents/ListItem/ListItem.js.map +1 -0
- package/build/main//321/201omponents/ListItem/index.d.ts +1 -0
- package/build/main//321/201omponents/ListItem/index.js +2 -0
- package/build/main//321/201omponents/ListItem/index.js.map +1 -0
- package/build/main//321/201omponents/ListItem/types.d.ts +42 -0
- package/build/main//321/201omponents/ListItem/types.js +2 -0
- package/build/main//321/201omponents/ListItem/types.js.map +1 -0
- package/build/main//321/201omponents/Loader/Loader.d.ts +4 -0
- package/build/main//321/201omponents/Loader/Loader.js +44 -0
- package/build/main//321/201omponents/Loader/Loader.js.map +1 -0
- package/build/main//321/201omponents/Loader/index.d.ts +1 -0
- package/build/main//321/201omponents/Loader/index.js +2 -0
- package/build/main//321/201omponents/Loader/index.js.map +1 -0
- package/build/main//321/201omponents/Loader/types.d.ts +18 -0
- package/build/main//321/201omponents/Loader/types.js +2 -0
- package/build/main//321/201omponents/Loader/types.js.map +1 -0
- package/build/main//321/201omponents/Modal/Modal.d.ts +4 -0
- package/build/main//321/201omponents/Modal/Modal.js +147 -0
- package/build/main//321/201omponents/Modal/Modal.js.map +1 -0
- package/build/main//321/201omponents/Modal/index.d.ts +1 -0
- package/build/main//321/201omponents/Modal/index.js +2 -0
- package/build/main//321/201omponents/Modal/index.js.map +1 -0
- package/build/main//321/201omponents/Modal/types.d.ts +36 -0
- package/build/main//321/201omponents/Modal/types.js +2 -0
- package/build/main//321/201omponents/Modal/types.js.map +1 -0
- package/build/main//321/201omponents/Notification/Notification.d.ts +8 -0
- package/build/main//321/201omponents/Notification/Notification.js +218 -0
- package/build/main//321/201omponents/Notification/Notification.js.map +1 -0
- package/build/main//321/201omponents/Notification/index.d.ts +1 -0
- package/build/main//321/201omponents/Notification/index.js +2 -0
- package/build/main//321/201omponents/Notification/index.js.map +1 -0
- package/build/main//321/201omponents/Notification/types.d.ts +45 -0
- package/build/main//321/201omponents/Notification/types.js +2 -0
- package/build/main//321/201omponents/Notification/types.js.map +1 -0
- package/build/main//321/201omponents/Profile/Profile.d.ts +4 -0
- package/build/main//321/201omponents/Profile/Profile.js +42 -0
- package/build/main//321/201omponents/Profile/Profile.js.map +1 -0
- package/build/main//321/201omponents/Profile/index.d.ts +1 -0
- package/build/main//321/201omponents/Profile/index.js +2 -0
- package/build/main//321/201omponents/Profile/index.js.map +1 -0
- package/build/main//321/201omponents/Profile/types.d.ts +14 -0
- package/build/main//321/201omponents/Profile/types.js +2 -0
- package/build/main//321/201omponents/Profile/types.js.map +1 -0
- package/build/main//321/201omponents/ProgressBar/ProgressBar.d.ts +4 -0
- package/build/main//321/201omponents/ProgressBar/ProgressBar.js +66 -0
- package/build/main//321/201omponents/ProgressBar/ProgressBar.js.map +1 -0
- package/build/main//321/201omponents/ProgressBar/index.d.ts +1 -0
- package/build/main//321/201omponents/ProgressBar/index.js +2 -0
- package/build/main//321/201omponents/ProgressBar/index.js.map +1 -0
- package/build/main//321/201omponents/ProgressBar/types.d.ts +7 -0
- package/build/main//321/201omponents/ProgressBar/types.js +2 -0
- package/build/main//321/201omponents/ProgressBar/types.js.map +1 -0
- package/build/main//321/201omponents/RadioButton/RadioButton.d.ts +4 -0
- package/build/main//321/201omponents/RadioButton/RadioButton.js +37 -0
- package/build/main//321/201omponents/RadioButton/RadioButton.js.map +1 -0
- package/build/main//321/201omponents/RadioButton/index.d.ts +1 -0
- package/build/main//321/201omponents/RadioButton/index.js +2 -0
- package/build/main//321/201omponents/RadioButton/index.js.map +1 -0
- package/build/main//321/201omponents/RadioButton/types.d.ts +12 -0
- package/build/main//321/201omponents/RadioButton/types.js +2 -0
- package/build/main//321/201omponents/RadioButton/types.js.map +1 -0
- package/build/main//321/201omponents/ScrollBar/ScrollBar.d.ts +5 -0
- package/build/main//321/201omponents/ScrollBar/ScrollBar.js +138 -0
- package/build/main//321/201omponents/ScrollBar/ScrollBar.js.map +1 -0
- package/build/main//321/201omponents/ScrollBar/index.d.ts +1 -0
- package/build/main//321/201omponents/ScrollBar/index.js +2 -0
- package/build/main//321/201omponents/ScrollBar/index.js.map +1 -0
- package/build/main//321/201omponents/ScrollBar/types.d.ts +23 -0
- package/build/main//321/201omponents/ScrollBar/types.js +2 -0
- package/build/main//321/201omponents/ScrollBar/types.js.map +1 -0
- package/build/main//321/201omponents/Skeleton/Skeleton.d.ts +4 -0
- package/build/main//321/201omponents/Skeleton/Skeleton.js +59 -0
- package/build/main//321/201omponents/Skeleton/Skeleton.js.map +1 -0
- package/build/main//321/201omponents/Skeleton/index.d.ts +1 -0
- package/build/main//321/201omponents/Skeleton/index.js +2 -0
- package/build/main//321/201omponents/Skeleton/index.js.map +1 -0
- package/build/main//321/201omponents/Skeleton/types.d.ts +17 -0
- package/build/main//321/201omponents/Skeleton/types.js +2 -0
- package/build/main//321/201omponents/Skeleton/types.js.map +1 -0
- package/build/main//321/201omponents/Stories/Stories.d.ts +4 -0
- package/build/main//321/201omponents/Stories/Stories.js +300 -0
- package/build/main//321/201omponents/Stories/Stories.js.map +1 -0
- package/build/main//321/201omponents/Stories/index.d.ts +1 -0
- package/build/main//321/201omponents/Stories/index.js +2 -0
- package/build/main//321/201omponents/Stories/index.js.map +1 -0
- package/build/main//321/201omponents/Stories/types.d.ts +70 -0
- package/build/main//321/201omponents/Stories/types.js +16 -0
- package/build/main//321/201omponents/Stories/types.js.map +1 -0
- package/build/main//321/201omponents/Switcher/Switcher.d.ts +4 -0
- package/build/main//321/201omponents/Switcher/Switcher.js +34 -0
- package/build/main//321/201omponents/Switcher/Switcher.js.map +1 -0
- package/build/main//321/201omponents/Switcher/index.d.ts +1 -0
- package/build/main//321/201omponents/Switcher/index.js +2 -0
- package/build/main//321/201omponents/Switcher/index.js.map +1 -0
- package/build/main//321/201omponents/Switcher/types.d.ts +8 -0
- package/build/main//321/201omponents/Switcher/types.js +2 -0
- package/build/main//321/201omponents/Switcher/types.js.map +1 -0
- package/build/main//321/201omponents/SyncLoader/SyncLoader.d.ts +5 -0
- package/build/main//321/201omponents/SyncLoader/SyncLoader.js +65 -0
- package/build/main//321/201omponents/SyncLoader/SyncLoader.js.map +1 -0
- package/build/main//321/201omponents/SyncLoader/index.d.ts +1 -0
- package/build/main//321/201omponents/SyncLoader/index.js +2 -0
- package/build/main//321/201omponents/SyncLoader/index.js.map +1 -0
- package/build/main//321/201omponents/SyncLoader/types.d.ts +9 -0
- package/build/main//321/201omponents/SyncLoader/types.js +2 -0
- package/build/main//321/201omponents/SyncLoader/types.js.map +1 -0
- package/build/main//321/201omponents/Textarea/Textarea.d.ts +4 -0
- package/build/main//321/201omponents/Textarea/Textarea.js +96 -0
- package/build/main//321/201omponents/Textarea/Textarea.js.map +1 -0
- package/build/main//321/201omponents/Textarea/index.d.ts +1 -0
- package/build/main//321/201omponents/Textarea/index.js +2 -0
- package/build/main//321/201omponents/Textarea/index.js.map +1 -0
- package/build/main//321/201omponents/Textarea/types.d.ts +12 -0
- package/build/main//321/201omponents/Textarea/types.js +2 -0
- package/build/main//321/201omponents/Textarea/types.js.map +1 -0
- package/build/main//321/201omponents/Toggle/Toggle.d.ts +4 -0
- package/build/main//321/201omponents/Toggle/Toggle.js +38 -0
- package/build/main//321/201omponents/Toggle/Toggle.js.map +1 -0
- package/build/main//321/201omponents/Toggle/index.d.ts +1 -0
- package/build/main//321/201omponents/Toggle/index.js +2 -0
- package/build/main//321/201omponents/Toggle/index.js.map +1 -0
- package/build/main//321/201omponents/Toggle/types.d.ts +12 -0
- package/build/main//321/201omponents/Toggle/types.js +2 -0
- package/build/main//321/201omponents/Toggle/types.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.js +32 -0
- package/build/main//321/201omponents/UserDropdown/ContactBottomSheet/ContactBottomSheet.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js +82 -0
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js +23 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js +130 -0
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.d.ts +3 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js +97 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/Option/Option.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/Option/Option.js +93 -0
- package/build/main//321/201omponents/UserDropdown/Option/Option.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.js +43 -0
- package/build/main//321/201omponents/UserDropdown/SearchInCatalogButton/SearchInCatalogButton.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/UserDropdown.d.ts +5 -0
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js +484 -0
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/constants.d.ts +7 -0
- package/build/main//321/201omponents/UserDropdown/constants.js +9 -0
- package/build/main//321/201omponents/UserDropdown/constants.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/helpers.d.ts +98 -0
- package/build/main//321/201omponents/UserDropdown/helpers.js +146 -0
- package/build/main//321/201omponents/UserDropdown/helpers.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/index.d.ts +1 -0
- package/build/main//321/201omponents/UserDropdown/index.js +2 -0
- package/build/main//321/201omponents/UserDropdown/index.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/selectStyles.d.ts +15 -0
- package/build/main//321/201omponents/UserDropdown/selectStyles.js +80 -0
- package/build/main//321/201omponents/UserDropdown/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/types.d.ts +251 -0
- package/build/main//321/201omponents/UserDropdown/types.js +9 -0
- package/build/main//321/201omponents/UserDropdown/types.js.map +1 -0
- package/build/main//321/201omponents/types.d.ts +2 -0
- package/build/main//321/201omponents/types.js +2 -0
- package/build/main//321/201omponents/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,138 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
24
|
+
import { useCallback, useEffect, useLayoutEffect, useState } from 'react';
|
|
25
|
+
import classNames from 'classnames';
|
|
26
|
+
import Scrollbar from 'react-scrollbars-custom';
|
|
27
|
+
import { generateId, isWebPlatform } from '../../helpers';
|
|
28
|
+
import { DEFAULT_SCROLL_BAR_HIDE_DURATION, EVENT_LISTENER_TYPES, PLATFORM } from '../../constants';
|
|
29
|
+
import '../../styles/styles.scss';
|
|
30
|
+
var X_VALUE = 'x';
|
|
31
|
+
var Y_VALUE = 'y';
|
|
32
|
+
export var DEFAULT_SCROLL_BAR_SIZE = '100%';
|
|
33
|
+
var generateAxisValue = function (isXAxis) { return (isXAxis ? X_VALUE : Y_VALUE); };
|
|
34
|
+
var generateDefaultThumbClassname = function (isXAxis) { return "smartapp-scroll__thumb-".concat(generateAxisValue(isXAxis)); };
|
|
35
|
+
var generateShowThumbClassname = function (isXAxis, isScrolling) {
|
|
36
|
+
var thumbClassname = generateDefaultThumbClassname(isXAxis);
|
|
37
|
+
return isScrolling ? "".concat(thumbClassname, "--show ").concat(thumbClassname) : "".concat(thumbClassname);
|
|
38
|
+
};
|
|
39
|
+
var generateScrollHeightWithMargin = function (trackHeight) { return "calc(".concat(trackHeight, " - 8px)"); };
|
|
40
|
+
var ScrollBar = function (_a) {
|
|
41
|
+
var _b = _a.platform, platform = _b === void 0 ? PLATFORM.web : _b, contentId = _a.contentId, content = _a.content, handleScroll = _a.handleScroll, _c = _a.hideDuration, hideDuration = _c === void 0 ? DEFAULT_SCROLL_BAR_HIDE_DURATION : _c, _d = _a.containerHeight, containerHeight = _d === void 0 ? DEFAULT_SCROLL_BAR_SIZE : _d, _e = _a.containerWidth, containerWidth = _e === void 0 ? DEFAULT_SCROLL_BAR_SIZE : _e, _f = _a.trackXHeight, trackXHeight = _f === void 0 ? DEFAULT_SCROLL_BAR_SIZE : _f, _g = _a.trackYHeight, trackYHeight = _g === void 0 ? DEFAULT_SCROLL_BAR_SIZE : _g, containerClassName = _a.containerClassName, containerStyles = _a.containerStyles, scrollbarRef = _a.scrollbarRef, containerScrollRef = _a.containerScrollRef, _h = _a.isShowHorizontalScroll, isShowHorizontalScroll = _h === void 0 ? false : _h, restProps = __rest(_a, ["platform", "contentId", "content", "handleScroll", "hideDuration", "containerHeight", "containerWidth", "trackXHeight", "trackYHeight", "containerClassName", "containerStyles", "scrollbarRef", "containerScrollRef", "isShowHorizontalScroll"]);
|
|
42
|
+
var _j = useState(generateId()), scrollbarKey = _j[0], setScrollbarKey = _j[1];
|
|
43
|
+
var _k = useState(false), scrollingX = _k[0], setScrollingX = _k[1];
|
|
44
|
+
var _l = useState(false), scrollingY = _l[0], setScrollingY = _l[1];
|
|
45
|
+
var _m = useState(0), scrollXValue = _m[0], setScrollXValue = _m[1];
|
|
46
|
+
var _o = useState(0), scrollYValue = _o[0], setScrollYValue = _o[1];
|
|
47
|
+
var _p = useState(false), draggingX = _p[0], setDraggingX = _p[1];
|
|
48
|
+
var _q = useState(false), draggingY = _q[0], setDraggingY = _q[1];
|
|
49
|
+
var _r = useState(false), trackXHovered = _r[0], setTrackXHovered = _r[1];
|
|
50
|
+
var _s = useState(false), trackYHovered = _s[0], setTrackYHovered = _s[1];
|
|
51
|
+
var pointerup = EVENT_LISTENER_TYPES.pointerup, mouseup = EVENT_LISTENER_TYPES.mouseup, touchcancel = EVENT_LISTENER_TYPES.touchcancel, touchend = EVENT_LISTENER_TYPES.touchend;
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
var debounceTimeout = setTimeout(function () { return setScrollingX(false); }, hideDuration);
|
|
54
|
+
return function () { return clearTimeout(debounceTimeout); };
|
|
55
|
+
/* eslint-disable-next-line */
|
|
56
|
+
}, [scrollingX]);
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
var debounceTimeout = setTimeout(function () { return setScrollingY(false); }, hideDuration);
|
|
59
|
+
return function () { return clearTimeout(debounceTimeout); };
|
|
60
|
+
/* eslint-disable-next-line */
|
|
61
|
+
}, [scrollingY]);
|
|
62
|
+
useLayoutEffect(function () {
|
|
63
|
+
if (contentId) {
|
|
64
|
+
setTrackXHovered(false);
|
|
65
|
+
setTrackYHovered(false);
|
|
66
|
+
setScrollingX(false);
|
|
67
|
+
setScrollingY(false);
|
|
68
|
+
setDraggingX(false);
|
|
69
|
+
setDraggingY(false);
|
|
70
|
+
setScrollbarKey(contentId);
|
|
71
|
+
}
|
|
72
|
+
}, [contentId]);
|
|
73
|
+
useEffect(function () {
|
|
74
|
+
var stopDraggingAll = function () {
|
|
75
|
+
setDraggingX(false);
|
|
76
|
+
setDraggingY(false);
|
|
77
|
+
};
|
|
78
|
+
window.addEventListener(pointerup, stopDraggingAll);
|
|
79
|
+
window.addEventListener(mouseup, stopDraggingAll);
|
|
80
|
+
window.addEventListener(touchend, stopDraggingAll, { passive: true });
|
|
81
|
+
window.addEventListener(touchcancel, stopDraggingAll, { passive: true });
|
|
82
|
+
return function () {
|
|
83
|
+
window.removeEventListener(pointerup, stopDraggingAll);
|
|
84
|
+
window.removeEventListener(mouseup, stopDraggingAll);
|
|
85
|
+
window.removeEventListener(touchend, stopDraggingAll);
|
|
86
|
+
window.removeEventListener(touchcancel, stopDraggingAll);
|
|
87
|
+
};
|
|
88
|
+
}, [mouseup, pointerup, touchcancel, touchend]);
|
|
89
|
+
var startDragX = function () { return startDrag(true); };
|
|
90
|
+
var startDragY = function () { return startDrag(false); };
|
|
91
|
+
var startDrag = useCallback(function (isXAxis) {
|
|
92
|
+
var setDragging = isXAxis ? setDraggingX : setDraggingY;
|
|
93
|
+
var setScrolling = isXAxis ? setScrollingX : setScrollingY;
|
|
94
|
+
setDragging(true);
|
|
95
|
+
setScrolling(true);
|
|
96
|
+
}, []);
|
|
97
|
+
var onScroll = function (scrollValues) {
|
|
98
|
+
handleScroll === null || handleScroll === void 0 ? void 0 : handleScroll(scrollValues);
|
|
99
|
+
if ('scrollLeft' in scrollValues) {
|
|
100
|
+
var scrollTop = scrollValues.scrollTop, scrollLeft = scrollValues.scrollLeft;
|
|
101
|
+
setScrollXValue(scrollLeft);
|
|
102
|
+
setScrollYValue(scrollTop);
|
|
103
|
+
var isXAxisWasScrolled = scrollLeft !== scrollXValue;
|
|
104
|
+
var isYAxisWasScrolled = scrollTop !== scrollYValue;
|
|
105
|
+
isXAxisWasScrolled && setScrollingX(true);
|
|
106
|
+
isYAxisWasScrolled && setScrollingY(true);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var generateThumbXClassName = useCallback(function () { return generateShowThumbClassname(true, scrollingX); }, [scrollingX]);
|
|
110
|
+
var generateThumbYClassName = useCallback(function () { return generateShowThumbClassname(false, scrollingY); }, [scrollingY]);
|
|
111
|
+
var generateScrollerStyles = function (trackHeight, isXTrack) {
|
|
112
|
+
return ({
|
|
113
|
+
'--scroller-height': isShowHorizontalScroll ? generateScrollHeightWithMargin(trackHeight) : trackHeight,
|
|
114
|
+
left: isXTrack ? 0 : undefined,
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
var generateTrackProps = function (isXTrack, trackHeight) {
|
|
118
|
+
var _a;
|
|
119
|
+
var axis = generateAxisValue(isXTrack);
|
|
120
|
+
var isDragging = isXTrack ? draggingX : draggingY;
|
|
121
|
+
var isScrolling = isXTrack ? scrollingX : scrollingY;
|
|
122
|
+
var isHovered = isXTrack ? trackXHovered : trackYHovered;
|
|
123
|
+
var isHoverClassName = isScrolling && isHovered && isWebPlatform(platform);
|
|
124
|
+
var setTrackHovered = isXTrack ? setTrackXHovered : setTrackYHovered;
|
|
125
|
+
return {
|
|
126
|
+
className: classNames("smartapp-scroll__scroller-".concat(axis), (_a = {},
|
|
127
|
+
_a["smartapp-scroll__scroller-".concat(axis, "--hover")] = isHoverClassName,
|
|
128
|
+
_a["smartapp-scroll__scroller-".concat(axis, "--dragging")] = isDragging,
|
|
129
|
+
_a)),
|
|
130
|
+
style: generateScrollerStyles(trackHeight, isXTrack),
|
|
131
|
+
onMouseEnter: function () { return setTrackHovered(true); },
|
|
132
|
+
onMouseLeave: function () { return setTrackHovered(false); },
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
return (_jsx("div", __assign({ ref: containerScrollRef, style: __assign({ height: containerHeight, width: containerWidth }, containerStyles), className: classNames('smartapp-scroll', containerClassName) }, { children: _jsx(Scrollbar, __assign({ ref: scrollbarRef, native: false, mobileNative: false, removeTracksWhenNotUsed: true, onScroll: onScroll, wrapperProps: { className: 'smartapp-scroll__wrapper' }, thumbYProps: { className: generateThumbYClassName(), onPointerDown: startDragY, onMouseDown: startDragY, onTouchStart: startDragY }, thumbXProps: { className: generateThumbXClassName(), onPointerDown: startDragX, onMouseDown: startDragX, onTouchStart: startDragX }, trackYProps: generateTrackProps(false, trackYHeight), trackXProps: generateTrackProps(true, trackXHeight), noScrollX: !isShowHorizontalScroll }, restProps, { children: content }), scrollbarKey) })));
|
|
136
|
+
};
|
|
137
|
+
export default ScrollBar;
|
|
138
|
+
//# sourceMappingURL=ScrollBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollBar.js","sourceRoot":"","sources":["../../../../src/сomponents/ScrollBar/ScrollBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,SAAS,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAElG,OAAO,0BAA0B,CAAA;AAEjC,IAAM,OAAO,GAAG,GAAG,CAAA;AACnB,IAAM,OAAO,GAAG,GAAG,CAAA;AACnB,MAAM,CAAC,IAAM,uBAAuB,GAAG,MAAM,CAAA;AAC7C,IAAM,iBAAiB,GAAG,UAAC,OAAgB,IAAK,OAAA,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAA7B,CAA6B,CAAA;AAC7E,IAAM,6BAA6B,GAAG,UAAC,OAAgB,IAAK,OAAA,iCAA0B,iBAAiB,CAAC,OAAO,CAAC,CAAE,EAAtD,CAAsD,CAAA;AAClH,IAAM,0BAA0B,GAAG,UAAC,OAAgB,EAAE,WAAoB;IACxE,IAAM,cAAc,GAAG,6BAA6B,CAAC,OAAO,CAAC,CAAA;IAC7D,OAAO,WAAW,CAAC,CAAC,CAAC,UAAG,cAAc,oBAAU,cAAc,CAAE,CAAC,CAAC,CAAC,UAAG,cAAc,CA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,YAAY,EAAE,EAAE,SAAS,EAAE,0BAA0B,EAAE,EACvD,WAAW,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,EACnI,WAAW,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,EACnI,WAAW,EAAE,kBAAkB,CAAC,KAAK,EAAE,YAAY,CAAC,EACpD,WAAW,EAAE,kBAAkB,CAAC,IAAI,EAAE,YAAY,CAAC,EACnD,SAAS,EAAE,CAAC,sBAAsB,IAC9B,SAAS,cAEZ,OAAO,KAbH,YAAY,CAcP,IACR,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ScrollBar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/ScrollBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { Scrollbar, ScrollbarProps } from 'react-scrollbars-custom';
|
|
3
|
+
import { ScrollState } from 'react-scrollbars-custom/dist/types/types';
|
|
4
|
+
import { IPlatformProps, TStyles } from '../../constants';
|
|
5
|
+
type TScrollbarInstance = (instance: Scrollbar | null) => void;
|
|
6
|
+
type TDivInstance = (instance: HTMLDivElement | null) => void;
|
|
7
|
+
type TScrollbarRef = ((TScrollbarInstance | RefObject<Scrollbar>) & (TDivInstance | RefObject<HTMLDivElement>)) | null | undefined;
|
|
8
|
+
export interface IScrollBarProps extends Omit<ScrollbarProps, 'content' | 'ref'>, IPlatformProps {
|
|
9
|
+
trackXHeight?: string;
|
|
10
|
+
trackYHeight?: string;
|
|
11
|
+
containerHeight?: string;
|
|
12
|
+
containerWidth?: string;
|
|
13
|
+
containerClassName?: string;
|
|
14
|
+
containerStyles?: TStyles;
|
|
15
|
+
hideDuration?: number;
|
|
16
|
+
handleScroll?: (e: ScrollState | React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
17
|
+
content: ReactNode;
|
|
18
|
+
contentId?: string;
|
|
19
|
+
scrollbarRef?: TScrollbarRef;
|
|
20
|
+
containerScrollRef?: React.Ref<HTMLDivElement>;
|
|
21
|
+
isShowHorizontalScroll?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/ScrollBar/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ISkeletonProps } from './types';
|
|
2
|
+
import '../../styles/styles.scss';
|
|
3
|
+
declare const Skeleton: ({ className, styles, baseColor, width, height, borderRadius, circle, containerRef, animationDuration, initialOffset, }: ISkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default Skeleton;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { useEffect, useRef, useState } from 'react';
|
|
7
|
+
import styled, { css, keyframes } from 'styled-components';
|
|
8
|
+
import { generateColor } from '../../helpers';
|
|
9
|
+
import '../../styles/styles.scss';
|
|
10
|
+
var Skeleton = function (_a) {
|
|
11
|
+
var className = _a.className, styles = _a.styles, baseColor = _a.baseColor, width = _a.width, height = _a.height, _b = _a.borderRadius, borderRadius = _b === void 0 ? 8 : _b, circle = _a.circle,
|
|
12
|
+
// needed to determine the offset, the left border must coincide with the left border of the skeletons (without padding in container)
|
|
13
|
+
containerRef = _a.containerRef,
|
|
14
|
+
// if not default, then it must be specified for all skeletons
|
|
15
|
+
_c = _a.animationDuration,
|
|
16
|
+
// if not default, then it must be specified for all skeletons
|
|
17
|
+
animationDuration = _c === void 0 ? 2 : _c,
|
|
18
|
+
// equal to gradient width
|
|
19
|
+
_d = _a.initialOffset,
|
|
20
|
+
// equal to gradient width
|
|
21
|
+
initialOffset = _d === void 0 ? -230 : _d;
|
|
22
|
+
var skeletonRef = useRef(null);
|
|
23
|
+
var _e = useState({ container: { left: 0, width: 0 }, item: { left: 0, width: 0 } }), position = _e[0], setPosition = _e[1];
|
|
24
|
+
//after mount set offset sizes
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
var containerRefCurrent = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
27
|
+
var skeletonRefContainerCurrent = skeletonRef === null || skeletonRef === void 0 ? void 0 : skeletonRef.current;
|
|
28
|
+
if (containerRefCurrent && skeletonRefContainerCurrent) {
|
|
29
|
+
var containerLeft = containerRefCurrent.getBoundingClientRect().left || 0;
|
|
30
|
+
var containerWidth = containerRefCurrent.clientWidth || 0;
|
|
31
|
+
var itemLeft = skeletonRefContainerCurrent.getBoundingClientRect().left || 0;
|
|
32
|
+
var itemWidth = skeletonRefContainerCurrent.getBoundingClientRect().width || 0;
|
|
33
|
+
setPosition({ container: { left: containerLeft, width: containerWidth }, item: { left: itemLeft, width: itemWidth } });
|
|
34
|
+
}
|
|
35
|
+
}, [containerRef]);
|
|
36
|
+
var calculateOffset = function () {
|
|
37
|
+
var diff = position.item.left - position.container.left;
|
|
38
|
+
var startOffset = initialOffset - diff;
|
|
39
|
+
var finalOffset = position.container.width - diff;
|
|
40
|
+
return { startOffset: startOffset, finalOffset: finalOffset };
|
|
41
|
+
};
|
|
42
|
+
var skeletonBackgroundColor = generateColor(baseColor, 'var(--color-input-primary)');
|
|
43
|
+
var skeletonCSS = {
|
|
44
|
+
width: width,
|
|
45
|
+
height: circle ? width : height,
|
|
46
|
+
minWidth: circle ? width : 0,
|
|
47
|
+
borderRadius: circle ? '50%' : borderRadius,
|
|
48
|
+
backgroundColor: skeletonBackgroundColor,
|
|
49
|
+
};
|
|
50
|
+
return (_jsx(StyledSkeleton, { "$animationDuration": animationDuration, "$initialOffset": calculateOffset().startOffset, "$finalOffset": calculateOffset().finalOffset, "$CSS": skeletonCSS, ref: skeletonRef, className: className, style: styles }));
|
|
51
|
+
};
|
|
52
|
+
export default Skeleton;
|
|
53
|
+
var StyledSkeleton = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n overflow: hidden;\n background-size: 230px;\n background-repeat: no-repeat;\n background-image: linear-gradient(\n 90deg,\n var(--color-skeleton-gradient-edge) var(--skeleton-start-edge-gradient-size),\n var(--color-skeleton-gradient-center) var(--skeleton-center-gradient-size),\n var(--color-skeleton-gradient-edge) var(--skeleton-end-edge-gradient-size)\n );\n ", ";\n"], ["\n position: relative;\n overflow: hidden;\n background-size: 230px;\n background-repeat: no-repeat;\n background-image: linear-gradient(\n 90deg,\n var(--color-skeleton-gradient-edge) var(--skeleton-start-edge-gradient-size),\n var(--color-skeleton-gradient-center) var(--skeleton-center-gradient-size),\n var(--color-skeleton-gradient-edge) var(--skeleton-end-edge-gradient-size)\n );\n ", ";\n"])), function (_a) {
|
|
54
|
+
var $CSS = _a.$CSS, $animationDuration = _a.$animationDuration, $initialOffset = _a.$initialOffset, $finalOffset = _a.$finalOffset;
|
|
55
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n animation: ", " ", "s infinite linear;\n ", ";\n "], ["\n animation: ", " ", "s infinite linear;\n ", ";\n "])), flash($initialOffset, $finalOffset), $animationDuration, $CSS);
|
|
56
|
+
});
|
|
57
|
+
var flash = function (initialOffset, finalOffset) { return keyframes(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n 0% {\n background-position: ", "px;\n }\n\n 60%,\n 100% {\n background-position: ", "px;\n }\n \n"], ["\n 0% {\n background-position: ", "px;\n }\n\n 60%,\n 100% {\n background-position: ", "px;\n }\n \n"])), initialOffset, finalOffset); };
|
|
58
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
59
|
+
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sourceRoot":"","sources":["../../../../src/сomponents/Skeleton/Skeleton.tsx"],"names":[],"mappings":";;;;;AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAW,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,OAAO,0BAA0B,CAAA;AAEjC,IAAM,QAAQ,GAAG,UAAC,EAcD;QAbf,SAAS,eAAA,EACT,MAAM,YAAA,EACN,SAAS,eAAA,EACT,KAAK,WAAA,EACL,MAAM,YAAA,EACN,oBAAgB,EAAhB,YAAY,mBAAG,CAAC,KAAA,EAChB,MAAM,YAAA;IACN,qIAAqI;IACrI,YAAY,kBAAA;IACZ,8DAA8D;IAC9D,yBAAqB;IADrB,8DAA8D;IAC9D,iBAAiB,mBAAG,CAAC,KAAA;IACrB,0BAA0B;IAC1B,qBAAoB;IADpB,0BAA0B;IAC1B,aAAa,mBAAG,CAAC,GAAG,KAAA;IAEpB,IAAM,WAAW,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAA;IACjD,IAAA,KAA0B,QAAQ,CAAC,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAApG,QAAQ,QAA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KAAK,OAAA;QACL,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;QAC/B,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5B,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY;QAC3C,eAAe,EAAE,uBAAuB;KACzC,CAAA;IAED,OAAO,CACL,KAAC,cAAc,0BACO,iBAAiB,oBACrB,eAAe,EAAE,CAAC,WAAW,kBAC/B,eAAe,EAAE,CAAC,WAAW,UACrC,WAAW,EACjB,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,GACb,CACH,CAAA;AACH,CAAC,CAAA;AACD,eAAe,QAAQ,CAAA;AASvB,IAAM,cAAc,GAAG,MAAM,CAAC,GAAG,oeAAqB,0ZAWlD,EAGD,KACF,KAJG,UAAC,EAA0D;QAAxD,IAAI,UAAA,EAAE,kBAAkB,wBAAA,EAAE,cAAc,oBAAA,EAAE,YAAY,kBAAA;IAAO,OAAA,GAAG,gIAAA,mBACtD,EAAmC,GAAI,EAAkB,0BACpE,EAAI,OACP,KAFc,KAAK,CAAC,cAAc,EAAE,YAAY,CAAC,EAAI,kBAAkB,EACpE,IAAI;AAF0D,CAGjE,CACF,CAAA;AAED,IAAM,KAAK,GAAG,UAAC,aAAqB,EAAE,WAAmB,IAAK,OAAA,SAAS,kMAAA,wCAE1C,EAAa,iEAKb,EAAW,kBAGvC,KAR4B,aAAa,EAKb,WAAW,GAPsB,CAU7D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Skeleton } from './Skeleton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/сomponents/Skeleton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { IThemeProps, TStyles } from '../../constants';
|
|
3
|
+
type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;
|
|
4
|
+
type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
5
|
+
export interface ISkeletonProps extends IThemeProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
styles?: TStyles;
|
|
8
|
+
baseColor?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
borderRadius?: number;
|
|
12
|
+
circle?: boolean;
|
|
13
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
14
|
+
animationDuration?: IntRange<1, 7>;
|
|
15
|
+
initialOffset?: number;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/сomponents/Skeleton/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IStoriesProps } from './types';
|
|
2
|
+
import '../../styles/styles.scss';
|
|
3
|
+
declare const StoriesComponent: ({ isCloseIconHidden, platform, fontFamily, imageClassName, titleClassName, bodyClassName, buttonClassName, contentClassName, bottomContentClassName, contentStyles, closeIconPosition, closeIcon, bottomContent, groupStories, allGroupsStories, changeStoryToViewed, changeGroupStoriesToViewed, handleCloseGroupStories, }: IStoriesProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
export default StoriesComponent;
|
|
@@ -0,0 +1,300 @@
|
|
|
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 _a, _b;
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
/* eslint-disable max-lines */
|
|
15
|
+
import { useCallback, useEffect, useLayoutEffect, useState } from 'react';
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
import { isNull, sortBy, isEmpty } from 'lodash';
|
|
18
|
+
import Stories from 'react-insta-stories';
|
|
19
|
+
import Popup from 'reactjs-popup';
|
|
20
|
+
import { useSwipeable } from 'react-swipeable';
|
|
21
|
+
import { ReactComponent as CloseStoriesIcon } from '../../assets/icons/close-stories.svg';
|
|
22
|
+
import { ReactComponent as LoaderIcon } from '../../assets/icons/story-loader.svg';
|
|
23
|
+
import { ReactComponent as ExternalLinkIcon } from '../../assets/icons/external-link.svg';
|
|
24
|
+
import { STORY_BACKGROUND_TYPES, STORY_TYPE, } from './types';
|
|
25
|
+
import { COLORS, FONT_FAMILY, NUMBER_OF_STORIES_FOR_ROUND_INDICATORS, PLATFORM } from '../../constants';
|
|
26
|
+
import { generateColor, isIosPlatform, isWebPlatform } from '../../helpers';
|
|
27
|
+
import '../../styles/styles.scss';
|
|
28
|
+
var storyItemBaseStyles = {
|
|
29
|
+
height: '100%',
|
|
30
|
+
width: '100%',
|
|
31
|
+
};
|
|
32
|
+
var progressContainerStyles = function (platform, storiesCount) { return ({
|
|
33
|
+
gap: storiesCount >= NUMBER_OF_STORIES_FOR_ROUND_INDICATORS ? '8px' : '12px',
|
|
34
|
+
width: '100%',
|
|
35
|
+
filter: 'none',
|
|
36
|
+
paddingTop: isWebPlatform(platform) ? '22px' : isIosPlatform(platform) ? '21px' : '26px',
|
|
37
|
+
paddingLeft: '0',
|
|
38
|
+
paddingRight: '0',
|
|
39
|
+
paddingBottom: '0',
|
|
40
|
+
}); };
|
|
41
|
+
var progressWrapperStyles = {
|
|
42
|
+
height: '4px',
|
|
43
|
+
borderRadius: '51px',
|
|
44
|
+
background: 'rgba(255, 255, 255, 0.4)',
|
|
45
|
+
margin: 0,
|
|
46
|
+
overflow: 'hidden',
|
|
47
|
+
};
|
|
48
|
+
var progressStyles = {
|
|
49
|
+
height: '4px',
|
|
50
|
+
borderRadius: '51px',
|
|
51
|
+
background: 'rgba(255, 255, 255, 1)',
|
|
52
|
+
};
|
|
53
|
+
var DEFAULT_STORY_DURATION = 5000;
|
|
54
|
+
var STORY_SIZE;
|
|
55
|
+
(function (STORY_SIZE) {
|
|
56
|
+
STORY_SIZE["xs"] = "xs";
|
|
57
|
+
STORY_SIZE["sm"] = "sm";
|
|
58
|
+
STORY_SIZE["l"] = "l";
|
|
59
|
+
})(STORY_SIZE || (STORY_SIZE = {}));
|
|
60
|
+
var STORY_SIZE_HEIGHT = (_a = {},
|
|
61
|
+
_a[STORY_SIZE.xs] = 620,
|
|
62
|
+
_a[STORY_SIZE.sm] = 768,
|
|
63
|
+
_a[STORY_SIZE.l] = 812,
|
|
64
|
+
_a);
|
|
65
|
+
var STORY_WIDTH_BREAKPOINT = (_b = {},
|
|
66
|
+
_b[STORY_SIZE.xs] = 377,
|
|
67
|
+
_b[STORY_SIZE.sm] = 399,
|
|
68
|
+
_b);
|
|
69
|
+
var generateSize = function (width, height) {
|
|
70
|
+
var isSizeXS = width < STORY_WIDTH_BREAKPOINT[STORY_SIZE.xs] || height < STORY_SIZE_HEIGHT[STORY_SIZE.sm];
|
|
71
|
+
var isSizeSM = width < STORY_WIDTH_BREAKPOINT[STORY_SIZE.sm] || height < STORY_SIZE_HEIGHT[STORY_SIZE.l];
|
|
72
|
+
if (isSizeXS)
|
|
73
|
+
return STORY_SIZE.xs;
|
|
74
|
+
if (isSizeSM)
|
|
75
|
+
return STORY_SIZE.sm;
|
|
76
|
+
return STORY_SIZE.l;
|
|
77
|
+
};
|
|
78
|
+
var PERCENTAGE_OF_IMAGE_WIDTH = 0.827;
|
|
79
|
+
var StoriesComponent = function (_a) {
|
|
80
|
+
var _b;
|
|
81
|
+
var _c = _a.isCloseIconHidden, isCloseIconHidden = _c === void 0 ? false : _c, _d = _a.platform, platform = _d === void 0 ? PLATFORM.web : _d, _e = _a.fontFamily, fontFamily = _e === void 0 ? FONT_FAMILY.openSans : _e, imageClassName = _a.imageClassName, titleClassName = _a.titleClassName, bodyClassName = _a.bodyClassName, buttonClassName = _a.buttonClassName, contentClassName = _a.contentClassName, bottomContentClassName = _a.bottomContentClassName, contentStyles = _a.contentStyles, closeIconPosition = _a.closeIconPosition, closeIcon = _a.closeIcon, bottomContent = _a.bottomContent, groupStories = _a.groupStories, allGroupsStories = _a.allGroupsStories, changeStoryToViewed = _a.changeStoryToViewed, changeGroupStoriesToViewed = _a.changeGroupStoriesToViewed, handleCloseGroupStories = _a.handleCloseGroupStories;
|
|
82
|
+
var sortStoriesByOrder = function (stories) { return sortBy(stories, ['order']); };
|
|
83
|
+
var generateActiveGroupStoriesIndex = function () { return allGroupsStories.findIndex(function (_a) {
|
|
84
|
+
var id = _a.id;
|
|
85
|
+
return id === (activeGroupStories === null || activeGroupStories === void 0 ? void 0 : activeGroupStories.id);
|
|
86
|
+
}); };
|
|
87
|
+
var _f = useState(groupStories), activeGroupStories = _f[0], setActiveGroupStories = _f[1];
|
|
88
|
+
var _g = useState(sortStoriesByOrder((groupStories === null || groupStories === void 0 ? void 0 : groupStories.stories) || [])), stories = _g[0], setStories = _g[1];
|
|
89
|
+
var _h = useState((_b = stories[0]) === null || _b === void 0 ? void 0 : _b.id), activeStoryId = _h[0], setActiveStoryId = _h[1];
|
|
90
|
+
var _j = useState(false), isAnimateToRight = _j[0], setIsAnimateToRight = _j[1];
|
|
91
|
+
var _k = useState(false), isAnimateToLeft = _k[0], setIsAnimateToLeft = _k[1];
|
|
92
|
+
var activeStory = stories.find(function (_a) {
|
|
93
|
+
var id = _a.id;
|
|
94
|
+
return id === activeStoryId;
|
|
95
|
+
});
|
|
96
|
+
var popupElement = document.querySelector('.smartapp-stories-content');
|
|
97
|
+
var containerHeight = (popupElement === null || popupElement === void 0 ? void 0 : popupElement.offsetHeight) || 0;
|
|
98
|
+
var containerWidth = (popupElement === null || popupElement === void 0 ? void 0 : popupElement.offsetWidth) || 0;
|
|
99
|
+
var size = generateSize(containerWidth, containerHeight);
|
|
100
|
+
var isShowCloseIconInsideStory = STORY_SIZE_HEIGHT[size] < containerHeight;
|
|
101
|
+
var isColorOnBackground = function (type) { return type === STORY_BACKGROUND_TYPES.color; };
|
|
102
|
+
var isImageOnBackground = function (_a) {
|
|
103
|
+
var type = _a.type;
|
|
104
|
+
return type === STORY_BACKGROUND_TYPES.image;
|
|
105
|
+
};
|
|
106
|
+
var generateStoryStyles = function (_a) {
|
|
107
|
+
var type = _a.type, value = _a.value;
|
|
108
|
+
return isColorOnBackground(type)
|
|
109
|
+
? __assign(__assign({}, storyItemBaseStyles), { background: value }) : __assign(__assign({}, storyItemBaseStyles), { backgroundImage: "url(".concat(value, ")"), backgroundSize: 'cover', backgroundPosition: 'center', backgroundRepeat: 'no-repeat' });
|
|
110
|
+
};
|
|
111
|
+
var changeActiveGroupStories = function (groupStoriesItem) {
|
|
112
|
+
setActiveGroupStories(groupStoriesItem);
|
|
113
|
+
setStories(sortStoriesByOrder(groupStoriesItem.stories));
|
|
114
|
+
setTimeout(function () {
|
|
115
|
+
setIsAnimateToLeft(false);
|
|
116
|
+
setIsAnimateToRight(false);
|
|
117
|
+
}, 500);
|
|
118
|
+
};
|
|
119
|
+
var handlePrevious = function () {
|
|
120
|
+
var prevGroupStories = allGroupsStories[generateActiveGroupStoriesIndex() - 1];
|
|
121
|
+
if (prevGroupStories) {
|
|
122
|
+
setIsAnimateToLeft(true);
|
|
123
|
+
changeActiveGroupStories(prevGroupStories);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
handleCloseGroupStories();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
var handleNext = function () {
|
|
130
|
+
var nextGroupStories = allGroupsStories[generateActiveGroupStoriesIndex() + 1];
|
|
131
|
+
if (nextGroupStories) {
|
|
132
|
+
setIsAnimateToRight(true);
|
|
133
|
+
changeActiveGroupStories(nextGroupStories);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
handleCloseGroupStories();
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
var onStoryStart = function (storyIndex) {
|
|
140
|
+
var isVideoStory = stories[storyIndex].type === STORY_TYPE.video;
|
|
141
|
+
isVideoStory && setActiveStoryId(stories[storyIndex].id);
|
|
142
|
+
var story = stories.find(function (_a) {
|
|
143
|
+
var id = _a.id;
|
|
144
|
+
return id === stories[storyIndex].id;
|
|
145
|
+
});
|
|
146
|
+
var isLastStory = stories.at(-1).id === story.id;
|
|
147
|
+
if (!story.viewed && changeStoryToViewed) {
|
|
148
|
+
changeStoryToViewed(story, activeGroupStories);
|
|
149
|
+
}
|
|
150
|
+
if (isLastStory && !activeGroupStories.viewed && changeGroupStoriesToViewed) {
|
|
151
|
+
changeGroupStoriesToViewed(activeGroupStories);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
var generateCurrentStoryIndex = useCallback(function () { return stories.findIndex(function (_a) {
|
|
155
|
+
var id = _a.id;
|
|
156
|
+
return id === activeStoryId;
|
|
157
|
+
}); }, [stories, activeStoryId]);
|
|
158
|
+
var onPrevious = function () {
|
|
159
|
+
activeStoryId === stories[0].id ? handlePrevious() : onStoryStart(generateCurrentStoryIndex() - 1);
|
|
160
|
+
};
|
|
161
|
+
var onNext = function () {
|
|
162
|
+
var currentStoryIndex = generateCurrentStoryIndex();
|
|
163
|
+
currentStoryIndex !== stories.length - 1 && onStoryStart(currentStoryIndex + 1);
|
|
164
|
+
};
|
|
165
|
+
var renderButton = function (_a) {
|
|
166
|
+
var text = _a.text, textColor = _a.textColor, backgroundColor = _a.backgroundColor, isTransitionToExternalSource = _a.isTransitionToExternalSource, action = _a.action;
|
|
167
|
+
return (_jsxs("div", __assign({ style: {
|
|
168
|
+
color: generateColor(textColor, COLORS.darkBlack),
|
|
169
|
+
background: generateColor(backgroundColor, COLORS.white),
|
|
170
|
+
}, className: classNames('smartapp-stories__story--bottom-content__button', buttonClassName, {
|
|
171
|
+
'smartapp-stories__story--bottom-content__button--with-icon': isTransitionToExternalSource,
|
|
172
|
+
}), onClick: action }, { children: [text, isTransitionToExternalSource && _jsx(ExternalLinkIcon, {})] })));
|
|
173
|
+
};
|
|
174
|
+
var createImageContent = function (_a) {
|
|
175
|
+
var id = _a.id, durationInMs = _a.durationInMs, title = _a.title, body = _a.body, backgroundSource = _a.backgroundSource, button = _a.button, image = _a.image;
|
|
176
|
+
return ({
|
|
177
|
+
duration: durationInMs || DEFAULT_STORY_DURATION,
|
|
178
|
+
content: function (_a) {
|
|
179
|
+
var action = _a.action;
|
|
180
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
181
|
+
var _b = useState(false), isImageLoaded = _b[0], setIsImageLoaded = _b[1];
|
|
182
|
+
var isLoaderVisible = image && (!isImageLoaded || isAnimateToLeft || isAnimateToRight);
|
|
183
|
+
var storyContainer = document.querySelector('.smartapp-stories');
|
|
184
|
+
var containerWidth = (storyContainer === null || storyContainer === void 0 ? void 0 : storyContainer.offsetWidth) || 0;
|
|
185
|
+
var imageContainerHeight = containerWidth * PERCENTAGE_OF_IMAGE_WIDTH;
|
|
186
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
187
|
+
useLayoutEffect(function () {
|
|
188
|
+
setActiveStoryId(id);
|
|
189
|
+
}, []);
|
|
190
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
191
|
+
useLayoutEffect(function () {
|
|
192
|
+
var timeoutId;
|
|
193
|
+
timeoutId = setTimeout(function () { return action(isLoaderVisible ? 'pause' : 'play'); }, 0);
|
|
194
|
+
return function () { return clearTimeout(timeoutId); };
|
|
195
|
+
// eslint-disable-next-line
|
|
196
|
+
}, [isLoaderVisible]);
|
|
197
|
+
var handleImageLoad = function () {
|
|
198
|
+
setTimeout(function () {
|
|
199
|
+
action('play');
|
|
200
|
+
setIsImageLoaded(true);
|
|
201
|
+
}, 0);
|
|
202
|
+
};
|
|
203
|
+
return (_jsx("div", __assign({ style: generateStoryStyles(backgroundSource) }, { children: _jsxs("div", __assign({ style: __assign({ fontFamily: "".concat(fontFamily, ", sans-serif") }, contentStyles), className: classNames('smartapp-stories__story', { 'smartapp-stories__story--image-bg': isImageOnBackground(backgroundSource) }, contentClassName) }, { children: [_jsxs("div", __assign({ style: { opacity: isLoaderVisible ? '0' : '1' } }, { children: [image && (_jsx("div", __assign({ className: classNames('smartapp-stories__story--image', imageClassName), style: { maxHeight: "".concat(imageContainerHeight, "px") } }, { children: _jsx("img", { src: image, alt: "", onLoad: handleImageLoad, onError: handleImageLoad }) }))), title && _jsx("div", __assign({ className: classNames('smartapp-stories__story--title', titleClassName) }, { children: title })), body && _jsx("div", __assign({ className: classNames('smartapp-stories__story--body', bodyClassName) }, { children: body })), (button || bottomContent) && (_jsxs("div", __assign({ className: classNames('smartapp-stories__story--bottom-content', "smartapp-stories__story--bottom-content__".concat(platform), bottomContentClassName) }, { children: [button && renderButton(button), bottomContent] })))] })), isLoaderVisible && (_jsx("div", __assign({ className: "smartapp-stories__story--loader" }, { children: _jsx(LoaderIcon, {}) })))] })) }), id));
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
var createVideoContent = function (_a) {
|
|
208
|
+
var url = _a.url;
|
|
209
|
+
return ({
|
|
210
|
+
type: STORY_TYPE.video,
|
|
211
|
+
url: url,
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
var generateStories = function () { return stories.map(function (story) { return (story.type === STORY_TYPE.image ? createImageContent(story) : createVideoContent(story)); }); };
|
|
215
|
+
var swipeableHandlers = useSwipeable({
|
|
216
|
+
trackMouse: true,
|
|
217
|
+
onSwipedLeft: function () { return handleNext(); },
|
|
218
|
+
onSwipedRight: function () { return handlePrevious(); },
|
|
219
|
+
});
|
|
220
|
+
var createBackgroundVideo = function (id, url) {
|
|
221
|
+
var video = document.createElement('video');
|
|
222
|
+
video.id = "background_video_".concat(id);
|
|
223
|
+
video.src = url;
|
|
224
|
+
video.muted = true;
|
|
225
|
+
video.playsInline = true;
|
|
226
|
+
video.autoplay = true;
|
|
227
|
+
video.classList.add('smartapp-stories-content__background-video');
|
|
228
|
+
return video;
|
|
229
|
+
};
|
|
230
|
+
useEffect(function () {
|
|
231
|
+
var sortedStories = sortStoriesByOrder((groupStories === null || groupStories === void 0 ? void 0 : groupStories.stories) || []);
|
|
232
|
+
setActiveGroupStories(groupStories);
|
|
233
|
+
setStories(sortedStories);
|
|
234
|
+
}, [groupStories]);
|
|
235
|
+
useEffect(function () {
|
|
236
|
+
var video = document.querySelector('video');
|
|
237
|
+
var pauseVideosOnBackground = function () {
|
|
238
|
+
var backgroundVideos = document.querySelectorAll("#background_video_".concat(activeStoryId));
|
|
239
|
+
backgroundVideos.forEach(function (video) { return video.pause(); });
|
|
240
|
+
};
|
|
241
|
+
var playVideosOnBackground = function () {
|
|
242
|
+
var backgroundVideos = document.querySelectorAll("#background_video_".concat(activeStoryId));
|
|
243
|
+
backgroundVideos.forEach(function (video) { return video.play().catch(function () { }); });
|
|
244
|
+
};
|
|
245
|
+
video === null || video === void 0 ? void 0 : video.addEventListener('play', playVideosOnBackground);
|
|
246
|
+
video === null || video === void 0 ? void 0 : video.addEventListener('pause', pauseVideosOnBackground);
|
|
247
|
+
return function () {
|
|
248
|
+
video === null || video === void 0 ? void 0 : video.removeEventListener('play', playVideosOnBackground);
|
|
249
|
+
video === null || video === void 0 ? void 0 : video.removeEventListener('pause', pauseVideosOnBackground);
|
|
250
|
+
};
|
|
251
|
+
}, [activeStoryId]);
|
|
252
|
+
useEffect(function () {
|
|
253
|
+
var currentStoryIndex = generateCurrentStoryIndex();
|
|
254
|
+
var indicatorsContainer = document.querySelector('.smartapp-stories > div:first-of-type > div:first-of-type');
|
|
255
|
+
var indicators = Array.from((indicatorsContainer === null || indicatorsContainer === void 0 ? void 0 : indicatorsContainer.children) || []);
|
|
256
|
+
indicators.forEach(function (indicator, index) {
|
|
257
|
+
if (indicators.length >= NUMBER_OF_STORIES_FOR_ROUND_INDICATORS) {
|
|
258
|
+
indicator.style.width = index !== currentStoryIndex ? '4px' : '48px';
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
indicator.style.width = '38px';
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}, [generateCurrentStoryIndex]);
|
|
265
|
+
useEffect(function () {
|
|
266
|
+
var popupElement = document.querySelector('.smartapp-stories-content');
|
|
267
|
+
var videoWrapper = document.querySelector('.smartapp-stories-content > div > div > div:nth-child(2) > div');
|
|
268
|
+
if (activeStory) {
|
|
269
|
+
if (activeStory.type === STORY_TYPE.image) {
|
|
270
|
+
var _a = activeStory.backgroundSource, type = _a.type, value = _a.value;
|
|
271
|
+
var prevBackgroundVideos = document.querySelectorAll('.smartapp-stories-content__background-video');
|
|
272
|
+
var background = isColorOnBackground(type) ? value : "url(".concat(value, ")");
|
|
273
|
+
!isEmpty(prevBackgroundVideos) && prevBackgroundVideos.forEach(function (video) { return video.remove(); });
|
|
274
|
+
isWebPlatform(platform) && (popupElement === null || popupElement === void 0 ? void 0 : popupElement.style.setProperty('--background', background));
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
var id = activeStory.id, url = activeStory.url;
|
|
278
|
+
var prevBackgroundVideos = document.querySelectorAll('.smartapp-stories-content__background-video');
|
|
279
|
+
!isEmpty(prevBackgroundVideos) && prevBackgroundVideos.forEach(function (video) { return video.remove(); });
|
|
280
|
+
// eslint-disable-next-line max-depth
|
|
281
|
+
if (isWebPlatform(platform)) {
|
|
282
|
+
popupElement === null || popupElement === void 0 ? void 0 : popupElement.style.removeProperty('--background');
|
|
283
|
+
popupElement === null || popupElement === void 0 ? void 0 : popupElement.appendChild(createBackgroundVideo(id, url));
|
|
284
|
+
}
|
|
285
|
+
videoWrapper === null || videoWrapper === void 0 ? void 0 : videoWrapper.appendChild(createBackgroundVideo(id, url));
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}, [platform, activeStory]);
|
|
289
|
+
if (isNull(activeGroupStories)) {
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
var closeStoriesIcon = !isCloseIconHidden && (_jsx("div", __assign({ className: classNames('smartapp-stories__icon', "smartapp-stories__icon--".concat(platform), "smartapp-stories__icon--".concat(closeIconPosition)), onClick: handleCloseGroupStories }, { children: closeIcon || _jsx(CloseStoriesIcon, {}) })));
|
|
293
|
+
return (_jsxs(Popup, __assign({ className: "smartapp-stories", open: true }, { children: [_jsxs("div", __assign({ className: classNames('smartapp-stories', "smartapp-stories__".concat(size), "smartapp-stories__".concat(platform), {
|
|
294
|
+
'smartapp-stories__video': (activeStory === null || activeStory === void 0 ? void 0 : activeStory.type) === STORY_TYPE.video,
|
|
295
|
+
'smartapp-stories__animate-right': isAnimateToRight,
|
|
296
|
+
'smartapp-stories__animate-left': isAnimateToLeft,
|
|
297
|
+
}) }, swipeableHandlers, { children: [_jsx(Stories, { defaultInterval: 6000, width: "100%", height: "100%", stories: generateStories(), onStoryStart: onStoryStart, onPrevious: onPrevious, onNext: onNext, onAllStoriesEnd: handleNext, progressContainerStyles: progressContainerStyles(platform, stories.length), progressWrapperStyles: progressWrapperStyles, progressStyles: progressStyles }, activeGroupStories.id), isShowCloseIconInsideStory && closeStoriesIcon] })), !isShowCloseIconInsideStory && closeStoriesIcon] })));
|
|
298
|
+
};
|
|
299
|
+
export default StoriesComponent;
|
|
300
|
+
//# sourceMappingURL=Stories.js.map
|