PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.0.3
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.0.3
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / includes / Admin / Form / ScriptFilePriorityManager.php

ScriptFilePriorityManager.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder V3.0.3, at includes/Admin/Form/ScriptFilePriorityManager.php

493 lines 23.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Admin\Form;
4
5 class ScriptFilePriorityManager
6 {
7 public static function jsFile()
8 {
9 /**
10 * file load priority
11 * first priority status code 100
12 * sub status code link 101,102
13 * second priority status code 200
14 * sub status code link 201,202, 203
15 * continue..........
16 * priority = 100 range for helper file
17 * priority = 200 range for field file
18 * priority = 300 range for script file
19 * priority = 400 range for custom script file
20 * priority = 500 range for js init for custom field file
21 * priority = 600 range for js init for CDN field file
22 * Priority = 700 range for validation js file
23 * priority = 800 range for conditional js file
24 * @array [fieldType] => [
25 * priority => 'choose one of the priority status code',
26 * filename => 'fileName',
27 * scriptTyp => 'script' or 'init' or 'custom' by default script
28 * source => 'filePath' or 'url' or 'cdn' or className or customClassName by scriptTyp && by default it will be 'filePath'=> 'assets/js/fileName.js'',
29 * fk => 'field key'
30 * field => 'field object'
31 * ]
32
33 * final priority
34 helper js
35 common js
36 custom field script js
37 init for custom field js
38 inti for CDN field js
39 validation js
40 confirmation js
41 conditional js
42 submit js
43 custom js
44 */
45 $initSource = '\\BitCode\\BitForm\\Admin\\Form\\InitJs\\';
46 $files = [
47 'helperScript' => [
48 ['priority' => 101, 'filename' => 'bfSelect.min.js'],
49 ['priority' => 101, 'filename' => 'bfReset.min.js'],
50 ['priority' => 101, 'filename' => 'setBFMsg.min.js'],
51 ['priority' => 101, 'filename' => 'bfSplit.min.js'],
52 ['priority' => 101, 'filename' => 'scrollToElm.min.js'],
53 ['priority' => 101, 'filename' => 'getFldKeyAndRowIndx.min.js'],
54 ['priority' => 101, 'filename' => 'moveToFirstErrFld.min.js'],
55 ['priority' => 101, 'filename' => 'bfValidationErrMsg.min.js'],
56 ['priority' => 101, 'filename' => 'setHiddenFld.min.js'],
57 ['priority' => 101, 'filename' => 'submit-form.min.js'],
58 ['priority' => 101, 'filename' => 'setStyleProperty.min.js']
59 ],
60
61 'text' => [
62 ['priority' => 301, 'filename' => 'initTextLengthHelper.min.js', 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->maxword', 'valid->minword']],
63 ],
64 'textarea' => [
65 ['priority' => 301, 'filename' => 'initTextLengthHelper.min.js', 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->maxword', 'valid->minword']],
66 ],
67 'range' => [
68 ['priority' => 301, 'filename' => 'setSliderFieldValue.min.js', 'path' => 'showValue'],
69 ],
70 'password' => [
71 ['priority' => 301, 'filename' => 'initPasswordStrengthHelper.min.js', 'path' => 'valid->validations'],
72 ['priority' => 301, 'filename' => 'bfTogglePasswordVisibility.min.js', 'path' => 'config->showPasswordIcon'],
73 ],
74 'country' => [
75 ['priority' => 101, 'filename' => 'observeElm.min.js'],
76 ['priority' => 301, 'filename' => 'bit-country-field.min.js'],
77 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
78 ['priority' => 101, 'filename' => 'observeElm.min.js'],
79 ],
80 'currency' => [
81 ['priority' => 101, 'filename' => 'observeElm.min.js'],
82 ['priority' => 301, 'filename' => 'bit-currency-field.min.js'],
83 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
84 ['priority' => 101, 'filename' => 'observeElm.min.js'],
85 ],
86 'select' => [
87 ['priority' => 101, 'filename' => 'observeElm.min.js'],
88 ['priority' => 301, 'filename' => 'bit-select-field.min.js'],
89 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
90 ['priority' => 101, 'filename' => 'observeElm.min.js'],
91 ],
92 'file-up' => [
93 ['priority' => 301, 'filename' => 'bit-file-up-field.min.js'],
94 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
95 ],
96 'phone-number' => [
97 ['priority' => 101, 'filename' => 'observeElm.min.js'],
98 ['priority' => 301, 'filename' => 'bit-phone-number-field.min.js'],
99 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
100 // ['priority' => 101, 'filename' => 'observeElm.min.js'],
101 ],
102 'section' => [
103 ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
104 ],
105 'repeater' => [
106 ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
107 ['priority' => 102, 'filename' => 'bit-repeater-field.min.js'],
108 ['priority' => 701, 'filename' => 'checkRepeatedField.min.js'],
109 ['priority' => 701, 'filename' => 'isRepeaterField.min.js'],
110 ['priority' => 701, 'filename' => 'getRepeatedIndexes.min.js'],
111 ['priority' => 701, 'filename' => 'getIndexesBaseOnConditions.min.js'],
112 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
113 ],
114 'recaptcha' => [
115 ['priority' => 301, 'filename' => 'bit-recaptcha-field.min.js'],
116 ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
117 ['priority' => 303, 'filename' => 'initRecaptchaFld.min.js'],
118 ],
119 'hcaptcha' => [
120 ['priority' => 301, 'filename' => 'bit-hcaptcha-field.min.js'],
121 ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
122 ['priority' => 303, 'filename' => 'initHCaptchaFld.min.js'],
123 ],
124 'turnstile' => [
125 ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
126 ['priority' => 303, 'filename' => 'initTurnstileFld.min.js'],
127 ],
128 'decision-box' => [
129 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
130 ],
131 'gdpr' => [
132 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
133 ],
134 'rating' => [
135 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
136 ['priority' => 301, 'filename' => 'bit-rating-field.min.js'],
137 ],
138 'date' => [
139 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
140 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
141 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
142 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
143 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
144 ],
145 'datetime-local' => [
146 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
147 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
148 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
149 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
150 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
151 ],
152 'time' => [
153 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
154 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
155 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
156 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
157 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
158 ],
159 'month' => [
160 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
161 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
162 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
163 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
164 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
165 ],
166 'week' => [
167 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
168 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
169 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
170 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
171 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
172 ],
173 ];
174
175 /**
176 * Allow add-on plugins (e.g. Pro) to register additional script files
177 * without shipping those files/paths in the wp.org (free) package.
178 */
179 return apply_filters('bitform_script_file_priority_list', $files);
180 }
181
182 public static function getAllFldConfs()
183 {
184 // $contentId = $fieldData['contentId'];
185 // $fieldKey = $fieldData['fk'];
186 // $field = $fieldData['field'];
187 // key is config path, value is field path
188 // var is for variable value
189 // path is for field path [ for multiple paths]
190 // val is for static value
191 $configs = [
192
193 'select' => [
194 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
195 'fieldKey' => ['var' => 'fieldKey'],
196 'options' => ['path' => 'optionsList'],
197 'placeholder' => ['path' => 'ph'],
198 'classNames' => ['path' => 'customClasses'],
199 'attributes' => ['path' => 'customAttributes'],
200 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
201 'separator' => ['val' => BITFORMS_BF_SEPARATOR],
202 'multipleSelect' => ['path' => 'config->multipleSelect', 'val' => false],
203 'showChip' => ['path' => 'config->showChip', 'val' => false],
204 'selectedOptClearable' => ['path' => 'config->selectedOptClearable', 'val' => true],
205 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
206 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
207 'activeList' => ['path' => 'config->activeList', 'val' => 0],
208 ],
209 'country' => [
210 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
211 'fieldKey' => ['var' => 'fieldKey'],
212 'options' => ['path' => 'options'],
213 'placeholder' => ['path' => 'ph'],
214 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
215 'classNames' => ['path' => 'customClasses'],
216 'attributes' => ['path' => 'customAttributes'],
217 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
218 'selectedCountryClearable' => ['path' => 'config->selectedCountryClearable', 'val' => true],
219 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
220 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
221 ],
222 'currency' => [
223 'config' => (object) [], // sentinel: blocks raw fldData.config
224 'fieldKey' => ['var' => 'fieldKey'],
225 'options' => ['path' => 'options'],
226 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
227 'classNames' => ['path' => 'customClasses'],
228 'attributes' => ['path' => 'customAttributes'],
229 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
230 'selectedCurrencyClearable' => ['path' => 'config->selectedCurrencyClearable', 'val' => true],
231 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
232 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
233 ],
234 'phone-number' => [
235 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
236 'fieldKey' => ['var' => 'fieldKey'],
237 'options' => ['path' => 'options'],
238 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
239 'classNames' => ['path' => 'customClasses'],
240 'attributes' => ['path' => 'customAttributes'],
241 'contentId' => ['var' => 'contentId'],
242 'selectedCountryClearable' => ['path' => 'config->selectedCountryClearable', 'val' => true],
243 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
244 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
245 ],
246 'file-up' => [
247 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
248 'fieldKey' => ['var' => 'fieldKey'],
249 'formID' => ['var' => 'formId'],
250 'maxSizeErrMsg' => ['path' => ['err->maxSize->msg', 'err->maxSize->dflt']],
251 'minFileErrMsg' => ['path' => ['err->minFile->msg', 'err->minFile->dflt']],
252 'maxFileErrMsg' => ['path' => ['err->maxFile->msg', 'err->maxFile->dflt']],
253 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload/'],
254 'classNames' => ['path' => 'customClasses'],
255 'attributes' => ['path' => 'customAttributes'],
256 'fieldName' => ['path' => 'fieldName'],
257 'contentId' => ['var' => 'contentId'],
258 'multiple' => ['path' => 'config->multiple', 'val' => false],
259 'allowMaxSize' => ['path' => 'config->allowMaxSize', 'val' => false],
260 'maxSize' => ['path' => 'config->maxSize', 'val' => 0],
261 'sizeUnit' => ['path' => 'config->sizeUnit', 'val' => 'KB'],
262 'isItTotalMax' => ['path' => 'config->isItTotalMax', 'val' => false],
263 'allowedFileType' => ['path' => 'config->allowedFileType', 'val' => ''],
264 'minFile' => ['path' => 'config->minFile', 'val' => 0],
265 'maxFile' => ['path' => 'config->maxFile', 'val' => 0],
266 'showSelectStatus' => ['path' => 'config->showSelectStatus', 'val' => false],
267 'fileSelectStatus' => ['path' => 'config->fileSelectStatus', 'val' => 'No File Selected'],
268 'fileExistMsg' => ['val' => 'A file already exist'],
269 'showFileList' => ['path' => 'config->showFileList', 'val' => false],
270 'showFilePreview' => ['path' => 'config->showFilePreview', 'val' => false],
271 'showFileSize' => ['path' => 'config->showFileSize', 'val' => false],
272 'fileExistMsg' => ['path' => 'config->fileExistMsg', 'val' => 'A file already exist'],
273 ],
274 'repeater' => [
275 'config' => (object) [],
276 'fieldKey' => ['var' => 'fieldKey'],
277 'fieldName' => ['path' => 'fieldName'],
278 'contentId' => ['var' => 'contentId'],
279 'showAddBtn' => ['path' => 'addBtn->show', 'val' => false],
280 'showAddToEndBtn' => ['path' => 'addToEndBtn->show', 'val' => false],
281 'defaultValue' => ['path' => 'val', 'val' => ''],
282 ],
283 'rating' => [
284 'fieldKey' => ['var' => 'fieldKey'],
285 'contentId' => ['var' => 'contentId'],
286 'options' => ['path' => 'opt'],
287 'selectedRating' => ['path' => 'selectedRating'],
288 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
289 ],
290 'hcaptcha'=> [
291 'fieldKey' => ['var'=>'fieldKey']
292 ],
293 ];
294 /**
295 * Allow add-on plugins to extend field config mappings.
296 */
297 return apply_filters('bitform_field_config_paths', $configs);
298 }
299
300 public static function multiStepFiles()
301 {
302 return [
303 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
304 ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
305 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
306 ['priority' => 700, 'filename' => 'bit-multi-step-form.min.js'],
307 ];
308 }
309
310 public static function conversationalFormFiles()
311 {
312 return [
313 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
314 ['priority' => 700, 'filename' => 'bit-conversational-form.min.js'],
315 ['priority' => 700, 'filename' => 'handleConversationalFormMsg.min.js'],
316 ];
317 }
318
319 public static function frontendScriptFile()
320 {
321 return [
322 'observeElm' => ['priority' => 101, 'filename' => 'observeElm.min.js'],
323 'hidden-token-field' => ['priority' => 300, 'filename' => 'hidden-token-field.min.js'],
324 ];
325 }
326
327 public static function validationAndOtherScriptFile()
328 {
329 $files = [
330 'confirmFldMatch' => ['priority' => 701, 'filename' => 'confirmFldMatch.min.js'],
331 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
332 // 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
333 // 'bfDatetimeFldValidation' => ['priority' => 702, 'filename' => 'bfDatetimeFldValidation.min.js'],
334 'bfParseDateTime' => ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
335 'checkMinMaxValue' => ['priority' => 702, 'filename' => 'checkMinMaxValue.min.js'],
336 'textLengthValidation' => ['priority' => 702, 'filename' => 'textLengthValidation.min.js'],
337 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
338 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
339 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
340 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
341 'advanceFileupFldValidation' => ['priority' => 702, 'filename' => 'advanceFileUpFldValidation.min.js'],
342 'phoneNumberFldValidation' => ['priority' => 702, 'filename' => 'phoneNumberFldValidation.min.js'],
343 'currencyFldValidation' => ['priority' => 702, 'filename' => 'currencyFldValidation.min.js'],
344 'generateBackslashPattern' => ['priority' => 700, 'filename' => 'generateBackslashPattern.min.js'],
345 // 'nmbrFldValidation' => ['priority' => 702, 'filename' => 'nmbrFldValidation.min.js'],
346 // 'regexPatternValidation' => ['priority' => 701, 'filename' => 'regexPatternValidation.min.js'], // load before generateBackslashPattern file, then load regexPatternValidation
347 'inputMaskValidation' => ['priority' => 701, 'filename' => 'inputMaskValidation.min.js'], // load before generateBackslashPattern file, then load inputMaskValidation
348 'bit-input-mask' => ['priority' => 701, 'filename' => 'bit-input-mask.min.js'], // load before generateBackslashPattern file, then load bit-input-mask
349 'setBitInputMaskToInput' => ['priority' => 702, 'filename' => 'setBitInputMaskToInput.min.js'], // load before generateBackslashPattern file, then load setBitInputMaskToInput
350 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
351 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
352 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
353 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
354 'resetPlaceholders' => ['priority' => 201, 'filename' => 'resetPlaceholders.min.js'],
355 'bfResetDefaultValue' => ['priority' => 201, 'filename' => 'bfResetDefaultValue.min.js'],
356 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
357 ];
358
359 /**
360 * Allow add-on plugins to register additional validation scripts.
361 */
362 return apply_filters('bitform_validation_and_other_script_files', $files);
363 }
364
365 public static function validationScriptFileMapping($fieldType)
366 {
367 $textTypeField = ['text', 'password', 'username', 'color'];
368 if (in_array($fieldType, $textTypeField)) {
369 $fieldType = 'text';
370 }
371 $fields =
372 [
373 'text' => [
374 'bit-input-mask' => [
375 'paths' => ['valid->inputMask'],
376 ],
377 'inputMaskValidation' => [
378 'paths' => ['valid->inputMask'],
379 'dependencies' => [
380 'generateBackslashPattern',
381 'validation',
382 ]
383 ],
384 'setBitInputMaskToInput' => [
385 'paths' => ['valid->inputMask'],
386 'dependencies' => [
387 'bit-input-mask'
388 ]
389 ],
390 'textLengthValidation' => [
391 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->minword', 'valid->maxword']
392 ],
393 'confirmFldMatch' => [
394 'paths' => ['parentFieldKey'],
395 ]
396
397 ],
398 'textarea' => [
399 'bit-input-mask' => [
400 'paths' => ['valid->inputMask'],
401 ],
402 'inputMaskValidation' => [
403 'paths' => ['valid->inputMask'],
404 'dependencies' => [
405 'generateBackslashPattern',
406 'validation',
407 ]
408 ],
409 'setBitInputMaskToInput' => [
410 'paths' => ['valid->inputMask'],
411 'dependencies' => [
412 'bit-input-mask'
413 ]
414 ],
415 'textLengthValidation' => [
416 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->minword', 'valid->maxword']
417 ]
418 ],
419 'email' => [
420 'emailFldValidation' => [
421 'paths' => ['err->invalid->show'],
422 'dependencies' => [
423 'generateBackslashPattern'
424 ]
425 ],
426 'confirmFldMatch' => [
427 'paths' => ['parentFieldKey'],
428 ]
429 ],
430 'number' => [
431 'nmbrFldValidation' => [
432 'paths' => ['mn', 'mx']
433 ]
434 ],
435 'range' => [
436 'checkMinMaxValue' => [
437 'paths' => ['mn', 'mx']
438 ]
439 ],
440 'url' => [
441 'urlFldValidation' => [
442 'paths' => ['err->invalid->show'],
443 'dependencies' => [
444 'generateBackslashPattern'
445 ]
446 ],
447 'bit-input-mask' => [
448 'paths' => ['valid->inputMask'],
449 ],
450 'inputMaskValidation' => [
451 'paths' => ['valid->inputMask'],
452 'dependencies' => [
453 'generateBackslashPattern',
454 'validation',
455 ]
456 ],
457 'setBitInputMaskToInput' => [
458 'paths' => ['valid->inputMask'],
459 'dependencies' => [
460 'bit-input-mask'
461 ]
462 ]
463 ],
464 'decision-box' => [
465 'dcsnbxFldValidation' => [
466 'paths' => ['valid->req']
467 ]
468 ],
469 'gdpr' => [
470 'dcsnbxFldValidation' => [
471 'paths' => ['valid->req']
472 ]
473 ],
474 'file-up' => [
475 'fileupFldValidation' => [
476 'paths' => ['valid->req']
477 ]
478 ],
479 'phone-number' => [
480 'phoneNumberFldValidation' => [
481 'paths' => ['err->invalid->show'],
482 ]
483 ],
484 ];
485 $mapping = isset($fields[$fieldType]) ? $fields[$fieldType] : [];
486
487 /**
488 * Allow pro add-ons to extend/override mapping per field type.
489 */
490 return apply_filters('bitform_field_validation_script_file_mapping', $mapping, $fieldType);
491 }
492 }
493