@bigbinary/neeto-form-frontend 1.0.24 → 1.0.25
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 +31 -0
- package/dist/index.cjs.js +89 -41
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +101 -54
- package/dist/index.js.map +1 -1
- package/index.d.ts +72 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,6 +119,37 @@ import { Submission } from "@bigbinary/neeto-form-frontend";
|
|
|
119
119
|
| `questionLabelProps` | `object` | To override props for question label |
|
|
120
120
|
| `answerProps` | `object` | To override props for answer text |
|
|
121
121
|
|
|
122
|
+
`Fields` component provides access to all the components used in building forms.
|
|
123
|
+
|
|
124
|
+
```js
|
|
125
|
+
import { Fields } from "@bigbinary/neeto-form-frontend";
|
|
126
|
+
|
|
127
|
+
const {
|
|
128
|
+
Email,
|
|
129
|
+
Dropdown,
|
|
130
|
+
ShortText,
|
|
131
|
+
LongText,
|
|
132
|
+
MultipleChoice,
|
|
133
|
+
SingleChoice,
|
|
134
|
+
Phone,
|
|
135
|
+
Rating,
|
|
136
|
+
Terms,
|
|
137
|
+
StarRating,
|
|
138
|
+
} = Fields;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Following components are currently available:
|
|
142
|
+
- `Email`
|
|
143
|
+
- `Dropdown`
|
|
144
|
+
- `ShortText`
|
|
145
|
+
- `LongText`
|
|
146
|
+
- `MultipleChoice`
|
|
147
|
+
- `SingleChoice`
|
|
148
|
+
- `Phone`
|
|
149
|
+
- `Rating`
|
|
150
|
+
- `Terms`
|
|
151
|
+
- `StarRating`
|
|
152
|
+
|
|
122
153
|
## Hooks
|
|
123
154
|
|
|
124
155
|
`useBuildFormState` hook is used to get the form state.
|
package/dist/index.cjs.js
CHANGED
|
@@ -24558,7 +24558,7 @@ function cov_2dmleb6ptc() {
|
|
|
24558
24558
|
}
|
|
24559
24559
|
cov_2dmleb6ptc();
|
|
24560
24560
|
cov_2dmleb6ptc().s[0]++;
|
|
24561
|
-
var Dropdown = function Dropdown(_ref) {
|
|
24561
|
+
var Dropdown$1 = function Dropdown(_ref) {
|
|
24562
24562
|
var item = _ref.item,
|
|
24563
24563
|
name = _ref.name,
|
|
24564
24564
|
isRequired = _ref.isRequired;
|
|
@@ -24780,7 +24780,7 @@ function cov_27ckchp1ss() {
|
|
|
24780
24780
|
}
|
|
24781
24781
|
cov_27ckchp1ss();
|
|
24782
24782
|
cov_27ckchp1ss().s[0]++;
|
|
24783
|
-
var Email = function Email(_ref) {
|
|
24783
|
+
var Email$1 = function Email(_ref) {
|
|
24784
24784
|
var name = _ref.name,
|
|
24785
24785
|
isRequired = _ref.isRequired;
|
|
24786
24786
|
cov_27ckchp1ss().f[0]++;
|
|
@@ -24941,7 +24941,7 @@ function cov_1b2ulkh5av() {
|
|
|
24941
24941
|
}
|
|
24942
24942
|
cov_1b2ulkh5av();
|
|
24943
24943
|
cov_1b2ulkh5av().s[0]++;
|
|
24944
|
-
var LongText = function LongText(_ref) {
|
|
24944
|
+
var LongText$1 = function LongText(_ref) {
|
|
24945
24945
|
var name = _ref.name,
|
|
24946
24946
|
isRequired = _ref.isRequired;
|
|
24947
24947
|
cov_1b2ulkh5av().f[0]++;
|
|
@@ -25359,7 +25359,7 @@ function cov_ezislrxf8() {
|
|
|
25359
25359
|
}
|
|
25360
25360
|
cov_ezislrxf8();
|
|
25361
25361
|
cov_ezislrxf8().s[0]++;
|
|
25362
|
-
var MultipleChoice = function MultipleChoice(_ref) {
|
|
25362
|
+
var MultipleChoice$1 = function MultipleChoice(_ref) {
|
|
25363
25363
|
var item = _ref.item,
|
|
25364
25364
|
name = _ref.name,
|
|
25365
25365
|
isRequired = _ref.isRequired;
|
|
@@ -25572,7 +25572,7 @@ function cov_sj6n6ei6b() {
|
|
|
25572
25572
|
}
|
|
25573
25573
|
cov_sj6n6ei6b();
|
|
25574
25574
|
cov_sj6n6ei6b().s[0]++;
|
|
25575
|
-
var Phone = function Phone(_ref) {
|
|
25575
|
+
var Phone$1 = function Phone(_ref) {
|
|
25576
25576
|
var name = _ref.name,
|
|
25577
25577
|
isRequired = _ref.isRequired;
|
|
25578
25578
|
cov_sj6n6ei6b().f[0]++;
|
|
@@ -25789,7 +25789,7 @@ var RatingItem = function RatingItem(_ref) {
|
|
|
25789
25789
|
}, children);
|
|
25790
25790
|
};
|
|
25791
25791
|
cov_2mbawiwhpy().s[2]++;
|
|
25792
|
-
var Rating$
|
|
25792
|
+
var Rating$2 = function Rating(_ref2) {
|
|
25793
25793
|
var name = _ref2.name,
|
|
25794
25794
|
isRequired = _ref2.isRequired;
|
|
25795
25795
|
cov_2mbawiwhpy().f[1]++;
|
|
@@ -25964,7 +25964,7 @@ function cov_ahxbwc6e2() {
|
|
|
25964
25964
|
}
|
|
25965
25965
|
cov_ahxbwc6e2();
|
|
25966
25966
|
cov_ahxbwc6e2().s[0]++;
|
|
25967
|
-
var ShortText = function ShortText(_ref) {
|
|
25967
|
+
var ShortText$1 = function ShortText(_ref) {
|
|
25968
25968
|
var name = _ref.name,
|
|
25969
25969
|
isRequired = _ref.isRequired;
|
|
25970
25970
|
cov_ahxbwc6e2().f[0]++;
|
|
@@ -26381,7 +26381,7 @@ function cov_1p625a7ih4() {
|
|
|
26381
26381
|
}
|
|
26382
26382
|
cov_1p625a7ih4();
|
|
26383
26383
|
cov_1p625a7ih4().s[0]++;
|
|
26384
|
-
var SingleChoice = function SingleChoice(_ref) {
|
|
26384
|
+
var SingleChoice$1 = function SingleChoice(_ref) {
|
|
26385
26385
|
var item = _ref.item,
|
|
26386
26386
|
name = _ref.name,
|
|
26387
26387
|
isRequired = _ref.isRequired;
|
|
@@ -26688,7 +26688,7 @@ function cov_h8r08qzr() {
|
|
|
26688
26688
|
}
|
|
26689
26689
|
cov_h8r08qzr();
|
|
26690
26690
|
cov_h8r08qzr().s[0]++;
|
|
26691
|
-
var StarRating$
|
|
26691
|
+
var StarRating$2 = function StarRating(_ref) {
|
|
26692
26692
|
var name = _ref.name,
|
|
26693
26693
|
isRequired = _ref.isRequired;
|
|
26694
26694
|
cov_h8r08qzr().f[0]++;
|
|
@@ -26989,7 +26989,7 @@ function cov_12g0frjp3f() {
|
|
|
26989
26989
|
}
|
|
26990
26990
|
cov_12g0frjp3f();
|
|
26991
26991
|
cov_12g0frjp3f().s[0]++;
|
|
26992
|
-
var Terms$
|
|
26992
|
+
var Terms$3 = function Terms(_ref) {
|
|
26993
26993
|
var name = _ref.name;
|
|
26994
26994
|
cov_12g0frjp3f().f[0]++;
|
|
26995
26995
|
var editorRef = (cov_12g0frjp3f().s[1]++, React$2.useRef(null));
|
|
@@ -27036,19 +27036,32 @@ var Terms$2 = function Terms(_ref) {
|
|
|
27036
27036
|
|
|
27037
27037
|
function cov_2qk3dozy47() {
|
|
27038
27038
|
var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/BuildForm/Questions/Fields/index.js";
|
|
27039
|
-
var hash = "
|
|
27039
|
+
var hash = "f240b3dc3957b377c9acff43090e6d3d1fca5bb0";
|
|
27040
27040
|
var global = new Function("return this")();
|
|
27041
27041
|
var gcv = "__coverage__";
|
|
27042
27042
|
var coverageData = {
|
|
27043
27043
|
path: "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/BuildForm/Questions/Fields/index.js",
|
|
27044
|
-
statementMap: {
|
|
27044
|
+
statementMap: {
|
|
27045
|
+
"0": {
|
|
27046
|
+
start: {
|
|
27047
|
+
line: 12,
|
|
27048
|
+
column: 15
|
|
27049
|
+
},
|
|
27050
|
+
end: {
|
|
27051
|
+
line: 23,
|
|
27052
|
+
column: 1
|
|
27053
|
+
}
|
|
27054
|
+
}
|
|
27055
|
+
},
|
|
27045
27056
|
fnMap: {},
|
|
27046
27057
|
branchMap: {},
|
|
27047
|
-
s: {
|
|
27058
|
+
s: {
|
|
27059
|
+
"0": 0
|
|
27060
|
+
},
|
|
27048
27061
|
f: {},
|
|
27049
27062
|
b: {},
|
|
27050
27063
|
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
27051
|
-
hash: "
|
|
27064
|
+
hash: "f240b3dc3957b377c9acff43090e6d3d1fca5bb0"
|
|
27052
27065
|
};
|
|
27053
27066
|
var coverage = global[gcv] || (global[gcv] = {});
|
|
27054
27067
|
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
@@ -27064,6 +27077,18 @@ function cov_2qk3dozy47() {
|
|
|
27064
27077
|
return actualCoverage;
|
|
27065
27078
|
}
|
|
27066
27079
|
cov_2qk3dozy47();
|
|
27080
|
+
var Fields = (cov_2qk3dozy47().s[0]++, {
|
|
27081
|
+
Email: Email$1,
|
|
27082
|
+
Dropdown: Dropdown$1,
|
|
27083
|
+
ShortText: ShortText$1,
|
|
27084
|
+
LongText: LongText$1,
|
|
27085
|
+
MultipleChoice: MultipleChoice$1,
|
|
27086
|
+
SingleChoice: SingleChoice$1,
|
|
27087
|
+
Phone: Phone$1,
|
|
27088
|
+
Rating: Rating$2,
|
|
27089
|
+
Terms: Terms$3,
|
|
27090
|
+
StarRating: StarRating$2
|
|
27091
|
+
});
|
|
27067
27092
|
|
|
27068
27093
|
function cov_2gcfk56wsh() {
|
|
27069
27094
|
var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/BuildForm/Questions/Fields/Editor.jsx";
|
|
@@ -27396,7 +27421,7 @@ var Editor = function Editor(_ref) {
|
|
|
27396
27421
|
|
|
27397
27422
|
function cov_2j8tlu2ul5() {
|
|
27398
27423
|
var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/BuildForm/Questions/constants.js";
|
|
27399
|
-
var hash = "
|
|
27424
|
+
var hash = "cf06aa225404e0ebe444d6f1219d393c9ffc9417";
|
|
27400
27425
|
var global = new Function("return this")();
|
|
27401
27426
|
var gcv = "__coverage__";
|
|
27402
27427
|
var coverageData = {
|
|
@@ -27405,50 +27430,60 @@ function cov_2j8tlu2ul5() {
|
|
|
27405
27430
|
"0": {
|
|
27406
27431
|
start: {
|
|
27407
27432
|
line: 29,
|
|
27408
|
-
column:
|
|
27433
|
+
column: 4
|
|
27409
27434
|
},
|
|
27410
27435
|
end: {
|
|
27411
27436
|
line: 29,
|
|
27412
|
-
column:
|
|
27437
|
+
column: 10
|
|
27413
27438
|
}
|
|
27414
27439
|
},
|
|
27415
27440
|
"1": {
|
|
27416
27441
|
start: {
|
|
27417
|
-
line:
|
|
27418
|
-
column:
|
|
27442
|
+
line: 31,
|
|
27443
|
+
column: 40
|
|
27419
27444
|
},
|
|
27420
27445
|
end: {
|
|
27421
|
-
line:
|
|
27422
|
-
column:
|
|
27446
|
+
line: 31,
|
|
27447
|
+
column: 41
|
|
27423
27448
|
}
|
|
27424
27449
|
},
|
|
27425
27450
|
"2": {
|
|
27426
27451
|
start: {
|
|
27427
27452
|
line: 32,
|
|
27428
|
-
column:
|
|
27453
|
+
column: 35
|
|
27429
27454
|
},
|
|
27430
27455
|
end: {
|
|
27431
|
-
line:
|
|
27432
|
-
column:
|
|
27456
|
+
line: 32,
|
|
27457
|
+
column: 36
|
|
27433
27458
|
}
|
|
27434
27459
|
},
|
|
27435
27460
|
"3": {
|
|
27436
27461
|
start: {
|
|
27437
|
-
line:
|
|
27438
|
-
column:
|
|
27462
|
+
line: 34,
|
|
27463
|
+
column: 30
|
|
27439
27464
|
},
|
|
27440
27465
|
end: {
|
|
27441
|
-
line:
|
|
27466
|
+
line: 177,
|
|
27442
27467
|
column: 1
|
|
27443
27468
|
}
|
|
27444
27469
|
},
|
|
27445
27470
|
"4": {
|
|
27446
27471
|
start: {
|
|
27472
|
+
line: 180,
|
|
27473
|
+
column: 38
|
|
27474
|
+
},
|
|
27475
|
+
end: {
|
|
27447
27476
|
line: 183,
|
|
27477
|
+
column: 1
|
|
27478
|
+
}
|
|
27479
|
+
},
|
|
27480
|
+
"5": {
|
|
27481
|
+
start: {
|
|
27482
|
+
line: 185,
|
|
27448
27483
|
column: 29
|
|
27449
27484
|
},
|
|
27450
27485
|
end: {
|
|
27451
|
-
line:
|
|
27486
|
+
line: 185,
|
|
27452
27487
|
column: 62
|
|
27453
27488
|
}
|
|
27454
27489
|
}
|
|
@@ -27460,12 +27495,13 @@ function cov_2j8tlu2ul5() {
|
|
|
27460
27495
|
"1": 0,
|
|
27461
27496
|
"2": 0,
|
|
27462
27497
|
"3": 0,
|
|
27463
|
-
"4": 0
|
|
27498
|
+
"4": 0,
|
|
27499
|
+
"5": 0
|
|
27464
27500
|
},
|
|
27465
27501
|
f: {},
|
|
27466
27502
|
b: {},
|
|
27467
27503
|
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
27468
|
-
hash: "
|
|
27504
|
+
hash: "cf06aa225404e0ebe444d6f1219d393c9ffc9417"
|
|
27469
27505
|
};
|
|
27470
27506
|
var coverage = global[gcv] || (global[gcv] = {});
|
|
27471
27507
|
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
@@ -27481,9 +27517,20 @@ function cov_2j8tlu2ul5() {
|
|
|
27481
27517
|
return actualCoverage;
|
|
27482
27518
|
}
|
|
27483
27519
|
cov_2j8tlu2ul5();
|
|
27484
|
-
var
|
|
27485
|
-
|
|
27486
|
-
|
|
27520
|
+
var _ref$1 = (cov_2j8tlu2ul5().s[0]++, Fields),
|
|
27521
|
+
Email = _ref$1.Email,
|
|
27522
|
+
Dropdown = _ref$1.Dropdown,
|
|
27523
|
+
ShortText = _ref$1.ShortText,
|
|
27524
|
+
LongText = _ref$1.LongText,
|
|
27525
|
+
MultipleChoice = _ref$1.MultipleChoice,
|
|
27526
|
+
SingleChoice = _ref$1.SingleChoice,
|
|
27527
|
+
Phone = _ref$1.Phone,
|
|
27528
|
+
Rating$1 = _ref$1.Rating,
|
|
27529
|
+
Terms$2 = _ref$1.Terms,
|
|
27530
|
+
StarRating$1 = _ref$1.StarRating;
|
|
27531
|
+
var SINGLE_CHOICE_FIELD_MIN_OPTIONS = (cov_2j8tlu2ul5().s[1]++, 2);
|
|
27532
|
+
var DROPDOWN_FIELD_MIN_OPTIONS = (cov_2j8tlu2ul5().s[2]++, 2);
|
|
27533
|
+
var QUESTION_KINDS = (cov_2j8tlu2ul5().s[3]++, {
|
|
27487
27534
|
email: {
|
|
27488
27535
|
type: "email",
|
|
27489
27536
|
label: instance.t("fields.eif"),
|
|
@@ -27644,11 +27691,11 @@ var QUESTION_KINDS = (cov_2j8tlu2ul5().s[2]++, {
|
|
|
27644
27691
|
});
|
|
27645
27692
|
|
|
27646
27693
|
// To show the question type as label in accordion
|
|
27647
|
-
var INDEPENDENT_LABELS_MAP = (cov_2j8tlu2ul5().s[
|
|
27694
|
+
var INDEPENDENT_LABELS_MAP = (cov_2j8tlu2ul5().s[4]++, {
|
|
27648
27695
|
textarea: "Paragraph",
|
|
27649
27696
|
termsandcondition: "Terms & conditions"
|
|
27650
27697
|
});
|
|
27651
|
-
var PADDED_FIELDS = (cov_2j8tlu2ul5().s[
|
|
27698
|
+
var PADDED_FIELDS = (cov_2j8tlu2ul5().s[5]++, ["textarea", "termsandcondition"]);
|
|
27652
27699
|
|
|
27653
27700
|
function cov_xwc6pppkl() {
|
|
27654
27701
|
var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/BuildForm/Questions/FormField.jsx";
|
|
@@ -29037,7 +29084,7 @@ v35('v5', 0x50, sha1);
|
|
|
29037
29084
|
|
|
29038
29085
|
function cov_1ia73x4fw3() {
|
|
29039
29086
|
var path = "/home/runner/work/neeto-form-frontend/neeto-form-frontend/src/components/BuildForm/Form/utils.js";
|
|
29040
|
-
var hash = "
|
|
29087
|
+
var hash = "1d151b6ca8e222f97d84c7ce5a72809c723c63ba";
|
|
29041
29088
|
var global = new Function("return this")();
|
|
29042
29089
|
var gcv = "__coverage__";
|
|
29043
29090
|
var coverageData = {
|
|
@@ -29126,7 +29173,7 @@ function cov_1ia73x4fw3() {
|
|
|
29126
29173
|
"8": {
|
|
29127
29174
|
start: {
|
|
29128
29175
|
line: 22,
|
|
29129
|
-
column:
|
|
29176
|
+
column: 68
|
|
29130
29177
|
},
|
|
29131
29178
|
end: {
|
|
29132
29179
|
line: 27,
|
|
@@ -29348,7 +29395,7 @@ function cov_1ia73x4fw3() {
|
|
|
29348
29395
|
loc: {
|
|
29349
29396
|
start: {
|
|
29350
29397
|
line: 22,
|
|
29351
|
-
column:
|
|
29398
|
+
column: 68
|
|
29352
29399
|
},
|
|
29353
29400
|
end: {
|
|
29354
29401
|
line: 27,
|
|
@@ -29816,7 +29863,7 @@ function cov_1ia73x4fw3() {
|
|
|
29816
29863
|
"8": [0, 0]
|
|
29817
29864
|
},
|
|
29818
29865
|
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
29819
|
-
hash: "
|
|
29866
|
+
hash: "1d151b6ca8e222f97d84c7ce5a72809c723c63ba"
|
|
29820
29867
|
};
|
|
29821
29868
|
var coverage = global[gcv] || (global[gcv] = {});
|
|
29822
29869
|
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
@@ -29861,13 +29908,13 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref) {
|
|
|
29861
29908
|
}
|
|
29862
29909
|
};
|
|
29863
29910
|
cov_1ia73x4fw3().s[7]++;
|
|
29864
|
-
var createFieldData = function createFieldData(_ref2,
|
|
29911
|
+
var createFieldData = function createFieldData(_ref2, isRequired) {
|
|
29865
29912
|
var defaults = _ref2.defaults,
|
|
29866
29913
|
type = _ref2.type;
|
|
29867
29914
|
cov_1ia73x4fw3().f[2]++;
|
|
29868
29915
|
cov_1ia73x4fw3().s[8]++;
|
|
29869
29916
|
return _objectSpread$a(_objectSpread$a({}, defaults), {}, {
|
|
29870
|
-
|
|
29917
|
+
required: isRequired,
|
|
29871
29918
|
kind: type,
|
|
29872
29919
|
nodeId: v4()
|
|
29873
29920
|
});
|
|
@@ -65539,6 +65586,7 @@ cov_26ii2dyz6b();
|
|
|
65539
65586
|
|
|
65540
65587
|
exports.BuildForm = BuildForm;
|
|
65541
65588
|
exports.ExternalForm = ExternalForm;
|
|
65589
|
+
exports.Fields = Fields;
|
|
65542
65590
|
exports.NeetoFormProvider = NeetoFormProvider;
|
|
65543
65591
|
exports.Submission = Submission;
|
|
65544
65592
|
exports.useBuildFormState = useBuildFormState;
|