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

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