@expressms/smartapp-ui 3.0.0-alpha.22 → 3.0.0-alpha.220
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/accepted-invite-status.svg +4 -0
- 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/calendar-arrow-next.svg +3 -0
- package/build/main/assets/icons/calendar-arrow-prev.svg +3 -0
- package/build/main/assets/icons/check-mark-square.svg +4 -0
- package/build/main/assets/icons/check-mark.svg +4 -0
- package/build/main/assets/icons/chevron.svg +3 -0
- package/build/main/assets/icons/chip-info.svg +5 -0
- package/build/main/assets/icons/clear.svg +3 -0
- package/build/main/assets/icons/close-modal.svg +3 -0
- package/build/main/assets/icons/close-stories.svg +4 -0
- package/build/main/assets/icons/close.svg +3 -0
- package/build/main/assets/icons/contact-info.svg +5 -0
- package/build/main/assets/icons/copy.svg +3 -0
- package/build/main/assets/icons/corporate-user.svg +3 -0
- package/build/main/assets/icons/crown.svg +5 -0
- package/build/main/assets/icons/declined-invite-status.svg +4 -0
- package/build/main/assets/icons/delete-chip.svg +3 -0
- package/build/main/assets/icons/department.svg +3 -0
- package/build/main/assets/icons/distribution.svg +12 -0
- package/build/main/assets/icons/doc-small.svg +11 -0
- package/build/main/assets/icons/doc.svg +11 -0
- package/build/main/assets/icons/download.svg +3 -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 +5 -0
- package/build/main/assets/icons/eye-on.svg +4 -0
- package/build/main/assets/icons/file-small.svg +11 -0
- package/build/main/assets/icons/file.svg +11 -0
- package/build/main/assets/icons/global-address-book-user.svg +4 -0
- package/build/main/assets/icons/group.svg +3 -0
- package/build/main/assets/icons/image-no-preview-small.svg +11 -0
- package/build/main/assets/icons/image-no-preview.svg +11 -0
- package/build/main/assets/icons/indeterminate-check-mark-square.svg +4 -0
- package/build/main/assets/icons/info.svg +5 -0
- package/build/main/assets/icons/input-arrow-down.svg +3 -0
- package/build/main/assets/icons/input-arrow-up.svg +3 -0
- package/build/main/assets/icons/job-position.svg +3 -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/more.svg +3 -0
- package/build/main/assets/icons/my-contacts-user.svg +3 -0
- package/build/main/assets/icons/needs-action-invite-status.svg +4 -0
- package/build/main/assets/icons/notification-close.svg +3 -0
- package/build/main/assets/icons/notification-error.svg +5 -0
- package/build/main/assets/icons/notification-failure-filled.svg +3 -0
- package/build/main/assets/icons/notification-failure.svg +3 -0
- package/build/main/assets/icons/notification-info-filled.svg +5 -0
- package/build/main/assets/icons/notification-info.svg +5 -0
- package/build/main/assets/icons/notification-success-filled.svg +4 -0
- package/build/main/assets/icons/notification-success.svg +4 -0
- package/build/main/assets/icons/office.svg +3 -0
- package/build/main/assets/icons/order.svg +6 -0
- package/build/main/assets/icons/pdf-small.svg +11 -0
- package/build/main/assets/icons/pdf.svg +11 -0
- package/build/main/assets/icons/play-small.svg +3 -0
- package/build/main/assets/icons/play.svg +3 -0
- package/build/main/assets/icons/plus.svg +4 -0
- package/build/main/assets/icons/ppt-small.svg +11 -0
- package/build/main/assets/icons/ppt.svg +11 -0
- package/build/main/assets/icons/private.svg +5 -0
- package/build/main/assets/icons/refresh.svg +3 -0
- package/build/main/assets/icons/remove.svg +3 -0
- package/build/main/assets/icons/search.svg +3 -0
- package/build/main/assets/icons/select-arrow-down.svg +3 -0
- package/build/main/assets/icons/select-arrow-up.svg +3 -0
- package/build/main/assets/icons/server.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/txt-small.svg +11 -0
- package/build/main/assets/icons/txt.svg +11 -0
- package/build/main/assets/icons/video-no-preview-small.svg +11 -0
- package/build/main/assets/icons/video-no-preview.svg +11 -0
- package/build/main/assets/icons/warning-avatar.svg +4 -0
- package/build/main/assets/icons/xls-small.svg +11 -0
- package/build/main/assets/icons/xls.svg +11 -0
- package/build/main/assets/storybook/index.d.ts +27 -0
- package/build/main/assets/storybook/index.js +28 -0
- package/build/main/assets/storybook/index.js.map +1 -0
- package/build/main/constants/constants.d.ts +245 -0
- package/build/main/constants/constants.js +303 -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 +69 -0
- package/build/main/constants/types.js +2 -0
- package/build/main/constants/types.js.map +1 -0
- package/build/main/helpers/fontScale.d.ts +3 -0
- package/build/main/helpers/fontScale.js +17 -0
- package/build/main/helpers/fontScale.js.map +1 -0
- package/build/main/helpers/index.d.ts +34 -0
- package/build/main/helpers/index.js +205 -0
- package/build/main/helpers/index.js.map +1 -0
- package/build/main/hooks/useCharHintDisplay.d.ts +10 -0
- package/build/main/hooks/useCharHintDisplay.js +57 -0
- package/build/main/hooks/useCharHintDisplay.js.map +1 -0
- package/build/main/hooks/useFontScale.d.ts +1 -0
- package/build/main/hooks/useFontScale.js +19 -0
- package/build/main/hooks/useFontScale.js.map +1 -0
- package/build/main/hooks/useMobileLongTap.d.ts +16 -0
- package/build/main/hooks/useMobileLongTap.js +65 -0
- package/build/main/hooks/useMobileLongTap.js.map +1 -0
- package/build/main/hooks/useModal.d.ts +30 -0
- package/build/main/hooks/useModal.js +275 -0
- package/build/main/hooks/useModal.js.map +1 -0
- package/build/main/index.d.ts +40 -0
- package/build/main/index.js +41 -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 +53 -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 +23 -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 +201 -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 +23 -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 +5 -0
- package/build/main//321/201omponents/Avatar/Avatar.js +257 -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 +64 -0
- package/build/main//321/201omponents/Avatar/types.js +32 -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 +68 -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 +31 -0
- package/build/main//321/201omponents/Button/types.js +15 -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 +16 -0
- package/build/main//321/201omponents/Calendar/Calendar.js +294 -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 +28 -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 +49 -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 +45 -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 +66 -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 +42 -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 +74 -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 +89 -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 +8 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.js +48 -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 +14 -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 +5 -0
- package/build/main//321/201omponents/Chip/Chip.js +288 -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 +39 -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/ChipDndContext/ChipDndContext.d.ts +13 -0
- package/build/main//321/201omponents/ChipDndContext/ChipDndContext.js +76 -0
- package/build/main//321/201omponents/ChipDndContext/ChipDndContext.js.map +1 -0
- package/build/main//321/201omponents/ChipDndContext/index.d.ts +1 -0
- package/build/main//321/201omponents/ChipDndContext/index.js +2 -0
- package/build/main//321/201omponents/ChipDndContext/index.js.map +1 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.d.ts +4 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +64 -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 +31 -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 +122 -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 +41 -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/ContextMenuItem/ContextMenuItem.d.ts +4 -0
- package/build/main//321/201omponents/ContextMenuItem/ContextMenuItem.js +49 -0
- package/build/main//321/201omponents/ContextMenuItem/ContextMenuItem.js.map +1 -0
- package/build/main//321/201omponents/ContextMenuItem/index.d.ts +1 -0
- package/build/main//321/201omponents/ContextMenuItem/index.js +2 -0
- package/build/main//321/201omponents/ContextMenuItem/index.js.map +1 -0
- package/build/main//321/201omponents/ContextMenuItem/types.d.ts +28 -0
- package/build/main//321/201omponents/ContextMenuItem/types.js +6 -0
- package/build/main//321/201omponents/ContextMenuItem/types.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.d.ts +12 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js +281 -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 +78 -0
- package/build/main//321/201omponents/CustomSelect/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelect/types.d.ts +86 -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 +67 -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/selectStyles.d.ts +12 -0
- package/build/main//321/201omponents/CustomSelectProfiles/selectStyles.js +42 -0
- package/build/main//321/201omponents/CustomSelectProfiles/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.d.ts +13 -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 +228 -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 +90 -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 +35 -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 +21 -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 +47 -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 +256 -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 +37 -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 +214 -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 +47 -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 +5 -0
- package/build/main//321/201omponents/Modal/Modal.js +397 -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 +77 -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 +4 -0
- package/build/main//321/201omponents/Notification/Notification.js +208 -0
- package/build/main//321/201omponents/Notification/Notification.js.map +1 -0
- package/build/main//321/201omponents/Notification/constants.d.ts +34 -0
- package/build/main//321/201omponents/Notification/constants.js +59 -0
- package/build/main//321/201omponents/Notification/constants.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 +64 -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 +33 -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 +140 -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 +24 -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 +406 -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 +71 -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 +8 -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 +59 -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 +13 -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 +35 -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 +40 -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 +98 -0
- package/build/main//321/201omponents/UserDropdown/ContactInfo/ContactInfo.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.d.ts +5 -0
- package/build/main//321/201omponents/UserDropdown/LoadingMessage/LoadingMessage.js +24 -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 +104 -0
- package/build/main//321/201omponents/UserDropdown/MenuList/MenuList.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.d.ts +4 -0
- package/build/main//321/201omponents/UserDropdown/MultiValueLabel/MultiValueLabel.js +133 -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 +85 -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 +41 -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 +527 -0
- package/build/main//321/201omponents/UserDropdown/UserDropdown.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.d.ts +8 -0
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.js +10 -0
- package/build/main//321/201omponents/UserDropdown/components/Delimiter.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.d.ts +6 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.js +21 -0
- package/build/main//321/201omponents/UserDropdown/components/Hint.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.d.ts +2 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.js +24 -0
- package/build/main//321/201omponents/UserDropdown/components/Input.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.d.ts +8 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.js +19 -0
- package/build/main//321/201omponents/UserDropdown/components/Mask.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.d.ts +5 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.js +18 -0
- package/build/main//321/201omponents/UserDropdown/components/Title.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/constants.d.ts +65 -0
- package/build/main//321/201omponents/UserDropdown/constants.js +83 -0
- package/build/main//321/201omponents/UserDropdown/constants.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/helpers.d.ts +148 -0
- package/build/main//321/201omponents/UserDropdown/helpers.js +313 -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 +99 -0
- package/build/main//321/201omponents/UserDropdown/selectStyles.js.map +1 -0
- package/build/main//321/201omponents/UserDropdown/types.d.ts +356 -0
- package/build/main//321/201omponents/UserDropdown/types.js +2 -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 +13 -8
|
@@ -0,0 +1,205 @@
|
|
|
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 DOMPurify from 'dompurify';
|
|
15
|
+
import juice from 'juice';
|
|
16
|
+
import { isArray, isNil } from 'lodash';
|
|
17
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
18
|
+
import { DISPLAY_SIZE } from '../сomponents/AttachedFile/AttachedFile';
|
|
19
|
+
import { AVATAR_COLOR_BOTTOM, AVATAR_COLOR_BOTTOM_PERCENTS, AVATAR_COLOR_MIDDLE, AVATAR_COLOR_MIDDLE_PERCENTS, AVATAR_COLOR_TOP, AVATAR_COLOR_TOP_PERCENTS, AVATAR_DEGREES, BOTTOM_SHEET, CENTER, COLORS, DEFAULT_HEADER_AVATAR_INDEX, FILE_FORMATS, FONT_FAMILY, LAYOUT_TYPE, MODAL_ICONS_PADDING_LEFT, PLATFORM, THEME, } from '../constants';
|
|
20
|
+
import { CONTACT_TYPES } from '../сomponents/UserDropdown/constants';
|
|
21
|
+
import { ReactComponent as CorporateUserIcon } from '../assets/icons/corporate-user.svg';
|
|
22
|
+
import { ReactComponent as DistributionIcon } from '../assets/icons/distribution.svg';
|
|
23
|
+
import { ReactComponent as DocFileSmallIcon } from '../assets/icons/doc-small.svg';
|
|
24
|
+
import { ReactComponent as DocFileIcon } from '../assets/icons/doc.svg';
|
|
25
|
+
import { ReactComponent as FileSmallIcon } from '../assets/icons/file-small.svg';
|
|
26
|
+
import { ReactComponent as FileIcon } from '../assets/icons/file.svg';
|
|
27
|
+
import { ReactComponent as GlobalAddressBookIcon } from '../assets/icons/global-address-book-user.svg';
|
|
28
|
+
import { ReactComponent as GroupIcon } from '../assets/icons/group.svg';
|
|
29
|
+
import { ReactComponent as ImageFileSmallIcon } from '../assets/icons/image-no-preview-small.svg';
|
|
30
|
+
import { ReactComponent as ImageFileIcon } from '../assets/icons/image-no-preview.svg';
|
|
31
|
+
import { ReactComponent as MeetingRoomIcon } from '../assets/icons/meeting-room.svg';
|
|
32
|
+
import { ReactComponent as MyContactsUserIcon } from '../assets/icons/my-contacts-user.svg';
|
|
33
|
+
import { ReactComponent as PdfFileSmallIcon } from '../assets/icons/pdf-small.svg';
|
|
34
|
+
import { ReactComponent as PdfFileIcon } from '../assets/icons/pdf.svg';
|
|
35
|
+
import { ReactComponent as PptFileSmallIcon } from '../assets/icons/ppt-small.svg';
|
|
36
|
+
import { ReactComponent as PptFileIcon } from '../assets/icons/ppt.svg';
|
|
37
|
+
import { ReactComponent as TxtFileSmallIcon } from '../assets/icons/txt-small.svg';
|
|
38
|
+
import { ReactComponent as TxtFileIcon } from '../assets/icons/txt.svg';
|
|
39
|
+
import { ReactComponent as VideoFileSmallIcon } from '../assets/icons/video-no-preview-small.svg';
|
|
40
|
+
import { ReactComponent as VideoFileIcon } from '../assets/icons/video-no-preview.svg';
|
|
41
|
+
import { ReactComponent as XlsFileSmallIcon } from '../assets/icons/xls-small.svg';
|
|
42
|
+
import { ReactComponent as XlsFileIcon } from '../assets/icons/xls.svg';
|
|
43
|
+
export { getFontScale, generateScaledCssValue, generateScaledFontValue } from './fontScale';
|
|
44
|
+
export var generateColor = function (color, defaultColor) {
|
|
45
|
+
if (defaultColor === void 0) { defaultColor = ''; }
|
|
46
|
+
return (color && CSS.supports('color', color) ? color : defaultColor);
|
|
47
|
+
};
|
|
48
|
+
export var checkIsWebPlatform = function (platform) { return platform === PLATFORM.web; };
|
|
49
|
+
export var checkIsIosPlatform = function (platform) { return platform === PLATFORM.ios; };
|
|
50
|
+
export var checkIsAndroidPlatform = function (platform) { return platform === PLATFORM.android; };
|
|
51
|
+
export var checkIsMobilePlatform = function (platform) {
|
|
52
|
+
return checkIsAndroidPlatform(platform) || checkIsIosPlatform(platform) || platform === PLATFORM.aurora;
|
|
53
|
+
};
|
|
54
|
+
export var isDarkTheme = function (theme) { return theme === THEME.dark; };
|
|
55
|
+
export var generateClassNames = function (_a) {
|
|
56
|
+
var className = _a.className, delimiter = _a.delimiter, additionalClassName = _a.additionalClassName;
|
|
57
|
+
return isArray(additionalClassName)
|
|
58
|
+
? classNames(className, additionalClassName.map(function (name) { return "".concat(className).concat(delimiter).concat(name); }))
|
|
59
|
+
: classNames(className, "".concat(className).concat(delimiter).concat(additionalClassName));
|
|
60
|
+
};
|
|
61
|
+
export var userNameToColor = function (userName) {
|
|
62
|
+
var _a = generateAvatarColor(userName), degrees = _a.degrees, top = _a.top, topPercent = _a.topPercent, middle = _a.middle, middlePercent = _a.middlePercent, bottom = _a.bottom, bottomPercent = _a.bottomPercent;
|
|
63
|
+
return middle
|
|
64
|
+
? "linear-gradient(".concat(degrees, "deg, ").concat(top, " ").concat(topPercent, "%, ").concat(middle, " ").concat(middlePercent, "%, ").concat(bottom, " ").concat(bottomPercent, "%)")
|
|
65
|
+
: "linear-gradient(".concat(degrees, "deg, ").concat(top, " ").concat(topPercent, "%, ").concat(bottom, " ").concat(bottomPercent, "%)");
|
|
66
|
+
};
|
|
67
|
+
var generateAvatarData = function (index) { return ({
|
|
68
|
+
degrees: AVATAR_DEGREES[index],
|
|
69
|
+
top: AVATAR_COLOR_TOP[index],
|
|
70
|
+
topPercent: AVATAR_COLOR_TOP_PERCENTS[index],
|
|
71
|
+
middle: AVATAR_COLOR_MIDDLE[index],
|
|
72
|
+
middlePercent: AVATAR_COLOR_MIDDLE_PERCENTS[index],
|
|
73
|
+
bottom: AVATAR_COLOR_BOTTOM[index],
|
|
74
|
+
bottomPercent: AVATAR_COLOR_BOTTOM_PERCENTS[index],
|
|
75
|
+
}); };
|
|
76
|
+
var generateAvatarColor = function (str) {
|
|
77
|
+
if (!str)
|
|
78
|
+
return generateAvatarData(DEFAULT_HEADER_AVATAR_INDEX);
|
|
79
|
+
var stylesIndex = calculateAvatarStylesIndex(str) || 0;
|
|
80
|
+
return generateAvatarData(stylesIndex);
|
|
81
|
+
};
|
|
82
|
+
var calculateAvatarStylesIndex = function (str) { return Math.abs(hashCode(str) % AVATAR_COLOR_TOP.length); };
|
|
83
|
+
var hashCode = function (str) {
|
|
84
|
+
return str.split('').reduce(function (a, b) {
|
|
85
|
+
a = (a << 5) - a + b.charCodeAt(0);
|
|
86
|
+
return a & a;
|
|
87
|
+
}, 0);
|
|
88
|
+
};
|
|
89
|
+
var generateFirstLetterOfWord = function (word) { return (word === null || word === void 0 ? void 0 : word[0]) || ''; };
|
|
90
|
+
export var createInitials = function (str) {
|
|
91
|
+
var _a = str.trim().toUpperCase().split(' '), firstWord = _a[0], secondWord = _a[1];
|
|
92
|
+
return "".concat(generateFirstLetterOfWord(firstWord)).concat(generateFirstLetterOfWord(secondWord));
|
|
93
|
+
};
|
|
94
|
+
export var calculatePercentageOfValue = function (_a) {
|
|
95
|
+
var value = _a.value, percentage = _a.percentage, _b = _a.shouldBeRounded, shouldBeRounded = _b === void 0 ? true : _b;
|
|
96
|
+
var result = (value * percentage) / 100;
|
|
97
|
+
return shouldBeRounded ? Math.ceil(result) : result;
|
|
98
|
+
};
|
|
99
|
+
export var isFullScreen = function (layoutType) { return layoutType === LAYOUT_TYPE.full; };
|
|
100
|
+
export var isValueEqualToZero = function (value) { return value === 0; };
|
|
101
|
+
export var renderStoryComponent = function (_a) {
|
|
102
|
+
var component = _a.component, componentDarkTheme = _a.componentDarkTheme, styles = _a.styles;
|
|
103
|
+
return (_jsxs("div", __assign({ style: { display: 'flex', flexDirection: 'column', gap: '16px' } }, { children: [_jsxs("div", __assign({ style: __assign({ border: '1px dashed #9747FF', borderRadius: '5px', padding: '0 16px 16px' }, styles) }, { children: [_jsx("h3", { children: "Light Theme" }), component] })), _jsxs("div", __assign({ style: __assign({ background: '#242424', borderRadius: '5px', padding: '0 16px 16px' }, styles) }, { children: [_jsx("h3", __assign({ style: { color: '#F9F9F9' } }, { children: "Dark Theme" })), _jsx("div", __assign({ "data-theme": "dark" }, { children: componentDarkTheme || component }))] }))] })));
|
|
104
|
+
};
|
|
105
|
+
export var generateIsCloseIconHidden = function (platform, isCloseIconHidden) {
|
|
106
|
+
return isNil(isCloseIconHidden) ? checkIsMobilePlatform(platform) : isCloseIconHidden;
|
|
107
|
+
};
|
|
108
|
+
var isTextAlignEqualToCenter = function (element) { return (element ? window.getComputedStyle(element).textAlign === CENTER : false); };
|
|
109
|
+
export var checkIfContentIsCentered = function (elementRef) {
|
|
110
|
+
var elementRefCurrent = elementRef.current;
|
|
111
|
+
if (elementRefCurrent)
|
|
112
|
+
return isTextAlignEqualToCenter(elementRefCurrent) || isTextAlignEqualToCenter(elementRefCurrent.firstElementChild);
|
|
113
|
+
};
|
|
114
|
+
export var generateBottomSheetClassName = function (platform, shouldUseBottomSheet) {
|
|
115
|
+
return [platform, shouldUseBottomSheet ? BOTTOM_SHEET : ''].filter(Boolean);
|
|
116
|
+
};
|
|
117
|
+
export var generateId = function () { return uuidv4(); };
|
|
118
|
+
export var generateAvatarIcon = function (userType) {
|
|
119
|
+
switch (userType) {
|
|
120
|
+
case CONTACT_TYPES.privateDL:
|
|
121
|
+
return _jsx(GroupIcon, { color: COLORS.iconContrast });
|
|
122
|
+
case CONTACT_TYPES.publicDL:
|
|
123
|
+
return _jsx(DistributionIcon, { color: COLORS.iconContrast });
|
|
124
|
+
case CONTACT_TYPES.meetingRoom:
|
|
125
|
+
return _jsx(MeetingRoomIcon, { color: COLORS.iconContrast });
|
|
126
|
+
default:
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
export var renderUserIcon = function (_a) {
|
|
131
|
+
var isMyContacts = _a.isMyContacts, isLocalContact = _a.isLocalContact, isCachedContact = _a.isCachedContact, userType = _a.userType, style = _a.style;
|
|
132
|
+
if (isMyContacts)
|
|
133
|
+
return _jsx(MyContactsUserIcon, { color: COLORS.iconSecondary, style: style });
|
|
134
|
+
if (isLocalContact || isCachedContact)
|
|
135
|
+
return _jsx(GlobalAddressBookIcon, { color: COLORS.iconPrimary, style: style });
|
|
136
|
+
switch (userType) {
|
|
137
|
+
case CONTACT_TYPES.myContact:
|
|
138
|
+
case CONTACT_TYPES.privateDL:
|
|
139
|
+
return _jsx(MyContactsUserIcon, { color: COLORS.iconSecondary, style: style });
|
|
140
|
+
case CONTACT_TYPES.GALContact:
|
|
141
|
+
return _jsx(GlobalAddressBookIcon, { color: COLORS.iconPrimary, style: style });
|
|
142
|
+
case CONTACT_TYPES.meetingRoom:
|
|
143
|
+
case CONTACT_TYPES.publicDL:
|
|
144
|
+
return null;
|
|
145
|
+
default:
|
|
146
|
+
return _jsx(CorporateUserIcon, { color: COLORS.iconAccent, style: style });
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
export var extractFileExtensionRegex = function (filename) {
|
|
150
|
+
var match = filename.match(/\.([a-z0-9]+)$/i);
|
|
151
|
+
return (match === null || match === void 0 ? void 0 : match[1]) || '';
|
|
152
|
+
};
|
|
153
|
+
export var generateFileIcon = function (fileName, displaySize) {
|
|
154
|
+
var isSmallDisplaySize = displaySize === DISPLAY_SIZE.small;
|
|
155
|
+
var fileExtension = extractFileExtensionRegex(fileName);
|
|
156
|
+
switch (fileExtension) {
|
|
157
|
+
case FILE_FORMATS.pdf:
|
|
158
|
+
return isSmallDisplaySize ? _jsx(PdfFileSmallIcon, {}) : _jsx(PdfFileIcon, {});
|
|
159
|
+
case FILE_FORMATS.doc:
|
|
160
|
+
case FILE_FORMATS.docx:
|
|
161
|
+
return isSmallDisplaySize ? _jsx(DocFileSmallIcon, {}) : _jsx(DocFileIcon, {});
|
|
162
|
+
case FILE_FORMATS.xls:
|
|
163
|
+
case FILE_FORMATS.xlsx:
|
|
164
|
+
return isSmallDisplaySize ? _jsx(XlsFileSmallIcon, {}) : _jsx(XlsFileIcon, {});
|
|
165
|
+
case FILE_FORMATS.ppt:
|
|
166
|
+
case FILE_FORMATS.pptx:
|
|
167
|
+
return isSmallDisplaySize ? _jsx(PptFileSmallIcon, {}) : _jsx(PptFileIcon, {});
|
|
168
|
+
case FILE_FORMATS.txt:
|
|
169
|
+
return isSmallDisplaySize ? _jsx(TxtFileSmallIcon, {}) : _jsx(TxtFileIcon, {});
|
|
170
|
+
case FILE_FORMATS.mov:
|
|
171
|
+
case FILE_FORMATS.mp4:
|
|
172
|
+
case FILE_FORMATS.webm:
|
|
173
|
+
case FILE_FORMATS.wmv:
|
|
174
|
+
return isSmallDisplaySize ? _jsx(VideoFileSmallIcon, {}) : _jsx(VideoFileIcon, {});
|
|
175
|
+
case FILE_FORMATS.jpg:
|
|
176
|
+
case FILE_FORMATS.jpeg:
|
|
177
|
+
case FILE_FORMATS.png:
|
|
178
|
+
return isSmallDisplaySize ? _jsx(ImageFileSmallIcon, {}) : _jsx(ImageFileIcon, {});
|
|
179
|
+
default:
|
|
180
|
+
return isSmallDisplaySize ? _jsx(FileSmallIcon, {}) : _jsx(FileIcon, {});
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
export var renderCloseIconSpace = function (_a) {
|
|
184
|
+
var _b;
|
|
185
|
+
var elementRef = _a.elementRef, closeIconRef = _a.closeIconRef, _c = _a.isContent, isContent = _c === void 0 ? false : _c;
|
|
186
|
+
var _d = (((_b = closeIconRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) || {}).width, width = _d === void 0 ? 0 : _d;
|
|
187
|
+
return (_jsx("div", { style: { '--close-icon-space-width': "".concat(width + MODAL_ICONS_PADDING_LEFT, "px") }, className: classNames('close-icon-space', {
|
|
188
|
+
'close-icon-space__content': isContent,
|
|
189
|
+
'close-icon-space__centered': checkIfContentIsCentered(elementRef),
|
|
190
|
+
}) }));
|
|
191
|
+
};
|
|
192
|
+
export var generateFontFamilyStyle = function (fontFamily) {
|
|
193
|
+
if (fontFamily === void 0) { fontFamily = FONT_FAMILY.inter; }
|
|
194
|
+
return ({ fontFamily: "".concat(fontFamily, ", sans-serif") });
|
|
195
|
+
};
|
|
196
|
+
export var createSanitizedHtml = function (str) {
|
|
197
|
+
var preparedHtml = juice(str);
|
|
198
|
+
var html = DOMPurify.sanitize(preparedHtml);
|
|
199
|
+
return { __html: html };
|
|
200
|
+
};
|
|
201
|
+
export var clickOutsideTheModal = function (closeModal, clickOutside) { return (clickOutside ? clickOutside() : closeModal()); };
|
|
202
|
+
export var checkIfContactTypeIsGroup = function (contactType) {
|
|
203
|
+
return contactType === CONTACT_TYPES.publicDL || contactType === CONTACT_TYPES.privateDL;
|
|
204
|
+
};
|
|
205
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AI,EAAmB,EAC/F,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE;YACxC,2BAA2B,EAAE,SAAS;YACtC,4BAA4B,EAAE,wBAAwB,CAAC,UAAU,CAAC;SACnE,CAAC,GACF,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,UAAsC;IAAtC,2BAAA,EAAA,aAAqB,WAAW,CAAC,KAAK;IAAK,OAAA,CAAC,EAAE,UAAU,EAAE,UAAG,UAAU,iBAAc,EAAE,CAAC;AAA7C,CAA6C,CAAA;AAEhI,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,GAAW;IAC7C,IAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/B,IAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA;IAC7C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;AACzB,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,oBAAoB,GAAG,UAAC,UAAsB,EAAE,YAAyB,IAAK,OAAA,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,EAA9C,CAA8C,CAAA;AAEzI,MAAM,CAAC,IAAM,yBAAyB,GAAG,UAAC,WAA2B;IACnE,OAAA,WAAW,KAAK,aAAa,CAAC,QAAQ,IAAI,WAAW,KAAK,aAAa,CAAC,SAAS;AAAjF,CAAiF,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type TUseCharHintDisplay = {
|
|
2
|
+
isFieldFocused?: boolean;
|
|
3
|
+
isCharHintEnable?: boolean;
|
|
4
|
+
inputValue: string;
|
|
5
|
+
charHintTimeout?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const useCharHintDisplay: ({ isFieldFocused, isCharHintEnable, inputValue, charHintTimeout, }: TUseCharHintDisplay) => {
|
|
8
|
+
isCharHintVisible: boolean;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { isNil } from 'lodash';
|
|
3
|
+
import { MIN_INPUT_SYMBOLS } from '../constants';
|
|
4
|
+
var ONE_CHARACTER = 1;
|
|
5
|
+
var TWO_CHARACTERS = 2;
|
|
6
|
+
var DEFAULT_CHAR_HINT_TIMEOUT = 1500;
|
|
7
|
+
export var useCharHintDisplay = function (_a) {
|
|
8
|
+
var isFieldFocused = _a.isFieldFocused, _b = _a.isCharHintEnable, isCharHintEnable = _b === void 0 ? true : _b, inputValue = _a.inputValue, _c = _a.charHintTimeout, charHintTimeout = _c === void 0 ? DEFAULT_CHAR_HINT_TIMEOUT : _c;
|
|
9
|
+
var _d = useState(null), timeoutId = _d[0], setTimeoutId = _d[1];
|
|
10
|
+
var _e = useState(false), isCharHintVisible = _e[0], setIsCharHintVisible = _e[1];
|
|
11
|
+
var wasCharHintVisibleOnBlurRef = useRef(false);
|
|
12
|
+
var handleClearTimeout = function () {
|
|
13
|
+
if (timeoutId) {
|
|
14
|
+
clearTimeout(timeoutId);
|
|
15
|
+
setTimeoutId(null);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
// скрываем подсказку при blur и мгновенно возвращаем при focus, если она была видна
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
if (!isCharHintEnable || isNil(isFieldFocused))
|
|
21
|
+
return;
|
|
22
|
+
if (!isFieldFocused) {
|
|
23
|
+
wasCharHintVisibleOnBlurRef.current = isCharHintVisible;
|
|
24
|
+
handleClearTimeout();
|
|
25
|
+
if (isCharHintVisible)
|
|
26
|
+
setIsCharHintVisible(false);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (wasCharHintVisibleOnBlurRef.current) {
|
|
30
|
+
wasCharHintVisibleOnBlurRef.current = false;
|
|
31
|
+
setIsCharHintVisible(true);
|
|
32
|
+
}
|
|
33
|
+
// eslint-disable-next-line
|
|
34
|
+
}, [isFieldFocused, isCharHintEnable]);
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
var inputValueLength = inputValue.length;
|
|
37
|
+
if (!isCharHintEnable || (!isNil(isFieldFocused) && !isFieldFocused))
|
|
38
|
+
return;
|
|
39
|
+
handleClearTimeout();
|
|
40
|
+
if (inputValueLength >= MIN_INPUT_SYMBOLS)
|
|
41
|
+
setIsCharHintVisible(false);
|
|
42
|
+
else if (inputValueLength === ONE_CHARACTER || inputValueLength === TWO_CHARACTERS) {
|
|
43
|
+
if (!isCharHintVisible) {
|
|
44
|
+
var nextTimeoutId = setTimeout(function () { return setIsCharHintVisible(true); }, charHintTimeout);
|
|
45
|
+
setTimeoutId(nextTimeoutId);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else
|
|
49
|
+
setIsCharHintVisible(false);
|
|
50
|
+
return function () {
|
|
51
|
+
timeoutId && clearTimeout(timeoutId);
|
|
52
|
+
};
|
|
53
|
+
// eslint-disable-next-line
|
|
54
|
+
}, [charHintTimeout, inputValue, isCharHintEnable, isCharHintVisible]);
|
|
55
|
+
return { isCharHintVisible: isCharHintVisible };
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=useCharHintDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCharHintDisplay.js","sourceRoot":"","sources":["../../../src/hooks/useCharHintDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAkB,MAAM,cAAc,CAAA;AAShE,IAAM,aAAa,GAAG,CAAC,CAAA;AACvB,IAAM,cAAc,GAAG,CAAC,CAAA;AACxB,IAAM,yBAAyB,GAAG,IAAI,CAAA;AAEtC,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,EAKb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B,IAAI,iBAAiB;YAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;aACjE,IAAI,gBAAgB,KAAK,aAAa,IAAI,gBAAgB,KAAK,cAAc,EAAE;YAClF,IAAI,CAAC,iBAAiB,EAAE;gBACtB,IAAM,aAAa,GAAG,UAAU,CAAC,cAAM,OAAA,oBAAoB,CAAC,IAAI,CAAC,EAA1B,CAA0B,EAAE,eAAe,CAAC,CAAA;gBACnF,YAAY,CAAC,aAAa,CAAC,CAAA;aAC5B;SACF;;YAAM,oBAAoB,CAAC,KAAK,CAAC,CAAA;QAElC,OAAO;YACL,SAAS,IAAI,YAAY,CAAC,SAAS,CAAC,CAAA;QACtC,CAAC,CAAA;QACD,2BAA2B;IAC7B,CAAC,EAAE,CAAC,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,CAAA;IAEtE,OAAO,EAAE,iBAAiB,mBAAA,EAAE,CAAA;AAC9B,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useFontScale: () => number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { isUndefined } from 'lodash';
|
|
3
|
+
import { getFontScale } from '../helpers';
|
|
4
|
+
var FONT_SCALE_OBSERVED_ATTRIBUTES = ['class', 'style'];
|
|
5
|
+
export var useFontScale = function () {
|
|
6
|
+
var _a = useState(getFontScale), fontScale = _a[0], setFontScale = _a[1];
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
if (isUndefined(globalThis.document) || isUndefined(globalThis.MutationObserver))
|
|
9
|
+
return;
|
|
10
|
+
var fontScaleObserver = new globalThis.MutationObserver(function () { return setFontScale(getFontScale()); });
|
|
11
|
+
fontScaleObserver.observe(globalThis.document.documentElement, {
|
|
12
|
+
attributeFilter: FONT_SCALE_OBSERVED_ATTRIBUTES,
|
|
13
|
+
attributes: true,
|
|
14
|
+
});
|
|
15
|
+
return function () { return fontScaleObserver.disconnect(); };
|
|
16
|
+
}, []);
|
|
17
|
+
return fontScale;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useFontScale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFontScale.js","sourceRoot":"","sources":["../../../src/hooks/useFontScale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEzC,IAAM,8BAA8B,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAEzD,MAAM,CAAC,IAAM,YAAY,GAAG;IACpB,IAAA,KAA4B,QAAQ,CAAC,YAAY,CAAC,EAAjD,SAAS,QAAA,EAAE,YAAY,QAA0B,CAAA;IAExD,SAAS,CAAC;QACR,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,gBAAgB,CAAC;YAAE,OAAM;QAExF,IAAM,iBAAiB,GAAG,IAAI,UAAU,CAAC,gBAAgB,CAAC,cAAM,OAAA,YAAY,CAAC,YAAY,EAAE,CAAC,EAA5B,CAA4B,CAAC,CAAA;QAE7F,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC7D,eAAe,EAAE,8BAA8B;YAC/C,UAAU,EAAE,IAAI;SACjB,CAAC,CAAA;QAEF,OAAO,cAAM,OAAA,iBAAiB,CAAC,UAAU,EAAE,EAA9B,CAA8B,CAAA;IAC7C,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TouchEvent } from 'react';
|
|
2
|
+
type TUseMobileLongTap = {
|
|
3
|
+
delay?: number;
|
|
4
|
+
onLongTap?: () => void;
|
|
5
|
+
onShortTap?: () => void;
|
|
6
|
+
onDragStart?: () => void;
|
|
7
|
+
onPressStart?: () => void;
|
|
8
|
+
onPressEnd?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const useMobileLongTap: ({ delay, onLongTap, onShortTap, onDragStart, onPressStart, onPressEnd, }: TUseMobileLongTap) => {
|
|
11
|
+
startPressTimer: ({ touches }: TouchEvent) => void;
|
|
12
|
+
handleTouchMove: ({ touches }: TouchEvent) => void;
|
|
13
|
+
handleTouchEnd: () => void;
|
|
14
|
+
handleTouchCancel: () => void;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import { RENDER_DELAY } from '../constants';
|
|
3
|
+
var DRAG_THRESHOLD = 10;
|
|
4
|
+
var DEFAULT_LONG_TAP_DELAY = 500;
|
|
5
|
+
export var useMobileLongTap = function (_a) {
|
|
6
|
+
var _b = _a.delay, delay = _b === void 0 ? DEFAULT_LONG_TAP_DELAY : _b, onLongTap = _a.onLongTap, onShortTap = _a.onShortTap, onDragStart = _a.onDragStart, onPressStart = _a.onPressStart, onPressEnd = _a.onPressEnd;
|
|
7
|
+
var pressTimer = useRef(null);
|
|
8
|
+
var isLongTapActivated = useRef(false);
|
|
9
|
+
var startPosition = useRef(null);
|
|
10
|
+
var touchStartTime = useRef(0);
|
|
11
|
+
var isMovedBeyondThreshold = useRef(false);
|
|
12
|
+
var startPressTimer = useCallback(function (_a) {
|
|
13
|
+
var touches = _a.touches;
|
|
14
|
+
var _b = touches[0], x = _b.clientX, y = _b.clientY;
|
|
15
|
+
isMovedBeyondThreshold.current = false;
|
|
16
|
+
isLongTapActivated.current = false;
|
|
17
|
+
touchStartTime.current = Date.now();
|
|
18
|
+
startPosition.current = { x: x, y: y };
|
|
19
|
+
onPressStart === null || onPressStart === void 0 ? void 0 : onPressStart();
|
|
20
|
+
pressTimer.current = setTimeout(function () {
|
|
21
|
+
isLongTapActivated.current = true;
|
|
22
|
+
onLongTap === null || onLongTap === void 0 ? void 0 : onLongTap();
|
|
23
|
+
}, delay);
|
|
24
|
+
}, [onLongTap, delay, onPressStart]);
|
|
25
|
+
var cancelPressTimer = useCallback(function () {
|
|
26
|
+
var pressTimerCurrent = pressTimer.current;
|
|
27
|
+
if (pressTimerCurrent) {
|
|
28
|
+
clearTimeout(pressTimerCurrent);
|
|
29
|
+
pressTimer.current = null;
|
|
30
|
+
}
|
|
31
|
+
startPosition.current = null;
|
|
32
|
+
}, []);
|
|
33
|
+
var handleTouchEnd = useCallback(function () {
|
|
34
|
+
var touchDuration = Date.now() - touchStartTime.current;
|
|
35
|
+
var isShortTap = touchDuration < delay && !isLongTapActivated.current && !isMovedBeyondThreshold.current;
|
|
36
|
+
onPressEnd === null || onPressEnd === void 0 ? void 0 : onPressEnd();
|
|
37
|
+
isMovedBeyondThreshold.current = false;
|
|
38
|
+
cancelPressTimer();
|
|
39
|
+
if (isShortTap)
|
|
40
|
+
setTimeout(function () { return !isLongTapActivated.current && (onShortTap === null || onShortTap === void 0 ? void 0 : onShortTap()); }, RENDER_DELAY);
|
|
41
|
+
isLongTapActivated.current = false;
|
|
42
|
+
}, [cancelPressTimer, onShortTap, delay, onPressEnd]);
|
|
43
|
+
var handleTouchMove = useCallback(function (_a) {
|
|
44
|
+
var touches = _a.touches;
|
|
45
|
+
var startPositionCurrent = startPosition.current;
|
|
46
|
+
if (!startPositionCurrent || isLongTapActivated.current || touches.length === 0)
|
|
47
|
+
return;
|
|
48
|
+
var _b = touches[0], clientX = _b.clientX, clientY = _b.clientY;
|
|
49
|
+
var x = startPositionCurrent.x, y = startPositionCurrent.y;
|
|
50
|
+
var deltaX = Math.abs(clientX - x);
|
|
51
|
+
var deltaY = Math.abs(clientY - y);
|
|
52
|
+
if (deltaX > DRAG_THRESHOLD || deltaY > DRAG_THRESHOLD) {
|
|
53
|
+
isMovedBeyondThreshold.current = true;
|
|
54
|
+
cancelPressTimer();
|
|
55
|
+
onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart();
|
|
56
|
+
}
|
|
57
|
+
}, [cancelPressTimer, onDragStart]);
|
|
58
|
+
var handleTouchCancel = useCallback(function () {
|
|
59
|
+
isMovedBeyondThreshold.current = false;
|
|
60
|
+
isLongTapActivated.current = false;
|
|
61
|
+
cancelPressTimer();
|
|
62
|
+
}, [cancelPressTimer]);
|
|
63
|
+
return { startPressTimer: startPressTimer, handleTouchMove: handleTouchMove, handleTouchEnd: handleTouchEnd, handleTouchCancel: handleTouchCancel };
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=useMobileLongTap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMobileLongTap.js","sourceRoot":"","sources":["../../../src/hooks/useMobileLongTap.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,YAAY,EAAqB,MAAM,cAAc,CAAA;AAW9D,IAAM,cAAc,GAAG,EAAE,CAAA;AACzB,IAAM,sBAAsB,GAAG,GAAG,CAAA;AAElC,MAAM,CAAC,IAAM,gBAAgB,GAAG,UAAC,EAOb;QANlB,aAA8B,EAA9B,KAAK,mBAAG,sBAAsB,KAAA,EAC9B,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,YAAY,kBAAA,EACZ,UAAU,gBAAA;IAEV,IAAM,UAAU,GAAG,MAAM,CAAW,IAAI,CAAC,CAAA;IACzC,IAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IACxC,IAAM,aAAa,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAClD,IAAM,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;IAChC,IAAM,sBAAsB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAE5C,IAAM,eAAe,GAAG,WAAW,CACjC,UAAC,EAAuB;Y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CAAA;QAClC,gBAAgB,EAAE,CAAA;IACpB,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAA;IAEtB,OAAO,EAAE,eAAe,iBAAA,EAAE,eAAe,iBAAA,EAAE,cAAc,gBAAA,EAAE,iBAAiB,mBAAA,EAAE,CAAA;AAChF,CAAC,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { SheetDetent } from 'react-modal-sheet';
|
|
3
|
+
import { TBottomSheetProps, TBottomSheetScrollMobileConfig, TBottomSheetStyles } from '../сomponents/Modal/types';
|
|
4
|
+
interface IUseModalProps {
|
|
5
|
+
platform?: string;
|
|
6
|
+
isModalOpen: boolean;
|
|
7
|
+
isClosableOutside: boolean;
|
|
8
|
+
isDisabledBottomSheet?: boolean;
|
|
9
|
+
initialIsBottomSheet?: boolean;
|
|
10
|
+
modalRef: RefObject<HTMLDivElement | null>;
|
|
11
|
+
scrollRef?: RefObject<HTMLDivElement | null>;
|
|
12
|
+
popupClassName?: string;
|
|
13
|
+
popupStyles?: React.CSSProperties;
|
|
14
|
+
bottomSheetProps?: TBottomSheetProps;
|
|
15
|
+
bottomSheetStyles?: TBottomSheetStyles;
|
|
16
|
+
bottomSheetDetent?: SheetDetent;
|
|
17
|
+
bottomSheetScrollMobileConfig?: TBottomSheetScrollMobileConfig;
|
|
18
|
+
handleClickOutside?: () => void;
|
|
19
|
+
handleCloseModal: () => void;
|
|
20
|
+
handleBottomSheetInitialized?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const DEFAULT_BOTTOM_SHEET_DETENT = "content";
|
|
23
|
+
export declare const useModal: ({ platform, isModalOpen, isClosableOutside, isDisabledBottomSheet, initialIsBottomSheet, modalRef, scrollRef, popupClassName, popupStyles, bottomSheetProps, bottomSheetStyles, bottomSheetDetent, bottomSheetScrollMobileConfig, handleClickOutside, handleCloseModal, handleBottomSheetInitialized, }: IUseModalProps) => {
|
|
24
|
+
shouldUseBottomSheet: boolean;
|
|
25
|
+
renderModal: (children: React.ReactNode) => import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
offsetScrollY: number;
|
|
27
|
+
offsetScrollYKey: number;
|
|
28
|
+
bottomKeyboardPadding: number;
|
|
29
|
+
};
|
|
30
|
+
export {};
|