@arudovwen/form-builder-react 1.9.16 → 1.9.18
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/form-builder-react.css +1 -1
- package/dist/form-builder.es.js +1 -1
- package/dist/form-builder.umd.js +17 -20
- package/dist/{index-nlYOj-Yu.js → index-DJlw_s73.js} +3599 -3515
- package/dist/{logic-flow-CJPqtBSk.js → logic-flow-BCzmmn3X.js} +3 -3
- package/package.json +1 -1
- package/types/components/editor/layout.d.ts +4 -3
- package/types/components/editor/main.d.ts +2 -2
- package/types/components/viewer/multi-page.d.ts +1 -5
- package/types/components/viewer/validation.d.ts +2 -2
- package/types/context/editor-context.d.ts +3 -0
- package/types/demo-data.d.ts +7 -7
- package/types/index.d.ts +1 -1
- package/types/pages/builder/index.d.ts +1 -1
- package/types/utils/contants.d.ts +1 -0
- package/types/utils/default-templates.d.ts +3 -3
- package/types/utils/getAllQuestions.d.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as ce, jsx as D, Fragment as De } from "react/jsx-runtime";
|
|
2
2
|
import ht, { memo as le, useState as xe, useCallback as we, forwardRef as Oo, useRef as ne, useEffect as ie, useContext as gt, createContext as fn, useMemo as be, useLayoutEffect as Aa } from "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
import { A as Ia } from "./index-
|
|
4
|
+
import { A as Ia } from "./index-DJlw_s73.js";
|
|
5
5
|
function ue(e) {
|
|
6
6
|
if (typeof e == "string" || typeof e == "number") return "" + e;
|
|
7
7
|
let t = "";
|
|
@@ -6804,7 +6804,7 @@ function Jg({ formData: e }) {
|
|
|
6804
6804
|
let u = null;
|
|
6805
6805
|
return (f = e == null ? void 0 : e.filter((h) => !(h != null && h.isFieldDeleted))) == null || f.forEach((h, y) => {
|
|
6806
6806
|
var _;
|
|
6807
|
-
const x = Lo[y % Lo.length], p = ((_ = h == null ? void 0 : h.
|
|
6807
|
+
const x = Lo[y % Lo.length], p = ((_ = h == null ? void 0 : h.formData) == null ? void 0 : _.filter((E) => !(E != null && E.isFieldDeleted))) || [], v = y * 400, m = 0, w = 320, S = 60 + p.length * 110;
|
|
6808
6808
|
l.push({
|
|
6809
6809
|
id: h.id,
|
|
6810
6810
|
type: "sectionGroup",
|
|
@@ -6851,7 +6851,7 @@ function Jg({ formData: e }) {
|
|
|
6851
6851
|
});
|
|
6852
6852
|
}), (g = e == null ? void 0 : e.filter((h) => !(h != null && h.isFieldDeleted))) == null || g.forEach((h) => {
|
|
6853
6853
|
var y, x;
|
|
6854
|
-
(x = (y = h == null ? void 0 : h.
|
|
6854
|
+
(x = (y = h == null ? void 0 : h.formData) == null ? void 0 : y.filter((p) => !(p != null && p.isFieldDeleted))) == null || x.forEach((p) => {
|
|
6855
6855
|
var v;
|
|
6856
6856
|
p.isHidden && ((v = p.visibilityDependentFields) == null ? void 0 : v.length) > 0 && p.visibilityDependentFields.forEach((m) => {
|
|
6857
6857
|
d.push({
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { DeleteMode } from "../../context/editor-context";
|
|
1
|
+
import { DeleteMode, BuilderMode } from "../../context/editor-context";
|
|
2
2
|
export interface BuilderProps {
|
|
3
3
|
onSubmit?: (e: any) => void;
|
|
4
4
|
onChange?: (data: any) => void;
|
|
5
5
|
onLogAction?: (action: string, value: any) => void;
|
|
6
|
-
|
|
6
|
+
formData?: any;
|
|
7
7
|
isReadOnly?: boolean;
|
|
8
8
|
config?: any;
|
|
9
9
|
deleteMode?: DeleteMode;
|
|
10
|
+
mode?: BuilderMode;
|
|
10
11
|
title?: string;
|
|
11
12
|
loading?: boolean;
|
|
12
13
|
goBackUrl?: () => void;
|
|
@@ -21,4 +22,4 @@ export interface BuilderProps {
|
|
|
21
22
|
onShowVersion?: () => void;
|
|
22
23
|
formType?: "default" | "poll";
|
|
23
24
|
}
|
|
24
|
-
export default function Layout({ onSubmit, onChange, onLogAction,
|
|
25
|
+
export default function Layout({ onSubmit, onChange, onLogAction, formData, deleteMode, mode, config, title, goBackUrl, loading, onPublish, previewLoading, saveLoading, publishLoading, onTitleChange, uploadUrl, onAddTemplate, templates, onShowVersion, formType, }: BuilderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default function MainPage({
|
|
2
|
-
|
|
1
|
+
export default function MainPage({ initialFormData, uploadUrl, onAddTemplate, templates, viewMode, }: {
|
|
2
|
+
initialFormData: any[];
|
|
3
3
|
isReadOnly?: boolean;
|
|
4
4
|
uploadUrl?: string;
|
|
5
5
|
onAddTemplate?: () => void;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
export default function MultiPage({ form_data, options, current }:
|
|
2
|
-
form_data: any;
|
|
3
|
-
options: any;
|
|
4
|
-
current: any;
|
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export default function MultiPage({ form_data, options, current }: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as yup from "yup";
|
|
2
|
-
interface
|
|
2
|
+
interface formData {
|
|
3
3
|
id: string;
|
|
4
4
|
type: "textField" | "longText" | "numberField" | "amountField" | "selectField" | "checkbox" | "email" | "date" | "matrix" | "url";
|
|
5
5
|
isRequired?: boolean;
|
|
@@ -15,7 +15,7 @@ interface QuestionData {
|
|
|
15
15
|
isDisabled?: boolean;
|
|
16
16
|
}
|
|
17
17
|
interface Section {
|
|
18
|
-
|
|
18
|
+
formData: formData[];
|
|
19
19
|
}
|
|
20
20
|
export declare const evaluateVisibility: (question: any, answerData: any) => any;
|
|
21
21
|
export declare function generateDynamicSchema({ formData, isReadOnly, ignoreValidation, answerData, }: {
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type DeleteMode = "remove" | "isFieldDeleted" | "soft" | "hard";
|
|
3
|
+
export type BuilderMode = "create" | "edit";
|
|
3
4
|
interface EditorProviderProps {
|
|
4
5
|
children: React.ReactNode;
|
|
5
6
|
onChange?: (data: any) => void;
|
|
6
7
|
onLogAction?: (action: string, value: any) => void;
|
|
7
8
|
deleteMode?: DeleteMode;
|
|
9
|
+
mode?: BuilderMode;
|
|
8
10
|
}
|
|
9
11
|
declare const EditorContext: React.Context<{
|
|
10
12
|
deleteMode?: DeleteMode;
|
|
13
|
+
mode?: BuilderMode;
|
|
11
14
|
showPreview: boolean;
|
|
12
15
|
setShowPreview: React.Dispatch<React.SetStateAction<boolean>>;
|
|
13
16
|
formData: any;
|
package/types/demo-data.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ export declare const demoQuestionDa: {
|
|
|
134
134
|
id: string;
|
|
135
135
|
disabled: boolean;
|
|
136
136
|
isHidden: boolean;
|
|
137
|
-
|
|
137
|
+
formData: ({
|
|
138
138
|
id: string;
|
|
139
139
|
sectionId: string;
|
|
140
140
|
type: string;
|
|
@@ -310,7 +310,7 @@ export declare const demoFormData: ({
|
|
|
310
310
|
title: string;
|
|
311
311
|
description: string;
|
|
312
312
|
id: string;
|
|
313
|
-
|
|
313
|
+
formData: ({
|
|
314
314
|
required: boolean;
|
|
315
315
|
description: string;
|
|
316
316
|
value: any;
|
|
@@ -509,7 +509,7 @@ export declare const demoFormData: ({
|
|
|
509
509
|
title: string;
|
|
510
510
|
description: string;
|
|
511
511
|
id: string;
|
|
512
|
-
|
|
512
|
+
formData: ({
|
|
513
513
|
required: boolean;
|
|
514
514
|
description: string;
|
|
515
515
|
value: any;
|
|
@@ -1014,7 +1014,7 @@ export declare const demoFormData: ({
|
|
|
1014
1014
|
title: string;
|
|
1015
1015
|
description: string;
|
|
1016
1016
|
id: string;
|
|
1017
|
-
|
|
1017
|
+
formData: ({
|
|
1018
1018
|
required: boolean;
|
|
1019
1019
|
description: string;
|
|
1020
1020
|
value: any;
|
|
@@ -1292,7 +1292,7 @@ export declare const demoFormData: ({
|
|
|
1292
1292
|
title: string;
|
|
1293
1293
|
description: string;
|
|
1294
1294
|
id: string;
|
|
1295
|
-
|
|
1295
|
+
formData: ({
|
|
1296
1296
|
required: boolean;
|
|
1297
1297
|
description: string;
|
|
1298
1298
|
value: any;
|
|
@@ -1506,7 +1506,7 @@ export declare const demoFormData: ({
|
|
|
1506
1506
|
title: string;
|
|
1507
1507
|
description: string;
|
|
1508
1508
|
id: string;
|
|
1509
|
-
|
|
1509
|
+
formData: ({
|
|
1510
1510
|
required: boolean;
|
|
1511
1511
|
description: string;
|
|
1512
1512
|
value: any;
|
|
@@ -1721,7 +1721,7 @@ export declare const demoFormData: ({
|
|
|
1721
1721
|
title: string;
|
|
1722
1722
|
description: string;
|
|
1723
1723
|
id: string;
|
|
1724
|
-
|
|
1724
|
+
formData: ({
|
|
1725
1725
|
required: boolean;
|
|
1726
1726
|
description: string;
|
|
1727
1727
|
value: any;
|
package/types/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export { default as FormBuilder } from "./pages/builder";
|
|
|
3
3
|
export { default as FormViewer } from "./pages/viewer";
|
|
4
4
|
export type { BuilderProps } from "./components/editor/layout";
|
|
5
5
|
export type { RenderProps } from "./pages/viewer";
|
|
6
|
-
export type { DeleteMode } from "./context/editor-context";
|
|
6
|
+
export type { DeleteMode, BuilderMode } from "./context/editor-context";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BuilderProps } from "../../components/editor/layout";
|
|
2
|
-
declare const HomePage: ({ onSubmit, onChange, onLogAction,
|
|
2
|
+
declare const HomePage: ({ onSubmit, onChange, onLogAction, formData, isReadOnly, deleteMode, mode, config, title, loading, goBackUrl, onPublish, previewLoading, saveLoading, publishLoading, onTitleChange, uploadUrl, onAddTemplate, templates, onShowVersion, formType, }: BuilderProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default HomePage;
|
|
@@ -6,7 +6,7 @@ export declare const defaultTemplates: ({
|
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
8
|
description: string;
|
|
9
|
-
|
|
9
|
+
formData: ({
|
|
10
10
|
id: string;
|
|
11
11
|
type: string;
|
|
12
12
|
label: string;
|
|
@@ -27,7 +27,7 @@ export declare const defaultTemplates: ({
|
|
|
27
27
|
sections: {
|
|
28
28
|
id: string;
|
|
29
29
|
title: string;
|
|
30
|
-
|
|
30
|
+
formData: ({
|
|
31
31
|
id: string;
|
|
32
32
|
type: string;
|
|
33
33
|
label: string;
|
|
@@ -48,7 +48,7 @@ export declare const defaultTemplates: ({
|
|
|
48
48
|
sections: {
|
|
49
49
|
id: string;
|
|
50
50
|
title: string;
|
|
51
|
-
|
|
51
|
+
formData: ({
|
|
52
52
|
id: string;
|
|
53
53
|
type: string;
|
|
54
54
|
label: string;
|
|
@@ -2,8 +2,8 @@ type Section = {
|
|
|
2
2
|
id: string;
|
|
3
3
|
title: string;
|
|
4
4
|
description: string;
|
|
5
|
-
|
|
5
|
+
formData?: any[];
|
|
6
6
|
isFieldDeleted?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function getAllformData(sections: Section[]): any[];
|
|
9
9
|
export {};
|