eai-frontend-components 2.0.22 → 2.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +298 -298
- package/dist/eai-frontend-components-1.0.0.tgz +0 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +147 -146
- 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 -132
- 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.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/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 -20
- 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/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/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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;AAKpE,QAAA,MAAM,WAAW,iDAA4B,CAAA;AAE7C,QAAA,MAAM,kBAAkB,sHAA+B,CAAA;AAEvD,QAAA,MAAM,gBAAgB,mHAA6B,CAAA;AAEnD,QAAA,MAAM,iBAAiB,uDAA8B,CAAA;AAErD,QAAA,MAAM,cAAc,oDAA2B,CAAA;AAE/C,QAAA,MAAM,qBAAqB,wHAAkC,CAAA;AAE7D,QAAA,MAAM,qBAAqB;YAGf,OAAO;wCAejB,CAAA;AAGF,QAAA,MAAM,qBAAqB,2KAYzB,CAAA;AAGF,QAAA,MAAM,kBAAkB,wKActB,CAAA;AAGF,QAAA,MAAM,eAAe;YAGT,OAAO;wCAYjB,CAAA;AAGF,QAAA,MAAM,uBAAuB,6KAoB3B,CAAA;AAIF,QAAA,MAAM,oBAAoB,0KAmBxB,CAAA;AAGF,QAAA,MAAM,gBAAgB;YAGV,OAAO;wCAYjB,CAAA;AAGF,QAAA,MAAM,oBAAoB,0KASxB,CAAA;AAGF,QAAA,MAAM,mBAAmB;8BAGtB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAUvC,CAAA;AAGD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
4
|
-
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
const ContextMenu = ContextMenuPrimitive.Root;
|
|
7
|
-
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
8
|
-
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
9
|
-
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
10
|
-
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
11
|
-
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
12
|
-
const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] })));
|
|
13
|
-
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
14
|
-
const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props })));
|
|
15
|
-
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
16
|
-
const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props }) })));
|
|
17
|
-
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
18
|
-
const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className), ...props })));
|
|
19
|
-
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
20
|
-
const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(ContextMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
21
|
-
ContextMenuCheckboxItem.displayName =
|
|
22
|
-
ContextMenuPrimitive.CheckboxItem.displayName;
|
|
23
|
-
const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
|
|
24
|
-
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
25
|
-
const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className), ...props })));
|
|
26
|
-
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
27
|
-
const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-border", className), ...props })));
|
|
28
|
-
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
29
|
-
const ContextMenuShortcut = ({ className, ...props }) => {
|
|
30
|
-
return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props }));
|
|
31
|
-
};
|
|
32
|
-
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
33
|
-
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DayPicker } from 'react-day-picker';
|
|
3
|
-
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
-
interface CalendarFormProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
onDateSelected: (selectedDateProps: Date | null) => void;
|
|
6
|
-
selectedDateProps?: Date | null;
|
|
7
|
-
startYear?: number;
|
|
8
|
-
endYear?: number;
|
|
9
|
-
}
|
|
10
|
-
declare const DatePicker: React.ForwardRefExoticComponent<CalendarFormProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export { DatePicker };
|
|
12
|
-
//# sourceMappingURL=date-picker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/custom/date-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAM7C,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAEnE,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE,cAAc,EAAE,CAAC,iBAAiB,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACzD,iBAAiB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,UAAU,0FA0Ef,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getMonth, getYear, setMonth, setYear } from 'date-fns';
|
|
3
|
-
import { ptBR } from 'date-fns/locale';
|
|
4
|
-
import { Calendar as CalendarIcon } from 'lucide-react';
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
import { cn } from '../../../lib/utils';
|
|
7
|
-
import { Calendar as CalendarComponent } from '../calendar';
|
|
8
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../popover';
|
|
9
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../select';
|
|
10
|
-
const DatePicker = React.forwardRef(({ className, onDateSelected, selectedDateProps, startYear = getYear(new Date()) - 100, endYear = getYear(new Date()) + 100, ...props }, ref) => {
|
|
11
|
-
const [selectedDate, setSelectedDate] = useState(null);
|
|
12
|
-
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
13
|
-
const months = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];
|
|
14
|
-
const years = Array.from({ length: endYear - startYear + 1 }, (_, i) => startYear + i);
|
|
15
|
-
const handleMonthChange = (month) => {
|
|
16
|
-
if (selectedDate) {
|
|
17
|
-
const newDate = setMonth(selectedDate, months.indexOf(month));
|
|
18
|
-
setSelectedDate(newDate);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const handleYearChange = (year) => {
|
|
22
|
-
if (selectedDate) {
|
|
23
|
-
const newDate = setYear(selectedDate, parseInt(year, 10));
|
|
24
|
-
setSelectedDate(newDate);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const handleDateChange = (selectedDate) => {
|
|
28
|
-
const newDate = selectedDate || null;
|
|
29
|
-
setSelectedDate(newDate);
|
|
30
|
-
setIsPopoverOpen(false);
|
|
31
|
-
onDateSelected(newDate);
|
|
32
|
-
};
|
|
33
|
-
return (_jsx("div", { className: cn('gap-2', className), ref: ref, ...props, children: _jsxs(Popover, { open: isPopoverOpen, onOpenChange: setIsPopoverOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(CalendarIcon, { size: 16, className: 'cursor-pointer text-gray-500', onClick: () => setIsPopoverOpen(true) }) }), _jsxs(PopoverContent, { className: 'w-auto p-0 flex flex-col justify-center', align: 'start', children: [_jsxs("div", { className: 'flex justify-between pt-5 px-5', children: [_jsxs(Select, { onValueChange: handleMonthChange, value: months[getMonth(selectedDate || new Date())], children: [_jsx(SelectTrigger, { className: 'w-[100px]', children: _jsx(SelectValue, { placeholder: 'Month' }) }), _jsx(SelectContent, { children: months.map((month) => (_jsx(SelectItem, { value: month, children: month }, month))) })] }), _jsxs(Select, { onValueChange: handleYearChange, value: getYear(selectedDate || new Date()).toString(), children: [_jsx(SelectTrigger, { className: 'w-[100px]', children: _jsx(SelectValue, { placeholder: 'Year' }) }), _jsx(SelectContent, { children: years.map((year) => (_jsx(SelectItem, { value: year.toString(), children: year }, year))) })] })] }), _jsx(CalendarComponent, { mode: 'single', locale: ptBR, onSelect: handleDateChange, className: 'bg-white text-black', month: selectedDate || undefined })] })] }) }));
|
|
34
|
-
});
|
|
35
|
-
export { DatePicker };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
control: any;
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
subLabel?: string;
|
|
6
|
-
helpText?: JSX.Element;
|
|
7
|
-
className?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
onCheckedChange?: (checked: boolean) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const FormInputCheckbox: React.FC<Props>;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/checkbox.tsx"],"names":[],"mappings":"AAMA,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmC7C,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Checkbox } from '../../checkbox';
|
|
3
|
-
import * as FormComponents from '../../form';
|
|
4
|
-
import { formHelpText } from './form-help-text';
|
|
5
|
-
import { formLabel } from './form-label';
|
|
6
|
-
import { formMessage } from './form-message';
|
|
7
|
-
export const FormInputCheckbox = ({ control, name, label, helpText, className, disabled, onCheckedChange }) => {
|
|
8
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
9
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center gap-2', children: [_jsx(FormControl, { children: _jsx(Checkbox, { value: field.value, className: `${field.value
|
|
10
|
-
? 'bg-purple-700 border border-purple-900 text-white rounded-[3px]'
|
|
11
|
-
: 'bg-white border border-black text-black'}`, onCheckedChange: (checked) => {
|
|
12
|
-
field?.onChange?.(checked);
|
|
13
|
-
onCheckedChange?.(checked);
|
|
14
|
-
}, disabled: disabled }) }), _jsxs("div", { className: 'flex h-full items-center space-x-1.5', children: [label && formLabel(FormLabel, label), helpText && formHelpText(helpText)] })] }), formMessage(FormMessage)] })) }));
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
control: any;
|
|
3
|
-
id?: string;
|
|
4
|
-
name: string;
|
|
5
|
-
label: string;
|
|
6
|
-
subLabel?: string;
|
|
7
|
-
helpText?: JSX.Element;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
className?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const FormInputColor: React.FC<Props>;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=color.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/color.tsx"],"names":[],"mappings":"AAcA,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgH1C,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Paintbrush } from 'lucide-react';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { HexColorPicker } from 'react-colorful';
|
|
5
|
-
import { cn } from '../../../../lib/utils';
|
|
6
|
-
import { Button } from '../../button';
|
|
7
|
-
import * as FormComponents from '../../form';
|
|
8
|
-
import { Input } from '../../input';
|
|
9
|
-
import { Label } from '../../label';
|
|
10
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../../popover';
|
|
11
|
-
import { formHelpText } from './form-help-text';
|
|
12
|
-
import { formLabelAndSubLabel } from './form-label';
|
|
13
|
-
import { formMessage } from './form-message';
|
|
14
|
-
import { hexToRgb, rgbToHex } from './utils';
|
|
15
|
-
export const FormInputColor = ({ control, name, label, subLabel, helpText, placeholder, className, disabled, required }) => {
|
|
16
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
17
|
-
const DEFAULT_COLOR = '#000000';
|
|
18
|
-
const [currentColor, setCurrentColor] = useState(DEFAULT_COLOR);
|
|
19
|
-
const rgb = hexToRgb(currentColor) || { r: 0, g: 0, b: 0 };
|
|
20
|
-
const handleColorChange = (newColor, onChange) => {
|
|
21
|
-
onChange?.(newColor);
|
|
22
|
-
setCurrentColor(newColor);
|
|
23
|
-
};
|
|
24
|
-
const handleHexChange = (hex, onChange) => {
|
|
25
|
-
if (/^#[0-9A-Fa-f]{6}$/.test(hex)) {
|
|
26
|
-
handleColorChange(hex, onChange);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
setCurrentColor(hex);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const handleRgbChange = (key, value, onChange) => {
|
|
33
|
-
const numValue = Number.parseInt(value);
|
|
34
|
-
if (!Number.isNaN(numValue) && numValue >= 0 && numValue <= 255) {
|
|
35
|
-
const newRgb = { ...rgb, [key]: numValue };
|
|
36
|
-
handleColorChange(rgbToHex(newRgb), onChange);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), _jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(FormControl, { children: _jsx(Button, { variant: 'outline', className: cn('w-[240px] justify-start text-left font-normal', !field.value && 'text-zinc-500', className), disabled: disabled || formState.isSubmitting, children: _jsxs("div", { className: 'w-full flex items-center gap-2', children: [field.value ? (_jsx("div", { className: 'h-4 w-4 rounded !bg-center !bg-cover transition-all border', style: { backgroundColor: field.value } })) : (_jsx(Paintbrush, { className: 'h-4 w-4' })), _jsx("div", { className: 'truncate flex-1 text-sm', children: field.value ? field.value : placeholder || 'Selecione uma cor' })] }) }) }) }), _jsx(PopoverContent, { className: cn('w-80', className), children: _jsxs("div", { className: 'flex flex-col gap-4', children: [_jsx("section", { className: '[&_.react-colorful]:w-auto', children: _jsx(HexColorPicker, { color: field.value ?? DEFAULT_COLOR, onChange: (newColor) => handleColorChange(newColor, field.onChange) }) }), _jsxs("div", { className: 'flex gap-2', children: [_jsxs("div", { className: 'flex flex-col gap-1', children: [_jsx(Label, { children: "Hex" }), _jsx(Input, { value: currentColor, onChange: (e) => handleHexChange(e.target.value, field.onChange), maxLength: 7 })] }), _jsxs("div", { className: 'flex gap-2', children: [_jsxs("div", { className: 'flex flex-col gap-1', children: [_jsx(Label, { children: "R" }), _jsx(Input, { value: rgb.r, onChange: (e) => handleRgbChange('r', e.target.value, field.onChange), className: 'w-14' })] }), _jsxs("div", { className: 'flex flex-col gap-1', children: [_jsx(Label, { children: "G" }), _jsx(Input, { value: rgb.g, onChange: (e) => handleRgbChange('g', e.target.value, field.onChange), className: 'w-14' })] }), _jsxs("div", { className: 'flex flex-col gap-1', children: [_jsx(Label, { children: "B" }), _jsx(Input, { value: rgb.b, onChange: (e) => handleRgbChange('b', e.target.value, field.onChange), className: 'w-14' })] })] })] })] }) })] }), formMessage(FormMessage)] })) }));
|
|
40
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export interface ComboboxOption {
|
|
2
|
-
value: string | undefined;
|
|
3
|
-
icon?: React.ReactNode | undefined;
|
|
4
|
-
title: string;
|
|
5
|
-
subTitle?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
interface Props {
|
|
9
|
-
control: any;
|
|
10
|
-
name: string;
|
|
11
|
-
label?: string;
|
|
12
|
-
subLabel?: string;
|
|
13
|
-
helpText?: JSX.Element;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
className?: string;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
required?: boolean;
|
|
18
|
-
options: ComboboxOption[];
|
|
19
|
-
selectedOption?: ComboboxOption;
|
|
20
|
-
iconLeft?: React.ReactNode | null;
|
|
21
|
-
iconRight?: React.ReactNode | null;
|
|
22
|
-
addEmptyOption?: boolean;
|
|
23
|
-
canUnselect?: boolean;
|
|
24
|
-
closePopUpOnChange?: boolean;
|
|
25
|
-
runInternalSearch?: boolean;
|
|
26
|
-
disabledSearch?: boolean;
|
|
27
|
-
onChange?: (option: ComboboxOption | undefined) => void;
|
|
28
|
-
onSearch?: (searchString: string) => void;
|
|
29
|
-
footerAction?: {
|
|
30
|
-
label: string;
|
|
31
|
-
icon?: React.ReactNode;
|
|
32
|
-
onClick: () => void;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export declare const FormCombobox: React.FC<Props>;
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/combobox.tsx"],"names":[],"mappings":"AAYA,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,OAAO,EAAE,MAAM,IAAI,CAAC;KACpB,CAAC;CACF;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAkNxC,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Check, ChevronsUpDown, LoaderCircle, X } from 'lucide-react';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { cn } from '../../../../lib/utils';
|
|
5
|
-
import { Button } from '../../button';
|
|
6
|
-
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../../command';
|
|
7
|
-
import * as FormComponents from '../../form';
|
|
8
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../../popover';
|
|
9
|
-
import { formHelpText } from './form-help-text';
|
|
10
|
-
import { formLabelAndSubLabel } from './form-label';
|
|
11
|
-
import { formMessage } from './form-message';
|
|
12
|
-
export const FormCombobox = ({ control, name, label, subLabel, helpText, placeholder, className, disabled, required, options, selectedOption, iconLeft, iconRight, addEmptyOption, canUnselect = false, closePopUpOnChange = true, runInternalSearch = true, disabledSearch = false, onChange, onSearch, footerAction, }) => {
|
|
13
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
14
|
-
const [open, setOpen] = useState(false);
|
|
15
|
-
const [loading, setLoading] = useState(false);
|
|
16
|
-
const [searchString, setSearchString] = useState('');
|
|
17
|
-
const DEFAULT_PLACEHOLDER = 'Digite para buscar...';
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
setLoading(false);
|
|
20
|
-
}, [options]);
|
|
21
|
-
const getOptions = () => {
|
|
22
|
-
if (options.length === 0) {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
let filteredOptions = options;
|
|
26
|
-
if (runInternalSearch) {
|
|
27
|
-
filteredOptions = options.filter((option) => {
|
|
28
|
-
const title = option.title
|
|
29
|
-
.toLowerCase()
|
|
30
|
-
.normalize('NFD')
|
|
31
|
-
.replace(/[^a-z0-9\s]/gi, '');
|
|
32
|
-
const subTitle = option.subTitle
|
|
33
|
-
?.toLowerCase()
|
|
34
|
-
.normalize('NFD')
|
|
35
|
-
.replace(/[^a-z0-9\s]/gi, '');
|
|
36
|
-
const search = searchString
|
|
37
|
-
.toLowerCase()
|
|
38
|
-
.normalize('NFD')
|
|
39
|
-
.replace(/[^a-z0-9\s]/gi, '');
|
|
40
|
-
return title.includes(search) || subTitle?.includes(search);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
if (addEmptyOption) {
|
|
44
|
-
filteredOptions.unshift({ value: undefined, title: '--Selecione--', subTitle: '' });
|
|
45
|
-
}
|
|
46
|
-
return filteredOptions;
|
|
47
|
-
};
|
|
48
|
-
const getSelectedOption = (value) => {
|
|
49
|
-
const option = options.find((option) => option.value === value);
|
|
50
|
-
if (option) {
|
|
51
|
-
return option;
|
|
52
|
-
}
|
|
53
|
-
return selectedOption;
|
|
54
|
-
};
|
|
55
|
-
const handleSelect = (value, field) => {
|
|
56
|
-
const option = value ? getSelectedOption(value) : undefined;
|
|
57
|
-
if (canUnselect) {
|
|
58
|
-
field.onChange(field.value === value ? undefined : value);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
field.onChange(value);
|
|
62
|
-
}
|
|
63
|
-
if (onChange) {
|
|
64
|
-
onChange(option);
|
|
65
|
-
}
|
|
66
|
-
if (closePopUpOnChange) {
|
|
67
|
-
setOpen(false);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const handleKeyUp = (event) => {
|
|
71
|
-
const searchString = event.target.value;
|
|
72
|
-
if (onSearch) {
|
|
73
|
-
setLoading(true);
|
|
74
|
-
onSearch(searchString);
|
|
75
|
-
}
|
|
76
|
-
setSearchString(searchString);
|
|
77
|
-
};
|
|
78
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), _jsxs(Popover, { open: open, onOpenChange: (open) => {
|
|
79
|
-
if (!disabled)
|
|
80
|
-
setOpen(open);
|
|
81
|
-
}, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(FormControl, { children: _jsx("div", { className: cn(`rounded-sm outline-none ${open ? 'ring-2 ring-ring ring-offset-2' : 'ring-0'}`, className), children: _jsxs(Button, { type: 'button', variant: 'outline', role: 'combobox', "aria-expanded": open, className: cn('justify-between disabled:border-disabled disabled:cursor-not-allowed disabled:opacity-50', formState.errors[name] ? 'border-red-600' : '', className), disabled: disabled || formState.isSubmitting, children: [iconLeft, _jsx("div", { className: 'grid flex-1 text-left text-sm leading-tight', children: _jsx("span", { className: 'truncate font-normal', children: getSelectedOption(field.value) ? (_jsxs("div", { className: 'flex gap-2', children: [getSelectedOption(field.value)?.icon, getSelectedOption(field.value)?.title] })) : (_jsx("span", { className: 'text-zinc-500', children: placeholder ?? DEFAULT_PLACEHOLDER })) }) }), iconRight ?? _jsx(ChevronsUpDown, { size: 20, className: 'stroke-zinc-500' })] }) }) }) }), _jsxs(PopoverContent, { className: cn('p-0', className, 'w-[--radix-popover-trigger-width]'), children: [_jsxs(Command, { shouldFilter: false, children: [!disabledSearch && _jsx(CommandInput, { placeholder: placeholder ?? DEFAULT_PLACEHOLDER, onKeyUp: handleKeyUp }), _jsxs(CommandList, { children: [_jsx(CommandEmpty, { className: 'flex flex-col justify-between items-center p-3 font-normal text-sm', children: loading ? (_jsx(LoaderCircle, { size: 16, className: 'text-sidebar-foreground animate-spin mr-2' })) : getOptions()?.length === 0 && (searchString !== '' || disabledSearch) ? ('Nenhum resultado encontrado') : ('Utilize o campo de busca acima') }), options.length > 0 && (_jsx(CommandGroup, { children: getOptions().map((option) => (_jsxs(CommandItem, { value: option.value, className: 'group', onSelect: () => handleSelect(option.value, field), children: [_jsxs("div", { className: cn('grid flex-1 text-left text-sm leading-tight', option.className), children: [_jsxs("div", { className: 'flex gap-2', children: [option.icon, _jsx("span", { className: 'truncate font-normal', children: option.title })] }), _jsx("span", { className: 'truncate text-xs text-zinc-500', children: option.subTitle })] }), _jsxs("div", { className: `ml-auto text-zinc-500 ${field.value === option.value ? 'opacity-100' : 'opacity-0'}`, children: [_jsx(Check, { className: cn('flex', canUnselect && 'group-hover:hidden hover:hidden'), size: 16 }), _jsx(X, { className: cn('hidden', canUnselect && 'group-hover:flex hover:flex'), size: 16 })] })] }, `key-opt-${option.value}`))) }))] })] }), footerAction && (_jsx("div", { className: 'grid w-full p-1 border-t', children: _jsxs(Button, { type: 'button', variant: 'ghost', className: 'h-8', onClick: () => footerAction.onClick(), children: [footerAction.icon, footerAction.label] }) }))] })] }), formMessage(FormMessage)] })) }));
|
|
82
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
control: any;
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
subLabel?: string;
|
|
6
|
-
helpText?: JSX.Element;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
-
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const FormInputCpfCnpj: React.FC<Props>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=cpf-cnpj.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cpf-cnpj.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/cpf-cnpj.tsx"],"names":[],"mappings":"AAOA,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACjE;AAID,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA6D5C,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import * as FormComponents from '../../form';
|
|
4
|
-
import { MaskInputCpfCnpj } from '../../input';
|
|
5
|
-
import { formHelpText } from './form-help-text';
|
|
6
|
-
import { formLabelAndSubLabel } from './form-label';
|
|
7
|
-
import { formMessage } from './form-message';
|
|
8
|
-
const masks = ['999.999.999-999', '99.999.999/9999-99'];
|
|
9
|
-
export const FormInputCpfCnpj = ({ control, name, label, subLabel, helpText, placeholder, className, disabled, required, onChange, onKeyUp, }) => {
|
|
10
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
11
|
-
const [mask, setMask] = useState(masks[0]);
|
|
12
|
-
const handleMaskChange = (value) => {
|
|
13
|
-
const numericValue = value.replace(/\D/g, '');
|
|
14
|
-
if (numericValue.length > 11) {
|
|
15
|
-
setMask(masks[1]);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
setMask(masks[0]);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), _jsx(FormControl, { children: _jsx(MaskInputCpfCnpj, { ...field, className: `${className}`, placeholder: placeholder, disabled: disabled || formState.isSubmitting, mask: mask, onChange: (e) => {
|
|
22
|
-
field.onChange(e);
|
|
23
|
-
handleMaskChange(e.target.value);
|
|
24
|
-
if (onChange) {
|
|
25
|
-
onChange(e);
|
|
26
|
-
}
|
|
27
|
-
}, onKeyUp: (e) => {
|
|
28
|
-
if (onKeyUp) {
|
|
29
|
-
onKeyUp(e);
|
|
30
|
-
}
|
|
31
|
-
} }) }), formMessage(FormMessage)] })) }));
|
|
32
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
control: any;
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
subLabel?: string;
|
|
6
|
-
helpText?: JSX.Element;
|
|
7
|
-
className?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const FormInputCurrency: React.FC<Props>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=currency.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/currency.tsx"],"names":[],"mappings":"AAMA,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAChE;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgC7C,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as FormComponents from '../../form';
|
|
3
|
-
import { MaskInputDecimal } from '../../input';
|
|
4
|
-
import { formHelpText } from './form-help-text';
|
|
5
|
-
import { formLabelAndSubLabel } from './form-label';
|
|
6
|
-
import { formMessage } from './form-message';
|
|
7
|
-
export const FormInputCurrency = ({ control, name, label, subLabel, helpText, className, disabled, required, onChange }) => {
|
|
8
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
9
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), _jsx(FormControl, { children: _jsx(MaskInputDecimal, { ...field, symbol: 'R$', className: `${className}`, disabled: disabled || formState.isSubmitting, onChange: (e) => {
|
|
10
|
-
field.onChange(e);
|
|
11
|
-
if (onChange) {
|
|
12
|
-
onChange(e);
|
|
13
|
-
}
|
|
14
|
-
} }) }), formMessage(FormMessage)] })) }));
|
|
15
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DateRange } from 'react-day-picker';
|
|
2
|
-
interface Props {
|
|
3
|
-
control: any;
|
|
4
|
-
name: string;
|
|
5
|
-
label: string;
|
|
6
|
-
subLabel?: string;
|
|
7
|
-
helpText?: JSX.Element;
|
|
8
|
-
placeholder?: string;
|
|
9
|
-
className?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement> | DateRange | undefined) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const FormDataRange: React.FC<Props>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=date-range.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-range.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/date-range.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAU7C,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;CACxF;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmFzC,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { format } from 'date-fns';
|
|
3
|
-
import { CalendarIcon } from 'lucide-react';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import { cn } from '../../../../lib/utils';
|
|
6
|
-
import { Button } from '../../button';
|
|
7
|
-
import { Calendar } from '../../calendar';
|
|
8
|
-
import * as FormComponents from '../../form';
|
|
9
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../../popover';
|
|
10
|
-
import { formHelpText } from './form-help-text';
|
|
11
|
-
import { formLabelAndSubLabel } from './form-label';
|
|
12
|
-
import { formMessage } from './form-message';
|
|
13
|
-
export const FormDataRange = ({ control, name, label, subLabel, helpText, placeholder, className, disabled, required, onChange, }) => {
|
|
14
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
15
|
-
// const [date, setDate] = useState<DateRange | undefined>(field.value);
|
|
16
|
-
const [open, setOpen] = useState(false);
|
|
17
|
-
const handleDateChange = (newDate, field) => {
|
|
18
|
-
// setDate(newDate);
|
|
19
|
-
field.onChange(newDate);
|
|
20
|
-
if (onChange)
|
|
21
|
-
onChange(newDate);
|
|
22
|
-
};
|
|
23
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), _jsx(FormControl, { children: _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, className: 'w-full', children: _jsx("div", { className: ` rounded-sm outline-none ${open ? 'ring-2 ring-ring ring-offset-2' : 'ring-0'}`, children: _jsxs(Button, { type: 'button', variant: 'outline', role: 'combobox', "aria-expanded": open, className: cn(` ${className} justify-start disabled:border-disabled disabled:cursor-not-allowed disabled:opacity-50`, formState.errors[name] ? 'border-red-600' : ''), disabled: disabled || formState.isSubmitting, children: [_jsx(CalendarIcon, { className: 'text-zinc-500' }), field.value?.from ? (field.value?.to ? (_jsxs(_Fragment, { children: [format(field.value?.from, 'dd/MM/yyyy'), " - ", format(field.value?.to, 'dd/MM/yyyy')] })) : (format(field.value?.from, 'dd/MM/yyyy'))) : (_jsx("span", { className: 'font-normal text-zinc-500', children: "Escolha um Per\u00EDodo" }))] }) }) }), _jsx(PopoverContent, { className: 'flex w-auto p-0', align: 'start', children: _jsx("div", { className: 'flex flex-row space-x-4', children: _jsx(Calendar, { initialFocus: true, mode: 'range', defaultMonth: field.value?.from, selected: field.value, numberOfMonths: 2, className: 'flex', onSelect: (newDate) => handleDateChange(newDate, field) }) }) })] }) }), formMessage(FormMessage)] })) }));
|
|
24
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
control: any;
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
subLabel?: string;
|
|
6
|
-
helpText?: JSX.Element;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
-
onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const FormInputDate: React.FC<Props>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=date.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/date.tsx"],"names":[],"mappings":"AAaA,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACjE;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiFzC,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ptBR } from 'date-fns/locale';
|
|
3
|
-
import { CalendarIcon } from 'lucide-react';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import { stringToDate } from '../../../../lib/help/date-utils';
|
|
6
|
-
import { cn } from '../../../../lib/utils';
|
|
7
|
-
import { Calendar } from '../../calendar';
|
|
8
|
-
import * as FormComponents from '../../form';
|
|
9
|
-
import { MaskInput } from '../../input';
|
|
10
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../../popover';
|
|
11
|
-
import { formHelpText } from './form-help-text';
|
|
12
|
-
import { formLabelAndSubLabel } from './form-label';
|
|
13
|
-
import { formMessage } from './form-message';
|
|
14
|
-
export const FormInputDate = ({ control, name, label, subLabel, helpText, placeholder = '01/01/2023', className, disabled, required, onChange, onKeyUp, }) => {
|
|
15
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
16
|
-
const [open, setOpen] = useState(false);
|
|
17
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), _jsx(FormControl, { children: _jsxs("div", { className: 'relative w-full', children: [_jsx(MaskInput, { ...field, mask: '99/99/9999', maskPlaceholder: null, placeholder: placeholder, disabled: disabled || formState.isSubmitting, className: cn('pl-9', className), onChange: (e) => {
|
|
18
|
-
field.onChange(e);
|
|
19
|
-
if (onChange) {
|
|
20
|
-
onChange(e);
|
|
21
|
-
}
|
|
22
|
-
}, onKeyUp: (e) => {
|
|
23
|
-
if (onKeyUp) {
|
|
24
|
-
onKeyUp(e);
|
|
25
|
-
}
|
|
26
|
-
} }), _jsx("div", { className: 'absolute left-3 top-1/2 -translate-y-1/2 cursor-pointer', children: _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(CalendarIcon, { size: 16, className: 'cursor-pointer text-gray-500' }) }), _jsx(PopoverContent, { className: 'w-[250px] p-0', align: 'start', children: _jsx(Calendar, { mode: 'single', locale: ptBR, required: true, selected: stringToDate(field.value) ?? new Date(), onSelect: (date) => {
|
|
27
|
-
field.onChange(date ? date.toLocaleDateString('pt-BR') : '');
|
|
28
|
-
if (onChange) {
|
|
29
|
-
onChange({
|
|
30
|
-
target: { value: date ? date.toLocaleDateString('pt-BR') : '' },
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
setOpen(false);
|
|
34
|
-
}, className: 'rounded-md', captionLayout: 'dropdown' }) })] }) })] }) }), formMessage(FormMessage)] })) }));
|
|
35
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
control: any;
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
subLabel?: string;
|
|
6
|
-
helpText?: JSX.Element;
|
|
7
|
-
className?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
required?: boolean;
|
|
10
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const FormInputDecimal: React.FC<Props>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=decimal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/decimal.tsx"],"names":[],"mappings":"AAMA,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAChE;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+B5C,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as FormComponents from '../../form';
|
|
3
|
-
import { MaskInputDecimal } from '../../input';
|
|
4
|
-
import { formHelpText } from './form-help-text';
|
|
5
|
-
import { formLabelAndSubLabel } from './form-label';
|
|
6
|
-
import { formMessage } from './form-message';
|
|
7
|
-
export const FormInputDecimal = ({ control, name, label, subLabel, helpText, className, disabled, required, onChange }) => {
|
|
8
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
9
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), _jsx(FormControl, { children: _jsx(MaskInputDecimal, { ...field, className: `${className}`, disabled: disabled || formState.isSubmitting, onChange: (e) => {
|
|
10
|
-
field.onChange(e);
|
|
11
|
-
if (onChange) {
|
|
12
|
-
onChange(e);
|
|
13
|
-
}
|
|
14
|
-
} }) }), formMessage(FormMessage)] })) }));
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
control: any;
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
subLabel?: string;
|
|
6
|
-
helpText?: JSX.Element;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const FormInputFile: React.FC<Props>;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/custom/form/file.tsx"],"names":[],"mappings":"AAOA,UAAU,KAAK;IACd,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAChE;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA4CzC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import * as FormComponents from '../../form';
|
|
4
|
-
import { InputFile } from '../../input';
|
|
5
|
-
import { formHelpText } from './form-help-text';
|
|
6
|
-
import { formLabelAndSubLabel } from './form-label';
|
|
7
|
-
import { formMessage } from './form-message';
|
|
8
|
-
export const FormInputFile = ({ control, name, label, subLabel, helpText, placeholder, className, disabled, required, onChange, }) => {
|
|
9
|
-
const { FormField, FormItem, FormLabel, FormControl, FormMessage } = FormComponents;
|
|
10
|
-
const [value, setValue] = useState('');
|
|
11
|
-
return (_jsx(FormField, { control: control, name: name, render: ({ field, formState }) => (_jsxs(FormItem, { className: className, children: [_jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), _jsx(FormControl, { children: _jsx(InputFile, { value: value, placeholder: placeholder, disabled: disabled || formState.isSubmitting, onChange: (e) => {
|
|
12
|
-
if (onChange) {
|
|
13
|
-
onChange(e);
|
|
14
|
-
}
|
|
15
|
-
setValue(e.target.value);
|
|
16
|
-
field.onChange(e.target.files);
|
|
17
|
-
} }) }), formMessage(FormMessage)] })) }));
|
|
18
|
-
};
|