@dovetail-v2/refine 0.3.15-alpha.0 → 0.3.16-alpha.0

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/refine.cjs CHANGED
@@ -10729,7 +10729,12 @@ function validateLabelValue(value2, i18n2, isOptional) {
10729
10729
  if (isOptional && value2 === "") {
10730
10730
  return { isValid: true };
10731
10731
  } else if (value2 === "") {
10732
- return { isValid: false, errorMessage: i18n2.t("dovetail.required_field", { label: i18n2.t("dovetail.value") }) };
10732
+ return {
10733
+ isValid: false,
10734
+ errorMessage: i18n2.t("dovetail.required_field", {
10735
+ label: i18n2.t("dovetail.value")
10736
+ })
10737
+ };
10733
10738
  }
10734
10739
  if (value2.length > 63) {
10735
10740
  return { isValid: false };
@@ -10766,7 +10771,7 @@ function validatePort(port2, options) {
10766
10771
  return { isValid: true };
10767
10772
  }
10768
10773
  function validateNodePort(nodePort, allNodePorts, i18n2) {
10769
- if (!nodePort) {
10774
+ if (nodePort === "") {
10770
10775
  return {
10771
10776
  isValid: false,
10772
10777
  errorMessage: i18n2.t("dovetail.required_field", {
@@ -11846,7 +11851,7 @@ function _KeyValueTableForm(props, ref) {
11846
11851
  },
11847
11852
  disableBatchFilling: true,
11848
11853
  hideEmptyTable: true
11849
- }), isHideLabelFormatPopover ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(LabelFormatPopover, {
11854
+ }), isHideLabelFormatPopover || _value.length === 0 ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(LabelFormatPopover, {
11850
11855
  noValueValidation
11851
11856
  })]
11852
11857
  });
@@ -17943,7 +17948,7 @@ const MatchLabelSelector = React.forwardRef(function MatchLabelSelector2(props,
17943
17948
  }
17944
17949
  ),
17945
17950
  onChange,
17946
- isValueOptional: false,
17951
+ isValueOptional: true,
17947
17952
  minSize: 1,
17948
17953
  disabledChagneDefaultValues
17949
17954
  }
@@ -18782,7 +18787,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18782
18787
  },
18783
18788
  {
18784
18789
  key: "name",
18785
- title: i18n2.t("dovetail.port_name"),
18790
+ title: `${i18n2.t("dovetail.name")} ${i18n2.t("dovetail.optional_with_bracket")}`,
18786
18791
  type: "input",
18787
18792
  validator: ({ value: portName, rowIndex }) => {
18788
18793
  const { errorMessage } = validateRfc1123Name({
@@ -18810,7 +18815,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18810
18815
  );
18811
18816
  },
18812
18817
  validator: ({ value: value22 }) => {
18813
- const { isValid, errorMessage } = validatePort(value22 || "", {
18818
+ const { isValid, errorMessage } = validatePort(value22 ?? "", {
18814
18819
  isOptional: false,
18815
18820
  i18n: i18n2,
18816
18821
  emptyText: i18n2.t("dovetail.required_field", {
@@ -18836,7 +18841,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18836
18841
  );
18837
18842
  },
18838
18843
  validator: ({ value: value22 }) => {
18839
- const { isValid, errorMessage } = validatePort(value22 || "", {
18844
+ const { isValid, errorMessage } = validatePort(value22 ?? "", {
18840
18845
  isOptional: false,
18841
18846
  i18n: i18n2,
18842
18847
  emptyText: i18n2.t("dovetail.required_field", {
@@ -18873,7 +18878,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18873
18878
  }
18874
18879
  ).map((row) => row.nodePort.value)
18875
18880
  ];
18876
- const { isValid, errorMessage } = value22.mode === "auto" ? { isValid: true, errorMessage: void 0 } : validateNodePort(value22.value, allNodePorts, i18n2);
18881
+ const { isValid, errorMessage } = value22.mode === "auto" ? { isValid: true, errorMessage: void 0 } : validateNodePort(value22.value ?? "", allNodePorts, i18n2);
18877
18882
  if (!isValid)
18878
18883
  return errorMessage;
18879
18884
  }
@@ -19474,13 +19479,7 @@ const DataKeysColumnRenderer = (i18n2) => {
19474
19479
  const PortMappingColumnRenderer = (i18n2) => {
19475
19480
  return {
19476
19481
  key: "displayPortMapping",
19477
- title: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Tooltip, {
19478
- title: i18n2.t("dovetail.port_mapping_title_tooltip"),
19479
- children: /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
19480
- className: DashedTitleStyle,
19481
- children: i18n2.t("dovetail.port_mapping")
19482
- })
19483
- }),
19482
+ title: i18n2.t("dovetail.port_mapping"),
19484
19483
  display: true,
19485
19484
  dataIndex: ["displayPortMapping"],
19486
19485
  width: 300,
@@ -20048,6 +20047,7 @@ exports.DataTab = DataTab;
20048
20047
  exports.DeleteButton = DeleteButton;
20049
20048
  exports.DeleteManyButton = DeleteManyButton;
20050
20049
  exports.DeploymentModel = DeploymentModel;
20050
+ exports.DnsSubdomainRegExp = DnsSubdomainRegExp;
20051
20051
  exports.Dovetail = Dovetail;
20052
20052
  exports.DrawerShow = DrawerShow;
20053
20053
  exports.DurationColumnRenderer = DurationColumnRenderer;
@@ -20209,6 +20209,8 @@ exports.ResourceTableField = ResourceTableField;
20209
20209
  exports.ResourceTableGroup = ResourceTableGroup;
20210
20210
  exports.ResourceUsageBar = ResourceUsageBar;
20211
20211
  exports.RestartsColumnRenderer = RestartsColumnRenderer;
20212
+ exports.Rfc1035NameRegExp = Rfc1035NameRegExp;
20213
+ exports.Rfc1123NameRegExp = Rfc1123NameRegExp;
20212
20214
  exports.SCAllowExpandColumnRenderer = SCAllowExpandColumnRenderer;
20213
20215
  exports.SCReclaimPolicyColumnRenderer = SCReclaimPolicyColumnRenderer;
20214
20216
  exports.SCReclaimPolicyField = SCReclaimPolicyField;
package/dist/refine.js CHANGED
@@ -10710,7 +10710,12 @@ function validateLabelValue(value2, i18n2, isOptional) {
10710
10710
  if (isOptional && value2 === "") {
10711
10711
  return { isValid: true };
10712
10712
  } else if (value2 === "") {
10713
- return { isValid: false, errorMessage: i18n2.t("dovetail.required_field", { label: i18n2.t("dovetail.value") }) };
10713
+ return {
10714
+ isValid: false,
10715
+ errorMessage: i18n2.t("dovetail.required_field", {
10716
+ label: i18n2.t("dovetail.value")
10717
+ })
10718
+ };
10714
10719
  }
10715
10720
  if (value2.length > 63) {
10716
10721
  return { isValid: false };
@@ -10747,7 +10752,7 @@ function validatePort(port2, options) {
10747
10752
  return { isValid: true };
10748
10753
  }
10749
10754
  function validateNodePort(nodePort, allNodePorts, i18n2) {
10750
- if (!nodePort) {
10755
+ if (nodePort === "") {
10751
10756
  return {
10752
10757
  isValid: false,
10753
10758
  errorMessage: i18n2.t("dovetail.required_field", {
@@ -11827,7 +11832,7 @@ function _KeyValueTableForm(props, ref) {
11827
11832
  },
11828
11833
  disableBatchFilling: true,
11829
11834
  hideEmptyTable: true
11830
- }), isHideLabelFormatPopover ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {
11835
+ }), isHideLabelFormatPopover || _value.length === 0 ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {
11831
11836
  noValueValidation
11832
11837
  })]
11833
11838
  });
@@ -17924,7 +17929,7 @@ const MatchLabelSelector = React.forwardRef(function MatchLabelSelector2(props,
17924
17929
  }
17925
17930
  ),
17926
17931
  onChange,
17927
- isValueOptional: false,
17932
+ isValueOptional: true,
17928
17933
  minSize: 1,
17929
17934
  disabledChagneDefaultValues
17930
17935
  }
@@ -18763,7 +18768,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18763
18768
  },
18764
18769
  {
18765
18770
  key: "name",
18766
- title: i18n2.t("dovetail.port_name"),
18771
+ title: `${i18n2.t("dovetail.name")} ${i18n2.t("dovetail.optional_with_bracket")}`,
18767
18772
  type: "input",
18768
18773
  validator: ({ value: portName, rowIndex }) => {
18769
18774
  const { errorMessage } = validateRfc1123Name({
@@ -18791,7 +18796,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18791
18796
  );
18792
18797
  },
18793
18798
  validator: ({ value: value22 }) => {
18794
- const { isValid, errorMessage } = validatePort(value22 || "", {
18799
+ const { isValid, errorMessage } = validatePort(value22 ?? "", {
18795
18800
  isOptional: false,
18796
18801
  i18n: i18n2,
18797
18802
  emptyText: i18n2.t("dovetail.required_field", {
@@ -18817,7 +18822,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18817
18822
  );
18818
18823
  },
18819
18824
  validator: ({ value: value22 }) => {
18820
- const { isValid, errorMessage } = validatePort(value22 || "", {
18825
+ const { isValid, errorMessage } = validatePort(value22 ?? "", {
18821
18826
  isOptional: false,
18822
18827
  i18n: i18n2,
18823
18828
  emptyText: i18n2.t("dovetail.required_field", {
@@ -18854,7 +18859,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18854
18859
  }
18855
18860
  ).map((row) => row.nodePort.value)
18856
18861
  ];
18857
- const { isValid, errorMessage } = value22.mode === "auto" ? { isValid: true, errorMessage: void 0 } : validateNodePort(value22.value, allNodePorts, i18n2);
18862
+ const { isValid, errorMessage } = value22.mode === "auto" ? { isValid: true, errorMessage: void 0 } : validateNodePort(value22.value ?? "", allNodePorts, i18n2);
18858
18863
  if (!isValid)
18859
18864
  return errorMessage;
18860
18865
  }
@@ -19455,13 +19460,7 @@ const DataKeysColumnRenderer = (i18n2) => {
19455
19460
  const PortMappingColumnRenderer = (i18n2) => {
19456
19461
  return {
19457
19462
  key: "displayPortMapping",
19458
- title: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
19459
- title: i18n2.t("dovetail.port_mapping_title_tooltip"),
19460
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
19461
- className: DashedTitleStyle,
19462
- children: i18n2.t("dovetail.port_mapping")
19463
- })
19464
- }),
19463
+ title: i18n2.t("dovetail.port_mapping"),
19465
19464
  display: true,
19466
19465
  dataIndex: ["displayPortMapping"],
19467
19466
  width: 300,
@@ -20030,6 +20029,7 @@ export {
20030
20029
  DeleteButton,
20031
20030
  DeleteManyButton,
20032
20031
  DeploymentModel,
20032
+ DnsSubdomainRegExp,
20033
20033
  Dovetail,
20034
20034
  DrawerShow,
20035
20035
  DurationColumnRenderer,
@@ -20191,6 +20191,8 @@ export {
20191
20191
  ResourceTableGroup,
20192
20192
  ResourceUsageBar,
20193
20193
  RestartsColumnRenderer,
20194
+ Rfc1035NameRegExp,
20195
+ Rfc1123NameRegExp,
20194
20196
  SCAllowExpandColumnRenderer,
20195
20197
  SCReclaimPolicyColumnRenderer,
20196
20198
  SCReclaimPolicyField,
@@ -1,4 +1,7 @@
1
1
  import { i18n as I18n } from 'i18next';
2
+ export declare const Rfc1123NameRegExp: RegExp;
3
+ export declare const Rfc1035NameRegExp: RegExp;
4
+ export declare const DnsSubdomainRegExp: RegExp;
2
5
  interface ValidateResourceNameOptions {
3
6
  v: string;
4
7
  allNames: string[];
@@ -58,7 +61,7 @@ export declare function validatePort(port: string | number, options: {
58
61
  isValid: boolean;
59
62
  errorMessage?: string;
60
63
  };
61
- export declare function validateNodePort(nodePort: number | null, allNodePorts: number[], i18n: I18n): {
64
+ export declare function validateNodePort(nodePort: number | string | null, allNodePorts: number[], i18n: I18n): {
62
65
  isValid: boolean;
63
66
  errorMessage?: string;
64
67
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.3.15-alpha.0",
3
+ "version": "0.3.16-alpha.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",