eai-frontend-components 2.0.4
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/LICENSE +21 -0
- package/README.md +299 -0
- package/dist/components/accordion.d.ts +8 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +13 -0
- package/dist/components/alert-dialog.d.ts +25 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +27 -0
- package/dist/components/alert.d.ts +9 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +22 -0
- package/dist/components/avatar.d.ts +7 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +11 -0
- package/dist/components/badge.d.ts +10 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +26 -0
- package/dist/components/breadcrumb.d.ts +20 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +23 -0
- package/dist/components/button.d.ts +12 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +33 -0
- package/dist/components/calendar.d.ts +9 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +70 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +16 -0
- package/dist/components/carousel.d.ts +19 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +98 -0
- package/dist/components/chart.d.ts +63 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +130 -0
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +8 -0
- package/dist/components/collapsible.d.ts +6 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +5 -0
- package/dist/components/command.d.ts +81 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +28 -0
- package/dist/components/context-menu.d.ts +28 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +33 -0
- package/dist/components/custom/date-picker.d.ts +12 -0
- package/dist/components/custom/date-picker.d.ts.map +1 -0
- package/dist/components/custom/date-picker.js +35 -0
- package/dist/components/custom/form/checkbox.d.ts +13 -0
- package/dist/components/custom/form/checkbox.d.ts.map +1 -0
- package/dist/components/custom/form/checkbox.js +15 -0
- package/dist/components/custom/form/color.d.ts +15 -0
- package/dist/components/custom/form/color.d.ts.map +1 -0
- package/dist/components/custom/form/color.js +40 -0
- package/dist/components/custom/form/combobox.d.ts +37 -0
- package/dist/components/custom/form/combobox.d.ts.map +1 -0
- package/dist/components/custom/form/combobox.js +82 -0
- package/dist/components/custom/form/cpf-cnpj.d.ts +16 -0
- package/dist/components/custom/form/cpf-cnpj.d.ts.map +1 -0
- package/dist/components/custom/form/cpf-cnpj.js +32 -0
- package/dist/components/custom/form/currency.d.ts +14 -0
- package/dist/components/custom/form/currency.d.ts.map +1 -0
- package/dist/components/custom/form/currency.js +15 -0
- package/dist/components/custom/form/date-range.d.ts +16 -0
- package/dist/components/custom/form/date-range.d.ts.map +1 -0
- package/dist/components/custom/form/date-range.js +24 -0
- package/dist/components/custom/form/date.d.ts +16 -0
- package/dist/components/custom/form/date.d.ts.map +1 -0
- package/dist/components/custom/form/date.js +35 -0
- package/dist/components/custom/form/decimal.d.ts +14 -0
- package/dist/components/custom/form/decimal.d.ts.map +1 -0
- package/dist/components/custom/form/decimal.js +15 -0
- package/dist/components/custom/form/file.d.ts +15 -0
- package/dist/components/custom/form/file.d.ts.map +1 -0
- package/dist/components/custom/form/file.js +18 -0
- package/dist/components/custom/form/form-help-text.d.ts +3 -0
- package/dist/components/custom/form/form-help-text.d.ts.map +1 -0
- package/dist/components/custom/form/form-help-text.js +7 -0
- package/dist/components/custom/form/form-label.d.ts +4 -0
- package/dist/components/custom/form/form-label.d.ts.map +1 -0
- package/dist/components/custom/form/form-label.js +9 -0
- package/dist/components/custom/form/form-message.d.ts +3 -0
- package/dist/components/custom/form/form-message.d.ts.map +1 -0
- package/dist/components/custom/form/form-message.js +5 -0
- package/dist/components/custom/form/ghost.d.ts +8 -0
- package/dist/components/custom/form/ghost.d.ts.map +1 -0
- package/dist/components/custom/form/ghost.js +8 -0
- package/dist/components/custom/form/input.d.ts +18 -0
- package/dist/components/custom/form/input.d.ts.map +1 -0
- package/dist/components/custom/form/input.js +14 -0
- package/dist/components/custom/form/mask.d.ts +19 -0
- package/dist/components/custom/form/mask.d.ts.map +1 -0
- package/dist/components/custom/form/mask.js +19 -0
- package/dist/components/custom/form/multi-select-old.d.ts +19 -0
- package/dist/components/custom/form/multi-select-old.d.ts.map +1 -0
- package/dist/components/custom/form/multi-select-old.js +30 -0
- package/dist/components/custom/form/multi-select.d.ts +26 -0
- package/dist/components/custom/form/multi-select.d.ts.map +1 -0
- package/dist/components/custom/form/multi-select.js +66 -0
- package/dist/components/custom/form/password.d.ts +16 -0
- package/dist/components/custom/form/password.d.ts.map +1 -0
- package/dist/components/custom/form/password.js +14 -0
- package/dist/components/custom/form/percent.d.ts +14 -0
- package/dist/components/custom/form/percent.d.ts.map +1 -0
- package/dist/components/custom/form/percent.js +15 -0
- package/dist/components/custom/form/phone.d.ts +16 -0
- package/dist/components/custom/form/phone.d.ts.map +1 -0
- package/dist/components/custom/form/phone.js +23 -0
- package/dist/components/custom/form/radio-group.d.ts +23 -0
- package/dist/components/custom/form/radio-group.d.ts.map +1 -0
- package/dist/components/custom/form/radio-group.js +15 -0
- package/dist/components/custom/form/select.d.ts +20 -0
- package/dist/components/custom/form/select.d.ts.map +1 -0
- package/dist/components/custom/form/select.js +12 -0
- package/dist/components/custom/form/step-new-form.d.ts +10 -0
- package/dist/components/custom/form/step-new-form.d.ts.map +1 -0
- package/dist/components/custom/form/step-new-form.js +13 -0
- package/dist/components/custom/form/switch.d.ts +13 -0
- package/dist/components/custom/form/switch.d.ts.map +1 -0
- package/dist/components/custom/form/switch.js +16 -0
- package/dist/components/custom/form/text.d.ts +18 -0
- package/dist/components/custom/form/text.d.ts.map +1 -0
- package/dist/components/custom/form/text.js +14 -0
- package/dist/components/custom/form/textarea.d.ts +16 -0
- package/dist/components/custom/form/textarea.d.ts.map +1 -0
- package/dist/components/custom/form/textarea.js +19 -0
- package/dist/components/custom/form/utils.d.ts +18 -0
- package/dist/components/custom/form/utils.d.ts.map +1 -0
- package/dist/components/custom/form/utils.js +88 -0
- package/dist/components/custom/header.d.ts +3 -0
- package/dist/components/custom/header.d.ts.map +1 -0
- package/dist/components/custom/header.js +94 -0
- package/dist/components/custom/label.d.ts +13 -0
- package/dist/components/custom/label.d.ts.map +1 -0
- package/dist/components/custom/label.js +20 -0
- package/dist/components/custom/not-found.d.ts +3 -0
- package/dist/components/custom/not-found.d.ts.map +1 -0
- package/dist/components/custom/not-found.js +9 -0
- package/dist/components/custom/sidebar/app-sidebar.d.ts +5 -0
- package/dist/components/custom/sidebar/app-sidebar.d.ts.map +1 -0
- package/dist/components/custom/sidebar/app-sidebar.js +26 -0
- package/dist/components/custom/sidebar/module-switcher.d.ts +3 -0
- package/dist/components/custom/sidebar/module-switcher.d.ts.map +1 -0
- package/dist/components/custom/sidebar/module-switcher.js +55 -0
- package/dist/components/custom/sidebar/nav-footer.d.ts +3 -0
- package/dist/components/custom/sidebar/nav-footer.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-footer.js +17 -0
- package/dist/components/custom/sidebar/nav-main.d.ts +3 -0
- package/dist/components/custom/sidebar/nav-main.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-main.js +32 -0
- package/dist/components/custom/sidebar/nav-submenu-collapsible.d.ts +9 -0
- package/dist/components/custom/sidebar/nav-submenu-collapsible.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-submenu-collapsible.js +21 -0
- package/dist/components/custom/sidebar/nav-submenu-dropdown.d.ts +10 -0
- package/dist/components/custom/sidebar/nav-submenu-dropdown.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-submenu-dropdown.js +13 -0
- package/dist/components/custom/sidebar/nav-user.d.ts +3 -0
- package/dist/components/custom/sidebar/nav-user.d.ts.map +1 -0
- package/dist/components/custom/sidebar/nav-user.js +51 -0
- package/dist/components/custom/sidebar/sidebar-button.d.ts +9 -0
- package/dist/components/custom/sidebar/sidebar-button.d.ts.map +1 -0
- package/dist/components/custom/sidebar/sidebar-button.js +7 -0
- package/dist/components/custom/sidebar/sidebar-item-two-lines.d.ts +12 -0
- package/dist/components/custom/sidebar/sidebar-item-two-lines.d.ts.map +1 -0
- package/dist/components/custom/sidebar/sidebar-item-two-lines.js +5 -0
- package/dist/components/custom/sidebar/sidebar-item.d.ts +9 -0
- package/dist/components/custom/sidebar/sidebar-item.d.ts.map +1 -0
- package/dist/components/custom/sidebar/sidebar-item.js +7 -0
- package/dist/components/custom/sidebar/types/sidebar.d.ts +29 -0
- package/dist/components/custom/sidebar/types/sidebar.d.ts.map +1 -0
- package/dist/components/custom/sidebar/types/sidebar.js +5 -0
- package/dist/components/custom/table/data-table-export.d.ts +8 -0
- package/dist/components/custom/table/data-table-export.d.ts.map +1 -0
- package/dist/components/custom/table/data-table-export.js +65 -0
- package/dist/components/custom/table/data-table-footer.d.ts +25 -0
- package/dist/components/custom/table/data-table-footer.d.ts.map +1 -0
- package/dist/components/custom/table/data-table-footer.js +39 -0
- package/dist/components/custom/table/data-table-header.d.ts +9 -0
- package/dist/components/custom/table/data-table-header.d.ts.map +1 -0
- package/dist/components/custom/table/data-table-header.js +11 -0
- package/dist/components/custom/table/data-table-rows.d.ts +13 -0
- package/dist/components/custom/table/data-table-rows.d.ts.map +1 -0
- package/dist/components/custom/table/data-table-rows.js +25 -0
- package/dist/components/custom/table/data-table.d.ts +35 -0
- package/dist/components/custom/table/data-table.d.ts.map +1 -0
- package/dist/components/custom/table/data-table.js +99 -0
- package/dist/components/custom/table/types/data-table.d.ts +29 -0
- package/dist/components/custom/table/types/data-table.d.ts.map +1 -0
- package/dist/components/custom/table/types/data-table.js +1 -0
- package/dist/components/custom/theme-provider.d.ts +24 -0
- package/dist/components/custom/theme-provider.d.ts.map +1 -0
- package/dist/components/custom/theme-provider.js +79 -0
- package/dist/components/dateRangePicker.d.ts +3 -0
- package/dist/components/dateRangePicker.d.ts.map +1 -0
- package/dist/components/dateRangePicker.js +15 -0
- package/dist/components/dialog.d.ts +23 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +23 -0
- package/dist/components/drawer.d.ts +23 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +22 -0
- package/dist/components/dropdown-menu.d.ts +28 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +32 -0
- package/dist/components/form.d.ts +24 -0
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +60 -0
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +9 -0
- package/dist/components/input.d.ts +24 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +71 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +9 -0
- package/dist/components/masks.d.ts +17 -0
- package/dist/components/masks.d.ts.map +1 -0
- package/dist/components/masks.js +25 -0
- package/dist/components/pagination.d.ts +30 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +23 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +11 -0
- package/dist/components/progress.d.ts +5 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +7 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +14 -0
- package/dist/components/scroll-area.d.ts +6 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +11 -0
- package/dist/components/select.d.ts +14 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +24 -0
- package/dist/components/separator.d.ts +5 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/sheet.d.ts +26 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +37 -0
- package/dist/components/sidebar.d.ts +67 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +221 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +6 -0
- package/dist/components/slider.d.ts +5 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +7 -0
- package/dist/components/switch.d.ts +5 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +7 -0
- package/dist/components/table.d.ts +11 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +20 -0
- package/dist/components/tabs.d.ts +8 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +12 -0
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +14 -0
- package/dist/components/toast.d.ts +16 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +34 -0
- package/dist/components/toaster.d.ts +2 -0
- package/dist/components/toaster.d.ts.map +1 -0
- package/dist/components/toaster.js +21 -0
- package/dist/components/tooltip.d.ts +8 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +10 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +13 -0
- package/dist/components/ui/alert-dialog.d.ts +25 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +27 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +22 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +11 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +23 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +33 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +70 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +16 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +98 -0
- package/dist/components/ui/chart.d.ts +63 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +130 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +8 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +5 -0
- package/dist/components/ui/command.d.ts +81 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +28 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +33 -0
- package/dist/components/ui/custom/date-picker.d.ts +12 -0
- package/dist/components/ui/custom/date-picker.d.ts.map +1 -0
- package/dist/components/ui/custom/date-picker.js +35 -0
- package/dist/components/ui/custom/form/checkbox.d.ts +13 -0
- package/dist/components/ui/custom/form/checkbox.d.ts.map +1 -0
- package/dist/components/ui/custom/form/checkbox.js +15 -0
- package/dist/components/ui/custom/form/color.d.ts +15 -0
- package/dist/components/ui/custom/form/color.d.ts.map +1 -0
- package/dist/components/ui/custom/form/color.js +40 -0
- package/dist/components/ui/custom/form/combobox.d.ts +37 -0
- package/dist/components/ui/custom/form/combobox.d.ts.map +1 -0
- package/dist/components/ui/custom/form/combobox.js +82 -0
- package/dist/components/ui/custom/form/cpf-cnpj.d.ts +16 -0
- package/dist/components/ui/custom/form/cpf-cnpj.d.ts.map +1 -0
- package/dist/components/ui/custom/form/cpf-cnpj.js +32 -0
- package/dist/components/ui/custom/form/currency.d.ts +14 -0
- package/dist/components/ui/custom/form/currency.d.ts.map +1 -0
- package/dist/components/ui/custom/form/currency.js +15 -0
- package/dist/components/ui/custom/form/date-range.d.ts +16 -0
- package/dist/components/ui/custom/form/date-range.d.ts.map +1 -0
- package/dist/components/ui/custom/form/date-range.js +24 -0
- package/dist/components/ui/custom/form/date.d.ts +16 -0
- package/dist/components/ui/custom/form/date.d.ts.map +1 -0
- package/dist/components/ui/custom/form/date.js +35 -0
- package/dist/components/ui/custom/form/decimal.d.ts +14 -0
- package/dist/components/ui/custom/form/decimal.d.ts.map +1 -0
- package/dist/components/ui/custom/form/decimal.js +15 -0
- package/dist/components/ui/custom/form/file.d.ts +15 -0
- package/dist/components/ui/custom/form/file.d.ts.map +1 -0
- package/dist/components/ui/custom/form/file.js +18 -0
- package/dist/components/ui/custom/form/form-help-text.d.ts +3 -0
- package/dist/components/ui/custom/form/form-help-text.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-help-text.js +7 -0
- package/dist/components/ui/custom/form/form-label.d.ts +7 -0
- package/dist/components/ui/custom/form/form-label.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-label.js +9 -0
- package/dist/components/ui/custom/form/form-message.d.ts +5 -0
- package/dist/components/ui/custom/form/form-message.d.ts.map +1 -0
- package/dist/components/ui/custom/form/form-message.js +5 -0
- package/dist/components/ui/custom/form/ghost.d.ts +8 -0
- package/dist/components/ui/custom/form/ghost.d.ts.map +1 -0
- package/dist/components/ui/custom/form/ghost.js +8 -0
- package/dist/components/ui/custom/form/input.d.ts +18 -0
- package/dist/components/ui/custom/form/input.d.ts.map +1 -0
- package/dist/components/ui/custom/form/input.js +14 -0
- package/dist/components/ui/custom/form/mask.d.ts +19 -0
- package/dist/components/ui/custom/form/mask.d.ts.map +1 -0
- package/dist/components/ui/custom/form/mask.js +19 -0
- package/dist/components/ui/custom/form/multi-select-old.d.ts +19 -0
- package/dist/components/ui/custom/form/multi-select-old.d.ts.map +1 -0
- package/dist/components/ui/custom/form/multi-select-old.js +30 -0
- package/dist/components/ui/custom/form/multi-select.d.ts +26 -0
- package/dist/components/ui/custom/form/multi-select.d.ts.map +1 -0
- package/dist/components/ui/custom/form/multi-select.js +66 -0
- package/dist/components/ui/custom/form/password.d.ts +16 -0
- package/dist/components/ui/custom/form/password.d.ts.map +1 -0
- package/dist/components/ui/custom/form/password.js +14 -0
- package/dist/components/ui/custom/form/percent.d.ts +14 -0
- package/dist/components/ui/custom/form/percent.d.ts.map +1 -0
- package/dist/components/ui/custom/form/percent.js +15 -0
- package/dist/components/ui/custom/form/phone.d.ts +16 -0
- package/dist/components/ui/custom/form/phone.d.ts.map +1 -0
- package/dist/components/ui/custom/form/phone.js +23 -0
- package/dist/components/ui/custom/form/radio-group.d.ts +23 -0
- package/dist/components/ui/custom/form/radio-group.d.ts.map +1 -0
- package/dist/components/ui/custom/form/radio-group.js +15 -0
- package/dist/components/ui/custom/form/select.d.ts +20 -0
- package/dist/components/ui/custom/form/select.d.ts.map +1 -0
- package/dist/components/ui/custom/form/select.js +12 -0
- package/dist/components/ui/custom/form/step-new-form.d.ts +10 -0
- package/dist/components/ui/custom/form/step-new-form.d.ts.map +1 -0
- package/dist/components/ui/custom/form/step-new-form.js +13 -0
- package/dist/components/ui/custom/form/switch.d.ts +13 -0
- package/dist/components/ui/custom/form/switch.d.ts.map +1 -0
- package/dist/components/ui/custom/form/switch.js +16 -0
- package/dist/components/ui/custom/form/text.d.ts +18 -0
- package/dist/components/ui/custom/form/text.d.ts.map +1 -0
- package/dist/components/ui/custom/form/text.js +14 -0
- package/dist/components/ui/custom/form/textarea.d.ts +16 -0
- package/dist/components/ui/custom/form/textarea.d.ts.map +1 -0
- package/dist/components/ui/custom/form/textarea.js +19 -0
- package/dist/components/ui/custom/form/utils.d.ts +18 -0
- package/dist/components/ui/custom/form/utils.d.ts.map +1 -0
- package/dist/components/ui/custom/form/utils.js +88 -0
- package/dist/components/ui/custom/header.d.ts +11 -0
- package/dist/components/ui/custom/header.d.ts.map +1 -0
- package/dist/components/ui/custom/header.js +74 -0
- package/dist/components/ui/custom/label.d.ts +13 -0
- package/dist/components/ui/custom/label.d.ts.map +1 -0
- package/dist/components/ui/custom/label.js +20 -0
- package/dist/components/ui/custom/not-found.d.ts +3 -0
- package/dist/components/ui/custom/not-found.d.ts.map +1 -0
- package/dist/components/ui/custom/not-found.js +9 -0
- package/dist/components/ui/custom/sidebar/app-sidebar.d.ts +5 -0
- package/dist/components/ui/custom/sidebar/app-sidebar.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/app-sidebar.js +26 -0
- package/dist/components/ui/custom/sidebar/module-switcher.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/module-switcher.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/module-switcher.js +55 -0
- package/dist/components/ui/custom/sidebar/nav-footer.d.ts +7 -0
- package/dist/components/ui/custom/sidebar/nav-footer.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-footer.js +13 -0
- package/dist/components/ui/custom/sidebar/nav-main.d.ts +7 -0
- package/dist/components/ui/custom/sidebar/nav-main.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-main.js +27 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.js +18 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts +10 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.js +10 -0
- package/dist/components/ui/custom/sidebar/nav-user.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/nav-user.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/nav-user.js +24 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-button.js +7 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts +12 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.js +5 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-item.js +7 -0
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.d.ts +9 -0
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.js +20 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.d.ts +29 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.d.ts.map +1 -0
- package/dist/components/ui/custom/sidebar/types/sidebar.js +5 -0
- package/dist/components/ui/custom/table/data-table-export.d.ts +8 -0
- package/dist/components/ui/custom/table/data-table-export.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-export.js +65 -0
- package/dist/components/ui/custom/table/data-table-footer.d.ts +25 -0
- package/dist/components/ui/custom/table/data-table-footer.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-footer.js +39 -0
- package/dist/components/ui/custom/table/data-table-header.d.ts +9 -0
- package/dist/components/ui/custom/table/data-table-header.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-header.js +11 -0
- package/dist/components/ui/custom/table/data-table-rows.d.ts +13 -0
- package/dist/components/ui/custom/table/data-table-rows.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table-rows.js +25 -0
- package/dist/components/ui/custom/table/data-table.d.ts +35 -0
- package/dist/components/ui/custom/table/data-table.d.ts.map +1 -0
- package/dist/components/ui/custom/table/data-table.js +99 -0
- package/dist/components/ui/custom/table/types/data-table.d.ts +29 -0
- package/dist/components/ui/custom/table/types/data-table.d.ts.map +1 -0
- package/dist/components/ui/custom/table/types/data-table.js +1 -0
- package/dist/components/ui/custom/theme-provider.d.ts +24 -0
- package/dist/components/ui/custom/theme-provider.d.ts.map +1 -0
- package/dist/components/ui/custom/theme-provider.js +79 -0
- package/dist/components/ui/dateRangePicker.d.ts +3 -0
- package/dist/components/ui/dateRangePicker.d.ts.map +1 -0
- package/dist/components/ui/dateRangePicker.js +15 -0
- package/dist/components/ui/dialog.d.ts +23 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +23 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +22 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +32 -0
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +60 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +9 -0
- package/dist/components/ui/input.d.ts +24 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +71 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +9 -0
- package/dist/components/ui/masks.d.ts +17 -0
- package/dist/components/ui/masks.d.ts.map +1 -0
- package/dist/components/ui/masks.js +25 -0
- package/dist/components/ui/pagination.d.ts +30 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +23 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +11 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +7 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +14 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +11 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +24 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +7 -0
- package/dist/components/ui/sheet.d.ts +26 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +37 -0
- package/dist/components/ui/sidebar.d.ts +67 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +221 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +6 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +7 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +7 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +20 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +12 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/toast.d.ts +16 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +34 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +21 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +10 -0
- package/dist/components/ui/use-calendar.d.ts +7 -0
- package/dist/components/ui/use-calendar.d.ts.map +1 -0
- package/dist/components/ui/use-calendar.js +23 -0
- package/dist/components/ui/use-toast.d.ts +46 -0
- package/dist/components/ui/use-toast.d.ts.map +1 -0
- package/dist/components/ui/use-toast.js +125 -0
- package/dist/components/use-calendar.d.ts +7 -0
- package/dist/components/use-calendar.d.ts.map +1 -0
- package/dist/components/use-calendar.js +23 -0
- package/dist/components/use-toast.d.ts +46 -0
- package/dist/components/use-toast.d.ts.map +1 -0
- package/dist/components/use-toast.js +125 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +1514 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +3233 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +3558 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/help/date-utils.d.ts +7 -0
- package/dist/lib/help/date-utils.d.ts.map +1 -0
- package/dist/lib/help/date-utils.js +34 -0
- package/dist/lib/help/format.d.ts +22 -0
- package/dist/lib/help/format.d.ts.map +1 -0
- package/dist/lib/help/format.js +140 -0
- package/dist/lib/help/theme.d.ts +291 -0
- package/dist/lib/help/theme.d.ts.map +1 -0
- package/dist/lib/help/theme.js +340 -0
- package/dist/lib/help/uuid.d.ts +2 -0
- package/dist/lib/help/uuid.d.ts.map +1 -0
- package/dist/lib/help/uuid.js +4 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/package.json +146 -0
- package/src/components/ui/accordion.tsx +48 -0
- package/src/components/ui/alert-dialog.tsx +138 -0
- package/src/components/ui/alert.tsx +36 -0
- package/src/components/ui/avatar.tsx +48 -0
- package/src/components/ui/badge.tsx +35 -0
- package/src/components/ui/breadcrumb.tsx +115 -0
- package/src/components/ui/button.tsx +43 -0
- package/src/components/ui/calendar.tsx +142 -0
- package/src/components/ui/card.tsx +35 -0
- package/src/components/ui/carousel.tsx +257 -0
- package/src/components/ui/chart.tsx +364 -0
- package/src/components/ui/checkbox.tsx +26 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/command.tsx +145 -0
- package/src/components/ui/context-menu.tsx +198 -0
- package/src/components/ui/custom/date-picker.tsx +97 -0
- package/src/components/ui/custom/form/checkbox.tsx +53 -0
- package/src/components/ui/custom/form/color.tsx +140 -0
- package/src/components/ui/custom/form/combobox.tsx +259 -0
- package/src/components/ui/custom/form/cpf-cnpj.tsx +85 -0
- package/src/components/ui/custom/form/currency.tsx +51 -0
- package/src/components/ui/custom/form/date-range.tsx +110 -0
- package/src/components/ui/custom/form/date.tsx +109 -0
- package/src/components/ui/custom/form/decimal.tsx +50 -0
- package/src/components/ui/custom/form/file.tsx +65 -0
- package/src/components/ui/custom/form/form-help-text.tsx +20 -0
- package/src/components/ui/custom/form/form-label.tsx +24 -0
- package/src/components/ui/custom/form/form-message.tsx +10 -0
- package/src/components/ui/custom/form/ghost.tsx +28 -0
- package/src/components/ui/custom/form/input.tsx +69 -0
- package/src/components/ui/custom/form/mask.tsx +78 -0
- package/src/components/ui/custom/form/multi-select.tsx +209 -0
- package/src/components/ui/custom/form/password.tsx +70 -0
- package/src/components/ui/custom/form/percent.tsx +52 -0
- package/src/components/ui/custom/form/phone.tsx +79 -0
- package/src/components/ui/custom/form/radio-group.tsx +94 -0
- package/src/components/ui/custom/form/select.tsx +62 -0
- package/src/components/ui/custom/form/step-new-form.tsx +49 -0
- package/src/components/ui/custom/form/switch.tsx +51 -0
- package/src/components/ui/custom/form/text.tsx +71 -0
- package/src/components/ui/custom/form/textarea.tsx +71 -0
- package/src/components/ui/custom/form/utils.ts +100 -0
- package/src/components/ui/custom/header.tsx +128 -0
- package/src/components/ui/custom/label.tsx +79 -0
- package/src/components/ui/custom/not-found.tsx +30 -0
- package/src/components/ui/custom/sidebar/module-switcher.tsx +58 -0
- package/src/components/ui/custom/sidebar/nav-footer.tsx +35 -0
- package/src/components/ui/custom/sidebar/nav-main.tsx +64 -0
- package/src/components/ui/custom/sidebar/nav-submenu-collapsible.tsx +60 -0
- package/src/components/ui/custom/sidebar/nav-submenu-dropdown.tsx +56 -0
- package/src/components/ui/custom/sidebar/nav-user.tsx +77 -0
- package/src/components/ui/custom/sidebar/sidebar-button.tsx +30 -0
- package/src/components/ui/custom/sidebar/sidebar-item-two-lines.tsx +25 -0
- package/src/components/ui/custom/sidebar/sidebar-item.tsx +19 -0
- package/src/components/ui/custom/sidebar/types/sidebar.ts +31 -0
- package/src/components/ui/custom/table/data-table-export.tsx +126 -0
- package/src/components/ui/custom/table/data-table-footer.tsx +148 -0
- package/src/components/ui/custom/table/data-table-header.tsx +58 -0
- package/src/components/ui/custom/table/data-table-rows.tsx +94 -0
- package/src/components/ui/custom/table/data-table.tsx +285 -0
- package/src/components/ui/custom/table/types/data-table.ts +31 -0
- package/src/components/ui/custom/theme-provider.tsx +121 -0
- package/src/components/ui/dateRangePicker.tsx +63 -0
- package/src/components/ui/dialog.tsx +84 -0
- package/src/components/ui/drawer.tsx +116 -0
- package/src/components/ui/dropdown-menu.tsx +173 -0
- package/src/components/ui/form.tsx +114 -0
- package/src/components/ui/hover-card.tsx +27 -0
- package/src/components/ui/input.tsx +265 -0
- package/src/components/ui/label.tsx +15 -0
- package/src/components/ui/masks.ts +35 -0
- package/src/components/ui/pagination.tsx +78 -0
- package/src/components/ui/popover.tsx +32 -0
- package/src/components/ui/progress.tsx +22 -0
- package/src/components/ui/radio-group.tsx +36 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.tsx +130 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.tsx +90 -0
- package/src/components/ui/sidebar.tsx +598 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +18 -0
- package/src/components/ui/switch.tsx +26 -0
- package/src/components/ui/table.tsx +53 -0
- package/src/components/ui/tabs.tsx +47 -0
- package/src/components/ui/textarea.tsx +27 -0
- package/src/components/ui/toast.tsx +88 -0
- package/src/components/ui/toaster.tsx +49 -0
- package/src/components/ui/tooltip.tsx +31 -0
- package/src/components/ui/use-calendar.tsx +61 -0
- package/src/components/ui/use-toast.ts +186 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +299 -0
- package/src/lib/help/date-utils.ts +41 -0
- package/src/lib/help/format.ts +171 -0
- package/src/lib/help/theme.ts +346 -0
- package/src/lib/help/uuid.ts +4 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/globals.css +59 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const SidebarSubmenuType = {
|
|
2
|
+
COLLAPSIBLE: 'collapsible',
|
|
3
|
+
// Deprecated: Use COLLAPSIBLE instead
|
|
4
|
+
DROPDOWN: 'dropdown',
|
|
5
|
+
} as const;
|
|
6
|
+
export type SidebarSubmenuType = (typeof SidebarSubmenuType)[keyof typeof SidebarSubmenuType];
|
|
7
|
+
|
|
8
|
+
export interface Module {
|
|
9
|
+
value: string;
|
|
10
|
+
path: string;
|
|
11
|
+
title: string;
|
|
12
|
+
icon: React.ReactNode;
|
|
13
|
+
subTitle: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface SidebarPage {
|
|
17
|
+
module: Module;
|
|
18
|
+
path: string;
|
|
19
|
+
icon?: React.ReactNode;
|
|
20
|
+
title: string;
|
|
21
|
+
hideSidebar: boolean;
|
|
22
|
+
displayOnlyresellerIsAdm?: boolean;
|
|
23
|
+
subMenuType?: SidebarSubmenuType;
|
|
24
|
+
subMenuItems?: {
|
|
25
|
+
label: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
path: string;
|
|
28
|
+
displayOnlyresellerIsAdm?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
2
|
+
import { FieldErrors, useForm } from 'react-hook-form';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { Button } from '../../button';
|
|
5
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '../../dialog';
|
|
6
|
+
import { Form } from '../../form';
|
|
7
|
+
import { toast } from '../../use-toast';
|
|
8
|
+
import { FormRadioGroup } from '../form/radio-group';
|
|
9
|
+
import { ExportDataTable } from './types/data-table';
|
|
10
|
+
|
|
11
|
+
interface DataTableExportProps {
|
|
12
|
+
exportData?: ExportDataTable;
|
|
13
|
+
totalRows: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function DataTableExport({ exportData, totalRows }: DataTableExportProps) {
|
|
17
|
+
const exportXlSX = () => {
|
|
18
|
+
if (!exportData) return;
|
|
19
|
+
|
|
20
|
+
if (totalRows === 0) {
|
|
21
|
+
toast({
|
|
22
|
+
title: 'Não há dados para exportar.',
|
|
23
|
+
variant: 'destructive',
|
|
24
|
+
});
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
const params = new URLSearchParams(exportData.params).toString();
|
|
28
|
+
window.open(`${exportData.url}?${params}`, '_blank');
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const renderExport = () => {
|
|
32
|
+
if (!exportData) return null;
|
|
33
|
+
|
|
34
|
+
if (exportData.type === 'xlsx') {
|
|
35
|
+
return (
|
|
36
|
+
<Button variant='secondary' onClick={exportXlSX}>
|
|
37
|
+
Exportar
|
|
38
|
+
</Button>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (exportData.type === 'dialog') {
|
|
43
|
+
const ExportDataSchema = z.object({
|
|
44
|
+
model: z.string(),
|
|
45
|
+
format: z.string(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const form = useForm<z.infer<typeof ExportDataSchema>>({
|
|
49
|
+
mode: 'onTouched',
|
|
50
|
+
resolver: zodResolver(ExportDataSchema),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const { control, trigger, handleSubmit } = form;
|
|
54
|
+
|
|
55
|
+
const onSubmit = async (values: z.infer<typeof ExportDataSchema>) => {
|
|
56
|
+
await trigger();
|
|
57
|
+
|
|
58
|
+
toast({
|
|
59
|
+
title: 'Em desenvolvimento.',
|
|
60
|
+
variant: 'destructive',
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const onError = async (errors: FieldErrors<z.infer<typeof ExportDataSchema>>) => {
|
|
65
|
+
toast({
|
|
66
|
+
title: 'Erro ao salvar',
|
|
67
|
+
description: 'Verifique os campos obrigatórios',
|
|
68
|
+
variant: 'destructive',
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Form {...(form as any)} onSubmit={handleSubmit(onSubmit, onError)}>
|
|
74
|
+
<Dialog>
|
|
75
|
+
<DialogTrigger asChild>
|
|
76
|
+
<Button variant='secondary'>Exportar</Button>
|
|
77
|
+
</DialogTrigger>
|
|
78
|
+
<DialogContent hideClose className='fixed p-6 rounded-lg w-[451px]'>
|
|
79
|
+
<DialogHeader>
|
|
80
|
+
<DialogTitle>Exportar</DialogTitle>
|
|
81
|
+
<DialogDescription />
|
|
82
|
+
</DialogHeader>
|
|
83
|
+
<div className='flex flex-col gap-6'>
|
|
84
|
+
<FormRadioGroup
|
|
85
|
+
control={control}
|
|
86
|
+
name='model'
|
|
87
|
+
label='Selecione o modelo de visualização'
|
|
88
|
+
options={[
|
|
89
|
+
{ value: '0', label: 'Resumido' },
|
|
90
|
+
{ value: '1', label: 'Detalhado' },
|
|
91
|
+
]}
|
|
92
|
+
className='text-sm font-normal'
|
|
93
|
+
classNameOptions='flex flex-col gap-4 mt-4 text-sm font-normal'
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<FormRadioGroup
|
|
97
|
+
control={control}
|
|
98
|
+
name='format'
|
|
99
|
+
label='Selecione o formato desejado para exportação'
|
|
100
|
+
options={[
|
|
101
|
+
{ value: '0', label: 'PDF' },
|
|
102
|
+
{ value: '1', label: 'XLSX' },
|
|
103
|
+
]}
|
|
104
|
+
className='text-sm font-normal'
|
|
105
|
+
classNameOptions='flex flex-col gap-4 mt-4 text-sm font-normal'
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
<DialogFooter className='sm:justify-end gap-2'>
|
|
109
|
+
<Button type='button' variant='secondary'>
|
|
110
|
+
Fechar
|
|
111
|
+
</Button>
|
|
112
|
+
<Button type='button' variant='default' onClick={() => exportXlSX()}>
|
|
113
|
+
Exportar
|
|
114
|
+
</Button>
|
|
115
|
+
</DialogFooter>
|
|
116
|
+
</DialogContent>
|
|
117
|
+
</Dialog>
|
|
118
|
+
</Form>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return null;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return exportData && renderExport();
|
|
126
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { PaginationState } from '@tanstack/react-table';
|
|
2
|
+
import { Badge } from '../../badge';
|
|
3
|
+
import {
|
|
4
|
+
Pagination,
|
|
5
|
+
PaginationContent,
|
|
6
|
+
PaginationEllipsis,
|
|
7
|
+
PaginationItem,
|
|
8
|
+
PaginationLink,
|
|
9
|
+
PaginationNext,
|
|
10
|
+
PaginationPrevious,
|
|
11
|
+
} from '../../pagination';
|
|
12
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '../../select';
|
|
13
|
+
import { DataTableExport } from './data-table-export';
|
|
14
|
+
import { ExportDataTable } from './types/data-table';
|
|
15
|
+
|
|
16
|
+
interface DataTableFooterProps<TData> {
|
|
17
|
+
hidePagination?: boolean;
|
|
18
|
+
disablePagination?: boolean;
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
totalRows: number;
|
|
21
|
+
totalPages: number;
|
|
22
|
+
currentPage: number;
|
|
23
|
+
pagination: PaginationState;
|
|
24
|
+
handlePageSize: (value: number) => void;
|
|
25
|
+
handlePage: (value: number) => void;
|
|
26
|
+
previousPage: {
|
|
27
|
+
action: () => void;
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
};
|
|
30
|
+
nextPage: {
|
|
31
|
+
action: () => void;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
};
|
|
34
|
+
exportData?: ExportDataTable;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function DataTableFooter<TData>({
|
|
38
|
+
isLoading,
|
|
39
|
+
totalRows,
|
|
40
|
+
totalPages,
|
|
41
|
+
currentPage,
|
|
42
|
+
hidePagination,
|
|
43
|
+
disablePagination,
|
|
44
|
+
pagination,
|
|
45
|
+
handlePageSize,
|
|
46
|
+
handlePage,
|
|
47
|
+
previousPage,
|
|
48
|
+
nextPage,
|
|
49
|
+
exportData,
|
|
50
|
+
}: DataTableFooterProps<TData>) {
|
|
51
|
+
const renderPaginationPages = () => {
|
|
52
|
+
const paginationItems: JSX.Element[] = [];
|
|
53
|
+
|
|
54
|
+
const createPaginationItem = (pageIndex: number) => (
|
|
55
|
+
<PaginationItem key={pageIndex}>
|
|
56
|
+
<PaginationLink onClick={() => handlePage(pageIndex)} isActive={currentPage === pageIndex}>
|
|
57
|
+
{pageIndex + 1}
|
|
58
|
+
</PaginationLink>
|
|
59
|
+
</PaginationItem>
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
// Add first page
|
|
63
|
+
paginationItems.push(createPaginationItem(0));
|
|
64
|
+
|
|
65
|
+
// Add ellipsis if needed
|
|
66
|
+
if (currentPage > 2) {
|
|
67
|
+
paginationItems.push(<PaginationEllipsis key='start-ellipsis' />);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Add pages before current page
|
|
71
|
+
for (let i = Math.max(1, currentPage - 1); i < currentPage; i++) {
|
|
72
|
+
paginationItems.push(createPaginationItem(i));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Add current page
|
|
76
|
+
if (currentPage !== 0 && currentPage !== totalPages - 1) {
|
|
77
|
+
paginationItems.push(createPaginationItem(currentPage));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Add pages after current page
|
|
81
|
+
for (let i = currentPage + 1; i <= Math.min(totalPages - 2, currentPage + 1); i++) {
|
|
82
|
+
paginationItems.push(createPaginationItem(i));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Add ellipsis if needed
|
|
86
|
+
if (currentPage < totalPages - 3) {
|
|
87
|
+
paginationItems.push(<PaginationEllipsis key='end-ellipsis' />);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Add last page
|
|
91
|
+
if (totalPages > 1) {
|
|
92
|
+
paginationItems.push(createPaginationItem(totalPages - 1));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return paginationItems;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
!hidePagination && (
|
|
100
|
+
<footer className='flex items-center justify-between h-[64px]'>
|
|
101
|
+
<div className='flex flex-row items-center gap-6'>
|
|
102
|
+
<div className='flex flex-row items-center gap-2'>
|
|
103
|
+
Linhas por página
|
|
104
|
+
<Select
|
|
105
|
+
value={pagination.pageSize.toString()}
|
|
106
|
+
onValueChange={(value) => handlePageSize(Number(value))}
|
|
107
|
+
disabled={isLoading || disablePagination}
|
|
108
|
+
>
|
|
109
|
+
<SelectTrigger className='w-20'>
|
|
110
|
+
<SelectValue placeholder='' className='text-slate-800 font-medium' />
|
|
111
|
+
</SelectTrigger>
|
|
112
|
+
<SelectContent>
|
|
113
|
+
<SelectGroup>
|
|
114
|
+
<SelectItem value='25'>25</SelectItem>
|
|
115
|
+
<SelectItem value='50'>50</SelectItem>
|
|
116
|
+
<SelectItem value='100'>100</SelectItem>
|
|
117
|
+
</SelectGroup>
|
|
118
|
+
</SelectContent>
|
|
119
|
+
</Select>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<DataTableExport exportData={exportData} totalRows={totalPages} />
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div className='flex items-center gap-4'>
|
|
126
|
+
<div>
|
|
127
|
+
{!isLoading && (
|
|
128
|
+
<Badge variant='secondary'>{totalRows === 0 ? 'Nenhum item' : totalRows === 1 ? '1 item' : `${totalRows} itens`}</Badge>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
<div>
|
|
132
|
+
<Pagination>
|
|
133
|
+
<PaginationContent>
|
|
134
|
+
<PaginationItem>
|
|
135
|
+
<PaginationPrevious onClick={() => previousPage.action()} disabled={previousPage.disabled || disablePagination} />
|
|
136
|
+
</PaginationItem>
|
|
137
|
+
{renderPaginationPages()}
|
|
138
|
+
<PaginationItem>
|
|
139
|
+
<PaginationNext onClick={() => nextPage.action()} disabled={nextPage.disabled || disablePagination} />
|
|
140
|
+
</PaginationItem>
|
|
141
|
+
</PaginationContent>
|
|
142
|
+
</Pagination>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</footer>
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Table, flexRender } from '@tanstack/react-table';
|
|
2
|
+
import { ArrowUpDown, MoveDown, MoveUp } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../../../lib/utils';
|
|
4
|
+
import { Button } from '../../button';
|
|
5
|
+
import { Checkbox } from '../../checkbox';
|
|
6
|
+
import { TableHead, TableHeader, TableRow } from '../../table';
|
|
7
|
+
|
|
8
|
+
interface DataTableHeaderProps<TData> {
|
|
9
|
+
table: Table<TData>;
|
|
10
|
+
canActionsRow?: boolean;
|
|
11
|
+
enableMultiRowSelection?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function DataTableHeader<TData>({ table, canActionsRow, enableMultiRowSelection }: DataTableHeaderProps<TData>) {
|
|
15
|
+
const headerGroups = table.getHeaderGroups();
|
|
16
|
+
return (
|
|
17
|
+
<TableHeader>
|
|
18
|
+
{headerGroups.map((headerGroup) => (
|
|
19
|
+
<TableRow key={headerGroup.id} className='bg-background dark:bg-datatable-accent rounded-t-md sticky top-0 z-10'>
|
|
20
|
+
{enableMultiRowSelection && (
|
|
21
|
+
<TableHead className='h-[65px] w-6'>
|
|
22
|
+
<Checkbox
|
|
23
|
+
checked={table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate')}
|
|
24
|
+
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
|
|
25
|
+
/>
|
|
26
|
+
</TableHead>
|
|
27
|
+
)}
|
|
28
|
+
{headerGroup.headers.map((header) => (
|
|
29
|
+
<TableHead
|
|
30
|
+
key={header.id}
|
|
31
|
+
className={cn(
|
|
32
|
+
'h-[65px] whitespace-nowrap',
|
|
33
|
+
header.column.id === 'id' ? 'sticky left-0 z-20' : '',
|
|
34
|
+
header.column.columnDef.enableSorting ? 'pl-2' : '',
|
|
35
|
+
)}
|
|
36
|
+
>
|
|
37
|
+
{header.column.columnDef.enableSorting ? (
|
|
38
|
+
<Button variant='ghost' onClick={() => header.column.toggleSorting(header.column.getIsSorted() === 'asc')}>
|
|
39
|
+
{flexRender(header.column.columnDef.header, header.getContext())}
|
|
40
|
+
{header.column.getIsSorted() === 'asc' ? (
|
|
41
|
+
<MoveUp className='ml-2 h-4 w-4' />
|
|
42
|
+
) : header.column.getIsSorted() === 'desc' ? (
|
|
43
|
+
<MoveDown className='ml-2 h-4 w-4' />
|
|
44
|
+
) : (
|
|
45
|
+
<ArrowUpDown className='ml-2 h-4 w-4' />
|
|
46
|
+
)}
|
|
47
|
+
</Button>
|
|
48
|
+
) : (
|
|
49
|
+
flexRender(header.column.columnDef.header, header.getContext())
|
|
50
|
+
)}
|
|
51
|
+
</TableHead>
|
|
52
|
+
))}
|
|
53
|
+
{canActionsRow && <TableHead />}
|
|
54
|
+
</TableRow>
|
|
55
|
+
))}
|
|
56
|
+
</TableHeader>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ColumnDef, Table, flexRender } from '@tanstack/react-table';
|
|
2
|
+
import { cn } from '../../../../lib/utils';
|
|
3
|
+
import { Button } from '../../button';
|
|
4
|
+
import { Checkbox } from '../../checkbox';
|
|
5
|
+
import { Skeleton } from '../../skeleton';
|
|
6
|
+
import { TableCell, TableRow } from '../../table';
|
|
7
|
+
import { ActionRow } from './types/data-table';
|
|
8
|
+
|
|
9
|
+
interface DataTableRowsProps<TData> {
|
|
10
|
+
table: Table<TData>;
|
|
11
|
+
columns: ColumnDef<TData>[];
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
actionsRow?: ActionRow[];
|
|
14
|
+
textNoRecords?: string;
|
|
15
|
+
enableMultiRowSelection?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function DataTableRows<TData>({ table, isLoading, columns, actionsRow, textNoRecords, enableMultiRowSelection }: DataTableRowsProps<TData>) {
|
|
19
|
+
const rows = table.getRowModel().rows;
|
|
20
|
+
|
|
21
|
+
const renderLoadingRows = () => {
|
|
22
|
+
const rows: JSX.Element[] = [];
|
|
23
|
+
|
|
24
|
+
for (let i = 0; i < 10; i++) {
|
|
25
|
+
rows.push(
|
|
26
|
+
<TableRow key={`loading-row-${i}`}>
|
|
27
|
+
{enableMultiRowSelection && (
|
|
28
|
+
<TableCell className='py-2'>
|
|
29
|
+
<Skeleton className='h-10 w-full' />
|
|
30
|
+
</TableCell>
|
|
31
|
+
)}
|
|
32
|
+
{columns.map((column) => (
|
|
33
|
+
<TableCell key={column.id} className='py-2'>
|
|
34
|
+
<Skeleton className='h-10 w-full' />
|
|
35
|
+
</TableCell>
|
|
36
|
+
))}
|
|
37
|
+
</TableRow>,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return rows;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const renderRows = () => {
|
|
45
|
+
return rows.map((row) => (
|
|
46
|
+
<TableRow key={row.id} data-state={row.getIsSelected() && 'selected'} className='group'>
|
|
47
|
+
{enableMultiRowSelection && (
|
|
48
|
+
<TableCell className='py-4'>
|
|
49
|
+
<Checkbox checked={row.getIsSelected()} onCheckedChange={(value) => row.toggleSelected(!!value)} aria-label='Select row' />
|
|
50
|
+
</TableCell>
|
|
51
|
+
)}
|
|
52
|
+
{row.getVisibleCells().map((cell) => (
|
|
53
|
+
<TableCell key={cell.id} className='py-4'>
|
|
54
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
55
|
+
</TableCell>
|
|
56
|
+
))}
|
|
57
|
+
{actionsRow && (
|
|
58
|
+
<TableCell
|
|
59
|
+
className='opacity-0 group-hover:opacity-100 hover:opacity-100 relative overflow-visible w-[0px]'
|
|
60
|
+
key={`buttons-${row.id}`}
|
|
61
|
+
>
|
|
62
|
+
<div className='absolute transition-colors group-hover:bg-datatable-accent overflow-visible right-5 -translate-y-1/2 flex space-x-4'>
|
|
63
|
+
{actionsRow.map((action, index) => (
|
|
64
|
+
<Button
|
|
65
|
+
key={`action-row-${index}`}
|
|
66
|
+
variant={(action.variant as 'link' | 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost') || 'default'}
|
|
67
|
+
className={cn('bg-datatable-accent', action.className?.(row.original) || '')}
|
|
68
|
+
onClick={() => action.onClick?.(row.original)}
|
|
69
|
+
disabled={action.disabled?.(row.original) || false}
|
|
70
|
+
>
|
|
71
|
+
{action.icon}
|
|
72
|
+
{action.label}
|
|
73
|
+
</Button>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
</TableCell>
|
|
77
|
+
)}
|
|
78
|
+
</TableRow>
|
|
79
|
+
));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const renderEmptyRows = () => {
|
|
83
|
+
const colSpan = columns.length + (actionsRow ? 1 : 0);
|
|
84
|
+
return (
|
|
85
|
+
<TableRow>
|
|
86
|
+
<TableCell colSpan={colSpan} className='text-center h-[53px]'>
|
|
87
|
+
{textNoRecords ? textNoRecords : 'Sem resultados.'}
|
|
88
|
+
</TableCell>
|
|
89
|
+
</TableRow>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return isLoading ? renderLoadingRows() : rows.length ? renderRows() : renderEmptyRows();
|
|
94
|
+
}
|