pixelize-design-library 2.2.198 → 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/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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type FilterItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
type?: "text" | "select" | "user" | "date";
|
|
6
|
+
option?: {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
export type FilterSection = {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
items?: FilterItem[];
|
|
15
|
+
initiallyExpanded?: boolean;
|
|
16
|
+
radio?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type SelectedFilterItem = {
|
|
19
|
+
id: string;
|
|
20
|
+
condition?: string;
|
|
21
|
+
value?: any;
|
|
22
|
+
type?: "text" | "select" | "user" | "date";
|
|
23
|
+
};
|
|
24
|
+
export type LeftFilterPaneProps = {
|
|
25
|
+
title?: string;
|
|
26
|
+
height?: number | string;
|
|
27
|
+
sections: FilterSection[];
|
|
28
|
+
selected?: Record<string, any>;
|
|
29
|
+
onApply?: (selected: any) => void;
|
|
30
|
+
onClear?: () => void;
|
|
31
|
+
theme: any;
|
|
32
|
+
isApplyLoading?: boolean;
|
|
33
|
+
filterMode?: "sidebar" | "modal";
|
|
34
|
+
};
|
|
35
|
+
declare const LeftFilterPane: ({ title, height, sections, selected: selectedProp, onApply, onClear, theme, isApplyLoading, filterMode, }: LeftFilterPaneProps) => React.JSX.Element;
|
|
36
|
+
export default LeftFilterPane;
|
|
@@ -0,0 +1,273 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
47
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
48
|
+
if (ar || !(i in from)) {
|
|
49
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
50
|
+
ar[i] = from[i];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
54
|
+
};
|
|
55
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
56
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
+
var react_1 = __importStar(require("react"));
|
|
60
|
+
var react_2 = require("@chakra-ui/react");
|
|
61
|
+
var lucide_react_1 = require("lucide-react");
|
|
62
|
+
var framer_motion_1 = require("framer-motion");
|
|
63
|
+
var react_3 = require("@chakra-ui/react");
|
|
64
|
+
var Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
65
|
+
var RadioButton_1 = require("../../RadioButton/RadioButton");
|
|
66
|
+
var TextOperationControls_1 = require("./TextOperationControls");
|
|
67
|
+
var SelectOperationControls_1 = require("./SelectOperationControls");
|
|
68
|
+
var CompactSelect_1 = __importDefault(require("./CompactSelect"));
|
|
69
|
+
var DatePicker_1 = __importDefault(require("../../DatePicker/DatePicker"));
|
|
70
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
71
|
+
var LABEL_MAX_LENGTH = 18;
|
|
72
|
+
function formatHeaderLabel(label) {
|
|
73
|
+
var text = (label || "").trim();
|
|
74
|
+
if (text.length <= LABEL_MAX_LENGTH)
|
|
75
|
+
return text;
|
|
76
|
+
var parts = text.split(/\s+/);
|
|
77
|
+
if (parts.length < 2)
|
|
78
|
+
return text;
|
|
79
|
+
var removable = new Set(["filters", "fields", "modules", "status", "action"]);
|
|
80
|
+
if (removable.has(parts[parts.length - 1].toLowerCase())) {
|
|
81
|
+
parts = parts.slice(0, -1);
|
|
82
|
+
}
|
|
83
|
+
while (parts.join(" ").length > LABEL_MAX_LENGTH && parts.length > 2) {
|
|
84
|
+
parts = parts.slice(0, -1);
|
|
85
|
+
}
|
|
86
|
+
return "".concat(parts.join(" "), "..");
|
|
87
|
+
}
|
|
88
|
+
var SectionLabel = function (_a) {
|
|
89
|
+
var label = _a.label, _b = _a.flex, flex = _b === void 0 ? false : _b, theme = _a.theme;
|
|
90
|
+
var needsTooltip = label.length > LABEL_MAX_LENGTH;
|
|
91
|
+
var content = (react_1.default.createElement(react_2.Box, { as: "span", flex: flex ? "1" : undefined, textAlign: "left", fontWeight: "medium", fontSize: "sm", sx: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }, formatHeaderLabel(label)));
|
|
92
|
+
if (!needsTooltip)
|
|
93
|
+
return content;
|
|
94
|
+
return (react_1.default.createElement(react_2.Tooltip, { label: label, hasArrow: true, placement: "top", bg: theme.colors.gray[600], color: theme.colors.white, fontSize: "0.75rem" }, content));
|
|
95
|
+
};
|
|
96
|
+
var ActiveItemControls = function (_a) {
|
|
97
|
+
var activeItem = _a.activeItem, sec = _a.sec, setTextOperator = _a.setTextOperator, setTextValue = _a.setTextValue;
|
|
98
|
+
if (!activeItem)
|
|
99
|
+
return null;
|
|
100
|
+
if (activeItem.type === "date") {
|
|
101
|
+
return (react_1.default.createElement(DatePicker_1.default, { size: "sm", selectedDate: activeItem.value, onChange: function (val) { return setTextValue(sec.id, activeItem.id, val); } }));
|
|
102
|
+
}
|
|
103
|
+
if (activeItem.type === "text") {
|
|
104
|
+
return (react_1.default.createElement(TextOperationControls_1.TextOperationControls, { operator: activeItem.condition || "contains", value: activeItem.value || "", onOperatorChange: function (op) { return setTextOperator(sec.id, activeItem.id, op); }, onValueChange: function (val) { return setTextValue(sec.id, activeItem.id, val); } }));
|
|
105
|
+
}
|
|
106
|
+
if (activeItem.type === "select" || activeItem.type === "user") {
|
|
107
|
+
var def = (sec.items || []).find(function (i) { return i.id === activeItem.id; });
|
|
108
|
+
var opts = (def === null || def === void 0 ? void 0 : def.selectOption) || (def === null || def === void 0 ? void 0 : def.option) || [];
|
|
109
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
110
|
+
react_1.default.createElement(SelectOperationControls_1.SelectOperationControls, { operator: activeItem.condition || "is", onOperatorChange: function (op) { return setTextOperator(sec.id, activeItem.id, op); }, size: "xs", ml: "1.25rem", mt: 2 }),
|
|
111
|
+
react_1.default.createElement(react_2.Box, { mt: 2, ml: "1.25rem" },
|
|
112
|
+
react_1.default.createElement(CompactSelect_1.default, { placeholder: def === null || def === void 0 ? void 0 : def.label, size: "xs", height: "22px", options: opts, value: activeItem.value, onSelect: function (option) { return setTextValue(sec.id, activeItem.id, option); } }))));
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
};
|
|
116
|
+
var SectionContent = function (_a) {
|
|
117
|
+
var _b;
|
|
118
|
+
var sec = _a.sec, selected = _a.selected, toggleItem = _a.toggleItem, setTextOperator = _a.setTextOperator, setTextValue = _a.setTextValue, setSelected = _a.setSelected;
|
|
119
|
+
if (sec.radio) {
|
|
120
|
+
var activeItem = (_b = selected[sec.id]) === null || _b === void 0 ? void 0 : _b[0];
|
|
121
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
122
|
+
react_1.default.createElement(RadioButton_1.RadioButtonGroup, { value: (activeItem === null || activeItem === void 0 ? void 0 : activeItem.id) || "", onChange: function (val) {
|
|
123
|
+
var item = (sec.items || []).find(function (i) { return i.id === val; });
|
|
124
|
+
setSelected(function (prev) {
|
|
125
|
+
var _a;
|
|
126
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[sec.id] = val
|
|
127
|
+
? [{ id: val, type: item === null || item === void 0 ? void 0 : item.type, condition: (item === null || item === void 0 ? void 0 : item.type) === "text" ? "contains" : "is", value: "" }]
|
|
128
|
+
: [], _a)));
|
|
129
|
+
});
|
|
130
|
+
}, options: (sec.items || []).map(function (it) { return ({ label: it.label, id: it.id }); }), size: "sm", spacing: "0.35rem", direction: "column", align: "start", labelFontSize: "0.75rem", labelClampLines: 1, showLabelTooltip: function (item) { return item.label.length > LABEL_MAX_LENGTH; } }),
|
|
131
|
+
activeItem && (react_1.default.createElement(ActiveItemControls, { activeItem: activeItem, sec: sec, setTextOperator: setTextOperator, setTextValue: setTextValue }))));
|
|
132
|
+
}
|
|
133
|
+
return (react_1.default.createElement(react_2.VStack, { spacing: 2, align: "stretch" }, (sec.items || []).map(function (it) {
|
|
134
|
+
var sectionItems = selected[sec.id] || [];
|
|
135
|
+
var activeItem = sectionItems.find(function (i) { return i.id === it.id; });
|
|
136
|
+
var checked = !!activeItem;
|
|
137
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: it.id },
|
|
138
|
+
react_1.default.createElement(Checkbox_1.default, { label: it.label, labelFontSize: "0.75rem", showLabelTooltip: it.label.length > LABEL_MAX_LENGTH, labelTooltip: it.label, labelClampLines: 1, isChecked: checked, onChange: function (e) { return toggleItem(sec.id, it.id, e.target.checked, it.type); }, size: "sm", iconSize: "0.5rem", spacing: "0.5rem", sx: {
|
|
139
|
+
gap: "0.5rem",
|
|
140
|
+
hiteSpace: "normal",
|
|
141
|
+
wordBreak: "break-word",
|
|
142
|
+
overflow: "hidden",
|
|
143
|
+
textOverflow: "ellipsis",
|
|
144
|
+
".chakra-checkbox__control": { width: "12px", height: "12px", mt: "2px" },
|
|
145
|
+
".chakra-checkbox__label": { lineHeight: "1rem", whiteSpace: "normal", wordBreak: "break-word" },
|
|
146
|
+
} }),
|
|
147
|
+
checked && it.type === "date" && (react_1.default.createElement(react_2.Box, { ml: "1.25rem" },
|
|
148
|
+
react_1.default.createElement(DatePicker_1.default, { size: "sm", selectedDate: activeItem.value, onChange: function (val) { return setTextValue(sec.id, it.id, val); } }))),
|
|
149
|
+
checked && it.type === "text" && (react_1.default.createElement(TextOperationControls_1.TextOperationControls, { operator: activeItem.condition || "contains", value: activeItem.value || "", onOperatorChange: function (op) { return setTextOperator(sec.id, it.id, op); }, onValueChange: function (val) { return setTextValue(sec.id, it.id, val); } })),
|
|
150
|
+
checked && (it.type === "select" || it.type === "user") && (react_1.default.createElement(react_2.Box, null,
|
|
151
|
+
react_1.default.createElement(SelectOperationControls_1.SelectOperationControls, { operator: activeItem.condition || "is", onOperatorChange: function (op) { return setTextOperator(sec.id, it.id, op); }, size: "xs", ml: "1.25rem" }),
|
|
152
|
+
react_1.default.createElement(react_2.Box, { mt: 2, ml: "1.25rem" },
|
|
153
|
+
react_1.default.createElement(CompactSelect_1.default, { placeholder: it.label, size: "xs", height: "30px", options: it.selectOption || it.option || [], value: activeItem.value, onSelect: function (option) { return setTextValue(sec.id, it.id, option); } }))))));
|
|
154
|
+
})));
|
|
155
|
+
};
|
|
156
|
+
// ─── Main Component ───────────────────────────────────────────────────────────
|
|
157
|
+
var LeftFilterPane = function (_a) {
|
|
158
|
+
var _b, _c, _d, _e;
|
|
159
|
+
var _f = _a.title, title = _f === void 0 ? "Filter" : _f, _g = _a.height, height = _g === void 0 ? 300 : _g, sections = _a.sections, selectedProp = _a.selected, onApply = _a.onApply, onClear = _a.onClear, theme = _a.theme, _h = _a.isApplyLoading, isApplyLoading = _h === void 0 ? false : _h, _j = _a.filterMode, filterMode = _j === void 0 ? "sidebar" : _j;
|
|
160
|
+
var _k = (0, react_1.useState)(!!(selectedProp === null || selectedProp === void 0 ? void 0 : selectedProp.search)), isSearching = _k[0], setIsSearching = _k[1];
|
|
161
|
+
var _l = (0, react_1.useState)({}), localSelected = _l[0], setLocalSelected = _l[1];
|
|
162
|
+
var searchRef = (0, react_1.useRef)(null);
|
|
163
|
+
(0, react_1.useEffect)(function () {
|
|
164
|
+
setLocalSelected(selectedProp || {});
|
|
165
|
+
if (selectedProp === null || selectedProp === void 0 ? void 0 : selectedProp.search)
|
|
166
|
+
setIsSearching(true);
|
|
167
|
+
}, [selectedProp]);
|
|
168
|
+
var search = localSelected.search || "";
|
|
169
|
+
var setSelected = function (updater) {
|
|
170
|
+
setLocalSelected(function (prev) { return (typeof updater === "function" ? updater(prev) : updater); });
|
|
171
|
+
};
|
|
172
|
+
var setSearch = function (val) {
|
|
173
|
+
setSelected(function (prev) { return (__assign(__assign({}, prev), { search: val })); });
|
|
174
|
+
};
|
|
175
|
+
var updateItem = function (sectionId, itemId, updates) {
|
|
176
|
+
setSelected(function (prev) {
|
|
177
|
+
var _a;
|
|
178
|
+
var items = prev[sectionId] || [];
|
|
179
|
+
var idx = items.findIndex(function (i) { return i.id === itemId; });
|
|
180
|
+
if (idx === -1)
|
|
181
|
+
return prev;
|
|
182
|
+
var updated = __spreadArray([], items, true);
|
|
183
|
+
updated[idx] = __assign(__assign({}, updated[idx]), updates);
|
|
184
|
+
return __assign(__assign({}, prev), (_a = {}, _a[sectionId] = updated, _a));
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
var setTextOperator = function (sectionId, itemId, operator) {
|
|
188
|
+
return updateItem(sectionId, itemId, { condition: operator });
|
|
189
|
+
};
|
|
190
|
+
var setTextValue = function (sectionId, itemId, value) {
|
|
191
|
+
return updateItem(sectionId, itemId, { value: value });
|
|
192
|
+
};
|
|
193
|
+
var toggleItem = function (sectionId, itemId, checked, type) {
|
|
194
|
+
setSelected(function (prev) {
|
|
195
|
+
var _a, _b;
|
|
196
|
+
var items = prev[sectionId] || [];
|
|
197
|
+
if (checked) {
|
|
198
|
+
if (items.some(function (i) { return i.id === itemId; }))
|
|
199
|
+
return prev;
|
|
200
|
+
var condition = type === "select" || type === "user" ? "is" : "contains";
|
|
201
|
+
return __assign(__assign({}, prev), (_a = {}, _a[sectionId] = __spreadArray(__spreadArray([], items, true), [{ id: itemId, type: type, condition: condition, value: "" }], false), _a));
|
|
202
|
+
}
|
|
203
|
+
return __assign(__assign({}, prev), (_b = {}, _b[sectionId] = items.filter(function (i) { return i.id !== itemId; }), _b));
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
(0, react_3.useOutsideClick)({
|
|
207
|
+
ref: searchRef,
|
|
208
|
+
handler: function () {
|
|
209
|
+
if (isSearching && !search.trim())
|
|
210
|
+
setIsSearching(false);
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
var filteredSections = (0, react_1.useMemo)(function () {
|
|
214
|
+
if (!search.trim())
|
|
215
|
+
return sections;
|
|
216
|
+
var q = search.toLowerCase();
|
|
217
|
+
return sections
|
|
218
|
+
.map(function (sec) { return (__assign(__assign({}, sec), { items: (sec.items || []).filter(function (i) { return i.label.toLowerCase().includes(q); }) })); })
|
|
219
|
+
.filter(function (sec) { return (sec.items || []).length > 0; });
|
|
220
|
+
}, [search, sections]);
|
|
221
|
+
var hasActiveFilters = (0, react_1.useMemo)(function () {
|
|
222
|
+
return Object.entries(localSelected).some(function (_a) {
|
|
223
|
+
var key = _a[0], value = _a[1];
|
|
224
|
+
if (key === "search")
|
|
225
|
+
return !!(value && typeof value === "string" && value.trim());
|
|
226
|
+
return Array.isArray(value) && value.length > 0;
|
|
227
|
+
});
|
|
228
|
+
}, [localSelected]);
|
|
229
|
+
var handleApply = function () { return onApply === null || onApply === void 0 ? void 0 : onApply(localSelected); };
|
|
230
|
+
var handleClear = function () {
|
|
231
|
+
var cleared = { search: "" };
|
|
232
|
+
setLocalSelected(cleared);
|
|
233
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
234
|
+
if (filterMode === "sidebar")
|
|
235
|
+
onApply === null || onApply === void 0 ? void 0 : onApply(cleared);
|
|
236
|
+
};
|
|
237
|
+
var sectionContentProps = { selected: localSelected, toggleItem: toggleItem, setTextOperator: setTextOperator, setTextValue: setTextValue, setSelected: setSelected };
|
|
238
|
+
var renderSections = function () {
|
|
239
|
+
if (filteredSections.length === 0) {
|
|
240
|
+
return (react_1.default.createElement(react_2.Box, { p: 4, textAlign: "center" },
|
|
241
|
+
react_1.default.createElement(react_2.Text, { fontSize: "xs", color: "gray.500" }, "No filters found")));
|
|
242
|
+
}
|
|
243
|
+
if (filteredSections.length > 1) {
|
|
244
|
+
return (react_1.default.createElement(react_2.Accordion, { allowMultiple: true, defaultIndex: filteredSections.map(function (s, i) { return (s.initiallyExpanded ? i : -1); }).filter(function (i) { return i >= 0; }) }, filteredSections.map(function (sec) { return (react_1.default.createElement(react_2.AccordionItem, { key: sec.id, border: "none" },
|
|
245
|
+
react_1.default.createElement("h2", null,
|
|
246
|
+
react_1.default.createElement(react_2.AccordionButton, { px: 3, py: 2, _expanded: { bg: "gray.50" } },
|
|
247
|
+
react_1.default.createElement(SectionLabel, { label: sec.label, flex: true, theme: theme }),
|
|
248
|
+
react_1.default.createElement(react_2.AccordionIcon, null))),
|
|
249
|
+
react_1.default.createElement(react_2.AccordionPanel, { px: 3, pt: 2, pb: 1 },
|
|
250
|
+
react_1.default.createElement(SectionContent, __assign({ sec: sec }, sectionContentProps))))); })));
|
|
251
|
+
}
|
|
252
|
+
return filteredSections.map(function (sec) { return (react_1.default.createElement(react_2.Box, { key: sec.id },
|
|
253
|
+
react_1.default.createElement(react_2.Box, { px: 3, py: 2, borderBottom: "1px solid", borderColor: "gray.200" },
|
|
254
|
+
react_1.default.createElement(SectionLabel, { label: sec.label, theme: theme })),
|
|
255
|
+
react_1.default.createElement(react_2.Box, { px: 3, pt: 2, pb: 1 },
|
|
256
|
+
react_1.default.createElement(SectionContent, __assign({ sec: sec }, sectionContentProps))))); });
|
|
257
|
+
};
|
|
258
|
+
return (react_1.default.createElement(react_2.Box, { width: filterMode === "modal" ? "100%" : "180px", height: filterMode === "modal" ? "100%" : height, minHeight: "32rem", bg: "white", borderRight: "1px solid", borderColor: "gray.200", borderRadius: "md", overflow: "hidden", display: "flex", flexDirection: "column", marginBottom: filterMode === "modal" && hasActiveFilters ? '3.5rem' : 0 },
|
|
259
|
+
react_1.default.createElement(react_2.Box, { p: 3, borderBottom: "1px solid", borderColor: "gray.200" }, !isSearching ? (react_1.default.createElement(react_2.Flex, { align: "center", justify: "space-between" },
|
|
260
|
+
react_1.default.createElement(react_2.Text, { fontWeight: "semibold", fontSize: "sm" }, title),
|
|
261
|
+
react_1.default.createElement(react_2.Icon, { as: lucide_react_1.Search, transform: "scaleX(-1)", cursor: "pointer", boxSize: 4, color: (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.text) === null || _c === void 0 ? void 0 : _c[500], onClick: function () { return setIsSearching(true); }, mr: filterMode === "modal" ? 8 : 2, mt: filterMode === "modal" ? -1 : 0 }))) : (react_1.default.createElement(framer_motion_1.motion.div, { ref: searchRef, initial: { opacity: 0, x: 40 }, animate: { opacity: 1, x: 0 }, transition: { type: "tween", duration: 0.2 } },
|
|
262
|
+
react_1.default.createElement(react_2.InputGroup, { size: "sm" },
|
|
263
|
+
react_1.default.createElement(react_2.InputLeftElement, { pointerEvents: "none" },
|
|
264
|
+
react_1.default.createElement(lucide_react_1.Search, { size: 16, color: (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e[500] })),
|
|
265
|
+
react_1.default.createElement(react_2.Input, { placeholder: "Search", value: search, onChange: function (e) { return setSearch(e.target.value); }, autoFocus: true }),
|
|
266
|
+
search.length > 0 && (react_1.default.createElement(react_2.InputRightElement, null,
|
|
267
|
+
react_1.default.createElement(react_2.IconButton, { "aria-label": "Clear", size: "xs", variant: "ghost", icon: react_1.default.createElement(lucide_react_1.X, { size: 14 }), onClick: function () { setSearch(""); setIsSearching(false); } }))))))),
|
|
268
|
+
react_1.default.createElement(react_2.Box, { flex: "1", overflowY: "auto" }, renderSections()),
|
|
269
|
+
hasActiveFilters && (react_1.default.createElement(react_2.HStack, { px: 2, py: 1, borderTop: "1px solid", borderColor: "gray.200", spacing: 2, position: filterMode === "modal" ? "absolute" : "relative", bottom: 0, left: 0, right: 0, bg: "white" },
|
|
270
|
+
react_1.default.createElement(react_2.Button, { flex: 1, variant: "outline", size: "sm", onClick: handleClear, fontSize: "xs", colorScheme: "red" }, "Clear All"),
|
|
271
|
+
react_1.default.createElement(react_2.Button, { flex: 1, colorScheme: "primary", color: "white", size: "sm", onClick: handleApply, fontSize: "xs", isLoading: isApplyLoading }, "Apply")))));
|
|
272
|
+
};
|
|
273
|
+
exports.default = LeftFilterPane;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function SelectOperationControls({ operator, onOperatorChange, size, ml, mt, }: {
|
|
3
|
+
operator: string;
|
|
4
|
+
onOperatorChange: (op: string) => void;
|
|
5
|
+
size?: "xs" | "sm";
|
|
6
|
+
ml?: string | number;
|
|
7
|
+
mt?: string | number;
|
|
8
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
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.SelectOperationControls = SelectOperationControls;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var react_2 = require("@chakra-ui/react");
|
|
9
|
+
function SelectOperationControls(_a) {
|
|
10
|
+
var operator = _a.operator, onOperatorChange = _a.onOperatorChange, _b = _a.size, size = _b === void 0 ? "xs" : _b, _c = _a.ml, ml = _c === void 0 ? "1.25rem" : _c, _d = _a.mt, mt = _d === void 0 ? 2 : _d;
|
|
11
|
+
return (react_1.default.createElement(react_2.VStack, { spacing: 2, align: "stretch", mt: mt, ml: ml },
|
|
12
|
+
react_1.default.createElement(react_2.Select, { size: size, value: operator, onChange: function (e) { return onOperatorChange(e.target.value); }, sx: { fontSize: "0.75rem", height: "24px" }, width: "90px" },
|
|
13
|
+
react_1.default.createElement("option", { value: "is" }, "is"),
|
|
14
|
+
react_1.default.createElement("option", { value: "is not" }, "is not"))));
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableFiltersProps } from "../TableProps";
|
|
3
|
+
declare const TableFilters: React.MemoExoticComponent<({ header, setColumnsSearch, columnsSearch, onClose, isOpen, onOpen, }: TableFiltersProps & {
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
onOpen?: () => void;
|
|
6
|
+
}) => React.JSX.Element>;
|
|
7
|
+
export default TableFilters;
|
|
@@ -0,0 +1,89 @@
|
|
|
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 TableFilters = (0, react_1.memo)(function (_a) {
|
|
40
|
+
var _b, _c;
|
|
41
|
+
var header = _a.header, setColumnsSearch = _a.setColumnsSearch, columnsSearch = _a.columnsSearch, onClose = _a.onClose, isOpen = _a.isOpen, onOpen = _a.onOpen;
|
|
42
|
+
var theme = (0, react_2.useTheme)();
|
|
43
|
+
var searchRef = (0, react_1.useRef)(null);
|
|
44
|
+
var _d = (0, react_1.useState)(false), refreshDataOnOpen = _d[0], setRefreshDataOnOpen = _d[1];
|
|
45
|
+
var setColumnsSearchRef = (0, react_1.useRef)(setColumnsSearch);
|
|
46
|
+
setColumnsSearchRef.current = setColumnsSearch;
|
|
47
|
+
var debounceTimerRef = (0, react_1.useRef)(null);
|
|
48
|
+
var debouncedSearch = (0, react_1.useCallback)(function (value) {
|
|
49
|
+
if (debounceTimerRef.current)
|
|
50
|
+
clearTimeout(debounceTimerRef.current);
|
|
51
|
+
debounceTimerRef.current = setTimeout(function () {
|
|
52
|
+
setColumnsSearchRef.current(value);
|
|
53
|
+
}, 700);
|
|
54
|
+
}, []);
|
|
55
|
+
(0, react_1.useEffect)(function () {
|
|
56
|
+
if (columnsSearch.length && searchRef.current) {
|
|
57
|
+
searchRef.current.value = columnsSearch;
|
|
58
|
+
}
|
|
59
|
+
/* eslint-disable */
|
|
60
|
+
}, [refreshDataOnOpen]);
|
|
61
|
+
// Auto-focus input when popover opens
|
|
62
|
+
(0, react_1.useEffect)(function () {
|
|
63
|
+
if (isOpen && searchRef.current) {
|
|
64
|
+
// Small delay to ensure popover is fully rendered
|
|
65
|
+
setTimeout(function () {
|
|
66
|
+
var _a;
|
|
67
|
+
(_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
68
|
+
}, 100);
|
|
69
|
+
}
|
|
70
|
+
}, [isOpen]);
|
|
71
|
+
var handleOpen = function () {
|
|
72
|
+
setRefreshDataOnOpen(function (prev) { return !prev; });
|
|
73
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
74
|
+
};
|
|
75
|
+
return (react_1.default.createElement(react_2.Popover, { isOpen: isOpen, onClose: onClose, onOpen: handleOpen },
|
|
76
|
+
react_1.default.createElement(react_2.PopoverTrigger, null,
|
|
77
|
+
react_1.default.createElement(react_2.IconButton, { "aria-label": "Search", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 17, color: (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c[900] }), size: "xs", variant: "ghost", _hover: { bg: "none" } })),
|
|
78
|
+
react_1.default.createElement(react_2.Portal, null,
|
|
79
|
+
react_1.default.createElement(react_2.PopoverContent, { width: "200px" },
|
|
80
|
+
react_1.default.createElement(react_2.PopoverBody, { p: 2 },
|
|
81
|
+
react_1.default.createElement(react_2.InputGroup, { flex: "1", size: "xs" },
|
|
82
|
+
react_1.default.createElement(react_2.InputLeftElement, { pointerEvents: "none" },
|
|
83
|
+
react_1.default.createElement(react_2.Icon, { as: lucide_react_1.Search, color: "gray.400", boxSize: 4 })),
|
|
84
|
+
react_1.default.createElement(react_2.Input, { autoFocus: true, placeholder: "Search ".concat(header.label, "..."), size: "xs", ref: searchRef, onChange: function (e) {
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
debouncedSearch(e.target.value);
|
|
87
|
+
}, onFocus: function (e) { return e.stopPropagation(); } })))))));
|
|
88
|
+
});
|
|
89
|
+
exports.default = TableFilters;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const TEXT_OPERATORS: string[];
|
|
3
|
+
export declare const requiresValue: (op: string) => boolean;
|
|
4
|
+
export declare function TextOperationControls({ operator, value, onOperatorChange, onValueChange, size, ml, mt, }: {
|
|
5
|
+
operator: string;
|
|
6
|
+
value: string;
|
|
7
|
+
onOperatorChange: (op: string) => void;
|
|
8
|
+
onValueChange: (val: string) => void;
|
|
9
|
+
size?: "xs" | "sm";
|
|
10
|
+
ml?: string | number;
|
|
11
|
+
mt?: string | number;
|
|
12
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
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.requiresValue = exports.TEXT_OPERATORS = void 0;
|
|
7
|
+
exports.TextOperationControls = TextOperationControls;
|
|
8
|
+
var react_1 = __importDefault(require("react"));
|
|
9
|
+
var react_2 = require("@chakra-ui/react");
|
|
10
|
+
exports.TEXT_OPERATORS = [
|
|
11
|
+
"is",
|
|
12
|
+
"is not",
|
|
13
|
+
"contains",
|
|
14
|
+
"does not contain",
|
|
15
|
+
"starts with",
|
|
16
|
+
"ends with",
|
|
17
|
+
"is empty",
|
|
18
|
+
"is not empty",
|
|
19
|
+
];
|
|
20
|
+
var requiresValue = function (op) {
|
|
21
|
+
return !(op === "is empty" || op === "is not empty");
|
|
22
|
+
};
|
|
23
|
+
exports.requiresValue = requiresValue;
|
|
24
|
+
function TextOperationControls(_a) {
|
|
25
|
+
var operator = _a.operator, value = _a.value, onOperatorChange = _a.onOperatorChange, onValueChange = _a.onValueChange, _b = _a.size, size = _b === void 0 ? "xs" : _b, _c = _a.ml, ml = _c === void 0 ? "1.25rem" : _c, _d = _a.mt, mt = _d === void 0 ? 2 : _d;
|
|
26
|
+
return (react_1.default.createElement(react_2.VStack, { spacing: 2, align: "stretch", mt: mt, ml: ml },
|
|
27
|
+
react_1.default.createElement(react_2.Select, { size: size, value: operator, onChange: function (e) { return onOperatorChange(e.target.value); }, sx: { fontSize: "0.75rem", height: "24px" }, width: "110px" }, exports.TEXT_OPERATORS.map(function (op) { return (react_1.default.createElement("option", { key: op, value: op }, op)); })),
|
|
28
|
+
(0, exports.requiresValue)(operator) && (react_1.default.createElement(react_2.Input, { size: size, placeholder: "Type here", value: value, onChange: function (e) { return onValueChange(e.target.value); }, sx: { fontSize: "0.75rem", height: "24px" }, width: "100%" }))));
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var react_1 = require("react");
|
|
4
|
+
// First, create a custom debounce hook
|
|
5
|
+
var useDebounce = function (callback, delay) {
|
|
6
|
+
var timeoutRef = (0, react_1.useRef)();
|
|
7
|
+
(0, react_1.useEffect)(function () {
|
|
8
|
+
return function () {
|
|
9
|
+
if (timeoutRef.current) {
|
|
10
|
+
clearTimeout(timeoutRef.current);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}, []);
|
|
14
|
+
var debouncedCallback = (0, react_1.useCallback)(function () {
|
|
15
|
+
var args = [];
|
|
16
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
17
|
+
args[_i] = arguments[_i];
|
|
18
|
+
}
|
|
19
|
+
if (timeoutRef.current) {
|
|
20
|
+
clearTimeout(timeoutRef.current);
|
|
21
|
+
}
|
|
22
|
+
timeoutRef.current = setTimeout(function () {
|
|
23
|
+
callback.apply(void 0, args);
|
|
24
|
+
}, delay);
|
|
25
|
+
}, [callback, delay]);
|
|
26
|
+
return debouncedCallback;
|
|
27
|
+
};
|
|
28
|
+
exports.default = useDebounce;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ColumnSortingProps, DataObject, TableHeaderProps } from "../TableProps";
|
|
2
|
+
type UseTableProps = {
|
|
3
|
+
tableBorderColor?: string;
|
|
4
|
+
data: DataObject[];
|
|
5
|
+
isPagination: boolean;
|
|
6
|
+
selections?: (string | number)[];
|
|
7
|
+
columns: TableHeaderProps[];
|
|
8
|
+
onSelection?: (selected: (string | number)[]) => void;
|
|
9
|
+
tablePreferences?: Record<string, any>;
|
|
10
|
+
savePreferences?: (data: Record<string, any>) => void;
|
|
11
|
+
noOfRowsPerPage?: number;
|
|
12
|
+
isServerPagination: boolean;
|
|
13
|
+
totalRecords: number;
|
|
14
|
+
onNoOfRowsPerPageChange?: (noOfRows: number) => void;
|
|
15
|
+
defaultVisibleColumns?: number;
|
|
16
|
+
};
|
|
17
|
+
declare const useTable: ({ tableBorderColor, data, isPagination, selections, onSelection, tablePreferences, savePreferences, noOfRowsPerPage, isServerPagination, totalRecords, columns, onNoOfRowsPerPageChange, defaultVisibleColumns, }: UseTableProps) => {
|
|
18
|
+
tableData: DataObject[];
|
|
19
|
+
tableContainerStyles: {
|
|
20
|
+
borderRadius: string;
|
|
21
|
+
borderWidth: string;
|
|
22
|
+
borderColor: string;
|
|
23
|
+
boxShadow: string;
|
|
24
|
+
maxHeight: string;
|
|
25
|
+
overflowY: string;
|
|
26
|
+
};
|
|
27
|
+
isContent: boolean;
|
|
28
|
+
isLink: boolean;
|
|
29
|
+
headerRefs: import("react").MutableRefObject<(HTMLTableCellElement | null)[]>;
|
|
30
|
+
columnWidths: number[];
|
|
31
|
+
handleSort: (field: string | number, sort: "asc" | "desc" | "none") => void;
|
|
32
|
+
handleCheckbox: (id: string | number) => void;
|
|
33
|
+
filteredData: DataObject[];
|
|
34
|
+
startRow: number;
|
|
35
|
+
endRow: number;
|
|
36
|
+
selection: (string | number)[];
|
|
37
|
+
columnsSort: ColumnSortingProps[];
|
|
38
|
+
handlePageSizeChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
39
|
+
pages: number;
|
|
40
|
+
currentPage: number;
|
|
41
|
+
rowsPerPage: number;
|
|
42
|
+
setCurrentPage: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
43
|
+
columnsList: TableHeaderProps[];
|
|
44
|
+
handleColumnPreferences: (columns: any) => void;
|
|
45
|
+
isSelecting: boolean;
|
|
46
|
+
};
|
|
47
|
+
export default useTable;
|