@arudovwen/form-builder-react 1.0.8 → 1.1.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/README.md +2 -0
- package/dist/form-builder.es.js +25 -17
- package/dist/form-builder.umd.js +21 -21
- package/dist/index.css +1 -1
- package/package.json +2 -2
- package/types/components/editor/element-canvas.d.ts +16 -16
- package/types/components/editor/layout.d.ts +9 -8
- package/types/components/editor/main.d.ts +4 -4
- package/types/components/editor/topbar.d.ts +3 -1
- package/types/components/elements/element-container.d.ts +13 -13
- package/types/components/elements/grid-input.d.ts +17 -17
- package/types/components/elements/multi-input-options.d.ts +13 -13
- package/types/components/elements/multi-input.d.ts +15 -15
- package/types/components/viewer/index.d.ts +16 -16
- package/types/components/viewer/multi-page.d.ts +5 -5
- package/types/components/viewer/single-page.d.ts +4 -4
- package/types/context/editor-context.d.ts +19 -19
- package/types/pages/builder/index.d.ts +3 -3
- package/types/pages/viewer/index.d.ts +11 -11
- package/types/utils/contants.d.ts +52 -52
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ function App() {
|
|
|
71
71
|
<FormBuilder
|
|
72
72
|
onSubmit={(form_data: any) => console.log(form_data)}
|
|
73
73
|
config={config}
|
|
74
|
+
title="My Form Title"
|
|
74
75
|
/>
|
|
75
76
|
<FormViewer
|
|
76
77
|
onSubmit={(e: any) => console.log(e)}
|
|
@@ -90,6 +91,7 @@ export default App;
|
|
|
90
91
|
|
|
91
92
|
| Prop | Type | Description |
|
|
92
93
|
|--------------|--------------------|--------------------------------------------------|
|
|
94
|
+
| `title` | `string` | TItle of the form, optional |
|
|
93
95
|
| `form_data` | `FormElement[]` | Array of form elements to render in the form. |
|
|
94
96
|
| `answerData` | `any[]` | Array of user-provided answers to the form. |
|
|
95
97
|
| `config` | `object` | Configuration object (e.g., `buttonColor`, `loaderColor`). |
|
package/dist/form-builder.es.js
CHANGED
|
@@ -14599,7 +14599,7 @@ const Sw = () => {
|
|
|
14599
14599
|
borderColor: s.color,
|
|
14600
14600
|
color: s.color
|
|
14601
14601
|
},
|
|
14602
|
-
className: `cursor-move text-[#475467] flex justify-between items-center
|
|
14602
|
+
className: `cursor-move text-[#475467] flex justify-between items-center h-11\r
|
|
14603
14603
|
border border-[#98A2B3] rounded-lg py-3 px-[14px] shadow-custom\r
|
|
14604
14604
|
hover:shadow-lg transition-all duration-200\r
|
|
14605
14605
|
active:opacity-50`,
|
|
@@ -14634,42 +14634,48 @@ const Sw = () => {
|
|
|
14634
14634
|
/* @__PURE__ */ m.jsx("div", { className: "max-h-[90vh] overflow-y-auto h-full min-h-[600px] w-full", children: /* @__PURE__ */ m.jsx(Mw, { form_data: n, ignoreValidation: !0 }) })
|
|
14635
14635
|
] }) }) : null;
|
|
14636
14636
|
};
|
|
14637
|
-
function Ow() {
|
|
14638
|
-
const { addSection:
|
|
14639
|
-
return /* @__PURE__ */ m.jsxs("div", { className: "px-[30px] py-[10px] flex justify-between items-center", children: [
|
|
14640
|
-
/* @__PURE__ */ m.jsx("
|
|
14641
|
-
|
|
14637
|
+
function Ow({ title: e }) {
|
|
14638
|
+
const { addSection: t } = he(Et), [n, r] = W(!1);
|
|
14639
|
+
return /* @__PURE__ */ m.jsxs("div", { className: "px-[30px] py-[10px] flex justify-between items-center bg-[#F9F9FB]", children: [
|
|
14640
|
+
/* @__PURE__ */ m.jsx("h1", { className: "font-semibold text-lg", children: e || "" }),
|
|
14641
|
+
n && /* @__PURE__ */ m.jsx(
|
|
14642
14642
|
Cw,
|
|
14643
14643
|
{
|
|
14644
|
-
isOpen:
|
|
14645
|
-
onClose: () =>
|
|
14644
|
+
isOpen: n,
|
|
14645
|
+
onClose: () => r(!1),
|
|
14646
14646
|
element: void 0
|
|
14647
14647
|
}
|
|
14648
14648
|
),
|
|
14649
|
-
/* @__PURE__ */ m.jsxs("div", { className: "py-4 flex justify-end gap-x-6 text-
|
|
14649
|
+
/* @__PURE__ */ m.jsxs("div", { className: "py-4 flex justify-end gap-x-6 text-base", children: [
|
|
14650
14650
|
/* @__PURE__ */ m.jsx(
|
|
14651
14651
|
Vn,
|
|
14652
14652
|
{
|
|
14653
|
-
onClick: () =>
|
|
14653
|
+
onClick: () => t(),
|
|
14654
14654
|
text: "Add section",
|
|
14655
|
-
btnClass: "text-gray-700 border-[#98A2B3] !font-medium bg-transparent"
|
|
14655
|
+
btnClass: "text-gray-700 border-[#98A2B3] !font-medium bg-transparent",
|
|
14656
|
+
icon: "icon-park-outline:plus"
|
|
14656
14657
|
}
|
|
14657
14658
|
),
|
|
14658
14659
|
/* @__PURE__ */ m.jsx(
|
|
14659
14660
|
Vn,
|
|
14660
14661
|
{
|
|
14661
|
-
onClick: () =>
|
|
14662
|
+
onClick: () => r(!0),
|
|
14662
14663
|
text: "Preview",
|
|
14663
|
-
btnClass: "text-gray-700 border-[#98A2B3] !font-medium"
|
|
14664
|
+
btnClass: "text-gray-700 border-[#98A2B3] !font-medium",
|
|
14665
|
+
icon: "solar:eye-bold-duotone"
|
|
14664
14666
|
}
|
|
14665
14667
|
)
|
|
14666
14668
|
] })
|
|
14667
14669
|
] });
|
|
14668
14670
|
}
|
|
14669
|
-
function Rw({
|
|
14671
|
+
function Rw({
|
|
14672
|
+
onSubmit: e,
|
|
14673
|
+
questionData: t,
|
|
14674
|
+
title: n
|
|
14675
|
+
}) {
|
|
14670
14676
|
return /* @__PURE__ */ m.jsx($u, { children: /* @__PURE__ */ m.jsxs("div", { className: "w-full h-screen bg-[#E4E7EC] flex flex-col", children: [
|
|
14671
14677
|
/* @__PURE__ */ m.jsx(Rd, {}),
|
|
14672
|
-
/* @__PURE__ */ m.jsx("div", { className: "border-b bg-white border-[#E4E7EC]", children: /* @__PURE__ */ m.jsx(Ow, {}) }),
|
|
14678
|
+
/* @__PURE__ */ m.jsx("div", { className: "border-b bg-white border-[#E4E7EC]", children: /* @__PURE__ */ m.jsx(Ow, { title: n }) }),
|
|
14673
14679
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-1 ", children: [
|
|
14674
14680
|
/* @__PURE__ */ m.jsx("div", { className: "w-[270px] h-full border-l border-[#E4E7EC] bg-white", children: /* @__PURE__ */ m.jsx(_w, {}) }),
|
|
14675
14681
|
/* @__PURE__ */ m.jsx("div", { className: "flex-1 h-full max-h-full p-4 z-[1]", children: /* @__PURE__ */ m.jsx(Tw, { questionData: t }) })
|
|
@@ -14683,7 +14689,8 @@ const Hw = ({
|
|
|
14683
14689
|
isReadOnly: n,
|
|
14684
14690
|
config: r = {
|
|
14685
14691
|
buttonColor: "#333"
|
|
14686
|
-
}
|
|
14692
|
+
},
|
|
14693
|
+
title: i
|
|
14687
14694
|
}) => (Q(() => {
|
|
14688
14695
|
r && Nu("config", r);
|
|
14689
14696
|
}, [r]), /* @__PURE__ */ m.jsx(
|
|
@@ -14691,7 +14698,8 @@ const Hw = ({
|
|
|
14691
14698
|
{
|
|
14692
14699
|
onSubmit: e,
|
|
14693
14700
|
questionData: t,
|
|
14694
|
-
isReadOnly: n
|
|
14701
|
+
isReadOnly: n,
|
|
14702
|
+
title: i
|
|
14695
14703
|
}
|
|
14696
14704
|
)), Fw = () => (Q(() => {
|
|
14697
14705
|
const e = Di("config"), t = (e == null ? void 0 : e.loaderColor) || "#333";
|