@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.11 → 1.4.0-alpha.13

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.
@@ -1593,7 +1593,7 @@
1593
1593
  justify-content: center;
1594
1594
  }
1595
1595
  `;
1596
- const Styled$J = {
1596
+ const Styled$K = {
1597
1597
  CustomTreeProvider
1598
1598
  };
1599
1599
 
@@ -1658,7 +1658,7 @@
1658
1658
  });
1659
1659
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1660
1660
  /* @__PURE__ */ jsxRuntimeExports.jsx(Search$1, { style: { marginBottom: 8 }, placeholder: "Search", onChange }),
1661
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$J.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1661
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$K.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1662
1662
  antd.Tree,
1663
1663
  {
1664
1664
  treeData: loop(treeData),
@@ -8258,14 +8258,14 @@
8258
8258
  display: ${({ $displayFlex }) => $displayFlex ? "flex" : "block"};
8259
8259
  flex-flow: ${({ $flexFlow }) => $flexFlow};
8260
8260
  `;
8261
- const Styled$I = {
8261
+ const Styled$J = {
8262
8262
  ContentContainer
8263
8263
  };
8264
8264
 
8265
8265
  const ContentCard$1 = ({ children, flexGrow, displayFlex, flexFlow, maxHeight }) => {
8266
8266
  const { token } = antd.theme.useToken();
8267
8267
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8268
- Styled$I.ContentContainer,
8268
+ Styled$J.ContentContainer,
8269
8269
  {
8270
8270
  $flexGrow: flexGrow,
8271
8271
  $bgColor: token.colorBgContainer,
@@ -8326,13 +8326,13 @@
8326
8326
  padding-inline: 8px;
8327
8327
  }
8328
8328
  `;
8329
- const Styled$H = {
8329
+ const Styled$I = {
8330
8330
  UncontrolledSelect: UncontrolledSelect$1
8331
8331
  };
8332
8332
 
8333
8333
  const UncontrolledSelect = (props) => {
8334
8334
  const { isCursorPointer } = props;
8335
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$H.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
8335
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$I.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
8336
8336
  };
8337
8337
 
8338
8338
  const CustomSelect$5 = styled(antd.Select)`
@@ -8380,13 +8380,13 @@
8380
8380
  margin-block: 0 !important;
8381
8381
  }
8382
8382
  `;
8383
- const Styled$G = {
8383
+ const Styled$H = {
8384
8384
  CustomSelect: CustomSelect$5
8385
8385
  };
8386
8386
 
8387
8387
  const CustomSelect$4 = (props) => {
8388
8388
  const { paddingContainerEnd, ...rest } = props;
8389
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$G.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
8389
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$H.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
8390
8390
  };
8391
8391
 
8392
8392
  const CursorPointerTag = styled(antd.Tag)`
@@ -8533,7 +8533,7 @@
8533
8533
  height: min-content;
8534
8534
  margin-right: 4px;
8535
8535
  `;
8536
- const Styled$F = {
8536
+ const Styled$G = {
8537
8537
  Abbr: Abbr$2
8538
8538
  };
8539
8539
 
@@ -8573,7 +8573,7 @@
8573
8573
  baseFactoriesMapping
8574
8574
  });
8575
8575
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
8576
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$F.Abbr, { $bgColor: bgColor, children: abbr }),
8576
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$G.Abbr, { $bgColor: bgColor, children: abbr }),
8577
8577
  resourceLink ? /* @__PURE__ */ jsxRuntimeExports.jsx(
8578
8578
  antd.Typography.Link,
8579
8579
  {
@@ -8612,7 +8612,7 @@
8612
8612
  flex-wrap: nowrap !important;
8613
8613
  }
8614
8614
  `;
8615
- const Styled$E = {
8615
+ const Styled$F = {
8616
8616
  PositionRelativeContainer,
8617
8617
  FullWidthContainer,
8618
8618
  NoWrapContainer
@@ -8655,9 +8655,9 @@
8655
8655
  };
8656
8656
  return [firstItem, ellipsisItem, lastItem];
8657
8657
  };
8658
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$E.PositionRelativeContainer, { children: [
8659
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$E.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
8660
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$E.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
8658
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$F.PositionRelativeContainer, { children: [
8659
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$F.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
8660
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$F.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
8661
8661
  ] });
8662
8662
  };
8663
8663
 
@@ -8665,12 +8665,12 @@
8665
8665
  min-height: 22px;
8666
8666
  width: 100%;
8667
8667
  `;
8668
- const Styled$D = {
8668
+ const Styled$E = {
8669
8669
  HeightDiv: HeightDiv$1
8670
8670
  };
8671
8671
 
8672
8672
  const ManageableBreadcrumbs = ({ data }) => {
8673
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$D.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
8673
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$E.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
8674
8674
  };
8675
8675
 
8676
8676
  const kindByGvr = (entries) => (gvr) => {
@@ -9657,7 +9657,7 @@
9657
9657
  min-height: 22px;
9658
9658
  width: 100%;
9659
9659
  `;
9660
- const Styled$C = {
9660
+ const Styled$D = {
9661
9661
  HeightDiv
9662
9662
  };
9663
9663
 
@@ -9687,7 +9687,7 @@
9687
9687
  return null;
9688
9688
  }
9689
9689
  if (rawDataLoading) {
9690
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$C.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
9690
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$D.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
9691
9691
  }
9692
9692
  if (!rawData) {
9693
9693
  return null;
@@ -9703,7 +9703,7 @@
9703
9703
  fallbackIdToCompare
9704
9704
  });
9705
9705
  if (!result) {
9706
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$C.HeightDiv, {});
9706
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$D.HeightDiv, {});
9707
9707
  }
9708
9708
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableBreadcrumbs, { data: result }, JSON.stringify(idToCompare));
9709
9709
  };
@@ -9731,7 +9731,7 @@
9731
9731
  margin: 0 !important;
9732
9732
  }
9733
9733
  `;
9734
- const Styled$B = {
9734
+ const Styled$C = {
9735
9735
  CustomMenu
9736
9736
  };
9737
9737
 
@@ -9758,7 +9758,7 @@
9758
9758
  setSelectedKeys(data.selectedKeys);
9759
9759
  }, [data.selectedKeys]);
9760
9760
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9761
- Styled$B.CustomMenu,
9761
+ Styled$C.CustomMenu,
9762
9762
  {
9763
9763
  selectedKeys,
9764
9764
  onSelect: () => {
@@ -34299,7 +34299,7 @@
34299
34299
  white-space: nowrap;
34300
34300
  text-overflow: ellipsis;
34301
34301
  `;
34302
- const Styled$A = {
34302
+ const Styled$B = {
34303
34303
  ShortenedText
34304
34304
  };
34305
34305
 
@@ -34308,7 +34308,7 @@
34308
34308
  const trimmedText = text.substring(0, trimLength);
34309
34309
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, placement: "top", children: trimmedText });
34310
34310
  }
34311
- return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.ShortenedText, { $maxWidth: maxWidth, children: text }) });
34311
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$B.ShortenedText, { $maxWidth: maxWidth, children: text }) });
34312
34312
  };
34313
34313
 
34314
34314
  const FilterDropdown = ({
@@ -34444,18 +34444,48 @@
34444
34444
  text-align: ${({ $align }) => $align};
34445
34445
  `;
34446
34446
 
34447
+ const TableTag = styled(antd.Tag)`
34448
+ margin: 0;
34449
+ flex-shrink: 0;
34450
+ `;
34451
+ const TooltipTagsContainer = styled(antd.Flex)`
34452
+ max-width: min(95vw, 900px);
34453
+ min-width: min(60vw, 320px);
34454
+ `;
34455
+ const TooltipTag = styled(antd.Tag)`
34456
+ margin: 0;
34457
+ width: 100%;
34458
+ white-space: nowrap;
34459
+ overflow: hidden;
34460
+ text-overflow: ellipsis;
34461
+ `;
34462
+ const Styled$A = {
34463
+ TableTag,
34464
+ TooltipTagsContainer,
34465
+ TooltipTag
34466
+ };
34467
+
34447
34468
  const TrimmedTags = ({ tags, trimLength }) => {
34448
- const renderTags = (tags2) => tags2.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tag, { style: { margin: 0, flexShrink: 0 }, children: tag }, tag));
34469
+ const renderTableTags = (tags2) => tags2.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.TableTag, { children: tag }, tag));
34470
+ const popoverTheme = { components: { Popover: { zIndexPopup: 2100 } } };
34471
+ const renderTooltipTags = (tags2) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.TooltipTagsContainer, { vertical: true, gap: 4, children: tags2.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.TooltipTag, { children: tag }, tag)) });
34449
34472
  if (trimLength && trimLength < tags.length) {
34450
34473
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { wrap: "nowrap", gap: "4px", children: [
34451
- renderTags(tags.slice(0, trimLength)),
34452
- /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderTags(tags.slice(trimLength)) }), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Tag, { children: [
34453
- "+",
34454
- tags.length - trimLength
34455
- ] }, "more") })
34474
+ renderTableTags(tags.slice(0, trimLength)),
34475
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.ConfigProvider, { theme: popoverTheme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
34476
+ antd.Popover,
34477
+ {
34478
+ content: renderTooltipTags(tags.slice(trimLength)),
34479
+ styles: { root: { maxWidth: "min(95vw, 900px)" } },
34480
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$A.TableTag, { children: [
34481
+ "+",
34482
+ tags.length - trimLength
34483
+ ] }, "more")
34484
+ }
34485
+ ) })
34456
34486
  ] });
34457
34487
  }
34458
- return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { wrap: "nowrap", gap: "4px", children: renderTags(tags) });
34488
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { wrap: "nowrap", gap: "4px", children: renderTableTags(tags) });
34459
34489
  };
34460
34490
 
34461
34491
  const isFlatObject = (obj) => {
@@ -43531,7 +43561,6 @@
43531
43561
  BigText: BigText$1
43532
43562
  };
43533
43563
 
43534
- const collapsedVersionByModel = /* @__PURE__ */ new WeakMap();
43535
43564
  const findManagedFieldsLine = (model) => {
43536
43565
  let inMetadata = false;
43537
43566
  let metadataIndent = -1;
@@ -43552,17 +43581,55 @@
43552
43581
  }
43553
43582
  return null;
43554
43583
  };
43555
- const collapseManagedFieldsInEditor = (editor) => {
43584
+ const findManagedFieldsRange = (model) => {
43585
+ const startLineNumber = findManagedFieldsLine(model);
43586
+ if (startLineNumber === null) return null;
43587
+ const startLine = model.getLineContent(startLineNumber);
43588
+ const managedFieldsIndent = startLine.match(/^\s*/)?.[0].length ?? 0;
43589
+ for (let lineNumber = startLineNumber + 1; lineNumber <= model.getLineCount(); lineNumber++) {
43590
+ const line = model.getLineContent(lineNumber);
43591
+ const trimmed = line.trim();
43592
+ const indent = line.match(/^\s*/)?.[0].length ?? 0;
43593
+ if (trimmed && indent <= managedFieldsIndent) {
43594
+ const endLineNumber = lineNumber - 1;
43595
+ if (endLineNumber <= startLineNumber) return null;
43596
+ return { startLineNumber, endLineNumber };
43597
+ }
43598
+ }
43599
+ if (startLineNumber >= model.getLineCount()) return null;
43600
+ return { startLineNumber, endLineNumber: model.getLineCount() };
43601
+ };
43602
+ const collapseManagedFieldsInEditor = async (editor) => {
43556
43603
  const model = editor.getModel();
43557
- if (!model) return;
43558
- const currentVersion = model.getVersionId();
43559
- if (collapsedVersionByModel.get(model) === currentVersion) return;
43560
- const managedFieldsLine = findManagedFieldsLine(model);
43561
- if (managedFieldsLine === null) return;
43562
- if (managedFieldsLine >= model.getLineCount()) return;
43563
- editor.setPosition({ lineNumber: managedFieldsLine, column: 1 });
43564
- editor.trigger("managed-fields-collapse", "editor.fold", null);
43565
- collapsedVersionByModel.set(model, currentVersion);
43604
+ if (!model) return false;
43605
+ const range = findManagedFieldsRange(model);
43606
+ if (!range) return false;
43607
+ const managedFieldsLine = range.startLineNumber;
43608
+ const foldingController = editor.getContribution?.(
43609
+ "editor.contrib.folding"
43610
+ );
43611
+ if (!foldingController?.getFoldingModel) {
43612
+ editor.trigger("managed-fields-collapse", "editor.fold", {
43613
+ selectionLines: [managedFieldsLine],
43614
+ levels: 1,
43615
+ direction: "down"
43616
+ });
43617
+ return true;
43618
+ }
43619
+ const foldingModel = await foldingController.getFoldingModel();
43620
+ if (!foldingModel) return false;
43621
+ const { regions } = foldingModel;
43622
+ let managedFieldsRegionIndex = -1;
43623
+ for (let index = 0; index < regions.length; index++) {
43624
+ if (regions.getStartLineNumber(index) === managedFieldsLine) {
43625
+ managedFieldsRegionIndex = index;
43626
+ break;
43627
+ }
43628
+ }
43629
+ if (managedFieldsRegionIndex === -1) return false;
43630
+ if (regions.isCollapsed(managedFieldsRegionIndex)) return true;
43631
+ foldingModel.toggleCollapseState([{ regionIndex: managedFieldsRegionIndex }]);
43632
+ return regions.isCollapsed(managedFieldsRegionIndex);
43566
43633
  };
43567
43634
 
43568
43635
  const NOTIFICATION_KEY = "yaml-data-changed";
@@ -43592,18 +43659,43 @@
43592
43659
  const latestPrefillYamlRef = React$1.useRef(null);
43593
43660
  const firstLoadRef = React$1.useRef(true);
43594
43661
  const editorRef = React$1.useRef(null);
43662
+ const shouldCollapseOnNextYamlRef = React$1.useRef(false);
43663
+ const collapseRetriesRef = React$1.useRef(0);
43595
43664
  const collapseManagedFieldsIfNeeded = React$1.useCallback(() => {
43596
43665
  const editor = editorRef.current;
43597
- if (!editor) return;
43598
- collapseManagedFieldsInEditor(editor);
43666
+ if (!editor) return Promise.resolve(false);
43667
+ return collapseManagedFieldsInEditor(editor);
43668
+ }, []);
43669
+ const setYamlDataWithManagedFieldsCollapsed = React$1.useCallback((nextYaml) => {
43670
+ shouldCollapseOnNextYamlRef.current = true;
43671
+ collapseRetriesRef.current = 0;
43672
+ setYamlData(nextYaml);
43599
43673
  }, []);
43674
+ const tryCollapseManagedFields = React$1.useCallback(() => {
43675
+ if (!shouldCollapseOnNextYamlRef.current) return;
43676
+ const MAX_RETRIES = 10;
43677
+ const RETRY_DELAY_MS = 50;
43678
+ setTimeout(() => {
43679
+ collapseManagedFieldsIfNeeded().then((collapsed) => {
43680
+ if (collapsed) {
43681
+ shouldCollapseOnNextYamlRef.current = false;
43682
+ collapseRetriesRef.current = 0;
43683
+ return;
43684
+ }
43685
+ collapseRetriesRef.current += 1;
43686
+ if (collapseRetriesRef.current <= MAX_RETRIES) {
43687
+ tryCollapseManagedFields();
43688
+ }
43689
+ });
43690
+ }, RETRY_DELAY_MS);
43691
+ }, [collapseManagedFieldsIfNeeded]);
43600
43692
  const handleReload = React$1.useCallback(() => {
43601
43693
  api.destroy(NOTIFICATION_KEY);
43602
43694
  const nextYaml = latestPrefillYamlRef.current ?? initialPrefillYamlRef.current;
43603
43695
  if (nextYaml !== null) {
43604
- setYamlData(nextYaml);
43696
+ setYamlDataWithManagedFieldsCollapsed(nextYaml);
43605
43697
  }
43606
- }, [api]);
43698
+ }, [api, setYamlDataWithManagedFieldsCollapsed]);
43607
43699
  const openNotificationYamlChanged = React$1.useCallback(() => {
43608
43700
  const btn = /* @__PURE__ */ jsxRuntimeExports.jsx(
43609
43701
  antd.Button,
@@ -43631,7 +43723,7 @@
43631
43723
  if (firstLoadRef.current) {
43632
43724
  initialPrefillYamlRef.current = nextYaml;
43633
43725
  latestPrefillYamlRef.current = nextYaml;
43634
- setYamlData(nextYaml);
43726
+ setYamlDataWithManagedFieldsCollapsed(nextYaml);
43635
43727
  firstLoadRef.current = false;
43636
43728
  return;
43637
43729
  }
@@ -43639,13 +43731,12 @@
43639
43731
  openNotificationYamlChanged();
43640
43732
  }
43641
43733
  latestPrefillYamlRef.current = nextYaml;
43642
- }, [prefillValuesSchema, openNotificationYamlChanged]);
43734
+ }, [prefillValuesSchema, openNotificationYamlChanged, setYamlDataWithManagedFieldsCollapsed]);
43643
43735
  React$1.useEffect(() => {
43644
- const id = setTimeout(() => {
43645
- collapseManagedFieldsIfNeeded();
43646
- }, 0);
43647
- return () => clearTimeout(id);
43648
- }, [yamlData, collapseManagedFieldsIfNeeded]);
43736
+ if (!shouldCollapseOnNextYamlRef.current) return void 0;
43737
+ tryCollapseManagedFields();
43738
+ return void 0;
43739
+ }, [yamlData, tryCollapseManagedFields]);
43649
43740
  const onSubmit = () => {
43650
43741
  setIsLoading(true);
43651
43742
  setError(void 0);
@@ -43705,9 +43796,9 @@
43705
43796
  value: yamlData,
43706
43797
  onMount: (editor) => {
43707
43798
  editorRef.current = editor;
43708
- setTimeout(() => {
43709
- collapseManagedFieldsIfNeeded();
43710
- }, 0);
43799
+ if (shouldCollapseOnNextYamlRef.current) {
43800
+ tryCollapseManagedFields();
43801
+ }
43711
43802
  },
43712
43803
  onChange: (value) => {
43713
43804
  if (!readOnly) {
@@ -80859,15 +80950,35 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
80859
80950
  const possibleCustomTypeWithProps = additionalPrinterColumnsKeyTypeProps && el.key ? additionalPrinterColumnsKeyTypeProps[el.key.toString()] : void 0;
80860
80951
  const useFactorySearch = possibleCustomTypeWithProps?.type === "factory";
80861
80952
  const colKey = el.key != null && String(el.key) || (Array.isArray(el.dataIndex) ? el.dataIndex.join(".") : String(el.dataIndex ?? colIndex));
80953
+ const getCellTextFromRecord = (record) => {
80954
+ const { dataIndex } = el;
80955
+ if (!dataIndex) return "";
80956
+ const entry = Array.isArray(dataIndex) ? lodashExports.get(record, dataIndex) : record?.[dataIndex];
80957
+ if (entry === null || entry === void 0) return "";
80958
+ if (typeof entry === "string") return entry.trim().toLowerCase();
80959
+ if (typeof entry === "number" || typeof entry === "boolean") return String(entry).toLowerCase();
80960
+ if (Array.isArray(entry))
80961
+ return entry.map((item) => String(item)).join(", ").trim().toLowerCase();
80962
+ if (typeof entry === "object") return JSON.stringify(entry).trim().toLowerCase();
80963
+ return String(entry).trim().toLowerCase();
80964
+ };
80862
80965
  const getCellTextFromDOM = (record) => {
80966
+ if (typeof document === "undefined") return "";
80863
80967
  const rowKey = getRowKey(record);
80864
- const selector = `td[data-rowkey="${String(rowKey)}"][data-colkey="${colKey}"]`;
80865
- const cell = document.querySelector(selector);
80866
- if (!cell) return "";
80867
- return (cell.innerText || cell.textContent || "").trim().toLowerCase();
80968
+ const rowKeyStr = String(rowKey);
80969
+ const colKeyStr = String(colKey);
80970
+ const cells = document.querySelectorAll("td[data-rowkey][data-colkey]");
80971
+ for (let i = 0; i < cells.length; i += 1) {
80972
+ const cell = cells[i];
80973
+ if (cell.getAttribute("data-rowkey") === rowKeyStr && cell.getAttribute("data-colkey") === colKeyStr) {
80974
+ return (cell.innerText || cell.textContent || "").trim().toLowerCase();
80975
+ }
80976
+ }
80977
+ return "";
80868
80978
  };
80979
+ const getComparableCellText = (record) => getCellTextFromDOM(record) || getCellTextFromRecord(record);
80869
80980
  const getMemoryInBytes = (record) => {
80870
- const text = getCellTextFromDOM(record);
80981
+ const text = getComparableCellText(record);
80871
80982
  if (!text) return 0;
80872
80983
  const parsed = parseValueWithUnit(text);
80873
80984
  if (!parsed) return 0;
@@ -80878,7 +80989,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
80878
80989
  return parsed.value;
80879
80990
  };
80880
80991
  const getCpuInCores = (record) => {
80881
- const text = getCellTextFromDOM(record);
80992
+ const text = getComparableCellText(record);
80882
80993
  if (!text) return 0;
80883
80994
  const parsed = parseCoresWithUnit(text);
80884
80995
  if (!parsed) return 0;
@@ -80955,7 +81066,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
80955
81066
  return false;
80956
81067
  }
80957
81068
  if (useFactorySearch) {
80958
- const text = getCellTextFromDOM(record);
81069
+ const text = getComparableCellText(record);
80959
81070
  return text.includes(String(value).toLowerCase());
80960
81071
  }
80961
81072
  const { dataIndex } = el;
@@ -80990,8 +81101,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
80990
81101
  return safeNumericCompare(aCores, bCores);
80991
81102
  }
80992
81103
  if (useFactorySearch) {
80993
- const aText = getCellTextFromDOM(a);
80994
- const bText = getCellTextFromDOM(b);
81104
+ const aText = getComparableCellText(a);
81105
+ const bText = getComparableCellText(b);
80995
81106
  return aText.localeCompare(bText);
80996
81107
  }
80997
81108
  const { dataIndex } = el;
@@ -81231,6 +81342,99 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
81231
81342
  );
81232
81343
  };
81233
81344
 
81345
+ const ClusterListTable = ({
81346
+ theme,
81347
+ dataSource,
81348
+ columns,
81349
+ pathToNavigate,
81350
+ recordKeysForNavigation,
81351
+ navigationSettings,
81352
+ tableProps
81353
+ }) => {
81354
+ const navigate = reactRouterDom.useNavigate();
81355
+ if (!columns) {
81356
+ return null;
81357
+ }
81358
+ const rowKey = (record) => record.key;
81359
+ const enrichedColumns = getEnrichedColumns({
81360
+ columns,
81361
+ theme,
81362
+ getRowKey: rowKey
81363
+ });
81364
+ if (!enrichedColumns) {
81365
+ return null;
81366
+ }
81367
+ const showTotal = (total) => `Total: ${total}`;
81368
+ const tryGetPathFromNavigationResource = async (clusterName) => {
81369
+ const resolvedCluster = clusterName;
81370
+ const resolvedApiGroup = navigationSettings?.apiGroup;
81371
+ const resolvedApiVersion = navigationSettings?.apiVersion;
81372
+ const resolvedPlural = navigationSettings?.plural;
81373
+ const resolvedResourceName = navigationSettings?.resourceName;
81374
+ if (!resolvedCluster || !resolvedApiGroup || !resolvedApiVersion || !resolvedPlural || !resolvedResourceName) {
81375
+ return void 0;
81376
+ }
81377
+ try {
81378
+ const { data } = await axios.get(
81379
+ `/api/clusters/${resolvedCluster}/k8s/apis/${resolvedApiGroup}/${resolvedApiVersion}/${resolvedPlural}`,
81380
+ {
81381
+ params: {
81382
+ fieldSelector: `metadata.name=${resolvedResourceName}`
81383
+ }
81384
+ }
81385
+ );
81386
+ const spec = data?.items?.[0]?.spec;
81387
+ return spec?.pathToNavigateFromClusterList;
81388
+ } catch {
81389
+ return void 0;
81390
+ }
81391
+ };
81392
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
81393
+ TableComponents.TableContainer,
81394
+ {
81395
+ $isDark: theme === "dark",
81396
+ $isCursorPointer: !!recordKeysForNavigation && (!!pathToNavigate || !!navigationSettings),
81397
+ $borderless: tableProps?.borderless,
81398
+ $isTotalLeft: tableProps?.isTotalLeft,
81399
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(TableComponents.HideableControls, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
81400
+ antd.Table,
81401
+ {
81402
+ rowKey,
81403
+ dataSource,
81404
+ columns: enrichedColumns,
81405
+ pagination: tableProps?.disablePagination ? false : {
81406
+ position: tableProps?.paginationPosition || ["bottomLeft"],
81407
+ showSizeChanger: true,
81408
+ defaultPageSize: 10,
81409
+ hideOnSinglePage: false,
81410
+ showTotal
81411
+ },
81412
+ scroll: { x: "max-content", y: tableProps?.maxHeight },
81413
+ virtual: tableProps?.virtual,
81414
+ onRow: (record) => {
81415
+ return {
81416
+ onClick: async () => {
81417
+ if (recordKeysForNavigation) {
81418
+ const recordValueRaw = Array.isArray(recordKeysForNavigation) ? lodashExports.get(record, recordKeysForNavigation) : jp.query(record || {}, `$${recordKeysForNavigation}`)[0];
81419
+ const clusterName = typeof recordValueRaw === "string" ? recordValueRaw : void 0;
81420
+ const recordValue = typeof recordValueRaw === "string" ? recordValueRaw : JSON.stringify(recordValueRaw);
81421
+ const fetchedPathToNavigate = await tryGetPathFromNavigationResource(clusterName);
81422
+ const finalPathToNavigate = fetchedPathToNavigate || pathToNavigate;
81423
+ if (!finalPathToNavigate) {
81424
+ return;
81425
+ }
81426
+ const newPath = finalPathToNavigate.replaceAll("~recordValue~", recordValue);
81427
+ navigate(newPath);
81428
+ }
81429
+ }
81430
+ };
81431
+ }
81432
+ }
81433
+ ) })
81434
+ }
81435
+ );
81436
+ };
81437
+
81234
81438
  const prepare = ({
81235
81439
  dataItems,
81236
81440
  pathToKey,
@@ -90349,6 +90553,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
90349
90553
  exports.BackToDefaultIcon = BackToDefaultIcon;
90350
90554
  exports.BlackholeForm = BlackholeForm;
90351
90555
  exports.BlackholeFormProvider = BlackholeFormProvider;
90556
+ exports.ClusterListTable = ClusterListTable;
90352
90557
  exports.ConfirmModal = ConfirmModal;
90353
90558
  exports.ContentCard = ContentCard$1;
90354
90559
  exports.CursorDefaultDiv = CursorDefaultDiv;