@prorobotech/openapi-k8s-toolkit 1.5.0-alpha.8 → 1.5.0-alpha.9

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.
@@ -44763,6 +44763,12 @@ const getStringByName = (name) => {
44763
44763
  return String(name);
44764
44764
  };
44765
44765
 
44766
+ const hasActionableDefaultValue = (defaultValue) => {
44767
+ if (defaultValue === void 0) return false;
44768
+ if (defaultValue === "") return false;
44769
+ if (Array.isArray(defaultValue) && defaultValue.length === 0) return false;
44770
+ return true;
44771
+ };
44766
44772
  const formatDefaultValue = (defaultValue) => {
44767
44773
  if (Array.isArray(defaultValue)) {
44768
44774
  return defaultValue.join(", ");
@@ -44770,7 +44776,7 @@ const formatDefaultValue = (defaultValue) => {
44770
44776
  return String(defaultValue);
44771
44777
  };
44772
44778
  const buildPlaceholder = (name, defaultValue, example) => {
44773
- if (defaultValue !== void 0) {
44779
+ if (hasActionableDefaultValue(defaultValue)) {
44774
44780
  return `Default: ${formatDefaultValue(defaultValue)}`;
44775
44781
  }
44776
44782
  if (example !== void 0) {
@@ -44780,7 +44786,7 @@ const buildPlaceholder = (name, defaultValue, example) => {
44780
44786
  };
44781
44787
  const getExampleTooltip = (defaultValue, example) => {
44782
44788
  if (example === void 0) return void 0;
44783
- if (defaultValue === void 0) return void 0;
44789
+ if (!hasActionableDefaultValue(defaultValue)) return void 0;
44784
44790
  return `Example: ${formatDefaultValue(example)}`;
44785
44791
  };
44786
44792
 
@@ -79094,7 +79100,7 @@ const TolerationsModal = ({
79094
79100
  };
79095
79101
 
79096
79102
  const LazyEnrichedTableModal = lazy(
79097
- () => import('./index-Cd_VfUiH.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
79103
+ () => import('./index-DlaVRXge.mjs').then((mod) => ({ default: mod.EnrichedTableModal }))
79098
79104
  );
79099
79105
  const renderActiveType = (activeType, extraProps) => {
79100
79106
  if (!activeType) return null;
@@ -84286,15 +84292,18 @@ const normalizeNameToPath = (name) => Array.isArray(name) ? name : [name];
84286
84292
 
84287
84293
  const useDefaultValueButton = (formFieldName, defaultValue, nullable) => {
84288
84294
  const form = Form.useFormInstance();
84295
+ const onValuesChangeCallback = useOnValuesChangeCallback();
84289
84296
  const currentValue = Form.useWatch(formFieldName, form);
84290
84297
  const handleApply = useCallback(() => {
84291
84298
  form.setFieldValue(formFieldName, defaultValue);
84292
- }, [defaultValue, form, formFieldName]);
84299
+ onValuesChangeCallback?.();
84300
+ }, [defaultValue, form, formFieldName, onValuesChangeCallback]);
84293
84301
  const handleClear = useCallback(() => {
84294
84302
  form.setFieldValue(formFieldName, void 0);
84295
- }, [form, formFieldName]);
84303
+ onValuesChangeCallback?.();
84304
+ }, [form, formFieldName, onValuesChangeCallback]);
84296
84305
  return useMemo(() => {
84297
- if (defaultValue === void 0) {
84306
+ if (!hasActionableDefaultValue(defaultValue)) {
84298
84307
  return { visible: false };
84299
84308
  }
84300
84309
  if (nullable && currentValue === null) {
@@ -86014,7 +86023,7 @@ const FormListInput = ({
86014
86023
  const fieldValue = Form.useWatch(name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name, form);
86015
86024
  const fixedName = name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name;
86016
86025
  const formFieldName = arrName || fixedName;
86017
- const defaultBtn = useDefaultValueButton(formFieldName, defaultValue);
86026
+ const defaultBtn = useDefaultValueButton(fixedName, defaultValue);
86018
86027
  const arrayItemsRule = getArrayItemsRule({ minItems, maxItems, name });
86019
86028
  const fullFieldPath = normalizeNameToPath(fixedName);
86020
86029
  const baseForRelative = listItemBasePath(fullFieldPath);
@@ -86040,32 +86049,23 @@ const FormListInput = ({
86040
86049
  if (relatedPath && isTouchedPeristed[relatedPath.join(".")] && relatedFieldValue && !hasSeededRef.current) {
86041
86050
  relatedFieldValuePrev.current = relatedFieldValue;
86042
86051
  hasSeededRef.current = true;
86043
- form.setFieldValue(arrName || fixedName, void 0);
86052
+ form.setFieldValue(fixedName, void 0);
86044
86053
  onValuesChangeCallBack?.();
86045
86054
  }
86046
- }, [
86047
- relatedPath,
86048
- relatedTouched,
86049
- isTouchedPeristed,
86050
- relatedFieldValue,
86051
- form,
86052
- arrName,
86053
- fixedName,
86054
- onValuesChangeCallBack
86055
- ]);
86055
+ }, [relatedPath, relatedTouched, isTouchedPeristed, relatedFieldValue, form, fixedName, onValuesChangeCallBack]);
86056
86056
  useEffect(() => {
86057
86057
  if (!relatedPath || relatedFieldValuePrev.current === "unset") {
86058
86058
  return;
86059
86059
  }
86060
86060
  if ((!relatedFieldValue || relatedFieldValuePrev.current !== "unset" && relatedFieldValuePrev.current !== relatedFieldValue) && !hasFiredRef.current) {
86061
- form.setFieldValue(arrName || fixedName, void 0);
86061
+ form.setFieldValue(fixedName, void 0);
86062
86062
  onValuesChangeCallBack?.();
86063
86063
  hasFiredRef.current = true;
86064
86064
  relatedFieldValuePrev.current = relatedFieldValue;
86065
86065
  } else if (relatedFieldValue && hasFiredRef.current) {
86066
86066
  hasFiredRef.current = false;
86067
86067
  }
86068
- }, [relatedPath, form, arrName, fixedName, relatedFieldValue, onValuesChangeCallBack, isTouchedPeristed]);
86068
+ }, [relatedPath, form, fixedName, relatedFieldValue, onValuesChangeCallBack, isTouchedPeristed]);
86069
86069
  const uri = prepareTemplate({
86070
86070
  template: customProps.valueUri,
86071
86071
  replaceValues: { cluster, namespace, syntheticProject, relatedFieldValue, name: entryName }
@@ -86162,7 +86162,7 @@ const FormListInput = ({
86162
86162
  Select,
86163
86163
  {
86164
86164
  mode: customProps.mode,
86165
- placeholder: defaultValue !== void 0 ? `Default: ${formatDefaultValue(defaultValue)}` : "Select",
86165
+ placeholder: hasActionableDefaultValue(defaultValue) ? `Default: ${formatDefaultValue(defaultValue)}` : "Select",
86166
86166
  options: uniqueOptions,
86167
86167
  filterOption: filterSelectOptions,
86168
86168
  disabled: isWaitingForRelatedValue,
@@ -86604,7 +86604,7 @@ const FormNamespaceInput = ({
86604
86604
  if (!namespaceData) {
86605
86605
  return null;
86606
86606
  }
86607
- const placeholder = defaultValue !== void 0 ? `Default: ${defaultValue}` : "Select namespace";
86607
+ const placeholder = hasActionableDefaultValue(defaultValue) ? `Default: ${defaultValue}` : "Select namespace";
86608
86608
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(HiddenContainer$1, { name, children: [
86609
86609
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "space-between", children: [
86610
86610
  /* @__PURE__ */ jsxRuntimeExports.jsxs(CustomSizeTitle, { $designNewLayout: designNewLayout, children: [
@@ -86692,8 +86692,8 @@ const FormStringInput = ({
86692
86692
  const designNewLayout = useDesignNewLayout();
86693
86693
  const fixedName = name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name;
86694
86694
  const formFieldName = arrName || fixedName;
86695
- const defaultBtn = useDefaultValueButton(formFieldName, defaultValue, nullable);
86696
- const nullBtn = useNullToggleButton(formFieldName, nullable);
86695
+ const defaultBtn = useDefaultValueButton(fixedName, defaultValue, nullable);
86696
+ const nullBtn = useNullToggleButton(fixedName, nullable);
86697
86697
  const exampleTooltip = getExampleTooltip(defaultValue, example);
86698
86698
  const formatRule = getStringFormatRule(format, name);
86699
86699
  const patternRule = getPatternRule(pattern, name);
@@ -86799,10 +86799,10 @@ const FormStringMultilineInput = ({
86799
86799
  const exampleTooltip = getExampleTooltip(defaultValue, example);
86800
86800
  const fixedName = name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name;
86801
86801
  const formFieldName = arrName || fixedName;
86802
- const formValue = Form.useWatch(formFieldName);
86802
+ const formValue = Form.useWatch(fixedName);
86803
86803
  const form = Form.useFormInstance();
86804
- const defaultBtn = useDefaultValueButton(formFieldName, defaultValue, nullable);
86805
- const nullBtn = useNullToggleButton(formFieldName, nullable);
86804
+ const defaultBtn = useDefaultValueButton(fixedName, defaultValue, nullable);
86805
+ const nullBtn = useNullToggleButton(fixedName, nullable);
86806
86806
  const formatRule = !isBase64 ? getStringFormatRule(format, name) : void 0;
86807
86807
  const patternRule = !isBase64 ? getPatternRule(pattern, name) : void 0;
86808
86808
  const lengthRule = !isBase64 ? getStringLengthRule({ minLength, maxLength, name }) : void 0;
@@ -86842,7 +86842,7 @@ const FormStringMultilineInput = ({
86842
86842
  /* @__PURE__ */ jsxRuntimeExports.jsx(
86843
86843
  ResetedFormItem$1,
86844
86844
  {
86845
- name: arrName || fixedName,
86845
+ name: formFieldName,
86846
86846
  rules: [
86847
86847
  getRequiredRule(forceNonRequired === false && !!required?.includes(getStringByName(name)), name, nullable),
86848
86848
  ...formatRule ? [formatRule] : [],
@@ -86873,7 +86873,7 @@ const FormStringMultilineInput = ({
86873
86873
  value: decoded,
86874
86874
  onChange: (e) => {
86875
86875
  try {
86876
- form.setFieldValue(formFieldName, toBase64(e.target.value));
86876
+ form.setFieldValue(fixedName, toBase64(e.target.value));
86877
86877
  setDecoded(e.target.value);
86878
86878
  } catch {
86879
86879
  }
@@ -86911,7 +86911,7 @@ const FormBooleanInput = ({
86911
86911
  }) => {
86912
86912
  const designNewLayout = useDesignNewLayout();
86913
86913
  const formFieldName = arrName || name;
86914
- const defaultBtn = useDefaultValueButton(formFieldName, defaultValue);
86914
+ const defaultBtn = useDefaultValueButton(name, defaultValue);
86915
86915
  const title = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: getStringByName(name) });
86916
86916
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(HiddenContainer$1, { name, children: [
86917
86917
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "space-between", children: [
@@ -86974,8 +86974,8 @@ const FormEnumStringInput = ({
86974
86974
  const designNewLayout = useDesignNewLayout();
86975
86975
  const fixedName = name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name;
86976
86976
  const formFieldName = arrName || fixedName;
86977
- const defaultBtn = useDefaultValueButton(formFieldName, defaultValue, nullable);
86978
- const nullBtn = useNullToggleButton(formFieldName, nullable);
86977
+ const defaultBtn = useDefaultValueButton(fixedName, defaultValue, nullable);
86978
+ const nullBtn = useNullToggleButton(fixedName, nullable);
86979
86979
  const exampleTooltip = getExampleTooltip(defaultValue, example);
86980
86980
  const title = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
86981
86981
  getStringByName(name),
@@ -87046,8 +87046,8 @@ const FormNumberInput = ({
87046
87046
  }) => {
87047
87047
  const designNewLayout = useDesignNewLayout();
87048
87048
  const formFieldName = arrName || name;
87049
- const defaultBtn = useDefaultValueButton(formFieldName, defaultValue, nullable);
87050
- const nullBtn = useNullToggleButton(formFieldName, nullable);
87049
+ const defaultBtn = useDefaultValueButton(name, defaultValue, nullable);
87050
+ const nullBtn = useNullToggleButton(name, nullable);
87051
87051
  const exampleTooltip = getExampleTooltip(defaultValue, example);
87052
87052
  const formatRule = getNumberFormatRule(format, name);
87053
87053
  const rangeRule = getNumberRangeRule({ minimum, maximum, name });
@@ -94814,4 +94814,4 @@ const usePluginManifest = ({
94814
94814
  };
94815
94815
 
94816
94816
  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 };
94817
- //# sourceMappingURL=index-cNF5QCwf.mjs.map
94817
+ //# sourceMappingURL=index-BTH8ednM.mjs.map