@oneplatformdev/ui 0.0.1-beta.36 → 0.0.1-beta.38
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.
@@ -1,21 +1,21 @@
|
|
1
|
-
import { jsx as r, jsxs as
|
2
|
-
import { FormField as d, FormItem as
|
3
|
-
const
|
4
|
-
const { form: n, name: m, label: o, render: t,
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
2
|
+
import { FormField as d, FormItem as i, FormLabel as F, FormMessage as p } from "./Form.mjs";
|
3
|
+
const b = (e) => {
|
4
|
+
const { form: n, name: m, label: o, render: t, containerProps: l = {}, ...s } = e;
|
5
5
|
return /* @__PURE__ */ r(
|
6
6
|
d,
|
7
7
|
{
|
8
8
|
control: n.control,
|
9
9
|
name: m,
|
10
|
-
render: (
|
11
|
-
!!o && /* @__PURE__ */ r(
|
12
|
-
t(
|
13
|
-
/* @__PURE__ */ r(
|
10
|
+
render: (c) => /* @__PURE__ */ a(i, { ...l, children: [
|
11
|
+
!!o && /* @__PURE__ */ r(F, { children: o }),
|
12
|
+
t(c),
|
13
|
+
/* @__PURE__ */ r(p, {})
|
14
14
|
] }),
|
15
|
-
...
|
15
|
+
...s
|
16
16
|
}
|
17
17
|
);
|
18
18
|
};
|
19
19
|
export {
|
20
|
-
|
20
|
+
b as FormRenderControl
|
21
21
|
};
|
@@ -14,5 +14,6 @@ export interface FormRenderControlProps<Data extends FieldValues> {
|
|
14
14
|
name: FieldPath<Data>;
|
15
15
|
label?: string;
|
16
16
|
render: FormRenderProps<Data>;
|
17
|
+
containerProps?: React.HTMLAttributes<HTMLDivElement>;
|
17
18
|
}
|
18
|
-
export type FormRenderControlExtendProps<Data extends FieldValues> =
|
19
|
+
export type FormRenderControlExtendProps<Data extends FieldValues> = Omit<FormRenderControlProps<Data>, 'render'>;
|
@@ -1,26 +1,27 @@
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
2
|
-
import { FormControl as
|
3
|
-
import { FormRenderControl as
|
4
|
-
import { Textarea as
|
5
|
-
const
|
6
|
-
const { form:
|
2
|
+
import { FormControl as p } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as i } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { Textarea as s } from "../Textarea/Textarea.mjs";
|
5
|
+
const F = (e) => {
|
6
|
+
const { form: t, label: m, name: n, containerProps: a, ...l } = e;
|
7
7
|
return /* @__PURE__ */ r(
|
8
|
-
|
8
|
+
i,
|
9
9
|
{
|
10
|
-
form:
|
10
|
+
form: t,
|
11
11
|
name: n,
|
12
|
-
label:
|
13
|
-
|
14
|
-
|
12
|
+
label: m,
|
13
|
+
containerProps: a,
|
14
|
+
render: ({ field: o }) => /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(
|
15
|
+
s,
|
15
16
|
{
|
16
17
|
...o,
|
17
18
|
value: o.value || "",
|
18
|
-
...
|
19
|
+
...l
|
19
20
|
}
|
20
21
|
) })
|
21
22
|
}
|
22
23
|
);
|
23
24
|
};
|
24
25
|
export {
|
25
|
-
|
26
|
+
F as FormTextarea
|
26
27
|
};
|
@@ -9,9 +9,9 @@ const u = ({
|
|
9
9
|
f.useEffect(() => {
|
10
10
|
const e = r.current;
|
11
11
|
if (e) {
|
12
|
-
c && (e.style.minHeight = `${s +
|
12
|
+
c && (e.style.minHeight = `${s + 0}px`, t > s && (e.style.maxHeight = `${t}px`), i(!1)), e.style.height = `${s + 0}px`;
|
13
13
|
const o = e.scrollHeight;
|
14
|
-
o > t ? e.style.height = `${t}px` : e.style.height = `${o +
|
14
|
+
o > t ? e.style.height = `${t}px` : e.style.height = `${o + 0}px`;
|
15
15
|
}
|
16
16
|
}, [r.current, l]);
|
17
17
|
};
|