@codezee/sixtify-brahma 0.2.207 → 0.2.208
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/package.json +16 -2
- package/packages/shared-components/dist/ActionButtons/ActionButtons.d.ts +1 -1
- package/packages/shared-components/dist/ActionButtons/ActionButtons.d.ts.map +1 -1
- package/packages/shared-components/dist/Button/SplitButton.d.ts +1 -1
- package/packages/shared-components/dist/Button/SplitButton.d.ts.map +1 -1
- package/packages/shared-components/dist/Card/CardItem/CardItem.d.ts +1 -1
- package/packages/shared-components/dist/Card/CardItem/CardItem.d.ts.map +1 -1
- package/packages/shared-components/dist/Card/ProfileCard/ProfileCard.d.ts.map +1 -1
- package/packages/shared-components/dist/Card/ProfileCard/ProfileCardItem/ProfileCardBody.d.ts.map +1 -1
- package/packages/shared-components/dist/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.d.ts +1 -1
- package/packages/shared-components/dist/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.d.ts.map +1 -1
- package/packages/shared-components/dist/CellSelectionTable/utils/types.d.ts +1 -1
- package/packages/shared-components/dist/CellSelectionTable/utils/types.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/FilterPopup.d.ts +1 -1
- package/packages/shared-components/dist/FilterList/FilterPopup.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/CheckBox/CheckBox.styled.d.ts +1 -1
- package/packages/shared-components/dist/FormFields/CheckBox/CheckBox.styled.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/FileUpload/FileUpload.styled.d.ts +1 -1
- package/packages/shared-components/dist/FormFields/FileUpload/FileUpload.styled.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/Rating/Ratting.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/Rating/types.d.ts +1 -1
- package/packages/shared-components/dist/FormFields/Rating/types.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/TextField/TextField.d.ts.map +1 -1
- package/packages/shared-components/dist/Layouts/FormRow/FormRow.styled.d.ts +1 -1
- package/packages/shared-components/dist/Layouts/FormRow/FormRow.styled.d.ts.map +1 -1
- package/packages/shared-components/dist/TabBar/Tab.d.ts.map +1 -1
- package/packages/shared-components/dist/Toast/Toaster.styled.d.ts.map +1 -1
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.d.ts +1 -1
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.d.ts.map +1 -1
- package/packages/shared-components/dist/index.cjs.js +2 -0
- package/packages/shared-components/dist/index.cjs.js.map +1 -0
- package/packages/shared-components/dist/index.esm.js +2 -0
- package/packages/shared-components/dist/index.esm.js.map +1 -0
- package/packages/shared-components/dist/ActionButtons/ActionButtons.js +0 -102
- package/packages/shared-components/dist/ActionButtons/FormActionButton.js +0 -49
- package/packages/shared-components/dist/ActionButtons/index.js +0 -19
- package/packages/shared-components/dist/ActionButtons/types.js +0 -2
- package/packages/shared-components/dist/Actions/AddIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/CalendarIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/ColumnIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/ConfigureIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/CurrentLocationAction.js +0 -14
- package/packages/shared-components/dist/Actions/DeleteIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/DownloadIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/DownloadPrintAction.js +0 -14
- package/packages/shared-components/dist/Actions/EditIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/ExportIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/FilterIconAction.js +0 -15
- package/packages/shared-components/dist/Actions/HistoryIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/ImportIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/InboxIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/KeyBoardIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/ProcessIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/ViewDetailsIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/ViewIconAction.js +0 -14
- package/packages/shared-components/dist/Actions/index.js +0 -34
- package/packages/shared-components/dist/AgGrid/ActionCell/ActionButtonsWrapper.js +0 -134
- package/packages/shared-components/dist/AgGrid/ActionCell/ActionCell.js +0 -39
- package/packages/shared-components/dist/AgGrid/ActionCell/Popover.js +0 -22
- package/packages/shared-components/dist/AgGrid/ActionCell/index.js +0 -18
- package/packages/shared-components/dist/AgGrid/AgGrid.js +0 -179
- package/packages/shared-components/dist/AgGrid/AgGridStyleProvider.js +0 -69
- package/packages/shared-components/dist/AgGrid/LoadingCell.js +0 -12
- package/packages/shared-components/dist/AgGrid/LoadingOverlay.js +0 -15
- package/packages/shared-components/dist/AgGrid/NoDataOverlay.js +0 -14
- package/packages/shared-components/dist/AgGrid/RedirectionCell/RedirectionCell.js +0 -123
- package/packages/shared-components/dist/AgGrid/RedirectionCell/index.js +0 -17
- package/packages/shared-components/dist/AgGrid/hooks/index.js +0 -23
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridCheckBoxSelection.js +0 -161
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridFilteredData.js +0 -22
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridKeyboardShortcuts.js +0 -173
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridRowSelectionConfig.js +0 -63
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridSelection.js +0 -326
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridSummaryRow.js +0 -159
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridSummaryRowUpdate.js +0 -33
- package/packages/shared-components/dist/AgGrid/hooks/useCellEnterClick.js +0 -71
- package/packages/shared-components/dist/AgGrid/index.js +0 -25
- package/packages/shared-components/dist/AgGrid/registerAgGridModules.js +0 -4
- package/packages/shared-components/dist/AgGrid/types/agGrid.js +0 -2
- package/packages/shared-components/dist/AgGrid/types/agSummaryTypes.js +0 -2
- package/packages/shared-components/dist/AgGrid/types/index.js +0 -18
- package/packages/shared-components/dist/AgGrid/utils/ag-grid-custom-filter.js +0 -108
- package/packages/shared-components/dist/AgGrid/utils/extractPrefixedValue.js +0 -15
- package/packages/shared-components/dist/AgGrid/utils/index.js +0 -18
- package/packages/shared-components/dist/AppBar/AppBar.js +0 -17
- package/packages/shared-components/dist/AppBar/AppBar.styled.js +0 -46
- package/packages/shared-components/dist/AppBar/index.js +0 -5
- package/packages/shared-components/dist/Badge/Badge.js +0 -19
- package/packages/shared-components/dist/Badge/index.js +0 -17
- package/packages/shared-components/dist/Breadcrumbs/Breadcrumb.styled.js +0 -95
- package/packages/shared-components/dist/Breadcrumbs/Breadcrumbs.js +0 -30
- package/packages/shared-components/dist/Breadcrumbs/index.js +0 -17
- package/packages/shared-components/dist/Button/ActionButton.js +0 -22
- package/packages/shared-components/dist/Button/Button.js +0 -32
- package/packages/shared-components/dist/Button/ButtonGroup.js +0 -18
- package/packages/shared-components/dist/Button/SplitButton.js +0 -117
- package/packages/shared-components/dist/Button/index.js +0 -20
- package/packages/shared-components/dist/Card/AttendanceCard.js +0 -27
- package/packages/shared-components/dist/Card/Card.js +0 -17
- package/packages/shared-components/dist/Card/CardItem/CardItem.js +0 -12
- package/packages/shared-components/dist/Card/CardItem/CardItemValue.js +0 -27
- package/packages/shared-components/dist/Card/CardItem/index.js +0 -18
- package/packages/shared-components/dist/Card/ProfileCard/ProfileCard.js +0 -15
- package/packages/shared-components/dist/Card/ProfileCard/ProfileCardItem/ProfileCardBody.js +0 -18
- package/packages/shared-components/dist/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.js +0 -21
- package/packages/shared-components/dist/Card/index.js +0 -22
- package/packages/shared-components/dist/CellSelectionTable/CellSelectionTable.js +0 -478
- package/packages/shared-components/dist/CellSelectionTable/SubComponents/EmployeeCell.js +0 -34
- package/packages/shared-components/dist/CellSelectionTable/SubComponents/TableBodyLoader.js +0 -16
- package/packages/shared-components/dist/CellSelectionTable/hook/useOutsideClick.js +0 -48
- package/packages/shared-components/dist/CellSelectionTable/hook/useSorting.js +0 -68
- package/packages/shared-components/dist/CellSelectionTable/hook/useStickyColumns.js +0 -29
- package/packages/shared-components/dist/CellSelectionTable/index.js +0 -20
- package/packages/shared-components/dist/CellSelectionTable/utils/employeeSelectionUtils.js +0 -97
- package/packages/shared-components/dist/CellSelectionTable/utils/helper.js +0 -159
- package/packages/shared-components/dist/CellSelectionTable/utils/index.js +0 -17
- package/packages/shared-components/dist/CellSelectionTable/utils/sortUtils.js +0 -84
- package/packages/shared-components/dist/CellSelectionTable/utils/types.js +0 -2
- package/packages/shared-components/dist/Charts/BarChart.js +0 -32
- package/packages/shared-components/dist/Charts/LineChart.js +0 -51
- package/packages/shared-components/dist/Charts/PieChart.js +0 -49
- package/packages/shared-components/dist/Charts/Skeleton.js +0 -28
- package/packages/shared-components/dist/Charts/index.js +0 -19
- package/packages/shared-components/dist/Chips/Chip.js +0 -13
- package/packages/shared-components/dist/Chips/ChipWithBorder.js +0 -28
- package/packages/shared-components/dist/Chips/FilterPill.js +0 -42
- package/packages/shared-components/dist/Chips/index.js +0 -19
- package/packages/shared-components/dist/ColumnArranger/ColumnArranger.js +0 -18
- package/packages/shared-components/dist/ColumnArranger/ColumnArrangerDialog.js +0 -28
- package/packages/shared-components/dist/ColumnArranger/ColumnArrangerForm.js +0 -44
- package/packages/shared-components/dist/ColumnArranger/ColumnItem.js +0 -17
- package/packages/shared-components/dist/ColumnArranger/LockedColumnItem.js +0 -17
- package/packages/shared-components/dist/ColumnArranger/hooks/useRefinedColumns.js +0 -18
- package/packages/shared-components/dist/ColumnArranger/index.js +0 -9
- package/packages/shared-components/dist/ContentBox/ContentBox.js +0 -21
- package/packages/shared-components/dist/ContentBox/index.js +0 -17
- package/packages/shared-components/dist/Dialog/BottomDialog.js +0 -13
- package/packages/shared-components/dist/Dialog/BottomDialog.styled.js +0 -26
- package/packages/shared-components/dist/Dialog/DeleteDialog.js +0 -25
- package/packages/shared-components/dist/Dialog/Dialog.js +0 -35
- package/packages/shared-components/dist/Dialog/SaveDialog.js +0 -20
- package/packages/shared-components/dist/Dialog/index.js +0 -20
- package/packages/shared-components/dist/Drawer/Bullet.js +0 -15
- package/packages/shared-components/dist/Drawer/CloseDrawer/CloseDrawerMenuItem.js +0 -30
- package/packages/shared-components/dist/Drawer/CloseDrawer/CloseDrawerMenuItemList.js +0 -57
- package/packages/shared-components/dist/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.js +0 -49
- package/packages/shared-components/dist/Drawer/CloseDrawer/Popover.js +0 -26
- package/packages/shared-components/dist/Drawer/CloseDrawer/Popper.js +0 -33
- package/packages/shared-components/dist/Drawer/Drawer.js +0 -29
- package/packages/shared-components/dist/Drawer/Drawer.styled.js +0 -58
- package/packages/shared-components/dist/Drawer/MenuItem.js +0 -32
- package/packages/shared-components/dist/Drawer/OpenDrawer/OpenDrawerCollapse.js +0 -12
- package/packages/shared-components/dist/Drawer/OpenDrawer/OpenDrawerMenuItem.js +0 -21
- package/packages/shared-components/dist/Drawer/OpenDrawer/OpenDrawerMenuItemList.js +0 -129
- package/packages/shared-components/dist/Drawer/index.js +0 -17
- package/packages/shared-components/dist/FilterList/DateRangePickerPopUp.js +0 -42
- package/packages/shared-components/dist/FilterList/FilterList.js +0 -97
- package/packages/shared-components/dist/FilterList/FilterListV2.js +0 -440
- package/packages/shared-components/dist/FilterList/FilterPopup.js +0 -72
- package/packages/shared-components/dist/FilterList/FilterPopupWrapper.js +0 -30
- package/packages/shared-components/dist/FilterList/FilterTypeWrapper.js +0 -18
- package/packages/shared-components/dist/FilterList/GetFilterPopupComponent.js +0 -40
- package/packages/shared-components/dist/FilterList/getFormData.js +0 -27
- package/packages/shared-components/dist/FilterList/index.js +0 -23
- package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.js +0 -508
- package/packages/shared-components/dist/FormFields/Autocomplete/AvatarCell.js +0 -16
- package/packages/shared-components/dist/FormFields/Autocomplete/Chip.styled.js +0 -34
- package/packages/shared-components/dist/FormFields/Autocomplete/ChipV2.styled.js +0 -23
- package/packages/shared-components/dist/FormFields/Autocomplete/Skeleton.js +0 -17
- package/packages/shared-components/dist/FormFields/Autocomplete/Tags.js +0 -18
- package/packages/shared-components/dist/FormFields/Autocomplete/index.js +0 -17
- package/packages/shared-components/dist/FormFields/CheckBox/CheckBox.js +0 -43
- package/packages/shared-components/dist/FormFields/CheckBox/CheckBox.styled.js +0 -59
- package/packages/shared-components/dist/FormFields/CheckBox/Skeleton.js +0 -12
- package/packages/shared-components/dist/FormFields/CheckBox/index.js +0 -17
- package/packages/shared-components/dist/FormFields/DatePicker/DatePicker.js +0 -245
- package/packages/shared-components/dist/FormFields/DatePicker/Skeleton.js +0 -17
- package/packages/shared-components/dist/FormFields/DatePicker/index.js +0 -17
- package/packages/shared-components/dist/FormFields/DateRangePicker/DateRangePicker.js +0 -45
- package/packages/shared-components/dist/FormFields/DateRangePicker/Skeleton.js +0 -21
- package/packages/shared-components/dist/FormFields/DateRangePicker/index.js +0 -17
- package/packages/shared-components/dist/FormFields/DateRangeSelector/DateRangeSelector.js +0 -59
- package/packages/shared-components/dist/FormFields/DateRangeSelector/index.js +0 -17
- package/packages/shared-components/dist/FormFields/DateTimePicker/DateTimePicker.js +0 -211
- package/packages/shared-components/dist/FormFields/DateTimePicker/Skeleton.js +0 -17
- package/packages/shared-components/dist/FormFields/DateTimePicker/index.js +0 -17
- package/packages/shared-components/dist/FormFields/DecimalTextField/DecimalTextField.js +0 -186
- package/packages/shared-components/dist/FormFields/DecimalTextField/index.js +0 -17
- package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/FilePreview.js +0 -202
- package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/ViewFilePreviewDialog.js +0 -34
- package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/index.js +0 -18
- package/packages/shared-components/dist/FormFields/FileUpload/DownloadAction.js +0 -17
- package/packages/shared-components/dist/FormFields/FileUpload/FileNames.js +0 -44
- package/packages/shared-components/dist/FormFields/FileUpload/FileUpload.js +0 -190
- package/packages/shared-components/dist/FormFields/FileUpload/FileUpload.styled.js +0 -23
- package/packages/shared-components/dist/FormFields/FileUpload/Skeleton.js +0 -17
- package/packages/shared-components/dist/FormFields/FileUpload/index.js +0 -20
- package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.js +0 -132
- package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.styled.js +0 -23
- package/packages/shared-components/dist/FormFields/ImageUpload/ImageUploadView.js +0 -73
- package/packages/shared-components/dist/FormFields/ImageUpload/PhotoCaptureDialog.js +0 -36
- package/packages/shared-components/dist/FormFields/ImageUpload/Skeleton.js +0 -19
- package/packages/shared-components/dist/FormFields/ImageUpload/index.js +0 -18
- package/packages/shared-components/dist/FormFields/ListItemButton/ListItemButton.js +0 -37
- package/packages/shared-components/dist/FormFields/ListItemButton/ListItemButton.styled.js +0 -24
- package/packages/shared-components/dist/FormFields/ListItemButton/index.js +0 -17
- package/packages/shared-components/dist/FormFields/PasswordField/PasswordField.js +0 -24
- package/packages/shared-components/dist/FormFields/PasswordField/index.js +0 -17
- package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.js +0 -134
- package/packages/shared-components/dist/FormFields/PhoneInputField/PhoneInputField.styled.js +0 -219
- package/packages/shared-components/dist/FormFields/PhoneInputField/Skeleton.js +0 -18
- package/packages/shared-components/dist/FormFields/PhoneInputField/index.js +0 -17
- package/packages/shared-components/dist/FormFields/RadioGroupField/RadioGroupField.js +0 -89
- package/packages/shared-components/dist/FormFields/RadioGroupField/Skeleton.js +0 -13
- package/packages/shared-components/dist/FormFields/RadioGroupField/index.js +0 -17
- package/packages/shared-components/dist/FormFields/Rating/Ratting.js +0 -27
- package/packages/shared-components/dist/FormFields/Rating/Skeleton.js +0 -18
- package/packages/shared-components/dist/FormFields/Rating/index.js +0 -17
- package/packages/shared-components/dist/FormFields/Rating/types.js +0 -2
- package/packages/shared-components/dist/FormFields/SearchField/SearchField.js +0 -29
- package/packages/shared-components/dist/FormFields/SearchField/StickySearchField.js +0 -20
- package/packages/shared-components/dist/FormFields/SearchField/index.js +0 -18
- package/packages/shared-components/dist/FormFields/Select/Select.js +0 -264
- package/packages/shared-components/dist/FormFields/Select/Select.styled.js +0 -49
- package/packages/shared-components/dist/FormFields/Select/index.js +0 -17
- package/packages/shared-components/dist/FormFields/SwitchField/Skeleton.js +0 -12
- package/packages/shared-components/dist/FormFields/SwitchField/SwitchField.js +0 -103
- package/packages/shared-components/dist/FormFields/SwitchField/index.js +0 -17
- package/packages/shared-components/dist/FormFields/TextField/Skeleton.js +0 -18
- package/packages/shared-components/dist/FormFields/TextField/TextField.js +0 -133
- package/packages/shared-components/dist/FormFields/TextField/index.js +0 -17
- package/packages/shared-components/dist/FormFields/TimeField/Skeleton.js +0 -17
- package/packages/shared-components/dist/FormFields/TimeField/TimeField.js +0 -81
- package/packages/shared-components/dist/FormFields/TimeField/index.js +0 -17
- package/packages/shared-components/dist/FormFields/TimePicker/Skeleton.js +0 -17
- package/packages/shared-components/dist/FormFields/TimePicker/TimePicker.js +0 -164
- package/packages/shared-components/dist/FormFields/TimePicker/index.js +0 -17
- package/packages/shared-components/dist/FormFields/commonStyles.js +0 -70
- package/packages/shared-components/dist/FormFields/index.js +0 -36
- package/packages/shared-components/dist/HighlightedText/HighlightedText.js +0 -29
- package/packages/shared-components/dist/HighlightedText/index.js +0 -17
- package/packages/shared-components/dist/Indicator/Indicator.js +0 -13
- package/packages/shared-components/dist/Indicator/SeverityIndicator.js +0 -21
- package/packages/shared-components/dist/Indicator/index.js +0 -18
- package/packages/shared-components/dist/Layouts/ButtonContainer.js +0 -15
- package/packages/shared-components/dist/Layouts/FilePreviewContainer.js +0 -11
- package/packages/shared-components/dist/Layouts/FormContainer.js +0 -12
- package/packages/shared-components/dist/Layouts/FormGridLayout.js +0 -21
- package/packages/shared-components/dist/Layouts/FormRow/FormRow.js +0 -9
- package/packages/shared-components/dist/Layouts/FormRow/FormRow.styled.js +0 -31
- package/packages/shared-components/dist/Layouts/FormRow/index.js +0 -5
- package/packages/shared-components/dist/Layouts/FormSection.js +0 -16
- package/packages/shared-components/dist/Layouts/GridProvider.js +0 -17
- package/packages/shared-components/dist/Layouts/MasterPageLayout.js +0 -30
- package/packages/shared-components/dist/Layouts/index.js +0 -24
- package/packages/shared-components/dist/Loader/FacebookCircularProgress.js +0 -23
- package/packages/shared-components/dist/Loader/index.js +0 -17
- package/packages/shared-components/dist/PadBox/PadBox.js +0 -17
- package/packages/shared-components/dist/PadBox/index.js +0 -17
- package/packages/shared-components/dist/Pagination/Pagination.js +0 -36
- package/packages/shared-components/dist/Pagination/index.js +0 -17
- package/packages/shared-components/dist/PrintDownloadAction/PrintDownloadActions.js +0 -30
- package/packages/shared-components/dist/PrintDownloadAction/index.js +0 -17
- package/packages/shared-components/dist/SmartGrid/Components/CellRenderer.js +0 -55
- package/packages/shared-components/dist/SmartGrid/Components/CircularLoader.js +0 -19
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArranger.js +0 -49
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerDialog.js +0 -117
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnArrangerForm.js +0 -47
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/ColumnItem.js +0 -122
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/LockedColumnItem.js +0 -17
- package/packages/shared-components/dist/SmartGrid/Components/ColumnChooser/hooks/useRefinedColumns.js +0 -24
- package/packages/shared-components/dist/SmartGrid/Components/DataNotFound.js +0 -16
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartSelectField.js +0 -58
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.js +0 -59
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTooltip.js +0 -113
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/index.js +0 -19
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.js +0 -195
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.js +0 -117
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/hooks/useGetDynamicOptionData.js +0 -39
- package/packages/shared-components/dist/SmartGrid/Components/FilterStatusPanel.js +0 -89
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupAreaOverlay.js +0 -101
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupChip.js +0 -73
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedColumn.js +0 -64
- package/packages/shared-components/dist/SmartGrid/Components/Grouped/GroupedPanel.js +0 -62
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/DraggableHeaderCell.js +0 -15
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/DraggableHeaderGroupRows.js +0 -28
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCells/HeaderCell.js +0 -114
- package/packages/shared-components/dist/SmartGrid/Components/IndeterminateCheckbox.js +0 -25
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.js +0 -127
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/StyleDateRangeWrapper.js +0 -120
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DebouncedInput.js +0 -38
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/GetRenderInputs.js +0 -76
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/SearchFilterRow.js +0 -34
- package/packages/shared-components/dist/SmartGrid/Components/SmartAlignments.js +0 -63
- package/packages/shared-components/dist/SmartGrid/Components/SmartButton.js +0 -21
- package/packages/shared-components/dist/SmartGrid/Components/SmartDialog.js +0 -42
- package/packages/shared-components/dist/SmartGrid/Components/SmartSwitch.js +0 -53
- package/packages/shared-components/dist/SmartGrid/Components/Svgs/HideIcon.js +0 -6
- package/packages/shared-components/dist/SmartGrid/Components/TableFooterComponent/TableFooterComponent.js +0 -30
- package/packages/shared-components/dist/SmartGrid/Components/TableFooterComponent/components/FooterCell.js +0 -42
- package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.js +0 -224
- package/packages/shared-components/dist/SmartGrid/Components/index.js +0 -17
- package/packages/shared-components/dist/SmartGrid/SmartGrid.js +0 -415
- package/packages/shared-components/dist/SmartGrid/context/CellSelectionContext.js +0 -18
- package/packages/shared-components/dist/SmartGrid/exportUtils/helper.js +0 -90
- package/packages/shared-components/dist/SmartGrid/exportUtils/index.js +0 -18
- package/packages/shared-components/dist/SmartGrid/exportUtils/types.js +0 -2
- package/packages/shared-components/dist/SmartGrid/hooks/index.js +0 -17
- package/packages/shared-components/dist/SmartGrid/hooks/useCellSelection.js +0 -207
- package/packages/shared-components/dist/SmartGrid/hooks/useCopyToClipboard.js +0 -80
- package/packages/shared-components/dist/SmartGrid/hooks/useExportToExcel.js +0 -241
- package/packages/shared-components/dist/SmartGrid/hooks/useGetColumnWidth.js +0 -65
- package/packages/shared-components/dist/SmartGrid/hooks/useGetDragMethods.js +0 -101
- package/packages/shared-components/dist/SmartGrid/hooks/useGetFacetedFilter.js +0 -116
- package/packages/shared-components/dist/SmartGrid/hooks/useGetGroupedColumn.js +0 -169
- package/packages/shared-components/dist/SmartGrid/hooks/useGetPinStyle.js +0 -36
- package/packages/shared-components/dist/SmartGrid/hooks/useGetPinningColumns.js +0 -24
- package/packages/shared-components/dist/SmartGrid/hooks/useGetRowSelection.js +0 -92
- package/packages/shared-components/dist/SmartGrid/hooks/useGetSortedColumn.js +0 -23
- package/packages/shared-components/dist/SmartGrid/hooks/useTableState.js +0 -112
- package/packages/shared-components/dist/SmartGrid/index.js +0 -20
- package/packages/shared-components/dist/SmartGrid/types/index.js +0 -2
- package/packages/shared-components/dist/SmartGrid/utils/helper.js +0 -15
- package/packages/shared-components/dist/SmartGrid/utils/summaryCalculations.js +0 -58
- package/packages/shared-components/dist/Stepper/Stepper.js +0 -51
- package/packages/shared-components/dist/Stepper/StepperV2.js +0 -108
- package/packages/shared-components/dist/Stepper/StepperV3.js +0 -33
- package/packages/shared-components/dist/Stepper/index.js +0 -19
- package/packages/shared-components/dist/Svgs/AppLogo/AppLogoMedium.js +0 -8
- package/packages/shared-components/dist/Svgs/AppLogo/AppLogoSmall.js +0 -6
- package/packages/shared-components/dist/Svgs/AppLogo/index.js +0 -18
- package/packages/shared-components/dist/Svgs/ArrowUp.js +0 -6
- package/packages/shared-components/dist/Svgs/ArrowUpRight.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/SvgArrival.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/SvgDeparture.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/SvgHoliday.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/SvgLeaveCalendar.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/SvgUnverifieduser.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/SvgUser.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/SvgVerifiedUser.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/SvgWeekoffCalendar.js +0 -8
- package/packages/shared-components/dist/Svgs/AttendanceDashboard/index.js +0 -24
- package/packages/shared-components/dist/Svgs/BookMarkSvg.js +0 -6
- package/packages/shared-components/dist/Svgs/Company/CompanyBanner.js +0 -8
- package/packages/shared-components/dist/Svgs/Company/index.js +0 -17
- package/packages/shared-components/dist/Svgs/DownloadSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/Drawer/MasterIcon.js +0 -6
- package/packages/shared-components/dist/Svgs/Drawer/SettingIcon.js +0 -8
- package/packages/shared-components/dist/Svgs/Drawer/SvgBankConfig.js +0 -6
- package/packages/shared-components/dist/Svgs/Drawer/SvgConfiguration.js +0 -6
- package/packages/shared-components/dist/Svgs/Drawer/SvgEmployees.js +0 -6
- package/packages/shared-components/dist/Svgs/Drawer/SvgLetteremplate.js +0 -6
- package/packages/shared-components/dist/Svgs/Drawer/SvgOrganization.js +0 -6
- package/packages/shared-components/dist/Svgs/Drawer/SvgPayroll.js +0 -6
- package/packages/shared-components/dist/Svgs/Drawer/SvgTransaction.js +0 -6
- package/packages/shared-components/dist/Svgs/Drawer/index.js +0 -25
- package/packages/shared-components/dist/Svgs/FormAction.js +0 -9
- package/packages/shared-components/dist/Svgs/HomePage/AttendanceManagementDarkSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/AttendanceReportDarkSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/BriefcaseSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/BulkOperationsDarkSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/CalendarSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/ChartIconSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/ClockSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/DashboardIconSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/EmployeeManagementDarkSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/EmployeeReportsDarkSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/HolidayCalendarSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/HomePageBanner.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/MiscellaneousManagementDarkSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/PayrollManagementDarkSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/PayrollReportDarkSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/HomePage/index.js +0 -31
- package/packages/shared-components/dist/Svgs/ImportExcelSuccessIcon.js +0 -6
- package/packages/shared-components/dist/Svgs/Inbox/ExitIcon.js +0 -8
- package/packages/shared-components/dist/Svgs/Inbox/LeaveIcon.js +0 -8
- package/packages/shared-components/dist/Svgs/Inbox/LoanIcon.js +0 -8
- package/packages/shared-components/dist/Svgs/Inbox/OvertimeIcon.js +0 -8
- package/packages/shared-components/dist/Svgs/Inbox/SalaryIcon.js +0 -8
- package/packages/shared-components/dist/Svgs/Inbox/index.js +0 -21
- package/packages/shared-components/dist/Svgs/InboxIcon.js +0 -9
- package/packages/shared-components/dist/Svgs/LogoIcon.js +0 -6
- package/packages/shared-components/dist/Svgs/NoDataFoundSvg.js +0 -8
- package/packages/shared-components/dist/Svgs/SvgAccessDenied.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgAdd.js +0 -9
- package/packages/shared-components/dist/Svgs/SvgAddRounded.js +0 -9
- package/packages/shared-components/dist/Svgs/SvgBranches.js +0 -23
- package/packages/shared-components/dist/Svgs/SvgCalendar.js +0 -8
- package/packages/shared-components/dist/Svgs/SvgColumn.js +0 -8
- package/packages/shared-components/dist/Svgs/SvgConfigure.js +0 -9
- package/packages/shared-components/dist/Svgs/SvgCurrentLocation.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgDelete.js +0 -8
- package/packages/shared-components/dist/Svgs/SvgDownload.js +0 -9
- package/packages/shared-components/dist/Svgs/SvgDrop.js +0 -13
- package/packages/shared-components/dist/Svgs/SvgEdit.js +0 -9
- package/packages/shared-components/dist/Svgs/SvgEmail.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgExport.js +0 -8
- package/packages/shared-components/dist/Svgs/SvgFilterList.js +0 -9
- package/packages/shared-components/dist/Svgs/SvgFilteredList.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgHistory.js +0 -9
- package/packages/shared-components/dist/Svgs/SvgHome.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgImport.js +0 -8
- package/packages/shared-components/dist/Svgs/SvgIndicator.js +0 -10
- package/packages/shared-components/dist/Svgs/SvgKeyBoard.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgNoLogo.js +0 -8
- package/packages/shared-components/dist/Svgs/SvgNoSign.js +0 -8
- package/packages/shared-components/dist/Svgs/SvgPageNotFound.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgPhone.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgProfile.js +0 -9
- package/packages/shared-components/dist/Svgs/SvgReGenerate.js +0 -6
- package/packages/shared-components/dist/Svgs/SvgView.js +0 -6
- package/packages/shared-components/dist/Svgs/index.js +0 -60
- package/packages/shared-components/dist/Tab/Skeleton.js +0 -16
- package/packages/shared-components/dist/Tab/Tabs.js +0 -26
- package/packages/shared-components/dist/Tab/index.js +0 -17
- package/packages/shared-components/dist/TabBar/Tab.js +0 -60
- package/packages/shared-components/dist/TabBar/TabBar.js +0 -58
- package/packages/shared-components/dist/TabBar/TabsMenus.js +0 -19
- package/packages/shared-components/dist/TabBar/index.js +0 -9
- package/packages/shared-components/dist/Timeline/AttendanceStatus.js +0 -43
- package/packages/shared-components/dist/Timeline/Timeline.js +0 -89
- package/packages/shared-components/dist/Timeline/TimelineTrackSegments.js +0 -95
- package/packages/shared-components/dist/Timeline/index.js +0 -18
- package/packages/shared-components/dist/Toast/Toast.js +0 -27
- package/packages/shared-components/dist/Toast/ToastBody.js +0 -14
- package/packages/shared-components/dist/Toast/ToastFooterLink.js +0 -13
- package/packages/shared-components/dist/Toast/Toaster.js +0 -10
- package/packages/shared-components/dist/Toast/Toaster.styled.js +0 -73
- package/packages/shared-components/dist/Toast/index.js +0 -7
- package/packages/shared-components/dist/Toast/toasts.js +0 -20
- package/packages/shared-components/dist/Toast/types.js +0 -2
- package/packages/shared-components/dist/Tooltip/Tooltip.js +0 -29
- package/packages/shared-components/dist/Tooltip/index.js +0 -17
- package/packages/shared-components/dist/Tree/DesktopTreeNode.js +0 -22
- package/packages/shared-components/dist/Tree/MobileTreeNode.js +0 -17
- package/packages/shared-components/dist/Tree/Node.js +0 -23
- package/packages/shared-components/dist/Tree/Node.styled.js +0 -31
- package/packages/shared-components/dist/Tree/Tree.js +0 -149
- package/packages/shared-components/dist/Tree/index.js +0 -18
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.js +0 -79
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.styled.js +0 -38
- package/packages/shared-components/dist/UserProfileMenu/index.js +0 -17
- package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.js +0 -51
- package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.styled.js +0 -27
- package/packages/shared-components/dist/codeSnippetBox/index.js +0 -17
- package/packages/shared-components/dist/index.js +0 -52
- package/packages/shared-components/dist/utils/CheckboxInput.js +0 -36
- package/packages/shared-components/dist/utils/colorVariant.js +0 -137
- package/packages/shared-components/dist/utils/context/NavigationKeyContext.js +0 -15
- package/packages/shared-components/dist/utils/context/index.js +0 -6
- package/packages/shared-components/dist/utils/date.js +0 -56
- package/packages/shared-components/dist/utils/download.js +0 -13
- package/packages/shared-components/dist/utils/downloadPrintHtml.js +0 -68
- package/packages/shared-components/dist/utils/file.js +0 -24
- package/packages/shared-components/dist/utils/helper.js +0 -50
- package/packages/shared-components/dist/utils/hooks/index.js +0 -20
- package/packages/shared-components/dist/utils/hooks/useAutocompleteScrollToSelected.js +0 -39
- package/packages/shared-components/dist/utils/hooks/useDialogActions.js +0 -14
- package/packages/shared-components/dist/utils/hooks/useFormFieldFocus.js +0 -228
- package/packages/shared-components/dist/utils/hooks/useGetDeviceType.js +0 -24
- package/packages/shared-components/dist/utils/hooks/useGlobalKeyboardShortcut.js +0 -95
- package/packages/shared-components/dist/utils/index.js +0 -30
- package/packages/shared-components/dist/utils/regex.js +0 -20
- package/packages/shared-components/dist/utils/theme/colorPalette.js +0 -309
- package/packages/shared-components/dist/utils/theme/colorPaletteUI.js +0 -29
- package/packages/shared-components/dist/utils/theme/paletteDark.js +0 -11
- package/packages/shared-components/dist/utils/theme/paletteLight.js +0 -31
- package/packages/shared-components/dist/utils/theme/theme.js +0 -377
- package/packages/shared-components/dist/utils/theme/types.js +0 -2
- package/packages/shared-components/dist/utils/theme/typography.js +0 -65
- package/packages/shared-components/dist/utils/types.js +0 -2
- package/packages/shared-components/dist/utils/urlToNestedObject.js +0 -13
|
@@ -1,440 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FilterListV2 = void 0;
|
|
7
|
-
exports.formatFilterData = formatFilterData;
|
|
8
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
-
/* eslint-disable sonarjs/no-nested-functions */
|
|
10
|
-
/* eslint-disable sonarjs/no-nested-conditional */
|
|
11
|
-
/* eslint-disable sonarjs/function-return-type */
|
|
12
|
-
/* eslint-disable no-use-before-define */
|
|
13
|
-
const zod_1 = require("@hookform/resolvers/zod");
|
|
14
|
-
const Clear_1 = __importDefault(require("@mui/icons-material/Clear"));
|
|
15
|
-
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
16
|
-
const Accordion_1 = __importDefault(require("@mui/material/Accordion"));
|
|
17
|
-
const AccordionDetails_1 = __importDefault(require("@mui/material/AccordionDetails"));
|
|
18
|
-
const AccordionSummary_1 = __importDefault(require("@mui/material/AccordionSummary"));
|
|
19
|
-
const Box_1 = __importDefault(require("@mui/material/Box"));
|
|
20
|
-
const Divider_1 = __importDefault(require("@mui/material/Divider"));
|
|
21
|
-
const Drawer_1 = __importDefault(require("@mui/material/Drawer"));
|
|
22
|
-
const IconButton_1 = __importDefault(require("@mui/material/IconButton"));
|
|
23
|
-
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
24
|
-
const styles_1 = require("@mui/material/styles");
|
|
25
|
-
const Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
26
|
-
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
27
|
-
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
28
|
-
const isNil_1 = __importDefault(require("lodash/isNil"));
|
|
29
|
-
const omitBy_1 = __importDefault(require("lodash/omitBy"));
|
|
30
|
-
const luxon_1 = require("luxon");
|
|
31
|
-
const react_1 = require("react");
|
|
32
|
-
const react_hook_form_1 = require("react-hook-form");
|
|
33
|
-
const zod_2 = require("zod");
|
|
34
|
-
const Actions_1 = require("../Actions");
|
|
35
|
-
const Button_1 = require("../Button");
|
|
36
|
-
const FilterPill_1 = require("../Chips/FilterPill");
|
|
37
|
-
const FormFields_1 = require("../FormFields");
|
|
38
|
-
const SwitchField_1 = require("../FormFields/SwitchField");
|
|
39
|
-
const Layouts_1 = require("../Layouts");
|
|
40
|
-
const PadBox_1 = require("../PadBox");
|
|
41
|
-
const Toast_1 = require("../Toast");
|
|
42
|
-
const Tooltip_1 = require("../Tooltip");
|
|
43
|
-
const utils_1 = require("../utils");
|
|
44
|
-
const FilterPopupWrapper_1 = require("./FilterPopupWrapper");
|
|
45
|
-
const GetFilterPopupComponent_1 = require("./GetFilterPopupComponent");
|
|
46
|
-
const getFormData_1 = require("./getFormData");
|
|
47
|
-
function formatFilterData(data, filterListItems) {
|
|
48
|
-
return Object.fromEntries(Object.entries(data).flatMap(([key, value]) => {
|
|
49
|
-
if (value) {
|
|
50
|
-
const config = filterListItems.find((item) => item.key === key);
|
|
51
|
-
const formattedValue = config?.monthYearFormat && typeof value === "string"
|
|
52
|
-
? luxon_1.DateTime.fromISO(value).toFormat("yyyy-MM")
|
|
53
|
-
: value;
|
|
54
|
-
return [[key, formattedValue]];
|
|
55
|
-
}
|
|
56
|
-
return [];
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onApply, onClear, onChange, }) => {
|
|
60
|
-
const theme = (0, styles_1.useTheme)();
|
|
61
|
-
const { iron, slate } = theme.palette.app.color;
|
|
62
|
-
const { layout } = (0, utils_1.useGetDeviceType)();
|
|
63
|
-
const isDesktop = layout === "desktop";
|
|
64
|
-
const isMobile = layout === "mobile";
|
|
65
|
-
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
66
|
-
const filterPopupAnchorElm = (0, react_1.useRef)(null);
|
|
67
|
-
const dateRangeAnchorRef = (0, react_1.useRef)(null);
|
|
68
|
-
const [openFilterPopup, setOpenFilterPopup] = (0, react_1.useState)(false);
|
|
69
|
-
const [datePickerPopup, setDatePickerPopup] = (0, react_1.useState)(false);
|
|
70
|
-
const [currentFilter, setCurrentFilter] = (0, react_1.useState)(null);
|
|
71
|
-
const filterListV2AnchorRef = (0, react_1.useRef)(null);
|
|
72
|
-
const [isPopupOpen, setIsPopupOpen] = (0, react_1.useState)(false);
|
|
73
|
-
const [focusedChipKey, setFocusedChipKey] = (0, react_1.useState)(null);
|
|
74
|
-
const chipRefs = (0, react_1.useRef)({});
|
|
75
|
-
const handleDateRange = (filter) => {
|
|
76
|
-
setCurrentFilter(filter);
|
|
77
|
-
setDatePickerPopup(true);
|
|
78
|
-
};
|
|
79
|
-
const defaultValues = (0, react_1.useMemo)(() => {
|
|
80
|
-
return filterListItems.reduce((acc, item) => {
|
|
81
|
-
if (item.type === "autoComplete" &&
|
|
82
|
-
item.required &&
|
|
83
|
-
item.options?.length === 1) {
|
|
84
|
-
acc[item.key] = item.options[0]?.value;
|
|
85
|
-
}
|
|
86
|
-
else if (item.multiSelect || item.type === "dateRange") {
|
|
87
|
-
acc[item.key] = item.value || null;
|
|
88
|
-
}
|
|
89
|
-
else if (item.type === "switch") {
|
|
90
|
-
acc[item.key] = item.value || false;
|
|
91
|
-
}
|
|
92
|
-
else if (item.isDefaultCurrentDate && item.type === "date") {
|
|
93
|
-
acc[item.key] = item.value || luxon_1.DateTime.now().toISODate();
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
acc[item.key] = item.value || null;
|
|
97
|
-
}
|
|
98
|
-
return acc;
|
|
99
|
-
}, {});
|
|
100
|
-
}, [filterListData]);
|
|
101
|
-
const baseSchema = zod_2.z.object((() => {
|
|
102
|
-
const shape = {};
|
|
103
|
-
filterListItems.forEach((item) => {
|
|
104
|
-
if (item.multiSelect || item.type === "dateRange") {
|
|
105
|
-
shape[item.key] = zod_2.z.array(zod_2.z.string()).nullable().optional();
|
|
106
|
-
}
|
|
107
|
-
else if (item.type === "switch") {
|
|
108
|
-
shape[item.key] = zod_2.z.boolean().nullable().optional();
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
shape[item.key] = zod_2.z.string().nullable().optional();
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
return shape;
|
|
115
|
-
})());
|
|
116
|
-
const validationSchema = baseSchema.superRefine((data, ctx) => {
|
|
117
|
-
filterListItems.forEach((item) => {
|
|
118
|
-
if (item.required && !data[item.key]?.length) {
|
|
119
|
-
ctx.addIssue({
|
|
120
|
-
path: [item.key],
|
|
121
|
-
message: `${item.label} is required`,
|
|
122
|
-
code: zod_2.z.ZodIssueCode.custom,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
const { control, handleSubmit, setValue, reset, getValues, formState: { errors, dirtyFields }, watch, } = (0, react_hook_form_1.useForm)({
|
|
128
|
-
values: defaultValues,
|
|
129
|
-
resolver: (0, zod_1.zodResolver)(validationSchema),
|
|
130
|
-
mode: "all",
|
|
131
|
-
});
|
|
132
|
-
(0, react_1.useMemo)(() => {
|
|
133
|
-
if (!filterListItems || filterListItems.length === 0) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
filterListItems.forEach((item) => {
|
|
137
|
-
if (item.required && item.options?.length === 1) {
|
|
138
|
-
const currentValue = getValues(item.key);
|
|
139
|
-
if (!currentValue) {
|
|
140
|
-
setValue(item.key, item.options[0]?.value);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}, [filterListItems]);
|
|
145
|
-
const company_id = watch("company_id");
|
|
146
|
-
const business_unit_id = watch("business_unit_id");
|
|
147
|
-
const department_id = watch("department_id");
|
|
148
|
-
const handleClose = () => {
|
|
149
|
-
setAnchorEl(null);
|
|
150
|
-
};
|
|
151
|
-
const handleCloseFilterPopup = () => {
|
|
152
|
-
if (currentFilter?.key) {
|
|
153
|
-
setValue(`${currentFilter?.key}`, filterListData?.[currentFilter.key]);
|
|
154
|
-
}
|
|
155
|
-
setOpenFilterPopup(false);
|
|
156
|
-
};
|
|
157
|
-
const handleCloseDatePickerPopup = () => {
|
|
158
|
-
if (currentFilter?.key) {
|
|
159
|
-
setValue(`${currentFilter?.key}`, filterListData?.[currentFilter.key]);
|
|
160
|
-
}
|
|
161
|
-
setDatePickerPopup(false);
|
|
162
|
-
};
|
|
163
|
-
const handlerReset = () => {
|
|
164
|
-
reset();
|
|
165
|
-
onClear();
|
|
166
|
-
handleClose();
|
|
167
|
-
};
|
|
168
|
-
const handleClick = (event) => {
|
|
169
|
-
const element = event instanceof HTMLElement ? event : event.currentTarget;
|
|
170
|
-
setAnchorEl(element);
|
|
171
|
-
};
|
|
172
|
-
const onSubmit = (data) => {
|
|
173
|
-
setOpenFilterPopup(false);
|
|
174
|
-
setCurrentFilter(null);
|
|
175
|
-
const filteredData = (0, omitBy_1.default)(formatFilterData(data, filterListItems), (v) => (0, isNil_1.default)(v) || (0, isEmpty_1.default)(v));
|
|
176
|
-
onApply(filteredData, openFilterPopup, currentFilter?.key);
|
|
177
|
-
handleClose();
|
|
178
|
-
};
|
|
179
|
-
const handleDateRangeSubmit = () => {
|
|
180
|
-
setDatePickerPopup(false);
|
|
181
|
-
};
|
|
182
|
-
const getFilterItem = (key) => {
|
|
183
|
-
return filterListItems.find((item) => item.key === key);
|
|
184
|
-
};
|
|
185
|
-
const handleDelete = (key) => {
|
|
186
|
-
const item = getFilterItem(key);
|
|
187
|
-
if (item?.required) {
|
|
188
|
-
return Toast_1.toasts.error({
|
|
189
|
-
title: "This is a required custom filter field and cannot be removed.",
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
setValue(`${key}`, null);
|
|
193
|
-
const newData = { ...filterListData };
|
|
194
|
-
delete newData[key];
|
|
195
|
-
onApply(newData, true, key);
|
|
196
|
-
};
|
|
197
|
-
const formData = (0, react_hook_form_1.useWatch)({ control });
|
|
198
|
-
const currentFilterValue = currentFilter?.key
|
|
199
|
-
? currentFilter.key === "switch"
|
|
200
|
-
? watch(currentFilter.key)
|
|
201
|
-
? "true"
|
|
202
|
-
: "false"
|
|
203
|
-
: watch(currentFilter.key)
|
|
204
|
-
: null;
|
|
205
|
-
(0, react_1.useEffect)(() => {
|
|
206
|
-
onChange(formData, openFilterPopup);
|
|
207
|
-
}, [formData, onChange]);
|
|
208
|
-
(0, react_1.useEffect)(() => {
|
|
209
|
-
reset(defaultValues);
|
|
210
|
-
}, [defaultValues, reset]);
|
|
211
|
-
(0, react_1.useMemo)(() => {
|
|
212
|
-
if (company_id !== filterListData?.company_id && !openFilterPopup) {
|
|
213
|
-
filterListItems.forEach((item) => {
|
|
214
|
-
if (item.isDefaultCurrentDate && item.type === "date") {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
setValue(`${item.key}`, null);
|
|
218
|
-
});
|
|
219
|
-
setValue("company_id", company_id);
|
|
220
|
-
}
|
|
221
|
-
}, [company_id]);
|
|
222
|
-
(0, react_1.useMemo)(() => {
|
|
223
|
-
if (!(0, isEqual_1.default)(business_unit_id, filterListData?.business_unit_id) &&
|
|
224
|
-
!openFilterPopup) {
|
|
225
|
-
setValue("business_unit_location_id", null);
|
|
226
|
-
}
|
|
227
|
-
}, [business_unit_id]);
|
|
228
|
-
(0, react_1.useMemo)(() => {
|
|
229
|
-
if (!(0, isEqual_1.default)(department_id, filterListData?.department_id) &&
|
|
230
|
-
!openFilterPopup) {
|
|
231
|
-
setValue("sub_department_id", null);
|
|
232
|
-
}
|
|
233
|
-
}, [department_id]);
|
|
234
|
-
const open = Boolean(anchorEl);
|
|
235
|
-
const shouldFormSubmit = (0, react_1.useMemo)(() => {
|
|
236
|
-
return (Object.keys(dirtyFields).length === 0 &&
|
|
237
|
-
Object.keys(formData).every((key) => (0, isNil_1.default)(formData[key]) || (0, isEmpty_1.default)(formData[key])));
|
|
238
|
-
}, [formData, dirtyFields]);
|
|
239
|
-
function formatKeyValue(keyValue) {
|
|
240
|
-
if (Array.isArray(keyValue)) {
|
|
241
|
-
return keyValue.join(", ");
|
|
242
|
-
}
|
|
243
|
-
if (utils_1.monthYearRegex.test(keyValue)) {
|
|
244
|
-
return luxon_1.DateTime.fromFormat(keyValue, "yyyy-MM").toFormat("MMM yyyy");
|
|
245
|
-
}
|
|
246
|
-
if (utils_1.isoDateRegex.test(keyValue)) {
|
|
247
|
-
return luxon_1.DateTime.fromFormat(keyValue, "yyyy-MM-dd").toFormat("dd-MM-yyyy");
|
|
248
|
-
}
|
|
249
|
-
return keyValue;
|
|
250
|
-
}
|
|
251
|
-
const handleChipClick = (key, e) => {
|
|
252
|
-
if (key === "company_id" &&
|
|
253
|
-
filterListItems?.some(({ required }) => required)) {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
setOpenFilterPopup(true);
|
|
257
|
-
filterPopupAnchorElm.current = e.currentTarget;
|
|
258
|
-
const item = getFilterItem(key);
|
|
259
|
-
if (item) {
|
|
260
|
-
setCurrentFilter(item);
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
const handleChipKeyDown = (key, e) => {
|
|
264
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
265
|
-
e.preventDefault();
|
|
266
|
-
const chipElement = chipRefs.current[key];
|
|
267
|
-
if (chipElement) {
|
|
268
|
-
handleChipClick(key, { currentTarget: chipElement });
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
else if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
|
|
272
|
-
e.preventDefault();
|
|
273
|
-
const chipKeys = Object.keys(filterListData || {}).filter((k) => filterListData?.[k]);
|
|
274
|
-
const currentIndex = chipKeys.indexOf(key);
|
|
275
|
-
const nextIndex = e.key === "ArrowRight"
|
|
276
|
-
? (currentIndex + 1) % chipKeys.length
|
|
277
|
-
: (currentIndex - 1 + chipKeys.length) % chipKeys.length;
|
|
278
|
-
const nextKey = chipKeys[nextIndex];
|
|
279
|
-
if (nextKey && chipRefs.current[nextKey]) {
|
|
280
|
-
chipRefs.current[nextKey]?.focus();
|
|
281
|
-
setFocusedChipKey(nextKey);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
};
|
|
285
|
-
const renderChips = (data) => {
|
|
286
|
-
return Object.entries(data).map(([key, value], index) => {
|
|
287
|
-
if (typeof value !== "boolean" && !value) {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const item = getFilterItem(key);
|
|
291
|
-
const keyValue = item && (0, getFormData_1.getFormValue)(value, item);
|
|
292
|
-
const formattedValue = formatKeyValue(typeof keyValue === "object"
|
|
293
|
-
? JSON.stringify(keyValue)
|
|
294
|
-
: String(keyValue));
|
|
295
|
-
if (typeof value !== "boolean" && !formattedValue) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
const isFocused = focusedChipKey === key;
|
|
299
|
-
return ((0, jsx_runtime_1.jsx)(FilterPill_1.FilterPill, { ref: (el) => {
|
|
300
|
-
chipRefs.current[key] = el;
|
|
301
|
-
if (index === 0 && !focusedChipKey) {
|
|
302
|
-
filterPopupAnchorElm.current = el;
|
|
303
|
-
}
|
|
304
|
-
}, label: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip
|
|
305
|
-
// eslint-disable-next-line sonarjs/no-base-to-string
|
|
306
|
-
, {
|
|
307
|
-
// eslint-disable-next-line sonarjs/no-base-to-string
|
|
308
|
-
toolTipLabel: `${formattedValue}`, children: `${item?.label}: ${formattedValue}` }), onDelete: () => handleDelete(key), onClick: (e) => {
|
|
309
|
-
handleChipClick(key, e);
|
|
310
|
-
}, isFocused: isFocused, onKeyDown: (e) => handleChipKeyDown(key, e), onFocus: () => setFocusedChipKey(key), onBlur: () => {
|
|
311
|
-
// Only clear focus if focus is moving to another chip
|
|
312
|
-
setTimeout(() => {
|
|
313
|
-
if (!Object.values(chipRefs.current).some((ref) => ref === document.activeElement)) {
|
|
314
|
-
setFocusedChipKey(null);
|
|
315
|
-
}
|
|
316
|
-
}, 0);
|
|
317
|
-
}, tabIndex: 0 }, key));
|
|
318
|
-
});
|
|
319
|
-
};
|
|
320
|
-
(0, utils_1.useGlobalKeyboardShortcut)({
|
|
321
|
-
key: "f",
|
|
322
|
-
modifierKeys: ["ctrl", "shift"],
|
|
323
|
-
onTrigger: () => {
|
|
324
|
-
if (isDisabled) {
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
const buttonElement = filterListV2AnchorRef.current ?? document.createElement("button");
|
|
328
|
-
handleClick(buttonElement);
|
|
329
|
-
},
|
|
330
|
-
});
|
|
331
|
-
const firstNonSwitchIndex = filterListItems.findIndex(({ type }) => type !== "switch" && type !== "dateRange");
|
|
332
|
-
return ((0, jsx_runtime_1.jsxs)(Box_1.default, { sx: { flexGrow: 1 }, children: [(0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", justifyContent: { xs: "end", md: "space-between" }, spacing: 1, children: [isDesktop && ((0, jsx_runtime_1.jsx)(Stack_1.default, { direction: "row", alignItems: "center", sx: {
|
|
333
|
-
maxWidth: {
|
|
334
|
-
xs: "40vw",
|
|
335
|
-
md: "45vw",
|
|
336
|
-
lg: "57vw",
|
|
337
|
-
},
|
|
338
|
-
}, children: filterListData &&
|
|
339
|
-
Object.values(filterListData).some((value) => value) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body1", sx: {
|
|
340
|
-
minWidth: "50px",
|
|
341
|
-
marginRight: "5px",
|
|
342
|
-
}, children: "Filters:" }), (0, jsx_runtime_1.jsx)(Stack_1.default, { direction: "row", gap: "5px", alignItems: "center", sx: { flexWrap: "wrap", maxWidth: "100%" }, children: renderChips(filterListData) })] })) })), (0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", alignItems: "flex-start", children: [filterListData &&
|
|
343
|
-
Object.values(filterListData).some((value) => value) && ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: () => handlerReset(), variant: "text", sx: { minWidth: { xs: "60px", sm: "100px" } }, children: !isMobile ? "Clear Filter" : "Clear" })), !isDisabled && ((0, jsx_runtime_1.jsx)(Actions_1.FilterIconAction, { isFiltered: !(0, isEmpty_1.default)(filterListData), onClick: handleClick, ref: filterListV2AnchorRef }))] })] }), (0, jsx_runtime_1.jsx)("form", { onSubmit: (e) => {
|
|
344
|
-
e.preventDefault();
|
|
345
|
-
if (!shouldFormSubmit) {
|
|
346
|
-
handleSubmit((data) => {
|
|
347
|
-
onSubmit(data);
|
|
348
|
-
})();
|
|
349
|
-
}
|
|
350
|
-
}, onKeyDown: (e) => {
|
|
351
|
-
if (e.key === "Enter") {
|
|
352
|
-
e.preventDefault();
|
|
353
|
-
if (!isPopupOpen && !shouldFormSubmit) {
|
|
354
|
-
handleSubmit((data) => {
|
|
355
|
-
onSubmit(data);
|
|
356
|
-
})();
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}, children: (0, jsx_runtime_1.jsxs)(Drawer_1.default, { open: open, onClose: (_event, reason) => {
|
|
360
|
-
if (reason === "backdropClick") {
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
handleClose();
|
|
364
|
-
}, anchor: "right", sx: {
|
|
365
|
-
zIndex: theme.zIndex.drawer + 2,
|
|
366
|
-
"& .MuiPaper-root": {
|
|
367
|
-
width: "100%",
|
|
368
|
-
maxWidth: { xs: "270px", sm: "350px" },
|
|
369
|
-
},
|
|
370
|
-
}, children: [(0, jsx_runtime_1.jsxs)(Stack_1.default, { sx: {
|
|
371
|
-
background: iron[600],
|
|
372
|
-
}, children: [(0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "10px 30px" }, children: (0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", justifyContent: "space-between", width: "100%", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h6", children: "Filter" }), (0, jsx_runtime_1.jsx)(IconButton_1.default, { onClick: () => {
|
|
373
|
-
reset();
|
|
374
|
-
handleClose();
|
|
375
|
-
}, children: (0, jsx_runtime_1.jsx)(Clear_1.default, {}) })] }) }), (0, jsx_runtime_1.jsx)(Divider_1.default, { sx: { width: "100%" } })] }), (0, jsx_runtime_1.jsx)(Stack_1.default, { flexGrow: 1, sx: { overflowX: "hidden" }, children: filterListItems.map((filter, index) => filter.type === "switch" ? ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", justifyContent: "space-between", alignItems: "center", width: "80%", sx: { padding: "10px 5px 10px 20px ", margin: "auto" }, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body2", children: filter.label }), (0, jsx_runtime_1.jsx)(SwitchField_1.SwitchField, { control: control, name: filter.key })] }, filter.key)) : ((0, jsx_runtime_1.jsxs)(Accordion_1.default, { defaultExpanded: index === firstNonSwitchIndex ||
|
|
376
|
-
!!filterListData?.[filter.key] ||
|
|
377
|
-
!!defaultValues?.[filter.key] ||
|
|
378
|
-
filter.required, disabled: filter.isDisabled, sx: {
|
|
379
|
-
boxShadow: "none",
|
|
380
|
-
"&.MuiAccordion-root.Mui-expanded": {
|
|
381
|
-
margin: "0 !important",
|
|
382
|
-
},
|
|
383
|
-
"&.MuiAccordion-root.Mui-disabled": {
|
|
384
|
-
backgroundColor: "transparent",
|
|
385
|
-
},
|
|
386
|
-
}, children: [(0, jsx_runtime_1.jsx)(AccordionSummary_1.default, { expandIcon: (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}), "aria-controls": "panel1a-content", id: "panel1a-header", sx: {
|
|
387
|
-
flexDirection: "row-reverse",
|
|
388
|
-
"& MuiAccordionSummary-root.Mui-expanded": {
|
|
389
|
-
marginRight: "10px",
|
|
390
|
-
transform: "rotate(-90deg)",
|
|
391
|
-
},
|
|
392
|
-
"&.Mui-expanded": {
|
|
393
|
-
minHeight: "40px",
|
|
394
|
-
paddingY: "5px",
|
|
395
|
-
},
|
|
396
|
-
"& .MuiAccordionSummary-content.Mui-expanded": {
|
|
397
|
-
margin: "0px",
|
|
398
|
-
},
|
|
399
|
-
}, children: (0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", justifyContent: "space-between", alignItems: "center", width: "90%", children: [(0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", alignItems: "center", gap: "5px", children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body2", children: filter.label }), filter.required && ((0, jsx_runtime_1.jsx)(Typography_1.default, { color: "error", children: "*" }))] }), (0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body2", children: filter.menuInfo })] }) }), (0, jsx_runtime_1.jsx)(AccordionDetails_1.default, { sx: {
|
|
400
|
-
background: slate[600],
|
|
401
|
-
borderRadius: "5px",
|
|
402
|
-
padding: "0px",
|
|
403
|
-
}, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: {
|
|
404
|
-
paddingLeft: "15px",
|
|
405
|
-
paddingY: "5px",
|
|
406
|
-
paddingRight: "15px",
|
|
407
|
-
}, children: filter.type === "dateRange" ? ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", alignItems: "center", gap: "10px", onClick: (e) => {
|
|
408
|
-
handleDateRange(filter);
|
|
409
|
-
dateRangeAnchorRef.current = e.currentTarget;
|
|
410
|
-
}, children: [(0, jsx_runtime_1.jsx)(Box_1.default, { sx: {
|
|
411
|
-
border: "1px solid black",
|
|
412
|
-
borderRadius: "5px",
|
|
413
|
-
width: "150px",
|
|
414
|
-
p: 1,
|
|
415
|
-
}, children: (0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body2", children: Array.isArray(watch(filter.key)) &&
|
|
416
|
-
watch(filter.key)[0]
|
|
417
|
-
? luxon_1.DateTime.fromISO(watch(filter.key)[0]).toFormat(FormFields_1.dateFormats.dateWithEuropean)
|
|
418
|
-
: "Start Date" }) }), (0, jsx_runtime_1.jsx)(Typography_1.default, { children: "~" }), (0, jsx_runtime_1.jsx)(Box_1.default, { sx: {
|
|
419
|
-
border: "1px solid black",
|
|
420
|
-
borderRadius: "5px",
|
|
421
|
-
width: "150px",
|
|
422
|
-
p: 1,
|
|
423
|
-
}, children: (0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body2", children: Array.isArray(watch(filter.key)) &&
|
|
424
|
-
watch(filter.key)[1]
|
|
425
|
-
? luxon_1.DateTime.fromISO(watch(filter.key)[1]).toFormat(FormFields_1.dateFormats.dateWithEuropean)
|
|
426
|
-
: "End Date" }) })] })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { children: (0, GetFilterPopupComponent_1.getFilterPopupComponent)({
|
|
427
|
-
selectedFilter: filter,
|
|
428
|
-
control,
|
|
429
|
-
errors,
|
|
430
|
-
setIsPopupOpen,
|
|
431
|
-
autoFocus: index === firstNonSwitchIndex,
|
|
432
|
-
})[filter.type] })) }) })] }, filter.key))) }), (0, jsx_runtime_1.jsx)(Divider_1.default, {}), (0, jsx_runtime_1.jsx)(Stack_1.default, { children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: (0, jsx_runtime_1.jsxs)(Layouts_1.ButtonContainer, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { type: "submit", disabled: shouldFormSubmit, variant: "contained", onClick: () => {
|
|
433
|
-
handleSubmit(onSubmit)();
|
|
434
|
-
}, children: "Apply" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { type: "button", onClick: () => handlerReset(), disabled: Object.keys(formData).every((key) => !formData[key]), variant: "outlined", children: "Reset" })] }) }) })] }) }), currentFilter && ((0, jsx_runtime_1.jsx)(FilterPopupWrapper_1.FilterPopupWrapper, { open: openFilterPopup, onClose: handleCloseFilterPopup, onApply: () => {
|
|
435
|
-
handleSubmit(onSubmit)();
|
|
436
|
-
}, control: control, errors: errors, reset: reset, anchorEl: filterPopupAnchorElm.current, filterItem: currentFilter, currentFilterValue: currentFilterValue })), currentFilter && ((0, jsx_runtime_1.jsx)(FilterPopupWrapper_1.FilterPopUpDateRangeWrapper, { open: datePickerPopup, onClose: handleCloseDatePickerPopup, onApply: () => {
|
|
437
|
-
handleDateRangeSubmit();
|
|
438
|
-
}, control: control, errors: errors, anchorEl: dateRangeAnchorRef.current, filterItem: currentFilter }))] }));
|
|
439
|
-
};
|
|
440
|
-
exports.FilterListV2 = FilterListV2;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FilterPopup = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const Clear_1 = __importDefault(require("@mui/icons-material/Clear"));
|
|
9
|
-
const Box_1 = __importDefault(require("@mui/material/Box"));
|
|
10
|
-
const Divider_1 = __importDefault(require("@mui/material/Divider"));
|
|
11
|
-
const IconButton_1 = __importDefault(require("@mui/material/IconButton"));
|
|
12
|
-
const Popover_1 = __importDefault(require("@mui/material/Popover"));
|
|
13
|
-
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
14
|
-
const styles_1 = require("@mui/material/styles");
|
|
15
|
-
const Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
16
|
-
const isFunction_1 = __importDefault(require("lodash/isFunction"));
|
|
17
|
-
const sortBy_1 = __importDefault(require("lodash/sortBy"));
|
|
18
|
-
const react_1 = require("react");
|
|
19
|
-
const Button_1 = require("../Button");
|
|
20
|
-
const PadBox_1 = require("../PadBox");
|
|
21
|
-
const FilterPopup = ({ open, anchorEl, onClose, children, onApply, showDivider = false, showFooter = true, title, required, filterItem, reset, background = false, currentFilterValue, }) => {
|
|
22
|
-
const theme = (0, styles_1.useTheme)();
|
|
23
|
-
const { slate } = theme.palette.app.color;
|
|
24
|
-
const [initialValue, setInitialValue] = (0, react_1.useState)(null);
|
|
25
|
-
const [isDisabled, setIsDisabled] = (0, react_1.useState)(true);
|
|
26
|
-
(0, react_1.useEffect)(() => {
|
|
27
|
-
if (open) {
|
|
28
|
-
if (!initialValue && !!currentFilterValue) {
|
|
29
|
-
const changedValue = filterItem?.multiSelect
|
|
30
|
-
? (0, sortBy_1.default)(currentFilterValue)
|
|
31
|
-
: currentFilterValue;
|
|
32
|
-
setInitialValue(changedValue);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
setInitialValue(null);
|
|
37
|
-
}
|
|
38
|
-
if (!!currentFilterValue && !!initialValue) {
|
|
39
|
-
const isChanged = filterItem?.multiSelect
|
|
40
|
-
? JSON.stringify((0, sortBy_1.default)(currentFilterValue)) !==
|
|
41
|
-
JSON.stringify(initialValue)
|
|
42
|
-
: currentFilterValue !== initialValue;
|
|
43
|
-
setIsDisabled(!isChanged);
|
|
44
|
-
}
|
|
45
|
-
}, [open, currentFilterValue, initialValue, filterItem?.multiSelect]);
|
|
46
|
-
const handleApply = () => {
|
|
47
|
-
setInitialValue(null);
|
|
48
|
-
if ((0, isFunction_1.default)(onApply)) {
|
|
49
|
-
onApply();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const handleClose = () => {
|
|
53
|
-
setInitialValue(null);
|
|
54
|
-
if ((0, isFunction_1.default)(reset)) {
|
|
55
|
-
reset();
|
|
56
|
-
}
|
|
57
|
-
if ((0, isFunction_1.default)(onClose)) {
|
|
58
|
-
onClose({}, "backdropClick");
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)(Popover_1.default, { open: open, anchorEl: anchorEl, anchorOrigin: { vertical: "bottom", horizontal: "left" }, onClose: (_event, reason) => {
|
|
62
|
-
if (reason === "backdropClick") {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
handleClose();
|
|
66
|
-
}, sx: { "& .MuiPaper-root": { minWidth: "300px" } }, children: [showDivider && ((0, jsx_runtime_1.jsxs)(Stack_1.default, { alignItems: "flex-end", children: [(0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "8px" }, children: (0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", justifyContent: "space-between", width: "100%", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", alignItems: "center", gap: "5px", children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h6", children: title }), required && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h6", color: "error", children: "*" }))] }), (0, jsx_runtime_1.jsx)(IconButton_1.default, { onClick: handleClose, children: (0, jsx_runtime_1.jsx)(Clear_1.default, {}) })] }) }), (0, jsx_runtime_1.jsx)(Divider_1.default, { sx: { width: "100%" } })] })), (0, jsx_runtime_1.jsx)(Box_1.default, { sx: {
|
|
67
|
-
background: background ? slate[600] : "transparent",
|
|
68
|
-
borderRadius: "5px",
|
|
69
|
-
maxWidth: "300px",
|
|
70
|
-
}, children: children }), showFooter && ((0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: (0, jsx_runtime_1.jsx)(Box_1.default, { display: "flex", justifyContent: "flex-end", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: handleApply, disabled: isDisabled, variant: "text", sx: { maxWidth: "40px" }, children: "Apply" }) }) }))] }));
|
|
71
|
-
};
|
|
72
|
-
exports.FilterPopup = FilterPopup;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FilterPopUpDateRangeWrapper = exports.FilterPopupWrapper = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
9
|
-
const Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
10
|
-
const FormFields_1 = require("../FormFields");
|
|
11
|
-
const PadBox_1 = require("../PadBox");
|
|
12
|
-
const DateRangePickerPopUp_1 = require("./DateRangePickerPopUp");
|
|
13
|
-
const FilterPopup_1 = require("./FilterPopup");
|
|
14
|
-
const GetFilterPopupComponent_1 = require("./GetFilterPopupComponent");
|
|
15
|
-
const FilterPopupWrapper = ({ open, anchorEl, filterItem, onClose, control, errors, onApply, currentFilterValue, reset, }) => {
|
|
16
|
-
return ((0, jsx_runtime_1.jsx)(FilterPopup_1.FilterPopup, { title: filterItem.label, required: filterItem.required, filterItem: filterItem, open: open, onClose: onClose, anchorEl: anchorEl, onApply: onApply, currentFilterValue: currentFilterValue, reset: reset, showFooter: true, showDivider: true, background: true, children: (0, jsx_runtime_1.jsxs)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: [(0, GetFilterPopupComponent_1.getFilterPopupComponent)({
|
|
17
|
-
selectedFilter: filterItem,
|
|
18
|
-
control,
|
|
19
|
-
errors,
|
|
20
|
-
})[filterItem.type], filterItem.type === "switch" && ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { padding: "10px 5px 10px 20px", margin: "auto" }, children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body2", children: filterItem.label }), (0, jsx_runtime_1.jsx)(FormFields_1.SwitchField, { control: control, name: filterItem.key })] }, filterItem.key))] }) }));
|
|
21
|
-
};
|
|
22
|
-
exports.FilterPopupWrapper = FilterPopupWrapper;
|
|
23
|
-
const FilterPopUpDateRangeWrapper = ({ open, anchorEl, filterItem, onClose, control, errors, onApply, }) => {
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(DateRangePickerPopUp_1.DateRangePickerPopUp, { title: filterItem.label, required: filterItem.required, open: open, onClose: onClose, anchorEl: anchorEl, onApply: onApply, showDivider: true, background: true, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: (0, GetFilterPopupComponent_1.getFilterPopupComponent)({
|
|
25
|
-
selectedFilter: filterItem,
|
|
26
|
-
control,
|
|
27
|
-
errors,
|
|
28
|
-
})[filterItem.type] }) }));
|
|
29
|
-
};
|
|
30
|
-
exports.FilterPopUpDateRangeWrapper = FilterPopUpDateRangeWrapper;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.FilterTypeWrapper = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const ListItemButton_1 = __importDefault(require("@mui/material/ListItemButton"));
|
|
9
|
-
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
10
|
-
const Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
11
|
-
const SwitchField_1 = require("../FormFields/SwitchField");
|
|
12
|
-
const FilterTypeWrapper = ({ filter, control, }) => {
|
|
13
|
-
const getFilterByType = (type) => {
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { direction: "row", width: "100%", justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body2", children: filter.label }), type === "switch" ? ((0, jsx_runtime_1.jsx)(SwitchField_1.SwitchField, { control: control, name: filter.key })) : ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "body2", children: filter.menuInfo }))] }));
|
|
15
|
-
};
|
|
16
|
-
return (0, jsx_runtime_1.jsx)(ListItemButton_1.default, { children: getFilterByType(filter.type) });
|
|
17
|
-
};
|
|
18
|
-
exports.FilterTypeWrapper = FilterTypeWrapper;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFilterPopupComponent = getFilterPopupComponent;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const styles_1 = require("@mui/material/styles");
|
|
6
|
-
const FormFields_1 = require("../FormFields");
|
|
7
|
-
function getFilterPopupComponent({ selectedFilter, control, errors, setIsPopupOpen, autoFocus = false, }) {
|
|
8
|
-
const theme = (0, styles_1.useTheme)();
|
|
9
|
-
const { sapphireBlue, black } = theme.palette.app.color;
|
|
10
|
-
const errorSelectedKey = errors[selectedFilter.key];
|
|
11
|
-
const { placeholder, label } = selectedFilter;
|
|
12
|
-
const autocompletePlaceholder = placeholder ?? `Select ${label}`;
|
|
13
|
-
const textFieldPlaceholder = placeholder ?? label;
|
|
14
|
-
return {
|
|
15
|
-
autoComplete: selectedFilter.options && ((0, jsx_runtime_1.jsx)(FormFields_1.Autocomplete, { disableClearable: true, multiple: selectedFilter.multiSelect ?? false, placeholder: autocompletePlaceholder, name: `${selectedFilter.key}`, disabled: selectedFilter.isDisabled, shouldCloseOnSelect: selectedFilter.multiSelect ?? false, control: control, options: selectedFilter.options ?? [], onOpen: () => setIsPopupOpen?.(true), onClose: () => setIsPopupOpen?.(false), autoFocus: autoFocus, sx: {
|
|
16
|
-
maxHeight: "250px",
|
|
17
|
-
overflowY: "auto",
|
|
18
|
-
width: "100%",
|
|
19
|
-
"& .MuiAutocomplete-tag": {
|
|
20
|
-
backgroundColor: sapphireBlue[300],
|
|
21
|
-
color: black[900],
|
|
22
|
-
},
|
|
23
|
-
}, ...(selectedFilter.employeeAutocomplete && {
|
|
24
|
-
isShowEmployeeData: true,
|
|
25
|
-
isShowOptionsOnType: true,
|
|
26
|
-
getOptionLabel: (option) => {
|
|
27
|
-
if (typeof option === "string") {
|
|
28
|
-
return option;
|
|
29
|
-
}
|
|
30
|
-
return `${option.label} (${option.employee_code}) - ${option.punch_code}`;
|
|
31
|
-
},
|
|
32
|
-
}), error: !!errorSelectedKey, helperText: errorSelectedKey?.message })),
|
|
33
|
-
text: ((0, jsx_runtime_1.jsx)(FormFields_1.TextField, { name: selectedFilter.key, control: control, disabled: selectedFilter.isDisabled, placeholder: textFieldPlaceholder, error: !!errorSelectedKey, helperText: errorSelectedKey?.message, autoFocus: autoFocus })),
|
|
34
|
-
date: ((0, jsx_runtime_1.jsx)(FormFields_1.DatePicker, { name: selectedFilter.key, control: control, disabled: selectedFilter.isDisabled, error: !!errorSelectedKey, helperText: errorSelectedKey?.message, autoFocus: autoFocus, ...(selectedFilter.monthYearFormat && {
|
|
35
|
-
format: "MMM yyyy",
|
|
36
|
-
views: ["year", "month"],
|
|
37
|
-
}) })),
|
|
38
|
-
dateRange: ((0, jsx_runtime_1.jsx)(FormFields_1.DateRangePicker, { name: selectedFilter.key, control: control, disabled: selectedFilter.isDisabled, error: !!errorSelectedKey, helperText: errorSelectedKey?.message })),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFormValue = void 0;
|
|
4
|
-
const getFormValue = (value, item) => {
|
|
5
|
-
let keyValue = value;
|
|
6
|
-
if (item && item.type === "autoComplete") {
|
|
7
|
-
if (item.multiSelect && Array.isArray(value)) {
|
|
8
|
-
keyValue = item.options
|
|
9
|
-
?.filter((option) => value.includes(option.value))
|
|
10
|
-
.map((option) => option.label)
|
|
11
|
-
.join(", ");
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
keyValue = item.options
|
|
15
|
-
?.filter((option) => option.value === value)
|
|
16
|
-
.map((option) => option.label)
|
|
17
|
-
.join(", ");
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
if (item.type === "dateRange" && Array.isArray(value) && value.length === 2) {
|
|
21
|
-
const startDate = value[0];
|
|
22
|
-
const endDate = value[1];
|
|
23
|
-
keyValue = `${startDate} <= Start Date <= ${endDate}`;
|
|
24
|
-
}
|
|
25
|
-
return keyValue;
|
|
26
|
-
};
|
|
27
|
-
exports.getFormValue = getFormValue;
|