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

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.
@@ -78892,7 +78892,7 @@ const TolerationsModal = ({
78892
78892
  };
78893
78893
 
78894
78894
  const LazyEnrichedTableModal = lazy(
78895
- () => import('./index-BmpJg0ct.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
78895
+ () => import('./index-sWQFraqw.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
78896
78896
  );
78897
78897
  const renderActiveType = (activeType, extraProps) => {
78898
78898
  if (!activeType) return null;
@@ -82274,6 +82274,70 @@ const TableFactory = ({ record, customProps, theme }) => {
82274
82274
  );
82275
82275
  };
82276
82276
 
82277
+ const DEFAULT_FIXED_NAME_COLUMN_WIDTH = 240;
82278
+ const DEFAULT_FIXED_ACTIONS_COLUMN_WIDTH = 60;
82279
+ const stringifyColumnValue = (value) => {
82280
+ if (typeof value === "string" || typeof value === "number") {
82281
+ return String(value).trim().toLowerCase();
82282
+ }
82283
+ return void 0;
82284
+ };
82285
+ const getColumnDataPath = (dataIndex) => {
82286
+ if (Array.isArray(dataIndex)) {
82287
+ return dataIndex.map(String).join(".").trim().toLowerCase();
82288
+ }
82289
+ return stringifyColumnValue(dataIndex);
82290
+ };
82291
+ const isNameColumn = (column) => {
82292
+ const key = stringifyColumnValue(column.key);
82293
+ const title = stringifyColumnValue(column.title);
82294
+ const dataPath = getColumnDataPath(column.dataIndex);
82295
+ return key === "name" || title === "name" || dataPath === "name" || dataPath === "metadata.name";
82296
+ };
82297
+ const hasFactoryItemOfType = (customProps, itemType) => {
82298
+ if (typeof customProps !== "object" || customProps === null) {
82299
+ return false;
82300
+ }
82301
+ if (!("items" in customProps) || !Array.isArray(customProps.items)) {
82302
+ return false;
82303
+ }
82304
+ return customProps.items.some(
82305
+ (item) => typeof item === "object" && item !== null && "type" in item && item.type === itemType
82306
+ );
82307
+ };
82308
+ const getFixedColumnSide = ({
82309
+ shouldFixNameColumn,
82310
+ shouldFixActionsColumn,
82311
+ currentFixed
82312
+ }) => {
82313
+ if (shouldFixNameColumn) {
82314
+ return "left";
82315
+ }
82316
+ if (shouldFixActionsColumn) {
82317
+ return "right";
82318
+ }
82319
+ return currentFixed;
82320
+ };
82321
+ const getFixedColumnWidth = ({
82322
+ possibleColWidth,
82323
+ currentWidth,
82324
+ shouldFixNameColumn,
82325
+ shouldFixActionsColumn
82326
+ }) => {
82327
+ if (possibleColWidth !== void 0) {
82328
+ return possibleColWidth;
82329
+ }
82330
+ if (currentWidth !== void 0) {
82331
+ return currentWidth;
82332
+ }
82333
+ if (shouldFixNameColumn) {
82334
+ return DEFAULT_FIXED_NAME_COLUMN_WIDTH;
82335
+ }
82336
+ if (shouldFixActionsColumn) {
82337
+ return DEFAULT_FIXED_ACTIONS_COLUMN_WIDTH;
82338
+ }
82339
+ return void 0;
82340
+ };
82277
82341
  const getCellRender = ({
82278
82342
  value,
82279
82343
  record,
@@ -82375,6 +82439,7 @@ const getEnrichedColumns = ({
82375
82439
  if (!columns) {
82376
82440
  return void 0;
82377
82441
  }
82442
+ let hasFixedNameColumn = false;
82378
82443
  return columns.map((el, colIndex) => {
82379
82444
  const possibleAdditionalPrinterColumnsCustomSortersAndFiltersType = additionalPrinterColumnsCustomSortersAndFilters?.find(({ key }) => key === el.key)?.type;
82380
82445
  const isSortersAndFiltersDisabled = possibleAdditionalPrinterColumnsCustomSortersAndFiltersType === "disabled";
@@ -82386,6 +82451,11 @@ const getEnrichedColumns = ({
82386
82451
  const possibleTooltip = additionalPrinterColumnsTooltips?.find(({ key }) => key === el.key)?.value;
82387
82452
  const possibleCustomTypeWithProps = additionalPrinterColumnsKeyTypeProps && el.key ? additionalPrinterColumnsKeyTypeProps[el.key.toString()] : void 0;
82388
82453
  const originalRender = el.render;
82454
+ const shouldFixNameColumn = !hasFixedNameColumn && isNameColumn(el);
82455
+ const shouldFixActionsColumn = possibleCustomTypeWithProps?.type === "factory" && hasFactoryItemOfType(possibleCustomTypeWithProps.customProps, "ActionsDropdown");
82456
+ if (shouldFixNameColumn) {
82457
+ hasFixedNameColumn = true;
82458
+ }
82389
82459
  const useFactorySearch = possibleCustomTypeWithProps?.type === "factory";
82390
82460
  const colKey = el.key != null && String(el.key) || (Array.isArray(el.dataIndex) ? el.dataIndex.join(".") : String(el.dataIndex ?? colIndex));
82391
82461
  const getCellTextFromRecord = (record) => {
@@ -82484,7 +82554,17 @@ const getEnrichedColumns = ({
82484
82554
  theme
82485
82555
  });
82486
82556
  },
82487
- width: possibleColWidth,
82557
+ fixed: getFixedColumnSide({
82558
+ shouldFixNameColumn,
82559
+ shouldFixActionsColumn,
82560
+ currentFixed: el.fixed
82561
+ }),
82562
+ width: getFixedColumnWidth({
82563
+ possibleColWidth,
82564
+ currentWidth: el.width,
82565
+ shouldFixNameColumn,
82566
+ shouldFixActionsColumn
82567
+ }),
82488
82568
  // for factory search
82489
82569
  onCell: (record) => {
82490
82570
  const rowKey = getRowKey(record);
@@ -82615,6 +82695,7 @@ const getEnrichedColumnsWithControls = ({
82615
82695
  dataIndex: "internalDataForControls",
82616
82696
  key: "controls",
82617
82697
  className: "controls",
82698
+ fixed: "right",
82618
82699
  width: 60,
82619
82700
  render: (value) => {
82620
82701
  return (
@@ -82775,6 +82856,7 @@ const EnrichedTable = ({
82775
82856
  rowClassName,
82776
82857
  rowSelection: selectData ? {
82777
82858
  type: "checkbox",
82859
+ fixed: "left",
82778
82860
  columnWidth: 48,
82779
82861
  selectedRowKeys: selectData.selectedRowKeys,
82780
82862
  onChange: (selectedRowKeys, selectedRows) => {
@@ -94514,4 +94596,4 @@ const usePluginManifest = ({
94514
94596
  };
94515
94597
 
94516
94598
  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-gq5MnduZ.mjs.map
94599
+ //# sourceMappingURL=index-C5cixTVm.mjs.map