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

512 lines 23.0 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 $customSource = '\\BitCode\\BitForm\\Admin\\Form\\ExtraFieldJS\\';
47 return [
48 'helperScript' => [
49 ['priority' => 101, 'filename' => 'bfSelect.min.js'],
50 ['priority' => 101, 'filename' => 'bfReset.min.js'],
51 ['priority' => 101, 'filename' => 'setBFMsg.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 'range' => [
61 ['priority' => 301, 'filename' => 'SetSliderFieldValue', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'showValue'],
62 ],
63 'country' => [
64 ['priority' => 101, 'filename' => 'observeElm.min.js'],
65 ['priority' => 301, 'filename' => 'bit-country-field.min.js'],
66 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
67 ['priority' => 101, 'filename' => 'observeElm.min.js'],
68 ],
69 'currency' => [
70 ['priority' => 101, 'filename' => 'observeElm.min.js'],
71 ['priority' => 301, 'filename' => 'bit-currency-field.min.js'],
72 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
73 ['priority' => 101, 'filename' => 'observeElm.min.js'],
74 ],
75 'select' => [
76 ['priority' => 101, 'filename' => 'observeElm.min.js'],
77 ['priority' => 301, 'filename' => 'bit-select-field.min.js'],
78 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
79 ['priority' => 101, 'filename' => 'observeElm.min.js'],
80 ],
81 'advanced-file-up' => [
82 ['priority' => 101, 'filename' => 'observeElm.min.js'],
83 ['priority' => 202, 'filename' => 'bit-filepond.min.js'],
84 ['priority' => 301, 'filename' => 'bit-advanced-file-up-field.min.js'],
85 ['priority' => 101, 'filename' => 'advancedFileHandle.min.js'],
86 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
87 ],
88 'file-up' => [
89 ['priority' => 301, 'filename' => 'bit-file-up-field.min.js'],
90 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
91 ],
92 'phone-number' => [
93 ['priority' => 101, 'filename' => 'observeElm.min.js'],
94 ['priority' => 301, 'filename' => 'bit-phone-number-field.min.js'],
95 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
96 ['priority' => 101, 'filename' => 'observeElm.min.js'],
97 ],
98 'paypal' => [
99 ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
100 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
101 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
102 ['priority' => 301, 'filename' => 'bit-paypal-field.min.js'],
103 ],
104 'stripe' => [
105 ['priority' => 201, 'filename' => 'bitsFetchFront.min.js'],
106 ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
107 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
108 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
109 ['priority' => 301, 'filename' => 'bit-stripe-field.min.js'],
110 ],
111 'mollie' => [
112 ['priority' => 201, 'filename' => 'bitsFetchFront.min.js'],
113 ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
114 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
115 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
116 ['priority' => 301, 'filename' => 'bit-mollie-field.min.js'],
117 ],
118 'repeater' => [
119 ['priority' => 102, 'filename' => 'bit-repeater-field.min.js'],
120 ['priority' => 701, 'filename' => 'checkRepeatedField.min.js'],
121 ['priority' => 701, 'filename' => 'isRepeaterField.min.js'],
122 ['priority' => 701, 'filename' => 'getRepeatedIndexes.min.js'],
123 ['priority' => 701, 'filename' => 'getIndexesBaseOnConditions.min.js'],
124 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
125 ],
126 'razorpay' => [
127 ['priority' => 201, 'filename' => 'replaceFieldAndSmartValues.min.js'],
128 ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
129 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
130 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
131 ['priority' => 301, 'filename' => 'bit-razorpay-field.min.js'],
132 ],
133 'radio' => [
134 ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
135 ],
136 'check' => [
137 ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
138 ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
139 ],
140 'image-select' => [
141 ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
142 ],
143 'recaptcha' => [
144 ['priority' => 301, 'filename' => 'bit-recaptcha-field.min.js'],
145 ],
146 'decision-box' => [
147 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
148 ],
149 'gdpr' => [
150 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
151 ],
152 'signature' => [
153 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
154 ['priority' => 301, 'filename' => 'bit-signature-field.min.js'],
155 ],
156 'rating' => [
157 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
158 ['priority' => 301, 'filename' => 'bit-rating-field.min.js'],
159 ],
160 ];
161 }
162
163 public static function filePondPlugins($plugin)
164 {
165 $plugins = [
166 'allowFileSizeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-size.min.js'],
167 'allowFileTypeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-type.min.js'],
168 'allowImageCrop' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-crop.min.js'],
169 'allowImagePreview' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-preview.min.js'],
170 'allowImageResize' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-resize.min.js'],
171 'allowImageTransform' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-transform.min.js'],
172 'allowImageValidateSize' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-validate-size.min.js'],
173 'allowPreview' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-media-preview.min.js'],
174 ];
175 if (array_key_exists($plugin, $plugins)) {
176 return $plugins[$plugin];
177 }
178
179 return false;
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 'select' => [
193 'fieldKey' => ['var' => 'fieldKey'],
194 'options' => ['path' => 'optionsList'],
195 'placeholder' => ['path' => 'ph'],
196 'classNames' => ['path' => 'customClasses'],
197 'attributes' => ['path' => 'customAttributes'],
198 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
199 'separator' => ['val' => BITFORMS_BF_SEPARATOR],
200 'mn' => ['path' => 'mn', 'val' => 0],
201 'mx' => ['path' => 'mx', 'val' => 0],
202 'disableOnMax' => ['path' => 'valid->disableOnMax', 'val' => false],
203 ],
204 'country' => [
205 'fieldKey' => ['var' => 'fieldKey'],
206 'options' => ['path' => 'options'],
207 'placeholder' => ['path' => 'ph'],
208 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
209 'classNames' => ['path' => 'customClasses'],
210 'attributes' => ['path' => 'customAttributes'],
211 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
212 ],
213 'currency' => [
214 'fieldKey' => ['var' => 'fieldKey'],
215 'options' => ['path' => 'options'],
216 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
217 'classNames' => ['path' => 'customClasses'],
218 'attributes' => ['path' => 'customAttributes'],
219 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
220 ],
221 'phone-number' => [
222 'fieldKey' => ['var' => 'fieldKey'],
223 'options' => ['path' => 'options'],
224 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
225 'classNames' => ['path' => 'customClasses'],
226 'attributes' => ['path' => 'customAttributes']
227 ],
228 'file-up' => [
229 'fieldKey' => ['var' => 'fieldKey'],
230 'formID' => ['var' => 'formId'],
231 'maxSizeErrMsg' => ['path' => ['err->maxSize->msg', 'err->maxSize->dflt']],
232 'minFileErrMsg' => ['path' => ['err->minFile->msg', 'err->minFile->dflt']],
233 'maxFileErrMsg' => ['path' => ['err->maxFile->msg', 'err->maxFile->dflt']],
234 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload/'],
235 'classNames' => ['path' => 'customClasses'],
236 'attributes' => ['path' => 'customAttributes'],
237 'fieldName' => ['path' => 'fieldName'],
238 ],
239 'paypal' => [
240 'payIntegID' => ['path' => 'payIntegID'],
241 'style' => ['path' => 'style'],
242 'currency' => ['path' => 'currency', 'val' => 'USD'],
243 'amount' => ['path' => 'amount', 'val' => 0],
244 'amountFld' => ['path' => 'amountFld', 'val' => ''],
245 'shipping' => ['path' => 'shipping', 'val' => 0],
246 'shippingVal' => ['path' => 'shippingFld', 'val' => ''],
247 'tax' => ['path' => 'tax', 'val' => 0],
248 'taxVal' => ['path' => 'taxFld', 'val' => ''],
249 'description' => ['path' => 'description', 'val' => ''],
250 'descFld' => ['path' => 'descFld', 'val' => ''],
251 'payType' => ['path' => 'payType', 'val' => 'payment'],
252 'planId' => ['path' => 'planId', 'val' => ''],
253 'locale' => ['path' => 'locale', 'val' => 'en_US'],
254 'disableFunding' => ['path' => 'disableFunding', 'val' => ''],
255 'fieldKey' => ['var' => 'fieldKey'],
256 'clientId' => ['path' => 'clientId'],
257 'contentId' => ['var' => 'contentId'],
258 'namespace' => ['val' => 'bit-paypal-__$contentId__'],
259 ],
260 'stripe' => [
261 'payIntegID' => ['path' => 'payIntegID'],
262 'locale' => ['path' => 'config->options->locale', 'val' => 'en'],
263 'amountType' => ['path' => 'config->amountType', 'val'=> 'fixed'],
264 'fieldKey' => ['var' => 'fieldKey'],
265 'contentId' => ['var' => 'contentId'],
266 'publishableKey' => ['path' => 'publishableKey'],
267 ],
268 'mollie' => [
269 'payIntegID' => ['path' => 'payIntegID'],
270 'locale' => ['path' => 'config->locale', 'val' => 'en'],
271 'amountType' => ['path' => 'config->amountType', 'val'=> 'fixed'],
272 'fieldKey' => ['var' => 'fieldKey'],
273 'contentId' => ['var' => 'contentId'],
274 'apiKey' => ['path' => 'apiKey'],
275 'payment_method' => ['path' => 'config->payment_method', 'val' => ['creditcard']],
276 'description' => ['path' => 'config->description', 'val' => ''],
277 'amount' => ['path' => 'config->amount', 'val' => 0],
278 'currency' => ['path' => 'config->currency', 'val' => 'EUR'],
279 ],
280 'advanced-file-up' => [
281 'fieldKey' => ['var' => 'fieldKey'],
282 'formID' => ['var' => 'formId'],
283 'configSetting' => ['path' => 'config'],
284 'ajaxURL' => ['val' => admin_url('admin-ajax.php')],
285 'nonce' => ['val' => wp_create_nonce('bitforms_save')],
286 'uploadFileToServer' => ['val' => 1],
287 'fieldName' => ['path' => 'fieldName'],
288 'contentId' => ['var' => 'contentId'],
289 ],
290 'razorpay' => [
291 'fieldKey' => ['var' => 'fieldKey'],
292 'options' => ['path' => 'options'],
293 'payIntegID' => ['path' => 'payIntegID'],
294 'payType' => ['path' =>'payType', 'val' => ''],
295 'clientId' => ['path' => 'clientId'],
296 'contentId' => ['var' => 'contentId'],
297 'includeOrderId' => ['path' => 'includeOrderId', 'val' => false],
298 'newOrderId' => ['path' => 'newOrderId', 'val' => false],
299 'orderIdFld' => ['path' => 'orderIdFld', 'val' => ''],
300 ],
301 'repeater' => [
302 'fieldKey' => ['var' => 'fieldKey'],
303 'fieldName' => ['path' => 'fieldName'],
304 'contentId' => ['var' => 'contentId'],
305 'defaultRow' => ['path' => 'defaultRow', 'val' => 1],
306 'minimumRow' => ['path' => 'minRow', 'val' => 1],
307 'maximumRow' => ['path' => 'maxRow', 'val' => 0],
308 'showAddBtn' => ['path' => 'addBtn->show', 'val' => false],
309 'showAddToEndBtn' => ['path' => 'addToEndBtn->show', 'val' => false],
310 'defaultValue' => ['path' => 'val', 'val' => ''],
311 ],
312 'signature' => [
313 'fieldKey' => ['var' => 'fieldKey'],
314 'contentId' => ['var' => 'contentId'],
315 'maxWidth' => ['path' => 'config->maxWidth', 'val' => '1'],
316 'penColor' => ['path' => 'config->penColor', 'val'=> '#000000'],
317 'backgroundColor' => ['path' => 'config->backgroundColor', 'val' => '#ffffff'],
318 'imgTyp' => ['path' => 'config->imgTyp', 'val' => 'image/png'],
319 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/signature/']
320 ],
321 'rating' => [
322 'fieldKey' => ['var' => 'fieldKey'],
323 'contentId' => ['var' => 'contentId'],
324 'options' => ['path' => 'opt'],
325 'showReviewLblOnHover' => ['path' => 'showReviewLblOnHover'],
326 'showReviewLblOnSelect' => ['path' => 'showReviewLblOnSelect'],
327 'selectedRating' => ['path' => 'selectedRating'],
328 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
329 ]
330 ];
331
332 return $configs;
333 }
334
335 public static function multiStepFiles()
336 {
337 return [
338 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
339 ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
340 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
341 ['priority' => 700, 'filename' => 'bit-multi-step-form.min.js'],
342 ];
343 }
344
345 public static function conversationalFormFiles()
346 {
347 return [
348 ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
349 ['priority' => 700, 'filename' => 'bit-conversational-form.min.js'],
350 ['priority' => 700, 'filename' => 'handleConversationalFormMsg.min.js'],
351 ];
352 }
353
354 public static function frontendScriptFile()
355 {
356 return [
357 'observeElm' => ['priority' => 101, 'filename' => 'observeElm.min.js'],
358 'hidden-token-field' => ['priority' => 300, 'filename' => 'hidden-token-field.min.js'],
359 ];
360 }
361
362 public static function validationAndOtherScriptFile()
363 {
364 return [
365 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
366 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
367 'checkMinMaxValue' => ['priority' => 702, 'filename' => 'checkMinMaxValue.min.js'],
368 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
369 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
370 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
371 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
372 'advanceFileupFldValidation' => ['priority' => 702, 'filename' => 'advanceFileUpFldValidation.min.js'],
373 'phoneNumberFldValidation' => ['priority' => 702, 'filename' => 'phoneNumberFldValidation.min.js'],
374 'generateBackslashPattern' => ['priority' => 700, 'filename' => 'generateBackslashPattern.min.js'],
375 'nmbrFldValidation' => ['priority' => 702, 'filename' => 'nmbrFldValidation.min.js'],
376 'regexPatternValidation' => ['priority' => 701, 'filename' => 'regexPatternValidation.min.js'], // load before generateBackslashPattern file, then load regexPatternValidation
377 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
378 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
379 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
380 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
381 'resetPlaceholders' => ['priority' => 201, 'filename' => 'resetPlaceholders.min.js'],
382 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
383 ];
384 }
385
386 public static function validationScriptFileMapping($fieldType)
387 {
388 $textTypeField = ['text', 'password', 'username', 'date', 'datetime-local', 'time', 'month', 'week', 'color'];
389 if (in_array($fieldType, $textTypeField)) {
390 $fieldType = 'text';
391 }
392 $fields =
393 [
394 'text' => [
395 'regexPatternValidation' => [
396 'paths' => ['valid->regexr'],
397 'dependencies' => [
398 'generateBackslashPattern'
399 ]
400 ]
401 ],
402 'email' => [
403 'emailFldValidation' => [
404 'paths' => ['err->invalid->show'],
405 'dependencies' => [
406 'generateBackslashPattern'
407 ]
408 ],
409 ],
410 'number' => [
411 'nmbrFldValidation' => [
412 'paths' => ['mn', 'mx']
413 ]
414 ],
415 'radio' => [
416 'customOptionValidation' => [
417 'paths' => ['valid->otherOptReq'],
418 ]
419 ],
420 'check' => [
421 'checkMinMaxOptions' => [
422 'paths' => ['mn', 'mx'],
423 'dependencies' => [
424 'checkFldValidation'
425 ]
426 ],
427 'customOptionValidation' => [
428 'paths' => ['valid->otherOptReq'],
429 ]
430 ],
431 'select' => [
432 'checkMinMaxOptions' => [
433 'paths' => ['mn', 'mx'],
434 'dependencies' => [
435 'checkFldValidation'
436 ]
437 ],
438 ],
439 'image-select' => [
440 'checkMinMaxOptions' => [
441 'paths' => ['mn', 'mx'],
442 'dependencies' => [
443 'checkFldValidation'
444 ]
445 ],
446 ],
447 'range' => [
448 'checkMinMaxValue' => [
449 'paths' => ['mn', 'mx']
450 ]
451 ],
452 'url' => [
453 'regexPatternValidation' => [
454 'paths' => ['valid->regexr'],
455 'dependencies' => [
456 'generateBackslashPattern'
457 ]
458 ],
459 'urlFldValidation' => [
460 'paths' => ['err->invalid->show'],
461 'dependencies' => [
462 'generateBackslashPattern'
463 ]
464 ]
465 ],
466 'decision-box' => [
467 'dcsnbxFldValidation' => [
468 'paths' => ['valid->req']
469 ]
470 ],
471 'gdpr' => [
472 'dcsnbxFldValidation' => [
473 'paths' => ['valid->req']
474 ]
475 ],
476 'file-up' => [
477 'fileupFldValidation' => [
478 'paths' => ['valid->req']
479 ]
480 ],
481 'advanced-file-up' => [
482 'advanceFileupFldValidation' => [
483 'paths' => ['valid->req']
484 ]
485 ],
486 'phone-number' => [
487 'phoneNumberFldValidation' => [
488 'paths' => ['err->invalid->show'],
489 ]
490 ],
491 ];
492 return isset($fields[$fieldType]) ? $fields[$fieldType] : [];
493 }
494
495 public static function formAbandonmentNeededFiles($abandonType = null)
496 {
497 $files = [
498 'autoSave' => [
499 ['priority' => 201, 'filename' => 'bit-page-lifecycle.min.js'],
500 ['priority' => 402, 'filename' => 'autoSavePartial.min.js'],
501 ]
502 ];
503
504 $required = [
505 ['priority' => 402, 'filename' => 'bit-form-abandonment.min.js'],
506 ['priority' => 401, 'filename' => 'saveFormProgress.min.js'],
507 ['priority' => 701, 'filename' => 'setFieldValues.min.js'],
508 ];
509 return isset($files[$abandonType]) ? array_merge($files[$abandonType], $required) : $required;
510 }
511 }
512