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
← All changes | includes/Admin/Form/ScriptFilePriorityManager.php +211 -58 2.02.16.2 View file →
@@ -1,10 +1,12 @@
1 1 <?php
2 2
3 3 namespace BitCode\BitForm\Admin\Form;
4 4
5 -class ScriptFilePriorityManager {
6 - public static function jsFile() {
5 +class ScriptFilePriorityManager
6 +{
7 + public static function jsFile()
8 + {
7 9 /**
8 10 * file load priority
9 11 * first priority status code 100
10 12 * sub status code link 101,102
@@ -46,34 +48,34 @@
46 48 'helperScript' => [
47 49 ['priority' => 101, 'filename' => 'bfSelect.min.js'],
48 50 ['priority' => 101, 'filename' => 'bfReset.min.js'],
49 51 ['priority' => 101, 'filename' => 'setBFMsg.min.js'],
50 - ['priority' => 101, 'filename' => 'scrollToFld.min.js'],
52 + ['priority' => 101, 'filename' => 'scrollToElm.min.js'],
53 + ['priority' => 101, 'filename' => 'getFldKeyAndRowIndx.min.js'],
54 + ['priority' => 101, 'filename' => 'moveToFirstErrFld.min.js'],
51 55 ['priority' => 101, 'filename' => 'bfValidationErrMsg.min.js'],
52 56 ['priority' => 101, 'filename' => 'setHiddenFld.min.js'],
53 57 ['priority' => 101, 'filename' => 'submit-form.min.js'],
54 58 ['priority' => 101, 'filename' => 'setStyleProperty.min.js']
55 59 ],
60 + 'range' => [
61 + ['priority' => 301, 'filename' => 'SetSliderFieldValue', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'showValue'],
62 + ],
56 63 'country' => [
57 64 ['priority' => 101, 'filename' => 'observeElm.min.js'],
58 - ['priority' => 201, 'filename' => 'bit-virtualized-list.min.js'],
59 65 ['priority' => 301, 'filename' => 'bit-country-field.min.js'],
60 - ['priority' => 501, 'filename' => 'Country', 'scriptTyp' => 'init', 'source' => $initSource],
61 66 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
62 67 ['priority' => 101, 'filename' => 'observeElm.min.js'],
63 68 ],
64 69 'currency' => [
65 70 ['priority' => 101, 'filename' => 'observeElm.min.js'],
66 - ['priority' => 201, 'filename' => 'bit-virtualized-list.min.js'],
67 71 ['priority' => 301, 'filename' => 'bit-currency-field.min.js'],
68 - ['priority' => 501, 'filename' => 'Currency', 'scriptTyp' => 'init', 'source' => $initSource],
69 72 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
70 73 ['priority' => 101, 'filename' => 'observeElm.min.js'],
71 74 ],
72 75 'select' => [
73 76 ['priority' => 101, 'filename' => 'observeElm.min.js'],
74 - ['priority' => 301, 'filename' => 'bit-dropdown-field.min.js'],
75 - ['priority' => 501, 'filename' => 'Select', 'scriptTyp' => 'init', 'source' => $initSource],
77 + ['priority' => 301, 'filename' => 'bit-select-field.min.js'],
76 78 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
77 79 ['priority' => 101, 'filename' => 'observeElm.min.js'],
78 80 ],
79 81 'advanced-file-up' => [
@@ -78,54 +80,89 @@
78 80 ],
79 81 'advanced-file-up' => [
80 82 ['priority' => 101, 'filename' => 'observeElm.min.js'],
81 83 ['priority' => 202, 'filename' => 'bit-filepond.min.js'],
82 - ['priority' => 301, 'filename' => 'bit-advance-file-upload-field.min.js'],
83 - ['priority' => 501, 'filename' => 'AdvancedFileUpload', 'scriptTyp' => 'init', 'source' => $initSource],
84 + ['priority' => 301, 'filename' => 'bit-advanced-file-up-field.min.js'],
84 85 ['priority' => 101, 'filename' => 'advancedFileHandle.min.js'],
85 86 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
86 87 ],
87 88 'file-up' => [
88 89 ['priority' => 301, 'filename' => 'bit-file-up-field.min.js'],
89 - ['priority' => 501, 'filename' => 'FileUpload', 'scriptTyp' => 'init', 'source' => $initSource],
90 90 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
91 91 ],
92 92 'phone-number' => [
93 93 ['priority' => 101, 'filename' => 'observeElm.min.js'],
94 - ['priority' => 201, 'filename' => 'bit-virtualized-list.min.js'],
95 94 ['priority' => 301, 'filename' => 'bit-phone-number-field.min.js'],
96 - ['priority' => 501, 'filename' => 'PhoneNumber', 'scriptTyp' => 'init', 'source' => $initSource],
97 95 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
98 96 ['priority' => 101, 'filename' => 'observeElm.min.js'],
99 97 ],
100 98 'paypal' => [
101 - ['priority' => 101, 'filename' => 'paymentSubmitResponse.min.js'],
99 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
100 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
101 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
102 102 ['priority' => 301, 'filename' => 'bit-paypal-field.min.js'],
103 - ['priority' => 601, 'filename' => 'Paypal', 'scriptTyp' => 'init', 'source' => $initSource],
104 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 + ],
105 126 'razorpay' => [
106 - ['priority' => 101, 'filename' => 'paymentSubmitResponse.min.js'],
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'],
107 131 ['priority' => 301, 'filename' => 'bit-razorpay-field.min.js'],
108 - ['priority' => 601, 'filename' => 'Razorpay', 'scriptTyp' => 'init', 'source' => $initSource],
109 132 ],
110 133 'radio' => [
111 - ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource],
134 + ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
112 135 ],
113 136 'check' => [
114 - ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource],
115 - ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource],
137 + ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
138 + ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
116 139 ],
140 + 'image-select' => [
141 + ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
142 + ],
117 143 'recaptcha' => [
118 144 ['priority' => 301, 'filename' => 'bit-recaptcha-field.min.js'],
119 - ['priority' => 601, 'filename' => 'Recaptcha', 'scriptTyp' => 'init', 'source' => $initSource],
120 145 ],
121 146 'decision-box' => [
122 147 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
123 - ]
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 + ],
124 160 ];
125 161 }
126 162
127 - public static function filePondPlugins($plugin) {
163 + public static function filePondPlugins($plugin)
164 + {
128 165 $plugins = [
129 166 'allowFileSizeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-size.min.js'],
130 167 'allowFileTypeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-type.min.js'],
131 168 'allowImageCrop' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-crop.min.js'],
@@ -141,12 +178,16 @@
141 178
142 179 return false;
143 180 }
144 181
145 - public static function fieldMissingConfigsProps($fieldType, $field) {
182 + public static function getAllFldConfs()
183 + {
184 + // $contentId = $fieldData['contentId'];
185 + // $fieldKey = $fieldData['fk'];
186 + // $field = $fieldData['field'];
146 187 // key is config path, value is field path
147 188 // var is for variable value
148 - // path is for field path
189 + // path is for field path [ for multiple paths]
149 190 // val is for static value
150 191 $configs = [
151 192 'select' => [
152 193 'fieldKey' => ['var' => 'fieldKey'],
@@ -153,9 +194,9 @@
153 194 'options' => ['path' => 'optionsList'],
154 195 'placeholder' => ['path' => 'ph'],
155 196 'classNames' => ['path' => 'customClasses'],
156 197 'attributes' => ['path' => 'customAttributes'],
157 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
198 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
158 199 'separator' => ['val' => BITFORMS_BF_SEPARATOR],
159 200 'mn' => ['path' => 'mn', 'val' => 0],
160 201 'mx' => ['path' => 'mx', 'val' => 0],
161 202 'disableOnMax' => ['path' => 'valid->disableOnMax', 'val' => false],
@@ -166,9 +207,9 @@
166 207 'placeholder' => ['path' => 'ph'],
167 208 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
168 209 'classNames' => ['path' => 'customClasses'],
169 210 'attributes' => ['path' => 'customAttributes'],
170 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
211 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
171 212 ],
172 213 'currency' => [
173 214 'fieldKey' => ['var' => 'fieldKey'],
174 215 'options' => ['path' => 'options'],
@@ -174,9 +215,9 @@
174 215 'options' => ['path' => 'options'],
175 216 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
176 217 'classNames' => ['path' => 'customClasses'],
177 218 'attributes' => ['path' => 'customAttributes'],
178 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
219 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
179 220 ],
180 221 'phone-number' => [
181 222 'fieldKey' => ['var' => 'fieldKey'],
182 223 'options' => ['path' => 'options'],
@@ -185,14 +226,16 @@
185 226 'attributes' => ['path' => 'customAttributes']
186 227 ],
187 228 'file-up' => [
188 229 'fieldKey' => ['var' => 'fieldKey'],
189 - 'maxSizeErrMsg' => ['path' => isset($field->err->maxSize->msg) ? 'err->maxSize->msg' : 'err->maxSize->dflt'],
190 - 'minFileErrMsg' => ['path' => isset($field->err->minFile->msg) ? 'err->minFile->msg' : 'err->minFile->dflt'],
191 - 'maxFileErrMsg' => ['path' => isset($field->err->maxFile->msg) ? 'err->maxFile->msg' : 'err->maxFile->dflt'],
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']],
192 234 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload/'],
193 235 'classNames' => ['path' => 'customClasses'],
194 - 'attributes' => ['path' => 'customAttributes']
236 + 'attributes' => ['path' => 'customAttributes'],
237 + 'fieldName' => ['path' => 'fieldName'],
195 238 ],
196 239 'paypal' => [
197 240 'payIntegID' => ['path' => 'payIntegID'],
198 241 'style' => ['path' => 'style'],
@@ -208,39 +251,121 @@
208 251 'payType' => ['path' => 'payType', 'val' => 'payment'],
209 252 'planId' => ['path' => 'planId', 'val' => ''],
210 253 'locale' => ['path' => 'locale', 'val' => 'en_US'],
211 254 'disableFunding' => ['path' => 'disableFunding', 'val' => ''],
255 + 'fieldKey' => ['var' => 'fieldKey'],
256 + 'clientId' => ['path' => 'clientId'],
257 + 'contentId' => ['var' => 'contentId'],
258 + 'namespace' => ['val' => 'bit-paypal-__$contentId__'],
212 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 + ],
213 280 'advanced-file-up' => [
214 281 'fieldKey' => ['var' => 'fieldKey'],
215 - 'formID' => ['var' => 'formID'],
282 + 'formID' => ['var' => 'formId'],
216 283 'configSetting' => ['path' => 'config'],
217 284 'ajaxURL' => ['val' => admin_url('admin-ajax.php')],
218 285 'nonce' => ['val' => wp_create_nonce('bitforms_save')],
219 286 'uploadFileToServer' => ['val' => 1],
287 + 'fieldName' => ['path' => 'fieldName'],
288 + 'contentId' => ['var' => 'contentId'],
220 289 ],
221 290 'razorpay' => [
222 - 'fieldKey' => ['var' => 'fieldKey'],
223 - 'options' => ['path' => 'options'],
224 - 'payIntegID' => ['path' => 'payIntegID'],
225 - 'payType' => ['path' =>'payType', 'val' => ''],
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' => ''],
226 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 + ]
227 330 ];
228 331
229 - return isset($configs[$fieldType]) ? $configs[$fieldType] : [];
332 + return $configs;
230 333 }
231 334
232 - public static function frontendScriptFile() {
335 + public static function multiStepFiles()
336 + {
233 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 [
234 357 'observeElm' => ['priority' => 101, 'filename' => 'observeElm.min.js'],
235 358 'hidden-token-field' => ['priority' => 300, 'filename' => 'hidden-token-field.min.js'],
236 359 ];
237 360 }
238 361
239 - public static function validationScriptFile() {
362 + public static function validationAndOtherScriptFile()
363 + {
240 364 return [
241 365 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
242 366 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
367 + 'checkMinMaxValue' => ['priority' => 702, 'filename' => 'checkMinMaxValue.min.js'],
243 368 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
244 369 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
245 370 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
246 371 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
@@ -252,29 +377,16 @@
252 377 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
253 378 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
254 379 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
255 380 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
381 + 'resetPlaceholders' => ['priority' => 201, 'filename' => 'resetPlaceholders.min.js'],
256 382 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
257 383 ];
258 384 }
259 385
260 - public static function validationCommonFunction() {
261 - $commonFunctions = [
262 - 'requiredFldValidation' => [
263 - 'fields' => ['text', 'email'] // string { all} or array {field name} of field types
264 - ],
265 - 'commonFuncion2' => [
266 - 'notFields' => ['text', 'email'],
267 - 'dependencies' => ['someDependsOnThisField'],
268 - 'paths' => ['path1', 'path2'],
269 - ],
270 - ];
271 -
272 - return $commonFunctions;
273 - }
274 -
275 - public static function validationScriptFileMapping($fieldType) {
276 - $textTypeField = ['text', 'password', 'username', 'url', 'date', 'datetime-local', 'time', 'month', 'week', 'color'];
386 + public static function validationScriptFileMapping($fieldType)
387 + {
388 + $textTypeField = ['text', 'password', 'username', 'date', 'datetime-local', 'time', 'month', 'week', 'color'];
277 389 if (in_array($fieldType, $textTypeField)) {
278 390 $fieldType = 'text';
279 391 }
280 392 $fields =
@@ -323,9 +435,28 @@
323 435 'checkFldValidation'
324 436 ]
325 437 ],
326 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 + ],
327 452 'url' => [
453 + 'regexPatternValidation' => [
454 + 'paths' => ['valid->regexr'],
455 + 'dependencies' => [
456 + 'generateBackslashPattern'
457 + ]
458 + ],
328 459 'urlFldValidation' => [
329 460 'paths' => ['err->invalid->show'],
330 461 'dependencies' => [
331 462 'generateBackslashPattern'
@@ -336,8 +467,13 @@
336 467 'dcsnbxFldValidation' => [
337 468 'paths' => ['valid->req']
338 469 ]
339 470 ],
471 + 'gdpr' => [
472 + 'dcsnbxFldValidation' => [
473 + 'paths' => ['valid->req']
474 + ]
475 + ],
340 476 'file-up' => [
341 477 'fileupFldValidation' => [
342 478 'paths' => ['valid->req']
343 479 ]
@@ -353,6 +489,23 @@
353 489 ]
354 490 ],
355 491 ];
356 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;
357 510 }
358 511 }