@bizapps/ui 1.5.0 → 1.5.1
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/main.cjs +19 -16
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.cts +3 -32
- package/dist/main.d.ts +3 -32
- package/dist/main.js +19 -16
- package/dist/main.js.map +1 -1
- package/dist/policy-DPpMNLiO.d.cts +75 -0
- package/dist/policy-DPpMNLiO.d.ts +75 -0
- package/dist/policy.cjs +33 -0
- package/dist/policy.cjs.map +1 -0
- package/dist/policy.d.cts +1 -0
- package/dist/policy.d.ts +1 -0
- package/dist/policy.js +29 -0
- package/dist/policy.js.map +1 -0
- package/package.json +6 -1
package/dist/main.d.cts
CHANGED
|
@@ -14,6 +14,8 @@ export { Controller, useFieldArray } from 'react-hook-form';
|
|
|
14
14
|
import { ZodType, z } from 'zod';
|
|
15
15
|
import { ColumnDef, SortingState, ColumnFiltersState, Row, RowSelectionState, Table as Table$1, VisibilityState, ColumnSizingState, Header, Updater, Column } from '@tanstack/react-table';
|
|
16
16
|
export { Column, ColumnDef, ColumnFiltersState, Row, SortingState, Table as TanStackTableType, createColumnHelper } from '@tanstack/react-table';
|
|
17
|
+
import { P as Permission } from './policy-DPpMNLiO.cjs';
|
|
18
|
+
export { K as KNOWN_PERMISSIONS, a as KnownPermission, m as matchPermission } from './policy-DPpMNLiO.cjs';
|
|
17
19
|
|
|
18
20
|
declare const alertVariants: (props?: ({
|
|
19
21
|
variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
|
|
@@ -2071,32 +2073,6 @@ interface UseTableSizingReturn {
|
|
|
2071
2073
|
*/
|
|
2072
2074
|
declare function useTableSizing({ columnSizing: controlledSizing, defaultColumnSizing, onColumnSizingChange, }: UseTableSizingProps): UseTableSizingReturn;
|
|
2073
2075
|
|
|
2074
|
-
/**
|
|
2075
|
-
* AUTO-GENERATED — do not edit by hand.
|
|
2076
|
-
*
|
|
2077
|
-
* Regenerate with `pnpm generate-permissions`, which reads the catalog from the
|
|
2078
|
-
* Nexus backend. The list is committed so the library build never depends on a
|
|
2079
|
-
* live backend call.
|
|
2080
|
-
*
|
|
2081
|
-
* While this list is empty, `Permission` degrades to plain `string` and the
|
|
2082
|
-
* development-time unknown-permission warning is skipped entirely — an empty
|
|
2083
|
-
* catalog must never produce false positives.
|
|
2084
|
-
*/
|
|
2085
|
-
declare const KNOWN_PERMISSIONS: readonly [];
|
|
2086
|
-
type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
|
|
2087
|
-
|
|
2088
|
-
/**
|
|
2089
|
-
* A permission string in `resource.action` or `module.resource.action`
|
|
2090
|
-
* dot-notation, lowercase, with `*` as a segment wildcard and a bare `*` as the
|
|
2091
|
-
* super-grant.
|
|
2092
|
-
*
|
|
2093
|
-
* Known catalog entries are suggested by autocomplete; any other string is still
|
|
2094
|
-
* accepted, so a permission the catalog has not caught up with never blocks a
|
|
2095
|
-
* build. The `(string & {})` half is the TypeScript idiom that keeps the literal
|
|
2096
|
-
* suggestions from collapsing into plain `string`.
|
|
2097
|
-
*/
|
|
2098
|
-
type Permission = KnownPermission | (string & {});
|
|
2099
|
-
|
|
2100
2076
|
/** `'loading'` while the grant set is unresolved, `'ready'` once it is known. */
|
|
2101
2077
|
type AbilityStatus = 'loading' | 'ready';
|
|
2102
2078
|
interface AbilityContextValue {
|
|
@@ -2115,11 +2091,6 @@ interface AbilityProviderProps {
|
|
|
2115
2091
|
children: ReactNode;
|
|
2116
2092
|
permissions?: string[];
|
|
2117
2093
|
}
|
|
2118
|
-
/**
|
|
2119
|
-
* @param pattern - an entry from the user's grant set (may contain `*` as a segment wildcard)
|
|
2120
|
-
* @param permission - the permission being requested (from `Can.perform`)
|
|
2121
|
-
*/
|
|
2122
|
-
declare function matchPermission(pattern: string, permission: string): boolean;
|
|
2123
2094
|
declare function AbilityProvider({ children, permissions }: AbilityProviderProps): react.JSX.Element;
|
|
2124
2095
|
declare function useAbility(): AbilityContextValue;
|
|
2125
2096
|
declare function useCan(permissions: Permission | Permission[], mode?: 'any' | 'all'): boolean;
|
|
@@ -2277,4 +2248,4 @@ interface TCCEProviderProps {
|
|
|
2277
2248
|
}
|
|
2278
2249
|
declare function TCCEProvider({ children, permissions, toasterPosition, tooltipDelayDuration, }: TCCEProviderProps): react.JSX.Element;
|
|
2279
2250
|
|
|
2280
|
-
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, type AbilityStatus, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BottomNav, type BottomNavItem, BottomNavTabs, BottomNavTabsContent, type BottomNavTabsItem, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, type CanState, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxMatchMode, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerSide, type DrawerSize, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle,
|
|
2251
|
+
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, type AbilityStatus, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BottomNav, type BottomNavItem, BottomNavTabs, BottomNavTabsContent, type BottomNavTabsItem, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, type CanState, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxMatchMode, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerSide, type DrawerSize, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Permission, PhoneField, type PhoneFieldCountry, type PhoneFieldProps, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, type SortDirection, type SortRecord, Spinner, SpinnerDots, type SpinnerDotsProps, SpinnerLoader, type SpinnerLoaderProps, type SpinnerProps, Status, StatusIndicator, type StatusIndicatorProps, StatusLabel, type StatusLabelProps, type StatusProps, Switch, TCCEProvider, type TCCEProviderProps, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, type TableCellSize, type TableClassNames, type TableColumnDef, type TableContextType, TableFooter, TableHead, TableHeader, TablePagination, type TablePaginationProps, TableRow, type TableVariant, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextAs, type TextProps, type TextSize, type TextWeight, Textarea, type ToastAction, type ToastItem, type ToastType, Toaster, type ToasterPosition, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseTableDataProps, type UseTableDataReturn, type UseTableFilteringProps, type UseTableFilteringReturn, type UseTableGlobalFilterProps, type UseTableGlobalFilterReturn, type UseTableSizingProps, type UseTableSizingReturn, type UseTableSortingProps, type UseTableSortingReturn, type UseTableVisibilityProps, type UseTableVisibilityReturn, alertVariants, animation, avatarVariants, badgeVariants, buttonVariants$1 as buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAbilityStatus, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useSidebar, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };
|
package/dist/main.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export { Controller, useFieldArray } from 'react-hook-form';
|
|
|
14
14
|
import { ZodType, z } from 'zod';
|
|
15
15
|
import { ColumnDef, SortingState, ColumnFiltersState, Row, RowSelectionState, Table as Table$1, VisibilityState, ColumnSizingState, Header, Updater, Column } from '@tanstack/react-table';
|
|
16
16
|
export { Column, ColumnDef, ColumnFiltersState, Row, SortingState, Table as TanStackTableType, createColumnHelper } from '@tanstack/react-table';
|
|
17
|
+
import { P as Permission } from './policy-DPpMNLiO.js';
|
|
18
|
+
export { K as KNOWN_PERMISSIONS, a as KnownPermission, m as matchPermission } from './policy-DPpMNLiO.js';
|
|
17
19
|
|
|
18
20
|
declare const alertVariants: (props?: ({
|
|
19
21
|
variant?: "default" | "info" | "success" | "warning" | "error" | null | undefined;
|
|
@@ -2071,32 +2073,6 @@ interface UseTableSizingReturn {
|
|
|
2071
2073
|
*/
|
|
2072
2074
|
declare function useTableSizing({ columnSizing: controlledSizing, defaultColumnSizing, onColumnSizingChange, }: UseTableSizingProps): UseTableSizingReturn;
|
|
2073
2075
|
|
|
2074
|
-
/**
|
|
2075
|
-
* AUTO-GENERATED — do not edit by hand.
|
|
2076
|
-
*
|
|
2077
|
-
* Regenerate with `pnpm generate-permissions`, which reads the catalog from the
|
|
2078
|
-
* Nexus backend. The list is committed so the library build never depends on a
|
|
2079
|
-
* live backend call.
|
|
2080
|
-
*
|
|
2081
|
-
* While this list is empty, `Permission` degrades to plain `string` and the
|
|
2082
|
-
* development-time unknown-permission warning is skipped entirely — an empty
|
|
2083
|
-
* catalog must never produce false positives.
|
|
2084
|
-
*/
|
|
2085
|
-
declare const KNOWN_PERMISSIONS: readonly [];
|
|
2086
|
-
type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
|
|
2087
|
-
|
|
2088
|
-
/**
|
|
2089
|
-
* A permission string in `resource.action` or `module.resource.action`
|
|
2090
|
-
* dot-notation, lowercase, with `*` as a segment wildcard and a bare `*` as the
|
|
2091
|
-
* super-grant.
|
|
2092
|
-
*
|
|
2093
|
-
* Known catalog entries are suggested by autocomplete; any other string is still
|
|
2094
|
-
* accepted, so a permission the catalog has not caught up with never blocks a
|
|
2095
|
-
* build. The `(string & {})` half is the TypeScript idiom that keeps the literal
|
|
2096
|
-
* suggestions from collapsing into plain `string`.
|
|
2097
|
-
*/
|
|
2098
|
-
type Permission = KnownPermission | (string & {});
|
|
2099
|
-
|
|
2100
2076
|
/** `'loading'` while the grant set is unresolved, `'ready'` once it is known. */
|
|
2101
2077
|
type AbilityStatus = 'loading' | 'ready';
|
|
2102
2078
|
interface AbilityContextValue {
|
|
@@ -2115,11 +2091,6 @@ interface AbilityProviderProps {
|
|
|
2115
2091
|
children: ReactNode;
|
|
2116
2092
|
permissions?: string[];
|
|
2117
2093
|
}
|
|
2118
|
-
/**
|
|
2119
|
-
* @param pattern - an entry from the user's grant set (may contain `*` as a segment wildcard)
|
|
2120
|
-
* @param permission - the permission being requested (from `Can.perform`)
|
|
2121
|
-
*/
|
|
2122
|
-
declare function matchPermission(pattern: string, permission: string): boolean;
|
|
2123
2094
|
declare function AbilityProvider({ children, permissions }: AbilityProviderProps): react.JSX.Element;
|
|
2124
2095
|
declare function useAbility(): AbilityContextValue;
|
|
2125
2096
|
declare function useCan(permissions: Permission | Permission[], mode?: 'any' | 'all'): boolean;
|
|
@@ -2277,4 +2248,4 @@ interface TCCEProviderProps {
|
|
|
2277
2248
|
}
|
|
2278
2249
|
declare function TCCEProvider({ children, permissions, toasterPosition, tooltipDelayDuration, }: TCCEProviderProps): react.JSX.Element;
|
|
2279
2250
|
|
|
2280
|
-
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, type AbilityStatus, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BottomNav, type BottomNavItem, BottomNavTabs, BottomNavTabsContent, type BottomNavTabsItem, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, type CanState, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxMatchMode, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerSide, type DrawerSize, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle,
|
|
2251
|
+
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, type AbilityStatus, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BottomNav, type BottomNavItem, BottomNavTabs, BottomNavTabsContent, type BottomNavTabsItem, BottomNavTabsList, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, type CanState, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxMatchMode, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerSide, type DrawerSize, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Label, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Permission, PhoneField, type PhoneFieldCountry, type PhoneFieldProps, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, type SortDirection, type SortRecord, Spinner, SpinnerDots, type SpinnerDotsProps, SpinnerLoader, type SpinnerLoaderProps, type SpinnerProps, Status, StatusIndicator, type StatusIndicatorProps, StatusLabel, type StatusLabelProps, type StatusProps, Switch, TCCEProvider, type TCCEProviderProps, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, type TableCellSize, type TableClassNames, type TableColumnDef, type TableContextType, TableFooter, TableHead, TableHeader, TablePagination, type TablePaginationProps, TableRow, type TableVariant, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextAs, type TextProps, type TextSize, type TextWeight, Textarea, type ToastAction, type ToastItem, type ToastType, Toaster, type ToasterPosition, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseTableDataProps, type UseTableDataReturn, type UseTableFilteringProps, type UseTableFilteringReturn, type UseTableGlobalFilterProps, type UseTableGlobalFilterReturn, type UseTableSizingProps, type UseTableSizingReturn, type UseTableSortingProps, type UseTableSortingReturn, type UseTableVisibilityProps, type UseTableVisibilityReturn, alertVariants, animation, avatarVariants, badgeVariants, buttonVariants$1 as buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAbilityStatus, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useSidebar, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };
|
package/dist/main.js
CHANGED
|
@@ -5117,6 +5117,8 @@ function NavigationMenuIndicator({
|
|
|
5117
5117
|
}
|
|
5118
5118
|
);
|
|
5119
5119
|
}
|
|
5120
|
+
|
|
5121
|
+
// src/components/authorization/policy.ts
|
|
5120
5122
|
function matchPermission(pattern, permission) {
|
|
5121
5123
|
if (pattern === "*") return true;
|
|
5122
5124
|
if (pattern === permission) return true;
|
|
@@ -5132,6 +5134,15 @@ function matchesAny(permissionSet, permission) {
|
|
|
5132
5134
|
}
|
|
5133
5135
|
return false;
|
|
5134
5136
|
}
|
|
5137
|
+
function can(permissionSet, perms, mode = "any") {
|
|
5138
|
+
const list = Array.isArray(perms) ? perms : [perms];
|
|
5139
|
+
if (list.length === 0) return false;
|
|
5140
|
+
if (permissionSet.has("*")) return true;
|
|
5141
|
+
if (mode === "all") {
|
|
5142
|
+
return list.every((p) => matchesAny(permissionSet, p));
|
|
5143
|
+
}
|
|
5144
|
+
return list.some((p) => matchesAny(permissionSet, p));
|
|
5145
|
+
}
|
|
5135
5146
|
var AbilityContext = createContext(void 0);
|
|
5136
5147
|
AbilityContext.displayName = "AbilityContext";
|
|
5137
5148
|
function AbilityProvider({ children, permissions }) {
|
|
@@ -5140,16 +5151,8 @@ function AbilityProvider({ children, permissions }) {
|
|
|
5140
5151
|
);
|
|
5141
5152
|
const [imperativelyResolved, setImperativelyResolved] = useState(false);
|
|
5142
5153
|
const status = permissions !== void 0 || imperativelyResolved ? "ready" : "loading";
|
|
5143
|
-
const
|
|
5144
|
-
(perms, mode = "any") =>
|
|
5145
|
-
const list = Array.isArray(perms) ? perms : [perms];
|
|
5146
|
-
if (list.length === 0) return false;
|
|
5147
|
-
if (permissionSet.has("*")) return true;
|
|
5148
|
-
if (mode === "all") {
|
|
5149
|
-
return list.every((p) => matchesAny(permissionSet, p));
|
|
5150
|
-
}
|
|
5151
|
-
return list.some((p) => matchesAny(permissionSet, p));
|
|
5152
|
-
},
|
|
5154
|
+
const can2 = useCallback(
|
|
5155
|
+
(perms, mode = "any") => can(permissionSet, perms, mode),
|
|
5153
5156
|
[permissionSet]
|
|
5154
5157
|
);
|
|
5155
5158
|
const setAbilities = useCallback((perms) => {
|
|
@@ -5169,8 +5172,8 @@ function AbilityProvider({ children, permissions }) {
|
|
|
5169
5172
|
setPermissionSet(new Set(permissions));
|
|
5170
5173
|
}, [permissionKey, permissions]);
|
|
5171
5174
|
const value = useMemo(
|
|
5172
|
-
() => ({ can, setAbilities, clearAbilities, status }),
|
|
5173
|
-
[
|
|
5175
|
+
() => ({ can: can2, setAbilities, clearAbilities, status }),
|
|
5176
|
+
[can2, setAbilities, clearAbilities, status]
|
|
5174
5177
|
);
|
|
5175
5178
|
return /* @__PURE__ */ jsx(AbilityContext.Provider, { value, children });
|
|
5176
5179
|
}
|
|
@@ -5182,8 +5185,8 @@ function useAbility() {
|
|
|
5182
5185
|
return context;
|
|
5183
5186
|
}
|
|
5184
5187
|
function useCan(permissions, mode = "any") {
|
|
5185
|
-
const { can } = useAbility();
|
|
5186
|
-
return
|
|
5188
|
+
const { can: can2 } = useAbility();
|
|
5189
|
+
return can2(permissions, mode);
|
|
5187
5190
|
}
|
|
5188
5191
|
function useAbilityStatus() {
|
|
5189
5192
|
return useAbility().status;
|
|
@@ -5290,8 +5293,8 @@ function Can({
|
|
|
5290
5293
|
children
|
|
5291
5294
|
}) {
|
|
5292
5295
|
warnUnknownPermission(permission);
|
|
5293
|
-
const { can, status } = useAbility();
|
|
5294
|
-
const hasPermission = status === "ready" &&
|
|
5296
|
+
const { can: can2, status } = useAbility();
|
|
5297
|
+
const hasPermission = status === "ready" && can2(permission, mode);
|
|
5295
5298
|
const show = negate ? !hasPermission : hasPermission;
|
|
5296
5299
|
if (typeof children === "function") {
|
|
5297
5300
|
warnRenderPropVoidsProps([
|