@prorobotech/openapi-k8s-toolkit 1.5.0-alpha.5 → 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.
- package/dist/{index-BmpJg0ct.mjs → index-Bdj1fTOn.mjs} +2 -2
- package/dist/{index-BmpJg0ct.mjs.map → index-Bdj1fTOn.mjs.map} +1 -1
- package/dist/{index-gq5MnduZ.mjs → index-DxI19K37.mjs} +385 -85
- package/dist/index-DxI19K37.mjs.map +1 -0
- package/dist/openapi-k8s-toolkit.es.js +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +383 -83
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/SyncedHorizontalScrollbar/SyncedHorizontalScrollbar.d.ts +7 -0
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/SyncedHorizontalScrollbar/SyncedHorizontalScrollbar.test.d.ts +1 -0
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/SyncedHorizontalScrollbar/index.d.ts +1 -0
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/utils.d.ts +6 -0
- package/package.json +1 -1
- package/dist/index-gq5MnduZ.mjs.map +0 -1
|
@@ -34572,6 +34572,18 @@ const TableContainer = styled.div`
|
|
|
34572
34572
|
&& .ant-table-expanded-row-fixed {
|
|
34573
34573
|
width: auto !important;
|
|
34574
34574
|
}
|
|
34575
|
+
|
|
34576
|
+
/* Virtual tables keep rc-virtual-list's own scrollbar; the custom synced scrollbar is disabled for them. */
|
|
34577
|
+
&& .ant-table:not(.ant-table-virtual) .ant-table-content,
|
|
34578
|
+
&& .ant-table:not(.ant-table-virtual) .ant-table-body {
|
|
34579
|
+
scrollbar-width: none;
|
|
34580
|
+
}
|
|
34581
|
+
|
|
34582
|
+
&& .ant-table:not(.ant-table-virtual) .ant-table-content::-webkit-scrollbar,
|
|
34583
|
+
&& .ant-table:not(.ant-table-virtual) .ant-table-body::-webkit-scrollbar {
|
|
34584
|
+
height: 0;
|
|
34585
|
+
width: 0;
|
|
34586
|
+
}
|
|
34575
34587
|
`;
|
|
34576
34588
|
const HideableControls = styled.div`
|
|
34577
34589
|
&& .ant-table-row .hideable {
|
|
@@ -34641,6 +34653,196 @@ const TrimmedTags = ({ tags, trimLength }) => {
|
|
|
34641
34653
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { wrap: "nowrap", gap: "4px", children: renderTableTags(tags) });
|
|
34642
34654
|
};
|
|
34643
34655
|
|
|
34656
|
+
const SCROLLABLE_TABLE_SELECTOR = ".ant-table-body, .ant-table-content";
|
|
34657
|
+
const EMPTY_SCROLLBAR_METRICS = {
|
|
34658
|
+
clientWidth: 0,
|
|
34659
|
+
scrollWidth: 0,
|
|
34660
|
+
visible: false
|
|
34661
|
+
};
|
|
34662
|
+
const HorizontalScrollbar = styled.div`
|
|
34663
|
+
position: sticky;
|
|
34664
|
+
bottom: var(--enriched-table-scrollbar-bottom-offset, 0px);
|
|
34665
|
+
z-index: 1056;
|
|
34666
|
+
height: 14px;
|
|
34667
|
+
overflow-x: auto;
|
|
34668
|
+
overflow-y: hidden;
|
|
34669
|
+
background: transparent;
|
|
34670
|
+
scrollbar-width: thin;
|
|
34671
|
+
scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
|
|
34672
|
+
|
|
34673
|
+
&::-webkit-scrollbar {
|
|
34674
|
+
height: 12px;
|
|
34675
|
+
}
|
|
34676
|
+
|
|
34677
|
+
&::-webkit-scrollbar-track {
|
|
34678
|
+
background: transparent;
|
|
34679
|
+
}
|
|
34680
|
+
|
|
34681
|
+
&::-webkit-scrollbar-thumb {
|
|
34682
|
+
background-color: rgba(0, 0, 0, 0.35);
|
|
34683
|
+
background-clip: content-box;
|
|
34684
|
+
border: 3px solid transparent;
|
|
34685
|
+
border-radius: 999px;
|
|
34686
|
+
}
|
|
34687
|
+
`;
|
|
34688
|
+
const HorizontalScrollbarInner = styled.div`
|
|
34689
|
+
height: 1px;
|
|
34690
|
+
`;
|
|
34691
|
+
const SyncedHorizontalScrollbar = ({
|
|
34692
|
+
tableContainerRef,
|
|
34693
|
+
disabled = false
|
|
34694
|
+
}) => {
|
|
34695
|
+
const scrollbarRef = React__default.useRef(null);
|
|
34696
|
+
const tableScrollerRef = React__default.useRef(null);
|
|
34697
|
+
const isSyncingRef = React__default.useRef(false);
|
|
34698
|
+
const refreshRafRef = React__default.useRef(null);
|
|
34699
|
+
const [metrics, setMetrics] = React__default.useState(EMPTY_SCROLLBAR_METRICS);
|
|
34700
|
+
const [scrollerBinding, setScrollerBinding] = React__default.useState({
|
|
34701
|
+
scroller: null,
|
|
34702
|
+
content: null
|
|
34703
|
+
});
|
|
34704
|
+
const releaseSyncLock = React__default.useCallback(() => {
|
|
34705
|
+
if (typeof window.requestAnimationFrame !== "function") {
|
|
34706
|
+
isSyncingRef.current = false;
|
|
34707
|
+
return;
|
|
34708
|
+
}
|
|
34709
|
+
window.requestAnimationFrame(() => {
|
|
34710
|
+
isSyncingRef.current = false;
|
|
34711
|
+
});
|
|
34712
|
+
}, []);
|
|
34713
|
+
const bindTableScroller = React__default.useCallback((tableScroller) => {
|
|
34714
|
+
const tableScrollerContent = tableScroller?.firstElementChild || null;
|
|
34715
|
+
tableScrollerRef.current = tableScroller;
|
|
34716
|
+
setScrollerBinding(
|
|
34717
|
+
(currentBinding) => currentBinding.scroller === tableScroller && currentBinding.content === tableScrollerContent ? currentBinding : {
|
|
34718
|
+
scroller: tableScroller,
|
|
34719
|
+
content: tableScrollerContent
|
|
34720
|
+
}
|
|
34721
|
+
);
|
|
34722
|
+
}, []);
|
|
34723
|
+
const findTableScroller = React__default.useCallback(
|
|
34724
|
+
() => disabled ? null : tableContainerRef.current?.querySelector(SCROLLABLE_TABLE_SELECTOR) || null,
|
|
34725
|
+
[disabled, tableContainerRef]
|
|
34726
|
+
);
|
|
34727
|
+
const updateMetrics = React__default.useCallback((tableScroller) => {
|
|
34728
|
+
tableScrollerRef.current = tableScroller;
|
|
34729
|
+
if (!tableScroller) {
|
|
34730
|
+
setMetrics((currentMetrics) => currentMetrics.visible ? EMPTY_SCROLLBAR_METRICS : currentMetrics);
|
|
34731
|
+
return;
|
|
34732
|
+
}
|
|
34733
|
+
const nextMetrics = {
|
|
34734
|
+
clientWidth: tableScroller.clientWidth,
|
|
34735
|
+
scrollWidth: tableScroller.scrollWidth,
|
|
34736
|
+
visible: tableScroller.scrollWidth > tableScroller.clientWidth + 1
|
|
34737
|
+
};
|
|
34738
|
+
setMetrics(
|
|
34739
|
+
(currentMetrics) => currentMetrics.clientWidth === nextMetrics.clientWidth && currentMetrics.scrollWidth === nextMetrics.scrollWidth && currentMetrics.visible === nextMetrics.visible ? currentMetrics : nextMetrics
|
|
34740
|
+
);
|
|
34741
|
+
if (scrollbarRef.current && scrollbarRef.current.scrollLeft !== tableScroller.scrollLeft) {
|
|
34742
|
+
scrollbarRef.current.scrollLeft = tableScroller.scrollLeft;
|
|
34743
|
+
}
|
|
34744
|
+
}, []);
|
|
34745
|
+
const refreshTableScroller = React__default.useCallback(() => {
|
|
34746
|
+
const tableScroller = findTableScroller();
|
|
34747
|
+
bindTableScroller(tableScroller);
|
|
34748
|
+
updateMetrics(tableScroller);
|
|
34749
|
+
}, [bindTableScroller, findTableScroller, updateMetrics]);
|
|
34750
|
+
const cancelScheduledRefresh = React__default.useCallback(() => {
|
|
34751
|
+
if (refreshRafRef.current === null || typeof window.cancelAnimationFrame !== "function") {
|
|
34752
|
+
return;
|
|
34753
|
+
}
|
|
34754
|
+
window.cancelAnimationFrame(refreshRafRef.current);
|
|
34755
|
+
refreshRafRef.current = null;
|
|
34756
|
+
}, []);
|
|
34757
|
+
const scheduleRefreshTableScroller = React__default.useCallback(() => {
|
|
34758
|
+
if (typeof window.requestAnimationFrame !== "function") {
|
|
34759
|
+
refreshTableScroller();
|
|
34760
|
+
return;
|
|
34761
|
+
}
|
|
34762
|
+
if (refreshRafRef.current !== null) {
|
|
34763
|
+
return;
|
|
34764
|
+
}
|
|
34765
|
+
refreshRafRef.current = window.requestAnimationFrame(() => {
|
|
34766
|
+
refreshRafRef.current = null;
|
|
34767
|
+
refreshTableScroller();
|
|
34768
|
+
});
|
|
34769
|
+
}, [refreshTableScroller]);
|
|
34770
|
+
React__default.useLayoutEffect(() => {
|
|
34771
|
+
refreshTableScroller();
|
|
34772
|
+
}, [refreshTableScroller]);
|
|
34773
|
+
React__default.useEffect(() => {
|
|
34774
|
+
refreshTableScroller();
|
|
34775
|
+
}, [refreshTableScroller]);
|
|
34776
|
+
React__default.useEffect(() => {
|
|
34777
|
+
if (disabled || !tableContainerRef.current || typeof MutationObserver !== "function") {
|
|
34778
|
+
return void 0;
|
|
34779
|
+
}
|
|
34780
|
+
const mutationObserver = new MutationObserver(scheduleRefreshTableScroller);
|
|
34781
|
+
mutationObserver.observe(tableContainerRef.current, {
|
|
34782
|
+
childList: true,
|
|
34783
|
+
subtree: true
|
|
34784
|
+
});
|
|
34785
|
+
return () => {
|
|
34786
|
+
cancelScheduledRefresh();
|
|
34787
|
+
mutationObserver.disconnect();
|
|
34788
|
+
};
|
|
34789
|
+
}, [cancelScheduledRefresh, disabled, scheduleRefreshTableScroller, tableContainerRef]);
|
|
34790
|
+
React__default.useEffect(() => cancelScheduledRefresh, [cancelScheduledRefresh]);
|
|
34791
|
+
React__default.useEffect(() => {
|
|
34792
|
+
const { scroller: tableScroller, content: tableScrollerContent } = scrollerBinding;
|
|
34793
|
+
if (disabled) {
|
|
34794
|
+
updateMetrics(null);
|
|
34795
|
+
return void 0;
|
|
34796
|
+
}
|
|
34797
|
+
if (!tableScroller) {
|
|
34798
|
+
return void 0;
|
|
34799
|
+
}
|
|
34800
|
+
const syncFromTable = () => {
|
|
34801
|
+
if (isSyncingRef.current || !scrollbarRef.current) {
|
|
34802
|
+
return;
|
|
34803
|
+
}
|
|
34804
|
+
isSyncingRef.current = true;
|
|
34805
|
+
scrollbarRef.current.scrollLeft = tableScroller.scrollLeft;
|
|
34806
|
+
releaseSyncLock();
|
|
34807
|
+
};
|
|
34808
|
+
tableScroller.addEventListener("scroll", syncFromTable, { passive: true });
|
|
34809
|
+
window.addEventListener("resize", scheduleRefreshTableScroller);
|
|
34810
|
+
const resizeObserver = typeof ResizeObserver === "function" ? new ResizeObserver(() => updateMetrics(tableScroller)) : void 0;
|
|
34811
|
+
resizeObserver?.observe(tableScroller);
|
|
34812
|
+
if (tableScrollerContent) {
|
|
34813
|
+
resizeObserver?.observe(tableScrollerContent);
|
|
34814
|
+
}
|
|
34815
|
+
updateMetrics(tableScroller);
|
|
34816
|
+
return () => {
|
|
34817
|
+
tableScroller.removeEventListener("scroll", syncFromTable);
|
|
34818
|
+
window.removeEventListener("resize", scheduleRefreshTableScroller);
|
|
34819
|
+
resizeObserver?.disconnect();
|
|
34820
|
+
};
|
|
34821
|
+
}, [disabled, releaseSyncLock, scheduleRefreshTableScroller, scrollerBinding, updateMetrics]);
|
|
34822
|
+
const syncFromScrollbar = React__default.useCallback(() => {
|
|
34823
|
+
const tableScroller = tableScrollerRef.current;
|
|
34824
|
+
if (isSyncingRef.current || !tableScroller || !scrollbarRef.current) {
|
|
34825
|
+
return;
|
|
34826
|
+
}
|
|
34827
|
+
isSyncingRef.current = true;
|
|
34828
|
+
tableScroller.scrollLeft = scrollbarRef.current.scrollLeft;
|
|
34829
|
+
releaseSyncLock();
|
|
34830
|
+
}, [releaseSyncLock]);
|
|
34831
|
+
if (!metrics.visible) {
|
|
34832
|
+
return null;
|
|
34833
|
+
}
|
|
34834
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34835
|
+
HorizontalScrollbar,
|
|
34836
|
+
{
|
|
34837
|
+
ref: scrollbarRef,
|
|
34838
|
+
"aria-hidden": "true",
|
|
34839
|
+
"data-testid": "enriched-table-horizontal-scrollbar",
|
|
34840
|
+
onScroll: syncFromScrollbar,
|
|
34841
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(HorizontalScrollbarInner, { style: { width: metrics.scrollWidth } })
|
|
34842
|
+
}
|
|
34843
|
+
);
|
|
34844
|
+
};
|
|
34845
|
+
|
|
34644
34846
|
const isFlatObject = (obj) => {
|
|
34645
34847
|
return Object.entries(obj).every(([, value]) => {
|
|
34646
34848
|
return value === null || typeof value !== "object";
|
|
@@ -78892,7 +79094,7 @@ const TolerationsModal = ({
|
|
|
78892
79094
|
};
|
|
78893
79095
|
|
|
78894
79096
|
const LazyEnrichedTableModal = lazy(
|
|
78895
|
-
() => import('./index-
|
|
79097
|
+
() => import('./index-Bdj1fTOn.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
|
|
78896
79098
|
);
|
|
78897
79099
|
const renderActiveType = (activeType, extraProps) => {
|
|
78898
79100
|
if (!activeType) return null;
|
|
@@ -82274,6 +82476,73 @@ const TableFactory = ({ record, customProps, theme }) => {
|
|
|
82274
82476
|
);
|
|
82275
82477
|
};
|
|
82276
82478
|
|
|
82479
|
+
const DEFAULT_FIXED_NAME_COLUMN_WIDTH = 240;
|
|
82480
|
+
const DEFAULT_FIXED_ACTIONS_COLUMN_WIDTH = 60;
|
|
82481
|
+
const stringifyColumnValue = (value) => {
|
|
82482
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
82483
|
+
return String(value).trim().toLowerCase();
|
|
82484
|
+
}
|
|
82485
|
+
return void 0;
|
|
82486
|
+
};
|
|
82487
|
+
const getColumnDataPath = (dataIndex) => {
|
|
82488
|
+
if (Array.isArray(dataIndex)) {
|
|
82489
|
+
return dataIndex.map(String).join(".").trim().toLowerCase();
|
|
82490
|
+
}
|
|
82491
|
+
return stringifyColumnValue(dataIndex);
|
|
82492
|
+
};
|
|
82493
|
+
const isNameColumn = (column) => {
|
|
82494
|
+
const key = stringifyColumnValue(column.key);
|
|
82495
|
+
const title = stringifyColumnValue(column.title);
|
|
82496
|
+
const dataPath = getColumnDataPath(column.dataIndex);
|
|
82497
|
+
return key === "name" || title === "name" || dataPath === "name" || dataPath === "metadata.name";
|
|
82498
|
+
};
|
|
82499
|
+
const hasFactoryItemOfType = (customProps, itemType) => {
|
|
82500
|
+
if (typeof customProps !== "object" || customProps === null) {
|
|
82501
|
+
return false;
|
|
82502
|
+
}
|
|
82503
|
+
if (!("items" in customProps) || !Array.isArray(customProps.items)) {
|
|
82504
|
+
return false;
|
|
82505
|
+
}
|
|
82506
|
+
return customProps.items.some(
|
|
82507
|
+
(item) => typeof item === "object" && item !== null && "type" in item && item.type === itemType
|
|
82508
|
+
);
|
|
82509
|
+
};
|
|
82510
|
+
const getFixedColumnSide = ({
|
|
82511
|
+
shouldFixNameColumn,
|
|
82512
|
+
shouldFixActionsColumn,
|
|
82513
|
+
currentFixed
|
|
82514
|
+
}) => {
|
|
82515
|
+
if (currentFixed !== void 0) {
|
|
82516
|
+
return currentFixed;
|
|
82517
|
+
}
|
|
82518
|
+
if (shouldFixNameColumn) {
|
|
82519
|
+
return "left";
|
|
82520
|
+
}
|
|
82521
|
+
if (shouldFixActionsColumn) {
|
|
82522
|
+
return "right";
|
|
82523
|
+
}
|
|
82524
|
+
return void 0;
|
|
82525
|
+
};
|
|
82526
|
+
const getFixedColumnWidth = ({
|
|
82527
|
+
possibleColWidth,
|
|
82528
|
+
currentWidth,
|
|
82529
|
+
shouldFixNameColumn,
|
|
82530
|
+
shouldFixActionsColumn
|
|
82531
|
+
}) => {
|
|
82532
|
+
if (possibleColWidth !== void 0) {
|
|
82533
|
+
return possibleColWidth;
|
|
82534
|
+
}
|
|
82535
|
+
if (currentWidth !== void 0) {
|
|
82536
|
+
return currentWidth;
|
|
82537
|
+
}
|
|
82538
|
+
if (shouldFixNameColumn) {
|
|
82539
|
+
return DEFAULT_FIXED_NAME_COLUMN_WIDTH;
|
|
82540
|
+
}
|
|
82541
|
+
if (shouldFixActionsColumn) {
|
|
82542
|
+
return DEFAULT_FIXED_ACTIONS_COLUMN_WIDTH;
|
|
82543
|
+
}
|
|
82544
|
+
return void 0;
|
|
82545
|
+
};
|
|
82277
82546
|
const getCellRender = ({
|
|
82278
82547
|
value,
|
|
82279
82548
|
record,
|
|
@@ -82375,6 +82644,7 @@ const getEnrichedColumns = ({
|
|
|
82375
82644
|
if (!columns) {
|
|
82376
82645
|
return void 0;
|
|
82377
82646
|
}
|
|
82647
|
+
let hasFixedNameColumn = false;
|
|
82378
82648
|
return columns.map((el, colIndex) => {
|
|
82379
82649
|
const possibleAdditionalPrinterColumnsCustomSortersAndFiltersType = additionalPrinterColumnsCustomSortersAndFilters?.find(({ key }) => key === el.key)?.type;
|
|
82380
82650
|
const isSortersAndFiltersDisabled = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "disabled";
|
|
@@ -82386,6 +82656,13 @@ const getEnrichedColumns = ({
|
|
|
82386
82656
|
const possibleTooltip = additionalPrinterColumnsTooltips?.find(({ key }) => key === el.key)?.value;
|
|
82387
82657
|
const possibleCustomTypeWithProps = additionalPrinterColumnsKeyTypeProps && el.key ? additionalPrinterColumnsKeyTypeProps[el.key.toString()] : void 0;
|
|
82388
82658
|
const originalRender = el.render;
|
|
82659
|
+
const columnIsNameColumn = isNameColumn(el);
|
|
82660
|
+
const canAutoFixColumn = el.fixed === void 0;
|
|
82661
|
+
const shouldFixNameColumn = canAutoFixColumn && !hasFixedNameColumn && columnIsNameColumn;
|
|
82662
|
+
const shouldFixActionsColumn = canAutoFixColumn && possibleCustomTypeWithProps?.type === "factory" && hasFactoryItemOfType(possibleCustomTypeWithProps.customProps, "ActionsDropdown");
|
|
82663
|
+
if (columnIsNameColumn && !hasFixedNameColumn) {
|
|
82664
|
+
hasFixedNameColumn = true;
|
|
82665
|
+
}
|
|
82389
82666
|
const useFactorySearch = possibleCustomTypeWithProps?.type === "factory";
|
|
82390
82667
|
const colKey = el.key != null && String(el.key) || (Array.isArray(el.dataIndex) ? el.dataIndex.join(".") : String(el.dataIndex ?? colIndex));
|
|
82391
82668
|
const getCellTextFromRecord = (record) => {
|
|
@@ -82484,7 +82761,17 @@ const getEnrichedColumns = ({
|
|
|
82484
82761
|
theme
|
|
82485
82762
|
});
|
|
82486
82763
|
},
|
|
82487
|
-
|
|
82764
|
+
fixed: getFixedColumnSide({
|
|
82765
|
+
shouldFixNameColumn,
|
|
82766
|
+
shouldFixActionsColumn,
|
|
82767
|
+
currentFixed: el.fixed
|
|
82768
|
+
}),
|
|
82769
|
+
width: getFixedColumnWidth({
|
|
82770
|
+
possibleColWidth,
|
|
82771
|
+
currentWidth: el.width,
|
|
82772
|
+
shouldFixNameColumn,
|
|
82773
|
+
shouldFixActionsColumn
|
|
82774
|
+
}),
|
|
82488
82775
|
// for factory search
|
|
82489
82776
|
onCell: (record) => {
|
|
82490
82777
|
const rowKey = getRowKey(record);
|
|
@@ -82615,6 +82902,7 @@ const getEnrichedColumnsWithControls = ({
|
|
|
82615
82902
|
dataIndex: "internalDataForControls",
|
|
82616
82903
|
key: "controls",
|
|
82617
82904
|
className: "controls",
|
|
82905
|
+
fixed: "right",
|
|
82618
82906
|
width: 60,
|
|
82619
82907
|
render: (value) => {
|
|
82620
82908
|
return (
|
|
@@ -82698,6 +82986,7 @@ const EnrichedTable = ({
|
|
|
82698
82986
|
tableProps
|
|
82699
82987
|
}) => {
|
|
82700
82988
|
const navigate = useNavigate();
|
|
82989
|
+
const tableContainerRef = React__default.useRef(null);
|
|
82701
82990
|
if (!columns) {
|
|
82702
82991
|
return null;
|
|
82703
82992
|
}
|
|
@@ -82753,56 +83042,62 @@ const EnrichedTable = ({
|
|
|
82753
83042
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
82754
83043
|
TableComponents.TableContainer,
|
|
82755
83044
|
{
|
|
83045
|
+
ref: tableContainerRef,
|
|
82756
83046
|
$isDark: theme === "dark",
|
|
82757
83047
|
$isCursorPointer: Boolean(pathToNavigate || rowClickable),
|
|
82758
83048
|
$borderless: tableProps?.borderless,
|
|
82759
83049
|
$isTotalLeft: tableProps?.isTotalLeft,
|
|
82760
|
-
children: /* @__PURE__ */ jsxRuntimeExports.
|
|
82761
|
-
|
|
82762
|
-
|
|
82763
|
-
|
|
82764
|
-
|
|
82765
|
-
|
|
82766
|
-
|
|
82767
|
-
|
|
82768
|
-
|
|
82769
|
-
|
|
82770
|
-
|
|
82771
|
-
|
|
82772
|
-
|
|
82773
|
-
|
|
82774
|
-
|
|
82775
|
-
|
|
82776
|
-
|
|
82777
|
-
|
|
82778
|
-
|
|
82779
|
-
|
|
82780
|
-
|
|
82781
|
-
|
|
82782
|
-
selectData.
|
|
82783
|
-
|
|
82784
|
-
rows
|
|
82785
|
-
|
|
82786
|
-
|
|
82787
|
-
|
|
82788
|
-
|
|
82789
|
-
|
|
82790
|
-
|
|
82791
|
-
|
|
82792
|
-
const consumerRowProps = onRow?.(record, void 0);
|
|
82793
|
-
const navigationClickHandler = buildNavigationClickHandler(record);
|
|
82794
|
-
return {
|
|
82795
|
-
...consumerRowProps,
|
|
82796
|
-
onClick: (event) => {
|
|
82797
|
-
consumerRowProps?.onClick?.(event);
|
|
82798
|
-
if (!event.defaultPrevented) {
|
|
82799
|
-
navigationClickHandler();
|
|
82800
|
-
}
|
|
83050
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableComponents.HideableControls, { children: [
|
|
83051
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
83052
|
+
Table,
|
|
83053
|
+
{
|
|
83054
|
+
rowKey,
|
|
83055
|
+
dataSource,
|
|
83056
|
+
columns: columnsWithControls,
|
|
83057
|
+
pagination: tableProps?.disablePagination ? false : {
|
|
83058
|
+
position: tableProps?.paginationPosition || ["bottomLeft"],
|
|
83059
|
+
showSizeChanger: true,
|
|
83060
|
+
defaultPageSize: 10,
|
|
83061
|
+
hideOnSinglePage: false,
|
|
83062
|
+
showTotal
|
|
83063
|
+
},
|
|
83064
|
+
scroll: { x: "max-content", y: tableProps?.maxHeight },
|
|
83065
|
+
virtual: tableProps?.virtual,
|
|
83066
|
+
rowClassName,
|
|
83067
|
+
rowSelection: selectData ? {
|
|
83068
|
+
type: "checkbox",
|
|
83069
|
+
// Keep selection controls aligned with the fixed Name column.
|
|
83070
|
+
fixed: "left",
|
|
83071
|
+
columnWidth: 48,
|
|
83072
|
+
selectedRowKeys: selectData.selectedRowKeys,
|
|
83073
|
+
onChange: (selectedRowKeys, selectedRows) => {
|
|
83074
|
+
const rows = selectedRows;
|
|
83075
|
+
selectData.onChange(
|
|
83076
|
+
selectedRowKeys,
|
|
83077
|
+
rows.map(({ internalDataForControls }) => ({
|
|
83078
|
+
name: internalDataForControls.name,
|
|
83079
|
+
endpoint: `${internalDataForControls.deletePathPrefix}/${internalDataForControls.apiGroupAndVersion}${internalDataForControls.namespace ? `/namespaces/${internalDataForControls.namespace}` : ""}/${internalDataForControls.plural}/${internalDataForControls.name}`
|
|
83080
|
+
}))
|
|
83081
|
+
);
|
|
82801
83082
|
}
|
|
82802
|
-
}
|
|
83083
|
+
} : void 0,
|
|
83084
|
+
onRow: (record) => {
|
|
83085
|
+
const consumerRowProps = onRow?.(record, void 0);
|
|
83086
|
+
const navigationClickHandler = buildNavigationClickHandler(record);
|
|
83087
|
+
return {
|
|
83088
|
+
...consumerRowProps,
|
|
83089
|
+
onClick: (event) => {
|
|
83090
|
+
consumerRowProps?.onClick?.(event);
|
|
83091
|
+
if (!event.defaultPrevented) {
|
|
83092
|
+
navigationClickHandler();
|
|
83093
|
+
}
|
|
83094
|
+
}
|
|
83095
|
+
};
|
|
83096
|
+
}
|
|
82803
83097
|
}
|
|
82804
|
-
|
|
82805
|
-
|
|
83098
|
+
),
|
|
83099
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SyncedHorizontalScrollbar, { disabled: tableProps?.virtual, tableContainerRef })
|
|
83100
|
+
] })
|
|
82806
83101
|
}
|
|
82807
83102
|
);
|
|
82808
83103
|
};
|
|
@@ -82820,6 +83115,7 @@ const ClusterListTable = ({
|
|
|
82820
83115
|
tableProps
|
|
82821
83116
|
}) => {
|
|
82822
83117
|
const navigate = useNavigate();
|
|
83118
|
+
const tableContainerRef = React__default.useRef(null);
|
|
82823
83119
|
if (!columns) {
|
|
82824
83120
|
return null;
|
|
82825
83121
|
}
|
|
@@ -82860,54 +83156,58 @@ const ClusterListTable = ({
|
|
|
82860
83156
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
82861
83157
|
TableComponents.TableContainer,
|
|
82862
83158
|
{
|
|
83159
|
+
ref: tableContainerRef,
|
|
82863
83160
|
$isDark: theme === "dark",
|
|
82864
83161
|
$isCursorPointer: Boolean(
|
|
82865
83162
|
recordKeysForNavigation && (!!pathToNavigate || !!navigationSettings) || rowClickable
|
|
82866
83163
|
),
|
|
82867
83164
|
$borderless: tableProps?.borderless,
|
|
82868
83165
|
$isTotalLeft: tableProps?.isTotalLeft,
|
|
82869
|
-
children: /* @__PURE__ */ jsxRuntimeExports.
|
|
82870
|
-
|
|
82871
|
-
|
|
82872
|
-
|
|
82873
|
-
|
|
82874
|
-
|
|
82875
|
-
|
|
82876
|
-
|
|
82877
|
-
|
|
82878
|
-
|
|
82879
|
-
|
|
82880
|
-
|
|
82881
|
-
|
|
82882
|
-
|
|
82883
|
-
|
|
82884
|
-
|
|
82885
|
-
|
|
82886
|
-
|
|
82887
|
-
|
|
82888
|
-
|
|
82889
|
-
|
|
82890
|
-
|
|
82891
|
-
|
|
82892
|
-
|
|
82893
|
-
}
|
|
82894
|
-
if (recordKeysForNavigation) {
|
|
82895
|
-
const recordValueRaw = Array.isArray(recordKeysForNavigation) ? lodashExports.get(record, recordKeysForNavigation) : jp.query(record || {}, `$${recordKeysForNavigation}`)[0];
|
|
82896
|
-
const clusterName = typeof recordValueRaw === "string" ? recordValueRaw : void 0;
|
|
82897
|
-
const recordValue = typeof recordValueRaw === "string" ? recordValueRaw : JSON.stringify(recordValueRaw);
|
|
82898
|
-
const fetchedPathToNavigate = await tryGetPathFromNavigationResource(clusterName);
|
|
82899
|
-
const finalPathToNavigate = fetchedPathToNavigate || pathToNavigate;
|
|
82900
|
-
if (!finalPathToNavigate) {
|
|
83166
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableComponents.HideableControls, { children: [
|
|
83167
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
83168
|
+
Table,
|
|
83169
|
+
{
|
|
83170
|
+
rowKey,
|
|
83171
|
+
dataSource,
|
|
83172
|
+
columns: enrichedColumns,
|
|
83173
|
+
pagination: tableProps?.disablePagination ? false : {
|
|
83174
|
+
position: tableProps?.paginationPosition || ["bottomLeft"],
|
|
83175
|
+
showSizeChanger: true,
|
|
83176
|
+
defaultPageSize: 10,
|
|
83177
|
+
hideOnSinglePage: false,
|
|
83178
|
+
showTotal
|
|
83179
|
+
},
|
|
83180
|
+
scroll: { x: "max-content", y: tableProps?.maxHeight },
|
|
83181
|
+
virtual: tableProps?.virtual,
|
|
83182
|
+
rowClassName,
|
|
83183
|
+
onRow: (record) => {
|
|
83184
|
+
const consumerRowProps = onRow?.(record, void 0);
|
|
83185
|
+
return {
|
|
83186
|
+
...consumerRowProps,
|
|
83187
|
+
onClick: async (event) => {
|
|
83188
|
+
consumerRowProps?.onClick?.(event);
|
|
83189
|
+
if (event.defaultPrevented) {
|
|
82901
83190
|
return;
|
|
82902
83191
|
}
|
|
82903
|
-
|
|
82904
|
-
|
|
83192
|
+
if (recordKeysForNavigation) {
|
|
83193
|
+
const recordValueRaw = Array.isArray(recordKeysForNavigation) ? lodashExports.get(record, recordKeysForNavigation) : jp.query(record || {}, `$${recordKeysForNavigation}`)[0];
|
|
83194
|
+
const clusterName = typeof recordValueRaw === "string" ? recordValueRaw : void 0;
|
|
83195
|
+
const recordValue = typeof recordValueRaw === "string" ? recordValueRaw : JSON.stringify(recordValueRaw);
|
|
83196
|
+
const fetchedPathToNavigate = await tryGetPathFromNavigationResource(clusterName);
|
|
83197
|
+
const finalPathToNavigate = fetchedPathToNavigate || pathToNavigate;
|
|
83198
|
+
if (!finalPathToNavigate) {
|
|
83199
|
+
return;
|
|
83200
|
+
}
|
|
83201
|
+
const newPath = finalPathToNavigate.replaceAll("~recordValue~", recordValue);
|
|
83202
|
+
navigate(newPath);
|
|
83203
|
+
}
|
|
82905
83204
|
}
|
|
82906
|
-
}
|
|
82907
|
-
}
|
|
83205
|
+
};
|
|
83206
|
+
}
|
|
82908
83207
|
}
|
|
82909
|
-
|
|
82910
|
-
|
|
83208
|
+
),
|
|
83209
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SyncedHorizontalScrollbar, { disabled: tableProps?.virtual, tableContainerRef })
|
|
83210
|
+
] })
|
|
82911
83211
|
}
|
|
82912
83212
|
);
|
|
82913
83213
|
};
|
|
@@ -94514,4 +94814,4 @@ const usePluginManifest = ({
|
|
|
94514
94814
|
};
|
|
94515
94815
|
|
|
94516
94816
|
export { useCrdResourceSingle as $, getBuiltinResources as A, getBuiltinResourceSingle as B, getCrdResources as C, DeleteIcon as D, EnrichedTableProvider as E, getCrdResourceSingle as F, getApiResourceTypes as G, getApiResourceTypesByApiGroup as H, getBuiltinResourceTypes as I, getCrdData as J, getDirectUnknownResource as K, checkPermission as L, getSwagger as M, filterIfApiInstanceNamespaceScoped as N, filterIfBuiltInInstanceNamespaceScoped as O, PerRequestError as P, checkIfApiInstanceNamespaceScoped as Q, ReadOnlyModal as R, checkIfBuiltInInstanceNamespaceScoped as S, getKinds as T, useClusterList as U, useApiResources as V, useApiResourceSingle as W, useBuiltinResources as X, useBuiltinResourceSingle as Y, useCrdResources as Z, _$1 as _, useTheme as a, DynamicRenderer as a$, useApisResourceTypes as a0, useApiResourceTypesByGroup as a1, useBuiltinResourceTypes as a2, useCrdData as a3, useListWatch as a4, useInfiniteSentinel as a5, useK8sVerbs as a6, useManyK8sSmartResource as a7, useSmartResourceParams as a8, useResourceScope as a9, ResourceLink as aA, ErrorBoundary as aB, ErrorBoundaryWithDataReset as aC, ManageableBreadcrumbsProvider as aD, prepareDataForManageableBreadcrumbs as aE, ManageableBreadcrumbs as aF, ManageableSidebarProvider as aG, prepareDataForManageableSidebar as aH, ManageableSidebar as aI, EnrichedTable as aJ, ClusterListTable as aK, getEnrichedColumns as aL, getEnrichedColumnsWithControls as aM, YamlEditorSingleton$1 as aN, BlackholeFormProvider as aO, BlackholeForm as aP, getObjectFormItemsDraft as aQ, MarketPlace as aR, MarketplaceCard as aS, ProjectInfoCard as aT, PodTerminal as aU, NodeTerminal as aV, PodLogs as aW, PodLogsMonaco as aX, VMVNC as aY, Search as aZ, Events as a_, useKinds as aa, useKindsRaw as ab, usePluginManifest as ac, Spacer$1 as ad, TreeWithSearch as ae, ConfirmModal as af, UpIcon as ag, DownIcon as ah, BackToDefaultIcon as ai, SuccessIcon as aj, feedbackIcons as ak, PlusIcon as al, MinusIcon as am, LockedIcon as an, UnlockedIcon as ao, PauseCircleIcon as ap, ResumeCircleIcon as aq, LookingGlassIcon as ar, EarthIcon as as, ContentCard$1 as at, FlexGrow as au, UncontrolledSelect as av, CustomSelect$4 as aw, CursorPointerTag as ax, CursorPointerTagMinContent as ay, CursorDefaultDiv as az, usePartsOfUrl as b, DynamicComponents as b0, DynamicRendererWithProviders as b1, prepareTemplate as b2, isFlatObject as b3, filterSelectOptions as b4, getStringByName as b5, floorToDecimal as b6, parseQuotaValue as b7, parseQuotaValueCpu as b8, parseQuotaValueMemoryAndStorage as b9, convertStorage as bA, parseValueWithUnit as bB, convertCores as bC, formatCoresAuto as bD, toCores as bE, convertCompute as bF, parseCoresWithUnit as bG, formatDateAuto as bH, isValidRFC3339 as bI, normalizeValuesForQuotasToNumber as ba, getAllPathsFromObj as bb, getPrefixSubarrays as bc, groupsToTreeData as bd, getBuiltinTreeData as be, getGroupsByCategory as bf, createContextFactory as bg, prepareUrlsToFetchForDynamicRenderer as bh, deepMerge as bi, getSortedKinds as bj, getSortedKindsAll as bk, hslFromString as bl, getUppercase as bm, kindByGvr as bn, pluralByKind as bo, namespacedByGvr as bp, getLinkToBuiltinForm as bq, getLinkToApiForm as br, isMultilineString as bs, isMultilineFromYaml as bt, includesArray as bu, getResourceLink as bv, getNamespaceLink as bw, convertBytes as bx, formatBytesAuto as by, toBytes as bz, useAutoPerRequestError as c, usePermissions as d, useDirectUnknownResource as e, useK8sSmartResource as f, jsxRuntimeExports as g, EditIcon as h, PaddingContainer as i, jp as j, getLinkToForm as k, DeleteModal as l, mergePerRequestErrors as m, DeleteModalMany as n, getClusterList as o, parseAll as p, createNewEntry as q, updateEntry as r, serializeLabelsWithNoEncoding$1 as s, deleteEntry as t, useMultiQuery as u, patchEntryWithReplaceOp as v, patchEntryWithMergePatch as w, patchEntryWithDeleteOp as x, getApiResources as y, getApiResourceSingle as z };
|
|
94517
|
-
//# sourceMappingURL=index-
|
|
94817
|
+
//# sourceMappingURL=index-DxI19K37.mjs.map
|