@inf-monkeys-tech/monkeys-design 1.0.109 → 1.0.111
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/{WorkbenchRadarMatrix-2ec5e4970f24.d.ts → WorkbenchRadarMatrix-39609aaa90a8.d.ts} +31 -2
- package/dist/{WorkbenchRadarMatrix-b50483af5a5d.d.mts → WorkbenchRadarMatrix-90d4af493e98.d.mts} +31 -2
- package/dist/components/workbench/index.d.mts +1 -1
- package/dist/components/workbench/index.d.ts +1 -1
- package/dist/components/workbench/index.js +168 -68
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +168 -69
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +168 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +168 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/{WorkbenchRadarMatrix-2ec5e4970f24.d.ts → WorkbenchRadarMatrix-39609aaa90a8.d.ts}
RENAMED
|
@@ -710,9 +710,37 @@ interface WorkbenchCollectionSkeletonConfig {
|
|
|
710
710
|
animated?: boolean;
|
|
711
711
|
}
|
|
712
712
|
type WorkbenchCollectionKey = number | string;
|
|
713
|
-
type WorkbenchCollectionLayoutMode = 'dense' | 'grid' | 'masonry' | 'rail';
|
|
714
713
|
type WorkbenchCollectionSelectionMode = 'multiple' | 'none' | 'single';
|
|
715
714
|
type WorkbenchCollectionSelectionBehavior = 'range' | 'replace' | 'toggle';
|
|
715
|
+
interface WorkbenchCollectionSelectionIntent {
|
|
716
|
+
behavior?: WorkbenchCollectionSelectionBehavior;
|
|
717
|
+
shiftKey?: boolean;
|
|
718
|
+
}
|
|
719
|
+
interface WorkbenchCollectionSelectionChangeDetails<Item> {
|
|
720
|
+
item: Item;
|
|
721
|
+
index: number;
|
|
722
|
+
key: WorkbenchCollectionKey;
|
|
723
|
+
behavior: WorkbenchCollectionSelectionBehavior;
|
|
724
|
+
}
|
|
725
|
+
interface UseWorkbenchCollectionSelectionOptions<Item> {
|
|
726
|
+
items: readonly Item[];
|
|
727
|
+
getItemKey: (item: Item, index: number) => WorkbenchCollectionKey;
|
|
728
|
+
mode?: WorkbenchCollectionSelectionMode;
|
|
729
|
+
behavior?: WorkbenchCollectionSelectionBehavior;
|
|
730
|
+
selectedKeys?: Iterable<WorkbenchCollectionKey>;
|
|
731
|
+
defaultSelectedKeys?: Iterable<WorkbenchCollectionKey>;
|
|
732
|
+
isItemDisabled?: (item: Item, index: number) => boolean;
|
|
733
|
+
onSelectionChange?: (selectedKeys: ReadonlySet<WorkbenchCollectionKey>, details: WorkbenchCollectionSelectionChangeDetails<Item>) => void;
|
|
734
|
+
}
|
|
735
|
+
interface WorkbenchCollectionSelectionController {
|
|
736
|
+
mode: WorkbenchCollectionSelectionMode;
|
|
737
|
+
selectedKeys: ReadonlySet<WorkbenchCollectionKey>;
|
|
738
|
+
isSelected: (key: WorkbenchCollectionKey) => boolean;
|
|
739
|
+
selectKey: (key: WorkbenchCollectionKey, intent?: WorkbenchCollectionSelectionIntent) => void;
|
|
740
|
+
resetAnchor: () => void;
|
|
741
|
+
}
|
|
742
|
+
declare function useWorkbenchCollectionSelection<Item>({ items, getItemKey, mode, behavior, selectedKeys: controlledSelectedKeys, defaultSelectedKeys, isItemDisabled, onSelectionChange, }: UseWorkbenchCollectionSelectionOptions<Item>): WorkbenchCollectionSelectionController;
|
|
743
|
+
type WorkbenchCollectionLayoutMode = 'dense' | 'grid' | 'masonry' | 'rail';
|
|
716
744
|
type WorkbenchCollectionActivationEvent = KeyboardEvent<HTMLElement> | MouseEvent<HTMLElement>;
|
|
717
745
|
type WorkbenchCollectionItemStatus = 'failed' | 'idle' | 'loading' | 'pending' | string;
|
|
718
746
|
type WorkbenchCollectionItemSlotName = 'actions' | 'badges' | 'body' | 'detail' | 'detailTrigger' | 'fallback' | 'footer' | 'header' | 'media' | 'meta' | 'selectionControl' | 'statusOverlay' | 'title' | 'top';
|
|
@@ -753,6 +781,7 @@ interface WorkbenchCollectionItemContext<Item> {
|
|
|
753
781
|
selectionMode: WorkbenchCollectionSelectionMode;
|
|
754
782
|
layout: WorkbenchCollectionLayoutContext;
|
|
755
783
|
select: (behavior?: WorkbenchCollectionSelectionBehavior) => void;
|
|
784
|
+
selectFromEvent: (event: Pick<WorkbenchCollectionActivationEvent, 'shiftKey'>, behavior?: WorkbenchCollectionSelectionBehavior) => void;
|
|
756
785
|
preview: () => void;
|
|
757
786
|
detail: () => void;
|
|
758
787
|
renderSlot: (name: WorkbenchCollectionItemSlotName) => ReactNode;
|
|
@@ -1291,4 +1320,4 @@ interface WorkbenchRadarMatrixProps {
|
|
|
1291
1320
|
className?: string;
|
|
1292
1321
|
}
|
|
1293
1322
|
declare function WorkbenchRadarMatrix({ points, xAxis, yAxis, thresholds, quadrants, legend, selectedPointId, onPointSelect, width, height, labelLimit, emptyState, ariaLabel, className, }: WorkbenchRadarMatrixProps): null | react_jsx_runtime.JSX.Element;
|
|
1294
|
-
export { type
|
|
1323
|
+
export { type WorkbenchCollectionSlotContext as $, type WorkbenchCollectionItemConfig as A, type WorkbenchCollectionItemContext as B, type WorkbenchCollectionItemSize as C, type WorkbenchCollectionItemSlotName as D, type WorkbenchCollectionItemSlots as E, type WorkbenchCollectionItemStatus as F, type WorkbenchCollectionItemTitleConfig as G, type WorkbenchCollectionKey as H, InteractiveTable as I, type WorkbenchCollectionLabels as J, type WorkbenchCollectionLayoutConfig as K, type WorkbenchCollectionLayoutContext as L, type WorkbenchCollectionLayoutMode as M, type WorkbenchCollectionLayoutSnapshot as N, type WorkbenchCollectionLoadingConfig as O, type WorkbenchCollectionLoadingVariant as P, type WorkbenchCollectionProps as Q, type WorkbenchCollectionResponsive as R, type WorkbenchCollectionSelectionBehavior as S, type WorkbenchCollectionSelectionChangeDetails as T, type UseWorkbenchCollectionSelectionOptions as U, type WorkbenchCollectionSelectionConfig as V, WorkbenchAssetGallery as W, type WorkbenchCollectionSelectionController as X, type WorkbenchCollectionSelectionIntent as Y, type WorkbenchCollectionSelectionMode as Z, type WorkbenchCollectionSkeletonConfig as _, type InteractiveTableClassNames as a, WorkbenchRadarFilterRow as a$, type WorkbenchCollectionSlots as a0, type WorkbenchCollectionStateConfig as a1, type WorkbenchCollectionTitlePlacement as a2, type WorkbenchCollectionTitleVisibility as a3, type WorkbenchCollectionVirtualizationAdapter as a4, type WorkbenchCollectionVirtualizationConfig as a5, type WorkbenchCollectionVirtualizationRenderOptions as a6, WorkbenchContentPane as a7, type WorkbenchContentPaneBodyProps as a8, type WorkbenchContentPaneClassNames as a9, type WorkbenchGallerySettingsOption as aA, WorkbenchGallerySettingsPanel as aB, type WorkbenchGallerySettingsPanelClassNames as aC, type WorkbenchGallerySettingsPanelProps as aD, type WorkbenchGallerySettingsValue as aE, WorkbenchGalleryView as aF, type WorkbenchGalleryViewProps as aG, type WorkbenchJourneyItem as aH, type WorkbenchJourneyItemState as aI, WorkbenchJourneyNavigation as aJ, type WorkbenchJourneyNavigationProps as aK, type WorkbenchLaneClassNames as aL, type WorkbenchLaneColumn as aM, type WorkbenchLaneRenderCardContext as aN, WorkbenchLaneView as aO, type WorkbenchLaneViewProps as aP, type WorkbenchMasonryItemSize as aQ, WorkbenchMasonryLayout as aR, type WorkbenchMasonryLayoutContext as aS, type WorkbenchMasonryLayoutProps as aT, WorkbenchMetricGrid as aU, type WorkbenchMetricGridDensity as aV, type WorkbenchMetricGridProps as aW, type WorkbenchMetricGridVariant as aX, type WorkbenchMetricItem as aY, WorkbenchRadarFilterChip as aZ, type WorkbenchRadarFilterChipProps as a_, type WorkbenchContentPaneProps as aa, WorkbenchContentToolbar as ab, type WorkbenchContentToolbarClassNames as ac, type WorkbenchContentToolbarProps as ad, type WorkbenchContentToolbarViewModeOption as ae, WorkbenchDetailSidebar as af, type WorkbenchDetailSidebarBodyProps as ag, type WorkbenchDetailSidebarClassNames as ah, type WorkbenchDetailSidebarField as ai, type WorkbenchDetailSidebarProps as aj, type WorkbenchDetailSidebarRenderContext as ak, type WorkbenchDetailSidebarSection as al, type WorkbenchEvidenceItem as am, WorkbenchEvidenceList as an, type WorkbenchEvidenceListProps as ao, WorkbenchGalleryCard as ap, type WorkbenchGalleryCardMetaContext as aq, type WorkbenchGalleryCardProps as ar, type WorkbenchGalleryCardRenderContext as as, type WorkbenchGalleryColumn as at, type WorkbenchGalleryLabels as au, type WorkbenchGalleryRecordVisual as av, WorkbenchGallerySettingsButton as aw, type WorkbenchGallerySettingsButtonClassNames as ax, type WorkbenchGallerySettingsButtonProps as ay, type WorkbenchGallerySettingsLabels as az, type InteractiveTableColumn as b, type WorkbenchRadarFilterRowDisclosureBase as b0, type WorkbenchRadarFilterRowIntegratedDisclosure as b1, type WorkbenchRadarFilterRowProps as b2, type WorkbenchRadarFilterRowSeparateDisclosure as b3, WorkbenchRadarInspectorSection as b4, type WorkbenchRadarLegendItem as b5, WorkbenchRadarMatrix as b6, type WorkbenchRadarMatrixProps as b7, WorkbenchRadarNavigation as b8, type WorkbenchRadarNavigationChild as b9, WorkbenchTableView as bA, type WorkbenchTableViewClassNames as bB, type WorkbenchTableViewColumn as bC, type WorkbenchTableViewHeaderContext as bD, type WorkbenchTableViewProps as bE, type WorkbenchTableViewRenderContext as bF, type WorkbenchVisualizationTone as bG, useWorkbenchCollectionSelection as bH, type WorkbenchCollectionActionsPlacement as bI, type WorkbenchCollectionActionsVisibility as bJ, type WorkbenchCollectionItemActionsConfig as bK, type WorkbenchCollectionItemAlign as bL, type WorkbenchRadarNavigationItem as ba, type WorkbenchRadarNavigationProps as bb, type WorkbenchRadarQuadrant as bc, WorkbenchRadarWorkspace as bd, type WorkbenchRadarWorkspaceProps as be, WorkbenchRankedList as bf, type WorkbenchRankedListItem as bg, type WorkbenchRankedListMetric as bh, type WorkbenchRankedListProps as bi, type WorkbenchRelationshipEdge as bj, WorkbenchRelationshipGraph as bk, type WorkbenchRelationshipGraphProps as bl, type WorkbenchRelationshipNode as bm, WorkbenchResizableSidebar as bn, type WorkbenchResizableSidebarClassNames as bo, type WorkbenchResizableSidebarItem as bp, type WorkbenchResizableSidebarProps as bq, type WorkbenchResizableSidebarSection as br, type WorkbenchScatterAxis as bs, WorkbenchScatterPlot as bt, type WorkbenchScatterPlotProps as bu, type WorkbenchScatterPoint as bv, type WorkbenchScatterThresholds as bw, WorkbenchSelectionTray as bx, type WorkbenchSelectionTrayItem as by, type WorkbenchSelectionTrayProps as bz, type InteractiveTableColumnMenuLabels as c, InteractiveTableEditableTextCell as d, type InteractiveTableEditableTextCellProps as e, type InteractiveTableHeaderContext as f, type InteractiveTableHeaderProps as g, type InteractiveTableProps as h, InteractiveTableReadonlyCell as i, type InteractiveTableReadonlyCellProps as j, type InteractiveTableRenderContext as k, type InteractiveTableRowState as l, InteractiveTableSelectCell as m, type InteractiveTableSelectCellProps as n, type InteractiveTableSelectOption as o, type WorkbenchAssetGalleryItem as p, type WorkbenchAssetGalleryProps as q, WorkbenchCollection as r, type WorkbenchCollectionActivationEvent as s, type WorkbenchCollectionAppearanceConfig as t, type WorkbenchCollectionCallbacks as u, type WorkbenchCollectionClassNames as v, type WorkbenchCollectionConfig as w, type WorkbenchCollectionGroupContext as x, type WorkbenchCollectionGroupingConfig as y, type WorkbenchCollectionHoverEffect as z };
|
package/dist/{WorkbenchRadarMatrix-b50483af5a5d.d.mts → WorkbenchRadarMatrix-90d4af493e98.d.mts}
RENAMED
|
@@ -710,9 +710,37 @@ interface WorkbenchCollectionSkeletonConfig {
|
|
|
710
710
|
animated?: boolean;
|
|
711
711
|
}
|
|
712
712
|
type WorkbenchCollectionKey = number | string;
|
|
713
|
-
type WorkbenchCollectionLayoutMode = 'dense' | 'grid' | 'masonry' | 'rail';
|
|
714
713
|
type WorkbenchCollectionSelectionMode = 'multiple' | 'none' | 'single';
|
|
715
714
|
type WorkbenchCollectionSelectionBehavior = 'range' | 'replace' | 'toggle';
|
|
715
|
+
interface WorkbenchCollectionSelectionIntent {
|
|
716
|
+
behavior?: WorkbenchCollectionSelectionBehavior;
|
|
717
|
+
shiftKey?: boolean;
|
|
718
|
+
}
|
|
719
|
+
interface WorkbenchCollectionSelectionChangeDetails<Item> {
|
|
720
|
+
item: Item;
|
|
721
|
+
index: number;
|
|
722
|
+
key: WorkbenchCollectionKey;
|
|
723
|
+
behavior: WorkbenchCollectionSelectionBehavior;
|
|
724
|
+
}
|
|
725
|
+
interface UseWorkbenchCollectionSelectionOptions<Item> {
|
|
726
|
+
items: readonly Item[];
|
|
727
|
+
getItemKey: (item: Item, index: number) => WorkbenchCollectionKey;
|
|
728
|
+
mode?: WorkbenchCollectionSelectionMode;
|
|
729
|
+
behavior?: WorkbenchCollectionSelectionBehavior;
|
|
730
|
+
selectedKeys?: Iterable<WorkbenchCollectionKey>;
|
|
731
|
+
defaultSelectedKeys?: Iterable<WorkbenchCollectionKey>;
|
|
732
|
+
isItemDisabled?: (item: Item, index: number) => boolean;
|
|
733
|
+
onSelectionChange?: (selectedKeys: ReadonlySet<WorkbenchCollectionKey>, details: WorkbenchCollectionSelectionChangeDetails<Item>) => void;
|
|
734
|
+
}
|
|
735
|
+
interface WorkbenchCollectionSelectionController {
|
|
736
|
+
mode: WorkbenchCollectionSelectionMode;
|
|
737
|
+
selectedKeys: ReadonlySet<WorkbenchCollectionKey>;
|
|
738
|
+
isSelected: (key: WorkbenchCollectionKey) => boolean;
|
|
739
|
+
selectKey: (key: WorkbenchCollectionKey, intent?: WorkbenchCollectionSelectionIntent) => void;
|
|
740
|
+
resetAnchor: () => void;
|
|
741
|
+
}
|
|
742
|
+
declare function useWorkbenchCollectionSelection<Item>({ items, getItemKey, mode, behavior, selectedKeys: controlledSelectedKeys, defaultSelectedKeys, isItemDisabled, onSelectionChange, }: UseWorkbenchCollectionSelectionOptions<Item>): WorkbenchCollectionSelectionController;
|
|
743
|
+
type WorkbenchCollectionLayoutMode = 'dense' | 'grid' | 'masonry' | 'rail';
|
|
716
744
|
type WorkbenchCollectionActivationEvent = KeyboardEvent<HTMLElement> | MouseEvent<HTMLElement>;
|
|
717
745
|
type WorkbenchCollectionItemStatus = 'failed' | 'idle' | 'loading' | 'pending' | string;
|
|
718
746
|
type WorkbenchCollectionItemSlotName = 'actions' | 'badges' | 'body' | 'detail' | 'detailTrigger' | 'fallback' | 'footer' | 'header' | 'media' | 'meta' | 'selectionControl' | 'statusOverlay' | 'title' | 'top';
|
|
@@ -753,6 +781,7 @@ interface WorkbenchCollectionItemContext<Item> {
|
|
|
753
781
|
selectionMode: WorkbenchCollectionSelectionMode;
|
|
754
782
|
layout: WorkbenchCollectionLayoutContext;
|
|
755
783
|
select: (behavior?: WorkbenchCollectionSelectionBehavior) => void;
|
|
784
|
+
selectFromEvent: (event: Pick<WorkbenchCollectionActivationEvent, 'shiftKey'>, behavior?: WorkbenchCollectionSelectionBehavior) => void;
|
|
756
785
|
preview: () => void;
|
|
757
786
|
detail: () => void;
|
|
758
787
|
renderSlot: (name: WorkbenchCollectionItemSlotName) => ReactNode;
|
|
@@ -1291,4 +1320,4 @@ interface WorkbenchRadarMatrixProps {
|
|
|
1291
1320
|
className?: string;
|
|
1292
1321
|
}
|
|
1293
1322
|
declare function WorkbenchRadarMatrix({ points, xAxis, yAxis, thresholds, quadrants, legend, selectedPointId, onPointSelect, width, height, labelLimit, emptyState, ariaLabel, className, }: WorkbenchRadarMatrixProps): null | react_jsx_runtime.JSX.Element;
|
|
1294
|
-
export { type
|
|
1323
|
+
export { type WorkbenchCollectionSlotContext as $, type WorkbenchCollectionItemConfig as A, type WorkbenchCollectionItemContext as B, type WorkbenchCollectionItemSize as C, type WorkbenchCollectionItemSlotName as D, type WorkbenchCollectionItemSlots as E, type WorkbenchCollectionItemStatus as F, type WorkbenchCollectionItemTitleConfig as G, type WorkbenchCollectionKey as H, InteractiveTable as I, type WorkbenchCollectionLabels as J, type WorkbenchCollectionLayoutConfig as K, type WorkbenchCollectionLayoutContext as L, type WorkbenchCollectionLayoutMode as M, type WorkbenchCollectionLayoutSnapshot as N, type WorkbenchCollectionLoadingConfig as O, type WorkbenchCollectionLoadingVariant as P, type WorkbenchCollectionProps as Q, type WorkbenchCollectionResponsive as R, type WorkbenchCollectionSelectionBehavior as S, type WorkbenchCollectionSelectionChangeDetails as T, type UseWorkbenchCollectionSelectionOptions as U, type WorkbenchCollectionSelectionConfig as V, WorkbenchAssetGallery as W, type WorkbenchCollectionSelectionController as X, type WorkbenchCollectionSelectionIntent as Y, type WorkbenchCollectionSelectionMode as Z, type WorkbenchCollectionSkeletonConfig as _, type InteractiveTableClassNames as a, WorkbenchRadarFilterRow as a$, type WorkbenchCollectionSlots as a0, type WorkbenchCollectionStateConfig as a1, type WorkbenchCollectionTitlePlacement as a2, type WorkbenchCollectionTitleVisibility as a3, type WorkbenchCollectionVirtualizationAdapter as a4, type WorkbenchCollectionVirtualizationConfig as a5, type WorkbenchCollectionVirtualizationRenderOptions as a6, WorkbenchContentPane as a7, type WorkbenchContentPaneBodyProps as a8, type WorkbenchContentPaneClassNames as a9, type WorkbenchGallerySettingsOption as aA, WorkbenchGallerySettingsPanel as aB, type WorkbenchGallerySettingsPanelClassNames as aC, type WorkbenchGallerySettingsPanelProps as aD, type WorkbenchGallerySettingsValue as aE, WorkbenchGalleryView as aF, type WorkbenchGalleryViewProps as aG, type WorkbenchJourneyItem as aH, type WorkbenchJourneyItemState as aI, WorkbenchJourneyNavigation as aJ, type WorkbenchJourneyNavigationProps as aK, type WorkbenchLaneClassNames as aL, type WorkbenchLaneColumn as aM, type WorkbenchLaneRenderCardContext as aN, WorkbenchLaneView as aO, type WorkbenchLaneViewProps as aP, type WorkbenchMasonryItemSize as aQ, WorkbenchMasonryLayout as aR, type WorkbenchMasonryLayoutContext as aS, type WorkbenchMasonryLayoutProps as aT, WorkbenchMetricGrid as aU, type WorkbenchMetricGridDensity as aV, type WorkbenchMetricGridProps as aW, type WorkbenchMetricGridVariant as aX, type WorkbenchMetricItem as aY, WorkbenchRadarFilterChip as aZ, type WorkbenchRadarFilterChipProps as a_, type WorkbenchContentPaneProps as aa, WorkbenchContentToolbar as ab, type WorkbenchContentToolbarClassNames as ac, type WorkbenchContentToolbarProps as ad, type WorkbenchContentToolbarViewModeOption as ae, WorkbenchDetailSidebar as af, type WorkbenchDetailSidebarBodyProps as ag, type WorkbenchDetailSidebarClassNames as ah, type WorkbenchDetailSidebarField as ai, type WorkbenchDetailSidebarProps as aj, type WorkbenchDetailSidebarRenderContext as ak, type WorkbenchDetailSidebarSection as al, type WorkbenchEvidenceItem as am, WorkbenchEvidenceList as an, type WorkbenchEvidenceListProps as ao, WorkbenchGalleryCard as ap, type WorkbenchGalleryCardMetaContext as aq, type WorkbenchGalleryCardProps as ar, type WorkbenchGalleryCardRenderContext as as, type WorkbenchGalleryColumn as at, type WorkbenchGalleryLabels as au, type WorkbenchGalleryRecordVisual as av, WorkbenchGallerySettingsButton as aw, type WorkbenchGallerySettingsButtonClassNames as ax, type WorkbenchGallerySettingsButtonProps as ay, type WorkbenchGallerySettingsLabels as az, type InteractiveTableColumn as b, type WorkbenchRadarFilterRowDisclosureBase as b0, type WorkbenchRadarFilterRowIntegratedDisclosure as b1, type WorkbenchRadarFilterRowProps as b2, type WorkbenchRadarFilterRowSeparateDisclosure as b3, WorkbenchRadarInspectorSection as b4, type WorkbenchRadarLegendItem as b5, WorkbenchRadarMatrix as b6, type WorkbenchRadarMatrixProps as b7, WorkbenchRadarNavigation as b8, type WorkbenchRadarNavigationChild as b9, WorkbenchTableView as bA, type WorkbenchTableViewClassNames as bB, type WorkbenchTableViewColumn as bC, type WorkbenchTableViewHeaderContext as bD, type WorkbenchTableViewProps as bE, type WorkbenchTableViewRenderContext as bF, type WorkbenchVisualizationTone as bG, useWorkbenchCollectionSelection as bH, type WorkbenchCollectionActionsPlacement as bI, type WorkbenchCollectionActionsVisibility as bJ, type WorkbenchCollectionItemActionsConfig as bK, type WorkbenchCollectionItemAlign as bL, type WorkbenchRadarNavigationItem as ba, type WorkbenchRadarNavigationProps as bb, type WorkbenchRadarQuadrant as bc, WorkbenchRadarWorkspace as bd, type WorkbenchRadarWorkspaceProps as be, WorkbenchRankedList as bf, type WorkbenchRankedListItem as bg, type WorkbenchRankedListMetric as bh, type WorkbenchRankedListProps as bi, type WorkbenchRelationshipEdge as bj, WorkbenchRelationshipGraph as bk, type WorkbenchRelationshipGraphProps as bl, type WorkbenchRelationshipNode as bm, WorkbenchResizableSidebar as bn, type WorkbenchResizableSidebarClassNames as bo, type WorkbenchResizableSidebarItem as bp, type WorkbenchResizableSidebarProps as bq, type WorkbenchResizableSidebarSection as br, type WorkbenchScatterAxis as bs, WorkbenchScatterPlot as bt, type WorkbenchScatterPlotProps as bu, type WorkbenchScatterPoint as bv, type WorkbenchScatterThresholds as bw, WorkbenchSelectionTray as bx, type WorkbenchSelectionTrayItem as by, type WorkbenchSelectionTrayProps as bz, type InteractiveTableColumnMenuLabels as c, InteractiveTableEditableTextCell as d, type InteractiveTableEditableTextCellProps as e, type InteractiveTableHeaderContext as f, type InteractiveTableHeaderProps as g, type InteractiveTableProps as h, InteractiveTableReadonlyCell as i, type InteractiveTableReadonlyCellProps as j, type InteractiveTableRenderContext as k, type InteractiveTableRowState as l, InteractiveTableSelectCell as m, type InteractiveTableSelectCellProps as n, type InteractiveTableSelectOption as o, type WorkbenchAssetGalleryItem as p, type WorkbenchAssetGalleryProps as q, WorkbenchCollection as r, type WorkbenchCollectionActivationEvent as s, type WorkbenchCollectionAppearanceConfig as t, type WorkbenchCollectionCallbacks as u, type WorkbenchCollectionClassNames as v, type WorkbenchCollectionConfig as w, type WorkbenchCollectionGroupContext as x, type WorkbenchCollectionGroupingConfig as y, type WorkbenchCollectionHoverEffect as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as InteractiveTable, a as InteractiveTableClassNames, b as InteractiveTableColumn, c as InteractiveTableColumnMenuLabels, d as InteractiveTableEditableTextCell, e as InteractiveTableEditableTextCellProps, f as InteractiveTableHeaderContext, g as InteractiveTableHeaderProps, h as InteractiveTableProps, i as InteractiveTableReadonlyCell, j as InteractiveTableReadonlyCellProps, k as InteractiveTableRenderContext, l as InteractiveTableRowState, m as InteractiveTableSelectCell, n as InteractiveTableSelectCellProps, o as InteractiveTableSelectOption, W as WorkbenchAssetGallery, p as WorkbenchAssetGalleryItem, q as WorkbenchAssetGalleryProps, r as WorkbenchCollection,
|
|
1
|
+
export { I as InteractiveTable, a as InteractiveTableClassNames, b as InteractiveTableColumn, c as InteractiveTableColumnMenuLabels, d as InteractiveTableEditableTextCell, e as InteractiveTableEditableTextCellProps, f as InteractiveTableHeaderContext, g as InteractiveTableHeaderProps, h as InteractiveTableProps, i as InteractiveTableReadonlyCell, j as InteractiveTableReadonlyCellProps, k as InteractiveTableRenderContext, l as InteractiveTableRowState, m as InteractiveTableSelectCell, n as InteractiveTableSelectCellProps, o as InteractiveTableSelectOption, U as UseWorkbenchCollectionSelectionOptions, W as WorkbenchAssetGallery, p as WorkbenchAssetGalleryItem, q as WorkbenchAssetGalleryProps, r as WorkbenchCollection, bI as WorkbenchCollectionActionsPlacement, bJ as WorkbenchCollectionActionsVisibility, s as WorkbenchCollectionActivationEvent, t as WorkbenchCollectionAppearanceConfig, u as WorkbenchCollectionCallbacks, v as WorkbenchCollectionClassNames, w as WorkbenchCollectionConfig, x as WorkbenchCollectionGroupContext, y as WorkbenchCollectionGroupingConfig, z as WorkbenchCollectionHoverEffect, bK as WorkbenchCollectionItemActionsConfig, bL as WorkbenchCollectionItemAlign, A as WorkbenchCollectionItemConfig, B as WorkbenchCollectionItemContext, C as WorkbenchCollectionItemSize, D as WorkbenchCollectionItemSlotName, E as WorkbenchCollectionItemSlots, F as WorkbenchCollectionItemStatus, G as WorkbenchCollectionItemTitleConfig, H as WorkbenchCollectionKey, J as WorkbenchCollectionLabels, K as WorkbenchCollectionLayoutConfig, L as WorkbenchCollectionLayoutContext, M as WorkbenchCollectionLayoutMode, N as WorkbenchCollectionLayoutSnapshot, O as WorkbenchCollectionLoadingConfig, P as WorkbenchCollectionLoadingVariant, Q as WorkbenchCollectionProps, R as WorkbenchCollectionResponsive, S as WorkbenchCollectionSelectionBehavior, T as WorkbenchCollectionSelectionChangeDetails, V as WorkbenchCollectionSelectionConfig, X as WorkbenchCollectionSelectionController, Y as WorkbenchCollectionSelectionIntent, Z as WorkbenchCollectionSelectionMode, _ as WorkbenchCollectionSkeletonConfig, $ as WorkbenchCollectionSlotContext, a0 as WorkbenchCollectionSlots, a1 as WorkbenchCollectionStateConfig, a2 as WorkbenchCollectionTitlePlacement, a3 as WorkbenchCollectionTitleVisibility, a4 as WorkbenchCollectionVirtualizationAdapter, a5 as WorkbenchCollectionVirtualizationConfig, a6 as WorkbenchCollectionVirtualizationRenderOptions, a7 as WorkbenchContentPane, a8 as WorkbenchContentPaneBodyProps, a9 as WorkbenchContentPaneClassNames, aa as WorkbenchContentPaneProps, ab as WorkbenchContentToolbar, ac as WorkbenchContentToolbarClassNames, ad as WorkbenchContentToolbarProps, ae as WorkbenchContentToolbarViewModeOption, af as WorkbenchDetailSidebar, ag as WorkbenchDetailSidebarBodyProps, ah as WorkbenchDetailSidebarClassNames, ai as WorkbenchDetailSidebarField, aj as WorkbenchDetailSidebarProps, ak as WorkbenchDetailSidebarRenderContext, al as WorkbenchDetailSidebarSection, am as WorkbenchEvidenceItem, an as WorkbenchEvidenceList, ao as WorkbenchEvidenceListProps, ap as WorkbenchGalleryCard, aq as WorkbenchGalleryCardMetaContext, ar as WorkbenchGalleryCardProps, as as WorkbenchGalleryCardRenderContext, at as WorkbenchGalleryColumn, au as WorkbenchGalleryLabels, av as WorkbenchGalleryRecordVisual, aw as WorkbenchGallerySettingsButton, ax as WorkbenchGallerySettingsButtonClassNames, ay as WorkbenchGallerySettingsButtonProps, az as WorkbenchGallerySettingsLabels, aA as WorkbenchGallerySettingsOption, aB as WorkbenchGallerySettingsPanel, aC as WorkbenchGallerySettingsPanelClassNames, aD as WorkbenchGallerySettingsPanelProps, aE as WorkbenchGallerySettingsValue, aF as WorkbenchGalleryView, aG as WorkbenchGalleryViewProps, aH as WorkbenchJourneyItem, aI as WorkbenchJourneyItemState, aJ as WorkbenchJourneyNavigation, aK as WorkbenchJourneyNavigationProps, aL as WorkbenchLaneClassNames, aM as WorkbenchLaneColumn, aN as WorkbenchLaneRenderCardContext, aO as WorkbenchLaneView, aP as WorkbenchLaneViewProps, aQ as WorkbenchMasonryItemSize, aR as WorkbenchMasonryLayout, aS as WorkbenchMasonryLayoutContext, aT as WorkbenchMasonryLayoutProps, aU as WorkbenchMetricGrid, aV as WorkbenchMetricGridDensity, aW as WorkbenchMetricGridProps, aX as WorkbenchMetricGridVariant, aY as WorkbenchMetricItem, aZ as WorkbenchRadarFilterChip, a_ as WorkbenchRadarFilterChipProps, a$ as WorkbenchRadarFilterRow, b0 as WorkbenchRadarFilterRowDisclosureBase, b1 as WorkbenchRadarFilterRowIntegratedDisclosure, b2 as WorkbenchRadarFilterRowProps, b3 as WorkbenchRadarFilterRowSeparateDisclosure, b4 as WorkbenchRadarInspectorSection, b5 as WorkbenchRadarLegendItem, b6 as WorkbenchRadarMatrix, b7 as WorkbenchRadarMatrixProps, b8 as WorkbenchRadarNavigation, b9 as WorkbenchRadarNavigationChild, ba as WorkbenchRadarNavigationItem, bb as WorkbenchRadarNavigationProps, bc as WorkbenchRadarQuadrant, bd as WorkbenchRadarWorkspace, be as WorkbenchRadarWorkspaceProps, bf as WorkbenchRankedList, bg as WorkbenchRankedListItem, bh as WorkbenchRankedListMetric, bi as WorkbenchRankedListProps, bj as WorkbenchRelationshipEdge, bk as WorkbenchRelationshipGraph, bl as WorkbenchRelationshipGraphProps, bm as WorkbenchRelationshipNode, bn as WorkbenchResizableSidebar, bo as WorkbenchResizableSidebarClassNames, bp as WorkbenchResizableSidebarItem, bq as WorkbenchResizableSidebarProps, br as WorkbenchResizableSidebarSection, bs as WorkbenchScatterAxis, bt as WorkbenchScatterPlot, bu as WorkbenchScatterPlotProps, bv as WorkbenchScatterPoint, bw as WorkbenchScatterThresholds, bx as WorkbenchSelectionTray, by as WorkbenchSelectionTrayItem, bz as WorkbenchSelectionTrayProps, bA as WorkbenchTableView, bB as WorkbenchTableViewClassNames, bC as WorkbenchTableViewColumn, bD as WorkbenchTableViewHeaderContext, bE as WorkbenchTableViewProps, bF as WorkbenchTableViewRenderContext, bG as WorkbenchVisualizationTone, bH as useWorkbenchCollectionSelection } from '../../WorkbenchRadarMatrix-90d4af493e98.mjs';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { HTMLAttributes } from 'react';
|
|
4
4
|
import '../../types-c6ec8b90925b.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as InteractiveTable, a as InteractiveTableClassNames, b as InteractiveTableColumn, c as InteractiveTableColumnMenuLabels, d as InteractiveTableEditableTextCell, e as InteractiveTableEditableTextCellProps, f as InteractiveTableHeaderContext, g as InteractiveTableHeaderProps, h as InteractiveTableProps, i as InteractiveTableReadonlyCell, j as InteractiveTableReadonlyCellProps, k as InteractiveTableRenderContext, l as InteractiveTableRowState, m as InteractiveTableSelectCell, n as InteractiveTableSelectCellProps, o as InteractiveTableSelectOption, W as WorkbenchAssetGallery, p as WorkbenchAssetGalleryItem, q as WorkbenchAssetGalleryProps, r as WorkbenchCollection,
|
|
1
|
+
export { I as InteractiveTable, a as InteractiveTableClassNames, b as InteractiveTableColumn, c as InteractiveTableColumnMenuLabels, d as InteractiveTableEditableTextCell, e as InteractiveTableEditableTextCellProps, f as InteractiveTableHeaderContext, g as InteractiveTableHeaderProps, h as InteractiveTableProps, i as InteractiveTableReadonlyCell, j as InteractiveTableReadonlyCellProps, k as InteractiveTableRenderContext, l as InteractiveTableRowState, m as InteractiveTableSelectCell, n as InteractiveTableSelectCellProps, o as InteractiveTableSelectOption, U as UseWorkbenchCollectionSelectionOptions, W as WorkbenchAssetGallery, p as WorkbenchAssetGalleryItem, q as WorkbenchAssetGalleryProps, r as WorkbenchCollection, bI as WorkbenchCollectionActionsPlacement, bJ as WorkbenchCollectionActionsVisibility, s as WorkbenchCollectionActivationEvent, t as WorkbenchCollectionAppearanceConfig, u as WorkbenchCollectionCallbacks, v as WorkbenchCollectionClassNames, w as WorkbenchCollectionConfig, x as WorkbenchCollectionGroupContext, y as WorkbenchCollectionGroupingConfig, z as WorkbenchCollectionHoverEffect, bK as WorkbenchCollectionItemActionsConfig, bL as WorkbenchCollectionItemAlign, A as WorkbenchCollectionItemConfig, B as WorkbenchCollectionItemContext, C as WorkbenchCollectionItemSize, D as WorkbenchCollectionItemSlotName, E as WorkbenchCollectionItemSlots, F as WorkbenchCollectionItemStatus, G as WorkbenchCollectionItemTitleConfig, H as WorkbenchCollectionKey, J as WorkbenchCollectionLabels, K as WorkbenchCollectionLayoutConfig, L as WorkbenchCollectionLayoutContext, M as WorkbenchCollectionLayoutMode, N as WorkbenchCollectionLayoutSnapshot, O as WorkbenchCollectionLoadingConfig, P as WorkbenchCollectionLoadingVariant, Q as WorkbenchCollectionProps, R as WorkbenchCollectionResponsive, S as WorkbenchCollectionSelectionBehavior, T as WorkbenchCollectionSelectionChangeDetails, V as WorkbenchCollectionSelectionConfig, X as WorkbenchCollectionSelectionController, Y as WorkbenchCollectionSelectionIntent, Z as WorkbenchCollectionSelectionMode, _ as WorkbenchCollectionSkeletonConfig, $ as WorkbenchCollectionSlotContext, a0 as WorkbenchCollectionSlots, a1 as WorkbenchCollectionStateConfig, a2 as WorkbenchCollectionTitlePlacement, a3 as WorkbenchCollectionTitleVisibility, a4 as WorkbenchCollectionVirtualizationAdapter, a5 as WorkbenchCollectionVirtualizationConfig, a6 as WorkbenchCollectionVirtualizationRenderOptions, a7 as WorkbenchContentPane, a8 as WorkbenchContentPaneBodyProps, a9 as WorkbenchContentPaneClassNames, aa as WorkbenchContentPaneProps, ab as WorkbenchContentToolbar, ac as WorkbenchContentToolbarClassNames, ad as WorkbenchContentToolbarProps, ae as WorkbenchContentToolbarViewModeOption, af as WorkbenchDetailSidebar, ag as WorkbenchDetailSidebarBodyProps, ah as WorkbenchDetailSidebarClassNames, ai as WorkbenchDetailSidebarField, aj as WorkbenchDetailSidebarProps, ak as WorkbenchDetailSidebarRenderContext, al as WorkbenchDetailSidebarSection, am as WorkbenchEvidenceItem, an as WorkbenchEvidenceList, ao as WorkbenchEvidenceListProps, ap as WorkbenchGalleryCard, aq as WorkbenchGalleryCardMetaContext, ar as WorkbenchGalleryCardProps, as as WorkbenchGalleryCardRenderContext, at as WorkbenchGalleryColumn, au as WorkbenchGalleryLabels, av as WorkbenchGalleryRecordVisual, aw as WorkbenchGallerySettingsButton, ax as WorkbenchGallerySettingsButtonClassNames, ay as WorkbenchGallerySettingsButtonProps, az as WorkbenchGallerySettingsLabels, aA as WorkbenchGallerySettingsOption, aB as WorkbenchGallerySettingsPanel, aC as WorkbenchGallerySettingsPanelClassNames, aD as WorkbenchGallerySettingsPanelProps, aE as WorkbenchGallerySettingsValue, aF as WorkbenchGalleryView, aG as WorkbenchGalleryViewProps, aH as WorkbenchJourneyItem, aI as WorkbenchJourneyItemState, aJ as WorkbenchJourneyNavigation, aK as WorkbenchJourneyNavigationProps, aL as WorkbenchLaneClassNames, aM as WorkbenchLaneColumn, aN as WorkbenchLaneRenderCardContext, aO as WorkbenchLaneView, aP as WorkbenchLaneViewProps, aQ as WorkbenchMasonryItemSize, aR as WorkbenchMasonryLayout, aS as WorkbenchMasonryLayoutContext, aT as WorkbenchMasonryLayoutProps, aU as WorkbenchMetricGrid, aV as WorkbenchMetricGridDensity, aW as WorkbenchMetricGridProps, aX as WorkbenchMetricGridVariant, aY as WorkbenchMetricItem, aZ as WorkbenchRadarFilterChip, a_ as WorkbenchRadarFilterChipProps, a$ as WorkbenchRadarFilterRow, b0 as WorkbenchRadarFilterRowDisclosureBase, b1 as WorkbenchRadarFilterRowIntegratedDisclosure, b2 as WorkbenchRadarFilterRowProps, b3 as WorkbenchRadarFilterRowSeparateDisclosure, b4 as WorkbenchRadarInspectorSection, b5 as WorkbenchRadarLegendItem, b6 as WorkbenchRadarMatrix, b7 as WorkbenchRadarMatrixProps, b8 as WorkbenchRadarNavigation, b9 as WorkbenchRadarNavigationChild, ba as WorkbenchRadarNavigationItem, bb as WorkbenchRadarNavigationProps, bc as WorkbenchRadarQuadrant, bd as WorkbenchRadarWorkspace, be as WorkbenchRadarWorkspaceProps, bf as WorkbenchRankedList, bg as WorkbenchRankedListItem, bh as WorkbenchRankedListMetric, bi as WorkbenchRankedListProps, bj as WorkbenchRelationshipEdge, bk as WorkbenchRelationshipGraph, bl as WorkbenchRelationshipGraphProps, bm as WorkbenchRelationshipNode, bn as WorkbenchResizableSidebar, bo as WorkbenchResizableSidebarClassNames, bp as WorkbenchResizableSidebarItem, bq as WorkbenchResizableSidebarProps, br as WorkbenchResizableSidebarSection, bs as WorkbenchScatterAxis, bt as WorkbenchScatterPlot, bu as WorkbenchScatterPlotProps, bv as WorkbenchScatterPoint, bw as WorkbenchScatterThresholds, bx as WorkbenchSelectionTray, by as WorkbenchSelectionTrayItem, bz as WorkbenchSelectionTrayProps, bA as WorkbenchTableView, bB as WorkbenchTableViewClassNames, bC as WorkbenchTableViewColumn, bD as WorkbenchTableViewHeaderContext, bE as WorkbenchTableViewProps, bF as WorkbenchTableViewRenderContext, bG as WorkbenchVisualizationTone, bH as useWorkbenchCollectionSelection } from '../../WorkbenchRadarMatrix-39609aaa90a8.js';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { HTMLAttributes } from 'react';
|
|
4
4
|
import '../../types-c6ec8b90925b.js';
|
|
@@ -10873,6 +10873,142 @@ function WorkbenchCollectionSkeleton({
|
|
|
10873
10873
|
}
|
|
10874
10874
|
);
|
|
10875
10875
|
}
|
|
10876
|
+
function setsEqual(left, right) {
|
|
10877
|
+
if (left.size !== right.size) return false;
|
|
10878
|
+
for (const value of left) {
|
|
10879
|
+
if (!right.has(value)) return false;
|
|
10880
|
+
}
|
|
10881
|
+
return true;
|
|
10882
|
+
}
|
|
10883
|
+
function getComparableKey(key) {
|
|
10884
|
+
return String(key);
|
|
10885
|
+
}
|
|
10886
|
+
function getDefaultBehavior(mode) {
|
|
10887
|
+
return mode === "multiple" ? "toggle" : "replace";
|
|
10888
|
+
}
|
|
10889
|
+
function useWorkbenchCollectionSelection({
|
|
10890
|
+
items,
|
|
10891
|
+
getItemKey,
|
|
10892
|
+
mode = "none",
|
|
10893
|
+
behavior,
|
|
10894
|
+
selectedKeys: controlledSelectedKeys,
|
|
10895
|
+
defaultSelectedKeys,
|
|
10896
|
+
isItemDisabled,
|
|
10897
|
+
onSelectionChange
|
|
10898
|
+
}) {
|
|
10899
|
+
const controlled = controlledSelectedKeys !== void 0;
|
|
10900
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = react.useState(
|
|
10901
|
+
() => new Set(defaultSelectedKeys ?? [])
|
|
10902
|
+
);
|
|
10903
|
+
const anchorKeyRef = react.useRef(null);
|
|
10904
|
+
const onSelectionChangeRef = react.useRef(onSelectionChange);
|
|
10905
|
+
onSelectionChangeRef.current = onSelectionChange;
|
|
10906
|
+
const normalizedItems = react.useMemo(() => {
|
|
10907
|
+
const seenKeys = /* @__PURE__ */ new Map();
|
|
10908
|
+
return items.map((item, index) => {
|
|
10909
|
+
const key = getItemKey(item, index);
|
|
10910
|
+
const comparableKey = getComparableKey(key);
|
|
10911
|
+
const duplicateIndex = seenKeys.get(comparableKey);
|
|
10912
|
+
if (duplicateIndex !== void 0) {
|
|
10913
|
+
throw new TypeError(
|
|
10914
|
+
`useWorkbenchCollectionSelection received duplicate item key "${comparableKey}" at indices ${duplicateIndex} and ${index}.`
|
|
10915
|
+
);
|
|
10916
|
+
}
|
|
10917
|
+
seenKeys.set(comparableKey, index);
|
|
10918
|
+
return { item, index, key };
|
|
10919
|
+
});
|
|
10920
|
+
}, [getItemKey, items]);
|
|
10921
|
+
const itemByKey = react.useMemo(() => {
|
|
10922
|
+
const entries = /* @__PURE__ */ new Map();
|
|
10923
|
+
normalizedItems.forEach((entry) => entries.set(entry.key, entry));
|
|
10924
|
+
return entries;
|
|
10925
|
+
}, [normalizedItems]);
|
|
10926
|
+
const selectedKeys = react.useMemo(
|
|
10927
|
+
() => mode === "none" ? /* @__PURE__ */ new Set() : controlled ? new Set(controlledSelectedKeys ?? []) : internalSelectedKeys,
|
|
10928
|
+
[controlled, controlledSelectedKeys, internalSelectedKeys, mode]
|
|
10929
|
+
);
|
|
10930
|
+
const selectedKeysRef = react.useRef(selectedKeys);
|
|
10931
|
+
selectedKeysRef.current = selectedKeys;
|
|
10932
|
+
const resetAnchor = react.useCallback(() => {
|
|
10933
|
+
anchorKeyRef.current = null;
|
|
10934
|
+
}, []);
|
|
10935
|
+
react.useEffect(() => {
|
|
10936
|
+
if (controlled) return;
|
|
10937
|
+
const availableKeys = new Set(normalizedItems.map(({ key }) => key));
|
|
10938
|
+
setInternalSelectedKeys((previous) => {
|
|
10939
|
+
const next = new Set(Array.from(previous).filter((key) => availableKeys.has(key)));
|
|
10940
|
+
if (setsEqual(previous, next)) return previous;
|
|
10941
|
+
selectedKeysRef.current = next;
|
|
10942
|
+
return next;
|
|
10943
|
+
});
|
|
10944
|
+
}, [controlled, normalizedItems]);
|
|
10945
|
+
react.useEffect(() => {
|
|
10946
|
+
const anchorKey = anchorKeyRef.current;
|
|
10947
|
+
if (mode !== "multiple" || selectedKeys.size === 0 || anchorKey === null) {
|
|
10948
|
+
resetAnchor();
|
|
10949
|
+
return;
|
|
10950
|
+
}
|
|
10951
|
+
const anchor = itemByKey.get(anchorKey);
|
|
10952
|
+
if (!anchor || isItemDisabled?.(anchor.item, anchor.index)) resetAnchor();
|
|
10953
|
+
}, [isItemDisabled, itemByKey, mode, resetAnchor, selectedKeys.size]);
|
|
10954
|
+
const selectKey = react.useCallback((key, intent = {}) => {
|
|
10955
|
+
if (mode === "none") return;
|
|
10956
|
+
const entry = itemByKey.get(key);
|
|
10957
|
+
if (!entry || isItemDisabled?.(entry.item, entry.index)) return;
|
|
10958
|
+
const current = new Set(selectedKeysRef.current);
|
|
10959
|
+
const configuredBehavior = behavior ?? getDefaultBehavior(mode);
|
|
10960
|
+
let effectiveBehavior = intent.shiftKey && mode === "multiple" ? "range" : intent.behavior ?? configuredBehavior;
|
|
10961
|
+
if (mode === "single") {
|
|
10962
|
+
effectiveBehavior = effectiveBehavior === "toggle" ? "toggle" : "replace";
|
|
10963
|
+
}
|
|
10964
|
+
const anchor = anchorKeyRef.current === null ? void 0 : itemByKey.get(anchorKeyRef.current);
|
|
10965
|
+
const hasValidAnchor = Boolean(
|
|
10966
|
+
anchor && !isItemDisabled?.(anchor.item, anchor.index)
|
|
10967
|
+
);
|
|
10968
|
+
if (mode === "multiple" && effectiveBehavior === "range" && !hasValidAnchor) {
|
|
10969
|
+
effectiveBehavior = configuredBehavior === "range" ? "toggle" : configuredBehavior;
|
|
10970
|
+
}
|
|
10971
|
+
const next = /* @__PURE__ */ new Set();
|
|
10972
|
+
if (mode === "single") {
|
|
10973
|
+
if (!(effectiveBehavior === "toggle" && current.has(entry.key))) next.add(entry.key);
|
|
10974
|
+
} else if (effectiveBehavior === "range" && anchor) {
|
|
10975
|
+
current.forEach((selectedKey) => next.add(selectedKey));
|
|
10976
|
+
const start = Math.min(anchor.index, entry.index);
|
|
10977
|
+
const end = Math.max(anchor.index, entry.index);
|
|
10978
|
+
normalizedItems.slice(start, end + 1).forEach((candidate) => {
|
|
10979
|
+
if (!isItemDisabled?.(candidate.item, candidate.index)) next.add(candidate.key);
|
|
10980
|
+
});
|
|
10981
|
+
} else if (effectiveBehavior === "replace") {
|
|
10982
|
+
next.add(entry.key);
|
|
10983
|
+
} else {
|
|
10984
|
+
current.forEach((selectedKey) => next.add(selectedKey));
|
|
10985
|
+
if (next.has(entry.key)) next.delete(entry.key);
|
|
10986
|
+
else next.add(entry.key);
|
|
10987
|
+
}
|
|
10988
|
+
anchorKeyRef.current = mode === "multiple" ? entry.key : null;
|
|
10989
|
+
if (!controlled) {
|
|
10990
|
+
selectedKeysRef.current = next;
|
|
10991
|
+
setInternalSelectedKeys(next);
|
|
10992
|
+
}
|
|
10993
|
+
onSelectionChangeRef.current?.(next, {
|
|
10994
|
+
item: entry.item,
|
|
10995
|
+
index: entry.index,
|
|
10996
|
+
key: entry.key,
|
|
10997
|
+
behavior: effectiveBehavior
|
|
10998
|
+
});
|
|
10999
|
+
}, [behavior, controlled, isItemDisabled, itemByKey, mode, normalizedItems]);
|
|
11000
|
+
const isSelected = react.useCallback(
|
|
11001
|
+
(key) => selectedKeys.has(key),
|
|
11002
|
+
[selectedKeys]
|
|
11003
|
+
);
|
|
11004
|
+
return {
|
|
11005
|
+
mode,
|
|
11006
|
+
selectedKeys,
|
|
11007
|
+
isSelected,
|
|
11008
|
+
selectKey,
|
|
11009
|
+
resetAnchor
|
|
11010
|
+
};
|
|
11011
|
+
}
|
|
10876
11012
|
var DEFAULT_GAP_PX = 12;
|
|
10877
11013
|
var DEFAULT_ROW_HEIGHT_PX = 8;
|
|
10878
11014
|
var DEFAULT_CARD_WIDTH_PX = 280;
|
|
@@ -10996,13 +11132,6 @@ function getParentScrollOwner(node) {
|
|
|
10996
11132
|
}
|
|
10997
11133
|
return null;
|
|
10998
11134
|
}
|
|
10999
|
-
function setsEqual(left, right) {
|
|
11000
|
-
if (left.size !== right.size) return false;
|
|
11001
|
-
for (const value of left) {
|
|
11002
|
-
if (!right.has(value)) return false;
|
|
11003
|
-
}
|
|
11004
|
-
return true;
|
|
11005
|
-
}
|
|
11006
11135
|
function isInteractiveEventTarget(target, currentTarget) {
|
|
11007
11136
|
if (typeof Element === "undefined" || !(target instanceof Element) || target === currentTarget) return false;
|
|
11008
11137
|
const control = target.closest(
|
|
@@ -11010,19 +11139,6 @@ function isInteractiveEventTarget(target, currentTarget) {
|
|
|
11010
11139
|
);
|
|
11011
11140
|
return Boolean(control && currentTarget.contains(control));
|
|
11012
11141
|
}
|
|
11013
|
-
function warnOnDuplicateKeys(keys) {
|
|
11014
|
-
if (typeof process !== "undefined" && process.env?.NODE_ENV === "production") return;
|
|
11015
|
-
const seen = /* @__PURE__ */ new Set();
|
|
11016
|
-
const duplicates = /* @__PURE__ */ new Set();
|
|
11017
|
-
keys.forEach((key) => {
|
|
11018
|
-
const stringKey = String(key);
|
|
11019
|
-
if (seen.has(stringKey)) duplicates.add(stringKey);
|
|
11020
|
-
seen.add(stringKey);
|
|
11021
|
-
});
|
|
11022
|
-
if (duplicates.size) {
|
|
11023
|
-
console.warn(`WorkbenchCollection received duplicate item keys: ${Array.from(duplicates).join(", ")}`);
|
|
11024
|
-
}
|
|
11025
|
-
}
|
|
11026
11142
|
function normalizeTitleMaxLines(value) {
|
|
11027
11143
|
if (!Number.isFinite(value) || Number(value) <= 0) return void 0;
|
|
11028
11144
|
return clamp3(Math.round(Number(value)), 1, 12);
|
|
@@ -11045,7 +11161,6 @@ function WorkbenchCollection({
|
|
|
11045
11161
|
const rootRef = react.useRef(null);
|
|
11046
11162
|
const itemsRef = react.useRef(null);
|
|
11047
11163
|
const loadMoreRef = react.useRef(null);
|
|
11048
|
-
const lastSelectedIndexRef = react.useRef(null);
|
|
11049
11164
|
const loadMoreRequestPendingRef = react.useRef(false);
|
|
11050
11165
|
const loadMoreIntersectionActiveRef = react.useRef(false);
|
|
11051
11166
|
const loadMoreIntersectionConsumedRef = react.useRef(false);
|
|
@@ -11054,9 +11169,6 @@ function WorkbenchCollection({
|
|
|
11054
11169
|
const layoutReadyRef = react.useRef(false);
|
|
11055
11170
|
const [containerWidth, setContainerWidth] = react.useState(0);
|
|
11056
11171
|
const [itemsNode, setItemsNode] = react.useState(null);
|
|
11057
|
-
const [internalSelectedKeys, setInternalSelectedKeys] = react.useState(
|
|
11058
|
-
() => new Set(config.selection?.defaultSelectedKeys ?? [])
|
|
11059
|
-
);
|
|
11060
11172
|
const callbacksRef = react.useRef(callbacks);
|
|
11061
11173
|
callbacksRef.current = callbacks;
|
|
11062
11174
|
const registerItemsNode = react.useCallback((node) => {
|
|
@@ -11074,10 +11186,6 @@ function WorkbenchCollection({
|
|
|
11074
11186
|
const key = getItemKey(item, index);
|
|
11075
11187
|
return { item, index, key, stringKey: String(key) };
|
|
11076
11188
|
}), [getItemKey, items]);
|
|
11077
|
-
const keys = react.useMemo(
|
|
11078
|
-
() => normalizedItems.map(({ key }) => key),
|
|
11079
|
-
[normalizedItems]
|
|
11080
|
-
);
|
|
11081
11189
|
const keysSignature = normalizedItems.map(({ stringKey }) => stringKey).join("");
|
|
11082
11190
|
const state = config.state;
|
|
11083
11191
|
const loading = state?.loading === true;
|
|
@@ -11085,21 +11193,32 @@ function WorkbenchCollection({
|
|
|
11085
11193
|
const hasMore = state?.hasMore === true;
|
|
11086
11194
|
const loadingVariant = resolveWorkbenchCollectionLoadingVariant(config.loading?.variant);
|
|
11087
11195
|
const layoutItemCount = loading && normalizedItems.length === 0 && loadingVariant === "skeleton" ? resolveWorkbenchCollectionSkeletonCapacity(config.loading?.skeleton) : normalizedItems.length;
|
|
11088
|
-
react.useEffect(() => warnOnDuplicateKeys(keys), [keys, keysSignature]);
|
|
11089
11196
|
const selectionMode = config.selection?.mode ?? "none";
|
|
11090
|
-
const
|
|
11091
|
-
|
|
11092
|
-
|
|
11093
|
-
[config.selection?.selectedKeys, controlledSelection, internalSelectedKeys, selectionMode]
|
|
11197
|
+
const isSelectionItemDisabled = react.useCallback(
|
|
11198
|
+
(entry) => config.selection?.isItemDisabled?.(entry.item, entry.index) ?? false,
|
|
11199
|
+
[config.selection?.isItemDisabled]
|
|
11094
11200
|
);
|
|
11095
|
-
react.
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11201
|
+
const getSelectionItemKey = react.useCallback(
|
|
11202
|
+
(entry) => entry.key,
|
|
11203
|
+
[]
|
|
11204
|
+
);
|
|
11205
|
+
const handleSelectionChange = react.useCallback((next, details) => {
|
|
11206
|
+
callbacksRef.current?.onSelectionChange?.(next, {
|
|
11207
|
+
item: details.item.item,
|
|
11208
|
+
key: details.key,
|
|
11209
|
+
behavior: details.behavior
|
|
11101
11210
|
});
|
|
11102
|
-
}, [
|
|
11211
|
+
}, []);
|
|
11212
|
+
const { selectedKeys, selectKey } = useWorkbenchCollectionSelection({
|
|
11213
|
+
items: normalizedItems,
|
|
11214
|
+
getItemKey: getSelectionItemKey,
|
|
11215
|
+
mode: selectionMode,
|
|
11216
|
+
behavior: config.selection?.behavior,
|
|
11217
|
+
selectedKeys: config.selection?.selectedKeys,
|
|
11218
|
+
defaultSelectedKeys: config.selection?.defaultSelectedKeys,
|
|
11219
|
+
isItemDisabled: isSelectionItemDisabled,
|
|
11220
|
+
onSelectionChange: handleSelectionChange
|
|
11221
|
+
});
|
|
11103
11222
|
react.useEffect(() => {
|
|
11104
11223
|
const node = itemsNode;
|
|
11105
11224
|
if (!node) return void 0;
|
|
@@ -11337,30 +11456,6 @@ function WorkbenchCollection({
|
|
|
11337
11456
|
});
|
|
11338
11457
|
return Array.from(grouped.values());
|
|
11339
11458
|
}, [config.grouping, normalizedItems]);
|
|
11340
|
-
const setSelection = react.useCallback((entry, behavior = config.selection?.behavior ?? (selectionMode === "multiple" ? "toggle" : "replace")) => {
|
|
11341
|
-
if (selectionMode === "none" || config.selection?.isItemDisabled?.(entry.item, entry.index)) return;
|
|
11342
|
-
const current = new Set(selectedKeys);
|
|
11343
|
-
const next = /* @__PURE__ */ new Set();
|
|
11344
|
-
if (selectionMode === "single") {
|
|
11345
|
-
if (!(behavior === "toggle" && current.has(entry.key))) next.add(entry.key);
|
|
11346
|
-
} else if (behavior === "range" && lastSelectedIndexRef.current !== null) {
|
|
11347
|
-
current.forEach((key) => next.add(key));
|
|
11348
|
-
const start = Math.min(lastSelectedIndexRef.current, entry.index);
|
|
11349
|
-
const end = Math.max(lastSelectedIndexRef.current, entry.index);
|
|
11350
|
-
normalizedItems.slice(start, end + 1).forEach((candidate) => {
|
|
11351
|
-
if (!config.selection?.isItemDisabled?.(candidate.item, candidate.index)) next.add(candidate.key);
|
|
11352
|
-
});
|
|
11353
|
-
} else if (behavior === "replace") {
|
|
11354
|
-
next.add(entry.key);
|
|
11355
|
-
} else {
|
|
11356
|
-
current.forEach((key) => next.add(key));
|
|
11357
|
-
if (next.has(entry.key)) next.delete(entry.key);
|
|
11358
|
-
else next.add(entry.key);
|
|
11359
|
-
}
|
|
11360
|
-
lastSelectedIndexRef.current = entry.index;
|
|
11361
|
-
if (!controlledSelection) setInternalSelectedKeys(next);
|
|
11362
|
-
callbacks?.onSelectionChange?.(next, { item: entry.item, key: entry.key, behavior });
|
|
11363
|
-
}, [callbacks, config.selection, controlledSelection, normalizedItems, selectedKeys, selectionMode]);
|
|
11364
11459
|
const createItemContext = react.useCallback((entry, layout) => {
|
|
11365
11460
|
const disabled = config.selection?.isItemDisabled?.(entry.item, entry.index) ?? false;
|
|
11366
11461
|
const context = {
|
|
@@ -11372,7 +11467,11 @@ function WorkbenchCollection({
|
|
|
11372
11467
|
selected: selectedKeys.has(entry.key),
|
|
11373
11468
|
selectionMode,
|
|
11374
11469
|
layout,
|
|
11375
|
-
select: (behavior) =>
|
|
11470
|
+
select: (behavior) => selectKey(entry.key, { behavior }),
|
|
11471
|
+
selectFromEvent: (event, behavior) => selectKey(entry.key, {
|
|
11472
|
+
behavior,
|
|
11473
|
+
shiftKey: event.shiftKey
|
|
11474
|
+
}),
|
|
11376
11475
|
preview: () => callbacks?.onItemPreview?.(entry.item, context),
|
|
11377
11476
|
detail: () => callbacks?.onItemDetail?.(entry.item, context),
|
|
11378
11477
|
renderSlot: (name) => {
|
|
@@ -11382,12 +11481,12 @@ function WorkbenchCollection({
|
|
|
11382
11481
|
notifyMediaError: (error) => callbacks?.onMediaError?.(entry.item, context, error)
|
|
11383
11482
|
};
|
|
11384
11483
|
return context;
|
|
11385
|
-
}, [callbacks, config.getItemStatus, config.selection, selectedKeys,
|
|
11484
|
+
}, [callbacks, config.getItemStatus, config.selection, selectedKeys, selectKey, selectionMode, slots?.item]);
|
|
11386
11485
|
const getItemInteractionProps = react.useCallback((entry, context) => {
|
|
11387
11486
|
const handleKeyboard = (event) => {
|
|
11388
11487
|
if (event.target !== event.currentTarget || event.key !== "Enter" && event.key !== " ") return;
|
|
11389
11488
|
event.preventDefault();
|
|
11390
|
-
if (selectionMode !== "none") context.
|
|
11489
|
+
if (selectionMode !== "none") context.selectFromEvent(event);
|
|
11391
11490
|
else callbacks?.onItemClick?.(entry.item, context, event);
|
|
11392
11491
|
};
|
|
11393
11492
|
return {
|
|
@@ -11416,7 +11515,7 @@ function WorkbenchCollection({
|
|
|
11416
11515
|
),
|
|
11417
11516
|
onClick: (event) => {
|
|
11418
11517
|
if (isInteractiveEventTarget(event.target, event.currentTarget)) return;
|
|
11419
|
-
if (selectionMode !== "none") context.
|
|
11518
|
+
if (selectionMode !== "none") context.selectFromEvent(event);
|
|
11420
11519
|
callbacks?.onItemClick?.(entry.item, context, event);
|
|
11421
11520
|
},
|
|
11422
11521
|
onDoubleClick: (event) => {
|
|
@@ -13991,5 +14090,6 @@ exports.WorkbenchResizableSidebar = WorkbenchResizableSidebar;
|
|
|
13991
14090
|
exports.WorkbenchScatterPlot = WorkbenchScatterPlot;
|
|
13992
14091
|
exports.WorkbenchSelectionTray = WorkbenchSelectionTray;
|
|
13993
14092
|
exports.WorkbenchTableView = WorkbenchTableView;
|
|
14093
|
+
exports.useWorkbenchCollectionSelection = useWorkbenchCollectionSelection;
|
|
13994
14094
|
//# sourceMappingURL=index.js.map
|
|
13995
14095
|
//# sourceMappingURL=index.js.map
|