@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.54 → 0.0.1-alpha.55
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 +82 -10
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +82 -10
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/types.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/EnrichedTableProvider.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/EnrichedTable.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +6 -1
- package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.d.ts +1 -0
- package/dist/types/components/organisms/DynamicRendererWithProviders/themeContext.d.ts +8 -0
- package/package.json +1 -1
|
@@ -26341,7 +26341,7 @@ const getEnrichedColumnsWithControls = ({
|
|
|
26341
26341
|
);
|
|
26342
26342
|
},
|
|
26343
26343
|
icon: editIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(EditOutlined, { size: 14 }),
|
|
26344
|
-
disabled:
|
|
26344
|
+
disabled: value.permissions && value.permissions.canUpdate ? value.permissions?.canUpdate : false
|
|
26345
26345
|
}
|
|
26346
26346
|
),
|
|
26347
26347
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -26357,7 +26357,7 @@ const getEnrichedColumnsWithControls = ({
|
|
|
26357
26357
|
);
|
|
26358
26358
|
},
|
|
26359
26359
|
icon: deleteIcon || /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteOutlined, { size: 14 }),
|
|
26360
|
-
disabled:
|
|
26360
|
+
disabled: value.permissions && value.permissions.canDelete ? value.permissions?.canDelete : false
|
|
26361
26361
|
}
|
|
26362
26362
|
)
|
|
26363
26363
|
] });
|
|
@@ -26366,7 +26366,7 @@ const getEnrichedColumnsWithControls = ({
|
|
|
26366
26366
|
];
|
|
26367
26367
|
};
|
|
26368
26368
|
|
|
26369
|
-
const EnrichedTable = ({
|
|
26369
|
+
const EnrichedTable$1 = ({
|
|
26370
26370
|
theme,
|
|
26371
26371
|
baseprefix,
|
|
26372
26372
|
dataSource,
|
|
@@ -33383,7 +33383,8 @@ const EnrichedTableProvider = ({
|
|
|
33383
33383
|
tableMappingsReplaceValues,
|
|
33384
33384
|
forceDefaultAdditionalPrinterColumns,
|
|
33385
33385
|
selectData,
|
|
33386
|
-
tableProps
|
|
33386
|
+
tableProps,
|
|
33387
|
+
withoutControls
|
|
33387
33388
|
}) => {
|
|
33388
33389
|
const [preparedProps, setPreparedProps] = useState();
|
|
33389
33390
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -33420,7 +33421,7 @@ const EnrichedTableProvider = ({
|
|
|
33420
33421
|
additionalPrinterColumns: preparedProps.additionalPrinterColumns
|
|
33421
33422
|
});
|
|
33422
33423
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
33423
|
-
EnrichedTable,
|
|
33424
|
+
EnrichedTable$1,
|
|
33424
33425
|
{
|
|
33425
33426
|
theme,
|
|
33426
33427
|
baseprefix,
|
|
@@ -33432,7 +33433,8 @@ const EnrichedTableProvider = ({
|
|
|
33432
33433
|
additionalPrinterColumnsTrimLengths: preparedProps.additionalPrinterColumnsTrimLengths,
|
|
33433
33434
|
additionalPrinterColumnsColWidths: preparedProps.additionalPrinterColumnsColWidths,
|
|
33434
33435
|
selectData,
|
|
33435
|
-
tableProps
|
|
33436
|
+
tableProps,
|
|
33437
|
+
withoutControls
|
|
33436
33438
|
}
|
|
33437
33439
|
);
|
|
33438
33440
|
};
|
|
@@ -45242,6 +45244,75 @@ const SidebarProvider = ({
|
|
|
45242
45244
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableSidebarWithDataProvider, { replaceValues, ...props });
|
|
45243
45245
|
};
|
|
45244
45246
|
|
|
45247
|
+
const ThemeContext = createContext("dark");
|
|
45248
|
+
const ThemeProvider = ({ theme, children }) => /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext.Provider, { value: theme, children });
|
|
45249
|
+
const useTheme = () => {
|
|
45250
|
+
return useContext(ThemeContext);
|
|
45251
|
+
};
|
|
45252
|
+
|
|
45253
|
+
const EnrichedTable = ({
|
|
45254
|
+
data,
|
|
45255
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
45256
|
+
children
|
|
45257
|
+
}) => {
|
|
45258
|
+
const { id, fetchUrl, clusterNamePartOfUrl, ...props } = data;
|
|
45259
|
+
const theme = useTheme();
|
|
45260
|
+
const partsOfUrl = usePartsOfUrl();
|
|
45261
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
45262
|
+
acc[index.toString()] = value;
|
|
45263
|
+
return acc;
|
|
45264
|
+
}, {});
|
|
45265
|
+
const clusterName = prepareTemplate({
|
|
45266
|
+
template: clusterNamePartOfUrl,
|
|
45267
|
+
replaceValues
|
|
45268
|
+
});
|
|
45269
|
+
const fetchUrlPrepared = prepareTemplate({
|
|
45270
|
+
template: fetchUrl,
|
|
45271
|
+
replaceValues
|
|
45272
|
+
});
|
|
45273
|
+
const {
|
|
45274
|
+
data: fetchedData,
|
|
45275
|
+
isLoading: isFetchedDataLoading,
|
|
45276
|
+
error: fetchedDataError
|
|
45277
|
+
} = useDirectUnknownResource({
|
|
45278
|
+
uri: fetchUrlPrepared,
|
|
45279
|
+
queryKey: [fetchUrlPrepared]
|
|
45280
|
+
});
|
|
45281
|
+
if (!fetchedData) {
|
|
45282
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "No data has been fetched" });
|
|
45283
|
+
}
|
|
45284
|
+
if (isFetchedDataLoading) {
|
|
45285
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
45286
|
+
}
|
|
45287
|
+
if (fetchedDataError) {
|
|
45288
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
45289
|
+
"Error: ",
|
|
45290
|
+
JSON.stringify(fetchedDataError)
|
|
45291
|
+
] });
|
|
45292
|
+
}
|
|
45293
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
45294
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
45295
|
+
EnrichedTableProvider,
|
|
45296
|
+
{
|
|
45297
|
+
tableMappingsReplaceValues: replaceValues,
|
|
45298
|
+
cluster: clusterName,
|
|
45299
|
+
theme,
|
|
45300
|
+
dataItems: fetchedData.items,
|
|
45301
|
+
tableProps: {
|
|
45302
|
+
borderless: true,
|
|
45303
|
+
paginationPosition: ["bottomRight"],
|
|
45304
|
+
isTotalLeft: true,
|
|
45305
|
+
editIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditIcon, {}),
|
|
45306
|
+
deleteIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteIcon, {}),
|
|
45307
|
+
disablePagination: true
|
|
45308
|
+
},
|
|
45309
|
+
...props
|
|
45310
|
+
}
|
|
45311
|
+
),
|
|
45312
|
+
children
|
|
45313
|
+
] });
|
|
45314
|
+
};
|
|
45315
|
+
|
|
45245
45316
|
const DynamicComponents = {
|
|
45246
45317
|
DefaultDiv,
|
|
45247
45318
|
antdText: AntdText,
|
|
@@ -45259,7 +45330,8 @@ const DynamicComponents = {
|
|
|
45259
45330
|
ContentCard,
|
|
45260
45331
|
Spacer,
|
|
45261
45332
|
StatusText,
|
|
45262
|
-
SidebarProvider
|
|
45333
|
+
SidebarProvider,
|
|
45334
|
+
EnrichedTable
|
|
45263
45335
|
};
|
|
45264
45336
|
|
|
45265
45337
|
const prepareUrlsToFetchForDynamicRenderer = ({
|
|
@@ -45280,12 +45352,12 @@ const prepareUrlsToFetchForDynamicRenderer = ({
|
|
|
45280
45352
|
|
|
45281
45353
|
const DynamicRendererWithProviders = (props) => {
|
|
45282
45354
|
const location = useLocation();
|
|
45283
|
-
const { urlsToFetch } = props;
|
|
45355
|
+
const { urlsToFetch, theme } = props;
|
|
45284
45356
|
const preparedUrlsToFetch = prepareUrlsToFetchForDynamicRenderer({
|
|
45285
45357
|
urls: urlsToFetch,
|
|
45286
45358
|
locationPathname: location.pathname
|
|
45287
45359
|
});
|
|
45288
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryProvider, { urls: preparedUrlsToFetch, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props }) }) });
|
|
45360
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryProvider, { urls: preparedUrlsToFetch, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props }) }) }) });
|
|
45289
45361
|
};
|
|
45290
45362
|
|
|
45291
45363
|
const isLeafNode = (value) => {
|
|
@@ -45761,5 +45833,5 @@ const useCrdData = ({
|
|
|
45761
45833
|
});
|
|
45762
45834
|
};
|
|
45763
45835
|
|
|
45764
|
-
export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable, EnrichedTableProvider, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard$1 as MarketplaceCard, MinusIcon, PlusIcon, ProjectInfoCard$1 as ProjectInfoCard, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UnlockedIcon, UpIcon, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getObjectFormItemsDraft, getPrefixSubarrays, getStringByName, getSwagger, groupsToTreeData, isFlatObject, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, usePermissions };
|
|
45836
|
+
export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable$1 as EnrichedTable, EnrichedTableProvider, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard$1 as MarketplaceCard, MinusIcon, PlusIcon, ProjectInfoCard$1 as ProjectInfoCard, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UnlockedIcon, UpIcon, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getObjectFormItemsDraft, getPrefixSubarrays, getStringByName, getSwagger, groupsToTreeData, isFlatObject, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, usePermissions };
|
|
45765
45837
|
//# sourceMappingURL=openapi-k8s-toolkit.es.js.map
|