eai-frontend-components 2.0.64 → 2.0.66
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/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 +26 -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 +34 -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 +94 -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 +111 -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 +32 -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 +16 -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 +41 -0
- package/dist/components/ui/custom/form/combobox.d.ts +39 -0
- package/dist/components/ui/custom/form/combobox.d.ts.map +1 -0
- package/dist/components/ui/custom/form/combobox.js +88 -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 +34 -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.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 +17 -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 +14 -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 +14 -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 +18 -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/responsive-dialog.d.ts +24 -0
- package/dist/components/ui/custom/responsive-dialog.d.ts.map +1 -0
- package/dist/components/ui/custom/responsive-dialog.js +32 -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 +24 -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 +26 -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 +17 -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 +9 -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/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 +66 -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 +22 -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 +51 -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 +89 -0
- package/dist/components/ui/masks.d.ts.map +1 -0
- package/dist/components/ui/masks.js +92 -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 +9 -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 +36 -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 +124 -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 +4 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/help/date-utils.d.ts +9 -0
- package/dist/lib/help/date-utils.d.ts.map +1 -0
- package/dist/lib/help/date-utils.js +65 -0
- package/dist/lib/help/download.d.ts +2 -0
- package/dist/lib/help/download.d.ts.map +1 -0
- package/dist/lib/help/download.js +26 -0
- package/dist/lib/help/format.d.ts +133 -0
- package/dist/lib/help/format.d.ts.map +1 -0
- package/dist/lib/help/format.js +268 -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 +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface LabelWithTitleProps {
|
|
3
|
+
title: string;
|
|
4
|
+
value: string;
|
|
5
|
+
value2?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
showCopyIcon?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
hoverAction?: {
|
|
11
|
+
icon: React.ReactNode;
|
|
12
|
+
tooltip: string;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const LabelWithTitle: React.FC<LabelWithTitleProps>;
|
|
17
|
+
export default LabelWithTitle;
|
|
18
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/custom/label.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,mBAAmB;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE;QACb,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,IAAI,CAAC;KACpB,CAAC;CACF;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8EjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Copy } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../../lib/utils';
|
|
4
|
+
import { Button } from '../button';
|
|
5
|
+
import { Skeleton } from '../skeleton';
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../tooltip';
|
|
7
|
+
import { toast } from '../use-toast';
|
|
8
|
+
const LabelWithTitle = ({ title, value, value2, required, showCopyIcon = false, className, isLoading, hoverAction, }) => {
|
|
9
|
+
const handleCopy = () => {
|
|
10
|
+
if (showCopyIcon && value) {
|
|
11
|
+
navigator.clipboard.writeText(`${value}${value2 ?? ''}`);
|
|
12
|
+
toast({
|
|
13
|
+
title: `"${value}${value2 ?? ''}" foi copiado para a área de transferência.`,
|
|
14
|
+
variant: 'success',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return (_jsx("div", { className: cn('flex group', className), children: _jsx("div", { className: cn('flex flex-col text-sm w-full', showCopyIcon || hoverAction ? 'p-1 rounded-md transition-colors group-hover:bg-sidebar-accent' : 'p-1'), children: _jsxs("div", { className: 'relative', children: [_jsxs("div", { className: 'flex items-center text-sm font-medium gap-0.5', children: [_jsx("span", { className: 'text-default truncate', children: title }), required && _jsx("div", { className: 'text-red-500 truncate', children: "*" })] }), _jsx("div", { className: 'grid flex-1 items-center pt-1', children: isLoading ? _jsx(Skeleton, { className: 'h-5 w-full rounded-lg' }) : _jsx("div", { className: 'text-zinc-500 truncate', children: value }) }), value2 && (_jsx("div", { className: 'grid flex-1 items-center pt-1', children: isLoading ? _jsx(Skeleton, { className: 'h-5 w-full rounded-lg' }) : _jsx("div", { className: 'text-zinc-500 truncate', children: value2 }) })), showCopyIcon && (_jsx("div", { className: cn('absolute top-1/2 right-0 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100'), children: _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: 'ghost', type: 'button', className: cn('p-1 h-10 w-8 bg-sidebar-accent'), onClick: handleCopy, children: _jsx(Copy, { size: 16 }) }) }), _jsx(TooltipContent, { children: "Copiar" })] }) }) })), hoverAction && (_jsx("div", { className: cn('absolute top-1/2 right-0 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100'), children: _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: 'ghost', type: 'button', className: cn('p-1 h-10 w-8 bg-sidebar-accent'), onClick: hoverAction.onClick, children: hoverAction.icon }) }), _jsx(TooltipContent, { children: hoverAction.tooltip })] }) }) }))] }) }) }));
|
|
19
|
+
};
|
|
20
|
+
export default LabelWithTitle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/custom/not-found.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,QAAQ,+CA0Bb,CAAC;AACF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BarChart2 } from 'lucide-react';
|
|
3
|
+
import { Button } from '../button';
|
|
4
|
+
const NotFound = () => {
|
|
5
|
+
return (_jsx("div", { className: "flex flex-col items-center justify-center h-screen bg-[url('/imgs/404.png')] bg-cover bg-no-repeat bg-center", children: _jsxs("div", { className: 'flex flex-col items-center justify-center gap-8 w-[424px]', children: [_jsxs("div", { className: 'flex flex-col items-center w-full', children: [_jsx("div", { className: 'text-5xl font-extrabold', children: "404" }), _jsx("div", { className: 'text-3xl font-semibold', children: "P\u00E1gina Indispon\u00EDvel" })] }), _jsx("div", { className: 'flex text-center text-xl font-semibold text-zinc-500', children: "A p\u00E1gina que voc\u00EA est\u00E1 tentando acessar se encontra indispon\u00EDvel no momento, tente novamente mais tarde" }), _jsx("div", { className: 'flex justify-center w-full', children: _jsxs(Button, { type: 'button', onClick: () => {
|
|
6
|
+
window.location.href = '/';
|
|
7
|
+
}, className: '[&_svg]:size-5', children: [_jsx(BarChart2, {}), "Voltar Para Inicial"] }) })] }) }));
|
|
8
|
+
};
|
|
9
|
+
export default NotFound;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type ResponsiveDialogAction = {
|
|
2
|
+
label: string;
|
|
3
|
+
icon?: JSX.Element;
|
|
4
|
+
variant: 'link' | 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost';
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
hideMobile?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type ResponsiveDialogRef = {
|
|
11
|
+
close: () => void;
|
|
12
|
+
};
|
|
13
|
+
interface ResponsiveDialogProps {
|
|
14
|
+
trigger?: React.ReactNode;
|
|
15
|
+
title: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
actions?: ResponsiveDialogAction[];
|
|
19
|
+
isOpenDialog?: boolean;
|
|
20
|
+
setIsOpenDialog?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
21
|
+
}
|
|
22
|
+
export declare const ResponsiveDialog: import("react").ForwardRefExoticComponent<ResponsiveDialogProps & import("react").RefAttributes<ResponsiveDialogRef>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=responsive-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/custom/responsive-dialog.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IAChF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,UAAU,qBAAqB;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAChE;AAED,eAAO,MAAM,gBAAgB,uHA2E5B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
|
3
|
+
import { useIsMobile } from '@/hooks/use-mobile';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
import { Button } from '../button';
|
|
6
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger } from '../dialog';
|
|
7
|
+
import { Drawer, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from '../drawer';
|
|
8
|
+
export const ResponsiveDialog = forwardRef(({ title, trigger, description, children, actions, isOpenDialog, setIsOpenDialog }, ref) => {
|
|
9
|
+
const [open, setOpen] = useState(false);
|
|
10
|
+
const isMobile = useIsMobile();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (isOpenDialog !== undefined) {
|
|
13
|
+
setOpen(isOpenDialog);
|
|
14
|
+
}
|
|
15
|
+
}, [isOpenDialog]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (setIsOpenDialog !== undefined) {
|
|
18
|
+
setIsOpenDialog(open);
|
|
19
|
+
}
|
|
20
|
+
}, [open]);
|
|
21
|
+
useImperativeHandle(ref, () => ({
|
|
22
|
+
close: () => setOpen(false),
|
|
23
|
+
}));
|
|
24
|
+
const renderTitle = () => _jsx("div", { className: 'text-2xl font-semibold', children: title });
|
|
25
|
+
const renderActions = () => {
|
|
26
|
+
return actions?.map((action, index) => (_jsxs(Button, { onClick: () => action.onClick?.(), variant: action.variant, disabled: action.disabled, className: cn('', action.hideMobile && 'md:flex hidden'), children: [action.icon && _jsx("div", { className: '[&_svg]:size-5', children: action.icon }), action.label] }, `action-responsive-dialog-${index}`)));
|
|
27
|
+
};
|
|
28
|
+
if (isMobile) {
|
|
29
|
+
return (_jsxs(Drawer, { open: open, onOpenChange: setOpen, children: [trigger && (_jsx(DrawerTrigger, { className: 'cursor-pointer', asChild: true, children: trigger })), _jsxs(DrawerContent, { className: 'px-5 py-7 rounded-t-3xl', children: [_jsxs(DrawerHeader, { children: [_jsx(DrawerTitle, { children: renderTitle() }), description ? _jsx(DrawerDescription, { children: description }) : _jsx(DrawerDescription, {})] }), children, _jsx(DrawerFooter, { className: 'grid gap-6 px-0 pt-8', children: renderActions() })] })] }));
|
|
30
|
+
}
|
|
31
|
+
return (_jsxs(Dialog, { open: open, onOpenChange: setOpen, children: [trigger && (_jsx(DialogTrigger, { className: 'cursor-pointer h-min', asChild: true, children: trigger })), _jsxs(DialogContent, { className: 'px-4 py-7 rounded-3xl', children: [_jsx(DialogTitle, { className: 'px-1', children: renderTitle() }), description ? _jsx(DialogDescription, { className: 'px-1', children: description }) : _jsx(DialogDescription, {}), _jsx("div", { className: 'max-h-[70vh] overflow-y-auto px-1', children: children }), _jsx(DialogFooter, { className: 'gap-2 px-1', children: renderActions() })] })] }));
|
|
32
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Module } from './types/sidebar';
|
|
2
|
+
interface ModuleSwitcherProps {
|
|
3
|
+
modules: Module[];
|
|
4
|
+
activeModule: Module | undefined;
|
|
5
|
+
onModuleChange: (module: Module) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const ModuleSwitcher: ({ modules, activeModule, onModuleChange }: ModuleSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ModuleSwitcher;
|
|
9
|
+
//# sourceMappingURL=module-switcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-switcher.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/module-switcher.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,UAAU,mBAAmB;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,QAAA,MAAM,cAAc,GAAI,2CAA2C,mBAAmB,4CAiDrF,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, ChevronsUpDown } from 'lucide-react';
|
|
3
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../../dropdown-menu';
|
|
4
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from '../../sidebar';
|
|
5
|
+
import SidebarItemTwoLines from './sidebar-item-two-lines';
|
|
6
|
+
const ModuleSwitcher = ({ modules, activeModule, onModuleChange }) => {
|
|
7
|
+
const { isMobile } = useSidebar();
|
|
8
|
+
return modules.length === 1 ? (_jsx(SidebarMenuButton, { size: 'lg', className: 'data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground', children: _jsx(SidebarItemTwoLines, { item: {
|
|
9
|
+
iconLeft: _jsx("div", { className: 'flex p-[7.6px] items-center rounded-md bg-background-primary', children: activeModule?.icon }),
|
|
10
|
+
title: activeModule?.title ?? '',
|
|
11
|
+
subTitle: activeModule?.subTitle ?? '',
|
|
12
|
+
} }) })) : (_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: {
|
|
13
|
+
iconLeft: (_jsx("div", { className: 'flex p-[7.6px] items-center rounded-md bg-background-primary', children: activeModule?.icon })),
|
|
14
|
+
title: activeModule?.title ?? '',
|
|
15
|
+
subTitle: activeModule?.subTitle ?? '',
|
|
16
|
+
iconRight: _jsx(ChevronsUpDown, { size: 16 }),
|
|
17
|
+
} }) }) }), _jsx(DropdownMenuContent, { className: 'w-[250px] rounded-lg', align: 'start', side: isMobile ? 'bottom' : 'right', sideOffset: 4, children: modules.map((module) => (_jsx(DropdownMenuItem, { onClick: () => onModuleChange?.(module), className: 'gap-2 p-2', children: _jsx(SidebarItemTwoLines, { item: {
|
|
18
|
+
iconLeft: _jsx("div", { className: 'flex p-[7.6px] items-center rounded-md bg-background-primary', children: module.icon }),
|
|
19
|
+
title: module.title,
|
|
20
|
+
subTitle: module.subTitle,
|
|
21
|
+
iconRight: activeModule?.value === module.value ? _jsx(Check, { size: 16 }) : null,
|
|
22
|
+
} }) }, `module-switcher-${module.value}`))) })] }) }) }));
|
|
23
|
+
};
|
|
24
|
+
export default ModuleSwitcher;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SidebarPage } from './types/sidebar';
|
|
2
|
+
interface NavFooterProps {
|
|
3
|
+
pages: SidebarPage[];
|
|
4
|
+
}
|
|
5
|
+
declare const NavFooter: ({ pages }: NavFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default NavFooter;
|
|
7
|
+
//# sourceMappingURL=nav-footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-footer.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/nav-footer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,UAAU,cAAc;IACvB,KAAK,EAAE,WAAW,EAAE,CAAC;CACrB;AAED,QAAA,MAAM,SAAS,GAAI,WAAW,cAAc,4CAuB3C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useLocation, useNavigate } from 'react-router-dom';
|
|
3
|
+
import { SidebarGroup, SidebarGroupContent, SidebarMenu } from '../../sidebar';
|
|
4
|
+
import SidebarItem from './sidebar-item';
|
|
5
|
+
const NavFooter = ({ pages }) => {
|
|
6
|
+
const navigate = useNavigate();
|
|
7
|
+
const location = useLocation();
|
|
8
|
+
const selectedRoutePath = location.pathname;
|
|
9
|
+
return (_jsx(SidebarGroup, { className: 'p-0', children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: pages.map((item) => {
|
|
10
|
+
return (_jsx(SidebarItem, { item: item, selectedRoute: selectedRoutePath, onClick: () => navigate(item.path) }, `sidebar-menu-main-${item.path}`));
|
|
11
|
+
}) }) }) }));
|
|
12
|
+
};
|
|
13
|
+
export default NavFooter;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type SidebarPage } from './types/sidebar';
|
|
2
|
+
interface NavMainProps {
|
|
3
|
+
pages: SidebarPage[];
|
|
4
|
+
}
|
|
5
|
+
declare const NavMain: ({ pages }: NavMainProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default NavMain;
|
|
7
|
+
//# sourceMappingURL=nav-main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-main.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/nav-main.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAEvE,UAAU,YAAY;IACrB,KAAK,EAAE,WAAW,EAAE,CAAC;CACrB;AAED,QAAA,MAAM,OAAO,GAAI,WAAW,YAAY,4CAiDvC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useLocation, useNavigate } from 'react-router-dom';
|
|
3
|
+
import { SidebarGroup, SidebarGroupContent, SidebarMenu, useSidebar } from '../../sidebar';
|
|
4
|
+
import NavSubmenuCollapsible from './nav-submenu-collapsible';
|
|
5
|
+
import NavSubmenuDropdown from './nav-submenu-dropdown';
|
|
6
|
+
import SidebarItem from './sidebar-item';
|
|
7
|
+
import { SidebarSubmenuType } from './types/sidebar';
|
|
8
|
+
const NavMain = ({ pages }) => {
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
const location = useLocation();
|
|
11
|
+
const { isMobile } = useSidebar();
|
|
12
|
+
const selectedRoutePath = location.pathname;
|
|
13
|
+
return (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: pages.map((item) => {
|
|
14
|
+
if (item.subMenuType) {
|
|
15
|
+
if (item.subMenuType === SidebarSubmenuType.COLLAPSIBLE || isMobile) {
|
|
16
|
+
return (_jsx(NavSubmenuCollapsible, { item: item, selectedRoute: selectedRoutePath, onClick: (path) => navigate(path) }, `sidebar-submenu-collapsible-${item.path}`));
|
|
17
|
+
}
|
|
18
|
+
// Deprecated: Use COLLAPSIBLE instead
|
|
19
|
+
if (item.subMenuType === SidebarSubmenuType.DROPDOWN) {
|
|
20
|
+
return (_jsx(NavSubmenuDropdown, { item: item, selectedRoute: selectedRoutePath, onClick: (path) => navigate(path), cols: 3 }, `sidebar-submenu-dropdown-${item.path}`));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return (_jsx(SidebarItem, { item: item, selectedRoute: selectedRoutePath, onClick: () => navigate(item.path) }, `sidebar-menu-main-${item.path}`));
|
|
24
|
+
}) }) }) }));
|
|
25
|
+
};
|
|
26
|
+
export default NavMain;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-submenu-collapsible.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/nav-submenu-collapsible.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,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,4CA4C1F,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../../../lib/utils';
|
|
4
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../collapsible';
|
|
5
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, useSidebar } from '../../sidebar';
|
|
6
|
+
const NavSubmenuCollapsible = ({ item, selectedRoute, onClick }) => {
|
|
7
|
+
const { open, toggleSidebar } = useSidebar();
|
|
8
|
+
const isOpen = () => {
|
|
9
|
+
return selectedRoute?.includes(item.path) ?? false;
|
|
10
|
+
};
|
|
11
|
+
const handleToggleSidebar = () => {
|
|
12
|
+
if (!open)
|
|
13
|
+
toggleSidebar();
|
|
14
|
+
};
|
|
15
|
+
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?.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) }));
|
|
16
|
+
};
|
|
17
|
+
export default NavSubmenuCollapsible;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-submenu-dropdown.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/nav-submenu-dropdown.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,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,4CAuC1F,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../../../lib/utils';
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../../dropdown-menu';
|
|
5
|
+
import { SidebarMenuButton, SidebarMenuItem } from '../../sidebar';
|
|
6
|
+
const NavSubmenuDropdown = ({ cols, item, selectedRoute, onClick }) => {
|
|
7
|
+
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?.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}`))) })] }) }));
|
|
8
|
+
};
|
|
9
|
+
export default NavSubmenuDropdown;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface NavUserProps {
|
|
2
|
+
userName: string;
|
|
3
|
+
userEmail: string;
|
|
4
|
+
userInitials: string;
|
|
5
|
+
callbackLogout: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const NavUser: ({ userName, userEmail, userInitials, callbackLogout }: NavUserProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default NavUser;
|
|
9
|
+
//# sourceMappingURL=nav-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-user.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/nav-user.tsx"],"names":[],"mappings":"AAOA,UAAU,YAAY;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,QAAA,MAAM,OAAO,GAAI,uDAAuD,YAAY,4CA4DnF,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LoaderCircle, LogOut } from 'lucide-react';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Avatar, AvatarFallback, AvatarImage } from '../../avatar';
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from '../../dropdown-menu';
|
|
6
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from '../../sidebar';
|
|
7
|
+
import SidebarItemTwoLines from './sidebar-item-two-lines';
|
|
8
|
+
const NavUser = ({ userName, userEmail, userInitials, callbackLogout }) => {
|
|
9
|
+
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
|
10
|
+
const { isMobile } = useSidebar();
|
|
11
|
+
const handleLogout = () => {
|
|
12
|
+
setIsLoggingOut(true);
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
callbackLogout();
|
|
15
|
+
}, 1000);
|
|
16
|
+
};
|
|
17
|
+
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: {
|
|
18
|
+
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 })] })),
|
|
19
|
+
title: isLoggingOut ? 'Saindo...' : userName,
|
|
20
|
+
subTitle: isLoggingOut ? '' : userEmail,
|
|
21
|
+
iconRight: isLoggingOut ? (_jsx(LoaderCircle, { size: 16, className: 'text-sidebar-foreground animate-spin mr-2' })) : (_jsx(LogOut, { size: 16, className: 'text-sidebar-foreground' })),
|
|
22
|
+
} }) }) }), _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"] }) })] })] }) }) }));
|
|
23
|
+
};
|
|
24
|
+
export default NavUser;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-button.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/sidebar-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-item-two-lines.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/sidebar-item-two-lines.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/sidebar/sidebar-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ui/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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-export.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/table/data-table-export.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,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,8DAgH9E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { downloadWithServiceWorker } from '@/lib/help/download';
|
|
6
|
+
import { Button } from '../../button';
|
|
7
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '../../dialog';
|
|
8
|
+
import { Form } from '../../form';
|
|
9
|
+
import { toast } from '../../use-toast';
|
|
10
|
+
import { FormRadioGroup } from '../form/radio-group';
|
|
11
|
+
export function DataTableExport({ exportData, totalRows }) {
|
|
12
|
+
const ExportDataSchema = z.object({
|
|
13
|
+
model: z.string(),
|
|
14
|
+
format: z.string(),
|
|
15
|
+
});
|
|
16
|
+
const form = useForm({
|
|
17
|
+
mode: 'onTouched',
|
|
18
|
+
resolver: zodResolver(ExportDataSchema),
|
|
19
|
+
});
|
|
20
|
+
const { control, trigger, handleSubmit } = form;
|
|
21
|
+
const exportXlSX = () => {
|
|
22
|
+
if (!exportData)
|
|
23
|
+
return;
|
|
24
|
+
if (totalRows === 0) {
|
|
25
|
+
toast({
|
|
26
|
+
title: 'Não há dados para exportar.',
|
|
27
|
+
variant: 'destructive',
|
|
28
|
+
});
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
const params = new URLSearchParams(exportData.params).toString();
|
|
32
|
+
downloadWithServiceWorker(`${exportData.url}?${params}`, 'data_export.xlsx');
|
|
33
|
+
};
|
|
34
|
+
const renderExport = () => {
|
|
35
|
+
if (!exportData)
|
|
36
|
+
return null;
|
|
37
|
+
if (exportData.type === 'xlsx') {
|
|
38
|
+
return (_jsx(Button, { type: 'button', variant: 'secondary', onClick: exportXlSX, children: "Exportar" }));
|
|
39
|
+
}
|
|
40
|
+
if (exportData.type === 'dialog') {
|
|
41
|
+
const onSubmit = async (_values) => {
|
|
42
|
+
await trigger();
|
|
43
|
+
toast({
|
|
44
|
+
title: 'Em desenvolvimento.',
|
|
45
|
+
variant: 'destructive',
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const onError = async (_errors) => {
|
|
49
|
+
toast({
|
|
50
|
+
title: 'Erro ao salvar',
|
|
51
|
+
description: 'Verifique os campos obrigatórios',
|
|
52
|
+
variant: 'destructive',
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
return (_jsx(Form, { ...form, onSubmit: handleSubmit(onSubmit, onError), children: _jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { type: '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: [
|
|
56
|
+
{ value: '0', label: 'Resumido' },
|
|
57
|
+
{ value: '1', label: 'Detalhado' },
|
|
58
|
+
], 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: [
|
|
59
|
+
{ value: '0', label: 'PDF' },
|
|
60
|
+
{ value: '1', label: 'XLSX' },
|
|
61
|
+
], 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" })] })] })] }) }));
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
};
|
|
65
|
+
return exportData && renderExport();
|
|
66
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PaginationState } from '@tanstack/react-table';
|
|
2
|
+
import type { 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-footer.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/table/data-table-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAa7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,UAAU,oBAAoB,CAAC,MAAM;IACpC,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"}
|