hazo_ui 6.3.0 → 6.4.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/CHANGE_LOG.md +73 -0
- package/dist/index.cjs +178 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -3
- package/dist/index.d.ts +42 -3
- package/dist/index.js +178 -22
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
package/dist/index.d.cts
CHANGED
|
@@ -1876,6 +1876,31 @@ interface KanbanItem {
|
|
|
1876
1876
|
id: string;
|
|
1877
1877
|
columnKey: string;
|
|
1878
1878
|
priority?: KanbanPriority;
|
|
1879
|
+
/**
|
|
1880
|
+
* Which section of `columnKey` this card sits in. Only meaningful when the
|
|
1881
|
+
* column declares `sections`; ignored otherwise. A card whose `sectionKey`
|
|
1882
|
+
* matches no declared section is rendered in an unlabelled trailing group
|
|
1883
|
+
* at the bottom of the column.
|
|
1884
|
+
*/
|
|
1885
|
+
sectionKey?: string;
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* A horizontal band inside a column. Sections split a column's cards into
|
|
1889
|
+
* separator-headed groups, each of which is its own drop target — so a drop
|
|
1890
|
+
* can express both "which column" and "which section" in one gesture.
|
|
1891
|
+
*/
|
|
1892
|
+
interface KanbanSection {
|
|
1893
|
+
key: string;
|
|
1894
|
+
title: string;
|
|
1895
|
+
/** Optional gate: returning false rejects a drop into this section. */
|
|
1896
|
+
accepts?: (item: KanbanItem) => boolean;
|
|
1897
|
+
/**
|
|
1898
|
+
* When true and the section currently holds no cards, it renders as a thin
|
|
1899
|
+
* one-line drop strip instead of a full header + empty body. Keeps a column
|
|
1900
|
+
* short when its section list is a long vocabulary, while leaving every
|
|
1901
|
+
* section reachable as a drop target.
|
|
1902
|
+
*/
|
|
1903
|
+
collapseWhenEmpty?: boolean;
|
|
1879
1904
|
}
|
|
1880
1905
|
/**
|
|
1881
1906
|
* Column descriptor passed to the board.
|
|
@@ -1885,6 +1910,12 @@ interface KanbanColumn {
|
|
|
1885
1910
|
title: string;
|
|
1886
1911
|
/** Optional gate: returning false rejects an incoming drop. */
|
|
1887
1912
|
accepts?: (item: KanbanItem) => boolean;
|
|
1913
|
+
/**
|
|
1914
|
+
* Optional in-column grouping. When present, the column body renders one
|
|
1915
|
+
* separator-headed group per entry, in this order, and cards are placed by
|
|
1916
|
+
* their `sectionKey`. Omit for a flat column (the default).
|
|
1917
|
+
*/
|
|
1918
|
+
sections?: KanbanSection[];
|
|
1888
1919
|
}
|
|
1889
1920
|
/**
|
|
1890
1921
|
* Handle attached to move/reorder events. Calling revert() removes the
|
|
@@ -1895,22 +1926,30 @@ interface KanbanMoveHandle {
|
|
|
1895
1926
|
revert: () => void;
|
|
1896
1927
|
}
|
|
1897
1928
|
/**
|
|
1898
|
-
* Fired when a card is dropped
|
|
1929
|
+
* Fired when a card is dropped somewhere that changes its placement — a
|
|
1930
|
+
* different column, a different section of the same column, or both. Only a
|
|
1931
|
+
* drop that lands in the *same* column and section is a reorder instead.
|
|
1899
1932
|
*/
|
|
1900
1933
|
type KanbanMoveEvent<T extends KanbanItem = KanbanItem> = {
|
|
1901
1934
|
itemId: string;
|
|
1902
1935
|
item: T;
|
|
1903
1936
|
fromColumn: string;
|
|
1904
1937
|
toColumn: string;
|
|
1938
|
+
/** The card's own `sectionKey`. `undefined` on unsectioned boards. */
|
|
1939
|
+
fromSection?: string;
|
|
1940
|
+
/** The section dropped into. `undefined` on unsectioned boards. */
|
|
1941
|
+
toSection?: string;
|
|
1905
1942
|
newIndex: number;
|
|
1906
1943
|
} & KanbanMoveHandle;
|
|
1907
1944
|
/**
|
|
1908
|
-
* Fired when a card is reordered within the same column.
|
|
1945
|
+
* Fired when a card is reordered within the same column *and* section.
|
|
1909
1946
|
*/
|
|
1910
1947
|
type KanbanReorderEvent<T extends KanbanItem = KanbanItem> = {
|
|
1911
1948
|
itemId: string;
|
|
1912
1949
|
item: T;
|
|
1913
1950
|
columnKey: string;
|
|
1951
|
+
/** The section reordered within. `undefined` on unsectioned boards. */
|
|
1952
|
+
sectionKey?: string;
|
|
1914
1953
|
newIndex: number;
|
|
1915
1954
|
} & KanbanMoveHandle;
|
|
1916
1955
|
/**
|
|
@@ -2856,4 +2895,4 @@ interface UseScrollRestoreResult {
|
|
|
2856
2895
|
*/
|
|
2857
2896
|
declare function useScrollRestore(treeId: string, viewName: string, options?: UseScrollRestoreOptions): UseScrollRestoreResult;
|
|
2858
2897
|
|
|
2859
|
-
export { ANIMATION_PRESETS, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AnimationPreset, AppFooter, type AppFooterProps, AppHeader, type AppHeaderProps, type BaseCommandInputProps, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CELEBRATION_GRADIENT, Calendar, CanvasTextToolbar, type CanvasTextToolbarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CelebrationPayload, CelebrationProvider, type CelebrationProviderProps, type CelebrationShareableCard, type ChartDataPoint, type ChartDataSeries, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type CommandEditContext, type CommandItem$1 as CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type ConfirmDialogVariant, type DateRangeOption, DateRangeSelector, type DateRangeSelectorProps, type DialogVariant, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorBannerSeverity, ErrorPage, type ErrorPageProps, type EtaProgressHandle, type FilterConfig, type FilterField, FunnelChart, type FunnelChartProps, type FunnelStep, HazoContextProvider, type HazoContextProviderProps, type HazoUiConfig, HazoUiConfirmDialog, type HazoUiConfirmDialogProps, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, type HazoUiDialogKind, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiEtaProgress, type HazoUiEtaProgressProps, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiIcon, HazoUiIconPicker, type HazoUiIconPickerProps, type HazoUiIconProps, HazoUiImageCropper, HazoUiImageCropperDialog, type HazoUiImageCropperDialogProps, type HazoUiImageCropperHandle, type HazoUiImageCropperProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMemoryDropdown, type HazoUiMemoryDropdownProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, HazoUiProgressBar, type HazoUiProgressBarProps, HazoUiRte, type HazoUiRteProps, HazoUiTable, type HazoUiTablePagination, type HazoUiTableProps, type HazoUiTableServerLoadArgs, type HazoUiTableServerLoadResult, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, HazoUiToaster, type HazoUiToasterProps, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputAffix, type InputAffixProps, type InsertedCommand, InverseSparkline, type InverseSparklineProps, type KanbanAnnouncements, type KanbanColumn, type KanbanEditorCtx, type KanbanEditorField, type KanbanEditorFieldType, type KanbanFilterValue, type KanbanItem, type KanbanMoveEvent, type KanbanMoveHandle, type KanbanPriority, type KanbanReorderEvent, type KanbanSaveEvent, Label, LiveRegion, type LiveRegionProps, LoadingTimeout, type LoadingTimeoutProps, type Logger, Logo, type LogoProps, MarkdownEditor, type MarkdownEditorProps, type MarkdownEmbed, type MemoryEntry, NotificationCountBadge, type NotificationCountBadgeProps, NotificationItem, type NotificationItemProps, NotificationPanel, type NotificationPanelProps, type PermissionToastOptions, Popover, PopoverContent, PopoverTrigger, type PrefixColor, type PrefixConfig, ProgressiveImage, type ProgressiveImageProps, RadioGroup, RadioGroupItem, type RteAttachment, type RteOutput, type RteVariable, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Command as ShadcnCommand, CommandEmpty as ShadcnCommandEmpty, CommandGroup as ShadcnCommandGroup, CommandInput as ShadcnCommandInput, CommandItem as ShadcnCommandItem, CommandList as ShadcnCommandList, Skeleton, SkeletonBar, type SkeletonBarProps, SkeletonCircle, type SkeletonCircleProps, SkeletonGroup, type SkeletonGroupProps, SkeletonRect, type SkeletonRectProps, Slider, type SortConfig, type SortField, Sparkline, type SparklineProps, Spinner, type StackedBar, StackedBars, type StackedBarsProps, type SuggestionState, Switch, Table, TableBody, TableCaption, TableCell, type TableColumn, type TableFilter, TableFooter, type TableFormatter, TableHead, TableHeader, TableRow, type TableSort, type TableSortEntry, type TableSortProp, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCopyToClipboardResult, type UseErrorDisplayResult, type UseEtaProgressOptions, type UseFullscreenRefResult, type UseFullscreenResult, type UseLoadingStateResult, type UseLongPressOptions, type UseLongPressResult, type UseRememberedStateOptions, type UseScrollRestoreOptions, type UseScrollRestoreResult, type UseWakeLockResult, applyKanbanFilter, buttonGroupVariants, celebrate, computeEta, create_command_suggestion_extension, easeToward, errorToast, format_num, generateUUID, get_hazo_ui_config, get_logger, isLucideValue, median, parse_commands_from_text, permissionToast, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, set_logger, successToast, text_to_tiptap_content, toggleVariants, upsertEntry as upsertMemoryEntry, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useEtaProgress, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useLongPress, useMediaQuery, useRememberedState, useScrollRestore, useSessionStorage, useViewport, useWakeLock, use_fullscreen, use_wake_lock };
|
|
2898
|
+
export { ANIMATION_PRESETS, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AnimationPreset, AppFooter, type AppFooterProps, AppHeader, type AppHeaderProps, type BaseCommandInputProps, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CELEBRATION_GRADIENT, Calendar, CanvasTextToolbar, type CanvasTextToolbarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CelebrationPayload, CelebrationProvider, type CelebrationProviderProps, type CelebrationShareableCard, type ChartDataPoint, type ChartDataSeries, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type CommandEditContext, type CommandItem$1 as CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type ConfirmDialogVariant, type DateRangeOption, DateRangeSelector, type DateRangeSelectorProps, type DialogVariant, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorBannerSeverity, ErrorPage, type ErrorPageProps, type EtaProgressHandle, type FilterConfig, type FilterField, FunnelChart, type FunnelChartProps, type FunnelStep, HazoContextProvider, type HazoContextProviderProps, type HazoUiConfig, HazoUiConfirmDialog, type HazoUiConfirmDialogProps, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, type HazoUiDialogKind, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiEtaProgress, type HazoUiEtaProgressProps, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiIcon, HazoUiIconPicker, type HazoUiIconPickerProps, type HazoUiIconProps, HazoUiImageCropper, HazoUiImageCropperDialog, type HazoUiImageCropperDialogProps, type HazoUiImageCropperHandle, type HazoUiImageCropperProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMemoryDropdown, type HazoUiMemoryDropdownProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, HazoUiProgressBar, type HazoUiProgressBarProps, HazoUiRte, type HazoUiRteProps, HazoUiTable, type HazoUiTablePagination, type HazoUiTableProps, type HazoUiTableServerLoadArgs, type HazoUiTableServerLoadResult, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, HazoUiToaster, type HazoUiToasterProps, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputAffix, type InputAffixProps, type InsertedCommand, InverseSparkline, type InverseSparklineProps, type KanbanAnnouncements, type KanbanColumn, type KanbanEditorCtx, type KanbanEditorField, type KanbanEditorFieldType, type KanbanFilterValue, type KanbanItem, type KanbanMoveEvent, type KanbanMoveHandle, type KanbanPriority, type KanbanReorderEvent, type KanbanSaveEvent, type KanbanSection, Label, LiveRegion, type LiveRegionProps, LoadingTimeout, type LoadingTimeoutProps, type Logger, Logo, type LogoProps, MarkdownEditor, type MarkdownEditorProps, type MarkdownEmbed, type MemoryEntry, NotificationCountBadge, type NotificationCountBadgeProps, NotificationItem, type NotificationItemProps, NotificationPanel, type NotificationPanelProps, type PermissionToastOptions, Popover, PopoverContent, PopoverTrigger, type PrefixColor, type PrefixConfig, ProgressiveImage, type ProgressiveImageProps, RadioGroup, RadioGroupItem, type RteAttachment, type RteOutput, type RteVariable, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Command as ShadcnCommand, CommandEmpty as ShadcnCommandEmpty, CommandGroup as ShadcnCommandGroup, CommandInput as ShadcnCommandInput, CommandItem as ShadcnCommandItem, CommandList as ShadcnCommandList, Skeleton, SkeletonBar, type SkeletonBarProps, SkeletonCircle, type SkeletonCircleProps, SkeletonGroup, type SkeletonGroupProps, SkeletonRect, type SkeletonRectProps, Slider, type SortConfig, type SortField, Sparkline, type SparklineProps, Spinner, type StackedBar, StackedBars, type StackedBarsProps, type SuggestionState, Switch, Table, TableBody, TableCaption, TableCell, type TableColumn, type TableFilter, TableFooter, type TableFormatter, TableHead, TableHeader, TableRow, type TableSort, type TableSortEntry, type TableSortProp, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCopyToClipboardResult, type UseErrorDisplayResult, type UseEtaProgressOptions, type UseFullscreenRefResult, type UseFullscreenResult, type UseLoadingStateResult, type UseLongPressOptions, type UseLongPressResult, type UseRememberedStateOptions, type UseScrollRestoreOptions, type UseScrollRestoreResult, type UseWakeLockResult, applyKanbanFilter, buttonGroupVariants, celebrate, computeEta, create_command_suggestion_extension, easeToward, errorToast, format_num, generateUUID, get_hazo_ui_config, get_logger, isLucideValue, median, parse_commands_from_text, permissionToast, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, set_logger, successToast, text_to_tiptap_content, toggleVariants, upsertEntry as upsertMemoryEntry, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useEtaProgress, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useLongPress, useMediaQuery, useRememberedState, useScrollRestore, useSessionStorage, useViewport, useWakeLock, use_fullscreen, use_wake_lock };
|
package/dist/index.d.ts
CHANGED
|
@@ -1876,6 +1876,31 @@ interface KanbanItem {
|
|
|
1876
1876
|
id: string;
|
|
1877
1877
|
columnKey: string;
|
|
1878
1878
|
priority?: KanbanPriority;
|
|
1879
|
+
/**
|
|
1880
|
+
* Which section of `columnKey` this card sits in. Only meaningful when the
|
|
1881
|
+
* column declares `sections`; ignored otherwise. A card whose `sectionKey`
|
|
1882
|
+
* matches no declared section is rendered in an unlabelled trailing group
|
|
1883
|
+
* at the bottom of the column.
|
|
1884
|
+
*/
|
|
1885
|
+
sectionKey?: string;
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* A horizontal band inside a column. Sections split a column's cards into
|
|
1889
|
+
* separator-headed groups, each of which is its own drop target — so a drop
|
|
1890
|
+
* can express both "which column" and "which section" in one gesture.
|
|
1891
|
+
*/
|
|
1892
|
+
interface KanbanSection {
|
|
1893
|
+
key: string;
|
|
1894
|
+
title: string;
|
|
1895
|
+
/** Optional gate: returning false rejects a drop into this section. */
|
|
1896
|
+
accepts?: (item: KanbanItem) => boolean;
|
|
1897
|
+
/**
|
|
1898
|
+
* When true and the section currently holds no cards, it renders as a thin
|
|
1899
|
+
* one-line drop strip instead of a full header + empty body. Keeps a column
|
|
1900
|
+
* short when its section list is a long vocabulary, while leaving every
|
|
1901
|
+
* section reachable as a drop target.
|
|
1902
|
+
*/
|
|
1903
|
+
collapseWhenEmpty?: boolean;
|
|
1879
1904
|
}
|
|
1880
1905
|
/**
|
|
1881
1906
|
* Column descriptor passed to the board.
|
|
@@ -1885,6 +1910,12 @@ interface KanbanColumn {
|
|
|
1885
1910
|
title: string;
|
|
1886
1911
|
/** Optional gate: returning false rejects an incoming drop. */
|
|
1887
1912
|
accepts?: (item: KanbanItem) => boolean;
|
|
1913
|
+
/**
|
|
1914
|
+
* Optional in-column grouping. When present, the column body renders one
|
|
1915
|
+
* separator-headed group per entry, in this order, and cards are placed by
|
|
1916
|
+
* their `sectionKey`. Omit for a flat column (the default).
|
|
1917
|
+
*/
|
|
1918
|
+
sections?: KanbanSection[];
|
|
1888
1919
|
}
|
|
1889
1920
|
/**
|
|
1890
1921
|
* Handle attached to move/reorder events. Calling revert() removes the
|
|
@@ -1895,22 +1926,30 @@ interface KanbanMoveHandle {
|
|
|
1895
1926
|
revert: () => void;
|
|
1896
1927
|
}
|
|
1897
1928
|
/**
|
|
1898
|
-
* Fired when a card is dropped
|
|
1929
|
+
* Fired when a card is dropped somewhere that changes its placement — a
|
|
1930
|
+
* different column, a different section of the same column, or both. Only a
|
|
1931
|
+
* drop that lands in the *same* column and section is a reorder instead.
|
|
1899
1932
|
*/
|
|
1900
1933
|
type KanbanMoveEvent<T extends KanbanItem = KanbanItem> = {
|
|
1901
1934
|
itemId: string;
|
|
1902
1935
|
item: T;
|
|
1903
1936
|
fromColumn: string;
|
|
1904
1937
|
toColumn: string;
|
|
1938
|
+
/** The card's own `sectionKey`. `undefined` on unsectioned boards. */
|
|
1939
|
+
fromSection?: string;
|
|
1940
|
+
/** The section dropped into. `undefined` on unsectioned boards. */
|
|
1941
|
+
toSection?: string;
|
|
1905
1942
|
newIndex: number;
|
|
1906
1943
|
} & KanbanMoveHandle;
|
|
1907
1944
|
/**
|
|
1908
|
-
* Fired when a card is reordered within the same column.
|
|
1945
|
+
* Fired when a card is reordered within the same column *and* section.
|
|
1909
1946
|
*/
|
|
1910
1947
|
type KanbanReorderEvent<T extends KanbanItem = KanbanItem> = {
|
|
1911
1948
|
itemId: string;
|
|
1912
1949
|
item: T;
|
|
1913
1950
|
columnKey: string;
|
|
1951
|
+
/** The section reordered within. `undefined` on unsectioned boards. */
|
|
1952
|
+
sectionKey?: string;
|
|
1914
1953
|
newIndex: number;
|
|
1915
1954
|
} & KanbanMoveHandle;
|
|
1916
1955
|
/**
|
|
@@ -2856,4 +2895,4 @@ interface UseScrollRestoreResult {
|
|
|
2856
2895
|
*/
|
|
2857
2896
|
declare function useScrollRestore(treeId: string, viewName: string, options?: UseScrollRestoreOptions): UseScrollRestoreResult;
|
|
2858
2897
|
|
|
2859
|
-
export { ANIMATION_PRESETS, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AnimationPreset, AppFooter, type AppFooterProps, AppHeader, type AppHeaderProps, type BaseCommandInputProps, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CELEBRATION_GRADIENT, Calendar, CanvasTextToolbar, type CanvasTextToolbarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CelebrationPayload, CelebrationProvider, type CelebrationProviderProps, type CelebrationShareableCard, type ChartDataPoint, type ChartDataSeries, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type CommandEditContext, type CommandItem$1 as CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type ConfirmDialogVariant, type DateRangeOption, DateRangeSelector, type DateRangeSelectorProps, type DialogVariant, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorBannerSeverity, ErrorPage, type ErrorPageProps, type EtaProgressHandle, type FilterConfig, type FilterField, FunnelChart, type FunnelChartProps, type FunnelStep, HazoContextProvider, type HazoContextProviderProps, type HazoUiConfig, HazoUiConfirmDialog, type HazoUiConfirmDialogProps, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, type HazoUiDialogKind, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiEtaProgress, type HazoUiEtaProgressProps, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiIcon, HazoUiIconPicker, type HazoUiIconPickerProps, type HazoUiIconProps, HazoUiImageCropper, HazoUiImageCropperDialog, type HazoUiImageCropperDialogProps, type HazoUiImageCropperHandle, type HazoUiImageCropperProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMemoryDropdown, type HazoUiMemoryDropdownProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, HazoUiProgressBar, type HazoUiProgressBarProps, HazoUiRte, type HazoUiRteProps, HazoUiTable, type HazoUiTablePagination, type HazoUiTableProps, type HazoUiTableServerLoadArgs, type HazoUiTableServerLoadResult, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, HazoUiToaster, type HazoUiToasterProps, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputAffix, type InputAffixProps, type InsertedCommand, InverseSparkline, type InverseSparklineProps, type KanbanAnnouncements, type KanbanColumn, type KanbanEditorCtx, type KanbanEditorField, type KanbanEditorFieldType, type KanbanFilterValue, type KanbanItem, type KanbanMoveEvent, type KanbanMoveHandle, type KanbanPriority, type KanbanReorderEvent, type KanbanSaveEvent, Label, LiveRegion, type LiveRegionProps, LoadingTimeout, type LoadingTimeoutProps, type Logger, Logo, type LogoProps, MarkdownEditor, type MarkdownEditorProps, type MarkdownEmbed, type MemoryEntry, NotificationCountBadge, type NotificationCountBadgeProps, NotificationItem, type NotificationItemProps, NotificationPanel, type NotificationPanelProps, type PermissionToastOptions, Popover, PopoverContent, PopoverTrigger, type PrefixColor, type PrefixConfig, ProgressiveImage, type ProgressiveImageProps, RadioGroup, RadioGroupItem, type RteAttachment, type RteOutput, type RteVariable, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Command as ShadcnCommand, CommandEmpty as ShadcnCommandEmpty, CommandGroup as ShadcnCommandGroup, CommandInput as ShadcnCommandInput, CommandItem as ShadcnCommandItem, CommandList as ShadcnCommandList, Skeleton, SkeletonBar, type SkeletonBarProps, SkeletonCircle, type SkeletonCircleProps, SkeletonGroup, type SkeletonGroupProps, SkeletonRect, type SkeletonRectProps, Slider, type SortConfig, type SortField, Sparkline, type SparklineProps, Spinner, type StackedBar, StackedBars, type StackedBarsProps, type SuggestionState, Switch, Table, TableBody, TableCaption, TableCell, type TableColumn, type TableFilter, TableFooter, type TableFormatter, TableHead, TableHeader, TableRow, type TableSort, type TableSortEntry, type TableSortProp, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCopyToClipboardResult, type UseErrorDisplayResult, type UseEtaProgressOptions, type UseFullscreenRefResult, type UseFullscreenResult, type UseLoadingStateResult, type UseLongPressOptions, type UseLongPressResult, type UseRememberedStateOptions, type UseScrollRestoreOptions, type UseScrollRestoreResult, type UseWakeLockResult, applyKanbanFilter, buttonGroupVariants, celebrate, computeEta, create_command_suggestion_extension, easeToward, errorToast, format_num, generateUUID, get_hazo_ui_config, get_logger, isLucideValue, median, parse_commands_from_text, permissionToast, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, set_logger, successToast, text_to_tiptap_content, toggleVariants, upsertEntry as upsertMemoryEntry, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useEtaProgress, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useLongPress, useMediaQuery, useRememberedState, useScrollRestore, useSessionStorage, useViewport, useWakeLock, use_fullscreen, use_wake_lock };
|
|
2898
|
+
export { ANIMATION_PRESETS, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AnimationPreset, AppFooter, type AppFooterProps, AppHeader, type AppHeaderProps, type BaseCommandInputProps, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CELEBRATION_GRADIENT, Calendar, CanvasTextToolbar, type CanvasTextToolbarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CelebrationPayload, CelebrationProvider, type CelebrationProviderProps, type CelebrationShareableCard, type ChartDataPoint, type ChartDataSeries, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type CommandEditContext, type CommandItem$1 as CommandItem, CommandNodeExtension, CommandPill, type CommandPillProps, CommandPopover, type CommandPopoverProps, type CommandTextOutput, type ConfirmDialogVariant, type DateRangeOption, DateRangeSelector, type DateRangeSelectorProps, type DialogVariant, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorBannerSeverity, ErrorPage, type ErrorPageProps, type EtaProgressHandle, type FilterConfig, type FilterField, FunnelChart, type FunnelChartProps, type FunnelStep, HazoContextProvider, type HazoContextProviderProps, type HazoUiConfig, HazoUiConfirmDialog, type HazoUiConfirmDialogProps, HazoUiDialog, DialogClose as HazoUiDialogClose, DialogContent as HazoUiDialogContent, DialogDescription as HazoUiDialogDescription, DialogFooter as HazoUiDialogFooter, DialogHeader as HazoUiDialogHeader, type HazoUiDialogKind, DialogOverlay as HazoUiDialogOverlay, DialogPortal as HazoUiDialogPortal, type HazoUiDialogProps, Dialog as HazoUiDialogRoot, DialogTitle as HazoUiDialogTitle, DialogTrigger as HazoUiDialogTrigger, HazoUiEtaProgress, type HazoUiEtaProgressProps, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiIcon, HazoUiIconPicker, type HazoUiIconPickerProps, type HazoUiIconProps, HazoUiImageCropper, HazoUiImageCropperDialog, type HazoUiImageCropperDialogProps, type HazoUiImageCropperHandle, type HazoUiImageCropperProps, HazoUiKanban, HazoUiKanbanFilter, type HazoUiKanbanFilterProps, type HazoUiKanbanProps, HazoUiMemoryDropdown, type HazoUiMemoryDropdownProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiPillRadio, type HazoUiPillRadioItem, type HazoUiPillRadioProps, HazoUiProgressBar, type HazoUiProgressBarProps, HazoUiRte, type HazoUiRteProps, HazoUiTable, type HazoUiTablePagination, type HazoUiTableProps, type HazoUiTableServerLoadArgs, type HazoUiTableServerLoadResult, HazoUiTextarea, type HazoUiTextareaProps, HazoUiTextbox, type HazoUiTextboxProps, HazoUiToaster, type HazoUiToasterProps, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputAffix, type InputAffixProps, type InsertedCommand, InverseSparkline, type InverseSparklineProps, type KanbanAnnouncements, type KanbanColumn, type KanbanEditorCtx, type KanbanEditorField, type KanbanEditorFieldType, type KanbanFilterValue, type KanbanItem, type KanbanMoveEvent, type KanbanMoveHandle, type KanbanPriority, type KanbanReorderEvent, type KanbanSaveEvent, type KanbanSection, Label, LiveRegion, type LiveRegionProps, LoadingTimeout, type LoadingTimeoutProps, type Logger, Logo, type LogoProps, MarkdownEditor, type MarkdownEditorProps, type MarkdownEmbed, type MemoryEntry, NotificationCountBadge, type NotificationCountBadgeProps, NotificationItem, type NotificationItemProps, NotificationPanel, type NotificationPanelProps, type PermissionToastOptions, Popover, PopoverContent, PopoverTrigger, type PrefixColor, type PrefixConfig, ProgressiveImage, type ProgressiveImageProps, RadioGroup, RadioGroupItem, type RteAttachment, type RteOutput, type RteVariable, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Command as ShadcnCommand, CommandEmpty as ShadcnCommandEmpty, CommandGroup as ShadcnCommandGroup, CommandInput as ShadcnCommandInput, CommandItem as ShadcnCommandItem, CommandList as ShadcnCommandList, Skeleton, SkeletonBar, type SkeletonBarProps, SkeletonCircle, type SkeletonCircleProps, SkeletonGroup, type SkeletonGroupProps, SkeletonRect, type SkeletonRectProps, Slider, type SortConfig, type SortField, Sparkline, type SparklineProps, Spinner, type StackedBar, StackedBars, type StackedBarsProps, type SuggestionState, Switch, Table, TableBody, TableCaption, TableCell, type TableColumn, type TableFilter, TableFooter, type TableFormatter, TableHead, TableHeader, TableRow, type TableSort, type TableSortEntry, type TableSortProp, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type ToastOptions, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCopyToClipboardResult, type UseErrorDisplayResult, type UseEtaProgressOptions, type UseFullscreenRefResult, type UseFullscreenResult, type UseLoadingStateResult, type UseLongPressOptions, type UseLongPressResult, type UseRememberedStateOptions, type UseScrollRestoreOptions, type UseScrollRestoreResult, type UseWakeLockResult, applyKanbanFilter, buttonGroupVariants, celebrate, computeEta, create_command_suggestion_extension, easeToward, errorToast, format_num, generateUUID, get_hazo_ui_config, get_logger, isLucideValue, median, parse_commands_from_text, permissionToast, pick_x_label_indices, reset_hazo_ui_config, resolve_animation_classes, set_hazo_ui_config, set_logger, successToast, text_to_tiptap_content, toggleVariants, upsertEntry as upsertMemoryEntry, useClickOutside, useCopyToClipboard, useDebounce, useErrorDisplay, useEtaProgress, useFullscreen, useIsMobile, useLoadingState, useLocalStorage, useLongPress, useMediaQuery, useRememberedState, useScrollRestore, useSessionStorage, useViewport, useWakeLock, use_fullscreen, use_wake_lock };
|
package/dist/index.js
CHANGED
|
@@ -9019,7 +9019,13 @@ function KanbanCard({
|
|
|
9019
9019
|
transform,
|
|
9020
9020
|
transition,
|
|
9021
9021
|
isDragging
|
|
9022
|
-
} = useSortable({
|
|
9022
|
+
} = useSortable({
|
|
9023
|
+
id: item.id,
|
|
9024
|
+
// sectionKey rides along so a drop *onto a card* resolves to that card's
|
|
9025
|
+
// section, not just its column (kanban_column.tsx's section bands cover
|
|
9026
|
+
// the gaps between cards, but the cards themselves are the sortable).
|
|
9027
|
+
data: { columnKey: item.columnKey, sectionKey: item.sectionKey }
|
|
9028
|
+
});
|
|
9023
9029
|
const priority_var = item.priority ? `--hazo-kanban-priority-${String(item.priority).toLowerCase()}` : null;
|
|
9024
9030
|
const style = {
|
|
9025
9031
|
transform: CSS.Transform.toString(transform),
|
|
@@ -9079,6 +9085,20 @@ function KanbanCard({
|
|
|
9079
9085
|
}
|
|
9080
9086
|
);
|
|
9081
9087
|
}
|
|
9088
|
+
function section_droppable_id(column_key, section_key) {
|
|
9089
|
+
return `section:${column_key}::${section_key}`;
|
|
9090
|
+
}
|
|
9091
|
+
function group_items_by_section(items, sections) {
|
|
9092
|
+
const bySection = /* @__PURE__ */ new Map();
|
|
9093
|
+
for (const section of sections) bySection.set(section.key, []);
|
|
9094
|
+
const unmatched = [];
|
|
9095
|
+
for (const item of items) {
|
|
9096
|
+
const bucket = item.sectionKey != null ? bySection.get(item.sectionKey) : void 0;
|
|
9097
|
+
if (bucket) bucket.push(item);
|
|
9098
|
+
else unmatched.push(item);
|
|
9099
|
+
}
|
|
9100
|
+
return { bySection, unmatched };
|
|
9101
|
+
}
|
|
9082
9102
|
function KanbanColumn({
|
|
9083
9103
|
column,
|
|
9084
9104
|
items,
|
|
@@ -9092,6 +9112,37 @@ function KanbanColumn({
|
|
|
9092
9112
|
id: `column:${column.key}`,
|
|
9093
9113
|
data: { columnKey: column.key, isColumn: true }
|
|
9094
9114
|
});
|
|
9115
|
+
const sections = column.sections;
|
|
9116
|
+
const { bySection, unmatched } = React27.useMemo(
|
|
9117
|
+
() => sections ? group_items_by_section(items, sections) : { bySection: /* @__PURE__ */ new Map(), unmatched: items },
|
|
9118
|
+
[items, sections]
|
|
9119
|
+
);
|
|
9120
|
+
const ordered = React27.useMemo(() => {
|
|
9121
|
+
if (!sections) return items;
|
|
9122
|
+
const out = [];
|
|
9123
|
+
for (const section of sections) out.push(...bySection.get(section.key) ?? []);
|
|
9124
|
+
out.push(...unmatched);
|
|
9125
|
+
return out;
|
|
9126
|
+
}, [items, sections, bySection, unmatched]);
|
|
9127
|
+
function render_cards(list) {
|
|
9128
|
+
return list.map((item) => /* @__PURE__ */ jsx(
|
|
9129
|
+
KanbanCard,
|
|
9130
|
+
{
|
|
9131
|
+
item,
|
|
9132
|
+
renderCard,
|
|
9133
|
+
cardClassName,
|
|
9134
|
+
showEdit,
|
|
9135
|
+
onEditRequest
|
|
9136
|
+
},
|
|
9137
|
+
item.id
|
|
9138
|
+
));
|
|
9139
|
+
}
|
|
9140
|
+
const expanded_sections = (sections ?? []).filter(
|
|
9141
|
+
(s) => !(s.collapseWhenEmpty && (bySection.get(s.key) ?? []).length === 0)
|
|
9142
|
+
);
|
|
9143
|
+
const collapsed_sections = (sections ?? []).filter(
|
|
9144
|
+
(s) => s.collapseWhenEmpty && (bySection.get(s.key) ?? []).length === 0
|
|
9145
|
+
);
|
|
9095
9146
|
return /* @__PURE__ */ jsxs(
|
|
9096
9147
|
"div",
|
|
9097
9148
|
{
|
|
@@ -9101,32 +9152,125 @@ function KanbanColumn({
|
|
|
9101
9152
|
isOver && "cls_hazo_kanban_column_over bg-accent/30 ring-2 ring-ring/40"
|
|
9102
9153
|
),
|
|
9103
9154
|
children: [
|
|
9104
|
-
/* @__PURE__ */
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9155
|
+
/* @__PURE__ */ jsx(
|
|
9156
|
+
KanbanColumnHead,
|
|
9157
|
+
{
|
|
9158
|
+
columnKey: column.key,
|
|
9159
|
+
title: column.title,
|
|
9160
|
+
count: items.length,
|
|
9161
|
+
droppable: sections != null
|
|
9162
|
+
}
|
|
9163
|
+
),
|
|
9108
9164
|
/* @__PURE__ */ jsx(
|
|
9109
9165
|
SortableContext,
|
|
9110
9166
|
{
|
|
9111
|
-
items:
|
|
9167
|
+
items: ordered.map((i) => i.id),
|
|
9112
9168
|
strategy: verticalListSortingStrategy,
|
|
9113
|
-
children: /* @__PURE__ */ jsx("div", { className: "cls_hazo_kanban_column_body flex-1 min-h-[40px]", children: items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "cls_hazo_kanban_column_empty text-xs text-muted-foreground py-2 px-1", children: emptyColumn }) : items
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9169
|
+
children: /* @__PURE__ */ jsx("div", { className: "cls_hazo_kanban_column_body flex-1 min-h-[40px]", children: !sections ? items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "cls_hazo_kanban_column_empty text-xs text-muted-foreground py-2 px-1", children: emptyColumn }) : render_cards(items) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
9170
|
+
expanded_sections.map((section) => /* @__PURE__ */ jsx(
|
|
9171
|
+
KanbanSectionBand,
|
|
9172
|
+
{
|
|
9173
|
+
columnKey: column.key,
|
|
9174
|
+
section,
|
|
9175
|
+
items: bySection.get(section.key) ?? [],
|
|
9176
|
+
emptyColumn,
|
|
9177
|
+
renderCards: render_cards
|
|
9178
|
+
},
|
|
9179
|
+
section.key
|
|
9180
|
+
)),
|
|
9181
|
+
unmatched.length > 0 && /* @__PURE__ */ jsx("div", { className: "cls_hazo_kanban_section cls_hazo_kanban_section_unmatched", children: render_cards(unmatched) }),
|
|
9182
|
+
collapsed_sections.length > 0 && /* @__PURE__ */ jsx("div", { className: "cls_hazo_kanban_section_strips mt-2 flex flex-wrap gap-1 border-t border-dashed border-border pt-2", children: collapsed_sections.map((section) => /* @__PURE__ */ jsx(
|
|
9183
|
+
KanbanSectionStrip,
|
|
9184
|
+
{
|
|
9185
|
+
columnKey: column.key,
|
|
9186
|
+
section
|
|
9187
|
+
},
|
|
9188
|
+
section.key
|
|
9189
|
+
)) })
|
|
9190
|
+
] }) })
|
|
9124
9191
|
}
|
|
9125
9192
|
)
|
|
9126
9193
|
]
|
|
9127
9194
|
}
|
|
9128
9195
|
);
|
|
9129
9196
|
}
|
|
9197
|
+
function KanbanColumnHead({
|
|
9198
|
+
columnKey,
|
|
9199
|
+
title,
|
|
9200
|
+
count,
|
|
9201
|
+
droppable
|
|
9202
|
+
}) {
|
|
9203
|
+
const { setNodeRef, isOver } = useDroppable({
|
|
9204
|
+
id: `columnhead:${columnKey}`,
|
|
9205
|
+
data: { columnKey, isColumn: true },
|
|
9206
|
+
disabled: !droppable
|
|
9207
|
+
});
|
|
9208
|
+
return /* @__PURE__ */ jsxs(
|
|
9209
|
+
"div",
|
|
9210
|
+
{
|
|
9211
|
+
ref: droppable ? setNodeRef : void 0,
|
|
9212
|
+
className: cn(
|
|
9213
|
+
"cls_hazo_kanban_column_head mb-2 flex items-center justify-between rounded-sm px-1 text-xs uppercase tracking-wider text-muted-foreground",
|
|
9214
|
+
droppable && "py-1",
|
|
9215
|
+
isOver && "cls_hazo_kanban_column_head_over bg-accent/30 text-foreground ring-1 ring-ring/40"
|
|
9216
|
+
),
|
|
9217
|
+
children: [
|
|
9218
|
+
/* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_column_title", children: title }),
|
|
9219
|
+
/* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_column_count rounded-full bg-muted px-2 py-0.5 text-foreground", children: count })
|
|
9220
|
+
]
|
|
9221
|
+
}
|
|
9222
|
+
);
|
|
9223
|
+
}
|
|
9224
|
+
function KanbanSectionBand({
|
|
9225
|
+
columnKey,
|
|
9226
|
+
section,
|
|
9227
|
+
items,
|
|
9228
|
+
emptyColumn,
|
|
9229
|
+
renderCards
|
|
9230
|
+
}) {
|
|
9231
|
+
const { setNodeRef, isOver } = useDroppable({
|
|
9232
|
+
id: section_droppable_id(columnKey, section.key),
|
|
9233
|
+
data: { columnKey, sectionKey: section.key, isSection: true }
|
|
9234
|
+
});
|
|
9235
|
+
return /* @__PURE__ */ jsxs(
|
|
9236
|
+
"div",
|
|
9237
|
+
{
|
|
9238
|
+
ref: setNodeRef,
|
|
9239
|
+
className: cn(
|
|
9240
|
+
"cls_hazo_kanban_section rounded-sm",
|
|
9241
|
+
isOver && "cls_hazo_kanban_section_over bg-accent/20 ring-1 ring-ring/30"
|
|
9242
|
+
),
|
|
9243
|
+
children: [
|
|
9244
|
+
/* @__PURE__ */ jsxs("div", { className: "cls_hazo_kanban_section_head mt-2 mb-1 flex items-center gap-2 px-1 first:mt-0", children: [
|
|
9245
|
+
/* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_section_title text-[11px] font-medium uppercase tracking-wider text-muted-foreground", children: section.title }),
|
|
9246
|
+
/* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_section_rule h-px flex-1 bg-border" }),
|
|
9247
|
+
/* @__PURE__ */ jsx("span", { className: "cls_hazo_kanban_section_count text-[11px] tabular-nums text-muted-foreground", children: items.length })
|
|
9248
|
+
] }),
|
|
9249
|
+
/* @__PURE__ */ jsx("div", { className: "cls_hazo_kanban_section_body min-h-[32px]", children: items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "cls_hazo_kanban_section_empty px-1 py-1 text-xs text-muted-foreground", children: emptyColumn }) : renderCards(items) })
|
|
9250
|
+
]
|
|
9251
|
+
}
|
|
9252
|
+
);
|
|
9253
|
+
}
|
|
9254
|
+
function KanbanSectionStrip({
|
|
9255
|
+
columnKey,
|
|
9256
|
+
section
|
|
9257
|
+
}) {
|
|
9258
|
+
const { setNodeRef, isOver } = useDroppable({
|
|
9259
|
+
id: section_droppable_id(columnKey, section.key),
|
|
9260
|
+
data: { columnKey, sectionKey: section.key, isSection: true }
|
|
9261
|
+
});
|
|
9262
|
+
return /* @__PURE__ */ jsx(
|
|
9263
|
+
"div",
|
|
9264
|
+
{
|
|
9265
|
+
ref: setNodeRef,
|
|
9266
|
+
className: cn(
|
|
9267
|
+
"cls_hazo_kanban_section_strip rounded-full border border-dashed border-border px-2 py-0.5 text-[11px] text-muted-foreground",
|
|
9268
|
+
isOver && "cls_hazo_kanban_section_strip_over border-solid bg-accent/30 text-foreground ring-1 ring-ring/30"
|
|
9269
|
+
),
|
|
9270
|
+
children: section.title
|
|
9271
|
+
}
|
|
9272
|
+
);
|
|
9273
|
+
}
|
|
9130
9274
|
var DEFAULT_PRIORITIES = ["P0", "P1", "P2", "P3"];
|
|
9131
9275
|
function humanize(key) {
|
|
9132
9276
|
return key.replace(/[_\-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().split(" ").map((w) => w ? w[0].toUpperCase() + w.slice(1) : w).join(" ");
|
|
@@ -9551,7 +9695,8 @@ function group_items_by_column(items, overlay, columns) {
|
|
|
9551
9695
|
if (ov) {
|
|
9552
9696
|
const bucket = overlay_inserts.get(ov.columnKey);
|
|
9553
9697
|
if (bucket) {
|
|
9554
|
-
|
|
9698
|
+
const placed = ov.sectionKey === item.sectionKey ? item : { ...item, sectionKey: ov.sectionKey };
|
|
9699
|
+
bucket.push({ item: placed, index: ov.index });
|
|
9555
9700
|
}
|
|
9556
9701
|
} else {
|
|
9557
9702
|
const bucket = out.get(item.columnKey);
|
|
@@ -9619,7 +9764,7 @@ function HazoUiKanban({
|
|
|
9619
9764
|
const next = new Map(prev);
|
|
9620
9765
|
for (const [item_id, pos] of prev.entries()) {
|
|
9621
9766
|
const item = items.find((i) => i.id === item_id);
|
|
9622
|
-
if (item && item.columnKey === pos.columnKey) {
|
|
9767
|
+
if (item && item.columnKey === pos.columnKey && item.sectionKey === pos.sectionKey) {
|
|
9623
9768
|
next.delete(item_id);
|
|
9624
9769
|
changed = true;
|
|
9625
9770
|
}
|
|
@@ -9685,7 +9830,8 @@ function HazoUiKanban({
|
|
|
9685
9830
|
const over_col_key = over ? over.data?.current?.columnKey ?? String(over.id).replace(/^column:/, "") : null;
|
|
9686
9831
|
const to_col = over_col_key ? columns.find((c) => c.key === over_col_key) ?? from_col : from_col;
|
|
9687
9832
|
const target = over_col_key ? grouped.get(over_col_key) ?? [] : grouped.get(item.columnKey) ?? [];
|
|
9688
|
-
const
|
|
9833
|
+
const on_shell = !over || String(over.id).startsWith("column:") || String(over.id).startsWith("columnhead:") || String(over.id).startsWith("section:");
|
|
9834
|
+
const new_index = on_shell ? target.length : target.findIndex((it) => it.id === String(over.id));
|
|
9689
9835
|
return merged_announcements.onDragEnd({
|
|
9690
9836
|
item,
|
|
9691
9837
|
fromColumn: from_col?.title ?? item.columnKey,
|
|
@@ -9734,22 +9880,28 @@ function HazoUiKanban({
|
|
|
9734
9880
|
const dest_column_key = over_data?.columnKey ?? over_id.replace(/^column:/, "");
|
|
9735
9881
|
const dest_column = columns.find((c) => c.key === dest_column_key);
|
|
9736
9882
|
if (!dest_column) return;
|
|
9883
|
+
const dest_section_key = dest_column.sections ? over_data?.sectionKey ?? item.sectionKey : void 0;
|
|
9884
|
+
const dest_section = dest_column.sections?.find(
|
|
9885
|
+
(s) => s.key === dest_section_key
|
|
9886
|
+
);
|
|
9737
9887
|
if (dest_column.accepts && !dest_column.accepts(item)) return;
|
|
9888
|
+
if (dest_section?.accepts && !dest_section.accepts(item)) return;
|
|
9738
9889
|
const dest_items_pre_overlay = grouped.get(dest_column_key) ?? [];
|
|
9739
9890
|
let new_index;
|
|
9740
|
-
if (over_data?.isColumn) {
|
|
9891
|
+
if (over_data?.isColumn || over_data?.isSection) {
|
|
9741
9892
|
new_index = dest_items_pre_overlay.length;
|
|
9742
9893
|
} else {
|
|
9743
9894
|
const idx = dest_items_pre_overlay.findIndex((i) => i.id === over_id);
|
|
9744
9895
|
new_index = idx === -1 ? dest_items_pre_overlay.length : idx;
|
|
9745
9896
|
}
|
|
9746
9897
|
const handle = make_revert_handle(active_id_str);
|
|
9747
|
-
if (item.columnKey === dest_column_key) {
|
|
9898
|
+
if (item.columnKey === dest_column_key && item.sectionKey === dest_section_key) {
|
|
9748
9899
|
if (active_id_str === over_id) return;
|
|
9749
9900
|
set_overlay((prev) => {
|
|
9750
9901
|
const next = new Map(prev);
|
|
9751
9902
|
next.set(active_id_str, {
|
|
9752
9903
|
columnKey: dest_column_key,
|
|
9904
|
+
sectionKey: dest_section_key,
|
|
9753
9905
|
index: new_index
|
|
9754
9906
|
});
|
|
9755
9907
|
return next;
|
|
@@ -9758,6 +9910,7 @@ function HazoUiKanban({
|
|
|
9758
9910
|
itemId: active_id_str,
|
|
9759
9911
|
item,
|
|
9760
9912
|
columnKey: dest_column_key,
|
|
9913
|
+
sectionKey: dest_section_key,
|
|
9761
9914
|
newIndex: new_index,
|
|
9762
9915
|
revert: handle.revert
|
|
9763
9916
|
};
|
|
@@ -9768,6 +9921,7 @@ function HazoUiKanban({
|
|
|
9768
9921
|
const next = new Map(prev);
|
|
9769
9922
|
next.set(active_id_str, {
|
|
9770
9923
|
columnKey: dest_column_key,
|
|
9924
|
+
sectionKey: dest_section_key,
|
|
9771
9925
|
index: new_index
|
|
9772
9926
|
});
|
|
9773
9927
|
return next;
|
|
@@ -9777,6 +9931,8 @@ function HazoUiKanban({
|
|
|
9777
9931
|
item,
|
|
9778
9932
|
fromColumn: item.columnKey,
|
|
9779
9933
|
toColumn: dest_column_key,
|
|
9934
|
+
fromSection: item.sectionKey,
|
|
9935
|
+
toSection: dest_section_key,
|
|
9780
9936
|
newIndex: new_index,
|
|
9781
9937
|
revert: handle.revert
|
|
9782
9938
|
};
|