pixelize-design-library 2.2.197 → 2.3.1-beta.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/.claude/settings.local.json +24 -0
- package/coverage/clover.xml +638 -0
- package/coverage/coverage-final.json +20 -0
- package/coverage/lcov-report/Table/CompactSelect.tsx.html +379 -0
- package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +514 -0
- package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +373 -0
- package/coverage/lcov-report/Table/Components/Pagination.tsx.html +574 -0
- package/coverage/lcov-report/Table/Components/TableActions.tsx.html +574 -0
- package/coverage/lcov-report/Table/Components/TableBody.tsx.html +1027 -0
- package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +397 -0
- package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +1060 -0
- package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +361 -0
- package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +337 -0
- package/coverage/lcov-report/Table/Components/index.html +266 -0
- package/coverage/lcov-report/Table/Components/useDebounce.ts.html +178 -0
- package/coverage/lcov-report/Table/Components/useTable.ts.html +778 -0
- package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +1810 -0
- package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +178 -0
- package/coverage/lcov-report/Table/Table.tsx.html +1567 -0
- package/coverage/lcov-report/Table/TableProps.tsx.html +658 -0
- package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +619 -0
- package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +229 -0
- package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +532 -0
- package/coverage/lcov-report/Table/TableSettings/index.html +146 -0
- package/coverage/lcov-report/Table/TableToDo.tsx.html +973 -0
- package/coverage/lcov-report/Table/TextOperationControls.tsx.html +271 -0
- package/coverage/lcov-report/Table/filterTypes.ts.html +97 -0
- package/coverage/lcov-report/Table/index.html +176 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +1836 -0
- package/dist/App.d.ts +4 -0
- package/dist/App.js +131 -0
- package/dist/Assets/defaultLogo.tsx +31 -0
- package/dist/Components/Button/Button.styles.js +44 -3
- package/dist/Components/Button/ButtonProps.d.ts +1 -1
- package/dist/Components/ButtonGroupIcon/ButtonGoupIconProps.d.ts +2 -2
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +50 -38
- package/dist/Components/Checkbox/Checkbox.js +2 -2
- package/dist/Components/Checkbox/Checkbox.styles.js +2 -0
- package/dist/Components/Common/FormLabel.d.ts +2 -1
- package/dist/Components/Common/FormLabel.js +8 -9
- package/dist/Components/Common/fieldStyles.d.ts +22 -0
- package/dist/Components/Common/fieldStyles.js +42 -0
- package/dist/Components/DatePicker/CalendarPanel.d.ts +2 -0
- package/dist/Components/DatePicker/CalendarPanel.js +104 -65
- package/dist/Components/DatePicker/RangeDatePicker.js +37 -16
- package/dist/Components/DatePicker/SingleDatePicker.js +16 -16
- package/dist/Components/DatePicker/TimePicker.js +4 -4
- package/dist/Components/Input/Input/Input.d.ts +1 -1
- package/dist/Components/Input/Input/Input.js +5 -4
- package/dist/Components/Input/Input/InputProps.d.ts +2 -0
- package/dist/Components/Input/TextInput.styles.js +2 -1
- package/dist/Components/InputTextArea/InputTextArea.style.js +2 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +5 -5
- package/dist/Components/KanbanBoard/MeasuredItem.js +21 -8
- package/dist/Components/MultiSelect/MultiSelect.js +11 -12
- package/dist/Components/NavigationBar/NavigationBar.d.ts +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +54 -27
- package/dist/Components/NavigationBar/NavigationBarProps.d.ts +1 -0
- package/dist/Components/NoteTextArea/NoteTextArea.js +44 -40
- package/dist/Components/NumberInput/NumberInput.styles.js +2 -1
- package/dist/Components/PinInput/PinInput.d.ts +1 -1
- package/dist/Components/PinInput/PinInput.js +3 -2
- package/dist/Components/PinInput/PinInputProps.d.ts +4 -0
- package/dist/Components/RadioButton/RadioButton.js +1 -1
- package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelect.js +3 -3
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +2 -0
- package/dist/Components/Select/Select.styles.js +2 -1
- package/dist/Components/SelectSearch/SelectSearch.js +7 -4
- package/dist/Components/SideBar/SecondaryBar.js +20 -18
- package/dist/Components/SideBar/SideBar.d.ts +1 -1
- package/dist/Components/SideBar/SideBar.js +58 -43
- package/dist/Components/SideBar/SideBarProps.d.ts +14 -3
- package/dist/Components/SideBar/components/MenuItemBox.js +28 -24
- package/dist/Components/SideBar/components/MenuItems.js +16 -2
- package/dist/Components/SideBar/components/MenuPopoverContent.js +16 -16
- package/dist/Components/SideBar/components/OtherApps.js +16 -14
- package/dist/Components/Table/Components/TableBody.d.ts +5 -1
- package/dist/Components/Table/Components/TableBody.js +133 -31
- package/dist/Components/Table/Components/TableGroupRow.d.ts +15 -0
- package/dist/Components/Table/Components/TableGroupRow.js +27 -0
- package/dist/Components/Table/Components/TableHeader.js +23 -9
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Table/Table.js +119 -38
- package/dist/Components/Table/TableProps.d.ts +34 -2
- package/dist/Components/Table/filters/ActiveFilters.d.ts +9 -0
- package/dist/Components/Table/filters/ActiveFilters.js +132 -0
- package/dist/Components/Table/filters/CompactSelect.d.ts +15 -0
- package/dist/Components/Table/filters/CompactSelect.js +69 -0
- package/dist/Components/Table/filters/LeftFilterPane.d.ts +36 -0
- package/dist/Components/Table/filters/LeftFilterPane.js +273 -0
- package/dist/Components/Table/filters/SelectOperationControls.d.ts +8 -0
- package/dist/Components/Table/filters/SelectOperationControls.js +15 -0
- package/dist/Components/Table/filters/TableFilters.d.ts +7 -0
- package/dist/Components/Table/filters/TableFilters.js +89 -0
- package/dist/Components/Table/filters/TextOperationControls.d.ts +12 -0
- package/dist/Components/Table/filters/TextOperationControls.js +29 -0
- package/dist/Components/Table/hooks/useDebounce.d.ts +2 -0
- package/dist/Components/Table/hooks/useDebounce.js +28 -0
- package/dist/Components/Table/hooks/useTable.d.ts +47 -0
- package/dist/Components/Table/hooks/useTable.js +219 -0
- package/dist/Components/Table/settings/ManageColumns.d.ts +12 -0
- package/dist/Components/Table/settings/ManageColumns.js +166 -0
- package/dist/Components/Table/settings/ManageColumns.test.d.ts +1 -0
- package/dist/Components/Table/settings/ManageColumns.test.js +146 -0
- package/dist/Components/Table/settings/TableSettings.d.ts +10 -0
- package/dist/Components/Table/settings/TableSettings.js +141 -0
- package/dist/Layout.d.ts +3 -0
- package/dist/Layout.js +292 -0
- package/dist/Pages/TInput.d.ts +3 -0
- package/dist/Pages/TInput.js +56 -0
- package/dist/Pages/accordion.d.ts +3 -0
- package/dist/Pages/accordion.js +42 -0
- package/dist/Pages/alertdialog.d.ts +3 -0
- package/dist/Pages/alertdialog.js +54 -0
- package/dist/Pages/button.d.ts +3 -0
- package/dist/Pages/button.js +46 -0
- package/dist/Pages/card.d.ts +3 -0
- package/dist/Pages/card.js +117 -0
- package/dist/Pages/chart.d.ts +4 -0
- package/dist/Pages/chart.js +40 -0
- package/dist/Pages/checkbox.d.ts +3 -0
- package/dist/Pages/checkbox.js +12 -0
- package/dist/Pages/contactForm.d.ts +3 -0
- package/dist/Pages/contactForm.js +16 -0
- package/dist/Pages/datePick.d.ts +3 -0
- package/dist/Pages/datePick.js +88 -0
- package/dist/Pages/drawer.d.ts +3 -0
- package/dist/Pages/drawer.js +58 -0
- package/dist/Pages/dropdown.d.ts +3 -0
- package/dist/Pages/dropdown.js +24 -0
- package/dist/Pages/editor.d.ts +3 -0
- package/dist/Pages/editor.js +14 -0
- package/dist/Pages/feedback.d.ts +2 -0
- package/dist/Pages/feedback.js +15 -0
- package/dist/Pages/fileUpload.d.ts +2 -0
- package/dist/Pages/fileUpload.js +82 -0
- package/dist/Pages/input.d.ts +3 -0
- package/dist/Pages/input.js +92 -0
- package/dist/Pages/kanbanboard.d.ts +3 -0
- package/dist/Pages/kanbanboard.js +224 -0
- package/dist/Pages/modal.d.ts +3 -0
- package/dist/Pages/modal.js +65 -0
- package/dist/Pages/multiSelect.d.ts +3 -0
- package/dist/Pages/multiSelect.js +55 -0
- package/dist/Pages/noteArea.d.ts +3 -0
- package/dist/Pages/noteArea.js +59 -0
- package/dist/Pages/notification.d.ts +3 -0
- package/dist/Pages/notification.js +25 -0
- package/dist/Pages/numberInput.d.ts +3 -0
- package/dist/Pages/numberInput.js +49 -0
- package/dist/Pages/photoViewer.d.ts +3 -0
- package/dist/Pages/photoViewer.js +12 -0
- package/dist/Pages/pinInputs.d.ts +3 -0
- package/dist/Pages/pinInputs.js +12 -0
- package/dist/Pages/productCaard.d.ts +3 -0
- package/dist/Pages/productCaard.js +311 -0
- package/dist/Pages/productDetailCard.d.ts +3 -0
- package/dist/Pages/productDetailCard.js +78 -0
- package/dist/Pages/productFilter.d.ts +3 -0
- package/dist/Pages/productFilter.js +202 -0
- package/dist/Pages/progressbar.d.ts +3 -0
- package/dist/Pages/progressbar.js +12 -0
- package/dist/Pages/radioButton.d.ts +3 -0
- package/dist/Pages/radioButton.js +54 -0
- package/dist/Pages/search.d.ts +3 -0
- package/dist/Pages/search.js +54 -0
- package/dist/Pages/searchSelect.d.ts +3 -0
- package/dist/Pages/searchSelect.js +133 -0
- package/dist/Pages/select.d.ts +3 -0
- package/dist/Pages/select.js +53 -0
- package/dist/Pages/selectSearch.d.ts +3 -0
- package/dist/Pages/selectSearch.js +103 -0
- package/dist/Pages/skeleton.d.ts +3 -0
- package/dist/Pages/skeleton.js +22 -0
- package/dist/Pages/switch.d.ts +3 -0
- package/dist/Pages/switch.js +50 -0
- package/dist/Pages/table.d.ts +3 -0
- package/dist/Pages/table.js +174 -0
- package/dist/Pages/textArea.d.ts +3 -0
- package/dist/Pages/textArea.js +15 -0
- package/dist/Pages/timeline.d.ts +3 -0
- package/dist/Pages/timeline.js +74 -0
- package/dist/Pages/tooltip.d.ts +3 -0
- package/dist/Pages/tooltip.js +12 -0
- package/dist/Pages/toster.d.ts +3 -0
- package/dist/Pages/toster.js +68 -0
- package/dist/Pages/verifyEmail.d.ts +3 -0
- package/dist/Pages/verifyEmail.js +18 -0
- package/dist/Theme/Dark/palette.d.ts +370 -0
- package/dist/Theme/Dark/palette.js +372 -0
- package/dist/Theme/Default/palette.d.ts +4 -0
- package/dist/Theme/Default/palette.js +3 -0
- package/dist/Theme/Emerald/palette.d.ts +4 -0
- package/dist/Theme/Emerald/palette.js +2 -1
- package/dist/Theme/Meadow/palette.d.ts +4 -0
- package/dist/Theme/Meadow/palette.js +2 -1
- package/dist/Theme/Radiant/palette.d.ts +4 -0
- package/dist/Theme/Radiant/palette.js +2 -1
- package/dist/Theme/Rosewood/palette.d.ts +4 -0
- package/dist/Theme/Rosewood/palette.js +2 -1
- package/dist/Theme/Skyline/palette.d.ts +4 -0
- package/dist/Theme/Skyline/palette.js +2 -1
- package/dist/Theme/Slate/palette.d.ts +4 -0
- package/dist/Theme/Slate/palette.js +2 -1
- package/dist/Theme/themeProps.d.ts +4 -0
- package/dist/Utils/table.d.ts +21 -0
- package/dist/Utils/table.js +98 -14
- package/dist/bootstrap.d.ts +1 -0
- package/dist/bootstrap.js +14 -0
- package/dist/components-v2/AlertDialog/AlertDialog.d.ts +23 -0
- package/dist/components-v2/AlertDialog/AlertDialog.js +98 -0
- package/dist/components-v2/Breadcrumbs/Breadcrumbs.d.ts +14 -0
- package/dist/components-v2/Breadcrumbs/Breadcrumbs.js +66 -0
- package/dist/components-v2/Charts/AreaChart.d.ts +23 -0
- package/dist/components-v2/Charts/AreaChart.js +63 -0
- package/dist/components-v2/Charts/BarChart.d.ts +25 -0
- package/dist/components-v2/Charts/BarChart.js +57 -0
- package/dist/components-v2/Charts/LineChart.d.ts +23 -0
- package/dist/components-v2/Charts/LineChart.js +55 -0
- package/dist/components-v2/Charts/PieChart.d.ts +15 -0
- package/dist/components-v2/Charts/PieChart.js +54 -0
- package/dist/components-v2/Charts/PolarChart.d.ts +14 -0
- package/dist/components-v2/Charts/PolarChart.js +54 -0
- package/dist/components-v2/Charts/chartOptions.d.ts +7 -0
- package/dist/components-v2/Charts/chartOptions.js +41 -0
- package/dist/components-v2/Charts/useChartTheme.d.ts +22 -0
- package/dist/components-v2/Charts/useChartTheme.js +106 -0
- package/dist/components-v2/ContactForm/ContactForm.d.ts +25 -0
- package/dist/components-v2/ContactForm/ContactForm.js +116 -0
- package/dist/components-v2/DatePicker/Calendar.d.ts +19 -0
- package/dist/components-v2/DatePicker/Calendar.js +212 -0
- package/dist/components-v2/DatePicker/DatePicker.d.ts +46 -0
- package/dist/components-v2/DatePicker/DatePicker.js +189 -0
- package/dist/components-v2/DatePicker/TimePicker.d.ts +12 -0
- package/dist/components-v2/DatePicker/TimePicker.js +105 -0
- package/dist/components-v2/DatePicker/utils.d.ts +31 -0
- package/dist/components-v2/DatePicker/utils.js +109 -0
- package/dist/components-v2/Drawer/Drawer.d.ts +27 -0
- package/dist/components-v2/Drawer/Drawer.js +132 -0
- package/dist/components-v2/FeedbackForm/FeedbackForm.d.ts +26 -0
- package/dist/components-v2/FeedbackForm/FeedbackForm.js +112 -0
- package/dist/components-v2/FileUploader/FileUploader.d.ts +28 -0
- package/dist/components-v2/FileUploader/FileUploader.js +127 -0
- package/dist/components-v2/Input/TextInput.d.ts +41 -0
- package/dist/components-v2/Input/TextInput.js +169 -0
- package/dist/components-v2/KanbanBoard/KanbanBoard.d.ts +39 -0
- package/dist/components-v2/KanbanBoard/KanbanBoard.js +101 -0
- package/dist/components-v2/Layout/AppLayout.d.ts +22 -0
- package/dist/components-v2/Layout/AppLayout.js +53 -0
- package/dist/components-v2/Loading/Loading.d.ts +19 -0
- package/dist/components-v2/Loading/Loading.js +55 -0
- package/dist/components-v2/Modal/Modal.d.ts +30 -0
- package/dist/components-v2/Modal/Modal.js +82 -0
- package/dist/components-v2/NavigationBar/NavigationBar.d.ts +47 -0
- package/dist/components-v2/NavigationBar/NavigationBar.js +148 -0
- package/dist/components-v2/Notification/Notification.d.ts +22 -0
- package/dist/components-v2/Notification/Notification.js +113 -0
- package/dist/components-v2/NumberInput/NumberInput.d.ts +37 -0
- package/dist/components-v2/NumberInput/NumberInput.js +210 -0
- package/dist/components-v2/PinInput/PinInput.d.ts +26 -0
- package/dist/components-v2/PinInput/PinInput.js +138 -0
- package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +18 -0
- package/dist/components-v2/ProfilePhotoViewer/ProfilePhotoViewer.js +91 -0
- package/dist/components-v2/Select/Select.d.ts +41 -0
- package/dist/components-v2/Select/Select.js +284 -0
- package/dist/components-v2/Sidebar/Sidebar.d.ts +41 -0
- package/dist/components-v2/Sidebar/Sidebar.js +182 -0
- package/dist/components-v2/Slider/Slider.d.ts +18 -0
- package/dist/components-v2/Slider/Slider.js +101 -0
- package/dist/components-v2/Table/Table.d.ts +7 -0
- package/dist/components-v2/Table/Table.js +172 -0
- package/dist/components-v2/Table/TableProps.d.ts +139 -0
- package/dist/components-v2/Table/TableProps.js +9 -0
- package/dist/components-v2/Table/components/ActiveFilters.d.ts +10 -0
- package/dist/components-v2/Table/components/ActiveFilters.js +70 -0
- package/dist/components-v2/Table/components/BulkActionBar.d.ts +11 -0
- package/dist/components-v2/Table/components/BulkActionBar.js +92 -0
- package/dist/components-v2/Table/components/ColumnResizeHandle.d.ts +7 -0
- package/dist/components-v2/Table/components/ColumnResizeHandle.js +41 -0
- package/dist/components-v2/Table/components/Pagination.d.ts +11 -0
- package/dist/components-v2/Table/components/Pagination.js +92 -0
- package/dist/components-v2/Table/components/TableBody.d.ts +23 -0
- package/dist/components-v2/Table/components/TableBody.js +69 -0
- package/dist/components-v2/Table/components/TableCell.d.ts +14 -0
- package/dist/components-v2/Table/components/TableCell.js +63 -0
- package/dist/components-v2/Table/components/TableEmptyState.d.ts +12 -0
- package/dist/components-v2/Table/components/TableEmptyState.js +55 -0
- package/dist/components-v2/Table/components/TableErrorState.d.ts +6 -0
- package/dist/components-v2/Table/components/TableErrorState.js +52 -0
- package/dist/components-v2/Table/components/TableHeader.d.ts +21 -0
- package/dist/components-v2/Table/components/TableHeader.js +94 -0
- package/dist/components-v2/Table/components/TableRow.d.ts +20 -0
- package/dist/components-v2/Table/components/TableRow.js +64 -0
- package/dist/components-v2/Table/components/TableSearch.d.ts +8 -0
- package/dist/components-v2/Table/components/TableSearch.js +47 -0
- package/dist/components-v2/Table/filters/FilterChips.d.ts +6 -0
- package/dist/components-v2/Table/filters/FilterChips.js +9 -0
- package/dist/components-v2/Table/filters/LeftFilterPane.d.ts +17 -0
- package/dist/components-v2/Table/filters/LeftFilterPane.js +105 -0
- package/dist/components-v2/Table/filters/TableFilters.d.ts +12 -0
- package/dist/components-v2/Table/filters/TableFilters.js +127 -0
- package/dist/components-v2/Table/hooks/useColumnResize.d.ts +15 -0
- package/dist/components-v2/Table/hooks/useColumnResize.js +104 -0
- package/dist/components-v2/Table/hooks/useTable.d.ts +58 -0
- package/dist/components-v2/Table/hooks/useTable.js +254 -0
- package/dist/components-v2/Table/hooks/useTableKeyboard.d.ts +25 -0
- package/dist/components-v2/Table/hooks/useTableKeyboard.js +112 -0
- package/dist/components-v2/Table/hooks/useVirtualScroll.d.ts +29 -0
- package/dist/components-v2/Table/hooks/useVirtualScroll.js +83 -0
- package/dist/components-v2/Table/settings/ManageColumns.d.ts +12 -0
- package/dist/components-v2/Table/settings/ManageColumns.js +59 -0
- package/dist/components-v2/Table/settings/TableSettings.d.ts +12 -0
- package/dist/components-v2/Table/settings/TableSettings.js +57 -0
- package/dist/components-v2/Table/utils/filterUtils.d.ts +7 -0
- package/dist/components-v2/Table/utils/filterUtils.js +149 -0
- package/dist/components-v2/Table/utils/sortUtils.d.ts +6 -0
- package/dist/components-v2/Table/utils/sortUtils.js +65 -0
- package/dist/components-v2/Tag/Tag.d.ts +15 -0
- package/dist/components-v2/Tag/Tag.js +87 -0
- package/dist/components-v2/Timeline/Timeline.d.ts +18 -0
- package/dist/components-v2/Timeline/Timeline.js +76 -0
- package/dist/components-v2/Toaster/Toaster.d.ts +61 -0
- package/dist/components-v2/Toaster/Toaster.js +63 -0
- package/dist/components-v2/Toggle/Toggle.d.ts +28 -0
- package/dist/components-v2/Toggle/Toggle.js +90 -0
- package/dist/components-v2/ui/accordion.d.ts +12 -0
- package/dist/components-v2/ui/accordion.js +104 -0
- package/dist/components-v2/ui/alert.d.ts +18 -0
- package/dist/components-v2/ui/alert.js +99 -0
- package/dist/components-v2/ui/avatar.d.ts +12 -0
- package/dist/components-v2/ui/avatar.js +80 -0
- package/dist/components-v2/ui/badge.d.ts +10 -0
- package/dist/components-v2/ui/badge.js +76 -0
- package/dist/components-v2/ui/button.d.ts +18 -0
- package/dist/components-v2/ui/button.js +97 -0
- package/dist/components-v2/ui/checkbox.d.ts +15 -0
- package/dist/components-v2/ui/checkbox.js +86 -0
- package/dist/components-v2/ui/dialog.d.ts +30 -0
- package/dist/components-v2/ui/dialog.js +115 -0
- package/dist/components-v2/ui/dropdown-menu.d.ts +26 -0
- package/dist/components-v2/ui/dropdown-menu.js +121 -0
- package/dist/components-v2/ui/field.d.ts +32 -0
- package/dist/components-v2/ui/field.js +62 -0
- package/dist/components-v2/ui/form-field.d.ts +25 -0
- package/dist/components-v2/ui/form-field.js +96 -0
- package/dist/components-v2/ui/input.d.ts +9 -0
- package/dist/components-v2/ui/input.js +73 -0
- package/dist/components-v2/ui/label.d.ts +10 -0
- package/dist/components-v2/ui/label.js +70 -0
- package/dist/components-v2/ui/popover.d.ts +9 -0
- package/dist/components-v2/ui/popover.js +60 -0
- package/dist/components-v2/ui/progress.d.ts +12 -0
- package/dist/components-v2/ui/progress.js +75 -0
- package/dist/components-v2/ui/radio-group.d.ts +17 -0
- package/dist/components-v2/ui/radio-group.js +91 -0
- package/dist/components-v2/ui/select.d.ts +24 -0
- package/dist/components-v2/ui/select.js +122 -0
- package/dist/components-v2/ui/separator.d.ts +5 -0
- package/dist/components-v2/ui/separator.js +55 -0
- package/dist/components-v2/ui/skeleton.d.ts +9 -0
- package/dist/components-v2/ui/skeleton.js +68 -0
- package/dist/components-v2/ui/spinner.d.ts +16 -0
- package/dist/components-v2/ui/spinner.js +64 -0
- package/dist/components-v2/ui/switch.d.ts +10 -0
- package/dist/components-v2/ui/switch.js +81 -0
- package/dist/components-v2/ui/tabs.d.ts +13 -0
- package/dist/components-v2/ui/tabs.js +95 -0
- package/dist/components-v2/ui/textarea.d.ts +10 -0
- package/dist/components-v2/ui/textarea.js +96 -0
- package/dist/components-v2/ui/tooltip.d.ts +17 -0
- package/dist/components-v2/ui/tooltip.js +75 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/theme-v2/ThemeProvider.d.ts +19 -0
- package/dist/theme-v2/ThemeProvider.js +149 -0
- package/dist/theme-v2/dark.css +47 -0
- package/dist/theme-v2/tokens.css +72 -0
- package/package.json +2 -2
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -41,46 +52,46 @@ var react_1 = __importStar(require("react"));
|
|
|
41
52
|
var react_2 = require("@chakra-ui/react");
|
|
42
53
|
var react_3 = require("@chakra-ui/react");
|
|
43
54
|
var framer_motion_1 = require("framer-motion");
|
|
44
|
-
var LeftFilterPane_1 = __importDefault(require("./LeftFilterPane"));
|
|
45
|
-
var Pagination_1 = __importDefault(require("./
|
|
46
|
-
var TableHeader_1 = __importDefault(require("./
|
|
47
|
-
var TableBody_1 = __importDefault(require("./
|
|
55
|
+
var LeftFilterPane_1 = __importDefault(require("./filters/LeftFilterPane"));
|
|
56
|
+
var Pagination_1 = __importDefault(require("./components/Pagination"));
|
|
57
|
+
var TableHeader_1 = __importDefault(require("./components/TableHeader"));
|
|
58
|
+
var TableBody_1 = __importDefault(require("./components/TableBody"));
|
|
48
59
|
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
49
|
-
var useTable_1 = __importDefault(require("./
|
|
60
|
+
var useTable_1 = __importDefault(require("./hooks/useTable"));
|
|
50
61
|
var table_1 = require("../../Utils/table");
|
|
51
62
|
var usePreferences_1 = require("../../Hooks/usePreferences");
|
|
52
|
-
var TableSettings_1 = __importDefault(require("./
|
|
53
|
-
var HeaderActions_1 = __importDefault(require("./
|
|
63
|
+
var TableSettings_1 = __importDefault(require("./settings/TableSettings"));
|
|
64
|
+
var HeaderActions_1 = __importDefault(require("./components/HeaderActions"));
|
|
54
65
|
var Divider_1 = __importDefault(require("../Divider/Divider"));
|
|
55
|
-
var TableSearch_1 = __importDefault(require("./
|
|
56
|
-
var ActiveFilters_1 = __importDefault(require("./
|
|
66
|
+
var TableSearch_1 = __importDefault(require("./components/TableSearch"));
|
|
67
|
+
var ActiveFilters_1 = __importDefault(require("./filters/ActiveFilters"));
|
|
57
68
|
var lucide_react_1 = require("lucide-react");
|
|
58
69
|
var MotionBox = (0, framer_motion_1.motion)(react_2.Box);
|
|
59
70
|
function Table(_a) {
|
|
60
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
61
|
-
var data = _a.data, columns = _a.columns, onSelection = _a.onSelection, isLoading = _a.isLoading,
|
|
71
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
72
|
+
var data = _a.data, columns = _a.columns, onSelection = _a.onSelection, isLoading = _a.isLoading, _9 = _a.isCheckbox, isCheckbox = _9 === void 0 ? false : _9, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, tableBorderColor = _a.tableBorderColor, _10 = _a.noBorders, noBorders = _10 === void 0 ? false : _10, _11 = _a.isPagination, isPagination = _11 === void 0 ? true : _11, onRowClick = _a.onRowClick, selections = _a.selections, _12 = _a.isActionFreeze, isActionFreeze = _12 === void 0 ? true : _12, _13 = _a.preferences, preferences = _13 === void 0 ? {
|
|
62
73
|
url: "",
|
|
63
74
|
token: "",
|
|
64
75
|
key: "",
|
|
65
76
|
name: "",
|
|
66
77
|
page: "",
|
|
67
78
|
orgId: "",
|
|
68
|
-
} :
|
|
79
|
+
} : _13, _14 = _a.paginationMode, paginationMode = _14 === void 0 ? "client" : _14, _15 = _a.infiniteScroll, infiniteScroll = _15 === void 0 ? false : _15, hasMore = _a.hasMore, _16 = _a.isLoadingMore, isLoadingMore = _16 === void 0 ? false : _16, _17 = _a.noOfRowsPerPage, noOfRowsPerPage = _17 === void 0 ? 50 : _17, _18 = _a.totalRecords, totalRecords = _18 === void 0 ? 0 : _18, onPagination = _a.onPagination, _19 = _a.isTableSettings, isTableSettings = _19 === void 0 ? false : _19, headerActions = _a.headerActions, onGlobalSearch = _a.onGlobalSearch, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange, paginationSelectOptions = _a.paginationSelectOptions, tableMaxHeight = _a.tableMaxHeight, minVisibleRows = _a.minVisibleRows, maxVisibleRows = _a.maxVisibleRows, autoFitViewport = _a.autoFitViewport, tableSettings = _a.tableSettings, filterSidebar = _a.filterSidebar, loadingSkeletonRows = _a.loadingSkeletonRows, defaultVisibleColumns = _a.defaultVisibleColumns, _20 = _a.density, density = _20 === void 0 ? "normal" : _20, stripe = _a.stripe, groupBy = _a.groupBy, groupColors = _a.groupColors, onAddItem = _a.onAddItem, emptyState = _a.emptyState;
|
|
69
80
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
70
|
-
var
|
|
81
|
+
var _21 = (0, react_1.useState)({}), columnsSearch = _21[0], setColumnsSearch = _21[1];
|
|
71
82
|
var tableContainerRef = (0, react_1.useRef)(null);
|
|
72
|
-
var
|
|
83
|
+
var _22 = (0, react_2.useDisclosure)(), isFilterModalOpen = _22.isOpen, onFilterModalOpen = _22.onOpen, onFilterModalClose = _22.onClose;
|
|
73
84
|
var filterMode = (_b = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.filterMode) !== null && _b !== void 0 ? _b : "sidebar";
|
|
74
|
-
var
|
|
85
|
+
var _23 = (0, react_1.useState)(500), viewportAvailableH = _23[0], setViewportAvailableH = _23[1];
|
|
75
86
|
var isServerPagination = paginationMode === "server";
|
|
76
|
-
var
|
|
87
|
+
var _24 = (0, usePreferences_1.useGetPreferences)({
|
|
77
88
|
baseUrl: preferences.url,
|
|
78
89
|
page: preferences.page,
|
|
79
90
|
key: preferences.key,
|
|
80
91
|
name: preferences.name,
|
|
81
92
|
authToken: preferences.token,
|
|
82
93
|
orgId: preferences.orgId,
|
|
83
|
-
}), tablePreferencesData =
|
|
94
|
+
}), tablePreferencesData = _24.preferences, loading = _24.loading;
|
|
84
95
|
var savePreferences = (0, usePreferences_1.useSavePreferences)({
|
|
85
96
|
baseUrl: preferences.url,
|
|
86
97
|
page: preferences.page,
|
|
@@ -98,7 +109,7 @@ function Table(_a) {
|
|
|
98
109
|
}
|
|
99
110
|
return {};
|
|
100
111
|
}, [tablePreferencesData]);
|
|
101
|
-
var
|
|
112
|
+
var _25 = (0, useTable_1.default)({
|
|
102
113
|
tableBorderColor: tableBorderColor,
|
|
103
114
|
data: data,
|
|
104
115
|
isPagination: isPagination,
|
|
@@ -112,10 +123,37 @@ function Table(_a) {
|
|
|
112
123
|
isServerPagination: isServerPagination,
|
|
113
124
|
onNoOfRowsPerPageChange: onNoOfRowsPerPageChange,
|
|
114
125
|
defaultVisibleColumns: defaultVisibleColumns,
|
|
115
|
-
}), tableData =
|
|
126
|
+
}), tableData = _25.tableData, isContent = _25.isContent, isLink = _25.isLink, headerRefs = _25.headerRefs, columnWidths = _25.columnWidths, handleSort = _25.handleSort, handleCheckbox = _25.handleCheckbox, filteredData = _25.filteredData, startRow = _25.startRow, endRow = _25.endRow, selection = _25.selection, columnsSort = _25.columnsSort, currentPage = _25.currentPage, pages = _25.pages, rowsPerPage = _25.rowsPerPage, handlePageSizeChange = _25.handlePageSizeChange, setCurrentPage = _25.setCurrentPage, columnsList = _25.columnsList, handleColumnPreferences = _25.handleColumnPreferences, isSelecting = _25.isSelecting;
|
|
127
|
+
// Density is managed here so the Table Settings tab can change + persist it
|
|
128
|
+
// (seeded from the prop, then from saved preferences when they load).
|
|
129
|
+
var _26 = (0, react_1.useState)(density), densityState = _26[0], setDensityState = _26[1];
|
|
130
|
+
(0, react_1.useEffect)(function () {
|
|
131
|
+
if (tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.density)
|
|
132
|
+
setDensityState(tablePreferences.density);
|
|
133
|
+
}, [tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.density]);
|
|
134
|
+
var handleDensityChange = function (d) {
|
|
135
|
+
setDensityState(d);
|
|
136
|
+
savePreferences === null || savePreferences === void 0 ? void 0 : savePreferences(__assign(__assign({}, tablePreferences), { columns: columnsList, density: d }));
|
|
137
|
+
};
|
|
116
138
|
var _filteredData = (0, react_1.useMemo)(function () {
|
|
117
139
|
return (0, table_1.searchAndSortData)(filteredData, columnsSearch);
|
|
118
140
|
}, [columnsSearch, filteredData]);
|
|
141
|
+
// --- Monday-style grouping (client-side). When active, pagination is hidden
|
|
142
|
+
// and the body renders colored, collapsible groups over the full dataset. ---
|
|
143
|
+
var isGrouped = !!groupBy && !isServerPagination;
|
|
144
|
+
// Infinite scroll (server mode, not grouped): load more on scroll-near-bottom.
|
|
145
|
+
var canInfinite = infiniteScroll && !isGrouped;
|
|
146
|
+
var groupPalette = (0, react_1.useMemo)(function () { return (0, table_1.buildTablePalette)(theme); }, [theme]);
|
|
147
|
+
var groupedSource = (0, react_1.useMemo)(function () {
|
|
148
|
+
if (!isGrouped)
|
|
149
|
+
return [];
|
|
150
|
+
return (0, table_1.searchAndSortData)((0, table_1.SortMultiColumnData)(tableData, columnsSort), columnsSearch);
|
|
151
|
+
}, [isGrouped, tableData, columnsSort, columnsSearch]);
|
|
152
|
+
var renderGroups = (0, react_1.useMemo)(function () {
|
|
153
|
+
if (!isGrouped)
|
|
154
|
+
return undefined;
|
|
155
|
+
return (0, table_1.groupRows)(groupedSource, groupBy).map(function (g) { return (__assign(__assign({}, g), { color: (0, table_1.pickTableColor)(g.value, groupPalette, groupColors === null || groupColors === void 0 ? void 0 : groupColors[g.value]) })); });
|
|
156
|
+
}, [isGrouped, groupedSource, groupBy, groupPalette, groupColors]);
|
|
119
157
|
var onPaginationRef = (0, react_1.useRef)(onPagination);
|
|
120
158
|
onPaginationRef.current = onPagination;
|
|
121
159
|
var prevPageRef = (0, react_1.useRef)(currentPage);
|
|
@@ -147,7 +185,10 @@ function Table(_a) {
|
|
|
147
185
|
: "".concat(startRow + 1, " - ").concat(endRow > tableData.length ? tableData.length : endRow, " of ").concat(tableData.length); }, [startRow, rowsPerPage, totalRecords, endRow, tableData.length]);
|
|
148
186
|
var controlsHeight = 45;
|
|
149
187
|
var estimatedRowHeight = 45;
|
|
150
|
-
|
|
188
|
+
// In grouped mode the rendered rows come from the full grouped source, not the
|
|
189
|
+
// paged slice — base the height on that so a 1-result search isn't clipped.
|
|
190
|
+
var actualRows = isGrouped ? groupedSource.length : _filteredData.length;
|
|
191
|
+
var isEmptyState = !isTableLoading && actualRows === 0;
|
|
151
192
|
var loadingRowsCount = typeof loadingSkeletonRows === "number" ? Math.max(1, loadingSkeletonRows) : 4;
|
|
152
193
|
var minRows = typeof minVisibleRows === "number"
|
|
153
194
|
? Math.max(0, minVisibleRows)
|
|
@@ -171,13 +212,46 @@ function Table(_a) {
|
|
|
171
212
|
return function () { return window.removeEventListener("resize", compute); };
|
|
172
213
|
}, [autoFitViewport]);
|
|
173
214
|
var heightRowsCount = isTableLoading ? loadingRowsCount : visibleRowsCount;
|
|
174
|
-
var isCompactRows = heightRowsCount <= 1 && !(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar);
|
|
175
|
-
var rowsHeight =
|
|
215
|
+
var isCompactRows = heightRowsCount <= 1 && !(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) && !isGrouped && !isEmptyState;
|
|
216
|
+
var rowsHeight = heightRowsCount * estimatedRowHeight + estimatedRowHeight;
|
|
217
|
+
if (isGrouped)
|
|
218
|
+
rowsHeight += ((_c = renderGroups === null || renderGroups === void 0 ? void 0 : renderGroups.length) !== null && _c !== void 0 ? _c : 1) * 42; // group header rows
|
|
219
|
+
if (isEmptyState)
|
|
220
|
+
rowsHeight = Math.max(rowsHeight, 200); // room for the empty state
|
|
176
221
|
var dynamicMaxH = Math.min(500, rowsHeight);
|
|
177
222
|
var fittedMaxH = autoFitViewport ? Math.min(dynamicMaxH, viewportAvailableH) : dynamicMaxH;
|
|
178
223
|
var tableMaxH = typeof tableMaxHeight === "number" ? tableMaxHeight : (isCompactRows ? rowsHeight + 8 : fittedMaxH);
|
|
179
224
|
var isCompactHeader = (0, react_2.useBreakpointValue)({ base: true, md: true, lg: false });
|
|
180
225
|
var compactScrollbarPadding = isCompactRows ? 4 : 0;
|
|
226
|
+
// Infinite scroll: reuse onPagination("next") when scrolled near the bottom.
|
|
227
|
+
var infiniteRef = (0, react_1.useRef)({ isLoadingMore: isLoadingMore, isTableLoading: isTableLoading, hasMore: hasMore, rowsPerPage: rowsPerPage, dataLen: tableData.length, lastRecord: tableData[tableData.length - 1], totalRecords: totalRecords, isServerPagination: isServerPagination });
|
|
228
|
+
infiniteRef.current = { isLoadingMore: isLoadingMore, isTableLoading: isTableLoading, hasMore: hasMore, rowsPerPage: rowsPerPage, dataLen: tableData.length, lastRecord: tableData[tableData.length - 1], totalRecords: totalRecords, isServerPagination: isServerPagination };
|
|
229
|
+
(0, react_1.useEffect)(function () {
|
|
230
|
+
if (!canInfinite)
|
|
231
|
+
return;
|
|
232
|
+
var el = tableContainerRef.current;
|
|
233
|
+
if (!el)
|
|
234
|
+
return;
|
|
235
|
+
var onScroll = function () {
|
|
236
|
+
var _a;
|
|
237
|
+
var s = infiniteRef.current;
|
|
238
|
+
if (s.isLoadingMore || s.isTableLoading)
|
|
239
|
+
return;
|
|
240
|
+
var more = typeof s.hasMore === "boolean"
|
|
241
|
+
? s.hasMore
|
|
242
|
+
: s.isServerPagination
|
|
243
|
+
? s.dataLen < s.totalRecords
|
|
244
|
+
: false;
|
|
245
|
+
if (!more)
|
|
246
|
+
return;
|
|
247
|
+
if (el.scrollHeight - el.scrollTop - el.clientHeight < 160) {
|
|
248
|
+
var nextPage = Math.floor(s.dataLen / (s.rowsPerPage || 1)) + 1;
|
|
249
|
+
(_a = onPaginationRef.current) === null || _a === void 0 ? void 0 : _a.call(onPaginationRef, nextPage, s.rowsPerPage, s.lastRecord, "next");
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
el.addEventListener("scroll", onScroll, { passive: true });
|
|
253
|
+
return function () { return el.removeEventListener("scroll", onScroll); };
|
|
254
|
+
}, [canInfinite]);
|
|
181
255
|
var sidebarActiveCount = (0, react_1.useMemo)(function () {
|
|
182
256
|
if (!(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected))
|
|
183
257
|
return 0;
|
|
@@ -188,22 +262,22 @@ function Table(_a) {
|
|
|
188
262
|
return acc + (Array.isArray(items) ? items.length : 0);
|
|
189
263
|
}, 0);
|
|
190
264
|
}, [filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected]);
|
|
191
|
-
return (react_1.default.createElement(react_2.Box, { bg: (
|
|
265
|
+
return (react_1.default.createElement(react_2.Box, { bg: (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e[50], border: "0.063rem solid ".concat((_f = theme.colors.border) === null || _f === void 0 ? void 0 : _f[500]), borderRadius: 3 },
|
|
192
266
|
filterSidebar && filterMode === "modal" && (react_1.default.createElement(react_2.Modal, { isOpen: isFilterModalOpen, onClose: onFilterModalClose, size: "4xl", scrollBehavior: "inside" },
|
|
193
267
|
react_1.default.createElement(react_2.ModalOverlay, null),
|
|
194
268
|
react_1.default.createElement(react_2.ModalContent, { my: 0, top: "10%", position: "fixed", left: "auto", right: "auto" },
|
|
195
269
|
react_1.default.createElement(react_2.ModalCloseButton, { size: "sm" }),
|
|
196
270
|
react_1.default.createElement(react_2.ModalBody, { p: 0 },
|
|
197
|
-
react_1.default.createElement(LeftFilterPane_1.default, { theme: theme, sections: (
|
|
271
|
+
react_1.default.createElement(LeftFilterPane_1.default, { theme: theme, sections: (_g = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _g !== void 0 ? _g : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: function (sel) { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, sel); onFilterModalClose(); }, onClear: function () { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) === null || _a === void 0 ? void 0 : _a.call(filterSidebar); }, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }))))),
|
|
198
272
|
react_1.default.createElement(react_2.Flex, { align: "start" },
|
|
199
|
-
filterMode === "sidebar" && (react_1.default.createElement(MotionBox, { initial: { width: 0 }, animate: { width: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? 180 : 0 }, transition: { type: "tween", duration: 0.5 }, overflow: "hidden", flexShrink: 0, borderRight: "1px solid", borderColor: (
|
|
200
|
-
react_1.default.createElement(LeftFilterPane_1.default, { height: controlsHeight + tableMaxH, theme: theme, sections: (
|
|
273
|
+
filterMode === "sidebar" && (react_1.default.createElement(MotionBox, { initial: { width: 0 }, animate: { width: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? 180 : 0 }, transition: { type: "tween", duration: 0.5 }, overflow: "hidden", flexShrink: 0, borderRight: "1px solid", borderColor: (_h = theme.colors.border) === null || _h === void 0 ? void 0 : _h[500], style: { height: controlsHeight + tableMaxH }, minHeight: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? "32rem" : "auto" },
|
|
274
|
+
react_1.default.createElement(LeftFilterPane_1.default, { height: controlsHeight + tableMaxH, theme: theme, sections: (_j = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _j !== void 0 ? _j : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply, onClear: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }))),
|
|
201
275
|
react_1.default.createElement(react_2.Box, { flex: "1", minW: 0 },
|
|
202
|
-
react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 0, height: controlsHeight, gap:
|
|
276
|
+
react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 0, height: controlsHeight, gap: 3, flexWrap: "nowrap", bg: (_l = (_k = theme.colors) === null || _k === void 0 ? void 0 : _k.background) === null || _l === void 0 ? void 0 : _l[50], borderBottom: "0.063rem solid ".concat((_m = theme.colors.border) === null || _m === void 0 ? void 0 : _m[500]) },
|
|
203
277
|
filterSidebar && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
204
278
|
react_1.default.createElement(react_2.Box, { position: "relative", display: "inline-block" },
|
|
205
|
-
react_1.default.createElement(react_3.Icon, { as: lucide_react_1.Filter, transform: "scaleX(-1)", cursor: "pointer", boxSize: 4, color: sidebarActiveCount > 0 ? (
|
|
206
|
-
sidebarActiveCount > 0 && (react_1.default.createElement(react_2.Box, { position: "absolute", top: "-6px", right: "-10px", bg: (
|
|
279
|
+
react_1.default.createElement(react_3.Icon, { as: lucide_react_1.Filter, transform: "scaleX(-1)", cursor: "pointer", boxSize: 4, color: sidebarActiveCount > 0 ? (_p = (_o = theme.colors) === null || _o === void 0 ? void 0 : _o.primary) === null || _p === void 0 ? void 0 : _p[500] : (_r = (_q = theme.colors) === null || _q === void 0 ? void 0 : _q.text) === null || _r === void 0 ? void 0 : _r[500], onClick: filterMode === "modal" ? onFilterModalOpen : filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.filterSidebarToggle }),
|
|
280
|
+
sidebarActiveCount > 0 && (react_1.default.createElement(react_2.Box, { position: "absolute", top: "-6px", right: "-10px", bg: (_t = (_s = theme.colors) === null || _s === void 0 ? void 0 : _s.primary) === null || _t === void 0 ? void 0 : _t[500], color: "white", borderRadius: "full", p: "1px", cursor: "pointer", onClick: function (e) {
|
|
207
281
|
var _a;
|
|
208
282
|
e.stopPropagation();
|
|
209
283
|
if (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) {
|
|
@@ -212,23 +286,23 @@ function Table(_a) {
|
|
|
212
286
|
else {
|
|
213
287
|
(_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, {});
|
|
214
288
|
}
|
|
215
|
-
}, _hover: { bg: (
|
|
289
|
+
}, _hover: { bg: (_v = (_u = theme.colors) === null || _u === void 0 ? void 0 : _u.red) === null || _v === void 0 ? void 0 : _v[600] }, display: "flex", alignItems: "center", justifyContent: "center", zIndex: 2 },
|
|
216
290
|
react_1.default.createElement(lucide_react_1.X, { size: 10, strokeWidth: 3 })))),
|
|
217
291
|
react_1.default.createElement(Divider_1.default, null))),
|
|
218
292
|
react_1.default.createElement(TableSearch_1.default, { onSearch: onGlobalSearch }),
|
|
219
293
|
isTableSettings && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
220
294
|
react_1.default.createElement(Divider_1.default, null),
|
|
221
|
-
react_1.default.createElement(TableSettings_1.default, { columns: columnsList, onSave: function (cols) { return handleColumnPreferences(cols); }, tableSettings: tableSettings }))),
|
|
295
|
+
react_1.default.createElement(TableSettings_1.default, { columns: columnsList, onSave: function (cols) { return handleColumnPreferences(cols); }, tableSettings: tableSettings, density: densityState, onDensityChange: handleDensityChange }))),
|
|
222
296
|
headerActions && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
223
297
|
react_1.default.createElement(Divider_1.default, null),
|
|
224
298
|
react_1.default.createElement(HeaderActions_1.default, { actions: headerActions, selections: selection }))),
|
|
225
299
|
react_1.default.createElement(ActiveFilters_1.default, { columns: columnsList, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch }),
|
|
226
300
|
react_1.default.createElement(react_2.Box, { ml: "auto", display: "flex", alignItems: "center", gap: 2 },
|
|
227
|
-
(isPagination || isServerPagination) && !isCompactHeader && (react_1.default.createElement(react_2.Box, { flex: "0 0 auto" },
|
|
301
|
+
(isPagination || isServerPagination) && !isGrouped && !canInfinite && !isCompactHeader && (react_1.default.createElement(react_2.Box, { flex: "0 0 auto" },
|
|
228
302
|
react_1.default.createElement(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }))),
|
|
229
|
-
(isPagination || isServerPagination) && isCompactHeader && tableData.length > 0 && (react_1.default.createElement(react_2.Popover, { placement: "bottom-end" },
|
|
303
|
+
(isPagination || isServerPagination) && !isGrouped && !canInfinite && isCompactHeader && tableData.length > 0 && (react_1.default.createElement(react_2.Popover, { placement: "bottom-end" },
|
|
230
304
|
react_1.default.createElement(react_2.PopoverTrigger, null,
|
|
231
|
-
react_1.default.createElement(react_2.IconButton, { "aria-label": "More", size: "sm", variant: "ghost", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 18, color: (
|
|
305
|
+
react_1.default.createElement(react_2.IconButton, { "aria-label": "More", size: "sm", variant: "ghost", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 18, color: (_x = (_w = theme.colors) === null || _w === void 0 ? void 0 : _w.text) === null || _x === void 0 ? void 0 : _x[500] }) })),
|
|
232
306
|
react_1.default.createElement(react_2.PopoverContent, { maxW: "22rem", p: 2, overflow: "hidden" },
|
|
233
307
|
react_1.default.createElement(react_2.PopoverBody, { p: 0 },
|
|
234
308
|
react_1.default.createElement(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }))))))),
|
|
@@ -259,7 +333,11 @@ function Table(_a) {
|
|
|
259
333
|
} },
|
|
260
334
|
react_1.default.createElement(react_3.Table, { variant: "simple", size: "sm", minW: "100%", className: "table_wrapper", sx: {
|
|
261
335
|
width: "100%",
|
|
262
|
-
|
|
336
|
+
// `separate` (not `collapse`) so sticky header cells paint an opaque
|
|
337
|
+
// background over their borders — collapsed borders bleed scrolling
|
|
338
|
+
// content through the seams.
|
|
339
|
+
borderCollapse: "separate",
|
|
340
|
+
borderSpacing: 0,
|
|
263
341
|
"th .resize-handle": {
|
|
264
342
|
position: "absolute",
|
|
265
343
|
top: 0,
|
|
@@ -271,12 +349,15 @@ function Table(_a) {
|
|
|
271
349
|
zIndex: 999,
|
|
272
350
|
},
|
|
273
351
|
} },
|
|
274
|
-
react_1.default.createElement(react_3.Thead, { position: "sticky", top: 0, zIndex: 4 },
|
|
275
|
-
react_1.default.createElement(TableHeader_1.default, { columns: columnsList, isCheckbox: isCheckbox, headerBgColor: headerBgColor !== null && headerBgColor !== void 0 ? headerBgColor : theme.colors.backgroundColor.muted, headerTextColor: headerTextColor !== null && headerTextColor !== void 0 ? headerTextColor : (
|
|
352
|
+
react_1.default.createElement(react_3.Thead, { position: "sticky", top: 0, zIndex: 4, bg: (_0 = (_z = (_y = theme.colors.table) === null || _y === void 0 ? void 0 : _y.hover) === null || _z === void 0 ? void 0 : _z[200]) !== null && _0 !== void 0 ? _0 : (_1 = theme.colors.secondary) === null || _1 === void 0 ? void 0 : _1[50] },
|
|
353
|
+
react_1.default.createElement(TableHeader_1.default, { columns: columnsList, isCheckbox: isCheckbox, headerBgColor: headerBgColor !== null && headerBgColor !== void 0 ? headerBgColor : theme.colors.backgroundColor.muted, headerTextColor: headerTextColor !== null && headerTextColor !== void 0 ? headerTextColor : (_2 = theme.colors) === null || _2 === void 0 ? void 0 : _2.gray[600], freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_3 = theme.colors) === null || _3 === void 0 ? void 0 : _3.gray[600], handleSort: handleSort, headerRefs: headerRefs, columnWidths: columnWidths, columnsSort: columnsSort, noBorders: noBorders, handleCheckbox: handleCheckbox, isLoading: isTableLoading, checked: tableData.length !== 0 && selection.length === tableData.length
|
|
276
354
|
? true
|
|
277
355
|
: selection.length === 0
|
|
278
356
|
? false
|
|
279
357
|
: "indeterminate", isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, setColumnsSearch: setColumnsSearch, columnsSearch: columnsSearch, isSelecting: isSelecting })),
|
|
280
358
|
react_1.default.createElement(react_3.Tbody, null,
|
|
281
|
-
react_1.default.createElement(TableBody_1.default, { data: _filteredData, columns: columnsList, startRow: startRow, endRow: endRow, scrollContainerRef: tableContainerRef, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (
|
|
359
|
+
react_1.default.createElement(TableBody_1.default, { data: isGrouped ? groupedSource : _filteredData, groups: renderGroups, onAddItem: onAddItem, columns: columnsList, startRow: isGrouped ? 0 : startRow, endRow: endRow, scrollContainerRef: tableContainerRef, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_4 = theme.colors) === null || _4 === void 0 ? void 0 : _4.gray[600], handleCheckbox: handleCheckbox, selections: selection, isLoading: isTableLoading, loadingSkeletonRows: loadingSkeletonRows, onRowClick: onRowClick, isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, density: densityState, stripe: stripe, emptyState: emptyState }))),
|
|
360
|
+
canInfinite && isLoadingMore && (react_1.default.createElement(react_2.Flex, { justify: "center", align: "center", py: 3, gap: 2 },
|
|
361
|
+
react_1.default.createElement(react_2.Spinner, { size: "sm", color: (_6 = (_5 = theme.colors) === null || _5 === void 0 ? void 0 : _5.primary) === null || _6 === void 0 ? void 0 : _6[500] }),
|
|
362
|
+
react_1.default.createElement(react_2.Box, { fontSize: "0.75rem", color: (_8 = (_7 = theme.colors) === null || _7 === void 0 ? void 0 : _7.text) === null || _8 === void 0 ? void 0 : _8[500] }, "Loading more\u2026"))))))));
|
|
282
363
|
}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
1
|
+
import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from "react";
|
|
2
2
|
import { FilterSidebarProps } from "../FilterSidebar/FilterSidebar";
|
|
3
|
+
export type TableDensity = "compact" | "normal" | "comfortable";
|
|
4
|
+
export type TableEmptyState = {
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
};
|
|
3
9
|
export type TableProps = {
|
|
4
10
|
data: DataObject[];
|
|
5
11
|
columns: TableHeaderProps[];
|
|
12
|
+
groupBy?: string | number;
|
|
13
|
+
groupColors?: Record<string | number, string>;
|
|
14
|
+
onAddItem?: (groupValue: string | number) => void;
|
|
15
|
+
density?: TableDensity;
|
|
16
|
+
stripe?: boolean;
|
|
17
|
+
emptyState?: TableEmptyState | ReactNode;
|
|
6
18
|
handleExportChange?: (value: string) => void | undefined;
|
|
7
19
|
exportOptions?: ExportOption[];
|
|
8
20
|
exportLabel?: string;
|
|
@@ -21,6 +33,9 @@ export type TableProps = {
|
|
|
21
33
|
onRowClick?: (row: DataObject, header: Record<string | number, string | number>) => void;
|
|
22
34
|
isActionFreeze?: boolean;
|
|
23
35
|
paginationMode?: "client" | "server";
|
|
36
|
+
infiniteScroll?: boolean;
|
|
37
|
+
hasMore?: boolean;
|
|
38
|
+
isLoadingMore?: boolean;
|
|
24
39
|
noOfRowsPerPage?: number;
|
|
25
40
|
totalRecords?: number;
|
|
26
41
|
onPagination?: (page: number, noOfRecords: number, record: DataObject | undefined, direction: "next" | "prev" | "first" | "last") => void;
|
|
@@ -88,6 +103,8 @@ export type TableHeaderProps = {
|
|
|
88
103
|
isSearch?: boolean;
|
|
89
104
|
isFreeze?: boolean;
|
|
90
105
|
isHidden?: boolean;
|
|
106
|
+
type?: "status";
|
|
107
|
+
statusColors?: Record<string, string>;
|
|
91
108
|
node?: (data: DataObject) => JSX.Element | string | number | undefined;
|
|
92
109
|
};
|
|
93
110
|
export type ExportOption = {
|
|
@@ -116,7 +133,7 @@ export type TableHeaderPageProps = Pick<TableProps, "columns" | "isCheckbox" | "
|
|
|
116
133
|
columnsSearch: Record<string, string>;
|
|
117
134
|
isSelecting?: boolean;
|
|
118
135
|
};
|
|
119
|
-
export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "data" | "freezedBgColor" | "freezedTextColor" | "noBorders" | "isLoading" | "loadingSkeletonRows" | "onRowClick" | "isActionFreeze"> & {
|
|
136
|
+
export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "data" | "freezedBgColor" | "freezedTextColor" | "noBorders" | "isLoading" | "loadingSkeletonRows" | "onRowClick" | "isActionFreeze" | "density" | "stripe" | "emptyState"> & {
|
|
120
137
|
startRow: number;
|
|
121
138
|
endRow: number;
|
|
122
139
|
columnWidths: number[];
|
|
@@ -125,6 +142,21 @@ export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "da
|
|
|
125
142
|
isContent: boolean;
|
|
126
143
|
isLink: boolean;
|
|
127
144
|
scrollContainerRef?: MutableRefObject<HTMLDivElement | null>;
|
|
145
|
+
/** Optional per-row id → accent color (Monday group stripe). */
|
|
146
|
+
accentColors?: Record<string | number, string>;
|
|
147
|
+
/** When provided, the body renders as a grouped (Monday) board instead of a flat list. */
|
|
148
|
+
groups?: TableRenderGroup[];
|
|
149
|
+
onAddItem?: (groupValue: string | number) => void;
|
|
150
|
+
};
|
|
151
|
+
export type TableRenderGroup = {
|
|
152
|
+
value: string | number;
|
|
153
|
+
label: string;
|
|
154
|
+
color: {
|
|
155
|
+
solid: string;
|
|
156
|
+
soft: string;
|
|
157
|
+
text: string;
|
|
158
|
+
};
|
|
159
|
+
rows: DataObject[];
|
|
128
160
|
};
|
|
129
161
|
export type TableFiltersProps = {
|
|
130
162
|
header: DataObject;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableHeaderProps } from "../TableProps";
|
|
3
|
+
interface ActiveFiltersProps {
|
|
4
|
+
columns: TableHeaderProps[];
|
|
5
|
+
columnsSearch: Record<string, string>;
|
|
6
|
+
setColumnsSearch: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
7
|
+
}
|
|
8
|
+
declare const ActiveFilters: React.FC<ActiveFiltersProps>;
|
|
9
|
+
export default ActiveFilters;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
var react_1 = __importStar(require("react"));
|
|
51
|
+
var react_2 = require("@chakra-ui/react");
|
|
52
|
+
var lucide_react_1 = require("lucide-react");
|
|
53
|
+
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
54
|
+
var Divider_1 = __importDefault(require("../../Divider/Divider"));
|
|
55
|
+
var ActiveFilters = react_1.default.memo(function (_a) {
|
|
56
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
57
|
+
var columns = _a.columns, columnsSearch = _a.columnsSearch, setColumnsSearch = _a.setColumnsSearch;
|
|
58
|
+
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
59
|
+
var columnLabelMap = (0, react_1.useMemo)(function () {
|
|
60
|
+
var map = new Map();
|
|
61
|
+
for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
|
|
62
|
+
var col = columns_1[_i];
|
|
63
|
+
map.set(col.id, col.label);
|
|
64
|
+
}
|
|
65
|
+
return map;
|
|
66
|
+
}, [columns]);
|
|
67
|
+
var activeFilters = (0, react_1.useMemo)(function () {
|
|
68
|
+
return Object.entries(columnsSearch)
|
|
69
|
+
.filter(function (_a) {
|
|
70
|
+
var _ = _a[0], value = _a[1];
|
|
71
|
+
return value && value.trim() !== "";
|
|
72
|
+
})
|
|
73
|
+
.map(function (_a) {
|
|
74
|
+
var columnId = _a[0], value = _a[1];
|
|
75
|
+
return ({
|
|
76
|
+
columnId: columnId,
|
|
77
|
+
label: columnLabelMap.get(columnId) || columnId,
|
|
78
|
+
value: value.trim(),
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}, [columnsSearch, columnLabelMap]);
|
|
82
|
+
var handleRemoveFilter = (0, react_1.useCallback)(function (columnId) {
|
|
83
|
+
setColumnsSearch(function (prev) {
|
|
84
|
+
var newSearch = __assign({}, prev);
|
|
85
|
+
delete newSearch[columnId];
|
|
86
|
+
return newSearch;
|
|
87
|
+
});
|
|
88
|
+
}, [setColumnsSearch]);
|
|
89
|
+
var handleClearAll = (0, react_1.useCallback)(function () {
|
|
90
|
+
setColumnsSearch({});
|
|
91
|
+
}, [setColumnsSearch]);
|
|
92
|
+
if (activeFilters.length === 0) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
return (react_1.default.createElement(react_2.Box, { px: 2, py: 1, bg: ((_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.background) === null || _c === void 0 ? void 0 : _c[100]) || ((_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray) === null || _e === void 0 ? void 0 : _e[50]), overflowX: "auto", sx: {
|
|
96
|
+
'&::-webkit-scrollbar': {
|
|
97
|
+
height: '6px',
|
|
98
|
+
},
|
|
99
|
+
'&::-webkit-scrollbar-track': {
|
|
100
|
+
background: theme.colors.gray[100],
|
|
101
|
+
borderRadius: '3px',
|
|
102
|
+
},
|
|
103
|
+
'&::-webkit-scrollbar-thumb': {
|
|
104
|
+
background: theme.colors.gray[400],
|
|
105
|
+
borderRadius: '3px',
|
|
106
|
+
},
|
|
107
|
+
'&::-webkit-scrollbar-thumb:hover': {
|
|
108
|
+
background: theme.colors.gray[500],
|
|
109
|
+
},
|
|
110
|
+
scrollbarWidth: 'thin',
|
|
111
|
+
scrollbarColor: "".concat(theme.colors.gray[400], " ").concat(theme.colors.gray[100]),
|
|
112
|
+
} },
|
|
113
|
+
react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", gap: 2, flexWrap: "nowrap", minW: "max-content" },
|
|
114
|
+
activeFilters.length > 0 && react_1.default.createElement(Divider_1.default, null),
|
|
115
|
+
activeFilters.map(function (filter) {
|
|
116
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
117
|
+
return (react_1.default.createElement(react_2.Flex, { key: filter.columnId, alignItems: "center", gap: 1, px: 2, py: 1, bg: ((_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.blue) === null || _b === void 0 ? void 0 : _b[50]) || ((_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d[50]), borderRadius: "md", border: "0.063rem solid ".concat(((_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.blue) === null || _f === void 0 ? void 0 : _f[200]) || ((_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.primary) === null || _h === void 0 ? void 0 : _h[200])), flexShrink: 0 },
|
|
118
|
+
react_1.default.createElement(react_2.Text, { fontSize: "sm", color: (_k = (_j = theme.colors) === null || _j === void 0 ? void 0 : _j.gray) === null || _k === void 0 ? void 0 : _k[700], whiteSpace: "nowrap" },
|
|
119
|
+
react_1.default.createElement(react_2.Text, { as: "span", fontWeight: 600 },
|
|
120
|
+
filter.label,
|
|
121
|
+
":"),
|
|
122
|
+
" ",
|
|
123
|
+
filter.value),
|
|
124
|
+
react_1.default.createElement(react_2.IconButton, { "aria-label": "Remove filter for ".concat(filter.label), icon: react_1.default.createElement(lucide_react_1.X, { size: 14 }), size: "xs", variant: "ghost", onClick: function () { return handleRemoveFilter(filter.columnId); }, _hover: {
|
|
125
|
+
bg: ((_m = (_l = theme.colors) === null || _l === void 0 ? void 0 : _l.blue) === null || _m === void 0 ? void 0 : _m[100]) || ((_p = (_o = theme.colors) === null || _o === void 0 ? void 0 : _o.primary) === null || _p === void 0 ? void 0 : _p[100]),
|
|
126
|
+
}, minW: "auto", h: "auto", p: 0.5, flexShrink: 0 })));
|
|
127
|
+
}),
|
|
128
|
+
activeFilters.length > 1 && (react_1.default.createElement(react_2.Text, { as: "p", className: "clear-all-text", "aria-label": "Clear All", fontSize: "sm", color: ((_g = (_f = theme.colors) === null || _f === void 0 ? void 0 : _f.blue) === null || _g === void 0 ? void 0 : _g[600]) || ((_j = (_h = theme.colors) === null || _h === void 0 ? void 0 : _h.primary) === null || _j === void 0 ? void 0 : _j[600]), cursor: "pointer", fontWeight: 500, onClick: handleClearAll, _hover: {
|
|
129
|
+
textDecoration: "underline",
|
|
130
|
+
}, flexShrink: 0, whiteSpace: "nowrap" }, "Clear All")))));
|
|
131
|
+
});
|
|
132
|
+
exports.default = ActiveFilters;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type Options = {
|
|
3
|
+
id: string | number;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
type Props = {
|
|
7
|
+
options: Options[];
|
|
8
|
+
value?: Options;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
height?: string | number;
|
|
11
|
+
onSelect?: (option: Options) => void;
|
|
12
|
+
size?: "xs" | "sm";
|
|
13
|
+
};
|
|
14
|
+
declare const CompactSelect: React.FC<Props>;
|
|
15
|
+
export default CompactSelect;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
var react_1 = __importStar(require("react"));
|
|
37
|
+
var react_2 = require("@chakra-ui/react");
|
|
38
|
+
var lucide_react_1 = require("lucide-react");
|
|
39
|
+
var CompactSelect = function (_a) {
|
|
40
|
+
var options = _a.options, value = _a.value, _b = _a.placeholder, placeholder = _b === void 0 ? "Select" : _b, _c = _a.height, height = _c === void 0 ? "22px" : _c, onSelect = _a.onSelect, _d = _a.size, size = _d === void 0 ? "xs" : _d;
|
|
41
|
+
var _e = (0, react_1.useState)(false), isOpen = _e[0], setIsOpen = _e[1];
|
|
42
|
+
var _f = (0, react_1.useState)(""), query = _f[0], setQuery = _f[1];
|
|
43
|
+
var filtered = (0, react_1.useMemo)(function () {
|
|
44
|
+
var q = query.trim().toLowerCase();
|
|
45
|
+
if (!q)
|
|
46
|
+
return options;
|
|
47
|
+
return options.filter(function (o) { return (o.label || "").toLowerCase().includes(q); });
|
|
48
|
+
}, [query, options]);
|
|
49
|
+
return (react_1.default.createElement(react_2.Popover, { isOpen: isOpen, onClose: function () { return setIsOpen(false); }, placement: "bottom-start" },
|
|
50
|
+
react_1.default.createElement(react_2.PopoverTrigger, null,
|
|
51
|
+
react_1.default.createElement(react_2.Box, { as: "button", type: "button", w: "100%", h: typeof height === "number" ? "".concat(height, "px") : height, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, px: 2, border: "0.063rem solid", borderColor: "gray.300", bg: "white", borderRadius: "0.25rem", onClick: function () { return setIsOpen(function (prev) { return !prev; }); } },
|
|
52
|
+
react_1.default.createElement(react_2.Text, { fontSize: size === "xs" ? "0.75rem" : "0.875rem", color: "gray.800", noOfLines: 1, textAlign: "left" }, (value === null || value === void 0 ? void 0 : value.label) || placeholder),
|
|
53
|
+
isOpen ? react_1.default.createElement(lucide_react_1.ChevronUp, { size: 12 }) : react_1.default.createElement(lucide_react_1.ChevronDown, { size: 12 }))),
|
|
54
|
+
react_1.default.createElement(react_2.Portal, null,
|
|
55
|
+
react_1.default.createElement(react_2.PopoverContent, { w: "100%", maxW: "14rem", p: 0, zIndex: 1600 },
|
|
56
|
+
react_1.default.createElement(react_2.PopoverBody, { p: 2 },
|
|
57
|
+
react_1.default.createElement(react_2.VStack, { spacing: 2, align: "stretch" },
|
|
58
|
+
react_1.default.createElement(react_2.Input, { size: size, placeholder: "Search", value: query, onChange: function (e) { return setQuery(e.target.value); }, sx: { fontSize: "0.75rem", height: "22px" } }),
|
|
59
|
+
react_1.default.createElement(react_2.Box, { maxH: "12rem", overflowY: "auto", borderTop: "1px solid", borderColor: "gray.100" },
|
|
60
|
+
filtered.map(function (opt) { return (react_1.default.createElement(react_2.Box, { key: opt.id, px: 2, py: 1, cursor: "pointer", _hover: { bg: "gray.50" }, bg: (value === null || value === void 0 ? void 0 : value.id) === opt.id ? "gray.100" : "transparent", onClick: function () {
|
|
61
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(opt);
|
|
62
|
+
setIsOpen(false);
|
|
63
|
+
setQuery("");
|
|
64
|
+
} },
|
|
65
|
+
react_1.default.createElement(react_2.Text, { fontSize: "0.75rem" }, opt.label))); }),
|
|
66
|
+
filtered.length === 0 && (react_1.default.createElement(react_2.Box, { px: 2, py: 2 },
|
|
67
|
+
react_1.default.createElement(react_2.Text, { fontSize: "0.75rem", color: "gray.500" }, "No results"))))))))));
|
|
68
|
+
};
|
|
69
|
+
exports.default = CompactSelect;
|