hrm_ui_lib 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/styles/styles.css +61 -5
- package/assets/styles/styles.scss +1 -1
- package/components/Alert/Alert.js +11 -52
- package/components/Alert/consts.js +12 -14
- package/components/Alert/index.js +1 -52
- package/components/Alert/types.js +1 -1
- package/components/Avatar/Avatar.js +21 -117
- package/components/Avatar/AvatarGroup.js +18 -117
- package/components/Avatar/index.js +2 -64
- package/components/Avatar/types.js +1 -1
- package/components/Badge/Badge.js +5 -22
- package/components/Badge/index.js +1 -6
- package/components/Badge/types.js +1 -1
- package/components/BadgeV2/BadgeV2.d.ts +3 -0
- package/components/BadgeV2/BadgeV2.js +9 -0
- package/components/BadgeV2/index.d.ts +1 -0
- package/components/BadgeV2/index.js +1 -0
- package/components/BadgeV2/types.d.ts +42 -0
- package/components/BadgeV2/types.js +31 -0
- package/components/Breadcrumb/Breadcrumb.js +6 -23
- package/components/Breadcrumb/index.js +1 -2
- package/components/Breadcrumb/types.js +1 -1
- package/components/Button/Button.js +29 -52
- package/components/Button/consts.js +12 -14
- package/components/Button/index.js +1 -52
- package/components/Button/types.js +1 -1
- package/components/Checkbox/Checkbox.js +45 -52
- package/components/Checkbox/index.js +1 -52
- package/components/Checkbox/types.js +1 -1
- package/components/Chips/Chips.js +23 -65
- package/components/Chips/consts.js +10 -12
- package/components/Chips/index.js +1 -11
- package/components/Chips/types.js +5 -7
- package/components/Collapse/CollapseGroup/CollapseGroup.js +22 -73
- package/components/Collapse/CollapseItem/CollapseItem.js +11 -86
- package/components/Collapse/index.js +2 -16
- package/components/Collapse/types.js +1 -1
- package/components/Container/Container.js +4 -9
- package/components/Container/index.js +1 -2
- package/components/Container/types.js +1 -1
- package/components/Copy/Copy.js +15 -93
- package/components/Copy/index.js +1 -54
- package/components/Copy/types.js +1 -1
- package/components/Counter/Counter.js +54 -134
- package/components/Counter/index.js +1 -61
- package/components/Counter/types.js +1 -1
- package/components/DatePicker/CustomHeader/CustomHeader.js +16 -191
- package/components/DatePicker/CustomHeader/helpers.js +10 -16
- package/components/DatePicker/RangeDatePicker/RangeDatePicker.js +7 -129
- package/components/DatePicker/RangeDatePicker/RangeDatePickerDesktop.js +71 -172
- package/components/DatePicker/RangeDatePicker/RangeDatePickerMobile.js +86 -265
- package/components/DatePicker/RangeDatePicker/index.js +1 -124
- package/components/DatePicker/SimpleDatePicker/SimpleDatePicker.js +8 -128
- package/components/DatePicker/SimpleDatePicker/SimpleDatePickerDesktop.js +45 -202
- package/components/DatePicker/SimpleDatePicker/SimpleDatePickerMobile.js +44 -206
- package/components/DatePicker/SimpleDatePicker/index.js +1 -123
- package/components/DatePicker/TimePicker/MobileModalContent.js +33 -123
- package/components/DatePicker/TimePicker/TimePicker.js +7 -75
- package/components/DatePicker/TimePicker/TimePickerDesktop.js +42 -128
- package/components/DatePicker/TimePicker/TimePickerMobile.js +27 -125
- package/components/DatePicker/TimePicker/consts.js +5 -8
- package/components/DatePicker/TimePicker/helpers.js +9 -19
- package/components/DatePicker/TimePicker/index.js +1 -70
- package/components/DatePicker/hooks.js +33 -2171
- package/components/DatePicker/index.js +3 -134
- package/components/DatePicker/localization.js +43 -6
- package/components/DatePicker/types.js +5 -7
- package/components/Divider/Divider.js +8 -15
- package/components/Divider/index.js +1 -3
- package/components/Divider/types.js +1 -1
- package/components/Empty/Empty.js +9 -83
- package/components/Empty/index.js +1 -54
- package/components/Empty/types.js +1 -1
- package/components/FileUpload/DropzoneFileUpload/DropzoneFileUpload.js +67 -52
- package/components/FileUpload/DropzoneFileUpload/ErrorItem.js +21 -52
- package/components/FileUpload/DropzoneFileUpload/FilePreview.js +23 -52
- package/components/FileUpload/DropzoneFileUpload/PreviewItem.js +30 -52
- package/components/FileUpload/DropzoneFileUpload/helpers.js +79 -52
- package/components/FileUpload/DropzoneFileUpload/index.js +1 -52
- package/components/FileUpload/FileUpload.js +69 -192
- package/components/FileUpload/UploadItems.js +22 -101
- package/components/FileUpload/index.js +3 -61
- package/components/FileUpload/types.js +6 -10
- package/components/FormContainer/FormContainer.js +43 -136
- package/components/FormContainer/index.js +1 -55
- package/components/FormContainer/types.js +1 -1
- package/components/FormField/FormField.js +17 -112
- package/components/FormField/index.js +1 -56
- package/components/FormField/types.js +1 -1
- package/components/Heading/Heading.js +5 -27
- package/components/Heading/index.js +1 -5
- package/components/Heading/types.js +1 -1
- package/components/Image/Image.js +12 -32
- package/components/Image/index.js +1 -2
- package/components/Image/types.js +1 -1
- package/components/Input/Input.js +68 -236
- package/components/Input/index.js +1 -58
- package/components/Input/types.js +1 -1
- package/components/Link/Link.js +14 -40
- package/components/Link/index.js +1 -3
- package/components/Link/types.js +1 -1
- package/components/Menu/Menu.js +47 -161
- package/components/Menu/NestedMenu.js +47 -173
- package/components/Menu/index.js +2 -72
- package/components/Menu/types.js +1 -1
- package/components/Modal/Modal.js +70 -52
- package/components/Modal/ModalConfirmation.js +30 -137
- package/components/Modal/ModalContent.js +10 -52
- package/components/Modal/index.js +2 -53
- package/components/Modal/types.js +1 -1
- package/components/More/More.js +19 -85
- package/components/More/index.js +1 -53
- package/components/More/types.js +1 -1
- package/components/Pagination/Pagination.js +15 -56
- package/components/Pagination/consts.js +5 -7
- package/components/Pagination/index.js +1 -10
- package/components/Pagination/types.js +1 -1
- package/components/Popover/Popover.js +41 -52
- package/components/Popover/PopoverDesktop.js +16 -69
- package/components/Popover/PopoverMobile.js +8 -52
- package/components/Popover/index.js +1 -52
- package/components/Popover/types.js +1 -1
- package/components/Progress/Progress.js +21 -56
- package/components/Progress/index.js +1 -2
- package/components/Progress/types.js +1 -1
- package/components/ProgressStep/ProgressStep.js +9 -38
- package/components/ProgressStep/Step.js +51 -98
- package/components/ProgressStep/consts.js +7 -9
- package/components/ProgressStep/index.js +1 -12
- package/components/ProgressStep/types.js +5 -7
- package/components/Radio/Radio.js +19 -56
- package/components/Radio/RadioGroup.js +21 -111
- package/components/Radio/index.js +2 -55
- package/components/Radio/types.js +1 -1
- package/components/SVGIcons/IconAdd.js +7 -28
- package/components/SVGIcons/IconAddCircle.js +7 -31
- package/components/SVGIcons/IconAddCircleFilled.js +7 -31
- package/components/SVGIcons/IconAddFilled.js +7 -28
- package/components/SVGIcons/IconAlert.js +7 -31
- package/components/SVGIcons/IconAlertBadge.js +7 -31
- package/components/SVGIcons/IconAlertBadgeFilled.js +7 -31
- package/components/SVGIcons/IconAlertFilled.js +7 -31
- package/components/SVGIcons/IconAm.js +6 -57
- package/components/SVGIcons/IconAmd.js +7 -28
- package/components/SVGIcons/IconAmdFilled.js +7 -28
- package/components/SVGIcons/IconApple.js +7 -31
- package/components/SVGIcons/IconArrowDown.js +7 -31
- package/components/SVGIcons/IconArrowDownFilled.js +7 -31
- package/components/SVGIcons/IconArrowDownLeft.js +7 -31
- package/components/SVGIcons/IconArrowDownLeftFilled.js +7 -31
- package/components/SVGIcons/IconArrowDownload.js +7 -31
- package/components/SVGIcons/IconArrowDownloadFilled.js +7 -31
- package/components/SVGIcons/IconArrowEnter.js +7 -28
- package/components/SVGIcons/IconArrowEnterFilled.js +7 -28
- package/components/SVGIcons/IconArrowExit.js +7 -28
- package/components/SVGIcons/IconArrowExitFilled.js +7 -28
- package/components/SVGIcons/IconArrowExportLeftToRight.js +7 -31
- package/components/SVGIcons/IconArrowExportLeftToRightFilled.js +7 -31
- package/components/SVGIcons/IconArrowExportRightToLeft.js +7 -31
- package/components/SVGIcons/IconArrowExportRightToLeftFilled.js +7 -31
- package/components/SVGIcons/IconArrowExportUp.js +7 -31
- package/components/SVGIcons/IconArrowExportUpFilled.js +7 -31
- package/components/SVGIcons/IconArrowImport.js +7 -31
- package/components/SVGIcons/IconArrowImportFilled.js +7 -31
- package/components/SVGIcons/IconArrowLeft.js +7 -31
- package/components/SVGIcons/IconArrowLeftFilled.js +7 -31
- package/components/SVGIcons/IconArrowRepeatAll.js +7 -31
- package/components/SVGIcons/IconArrowRepeatAllFilled.js +7 -31
- package/components/SVGIcons/IconArrowReset.js +7 -31
- package/components/SVGIcons/IconArrowResetFilled.js +7 -31
- package/components/SVGIcons/IconArrowRight.js +7 -31
- package/components/SVGIcons/IconArrowRightFilled.js +7 -31
- package/components/SVGIcons/IconArrowSort.js +7 -28
- package/components/SVGIcons/IconArrowSortFilled.js +7 -28
- package/components/SVGIcons/IconArrowSync.js +7 -28
- package/components/SVGIcons/IconArrowSyncFilled.js +7 -28
- package/components/SVGIcons/IconArrowUp.js +7 -31
- package/components/SVGIcons/IconArrowUpFilled.js +7 -31
- package/components/SVGIcons/IconArrowUpLeft.js +7 -31
- package/components/SVGIcons/IconArrowUpLeftFilled.js +7 -31
- package/components/SVGIcons/IconArrowUpRight.js +7 -31
- package/components/SVGIcons/IconArrowUpRightFilled.js +7 -31
- package/components/SVGIcons/IconAttach.js +7 -31
- package/components/SVGIcons/IconAttachFilled.js +7 -31
- package/components/SVGIcons/IconBeach.js +7 -28
- package/components/SVGIcons/IconBeachFilled.js +7 -28
- package/components/SVGIcons/IconBook.js +7 -31
- package/components/SVGIcons/IconBookFilled.js +7 -31
- package/components/SVGIcons/IconBookmark.js +7 -31
- package/components/SVGIcons/IconBookmarkFilled.js +7 -31
- package/components/SVGIcons/IconBriefcase.js +7 -31
- package/components/SVGIcons/IconBriefcaseFilled.js +7 -31
- package/components/SVGIcons/IconBuilding.js +7 -54
- package/components/SVGIcons/IconBuildingBank.js +7 -28
- package/components/SVGIcons/IconBuildingBankFilled.js +7 -28
- package/components/SVGIcons/IconBuildingFilled.js +7 -31
- package/components/SVGIcons/IconBulletListAdd.js +7 -31
- package/components/SVGIcons/IconBulletListAddFilled.js +7 -31
- package/components/SVGIcons/IconCalculator.js +7 -31
- package/components/SVGIcons/IconCalculatorFilled.js +7 -31
- package/components/SVGIcons/IconCalendarClock.js +7 -28
- package/components/SVGIcons/IconCalendarClockFilled.js +7 -28
- package/components/SVGIcons/IconCalendarDay.js +7 -31
- package/components/SVGIcons/IconCalendarDayFilled.js +7 -31
- package/components/SVGIcons/IconCalendarEmpty.js +7 -28
- package/components/SVGIcons/IconCalendarLeft.js +7 -28
- package/components/SVGIcons/IconCalendarLeftFilled.js +7 -28
- package/components/SVGIcons/IconCalendarRight.js +7 -28
- package/components/SVGIcons/IconCalendarRightFilled.js +7 -28
- package/components/SVGIcons/IconCall.js +7 -31
- package/components/SVGIcons/IconCallFilled.js +7 -31
- package/components/SVGIcons/IconCard.js +7 -28
- package/components/SVGIcons/IconCardFilled.js +7 -28
- package/components/SVGIcons/IconCaretDown.js +7 -28
- package/components/SVGIcons/IconCaretDownFilled.js +7 -28
- package/components/SVGIcons/IconCaretDownRight.js +7 -28
- package/components/SVGIcons/IconCaretDownRightFilled.js +7 -28
- package/components/SVGIcons/IconCaretLeft.js +7 -28
- package/components/SVGIcons/IconCaretLeftFilled.js +7 -28
- package/components/SVGIcons/IconCaretRight.js +7 -28
- package/components/SVGIcons/IconCaretRightFilled.js +7 -28
- package/components/SVGIcons/IconCaretUp.js +7 -28
- package/components/SVGIcons/IconCaretUpFilled.js +7 -28
- package/components/SVGIcons/IconChat.js +7 -28
- package/components/SVGIcons/IconChatFilled.js +7 -28
- package/components/SVGIcons/IconChatMultiple.js +7 -28
- package/components/SVGIcons/IconChatMultipleFilled.js +7 -28
- package/components/SVGIcons/IconCheckboxArrowRight.js +7 -31
- package/components/SVGIcons/IconCheckboxArrowRightFilled.js +7 -31
- package/components/SVGIcons/IconCheckmark.js +7 -28
- package/components/SVGIcons/IconCheckmarkCircle.js +7 -28
- package/components/SVGIcons/IconCheckmarkCircleFilled.js +7 -28
- package/components/SVGIcons/IconCheckmarkFilled.js +7 -28
- package/components/SVGIcons/IconChevronDoubleLeft.js +7 -28
- package/components/SVGIcons/IconChevronDoubleRight.js +7 -28
- package/components/SVGIcons/IconChevronDown.js +7 -28
- package/components/SVGIcons/IconChevronDownFilled.js +7 -28
- package/components/SVGIcons/IconChevronLeft.js +7 -28
- package/components/SVGIcons/IconChevronLeftFilled.js +7 -28
- package/components/SVGIcons/IconChevronRight.js +7 -28
- package/components/SVGIcons/IconChevronRightFilled.js +7 -28
- package/components/SVGIcons/IconChevronUp.js +7 -28
- package/components/SVGIcons/IconChevronUpDown.js +7 -31
- package/components/SVGIcons/IconChevronUpDownFilled.js +7 -31
- package/components/SVGIcons/IconChevronUpFilled.js +7 -28
- package/components/SVGIcons/IconClipboardDay.js +7 -28
- package/components/SVGIcons/IconClock.js +7 -31
- package/components/SVGIcons/IconClockDismiss.js +7 -28
- package/components/SVGIcons/IconClockDismissFilled.js +7 -28
- package/components/SVGIcons/IconClockFilled.js +7 -31
- package/components/SVGIcons/IconComment.js +7 -31
- package/components/SVGIcons/IconCommentFilled.js +7 -31
- package/components/SVGIcons/IconContractCard.js +7 -28
- package/components/SVGIcons/IconContractCardFilled.js +7 -28
- package/components/SVGIcons/IconCopy.js +7 -28
- package/components/SVGIcons/IconCopyFilled.js +7 -28
- package/components/SVGIcons/IconCubeTree.js +7 -28
- package/components/SVGIcons/IconCubeTreeFilled.js +7 -31
- package/components/SVGIcons/IconDatabase.js +7 -31
- package/components/SVGIcons/IconDatabaseFilled.js +7 -31
- package/components/SVGIcons/IconDelete.js +7 -28
- package/components/SVGIcons/IconDeleteFilled.js +7 -28
- package/components/SVGIcons/IconDeviceMeetingRoom.js +7 -28
- package/components/SVGIcons/IconDeviceMeetingRoomFilled.js +7 -28
- package/components/SVGIcons/IconDismiss.js +7 -28
- package/components/SVGIcons/IconDismissCircle.js +7 -31
- package/components/SVGIcons/IconDismissCircleFilled.js +7 -31
- package/components/SVGIcons/IconDismissFilled.js +7 -28
- package/components/SVGIcons/IconDocument.js +7 -28
- package/components/SVGIcons/IconDocumentBulletList.js +7 -31
- package/components/SVGIcons/IconDocumentBulletListFilled.js +7 -31
- package/components/SVGIcons/IconDocumentEdit.js +7 -28
- package/components/SVGIcons/IconDocumentEditFilled.js +7 -28
- package/components/SVGIcons/IconDocumentFilled.js +7 -28
- package/components/SVGIcons/IconDocumentPerson.js +7 -28
- package/components/SVGIcons/IconEdit.js +7 -28
- package/components/SVGIcons/IconEditFilled.js +7 -28
- package/components/SVGIcons/IconErrorCircle.js +7 -28
- package/components/SVGIcons/IconErrorCircleFilled.js +7 -28
- package/components/SVGIcons/IconEur.js +7 -28
- package/components/SVGIcons/IconEurFilled.js +7 -28
- package/components/SVGIcons/IconExpandUpLeft.js +7 -31
- package/components/SVGIcons/IconExpandUpLeftFilled.js +7 -31
- package/components/SVGIcons/IconExpandUpRight.js +7 -31
- package/components/SVGIcons/IconExpandUpRightFilled.js +7 -31
- package/components/SVGIcons/IconEyeOff.js +7 -31
- package/components/SVGIcons/IconEyeOffFilled.js +7 -31
- package/components/SVGIcons/IconEyeOn.js +7 -31
- package/components/SVGIcons/IconEyeOnFilled.js +7 -31
- package/components/SVGIcons/IconFacebook.js +7 -38
- package/components/SVGIcons/IconFilter.js +7 -28
- package/components/SVGIcons/IconFilterFilled.js +7 -28
- package/components/SVGIcons/IconFlag.js +7 -31
- package/components/SVGIcons/IconFlagFilled.js +7 -31
- package/components/SVGIcons/IconFolderLink.js +7 -28
- package/components/SVGIcons/IconFolderLinkFilled.js +7 -28
- package/components/SVGIcons/IconFood.js +7 -28
- package/components/SVGIcons/IconFoodFilled.js +7 -28
- package/components/SVGIcons/IconGb.js +6 -71
- package/components/SVGIcons/IconGlobe.js +7 -28
- package/components/SVGIcons/IconGlobeFilled.js +7 -28
- package/components/SVGIcons/IconGoogle.js +7 -40
- package/components/SVGIcons/IconHandOpenHeart.js +7 -31
- package/components/SVGIcons/IconHandOpenHeartFilled.js +7 -31
- package/components/SVGIcons/IconHeart.js +7 -31
- package/components/SVGIcons/IconHeartFilled.js +7 -31
- package/components/SVGIcons/IconHistory.js +7 -31
- package/components/SVGIcons/IconHistoryFilled.js +7 -31
- package/components/SVGIcons/IconHome.js +7 -31
- package/components/SVGIcons/IconHomeFilled.js +7 -31
- package/components/SVGIcons/IconImage.js +7 -31
- package/components/SVGIcons/IconImageFilled.js +7 -31
- package/components/SVGIcons/IconInfo.js +7 -28
- package/components/SVGIcons/IconInfoFilled.js +7 -28
- package/components/SVGIcons/IconInstagram.js +7 -39
- package/components/SVGIcons/IconKeyReset.js +7 -31
- package/components/SVGIcons/IconKeyResetFilled.js +7 -31
- package/components/SVGIcons/IconLink.js +7 -31
- package/components/SVGIcons/IconLinkFilled.js +7 -31
- package/components/SVGIcons/IconLinkedin.js +7 -31
- package/components/SVGIcons/IconList.js +7 -28
- package/components/SVGIcons/IconListFilled.js +7 -31
- package/components/SVGIcons/IconLocation.js +7 -31
- package/components/SVGIcons/IconLocationFilled.js +7 -31
- package/components/SVGIcons/IconLockClosed.js +7 -31
- package/components/SVGIcons/IconLockClosedFilled.js +7 -31
- package/components/SVGIcons/IconLockOpen.js +7 -31
- package/components/SVGIcons/IconLockOpenFilled.js +7 -31
- package/components/SVGIcons/IconMail.js +7 -31
- package/components/SVGIcons/IconMailAdd.js +7 -31
- package/components/SVGIcons/IconMailAddFilled.js +7 -31
- package/components/SVGIcons/IconMailArrowForward.js +7 -31
- package/components/SVGIcons/IconMailArrowForwardFilled.js +7 -31
- package/components/SVGIcons/IconMailFilled.js +7 -31
- package/components/SVGIcons/IconMailLink.js +7 -31
- package/components/SVGIcons/IconMailLinkFilled.js +7 -31
- package/components/SVGIcons/IconMedium.js +7 -31
- package/components/SVGIcons/IconMore.js +7 -31
- package/components/SVGIcons/IconMoreFilled.js +7 -31
- package/components/SVGIcons/IconMoreVertical.js +7 -31
- package/components/SVGIcons/IconMoreVerticalFilled.js +7 -31
- package/components/SVGIcons/IconNavigation.js +7 -31
- package/components/SVGIcons/IconNavigationFilled.js +7 -31
- package/components/SVGIcons/IconNotebook.js +7 -31
- package/components/SVGIcons/IconNotebookAdd.js +7 -47
- package/components/SVGIcons/IconNotebookAddFilled.js +7 -44
- package/components/SVGIcons/IconNotebookFilled.js +7 -31
- package/components/SVGIcons/IconOnlyEmployee.js +7 -28
- package/components/SVGIcons/IconOpen.js +7 -31
- package/components/SVGIcons/IconOpenFilled.js +7 -31
- package/components/SVGIcons/IconPatient.js +7 -28
- package/components/SVGIcons/IconPatientFilled.js +7 -28
- package/components/SVGIcons/IconPeople.js +7 -28
- package/components/SVGIcons/IconPeopleAdd.js +7 -31
- package/components/SVGIcons/IconPeopleAddFilled.js +7 -31
- package/components/SVGIcons/IconPeopleFilled.js +7 -31
- package/components/SVGIcons/IconPercent.js +7 -33
- package/components/SVGIcons/IconPerson.js +7 -31
- package/components/SVGIcons/IconPersonAccount.js +7 -28
- package/components/SVGIcons/IconPersonAccountFilled.js +7 -28
- package/components/SVGIcons/IconPersonAdd.js +7 -31
- package/components/SVGIcons/IconPersonAddFilled.js +7 -31
- package/components/SVGIcons/IconPersonArrowLeft.js +7 -28
- package/components/SVGIcons/IconPersonArrowLeftFilled.js +7 -28
- package/components/SVGIcons/IconPersonArrowRight.js +7 -28
- package/components/SVGIcons/IconPersonArrowRightFilled.js +7 -28
- package/components/SVGIcons/IconPersonBoard.js +7 -28
- package/components/SVGIcons/IconPersonFilled.js +7 -31
- package/components/SVGIcons/IconPersonMinus.js +7 -28
- package/components/SVGIcons/IconPersonStar.js +7 -31
- package/components/SVGIcons/IconPersonStarFilled.js +7 -31
- package/components/SVGIcons/IconPersonSubtract.js +7 -31
- package/components/SVGIcons/IconPersonSubtractFilled.js +7 -31
- package/components/SVGIcons/IconPhone.js +7 -31
- package/components/SVGIcons/IconPhoneFilled.js +7 -31
- package/components/SVGIcons/IconPlugConnected.js +7 -28
- package/components/SVGIcons/IconPos.js +7 -33
- package/components/SVGIcons/IconPosFilled.js +7 -33
- package/components/SVGIcons/IconProhibited.js +7 -31
- package/components/SVGIcons/IconProhibitedFilled.js +7 -31
- package/components/SVGIcons/IconProjectProduct.js +7 -28
- package/components/SVGIcons/IconQuestion.js +7 -31
- package/components/SVGIcons/IconQuestionFilled.js +7 -31
- package/components/SVGIcons/IconRedo.js +7 -31
- package/components/SVGIcons/IconRedoFilled.js +7 -31
- package/components/SVGIcons/IconRu.js +6 -60
- package/components/SVGIcons/IconRub.js +7 -28
- package/components/SVGIcons/IconRubFilled.js +7 -28
- package/components/SVGIcons/IconSave.js +7 -31
- package/components/SVGIcons/IconSaveFilled.js +7 -31
- package/components/SVGIcons/IconSavings.js +7 -31
- package/components/SVGIcons/IconSavingsFilled.js +7 -31
- package/components/SVGIcons/IconSearch.js +7 -31
- package/components/SVGIcons/IconSearchFilled.js +7 -31
- package/components/SVGIcons/IconSelectAllOff.js +7 -31
- package/components/SVGIcons/IconSelectAllOffFilled.js +7 -31
- package/components/SVGIcons/IconSelectAllOn.js +7 -31
- package/components/SVGIcons/IconSelectAllOnFilled.js +7 -31
- package/components/SVGIcons/IconSend.js +7 -31
- package/components/SVGIcons/IconSendFilled.js +7 -31
- package/components/SVGIcons/IconSettings.js +7 -28
- package/components/SVGIcons/IconSettingsFilled.js +7 -31
- package/components/SVGIcons/IconShare.js +7 -31
- package/components/SVGIcons/IconShareAndroid.js +7 -31
- package/components/SVGIcons/IconShareAndroidFilled.js +7 -31
- package/components/SVGIcons/IconShareFilled.js +7 -31
- package/components/SVGIcons/IconSignOut.js +7 -31
- package/components/SVGIcons/IconSignOutFilled.js +7 -31
- package/components/SVGIcons/IconSpinner.js +7 -31
- package/components/SVGIcons/IconSpinnerFilled.js +7 -31
- package/components/SVGIcons/IconStatus.js +7 -31
- package/components/SVGIcons/IconStatusFilled.js +7 -31
- package/components/SVGIcons/IconSubtract.js +7 -31
- package/components/SVGIcons/IconSubtractCircle.js +7 -31
- package/components/SVGIcons/IconSubtractCircleFilled.js +7 -31
- package/components/SVGIcons/IconSubtractFilled.js +7 -31
- package/components/SVGIcons/IconTableCellEdit.js +7 -35
- package/components/SVGIcons/IconTableCellEditFilled.js +7 -41
- package/components/SVGIcons/IconTelegram.js +7 -40
- package/components/SVGIcons/IconTimer.js +7 -31
- package/components/SVGIcons/IconTimerFilled.js +7 -31
- package/components/SVGIcons/IconTwitter.js +7 -31
- package/components/SVGIcons/IconUndo.js +7 -31
- package/components/SVGIcons/IconUndoFilled.js +7 -31
- package/components/SVGIcons/IconUnitsEmployee.js +7 -28
- package/components/SVGIcons/IconUpload.js +7 -28
- package/components/SVGIcons/IconUsd.js +7 -28
- package/components/SVGIcons/IconUsdFilled.js +7 -28
- package/components/SVGIcons/IconUserMinus.js +7 -31
- package/components/SVGIcons/IconVideo.js +7 -28
- package/components/SVGIcons/IconVideoFilled.js +7 -28
- package/components/SVGIcons/IconWallet.js +7 -31
- package/components/SVGIcons/IconWalletFilled.js +7 -31
- package/components/SVGIcons/IconWarning.js +7 -28
- package/components/SVGIcons/IconWarningFilled.js +7 -28
- package/components/SVGIcons/IconYoutube.js +7 -31
- package/components/SVGIcons/index.js +302 -305
- package/components/SVGIcons/types.js +1 -1
- package/components/Select/ButtonSelect/ButtonSelect.js +42 -195
- package/components/Select/FilterSelect/FilterDropdown.js +14 -95
- package/components/Select/FilterSelect/FilterGroupDropdown.js +18 -82
- package/components/Select/FilterSelect/FilterSelect.js +69 -199
- package/components/Select/MultiSelect/DesktopWrapper.js +18 -55
- package/components/Select/MultiSelect/MobileWrapper.js +12 -77
- package/components/Select/MultiSelect/MultiBase/MultiBase.js +60 -211
- package/components/Select/MultiSelect/MultiSelect.js +66 -244
- package/components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js +94 -264
- package/components/Select/MultiSelect/MultiSelectWithTabs/MultiSelectWithTabs.js +76 -251
- package/components/Select/MultiSelect/OptionsWrapper.js +64 -175
- package/components/Select/NestedSelect/NestedSelect.js +55 -197
- package/components/Select/ProfileDropdown/index.js +12 -82
- package/components/Select/Select/Select.js +85 -254
- package/components/Select/Select/SelectDesktop/index.js +66 -219
- package/components/Select/Select/SelectMobile/MobileTopContent.js +17 -90
- package/components/Select/Select/SelectMobile/index.js +49 -194
- package/components/Select/Select/helpers.js +8 -9
- package/components/Select/SharedComponents/Actions.js +13 -115
- package/components/Select/SharedComponents/ButtonSelectWrapper/Button/Button.js +8 -43
- package/components/Select/SharedComponents/ButtonSelectWrapper/ButtonSelectWrapper.js +27 -130
- package/components/Select/SharedComponents/ContentTop.js +70 -177
- package/components/Select/SharedComponents/Footer.js +10 -97
- package/components/Select/SharedComponents/InputSelectWrapper/InputSelectWrapper.js +49 -161
- package/components/Select/SharedComponents/Loading.js +5 -16
- package/components/Select/SharedComponents/index.js +6 -92
- package/components/Select/constants.js +7 -9
- package/components/Select/index.js +6 -114
- package/components/Select/localization.js +28 -30
- package/components/Select/types.js +1 -1
- package/components/SideSheet/Footer/Footer.js +13 -99
- package/components/SideSheet/SideSheet.js +55 -208
- package/components/SideSheet/index.js +1 -56
- package/components/SideSheet/types.js +1 -1
- package/components/Snackbar/Snackbar.js +29 -123
- package/components/Snackbar/consts.js +11 -13
- package/components/Snackbar/index.js +1 -54
- package/components/Snackbar/types.js +1 -1
- package/components/Status/Status.js +16 -51
- package/components/Status/index.js +1 -8
- package/components/Status/types.js +1 -1
- package/components/Stepper/Stepper.js +28 -44
- package/components/Stepper/index.js +1 -3
- package/components/Stepper/types.js +1 -1
- package/components/Switcher/Switcher.js +17 -114
- package/components/Switcher/index.js +1 -55
- package/components/Switcher/types.js +1 -1
- package/components/Tab/Tab.js +18 -35
- package/components/Tab/TabItem.js +11 -52
- package/components/Tab/index.js +1 -11
- package/components/Tab/types.js +1 -1
- package/components/Table/Header.js +19 -121
- package/components/Table/IndeterminateCheckbox.js +13 -76
- package/components/Table/Row.js +16 -92
- package/components/Table/Table.js +60 -160
- package/components/Table/index.js +1 -61
- package/components/Table/types.js +1 -1
- package/components/Table/utils.js +17 -76
- package/components/TableV2/AdvancedPagination.js +61 -270
- package/components/TableV2/ColumnHeader.js +29 -61
- package/components/TableV2/ColumnSettings.js +31 -162
- package/components/TableV2/IndeterminateCheckbox.js +13 -84
- package/components/TableV2/Table.js +114 -310
- package/components/TableV2/constants/index.js +26 -22
- package/components/TableV2/hooks/useTableColumnSettings.js +16 -19
- package/components/TableV2/hooks/useTableControl.js +176 -297
- package/components/TableV2/index.js +3 -131
- package/components/TableV2/loadTableSettings.js +8 -17
- package/components/TableV2/types.js +1 -1
- package/components/Text/Text.js +5 -34
- package/components/Text/index.js +1 -5
- package/components/Text/types.js +1 -1
- package/components/Textarea/Textarea.js +36 -140
- package/components/Textarea/index.js +1 -56
- package/components/Textarea/types.js +1 -1
- package/components/Tooltip/Tooltip.js +49 -99
- package/components/Tooltip/index.js +1 -18
- package/components/Tooltip/types.js +11 -13
- package/consts/index.js +86 -65
- package/context/FormContextProvider.js +4 -10
- package/context/index.js +2 -5
- package/context/types.js +6 -10
- package/helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js +4 -12
- package/helperComponents/AnimatePresenceWrapper/index.js +1 -3
- package/helperComponents/CodeBlock/CodeBlock.js +4 -178
- package/helperComponents/CodeBlock/index.js +1 -3
- package/helperComponents/ErrorMessage/ErrorMessage.js +7 -26
- package/helperComponents/ErrorMessage/index.js +1 -8
- package/helperComponents/ErrorMessage/types.js +1 -1
- package/helperComponents/GoToWebPage/GoToWebPage.js +5 -66
- package/helperComponents/IconDynamicComponent/IconDynamicComponent.js +11 -25
- package/helperComponents/IconDynamicComponent/constants.js +10 -31
- package/helperComponents/IconDynamicComponent/index.js +1 -3
- package/helperComponents/Label/Label.js +8 -28
- package/helperComponents/Label/index.js +1 -6
- package/helperComponents/Label/types.js +1 -1
- package/helperComponents/Loader/Loader.js +4 -14
- package/helperComponents/Loader/index.js +1 -2
- package/helperComponents/Loader/types.js +1 -1
- package/helperComponents/OptionItem/OptionItem.js +27 -148
- package/helperComponents/OptionItem/index.js +1 -64
- package/helperComponents/OptionItem/types.js +1 -1
- package/helperComponents/index.js +6 -65
- package/helpers/check-authorization.js +57 -111
- package/helpers/download-file.js +7 -9
- package/helpers/format-date.js +14 -42
- package/helpers/get-module-prefix.js +3 -5
- package/helpers/index.js +7 -59
- package/helpers/isDeepEqual.js +11 -17
- package/helpers/locale.js +10 -15
- package/helpers/storage.js +17 -18
- package/hooks/index.js +12 -21
- package/hooks/useChangePositionsOnScroll.js +28 -32
- package/hooks/useDispatchEventOnScroll.js +8 -13
- package/hooks/useFormContext.js +3 -8
- package/hooks/useFormProps.js +3 -8
- package/hooks/useGetElemPositions.js +14 -16
- package/hooks/useGetElemSizes.js +11 -13
- package/hooks/useGetHasBottomSpace.js +13 -24
- package/hooks/useGetIsMobile.js +33 -45
- package/hooks/useGetTooltipPosition.js +66 -82
- package/hooks/useGetTooltipStyles.js +45 -87
- package/hooks/useHideBodyScroll.js +25 -34
- package/hooks/useHideOnScroll.js +19 -24
- package/hooks/useOnOutsideClick.js +33 -46
- package/hooks/useScreenSize.js +24 -34
- package/index.d.ts +1 -0
- package/index.js +47 -468
- package/package.json +1 -1
- package/type/file-upload.js +6 -8
- package/type/index.js +4 -4
- package/type/locale.js +12 -14
- package/type/notification.js +7 -9
- package/type/status-code.js +7 -9
- package/utils/helpers.js +63 -77
- /package/{Alert-BslI0aA0.js → Alert-CNizbUJ6.js} +0 -0
|
@@ -1,85 +1,69 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useGetElemPositions } from './useGetElemPositions
|
|
3
|
-
import { useGetElemSizes } from './useGetElemSizes
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
import { useGetElemPositions } from './useGetElemPositions';
|
|
3
|
+
import { useGetElemSizes } from './useGetElemSizes';
|
|
4
|
+
const GAP = 20;
|
|
5
|
+
const ARROW_DISTANCE = 20;
|
|
6
|
+
export const useGetTooltipPosition = (info) => {
|
|
7
|
+
const { initialPosition, elemRef, tooltipRef, hasTriangle = true } = info;
|
|
8
|
+
const { left, top, bottom } = useGetElemPositions(elemRef);
|
|
9
|
+
const { width: tooltipWidth, height: tooltipHeight } = useGetElemSizes(tooltipRef);
|
|
10
|
+
const { width: itemWidth } = useGetElemSizes(elemRef);
|
|
11
|
+
// this is calculations for tooltip top/left/bottom/right positions
|
|
12
|
+
const calculatedPosition = useMemo(() => {
|
|
13
|
+
const hasTopSpace = tooltipHeight + GAP < top;
|
|
14
|
+
const hasBottomSpace = tooltipHeight + GAP < window.innerHeight - bottom;
|
|
15
|
+
const hasLeftSpace = tooltipWidth + GAP < left;
|
|
16
|
+
const hasRightSpace = tooltipWidth + GAP < window.innerWidth - left;
|
|
17
|
+
const hasMiddleRightSpace = tooltipWidth + GAP < window.innerWidth - left - itemWidth;
|
|
18
|
+
if (!hasBottomSpace && !hasRightSpace && initialPosition.includes('bottom-right')) {
|
|
19
|
+
return initialPosition.replace('bottom-right', 'top-left');
|
|
20
|
+
}
|
|
21
|
+
if (!hasTopSpace && initialPosition.includes('top')) {
|
|
22
|
+
return initialPosition.replace('top', 'bottom');
|
|
23
|
+
}
|
|
24
|
+
if (!hasBottomSpace && initialPosition.includes('bottom')) {
|
|
25
|
+
return initialPosition.replace('bottom', 'top');
|
|
26
|
+
}
|
|
27
|
+
if (!hasLeftSpace && initialPosition.includes('left')) {
|
|
28
|
+
return initialPosition.replace('left', 'right');
|
|
29
|
+
}
|
|
30
|
+
if (!hasRightSpace && initialPosition.includes('right')) {
|
|
31
|
+
return initialPosition.replace('right', 'left');
|
|
32
|
+
}
|
|
33
|
+
if (!hasMiddleRightSpace && initialPosition.includes('middle-right')) {
|
|
34
|
+
return initialPosition.replace('right', 'left');
|
|
35
|
+
}
|
|
36
|
+
return initialPosition;
|
|
37
|
+
}, [tooltipHeight, tooltipWidth, bottom, initialPosition]);
|
|
38
|
+
// this is calculations for triangle position
|
|
39
|
+
const finalPosition = useMemo(() => {
|
|
40
|
+
const hasLeftSpace = tooltipWidth < left + ARROW_DISTANCE + GAP;
|
|
41
|
+
const hasRightSpace = tooltipWidth + GAP < window.innerWidth - left;
|
|
42
|
+
// in case of middle position we don't need to change triangle position
|
|
43
|
+
if (calculatedPosition.includes('middle')) {
|
|
44
|
+
return calculatedPosition;
|
|
45
|
+
}
|
|
46
|
+
if (calculatedPosition.includes('right') && !hasLeftSpace) {
|
|
47
|
+
return calculatedPosition.replace('right', 'left');
|
|
48
|
+
}
|
|
49
|
+
if (calculatedPosition.includes('left') && !hasRightSpace) {
|
|
50
|
+
return calculatedPosition.replace('left', 'right');
|
|
51
|
+
}
|
|
52
|
+
if (calculatedPosition.includes('center')) {
|
|
53
|
+
const hasLeftHalfSpace = tooltipWidth / 2 < left + ARROW_DISTANCE + GAP;
|
|
54
|
+
const hasRightHalfSpace = tooltipWidth / 2 + GAP < window.innerWidth - left;
|
|
55
|
+
if (!hasLeftHalfSpace) {
|
|
56
|
+
return calculatedPosition.replace('center', 'left');
|
|
57
|
+
}
|
|
58
|
+
if (!hasRightHalfSpace) {
|
|
59
|
+
return calculatedPosition.replace('center', 'right');
|
|
60
|
+
}
|
|
61
|
+
return calculatedPosition;
|
|
62
|
+
}
|
|
63
|
+
return calculatedPosition;
|
|
64
|
+
}, [calculatedPosition, tooltipWidth, itemWidth, left]);
|
|
65
|
+
if (!hasTriangle) {
|
|
66
|
+
return calculatedPosition;
|
|
32
67
|
}
|
|
33
|
-
|
|
34
|
-
return initialPosition.replace('top', 'bottom');
|
|
35
|
-
}
|
|
36
|
-
if (!hasBottomSpace && initialPosition.includes('bottom')) {
|
|
37
|
-
return initialPosition.replace('bottom', 'top');
|
|
38
|
-
}
|
|
39
|
-
if (!hasLeftSpace && initialPosition.includes('left')) {
|
|
40
|
-
return initialPosition.replace('left', 'right');
|
|
41
|
-
}
|
|
42
|
-
if (!hasRightSpace && initialPosition.includes('right')) {
|
|
43
|
-
return initialPosition.replace('right', 'left');
|
|
44
|
-
}
|
|
45
|
-
if (!hasMiddleRightSpace && initialPosition.includes('middle-right')) {
|
|
46
|
-
return initialPosition.replace('right', 'left');
|
|
47
|
-
}
|
|
48
|
-
return initialPosition;
|
|
49
|
-
}, [tooltipHeight, tooltipWidth, bottom, initialPosition]);
|
|
50
|
-
|
|
51
|
-
// this is calculations for triangle position
|
|
52
|
-
var finalPosition = useMemo(function () {
|
|
53
|
-
var hasLeftSpace = tooltipWidth < left + ARROW_DISTANCE + GAP;
|
|
54
|
-
var hasRightSpace = tooltipWidth + GAP < window.innerWidth - left;
|
|
55
|
-
|
|
56
|
-
// in case of middle position we don't need to change triangle position
|
|
57
|
-
if (calculatedPosition.includes('middle')) {
|
|
58
|
-
return calculatedPosition;
|
|
59
|
-
}
|
|
60
|
-
if (calculatedPosition.includes('right') && !hasLeftSpace) {
|
|
61
|
-
return calculatedPosition.replace('right', 'left');
|
|
62
|
-
}
|
|
63
|
-
if (calculatedPosition.includes('left') && !hasRightSpace) {
|
|
64
|
-
return calculatedPosition.replace('left', 'right');
|
|
65
|
-
}
|
|
66
|
-
if (calculatedPosition.includes('center')) {
|
|
67
|
-
var hasLeftHalfSpace = tooltipWidth / 2 < left + ARROW_DISTANCE + GAP;
|
|
68
|
-
var hasRightHalfSpace = tooltipWidth / 2 + GAP < window.innerWidth - left;
|
|
69
|
-
if (!hasLeftHalfSpace) {
|
|
70
|
-
return calculatedPosition.replace('center', 'left');
|
|
71
|
-
}
|
|
72
|
-
if (!hasRightHalfSpace) {
|
|
73
|
-
return calculatedPosition.replace('center', 'right');
|
|
74
|
-
}
|
|
75
|
-
return calculatedPosition;
|
|
76
|
-
}
|
|
77
|
-
return calculatedPosition;
|
|
78
|
-
}, [calculatedPosition, tooltipWidth, itemWidth, left]);
|
|
79
|
-
if (!hasTriangle) {
|
|
80
|
-
return calculatedPosition;
|
|
81
|
-
}
|
|
82
|
-
return finalPosition;
|
|
68
|
+
return finalPosition;
|
|
83
69
|
};
|
|
84
|
-
|
|
85
|
-
export { useGetTooltipPosition };
|
|
@@ -1,89 +1,47 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useGetElemSizes } from './useGetElemSizes
|
|
3
|
-
import { useGetElemPositions } from './useGetElemPositions
|
|
4
|
-
import { useGetTooltipPosition } from './useGetTooltipPosition
|
|
5
|
-
import { Positions } from '../components/Tooltip/types
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
if (tooltipPosition === Positions.TOP_RIGHT) {
|
|
49
|
-
return {
|
|
50
|
-
top: top - tooltipHeight - TOOLTIP_GAP,
|
|
51
|
-
left: right - TOOLTIP_WIDTH - TOOLTIP_GAP
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
if (tooltipPosition === Positions.BOTTOM_CENTER) {
|
|
55
|
-
return {
|
|
56
|
-
top: top + (height + TOOLTIP_GAP),
|
|
57
|
-
left: left - (TOOLTIP_WIDTH - width) / 2
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
if (tooltipPosition === Positions.TOP_CENTER) {
|
|
61
|
-
return {
|
|
62
|
-
top: top - (tooltipHeight + TOOLTIP_GAP),
|
|
63
|
-
left: left - (TOOLTIP_WIDTH - width) / 2
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
if (tooltipPosition === Positions.MIDDLE_LEFT) {
|
|
67
|
-
return {
|
|
68
|
-
top: top + height / 2 - tooltipHeight / 2,
|
|
69
|
-
left: left - TOOLTIP_WIDTH - TOOLTIP_GAP
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
if (tooltipPosition === Positions.MIDDLE_RIGHT) {
|
|
73
|
-
return {
|
|
74
|
-
top: top + height / 2 - tooltipHeight / 2,
|
|
75
|
-
left: left + width + TOOLTIP_GAP
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
left: left,
|
|
80
|
-
top: top
|
|
81
|
-
};
|
|
82
|
-
}, [top, left, width, height, tooltipPosition, TOOLTIP_WIDTH]);
|
|
83
|
-
return {
|
|
84
|
-
tooltipStyles: tooltipStyles,
|
|
85
|
-
tooltipPosition: tooltipPosition
|
|
86
|
-
};
|
|
2
|
+
import { useGetElemSizes } from './useGetElemSizes';
|
|
3
|
+
import { useGetElemPositions } from './useGetElemPositions';
|
|
4
|
+
import { useGetTooltipPosition } from './useGetTooltipPosition';
|
|
5
|
+
import { Positions } from '../components/Tooltip/types';
|
|
6
|
+
const TOOLTIP_GAP = 8;
|
|
7
|
+
export const useGetTooltipStyles = ({ initialPosition, elemRef, tooltipRef, toolTipCurrentWidth }) => {
|
|
8
|
+
const { top, left, right } = useGetElemPositions(elemRef);
|
|
9
|
+
const { width, height } = useGetElemSizes(elemRef);
|
|
10
|
+
const { height: tooltipHeight, width: tooltipWitdh } = useGetElemSizes(tooltipRef);
|
|
11
|
+
const TOOLTIP_WIDTH = toolTipCurrentWidth || tooltipWitdh;
|
|
12
|
+
const tooltipPosition = useGetTooltipPosition({ tooltipRef, elemRef, initialPosition });
|
|
13
|
+
const tooltipStyles = useMemo(() => {
|
|
14
|
+
if (tooltipPosition === Positions.BOTTOM_LEFT) {
|
|
15
|
+
return { top: top + (height + TOOLTIP_GAP), left };
|
|
16
|
+
}
|
|
17
|
+
if (tooltipPosition === Positions.TOP_LEFT) {
|
|
18
|
+
return { top: top - (tooltipHeight + TOOLTIP_GAP), left };
|
|
19
|
+
}
|
|
20
|
+
if (tooltipPosition === Positions.BOTTOM_RIGHT) {
|
|
21
|
+
return {
|
|
22
|
+
top: top + (height + TOOLTIP_GAP),
|
|
23
|
+
left: right - TOOLTIP_WIDTH - TOOLTIP_GAP
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (tooltipPosition === Positions.TOP_RIGHT) {
|
|
27
|
+
return {
|
|
28
|
+
top: top - tooltipHeight - TOOLTIP_GAP,
|
|
29
|
+
left: right - TOOLTIP_WIDTH - TOOLTIP_GAP
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (tooltipPosition === Positions.BOTTOM_CENTER) {
|
|
33
|
+
return { top: top + (height + TOOLTIP_GAP), left: left - (TOOLTIP_WIDTH - width) / 2 };
|
|
34
|
+
}
|
|
35
|
+
if (tooltipPosition === Positions.TOP_CENTER) {
|
|
36
|
+
return { top: top - (tooltipHeight + TOOLTIP_GAP), left: left - (TOOLTIP_WIDTH - width) / 2 };
|
|
37
|
+
}
|
|
38
|
+
if (tooltipPosition === Positions.MIDDLE_LEFT) {
|
|
39
|
+
return { top: top + height / 2 - tooltipHeight / 2, left: left - TOOLTIP_WIDTH - TOOLTIP_GAP };
|
|
40
|
+
}
|
|
41
|
+
if (tooltipPosition === Positions.MIDDLE_RIGHT) {
|
|
42
|
+
return { top: top + height / 2 - tooltipHeight / 2, left: left + width + TOOLTIP_GAP };
|
|
43
|
+
}
|
|
44
|
+
return { left, top };
|
|
45
|
+
}, [top, left, width, height, tooltipPosition, TOOLTIP_WIDTH]);
|
|
46
|
+
return { tooltipStyles, tooltipPosition };
|
|
87
47
|
};
|
|
88
|
-
|
|
89
|
-
export { useGetTooltipStyles };
|
|
@@ -1,35 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setInitialOverflow(initial);
|
|
27
|
-
}
|
|
28
|
-
return function () {
|
|
29
|
-
document.body.style.overflow = initialOverflow;
|
|
30
|
-
};
|
|
31
|
-
}, []);
|
|
32
|
-
return null;
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export const useHideBodyScroll = (isOpen) => {
|
|
3
|
+
const [initialOverflow, setInitialOverflow] = useState('initial');
|
|
4
|
+
const [isHidden, setIsHidden] = useState(false);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
if (isOpen) {
|
|
7
|
+
document.body.style.overflow = 'hidden';
|
|
8
|
+
setIsHidden(true);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
if (isHidden) {
|
|
12
|
+
document.body.style.overflow = initialOverflow;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}, [isOpen]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const initial = document.body.style.overflow;
|
|
18
|
+
if (initial) {
|
|
19
|
+
setInitialOverflow(initial);
|
|
20
|
+
}
|
|
21
|
+
return () => {
|
|
22
|
+
document.body.style.overflow = initialOverflow;
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
return null;
|
|
33
26
|
};
|
|
34
|
-
|
|
35
|
-
export { useHideBodyScroll };
|
package/hooks/useHideOnScroll.js
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import { CUSTOM_SCROLL_NAME, CUSTOM_SCROLL_MESSAGE } from '../consts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
22
|
-
}, []);
|
|
23
|
-
return null;
|
|
2
|
+
import { CUSTOM_SCROLL_NAME, CUSTOM_SCROLL_MESSAGE } from '../consts';
|
|
3
|
+
export const useHideOnScroll = (hide) => {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
document.addEventListener('scroll', hide);
|
|
6
|
+
return () => {
|
|
7
|
+
document.removeEventListener('scroll', hide);
|
|
8
|
+
};
|
|
9
|
+
}, []);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
document.addEventListener(CUSTOM_SCROLL_NAME, (event) => {
|
|
12
|
+
const customEvent = event;
|
|
13
|
+
// Check the event type
|
|
14
|
+
if (customEvent.detail === CUSTOM_SCROLL_MESSAGE) {
|
|
15
|
+
// Close the menu
|
|
16
|
+
hide();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}, []);
|
|
20
|
+
return null;
|
|
24
21
|
};
|
|
25
|
-
|
|
26
|
-
export { useHideOnScroll };
|
|
@@ -1,52 +1,39 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
var callbackStack = [];
|
|
2
|
+
const callbackStack = [];
|
|
4
3
|
function handleMouseDownEvent(event) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
var ref = callbackObject.ref,
|
|
10
|
-
callback = callbackObject.callback,
|
|
11
|
-
shouldRemoveCallback = callbackObject.shouldRemoveCallback;
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
if (ref && !ref.contains(event.target)) {
|
|
14
|
-
if (shouldRemoveCallback) {
|
|
15
|
-
callbackStack.splice(callbackStack.length - 1, 1);
|
|
4
|
+
const callbackObject = callbackStack[callbackStack.length - 1];
|
|
5
|
+
if (!callbackObject) {
|
|
6
|
+
return;
|
|
16
7
|
}
|
|
17
|
-
callback
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
useEffect(function () {
|
|
23
|
-
if (ref && state && uid) {
|
|
24
|
-
callbackStack.push({
|
|
25
|
-
ref: ref,
|
|
26
|
-
callback: callback,
|
|
27
|
-
uid: uid,
|
|
28
|
-
shouldRemoveCallback: shouldRemoveCallback
|
|
29
|
-
});
|
|
30
|
-
if (callbackStack.length === 1) {
|
|
31
|
-
document.addEventListener('mousedown', handleMouseDownEvent);
|
|
32
|
-
}
|
|
33
|
-
return function () {
|
|
34
|
-
if (callbackStack.length === 0) {
|
|
35
|
-
document.removeEventListener('mousedown', handleMouseDownEvent);
|
|
8
|
+
const { ref, callback, shouldRemoveCallback } = callbackObject;
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
if (ref && !ref.contains(event.target)) {
|
|
11
|
+
if (shouldRemoveCallback) {
|
|
12
|
+
callbackStack.splice(callbackStack.length - 1, 1);
|
|
36
13
|
}
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
}, [ref, state, uid]);
|
|
40
|
-
useEffect(function () {
|
|
41
|
-
if (!state && callbackStack.length > 0) {
|
|
42
|
-
var activeElementIndex = callbackStack.findIndex(function (stack) {
|
|
43
|
-
return stack.uid === uid;
|
|
44
|
-
});
|
|
45
|
-
if (activeElementIndex >= 0) {
|
|
46
|
-
callbackStack.splice(activeElementIndex, 1);
|
|
47
|
-
}
|
|
14
|
+
callback(event);
|
|
48
15
|
}
|
|
49
|
-
|
|
16
|
+
}
|
|
17
|
+
export const useOnOutsideClick = (ref, callback, state, uid, shouldRemoveCallback = true) => {
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (ref && state && uid) {
|
|
20
|
+
callbackStack.push({ ref, callback, uid, shouldRemoveCallback });
|
|
21
|
+
if (callbackStack.length === 1) {
|
|
22
|
+
document.addEventListener('mousedown', handleMouseDownEvent);
|
|
23
|
+
}
|
|
24
|
+
return () => {
|
|
25
|
+
if (callbackStack.length === 0) {
|
|
26
|
+
document.removeEventListener('mousedown', handleMouseDownEvent);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}, [ref, state, uid]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!state && callbackStack.length > 0) {
|
|
33
|
+
const activeElementIndex = callbackStack.findIndex((stack) => stack.uid === uid);
|
|
34
|
+
if (activeElementIndex >= 0) {
|
|
35
|
+
callbackStack.splice(activeElementIndex, 1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}, [state]);
|
|
50
39
|
};
|
|
51
|
-
|
|
52
|
-
export { useOnOutsideClick };
|
package/hooks/useScreenSize.js
CHANGED
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
1
|
import { useState, useEffect } from 'react';
|
|
3
|
-
import { SCREEN_SIZES } from '../consts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
case width <= SMALL:
|
|
18
|
-
return 'small';
|
|
19
|
-
case width <= MEDIUM:
|
|
20
|
-
return 'medium';
|
|
21
|
-
default:
|
|
22
|
-
return 'large';
|
|
2
|
+
import { SCREEN_SIZES } from '../consts';
|
|
3
|
+
const { SMALL, MEDIUM } = SCREEN_SIZES;
|
|
4
|
+
export const useScreenSize = () => {
|
|
5
|
+
const [screenSize, setScreenSize] = useState(getScreenSize);
|
|
6
|
+
function getScreenSize() {
|
|
7
|
+
const width = window.innerWidth;
|
|
8
|
+
switch (true) {
|
|
9
|
+
case width <= SMALL:
|
|
10
|
+
return 'small';
|
|
11
|
+
case width <= MEDIUM:
|
|
12
|
+
return 'medium';
|
|
13
|
+
default:
|
|
14
|
+
return 'large';
|
|
15
|
+
}
|
|
23
16
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setScreenSize(getScreenSize());
|
|
27
|
-
};
|
|
28
|
-
useEffect(function () {
|
|
29
|
-
window.addEventListener('resize', handleResize);
|
|
30
|
-
handleResize();
|
|
31
|
-
return function () {
|
|
32
|
-
window.removeEventListener('resize', handleResize);
|
|
17
|
+
const handleResize = () => {
|
|
18
|
+
setScreenSize(getScreenSize());
|
|
33
19
|
};
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
window.addEventListener('resize', handleResize);
|
|
22
|
+
handleResize();
|
|
23
|
+
return () => {
|
|
24
|
+
window.removeEventListener('resize', handleResize);
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
27
|
+
return screenSize;
|
|
36
28
|
};
|
|
37
|
-
|
|
38
|
-
export { useScreenSize };
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import './assets/styles/index.scss';
|
|
|
2
2
|
export * from './components/Alert';
|
|
3
3
|
export * from './components/Avatar';
|
|
4
4
|
export * from './components/Badge';
|
|
5
|
+
export * from './components/BadgeV2';
|
|
5
6
|
export * from './components/Breadcrumb';
|
|
6
7
|
export * from './components/Button';
|
|
7
8
|
export * from './components/Checkbox';
|