@arudovwen/form-builder-react 1.9.8 → 1.9.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arudovwen/form-builder-react",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
4
4
  "description": "A React-based form builder component library.",
5
5
  "type": "module",
6
6
  "main": "./dist/form-builder.umd.js",
@@ -1,3 +1,4 @@
1
+ import { DeleteMode } from "../../context/editor-context";
1
2
  export interface BuilderProps {
2
3
  onSubmit?: (e: any) => void;
3
4
  onChange?: (data: any) => void;
@@ -5,6 +6,7 @@ export interface BuilderProps {
5
6
  questionData?: any;
6
7
  isReadOnly?: boolean;
7
8
  config?: any;
9
+ deleteMode?: DeleteMode;
8
10
  title?: string;
9
11
  loading?: boolean;
10
12
  goBackUrl?: () => void;
@@ -19,4 +21,4 @@ export interface BuilderProps {
19
21
  onShowVersion?: () => void;
20
22
  formType?: "default" | "poll";
21
23
  }
22
- export default function Layout({ onSubmit, onChange, onLogAction, questionData, title, goBackUrl, loading, onPublish, previewLoading, saveLoading, publishLoading, onTitleChange, uploadUrl, onAddTemplate, templates, onShowVersion, formType, }: BuilderProps): import("react/jsx-runtime").JSX.Element;
24
+ export default function Layout({ onSubmit, onChange, onLogAction, questionData, deleteMode, config, title, goBackUrl, loading, onPublish, previewLoading, saveLoading, publishLoading, onTitleChange, uploadUrl, onAddTemplate, templates, onShowVersion, formType, }: BuilderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,13 @@
1
1
  import React from "react";
2
+ export type DeleteMode = "remove" | "isDeleted" | "soft" | "hard";
2
3
  interface EditorProviderProps {
3
4
  children: React.ReactNode;
4
5
  onChange?: (data: any) => void;
5
6
  onLogAction?: (action: string, value: any) => void;
7
+ deleteMode?: DeleteMode;
6
8
  }
7
9
  declare const EditorContext: React.Context<{
10
+ deleteMode?: DeleteMode;
8
11
  showPreview: boolean;
9
12
  setShowPreview: React.Dispatch<React.SetStateAction<boolean>>;
10
13
  formData: any;
@@ -0,0 +1,181 @@
1
+ export declare const demoPollApiResponse: {
2
+ succeeded: boolean;
3
+ message: string;
4
+ errors: any;
5
+ data: {
6
+ formId: string;
7
+ formName: string;
8
+ category: string;
9
+ totalSubmissions: number;
10
+ submissionsData: ({
11
+ sectionId: string;
12
+ fieldId: string;
13
+ type: string;
14
+ label: string;
15
+ totalResponses: number;
16
+ responsesData: {
17
+ options: {
18
+ optionId: string;
19
+ label: string;
20
+ value: string;
21
+ count: number;
22
+ percentage: number;
23
+ }[];
24
+ rows?: undefined;
25
+ average?: undefined;
26
+ nps?: undefined;
27
+ rankings?: undefined;
28
+ topRankWeight?: undefined;
29
+ totalPoints?: undefined;
30
+ };
31
+ } | {
32
+ sectionId: string;
33
+ fieldId: string;
34
+ type: string;
35
+ label: string;
36
+ totalResponses: number;
37
+ responsesData: {
38
+ rows: {
39
+ rowId: string;
40
+ label: string;
41
+ value: string;
42
+ totalResponses: number;
43
+ columns: {
44
+ optionId: string;
45
+ label: string;
46
+ value: string;
47
+ count: number;
48
+ percentage: number;
49
+ }[];
50
+ }[];
51
+ options?: undefined;
52
+ average?: undefined;
53
+ nps?: undefined;
54
+ rankings?: undefined;
55
+ topRankWeight?: undefined;
56
+ totalPoints?: undefined;
57
+ };
58
+ } | {
59
+ sectionId: string;
60
+ fieldId: string;
61
+ type: string;
62
+ label: string;
63
+ totalResponses: number;
64
+ responsesData: {
65
+ options: {
66
+ label: string;
67
+ value: string;
68
+ count: number;
69
+ percentage: number;
70
+ }[];
71
+ average: number;
72
+ nps: {
73
+ promoters: number;
74
+ passives: number;
75
+ detractors: number;
76
+ score: number;
77
+ };
78
+ rows?: undefined;
79
+ rankings?: undefined;
80
+ topRankWeight?: undefined;
81
+ totalPoints?: undefined;
82
+ };
83
+ } | {
84
+ sectionId: string;
85
+ fieldId: string;
86
+ type: string;
87
+ label: string;
88
+ totalResponses: number;
89
+ responsesData: {
90
+ options: {
91
+ label: string;
92
+ value: string;
93
+ count: number;
94
+ percentage: number;
95
+ }[];
96
+ average: number;
97
+ rows?: undefined;
98
+ nps?: undefined;
99
+ rankings?: undefined;
100
+ topRankWeight?: undefined;
101
+ totalPoints?: undefined;
102
+ };
103
+ } | {
104
+ sectionId: string;
105
+ fieldId: string;
106
+ type: string;
107
+ label: string;
108
+ totalResponses: number;
109
+ responsesData: {
110
+ rankings: {
111
+ optionId: string;
112
+ label: string;
113
+ value: string;
114
+ count: number;
115
+ percentage: number;
116
+ averageRank: number;
117
+ points: number;
118
+ pointsPercentage: number;
119
+ isTopRanked: boolean;
120
+ }[];
121
+ topRankWeight: number;
122
+ totalPoints: number;
123
+ options?: undefined;
124
+ rows?: undefined;
125
+ average?: undefined;
126
+ nps?: undefined;
127
+ };
128
+ })[];
129
+ };
130
+ };
131
+ export declare const demoQuestionDa: {
132
+ title: string;
133
+ description: string;
134
+ id: string;
135
+ questionData: ({
136
+ required: boolean;
137
+ isReadOnly: boolean;
138
+ isDisabled: boolean;
139
+ id: string;
140
+ sectionId: string;
141
+ type: string;
142
+ label: string;
143
+ inputLabel: string;
144
+ inputType: string;
145
+ } | {
146
+ options: {
147
+ id: any;
148
+ label: any;
149
+ value: any;
150
+ }[];
151
+ options1: {
152
+ id: any;
153
+ label: any;
154
+ value: any;
155
+ }[];
156
+ required: boolean;
157
+ isReadOnly: boolean;
158
+ isDisabled: boolean;
159
+ id: string;
160
+ sectionId: string;
161
+ type: string;
162
+ label: string;
163
+ inputLabel: string;
164
+ inputType: string;
165
+ } | {
166
+ options: {
167
+ id: any;
168
+ label: any;
169
+ value: any;
170
+ }[];
171
+ required: boolean;
172
+ isReadOnly: boolean;
173
+ isDisabled: boolean;
174
+ id: string;
175
+ sectionId: string;
176
+ type: string;
177
+ label: string;
178
+ inputLabel: string;
179
+ inputType: string;
180
+ })[];
181
+ }[];
package/types/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  import './index.css';
2
2
  export { default as FormBuilder } from "./pages/builder";
3
3
  export { default as FormViewer } from "./pages/viewer";
4
+ export type { BuilderProps } from "./components/editor/layout";
5
+ export type { RenderProps } from "./pages/viewer";
6
+ export type { DeleteMode } from "./context/editor-context";
@@ -1,3 +1,3 @@
1
1
  import { BuilderProps } from "../../components/editor/layout";
2
- declare const HomePage: ({ onSubmit, onChange, onLogAction, questionData, isReadOnly, config, title, loading, goBackUrl, onPublish, previewLoading, saveLoading, publishLoading, onTitleChange, uploadUrl, onAddTemplate, templates, onShowVersion, formType, }: BuilderProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const HomePage: ({ onSubmit, onChange, onLogAction, questionData, isReadOnly, deleteMode, 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;
@@ -3,6 +3,7 @@ type Section = {
3
3
  title: string;
4
4
  description: string;
5
5
  questionData?: any[];
6
+ isDeleted?: boolean;
6
7
  };
7
8
  export declare function getAllQuestionData(sections: Section[]): any[];
8
9
  export {};