@prorobotech/openapi-k8s-toolkit 1.5.0-alpha.6 → 1.5.0-alpha.7

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.
@@ -1,2 +1,2 @@
1
- export { ai as BackToDefaultIcon, aP as BlackholeForm, aO as BlackholeFormProvider, aK as ClusterListTable, af as ConfirmModal, at as ContentCard, az as CursorDefaultDiv, ax as CursorPointerTag, ay as CursorPointerTagMinContent, aw as CustomSelect, D as DeleteIcon, l as DeleteModal, n as DeleteModalMany, ah as DownIcon, b0 as DynamicComponents, a$ as DynamicRenderer, b1 as DynamicRendererWithProviders, as as EarthIcon, h as EditIcon, aJ as EnrichedTable, E as EnrichedTableProvider, aB as ErrorBoundary, aC as ErrorBoundaryWithDataReset, a_ as Events, au as FlexGrow, an as LockedIcon, ar as LookingGlassIcon, aF as ManageableBreadcrumbs, aD as ManageableBreadcrumbsProvider, aI as ManageableSidebar, aG as ManageableSidebarProvider, aR as MarketPlace, aS as MarketplaceCard, am as MinusIcon, aV as NodeTerminal, i as PaddingContainer, ap as PauseCircleIcon, al as PlusIcon, aW as PodLogs, aX as PodLogsMonaco, aU as PodTerminal, aT as ProjectInfoCard, aA as ResourceLink, aq as ResumeCircleIcon, aZ as Search, ad as Spacer, aj as SuccessIcon, ae as TreeWithSearch, av as UncontrolledSelect, ao as UnlockedIcon, ag as UpIcon, aY as VMVNC, aN as YamlEditorSingleton, Q as checkIfApiInstanceNamespaceScoped, S as checkIfBuiltInInstanceNamespaceScoped, L as checkPermission, bx as convertBytes, bF as convertCompute, bC as convertCores, bA as convertStorage, bg as createContextFactory, q as createNewEntry, bi as deepMerge, t as deleteEntry, ak as feedbackIcons, N as filterIfApiInstanceNamespaceScoped, O as filterIfBuiltInInstanceNamespaceScoped, b4 as filterSelectOptions, b6 as floorToDecimal, by as formatBytesAuto, bD as formatCoresAuto, bH as formatDateAuto, bb as getAllPathsFromObj, z as getApiResourceSingle, G as getApiResourceTypes, H as getApiResourceTypesByApiGroup, y as getApiResources, B as getBuiltinResourceSingle, I as getBuiltinResourceTypes, A as getBuiltinResources, be as getBuiltinTreeData, o as getClusterList, J as getCrdData, F as getCrdResourceSingle, C as getCrdResources, K as getDirectUnknownResource, aL as getEnrichedColumns, aM as getEnrichedColumnsWithControls, bf as getGroupsByCategory, T as getKinds, br as getLinkToApiForm, bq as getLinkToBuiltinForm, k as getLinkToForm, bw as getNamespaceLink, aQ as getObjectFormItemsDraft, bc as getPrefixSubarrays, bv as getResourceLink, bj as getSortedKinds, bk as getSortedKindsAll, b5 as getStringByName, M as getSwagger, bm as getUppercase, bd as groupsToTreeData, bl as hslFromString, bu as includesArray, b3 as isFlatObject, bt as isMultilineFromYaml, bs as isMultilineString, bI as isValidRFC3339, bn as kindByGvr, bp as namespacedByGvr, ba as normalizeValuesForQuotasToNumber, bG as parseCoresWithUnit, b7 as parseQuotaValue, b8 as parseQuotaValueCpu, b9 as parseQuotaValueMemoryAndStorage, bB as parseValueWithUnit, x as patchEntryWithDeleteOp, w as patchEntryWithMergePatch, v as patchEntryWithReplaceOp, bo as pluralByKind, aE as prepareDataForManageableBreadcrumbs, aH as prepareDataForManageableSidebar, b2 as prepareTemplate, bh as prepareUrlsToFetchForDynamicRenderer, bz as toBytes, bE as toCores, r as updateEntry, W as useApiResourceSingle, a1 as useApiResourceTypesByGroup, V as useApiResources, a0 as useApisResourceTypes, Y as useBuiltinResourceSingle, a2 as useBuiltinResourceTypes, X as useBuiltinResources, U as useClusterList, a3 as useCrdData, $ as useCrdResourceSingle, Z as useCrdResources, e as useDirectUnknownResource, a5 as useInfiniteSentinel, f as useK8sSmartResource, a6 as useK8sVerbs, aa as useKinds, ab as useKindsRaw, a4 as useListWatch, a7 as useManyK8sSmartResource, d as usePermissions, ac as usePluginManifest, a9 as useResourceScope, a8 as useSmartResourceParams } from './index-C5cixTVm.mjs';
1
+ export { ai as BackToDefaultIcon, aP as BlackholeForm, aO as BlackholeFormProvider, aK as ClusterListTable, af as ConfirmModal, at as ContentCard, az as CursorDefaultDiv, ax as CursorPointerTag, ay as CursorPointerTagMinContent, aw as CustomSelect, D as DeleteIcon, l as DeleteModal, n as DeleteModalMany, ah as DownIcon, b0 as DynamicComponents, a$ as DynamicRenderer, b1 as DynamicRendererWithProviders, as as EarthIcon, h as EditIcon, aJ as EnrichedTable, E as EnrichedTableProvider, aB as ErrorBoundary, aC as ErrorBoundaryWithDataReset, a_ as Events, au as FlexGrow, an as LockedIcon, ar as LookingGlassIcon, aF as ManageableBreadcrumbs, aD as ManageableBreadcrumbsProvider, aI as ManageableSidebar, aG as ManageableSidebarProvider, aR as MarketPlace, aS as MarketplaceCard, am as MinusIcon, aV as NodeTerminal, i as PaddingContainer, ap as PauseCircleIcon, al as PlusIcon, aW as PodLogs, aX as PodLogsMonaco, aU as PodTerminal, aT as ProjectInfoCard, aA as ResourceLink, aq as ResumeCircleIcon, aZ as Search, ad as Spacer, aj as SuccessIcon, ae as TreeWithSearch, av as UncontrolledSelect, ao as UnlockedIcon, ag as UpIcon, aY as VMVNC, aN as YamlEditorSingleton, Q as checkIfApiInstanceNamespaceScoped, S as checkIfBuiltInInstanceNamespaceScoped, L as checkPermission, bx as convertBytes, bF as convertCompute, bC as convertCores, bA as convertStorage, bg as createContextFactory, q as createNewEntry, bi as deepMerge, t as deleteEntry, ak as feedbackIcons, N as filterIfApiInstanceNamespaceScoped, O as filterIfBuiltInInstanceNamespaceScoped, b4 as filterSelectOptions, b6 as floorToDecimal, by as formatBytesAuto, bD as formatCoresAuto, bH as formatDateAuto, bb as getAllPathsFromObj, z as getApiResourceSingle, G as getApiResourceTypes, H as getApiResourceTypesByApiGroup, y as getApiResources, B as getBuiltinResourceSingle, I as getBuiltinResourceTypes, A as getBuiltinResources, be as getBuiltinTreeData, o as getClusterList, J as getCrdData, F as getCrdResourceSingle, C as getCrdResources, K as getDirectUnknownResource, aL as getEnrichedColumns, aM as getEnrichedColumnsWithControls, bf as getGroupsByCategory, T as getKinds, br as getLinkToApiForm, bq as getLinkToBuiltinForm, k as getLinkToForm, bw as getNamespaceLink, aQ as getObjectFormItemsDraft, bc as getPrefixSubarrays, bv as getResourceLink, bj as getSortedKinds, bk as getSortedKindsAll, b5 as getStringByName, M as getSwagger, bm as getUppercase, bd as groupsToTreeData, bl as hslFromString, bu as includesArray, b3 as isFlatObject, bt as isMultilineFromYaml, bs as isMultilineString, bI as isValidRFC3339, bn as kindByGvr, bp as namespacedByGvr, ba as normalizeValuesForQuotasToNumber, bG as parseCoresWithUnit, b7 as parseQuotaValue, b8 as parseQuotaValueCpu, b9 as parseQuotaValueMemoryAndStorage, bB as parseValueWithUnit, x as patchEntryWithDeleteOp, w as patchEntryWithMergePatch, v as patchEntryWithReplaceOp, bo as pluralByKind, aE as prepareDataForManageableBreadcrumbs, aH as prepareDataForManageableSidebar, b2 as prepareTemplate, bh as prepareUrlsToFetchForDynamicRenderer, bz as toBytes, bE as toCores, r as updateEntry, W as useApiResourceSingle, a1 as useApiResourceTypesByGroup, V as useApiResources, a0 as useApisResourceTypes, Y as useBuiltinResourceSingle, a2 as useBuiltinResourceTypes, X as useBuiltinResources, U as useClusterList, a3 as useCrdData, $ as useCrdResourceSingle, Z as useCrdResources, e as useDirectUnknownResource, a5 as useInfiniteSentinel, f as useK8sSmartResource, a6 as useK8sVerbs, aa as useKinds, ab as useKindsRaw, a4 as useListWatch, a7 as useManyK8sSmartResource, d as usePermissions, ac as usePluginManifest, a9 as useResourceScope, a8 as useSmartResourceParams } from './index-DxI19K37.mjs';
2
2
  //# sourceMappingURL=openapi-k8s-toolkit.es.js.map
@@ -34587,6 +34587,18 @@
34587
34587
  && .ant-table-expanded-row-fixed {
34588
34588
  width: auto !important;
34589
34589
  }
34590
+
34591
+ /* Virtual tables keep rc-virtual-list's own scrollbar; the custom synced scrollbar is disabled for them. */
34592
+ && .ant-table:not(.ant-table-virtual) .ant-table-content,
34593
+ && .ant-table:not(.ant-table-virtual) .ant-table-body {
34594
+ scrollbar-width: none;
34595
+ }
34596
+
34597
+ && .ant-table:not(.ant-table-virtual) .ant-table-content::-webkit-scrollbar,
34598
+ && .ant-table:not(.ant-table-virtual) .ant-table-body::-webkit-scrollbar {
34599
+ height: 0;
34600
+ width: 0;
34601
+ }
34590
34602
  `;
34591
34603
  const HideableControls = styled.div`
34592
34604
  && .ant-table-row .hideable {
@@ -34656,6 +34668,196 @@
34656
34668
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { wrap: "nowrap", gap: "4px", children: renderTableTags(tags) });
34657
34669
  };
34658
34670
 
34671
+ const SCROLLABLE_TABLE_SELECTOR = ".ant-table-body, .ant-table-content";
34672
+ const EMPTY_SCROLLBAR_METRICS = {
34673
+ clientWidth: 0,
34674
+ scrollWidth: 0,
34675
+ visible: false
34676
+ };
34677
+ const HorizontalScrollbar = styled.div`
34678
+ position: sticky;
34679
+ bottom: var(--enriched-table-scrollbar-bottom-offset, 0px);
34680
+ z-index: 1056;
34681
+ height: 14px;
34682
+ overflow-x: auto;
34683
+ overflow-y: hidden;
34684
+ background: transparent;
34685
+ scrollbar-width: thin;
34686
+ scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
34687
+
34688
+ &::-webkit-scrollbar {
34689
+ height: 12px;
34690
+ }
34691
+
34692
+ &::-webkit-scrollbar-track {
34693
+ background: transparent;
34694
+ }
34695
+
34696
+ &::-webkit-scrollbar-thumb {
34697
+ background-color: rgba(0, 0, 0, 0.35);
34698
+ background-clip: content-box;
34699
+ border: 3px solid transparent;
34700
+ border-radius: 999px;
34701
+ }
34702
+ `;
34703
+ const HorizontalScrollbarInner = styled.div`
34704
+ height: 1px;
34705
+ `;
34706
+ const SyncedHorizontalScrollbar = ({
34707
+ tableContainerRef,
34708
+ disabled = false
34709
+ }) => {
34710
+ const scrollbarRef = React$1.useRef(null);
34711
+ const tableScrollerRef = React$1.useRef(null);
34712
+ const isSyncingRef = React$1.useRef(false);
34713
+ const refreshRafRef = React$1.useRef(null);
34714
+ const [metrics, setMetrics] = React$1.useState(EMPTY_SCROLLBAR_METRICS);
34715
+ const [scrollerBinding, setScrollerBinding] = React$1.useState({
34716
+ scroller: null,
34717
+ content: null
34718
+ });
34719
+ const releaseSyncLock = React$1.useCallback(() => {
34720
+ if (typeof window.requestAnimationFrame !== "function") {
34721
+ isSyncingRef.current = false;
34722
+ return;
34723
+ }
34724
+ window.requestAnimationFrame(() => {
34725
+ isSyncingRef.current = false;
34726
+ });
34727
+ }, []);
34728
+ const bindTableScroller = React$1.useCallback((tableScroller) => {
34729
+ const tableScrollerContent = tableScroller?.firstElementChild || null;
34730
+ tableScrollerRef.current = tableScroller;
34731
+ setScrollerBinding(
34732
+ (currentBinding) => currentBinding.scroller === tableScroller && currentBinding.content === tableScrollerContent ? currentBinding : {
34733
+ scroller: tableScroller,
34734
+ content: tableScrollerContent
34735
+ }
34736
+ );
34737
+ }, []);
34738
+ const findTableScroller = React$1.useCallback(
34739
+ () => disabled ? null : tableContainerRef.current?.querySelector(SCROLLABLE_TABLE_SELECTOR) || null,
34740
+ [disabled, tableContainerRef]
34741
+ );
34742
+ const updateMetrics = React$1.useCallback((tableScroller) => {
34743
+ tableScrollerRef.current = tableScroller;
34744
+ if (!tableScroller) {
34745
+ setMetrics((currentMetrics) => currentMetrics.visible ? EMPTY_SCROLLBAR_METRICS : currentMetrics);
34746
+ return;
34747
+ }
34748
+ const nextMetrics = {
34749
+ clientWidth: tableScroller.clientWidth,
34750
+ scrollWidth: tableScroller.scrollWidth,
34751
+ visible: tableScroller.scrollWidth > tableScroller.clientWidth + 1
34752
+ };
34753
+ setMetrics(
34754
+ (currentMetrics) => currentMetrics.clientWidth === nextMetrics.clientWidth && currentMetrics.scrollWidth === nextMetrics.scrollWidth && currentMetrics.visible === nextMetrics.visible ? currentMetrics : nextMetrics
34755
+ );
34756
+ if (scrollbarRef.current && scrollbarRef.current.scrollLeft !== tableScroller.scrollLeft) {
34757
+ scrollbarRef.current.scrollLeft = tableScroller.scrollLeft;
34758
+ }
34759
+ }, []);
34760
+ const refreshTableScroller = React$1.useCallback(() => {
34761
+ const tableScroller = findTableScroller();
34762
+ bindTableScroller(tableScroller);
34763
+ updateMetrics(tableScroller);
34764
+ }, [bindTableScroller, findTableScroller, updateMetrics]);
34765
+ const cancelScheduledRefresh = React$1.useCallback(() => {
34766
+ if (refreshRafRef.current === null || typeof window.cancelAnimationFrame !== "function") {
34767
+ return;
34768
+ }
34769
+ window.cancelAnimationFrame(refreshRafRef.current);
34770
+ refreshRafRef.current = null;
34771
+ }, []);
34772
+ const scheduleRefreshTableScroller = React$1.useCallback(() => {
34773
+ if (typeof window.requestAnimationFrame !== "function") {
34774
+ refreshTableScroller();
34775
+ return;
34776
+ }
34777
+ if (refreshRafRef.current !== null) {
34778
+ return;
34779
+ }
34780
+ refreshRafRef.current = window.requestAnimationFrame(() => {
34781
+ refreshRafRef.current = null;
34782
+ refreshTableScroller();
34783
+ });
34784
+ }, [refreshTableScroller]);
34785
+ React$1.useLayoutEffect(() => {
34786
+ refreshTableScroller();
34787
+ }, [refreshTableScroller]);
34788
+ React$1.useEffect(() => {
34789
+ refreshTableScroller();
34790
+ }, [refreshTableScroller]);
34791
+ React$1.useEffect(() => {
34792
+ if (disabled || !tableContainerRef.current || typeof MutationObserver !== "function") {
34793
+ return void 0;
34794
+ }
34795
+ const mutationObserver = new MutationObserver(scheduleRefreshTableScroller);
34796
+ mutationObserver.observe(tableContainerRef.current, {
34797
+ childList: true,
34798
+ subtree: true
34799
+ });
34800
+ return () => {
34801
+ cancelScheduledRefresh();
34802
+ mutationObserver.disconnect();
34803
+ };
34804
+ }, [cancelScheduledRefresh, disabled, scheduleRefreshTableScroller, tableContainerRef]);
34805
+ React$1.useEffect(() => cancelScheduledRefresh, [cancelScheduledRefresh]);
34806
+ React$1.useEffect(() => {
34807
+ const { scroller: tableScroller, content: tableScrollerContent } = scrollerBinding;
34808
+ if (disabled) {
34809
+ updateMetrics(null);
34810
+ return void 0;
34811
+ }
34812
+ if (!tableScroller) {
34813
+ return void 0;
34814
+ }
34815
+ const syncFromTable = () => {
34816
+ if (isSyncingRef.current || !scrollbarRef.current) {
34817
+ return;
34818
+ }
34819
+ isSyncingRef.current = true;
34820
+ scrollbarRef.current.scrollLeft = tableScroller.scrollLeft;
34821
+ releaseSyncLock();
34822
+ };
34823
+ tableScroller.addEventListener("scroll", syncFromTable, { passive: true });
34824
+ window.addEventListener("resize", scheduleRefreshTableScroller);
34825
+ const resizeObserver = typeof ResizeObserver === "function" ? new ResizeObserver(() => updateMetrics(tableScroller)) : void 0;
34826
+ resizeObserver?.observe(tableScroller);
34827
+ if (tableScrollerContent) {
34828
+ resizeObserver?.observe(tableScrollerContent);
34829
+ }
34830
+ updateMetrics(tableScroller);
34831
+ return () => {
34832
+ tableScroller.removeEventListener("scroll", syncFromTable);
34833
+ window.removeEventListener("resize", scheduleRefreshTableScroller);
34834
+ resizeObserver?.disconnect();
34835
+ };
34836
+ }, [disabled, releaseSyncLock, scheduleRefreshTableScroller, scrollerBinding, updateMetrics]);
34837
+ const syncFromScrollbar = React$1.useCallback(() => {
34838
+ const tableScroller = tableScrollerRef.current;
34839
+ if (isSyncingRef.current || !tableScroller || !scrollbarRef.current) {
34840
+ return;
34841
+ }
34842
+ isSyncingRef.current = true;
34843
+ tableScroller.scrollLeft = scrollbarRef.current.scrollLeft;
34844
+ releaseSyncLock();
34845
+ }, [releaseSyncLock]);
34846
+ if (!metrics.visible) {
34847
+ return null;
34848
+ }
34849
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
34850
+ HorizontalScrollbar,
34851
+ {
34852
+ ref: scrollbarRef,
34853
+ "aria-hidden": "true",
34854
+ "data-testid": "enriched-table-horizontal-scrollbar",
34855
+ onScroll: syncFromScrollbar,
34856
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(HorizontalScrollbarInner, { style: { width: metrics.scrollWidth } })
34857
+ }
34858
+ );
34859
+ };
34860
+
34659
34861
  const isFlatObject = (obj) => {
34660
34862
  return Object.entries(obj).every(([, value]) => {
34661
34863
  return value === null || typeof value !== "object";
@@ -82325,13 +82527,16 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82325
82527
  shouldFixActionsColumn,
82326
82528
  currentFixed
82327
82529
  }) => {
82530
+ if (currentFixed !== void 0) {
82531
+ return currentFixed;
82532
+ }
82328
82533
  if (shouldFixNameColumn) {
82329
82534
  return "left";
82330
82535
  }
82331
82536
  if (shouldFixActionsColumn) {
82332
82537
  return "right";
82333
82538
  }
82334
- return currentFixed;
82539
+ return void 0;
82335
82540
  };
82336
82541
  const getFixedColumnWidth = ({
82337
82542
  possibleColWidth,
@@ -82466,9 +82671,11 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82466
82671
  const possibleTooltip = additionalPrinterColumnsTooltips?.find(({ key }) => key === el.key)?.value;
82467
82672
  const possibleCustomTypeWithProps = additionalPrinterColumnsKeyTypeProps && el.key ? additionalPrinterColumnsKeyTypeProps[el.key.toString()] : void 0;
82468
82673
  const originalRender = el.render;
82469
- const shouldFixNameColumn = !hasFixedNameColumn && isNameColumn(el);
82470
- const shouldFixActionsColumn = possibleCustomTypeWithProps?.type === "factory" && hasFactoryItemOfType(possibleCustomTypeWithProps.customProps, "ActionsDropdown");
82471
- if (shouldFixNameColumn) {
82674
+ const columnIsNameColumn = isNameColumn(el);
82675
+ const canAutoFixColumn = el.fixed === void 0;
82676
+ const shouldFixNameColumn = canAutoFixColumn && !hasFixedNameColumn && columnIsNameColumn;
82677
+ const shouldFixActionsColumn = canAutoFixColumn && possibleCustomTypeWithProps?.type === "factory" && hasFactoryItemOfType(possibleCustomTypeWithProps.customProps, "ActionsDropdown");
82678
+ if (columnIsNameColumn && !hasFixedNameColumn) {
82472
82679
  hasFixedNameColumn = true;
82473
82680
  }
82474
82681
  const useFactorySearch = possibleCustomTypeWithProps?.type === "factory";
@@ -82794,6 +83001,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82794
83001
  tableProps
82795
83002
  }) => {
82796
83003
  const navigate = reactRouterDom.useNavigate();
83004
+ const tableContainerRef = React$1.useRef(null);
82797
83005
  if (!columns) {
82798
83006
  return null;
82799
83007
  }
@@ -82849,57 +83057,62 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82849
83057
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
82850
83058
  TableComponents.TableContainer,
82851
83059
  {
83060
+ ref: tableContainerRef,
82852
83061
  $isDark: theme === "dark",
82853
83062
  $isCursorPointer: Boolean(pathToNavigate || rowClickable),
82854
83063
  $borderless: tableProps?.borderless,
82855
83064
  $isTotalLeft: tableProps?.isTotalLeft,
82856
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(TableComponents.HideableControls, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
82857
- antd.Table,
82858
- {
82859
- rowKey,
82860
- dataSource,
82861
- columns: columnsWithControls,
82862
- pagination: tableProps?.disablePagination ? false : {
82863
- position: tableProps?.paginationPosition || ["bottomLeft"],
82864
- showSizeChanger: true,
82865
- defaultPageSize: 10,
82866
- hideOnSinglePage: false,
82867
- showTotal
82868
- },
82869
- scroll: { x: "max-content", y: tableProps?.maxHeight },
82870
- virtual: tableProps?.virtual,
82871
- rowClassName,
82872
- rowSelection: selectData ? {
82873
- type: "checkbox",
82874
- fixed: "left",
82875
- columnWidth: 48,
82876
- selectedRowKeys: selectData.selectedRowKeys,
82877
- onChange: (selectedRowKeys, selectedRows) => {
82878
- const rows = selectedRows;
82879
- selectData.onChange(
82880
- selectedRowKeys,
82881
- rows.map(({ internalDataForControls }) => ({
82882
- name: internalDataForControls.name,
82883
- endpoint: `${internalDataForControls.deletePathPrefix}/${internalDataForControls.apiGroupAndVersion}${internalDataForControls.namespace ? `/namespaces/${internalDataForControls.namespace}` : ""}/${internalDataForControls.plural}/${internalDataForControls.name}`
82884
- }))
82885
- );
82886
- }
82887
- } : void 0,
82888
- onRow: (record) => {
82889
- const consumerRowProps = onRow?.(record, void 0);
82890
- const navigationClickHandler = buildNavigationClickHandler(record);
82891
- return {
82892
- ...consumerRowProps,
82893
- onClick: (event) => {
82894
- consumerRowProps?.onClick?.(event);
82895
- if (!event.defaultPrevented) {
82896
- navigationClickHandler();
82897
- }
83065
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableComponents.HideableControls, { children: [
83066
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
83067
+ antd.Table,
83068
+ {
83069
+ rowKey,
83070
+ dataSource,
83071
+ columns: columnsWithControls,
83072
+ pagination: tableProps?.disablePagination ? false : {
83073
+ position: tableProps?.paginationPosition || ["bottomLeft"],
83074
+ showSizeChanger: true,
83075
+ defaultPageSize: 10,
83076
+ hideOnSinglePage: false,
83077
+ showTotal
83078
+ },
83079
+ scroll: { x: "max-content", y: tableProps?.maxHeight },
83080
+ virtual: tableProps?.virtual,
83081
+ rowClassName,
83082
+ rowSelection: selectData ? {
83083
+ type: "checkbox",
83084
+ // Keep selection controls aligned with the fixed Name column.
83085
+ fixed: "left",
83086
+ columnWidth: 48,
83087
+ selectedRowKeys: selectData.selectedRowKeys,
83088
+ onChange: (selectedRowKeys, selectedRows) => {
83089
+ const rows = selectedRows;
83090
+ selectData.onChange(
83091
+ selectedRowKeys,
83092
+ rows.map(({ internalDataForControls }) => ({
83093
+ name: internalDataForControls.name,
83094
+ endpoint: `${internalDataForControls.deletePathPrefix}/${internalDataForControls.apiGroupAndVersion}${internalDataForControls.namespace ? `/namespaces/${internalDataForControls.namespace}` : ""}/${internalDataForControls.plural}/${internalDataForControls.name}`
83095
+ }))
83096
+ );
82898
83097
  }
82899
- };
83098
+ } : void 0,
83099
+ onRow: (record) => {
83100
+ const consumerRowProps = onRow?.(record, void 0);
83101
+ const navigationClickHandler = buildNavigationClickHandler(record);
83102
+ return {
83103
+ ...consumerRowProps,
83104
+ onClick: (event) => {
83105
+ consumerRowProps?.onClick?.(event);
83106
+ if (!event.defaultPrevented) {
83107
+ navigationClickHandler();
83108
+ }
83109
+ }
83110
+ };
83111
+ }
82900
83112
  }
82901
- }
82902
- ) })
83113
+ ),
83114
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SyncedHorizontalScrollbar, { disabled: tableProps?.virtual, tableContainerRef })
83115
+ ] })
82903
83116
  }
82904
83117
  );
82905
83118
  };
@@ -82917,6 +83130,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82917
83130
  tableProps
82918
83131
  }) => {
82919
83132
  const navigate = reactRouterDom.useNavigate();
83133
+ const tableContainerRef = React$1.useRef(null);
82920
83134
  if (!columns) {
82921
83135
  return null;
82922
83136
  }
@@ -82957,54 +83171,58 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82957
83171
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
82958
83172
  TableComponents.TableContainer,
82959
83173
  {
83174
+ ref: tableContainerRef,
82960
83175
  $isDark: theme === "dark",
82961
83176
  $isCursorPointer: Boolean(
82962
83177
  recordKeysForNavigation && (!!pathToNavigate || !!navigationSettings) || rowClickable
82963
83178
  ),
82964
83179
  $borderless: tableProps?.borderless,
82965
83180
  $isTotalLeft: tableProps?.isTotalLeft,
82966
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(TableComponents.HideableControls, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
82967
- antd.Table,
82968
- {
82969
- rowKey,
82970
- dataSource,
82971
- columns: enrichedColumns,
82972
- pagination: tableProps?.disablePagination ? false : {
82973
- position: tableProps?.paginationPosition || ["bottomLeft"],
82974
- showSizeChanger: true,
82975
- defaultPageSize: 10,
82976
- hideOnSinglePage: false,
82977
- showTotal
82978
- },
82979
- scroll: { x: "max-content", y: tableProps?.maxHeight },
82980
- virtual: tableProps?.virtual,
82981
- rowClassName,
82982
- onRow: (record) => {
82983
- const consumerRowProps = onRow?.(record, void 0);
82984
- return {
82985
- ...consumerRowProps,
82986
- onClick: async (event) => {
82987
- consumerRowProps?.onClick?.(event);
82988
- if (event.defaultPrevented) {
82989
- return;
82990
- }
82991
- if (recordKeysForNavigation) {
82992
- const recordValueRaw = Array.isArray(recordKeysForNavigation) ? lodashExports.get(record, recordKeysForNavigation) : jp.query(record || {}, `$${recordKeysForNavigation}`)[0];
82993
- const clusterName = typeof recordValueRaw === "string" ? recordValueRaw : void 0;
82994
- const recordValue = typeof recordValueRaw === "string" ? recordValueRaw : JSON.stringify(recordValueRaw);
82995
- const fetchedPathToNavigate = await tryGetPathFromNavigationResource(clusterName);
82996
- const finalPathToNavigate = fetchedPathToNavigate || pathToNavigate;
82997
- if (!finalPathToNavigate) {
83181
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableComponents.HideableControls, { children: [
83182
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
83183
+ antd.Table,
83184
+ {
83185
+ rowKey,
83186
+ dataSource,
83187
+ columns: enrichedColumns,
83188
+ pagination: tableProps?.disablePagination ? false : {
83189
+ position: tableProps?.paginationPosition || ["bottomLeft"],
83190
+ showSizeChanger: true,
83191
+ defaultPageSize: 10,
83192
+ hideOnSinglePage: false,
83193
+ showTotal
83194
+ },
83195
+ scroll: { x: "max-content", y: tableProps?.maxHeight },
83196
+ virtual: tableProps?.virtual,
83197
+ rowClassName,
83198
+ onRow: (record) => {
83199
+ const consumerRowProps = onRow?.(record, void 0);
83200
+ return {
83201
+ ...consumerRowProps,
83202
+ onClick: async (event) => {
83203
+ consumerRowProps?.onClick?.(event);
83204
+ if (event.defaultPrevented) {
82998
83205
  return;
82999
83206
  }
83000
- const newPath = finalPathToNavigate.replaceAll("~recordValue~", recordValue);
83001
- navigate(newPath);
83207
+ if (recordKeysForNavigation) {
83208
+ const recordValueRaw = Array.isArray(recordKeysForNavigation) ? lodashExports.get(record, recordKeysForNavigation) : jp.query(record || {}, `$${recordKeysForNavigation}`)[0];
83209
+ const clusterName = typeof recordValueRaw === "string" ? recordValueRaw : void 0;
83210
+ const recordValue = typeof recordValueRaw === "string" ? recordValueRaw : JSON.stringify(recordValueRaw);
83211
+ const fetchedPathToNavigate = await tryGetPathFromNavigationResource(clusterName);
83212
+ const finalPathToNavigate = fetchedPathToNavigate || pathToNavigate;
83213
+ if (!finalPathToNavigate) {
83214
+ return;
83215
+ }
83216
+ const newPath = finalPathToNavigate.replaceAll("~recordValue~", recordValue);
83217
+ navigate(newPath);
83218
+ }
83002
83219
  }
83003
- }
83004
- };
83220
+ };
83221
+ }
83005
83222
  }
83006
- }
83007
- ) })
83223
+ ),
83224
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SyncedHorizontalScrollbar, { disabled: tableProps?.virtual, tableContainerRef })
83225
+ ] })
83008
83226
  }
83009
83227
  );
83010
83228
  };