@arudovwen/form-builder-react 1.9.2 → 1.9.3

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,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-BCYTk5tZ.js";
4
+ import { A as Ia } from "./index-Bm9-Z-_6.js";
5
5
  function ue(e) {
6
6
  if (typeof e == "string" || typeof e == "number") return "" + e;
7
7
  let t = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arudovwen/form-builder-react",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "A React-based form builder component library.",
5
5
  "type": "module",
6
6
  "main": "./dist/form-builder.umd.js",
@@ -17,5 +17,6 @@ export interface BuilderProps {
17
17
  onAddTemplate?: () => void;
18
18
  templates?: any[];
19
19
  onShowVersion?: () => void;
20
+ formType?: "default" | "poll";
20
21
  }
21
- export default function Layout({ onSubmit, onChange, onLogAction, questionData, title, goBackUrl, loading, onPublish, previewLoading, saveLoading, publishLoading, onTitleChange, uploadUrl, onAddTemplate, templates, onShowVersion, }: BuilderProps): import("react/jsx-runtime").JSX.Element;
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;
@@ -1,2 +1,5 @@
1
- declare const _default: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
1
+ import { FormType } from "../../utils/contants";
2
+ declare const _default: import("react").MemoExoticComponent<({ formType }: {
3
+ formType?: FormType;
4
+ }) => import("react/jsx-runtime").JSX.Element>;
2
5
  export default _default;
@@ -0,0 +1,2 @@
1
+ declare const ImageChoiceInput: ({ element, state, validationData }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default ImageChoiceInput;
@@ -0,0 +1,2 @@
1
+ declare const NpsInput: ({ element, state, validationData }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default NpsInput;
@@ -0,0 +1,2 @@
1
+ declare const RankingInput: ({ element, state, validationData }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default RankingInput;
@@ -20,6 +20,8 @@ export interface FormRendererProps {
20
20
  }) => ReactNode);
21
21
  hideFooter?: boolean;
22
22
  uploadUrl?: string;
23
+ pollResults?: Record<string, any>;
24
+ showResults?: boolean;
23
25
  }
24
26
  declare const _default: React.NamedExoticComponent<FormRendererProps>;
25
27
  export default _default;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ export interface PollResultsProps {
3
+ results: {
4
+ totalVotes: number;
5
+ options: {
6
+ label: string;
7
+ percentage: number;
8
+ count: number;
9
+ }[];
10
+ };
11
+ }
12
+ export declare const PollResultsBreakdown: React.FC<PollResultsProps>;
@@ -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, }: BuilderProps) => import("react/jsx-runtime").JSX.Element;
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;
3
3
  export default HomePage;
@@ -16,5 +16,7 @@ export interface RenderProps {
16
16
  hideFooter?: boolean;
17
17
  onGetValues?: (e: any) => void;
18
18
  uploadUrl?: string;
19
+ pollResults?: Record<string, any>;
20
+ showResults?: boolean;
19
21
  }
20
- export default function Viewer({ answerData, form_data, ignoreValidation, onSubmit, isReadOnly, loading, config, renderType, children, hideFooter, onGetValues, uploadUrl, }: RenderProps): import("react/jsx-runtime").JSX.Element;
22
+ export default function Viewer({ answerData, form_data, ignoreValidation, onSubmit, isReadOnly, loading, config, renderType, children, hideFooter, onGetValues, uploadUrl, pollResults, showResults, }: RenderProps): import("react/jsx-runtime").JSX.Element;
@@ -27,8 +27,12 @@ export declare enum ElementKind {
27
27
  GRID = "grid",
28
28
  MATRIX = "matrix",
29
29
  CALCULATED_FIELD = "calculatedField",
30
- POLLING = "polling"
30
+ POLLING = "polling",
31
+ NPS = "nps",
32
+ RANKING = "ranking",
33
+ IMAGE_CHOICE = "imageChoice"
31
34
  }
35
+ export type FormType = "default" | "poll";
32
36
  export interface DataColumnType {
33
37
  field: string;
34
38
  headerName: string;
@@ -102,6 +106,8 @@ export interface ElementType {
102
106
  formula?: string;
103
107
  fetchExternalResults?: boolean;
104
108
  externalApiUrl?: string;
109
+ minLabel?: string;
110
+ maxLabel?: string;
105
111
  }
106
112
  export declare const countryOptions: OptionType[];
107
113
  export declare const Elements: ElementType[];
@@ -113,6 +119,10 @@ export declare const CategorizedElements: Readonly<{
113
119
  layoutAndDisplay: ElementKind[];
114
120
  advancedData: ElementKind[];
115
121
  }>;
122
+ export declare const CategorizedPollElements: Readonly<{
123
+ pollComponents: ElementKind[];
124
+ layoutAndInfo: ElementKind[];
125
+ }>;
116
126
  export declare const dateFormats: {
117
127
  label: string;
118
128
  value: string;