@prorobotech/openapi-k8s-toolkit 1.2.0-alpha.3 → 1.2.0-alpha.5
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/openapi-k8s-toolkit.es.js +309 -42
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +309 -42
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/EnrichedTable.d.ts +2 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/utils.d.ts +4 -2
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/ConverterBytes.d.ts +11 -9
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterCores/ConverterCores.d.ts +19 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterCores/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterCores/types.d.ts +7 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterCores/utils.d.ts +45 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterCores/utilts.test.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/MemoryChart.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/MemoryChartMulti.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/usePrometheusQueryRange.d.ts +7 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/usePrometheusQueryRangeMulti.d.ts +7 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/prometheus.d.ts +10 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/prometheus.test.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/prometheusAdapter.d.ts +21 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +21 -1
- package/dist/types/localTypes/bff/table.d.ts +2 -1
- package/dist/types/localTypes/richTable.d.ts +2 -0
- package/package.json +2 -1
|
@@ -44922,11 +44922,6 @@ const toBytes = (value, from) => {
|
|
|
44922
44922
|
const factor = UNIT_FACTORS[canon];
|
|
44923
44923
|
return value * factor;
|
|
44924
44924
|
};
|
|
44925
|
-
const convertStorage = (value, from, to, opts) => {
|
|
44926
|
-
const bytes = toBytes(value, from);
|
|
44927
|
-
if (bytes < 0) return -1;
|
|
44928
|
-
return convertBytes(bytes, to, opts);
|
|
44929
|
-
};
|
|
44930
44925
|
const parseValueWithUnit = (input) => {
|
|
44931
44926
|
const trimmed = input.trim();
|
|
44932
44927
|
if (!trimmed) return null;
|
|
@@ -44967,30 +44962,67 @@ const ConverterBytes = ({ data }) => {
|
|
|
44967
44962
|
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
44968
44963
|
] });
|
|
44969
44964
|
}
|
|
44970
|
-
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc,
|
|
44971
|
-
acc[index.toString()] =
|
|
44965
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
44966
|
+
acc[index.toString()] = value;
|
|
44972
44967
|
return acc;
|
|
44973
44968
|
}, {});
|
|
44974
|
-
const
|
|
44975
|
-
const
|
|
44976
|
-
if (
|
|
44977
|
-
const
|
|
44978
|
-
if (
|
|
44979
|
-
|
|
44980
|
-
|
|
44981
|
-
|
|
44982
|
-
|
|
44969
|
+
const byteValueItems = Array.isArray(bytesValue) ? bytesValue : [bytesValue];
|
|
44970
|
+
const resolvedStrings = byteValueItems.map((text) => parseAll({ text, replaceValues, multiQueryData }));
|
|
44971
|
+
if (resolvedStrings.length === 0) {
|
|
44972
|
+
const targetUnit2 = toUnit || unit;
|
|
44973
|
+
if (targetUnit2) {
|
|
44974
|
+
const result3 = String(
|
|
44975
|
+
convertBytes(0, targetUnit2, {
|
|
44976
|
+
format,
|
|
44977
|
+
precision,
|
|
44978
|
+
locale
|
|
44979
|
+
})
|
|
44980
|
+
);
|
|
44983
44981
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: result3 });
|
|
44984
44982
|
}
|
|
44985
|
-
const result2 = formatBytesAuto(
|
|
44983
|
+
const result2 = formatBytesAuto(0, { standard, precision, locale });
|
|
44986
44984
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: result2 });
|
|
44987
44985
|
}
|
|
44988
|
-
|
|
44989
|
-
const
|
|
44986
|
+
let totalBytes = 0;
|
|
44987
|
+
for (const s of resolvedStrings) {
|
|
44988
|
+
const parsed = parseValueWithUnit(s);
|
|
44989
|
+
let numericValue;
|
|
44990
|
+
let inlineUnit;
|
|
44991
|
+
if (parsed) {
|
|
44992
|
+
numericValue = parsed.value;
|
|
44993
|
+
inlineUnit = parsed.unit;
|
|
44994
|
+
} else {
|
|
44995
|
+
const fallbackNumber = Number(s);
|
|
44996
|
+
if (Number.isNaN(fallbackNumber)) {
|
|
44997
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: notANumberText || "Not a proper value" });
|
|
44998
|
+
}
|
|
44999
|
+
numericValue = fallbackNumber;
|
|
45000
|
+
inlineUnit = void 0;
|
|
45001
|
+
}
|
|
45002
|
+
const fromForThis = fromUnit || inlineUnit || "B";
|
|
45003
|
+
let bytesForThis;
|
|
45004
|
+
if (fromForThis === "B") {
|
|
45005
|
+
if (!Number.isFinite(numericValue)) {
|
|
45006
|
+
console.error("bytes must be a finite number");
|
|
45007
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: notANumberText || "Not a proper value" });
|
|
45008
|
+
}
|
|
45009
|
+
if (numericValue < 0) {
|
|
45010
|
+
console.error("bytes must be >= 0");
|
|
45011
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: notANumberText || "Not a proper value" });
|
|
45012
|
+
}
|
|
45013
|
+
bytesForThis = numericValue;
|
|
45014
|
+
} else {
|
|
45015
|
+
bytesForThis = toBytes(numericValue, fromForThis);
|
|
45016
|
+
if (bytesForThis < 0) {
|
|
45017
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: notANumberText || "Not a proper value" });
|
|
45018
|
+
}
|
|
45019
|
+
}
|
|
45020
|
+
totalBytes += bytesForThis;
|
|
45021
|
+
}
|
|
44990
45022
|
const targetUnit = toUnit || unit;
|
|
44991
|
-
if (
|
|
45023
|
+
if (targetUnit) {
|
|
44992
45024
|
const result2 = String(
|
|
44993
|
-
|
|
45025
|
+
convertBytes(totalBytes, targetUnit, {
|
|
44994
45026
|
format,
|
|
44995
45027
|
precision,
|
|
44996
45028
|
locale
|
|
@@ -44998,19 +45030,203 @@ const ConverterBytes = ({ data }) => {
|
|
|
44998
45030
|
);
|
|
44999
45031
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: result2 });
|
|
45000
45032
|
}
|
|
45001
|
-
|
|
45002
|
-
|
|
45003
|
-
|
|
45004
|
-
|
|
45033
|
+
const result = formatBytesAuto(totalBytes, { standard, precision, locale });
|
|
45034
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: result });
|
|
45035
|
+
};
|
|
45036
|
+
|
|
45037
|
+
const CORE_UNIT_FACTORS = {
|
|
45038
|
+
core: 1,
|
|
45039
|
+
mcore: 1e-3,
|
|
45040
|
+
ucore: 1e-6,
|
|
45041
|
+
ncore: 1e-9
|
|
45042
|
+
};
|
|
45043
|
+
const CORE_ALIASES = (() => {
|
|
45044
|
+
const corePairs = [
|
|
45045
|
+
// plain cores
|
|
45046
|
+
[["core", "cores", "c", "cpu", "cpus", "vcpu", "vcpus"], "core"],
|
|
45047
|
+
// millicores
|
|
45048
|
+
[["m", "mc", "mcore", "mcores", "millicore", "millicores", "millicpu", "millicpus"], "mcore"],
|
|
45049
|
+
// microcores
|
|
45050
|
+
[["u", "µ", "ucore", "ucores", "micro", "microcore", "microcores"], "ucore"],
|
|
45051
|
+
// nanocores
|
|
45052
|
+
[["n", "ncore", "ncores", "nano", "nanocore", "nanocores"], "ncore"]
|
|
45053
|
+
];
|
|
45054
|
+
const entries = corePairs.flatMap(([keys, unit]) => keys.map((k) => [k.toLowerCase(), unit]));
|
|
45055
|
+
const canon = Object.keys(CORE_UNIT_FACTORS).map((u) => [u.toLowerCase(), u]);
|
|
45056
|
+
return Object.fromEntries([...entries, ...canon]);
|
|
45057
|
+
})();
|
|
45058
|
+
const normalizeCoreUnit = (u) => {
|
|
45059
|
+
const key = String(u).trim().toLowerCase();
|
|
45060
|
+
const canon = CORE_ALIASES[key];
|
|
45061
|
+
if (!canon) {
|
|
45062
|
+
console.error(`Unknown core unit: "${u}"`);
|
|
45063
|
+
return "core";
|
|
45064
|
+
}
|
|
45065
|
+
return canon;
|
|
45066
|
+
};
|
|
45067
|
+
const convertCores = (cores, unit, opts) => {
|
|
45068
|
+
if (!Number.isFinite(cores)) {
|
|
45069
|
+
console.error("cores must be a finite number");
|
|
45070
|
+
return -1;
|
|
45071
|
+
}
|
|
45072
|
+
if (cores < 0) {
|
|
45073
|
+
console.error("cores must be >= 0");
|
|
45074
|
+
return -1;
|
|
45075
|
+
}
|
|
45076
|
+
const canon = normalizeCoreUnit(unit);
|
|
45077
|
+
const factor = CORE_UNIT_FACTORS[canon];
|
|
45078
|
+
const value = cores / factor;
|
|
45079
|
+
if (!opts?.format) return value;
|
|
45080
|
+
return `${value.toLocaleString(opts.locale, {
|
|
45081
|
+
minimumFractionDigits: 0,
|
|
45082
|
+
maximumFractionDigits: opts?.precision ?? 2
|
|
45083
|
+
})} ${canon}`;
|
|
45084
|
+
};
|
|
45085
|
+
const formatCoresAuto = (cores, { precision = 2, locale } = {}) => {
|
|
45086
|
+
if (!Number.isFinite(cores)) {
|
|
45087
|
+
console.error("cores must be a finite number");
|
|
45088
|
+
return "infinite";
|
|
45089
|
+
}
|
|
45090
|
+
if (cores < 0) {
|
|
45091
|
+
console.error("cores must be >= 0");
|
|
45092
|
+
return "less then zero";
|
|
45093
|
+
}
|
|
45094
|
+
if (cores === 0) {
|
|
45095
|
+
return "0 core";
|
|
45096
|
+
}
|
|
45097
|
+
let targetUnit;
|
|
45098
|
+
if (cores >= 1) {
|
|
45099
|
+
targetUnit = "core";
|
|
45100
|
+
} else if (cores >= 1e-3) {
|
|
45101
|
+
targetUnit = "mcore";
|
|
45102
|
+
} else if (cores >= 1e-6) {
|
|
45103
|
+
targetUnit = "ucore";
|
|
45104
|
+
} else {
|
|
45105
|
+
targetUnit = "ncore";
|
|
45106
|
+
}
|
|
45107
|
+
return String(convertCores(cores, targetUnit, { format: true, precision, locale }));
|
|
45108
|
+
};
|
|
45109
|
+
const toCores = (value, from) => {
|
|
45110
|
+
if (!Number.isFinite(value)) {
|
|
45111
|
+
console.error("value must be a finite number");
|
|
45112
|
+
return -1;
|
|
45113
|
+
}
|
|
45114
|
+
if (value < 0) {
|
|
45115
|
+
console.error("value must be >= 0");
|
|
45116
|
+
return -1;
|
|
45117
|
+
}
|
|
45118
|
+
const canon = normalizeCoreUnit(from);
|
|
45119
|
+
const factor = CORE_UNIT_FACTORS[canon];
|
|
45120
|
+
return value * factor;
|
|
45121
|
+
};
|
|
45122
|
+
const parseCoresWithUnit = (input) => {
|
|
45123
|
+
const trimmed = input.trim();
|
|
45124
|
+
if (!trimmed) return null;
|
|
45125
|
+
const match = trimmed.match(/^([+-]?\d+(?:\.\d+)?)(?:\s*([a-zA-Zµ]+))?$/);
|
|
45126
|
+
if (!match) return null;
|
|
45127
|
+
const [, numPart, unitPart] = match;
|
|
45128
|
+
const value = Number(numPart);
|
|
45129
|
+
if (!Number.isFinite(value)) return null;
|
|
45130
|
+
if (unitPart) {
|
|
45131
|
+
return { value, unit: unitPart };
|
|
45132
|
+
}
|
|
45133
|
+
return { value };
|
|
45134
|
+
};
|
|
45135
|
+
|
|
45136
|
+
const ConverterCores = ({ data }) => {
|
|
45137
|
+
const {
|
|
45138
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
45139
|
+
id,
|
|
45140
|
+
coresValue,
|
|
45141
|
+
unit,
|
|
45142
|
+
fromUnit,
|
|
45143
|
+
toUnit,
|
|
45144
|
+
format,
|
|
45145
|
+
precision,
|
|
45146
|
+
locale,
|
|
45147
|
+
notANumberText,
|
|
45148
|
+
style
|
|
45149
|
+
} = data;
|
|
45150
|
+
const { data: multiQueryData, isLoading, isError, errors } = useMultiQuery();
|
|
45151
|
+
const partsOfUrl = usePartsOfUrl();
|
|
45152
|
+
if (isLoading) {
|
|
45153
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
45154
|
+
}
|
|
45155
|
+
if (isError) {
|
|
45156
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
45157
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
45158
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
45159
|
+
] });
|
|
45160
|
+
}
|
|
45161
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
45162
|
+
acc[index.toString()] = value;
|
|
45163
|
+
return acc;
|
|
45164
|
+
}, {});
|
|
45165
|
+
const coreValueItems = Array.isArray(coresValue) ? coresValue : [coresValue];
|
|
45166
|
+
const resolvedStrings = coreValueItems.map((text) => parseAll({ text, replaceValues, multiQueryData }));
|
|
45167
|
+
if (resolvedStrings.length === 0) {
|
|
45168
|
+
const targetUnit2 = toUnit || unit;
|
|
45169
|
+
if (targetUnit2) {
|
|
45170
|
+
const result3 = String(
|
|
45171
|
+
convertCores(0, targetUnit2, {
|
|
45172
|
+
format,
|
|
45173
|
+
precision,
|
|
45174
|
+
locale
|
|
45175
|
+
})
|
|
45176
|
+
);
|
|
45177
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: result3 });
|
|
45005
45178
|
}
|
|
45006
|
-
const result2 =
|
|
45179
|
+
const result2 = formatCoresAuto(0, { precision, locale });
|
|
45007
45180
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: result2 });
|
|
45008
45181
|
}
|
|
45182
|
+
let totalCores = 0;
|
|
45183
|
+
for (const s of resolvedStrings) {
|
|
45184
|
+
const parsed = parseCoresWithUnit(s);
|
|
45185
|
+
let numericValue;
|
|
45186
|
+
let inlineUnit;
|
|
45187
|
+
if (parsed) {
|
|
45188
|
+
numericValue = parsed.value;
|
|
45189
|
+
inlineUnit = parsed.unit;
|
|
45190
|
+
} else {
|
|
45191
|
+
const fallbackNumber = Number(s);
|
|
45192
|
+
if (Number.isNaN(fallbackNumber)) {
|
|
45193
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: notANumberText || "Not a proper value" });
|
|
45194
|
+
}
|
|
45195
|
+
numericValue = fallbackNumber;
|
|
45196
|
+
inlineUnit = void 0;
|
|
45197
|
+
}
|
|
45198
|
+
const fromForThis = fromUnit || inlineUnit || "core";
|
|
45199
|
+
let coresForThis;
|
|
45200
|
+
if (fromForThis === "core") {
|
|
45201
|
+
if (!Number.isFinite(numericValue)) {
|
|
45202
|
+
console.error("cores must be a finite number");
|
|
45203
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: notANumberText || "Not a proper value" });
|
|
45204
|
+
}
|
|
45205
|
+
if (numericValue < 0) {
|
|
45206
|
+
console.error("cores must be >= 0");
|
|
45207
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: notANumberText || "Not a proper value" });
|
|
45208
|
+
}
|
|
45209
|
+
coresForThis = numericValue;
|
|
45210
|
+
} else {
|
|
45211
|
+
coresForThis = toCores(numericValue, fromForThis);
|
|
45212
|
+
if (coresForThis < 0) {
|
|
45213
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: notANumberText || "Not a proper value" });
|
|
45214
|
+
}
|
|
45215
|
+
}
|
|
45216
|
+
totalCores += coresForThis;
|
|
45217
|
+
}
|
|
45218
|
+
const targetUnit = toUnit || unit;
|
|
45009
45219
|
if (targetUnit) {
|
|
45010
|
-
const result2 = String(
|
|
45220
|
+
const result2 = String(
|
|
45221
|
+
convertCores(totalCores, targetUnit, {
|
|
45222
|
+
format,
|
|
45223
|
+
precision,
|
|
45224
|
+
locale
|
|
45225
|
+
})
|
|
45226
|
+
);
|
|
45011
45227
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: result2 });
|
|
45012
45228
|
}
|
|
45013
|
-
const result =
|
|
45229
|
+
const result = formatCoresAuto(totalCores, { precision, locale });
|
|
45014
45230
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style, children: result });
|
|
45015
45231
|
};
|
|
45016
45232
|
|
|
@@ -46649,6 +46865,7 @@ const DynamicComponents = {
|
|
|
46649
46865
|
Tolerations,
|
|
46650
46866
|
Annotations,
|
|
46651
46867
|
ConverterBytes,
|
|
46868
|
+
ConverterCores,
|
|
46652
46869
|
SecretBase64Plain,
|
|
46653
46870
|
ResourceBadge,
|
|
46654
46871
|
Events: Events$1,
|
|
@@ -46835,16 +47052,29 @@ const getEnrichedColumns = ({
|
|
|
46835
47052
|
additionalPrinterColumnsTrimLengths,
|
|
46836
47053
|
additionalPrinterColumnsColWidths,
|
|
46837
47054
|
additionalPrinterColumnsKeyTypeProps,
|
|
46838
|
-
|
|
47055
|
+
additionalPrinterColumnsDisableSortersAndFilters,
|
|
47056
|
+
theme,
|
|
47057
|
+
getRowKey
|
|
47058
|
+
// for factory search
|
|
46839
47059
|
}) => {
|
|
46840
47060
|
if (!columns) {
|
|
46841
47061
|
return void 0;
|
|
46842
47062
|
}
|
|
46843
|
-
return columns.map((el) => {
|
|
47063
|
+
return columns.map((el, colIndex) => {
|
|
47064
|
+
const isSortersAndFitlersDisabled = additionalPrinterColumnsDisableSortersAndFilters?.some((key) => key === el.key);
|
|
46844
47065
|
const possibleUndefinedValue = additionalPrinterColumnsUndefinedValues?.find(({ key }) => key === el.key)?.value;
|
|
46845
47066
|
const possibleTrimLength = additionalPrinterColumnsTrimLengths?.find(({ key }) => key === el.key)?.value;
|
|
46846
47067
|
const possibleColWidth = additionalPrinterColumnsColWidths?.find(({ key }) => key === el.key)?.value;
|
|
46847
47068
|
const possibleCustomTypeWithProps = additionalPrinterColumnsKeyTypeProps && el.key ? additionalPrinterColumnsKeyTypeProps[el.key.toString()] : void 0;
|
|
47069
|
+
const useFactorySearch = possibleCustomTypeWithProps?.type === "factory";
|
|
47070
|
+
const colKey = el.key != null && String(el.key) || (Array.isArray(el.dataIndex) ? el.dataIndex.join(".") : String(el.dataIndex ?? colIndex));
|
|
47071
|
+
const getCellTextFromDOM = (record) => {
|
|
47072
|
+
const rowKey = getRowKey(record);
|
|
47073
|
+
const selector = `td[data-rowkey="${String(rowKey)}"][data-colkey="${colKey}"]`;
|
|
47074
|
+
const cell = document.querySelector(selector);
|
|
47075
|
+
if (!cell) return "";
|
|
47076
|
+
return (cell.innerText || cell.textContent || "").trim().toLowerCase();
|
|
47077
|
+
};
|
|
46848
47078
|
return {
|
|
46849
47079
|
...el,
|
|
46850
47080
|
render: (value, record) => getCellRender({
|
|
@@ -46856,18 +47086,43 @@ const getEnrichedColumns = ({
|
|
|
46856
47086
|
theme
|
|
46857
47087
|
}),
|
|
46858
47088
|
width: possibleColWidth,
|
|
46859
|
-
|
|
46860
|
-
|
|
46861
|
-
|
|
46862
|
-
|
|
46863
|
-
|
|
46864
|
-
|
|
46865
|
-
|
|
46866
|
-
|
|
47089
|
+
// for factory search
|
|
47090
|
+
onCell: (record) => {
|
|
47091
|
+
const rowKey = getRowKey(record);
|
|
47092
|
+
return {
|
|
47093
|
+
"data-rowkey": String(rowKey),
|
|
47094
|
+
"data-colkey": String(colKey)
|
|
47095
|
+
};
|
|
47096
|
+
},
|
|
47097
|
+
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }) => {
|
|
47098
|
+
if (isSortersAndFitlersDisabled) {
|
|
47099
|
+
return null;
|
|
46867
47100
|
}
|
|
46868
|
-
|
|
46869
|
-
|
|
47101
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47102
|
+
FilterDropdown,
|
|
47103
|
+
{
|
|
47104
|
+
setSelectedKeys,
|
|
47105
|
+
selectedKeys,
|
|
47106
|
+
confirm,
|
|
47107
|
+
clearFilters,
|
|
47108
|
+
close
|
|
47109
|
+
}
|
|
47110
|
+
);
|
|
47111
|
+
},
|
|
47112
|
+
filterIcon: (filtered) => {
|
|
47113
|
+
if (isSortersAndFitlersDisabled) {
|
|
47114
|
+
return null;
|
|
47115
|
+
}
|
|
47116
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SearchOutlined, { style: { color: filtered ? "#1677ff" : void 0 } });
|
|
47117
|
+
},
|
|
46870
47118
|
onFilter: (value, record) => {
|
|
47119
|
+
if (isSortersAndFitlersDisabled) {
|
|
47120
|
+
return false;
|
|
47121
|
+
}
|
|
47122
|
+
if (useFactorySearch) {
|
|
47123
|
+
const text = getCellTextFromDOM(record);
|
|
47124
|
+
return text.includes(String(value).toLowerCase());
|
|
47125
|
+
}
|
|
46871
47126
|
const { dataIndex } = el;
|
|
46872
47127
|
const entry = Array.isArray(dataIndex) ? lodashExports.get(record, dataIndex) : record[dataIndex];
|
|
46873
47128
|
if (typeof entry === "object" && !Array.isArray(entry)) {
|
|
@@ -46888,7 +47143,12 @@ const getEnrichedColumns = ({
|
|
|
46888
47143
|
}
|
|
46889
47144
|
return false;
|
|
46890
47145
|
},
|
|
46891
|
-
sorter: (a, b) => {
|
|
47146
|
+
sorter: isSortersAndFitlersDisabled ? false : (a, b) => {
|
|
47147
|
+
if (useFactorySearch) {
|
|
47148
|
+
const aText = getCellTextFromDOM(a);
|
|
47149
|
+
const bText = getCellTextFromDOM(b);
|
|
47150
|
+
return aText.localeCompare(bText);
|
|
47151
|
+
}
|
|
46892
47152
|
const { dataIndex } = el;
|
|
46893
47153
|
const aEntry = Array.isArray(dataIndex) ? lodashExports.get(a, dataIndex) : a[dataIndex];
|
|
46894
47154
|
const bEntry = Array.isArray(dataIndex) ? lodashExports.get(b, dataIndex) : b[dataIndex];
|
|
@@ -47019,6 +47279,7 @@ const EnrichedTable = ({
|
|
|
47019
47279
|
additionalPrinterColumnsTrimLengths,
|
|
47020
47280
|
additionalPrinterColumnsColWidths,
|
|
47021
47281
|
additionalPrinterColumnsKeyTypeProps,
|
|
47282
|
+
additionalPrinterColumnsDisableSortersAndFilters,
|
|
47022
47283
|
selectData,
|
|
47023
47284
|
withoutControls = false,
|
|
47024
47285
|
tableProps
|
|
@@ -47027,13 +47288,17 @@ const EnrichedTable = ({
|
|
|
47027
47288
|
if (!columns) {
|
|
47028
47289
|
return null;
|
|
47029
47290
|
}
|
|
47291
|
+
const rowKey = (record) => record.key;
|
|
47030
47292
|
const enrichedColumns = getEnrichedColumns({
|
|
47031
47293
|
columns,
|
|
47032
47294
|
additionalPrinterColumnsUndefinedValues,
|
|
47033
47295
|
additionalPrinterColumnsTrimLengths,
|
|
47034
47296
|
additionalPrinterColumnsColWidths,
|
|
47035
47297
|
additionalPrinterColumnsKeyTypeProps,
|
|
47036
|
-
|
|
47298
|
+
additionalPrinterColumnsDisableSortersAndFilters,
|
|
47299
|
+
theme,
|
|
47300
|
+
getRowKey: rowKey
|
|
47301
|
+
// for factory search
|
|
47037
47302
|
});
|
|
47038
47303
|
if (!enrichedColumns) {
|
|
47039
47304
|
return null;
|
|
@@ -47059,6 +47324,7 @@ const EnrichedTable = ({
|
|
|
47059
47324
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(TableComponents.HideableControls, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47060
47325
|
Table,
|
|
47061
47326
|
{
|
|
47327
|
+
rowKey,
|
|
47062
47328
|
dataSource,
|
|
47063
47329
|
columns: columnsWithControls,
|
|
47064
47330
|
pagination: tableProps?.disablePagination ? false : {
|
|
@@ -47400,6 +47666,7 @@ const EnrichedTableProvider = ({
|
|
|
47400
47666
|
additionalPrinterColumnsTrimLengths: preparedProps.additionalPrinterColumnsTrimLengths,
|
|
47401
47667
|
additionalPrinterColumnsColWidths: preparedProps.additionalPrinterColumnsColWidths,
|
|
47402
47668
|
additionalPrinterColumnsKeyTypeProps: preparedProps.additionalPrinterColumnsKeyTypeProps,
|
|
47669
|
+
additionalPrinterColumnsDisableSortersAndFilters: preparedProps.additionalPrinterColumnsDisableSortersAndFilters,
|
|
47403
47670
|
selectData,
|
|
47404
47671
|
tableProps,
|
|
47405
47672
|
withoutControls
|