@inf-monkeys-tech/monkeys-design 0.4.32 → 0.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/base/index.d.mts +2 -2
- package/dist/components/base/index.d.ts +2 -2
- package/dist/components/base/index.js +545 -26
- package/dist/components/base/index.js.map +1 -1
- package/dist/components/base/index.mjs +543 -28
- package/dist/components/base/index.mjs.map +1 -1
- package/dist/components/workbench/index.d.mts +193 -2
- package/dist/components/workbench/index.d.ts +193 -2
- package/dist/components/workbench/index.js +1157 -20
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +1134 -22
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1382 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1375 -39
- package/dist/index.mjs.map +1 -1
- package/dist/{theme-CvbotXXr.d.ts → theme-CoG9vCPT.d.mts} +8 -3
- package/dist/{theme-6RDum855.d.mts → theme-Cuy60thu.d.ts} +8 -3
- package/dist/theme-system/index.d.mts +1 -1
- package/dist/theme-system/index.d.ts +1 -1
- package/dist/theme-system/index.js +398 -16
- package/dist/theme-system/index.js.map +1 -1
- package/dist/theme-system/index.mjs +399 -17
- package/dist/theme-system/index.mjs.map +1 -1
- package/dist/{types-BgEEUqSm.d.mts → types-CZALgtez.d.mts} +121 -1
- package/dist/{types-BgEEUqSm.d.ts → types-CZALgtez.d.ts} +121 -1
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { b as BaseAccordionProps, e as BaseAvatarProps, h as BaseBadgeProps, l as BaseBreadcrumbProps, n as BaseButtonProps, p as BaseCheckboxProps, z as BaseContextMenuProps, s as BaseContextMenuCheckboxItemProps, v as BaseContextMenuContentProps, x as BaseContextMenuItemProps, y as BaseContextMenuLabelProps, A as BaseContextMenuRadioGroupProps, C as BaseContextMenuRadioItemProps, D as BaseContextMenuSeparatorProps, F as BaseContextMenuSubProps, E as BaseContextMenuSubContentProps, G as BaseContextMenuSubTriggerProps, H as BaseContextMenuTriggerProps, L as BaseDescriptionListProps, N as BaseDialogProps, P as BaseDividerProps, T as BaseDropdownMenuProps, U as BaseEmptyStateProps, W as BaseFieldProps, X as BaseInputProps,
|
|
2
|
+
import { b as BaseAccordionProps, e as BaseAvatarProps, h as BaseBadgeProps, l as BaseBreadcrumbProps, n as BaseButtonProps, p as BaseCheckboxProps, z as BaseContextMenuProps, s as BaseContextMenuCheckboxItemProps, v as BaseContextMenuContentProps, x as BaseContextMenuItemProps, y as BaseContextMenuLabelProps, A as BaseContextMenuRadioGroupProps, C as BaseContextMenuRadioItemProps, D as BaseContextMenuSeparatorProps, F as BaseContextMenuSubProps, E as BaseContextMenuSubContentProps, G as BaseContextMenuSubTriggerProps, H as BaseContextMenuTriggerProps, L as BaseDescriptionListProps, N as BaseDialogProps, P as BaseDividerProps, T as BaseDropdownMenuProps, U as BaseEmptyStateProps, W as BaseFieldProps, X as BaseInputProps, a2 as BaseLayoutProps, a0 as BaseLayoutPaneProps, a4 as BaseLayoutResizeHandleProps, a7 as BaseLayoutSplitProps, a8 as BaseLoadingStateProps, aa as BaseNoticeProps, ac as BasePanelProps, ae as BasePaginationProps, ag as BaseProgressProps, aj as BaseRadioGroupProps, ap as BaseSelectProps, an as BaseSectionHeaderProps, as as BaseSegmentedControlProps, au as BaseSkeletonProps, ax as BaseSwitchProps, aV as BaseTableProps, az as BaseTableBodyProps, aB as BaseTableCaptionProps, aD as BaseTableCellProps, aK as BaseTableContainerProps, aM as BaseTableEmptyProps, aP as BaseTableFooterProps, aS as BaseTableHeadProps, aQ as BaseTableHeaderProps, aU as BaseTableLoadingProps, aX as BaseTableRowProps, aO as BaseTableFooterBarProps, b0 as BaseTabsProps, b1 as BaseTextareaProps, b4 as BaseTooltipProps, b6 as BaseToolbarProps, al as BaseResolvedTheme, r as BaseControlTone, c as BaseAppearance } from './types-CZALgtez.mjs';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
declare function BaseAccordion({ items, value, defaultValue, allowCollapse, appearance, className, classNames, style, onValueChange, id, ...accordionProps }: BaseAccordionProps): react_jsx_runtime.JSX.Element;
|
|
@@ -41,6 +41,11 @@ declare function BaseField({ label, description, message, error, required, disab
|
|
|
41
41
|
|
|
42
42
|
declare const BaseInput: React.ForwardRefExoticComponent<BaseInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
43
43
|
|
|
44
|
+
declare function BaseLayout({ header, sidebar, aside, footer, children, sidebarSize, asideSize, gap, fullHeight, appearance, className, classNames, style, ...layoutProps }: BaseLayoutProps): react_jsx_runtime.JSX.Element;
|
|
45
|
+
declare function BaseLayoutPane({ as, scrollable, bordered, surface, children, appearance, className, classNames, style, ...paneProps }: BaseLayoutPaneProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
declare function BaseLayoutResizeHandle({ orientation, resizable, disabled, size, minSize, maxSize, label, appearance, className, classNames, style, tabIndex, ...handleProps }: BaseLayoutResizeHandleProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare function BaseLayoutSplit({ orientation, primary, secondary, children, resizable, size, defaultSize, minSize, maxSize, gap, keyboardStep, resizeLabel, appearance, className, classNames, style, onSizeChange, ...splitProps }: BaseLayoutSplitProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
44
49
|
declare function BaseLoadingState({ icon, title, description, actions, appearance, className, classNames, style, ...stateProps }: BaseLoadingStateProps): react_jsx_runtime.JSX.Element;
|
|
45
50
|
|
|
46
51
|
declare function BaseNotice({ tone, icon, title, description, actions, children, appearance, className, classNames, style, ...noticeProps }: BaseNoticeProps): react_jsx_runtime.JSX.Element;
|
|
@@ -69,7 +74,7 @@ declare function BaseTableHeader({ appearance, className, classNames, style, ...
|
|
|
69
74
|
declare function BaseTableBody({ appearance, className, classNames, style, ...bodyProps }: BaseTableBodyProps): react_jsx_runtime.JSX.Element;
|
|
70
75
|
declare function BaseTableFooter({ appearance, className, classNames, style, ...footerProps }: BaseTableFooterProps): react_jsx_runtime.JSX.Element;
|
|
71
76
|
declare function BaseTableRow({ interactive, selected, disabled, appearance, className, classNames, style, ...rowProps }: BaseTableRowProps): react_jsx_runtime.JSX.Element;
|
|
72
|
-
declare
|
|
77
|
+
declare const BaseTableHead: React.ForwardRefExoticComponent<BaseTableHeadProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
73
78
|
declare function BaseTableCell({ align, appearance, className, classNames, style, ...cellProps }: BaseTableCellProps): react_jsx_runtime.JSX.Element;
|
|
74
79
|
declare function BaseTableCaption({ appearance, className, classNames, style, ...captionProps }: BaseTableCaptionProps): react_jsx_runtime.JSX.Element;
|
|
75
80
|
declare function BaseTableEmpty({ colSpan, icon, title, description, actions, children, appearance, className, classNames, style, ...emptyProps }: BaseTableEmptyProps): react_jsx_runtime.JSX.Element;
|
|
@@ -91,4 +96,4 @@ declare function getBaseBadgeToneClassName(theme: BaseResolvedTheme, tone?: Base
|
|
|
91
96
|
declare function getBaseNoticeToneClassName(theme: BaseResolvedTheme, tone?: BaseControlTone): string;
|
|
92
97
|
declare function getBaseMenuItemToneClassName(theme: BaseResolvedTheme, tone?: BaseControlTone): string;
|
|
93
98
|
|
|
94
|
-
export {
|
|
99
|
+
export { BaseTextarea as $, BaseLayoutResizeHandle as A, BaseAccordion as B, BaseLayoutSplit as C, BaseLoadingState as D, BaseNotice as E, BasePanel as F, BasePagination as G, BaseProgress as H, BaseRadioGroup as I, BaseSelect as J, BaseSectionHeader as K, BaseSegmentedControl as L, BaseSkeleton as M, BaseSwitch as N, BaseTable as O, BaseTableBody as P, BaseTableCaption as Q, BaseTableCell as R, BaseTableContainer as S, BaseTableEmpty as T, BaseTableFooter as U, BaseTableFooterBar as V, BaseTableHead as W, BaseTableHeader as X, BaseTableLoading as Y, BaseTableRow as Z, BaseTabs as _, BaseAvatar as a, BaseTooltip as a0, BaseToolbar as a1, getBaseBadgeToneClassName as a2, getBaseButtonToneClassName as a3, getBaseMenuItemToneClassName as a4, getBaseNoticeToneClassName as a5, resolveBaseAppearance as a6, BaseBadge as b, BaseBreadcrumb as c, BaseButton as d, BaseCheckbox as e, BaseContextMenu as f, BaseContextMenuCheckboxItem as g, BaseContextMenuContent as h, BaseContextMenuItem as i, BaseContextMenuLabel as j, BaseContextMenuRadioGroup as k, BaseContextMenuRadioItem as l, BaseContextMenuSeparator as m, BaseContextMenuSub as n, BaseContextMenuSubContent as o, BaseContextMenuSubTrigger as p, BaseContextMenuTrigger as q, BaseDescriptionList as r, BaseDialog as s, BaseDivider as t, BaseDropdownMenu as u, BaseEmptyState as v, BaseField as w, BaseInput as x, BaseLayout as y, BaseLayoutPane as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { b as BaseAccordionProps, e as BaseAvatarProps, h as BaseBadgeProps, l as BaseBreadcrumbProps, n as BaseButtonProps, p as BaseCheckboxProps, z as BaseContextMenuProps, s as BaseContextMenuCheckboxItemProps, v as BaseContextMenuContentProps, x as BaseContextMenuItemProps, y as BaseContextMenuLabelProps, A as BaseContextMenuRadioGroupProps, C as BaseContextMenuRadioItemProps, D as BaseContextMenuSeparatorProps, F as BaseContextMenuSubProps, E as BaseContextMenuSubContentProps, G as BaseContextMenuSubTriggerProps, H as BaseContextMenuTriggerProps, L as BaseDescriptionListProps, N as BaseDialogProps, P as BaseDividerProps, T as BaseDropdownMenuProps, U as BaseEmptyStateProps, W as BaseFieldProps, X as BaseInputProps,
|
|
2
|
+
import { b as BaseAccordionProps, e as BaseAvatarProps, h as BaseBadgeProps, l as BaseBreadcrumbProps, n as BaseButtonProps, p as BaseCheckboxProps, z as BaseContextMenuProps, s as BaseContextMenuCheckboxItemProps, v as BaseContextMenuContentProps, x as BaseContextMenuItemProps, y as BaseContextMenuLabelProps, A as BaseContextMenuRadioGroupProps, C as BaseContextMenuRadioItemProps, D as BaseContextMenuSeparatorProps, F as BaseContextMenuSubProps, E as BaseContextMenuSubContentProps, G as BaseContextMenuSubTriggerProps, H as BaseContextMenuTriggerProps, L as BaseDescriptionListProps, N as BaseDialogProps, P as BaseDividerProps, T as BaseDropdownMenuProps, U as BaseEmptyStateProps, W as BaseFieldProps, X as BaseInputProps, a2 as BaseLayoutProps, a0 as BaseLayoutPaneProps, a4 as BaseLayoutResizeHandleProps, a7 as BaseLayoutSplitProps, a8 as BaseLoadingStateProps, aa as BaseNoticeProps, ac as BasePanelProps, ae as BasePaginationProps, ag as BaseProgressProps, aj as BaseRadioGroupProps, ap as BaseSelectProps, an as BaseSectionHeaderProps, as as BaseSegmentedControlProps, au as BaseSkeletonProps, ax as BaseSwitchProps, aV as BaseTableProps, az as BaseTableBodyProps, aB as BaseTableCaptionProps, aD as BaseTableCellProps, aK as BaseTableContainerProps, aM as BaseTableEmptyProps, aP as BaseTableFooterProps, aS as BaseTableHeadProps, aQ as BaseTableHeaderProps, aU as BaseTableLoadingProps, aX as BaseTableRowProps, aO as BaseTableFooterBarProps, b0 as BaseTabsProps, b1 as BaseTextareaProps, b4 as BaseTooltipProps, b6 as BaseToolbarProps, al as BaseResolvedTheme, r as BaseControlTone, c as BaseAppearance } from './types-CZALgtez.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
declare function BaseAccordion({ items, value, defaultValue, allowCollapse, appearance, className, classNames, style, onValueChange, id, ...accordionProps }: BaseAccordionProps): react_jsx_runtime.JSX.Element;
|
|
@@ -41,6 +41,11 @@ declare function BaseField({ label, description, message, error, required, disab
|
|
|
41
41
|
|
|
42
42
|
declare const BaseInput: React.ForwardRefExoticComponent<BaseInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
43
43
|
|
|
44
|
+
declare function BaseLayout({ header, sidebar, aside, footer, children, sidebarSize, asideSize, gap, fullHeight, appearance, className, classNames, style, ...layoutProps }: BaseLayoutProps): react_jsx_runtime.JSX.Element;
|
|
45
|
+
declare function BaseLayoutPane({ as, scrollable, bordered, surface, children, appearance, className, classNames, style, ...paneProps }: BaseLayoutPaneProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
declare function BaseLayoutResizeHandle({ orientation, resizable, disabled, size, minSize, maxSize, label, appearance, className, classNames, style, tabIndex, ...handleProps }: BaseLayoutResizeHandleProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare function BaseLayoutSplit({ orientation, primary, secondary, children, resizable, size, defaultSize, minSize, maxSize, gap, keyboardStep, resizeLabel, appearance, className, classNames, style, onSizeChange, ...splitProps }: BaseLayoutSplitProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
44
49
|
declare function BaseLoadingState({ icon, title, description, actions, appearance, className, classNames, style, ...stateProps }: BaseLoadingStateProps): react_jsx_runtime.JSX.Element;
|
|
45
50
|
|
|
46
51
|
declare function BaseNotice({ tone, icon, title, description, actions, children, appearance, className, classNames, style, ...noticeProps }: BaseNoticeProps): react_jsx_runtime.JSX.Element;
|
|
@@ -69,7 +74,7 @@ declare function BaseTableHeader({ appearance, className, classNames, style, ...
|
|
|
69
74
|
declare function BaseTableBody({ appearance, className, classNames, style, ...bodyProps }: BaseTableBodyProps): react_jsx_runtime.JSX.Element;
|
|
70
75
|
declare function BaseTableFooter({ appearance, className, classNames, style, ...footerProps }: BaseTableFooterProps): react_jsx_runtime.JSX.Element;
|
|
71
76
|
declare function BaseTableRow({ interactive, selected, disabled, appearance, className, classNames, style, ...rowProps }: BaseTableRowProps): react_jsx_runtime.JSX.Element;
|
|
72
|
-
declare
|
|
77
|
+
declare const BaseTableHead: React.ForwardRefExoticComponent<BaseTableHeadProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
73
78
|
declare function BaseTableCell({ align, appearance, className, classNames, style, ...cellProps }: BaseTableCellProps): react_jsx_runtime.JSX.Element;
|
|
74
79
|
declare function BaseTableCaption({ appearance, className, classNames, style, ...captionProps }: BaseTableCaptionProps): react_jsx_runtime.JSX.Element;
|
|
75
80
|
declare function BaseTableEmpty({ colSpan, icon, title, description, actions, children, appearance, className, classNames, style, ...emptyProps }: BaseTableEmptyProps): react_jsx_runtime.JSX.Element;
|
|
@@ -91,4 +96,4 @@ declare function getBaseBadgeToneClassName(theme: BaseResolvedTheme, tone?: Base
|
|
|
91
96
|
declare function getBaseNoticeToneClassName(theme: BaseResolvedTheme, tone?: BaseControlTone): string;
|
|
92
97
|
declare function getBaseMenuItemToneClassName(theme: BaseResolvedTheme, tone?: BaseControlTone): string;
|
|
93
98
|
|
|
94
|
-
export {
|
|
99
|
+
export { BaseTextarea as $, BaseLayoutResizeHandle as A, BaseAccordion as B, BaseLayoutSplit as C, BaseLoadingState as D, BaseNotice as E, BasePanel as F, BasePagination as G, BaseProgress as H, BaseRadioGroup as I, BaseSelect as J, BaseSectionHeader as K, BaseSegmentedControl as L, BaseSkeleton as M, BaseSwitch as N, BaseTable as O, BaseTableBody as P, BaseTableCaption as Q, BaseTableCell as R, BaseTableContainer as S, BaseTableEmpty as T, BaseTableFooter as U, BaseTableFooterBar as V, BaseTableHead as W, BaseTableHeader as X, BaseTableLoading as Y, BaseTableRow as Z, BaseTabs as _, BaseAvatar as a, BaseTooltip as a0, BaseToolbar as a1, getBaseBadgeToneClassName as a2, getBaseButtonToneClassName as a3, getBaseMenuItemToneClassName as a4, getBaseNoticeToneClassName as a5, resolveBaseAppearance as a6, BaseBadge as b, BaseBreadcrumb as c, BaseButton as d, BaseCheckbox as e, BaseContextMenu as f, BaseContextMenuCheckboxItem as g, BaseContextMenuContent as h, BaseContextMenuItem as i, BaseContextMenuLabel as j, BaseContextMenuRadioGroup as k, BaseContextMenuRadioItem as l, BaseContextMenuSeparator as m, BaseContextMenuSub as n, BaseContextMenuSubContent as o, BaseContextMenuSubTrigger as p, BaseContextMenuTrigger as q, BaseDescriptionList as r, BaseDialog as s, BaseDivider as t, BaseDropdownMenu as u, BaseEmptyState as v, BaseField as w, BaseInput as x, BaseLayout as y, BaseLayoutPane as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as BaseAppearance,
|
|
1
|
+
import { c as BaseAppearance, al as BaseResolvedTheme } from '../types-CZALgtez.mjs';
|
|
2
2
|
import { c as DataExplorerAppearance, Y as DataExplorerResolvedTheme } from '../types-B81dpI1o.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@radix-ui/react-context-menu';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as BaseAppearance,
|
|
1
|
+
import { c as BaseAppearance, al as BaseResolvedTheme } from '../types-CZALgtez.js';
|
|
2
2
|
import { c as DataExplorerAppearance, Y as DataExplorerResolvedTheme } from '../types-B81dpI1o.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@radix-ui/react-context-menu';
|
|
@@ -8548,7 +8548,41 @@ var baseSlots = {
|
|
|
8548
8548
|
tableEmptyActions: "mt-4 flex flex-wrap items-center justify-center gap-2",
|
|
8549
8549
|
tableLoadingRow: "border-b border-border/60",
|
|
8550
8550
|
tableLoadingCell: "px-3 py-2",
|
|
8551
|
-
tableLoadingSkeleton: "h-4 w-full rounded-md bg-muted/70"
|
|
8551
|
+
tableLoadingSkeleton: "h-4 w-full rounded-md bg-muted/70",
|
|
8552
|
+
layoutRoot: cn(
|
|
8553
|
+
"grid min-w-0 overflow-hidden grid-rows-[auto_minmax(0,1fr)_auto] gap-3 rounded-lg border border-border/70 bg-background p-3 text-foreground",
|
|
8554
|
+
motionBase
|
|
8555
|
+
),
|
|
8556
|
+
layoutRootFull: "h-full min-h-0",
|
|
8557
|
+
layoutHeader: "min-w-0",
|
|
8558
|
+
layoutBody: "grid min-h-0 min-w-0 overflow-hidden gap-3",
|
|
8559
|
+
layoutSidebar: "min-h-0 min-w-0 overflow-hidden",
|
|
8560
|
+
layoutMain: "min-h-0 min-w-0 overflow-hidden",
|
|
8561
|
+
layoutAside: "min-h-0 min-w-0 overflow-hidden",
|
|
8562
|
+
layoutFooter: "min-w-0",
|
|
8563
|
+
layoutPane: cn(
|
|
8564
|
+
"h-full max-h-full min-h-0 min-w-0 overflow-hidden rounded-lg bg-background text-foreground",
|
|
8565
|
+
motionBase
|
|
8566
|
+
),
|
|
8567
|
+
layoutPaneScrollable: "overflow-auto",
|
|
8568
|
+
layoutPaneBordered: "border border-border/70",
|
|
8569
|
+
layoutPaneMuted: "bg-muted/25",
|
|
8570
|
+
layoutPaneSoft: "bg-background/95 shadow-sm",
|
|
8571
|
+
layoutPaneTransparent: "bg-transparent shadow-none",
|
|
8572
|
+
layoutSplitRoot: "grid min-h-0 min-w-0 overflow-hidden",
|
|
8573
|
+
layoutSplitHorizontal: "grid-flow-col",
|
|
8574
|
+
layoutSplitVertical: "grid-flow-row",
|
|
8575
|
+
layoutSplitPane: "min-h-0 min-w-0 overflow-hidden",
|
|
8576
|
+
layoutSplitPrimary: "",
|
|
8577
|
+
layoutSplitSecondary: "",
|
|
8578
|
+
layoutResizeHandle: cn(
|
|
8579
|
+
"group/resize relative z-10 flex shrink-0 items-center justify-center bg-transparent text-muted-foreground hover:bg-border/60 active:bg-border/70 focus-visible:bg-border/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",
|
|
8580
|
+
motionInteractive
|
|
8581
|
+
),
|
|
8582
|
+
layoutResizeHandleHorizontal: "w-2 cursor-col-resize",
|
|
8583
|
+
layoutResizeHandleVertical: "h-2 cursor-row-resize",
|
|
8584
|
+
layoutResizeHandleDisabled: "cursor-default opacity-60",
|
|
8585
|
+
layoutResizeHandleIndicator: "rounded-full bg-muted-foreground/45 group-hover/resize:bg-primary/70"
|
|
8552
8586
|
};
|
|
8553
8587
|
var densitySlots = {
|
|
8554
8588
|
compact: {
|
|
@@ -8622,7 +8656,12 @@ var densitySlots = {
|
|
|
8622
8656
|
tableCell: "px-2 py-1.5 text-xs",
|
|
8623
8657
|
tableHeadLabel: "text-[11px]",
|
|
8624
8658
|
tableHeadDescription: "text-[10px] leading-3",
|
|
8625
|
-
tableLoadingCell: "px-2 py-1.5"
|
|
8659
|
+
tableLoadingCell: "px-2 py-1.5",
|
|
8660
|
+
layoutRoot: "gap-2 p-2",
|
|
8661
|
+
layoutBody: "gap-2",
|
|
8662
|
+
layoutPane: "rounded-md text-xs",
|
|
8663
|
+
layoutResizeHandleHorizontal: "w-1.5",
|
|
8664
|
+
layoutResizeHandleVertical: "h-1.5"
|
|
8626
8665
|
},
|
|
8627
8666
|
default: {
|
|
8628
8667
|
buttonBase: "h-9"
|
|
@@ -8673,7 +8712,12 @@ var densitySlots = {
|
|
|
8673
8712
|
menuSubTrigger: "min-h-9 px-3 py-2",
|
|
8674
8713
|
tableHead: "h-12 px-4 py-3",
|
|
8675
8714
|
tableCell: "px-4 py-3",
|
|
8676
|
-
tableLoadingCell: "px-4 py-3"
|
|
8715
|
+
tableLoadingCell: "px-4 py-3",
|
|
8716
|
+
layoutRoot: "gap-4 p-4",
|
|
8717
|
+
layoutBody: "gap-4",
|
|
8718
|
+
layoutPane: "rounded-xl",
|
|
8719
|
+
layoutResizeHandleHorizontal: "w-2.5",
|
|
8720
|
+
layoutResizeHandleVertical: "h-2.5"
|
|
8677
8721
|
}
|
|
8678
8722
|
};
|
|
8679
8723
|
var radiusSlots = {
|
|
@@ -8717,7 +8761,9 @@ var radiusSlots = {
|
|
|
8717
8761
|
menuSubContent: "rounded-none",
|
|
8718
8762
|
tableContainer: "rounded-none",
|
|
8719
8763
|
tableEmptyIcon: "rounded-none",
|
|
8720
|
-
tableLoadingSkeleton: "rounded-none"
|
|
8764
|
+
tableLoadingSkeleton: "rounded-none",
|
|
8765
|
+
layoutRoot: "rounded-none",
|
|
8766
|
+
layoutPane: "rounded-none"
|
|
8721
8767
|
},
|
|
8722
8768
|
sm: {
|
|
8723
8769
|
buttonBase: "rounded-sm",
|
|
@@ -8759,7 +8805,9 @@ var radiusSlots = {
|
|
|
8759
8805
|
menuSubContent: "rounded-sm",
|
|
8760
8806
|
tableContainer: "rounded-sm",
|
|
8761
8807
|
tableEmptyIcon: "rounded-sm",
|
|
8762
|
-
tableLoadingSkeleton: "rounded-sm"
|
|
8808
|
+
tableLoadingSkeleton: "rounded-sm",
|
|
8809
|
+
layoutRoot: "rounded-sm",
|
|
8810
|
+
layoutPane: "rounded-sm"
|
|
8763
8811
|
},
|
|
8764
8812
|
md: {},
|
|
8765
8813
|
lg: {
|
|
@@ -8796,7 +8844,9 @@ var radiusSlots = {
|
|
|
8796
8844
|
menuSubContent: "rounded-lg",
|
|
8797
8845
|
tableContainer: "rounded-xl",
|
|
8798
8846
|
tableEmptyIcon: "rounded-xl",
|
|
8799
|
-
tableLoadingSkeleton: "rounded-lg"
|
|
8847
|
+
tableLoadingSkeleton: "rounded-lg",
|
|
8848
|
+
layoutRoot: "rounded-xl",
|
|
8849
|
+
layoutPane: "rounded-xl"
|
|
8800
8850
|
},
|
|
8801
8851
|
xl: {
|
|
8802
8852
|
buttonBase: "rounded-xl",
|
|
@@ -8834,7 +8884,9 @@ var radiusSlots = {
|
|
|
8834
8884
|
menuSubContent: "rounded-xl",
|
|
8835
8885
|
tableContainer: "rounded-2xl",
|
|
8836
8886
|
tableEmptyIcon: "rounded-2xl",
|
|
8837
|
-
tableLoadingSkeleton: "rounded-xl"
|
|
8887
|
+
tableLoadingSkeleton: "rounded-xl",
|
|
8888
|
+
layoutRoot: "rounded-2xl",
|
|
8889
|
+
layoutPane: "rounded-2xl"
|
|
8838
8890
|
},
|
|
8839
8891
|
full: {
|
|
8840
8892
|
buttonBase: "rounded-full",
|
|
@@ -8876,7 +8928,9 @@ var radiusSlots = {
|
|
|
8876
8928
|
menuSubContent: "rounded-2xl",
|
|
8877
8929
|
tableContainer: "rounded-2xl",
|
|
8878
8930
|
tableEmptyIcon: "rounded-full",
|
|
8879
|
-
tableLoadingSkeleton: "rounded-full"
|
|
8931
|
+
tableLoadingSkeleton: "rounded-full",
|
|
8932
|
+
layoutRoot: "rounded-2xl",
|
|
8933
|
+
layoutPane: "rounded-2xl"
|
|
8880
8934
|
}
|
|
8881
8935
|
};
|
|
8882
8936
|
var borderSlots = {
|
|
@@ -8918,7 +8972,10 @@ var borderSlots = {
|
|
|
8918
8972
|
tableFooterBarAttached: "border-t border-transparent",
|
|
8919
8973
|
tableRow: "border-transparent",
|
|
8920
8974
|
tableEmptyRow: "border-transparent",
|
|
8921
|
-
tableLoadingRow: "border-transparent"
|
|
8975
|
+
tableLoadingRow: "border-transparent",
|
|
8976
|
+
layoutRoot: "border-transparent",
|
|
8977
|
+
layoutPaneBordered: "border-transparent",
|
|
8978
|
+
layoutResizeHandle: "bg-transparent hover:bg-transparent active:bg-transparent focus-visible:bg-transparent"
|
|
8922
8979
|
},
|
|
8923
8980
|
subtle: {
|
|
8924
8981
|
buttonDefault: "border-border/60",
|
|
@@ -8958,7 +9015,9 @@ var borderSlots = {
|
|
|
8958
9015
|
tableFooterBarAttached: "border-t border-border/60",
|
|
8959
9016
|
tableRow: "border-border/50",
|
|
8960
9017
|
tableEmptyRow: "border-border/50",
|
|
8961
|
-
tableLoadingRow: "border-border/50"
|
|
9018
|
+
tableLoadingRow: "border-border/50",
|
|
9019
|
+
layoutRoot: "border-border/60",
|
|
9020
|
+
layoutPaneBordered: "border-border/60"
|
|
8962
9021
|
},
|
|
8963
9022
|
solid: {},
|
|
8964
9023
|
strong: {
|
|
@@ -8999,7 +9058,10 @@ var borderSlots = {
|
|
|
8999
9058
|
tableFooterBarAttached: "border-t border-foreground/20",
|
|
9000
9059
|
tableRow: "border-foreground/15",
|
|
9001
9060
|
tableEmptyRow: "border-foreground/15",
|
|
9002
|
-
tableLoadingRow: "border-foreground/15"
|
|
9061
|
+
tableLoadingRow: "border-foreground/15",
|
|
9062
|
+
layoutRoot: "border-foreground/20",
|
|
9063
|
+
layoutPaneBordered: "border-foreground/20",
|
|
9064
|
+
layoutResizeHandle: "hover:bg-foreground/15 active:bg-foreground/20 focus-visible:bg-foreground/15"
|
|
9003
9065
|
}
|
|
9004
9066
|
};
|
|
9005
9067
|
var backgroundSlots = {
|
|
@@ -9041,7 +9103,11 @@ var backgroundSlots = {
|
|
|
9041
9103
|
tableFooter: "bg-muted/35",
|
|
9042
9104
|
tableFooterBar: "bg-muted/30 shadow-none",
|
|
9043
9105
|
tableRowInteractive: "cursor-pointer hover:bg-muted/45",
|
|
9044
|
-
tableLoadingSkeleton: "bg-muted"
|
|
9106
|
+
tableLoadingSkeleton: "bg-muted",
|
|
9107
|
+
layoutRoot: "bg-card",
|
|
9108
|
+
layoutPane: "bg-card",
|
|
9109
|
+
layoutPaneMuted: "bg-muted/35",
|
|
9110
|
+
layoutResizeHandle: "hover:bg-border/70 active:bg-border/80 focus-visible:bg-border/70"
|
|
9045
9111
|
},
|
|
9046
9112
|
soft: {
|
|
9047
9113
|
buttonDefault: "bg-muted/30 hover:bg-muted/55",
|
|
@@ -9077,7 +9143,10 @@ var backgroundSlots = {
|
|
|
9077
9143
|
tableFooter: "bg-muted/25",
|
|
9078
9144
|
tableFooterBar: "bg-muted/25 shadow-none",
|
|
9079
9145
|
tableRowInteractive: "cursor-pointer hover:bg-muted/35",
|
|
9080
|
-
tableLoadingSkeleton: "bg-muted/65"
|
|
9146
|
+
tableLoadingSkeleton: "bg-muted/65",
|
|
9147
|
+
layoutRoot: "bg-background/95 shadow-sm",
|
|
9148
|
+
layoutPane: "bg-background/95 shadow-sm",
|
|
9149
|
+
layoutPaneSoft: "bg-background/95 shadow-md"
|
|
9081
9150
|
},
|
|
9082
9151
|
glass: {
|
|
9083
9152
|
buttonBase: "backdrop-blur-md",
|
|
@@ -9138,7 +9207,13 @@ var backgroundSlots = {
|
|
|
9138
9207
|
tableRow: "border-white/10",
|
|
9139
9208
|
tableRowInteractive: "cursor-pointer hover:bg-white/[0.08]",
|
|
9140
9209
|
tableHeadLabel: "text-foreground",
|
|
9141
|
-
tableLoadingSkeleton: "bg-white/[0.16]"
|
|
9210
|
+
tableLoadingSkeleton: "bg-white/[0.16]",
|
|
9211
|
+
layoutRoot: "border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",
|
|
9212
|
+
layoutPane: "border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",
|
|
9213
|
+
layoutPaneMuted: "bg-white/[0.08]",
|
|
9214
|
+
layoutPaneSoft: "bg-white/[0.10] shadow-none backdrop-blur-md",
|
|
9215
|
+
layoutResizeHandle: "text-foreground/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",
|
|
9216
|
+
layoutResizeHandleIndicator: "bg-white/45 group-hover/resize:bg-white/75"
|
|
9142
9217
|
},
|
|
9143
9218
|
dark: {
|
|
9144
9219
|
buttonBase: "border-white/15 text-white shadow-lg backdrop-blur",
|
|
@@ -9267,7 +9342,13 @@ var backgroundSlots = {
|
|
|
9267
9342
|
menuSubTrigger: "text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white data-[state=open]:bg-white/[0.12]",
|
|
9268
9343
|
menuSubTriggerIcon: "text-white/55",
|
|
9269
9344
|
menuSubContent: "border-white/10 bg-slate-950 text-white shadow-2xl",
|
|
9270
|
-
tableLoadingSkeleton: "bg-white/[0.14]"
|
|
9345
|
+
tableLoadingSkeleton: "bg-white/[0.14]",
|
|
9346
|
+
layoutRoot: "border-white/10 bg-slate-950 text-white shadow-none",
|
|
9347
|
+
layoutPane: "border-white/10 bg-slate-950 text-white shadow-none",
|
|
9348
|
+
layoutPaneMuted: "bg-white/[0.06]",
|
|
9349
|
+
layoutPaneSoft: "bg-white/[0.08] shadow-none",
|
|
9350
|
+
layoutResizeHandle: "text-white/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",
|
|
9351
|
+
layoutResizeHandleIndicator: "bg-white/45 group-hover/resize:bg-white/75"
|
|
9271
9352
|
}
|
|
9272
9353
|
};
|
|
9273
9354
|
var presetDefaults = {
|
|
@@ -10118,7 +10199,308 @@ react.forwardRef(
|
|
|
10118
10199
|
);
|
|
10119
10200
|
}
|
|
10120
10201
|
);
|
|
10121
|
-
|
|
10202
|
+
var DATA_TRANSFER_COLUMN_TYPE = "application/x-monkeys-base-table-column";
|
|
10203
|
+
var BaseTableContext = react.createContext(null);
|
|
10204
|
+
function useBaseTableContext(appearance) {
|
|
10205
|
+
const context = react.useContext(BaseTableContext);
|
|
10206
|
+
if (context) {
|
|
10207
|
+
return {
|
|
10208
|
+
...context,
|
|
10209
|
+
theme: appearance ? resolveBaseAppearance(appearance) : context.theme,
|
|
10210
|
+
appearance: appearance ?? context.appearance
|
|
10211
|
+
};
|
|
10212
|
+
}
|
|
10213
|
+
const theme = resolveBaseAppearance(appearance);
|
|
10214
|
+
return {
|
|
10215
|
+
appearance,
|
|
10216
|
+
theme,
|
|
10217
|
+
setDraggingColumnId: () => {
|
|
10218
|
+
}
|
|
10219
|
+
};
|
|
10220
|
+
}
|
|
10221
|
+
function toCssSize(value) {
|
|
10222
|
+
if (value === void 0) return void 0;
|
|
10223
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
10224
|
+
}
|
|
10225
|
+
function clampWidth(value, minWidth, maxWidth) {
|
|
10226
|
+
const min5 = minWidth ?? 48;
|
|
10227
|
+
const max5 = maxWidth ?? Number.POSITIVE_INFINITY;
|
|
10228
|
+
return Math.min(Math.max(value, min5), max5);
|
|
10229
|
+
}
|
|
10230
|
+
function getNextColumnOrder(order, columnId, targetColumnId) {
|
|
10231
|
+
if (!order || columnId === targetColumnId) return void 0;
|
|
10232
|
+
const fromIndex = order.indexOf(columnId);
|
|
10233
|
+
const toIndex = order.indexOf(targetColumnId);
|
|
10234
|
+
if (fromIndex < 0 || toIndex < 0) return void 0;
|
|
10235
|
+
const next = [...order];
|
|
10236
|
+
const [moved] = next.splice(fromIndex, 1);
|
|
10237
|
+
next.splice(toIndex, 0, moved);
|
|
10238
|
+
return next;
|
|
10239
|
+
}
|
|
10240
|
+
function sortAriaValue(direction) {
|
|
10241
|
+
switch (direction) {
|
|
10242
|
+
case "asc":
|
|
10243
|
+
return "ascending";
|
|
10244
|
+
case "desc":
|
|
10245
|
+
return "descending";
|
|
10246
|
+
default:
|
|
10247
|
+
return void 0;
|
|
10248
|
+
}
|
|
10249
|
+
}
|
|
10250
|
+
function SortIndicator({
|
|
10251
|
+
direction,
|
|
10252
|
+
className
|
|
10253
|
+
}) {
|
|
10254
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10255
|
+
"span",
|
|
10256
|
+
{
|
|
10257
|
+
"aria-hidden": "true",
|
|
10258
|
+
className: cn(
|
|
10259
|
+
className,
|
|
10260
|
+
direction === "desc" && "rotate-180",
|
|
10261
|
+
(!direction || direction === "none") && "opacity-45"
|
|
10262
|
+
),
|
|
10263
|
+
children: "\u25B2"
|
|
10264
|
+
}
|
|
10265
|
+
);
|
|
10266
|
+
}
|
|
10267
|
+
function DragHandleIcon() {
|
|
10268
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": "true", className: "grid gap-0.5", children: [
|
|
10269
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-0.5 w-0.5 rounded-full bg-current" }),
|
|
10270
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-0.5 w-0.5 rounded-full bg-current" }),
|
|
10271
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-0.5 w-0.5 rounded-full bg-current" })
|
|
10272
|
+
] });
|
|
10273
|
+
}
|
|
10274
|
+
react.forwardRef(function BaseTableHead2({
|
|
10275
|
+
columnId,
|
|
10276
|
+
align = "left",
|
|
10277
|
+
icon,
|
|
10278
|
+
label,
|
|
10279
|
+
description,
|
|
10280
|
+
meta,
|
|
10281
|
+
actions,
|
|
10282
|
+
trailing,
|
|
10283
|
+
sortable,
|
|
10284
|
+
sortDirection = "none",
|
|
10285
|
+
sortLabel,
|
|
10286
|
+
onSort,
|
|
10287
|
+
draggable,
|
|
10288
|
+
dragLabel,
|
|
10289
|
+
resizable,
|
|
10290
|
+
resizeLabel,
|
|
10291
|
+
width,
|
|
10292
|
+
minWidth,
|
|
10293
|
+
maxWidth,
|
|
10294
|
+
appearance,
|
|
10295
|
+
className,
|
|
10296
|
+
classNames,
|
|
10297
|
+
style,
|
|
10298
|
+
children,
|
|
10299
|
+
onDragOver,
|
|
10300
|
+
onDrop,
|
|
10301
|
+
...headProps
|
|
10302
|
+
}, forwardedRef) {
|
|
10303
|
+
const tableContext = useBaseTableContext(appearance);
|
|
10304
|
+
const { theme } = tableContext;
|
|
10305
|
+
const headRef = react.useRef(null);
|
|
10306
|
+
const setHeadRef = (node) => {
|
|
10307
|
+
headRef.current = node;
|
|
10308
|
+
if (typeof forwardedRef === "function") {
|
|
10309
|
+
forwardedRef(node);
|
|
10310
|
+
} else if (forwardedRef) {
|
|
10311
|
+
forwardedRef.current = node;
|
|
10312
|
+
}
|
|
10313
|
+
};
|
|
10314
|
+
const controlledWidth = columnId && tableContext.columnSizes?.[columnId] !== void 0 ? tableContext.columnSizes[columnId] : width;
|
|
10315
|
+
const canDrag = Boolean(
|
|
10316
|
+
columnId && draggable !== false && (draggable || tableContext.columnDragEnabled) && tableContext.columnOrder && tableContext.onColumnOrderChange
|
|
10317
|
+
);
|
|
10318
|
+
const canResize = Boolean(
|
|
10319
|
+
columnId && resizable !== false && (resizable || tableContext.columnResizeEnabled) && tableContext.onColumnSizeChange
|
|
10320
|
+
);
|
|
10321
|
+
const interactiveSort = Boolean(sortable || onSort);
|
|
10322
|
+
const ariaSort = sortAriaValue(sortDirection);
|
|
10323
|
+
const content = hasRenderableNode(label) ? label : children;
|
|
10324
|
+
const usesRichHeader = canDrag || hasRenderableNode(icon) || hasRenderableNode(label) || hasRenderableNode(description) || hasRenderableNode(meta) || hasRenderableNode(actions) || hasRenderableNode(trailing) || interactiveSort;
|
|
10325
|
+
const renderedContent = usesRichHeader ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(theme.slots.tableHeadContent, classNames?.content), children: [
|
|
10326
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(theme.slots.tableHeadMain, classNames?.main), children: [
|
|
10327
|
+
canDrag ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10328
|
+
"button",
|
|
10329
|
+
{
|
|
10330
|
+
type: "button",
|
|
10331
|
+
draggable: true,
|
|
10332
|
+
title: dragLabel,
|
|
10333
|
+
"aria-label": dragLabel ?? `Drag column ${columnId}`,
|
|
10334
|
+
className: cn(theme.slots.tableHeadDragHandle, classNames?.dragHandle),
|
|
10335
|
+
onClick: (event) => event.stopPropagation(),
|
|
10336
|
+
onDragStart: (event) => {
|
|
10337
|
+
event.stopPropagation();
|
|
10338
|
+
tableContext.setDraggingColumnId(columnId);
|
|
10339
|
+
event.dataTransfer.effectAllowed = "move";
|
|
10340
|
+
event.dataTransfer.setData(DATA_TRANSFER_COLUMN_TYPE, columnId);
|
|
10341
|
+
},
|
|
10342
|
+
onDragEnd: (event) => {
|
|
10343
|
+
event.stopPropagation();
|
|
10344
|
+
tableContext.setDraggingColumnId(void 0);
|
|
10345
|
+
},
|
|
10346
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(DragHandleIcon, {})
|
|
10347
|
+
}
|
|
10348
|
+
) : null,
|
|
10349
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(theme.slots.tableHeadIcon, classNames?.icon), children: icon }) : null,
|
|
10350
|
+
interactiveSort ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10351
|
+
"button",
|
|
10352
|
+
{
|
|
10353
|
+
type: "button",
|
|
10354
|
+
disabled: !onSort,
|
|
10355
|
+
title: sortLabel,
|
|
10356
|
+
className: cn(theme.slots.tableHeadSortButton, classNames?.sortButton),
|
|
10357
|
+
onClick: (event) => {
|
|
10358
|
+
event.stopPropagation();
|
|
10359
|
+
onSort?.(columnId);
|
|
10360
|
+
},
|
|
10361
|
+
children: [
|
|
10362
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(theme.slots.tableHeadText, classNames?.text), children: [
|
|
10363
|
+
hasRenderableNode(content) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(theme.slots.tableHeadLabel, classNames?.label), children: content }) : null,
|
|
10364
|
+
hasRenderableNode(description) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10365
|
+
"span",
|
|
10366
|
+
{
|
|
10367
|
+
className: cn(
|
|
10368
|
+
theme.slots.tableHeadDescription,
|
|
10369
|
+
classNames?.description
|
|
10370
|
+
),
|
|
10371
|
+
children: description
|
|
10372
|
+
}
|
|
10373
|
+
) : null
|
|
10374
|
+
] }),
|
|
10375
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10376
|
+
SortIndicator,
|
|
10377
|
+
{
|
|
10378
|
+
direction: sortDirection,
|
|
10379
|
+
className: cn(theme.slots.tableHeadSortIcon, classNames?.sortIcon)
|
|
10380
|
+
}
|
|
10381
|
+
)
|
|
10382
|
+
]
|
|
10383
|
+
}
|
|
10384
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(theme.slots.tableHeadText, classNames?.text), children: [
|
|
10385
|
+
hasRenderableNode(content) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(theme.slots.tableHeadLabel, classNames?.label), children: content }) : null,
|
|
10386
|
+
hasRenderableNode(description) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10387
|
+
"span",
|
|
10388
|
+
{
|
|
10389
|
+
className: cn(
|
|
10390
|
+
theme.slots.tableHeadDescription,
|
|
10391
|
+
classNames?.description
|
|
10392
|
+
),
|
|
10393
|
+
children: description
|
|
10394
|
+
}
|
|
10395
|
+
) : null
|
|
10396
|
+
] })
|
|
10397
|
+
] }),
|
|
10398
|
+
hasRenderableNode(meta) || hasRenderableNode(actions) || hasRenderableNode(trailing) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(theme.slots.tableHeadActions, classNames?.actions), children: [
|
|
10399
|
+
hasRenderableNode(meta) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(theme.slots.tableHeadMeta, classNames?.meta), children: meta }) : null,
|
|
10400
|
+
actions,
|
|
10401
|
+
trailing
|
|
10402
|
+
] }) : null
|
|
10403
|
+
] }) : children;
|
|
10404
|
+
const handleDragOver = (event) => {
|
|
10405
|
+
onDragOver?.(event);
|
|
10406
|
+
if (!canDrag || !tableContext.draggingColumnId || tableContext.draggingColumnId === columnId) {
|
|
10407
|
+
return;
|
|
10408
|
+
}
|
|
10409
|
+
event.preventDefault();
|
|
10410
|
+
event.dataTransfer.dropEffect = "move";
|
|
10411
|
+
};
|
|
10412
|
+
const handleDrop = (event) => {
|
|
10413
|
+
onDrop?.(event);
|
|
10414
|
+
if (!canDrag || !columnId) return;
|
|
10415
|
+
const sourceColumnId = tableContext.draggingColumnId || event.dataTransfer.getData(DATA_TRANSFER_COLUMN_TYPE);
|
|
10416
|
+
if (!sourceColumnId || sourceColumnId === columnId) return;
|
|
10417
|
+
const nextOrder = getNextColumnOrder(
|
|
10418
|
+
tableContext.columnOrder,
|
|
10419
|
+
sourceColumnId,
|
|
10420
|
+
columnId
|
|
10421
|
+
);
|
|
10422
|
+
if (nextOrder) {
|
|
10423
|
+
event.preventDefault();
|
|
10424
|
+
tableContext.onColumnOrderChange?.(nextOrder, {
|
|
10425
|
+
columnId: sourceColumnId,
|
|
10426
|
+
targetColumnId: columnId
|
|
10427
|
+
});
|
|
10428
|
+
}
|
|
10429
|
+
tableContext.setDraggingColumnId(void 0);
|
|
10430
|
+
};
|
|
10431
|
+
const handleResizePointerDown = (event) => {
|
|
10432
|
+
if (!canResize || !columnId || !tableContext.onColumnSizeChange) return;
|
|
10433
|
+
event.preventDefault();
|
|
10434
|
+
event.stopPropagation();
|
|
10435
|
+
const startX = event.clientX;
|
|
10436
|
+
const currentWidth = typeof controlledWidth === "number" ? controlledWidth : headRef.current?.offsetWidth ?? minWidth ?? 96;
|
|
10437
|
+
const previousWidth = clampWidth(currentWidth, minWidth, maxWidth);
|
|
10438
|
+
const pointerId = event.pointerId;
|
|
10439
|
+
const target = event.currentTarget;
|
|
10440
|
+
target.setPointerCapture?.(pointerId);
|
|
10441
|
+
const handlePointerMove = (moveEvent) => {
|
|
10442
|
+
const nextWidth = clampWidth(
|
|
10443
|
+
previousWidth + moveEvent.clientX - startX,
|
|
10444
|
+
minWidth,
|
|
10445
|
+
maxWidth
|
|
10446
|
+
);
|
|
10447
|
+
tableContext.onColumnSizeChange?.(columnId, nextWidth, {
|
|
10448
|
+
columnId,
|
|
10449
|
+
previousWidth,
|
|
10450
|
+
minWidth,
|
|
10451
|
+
maxWidth
|
|
10452
|
+
});
|
|
10453
|
+
};
|
|
10454
|
+
const cleanup = () => {
|
|
10455
|
+
target.releasePointerCapture?.(pointerId);
|
|
10456
|
+
window.removeEventListener("pointermove", handlePointerMove);
|
|
10457
|
+
window.removeEventListener("pointerup", cleanup);
|
|
10458
|
+
window.removeEventListener("pointercancel", cleanup);
|
|
10459
|
+
};
|
|
10460
|
+
window.addEventListener("pointermove", handlePointerMove);
|
|
10461
|
+
window.addEventListener("pointerup", cleanup);
|
|
10462
|
+
window.addEventListener("pointercancel", cleanup);
|
|
10463
|
+
};
|
|
10464
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10465
|
+
"th",
|
|
10466
|
+
{
|
|
10467
|
+
...headProps,
|
|
10468
|
+
ref: setHeadRef,
|
|
10469
|
+
scope: headProps.scope ?? "col",
|
|
10470
|
+
"aria-sort": ariaSort,
|
|
10471
|
+
className: cn(
|
|
10472
|
+
theme.slots.tableHead,
|
|
10473
|
+
align === "center" && theme.slots.tableCellAlignCenter,
|
|
10474
|
+
align === "right" && theme.slots.tableCellAlignRight,
|
|
10475
|
+
classNames?.root,
|
|
10476
|
+
className
|
|
10477
|
+
),
|
|
10478
|
+
style: {
|
|
10479
|
+
...theme.styles.tableHead,
|
|
10480
|
+
width: toCssSize(controlledWidth),
|
|
10481
|
+
minWidth: toCssSize(minWidth),
|
|
10482
|
+
maxWidth: toCssSize(maxWidth),
|
|
10483
|
+
...style
|
|
10484
|
+
},
|
|
10485
|
+
onDragOver: handleDragOver,
|
|
10486
|
+
onDrop: handleDrop,
|
|
10487
|
+
children: [
|
|
10488
|
+
renderedContent,
|
|
10489
|
+
canResize ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10490
|
+
"button",
|
|
10491
|
+
{
|
|
10492
|
+
type: "button",
|
|
10493
|
+
title: resizeLabel,
|
|
10494
|
+
"aria-label": resizeLabel ?? `Resize column ${columnId}`,
|
|
10495
|
+
className: cn(theme.slots.tableHeadResizeHandle, classNames?.resizeHandle),
|
|
10496
|
+
onClick: (event) => event.stopPropagation(),
|
|
10497
|
+
onPointerDown: handleResizePointerDown
|
|
10498
|
+
}
|
|
10499
|
+
) : null
|
|
10500
|
+
]
|
|
10501
|
+
}
|
|
10502
|
+
);
|
|
10503
|
+
});
|
|
10122
10504
|
react.forwardRef(
|
|
10123
10505
|
function BaseTextarea2({
|
|
10124
10506
|
invalid = false,
|