@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.155 → 0.0.1-alpha.156

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.
@@ -46832,24 +46832,10 @@ const FormStringInput = ({
46832
46832
  onRemoveByMinus
46833
46833
  }) => {
46834
46834
  const designNewLayout = useDesignNewLayout();
46835
- const [isMultiline, setIsMultiline] = useState(false);
46836
- const [currentValue, setCurrentValue] = useState("");
46837
46835
  const fixedName = name === "nodeName" ? "nodeNameBecauseOfSuddenBug" : name;
46838
46836
  const formFieldName = arrName || fixedName;
46839
46837
  const formValue = Form.useWatch(formFieldName);
46840
- useEffect(() => {
46841
- if (formValue && typeof formValue === "string") {
46842
- setCurrentValue(formValue);
46843
- if (isMultilineString(formValue)) {
46844
- setIsMultiline(true);
46845
- }
46846
- }
46847
- }, [formValue]);
46848
- useEffect(() => {
46849
- if (currentValue && isMultilineString(currentValue)) {
46850
- setIsMultiline(true);
46851
- }
46852
- }, [currentValue]);
46838
+ const isMultiline = useMemo(() => isMultilineString(formValue), [formValue]);
46853
46839
  const title = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
46854
46840
  getStringByName(name),
46855
46841
  required?.includes(getStringByName(name)) && /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "danger", children: "*" })
@@ -46875,33 +46861,7 @@ const FormStringInput = ({
46875
46861
  {
46876
46862
  placeholder: getStringByName(name),
46877
46863
  rows: isMultiline ? 4 : 1,
46878
- autoSize: !isMultiline ? { minRows: 1, maxRows: 1 } : { minRows: 2, maxRows: 10 },
46879
- onChange: (e) => {
46880
- const { value } = e.target;
46881
- setCurrentValue(value);
46882
- },
46883
- onInput: (e) => {
46884
- const { value } = e.target;
46885
- setCurrentValue(value);
46886
- if (!isMultiline && value.includes("\n")) {
46887
- setIsMultiline(true);
46888
- }
46889
- },
46890
- onBlur: (e) => {
46891
- if (isMultilineString(e.target.value)) {
46892
- setIsMultiline(true);
46893
- } else {
46894
- setIsMultiline(false);
46895
- }
46896
- },
46897
- onPaste: (e) => {
46898
- const pastedText = e.clipboardData.getData("text");
46899
- if (pastedText && isMultilineString(pastedText)) {
46900
- setTimeout(() => {
46901
- setIsMultiline(true);
46902
- }, 0);
46903
- }
46904
- }
46864
+ autoSize: !isMultiline ? { minRows: 1, maxRows: 1 } : { minRows: 2, maxRows: 10 }
46905
46865
  }
46906
46866
  )
46907
46867
  },