@bigbinary/neeto-form-frontend 1.0.2 → 1.0.4

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.
Files changed (4) hide show
  1. package/dist/index.js +4482 -6465
  2. package/dist/main.css +614 -587
  3. package/index.d.ts +82 -0
  4. package/package.json +21 -29
package/index.d.ts ADDED
@@ -0,0 +1,82 @@
1
+ import { ButtonProps, TypographyProps } from "@bigbinary/neetoui";
2
+ import React, { FormHTMLAttributes, HTMLAttributes } from "react";
3
+
4
+ interface BuildFormProps {
5
+ isEmbedded?: boolean;
6
+ id: string;
7
+ onUpdate?: (data: any) => void;
8
+ buildRequestArgs?: any;
9
+ showAddQuestionDivider?: boolean;
10
+ nonRemovableFields?: string[];
11
+ requiredFields?: string[];
12
+ formDomProps?: FormHTMLAttributes<HTMLFormElement>;
13
+ showActionBlock?: boolean;
14
+ submitButtonProps?: HTMLAttributes<HTMLButtonElement>;
15
+ cancelButtonProps?: HTMLAttributes<HTMLButtonElement>;
16
+ }
17
+
18
+ interface ExternalFormProps {
19
+ preview?: boolean;
20
+ formId: string;
21
+ submissionId: string;
22
+ customSubmitHandler?: (data: any) => void;
23
+ onBeforeSubmit?: (data: any) => void;
24
+ onSubmitSuccess?: (data: any) => void;
25
+ showTitle?: boolean;
26
+ formTitle?: string;
27
+ titleProps?: TypographyProps;
28
+ submitRequestArgs?: any;
29
+ footer?: React.ReactNode;
30
+ submitButtonProps?: ButtonProps;
31
+ cancelButtonProps?: ButtonProps;
32
+ resetButtonProps?: ButtonProps;
33
+ showPrefixIcons?: boolean;
34
+ displayThankYou?: boolean;
35
+ showSuccessToastr?: boolean;
36
+ showEmptyState?: boolean;
37
+ className?: string;
38
+ preserveValues?: boolean;
39
+ clearValuesOnReset?: boolean;
40
+ clearValuesOnSubmit?: boolean;
41
+ formDomProps?: FormHTMLAttributes<HTMLFormElement>;
42
+ }
43
+
44
+ interface SubmissionProps {
45
+ formId: string;
46
+ submissionId: string;
47
+ className?: string;
48
+ questionLabelProps?: TypographyProps;
49
+ answerProps?: TypographyProps;
50
+ }
51
+
52
+ interface IBuildFormState {
53
+ values: any;
54
+ dirty: boolean;
55
+ isSubmitting: boolean;
56
+ isValid: boolean;
57
+ errors: { [key: string]: string }[];
58
+ submitForm: () => void;
59
+ resetForm: () => void;
60
+ }
61
+
62
+ interface ISubmission {
63
+ responses: {
64
+ label: string;
65
+ value: string;
66
+ kind: string;
67
+ }[];
68
+ }
69
+
70
+ export const BuildForm: React.FC<BuildFormProps>;
71
+ export const ExternalForm: React.FC<ExternalFormProps>;
72
+ export const Submission: React.FC<SubmissionProps>;
73
+ export const NeetoFormProvider: React.FC;
74
+
75
+ export const useBuildFormState: () => IBuildFormState;
76
+ export const useFormSubmission: (args: {
77
+ formId: string;
78
+ submissionId: string;
79
+ }) => {
80
+ submission: ISubmission;
81
+ isLoading: boolean;
82
+ };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-form-frontend",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Neeto Form Engine Frontend",
5
5
  "author": "BigBinary",
6
6
  "license": "MIT",
7
7
  "repository": "https://github.com/bigbinary/neeto-form-frontend",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
10
+ "types": "./index.d.ts",
10
11
  "engines": {
11
12
  "node": ">=10"
12
13
  },
@@ -32,13 +33,14 @@
32
33
  "@babel/core": "^7.13.15",
33
34
  "@babel/eslint-parser": "^7.17.0",
34
35
  "@babel/plugin-proposal-class-properties": "^7.13.0",
36
+ "@babel/plugin-transform-runtime": "^7.19.6",
35
37
  "@babel/preset-env": "^7.13.15",
36
38
  "@babel/preset-react": "^7.16.7",
39
+ "@babel/runtime": "^7.17.9",
37
40
  "@bigbinary/neeto-commons-frontend": "^2.0.35",
38
41
  "@bigbinary/neeto-editor": "^1.0.3",
39
42
  "@bigbinary/neeto-icons": "^1.8.35",
40
43
  "@bigbinary/neetoui": "^4.0.6",
41
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
42
44
  "@rollup/plugin-alias": "^3.1.9",
43
45
  "@rollup/plugin-babel": "^5.3.1",
44
46
  "@rollup/plugin-commonjs": "^22.0.0",
@@ -47,10 +49,9 @@
47
49
  "@rollup/plugin-replace": "^4.0.0",
48
50
  "@svgr/rollup": "^6.2.1",
49
51
  "antd": "^4.24.2",
50
- "babel-loader": "^8.2.2",
52
+ "axios": "^0.27.2",
53
+ "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
51
54
  "classnames": "^2.3.1",
52
- "css-loader": "^4.3.0",
53
- "css-minimizer-webpack-plugin": "1.3.0",
54
55
  "dayjs": "^1.11.0",
55
56
  "eslint": "^8.12.0",
56
57
  "eslint-config-prettier": "^8.5.0",
@@ -63,33 +64,33 @@
63
64
  "eslint-plugin-react": "^7.29.4",
64
65
  "eslint-plugin-react-hooks": "4.4.0",
65
66
  "eslint-plugin-unused-imports": "^2.0.0",
66
- "file-loader": "^6.1.1",
67
67
  "formik": "^2.2.9",
68
- "html-loader": "^1.3.1",
69
- "html-webpack-plugin": "^4.5.0",
70
68
  "husky": "^7.0.4",
69
+ "i18next": "^21.8.0",
70
+ "libphonenumber-js": "^1.10.9",
71
71
  "lint-staged": "^12.3.7",
72
- "mini-css-extract-plugin": "0.9.0",
73
72
  "postcss": "^8.2.15",
74
- "postcss-loader": "^4.0.3",
75
73
  "postcss-preset-env": "^6.7.0",
76
74
  "prettier": "^2.6.1",
77
75
  "prop-types": "^15.8.1",
78
76
  "ramda": "^0.28.0",
79
77
  "react": "^17.0.1",
78
+ "react-beautiful-dnd": "^13.1.0",
80
79
  "react-dom": "^17.0.1",
81
- "react-refresh": "^0.11.0",
80
+ "react-i18next": "^11.16.9",
81
+ "react-query": "^3.39.2",
82
82
  "react-router-dom": "5.3.0",
83
83
  "react-router-nav-prompt": "0.4.1",
84
- "react-scripts": "4.0.3",
84
+ "react-select": "^5.3.2",
85
85
  "react-svg-loader": "^3.0.3",
86
86
  "react-toastify": "8.0.2",
87
87
  "rollup": "^2.73.0",
88
88
  "rollup-plugin-peer-deps-external": "^2.2.4",
89
89
  "rollup-plugin-styles": "^4.0.0",
90
90
  "sass": "^1.26.11",
91
- "sass-loader": "^10.0.2",
92
- "style-loader": "^2.0.0"
91
+ "tailwindcss": "^3.0.24",
92
+ "uuid": "^9.0.0",
93
+ "yup": "^1.0.0"
93
94
  },
94
95
  "peerDependencies": {
95
96
  "@bigbinary/neeto-commons-frontend": "latest",
@@ -104,21 +105,12 @@
104
105
  "react": "17.0.2",
105
106
  "react-dom": "17.0.2",
106
107
  "react-router-dom": "5.3.0",
107
- "yup": "^0.32.11"
108
+ "react-toastify": "8.0.2",
109
+ "tailwindcss": "^3.0.24",
110
+ "yup": "^1.0.0"
108
111
  },
109
112
  "files": [
110
- "dist"
111
- ],
112
- "dependencies": {
113
- "@babel/runtime": "^7.17.9",
114
- "axios": "^0.27.2",
115
- "i18next": "^21.8.0",
116
- "libphonenumber-js": "^1.10.9",
117
- "react-beautiful-dnd": "^13.1.0",
118
- "react-i18next": "^11.16.9",
119
- "react-query": "^3.39.0",
120
- "react-select": "^5.3.2",
121
- "tailwindcss": "^3.0.24",
122
- "yup": "^0.32.11"
123
- }
113
+ "dist",
114
+ "index.d.ts"
115
+ ]
124
116
  }