@bigbinary/neeto-form-frontend 4.4.36 → 4.4.38
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/app/javascript/src/translations/en.json +5 -1
- package/dist/.ready +1 -1
- package/dist/BuildForm.js +57 -7
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +5 -4
- package/dist/ExternalForm.js.map +1 -1
- package/dist/Submission.js +1 -1
- package/dist/UrlBuilder.js +5 -4
- package/dist/UrlBuilder.js.map +1 -1
- package/dist/{buildForm-Ds5d1DR8.js → buildForm-C5642_SF.js} +2 -2
- package/dist/{buildForm-Ds5d1DR8.js.map → buildForm-C5642_SF.js.map} +1 -1
- package/dist/cjs/BuildForm.js +57 -7
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +5 -4
- package/dist/cjs/ExternalForm.js.map +1 -1
- package/dist/cjs/Submission.js +1 -1
- package/dist/cjs/UrlBuilder.js +5 -4
- package/dist/cjs/UrlBuilder.js.map +1 -1
- package/dist/cjs/{buildForm-CtHZCSpo.js → buildForm-BO5Vcxv_.js} +2 -2
- package/dist/cjs/{buildForm-CtHZCSpo.js.map → buildForm-BO5Vcxv_.js.map} +1 -1
- package/dist/cjs/{constants-CUBwzMb-.js → constants-D3en9KhN.js} +2 -1
- package/dist/cjs/constants-D3en9KhN.js.map +1 -0
- package/dist/cjs/hooks.js +4 -4
- package/dist/cjs/{index-Bj56Ua86.js → index-B9L6Cdpy.js} +2 -2
- package/dist/cjs/{index-Bj56Ua86.js.map → index-B9L6Cdpy.js.map} +1 -1
- package/dist/cjs/index.js +10 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/{useFormSubmission-DGRHK3u9.js → useFormSubmission-CdbaJ9RK.js} +2 -2
- package/dist/cjs/{useFormSubmission-DGRHK3u9.js.map → useFormSubmission-CdbaJ9RK.js.map} +1 -1
- package/dist/cjs/{utils-Xnit8PUn.js → utils-ojUD_GO6.js} +188 -96
- package/dist/cjs/utils-ojUD_GO6.js.map +1 -0
- package/dist/cjs/v2/BuildForm.js +157 -134
- package/dist/cjs/v2/BuildForm.js.map +1 -1
- package/dist/cjs/v2/ExternalForm.js +16 -42
- package/dist/cjs/v2/ExternalForm.js.map +1 -1
- package/dist/cjs/v2/Submission.js +5 -4
- package/dist/cjs/v2/Submission.js.map +1 -1
- package/dist/cjs/v2/UrlBuilder.js +6 -33
- package/dist/cjs/v2/UrlBuilder.js.map +1 -1
- package/dist/cjs/v2/{constants-DIy-d-Pb.js → constants-DyPOVMyi.js} +2 -1
- package/dist/cjs/v2/constants-DyPOVMyi.js.map +1 -0
- package/dist/cjs/v2/index.js +27 -57
- package/dist/cjs/v2/index.js.map +1 -1
- package/dist/cjs/v2/{utils-DO12kVcq.js → utils-ChwdTdnN.js} +197 -110
- package/dist/cjs/v2/utils-ChwdTdnN.js.map +1 -0
- package/dist/cjs/v2/{yup-DH3aFnam.js → yup-CKeWnmJ3.js} +362 -84
- package/dist/cjs/v2/yup-CKeWnmJ3.js.map +1 -0
- package/dist/cjs/{yup-DZgfXVgs.js → yup-DvB9BGdG.js} +340 -39
- package/dist/cjs/yup-DvB9BGdG.js.map +1 -0
- package/dist/{constants-fjoeNdhb.js → constants-ClqQe4qZ.js} +2 -1
- package/dist/constants-ClqQe4qZ.js.map +1 -0
- package/dist/hooks.js +4 -4
- package/dist/{index-Cx0yvXwJ.js → index-CAR9-spo.js} +2 -2
- package/dist/{index-Cx0yvXwJ.js.map → index-CAR9-spo.js.map} +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/dist/{useFormSubmission-DMpf1msR.js → useFormSubmission-DMRpRRj4.js} +2 -2
- package/dist/{useFormSubmission-DMpf1msR.js.map → useFormSubmission-DMRpRRj4.js.map} +1 -1
- package/dist/{utils-Chj7ZOKi.js → utils-6l6j_LN6.js} +188 -96
- package/dist/utils-6l6j_LN6.js.map +1 -0
- package/dist/v2/BuildForm.js +157 -134
- package/dist/v2/BuildForm.js.map +1 -1
- package/dist/v2/ExternalForm.js +15 -41
- package/dist/v2/ExternalForm.js.map +1 -1
- package/dist/v2/Submission.js +5 -4
- package/dist/v2/Submission.js.map +1 -1
- package/dist/v2/UrlBuilder.js +6 -33
- package/dist/v2/UrlBuilder.js.map +1 -1
- package/dist/v2/{constants-CZ7swzMG.js → constants-BlY0KFT4.js} +2 -1
- package/dist/v2/constants-BlY0KFT4.js.map +1 -0
- package/dist/v2/index.js +22 -52
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/main.css +1 -1
- package/dist/v2/main.css.map +1 -1
- package/dist/v2/{utils-CW12NXEG.js → utils-B8sTYkWG.js} +194 -107
- package/dist/v2/utils-B8sTYkWG.js.map +1 -0
- package/dist/v2/{yup-Cddsv0mm.js → yup-Cf-x7SqN.js} +355 -80
- package/dist/v2/yup-Cf-x7SqN.js.map +1 -0
- package/dist/{yup-CwN-8JrO.js → yup-7qmI_2fI.js} +338 -40
- package/dist/yup-7qmI_2fI.js.map +1 -0
- package/package.json +18 -16
- package/dist/cjs/constants-CUBwzMb-.js.map +0 -1
- package/dist/cjs/utils-Xnit8PUn.js.map +0 -1
- package/dist/cjs/v2/constants-DIy-d-Pb.js.map +0 -1
- package/dist/cjs/v2/utils-DO12kVcq.js.map +0 -1
- package/dist/cjs/v2/yup-DH3aFnam.js.map +0 -1
- package/dist/cjs/yup-DZgfXVgs.js.map +0 -1
- package/dist/constants-fjoeNdhb.js.map +0 -1
- package/dist/utils-Chj7ZOKi.js.map +0 -1
- package/dist/v2/constants-CZ7swzMG.js.map +0 -1
- package/dist/v2/utils-CW12NXEG.js.map +0 -1
- package/dist/v2/yup-Cddsv0mm.js.map +0 -1
- package/dist/yup-CwN-8JrO.js.map +0 -1
|
@@ -85,7 +85,8 @@
|
|
|
85
85
|
"smsReminder": "SMS reminder",
|
|
86
86
|
"spot": "Number of group booking spots",
|
|
87
87
|
"opinionScale": "Opinion scale",
|
|
88
|
-
"address": "Address"
|
|
88
|
+
"address": "Address",
|
|
89
|
+
"yesNo": "Yes/No"
|
|
89
90
|
},
|
|
90
91
|
"questionTooltips": {
|
|
91
92
|
"def": "Add paragraphs, information, or short notes to your form."
|
|
@@ -173,6 +174,9 @@
|
|
|
173
174
|
"worst": "Worst",
|
|
174
175
|
"best": "Best"
|
|
175
176
|
},
|
|
177
|
+
"yesNo": {
|
|
178
|
+
"showIcons": "Show icons"
|
|
179
|
+
},
|
|
176
180
|
"address": {
|
|
177
181
|
"fields": "Address fields",
|
|
178
182
|
"field": "Address field",
|
package/dist/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-
|
|
1
|
+
Built at 2026-08-11T10:15:33.197Z
|
package/dist/BuildForm.js
CHANGED
|
@@ -3,14 +3,14 @@ import classnames from 'classnames';
|
|
|
3
3
|
import { isPresent, truncate, findBy, isNotPresent, slugify, existsBy, findById, findIndexById, hyphenate, noop, nullSafe, modifyBy, removeBy } from '@bigbinary/neeto-cist';
|
|
4
4
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
5
5
|
import { equals, path, when, assoc, includes, isEmpty, reject, keys, pick, omit, evolve, map, mergeLeft, isNil, pipe, filter, isNotNil, values, uniq, join, pathSatisfies, assocPath, dissoc, append, pluck, test, paths, difference, prop, startsWith, split, last, either, F, T } from 'ramda';
|
|
6
|
-
import { k as useDeleteQuestion, Q as QUESTION_TYPES, b as useForm, l as useCreateQuestion, m as useUpdateQuestion, C as CAPTCHA_TYPES, n as useReorderQuestions, i as QUERY_KEYS } from './constants-
|
|
7
|
-
import {
|
|
6
|
+
import { k as useDeleteQuestion, Q as QUESTION_TYPES, b as useForm, l as useCreateQuestion, m as useUpdateQuestion, C as CAPTCHA_TYPES, n as useReorderQuestions, i as QUERY_KEYS } from './constants-ClqQe4qZ.js';
|
|
7
|
+
import { k as QUESTION_ACTIONS, l as INDEPENDENT_LABELS_MAP, m as buildDisplayLabel, n as isElementOverflowing, o as SELECTABLE_KINDS, p as isAutoGeneratedQuestion, q as isRichTextQuestion, r as SPOT_QUESTION_FIELD_CODE, N as NON_BASIC_LATIN_CHARACTERS_REGEX, s as RESERVED_FIELD_CODES, t as renameKey, f as LABEL_FIELDS, u as isDefaultLanguage, v as buildAddQuestionButtonProps, w as validateEditorContent, F as FIELD_CODES_REJECT_CHARS_REGEX, M as MIN_WORDS_SWITCH_LABEL_PROPS, x as MIN_WORDS, y as isImmutableField, a as QUESTIONS_WITHOUT_FIELD_CODE, z as NON_HIDEABLE_FIELDS, B as NON_READ_ONLY_FIELDS, O as OPINION_LABEL_MAX_LENGTH, G as RICH_TEXT_QUESTIONS, e as ADDRESS_FIELD_WIDTHS, A as ADDRESS_FIELD_TYPES, H as generateDefaultOptions, J as MINIMUM_ADDRESS_FIELDS, K as getDeletedRecords, T as randomId, U as getActiveRecords, V as FILE_TYPES_MAP, W as FILE_GROUPS, X as OPINION_SCALE_MIN_VALUE_OPTIONS, Z as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, _ as MINIMUM_OPTIONS, $ as IMAGE_HEIGHT_SLIDER_DEFAULTS, a0 as RATING_OPTIONS, a1 as STAR_RATING_MIN_VALUE_OPTIONS, a2 as STAR_RATING_MAX_VALUE_OPTIONS, a3 as STAR_RATING_ICONS_MAP, a4 as YES_NO_ICONS_MAP, a5 as buildDisabledAddButtonHelpPopoverProps, a6 as buildReorderPayload, a7 as QUESTIONS_INITIAL_VALUE, a8 as isMandatoryField, a9 as QUESTION_KINDS, Q as QUESTION_KIND, aa as getActiveQuestionKindDetails, ab as DEFAULT_AVAILABLE_LANGUAGES, ac as DEFAULT_ADVANCED_FEATURES } from './yup-7qmI_2fI.js';
|
|
8
8
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
9
9
|
import { useState, useRef, useEffect, createElement } from 'react';
|
|
10
10
|
import { Droppable, Draggable, DragDropContext } from '@hello-pangea/dnd';
|
|
11
11
|
import { withT, isMetaKeyPressed, useStateWithDependency, useFuncDebounce, useOnClickOutside } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
12
12
|
import { showThumbsUpToastr, withEventTargetValue, hyphenize } from '@bigbinary/neeto-commons-frontend/utils';
|
|
13
|
-
import { a as useBuildFormStore } from './buildForm-
|
|
13
|
+
import { a as useBuildFormStore } from './buildForm-C5642_SF.js';
|
|
14
14
|
import { shallow } from 'zustand/shallow';
|
|
15
15
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
16
16
|
import { useTranslation, Trans } from 'react-i18next';
|
|
@@ -23,7 +23,7 @@ import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
|
23
23
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
24
24
|
import Equals from '@bigbinary/neeto-icons/Equals';
|
|
25
25
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
26
|
-
import { i as isFunction, f as fieldWithFallback, c as isNameQuestion } from './index-
|
|
26
|
+
import { i as isFunction, f as fieldWithFallback, c as isNameQuestion } from './index-CAR9-spo.js';
|
|
27
27
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
28
28
|
import { t } from 'i18next';
|
|
29
29
|
import { v4 } from 'uuid';
|
|
@@ -81,6 +81,7 @@ import '@bigbinary/neeto-icons/Sms';
|
|
|
81
81
|
import '@bigbinary/neeto-icons/Terms';
|
|
82
82
|
import '@bigbinary/neeto-icons/TextLines';
|
|
83
83
|
import '@bigbinary/neeto-icons/UserRoundedRect';
|
|
84
|
+
import '@bigbinary/neeto-icons/YesNo';
|
|
84
85
|
import 'dompurify';
|
|
85
86
|
import '@bigbinary/neeto-icons/Plus';
|
|
86
87
|
import 'zustand';
|
|
@@ -769,8 +770,9 @@ var NAME = QUESTION_TYPES.NAME,
|
|
|
769
770
|
FILE_UPLOAD$1 = QUESTION_TYPES.FILE_UPLOAD,
|
|
770
771
|
CAPTCHA$1 = QUESTION_TYPES.CAPTCHA,
|
|
771
772
|
SMS_REMINDER = QUESTION_TYPES.SMS_REMINDER,
|
|
772
|
-
ADDRESS$1 = QUESTION_TYPES.ADDRESS
|
|
773
|
-
|
|
773
|
+
ADDRESS$1 = QUESTION_TYPES.ADDRESS,
|
|
774
|
+
YES_NO$1 = QUESTION_TYPES.YES_NO;
|
|
775
|
+
var QUESTIONS_WITH_ADDITIONAL_DATA = [].concat(_toConsumableArray(SELECTABLE_KINDS), [STAR_RATING$1, OPINION_SCALE$1, RATING$1, FILE_UPLOAD$1, CAPTCHA$1, EMAIL$1, ADDRESS$1, YES_NO$1]);
|
|
774
776
|
var QUESTIONS_WITH_PLACEHOLDERS = [NAME, PHONE, EMAIL$1, ADDITIONAL_GUESTS, TEXT, TEXTAREA, RICH_TEXT, INTEGER, DECIMAL, DATE, SMS_REMINDER];
|
|
775
777
|
var DEFAULT_PLACEHOLDERS = {
|
|
776
778
|
CHECKBOX: t("neetoForm.questions.common.questionFields.field.labelExample", {
|
|
@@ -2752,6 +2754,51 @@ var StarRating = function StarRating() {
|
|
|
2752
2754
|
});
|
|
2753
2755
|
};
|
|
2754
2756
|
|
|
2757
|
+
var YesNo = function YesNo() {
|
|
2758
|
+
var _useTranslation = useTranslation(),
|
|
2759
|
+
t = _useTranslation.t;
|
|
2760
|
+
var _useField = useField("isIconEnabled"),
|
|
2761
|
+
_useField2 = _slicedToArray(_useField, 1),
|
|
2762
|
+
isIconEnabled = _useField2[0].value;
|
|
2763
|
+
var _useField3 = useField("iconType"),
|
|
2764
|
+
_useField4 = _slicedToArray(_useField3, 3),
|
|
2765
|
+
iconType = _useField4[0].value;
|
|
2766
|
+
_useField4[1];
|
|
2767
|
+
var setIconType = _useField4[2].setValue;
|
|
2768
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2769
|
+
children: [/*#__PURE__*/jsx(Switch, {
|
|
2770
|
+
"data-testid": "neeto-form-engine-yes-no-show-icons",
|
|
2771
|
+
label: t("neetoForm.questions.yesNo.showIcons"),
|
|
2772
|
+
name: "isIconEnabled"
|
|
2773
|
+
}), isIconEnabled && /*#__PURE__*/jsxs(Fragment, {
|
|
2774
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
2775
|
+
children: t("neetoForm.common.shape")
|
|
2776
|
+
}), /*#__PURE__*/jsx("div", {
|
|
2777
|
+
className: "flex gap-2",
|
|
2778
|
+
children: Object.entries(YES_NO_ICONS_MAP).map(function (_ref) {
|
|
2779
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
2780
|
+
name = _ref2[0],
|
|
2781
|
+
_ref2$ = _ref2[1],
|
|
2782
|
+
Yes = _ref2$.Yes,
|
|
2783
|
+
No = _ref2$.No;
|
|
2784
|
+
var isActive = name === iconType;
|
|
2785
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2786
|
+
"data-testid": "neeto-form-engine-yes-no-icon-".concat(name),
|
|
2787
|
+
className: classnames("flex items-center justify-center gap-2 px-3 py-2", "neeto-ui-border-gray-800 neeto-ui-rounded-full cursor-pointer border", "transition-all duration-300 ease-in-out", {
|
|
2788
|
+
"neeto-ui-text-gray-800 neeto-ui-bg-gray-200": !isActive,
|
|
2789
|
+
"neeto-ui-text-white neeto-ui-bg-gray-800": isActive
|
|
2790
|
+
}),
|
|
2791
|
+
onClick: function onClick() {
|
|
2792
|
+
return setIconType(name);
|
|
2793
|
+
},
|
|
2794
|
+
children: [/*#__PURE__*/jsx(Yes, {}), /*#__PURE__*/jsx(No, {})]
|
|
2795
|
+
}, name);
|
|
2796
|
+
})
|
|
2797
|
+
})]
|
|
2798
|
+
})]
|
|
2799
|
+
});
|
|
2800
|
+
};
|
|
2801
|
+
|
|
2755
2802
|
var _excluded$1 = ["minWords"],
|
|
2756
2803
|
_excluded2 = ["fields"];
|
|
2757
2804
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -2765,7 +2812,8 @@ var CHECKBOX = QUESTION_TYPES.CHECKBOX,
|
|
|
2765
2812
|
FILE_UPLOAD = QUESTION_TYPES.FILE_UPLOAD,
|
|
2766
2813
|
CAPTCHA = QUESTION_TYPES.CAPTCHA,
|
|
2767
2814
|
EMAIL = QUESTION_TYPES.EMAIL,
|
|
2768
|
-
ADDRESS = QUESTION_TYPES.ADDRESS
|
|
2815
|
+
ADDRESS = QUESTION_TYPES.ADDRESS,
|
|
2816
|
+
YES_NO = QUESTION_TYPES.YES_NO;
|
|
2769
2817
|
var transformValueForOption = function transformValueForOption(_ref) {
|
|
2770
2818
|
var label = _ref.label,
|
|
2771
2819
|
type = _ref.type;
|
|
@@ -2791,6 +2839,8 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
2791
2839
|
return /*#__PURE__*/jsx(StarRating, {});
|
|
2792
2840
|
case OPINION_SCALE:
|
|
2793
2841
|
return /*#__PURE__*/jsx(OpinionScale, {});
|
|
2842
|
+
case YES_NO:
|
|
2843
|
+
return /*#__PURE__*/jsx(YesNo, {});
|
|
2794
2844
|
case FILE_UPLOAD:
|
|
2795
2845
|
return /*#__PURE__*/jsx(FileUpload, {});
|
|
2796
2846
|
case CAPTCHA:
|