@prorobotech/openapi-k8s-toolkit 1.4.0-alpha.16 → 1.4.0-alpha.17
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-Cc-4YPOA.mjs → index-B50_esSW.mjs} +86 -15
- package/dist/index-B50_esSW.mjs.map +1 -0
- package/dist/{index-Drku3xGg.mjs → index-CTYM2Lu_.mjs} +2 -2
- package/dist/{index-Drku3xGg.mjs.map → index-CTYM2Lu_.mjs.map} +1 -1
- package/dist/openapi-k8s-toolkit.es.js +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +84 -13
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/api/bff/plugins/getPlugins.d.ts +1 -1
- package/dist/types/api/bff/scopes/checkScopes.d.ts +1 -1
- package/dist/types/api/bff/scopes/filterScopes.d.ts +2 -2
- package/dist/types/api/bff/search/getKinds.d.ts +1 -1
- package/dist/types/api/bff/swagger/getSwagger.d.ts +1 -1
- package/dist/types/api/getClusterList.d.ts +1 -1
- package/dist/types/api/permissions.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/CustomCollapse/CustomCollapse.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/DebugNameViewer/DebugNameViewer.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/HiddenContainer.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/utils.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/PersistedCheckbox/PersistedCheckbox.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormArrayHeader/FormArrayHeader.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormBooleanInput/FormBooleanInput.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormEnumStringInput/FormEnumStringInput.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormInlineYamlEditor/FormInlineYamlEditor.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormListInput/FormListInput.d.ts +2 -2
- package/dist/types/components/molecules/BlackholeForm/molecules/FormNamespaceInput/FormNamespaceInput.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormNumberInput/FormNumberInput.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormObjectFromSwagger/FormObjectFromSwagger.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/FormRangeInput.d.ts +2 -2
- package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/molecules/RangeInput/RangeInput.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/utils.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormStringInput/FormStringInput.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/FormStringMultilineInput.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/helpers/validation.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/BlackholeForm.d.ts +3 -3
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/casts.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/getSortedPropertyKeys.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/hiddenExpanded.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/utils.d.ts +2 -2
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/utilsErrorHandler.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/BlackholeFormProvider.d.ts +2 -2
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/EnrichedTable.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/utils.d.ts +2 -2
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/EnrichedTableProvider.d.ts +2 -2
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/utils.d.ts +2 -2
- package/dist/types/components/molecules/MarketPlace/molecules/AddEditFormModal/AddEditFormModal.d.ts +1 -1
- package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/MarketplaceCard.d.ts +1 -1
- package/dist/types/components/molecules/Search/Search.d.ts +1 -1
- package/dist/types/components/molecules/YamlEditorSingleton/YamlEditorSingleton.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/DynamicComponents.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ActionsDropdown/permissionsMap.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/helpers.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/UsageGraphCard/atoms/FormattedValue/utils.d.ts +2 -2
- package/dist/types/components/organisms/DynamicComponents/types/ContentCard.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/types/ConverterBytes.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/types/ConverterCores.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/types/EnrichedTable.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/types/PrometheusGraph.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/types/SidebarProvider.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/types/Spacer.d.ts +1 -1
- package/dist/types/components/organisms/DynamicRenderer/DynamicRenderer.d.ts +1 -1
- package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.d.ts +2 -2
- package/dist/types/components/organisms/DynamicRendererWithProviders/providers/hybridDataProvider/hybridDataProvider.d.ts +1 -1
- package/dist/types/components/organisms/DynamicRendererWithProviders/providers/multiK8sProvider/multiK8sProvider.d.ts +1 -1
- package/dist/types/hooks/useApiResource.d.ts +1 -1
- package/dist/types/hooks/useBuiltinResourceTypes.d.ts +1 -1
- package/dist/types/hooks/useCrdResource.d.ts +1 -1
- package/dist/types/hooks/useK8sSmartResource/useK8sSmartResourceWithoutKinds.d.ts +1 -1
- package/dist/types/hooks/useListThenWatch/reducer.d.ts +1 -1
- package/dist/types/hooks/useListThenWatch/types.d.ts +1 -1
- package/dist/types/hooks/useListThenWatch/useListWatch.d.ts +1 -1
- package/dist/types/hooks/useListThenWatch/utils.d.ts +1 -1
- package/dist/types/hooks/usePermissions.d.ts +1 -1
- package/dist/types/localTypes/bff/table.d.ts +1 -1
- package/dist/types/localTypes/dynamicRender.d.ts +1 -1
- package/dist/types/localTypes/search.d.ts +1 -1
- package/dist/types/utils/converterBytes/converterBytes.d.ts +1 -1
- package/dist/types/utils/converterCores/converterCores.d.ts +1 -1
- package/dist/types/utils/getGroupsByCategory/getGroupsByCategory.d.ts +1 -1
- package/dist/types/utils/getSortedKinds/getSortedKinds.d.ts +2 -2
- package/dist/types/utils/getSortedKindsAll/getSortedKindsAll.d.ts +2 -2
- package/dist/types/utils/getStringByName/getStringByName.d.ts +1 -1
- package/dist/types/utils/kindByGvr/kindByGvr.d.ts +1 -1
- package/dist/types/utils/namespacedByGvr/namespacedByGvr.d.ts +1 -1
- package/dist/types/utils/pluralByKind/pluralByKind.d.ts +1 -1
- package/package.json +1 -1
- package/dist/index-Cc-4YPOA.mjs.map +0 -1
|
@@ -78596,7 +78596,7 @@ const TolerationsModal = ({
|
|
|
78596
78596
|
};
|
|
78597
78597
|
|
|
78598
78598
|
const LazyEnrichedTableModal = lazy(
|
|
78599
|
-
() => import('./index-
|
|
78599
|
+
() => import('./index-CTYM2Lu_.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
|
|
78600
78600
|
);
|
|
78601
78601
|
const renderActiveType = (activeType, extraProps) => {
|
|
78602
78602
|
if (!activeType) return null;
|
|
@@ -81012,6 +81012,39 @@ const CreateFromFilesModal = ({
|
|
|
81012
81012
|
);
|
|
81013
81013
|
};
|
|
81014
81014
|
|
|
81015
|
+
const VIEWPORT_MARGIN_PX = 12;
|
|
81016
|
+
const ITEM_HEIGHT_ESTIMATE_PX = 40;
|
|
81017
|
+
const MENU_VERTICAL_PADDING_PX = 8;
|
|
81018
|
+
const MIN_MENU_HEIGHT_PX = 140;
|
|
81019
|
+
const MAX_MENU_HEIGHT_PX = 420;
|
|
81020
|
+
const DEFAULT_MENU_MAX_HEIGHT_PX = 320;
|
|
81021
|
+
const isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
81022
|
+
const clamp = (value, min, max) => {
|
|
81023
|
+
return Math.min(Math.max(value, min), max);
|
|
81024
|
+
};
|
|
81025
|
+
const getDropdownPlacement = ({
|
|
81026
|
+
triggerTop,
|
|
81027
|
+
triggerBottom,
|
|
81028
|
+
viewportHeight,
|
|
81029
|
+
actionsCount
|
|
81030
|
+
}) => {
|
|
81031
|
+
const safeActionsCount = Number.isFinite(actionsCount) ? Math.max(0, actionsCount) : 0;
|
|
81032
|
+
if (!isFiniteNumber(triggerTop) || !isFiniteNumber(triggerBottom) || !isFiniteNumber(viewportHeight)) {
|
|
81033
|
+
return { placement: "bottomLeft", maxMenuHeightPx: DEFAULT_MENU_MAX_HEIGHT_PX };
|
|
81034
|
+
}
|
|
81035
|
+
const estimatedMenuHeight = safeActionsCount * ITEM_HEIGHT_ESTIMATE_PX + MENU_VERTICAL_PADDING_PX;
|
|
81036
|
+
const spaceAbove = Math.max(0, Math.floor(triggerTop - VIEWPORT_MARGIN_PX));
|
|
81037
|
+
const spaceBelow = Math.max(0, Math.floor(viewportHeight - triggerBottom - VIEWPORT_MARGIN_PX));
|
|
81038
|
+
const shouldOpenUp = spaceBelow < estimatedMenuHeight && spaceAbove > spaceBelow;
|
|
81039
|
+
const placement = shouldOpenUp ? "topLeft" : "bottomLeft";
|
|
81040
|
+
const availableSpace = shouldOpenUp ? spaceAbove : spaceBelow;
|
|
81041
|
+
if (availableSpace <= 0) {
|
|
81042
|
+
return { placement, maxMenuHeightPx: DEFAULT_MENU_MAX_HEIGHT_PX };
|
|
81043
|
+
}
|
|
81044
|
+
const maxMenuHeightPx = availableSpace < MIN_MENU_HEIGHT_PX ? availableSpace : clamp(availableSpace, MIN_MENU_HEIGHT_PX, MAX_MENU_HEIGHT_PX);
|
|
81045
|
+
return { placement, maxMenuHeightPx };
|
|
81046
|
+
};
|
|
81047
|
+
|
|
81015
81048
|
const ActionsDropdown = ({ data, children }) => {
|
|
81016
81049
|
const { buttonText = "Actions", buttonVariant = "default", containerStyle, actions, permissions } = data;
|
|
81017
81050
|
const { data: multiQueryData, isLoading: isMultiQueryLoading, isError: isMultiQueryError, errors } = useMultiQuery();
|
|
@@ -81032,6 +81065,9 @@ const ActionsDropdown = ({ data, children }) => {
|
|
|
81032
81065
|
replaceValues,
|
|
81033
81066
|
multiQueryData: safeMultiQueryData
|
|
81034
81067
|
});
|
|
81068
|
+
const triggerRef = useRef(null);
|
|
81069
|
+
const [dropdownPlacement, setDropdownPlacement] = useState("bottomLeft");
|
|
81070
|
+
const [menuMaxHeightPx, setMenuMaxHeightPx] = useState(DEFAULT_MENU_MAX_HEIGHT_PX);
|
|
81035
81071
|
const {
|
|
81036
81072
|
notificationContextHolder,
|
|
81037
81073
|
activeAction,
|
|
@@ -81078,20 +81114,26 @@ const ActionsDropdown = ({ data, children }) => {
|
|
|
81078
81114
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { title: errorMessage || "Failed to load data", children: /* @__PURE__ */ jsxRuntimeExports.jsx(WarningOutlined, { style: { color: "red" } }) });
|
|
81079
81115
|
}
|
|
81080
81116
|
const menuItems = getMenuItems(visibleActions, handleActionClick, effectivePermissions);
|
|
81117
|
+
const handleDropdownOpenChange = (nextOpen) => {
|
|
81118
|
+
if (!nextOpen) {
|
|
81119
|
+
return;
|
|
81120
|
+
}
|
|
81121
|
+
const triggerRect = triggerRef.current?.getBoundingClientRect();
|
|
81122
|
+
if (!triggerRect) {
|
|
81123
|
+
return;
|
|
81124
|
+
}
|
|
81125
|
+
const { placement, maxMenuHeightPx } = getDropdownPlacement({
|
|
81126
|
+
triggerTop: triggerRect.top,
|
|
81127
|
+
triggerBottom: triggerRect.bottom,
|
|
81128
|
+
viewportHeight: window.innerHeight,
|
|
81129
|
+
actionsCount: menuItems.length
|
|
81130
|
+
});
|
|
81131
|
+
setDropdownPlacement(placement);
|
|
81132
|
+
setMenuMaxHeightPx(maxMenuHeightPx);
|
|
81133
|
+
};
|
|
81081
81134
|
const renderButton = () => {
|
|
81082
81135
|
if (buttonVariant === "icon") {
|
|
81083
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
81084
|
-
Styled$m.IconButton,
|
|
81085
|
-
{
|
|
81086
|
-
type: "text",
|
|
81087
|
-
size: "small",
|
|
81088
|
-
onClick: (e) => {
|
|
81089
|
-
e.stopPropagation();
|
|
81090
|
-
e.preventDefault();
|
|
81091
|
-
},
|
|
81092
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(MoreOutlined, {})
|
|
81093
|
-
}
|
|
81094
|
-
);
|
|
81136
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$m.IconButton, { type: "text", size: "small", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(MoreOutlined, {}) });
|
|
81095
81137
|
}
|
|
81096
81138
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { children: [
|
|
81097
81139
|
buttonText,
|
|
@@ -81100,7 +81142,36 @@ const ActionsDropdown = ({ data, children }) => {
|
|
|
81100
81142
|
};
|
|
81101
81143
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
81102
81144
|
notificationContextHolder,
|
|
81103
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
81145
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
81146
|
+
ConfigProvider,
|
|
81147
|
+
{
|
|
81148
|
+
theme: { components: { Dropdown: { zIndexPopup: 2e3 } } },
|
|
81149
|
+
getPopupContainer: (trigger) => trigger?.ownerDocument?.body ?? document.body,
|
|
81150
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
81151
|
+
Dropdown,
|
|
81152
|
+
{
|
|
81153
|
+
menu: {
|
|
81154
|
+
items: menuItems,
|
|
81155
|
+
style: { maxHeight: menuMaxHeightPx, overflowY: "auto" }
|
|
81156
|
+
},
|
|
81157
|
+
trigger: ["click"],
|
|
81158
|
+
placement: dropdownPlacement,
|
|
81159
|
+
autoAdjustOverflow: true,
|
|
81160
|
+
onOpenChange: handleDropdownOpenChange,
|
|
81161
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
81162
|
+
"span",
|
|
81163
|
+
{
|
|
81164
|
+
ref: triggerRef,
|
|
81165
|
+
onClick: (e) => {
|
|
81166
|
+
e.stopPropagation();
|
|
81167
|
+
},
|
|
81168
|
+
children: renderButton()
|
|
81169
|
+
}
|
|
81170
|
+
)
|
|
81171
|
+
}
|
|
81172
|
+
)
|
|
81173
|
+
}
|
|
81174
|
+
),
|
|
81104
81175
|
activeAction && renderActionModal(activeAction, { open: modalOpen, onClose: handleCloseModal }),
|
|
81105
81176
|
deleteModalData && /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteModal, { name: deleteModalData.name, endpoint: deleteModalData.endpoint, onClose: handleDeleteModalClose }),
|
|
81106
81177
|
evictModalData && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -90805,4 +90876,4 @@ const usePluginManifest = ({
|
|
|
90805
90876
|
};
|
|
90806
90877
|
|
|
90807
90878
|
export { useInfiniteSentinel as $, getBuiltinResourceTypes as A, getCrdData as B, getDirectUnknownResource as C, DeleteIcon as D, EnrichedTableProvider as E, checkPermission as F, getSwagger as G, filterIfApiInstanceNamespaceScoped as H, filterIfBuiltInInstanceNamespaceScoped as I, checkIfApiInstanceNamespaceScoped as J, checkIfBuiltInInstanceNamespaceScoped as K, getKinds as L, useClusterList as M, useApiResources as N, useApiResourceSingle as O, PaddingContainer as P, useBuiltinResources as Q, ReadOnlyModal as R, useBuiltinResourceSingle as S, useCrdResources as T, useCrdResourceSingle as U, useApisResourceTypes as V, useApiResourceTypesByGroup as W, useBuiltinResourceTypes as X, useCrdData as Y, useListWatch as Z, _$1 as _, useTheme as a, parseQuotaValueCpu as a$, useK8sVerbs as a0, useManyK8sSmartResource as a1, useSmartResourceParams as a2, useResourceScope as a3, useKinds as a4, usePluginManifest as a5, Spacer$1 as a6, TreeWithSearch as a7, ConfirmModal as a8, UpIcon as a9, EnrichedTable as aA, ClusterListTable as aB, getEnrichedColumns as aC, getEnrichedColumnsWithControls as aD, YamlEditorSingleton$1 as aE, BlackholeFormProvider as aF, BlackholeForm as aG, getObjectFormItemsDraft as aH, MarketPlace as aI, MarketplaceCard as aJ, ProjectInfoCard as aK, PodTerminal as aL, NodeTerminal as aM, PodLogs as aN, PodLogsMonaco as aO, VMVNC as aP, Search as aQ, Events as aR, DynamicRenderer as aS, DynamicComponents as aT, DynamicRendererWithProviders as aU, prepareTemplate as aV, isFlatObject as aW, filterSelectOptions as aX, getStringByName as aY, floorToDecimal as aZ, parseQuotaValue as a_, DownIcon as aa, BackToDefaultIcon as ab, SuccessIcon as ac, feedbackIcons as ad, PlusIcon as ae, MinusIcon as af, LockedIcon as ag, UnlockedIcon as ah, PauseCircleIcon as ai, ResumeCircleIcon as aj, LookingGlassIcon as ak, EarthIcon as al, ContentCard$1 as am, FlexGrow as an, UncontrolledSelect as ao, CustomSelect$4 as ap, CursorPointerTag as aq, CursorPointerTagMinContent as ar, CursorDefaultDiv as as, ResourceLink as at, ManageableBreadcrumbsProvider as au, prepareDataForManageableBreadcrumbs as av, ManageableBreadcrumbs as aw, ManageableSidebarProvider as ax, prepareDataForManageableSidebar as ay, ManageableSidebar as az, usePartsOfUrl as b, parseQuotaValueMemoryAndStorage as b0, normalizeValuesForQuotasToNumber as b1, getAllPathsFromObj as b2, getPrefixSubarrays as b3, groupsToTreeData as b4, getBuiltinTreeData as b5, getGroupsByCategory as b6, createContextFactory as b7, prepareUrlsToFetchForDynamicRenderer as b8, deepMerge as b9, getSortedKinds as ba, getSortedKindsAll as bb, hslFromString as bc, getUppercase as bd, kindByGvr as be, pluralByKind as bf, namespacedByGvr as bg, getLinkToBuiltinForm as bh, getLinkToApiForm as bi, isMultilineString as bj, isMultilineFromYaml as bk, includesArray as bl, getResourceLink as bm, getNamespaceLink as bn, convertBytes as bo, formatBytesAuto as bp, toBytes as bq, convertStorage as br, parseValueWithUnit as bs, convertCores as bt, formatCoresAuto as bu, toCores as bv, convertCompute as bw, parseCoresWithUnit as bx, formatDateAuto as by, isValidRFC3339 as bz, usePermissions as c, useDirectUnknownResource as d, useK8sSmartResource as e, jsxRuntimeExports as f, EditIcon as g, getLinkToForm as h, DeleteModal as i, jp as j, DeleteModalMany as k, getClusterList as l, createNewEntry as m, updateEntry as n, deleteEntry as o, parseAll as p, getApiResources as q, getApiResourceSingle as r, serializeLabelsWithNoEncoding$1 as s, getBuiltinResources as t, useMultiQuery as u, getBuiltinResourceSingle as v, getCrdResources as w, getCrdResourceSingle as x, getApiResourceTypes as y, getApiResourceTypesByApiGroup as z };
|
|
90808
|
-
//# sourceMappingURL=index-
|
|
90879
|
+
//# sourceMappingURL=index-B50_esSW.mjs.map
|