hrm_ui_lib 2.0.3 → 2.1.1
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 +525 -0
- package/assets/styles/styles.scss +3 -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/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.d.ts +4 -0
- package/components/SVGIcons/IconChevronDoubleLeft.js +8 -0
- package/components/SVGIcons/IconChevronDoubleRight.d.ts +4 -0
- package/components/SVGIcons/IconChevronDoubleRight.js +8 -0
- 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.d.ts +2 -0
- package/components/SVGIcons/index.js +302 -303
- 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.d.ts +8 -0
- package/components/TableV2/AdvancedPagination.js +62 -0
- package/components/TableV2/ColumnHeader.d.ts +9 -0
- package/components/TableV2/ColumnHeader.js +32 -0
- package/components/TableV2/ColumnSettings.d.ts +9 -0
- package/components/TableV2/ColumnSettings.js +33 -0
- package/components/TableV2/IndeterminateCheckbox.d.ts +13 -0
- package/components/TableV2/IndeterminateCheckbox.js +16 -0
- package/components/TableV2/Table.d.ts +3 -0
- package/components/TableV2/Table.js +123 -0
- package/components/TableV2/constants/index.d.ts +6 -0
- package/components/TableV2/constants/index.js +27 -0
- package/components/TableV2/hooks/useTableColumnSettings.d.ts +2 -0
- package/components/TableV2/hooks/useTableColumnSettings.js +17 -0
- package/components/TableV2/hooks/useTableControl.d.ts +11 -0
- package/components/TableV2/hooks/useTableControl.js +182 -0
- package/components/TableV2/index.d.ts +3 -0
- package/components/TableV2/index.js +3 -0
- package/components/TableV2/loadTableSettings.d.ts +2 -0
- package/components/TableV2/loadTableSettings.js +9 -0
- package/components/TableV2/types.d.ts +70 -0
- package/components/TableV2/types.js +1 -0
- 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 +46 -453
- package/package.json +5 -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-V_kH4Snn.js → Alert-sShHxUYN.js} +0 -0
|
@@ -1,78 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import '../../type/file-upload.js';
|
|
17
|
-
import '../../hooks/useScreenSize.js';
|
|
18
|
-
import 'react-hook-form';
|
|
19
|
-
import 'react-dropzone';
|
|
20
|
-
import '../SVGIcons/IconUpload.js';
|
|
21
|
-
import '../FileUpload/types.js';
|
|
22
|
-
import '../../helpers/format-date.js';
|
|
23
|
-
import '../../helpers/locale.js';
|
|
24
|
-
import '../../type/locale.js';
|
|
25
|
-
import '../../helpers/storage.js';
|
|
26
|
-
import 'react-toastify';
|
|
27
|
-
import '../../hooks/useGetIsMobile.js';
|
|
28
|
-
import 'framer-motion';
|
|
29
|
-
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
30
|
-
import '../../hooks/useOnOutsideClick.js';
|
|
31
|
-
import '../../hooks/useHideBodyScroll.js';
|
|
32
|
-
import '../SVGIcons/IconDismiss.js';
|
|
33
|
-
import '../Tooltip/types.js';
|
|
34
|
-
import '../Tooltip/Tooltip.js';
|
|
35
|
-
import '../../hooks/useGetTooltipStyles.js';
|
|
36
|
-
import '../../hooks/useGetElemSizes.js';
|
|
37
|
-
import '../../hooks/useGetElemPositions.js';
|
|
38
|
-
import '../../hooks/useGetTooltipPosition.js';
|
|
39
|
-
import '../../hooks/useHideOnScroll.js';
|
|
40
|
-
import 'react-syntax-highlighter';
|
|
41
|
-
import '../Link/Link.js';
|
|
42
|
-
import '../Popover/PopoverDesktop.js';
|
|
43
|
-
import '../SVGIcons/IconInfo.js';
|
|
44
|
-
import '../../helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
45
|
-
import '../../helperComponents/IconDynamicComponent/constants.js';
|
|
46
|
-
import '@babel/runtime/helpers/typeof';
|
|
47
|
-
import '../SVGIcons/IconDismissFilled.js';
|
|
48
|
-
import '../SVGIcons/IconDelete.js';
|
|
49
|
-
import '../FileUpload/DropzoneFileUpload/FilePreview.js';
|
|
50
|
-
import '../Progress/Progress.js';
|
|
51
|
-
import '../SVGIcons/IconArrowDownloadFilled.js';
|
|
52
|
-
import '../../helpers/download-file.js';
|
|
53
|
-
import '../Button/consts.js';
|
|
54
|
-
|
|
55
|
-
var CHECKBOX_HEADER_ID = 'selection';
|
|
56
|
-
var CHECKBOX_DEFAULT_WIDTH = 48;
|
|
57
|
-
function setSelectedRows(hooks, withSelect) {
|
|
58
|
-
if (withSelect) {
|
|
59
|
-
hooks.visibleColumns.push(function (columns) {
|
|
60
|
-
return [{
|
|
61
|
-
id: CHECKBOX_HEADER_ID,
|
|
62
|
-
Header: function Header(_ref) {
|
|
63
|
-
var getToggleAllRowsSelectedProps = _ref.getToggleAllRowsSelectedProps;
|
|
64
|
-
return /*#__PURE__*/React.createElement(IndeterminateCheckbox, getToggleAllRowsSelectedProps());
|
|
65
|
-
},
|
|
66
|
-
Cell: function Cell(_ref2) {
|
|
67
|
-
var row = _ref2.row;
|
|
68
|
-
return /*#__PURE__*/React.createElement(IndeterminateCheckbox, row.getToggleRowSelectedProps());
|
|
69
|
-
}
|
|
70
|
-
}].concat(_toConsumableArray(columns));
|
|
71
|
-
});
|
|
72
|
-
}
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IndeterminateCheckbox } from './IndeterminateCheckbox';
|
|
3
|
+
export const CHECKBOX_HEADER_ID = 'selection';
|
|
4
|
+
export const CHECKBOX_DEFAULT_WIDTH = 48;
|
|
5
|
+
export function setSelectedRows(hooks, withSelect) {
|
|
6
|
+
if (withSelect) {
|
|
7
|
+
hooks.visibleColumns.push((columns) => [
|
|
8
|
+
{
|
|
9
|
+
id: CHECKBOX_HEADER_ID,
|
|
10
|
+
Header: ({ getToggleAllRowsSelectedProps }) => (_jsx(IndeterminateCheckbox, Object.assign({}, getToggleAllRowsSelectedProps()))),
|
|
11
|
+
Cell: ({ row }) => _jsx(IndeterminateCheckbox, Object.assign({}, row.getToggleRowSelectedProps()))
|
|
12
|
+
},
|
|
13
|
+
...columns
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
73
16
|
}
|
|
74
|
-
function calcColumnWidth(percent, tableWidth) {
|
|
75
|
-
|
|
17
|
+
export function calcColumnWidth(percent, tableWidth) {
|
|
18
|
+
return (percent * tableWidth) / 100;
|
|
76
19
|
}
|
|
77
|
-
|
|
78
|
-
export { CHECKBOX_DEFAULT_WIDTH, CHECKBOX_HEADER_ID, calcColumnWidth, setSelectedRows };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Table } from '@tanstack/react-table';
|
|
2
|
+
interface PaginationProps<T> {
|
|
3
|
+
table: Table<T>;
|
|
4
|
+
totalCount: number;
|
|
5
|
+
buttonText?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function AdvancedPagination<TData>({ table, totalCount, buttonText }: PaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Input } from '../Input';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import { Select } from '../Select';
|
|
6
|
+
import { Text } from '../Text';
|
|
7
|
+
import classnames from 'classnames';
|
|
8
|
+
import { OPTIONS } from './constants';
|
|
9
|
+
import IconChevronLeft from '../SVGIcons/IconChevronLeft';
|
|
10
|
+
import IconChevronRight from '../SVGIcons/IconChevronRight';
|
|
11
|
+
import IconChevronDoubleLeft from '../SVGIcons/IconChevronDoubleLeft';
|
|
12
|
+
import IconChevronDoubleRight from '../SVGIcons/IconChevronDoubleRight';
|
|
13
|
+
import IconMore from '../SVGIcons/IconMore';
|
|
14
|
+
export function AdvancedPagination({ table, totalCount, buttonText }) {
|
|
15
|
+
const [navigatePage, setNavigatePage] = useState('1');
|
|
16
|
+
const pageIndex = table.getState().pagination.pageIndex;
|
|
17
|
+
const pageSize = table.getState().pagination.pageSize;
|
|
18
|
+
const onNavigateToPage = (page) => {
|
|
19
|
+
if (!page || (/^[1-9]\d*$/.test(page) && table.getPageCount() >= Number(page))) {
|
|
20
|
+
setNavigatePage(page);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const onGoToPage = () => {
|
|
24
|
+
const page = navigatePage ? Number(navigatePage) - 1 : 0;
|
|
25
|
+
table.setPageIndex(page);
|
|
26
|
+
};
|
|
27
|
+
const onRowCountChange = (value) => {
|
|
28
|
+
if (value) {
|
|
29
|
+
table.setPagination({
|
|
30
|
+
pageIndex: 0,
|
|
31
|
+
pageSize: Number(value)
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const getVisiblePageNumbers = () => {
|
|
36
|
+
const currentPage = pageIndex;
|
|
37
|
+
const totalPages = table.getPageCount();
|
|
38
|
+
const visiblePages = [];
|
|
39
|
+
if (totalPages <= 7) {
|
|
40
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
41
|
+
}
|
|
42
|
+
visiblePages.push(1);
|
|
43
|
+
if (currentPage <= 3) {
|
|
44
|
+
visiblePages.push(2, 3, 4, 5, '+++', totalPages);
|
|
45
|
+
}
|
|
46
|
+
else if (currentPage > totalPages - 5) {
|
|
47
|
+
visiblePages.push('---', totalPages - 4, totalPages - 3, totalPages - 2, totalPages - 1, totalPages);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
visiblePages.push('---', currentPage, currentPage + 1, currentPage + 2, '+++', totalPages);
|
|
51
|
+
}
|
|
52
|
+
return visiblePages;
|
|
53
|
+
};
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (table.getPageCount() < Number(navigatePage)) {
|
|
56
|
+
setNavigatePage('1');
|
|
57
|
+
}
|
|
58
|
+
}, [table.getPageCount(), table.getState().pagination]);
|
|
59
|
+
return (_jsxs("div", { className: "advanced-table__pagination", children: [_jsx(Select, { setSelectedItem: (value) => onRowCountChange(value), selectedItem: `${pageSize}`, className: 'no-border', options: OPTIONS }), _jsxs("div", { className: 'advanced-table__pagination__right', children: [_jsxs(Text, { type: 'tertiary', children: [pageIndex * pageSize + 1, " - ", (pageIndex + 1) * pageSize, " / ", totalCount] }), _jsxs("div", { className: "flexbox align-items--center", children: [_jsx(Input, { currentValue: navigatePage, size: "small", onChange: (e) => onNavigateToPage(e.target.value), className: "advanced-table__pagination__right__input mr-8" }), _jsx(Button, { onClick: onGoToPage, type: "secondary", size: "medium", buttonText: buttonText !== null && buttonText !== void 0 ? buttonText : 'Go to page' })] }), _jsxs("ul", { className: "pagination", children: [_jsx("li", { className: `previous ${!table.getCanPreviousPage() ? 'disabled' : ''}`, children: _jsx("a", { rel: 'prev', role: 'button', onClick: () => table.firstPage(), children: _jsx(IconChevronDoubleLeft, { size: 'small' }) }) }), _jsx("li", { className: `previous ${!table.getCanPreviousPage() ? 'disabled' : ''}`, children: _jsx("a", { rel: 'prev', role: 'button', onClick: () => table.previousPage(), children: _jsx(IconChevronLeft, { size: 'small' }) }) }), getVisiblePageNumbers().map((pageNumber, index) => pageNumber === '---' ? (_jsx("li", { className: 'pagination__more', children: _jsx("a", { role: 'button', onClick: () => table.setPageIndex(+pageIndex - 3), children: _jsx(IconMore, { size: 'small' }) }) }, `ellipsis-${index}`)) : pageNumber === '+++' ? (_jsx("li", { className: 'pagination__more', children: _jsx("a", { role: 'button', onClick: () => table.setPageIndex(+pageIndex + 3), children: _jsx(IconMore, { size: 'small' }) }) }, `ellipsis-${index}`)) : (_jsx("li", { className: classnames({
|
|
60
|
+
['active']: pageNumber === pageIndex + 1
|
|
61
|
+
}), children: _jsx("a", { role: 'button', onClick: () => table.setPageIndex(+pageNumber - 1), children: pageNumber }) }, pageNumber))), _jsx("li", { className: `next ${!table.getCanNextPage() ? 'disabled' : ''}`, children: _jsx("a", { rel: 'next', role: 'button', onClick: () => table.nextPage(), children: _jsx(IconChevronRight, { size: 'small' }) }) }), _jsx("li", { className: `next ${!table.getCanNextPage() ? 'disabled' : ''}`, children: _jsx("a", { rel: 'next', role: 'button', onClick: () => table.lastPage(), children: _jsx(IconChevronDoubleRight, { size: 'small' }) }) })] })] })] }));
|
|
62
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { Header } from '@tanstack/react-table';
|
|
3
|
+
interface DraggableColumnHeaderProps<TData> {
|
|
4
|
+
header: Header<TData, unknown>;
|
|
5
|
+
isPinned?: boolean;
|
|
6
|
+
pinnedStyles: CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
export declare function ColumnHeader<TData>({ header, pinnedStyles }: DraggableColumnHeaderProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { flexRender } from '@tanstack/react-table';
|
|
3
|
+
import { useSortable } from '@dnd-kit/sortable';
|
|
4
|
+
import IconArrowDown from '../SVGIcons/IconArrowDown';
|
|
5
|
+
import IconArrowSort from '../SVGIcons/IconArrowSort';
|
|
6
|
+
import IconArrowUp from '../SVGIcons/IconArrowUp';
|
|
7
|
+
import { Text } from '../Text';
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
export function ColumnHeader({ header, pinnedStyles }) {
|
|
10
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
11
|
+
id: header.id
|
|
12
|
+
});
|
|
13
|
+
const style = transform
|
|
14
|
+
? {
|
|
15
|
+
transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,
|
|
16
|
+
transition,
|
|
17
|
+
minWidth: header.getSize(),
|
|
18
|
+
position: 'relative',
|
|
19
|
+
zIndex: isDragging ? 1 : 0
|
|
20
|
+
}
|
|
21
|
+
: {
|
|
22
|
+
minWidth: header.getSize(),
|
|
23
|
+
position: 'relative',
|
|
24
|
+
zIndex: isDragging ? 1 : 0
|
|
25
|
+
};
|
|
26
|
+
return (_jsxs("th", Object.assign({ ref: setNodeRef, style: Object.assign(Object.assign({}, style), pinnedStyles), className: classnames('select-none', {
|
|
27
|
+
['with-checkbox']: header.column.id === 'select',
|
|
28
|
+
['actions-header']: header.column.id === 'actions',
|
|
29
|
+
['cursor-pointer']: header.column.getCanSort()
|
|
30
|
+
}) }, attributes, { children: [_jsxs("div", { onClick: header.column.getToggleSortingHandler(), className: "flexbox align-items--center", children: [_jsx("div", Object.assign({}, listeners, { children: _jsx(Text, { className: "text-left", weight: 'bold', children: flexRender(header.column.columnDef.header, header.getContext()) }) })), _jsx("span", { className: "ml-4", children: header.column.getCanSort() &&
|
|
31
|
+
(header.column.getIsSorted() === 'asc' ? (_jsx(IconArrowUp, { size: "xsmall" })) : header.column.getIsSorted() === 'desc' ? (_jsx(IconArrowDown, { size: "xsmall" })) : (_jsx(IconArrowSort, { size: "xsmall" }))) })] }), _jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: "resize-icon select-none touch-none" })] })));
|
|
32
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Table } from '@tanstack/react-table';
|
|
2
|
+
interface ColumnSettingsProps<T> {
|
|
3
|
+
table: Table<T>;
|
|
4
|
+
tooltipText?: string;
|
|
5
|
+
hiddenColumns?: string[];
|
|
6
|
+
allToggleText?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ColumnSettings<T>({ table, tooltipText, hiddenColumns, allToggleText }: ColumnSettingsProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
import { IconSettings } from '../SVGIcons';
|
|
5
|
+
import { Switcher } from '../Switcher';
|
|
6
|
+
import { Menu } from '../Menu';
|
|
7
|
+
import { Tooltip } from '../Tooltip';
|
|
8
|
+
import { Positions } from '../Tooltip/types';
|
|
9
|
+
const defaultHiddenColumnSettings = ['select', 'actions', 'expand'];
|
|
10
|
+
export function ColumnSettings({ table, tooltipText, hiddenColumns = [], allToggleText = 'All' }) {
|
|
11
|
+
const [ref, setRef] = useState(null);
|
|
12
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
13
|
+
const closeUserMenu = () => {
|
|
14
|
+
setIsOpen(false);
|
|
15
|
+
};
|
|
16
|
+
const handleClick = (column) => {
|
|
17
|
+
const toggle = column.getToggleVisibilityHandler();
|
|
18
|
+
if (toggle) {
|
|
19
|
+
toggle({ target: { checked: !column.getIsVisible() } });
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const hiddenColumnSettings = defaultHiddenColumnSettings.concat(hiddenColumns);
|
|
23
|
+
return (_jsxs("div", { ref: setRef, children: [_jsx(Button, { type: "secondary", iconProps: {
|
|
24
|
+
Component: IconSettings
|
|
25
|
+
}, onClick: () => setIsOpen((prev) => !prev) }), _jsx(Menu, { className: "settings-menu", position: "top-left", onClose: closeUserMenu, isOpen: isOpen, parentRef: ref, children: _jsxs("div", { className: "settings-menu__dropdown", children: [_jsx("div", { className: "relative", children: _jsx("div", { className: "settings-menu__dropdown__option sticky", children: _jsx(Switcher, { label: allToggleText, selectedValue: table.getIsAllColumnsVisible(), onClick: () => table.toggleAllColumnsVisible(), inlineType: true, size: 'small' }) }) }), _jsx("div", { className: "scrollbar--content scrollbar scrollbar--vertical", children: table.getAllLeafColumns().map((column) => {
|
|
26
|
+
if (!(hiddenColumnSettings === null || hiddenColumnSettings === void 0 ? void 0 : hiddenColumnSettings.includes(column.id))) {
|
|
27
|
+
const label = typeof column.columnDef.header === 'string'
|
|
28
|
+
? column.columnDef.header
|
|
29
|
+
: column.columnDef.id;
|
|
30
|
+
return (_jsxs("div", { className: 'settings-menu__dropdown__option', children: [tooltipText && !column.getCanHide() && (_jsx(Tooltip, { position: Positions.TOP_CENTER, text: tooltipText, id: column.columnDef.id })), _jsx(Switcher, { label: label, id: column.columnDef.id, selectedValue: column.getIsVisible(), onClick: () => handleClick(column), disabled: !column.getCanHide(), inlineType: true, size: 'small' })] }, column.id));
|
|
31
|
+
}
|
|
32
|
+
}) })] }) })] }));
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type IndeterminateCheckboxProps = {
|
|
3
|
+
indeterminate: boolean;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
onChange: (e: {
|
|
6
|
+
target: {
|
|
7
|
+
checked: boolean;
|
|
8
|
+
};
|
|
9
|
+
}) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const IndeterminateCheckbox: React.ForwardRefExoticComponent<IndeterminateCheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useRef } from 'react';
|
|
3
|
+
import { Checkbox } from '../Checkbox';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
export const IndeterminateCheckbox = forwardRef(({ indeterminate, checked, onChange, disabled }, ref) => {
|
|
6
|
+
const defaultRef = useRef(null);
|
|
7
|
+
const resolvedRef = ref !== null && ref !== void 0 ? ref : defaultRef;
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
resolvedRef.current.indeterminate = indeterminate;
|
|
10
|
+
}, [resolvedRef, indeterminate]);
|
|
11
|
+
const handleChange = (v) => {
|
|
12
|
+
onChange({ target: { checked: v } });
|
|
13
|
+
};
|
|
14
|
+
return (_jsx("div", { className: 'actions-list', children: _jsx(Checkbox, { className: classNames('actions-list__checkbox', { 'active-checkbox': checked }), value: checked, disabled: disabled, onClick: handleChange, ref: resolvedRef }) }));
|
|
15
|
+
});
|
|
16
|
+
IndeterminateCheckbox.displayName = 'IndeterminateCheckbox';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TTableProps } from './types';
|
|
2
|
+
import 'react-loading-skeleton/dist/skeleton.css';
|
|
3
|
+
export declare function Table<TData>({ data, columns, isLoading, hasError, isActionsVisible, totalCount, emptyTitle, emptySubTitle, emptyIllustration, withSelect, withBorder, defaultPageIndex, defaultPageSize, defaultHiddenColumns, collapsibleRows, renderExpandedContent, renderHeader, renderFooter, onSortChange, onRowClick, tableSettings, onRowSelection, onColumnSizing, onPaginationChange }: TTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useCallback, useMemo } from 'react';
|
|
3
|
+
import { flexRender } from '@tanstack/react-table';
|
|
4
|
+
import { DndContext, DragOverlay, closestCenter } from '@dnd-kit/core';
|
|
5
|
+
import { SortableContext, horizontalListSortingStrategy } from '@dnd-kit/sortable';
|
|
6
|
+
import { ColumnHeader } from './ColumnHeader';
|
|
7
|
+
import Skeleton from 'react-loading-skeleton';
|
|
8
|
+
import { useTableControl } from './hooks/useTableControl';
|
|
9
|
+
import { Text } from '../Text';
|
|
10
|
+
import classnames from 'classnames';
|
|
11
|
+
import { Empty } from '../Empty';
|
|
12
|
+
import { Button } from '../Button';
|
|
13
|
+
import { IconChevronDown } from '../SVGIcons/IconChevronDown';
|
|
14
|
+
import { IconChevronUp } from '../SVGIcons/IconChevronUp';
|
|
15
|
+
import 'react-loading-skeleton/dist/skeleton.css';
|
|
16
|
+
var ColumnId;
|
|
17
|
+
(function (ColumnId) {
|
|
18
|
+
ColumnId["Select"] = "select";
|
|
19
|
+
ColumnId["Actions"] = "actions";
|
|
20
|
+
ColumnId["Expand"] = "expand";
|
|
21
|
+
})(ColumnId || (ColumnId = {}));
|
|
22
|
+
const ExpandColumn = ({ row, expandedRows, onToggle }) => {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
const hasSubRows = ((_a = row.original) === null || _a === void 0 ? void 0 : _a.subRows) && ((_c = (_b = row.original) === null || _b === void 0 ? void 0 : _b.subRows) === null || _c === void 0 ? void 0 : _c.length) > 0;
|
|
25
|
+
if (!hasSubRows)
|
|
26
|
+
return null;
|
|
27
|
+
return (_jsx(Button, { type: "tertiary", size: "medium", className: classnames('advanced-table__expand-button'), iconProps: {
|
|
28
|
+
Component: expandedRows.has(row.id) ? IconChevronUp : IconChevronDown
|
|
29
|
+
}, onClick: (e) => {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
onToggle(row.id);
|
|
32
|
+
} }));
|
|
33
|
+
};
|
|
34
|
+
export function Table({ data, columns, isLoading, hasError, isActionsVisible = false, totalCount = 0, emptyTitle, emptySubTitle, emptyIllustration, withSelect = false, withBorder = true, defaultPageIndex, defaultPageSize, defaultHiddenColumns, collapsibleRows = false, renderExpandedContent, renderHeader, renderFooter, onSortChange, onRowClick, tableSettings, onRowSelection, onColumnSizing, onPaginationChange }) {
|
|
35
|
+
const [expandedRows, setExpandedRows] = useState(new Set());
|
|
36
|
+
const handleToggleRow = useCallback((rowId) => {
|
|
37
|
+
setExpandedRows((prev) => {
|
|
38
|
+
const next = new Set(prev);
|
|
39
|
+
if (next.has(rowId)) {
|
|
40
|
+
next.delete(rowId);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
next.add(rowId);
|
|
44
|
+
}
|
|
45
|
+
return next;
|
|
46
|
+
});
|
|
47
|
+
}, []);
|
|
48
|
+
const expandColumn = useMemo(() => ({
|
|
49
|
+
id: ColumnId.Expand,
|
|
50
|
+
accessorKey: 'expand',
|
|
51
|
+
header: () => _jsx("span", { style: { display: 'none' }, children: "Expand" }),
|
|
52
|
+
size: 50,
|
|
53
|
+
minSize: 50,
|
|
54
|
+
maxSize: 50,
|
|
55
|
+
cell: ({ row }) => (_jsx(ExpandColumn, { row: row, expandedRows: expandedRows, onToggle: handleToggleRow })),
|
|
56
|
+
meta: {
|
|
57
|
+
enableHiding: false,
|
|
58
|
+
enableColumnDragging: false,
|
|
59
|
+
enablePinning: true,
|
|
60
|
+
enableResizing: false,
|
|
61
|
+
headerVisible: false,
|
|
62
|
+
enableSorting: false
|
|
63
|
+
}
|
|
64
|
+
}), [expandedRows, handleToggleRow]);
|
|
65
|
+
const { table, sensors, handleDragStart, handleDragEnd, handleDragCancel, activeHeader } = useTableControl({
|
|
66
|
+
data,
|
|
67
|
+
tableSettings,
|
|
68
|
+
columns: collapsibleRows ? [expandColumn, ...columns] : columns,
|
|
69
|
+
withSelect,
|
|
70
|
+
totalCount,
|
|
71
|
+
defaultPageIndex,
|
|
72
|
+
defaultPageSize,
|
|
73
|
+
defaultHiddenColumns,
|
|
74
|
+
onSortChange,
|
|
75
|
+
onRowSelection,
|
|
76
|
+
onColumnSizing,
|
|
77
|
+
onPaginationChange
|
|
78
|
+
});
|
|
79
|
+
const header = renderHeader === null || renderHeader === void 0 ? void 0 : renderHeader(table);
|
|
80
|
+
const footer = renderFooter === null || renderFooter === void 0 ? void 0 : renderFooter(table);
|
|
81
|
+
const getCommonPinningStyles = (column) => {
|
|
82
|
+
const isPinned = column.getIsPinned();
|
|
83
|
+
return {
|
|
84
|
+
left: isPinned === 'left' ? `${column.getStart('left')}px` : undefined,
|
|
85
|
+
right: isPinned === 'right' ? `${column.getAfter('right')}px` : undefined,
|
|
86
|
+
position: isPinned ? 'sticky' : 'relative',
|
|
87
|
+
backgroundColor: isPinned ? 'white' : undefined,
|
|
88
|
+
minWidth: column.getSize(),
|
|
89
|
+
zIndex: isPinned ? 1 : 0
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const handleRowClick = (column, row) => {
|
|
93
|
+
if (column.id !== ColumnId.Actions && column.id !== ColumnId.Select && onRowClick) {
|
|
94
|
+
onRowClick(row);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const tableStyle = useMemo(() => ({
|
|
98
|
+
minWidth: (data === null || data === void 0 ? void 0 : data.length) ? table.getCenterTotalSize() : undefined
|
|
99
|
+
}), [data === null || data === void 0 ? void 0 : data.length, table]);
|
|
100
|
+
const skeletonRowSize = useMemo(() => {
|
|
101
|
+
return Array.from({ length: table.getState().pagination.pageSize });
|
|
102
|
+
}, [table.getState().pagination.pageSize]);
|
|
103
|
+
return (_jsxs("div", { className: classnames('advanced-table', {
|
|
104
|
+
'with-border': withBorder
|
|
105
|
+
}), children: [header, _jsx("div", { className: classnames('advanced-table__inner scrollbar scrollbar--horizontal scrollbar--vertical'), children: _jsxs(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onDragCancel: handleDragCancel, children: [_jsx("div", { children: _jsx("table", { style: tableStyle, children: !isLoading && (!(data === null || data === void 0 ? void 0 : data.length) || hasError) ? (_jsx(Empty, { mainMessage: emptyTitle, paragraphMessage: emptySubTitle, illustration: emptyIllustration })) : (_jsxs(_Fragment, { children: [_jsx("thead", { className: classnames('advanced-table__thead'), children: table.getHeaderGroups().map((headerGroup) => (_jsx("tr", { children: _jsx(SortableContext, { items: headerGroup.headers.map((header) => header.id), strategy: horizontalListSortingStrategy, children: headerGroup.headers.map((header) => {
|
|
106
|
+
if (header.id === ColumnId.Actions && !isActionsVisible)
|
|
107
|
+
return null;
|
|
108
|
+
return (_jsx(ColumnHeader, { pinnedStyles: Object.assign({}, getCommonPinningStyles(header.column)), header: header }, header.id));
|
|
109
|
+
}) }) }, headerGroup.id))) }), _jsx("tbody", { children: isLoading
|
|
110
|
+
? skeletonRowSize.map((_, i) => (_jsx("tr", { children: table.getVisibleFlatColumns().map((column) => (_jsx("td", { className: classnames({
|
|
111
|
+
'with-checkbox': column.id === ColumnId.Select,
|
|
112
|
+
'pinned-cell': column.getIsPinned(),
|
|
113
|
+
'action-column': column.id === ColumnId.Actions && !isActionsVisible
|
|
114
|
+
}), style: Object.assign({}, getCommonPinningStyles(column)), children: _jsx(Skeleton, {}) }, column.id))) }, `skeleton-row-${i}`)))
|
|
115
|
+
: table.getRowModel().rows.map((row) => (_jsxs(React.Fragment, { children: [_jsx("tr", { className: classnames({ selected: row.getIsSelected() }), children: row.getVisibleCells().map((cell) => (_jsx("td", { className: classnames({
|
|
116
|
+
'with-checkbox': cell.column.id === ColumnId.Select,
|
|
117
|
+
'pinned-cell': cell.column.getIsPinned(),
|
|
118
|
+
'action-column': cell.column.id === ColumnId.Actions && !isActionsVisible,
|
|
119
|
+
'expand-column': cell.column.id === ColumnId.Expand
|
|
120
|
+
}), id: cell.id, onClick: () => handleRowClick(cell.column, row), style: Object.assign({}, getCommonPinningStyles(cell.column)), children: cell.column.id === ColumnId.Actions && !isActionsVisible ? (_jsx("div", { className: classnames('actions-list__right'), children: flexRender(cell.column.columnDef.cell, cell.getContext()) })) : (flexRender(cell.column.columnDef.cell, cell.getContext())) }, cell.id))) }), collapsibleRows &&
|
|
121
|
+
expandedRows.has(row.id) &&
|
|
122
|
+
renderExpandedContent && (_jsx("tr", { className: classnames('advanced-table__expanded-row'), children: _jsx("td", { colSpan: row.getVisibleCells().length, children: renderExpandedContent(row) }) }))] }, row.id))) })] })) }) }), _jsx(DragOverlay, { dropAnimation: null, children: activeHeader && (_jsx("table", { style: { width: activeHeader.getSize() }, children: _jsx("thead", { children: _jsx("tr", { children: _jsx("th", { className: classnames('draggable-col'), style: { width: activeHeader.getSize() }, children: _jsx(Text, { weight: 'bold', children: flexRender(activeHeader.column.columnDef.header, activeHeader.getContext()) }) }) }) }) })) })] }) }), !!data.length && !hasError && footer] }));
|
|
123
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const STORAGE_TYPE = {
|
|
2
|
+
LOCAL: 'localStorage',
|
|
3
|
+
EXTERNAL: 'external'
|
|
4
|
+
};
|
|
5
|
+
export const TABLE_NAME_PREFIX = 'table-settings';
|
|
6
|
+
export const OPTIONS = [
|
|
7
|
+
{
|
|
8
|
+
value: '10',
|
|
9
|
+
label: '10'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
value: '20',
|
|
13
|
+
label: '20'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
value: '30',
|
|
17
|
+
label: '30'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: '40',
|
|
21
|
+
label: '40'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
value: '50',
|
|
25
|
+
label: '50'
|
|
26
|
+
}
|
|
27
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
export const useTableColumnSettings = (table, tableName, shouldPersistToStorage) => {
|
|
3
|
+
const prevSettings = useRef(null);
|
|
4
|
+
const state = table.getState();
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const settings = {
|
|
7
|
+
columnVisibility: state.columnVisibility,
|
|
8
|
+
columnOrder: state.columnOrder,
|
|
9
|
+
columnSizing: state.columnSizing
|
|
10
|
+
};
|
|
11
|
+
const serialized = JSON.stringify(settings);
|
|
12
|
+
if (prevSettings.current !== serialized && shouldPersistToStorage) {
|
|
13
|
+
localStorage.setItem(tableName, serialized);
|
|
14
|
+
prevSettings.current = serialized;
|
|
15
|
+
}
|
|
16
|
+
}, [state.columnVisibility, state.columnOrder, state.columnSizing, tableName]);
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DragEndEvent, DragStartEvent } from '@dnd-kit/core';
|
|
2
|
+
import type { Column, TTableProps } from '../types';
|
|
3
|
+
export declare function useTableControl<TData>({ withSelect, columns, data, tableSettings, totalCount, defaultPageSize, defaultPageIndex, defaultHiddenColumns, onSortChange, onRowSelection, onColumnSizing, onPaginationChange }: TTableProps<TData>): {
|
|
4
|
+
table: import("@tanstack/react-table").Table<TData>;
|
|
5
|
+
activeHeader: import("@tanstack/react-table").Header<TData, unknown> | null | undefined;
|
|
6
|
+
sensors: import("@dnd-kit/core").SensorDescriptor<import("@dnd-kit/core").SensorOptions>[];
|
|
7
|
+
memoizedColumns: Column<TData>[];
|
|
8
|
+
handleDragCancel: () => void;
|
|
9
|
+
handleDragEnd: (event: DragEndEvent) => void;
|
|
10
|
+
handleDragStart: (event: DragStartEvent) => void;
|
|
11
|
+
};
|