@bigbinary/neeto-form-frontend 4.4.17 → 4.4.19
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 +1 -1
- package/app/javascript/src/translations/ar.json +8 -2
- package/app/javascript/src/translations/bg.json +8 -2
- package/app/javascript/src/translations/ca.json +8 -2
- package/app/javascript/src/translations/cs.json +8 -2
- package/app/javascript/src/translations/da.json +8 -2
- package/app/javascript/src/translations/de.json +8 -2
- package/app/javascript/src/translations/en.json +7 -1
- package/app/javascript/src/translations/es-MX.json +8 -2
- package/app/javascript/src/translations/es.json +8 -2
- package/app/javascript/src/translations/et.json +8 -2
- package/app/javascript/src/translations/fi.json +8 -2
- package/app/javascript/src/translations/fil.json +8 -2
- package/app/javascript/src/translations/fr.json +8 -2
- package/app/javascript/src/translations/he.json +8 -2
- package/app/javascript/src/translations/hi.json +8 -2
- package/app/javascript/src/translations/hr.json +8 -2
- package/app/javascript/src/translations/hu.json +8 -2
- package/app/javascript/src/translations/id.json +8 -2
- package/app/javascript/src/translations/it.json +8 -2
- package/app/javascript/src/translations/ja.json +8 -2
- package/app/javascript/src/translations/ko.json +8 -2
- package/app/javascript/src/translations/nl.json +8 -2
- package/app/javascript/src/translations/pl.json +8 -2
- package/app/javascript/src/translations/pt-BR.json +8 -2
- package/app/javascript/src/translations/pt.json +8 -2
- package/app/javascript/src/translations/ro.json +8 -2
- package/app/javascript/src/translations/ru.json +8 -2
- package/app/javascript/src/translations/sk.json +8 -2
- package/app/javascript/src/translations/sl.json +8 -2
- package/app/javascript/src/translations/sv.json +8 -2
- package/app/javascript/src/translations/th.json +8 -2
- package/app/javascript/src/translations/tr.json +8 -2
- package/app/javascript/src/translations/uk.json +8 -2
- package/app/javascript/src/translations/vi.json +8 -2
- package/app/javascript/src/translations/zh-CN.json +8 -2
- package/app/javascript/src/translations/zh-TW.json +8 -2
- package/dist/.ready +1 -1
- package/dist/BuildForm.js +111 -33
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +24 -2
- package/dist/ExternalForm.js.map +1 -1
- package/dist/UrlBuilder.js +24 -2
- package/dist/UrlBuilder.js.map +1 -1
- package/dist/cjs/BuildForm.js +111 -33
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +24 -2
- package/dist/cjs/ExternalForm.js.map +1 -1
- package/dist/cjs/UrlBuilder.js +24 -2
- package/dist/cjs/UrlBuilder.js.map +1 -1
- package/dist/cjs/index.js +25 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +25 -3
- package/dist/index.js.map +1 -1
- package/dist/{utils-H7u9B9Jq.js → utils-NwGbGewW.js} +2 -2
- package/dist/{utils-H7u9B9Jq.js.map → utils-NwGbGewW.js.map} +1 -1
- package/dist/{utils-QSMxxdQN.js → utils-rfqUlBlT.js} +2 -2
- package/dist/{utils-QSMxxdQN.js.map → utils-rfqUlBlT.js.map} +1 -1
- package/dist/{yup-B3JGBWm7.js → yup-CBPWSDXh.js} +67 -8
- package/dist/yup-CBPWSDXh.js.map +1 -0
- package/dist/{yup-DfKhsn0t.js → yup-COZendlM.js} +67 -8
- package/dist/yup-COZendlM.js.map +1 -0
- package/package.json +18 -18
- package/dist/yup-B3JGBWm7.js.map +0 -1
- package/dist/yup-DfKhsn0t.js.map +0 -1
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "Viacnásobný výber",
|
|
69
69
|
"scf": "Jednotný výber",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "Pokyny",
|
|
71
71
|
"drf": "Rozbaľovací zoznam",
|
|
72
72
|
"qif": "Viacriadkový text",
|
|
73
73
|
"nif": "Meno",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "Overovací kód bol odoslaný do vašej prichádzajúcej pošty. Neprišiel vám kód? <button>Znova odoslať overovací kód</button>",
|
|
282
282
|
"sendCode": "Odoslať kód",
|
|
283
283
|
"verificationCode": "Overovací kód"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "Pridajte odstavce, informácie alebo krátke poznámky do svojho formulára."
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "odstavec, informácie, krátke poznámky"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "Več izbire",
|
|
69
69
|
"scf": "Enojna izbira",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "Navodila",
|
|
71
71
|
"drf": "Spustni meni",
|
|
72
72
|
"qif": "Več vrstic besedila",
|
|
73
73
|
"nif": "Ime",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "Verifikacijska koda je bila poslana v vašo poštno shramba. Niste prejeli kode? <button>Ponovno pošlji verifikacijsko kodo</button>",
|
|
282
282
|
"sendCode": "Pošlji kodo",
|
|
283
283
|
"verificationCode": "Verifikacijska koda"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "Dodajte odstavke, informacije ali kratke opombe v svoj obrazec."
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "odstavek, informacije, kratke opombe"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "Flera val",
|
|
69
69
|
"scf": "Enkel val",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "Instruktioner",
|
|
71
71
|
"drf": "Rullgardinsmeny",
|
|
72
72
|
"qif": "Flera raders text",
|
|
73
73
|
"nif": "Namn",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "En verifieringskod har skickats till din inkorg. Fick du inte en kod? <button>Skicka verifieringskod igen</button>",
|
|
282
282
|
"sendCode": "Skicka kod",
|
|
283
283
|
"verificationCode": "Verifieringskod"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "Lägg till stycken, information eller korta anteckningar till ditt formulär."
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "stycke, information, korta anteckningar"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "ทางเลือกหลายทาง",
|
|
69
69
|
"scf": "ทางเลือกเดียว",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "คำแนะนำ",
|
|
71
71
|
"drf": "แบบเลื่อนลง",
|
|
72
72
|
"qif": "ข้อความหลายบรรทัด",
|
|
73
73
|
"nif": "ชื่อ",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "รหัสยืนยันได้ถูกส่งไปยังกล่องขาเข้าแล้ว ไม่ได้รับรหัส? <button>ส่งรหัสยืนยันซ้ำ</button>",
|
|
282
282
|
"sendCode": "ส่งรหัส",
|
|
283
283
|
"verificationCode": "รหัสยืนยัน"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "เพิ่มย่อหน้า ข้อมูล หรือบันทัดสั้นๆ ลงในแบบฟอร์มของคุณ。"
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "ย่อหน้า ข้อมูล บันทัดสั้นๆ"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "Çoklu seçim",
|
|
69
69
|
"scf": "Tek seçim",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "Talimatlar",
|
|
71
71
|
"drf": "Açılır menü",
|
|
72
72
|
"qif": "Birden fazla satır metin",
|
|
73
73
|
"nif": "İsim",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "Bir doğrulama kodu gelen kutunuza gönderildi. Kod almadınız mı? <button>Doğrulama kodunu yeniden gönder</button>",
|
|
282
282
|
"sendCode": "Kodu gönder",
|
|
283
283
|
"verificationCode": "Doğrulama kodu"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "Formunuza paragraflar, bilgi veya kısa notlar ekleyin."
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "paragraf, bilgi, kısa notlar"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "Багатократний вибір",
|
|
69
69
|
"scf": "Один вибір",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "Інструкції",
|
|
71
71
|
"drf": "Випадаючий список",
|
|
72
72
|
"qif": "Багаторядковий текст",
|
|
73
73
|
"nif": "Ім'я",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "Код перевірки надіслано на вашу поштову скриньку. Не отримали код? <button>Повторно надішліть код перевірки</button>",
|
|
282
282
|
"sendCode": "Надіслати код",
|
|
283
283
|
"verificationCode": "Код перевірки"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "Додайте абзаци, інформацію або короткі нотатки до вашої форми."
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "абзац, інформація, короткі нотатки"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "Lựa chọn nhiều",
|
|
69
69
|
"scf": "Lựa chọn đơn",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "Hướng dẫn",
|
|
71
71
|
"drf": "Danh sách xổ xuống",
|
|
72
72
|
"qif": "Văn bản nhiều dòng",
|
|
73
73
|
"nif": "Tên",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "Mã xác minh đã được gửi đến hộp thư của bạn. Chưa nhận được mã? <button>Gửi lại mã xác minh</button>",
|
|
282
282
|
"sendCode": "Gửi mã",
|
|
283
283
|
"verificationCode": "Mã xác minh"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "Thêm đoạn văn, thông tin hoặc ghi chú ngắn vào biểu mẫu của bạn."
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "đoạn văn, thông tin, ghi chú ngắn"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "多项选择",
|
|
69
69
|
"scf": "单项选择",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "说明",
|
|
71
71
|
"drf": "下拉菜单",
|
|
72
72
|
"qif": "多行文本",
|
|
73
73
|
"nif": "姓名",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "验证代码已发送到您的收件箱。没有收到代码? <button>重新发送验证代码</button>",
|
|
282
282
|
"sendCode": "发送代码",
|
|
283
283
|
"verificationCode": "验证代码"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "在表单中添加段落、信息或简短备注。"
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "段落,信息,短备注"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fields": {
|
|
68
68
|
"mcf": "多選",
|
|
69
69
|
"scf": "單選",
|
|
70
|
-
"def": "
|
|
70
|
+
"def": "說明",
|
|
71
71
|
"drf": "下拉菜單",
|
|
72
72
|
"qif": "多行文本",
|
|
73
73
|
"nif": "姓名",
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"resendCode": "驗證代碼已發送到您的收件箱。沒有收到代碼? <button>重新發送驗證代碼</button>",
|
|
282
282
|
"sendCode": "發送代碼",
|
|
283
283
|
"verificationCode": "驗證代碼"
|
|
284
|
+
},
|
|
285
|
+
"questionTooltips": {
|
|
286
|
+
"def": "在您的表單中加入段落、信息或簡短說明。"
|
|
287
|
+
},
|
|
288
|
+
"questionAliases": {
|
|
289
|
+
"def": "段落, 信息, 簡短說明"
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
}
|
|
292
|
+
}
|
package/dist/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-
|
|
1
|
+
Built at 2026-05-08T05:05:46.191Z
|
package/dist/BuildForm.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isPresent, truncate, findBy, isNotPresent, slugify, existsBy, findById,
|
|
|
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
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-Cj0XxE8a.js';
|
|
7
|
-
import { j as QUESTION_ACTIONS, k as INDEPENDENT_LABELS_MAP, l as buildDisplayLabel, m as isElementOverflowing, n as Drag, 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, Q 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, Y as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, Z as MINIMUM_OPTIONS, _ as IMAGE_HEIGHT_SLIDER_DEFAULTS, $ as RATING_OPTIONS, a0 as STAR_RATING_MIN_VALUE_OPTIONS, a1 as STAR_RATING_MAX_VALUE_OPTIONS, a2 as STAR_RATING_ICONS_MAP, a3 as buildDisabledAddButtonHelpPopoverProps, a4 as buildReorderPayload, a5 as QUESTIONS_INITIAL_VALUE, a6 as isMandatoryField, a7 as QUESTION_KINDS, a as QUESTION_KIND, a8 as getActiveQuestionKindDetails, a9 as DEFAULT_AVAILABLE_LANGUAGES, aa as DEFAULT_ADVANCED_FEATURES } from './yup-
|
|
7
|
+
import { j as QUESTION_ACTIONS, k as INDEPENDENT_LABELS_MAP, l as buildDisplayLabel, m as isElementOverflowing, n as Drag, 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, Q 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, Y as OPINION_SCALE_MAX_VALUE_OPTIONS, D as DEFAULT_CHOICE_QUESTION_ATTRIBUTES, Z as MINIMUM_OPTIONS, _ as IMAGE_HEIGHT_SLIDER_DEFAULTS, $ as RATING_OPTIONS, a0 as STAR_RATING_MIN_VALUE_OPTIONS, a1 as STAR_RATING_MAX_VALUE_OPTIONS, a2 as STAR_RATING_ICONS_MAP, a3 as buildDisabledAddButtonHelpPopoverProps, a4 as buildReorderPayload, a5 as QUESTIONS_INITIAL_VALUE, a6 as isMandatoryField, a7 as QUESTION_KINDS, a as QUESTION_KIND, a8 as getActiveQuestionKindDetails, a9 as DEFAULT_AVAILABLE_LANGUAGES, aa as DEFAULT_ADVANCED_FEATURES } from './yup-CBPWSDXh.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';
|
|
@@ -21,9 +21,9 @@ import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
|
21
21
|
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
22
22
|
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
23
23
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
24
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
24
25
|
import { i as isFunction, f as fieldWithFallback, c as isNameQuestion } from './index-DhtQJpD_.js';
|
|
25
26
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
26
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
27
27
|
import { t } from 'i18next';
|
|
28
28
|
import { v4 } from 'uuid';
|
|
29
29
|
import NoData from '@bigbinary/neetoui/NoData';
|
|
@@ -58,6 +58,28 @@ import Slider from '@bigbinary/neetoui/Slider';
|
|
|
58
58
|
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
59
59
|
import '@bigbinary/neeto-commons-frontend/constants';
|
|
60
60
|
import 'axios';
|
|
61
|
+
import '@bigbinary/neeto-icons/Address';
|
|
62
|
+
import '@bigbinary/neeto-icons/Calendar';
|
|
63
|
+
import '@bigbinary/neeto-icons/Captcha';
|
|
64
|
+
import '@bigbinary/neeto-icons/Checkbox';
|
|
65
|
+
import '@bigbinary/neeto-icons/DropdownClosed';
|
|
66
|
+
import '@bigbinary/neeto-icons/Email';
|
|
67
|
+
import '@bigbinary/neeto-icons/FileUpload';
|
|
68
|
+
import '@bigbinary/neeto-icons/Group';
|
|
69
|
+
import '@bigbinary/neeto-icons/Hash';
|
|
70
|
+
import '@bigbinary/neeto-icons/Header';
|
|
71
|
+
import '@bigbinary/neeto-icons/Location';
|
|
72
|
+
import '@bigbinary/neeto-icons/LongText';
|
|
73
|
+
import '@bigbinary/neeto-icons/MessageSquare';
|
|
74
|
+
import '@bigbinary/neeto-icons/NeetoInvisible';
|
|
75
|
+
import '@bigbinary/neeto-icons/PhoneRing';
|
|
76
|
+
import '@bigbinary/neeto-icons/Radio';
|
|
77
|
+
import '@bigbinary/neeto-icons/Rating';
|
|
78
|
+
import '@bigbinary/neeto-icons/Scale';
|
|
79
|
+
import '@bigbinary/neeto-icons/Sms';
|
|
80
|
+
import '@bigbinary/neeto-icons/Terms';
|
|
81
|
+
import '@bigbinary/neeto-icons/TextLines';
|
|
82
|
+
import '@bigbinary/neeto-icons/UserRoundedRect';
|
|
61
83
|
import 'dompurify';
|
|
62
84
|
import '@bigbinary/neeto-icons/Plus';
|
|
63
85
|
import 'zustand';
|
|
@@ -278,7 +300,9 @@ var Card = function Card(_ref) {
|
|
|
278
300
|
onEdit = _ref.onEdit,
|
|
279
301
|
onClone = _ref.onClone,
|
|
280
302
|
onDelete = _ref.onDelete,
|
|
281
|
-
canManageQuestions = _ref.canManageQuestions
|
|
303
|
+
canManageQuestions = _ref.canManageQuestions,
|
|
304
|
+
_ref$extraMenuItems = _ref.extraMenuItems,
|
|
305
|
+
extraMenuItems = _ref$extraMenuItems === void 0 ? [] : _ref$extraMenuItems;
|
|
282
306
|
var _useState = useState(false),
|
|
283
307
|
_useState2 = _slicedToArray(_useState, 2),
|
|
284
308
|
isTooltipEnabled = _useState2[0],
|
|
@@ -344,7 +368,7 @@ var Card = function Card(_ref) {
|
|
|
344
368
|
label: t("neetoForm.common.clone"),
|
|
345
369
|
isVisible: !isSingular && isFunction(onClone),
|
|
346
370
|
onClick: onClone
|
|
347
|
-
}, {
|
|
371
|
+
}].concat(_toConsumableArray(extraMenuItems), [{
|
|
348
372
|
"data-testid": "delete-question",
|
|
349
373
|
key: "delete",
|
|
350
374
|
label: t("neetoForm.common.delete"),
|
|
@@ -352,19 +376,20 @@ var Card = function Card(_ref) {
|
|
|
352
376
|
onClick: function onClick() {
|
|
353
377
|
return onDelete(question);
|
|
354
378
|
}
|
|
355
|
-
}]
|
|
379
|
+
}])
|
|
356
380
|
})]
|
|
357
381
|
})]
|
|
358
382
|
});
|
|
359
383
|
};
|
|
360
384
|
|
|
361
|
-
function ownKeys$
|
|
362
|
-
function _objectSpread$
|
|
385
|
+
function ownKeys$j(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; }
|
|
386
|
+
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$j(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$j(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
363
387
|
var Questions = function Questions(_ref) {
|
|
364
388
|
var questions = _ref.questions,
|
|
365
389
|
isDeletable = _ref.isDeletable,
|
|
366
390
|
allQuestionKinds = _ref.allQuestionKinds,
|
|
367
391
|
getActiveKindDetails = _ref.getActiveKindDetails,
|
|
392
|
+
getQuestionMenuExtras = _ref.getQuestionMenuExtras,
|
|
368
393
|
selectedQuestion = _ref.selectedQuestion,
|
|
369
394
|
onEdit = _ref.onEdit,
|
|
370
395
|
onClone = _ref.onClone,
|
|
@@ -378,7 +403,7 @@ var Questions = function Questions(_ref) {
|
|
|
378
403
|
var droppableProps = _ref2.droppableProps,
|
|
379
404
|
placeholder = _ref2.placeholder,
|
|
380
405
|
innerRef = _ref2.innerRef;
|
|
381
|
-
return /*#__PURE__*/jsxs("div", _objectSpread$
|
|
406
|
+
return /*#__PURE__*/jsxs("div", _objectSpread$j(_objectSpread$j({}, droppableProps), {}, {
|
|
382
407
|
className: "space-y-2",
|
|
383
408
|
ref: innerRef,
|
|
384
409
|
children: [questions.map(function (question, index) {
|
|
@@ -389,10 +414,11 @@ var Questions = function Questions(_ref) {
|
|
|
389
414
|
isDragDisabled: !canManageQuestions,
|
|
390
415
|
key: "question-".concat((_question$id2 = question.id) !== null && _question$id2 !== void 0 ? _question$id2 : question.nodeId)
|
|
391
416
|
}, function (_ref3) {
|
|
417
|
+
var _getQuestionMenuExtra;
|
|
392
418
|
var draggableProps = _ref3.draggableProps,
|
|
393
419
|
dragHandleProps = _ref3.dragHandleProps,
|
|
394
420
|
innerRef = _ref3.innerRef;
|
|
395
|
-
return /*#__PURE__*/jsx("div", _objectSpread$
|
|
421
|
+
return /*#__PURE__*/jsx("div", _objectSpread$j(_objectSpread$j(_objectSpread$j({}, draggableProps), dragHandleProps), {}, {
|
|
396
422
|
ref: innerRef,
|
|
397
423
|
children: /*#__PURE__*/jsx(Card, {
|
|
398
424
|
allQuestionKinds: allQuestionKinds,
|
|
@@ -402,6 +428,7 @@ var Questions = function Questions(_ref) {
|
|
|
402
428
|
onEdit: onEdit,
|
|
403
429
|
onSelect: onSelect,
|
|
404
430
|
question: question,
|
|
431
|
+
extraMenuItems: (_getQuestionMenuExtra = getQuestionMenuExtras === null || getQuestionMenuExtras === void 0 ? void 0 : getQuestionMenuExtras(question)) !== null && _getQuestionMenuExtra !== void 0 ? _getQuestionMenuExtra : [],
|
|
405
432
|
isActive: equals(selectedQuestion, question),
|
|
406
433
|
onDelete: isDeletable(question) && onDelete
|
|
407
434
|
})
|
|
@@ -426,8 +453,8 @@ var arrayHelpers = {
|
|
|
426
453
|
};
|
|
427
454
|
|
|
428
455
|
var _excluded$b = ["fields"];
|
|
429
|
-
function ownKeys$
|
|
430
|
-
function _objectSpread$
|
|
456
|
+
function ownKeys$i(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; }
|
|
457
|
+
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
431
458
|
var isChoiceQuestion = function isChoiceQuestion(question) {
|
|
432
459
|
return includes(question === null || question === void 0 ? void 0 : question.kind, SELECTABLE_KINDS);
|
|
433
460
|
};
|
|
@@ -512,7 +539,7 @@ var handleFieldDragEnd = function handleFieldDragEnd(_ref4) {
|
|
|
512
539
|
var nextItems = _toConsumableArray(items);
|
|
513
540
|
arrayHelpers.moveItem(nextItems, source.index, destination.index);
|
|
514
541
|
var orderedItems = nextItems.map(function (item, index) {
|
|
515
|
-
return _objectSpread$
|
|
542
|
+
return _objectSpread$i(_objectSpread$i({}, item), {}, {
|
|
516
543
|
displayOrder: index
|
|
517
544
|
});
|
|
518
545
|
});
|
|
@@ -534,7 +561,7 @@ var createFieldData = function createFieldData(_ref5) {
|
|
|
534
561
|
selectedLanguage: selectedLanguage,
|
|
535
562
|
isUsingDefaultQuestionKinds: isUsingDefaultQuestionKinds
|
|
536
563
|
});
|
|
537
|
-
return _objectSpread$
|
|
564
|
+
return _objectSpread$i(_objectSpread$i(_objectSpread$i({}, modifiedDefaultValues), {}, {
|
|
538
565
|
metadata: metadata
|
|
539
566
|
}, typeof isRequired === "boolean" && {
|
|
540
567
|
isRequired: isRequired
|
|
@@ -566,7 +593,7 @@ var duplicateFieldData = function duplicateFieldData(_ref6) {
|
|
|
566
593
|
var newQuestionLabel = isRichTextQuestion(kind) ? label : t("neetoForm.common.clonedElementLabel", {
|
|
567
594
|
label: label
|
|
568
595
|
});
|
|
569
|
-
return _objectSpread$
|
|
596
|
+
return _objectSpread$i(_objectSpread$i({}, defaultAttributes), {}, {
|
|
570
597
|
isRequired: isRequired,
|
|
571
598
|
kind: kind,
|
|
572
599
|
label: newQuestionLabel,
|
|
@@ -679,9 +706,34 @@ var useHelpDoc = function useHelpDoc(key) {
|
|
|
679
706
|
return useBuildFormStore(path(["formState", "helpDocUrls", key]));
|
|
680
707
|
};
|
|
681
708
|
|
|
709
|
+
var KindOption = function KindOption(_ref) {
|
|
710
|
+
var label = _ref.label,
|
|
711
|
+
description = _ref.description,
|
|
712
|
+
Icon = _ref.icon;
|
|
713
|
+
return /*#__PURE__*/jsxs("div", {
|
|
714
|
+
className: "flex items-start gap-2",
|
|
715
|
+
children: [Icon && /*#__PURE__*/jsx(Icon, {
|
|
716
|
+
className: "neeto-ui-text-gray-700 mt-0.5 shrink-0",
|
|
717
|
+
"data-testid": "kind-option-icon",
|
|
718
|
+
size: 16
|
|
719
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
720
|
+
className: "flex min-w-0 flex-col",
|
|
721
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
722
|
+
style: "body2",
|
|
723
|
+
children: label
|
|
724
|
+
}), description && /*#__PURE__*/jsx(Typography, {
|
|
725
|
+
className: "neeto-ui-text-gray-600 mt-0.5",
|
|
726
|
+
"data-testid": "kind-option-description",
|
|
727
|
+
style: "body3",
|
|
728
|
+
children: description
|
|
729
|
+
})]
|
|
730
|
+
})]
|
|
731
|
+
});
|
|
732
|
+
};
|
|
733
|
+
|
|
682
734
|
var _excluded$a = ["label", "name"];
|
|
683
|
-
function ownKeys$
|
|
684
|
-
function _objectSpread$
|
|
735
|
+
function ownKeys$h(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; }
|
|
736
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
685
737
|
var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
686
738
|
var label = _ref.label,
|
|
687
739
|
name = _ref.name,
|
|
@@ -700,7 +752,7 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
700
752
|
var end = element.value.length;
|
|
701
753
|
element.setSelectionRange(end, end);
|
|
702
754
|
};
|
|
703
|
-
return /*#__PURE__*/jsx(Textarea$1, _objectSpread$
|
|
755
|
+
return /*#__PURE__*/jsx(Textarea$1, _objectSpread$h({
|
|
704
756
|
label: label,
|
|
705
757
|
name: name,
|
|
706
758
|
className: "neeto-form-nano-adaptive-input",
|
|
@@ -714,8 +766,8 @@ var FormikAdaptiveInput = function FormikAdaptiveInput(_ref) {
|
|
|
714
766
|
}, otherProps));
|
|
715
767
|
};
|
|
716
768
|
|
|
717
|
-
function ownKeys$
|
|
718
|
-
function _objectSpread$
|
|
769
|
+
function ownKeys$g(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; }
|
|
770
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
719
771
|
var LabelWithPlaceholder = function LabelWithPlaceholder(_ref) {
|
|
720
772
|
var kind = _ref.kind,
|
|
721
773
|
isLabelDisabled = _ref.isLabelDisabled,
|
|
@@ -729,14 +781,14 @@ var LabelWithPlaceholder = function LabelWithPlaceholder(_ref) {
|
|
|
729
781
|
var shouldShowPlaceholder = includes(kind, QUESTIONS_WITH_PLACEHOLDERS);
|
|
730
782
|
return /*#__PURE__*/jsxs("div", {
|
|
731
783
|
className: "space-y-4",
|
|
732
|
-
children: [/*#__PURE__*/jsx(FormikAdaptiveInput, _objectSpread$
|
|
784
|
+
children: [/*#__PURE__*/jsx(FormikAdaptiveInput, _objectSpread$g({
|
|
733
785
|
required: true,
|
|
734
786
|
disabled: isLabelDisabled,
|
|
735
787
|
label: t("neetoForm.questions.common.questionFields.field.question"),
|
|
736
788
|
name: "label",
|
|
737
789
|
placeholder: DEFAULT_PLACEHOLDERS[kind],
|
|
738
790
|
onChange: withEventTargetValue(handleLabelChange)
|
|
739
|
-
}, labelProps)), shouldShowPlaceholder && /*#__PURE__*/jsx(FormikAdaptiveInput, _objectSpread$
|
|
791
|
+
}, labelProps)), shouldShowPlaceholder && /*#__PURE__*/jsx(FormikAdaptiveInput, _objectSpread$g({
|
|
740
792
|
className: "neeto-form-nano-placeholder-input neeto-form-nano-placeholder-input-".concat(kind),
|
|
741
793
|
name: "placeholder",
|
|
742
794
|
label: t("neetoForm.questions.common.questionFields.field.placeholder")
|
|
@@ -744,8 +796,8 @@ var LabelWithPlaceholder = function LabelWithPlaceholder(_ref) {
|
|
|
744
796
|
});
|
|
745
797
|
};
|
|
746
798
|
|
|
747
|
-
function ownKeys$
|
|
748
|
-
function _objectSpread$
|
|
799
|
+
function ownKeys$f(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; }
|
|
800
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
749
801
|
var Name = function Name(_ref) {
|
|
750
802
|
var isLabelDisabled = _ref.isLabelDisabled,
|
|
751
803
|
_handleLabelChange = _ref.handleLabelChange;
|
|
@@ -765,7 +817,7 @@ var Name = function Name(_ref) {
|
|
|
765
817
|
label: t("neetoForm.common.splitAsFirstAndLastNames"),
|
|
766
818
|
name: "isSplitMode"
|
|
767
819
|
}), isSplitMode && !usesCustomSubmissionComponent ? /*#__PURE__*/jsxs(Fragment, {
|
|
768
|
-
children: [/*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$
|
|
820
|
+
children: [/*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$f(_objectSpread$f({}, commonProps), {}, {
|
|
769
821
|
handleLabelChange: function handleLabelChange(value) {
|
|
770
822
|
return _handleLabelChange(value, LABEL_FIELDS.FIRST_NAME);
|
|
771
823
|
},
|
|
@@ -777,7 +829,7 @@ var Name = function Name(_ref) {
|
|
|
777
829
|
label: t("neetoForm.questions.common.questionFields.field.firstNamePlaceholder"),
|
|
778
830
|
name: "firstNamePlaceholder"
|
|
779
831
|
}
|
|
780
|
-
})), /*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$
|
|
832
|
+
})), /*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$f(_objectSpread$f({}, commonProps), {}, {
|
|
781
833
|
handleLabelChange: function handleLabelChange(value) {
|
|
782
834
|
return _handleLabelChange(value, LABEL_FIELDS.LAST_NAME);
|
|
783
835
|
},
|
|
@@ -790,7 +842,7 @@ var Name = function Name(_ref) {
|
|
|
790
842
|
name: "lastNamePlaceholder"
|
|
791
843
|
}
|
|
792
844
|
}))]
|
|
793
|
-
}) : /*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$
|
|
845
|
+
}) : /*#__PURE__*/jsx(LabelWithPlaceholder, _objectSpread$f(_objectSpread$f({}, commonProps), {}, {
|
|
794
846
|
labelProps: {
|
|
795
847
|
name: LABEL_FIELDS.FULL_NAME
|
|
796
848
|
},
|
|
@@ -935,8 +987,8 @@ var RequiredSwitch = withT(function (_ref) {
|
|
|
935
987
|
});
|
|
936
988
|
|
|
937
989
|
var _excluded$9 = ["maxLength"];
|
|
938
|
-
function ownKeys$
|
|
939
|
-
function _objectSpread$
|
|
990
|
+
function ownKeys$e(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; }
|
|
991
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
940
992
|
var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
941
993
|
var maxLength = _ref.maxLength,
|
|
942
994
|
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
@@ -950,7 +1002,7 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
950
1002
|
}
|
|
951
1003
|
}, [value, maxLength, setValue]);
|
|
952
1004
|
var shouldShowMaxLength = value && value.length > maxLength - 10;
|
|
953
|
-
return /*#__PURE__*/jsx(Input, _objectSpread$
|
|
1005
|
+
return /*#__PURE__*/jsx(Input, _objectSpread$e(_objectSpread$e({}, props), shouldShowMaxLength && {
|
|
954
1006
|
maxLength: maxLength
|
|
955
1007
|
}));
|
|
956
1008
|
};
|
|
@@ -1010,6 +1062,8 @@ var Textarea = function Textarea() {
|
|
|
1010
1062
|
});
|
|
1011
1063
|
};
|
|
1012
1064
|
|
|
1065
|
+
function ownKeys$d(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; }
|
|
1066
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1013
1067
|
var Form$1 = function Form(_ref) {
|
|
1014
1068
|
var questions = _ref.questions,
|
|
1015
1069
|
initialFocusRef = _ref.initialFocusRef,
|
|
@@ -1131,10 +1185,15 @@ var Form$1 = function Form(_ref) {
|
|
|
1131
1185
|
isClearable: true,
|
|
1132
1186
|
isSearchable: true,
|
|
1133
1187
|
defaultValue: buildDefaultValueForKind(questionKind),
|
|
1188
|
+
filterOption: filterKindOption,
|
|
1134
1189
|
innerRef: initialFocusRef,
|
|
1135
1190
|
isDisabled: isEdit,
|
|
1136
1191
|
name: "kind",
|
|
1137
1192
|
options: buildKindOptions(questionKinds),
|
|
1193
|
+
formatOptionLabel: function formatOptionLabel(option, _ref3) {
|
|
1194
|
+
var context = _ref3.context;
|
|
1195
|
+
return context === "menu" ? /*#__PURE__*/jsx(KindOption, _objectSpread$d({}, option)) : option.label;
|
|
1196
|
+
},
|
|
1138
1197
|
label: t("neetoForm.questions.common.questionFields.field.questionType"),
|
|
1139
1198
|
onChange: handleKindChange
|
|
1140
1199
|
}), isRichTextQuestion(kind) ? /*#__PURE__*/jsxs(Fragment, {
|
|
@@ -2639,16 +2698,31 @@ var getQuestionKind = function getQuestionKind(questionKinds, pattern) {
|
|
|
2639
2698
|
var buildKindOptions = function buildKindOptions(kinds) {
|
|
2640
2699
|
return kinds.map(function (_ref3) {
|
|
2641
2700
|
var label = _ref3.label,
|
|
2642
|
-
type = _ref3.type
|
|
2701
|
+
type = _ref3.type,
|
|
2702
|
+
icon = _ref3.icon,
|
|
2703
|
+
description = _ref3.description,
|
|
2704
|
+
searchTerms = _ref3.searchTerms;
|
|
2643
2705
|
return {
|
|
2644
2706
|
label: label,
|
|
2645
2707
|
value: transformValueForOption({
|
|
2646
2708
|
label: label,
|
|
2647
2709
|
type: type
|
|
2648
|
-
})
|
|
2710
|
+
}),
|
|
2711
|
+
icon: icon,
|
|
2712
|
+
description: description,
|
|
2713
|
+
searchTerms: searchTerms
|
|
2649
2714
|
};
|
|
2650
2715
|
});
|
|
2651
2716
|
};
|
|
2717
|
+
var filterKindOption = function filterKindOption(option, rawInput) {
|
|
2718
|
+
var _option$data$searchTe, _option$data;
|
|
2719
|
+
var query = rawInput === null || rawInput === void 0 ? void 0 : rawInput.trim().toLowerCase();
|
|
2720
|
+
if (!query) return true;
|
|
2721
|
+
var searchTerms = (_option$data$searchTe = (_option$data = option.data) === null || _option$data === void 0 ? void 0 : _option$data.searchTerms) !== null && _option$data$searchTe !== void 0 ? _option$data$searchTe : [];
|
|
2722
|
+
return searchTerms.some(function (term) {
|
|
2723
|
+
return term.includes(query);
|
|
2724
|
+
});
|
|
2725
|
+
};
|
|
2652
2726
|
var extractKindFromOption = pipe(split("-"), last);
|
|
2653
2727
|
var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
|
|
2654
2728
|
return isPresent(questionKind) ? {
|
|
@@ -2790,7 +2864,8 @@ var Form = function Form(_ref) {
|
|
|
2790
2864
|
questionsFromCache = _ref.questionsFromCache,
|
|
2791
2865
|
onMutateSuccess = _ref.onMutateSuccess,
|
|
2792
2866
|
advancedFeatures = _ref.advancedFeatures,
|
|
2793
|
-
isPictureChoiceEnabled = _ref.isPictureChoiceEnabled
|
|
2867
|
+
isPictureChoiceEnabled = _ref.isPictureChoiceEnabled,
|
|
2868
|
+
getQuestionMenuExtras = _ref.getQuestionMenuExtras;
|
|
2794
2869
|
var containerRef = useRef();
|
|
2795
2870
|
var _useStateWithDependen = useStateWithDependency(questionsFromCache),
|
|
2796
2871
|
_useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
|
|
@@ -2979,6 +3054,7 @@ var Form = function Form(_ref) {
|
|
|
2979
3054
|
children: /*#__PURE__*/jsx(Questions, {
|
|
2980
3055
|
canManageQuestions: canManageQuestions,
|
|
2981
3056
|
getActiveKindDetails: getActiveKindDetails,
|
|
3057
|
+
getQuestionMenuExtras: getQuestionMenuExtras,
|
|
2982
3058
|
isDeletable: isDeletable,
|
|
2983
3059
|
questions: questions,
|
|
2984
3060
|
selectedQuestion: selectedQuestion,
|
|
@@ -3064,7 +3140,8 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
3064
3140
|
_ref$canManageQuestio = _ref.canManageQuestions,
|
|
3065
3141
|
canManageQuestions = _ref$canManageQuestio === void 0 ? false : _ref$canManageQuestio,
|
|
3066
3142
|
_ref$isPictureChoiceE = _ref.isPictureChoiceEnabled,
|
|
3067
|
-
isPictureChoiceEnabled = _ref$isPictureChoiceE === void 0 ? false : _ref$isPictureChoiceE
|
|
3143
|
+
isPictureChoiceEnabled = _ref$isPictureChoiceE === void 0 ? false : _ref$isPictureChoiceE,
|
|
3144
|
+
getQuestionMenuExtras = _ref.getQuestionMenuExtras;
|
|
3068
3145
|
var queryClient = useQueryClient();
|
|
3069
3146
|
var _useForm = useForm({
|
|
3070
3147
|
formId: id,
|
|
@@ -3111,6 +3188,7 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
3111
3188
|
formDescription: formDescription,
|
|
3112
3189
|
formTitle: formTitle,
|
|
3113
3190
|
getActiveKindDetails: getActiveKindDetails,
|
|
3191
|
+
getQuestionMenuExtras: getQuestionMenuExtras,
|
|
3114
3192
|
helpDocUrls: helpDocUrls,
|
|
3115
3193
|
hostSpecificData: hostSpecificData,
|
|
3116
3194
|
isDisabledFieldLabel: isDisabledFieldLabel,
|