eai-frontend-components 2.0.7 → 2.0.8
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/dist/index.d.ts +24 -73
- package/package.json +1 -1
- package/dist/components/accordion.d.ts +0 -8
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js +0 -13
- package/dist/components/alert-dialog.d.ts +0 -25
- package/dist/components/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert-dialog.js +0 -27
- package/dist/components/alert.d.ts +0 -9
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/alert.js +0 -22
- package/dist/components/avatar.d.ts +0 -7
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/avatar.js +0 -11
- package/dist/components/badge.d.ts +0 -10
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/badge.js +0 -26
- package/dist/components/breadcrumb.d.ts +0 -20
- package/dist/components/breadcrumb.d.ts.map +0 -1
- package/dist/components/breadcrumb.js +0 -23
- package/dist/components/button.d.ts +0 -12
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/button.js +0 -33
- package/dist/components/calendar.d.ts +0 -9
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/calendar.js +0 -70
- package/dist/components/card.d.ts +0 -9
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js +0 -16
- package/dist/components/carousel.d.ts +0 -19
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/carousel.js +0 -98
- package/dist/components/chart.d.ts +0 -63
- package/dist/components/chart.d.ts.map +0 -1
- package/dist/components/chart.js +0 -130
- package/dist/components/checkbox.d.ts +0 -5
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox.js +0 -8
- package/dist/components/collapsible.d.ts +0 -6
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/collapsible.js +0 -5
- package/dist/components/command.d.ts +0 -81
- package/dist/components/command.d.ts.map +0 -1
- package/dist/components/command.js +0 -28
- package/dist/components/context-menu.d.ts +0 -28
- package/dist/components/context-menu.d.ts.map +0 -1
- package/dist/components/context-menu.js +0 -33
- package/dist/components/custom/date-picker.d.ts +0 -12
- package/dist/components/custom/date-picker.d.ts.map +0 -1
- package/dist/components/custom/date-picker.js +0 -35
- package/dist/components/custom/form/checkbox.d.ts +0 -13
- package/dist/components/custom/form/checkbox.d.ts.map +0 -1
- package/dist/components/custom/form/checkbox.js +0 -15
- package/dist/components/custom/form/color.d.ts +0 -15
- package/dist/components/custom/form/color.d.ts.map +0 -1
- package/dist/components/custom/form/color.js +0 -40
- package/dist/components/custom/form/combobox.d.ts +0 -37
- package/dist/components/custom/form/combobox.d.ts.map +0 -1
- package/dist/components/custom/form/combobox.js +0 -82
- package/dist/components/custom/form/cpf-cnpj.d.ts +0 -16
- package/dist/components/custom/form/cpf-cnpj.d.ts.map +0 -1
- package/dist/components/custom/form/cpf-cnpj.js +0 -32
- package/dist/components/custom/form/currency.d.ts +0 -14
- package/dist/components/custom/form/currency.d.ts.map +0 -1
- package/dist/components/custom/form/currency.js +0 -15
- package/dist/components/custom/form/date-range.d.ts +0 -16
- package/dist/components/custom/form/date-range.d.ts.map +0 -1
- package/dist/components/custom/form/date-range.js +0 -24
- package/dist/components/custom/form/date.d.ts +0 -16
- package/dist/components/custom/form/date.d.ts.map +0 -1
- package/dist/components/custom/form/date.js +0 -35
- package/dist/components/custom/form/decimal.d.ts +0 -14
- package/dist/components/custom/form/decimal.d.ts.map +0 -1
- package/dist/components/custom/form/decimal.js +0 -15
- package/dist/components/custom/form/file.d.ts +0 -15
- package/dist/components/custom/form/file.d.ts.map +0 -1
- package/dist/components/custom/form/file.js +0 -18
- package/dist/components/custom/form/form-help-text.d.ts +0 -3
- package/dist/components/custom/form/form-help-text.d.ts.map +0 -1
- package/dist/components/custom/form/form-help-text.js +0 -7
- package/dist/components/custom/form/form-label.d.ts +0 -4
- package/dist/components/custom/form/form-label.d.ts.map +0 -1
- package/dist/components/custom/form/form-label.js +0 -9
- package/dist/components/custom/form/form-message.d.ts +0 -3
- package/dist/components/custom/form/form-message.d.ts.map +0 -1
- package/dist/components/custom/form/form-message.js +0 -5
- package/dist/components/custom/form/ghost.d.ts +0 -8
- package/dist/components/custom/form/ghost.d.ts.map +0 -1
- package/dist/components/custom/form/ghost.js +0 -8
- package/dist/components/custom/form/input.d.ts +0 -18
- package/dist/components/custom/form/input.d.ts.map +0 -1
- package/dist/components/custom/form/input.js +0 -14
- package/dist/components/custom/form/mask.d.ts +0 -19
- package/dist/components/custom/form/mask.d.ts.map +0 -1
- package/dist/components/custom/form/mask.js +0 -19
- package/dist/components/custom/form/multi-select-old.d.ts +0 -19
- package/dist/components/custom/form/multi-select-old.d.ts.map +0 -1
- package/dist/components/custom/form/multi-select-old.js +0 -30
- package/dist/components/custom/form/multi-select.d.ts +0 -26
- package/dist/components/custom/form/multi-select.d.ts.map +0 -1
- package/dist/components/custom/form/multi-select.js +0 -66
- package/dist/components/custom/form/password.d.ts +0 -16
- package/dist/components/custom/form/password.d.ts.map +0 -1
- package/dist/components/custom/form/password.js +0 -14
- package/dist/components/custom/form/percent.d.ts +0 -14
- package/dist/components/custom/form/percent.d.ts.map +0 -1
- package/dist/components/custom/form/percent.js +0 -15
- package/dist/components/custom/form/phone.d.ts +0 -16
- package/dist/components/custom/form/phone.d.ts.map +0 -1
- package/dist/components/custom/form/phone.js +0 -23
- package/dist/components/custom/form/radio-group.d.ts +0 -23
- package/dist/components/custom/form/radio-group.d.ts.map +0 -1
- package/dist/components/custom/form/radio-group.js +0 -15
- package/dist/components/custom/form/select.d.ts +0 -20
- package/dist/components/custom/form/select.d.ts.map +0 -1
- package/dist/components/custom/form/select.js +0 -12
- package/dist/components/custom/form/step-new-form.d.ts +0 -10
- package/dist/components/custom/form/step-new-form.d.ts.map +0 -1
- package/dist/components/custom/form/step-new-form.js +0 -13
- package/dist/components/custom/form/switch.d.ts +0 -13
- package/dist/components/custom/form/switch.d.ts.map +0 -1
- package/dist/components/custom/form/switch.js +0 -16
- package/dist/components/custom/form/text.d.ts +0 -18
- package/dist/components/custom/form/text.d.ts.map +0 -1
- package/dist/components/custom/form/text.js +0 -14
- package/dist/components/custom/form/textarea.d.ts +0 -16
- package/dist/components/custom/form/textarea.d.ts.map +0 -1
- package/dist/components/custom/form/textarea.js +0 -19
- package/dist/components/custom/form/utils.d.ts +0 -18
- package/dist/components/custom/form/utils.d.ts.map +0 -1
- package/dist/components/custom/form/utils.js +0 -88
- package/dist/components/custom/header.d.ts +0 -3
- package/dist/components/custom/header.d.ts.map +0 -1
- package/dist/components/custom/header.js +0 -94
- package/dist/components/custom/label.d.ts +0 -13
- package/dist/components/custom/label.d.ts.map +0 -1
- package/dist/components/custom/label.js +0 -20
- package/dist/components/custom/not-found.d.ts +0 -3
- package/dist/components/custom/not-found.d.ts.map +0 -1
- package/dist/components/custom/not-found.js +0 -9
- package/dist/components/custom/sidebar/app-sidebar.d.ts +0 -5
- package/dist/components/custom/sidebar/app-sidebar.d.ts.map +0 -1
- package/dist/components/custom/sidebar/app-sidebar.js +0 -26
- package/dist/components/custom/sidebar/module-switcher.d.ts +0 -3
- package/dist/components/custom/sidebar/module-switcher.d.ts.map +0 -1
- package/dist/components/custom/sidebar/module-switcher.js +0 -55
- package/dist/components/custom/sidebar/nav-footer.d.ts +0 -3
- package/dist/components/custom/sidebar/nav-footer.d.ts.map +0 -1
- package/dist/components/custom/sidebar/nav-footer.js +0 -17
- package/dist/components/custom/sidebar/nav-main.d.ts +0 -3
- package/dist/components/custom/sidebar/nav-main.d.ts.map +0 -1
- package/dist/components/custom/sidebar/nav-main.js +0 -32
- package/dist/components/custom/sidebar/nav-submenu-collapsible.d.ts +0 -9
- package/dist/components/custom/sidebar/nav-submenu-collapsible.d.ts.map +0 -1
- package/dist/components/custom/sidebar/nav-submenu-collapsible.js +0 -21
- package/dist/components/custom/sidebar/nav-submenu-dropdown.d.ts +0 -10
- package/dist/components/custom/sidebar/nav-submenu-dropdown.d.ts.map +0 -1
- package/dist/components/custom/sidebar/nav-submenu-dropdown.js +0 -13
- package/dist/components/custom/sidebar/nav-user.d.ts +0 -3
- package/dist/components/custom/sidebar/nav-user.d.ts.map +0 -1
- package/dist/components/custom/sidebar/nav-user.js +0 -51
- package/dist/components/custom/sidebar/sidebar-button.d.ts +0 -9
- package/dist/components/custom/sidebar/sidebar-button.d.ts.map +0 -1
- package/dist/components/custom/sidebar/sidebar-button.js +0 -7
- package/dist/components/custom/sidebar/sidebar-item-two-lines.d.ts +0 -12
- package/dist/components/custom/sidebar/sidebar-item-two-lines.d.ts.map +0 -1
- package/dist/components/custom/sidebar/sidebar-item-two-lines.js +0 -5
- package/dist/components/custom/sidebar/sidebar-item.d.ts +0 -9
- package/dist/components/custom/sidebar/sidebar-item.d.ts.map +0 -1
- package/dist/components/custom/sidebar/sidebar-item.js +0 -7
- package/dist/components/custom/sidebar/types/sidebar.d.ts +0 -29
- package/dist/components/custom/sidebar/types/sidebar.d.ts.map +0 -1
- package/dist/components/custom/sidebar/types/sidebar.js +0 -5
- package/dist/components/custom/table/data-table-export.d.ts +0 -8
- package/dist/components/custom/table/data-table-export.d.ts.map +0 -1
- package/dist/components/custom/table/data-table-export.js +0 -65
- package/dist/components/custom/table/data-table-footer.d.ts +0 -25
- package/dist/components/custom/table/data-table-footer.d.ts.map +0 -1
- package/dist/components/custom/table/data-table-footer.js +0 -39
- package/dist/components/custom/table/data-table-header.d.ts +0 -9
- package/dist/components/custom/table/data-table-header.d.ts.map +0 -1
- package/dist/components/custom/table/data-table-header.js +0 -11
- package/dist/components/custom/table/data-table-rows.d.ts +0 -13
- package/dist/components/custom/table/data-table-rows.d.ts.map +0 -1
- package/dist/components/custom/table/data-table-rows.js +0 -25
- package/dist/components/custom/table/data-table.d.ts +0 -35
- package/dist/components/custom/table/data-table.d.ts.map +0 -1
- package/dist/components/custom/table/data-table.js +0 -99
- package/dist/components/custom/table/types/data-table.d.ts +0 -29
- package/dist/components/custom/table/types/data-table.d.ts.map +0 -1
- package/dist/components/custom/table/types/data-table.js +0 -1
- package/dist/components/custom/theme-provider.d.ts +0 -24
- package/dist/components/custom/theme-provider.d.ts.map +0 -1
- package/dist/components/custom/theme-provider.js +0 -79
- package/dist/components/dateRangePicker.d.ts +0 -3
- package/dist/components/dateRangePicker.d.ts.map +0 -1
- package/dist/components/dateRangePicker.js +0 -15
- package/dist/components/dialog.d.ts +0 -23
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dialog.js +0 -23
- package/dist/components/drawer.d.ts +0 -23
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/drawer.js +0 -22
- package/dist/components/dropdown-menu.d.ts +0 -28
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu.js +0 -32
- package/dist/components/form.d.ts +0 -24
- package/dist/components/form.d.ts.map +0 -1
- package/dist/components/form.js +0 -60
- package/dist/components/hover-card.d.ts +0 -7
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card.js +0 -9
- package/dist/components/input.d.ts +0 -24
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/input.js +0 -71
- package/dist/components/label.d.ts +0 -6
- package/dist/components/label.d.ts.map +0 -1
- package/dist/components/label.js +0 -9
- package/dist/components/masks.d.ts +0 -17
- package/dist/components/masks.d.ts.map +0 -1
- package/dist/components/masks.js +0 -25
- package/dist/components/pagination.d.ts +0 -30
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/pagination.js +0 -23
- package/dist/components/popover.d.ts +0 -7
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/popover.js +0 -11
- package/dist/components/progress.d.ts +0 -5
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/progress.js +0 -7
- package/dist/components/radio-group.d.ts +0 -6
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group.js +0 -14
- package/dist/components/scroll-area.d.ts +0 -6
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/scroll-area.js +0 -11
- package/dist/components/select.d.ts +0 -14
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/select.js +0 -24
- package/dist/components/separator.d.ts +0 -5
- package/dist/components/separator.d.ts.map +0 -1
- package/dist/components/separator.js +0 -7
- package/dist/components/sheet.d.ts +0 -26
- package/dist/components/sheet.d.ts.map +0 -1
- package/dist/components/sheet.js +0 -37
- package/dist/components/sidebar.d.ts +0 -67
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/sidebar.js +0 -221
- package/dist/components/skeleton.d.ts +0 -3
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton.js +0 -6
- package/dist/components/slider.d.ts +0 -5
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/slider.js +0 -7
- package/dist/components/switch.d.ts +0 -5
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/switch.js +0 -7
- package/dist/components/table.d.ts +0 -11
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/table.js +0 -20
- package/dist/components/tabs.d.ts +0 -8
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js +0 -12
- package/dist/components/textarea.d.ts +0 -4
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/textarea.js +0 -14
- package/dist/components/toast.d.ts +0 -16
- package/dist/components/toast.d.ts.map +0 -1
- package/dist/components/toast.js +0 -34
- package/dist/components/toaster.d.ts +0 -2
- package/dist/components/toaster.d.ts.map +0 -1
- package/dist/components/toaster.js +0 -21
- package/dist/components/tooltip.d.ts +0 -8
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip.js +0 -10
- package/dist/components/ui/accordion.d.ts +0 -8
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js +0 -13
- package/dist/components/ui/alert-dialog.d.ts +0 -25
- package/dist/components/ui/alert-dialog.d.ts.map +0 -1
- package/dist/components/ui/alert-dialog.js +0 -27
- package/dist/components/ui/alert.d.ts +0 -9
- package/dist/components/ui/alert.d.ts.map +0 -1
- package/dist/components/ui/alert.js +0 -22
- package/dist/components/ui/avatar.d.ts +0 -7
- package/dist/components/ui/avatar.d.ts.map +0 -1
- package/dist/components/ui/avatar.js +0 -11
- package/dist/components/ui/badge.d.ts +0 -10
- package/dist/components/ui/badge.d.ts.map +0 -1
- package/dist/components/ui/badge.js +0 -26
- package/dist/components/ui/breadcrumb.d.ts +0 -20
- package/dist/components/ui/breadcrumb.d.ts.map +0 -1
- package/dist/components/ui/breadcrumb.js +0 -23
- package/dist/components/ui/button.d.ts +0 -12
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js +0 -33
- package/dist/components/ui/calendar.d.ts +0 -9
- package/dist/components/ui/calendar.d.ts.map +0 -1
- package/dist/components/ui/calendar.js +0 -70
- package/dist/components/ui/card.d.ts +0 -9
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/card.js +0 -16
- package/dist/components/ui/carousel.d.ts +0 -19
- package/dist/components/ui/carousel.d.ts.map +0 -1
- package/dist/components/ui/carousel.js +0 -98
- package/dist/components/ui/chart.d.ts +0 -63
- package/dist/components/ui/chart.d.ts.map +0 -1
- package/dist/components/ui/chart.js +0 -130
- package/dist/components/ui/checkbox.d.ts +0 -5
- package/dist/components/ui/checkbox.d.ts.map +0 -1
- package/dist/components/ui/checkbox.js +0 -8
- package/dist/components/ui/collapsible.d.ts +0 -6
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/collapsible.js +0 -5
- package/dist/components/ui/command.d.ts +0 -81
- package/dist/components/ui/command.d.ts.map +0 -1
- package/dist/components/ui/command.js +0 -28
- package/dist/components/ui/context-menu.d.ts +0 -28
- package/dist/components/ui/context-menu.d.ts.map +0 -1
- package/dist/components/ui/context-menu.js +0 -33
- package/dist/components/ui/custom/date-picker.d.ts +0 -12
- package/dist/components/ui/custom/date-picker.d.ts.map +0 -1
- package/dist/components/ui/custom/date-picker.js +0 -35
- package/dist/components/ui/custom/form/checkbox.d.ts +0 -13
- package/dist/components/ui/custom/form/checkbox.d.ts.map +0 -1
- package/dist/components/ui/custom/form/checkbox.js +0 -15
- package/dist/components/ui/custom/form/color.d.ts +0 -15
- package/dist/components/ui/custom/form/color.d.ts.map +0 -1
- package/dist/components/ui/custom/form/color.js +0 -40
- package/dist/components/ui/custom/form/combobox.d.ts +0 -37
- package/dist/components/ui/custom/form/combobox.d.ts.map +0 -1
- package/dist/components/ui/custom/form/combobox.js +0 -82
- package/dist/components/ui/custom/form/cpf-cnpj.d.ts +0 -16
- package/dist/components/ui/custom/form/cpf-cnpj.d.ts.map +0 -1
- package/dist/components/ui/custom/form/cpf-cnpj.js +0 -32
- package/dist/components/ui/custom/form/currency.d.ts +0 -14
- package/dist/components/ui/custom/form/currency.d.ts.map +0 -1
- package/dist/components/ui/custom/form/currency.js +0 -15
- package/dist/components/ui/custom/form/date-range.d.ts +0 -16
- package/dist/components/ui/custom/form/date-range.d.ts.map +0 -1
- package/dist/components/ui/custom/form/date-range.js +0 -24
- package/dist/components/ui/custom/form/date.d.ts +0 -16
- package/dist/components/ui/custom/form/date.d.ts.map +0 -1
- package/dist/components/ui/custom/form/date.js +0 -35
- package/dist/components/ui/custom/form/decimal.d.ts +0 -14
- package/dist/components/ui/custom/form/decimal.d.ts.map +0 -1
- package/dist/components/ui/custom/form/decimal.js +0 -15
- package/dist/components/ui/custom/form/file.d.ts +0 -15
- package/dist/components/ui/custom/form/file.d.ts.map +0 -1
- package/dist/components/ui/custom/form/file.js +0 -18
- package/dist/components/ui/custom/form/form-help-text.d.ts +0 -3
- package/dist/components/ui/custom/form/form-help-text.d.ts.map +0 -1
- package/dist/components/ui/custom/form/form-help-text.js +0 -7
- package/dist/components/ui/custom/form/form-label.d.ts +0 -7
- package/dist/components/ui/custom/form/form-label.d.ts.map +0 -1
- package/dist/components/ui/custom/form/form-label.js +0 -9
- package/dist/components/ui/custom/form/form-message.d.ts +0 -5
- package/dist/components/ui/custom/form/form-message.d.ts.map +0 -1
- package/dist/components/ui/custom/form/form-message.js +0 -5
- package/dist/components/ui/custom/form/ghost.d.ts +0 -8
- package/dist/components/ui/custom/form/ghost.d.ts.map +0 -1
- package/dist/components/ui/custom/form/ghost.js +0 -8
- package/dist/components/ui/custom/form/input.d.ts +0 -18
- package/dist/components/ui/custom/form/input.d.ts.map +0 -1
- package/dist/components/ui/custom/form/input.js +0 -14
- package/dist/components/ui/custom/form/mask.d.ts +0 -19
- package/dist/components/ui/custom/form/mask.d.ts.map +0 -1
- package/dist/components/ui/custom/form/mask.js +0 -19
- package/dist/components/ui/custom/form/multi-select-old.d.ts +0 -19
- package/dist/components/ui/custom/form/multi-select-old.d.ts.map +0 -1
- package/dist/components/ui/custom/form/multi-select-old.js +0 -30
- package/dist/components/ui/custom/form/multi-select.d.ts +0 -26
- package/dist/components/ui/custom/form/multi-select.d.ts.map +0 -1
- package/dist/components/ui/custom/form/multi-select.js +0 -66
- package/dist/components/ui/custom/form/password.d.ts +0 -16
- package/dist/components/ui/custom/form/password.d.ts.map +0 -1
- package/dist/components/ui/custom/form/password.js +0 -14
- package/dist/components/ui/custom/form/percent.d.ts +0 -14
- package/dist/components/ui/custom/form/percent.d.ts.map +0 -1
- package/dist/components/ui/custom/form/percent.js +0 -15
- package/dist/components/ui/custom/form/phone.d.ts +0 -16
- package/dist/components/ui/custom/form/phone.d.ts.map +0 -1
- package/dist/components/ui/custom/form/phone.js +0 -23
- package/dist/components/ui/custom/form/radio-group.d.ts +0 -23
- package/dist/components/ui/custom/form/radio-group.d.ts.map +0 -1
- package/dist/components/ui/custom/form/radio-group.js +0 -15
- package/dist/components/ui/custom/form/select.d.ts +0 -20
- package/dist/components/ui/custom/form/select.d.ts.map +0 -1
- package/dist/components/ui/custom/form/select.js +0 -12
- package/dist/components/ui/custom/form/step-new-form.d.ts +0 -10
- package/dist/components/ui/custom/form/step-new-form.d.ts.map +0 -1
- package/dist/components/ui/custom/form/step-new-form.js +0 -13
- package/dist/components/ui/custom/form/switch.d.ts +0 -13
- package/dist/components/ui/custom/form/switch.d.ts.map +0 -1
- package/dist/components/ui/custom/form/switch.js +0 -16
- package/dist/components/ui/custom/form/text.d.ts +0 -18
- package/dist/components/ui/custom/form/text.d.ts.map +0 -1
- package/dist/components/ui/custom/form/text.js +0 -14
- package/dist/components/ui/custom/form/textarea.d.ts +0 -16
- package/dist/components/ui/custom/form/textarea.d.ts.map +0 -1
- package/dist/components/ui/custom/form/textarea.js +0 -19
- package/dist/components/ui/custom/form/utils.d.ts +0 -18
- package/dist/components/ui/custom/form/utils.d.ts.map +0 -1
- package/dist/components/ui/custom/form/utils.js +0 -88
- package/dist/components/ui/custom/header.d.ts +0 -11
- package/dist/components/ui/custom/header.d.ts.map +0 -1
- package/dist/components/ui/custom/header.js +0 -74
- package/dist/components/ui/custom/label.d.ts +0 -13
- package/dist/components/ui/custom/label.d.ts.map +0 -1
- package/dist/components/ui/custom/label.js +0 -20
- package/dist/components/ui/custom/not-found.d.ts +0 -3
- package/dist/components/ui/custom/not-found.d.ts.map +0 -1
- package/dist/components/ui/custom/not-found.js +0 -9
- package/dist/components/ui/custom/sidebar/app-sidebar.d.ts +0 -5
- package/dist/components/ui/custom/sidebar/app-sidebar.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/app-sidebar.js +0 -26
- package/dist/components/ui/custom/sidebar/module-switcher.d.ts +0 -9
- package/dist/components/ui/custom/sidebar/module-switcher.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/module-switcher.js +0 -55
- package/dist/components/ui/custom/sidebar/nav-footer.d.ts +0 -7
- package/dist/components/ui/custom/sidebar/nav-footer.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/nav-footer.js +0 -13
- package/dist/components/ui/custom/sidebar/nav-main.d.ts +0 -7
- package/dist/components/ui/custom/sidebar/nav-main.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/nav-main.js +0 -27
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts +0 -9
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/nav-submenu-collapsible.js +0 -18
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts +0 -10
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/nav-submenu-dropdown.js +0 -10
- package/dist/components/ui/custom/sidebar/nav-user.d.ts +0 -9
- package/dist/components/ui/custom/sidebar/nav-user.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/nav-user.js +0 -24
- package/dist/components/ui/custom/sidebar/sidebar-button.d.ts +0 -9
- package/dist/components/ui/custom/sidebar/sidebar-button.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/sidebar-button.js +0 -7
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts +0 -12
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/sidebar-item-two-lines.js +0 -5
- package/dist/components/ui/custom/sidebar/sidebar-item.d.ts +0 -9
- package/dist/components/ui/custom/sidebar/sidebar-item.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/sidebar-item.js +0 -7
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.d.ts +0 -9
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/sidebar-module-switcher.js +0 -20
- package/dist/components/ui/custom/sidebar/types/sidebar.d.ts +0 -29
- package/dist/components/ui/custom/sidebar/types/sidebar.d.ts.map +0 -1
- package/dist/components/ui/custom/sidebar/types/sidebar.js +0 -5
- package/dist/components/ui/custom/table/data-table-export.d.ts +0 -8
- package/dist/components/ui/custom/table/data-table-export.d.ts.map +0 -1
- package/dist/components/ui/custom/table/data-table-export.js +0 -65
- package/dist/components/ui/custom/table/data-table-footer.d.ts +0 -25
- package/dist/components/ui/custom/table/data-table-footer.d.ts.map +0 -1
- package/dist/components/ui/custom/table/data-table-footer.js +0 -39
- package/dist/components/ui/custom/table/data-table-header.d.ts +0 -9
- package/dist/components/ui/custom/table/data-table-header.d.ts.map +0 -1
- package/dist/components/ui/custom/table/data-table-header.js +0 -11
- package/dist/components/ui/custom/table/data-table-rows.d.ts +0 -13
- package/dist/components/ui/custom/table/data-table-rows.d.ts.map +0 -1
- package/dist/components/ui/custom/table/data-table-rows.js +0 -25
- package/dist/components/ui/custom/table/data-table.d.ts +0 -35
- package/dist/components/ui/custom/table/data-table.d.ts.map +0 -1
- package/dist/components/ui/custom/table/data-table.js +0 -99
- package/dist/components/ui/custom/table/types/data-table.d.ts +0 -29
- package/dist/components/ui/custom/table/types/data-table.d.ts.map +0 -1
- package/dist/components/ui/custom/table/types/data-table.js +0 -1
- package/dist/components/ui/custom/theme-provider.d.ts +0 -24
- package/dist/components/ui/custom/theme-provider.d.ts.map +0 -1
- package/dist/components/ui/custom/theme-provider.js +0 -79
- package/dist/components/ui/dateRangePicker.d.ts +0 -3
- package/dist/components/ui/dateRangePicker.d.ts.map +0 -1
- package/dist/components/ui/dateRangePicker.js +0 -15
- package/dist/components/ui/dialog.d.ts +0 -23
- package/dist/components/ui/dialog.d.ts.map +0 -1
- package/dist/components/ui/dialog.js +0 -23
- package/dist/components/ui/drawer.d.ts +0 -23
- package/dist/components/ui/drawer.d.ts.map +0 -1
- package/dist/components/ui/drawer.js +0 -22
- package/dist/components/ui/dropdown-menu.d.ts +0 -28
- package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu.js +0 -32
- package/dist/components/ui/form.d.ts +0 -24
- package/dist/components/ui/form.d.ts.map +0 -1
- package/dist/components/ui/form.js +0 -60
- package/dist/components/ui/hover-card.d.ts +0 -7
- package/dist/components/ui/hover-card.d.ts.map +0 -1
- package/dist/components/ui/hover-card.js +0 -9
- package/dist/components/ui/input.d.ts +0 -24
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/input.js +0 -71
- package/dist/components/ui/label.d.ts +0 -6
- package/dist/components/ui/label.d.ts.map +0 -1
- package/dist/components/ui/label.js +0 -9
- package/dist/components/ui/masks.d.ts +0 -17
- package/dist/components/ui/masks.d.ts.map +0 -1
- package/dist/components/ui/masks.js +0 -25
- package/dist/components/ui/pagination.d.ts +0 -30
- package/dist/components/ui/pagination.d.ts.map +0 -1
- package/dist/components/ui/pagination.js +0 -23
- package/dist/components/ui/popover.d.ts +0 -7
- package/dist/components/ui/popover.d.ts.map +0 -1
- package/dist/components/ui/popover.js +0 -11
- package/dist/components/ui/progress.d.ts +0 -5
- package/dist/components/ui/progress.d.ts.map +0 -1
- package/dist/components/ui/progress.js +0 -7
- package/dist/components/ui/radio-group.d.ts +0 -6
- package/dist/components/ui/radio-group.d.ts.map +0 -1
- package/dist/components/ui/radio-group.js +0 -14
- package/dist/components/ui/scroll-area.d.ts +0 -6
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js +0 -11
- package/dist/components/ui/select.d.ts +0 -14
- package/dist/components/ui/select.d.ts.map +0 -1
- package/dist/components/ui/select.js +0 -24
- package/dist/components/ui/separator.d.ts +0 -5
- package/dist/components/ui/separator.d.ts.map +0 -1
- package/dist/components/ui/separator.js +0 -7
- package/dist/components/ui/sheet.d.ts +0 -26
- package/dist/components/ui/sheet.d.ts.map +0 -1
- package/dist/components/ui/sheet.js +0 -37
- package/dist/components/ui/sidebar.d.ts +0 -67
- package/dist/components/ui/sidebar.d.ts.map +0 -1
- package/dist/components/ui/sidebar.js +0 -221
- package/dist/components/ui/skeleton.d.ts +0 -3
- package/dist/components/ui/skeleton.d.ts.map +0 -1
- package/dist/components/ui/skeleton.js +0 -6
- package/dist/components/ui/slider.d.ts +0 -5
- package/dist/components/ui/slider.d.ts.map +0 -1
- package/dist/components/ui/slider.js +0 -7
- package/dist/components/ui/switch.d.ts +0 -5
- package/dist/components/ui/switch.d.ts.map +0 -1
- package/dist/components/ui/switch.js +0 -7
- package/dist/components/ui/table.d.ts +0 -11
- package/dist/components/ui/table.d.ts.map +0 -1
- package/dist/components/ui/table.js +0 -20
- package/dist/components/ui/tabs.d.ts +0 -8
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js +0 -12
- package/dist/components/ui/textarea.d.ts +0 -4
- package/dist/components/ui/textarea.d.ts.map +0 -1
- package/dist/components/ui/textarea.js +0 -14
- package/dist/components/ui/toast.d.ts +0 -16
- package/dist/components/ui/toast.d.ts.map +0 -1
- package/dist/components/ui/toast.js +0 -34
- package/dist/components/ui/toaster.d.ts +0 -2
- package/dist/components/ui/toaster.d.ts.map +0 -1
- package/dist/components/ui/toaster.js +0 -21
- package/dist/components/ui/tooltip.d.ts +0 -8
- package/dist/components/ui/tooltip.d.ts.map +0 -1
- package/dist/components/ui/tooltip.js +0 -10
- package/dist/components/ui/use-calendar.d.ts +0 -7
- package/dist/components/ui/use-calendar.d.ts.map +0 -1
- package/dist/components/ui/use-calendar.js +0 -23
- package/dist/components/ui/use-toast.d.ts +0 -46
- package/dist/components/ui/use-toast.d.ts.map +0 -1
- package/dist/components/ui/use-toast.js +0 -125
- package/dist/components/use-calendar.d.ts +0 -7
- package/dist/components/use-calendar.d.ts.map +0 -1
- package/dist/components/use-calendar.js +0 -23
- package/dist/components/use-toast.d.ts +0 -46
- package/dist/components/use-toast.d.ts.map +0 -1
- package/dist/components/use-toast.js +0 -125
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-mobile.js +0 -15
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/help/date-utils.d.ts +0 -7
- package/dist/lib/help/date-utils.d.ts.map +0 -1
- package/dist/lib/help/date-utils.js +0 -34
- package/dist/lib/help/format.d.ts +0 -22
- package/dist/lib/help/format.d.ts.map +0 -1
- package/dist/lib/help/format.js +0 -140
- package/dist/lib/help/theme.d.ts +0 -291
- package/dist/lib/help/theme.d.ts.map +0 -1
- package/dist/lib/help/theme.js +0 -340
- package/dist/lib/help/uuid.d.ts +0 -2
- package/dist/lib/help/uuid.d.ts.map +0 -1
- package/dist/lib/help/uuid.js +0 -4
- package/dist/lib/utils.d.ts +0 -3
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -5
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getPagesByModule } from '@/lib/help/sidebar';
|
|
3
|
-
import { useLogin } from '@/lib/hooks/auth';
|
|
4
|
-
import { activeModuleAtom, resellerIdAtom, resellerPersonIdAtom } from '@/lib/store/auth';
|
|
5
|
-
import { useAtomValue, useSetAtom } from 'jotai';
|
|
6
|
-
import { Check, ChevronsUpDown } from 'lucide-react';
|
|
7
|
-
import { useEffect, useState } from 'react';
|
|
8
|
-
import { useNavigate } from 'react-router-dom';
|
|
9
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from './dropdown-menu';
|
|
10
|
-
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from './sidebar';
|
|
11
|
-
import SidebarItemTwoLines from './sidebar-item-two-lines';
|
|
12
|
-
const ModuleSwitcher = () => {
|
|
13
|
-
const { getConfiguredModules } = useLogin();
|
|
14
|
-
const { isMobile } = useSidebar();
|
|
15
|
-
const navigate = useNavigate();
|
|
16
|
-
const [activeModule, setActiveModule] = useState();
|
|
17
|
-
const [modules, setModules] = useState([]);
|
|
18
|
-
const resellerId = useAtomValue(resellerIdAtom);
|
|
19
|
-
const resellerPersonId = useAtomValue(resellerPersonIdAtom);
|
|
20
|
-
const activeModuleValue = useAtomValue(activeModuleAtom);
|
|
21
|
-
const setActiveModuleValue = useSetAtom(activeModuleAtom);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
fetchModules();
|
|
24
|
-
}, []);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
setActiveModule(modules.find((module) => module.value === activeModuleValue) ?? modules[0]);
|
|
27
|
-
}, [modules, activeModuleValue]);
|
|
28
|
-
const fetchModules = async () => {
|
|
29
|
-
const configuredModules = await getConfiguredModules(resellerPersonId, resellerId === '0');
|
|
30
|
-
if (configuredModules) {
|
|
31
|
-
setModules(configuredModules);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const handleModuleChange = (module) => {
|
|
35
|
-
setActiveModuleValue(module);
|
|
36
|
-
if (module) {
|
|
37
|
-
const firstLink = getPagesByModule(module)[0];
|
|
38
|
-
if (firstLink) {
|
|
39
|
-
navigate(firstLink.path);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(SidebarMenuButton, { size: 'lg', className: 'data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground', children: _jsx(SidebarItemTwoLines, { item: {
|
|
44
|
-
iconLeft: (_jsx("div", { className: 'flex p-[7.6px] items-center rounded-md bg-background-primary', children: activeModule?.icon })),
|
|
45
|
-
title: activeModule?.title ?? '',
|
|
46
|
-
subTitle: activeModule?.subTitle ?? '',
|
|
47
|
-
iconRight: _jsx(ChevronsUpDown, { size: 16 }),
|
|
48
|
-
} }) }) }), _jsx(DropdownMenuContent, { className: 'w-[250px] rounded-lg', align: 'start', side: isMobile ? 'bottom' : 'right', sideOffset: 4, children: modules.map((module) => (_jsx(DropdownMenuItem, { onClick: () => handleModuleChange(module.value), className: 'gap-2 p-2', children: _jsx(SidebarItemTwoLines, { item: {
|
|
49
|
-
iconLeft: _jsx("div", { className: 'flex p-[7.6px] items-center rounded-md bg-background-primary', children: module.icon }),
|
|
50
|
-
title: module.title,
|
|
51
|
-
subTitle: module.subTitle,
|
|
52
|
-
iconRight: activeModule?.value === module.value ? _jsx(Check, { size: 16 }) : null,
|
|
53
|
-
} }) }, `module-switcher-${module.value}`))) })] }) }) }));
|
|
54
|
-
};
|
|
55
|
-
export default ModuleSwitcher;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-footer.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/sidebar/nav-footer.tsx"],"names":[],"mappings":"AAMA,QAAA,MAAM,SAAS,+CAyBd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SidebarLinks } from '@/lib/constants/sidebar';
|
|
3
|
-
import { resellerIsAdm } from '@/lib/store/auth';
|
|
4
|
-
import { useLocation, useNavigate } from 'react-router-dom';
|
|
5
|
-
import { SidebarGroup, SidebarGroupContent, SidebarMenu } from './sidebar';
|
|
6
|
-
import SidebarItem from './sidebar-item';
|
|
7
|
-
const NavFooter = () => {
|
|
8
|
-
const navigate = useNavigate();
|
|
9
|
-
const location = useLocation();
|
|
10
|
-
const selectedRoutePath = location.pathname;
|
|
11
|
-
const isAdm = resellerIsAdm();
|
|
12
|
-
const pages = Object.values(SidebarLinks.settings ?? []).filter((item) => !item.hideSidebar && !(item.displayOnlyresellerIsAdm && !isAdm));
|
|
13
|
-
return (_jsx(SidebarGroup, { className: 'p-0', children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: pages.map((item) => {
|
|
14
|
-
return (_jsx(SidebarItem, { item: item, selectedRoute: selectedRoutePath, onClick: () => navigate(item.path) }, `sidebar-menu-main-${item.path}`));
|
|
15
|
-
}) }) }) }));
|
|
16
|
-
};
|
|
17
|
-
export default NavFooter;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-main.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/sidebar/nav-main.tsx"],"names":[],"mappings":"AAWA,QAAA,MAAM,OAAO,+CAmDZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useIsMobile } from '@/hooks/use-mobile';
|
|
3
|
-
import { getPagesByModule } from '@/lib/help/sidebar';
|
|
4
|
-
import { activeModuleAtom } from '@/lib/store/auth';
|
|
5
|
-
import { useAtomValue } from 'jotai';
|
|
6
|
-
import { useLocation, useNavigate } from 'react-router-dom';
|
|
7
|
-
import NavSubmenuCollapsible from './nav-submenu-collapsible';
|
|
8
|
-
import NavSubmenuDropdown from './nav-submenu-dropdown';
|
|
9
|
-
import { SidebarGroup, SidebarGroupContent, SidebarMenu } from './sidebar';
|
|
10
|
-
import SidebarItem from './sidebar-item';
|
|
11
|
-
import { SidebarSubmenuType } from './types/sidebar';
|
|
12
|
-
const NavMain = () => {
|
|
13
|
-
const activeModuleValue = useAtomValue(activeModuleAtom);
|
|
14
|
-
const navigate = useNavigate();
|
|
15
|
-
const location = useLocation();
|
|
16
|
-
const isMobile = useIsMobile();
|
|
17
|
-
const selectedRoutePath = location.pathname;
|
|
18
|
-
const pages = getPagesByModule(activeModuleValue);
|
|
19
|
-
return (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: pages.map((item) => {
|
|
20
|
-
if (item.subMenuType) {
|
|
21
|
-
if (item.subMenuType === SidebarSubmenuType.COLLAPSIBLE || isMobile) {
|
|
22
|
-
return (_jsx(NavSubmenuCollapsible, { item: item, selectedRoute: selectedRoutePath, onClick: (path) => navigate(path) }, `sidebar-submenu-collapsible-${item.path}`));
|
|
23
|
-
}
|
|
24
|
-
// Deprecated: Use COLLAPSIBLE instead
|
|
25
|
-
if (item.subMenuType === SidebarSubmenuType.DROPDOWN) {
|
|
26
|
-
return (_jsx(NavSubmenuDropdown, { item: item, selectedRoute: selectedRoutePath, onClick: (path) => navigate(path), cols: 3 }, `sidebar-submenu-dropdown-${item.path}`));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return (_jsx(SidebarItem, { item: item, selectedRoute: selectedRoutePath, onClick: () => navigate(item.path) }, `sidebar-menu-main-${item.path}`));
|
|
30
|
-
}) }) }) }));
|
|
31
|
-
};
|
|
32
|
-
export default NavMain;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SidebarPage } from './types/sidebar';
|
|
2
|
-
interface NavSubmenuCollapsibleProps {
|
|
3
|
-
item: SidebarPage;
|
|
4
|
-
selectedRoute: string | null;
|
|
5
|
-
onClick: (path: string) => void;
|
|
6
|
-
}
|
|
7
|
-
declare const NavSubmenuCollapsible: ({ item, selectedRoute, onClick }: NavSubmenuCollapsibleProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default NavSubmenuCollapsible;
|
|
9
|
-
//# sourceMappingURL=nav-submenu-collapsible.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-submenu-collapsible.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/sidebar/nav-submenu-collapsible.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,UAAU,0BAA0B;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,QAAA,MAAM,qBAAqB,GAAI,kCAAkC,0BAA0B,4CA+C1F,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { resellerIsAdm } from '@/lib/store/auth';
|
|
3
|
-
import { cn } from '@/lib/utils';
|
|
4
|
-
import { ChevronRight } from 'lucide-react';
|
|
5
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../collapsible';
|
|
6
|
-
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, useSidebar } from '../../sidebar';
|
|
7
|
-
const NavSubmenuCollapsible = ({ item, selectedRoute, onClick }) => {
|
|
8
|
-
const isAdm = resellerIsAdm();
|
|
9
|
-
const { open, toggleSidebar } = useSidebar();
|
|
10
|
-
const isOpen = () => {
|
|
11
|
-
return selectedRoute?.includes(item.path) ?? false;
|
|
12
|
-
};
|
|
13
|
-
const handleToggleSidebar = () => {
|
|
14
|
-
if (!open)
|
|
15
|
-
toggleSidebar();
|
|
16
|
-
};
|
|
17
|
-
return (_jsx(SidebarMenu, { children: _jsx(Collapsible, { asChild: true, defaultOpen: isOpen(), children: _jsxs(SidebarMenuItem, { children: [_jsx(CollapsibleTrigger, { asChild: true, className: 'group/collapsible', children: _jsxs(SidebarMenuButton, { tooltip: item.title, className: 'px-2 py-5 gap-3', onClick: () => handleToggleSidebar(), children: [item.icon, _jsx("span", { children: item.title }), _jsx(ChevronRight, { className: 'ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90' })] }) }), _jsx(CollapsibleContent, { children: _jsx(SidebarMenuSub, { children: item.subMenuItems
|
|
18
|
-
?.filter((subItem) => !(subItem.displayOnlyresellerIsAdm && !isAdm))
|
|
19
|
-
.map((subItem) => (_jsx(SidebarMenuSubItem, { children: _jsx(SidebarMenuSubButton, { asChild: true, onClick: () => onClick(subItem.path), "aria-disabled": subItem.disabled, children: _jsx("div", { className: cn('cursor-pointer px-2 py-1 items-center self-stretch', selectedRoute === subItem.path ? 'bg-sidebar-accent' : ''), children: _jsx("span", { children: subItem.label }) }) }) }, subItem.label))) }) })] }) }, item.title) }));
|
|
20
|
-
};
|
|
21
|
-
export default NavSubmenuCollapsible;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SidebarPage } from './types/sidebar';
|
|
2
|
-
interface NavSubmenuDropdownProps {
|
|
3
|
-
cols?: number;
|
|
4
|
-
item: SidebarPage;
|
|
5
|
-
selectedRoute: string | null;
|
|
6
|
-
onClick: (path: string) => void;
|
|
7
|
-
}
|
|
8
|
-
declare const NavSubmenuDropdown: ({ cols, item, selectedRoute, onClick }: NavSubmenuDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export default NavSubmenuDropdown;
|
|
10
|
-
//# sourceMappingURL=nav-submenu-dropdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-submenu-dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/sidebar/nav-submenu-dropdown.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,UAAU,uBAAuB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,QAAA,MAAM,kBAAkB,GAAI,wCAAwC,uBAAuB,4CA2C1F,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { resellerIsAdm } from '@/lib/store/auth';
|
|
3
|
-
import { cn } from '@/lib/utils';
|
|
4
|
-
import { ChevronRight } from 'lucide-react';
|
|
5
|
-
import { SidebarMenuButton, SidebarMenuItem } from '../../sidebar';
|
|
6
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from './dropdown-menu';
|
|
7
|
-
const NavSubmenuDropdown = ({ cols, item, selectedRoute, onClick }) => {
|
|
8
|
-
const isAdm = resellerIsAdm();
|
|
9
|
-
return (_jsx(SidebarMenuItem, { children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(SidebarMenuButton, { asChild: true, className: cn('data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground hover:bg-sidebar-accent px-2 py-5 gap-3 cursor-pointer', selectedRoute?.includes(item.path) ? 'bg-sidebar-accent' : ''), tooltip: item.title, children: _jsxs("div", { children: [item.icon, _jsx("span", { children: item.title }), _jsx(ChevronRight, { className: 'ml-auto' })] }) }) }), _jsx(DropdownMenuContent, { className: `grid grid-cols-${cols ?? '1'} gap-4 p-4`, align: 'start', side: 'right', sideOffset: 4, children: item.subMenuItems
|
|
10
|
-
?.filter((subItem) => !(subItem.displayOnlyresellerIsAdm && !isAdm))
|
|
11
|
-
.map((subItem, index) => (_jsxs(DropdownMenuItem, { className: cn('flex flex-col items-start text-left max-w-[220px] gap-1 cursor-pointer', selectedRoute === subItem.path ? 'bg-sidebar-accent' : ''), onClick: () => onClick(subItem.path), disabled: subItem.disabled, children: [_jsx("div", { className: 'text-sm font-semibold', children: subItem.label }), _jsx("div", { className: 'text-sm text-muted-foreground', children: subItem.description })] }, `${index}`))) })] }) }));
|
|
12
|
-
};
|
|
13
|
-
export default NavSubmenuDropdown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-user.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/sidebar/nav-user.tsx"],"names":[],"mappings":"AASA,QAAA,MAAM,OAAO,+CAuFZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getMe } from '@/lib/grpc/auth';
|
|
3
|
-
import { LoaderCircle, LogOut } from 'lucide-react';
|
|
4
|
-
import { useEffect, useState } from 'react';
|
|
5
|
-
import { useNavigate } from 'react-router-dom';
|
|
6
|
-
import { Avatar, AvatarFallback, AvatarImage } from './avatar';
|
|
7
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from './dropdown-menu';
|
|
8
|
-
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from './sidebar';
|
|
9
|
-
import SidebarItemTwoLines from './sidebar-item-two-lines';
|
|
10
|
-
const NavUser = () => {
|
|
11
|
-
const [userName, setUserName] = useState('');
|
|
12
|
-
const [userEmail, setUserEmail] = useState('');
|
|
13
|
-
const [userInitials, setUserInitials] = useState('');
|
|
14
|
-
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
|
15
|
-
const { isMobile } = useSidebar();
|
|
16
|
-
const navigate = useNavigate();
|
|
17
|
-
// Busca os dados do usuário logado
|
|
18
|
-
const fetchUserData = async () => {
|
|
19
|
-
try {
|
|
20
|
-
const data = await getMe();
|
|
21
|
-
if (data?.user) {
|
|
22
|
-
const name = data.user.name;
|
|
23
|
-
const email = data.user.email;
|
|
24
|
-
const nameParts = data.user.name?.split(' ');
|
|
25
|
-
const avatarInitial = `${nameParts[0].charAt(0).toUpperCase()}${nameParts[nameParts.length - 1].charAt(0).toUpperCase()}`;
|
|
26
|
-
setUserName(name);
|
|
27
|
-
setUserEmail(email);
|
|
28
|
-
setUserInitials(avatarInitial);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.error('Erro ao buscar dados do usuário:', error);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
fetchUserData();
|
|
37
|
-
}, []);
|
|
38
|
-
const handleLogout = () => {
|
|
39
|
-
setIsLoggingOut(true);
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
navigate('/logout');
|
|
42
|
-
}, 2000);
|
|
43
|
-
};
|
|
44
|
-
return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(SidebarMenuButton, { size: 'lg', className: 'data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground', children: _jsx(SidebarItemTwoLines, { item: {
|
|
45
|
-
iconLeft: (_jsxs(Avatar, { className: 'h-[31px] w-[31px] rounded-md', children: [_jsx(AvatarImage, { src: userInitials, alt: userName }), _jsx(AvatarFallback, { className: 'rounded-md bg-background-primary text-white', children: userInitials })] })),
|
|
46
|
-
title: isLoggingOut ? 'Saindo...' : userName,
|
|
47
|
-
subTitle: isLoggingOut ? '' : userEmail,
|
|
48
|
-
iconRight: isLoggingOut ? (_jsx(LoaderCircle, { size: 16, className: 'text-sidebar-foreground animate-spin mr-2' })) : (_jsx(LogOut, { size: 16, className: 'text-sidebar-foreground' })),
|
|
49
|
-
} }) }) }), _jsxs(DropdownMenuContent, { className: 'w-[250px] rounded-lg', side: isMobile ? 'bottom' : 'right', align: 'end', sideOffset: 4, children: [_jsx(DropdownMenuLabel, { className: 'p-0 font-normal', children: _jsxs("div", { className: 'flex items-center gap-2 px-1 py-1.5 text-left text-sm', children: [_jsxs(Avatar, { className: 'h-8 w-8 rounded-lg', children: [_jsx(AvatarImage, { src: userInitials, alt: userName }), _jsx(AvatarFallback, { className: 'rounded-lg bg-background-primary text-white', children: userInitials })] }), _jsxs("div", { className: 'grid flex-1 text-left text-sm leading-tight', children: [_jsx("span", { className: 'truncate font-semibold', children: userName }), _jsx("span", { className: 'truncate text-xs', children: userEmail })] })] }) }), _jsx(DropdownMenuItem, { className: 'p-0 font-normal cursor-pointer', onClick: () => handleLogout(), children: _jsxs("div", { className: 'flex items-center gap-2 px-1 py-1.5 text-left text-sm', children: [_jsx("div", { className: 'flex w-8 h-8 p-2 items-center rounded-md', children: _jsx(LogOut, { size: 16 }) }), "Log out"] }) })] })] }) }) }));
|
|
50
|
-
};
|
|
51
|
-
export default NavUser;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Module, SidebarPage } from './types/sidebar';
|
|
2
|
-
interface SidebarItemProps {
|
|
3
|
-
item: SidebarPage;
|
|
4
|
-
selectedRoute: string | null;
|
|
5
|
-
onClick?: (module: Module | null, path: string) => void;
|
|
6
|
-
}
|
|
7
|
-
declare const SidebarButton: ({ item, selectedRoute, onClick }: SidebarItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default SidebarButton;
|
|
9
|
-
//# sourceMappingURL=sidebar-button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-button.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/sidebar/sidebar-button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEtD,UAAU,gBAAgB;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxD;AAED,QAAA,MAAM,aAAa,GAAI,kCAAkC,gBAAgB,4CAiBxE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
import { SidebarMenuButton } from '../../sidebar';
|
|
4
|
-
const SidebarButton = ({ item, selectedRoute, onClick }) => {
|
|
5
|
-
return (_jsx(SidebarMenuButton, { asChild: true, className: cn('data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground hover:bg-sidebar-accent px-2 py-5 gap-3 cursor-pointer', selectedRoute?.includes(item.path) ? 'bg-sidebar-accent' : ''), tooltip: item.title, onClick: () => onClick?.(item.module ?? null, item.path), children: _jsxs("div", { children: [_jsx("div", { className: '[&_svg]:size-4 text-sidebar-foreground', children: item.icon }), _jsx("span", { children: item.title })] }) }));
|
|
6
|
-
};
|
|
7
|
-
export default SidebarButton;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface SidebarItemTwoLinesProps {
|
|
3
|
-
item: {
|
|
4
|
-
iconLeft: React.ReactNode;
|
|
5
|
-
title: string;
|
|
6
|
-
subTitle: string;
|
|
7
|
-
iconRight?: React.ReactNode | null;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
declare const SidebarItemTwoLines: ({ item }: SidebarItemTwoLinesProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default SidebarItemTwoLines;
|
|
12
|
-
//# sourceMappingURL=sidebar-item-two-lines.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-item-two-lines.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/sidebar/sidebar-item-two-lines.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,UAAU,wBAAwB;IACjC,IAAI,EAAE;QACL,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;KACnC,CAAC;CACF;AAED,QAAA,MAAM,mBAAmB,GAAI,UAAU,wBAAwB,4CAW9D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
const SidebarItemTwoLines = ({ item }) => {
|
|
3
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: '[&_svg]:size-4 text-white', children: item.iconLeft }), _jsxs("div", { className: 'grid flex-1 text-left text-sm leading-tight', children: [_jsx("span", { className: 'truncate font-semibold', children: item.title }), _jsx("span", { className: 'truncate text-xs text-foreground', children: item.subTitle })] }), item.iconRight] }));
|
|
4
|
-
};
|
|
5
|
-
export default SidebarItemTwoLines;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Module, SidebarPage } from './types/sidebar';
|
|
2
|
-
interface SidebarItemProps {
|
|
3
|
-
item: SidebarPage;
|
|
4
|
-
selectedRoute: string | null;
|
|
5
|
-
onClick?: (module: Module | null, path: string) => void;
|
|
6
|
-
}
|
|
7
|
-
declare const SidebarItem: ({ item, selectedRoute, onClick }: SidebarItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default SidebarItem;
|
|
9
|
-
//# sourceMappingURL=sidebar-item.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-item.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/sidebar/sidebar-item.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEtD,UAAU,gBAAgB;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxD;AAED,QAAA,MAAM,WAAW,GAAI,kCAAkC,gBAAgB,4CAMtE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SidebarMenuItem } from '../../sidebar';
|
|
3
|
-
import SidebarButton from './sidebar-button';
|
|
4
|
-
const SidebarItem = ({ item, selectedRoute, onClick }) => {
|
|
5
|
-
return (_jsx(SidebarMenuItem, { children: _jsx(SidebarButton, { item: item, selectedRoute: selectedRoute, onClick: onClick }) }));
|
|
6
|
-
};
|
|
7
|
-
export default SidebarItem;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare const SidebarSubmenuType: {
|
|
2
|
-
readonly COLLAPSIBLE: "collapsible";
|
|
3
|
-
readonly DROPDOWN: "dropdown";
|
|
4
|
-
};
|
|
5
|
-
export type SidebarSubmenuType = (typeof SidebarSubmenuType)[keyof typeof SidebarSubmenuType];
|
|
6
|
-
export interface Module {
|
|
7
|
-
value: string;
|
|
8
|
-
path: string;
|
|
9
|
-
title: string;
|
|
10
|
-
icon: React.ReactNode;
|
|
11
|
-
subTitle: string;
|
|
12
|
-
}
|
|
13
|
-
export interface SidebarPage {
|
|
14
|
-
module: Module;
|
|
15
|
-
path: string;
|
|
16
|
-
icon?: React.ReactNode;
|
|
17
|
-
title: string;
|
|
18
|
-
hideSidebar: boolean;
|
|
19
|
-
displayOnlyresellerIsAdm?: boolean;
|
|
20
|
-
subMenuType?: SidebarSubmenuType;
|
|
21
|
-
subMenuItems?: {
|
|
22
|
-
label: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
path: string;
|
|
25
|
-
displayOnlyresellerIsAdm?: boolean;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
}[];
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/sidebar/types/sidebar.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;CAIrB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE9F,MAAM,WAAW,MAAM;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACnB,EAAE,CAAC;CACJ"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ExportDataTable } from './types/data-table';
|
|
2
|
-
interface DataTableExportProps {
|
|
3
|
-
exportData?: ExportDataTable;
|
|
4
|
-
totalRows: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function DataTableExport({ exportData, totalRows }: DataTableExportProps): import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=data-table-export.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-export.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/table/data-table-export.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,UAAU,oBAAoB;IAC7B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,oBAAoB,8DA8G9E"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { zodResolver } from '@hookform/resolvers/zod';
|
|
3
|
-
import { useForm } from 'react-hook-form';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { Button } from '../../button';
|
|
6
|
-
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '../../dialog';
|
|
7
|
-
import { Form } from '../../form';
|
|
8
|
-
import { toast } from '../../use-toast';
|
|
9
|
-
import { FormRadioGroup } from './custom/form/radio-group';
|
|
10
|
-
export function DataTableExport({ exportData, totalRows }) {
|
|
11
|
-
const exportXlSX = () => {
|
|
12
|
-
if (!exportData)
|
|
13
|
-
return;
|
|
14
|
-
if (totalRows === 0) {
|
|
15
|
-
toast({
|
|
16
|
-
title: 'Não há dados para exportar.',
|
|
17
|
-
variant: 'destructive',
|
|
18
|
-
});
|
|
19
|
-
return {};
|
|
20
|
-
}
|
|
21
|
-
const params = new URLSearchParams(exportData.params).toString();
|
|
22
|
-
window.open(`${exportData.url}?${params}`, '_blank');
|
|
23
|
-
};
|
|
24
|
-
const renderExport = () => {
|
|
25
|
-
if (!exportData)
|
|
26
|
-
return null;
|
|
27
|
-
if (exportData.type === 'xlsx') {
|
|
28
|
-
return (_jsx(Button, { variant: 'secondary', onClick: exportXlSX, children: "Exportar" }));
|
|
29
|
-
}
|
|
30
|
-
if (exportData.type === 'dialog') {
|
|
31
|
-
const ExportDataSchema = z.object({
|
|
32
|
-
model: z.string(),
|
|
33
|
-
format: z.string(),
|
|
34
|
-
});
|
|
35
|
-
const form = useForm({
|
|
36
|
-
mode: 'onTouched',
|
|
37
|
-
resolver: zodResolver(ExportDataSchema),
|
|
38
|
-
});
|
|
39
|
-
const { control, trigger, handleSubmit } = form;
|
|
40
|
-
const onSubmit = async (values) => {
|
|
41
|
-
await trigger();
|
|
42
|
-
toast({
|
|
43
|
-
title: 'Em desenvolvimento.',
|
|
44
|
-
variant: 'destructive',
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
const onError = async (errors) => {
|
|
48
|
-
toast({
|
|
49
|
-
title: 'Erro ao salvar',
|
|
50
|
-
description: 'Verifique os campos obrigatórios',
|
|
51
|
-
variant: 'destructive',
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
return (_jsx(Form, { ...form, onSubmit: handleSubmit(onSubmit, onError), children: _jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { variant: 'secondary', children: "Exportar" }) }), _jsxs(DialogContent, { hideClose: true, className: 'fixed p-6 rounded-lg w-[451px]', children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Exportar" }), _jsx(DialogDescription, {})] }), _jsxs("div", { className: 'flex flex-col gap-6', children: [_jsx(FormRadioGroup, { control: control, name: 'model', label: 'Selecione o modelo de visualiza\u00E7\u00E3o', options: [
|
|
55
|
-
{ value: '0', label: 'Resumido' },
|
|
56
|
-
{ value: '1', label: 'Detalhado' },
|
|
57
|
-
], className: 'text-sm font-normal', classNameOptions: 'flex flex-col gap-4 mt-4 text-sm font-normal' }), _jsx(FormRadioGroup, { control: control, name: 'format', label: 'Selecione o formato desejado para exporta\u00E7\u00E3o', options: [
|
|
58
|
-
{ value: '0', label: 'PDF' },
|
|
59
|
-
{ value: '1', label: 'XLSX' },
|
|
60
|
-
], className: 'text-sm font-normal', classNameOptions: 'flex flex-col gap-4 mt-4 text-sm font-normal' })] }), _jsxs(DialogFooter, { className: 'sm:justify-end gap-2', children: [_jsx(Button, { type: 'button', variant: 'secondary', children: "Fechar" }), _jsx(Button, { type: 'button', variant: 'default', onClick: () => exportXlSX(), children: "Exportar" })] })] })] }) }));
|
|
61
|
-
}
|
|
62
|
-
return null;
|
|
63
|
-
};
|
|
64
|
-
return exportData && renderExport();
|
|
65
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PaginationState } from '@tanstack/react-table';
|
|
2
|
-
import { ExportDataTable } from './types/data-table';
|
|
3
|
-
interface DataTableFooterProps<TData> {
|
|
4
|
-
hidePagination?: boolean;
|
|
5
|
-
disablePagination?: boolean;
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
totalRows: number;
|
|
8
|
-
totalPages: number;
|
|
9
|
-
currentPage: number;
|
|
10
|
-
pagination: PaginationState;
|
|
11
|
-
handlePageSize: (value: number) => void;
|
|
12
|
-
handlePage: (value: number) => void;
|
|
13
|
-
previousPage: {
|
|
14
|
-
action: () => void;
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
};
|
|
17
|
-
nextPage: {
|
|
18
|
-
action: () => void;
|
|
19
|
-
disabled: boolean;
|
|
20
|
-
};
|
|
21
|
-
exportData?: ExportDataTable;
|
|
22
|
-
}
|
|
23
|
-
export declare function DataTableFooter<TData>({ isLoading, totalRows, totalPages, currentPage, hidePagination, disablePagination, pagination, handlePageSize, handlePage, previousPage, nextPage, exportData, }: DataTableFooterProps<TData>): false | import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=data-table-footer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-footer.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/table/data-table-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAaxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,UAAU,oBAAoB,CAAC,KAAK;IACnC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,eAAe,CAAC;IAC5B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,YAAY,EAAE;QACb,MAAM,EAAE,MAAM,IAAI,CAAC;QACnB,QAAQ,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,QAAQ,EAAE;QACT,MAAM,EAAE,MAAM,IAAI,CAAC;QACnB,QAAQ,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,UAAU,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,EACtC,SAAS,EACT,SAAS,EACT,UAAU,EACV,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,UAAU,GACV,EAAE,oBAAoB,CAAC,KAAK,CAAC,mDAkG7B"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Badge } from '../../badge';
|
|
3
|
-
import { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from '../../pagination';
|
|
4
|
-
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '../../select';
|
|
5
|
-
import { DataTableExport } from './data-table-export';
|
|
6
|
-
export function DataTableFooter({ isLoading, totalRows, totalPages, currentPage, hidePagination, disablePagination, pagination, handlePageSize, handlePage, previousPage, nextPage, exportData, }) {
|
|
7
|
-
const renderPaginationPages = () => {
|
|
8
|
-
const paginationItems = [];
|
|
9
|
-
const createPaginationItem = (pageIndex) => (_jsx(PaginationItem, { children: _jsx(PaginationLink, { onClick: () => handlePage(pageIndex), isActive: currentPage === pageIndex, children: pageIndex + 1 }) }, pageIndex));
|
|
10
|
-
// Add first page
|
|
11
|
-
paginationItems.push(createPaginationItem(0));
|
|
12
|
-
// Add ellipsis if needed
|
|
13
|
-
if (currentPage > 2) {
|
|
14
|
-
paginationItems.push(_jsx(PaginationEllipsis, {}, 'start-ellipsis'));
|
|
15
|
-
}
|
|
16
|
-
// Add pages before current page
|
|
17
|
-
for (let i = Math.max(1, currentPage - 1); i < currentPage; i++) {
|
|
18
|
-
paginationItems.push(createPaginationItem(i));
|
|
19
|
-
}
|
|
20
|
-
// Add current page
|
|
21
|
-
if (currentPage !== 0 && currentPage !== totalPages - 1) {
|
|
22
|
-
paginationItems.push(createPaginationItem(currentPage));
|
|
23
|
-
}
|
|
24
|
-
// Add pages after current page
|
|
25
|
-
for (let i = currentPage + 1; i <= Math.min(totalPages - 2, currentPage + 1); i++) {
|
|
26
|
-
paginationItems.push(createPaginationItem(i));
|
|
27
|
-
}
|
|
28
|
-
// Add ellipsis if needed
|
|
29
|
-
if (currentPage < totalPages - 3) {
|
|
30
|
-
paginationItems.push(_jsx(PaginationEllipsis, {}, 'end-ellipsis'));
|
|
31
|
-
}
|
|
32
|
-
// Add last page
|
|
33
|
-
if (totalPages > 1) {
|
|
34
|
-
paginationItems.push(createPaginationItem(totalPages - 1));
|
|
35
|
-
}
|
|
36
|
-
return paginationItems;
|
|
37
|
-
};
|
|
38
|
-
return (!hidePagination && (_jsxs("footer", { className: 'flex items-center justify-between h-[64px]', children: [_jsxs("div", { className: 'flex flex-row items-center gap-6', children: [_jsxs("div", { className: 'flex flex-row items-center gap-2', children: ["Linhas por p\u00E1gina", _jsxs(Select, { value: pagination.pageSize.toString(), onValueChange: (value) => handlePageSize(Number(value)), disabled: isLoading || disablePagination, children: [_jsx(SelectTrigger, { className: 'w-20', children: _jsx(SelectValue, { placeholder: '', className: 'text-slate-800 font-medium' }) }), _jsx(SelectContent, { children: _jsxs(SelectGroup, { children: [_jsx(SelectItem, { value: '25', children: "25" }), _jsx(SelectItem, { value: '50', children: "50" }), _jsx(SelectItem, { value: '100', children: "100" })] }) })] })] }), _jsx(DataTableExport, { exportData: exportData, totalRows: totalPages })] }), _jsxs("div", { className: 'flex items-center gap-4', children: [_jsx("div", { children: !isLoading && (_jsx(Badge, { variant: 'secondary', children: totalRows === 0 ? 'Nenhum item' : totalRows === 1 ? '1 item' : `${totalRows} itens` })) }), _jsx("div", { children: _jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { onClick: () => previousPage.action(), disabled: previousPage.disabled || disablePagination }) }), renderPaginationPages(), _jsx(PaginationItem, { children: _jsx(PaginationNext, { onClick: () => nextPage.action(), disabled: nextPage.disabled || disablePagination }) })] }) }) })] })] })));
|
|
39
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Table } from '@tanstack/react-table';
|
|
2
|
-
interface DataTableHeaderProps<TData> {
|
|
3
|
-
table: Table<TData>;
|
|
4
|
-
canActionsRow?: boolean;
|
|
5
|
-
enableMultiRowSelection?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function DataTableHeader<TData>({ table, canActionsRow, enableMultiRowSelection }: DataTableHeaderProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=data-table-header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-header.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/table/data-table-header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAc,MAAM,uBAAuB,CAAC;AAM1D,UAAU,oBAAoB,CAAC,KAAK;IACnC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,EAAE,oBAAoB,CAAC,KAAK,CAAC,2CA4CpH"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
import { flexRender } from '@tanstack/react-table';
|
|
4
|
-
import { ArrowUpDown, MoveDown, MoveUp } from 'lucide-react';
|
|
5
|
-
import { Button } from '../../button';
|
|
6
|
-
import { Checkbox } from '../../checkbox';
|
|
7
|
-
import { TableHead, TableHeader, TableRow } from '../../table';
|
|
8
|
-
export function DataTableHeader({ table, canActionsRow, enableMultiRowSelection }) {
|
|
9
|
-
const headerGroups = table.getHeaderGroups();
|
|
10
|
-
return (_jsx(TableHeader, { children: headerGroups.map((headerGroup) => (_jsxs(TableRow, { className: 'bg-background dark:bg-datatable-accent rounded-t-md sticky top-0 z-10', children: [enableMultiRowSelection && (_jsx(TableHead, { className: 'h-[65px] w-6', children: _jsx(Checkbox, { checked: table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate'), onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value) }) })), headerGroup.headers.map((header) => (_jsx(TableHead, { className: cn('h-[65px] whitespace-nowrap', header.column.id === 'id' ? 'sticky left-0 z-20' : '', header.column.columnDef.enableSorting ? 'pl-2' : ''), children: header.column.columnDef.enableSorting ? (_jsxs(Button, { variant: 'ghost', onClick: () => header.column.toggleSorting(header.column.getIsSorted() === 'asc'), children: [flexRender(header.column.columnDef.header, header.getContext()), header.column.getIsSorted() === 'asc' ? (_jsx(MoveUp, { className: 'ml-2 h-4 w-4' })) : header.column.getIsSorted() === 'desc' ? (_jsx(MoveDown, { className: 'ml-2 h-4 w-4' })) : (_jsx(ArrowUpDown, { className: 'ml-2 h-4 w-4' }))] })) : (flexRender(header.column.columnDef.header, header.getContext())) }, header.id))), canActionsRow && _jsx(TableHead, {})] }, headerGroup.id))) }));
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ColumnDef, Table } from '@tanstack/react-table';
|
|
2
|
-
import { ActionRow } from './types/data-table';
|
|
3
|
-
interface DataTableRowsProps<TData> {
|
|
4
|
-
table: Table<TData>;
|
|
5
|
-
columns: ColumnDef<TData>[];
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
actionsRow?: ActionRow[];
|
|
8
|
-
textNoRecords?: string;
|
|
9
|
-
enableMultiRowSelection?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function DataTableRows<TData>({ table, isLoading, columns, actionsRow, textNoRecords, enableMultiRowSelection }: DataTableRowsProps<TData>): any;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=data-table-rows.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-table-rows.d.ts","sourceRoot":"","sources":["../../../../src/components/custom/table/data-table-rows.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAc,MAAM,uBAAuB,CAAC;AAKrE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,UAAU,kBAAkB,CAAC,KAAK;IACjC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,uBAAuB,EAAE,EAAE,kBAAkB,CAAC,KAAK,CAAC,OA4EhJ"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
import { flexRender } from '@tanstack/react-table';
|
|
4
|
-
import { Button } from '../../button';
|
|
5
|
-
import { Checkbox } from '../../checkbox';
|
|
6
|
-
import { Skeleton } from '../../skeleton';
|
|
7
|
-
import { TableCell, TableRow } from '../../table';
|
|
8
|
-
export function DataTableRows({ table, isLoading, columns, actionsRow, textNoRecords, enableMultiRowSelection }) {
|
|
9
|
-
const rows = table.getRowModel().rows;
|
|
10
|
-
const renderLoadingRows = () => {
|
|
11
|
-
const rows = [];
|
|
12
|
-
for (let i = 0; i < 10; i++) {
|
|
13
|
-
rows.push(_jsxs(TableRow, { children: [enableMultiRowSelection && (_jsx(TableCell, { className: 'py-2', children: _jsx(Skeleton, { className: 'h-10 w-full' }) })), columns.map((column) => (_jsx(TableCell, { className: 'py-2', children: _jsx(Skeleton, { className: 'h-10 w-full' }) }, column.id)))] }, `loading-row-${i}`));
|
|
14
|
-
}
|
|
15
|
-
return rows;
|
|
16
|
-
};
|
|
17
|
-
const renderRows = () => {
|
|
18
|
-
return rows.map((row) => (_jsxs(TableRow, { "data-state": row.getIsSelected() && 'selected', className: 'group', children: [enableMultiRowSelection && (_jsx(TableCell, { className: 'py-4', children: _jsx(Checkbox, { checked: row.getIsSelected(), onCheckedChange: (value) => row.toggleSelected(!!value), "aria-label": 'Select row' }) })), row.getVisibleCells().map((cell) => (_jsx(TableCell, { className: 'py-4', children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))), actionsRow && (_jsx(TableCell, { className: 'opacity-0 group-hover:opacity-100 hover:opacity-100 relative overflow-visible w-[0px]', children: _jsx("div", { className: 'absolute transition-colors group-hover:bg-datatable-accent overflow-visible right-5 -translate-y-1/2 flex space-x-4', children: actionsRow.map((action, index) => (_jsxs(Button, { variant: action.variant || 'default', className: cn('bg-datatable-accent', action.className?.(row.original) || ''), onClick: () => action.onClick?.(row.original), disabled: action.disabled?.(row.original) || false, children: [action.icon, action.label] }, `action-row-${index}`))) }) }, `buttons-${row.id}`))] }, row.id)));
|
|
19
|
-
};
|
|
20
|
-
const renderEmptyRows = () => {
|
|
21
|
-
const colSpan = columns.length + (actionsRow ? 1 : 0);
|
|
22
|
-
return (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: colSpan, className: 'text-center h-[53px]', children: textNoRecords ? textNoRecords : 'Sem resultados.' }) }));
|
|
23
|
-
};
|
|
24
|
-
return isLoading ? renderLoadingRows() : rows.length ? renderRows() : renderEmptyRows();
|
|
25
|
-
}
|