@una-ui/nuxt 0.53.0 → 0.54.0
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/module.cjs +5 -0
- package/dist/module.d.ts +37 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/alert-dialog/AlertDialog.vue +38 -43
- package/dist/runtime/components/alert-dialog/AlertDialogAction.vue +9 -35
- package/dist/runtime/components/alert-dialog/AlertDialogCancel.vue +13 -39
- package/dist/runtime/components/alert-dialog/AlertDialogContent.vue +33 -39
- package/dist/runtime/components/alert-dialog/AlertDialogDescription.vue +13 -15
- package/dist/runtime/components/alert-dialog/AlertDialogFooter.vue +11 -12
- package/dist/runtime/components/alert-dialog/AlertDialogHeader.vue +9 -10
- package/dist/runtime/components/alert-dialog/AlertDialogOverlay.vue +11 -15
- package/dist/runtime/components/alert-dialog/AlertDialogTitle.vue +13 -15
- package/dist/runtime/components/alert-dialog/AlertDialogTrigger.vue +5 -6
- package/dist/runtime/components/aspect-ratio/AspectRatio.vue +16 -18
- package/dist/runtime/components/combobox/Combobox.vue +144 -144
- package/dist/runtime/components/combobox/ComboboxAnchor.vue +18 -20
- package/dist/runtime/components/combobox/ComboboxEmpty.vue +16 -18
- package/dist/runtime/components/combobox/ComboboxGroup.vue +19 -25
- package/dist/runtime/components/combobox/ComboboxInput.vue +24 -38
- package/dist/runtime/components/combobox/ComboboxItem.vue +22 -23
- package/dist/runtime/components/combobox/ComboboxItemIndicator.vue +23 -23
- package/dist/runtime/components/combobox/ComboboxLabel.vue +10 -16
- package/dist/runtime/components/combobox/ComboboxList.vue +25 -43
- package/dist/runtime/components/combobox/ComboboxSeparator.vue +16 -18
- package/dist/runtime/components/combobox/ComboboxTrigger.vue +52 -75
- package/dist/runtime/components/combobox/ComboboxViewport.vue +18 -20
- package/dist/runtime/components/data/table/Table.vue +186 -206
- package/dist/runtime/components/data/table/TableBody.vue +15 -15
- package/dist/runtime/components/data/table/TableCaption.vue +16 -16
- package/dist/runtime/components/data/table/TableCell.vue +19 -20
- package/dist/runtime/components/data/table/TableEmpty.vue +27 -27
- package/dist/runtime/components/data/table/TableFooter.vue +15 -15
- package/dist/runtime/components/data/table/TableHead.vue +17 -18
- package/dist/runtime/components/data/table/TableHeader.vue +15 -15
- package/dist/runtime/components/data/table/TableLoading.vue +28 -31
- package/dist/runtime/components/data/table/TableRow.vue +15 -15
- package/dist/runtime/components/elements/Accordion.vue +92 -99
- package/dist/runtime/components/elements/Alert.vue +50 -37
- package/dist/runtime/components/elements/AvatarGroup.vue +71 -64
- package/dist/runtime/components/elements/Badge.vue +20 -19
- package/dist/runtime/components/elements/Button.vue +62 -75
- package/dist/runtime/components/elements/Icon.vue +4 -4
- package/dist/runtime/components/elements/Indicator.vue +29 -25
- package/dist/runtime/components/elements/Kbd.vue +12 -13
- package/dist/runtime/components/elements/Label.vue +15 -17
- package/dist/runtime/components/elements/Link.vue +2 -2
- package/dist/runtime/components/elements/Link.vue.d.ts +109 -0
- package/dist/runtime/components/elements/Progress.vue +35 -36
- package/dist/runtime/components/elements/Separator.vue +26 -31
- package/dist/runtime/components/elements/Skeleton.vue +11 -15
- package/dist/runtime/components/elements/Toggle.vue +26 -48
- package/dist/runtime/components/elements/avatar/Avatar.vue +22 -31
- package/dist/runtime/components/elements/avatar/AvatarFallback.vue +17 -26
- package/dist/runtime/components/elements/avatar/AvatarImage.vue +11 -20
- package/dist/runtime/components/elements/card/Card.vue +24 -28
- package/dist/runtime/components/elements/card/CardContent.vue +9 -10
- package/dist/runtime/components/elements/card/CardDescription.vue +9 -10
- package/dist/runtime/components/elements/card/CardFooter.vue +9 -10
- package/dist/runtime/components/elements/card/CardHeader.vue +9 -10
- package/dist/runtime/components/elements/card/CardTitle.vue +11 -12
- package/dist/runtime/components/elements/collapsible/Collapsible.vue +11 -15
- package/dist/runtime/components/elements/collapsible/CollapsibleContent.vue +9 -12
- package/dist/runtime/components/elements/collapsible/CollapsibleTrigger.vue +5 -6
- package/dist/runtime/components/elements/dialog/Dialog.vue +35 -43
- package/dist/runtime/components/elements/dialog/DialogClose.vue +11 -34
- package/dist/runtime/components/elements/dialog/DialogContent.vue +35 -40
- package/dist/runtime/components/elements/dialog/DialogDescription.vue +15 -16
- package/dist/runtime/components/elements/dialog/DialogFooter.vue +9 -10
- package/dist/runtime/components/elements/dialog/DialogHeader.vue +9 -10
- package/dist/runtime/components/elements/dialog/DialogOverlay.vue +11 -13
- package/dist/runtime/components/elements/dialog/DialogScrollContent.vue +37 -39
- package/dist/runtime/components/elements/dialog/DialogTitle.vue +17 -19
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenu.vue +38 -85
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuContent.vue +26 -43
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuGroup.vue +10 -14
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuItem.vue +33 -58
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuLabel.vue +19 -21
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuRoot.vue +9 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSeparator.vue +18 -25
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuShortcut.vue +9 -12
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSub.vue +13 -9
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubContent.vue +21 -36
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubTrigger.vue +27 -52
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuTrigger.vue +17 -44
- package/dist/runtime/components/elements/pagination/Pagination.vue +31 -51
- package/dist/runtime/components/elements/pagination/PaginationEllipsis.vue +25 -27
- package/dist/runtime/components/elements/pagination/PaginationFirst.vue +25 -45
- package/dist/runtime/components/elements/pagination/PaginationLast.vue +25 -45
- package/dist/runtime/components/elements/pagination/PaginationListItem.vue +27 -50
- package/dist/runtime/components/elements/pagination/PaginationNext.vue +25 -45
- package/dist/runtime/components/elements/pagination/PaginationPrev.vue +25 -45
- package/dist/runtime/components/elements/popover/Popover.vue +16 -15
- package/dist/runtime/components/elements/popover/PopoverContent.vue +31 -39
- package/dist/runtime/components/elements/tabs/Tabs.vue +21 -32
- package/dist/runtime/components/elements/tabs/TabsContent.vue +18 -22
- package/dist/runtime/components/elements/tabs/TabsList.vue +14 -19
- package/dist/runtime/components/elements/tabs/TabsRoot.vue +13 -22
- package/dist/runtime/components/elements/tabs/TabsTrigger.vue +19 -47
- package/dist/runtime/components/elements/tooltip/Tooltip.vue +24 -36
- package/dist/runtime/components/elements/tooltip/TooltipContent.vue +27 -37
- package/dist/runtime/components/elements/tooltip/TooltipProvider.vue +7 -10
- package/dist/runtime/components/elements/tooltip/TooltipRoot.vue +9 -13
- package/dist/runtime/components/elements/tooltip/TooltipTrigger.vue +5 -34
- package/dist/runtime/components/forms/Checkbox.vue +42 -49
- package/dist/runtime/components/forms/FormGroup.vue +33 -40
- package/dist/runtime/components/forms/Input.vue +134 -118
- package/dist/runtime/components/forms/Slider.vue +33 -48
- package/dist/runtime/components/forms/Switch.vue +42 -43
- package/dist/runtime/components/forms/form/FormControl.vue +5 -4
- package/dist/runtime/components/forms/form/FormDescription.vue +12 -12
- package/dist/runtime/components/forms/form/FormField.vue +56 -65
- package/dist/runtime/components/forms/form/FormItem.vue +14 -14
- package/dist/runtime/components/forms/form/FormLabel.vue +13 -17
- package/dist/runtime/components/forms/form/FormMessage.vue +14 -14
- package/dist/runtime/components/forms/radio-group/RadioGroup.vue +62 -66
- package/dist/runtime/components/forms/radio-group/RadioGroupItem.vue +54 -60
- package/dist/runtime/components/forms/select/Select.vue +63 -81
- package/dist/runtime/components/forms/select/SelectContent.vue +38 -55
- package/dist/runtime/components/forms/select/SelectGroup.vue +16 -18
- package/dist/runtime/components/forms/select/SelectItem.vue +25 -31
- package/dist/runtime/components/forms/select/SelectItemIndicator.vue +15 -17
- package/dist/runtime/components/forms/select/SelectItemText.vue +5 -9
- package/dist/runtime/components/forms/select/SelectLabel.vue +10 -15
- package/dist/runtime/components/forms/select/SelectScrollDownButton.vue +19 -20
- package/dist/runtime/components/forms/select/SelectScrollUpButton.vue +19 -20
- package/dist/runtime/components/forms/select/SelectSeparator.vue +16 -18
- package/dist/runtime/components/forms/select/SelectTrigger.vue +53 -78
- package/dist/runtime/components/forms/select/SelectValue.vue +10 -15
- package/dist/runtime/components/misc/ThemeSwitcher.vue +69 -51
- package/dist/runtime/components/navigation/breadcrumb/Breadcrumb.vue +22 -35
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbEllipsis.vue +14 -13
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbItem.vue +9 -10
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbLink.vue +26 -46
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbList.vue +9 -10
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbPage.vue +7 -5
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbRoot.vue +8 -9
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbSeparator.vue +13 -13
- package/dist/runtime/components/navigation-menu/NavigationMenu.vue +32 -52
- package/dist/runtime/components/navigation-menu/NavigationMenuContent.vue +19 -22
- package/dist/runtime/components/navigation-menu/NavigationMenuContentItem.vue +24 -53
- package/dist/runtime/components/navigation-menu/NavigationMenuIndicator.vue +15 -18
- package/dist/runtime/components/navigation-menu/NavigationMenuItem.vue +5 -40
- package/dist/runtime/components/navigation-menu/NavigationMenuLink.vue +28 -51
- package/dist/runtime/components/navigation-menu/NavigationMenuList.vue +22 -24
- package/dist/runtime/components/navigation-menu/NavigationMenuTrigger.vue +34 -54
- package/dist/runtime/components/navigation-menu/NavigationMenuViewport.vue +26 -29
- package/dist/runtime/components/overlays/Toaster.vue +16 -19
- package/dist/runtime/components/overlays/toast/Toast.vue +38 -58
- package/dist/runtime/components/overlays/toast/ToastAction.vue +19 -42
- package/dist/runtime/components/overlays/toast/ToastClose.vue +20 -21
- package/dist/runtime/components/overlays/toast/ToastDescription.vue +16 -17
- package/dist/runtime/components/overlays/toast/ToastInfo.vue +9 -10
- package/dist/runtime/components/overlays/toast/ToastProvider.vue +7 -8
- package/dist/runtime/components/overlays/toast/ToastTitle.vue +16 -17
- package/dist/runtime/components/overlays/toast/ToastViewport.vue +16 -19
- package/dist/runtime/components/resizable/ResizableHandle.vue +36 -36
- package/dist/runtime/components/resizable/ResizablePanel.vue +17 -24
- package/dist/runtime/components/resizable/ResizablePanelGroup.vue +17 -22
- package/dist/runtime/components/scroll-area/ScrollArea.vue +23 -31
- package/dist/runtime/components/scroll-area/ScrollBar.vue +25 -29
- package/dist/runtime/components/sheet/Sheet.vue +29 -40
- package/dist/runtime/components/sheet/SheetClose.vue +12 -34
- package/dist/runtime/components/sheet/SheetContent.vue +29 -35
- package/dist/runtime/components/sheet/SheetDescription.vue +13 -13
- package/dist/runtime/components/sheet/SheetFooter.vue +11 -12
- package/dist/runtime/components/sheet/SheetHeader.vue +7 -8
- package/dist/runtime/components/sheet/SheetTitle.vue +12 -13
- package/dist/runtime/components/sheet/SheetTrigger.vue +7 -6
- package/dist/runtime/components/sidebar/Sidebar.vue +52 -48
- package/dist/runtime/components/sidebar/SidebarContent.vue +10 -11
- package/dist/runtime/components/sidebar/SidebarFooter.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarGroup.vue +10 -12
- package/dist/runtime/components/sidebar/SidebarGroupAction.vue +13 -13
- package/dist/runtime/components/sidebar/SidebarGroupContent.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarGroupLabel.vue +13 -13
- package/dist/runtime/components/sidebar/SidebarHeader.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarInput.vue +10 -26
- package/dist/runtime/components/sidebar/SidebarInset.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarMenu.vue +14 -16
- package/dist/runtime/components/sidebar/SidebarMenuAction.vue +13 -15
- package/dist/runtime/components/sidebar/SidebarMenuBadge.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarMenuButton.vue +28 -27
- package/dist/runtime/components/sidebar/SidebarMenuButtonChild.vue +41 -29
- package/dist/runtime/components/sidebar/SidebarMenuItem.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarMenuSkeleton.vue +14 -15
- package/dist/runtime/components/sidebar/SidebarMenuSub.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarMenuSubButton.vue +17 -19
- package/dist/runtime/components/sidebar/SidebarMenuSubItem.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarProvider.vue +55 -38
- package/dist/runtime/components/sidebar/SidebarRail.vue +12 -12
- package/dist/runtime/components/sidebar/SidebarSeparator.vue +10 -11
- package/dist/runtime/components/sidebar/SidebarTrigger.vue +18 -38
- package/dist/types.d.mts +5 -3
- package/dist/types.d.ts +7 -0
- package/dist/una.config.d.ts +8 -0
- package/dist/una.config.mjs +1 -1
- package/package.json +10 -8
- package/dist/runtime/components/alert-dialog/AlertDialog.vue.d.ts +0 -45
- package/dist/runtime/components/alert-dialog/AlertDialogAction.vue.d.ts +0 -16
- package/dist/runtime/components/alert-dialog/AlertDialogCancel.vue.d.ts +0 -16
- package/dist/runtime/components/alert-dialog/AlertDialogContent.vue.d.ts +0 -45
- package/dist/runtime/components/alert-dialog/AlertDialogDescription.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogFooter.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogHeader.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogOverlay.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogTitle.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/aspect-ratio/AspectRatio.vue.d.ts +0 -18
- package/dist/runtime/components/combobox/Combobox.vue.d.ts +0 -89
- package/dist/runtime/components/combobox/ComboboxAnchor.vue.d.ts +0 -13
- package/dist/runtime/components/combobox/ComboboxEmpty.vue.d.ts +0 -13
- package/dist/runtime/components/combobox/ComboboxGroup.vue.d.ts +0 -17
- package/dist/runtime/components/combobox/ComboboxInput.vue.d.ts +0 -16
- package/dist/runtime/components/combobox/ComboboxItem.vue.d.ts +0 -18
- package/dist/runtime/components/combobox/ComboboxItemIndicator.vue.d.ts +0 -15
- package/dist/runtime/components/combobox/ComboboxLabel.vue.d.ts +0 -13
- package/dist/runtime/components/combobox/ComboboxList.vue.d.ts +0 -43
- package/dist/runtime/components/combobox/ComboboxSeparator.vue.d.ts +0 -13
- package/dist/runtime/components/combobox/ComboboxTrigger.vue.d.ts +0 -17
- package/dist/runtime/components/combobox/ComboboxViewport.vue.d.ts +0 -13
- package/dist/runtime/components/data/table/Table.vue.d.ts +0 -184
- package/dist/runtime/components/data/table/TableBody.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableCaption.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableCell.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableEmpty.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableFooter.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableHead.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableHeader.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableLoading.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableRow.vue.d.ts +0 -15
- package/dist/runtime/components/elements/Accordion.vue.d.ts +0 -28
- package/dist/runtime/components/elements/Alert.vue.d.ts +0 -22
- package/dist/runtime/components/elements/AvatarGroup.vue.d.ts +0 -11
- package/dist/runtime/components/elements/Badge.vue.d.ts +0 -26
- package/dist/runtime/components/elements/Button.vue.d.ts +0 -34
- package/dist/runtime/components/elements/Icon.vue.d.ts +0 -3
- package/dist/runtime/components/elements/Indicator.vue.d.ts +0 -19
- package/dist/runtime/components/elements/Kbd.vue.d.ts +0 -13
- package/dist/runtime/components/elements/Label.vue.d.ts +0 -13
- package/dist/runtime/components/elements/Progress.vue.d.ts +0 -18
- package/dist/runtime/components/elements/Separator.vue.d.ts +0 -15
- package/dist/runtime/components/elements/Skeleton.vue.d.ts +0 -13
- package/dist/runtime/components/elements/Toggle.vue.d.ts +0 -22
- package/dist/runtime/components/elements/avatar/Avatar.vue.d.ts +0 -21
- package/dist/runtime/components/elements/avatar/AvatarFallback.vue.d.ts +0 -13
- package/dist/runtime/components/elements/avatar/AvatarImage.vue.d.ts +0 -3
- package/dist/runtime/components/elements/card/Card.vue.d.ts +0 -25
- package/dist/runtime/components/elements/card/CardContent.vue.d.ts +0 -13
- package/dist/runtime/components/elements/card/CardDescription.vue.d.ts +0 -13
- package/dist/runtime/components/elements/card/CardFooter.vue.d.ts +0 -13
- package/dist/runtime/components/elements/card/CardHeader.vue.d.ts +0 -13
- package/dist/runtime/components/elements/card/CardTitle.vue.d.ts +0 -13
- package/dist/runtime/components/elements/collapsible/Collapsible.vue.d.ts +0 -25
- package/dist/runtime/components/elements/collapsible/CollapsibleContent.vue.d.ts +0 -13
- package/dist/runtime/components/elements/collapsible/CollapsibleTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/Dialog.vue.d.ts +0 -34
- package/dist/runtime/components/elements/dialog/DialogClose.vue.d.ts +0 -18
- package/dist/runtime/components/elements/dialog/DialogContent.vue.d.ts +0 -46
- package/dist/runtime/components/elements/dialog/DialogDescription.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/DialogFooter.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/DialogHeader.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/DialogOverlay.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/DialogScrollContent.vue.d.ts +0 -46
- package/dist/runtime/components/elements/dialog/DialogTitle.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenu.vue.d.ts +0 -61
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -43
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -14
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuRoot.vue.d.ts +0 -17
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -3
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -17
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -45
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -16
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/elements/pagination/Pagination.vue.d.ts +0 -41
- package/dist/runtime/components/elements/pagination/PaginationEllipsis.vue.d.ts +0 -15
- package/dist/runtime/components/elements/pagination/PaginationFirst.vue.d.ts +0 -18
- package/dist/runtime/components/elements/pagination/PaginationLast.vue.d.ts +0 -18
- package/dist/runtime/components/elements/pagination/PaginationListItem.vue.d.ts +0 -17
- package/dist/runtime/components/elements/pagination/PaginationNext.vue.d.ts +0 -18
- package/dist/runtime/components/elements/pagination/PaginationPrev.vue.d.ts +0 -18
- package/dist/runtime/components/elements/popover/Popover.vue.d.ts +0 -21
- package/dist/runtime/components/elements/popover/PopoverContent.vue.d.ts +0 -46
- package/dist/runtime/components/elements/tabs/Tabs.vue.d.ts +0 -28
- package/dist/runtime/components/elements/tabs/TabsContent.vue.d.ts +0 -13
- package/dist/runtime/components/elements/tabs/TabsList.vue.d.ts +0 -13
- package/dist/runtime/components/elements/tabs/TabsRoot.vue.d.ts +0 -17
- package/dist/runtime/components/elements/tabs/TabsTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/elements/tooltip/Tooltip.vue.d.ts +0 -19
- package/dist/runtime/components/elements/tooltip/TooltipContent.vue.d.ts +0 -22
- package/dist/runtime/components/elements/tooltip/TooltipProvider.vue.d.ts +0 -15
- package/dist/runtime/components/elements/tooltip/TooltipRoot.vue.d.ts +0 -17
- package/dist/runtime/components/elements/tooltip/TooltipTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +0 -21
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +0 -27
- package/dist/runtime/components/forms/Input.vue.d.ts +0 -31
- package/dist/runtime/components/forms/Slider.vue.d.ts +0 -25
- package/dist/runtime/components/forms/Switch.vue.d.ts +0 -27
- package/dist/runtime/components/forms/form/FormControl.vue.d.ts +0 -12
- package/dist/runtime/components/forms/form/FormDescription.vue.d.ts +0 -13
- package/dist/runtime/components/forms/form/FormField.vue.d.ts +0 -25
- package/dist/runtime/components/forms/form/FormItem.vue.d.ts +0 -13
- package/dist/runtime/components/forms/form/FormLabel.vue.d.ts +0 -13
- package/dist/runtime/components/forms/form/FormMessage.vue.d.ts +0 -3
- package/dist/runtime/components/forms/radio-group/RadioGroup.vue.d.ts +0 -29
- package/dist/runtime/components/forms/radio-group/RadioGroupItem.vue.d.ts +0 -22
- package/dist/runtime/components/forms/select/Select.vue.d.ts +0 -72
- package/dist/runtime/components/forms/select/SelectContent.vue.d.ts +0 -27
- package/dist/runtime/components/forms/select/SelectGroup.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectItem.vue.d.ts +0 -17
- package/dist/runtime/components/forms/select/SelectItemIndicator.vue.d.ts +0 -15
- package/dist/runtime/components/forms/select/SelectItemText.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectLabel.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectScrollDownButton.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectScrollUpButton.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectSeparator.vue.d.ts +0 -3
- package/dist/runtime/components/forms/select/SelectTrigger.vue.d.ts +0 -15
- package/dist/runtime/components/forms/select/SelectValue.vue.d.ts +0 -13
- package/dist/runtime/components/misc/ThemeSwitcher.vue.d.ts +0 -16
- package/dist/runtime/components/navigation/breadcrumb/Breadcrumb.vue.d.ts +0 -45
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbEllipsis.vue.d.ts +0 -16
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbItem.vue.d.ts +0 -13
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbLink.vue.d.ts +0 -18
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbList.vue.d.ts +0 -13
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbPage.vue.d.ts +0 -16
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbRoot.vue.d.ts +0 -13
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbSeparator.vue.d.ts +0 -16
- package/dist/runtime/components/navigation-menu/NavigationMenu.vue.d.ts +0 -46
- package/dist/runtime/components/navigation-menu/NavigationMenuContent.vue.d.ts +0 -39
- package/dist/runtime/components/navigation-menu/NavigationMenuContentItem.vue.d.ts +0 -21
- package/dist/runtime/components/navigation-menu/NavigationMenuIndicator.vue.d.ts +0 -13
- package/dist/runtime/components/navigation-menu/NavigationMenuItem.vue.d.ts +0 -13
- package/dist/runtime/components/navigation-menu/NavigationMenuLink.vue.d.ts +0 -27
- package/dist/runtime/components/navigation-menu/NavigationMenuList.vue.d.ts +0 -13
- package/dist/runtime/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +0 -18
- package/dist/runtime/components/navigation-menu/NavigationMenuViewport.vue.d.ts +0 -3
- package/dist/runtime/components/overlays/Toaster.vue.d.ts +0 -13
- package/dist/runtime/components/overlays/toast/Toast.vue.d.ts +0 -112
- package/dist/runtime/components/overlays/toast/ToastAction.vue.d.ts +0 -16
- package/dist/runtime/components/overlays/toast/ToastClose.vue.d.ts +0 -3
- package/dist/runtime/components/overlays/toast/ToastDescription.vue.d.ts +0 -13
- package/dist/runtime/components/overlays/toast/ToastInfo.vue.d.ts +0 -13
- package/dist/runtime/components/overlays/toast/ToastProvider.vue.d.ts +0 -15
- package/dist/runtime/components/overlays/toast/ToastTitle.vue.d.ts +0 -13
- package/dist/runtime/components/overlays/toast/ToastViewport.vue.d.ts +0 -3
- package/dist/runtime/components/resizable/ResizableHandle.vue.d.ts +0 -21
- package/dist/runtime/components/resizable/ResizablePanel.vue.d.ts +0 -24
- package/dist/runtime/components/resizable/ResizablePanelGroup.vue.d.ts +0 -19
- package/dist/runtime/components/scroll-area/ScrollArea.vue.d.ts +0 -17
- package/dist/runtime/components/scroll-area/ScrollBar.vue.d.ts +0 -6
- package/dist/runtime/components/sheet/Sheet.vue.d.ts +0 -36
- package/dist/runtime/components/sheet/SheetClose.vue.d.ts +0 -42
- package/dist/runtime/components/sheet/SheetContent.vue.d.ts +0 -68
- package/dist/runtime/components/sheet/SheetDescription.vue.d.ts +0 -12
- package/dist/runtime/components/sheet/SheetFooter.vue.d.ts +0 -12
- package/dist/runtime/components/sheet/SheetHeader.vue.d.ts +0 -12
- package/dist/runtime/components/sheet/SheetTitle.vue.d.ts +0 -12
- package/dist/runtime/components/sheet/SheetTrigger.vue.d.ts +0 -15
- package/dist/runtime/components/sidebar/Sidebar.vue.d.ts +0 -24
- package/dist/runtime/components/sidebar/SidebarContent.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarFooter.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarGroup.vue.d.ts +0 -16
- package/dist/runtime/components/sidebar/SidebarGroupAction.vue.d.ts +0 -36
- package/dist/runtime/components/sidebar/SidebarGroupContent.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarGroupLabel.vue.d.ts +0 -36
- package/dist/runtime/components/sidebar/SidebarHeader.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarInput.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarInset.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenu.vue.d.ts +0 -22
- package/dist/runtime/components/sidebar/SidebarMenuAction.vue.d.ts +0 -34
- package/dist/runtime/components/sidebar/SidebarMenuBadge.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenuButton.vue.d.ts +0 -19
- package/dist/runtime/components/sidebar/SidebarMenuButtonChild.vue.d.ts +0 -31
- package/dist/runtime/components/sidebar/SidebarMenuItem.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenuSkeleton.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenuSub.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenuSubButton.vue.d.ts +0 -16
- package/dist/runtime/components/sidebar/SidebarMenuSubItem.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarProvider.vue.d.ts +0 -20
- package/dist/runtime/components/sidebar/SidebarRail.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarSeparator.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarTrigger.vue.d.ts +0 -30
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts" generic="TData, TValue">
|
|
2
|
+
import type {
|
|
3
|
+
ColumnFiltersState,
|
|
4
|
+
ColumnOrderState,
|
|
5
|
+
ColumnPinningState,
|
|
6
|
+
ExpandedState,
|
|
7
|
+
GroupingState,
|
|
8
|
+
Header,
|
|
9
|
+
PaginationState,
|
|
10
|
+
Row,
|
|
11
|
+
RowSelectionState,
|
|
12
|
+
SortingState,
|
|
13
|
+
Table,
|
|
14
|
+
VisibilityState,
|
|
15
|
+
} from '@tanstack/vue-table'
|
|
16
|
+
import type { NTableProps } from '../../../types'
|
|
17
|
+
|
|
2
18
|
import {
|
|
3
19
|
FlexRender,
|
|
4
20
|
getCoreRowModel,
|
|
@@ -6,190 +22,146 @@ import {
|
|
|
6
22
|
getFilteredRowModel,
|
|
7
23
|
getPaginationRowModel,
|
|
8
24
|
getSortedRowModel,
|
|
9
|
-
useVueTable
|
|
10
|
-
} from
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_tableHead: { type: Object, required: false },
|
|
53
|
-
_tableHeader: { type: Object, required: false },
|
|
54
|
-
_tableFooter: { type: Object, required: false },
|
|
55
|
-
_tableBody: { type: Object, required: false },
|
|
56
|
-
_tableCaption: { type: Object, required: false },
|
|
57
|
-
_tableRow: { type: [Object, Function], required: false },
|
|
58
|
-
_tableCell: { type: Object, required: false },
|
|
59
|
-
_tableEmpty: { type: Object, required: false },
|
|
60
|
-
_tableLoading: { type: Object, required: false },
|
|
61
|
-
_scrollArea: { type: Object, required: false },
|
|
62
|
-
loading: { type: Boolean, required: false },
|
|
63
|
-
una: { type: Object, required: false },
|
|
64
|
-
_features: { type: Array, required: false },
|
|
65
|
-
debugAll: { type: Boolean, required: false },
|
|
66
|
-
debugCells: { type: Boolean, required: false },
|
|
67
|
-
debugColumns: { type: Boolean, required: false },
|
|
68
|
-
debugHeaders: { type: Boolean, required: false },
|
|
69
|
-
debugRows: { type: Boolean, required: false },
|
|
70
|
-
debugTable: { type: Boolean, required: false },
|
|
71
|
-
defaultColumn: { type: Object, required: false },
|
|
72
|
-
getRowId: { type: Function, required: false },
|
|
73
|
-
getSubRows: { type: Function, required: false },
|
|
74
|
-
initialState: { type: Object, required: false },
|
|
75
|
-
mergeOptions: { type: Function, required: false },
|
|
76
|
-
meta: { type: Object, required: false }
|
|
77
|
-
});
|
|
78
|
-
const emit = defineEmits(["select", "selectAll", "expand", "row"]);
|
|
79
|
-
const slots = defineSlots();
|
|
80
|
-
const rowSelection = defineModel("rowSelection", { type: Object });
|
|
81
|
-
const sorting = defineModel("sorting", { type: Array });
|
|
82
|
-
const columnVisibility = defineModel("columnVisibility", { type: Object });
|
|
83
|
-
const columnFilters = defineModel("columnFilters", { type: Array });
|
|
84
|
-
const globalFilter = defineModel("globalFilter", { type: String });
|
|
85
|
-
const columnOrder = defineModel("columnOrder", { type: Array });
|
|
86
|
-
const columnPinning = defineModel("columnPinning", { type: Object });
|
|
87
|
-
const expanded = defineModel("expanded", { type: [Boolean, Object] });
|
|
88
|
-
const grouping = defineModel("grouping", { type: Array });
|
|
89
|
-
const pagination = defineModel("pagination", { type: Object, ...{
|
|
25
|
+
useVueTable,
|
|
26
|
+
} from '@tanstack/vue-table'
|
|
27
|
+
|
|
28
|
+
import { computed, h } from 'vue'
|
|
29
|
+
|
|
30
|
+
import { cn, valueUpdater } from '../../../utils'
|
|
31
|
+
import Button from '../../elements/Button.vue'
|
|
32
|
+
import Checkbox from '../../forms/Checkbox.vue'
|
|
33
|
+
import Input from '../../forms/Input.vue'
|
|
34
|
+
import ScrollArea from '../../scroll-area/ScrollArea.vue'
|
|
35
|
+
import TableBody from './TableBody.vue'
|
|
36
|
+
import TableCell from './TableCell.vue'
|
|
37
|
+
import TableEmpty from './TableEmpty.vue'
|
|
38
|
+
import TableFooter from './TableFooter.vue'
|
|
39
|
+
import TableHead from './TableHead.vue'
|
|
40
|
+
import TableHeader from './TableHeader.vue'
|
|
41
|
+
import TableLoading from './TableLoading.vue'
|
|
42
|
+
import TableRow from './TableRow.vue'
|
|
43
|
+
|
|
44
|
+
const props = withDefaults(defineProps <NTableProps<TData, TValue>>(), {
|
|
45
|
+
enableMultiRowSelection: true,
|
|
46
|
+
enableSortingRemoval: true,
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const emit = defineEmits<{
|
|
50
|
+
select: [row: TData]
|
|
51
|
+
selectAll: [rows: TData[]]
|
|
52
|
+
expand: [row: TData]
|
|
53
|
+
row: [event: Event, row: TData]
|
|
54
|
+
}>()
|
|
55
|
+
|
|
56
|
+
const slots = defineSlots()
|
|
57
|
+
|
|
58
|
+
const rowSelection = defineModel<RowSelectionState>('rowSelection')
|
|
59
|
+
const sorting = defineModel<SortingState>('sorting')
|
|
60
|
+
const columnVisibility = defineModel<VisibilityState>('columnVisibility')
|
|
61
|
+
const columnFilters = defineModel<ColumnFiltersState>('columnFilters')
|
|
62
|
+
const globalFilter = defineModel<string>('globalFilter')
|
|
63
|
+
const columnOrder = defineModel<ColumnOrderState>('columnOrder')
|
|
64
|
+
const columnPinning = defineModel<ColumnPinningState>('columnPinning')
|
|
65
|
+
const expanded = defineModel<ExpandedState>('expanded')
|
|
66
|
+
const grouping = defineModel<GroupingState>('grouping')
|
|
67
|
+
const pagination = defineModel<PaginationState>('pagination', {
|
|
90
68
|
default: () => ({
|
|
91
69
|
pageIndex: 0,
|
|
92
|
-
pageSize: 10
|
|
93
|
-
})
|
|
94
|
-
}
|
|
70
|
+
pageSize: 10,
|
|
71
|
+
}),
|
|
72
|
+
})
|
|
73
|
+
|
|
95
74
|
const columnsWithMisc = computed(() => {
|
|
96
|
-
let data = []
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
75
|
+
let data = []
|
|
76
|
+
|
|
77
|
+
// add selection column
|
|
78
|
+
data = props.enableRowSelection
|
|
79
|
+
? [
|
|
80
|
+
{
|
|
81
|
+
accessorKey: 'selection',
|
|
82
|
+
header: props.enableMultiRowSelection
|
|
83
|
+
? ({ table }: { table: Table<TData> }) => h(Checkbox, {
|
|
84
|
+
'modelValue': table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate'),
|
|
85
|
+
'onUpdate:modelValue': (value: boolean | 'indeterminate' | null) => {
|
|
86
|
+
table.toggleAllPageRowsSelected(!!value)
|
|
87
|
+
emit('selectAll', table.getRowModel().rows.map(row => row.original))
|
|
88
|
+
},
|
|
89
|
+
'areaLabel': 'Select all rows',
|
|
90
|
+
'onClick': (event: Event) => {
|
|
91
|
+
event.stopPropagation()
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
: '',
|
|
95
|
+
cell: ({ row }: { row: Row<TData> }) => h(Checkbox, {
|
|
96
|
+
'modelValue': row.getIsSelected() ?? false,
|
|
97
|
+
'onUpdate:modelValue': (value: boolean | 'indeterminate' | null) => {
|
|
98
|
+
row.toggleSelected(!!value)
|
|
99
|
+
emit('select', row.original)
|
|
100
|
+
},
|
|
101
|
+
'areaLabel': 'Select row',
|
|
102
|
+
'onClick': (event: Event) => {
|
|
103
|
+
event.stopPropagation()
|
|
104
|
+
},
|
|
105
|
+
}),
|
|
106
|
+
enableSorting: false,
|
|
116
107
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
108
|
+
...props.columns,
|
|
109
|
+
]
|
|
110
|
+
: props.columns
|
|
111
|
+
|
|
112
|
+
// add expanded column
|
|
113
|
+
data = slots.expanded
|
|
114
|
+
? [
|
|
115
|
+
{
|
|
116
|
+
accessorKey: 'expanded',
|
|
117
|
+
header: '',
|
|
118
|
+
cell: ({ row }: any) => h(Button, {
|
|
119
|
+
size: 'xs',
|
|
120
|
+
icon: true,
|
|
121
|
+
square: true,
|
|
122
|
+
btn: 'ghost-gray',
|
|
123
|
+
label: 'i-radix-icons-chevron-down',
|
|
124
|
+
onClick: () => {
|
|
125
|
+
row.toggleExpanded()
|
|
126
|
+
emit('expand', row)
|
|
127
|
+
},
|
|
128
|
+
una: {
|
|
129
|
+
btnIconLabel: cn(
|
|
130
|
+
'transform transition-transform duration-200',
|
|
131
|
+
row.getIsExpanded() ? '-rotate-180' : 'rotate-0',
|
|
132
|
+
),
|
|
133
|
+
},
|
|
134
|
+
}),
|
|
135
|
+
enableSorting: false,
|
|
136
|
+
enableHiding: false,
|
|
139
137
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
enableSorting: false,
|
|
148
|
-
enableHiding: false
|
|
149
|
-
},
|
|
150
|
-
...data
|
|
151
|
-
] : data;
|
|
152
|
-
return data;
|
|
153
|
-
});
|
|
138
|
+
...data,
|
|
139
|
+
]
|
|
140
|
+
: data
|
|
141
|
+
|
|
142
|
+
return data
|
|
143
|
+
})
|
|
144
|
+
|
|
154
145
|
const table = useVueTable({
|
|
155
146
|
get data() {
|
|
156
|
-
return props.data ?? []
|
|
147
|
+
return props.data ?? []
|
|
157
148
|
},
|
|
158
149
|
get columns() {
|
|
159
|
-
return columnsWithMisc.value ?? []
|
|
150
|
+
return columnsWithMisc.value ?? []
|
|
160
151
|
},
|
|
161
152
|
state: {
|
|
162
|
-
get sorting() {
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
get
|
|
166
|
-
|
|
167
|
-
},
|
|
168
|
-
get
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
get
|
|
172
|
-
return rowSelection.value;
|
|
173
|
-
},
|
|
174
|
-
get columnVisibility() {
|
|
175
|
-
return columnVisibility.value;
|
|
176
|
-
},
|
|
177
|
-
get pagination() {
|
|
178
|
-
return pagination.value;
|
|
179
|
-
},
|
|
180
|
-
get columnOrder() {
|
|
181
|
-
return columnOrder.value;
|
|
182
|
-
},
|
|
183
|
-
get columnPinning() {
|
|
184
|
-
return columnPinning.value;
|
|
185
|
-
},
|
|
186
|
-
get expanded() {
|
|
187
|
-
return expanded.value;
|
|
188
|
-
},
|
|
189
|
-
get grouping() {
|
|
190
|
-
return grouping.value;
|
|
191
|
-
}
|
|
153
|
+
get sorting() { return sorting.value },
|
|
154
|
+
get columnFilters() { return columnFilters.value },
|
|
155
|
+
get globalFilter() { return globalFilter.value },
|
|
156
|
+
get rowSelection() { return rowSelection.value },
|
|
157
|
+
get columnVisibility() { return columnVisibility.value },
|
|
158
|
+
get pagination() { return pagination.value },
|
|
159
|
+
get columnOrder() { return columnOrder.value },
|
|
160
|
+
get columnPinning() { return columnPinning.value },
|
|
161
|
+
get expanded() { return expanded.value },
|
|
162
|
+
get grouping() { return grouping.value },
|
|
192
163
|
},
|
|
164
|
+
|
|
193
165
|
enableMultiRowSelection: props.enableMultiRowSelection,
|
|
194
166
|
enableSubRowSelection: props.enableSubRowSelection,
|
|
195
167
|
autoResetAll: props.autoResetAll,
|
|
@@ -208,40 +180,46 @@ const table = useVueTable({
|
|
|
208
180
|
maxMultiSortColCount: props.maxMultiSortColCount,
|
|
209
181
|
sortingFns: props.sortingFns,
|
|
210
182
|
isMultiSortEvent: props.isMultiSortEvent,
|
|
183
|
+
|
|
211
184
|
getCoreRowModel: getCoreRowModel(),
|
|
212
185
|
getSortedRowModel: getSortedRowModel(),
|
|
213
186
|
getFilteredRowModel: getFilteredRowModel(),
|
|
214
187
|
getPaginationRowModel: getPaginationRowModel(),
|
|
215
|
-
getRowId: (row) => props.rowId ? row[props.rowId] : row.id,
|
|
188
|
+
getRowId: (row: any) => props.rowId ? row[props.rowId] : row.id,
|
|
216
189
|
getExpandedRowModel: getExpandedRowModel(),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
190
|
+
|
|
191
|
+
onSortingChange: updaterOrValue => valueUpdater(updaterOrValue, sorting),
|
|
192
|
+
onRowSelectionChange: updaterOrValue => valueUpdater(updaterOrValue, rowSelection),
|
|
193
|
+
onColumnVisibilityChange: updaterOrValue => valueUpdater(updaterOrValue, columnVisibility),
|
|
194
|
+
onColumnFiltersChange: updaterOrValue => valueUpdater(updaterOrValue, columnFilters),
|
|
195
|
+
onGlobalFilterChange: updaterOrValue => valueUpdater(updaterOrValue, globalFilter),
|
|
196
|
+
onPaginationChange: updaterOrValue => valueUpdater(updaterOrValue, pagination),
|
|
197
|
+
onColumnOrderChange: updaterOrValue => valueUpdater(updaterOrValue, columnOrder),
|
|
198
|
+
onColumnPinningChange: updaterOrValue => valueUpdater(updaterOrValue, columnPinning),
|
|
199
|
+
onExpandedChange: updaterOrValue => valueUpdater(updaterOrValue, expanded),
|
|
200
|
+
onGroupingChange: updaterOrValue => valueUpdater(updaterOrValue, grouping),
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
function getHeaderColumnFiltersCount(headers: Header<unknown, unknown>[]): number {
|
|
204
|
+
let count = 0
|
|
230
205
|
headers.forEach((header) => {
|
|
231
206
|
if (header.column.columnDef.enableColumnFilter)
|
|
232
|
-
count
|
|
233
|
-
})
|
|
234
|
-
|
|
207
|
+
count++
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
return count
|
|
235
211
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
212
|
+
|
|
213
|
+
function getRowAttrs(data?: TData) {
|
|
214
|
+
if (typeof props._tableRow === 'function') {
|
|
215
|
+
return props._tableRow(data)
|
|
239
216
|
}
|
|
240
|
-
return props._tableRow
|
|
217
|
+
return props._tableRow
|
|
241
218
|
}
|
|
219
|
+
|
|
242
220
|
defineExpose({
|
|
243
|
-
...table
|
|
244
|
-
})
|
|
221
|
+
...table,
|
|
222
|
+
})
|
|
245
223
|
</script>
|
|
246
224
|
|
|
247
225
|
<template>
|
|
@@ -256,10 +234,10 @@ defineExpose({
|
|
|
256
234
|
<table
|
|
257
235
|
v-bind="$attrs"
|
|
258
236
|
:class="cn(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
)"
|
|
237
|
+
'table',
|
|
238
|
+
props.una?.table,
|
|
239
|
+
props.class,
|
|
240
|
+
)"
|
|
263
241
|
>
|
|
264
242
|
<!-- header -->
|
|
265
243
|
<TableHeader
|
|
@@ -283,14 +261,16 @@ defineExpose({
|
|
|
283
261
|
v-bind="{ ...props._tableHead, ...header.column.columnDef.meta }"
|
|
284
262
|
>
|
|
285
263
|
<Button
|
|
286
|
-
v-if="header.column.columnDef.enableSorting || header.column.columnDef.enableSorting !== false && enableSorting"
|
|
264
|
+
v-if="header.column.columnDef.enableSorting || (header.column.columnDef.enableSorting !== false && enableSorting)"
|
|
287
265
|
btn="ghost-gray"
|
|
288
266
|
size="sm"
|
|
289
267
|
class="font-normal -ml-1em"
|
|
290
268
|
:una="{
|
|
291
|
-
|
|
292
|
-
}"
|
|
293
|
-
:trailing="header.column.getIsSorted() === 'asc'
|
|
269
|
+
btnTrailing: 'text-sm',
|
|
270
|
+
}"
|
|
271
|
+
:trailing="header.column.getIsSorted() === 'asc'
|
|
272
|
+
? 'i-lucide-arrow-up-wide-narrow' : header.column.getIsSorted() === 'desc'
|
|
273
|
+
? 'i-lucide-arrow-down-narrow-wide' : 'i-lucide-arrow-up-down'"
|
|
294
274
|
@click="header.column.getToggleSortingHandler()?.($event)"
|
|
295
275
|
>
|
|
296
276
|
<slot
|
|
@@ -340,13 +320,13 @@ defineExpose({
|
|
|
340
320
|
v-bind="{ ...props._tableHead, ...header.column.columnDef.meta }"
|
|
341
321
|
>
|
|
342
322
|
<slot
|
|
343
|
-
v-if="header.id !== 'selection' && (header.column.columnDef.enableColumnFilter !== false && enableColumnFilters || header.column.columnDef.enableColumnFilter)"
|
|
323
|
+
v-if="header.id !== 'selection' && ((header.column.columnDef.enableColumnFilter !== false && enableColumnFilters) || header.column.columnDef.enableColumnFilter)"
|
|
344
324
|
:name="`${header.id}-filter`"
|
|
345
325
|
:column="header.column"
|
|
346
326
|
>
|
|
347
327
|
<Input
|
|
348
328
|
class="w-auto"
|
|
349
|
-
:model-value="header.column.getFilterValue()"
|
|
329
|
+
:model-value="header.column.getFilterValue() as string"
|
|
350
330
|
:placeholder="header.column.columnDef.header"
|
|
351
331
|
@update:model-value="header.column.setFilterValue($event)"
|
|
352
332
|
/>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const rootProps = reactiveOmit(props, [
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NTableBodyProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
5
|
+
import { cn } from '../../../utils'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<NTableBodyProps>(), {
|
|
8
|
+
as: 'tbody',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
15
|
<Primitive
|
|
16
16
|
:class="cn(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)"
|
|
17
|
+
'table-body',
|
|
18
|
+
props?.una?.tableBody,
|
|
19
|
+
props.class,
|
|
20
|
+
)"
|
|
21
21
|
v-bind="{ ...rootProps, ...$attrs }"
|
|
22
22
|
>
|
|
23
23
|
<slot />
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const rootProps = reactiveOmit(props, [
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NTableCaptionProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
5
|
+
import { cn } from '../../../utils'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<NTableCaptionProps>(), {
|
|
8
|
+
as: 'caption',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
15
|
<Primitive
|
|
16
16
|
:class="cn(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)"
|
|
21
|
-
v-bind="{ ...rootProps, ...$attrs }"
|
|
17
|
+
'table-caption',
|
|
18
|
+
props?.una?.tableCaption,
|
|
19
|
+
props.class,
|
|
20
|
+
)"
|
|
21
|
+
v-bind="{ ...rootProps, ...$attrs } "
|
|
22
22
|
>
|
|
23
23
|
<slot />
|
|
24
24
|
</Primitive>
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const rootProps = reactiveOmit(props, ["una", "class"]);
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NTableCellProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
5
|
+
import { cn } from '../../../utils'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<NTableCellProps>(), {
|
|
8
|
+
as: 'td',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
13
12
|
</script>
|
|
14
13
|
|
|
15
14
|
<template>
|
|
16
15
|
<Primitive
|
|
17
16
|
:class="
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
17
|
+
cn(
|
|
18
|
+
'table-cell',
|
|
19
|
+
props?.una?.tableCell,
|
|
20
|
+
props.class,
|
|
21
|
+
{ 'table-cell-pinned': dataPinned },
|
|
22
|
+
dataPinned === 'left' ? 'table-cell-pinned-left' : 'table-cell-pinned-right',
|
|
23
|
+
)
|
|
24
|
+
"
|
|
26
25
|
v-bind="{ ...rootProps, ...$attrs }"
|
|
27
26
|
>
|
|
28
27
|
<slot />
|