@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.94 → 0.0.1-alpha.95

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.
@@ -2504,7 +2504,7 @@ const CustomTreeProvider = st.div`
2504
2504
  justify-content: center;
2505
2505
  }
2506
2506
  `;
2507
- const Styled$p = {
2507
+ const Styled$q = {
2508
2508
  CustomTreeProvider
2509
2509
  };
2510
2510
 
@@ -2569,7 +2569,7 @@ const TreeWithSearch = ({ treeData, onSelect }) => {
2569
2569
  });
2570
2570
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
2571
2571
  /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { style: { marginBottom: 8 }, placeholder: "Search", onChange }),
2572
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$p.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2572
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$q.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2573
2573
  Tree,
2574
2574
  {
2575
2575
  treeData: loop(treeData),
@@ -8424,14 +8424,14 @@ const ContentContainer = st.div`
8424
8424
  display: ${({ $displayFlex }) => $displayFlex ? "flex" : "block"};
8425
8425
  flex-flow: ${({ $flexFlow }) => $flexFlow};
8426
8426
  `;
8427
- const Styled$o = {
8427
+ const Styled$p = {
8428
8428
  ContentContainer
8429
8429
  };
8430
8430
 
8431
8431
  const ContentCard$1 = ({ children, flexGrow, displayFlex, flexFlow, maxHeight }) => {
8432
8432
  const { token } = theme.useToken();
8433
8433
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8434
- Styled$o.ContentContainer,
8434
+ Styled$p.ContentContainer,
8435
8435
  {
8436
8436
  $flexGrow: flexGrow,
8437
8437
  $bgColor: token.colorBgContainer,
@@ -8492,13 +8492,63 @@ const UncontrolledSelect$1 = st(Select)`
8492
8492
  padding-inline: 8px;
8493
8493
  }
8494
8494
  `;
8495
- const Styled$n = {
8495
+ const Styled$o = {
8496
8496
  UncontrolledSelect: UncontrolledSelect$1
8497
8497
  };
8498
8498
 
8499
8499
  const UncontrolledSelect = (props) => {
8500
8500
  const { isCursorPointer } = props;
8501
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$n.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
8501
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
8502
+ };
8503
+
8504
+ const CustomSelect$5 = st(Select)`
8505
+ width: 100%;
8506
+ margin: 0;
8507
+ padding: 4px;
8508
+
8509
+ && .ant-select-selector {
8510
+ background: none;
8511
+ }
8512
+
8513
+ && .ant-select-selector,
8514
+ && .ant-select-focused .ant-select-selector,
8515
+ && .ant-select-selector:focus,
8516
+ && .ant-select-selector:active,
8517
+ && .ant-select-open .ant-select-selector {
8518
+ align-items: flex-start;
8519
+ outline: none !important;
8520
+ outline-color: transparent !important;
8521
+ box-shadow: none !important;
8522
+ padding-inline: 4px !important;
8523
+ padding-block: 4px !important;
8524
+ }
8525
+
8526
+ && .ant-select-selection-overflow {
8527
+ gap: 4px;
8528
+ }
8529
+
8530
+ && .ant-select-selection-overflow-item-rest .ant-select-selection-item {
8531
+ background: 0;
8532
+ }
8533
+
8534
+ && .ant-tag {
8535
+ font-size: 14px;
8536
+ line-height: 22px;
8537
+ border: 0;
8538
+ padding-inline: 8px;
8539
+ }
8540
+
8541
+ && .ant-select-multiple .ant-select-selection-overflow-item-suffix {
8542
+ min-height: 22px !important;
8543
+ margin-block: 0 !important;
8544
+ }
8545
+ `;
8546
+ const Styled$n = {
8547
+ CustomSelect: CustomSelect$5
8548
+ };
8549
+
8550
+ const CustomSelect$4 = (props) => {
8551
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$n.CustomSelect, { ...props });
8502
8552
  };
8503
8553
 
8504
8554
  const CursorPointerTag = st(Tag)`
@@ -46858,7 +46908,7 @@ const getItemsInside = (value) => {
46858
46908
  return { error: "Value on jsonPath is not an array" };
46859
46909
  }
46860
46910
  if (typeof value[0] !== "object" || value[0] === null) {
46861
- return { error: "Value[0] is not an object" };
46911
+ return { counter: 0 };
46862
46912
  }
46863
46913
  return { counter: Object.keys(value[0]).length };
46864
46914
  };
@@ -46910,6 +46960,23 @@ const KeyCounter = ({
46910
46960
  ] });
46911
46961
  };
46912
46962
 
46963
+ const isRecordStringNumber$1 = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.entries(value).every(([k, v]) => typeof k === "string" && (typeof v === "string" || typeof v === "number"));
46964
+ const parseArrayOfAny$1 = (value) => {
46965
+ if (!Array.isArray(value)) {
46966
+ return { error: "Value on jsonPath is not an array" };
46967
+ }
46968
+ if (isRecordStringNumber$1(value[0])) {
46969
+ return { data: value[0] };
46970
+ }
46971
+ return { error: "Value on jsonPath is not a record array" };
46972
+ };
46973
+ const truncate = (text, max) => {
46974
+ if (!max) {
46975
+ return text;
46976
+ }
46977
+ return text.length > max ? text.slice(0, max) + "..." : text;
46978
+ };
46979
+
46913
46980
  const EditModal = ({
46914
46981
  open,
46915
46982
  close,
@@ -46917,7 +46984,9 @@ const EditModal = ({
46917
46984
  openNotificationSuccess,
46918
46985
  modalTitle,
46919
46986
  modalDescriptionText,
46920
- inputLabel
46987
+ inputLabel,
46988
+ maxEditTagTextLength,
46989
+ allowClearEditSelect
46921
46990
  }) => {
46922
46991
  const [error, setError] = useState();
46923
46992
  const [isLoading, setIsLoading] = useState(false);
@@ -46958,13 +47027,18 @@ const EditModal = ({
46958
47027
  okText: "Save",
46959
47028
  confirmLoading: isLoading,
46960
47029
  maskClosable: false,
46961
- width: "60vw",
47030
+ width: 520,
46962
47031
  destroyOnHidden: true,
47032
+ centered: true,
46963
47033
  children: [
46964
47034
  error && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { type: "error", message: "Error while submitting", description: error?.response?.data?.message }),
46965
- modalDescriptionText,
47035
+ modalDescriptionText && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
47036
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: modalDescriptionText }),
47037
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true })
47038
+ ] }),
46966
47039
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Form, { form, children: [
46967
- inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { children: inputLabel }),
47040
+ inputLabel && /* @__PURE__ */ jsxRuntimeExports.jsx(CustomSizeTitle, { $designNewLayout: true, children: inputLabel }),
47041
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
46968
47042
  /* @__PURE__ */ jsxRuntimeExports.jsx(
46969
47043
  ResetedFormItem,
46970
47044
  {
@@ -46974,7 +47048,7 @@ const EditModal = ({
46974
47048
  rules: [
46975
47049
  () => ({
46976
47050
  validator(_, value) {
46977
- if (Array.isArray(value) && value.every((str) => typeof str === "string" && str.includes("="))) {
47051
+ if (Array.isArray(value) && value.every((str) => typeof str === "string" && str.includes("=") && !str.startsWith("="))) {
46978
47052
  return Promise.resolve();
46979
47053
  }
46980
47054
  return Promise.reject(new Error("Please enter key=value style"));
@@ -46982,14 +47056,27 @@ const EditModal = ({
46982
47056
  })
46983
47057
  ],
46984
47058
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
46985
- Select,
47059
+ CustomSelect$4,
46986
47060
  {
46987
47061
  mode: "tags",
46988
47062
  placeholder: "Enter key=value",
46989
47063
  filterOption: filterSelectOptions,
46990
- allowClear: true,
47064
+ allowClear: allowClearEditSelect,
46991
47065
  tokenSeparators: [" "],
46992
- open: false
47066
+ open: false,
47067
+ tagRender: ({ label, closable, onClose }) => {
47068
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Popover, { content: label, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
47069
+ Tag,
47070
+ {
47071
+ closable,
47072
+ onClose,
47073
+ onClick: (e) => {
47074
+ e.stopPropagation();
47075
+ },
47076
+ children: typeof label === "string" ? truncate(label, maxEditTagTextLength) : "Not a string value"
47077
+ }
47078
+ ) });
47079
+ }
46993
47080
  }
46994
47081
  )
46995
47082
  }
@@ -47000,23 +47087,6 @@ const EditModal = ({
47000
47087
  );
47001
47088
  };
47002
47089
 
47003
- const isRecordStringNumber$1 = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.entries(value).every(([k, v]) => typeof k === "string" && (typeof v === "string" || typeof v === "number"));
47004
- const parseArrayOfAny$1 = (value) => {
47005
- if (!Array.isArray(value)) {
47006
- return { error: "Value on jsonPath is not an array" };
47007
- }
47008
- if (isRecordStringNumber$1(value[0])) {
47009
- return { data: value[0] };
47010
- }
47011
- return { error: "Value on jsonPath is not a record array" };
47012
- };
47013
- const truncate = (text, max) => {
47014
- if (!max) {
47015
- return text;
47016
- }
47017
- return text.length > max ? text.slice(0, max) + "..." : text;
47018
- };
47019
-
47020
47090
  const Labels = ({ data, children }) => {
47021
47091
  const {
47022
47092
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -47029,7 +47099,9 @@ const Labels = ({ data, children }) => {
47029
47099
  modalTitle,
47030
47100
  modalDescriptionText,
47031
47101
  inputLabel,
47032
- containerStyle
47102
+ containerStyle,
47103
+ maxEditTagTextLength,
47104
+ allowClearEditSelect
47033
47105
  } = data;
47034
47106
  const [api, contextHolder] = notification.useNotification();
47035
47107
  const [open, setOpen] = useState(false);
@@ -47115,7 +47187,9 @@ const Labels = ({ data, children }) => {
47115
47187
  openNotificationSuccess,
47116
47188
  modalTitle: modalTitlePrepared,
47117
47189
  modalDescriptionText: modalDescriptionTextPrepared,
47118
- inputLabel: inputLabelPrepared
47190
+ inputLabel: inputLabelPrepared,
47191
+ maxEditTagTextLength,
47192
+ allowClearEditSelect
47119
47193
  }
47120
47194
  )
47121
47195
  ] });
@@ -47174,7 +47248,9 @@ const Labels = ({ data, children }) => {
47174
47248
  openNotificationSuccess,
47175
47249
  modalTitle: modalTitlePrepared,
47176
47250
  modalDescriptionText: modalDescriptionTextPrepared,
47177
- inputLabel: inputLabelPrepared
47251
+ inputLabel: inputLabelPrepared,
47252
+ maxEditTagTextLength,
47253
+ allowClearEditSelect
47178
47254
  }
47179
47255
  )
47180
47256
  ] });
@@ -47768,5 +47844,5 @@ const useCrdData = ({
47768
47844
  });
47769
47845
  };
47770
47846
 
47771
- export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, CursorPointerTag, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable$1 as EnrichedTable, EnrichedTableProvider, FlexGrow, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard$1 as MarketplaceCard, MinusIcon, NodeTerminal$1 as NodeTerminal, PauseCircleIcon, PlusIcon, PodLogs$1 as PodLogs, PodLogsMonaco, PodTerminal$1 as PodTerminal, ProjectInfoCard$1 as ProjectInfoCard, ResumeCircleIcon, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UncontrolledSelect, UnlockedIcon, UpIcon, YamlEditorSingleton$1 as YamlEditorSingleton, 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 };
47847
+ export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, CursorPointerTag, CustomSelect$4 as CustomSelect, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable$1 as EnrichedTable, EnrichedTableProvider, FlexGrow, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard$1 as MarketplaceCard, MinusIcon, NodeTerminal$1 as NodeTerminal, PauseCircleIcon, PlusIcon, PodLogs$1 as PodLogs, PodLogsMonaco, PodTerminal$1 as PodTerminal, ProjectInfoCard$1 as ProjectInfoCard, ResumeCircleIcon, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UncontrolledSelect, UnlockedIcon, UpIcon, YamlEditorSingleton$1 as YamlEditorSingleton, 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 };
47772
47848
  //# sourceMappingURL=openapi-k8s-toolkit.es.js.map