PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.1.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.1.2
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 3.1.2, at includes/Admin/Form/ScriptFilePriorityManager.php

520 lines 24.6 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 'address' => [
75 ['priority' => 101, 'filename' => 'observeElm.min.js'],
76 ['priority' => 301, 'filename' => 'bit-address-field.min.js'],
77 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
78 ],
79 'country' => [
80 ['priority' => 101, 'filename' => 'observeElm.min.js'],
81 ['priority' => 301, 'filename' => 'bit-country-field.min.js'],
82 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
83 ['priority' => 101, 'filename' => 'observeElm.min.js'],
84 ],
85 'currency' => [
86 ['priority' => 101, 'filename' => 'observeElm.min.js'],
87 ['priority' => 301, 'filename' => 'bit-currency-field.min.js'],
88 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
89 ['priority' => 101, 'filename' => 'observeElm.min.js'],
90 ],
91 'select' => [
92 ['priority' => 101, 'filename' => 'observeElm.min.js'],
93 ['priority' => 301, 'filename' => 'bit-select-field.min.js'],
94 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
95 ['priority' => 101, 'filename' => 'observeElm.min.js'],
96 ],
97 'file-up' => [
98 ['priority' => 301, 'filename' => 'bit-file-up-field.min.js'],
99 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
100 ],
101 'phone-number' => [
102 ['priority' => 101, 'filename' => 'observeElm.min.js'],
103 ['priority' => 301, 'filename' => 'bit-phone-number-field.min.js'],
104 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
105 // ['priority' => 101, 'filename' => 'observeElm.min.js'],
106 ],
107 'section' => [
108 ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
109 ],
110 'repeater' => [
111 ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
112 ['priority' => 102, 'filename' => 'bit-repeater-field.min.js'],
113 ['priority' => 701, 'filename' => 'checkRepeatedField.min.js'],
114 ['priority' => 701, 'filename' => 'isRepeaterField.min.js'],
115 ['priority' => 701, 'filename' => 'getRepeatedIndexes.min.js'],
116 ['priority' => 701, 'filename' => 'getIndexesBaseOnConditions.min.js'],
117 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
118 ],
119 'recaptcha' => [
120 ['priority' => 301, 'filename' => 'bit-recaptcha-field.min.js'],
121 ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
122 ['priority' => 303, 'filename' => 'initRecaptchaFld.min.js'],
123 ],
124 'hcaptcha' => [
125 ['priority' => 301, 'filename' => 'bit-hcaptcha-field.min.js'],
126 ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
127 ['priority' => 303, 'filename' => 'initHCaptchaFld.min.js'],
128 ],
129 'turnstile' => [
130 ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
131 ['priority' => 303, 'filename' => 'initTurnstileFld.min.js'],
132 ],
133 'decision-box' => [
134 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
135 ],
136 'gdpr' => [
137 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
138 ],
139 'rating' => [
140 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
141 ['priority' => 301, 'filename' => 'bit-rating-field.min.js'],
142 ],
143 'date' => [
144 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
145 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
146 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
147 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
148 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
149 ],
150 'datetime-local' => [
151 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
152 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
153 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
154 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
155 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
156 ],
157 'time' => [
158 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
159 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
160 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
161 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
162 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
163 ],
164 'month' => [
165 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
166 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
167 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
168 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
169 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
170 ],
171 'week' => [
172 ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
173 ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
174 ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
175 ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
176 ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
177 ],
178 ];
179
180 /**
181 * Allow add-on plugins (e.g. Pro) to register additional script files
182 * without shipping those files/paths in the wp.org (free) package.
183 */
184 return apply_filters('bitform_script_file_priority_list', $files);
185 }
186
187 public static function getAllFldConfs()
188 {
189 // $contentId = $fieldData['contentId'];
190 // $fieldKey = $fieldData['fk'];
191 // $field = $fieldData['field'];
192 // key is config path, value is field path
193 // var is for variable value
194 // path is for field path [ for multiple paths]
195 // val is for static value
196 $configs = [
197
198 'select' => [
199 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
200 'fieldKey' => ['var' => 'fieldKey'],
201 'options' => ['path' => 'optionsList'],
202 'placeholder' => ['path' => 'ph'],
203 'classNames' => ['path' => 'customClasses'],
204 'attributes' => ['path' => 'customAttributes'],
205 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
206 'separator' => ['val' => BITFORMS_BF_SEPARATOR],
207 'multipleSelect' => ['path' => 'config->multipleSelect', 'val' => false],
208 'showChip' => ['path' => 'config->showChip', 'val' => false],
209 'selectedOptClearable' => ['path' => 'config->selectedOptClearable', 'val' => true],
210 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
211 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
212 'activeList' => ['path' => 'config->activeList', 'val' => 0],
213 ],
214 'address' => [
215 'config' => (object) [],
216 'fieldKey' => ['var' => 'fieldKey'],
217 'contentId' => ['var' => 'contentId'],
218 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/address/'],
219 'fieldName' => ['path' => 'fieldName'],
220 'classNames' => ['path' => 'customClasses'],
221 'attributes' => ['path' => 'customAttributes'],
222 'defaultCountry' => ['path' => 'config->defaultCountry', 'val' => ''],
223 'zipValidation' => ['path' => 'config->zipValidation', 'val' => 'auto'],
224 'zipCustomRegex' => ['path' => 'config->zipCustomRegex', 'val' => ''],
225
226 ],
227 'country' => [
228 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
229 'fieldKey' => ['var' => 'fieldKey'],
230 'options' => ['path' => 'options'],
231 'placeholder' => ['path' => 'ph'],
232 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
233 'classNames' => ['path' => 'customClasses'],
234 'attributes' => ['path' => 'customAttributes'],
235 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
236 'selectedCountryClearable' => ['path' => 'config->selectedCountryClearable', 'val' => true],
237 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
238 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
239 ],
240 'currency' => [
241 'config' => (object) [], // sentinel: blocks raw fldData.config
242 'fieldKey' => ['var' => 'fieldKey'],
243 'options' => ['path' => 'options'],
244 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
245 'classNames' => ['path' => 'customClasses'],
246 'attributes' => ['path' => 'customAttributes'],
247 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
248 'selectedCurrencyClearable' => ['path' => 'config->selectedCurrencyClearable', 'val' => true],
249 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
250 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
251 ],
252 'phone-number' => [
253 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
254 'fieldKey' => ['var' => 'fieldKey'],
255 'options' => ['path' => 'options'],
256 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
257 'classNames' => ['path' => 'customClasses'],
258 'attributes' => ['path' => 'customAttributes'],
259 'contentId' => ['var' => 'contentId'],
260 'selectedCountryClearable' => ['path' => 'config->selectedCountryClearable', 'val' => true],
261 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
262 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
263 ],
264 'file-up' => [
265 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
266 'fieldKey' => ['var' => 'fieldKey'],
267 'formID' => ['var' => 'formId'],
268 'maxSizeErrMsg' => ['path' => ['err->maxSize->msg', 'err->maxSize->dflt']],
269 'minFileErrMsg' => ['path' => ['err->minFile->msg', 'err->minFile->dflt']],
270 'maxFileErrMsg' => ['path' => ['err->maxFile->msg', 'err->maxFile->dflt']],
271 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload/'],
272 'classNames' => ['path' => 'customClasses'],
273 'attributes' => ['path' => 'customAttributes'],
274 'fieldName' => ['path' => 'fieldName'],
275 'contentId' => ['var' => 'contentId'],
276 'multiple' => ['path' => 'config->multiple', 'val' => false],
277 'allowMaxSize' => ['path' => 'config->allowMaxSize', 'val' => false],
278 'maxSize' => ['path' => 'config->maxSize', 'val' => 0],
279 'sizeUnit' => ['path' => 'config->sizeUnit', 'val' => 'KB'],
280 'isItTotalMax' => ['path' => 'config->isItTotalMax', 'val' => false],
281 'allowedFileType' => ['path' => 'config->allowedFileType', 'val' => ''],
282 'minFile' => ['path' => 'config->minFile', 'val' => 0],
283 'maxFile' => ['path' => 'config->maxFile', 'val' => 0],
284 'showSelectStatus' => ['path' => 'config->showSelectStatus', 'val' => false],
285 'fileSelectStatus' => ['path' => 'config->fileSelectStatus', 'val' => 'No File Selected'],
286 'fileExistMsg' => ['val' => 'A file already exist'],
287 'showFileList' => ['path' => 'config->showFileList', 'val' => false],
288 'showFilePreview' => ['path' => 'config->showFilePreview', 'val' => false],
289 'showFileSize' => ['path' => 'config->showFileSize', 'val' => false],
290 'fileExistMsg' => ['path' => 'config->fileExistMsg', 'val' => 'A file already exist'],
291 ],
292 'repeater' => [
293 'config' => (object) [],
294 'fieldKey' => ['var' => 'fieldKey'],
295 'fieldName' => ['path' => 'fieldName'],
296 'contentId' => ['var' => 'contentId'],
297 'showAddBtn' => ['path' => 'addBtn->show', 'val' => false],
298 'showAddToEndBtn' => ['path' => 'addToEndBtn->show', 'val' => false],
299 'defaultValue' => ['path' => 'val', 'val' => ''],
300 ],
301 'rating' => [
302 'fieldKey' => ['var' => 'fieldKey'],
303 'contentId' => ['var' => 'contentId'],
304 'options' => ['path' => 'opt'],
305 'selectedRating' => ['path' => 'selectedRating'],
306 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
307 ],
308 'hcaptcha'=> [
309 'fieldKey' => ['var'=>'fieldKey']
310 ],
311 ];
312 /**
313 * Allow add-on plugins to extend field config mappings.
314 */
315 return apply_filters('bitform_field_config_paths', $configs);
316 }
317
318 public static function multiStepFiles()
319 {
320 return [
321 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
322 ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
323 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
324 ['priority' => 700, 'filename' => 'bit-multi-step-form.min.js'],
325 ];
326 }
327
328 public static function conversationalFormFiles()
329 {
330 return [
331 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
332 ['priority' => 700, 'filename' => 'bit-conversational-form.min.js'],
333 ['priority' => 700, 'filename' => 'handleConversationalFormMsg.min.js'],
334 ];
335 }
336
337 public static function frontendScriptFile()
338 {
339 return [
340 'observeElm' => ['priority' => 101, 'filename' => 'observeElm.min.js'],
341 'hidden-token-field' => ['priority' => 300, 'filename' => 'hidden-token-field.min.js'],
342 ];
343 }
344
345 public static function validationAndOtherScriptFile()
346 {
347 $files = [
348 'confirmFldMatch' => ['priority' => 701, 'filename' => 'confirmFldMatch.min.js'],
349 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
350 // 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
351 // 'bfDatetimeFldValidation' => ['priority' => 702, 'filename' => 'bfDatetimeFldValidation.min.js'],
352 'bfParseDateTime' => ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
353 'checkMinMaxValue' => ['priority' => 702, 'filename' => 'checkMinMaxValue.min.js'],
354 'textLengthValidation' => ['priority' => 702, 'filename' => 'textLengthValidation.min.js'],
355 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
356 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
357 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
358 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
359 'advanceFileupFldValidation' => ['priority' => 702, 'filename' => 'advanceFileUpFldValidation.min.js'],
360 'phoneNumberFldValidation' => ['priority' => 702, 'filename' => 'phoneNumberFldValidation.min.js'],
361 'currencyFldValidation' => ['priority' => 702, 'filename' => 'currencyFldValidation.min.js'],
362 'addressZipFldValidation' => ['priority' => 702, 'filename' => 'addressZipFldValidation.min.js'],
363 'generateBackslashPattern' => ['priority' => 700, 'filename' => 'generateBackslashPattern.min.js'],
364 // 'nmbrFldValidation' => ['priority' => 702, 'filename' => 'nmbrFldValidation.min.js'],
365 // 'regexPatternValidation' => ['priority' => 701, 'filename' => 'regexPatternValidation.min.js'], // load before generateBackslashPattern file, then load regexPatternValidation
366 'inputMaskValidation' => ['priority' => 701, 'filename' => 'inputMaskValidation.min.js'], // load before generateBackslashPattern file, then load inputMaskValidation
367 'bit-input-mask' => ['priority' => 701, 'filename' => 'bit-input-mask.min.js'], // load before generateBackslashPattern file, then load bit-input-mask
368 'setBitInputMaskToInput' => ['priority' => 702, 'filename' => 'setBitInputMaskToInput.min.js'], // load before generateBackslashPattern file, then load setBitInputMaskToInput
369 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
370 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
371 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
372 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
373 'resetPlaceholders' => ['priority' => 201, 'filename' => 'resetPlaceholders.min.js'],
374 'bfResetDefaultValue' => ['priority' => 201, 'filename' => 'bfResetDefaultValue.min.js'],
375 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
376 ];
377
378 /**
379 * Allow add-on plugins to register additional validation scripts.
380 */
381 return apply_filters('bitform_validation_and_other_script_files', $files);
382 }
383
384 public static function validationScriptFileMapping($fieldType)
385 {
386 $textTypeField = ['text', 'password', 'username', 'color'];
387 if (in_array($fieldType, $textTypeField)) {
388 $fieldType = 'text';
389 }
390 $fields =
391 [
392 'text' => [
393 'bit-input-mask' => [
394 'paths' => ['valid->inputMask'],
395 ],
396 'inputMaskValidation' => [
397 'paths' => ['valid->inputMask'],
398 'dependencies' => [
399 'generateBackslashPattern',
400 'validation',
401 ]
402 ],
403 'setBitInputMaskToInput' => [
404 'paths' => ['valid->inputMask'],
405 'dependencies' => [
406 'bit-input-mask'
407 ]
408 ],
409 'textLengthValidation' => [
410 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->minword', 'valid->maxword']
411 ],
412 'confirmFldMatch' => [
413 'paths' => ['parentFieldKey'],
414 ]
415
416 ],
417 'textarea' => [
418 'bit-input-mask' => [
419 'paths' => ['valid->inputMask'],
420 ],
421 'inputMaskValidation' => [
422 'paths' => ['valid->inputMask'],
423 'dependencies' => [
424 'generateBackslashPattern',
425 'validation',
426 ]
427 ],
428 'setBitInputMaskToInput' => [
429 'paths' => ['valid->inputMask'],
430 'dependencies' => [
431 'bit-input-mask'
432 ]
433 ],
434 'textLengthValidation' => [
435 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->minword', 'valid->maxword']
436 ]
437 ],
438 'email' => [
439 'emailFldValidation' => [
440 'paths' => ['err->invalid->show'],
441 'dependencies' => [
442 'generateBackslashPattern'
443 ]
444 ],
445 'confirmFldMatch' => [
446 'paths' => ['parentFieldKey'],
447 ]
448 ],
449 'number' => [
450 'nmbrFldValidation' => [
451 'paths' => ['mn', 'mx']
452 ]
453 ],
454 'range' => [
455 'checkMinMaxValue' => [
456 'paths' => ['mn', 'mx']
457 ]
458 ],
459 'url' => [
460 'urlFldValidation' => [
461 'paths' => ['err->invalid->show'],
462 'dependencies' => [
463 'generateBackslashPattern'
464 ]
465 ],
466 'bit-input-mask' => [
467 'paths' => ['valid->inputMask'],
468 ],
469 'inputMaskValidation' => [
470 'paths' => ['valid->inputMask'],
471 'dependencies' => [
472 'generateBackslashPattern',
473 'validation',
474 ]
475 ],
476 'setBitInputMaskToInput' => [
477 'paths' => ['valid->inputMask'],
478 'dependencies' => [
479 'bit-input-mask'
480 ]
481 ]
482 ],
483 'decision-box' => [
484 'dcsnbxFldValidation' => [
485 'paths' => ['valid->req']
486 ]
487 ],
488 'gdpr' => [
489 'dcsnbxFldValidation' => [
490 'paths' => ['valid->req']
491 ]
492 ],
493 'file-up' => [
494 'fileupFldValidation' => [
495 'paths' => ['valid->req']
496 ]
497 ],
498 'phone-number' => [
499 'phoneNumberFldValidation' => [
500 'paths' => ['err->invalid->show'],
501 ]
502 ],
503 'address' => [
504 'addressZipFldValidation' => [
505 'paths' => ['config->zipValidation'],
506 'dependencies' => [
507 'validation',
508 ]
509 ]
510 ],
511 ];
512 $mapping = isset($fields[$fieldType]) ? $fields[$fieldType] : [];
513
514 /**
515 * Allow pro add-ons to extend/override mapping per field type.
516 */
517 return apply_filters('bitform_field_validation_script_file_mapping', $mapping, $fieldType);
518 }
519 }
520