@prorobotech/openapi-k8s-toolkit 1.2.0-alpha.7 → 1.2.0-alpha.8

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.
@@ -47072,9 +47072,9 @@ const getEnrichedColumns = ({
47072
47072
  }
47073
47073
  return columns.map((el, colIndex) => {
47074
47074
  const possibleAdditionalPrinterColumnsCustomSortersAndFiltersType = additionalPrinterColumnsCustomSortersAndFilters?.find(({ key }) => key === el.key)?.type;
47075
- const isSortersAndFitlersDisabled = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "disabled";
47076
- const isSortersAndFitlersCPU = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "cpu";
47077
- const isSortersAndFitlersMemory = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "memory";
47075
+ const isSortersAndFiltersDisabled = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "disabled";
47076
+ const isSortersAndFiltersCPU = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "cpu";
47077
+ const isSortersAndFiltersMemory = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "memory";
47078
47078
  const possibleUndefinedValue = additionalPrinterColumnsUndefinedValues?.find(({ key }) => key === el.key)?.value;
47079
47079
  const possibleTrimLength = additionalPrinterColumnsTrimLengths?.find(({ key }) => key === el.key)?.value;
47080
47080
  const possibleColWidth = additionalPrinterColumnsColWidths?.find(({ key }) => key === el.key)?.value;
@@ -47088,36 +47088,25 @@ const getEnrichedColumns = ({
47088
47088
  if (!cell) return "";
47089
47089
  return (cell.innerText || cell.textContent || "").trim().toLowerCase();
47090
47090
  };
47091
- const getEntry = (record) => {
47092
- const { dataIndex } = el;
47093
- return Array.isArray(dataIndex) ? lodashExports.get(record, dataIndex) : record[dataIndex];
47094
- };
47095
- const getTextForNumericUnitSort = (record) => {
47096
- if (useFactorySearch) {
47097
- const textFromDom = getCellTextFromDOM(record);
47098
- if (textFromDom) return textFromDom;
47099
- }
47100
- const raw = getEntry(record);
47101
- if (raw == null) return null;
47102
- return String(raw);
47103
- };
47104
47091
  const getMemoryInBytes = (record) => {
47105
- const text = getTextForNumericUnitSort(record);
47106
- if (!text) return NaN;
47092
+ const text = getCellTextFromDOM(record);
47093
+ if (!text) return 0;
47107
47094
  const parsed = parseValueWithUnit(text);
47108
- if (!parsed) return NaN;
47095
+ if (!parsed) return 0;
47109
47096
  if (parsed.unit) {
47110
- return toBytes(parsed.value, parsed.unit);
47097
+ const bytes = toBytes(parsed.value, parsed.unit);
47098
+ return bytes >= 0 ? bytes : 0;
47111
47099
  }
47112
47100
  return parsed.value;
47113
47101
  };
47114
47102
  const getCpuInCores = (record) => {
47115
- const text = getTextForNumericUnitSort(record);
47116
- if (!text) return NaN;
47103
+ const text = getCellTextFromDOM(record);
47104
+ if (!text) return 0;
47117
47105
  const parsed = parseCoresWithUnit(text);
47118
- if (!parsed) return NaN;
47106
+ if (!parsed) return 0;
47119
47107
  if (parsed.unit) {
47120
- return toCores(parsed.value, parsed.unit);
47108
+ const cores = toCores(parsed.value, parsed.unit);
47109
+ return cores >= 0 ? cores : 0;
47121
47110
  }
47122
47111
  return parsed.value;
47123
47112
  };
@@ -47149,7 +47138,7 @@ const getEnrichedColumns = ({
47149
47138
  };
47150
47139
  },
47151
47140
  filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }) => {
47152
- if (isSortersAndFitlersDisabled || isSortersAndFitlersMemory || isSortersAndFitlersCPU) {
47141
+ if (isSortersAndFiltersDisabled || isSortersAndFiltersMemory || isSortersAndFiltersCPU) {
47153
47142
  return null;
47154
47143
  }
47155
47144
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -47164,13 +47153,13 @@ const getEnrichedColumns = ({
47164
47153
  );
47165
47154
  },
47166
47155
  filterIcon: (filtered) => {
47167
- if (isSortersAndFitlersDisabled || isSortersAndFitlersMemory || isSortersAndFitlersCPU) {
47156
+ if (isSortersAndFiltersDisabled || isSortersAndFiltersMemory || isSortersAndFiltersCPU) {
47168
47157
  return null;
47169
47158
  }
47170
47159
  return /* @__PURE__ */ jsxRuntimeExports.jsx(SearchOutlined, { style: { color: filtered ? "#1677ff" : void 0 } });
47171
47160
  },
47172
47161
  onFilter: (value, record) => {
47173
- if (isSortersAndFitlersDisabled || isSortersAndFitlersMemory || isSortersAndFitlersCPU) {
47162
+ if (isSortersAndFiltersDisabled || isSortersAndFiltersMemory || isSortersAndFiltersCPU) {
47174
47163
  return false;
47175
47164
  }
47176
47165
  if (useFactorySearch) {
@@ -47197,22 +47186,22 @@ const getEnrichedColumns = ({
47197
47186
  }
47198
47187
  return false;
47199
47188
  },
47200
- sorter: isSortersAndFitlersDisabled ? false : (a, b) => {
47201
- if (useFactorySearch) {
47202
- const aText = getCellTextFromDOM(a);
47203
- const bText = getCellTextFromDOM(b);
47204
- return aText.localeCompare(bText);
47205
- }
47206
- if (isSortersAndFitlersMemory) {
47189
+ sorter: isSortersAndFiltersDisabled ? false : (a, b) => {
47190
+ if (isSortersAndFiltersMemory) {
47207
47191
  const aBytes = getMemoryInBytes(a);
47208
47192
  const bBytes = getMemoryInBytes(b);
47209
47193
  return safeNumericCompare(aBytes, bBytes);
47210
47194
  }
47211
- if (isSortersAndFitlersCPU) {
47195
+ if (isSortersAndFiltersCPU) {
47212
47196
  const aCores = getCpuInCores(a);
47213
47197
  const bCores = getCpuInCores(b);
47214
47198
  return safeNumericCompare(aCores, bCores);
47215
47199
  }
47200
+ if (useFactorySearch) {
47201
+ const aText = getCellTextFromDOM(a);
47202
+ const bText = getCellTextFromDOM(b);
47203
+ return aText.localeCompare(bText);
47204
+ }
47216
47205
  const { dataIndex } = el;
47217
47206
  const aEntry = Array.isArray(dataIndex) ? lodashExports.get(a, dataIndex) : a[dataIndex];
47218
47207
  const bEntry = Array.isArray(dataIndex) ? lodashExports.get(b, dataIndex) : b[dataIndex];