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
← All changes | includes/Admin/Form/ScriptFilePriorityManager.php +202 -58 2.02.15.3 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,85 @@
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' => 'getRepeatedIndexes.min.js'],
122 + ['priority' => 701, 'filename' => 'getIndexesBaseOnConditions.min.js'],
123 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
124 + ],
105 125 'razorpay' => [
106 - ['priority' => 101, 'filename' => 'paymentSubmitResponse.min.js'],
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'],
107 130 ['priority' => 301, 'filename' => 'bit-razorpay-field.min.js'],
108 - ['priority' => 601, 'filename' => 'Razorpay', 'scriptTyp' => 'init', 'source' => $initSource],
109 131 ],
110 132 'radio' => [
111 - ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource],
133 + ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
112 134 ],
113 135 'check' => [
114 - ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource],
115 - ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource],
136 + ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
137 + ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
116 138 ],
139 + 'image-select' => [
140 + ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
141 + ],
117 142 'recaptcha' => [
118 143 ['priority' => 301, 'filename' => 'bit-recaptcha-field.min.js'],
119 - ['priority' => 601, 'filename' => 'Recaptcha', 'scriptTyp' => 'init', 'source' => $initSource],
120 144 ],
121 145 'decision-box' => [
122 146 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
123 - ]
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 + ],
124 156 ];
125 157 }
126 158
127 - public static function filePondPlugins($plugin) {
159 + public static function filePondPlugins($plugin)
160 + {
128 161 $plugins = [
129 162 'allowFileSizeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-size.min.js'],
130 163 'allowFileTypeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-type.min.js'],
131 164 'allowImageCrop' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-crop.min.js'],
@@ -141,12 +174,16 @@
141 174
142 175 return false;
143 176 }
144 177
145 - public static function fieldMissingConfigsProps($fieldType, $field) {
178 + public static function getAllFldConfs()
179 + {
180 + // $contentId = $fieldData['contentId'];
181 + // $fieldKey = $fieldData['fk'];
182 + // $field = $fieldData['field'];
146 183 // key is config path, value is field path
147 184 // var is for variable value
148 - // path is for field path
185 + // path is for field path [ for multiple paths]
149 186 // val is for static value
150 187 $configs = [
151 188 'select' => [
152 189 'fieldKey' => ['var' => 'fieldKey'],
@@ -153,9 +190,9 @@
153 190 'options' => ['path' => 'optionsList'],
154 191 'placeholder' => ['path' => 'ph'],
155 192 'classNames' => ['path' => 'customClasses'],
156 193 'attributes' => ['path' => 'customAttributes'],
157 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
194 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
158 195 'separator' => ['val' => BITFORMS_BF_SEPARATOR],
159 196 'mn' => ['path' => 'mn', 'val' => 0],
160 197 'mx' => ['path' => 'mx', 'val' => 0],
161 198 'disableOnMax' => ['path' => 'valid->disableOnMax', 'val' => false],
@@ -166,9 +203,9 @@
166 203 'placeholder' => ['path' => 'ph'],
167 204 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
168 205 'classNames' => ['path' => 'customClasses'],
169 206 'attributes' => ['path' => 'customAttributes'],
170 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
207 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
171 208 ],
172 209 'currency' => [
173 210 'fieldKey' => ['var' => 'fieldKey'],
174 211 'options' => ['path' => 'options'],
@@ -174,9 +211,9 @@
174 211 'options' => ['path' => 'options'],
175 212 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
176 213 'classNames' => ['path' => 'customClasses'],
177 214 'attributes' => ['path' => 'customAttributes'],
178 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
215 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
179 216 ],
180 217 'phone-number' => [
181 218 'fieldKey' => ['var' => 'fieldKey'],
182 219 'options' => ['path' => 'options'],
@@ -185,14 +222,16 @@
185 222 'attributes' => ['path' => 'customAttributes']
186 223 ],
187 224 'file-up' => [
188 225 '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'],
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']],
192 230 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload/'],
193 231 'classNames' => ['path' => 'customClasses'],
194 - 'attributes' => ['path' => 'customAttributes']
232 + 'attributes' => ['path' => 'customAttributes'],
233 + 'fieldName' => ['path' => 'fieldName'],
195 234 ],
196 235 'paypal' => [
197 236 'payIntegID' => ['path' => 'payIntegID'],
198 237 'style' => ['path' => 'style'],
@@ -208,39 +247,121 @@
208 247 'payType' => ['path' => 'payType', 'val' => 'payment'],
209 248 'planId' => ['path' => 'planId', 'val' => ''],
210 249 'locale' => ['path' => 'locale', 'val' => 'en_US'],
211 250 'disableFunding' => ['path' => 'disableFunding', 'val' => ''],
251 + 'fieldKey' => ['var' => 'fieldKey'],
252 + 'clientId' => ['path' => 'clientId'],
253 + 'contentId' => ['var' => 'contentId'],
254 + 'namespace' => ['val' => 'bit-paypal-__$contentId__'],
212 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 + ],
213 276 'advanced-file-up' => [
214 277 'fieldKey' => ['var' => 'fieldKey'],
215 - 'formID' => ['var' => 'formID'],
278 + 'formID' => ['var' => 'formId'],
216 279 'configSetting' => ['path' => 'config'],
217 280 'ajaxURL' => ['val' => admin_url('admin-ajax.php')],
218 281 'nonce' => ['val' => wp_create_nonce('bitforms_save')],
219 282 'uploadFileToServer' => ['val' => 1],
283 + 'fieldName' => ['path' => 'fieldName'],
284 + 'contentId' => ['var' => 'contentId'],
220 285 ],
221 286 'razorpay' => [
222 - 'fieldKey' => ['var' => 'fieldKey'],
223 - 'options' => ['path' => 'options'],
224 - 'payIntegID' => ['path' => 'payIntegID'],
225 - 'payType' => ['path' =>'payType', 'val' => ''],
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' => ''],
226 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 + ]
227 326 ];
228 327
229 - return isset($configs[$fieldType]) ? $configs[$fieldType] : [];
328 + return $configs;
230 329 }
231 330
232 - public static function frontendScriptFile() {
331 + public static function multiStepFiles()
332 + {
233 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 [
234 353 'observeElm' => ['priority' => 101, 'filename' => 'observeElm.min.js'],
235 354 'hidden-token-field' => ['priority' => 300, 'filename' => 'hidden-token-field.min.js'],
236 355 ];
237 356 }
238 357
239 - public static function validationScriptFile() {
358 + public static function validationAndOtherScriptFile()
359 + {
240 360 return [
241 361 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
242 362 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
363 + 'checkMinMaxValue' => ['priority' => 702, 'filename' => 'checkMinMaxValue.min.js'],
243 364 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
244 365 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
245 366 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
246 367 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
@@ -252,29 +373,16 @@
252 373 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
253 374 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
254 375 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
255 376 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
377 + 'resetPlaceholders' => ['priority' => 201, 'filename' => 'resetPlaceholders.min.js'],
256 378 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
257 379 ];
258 380 }
259 381
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'];
382 + public static function validationScriptFileMapping($fieldType)
383 + {
384 + $textTypeField = ['text', 'password', 'username', 'date', 'datetime-local', 'time', 'month', 'week', 'color'];
277 385 if (in_array($fieldType, $textTypeField)) {
278 386 $fieldType = 'text';
279 387 }
280 388 $fields =
@@ -323,9 +431,28 @@
323 431 'checkFldValidation'
324 432 ]
325 433 ],
326 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 + ],
327 448 'url' => [
449 + 'regexPatternValidation' => [
450 + 'paths' => ['valid->regexr'],
451 + 'dependencies' => [
452 + 'generateBackslashPattern'
453 + ]
454 + ],
328 455 'urlFldValidation' => [
329 456 'paths' => ['err->invalid->show'],
330 457 'dependencies' => [
331 458 'generateBackslashPattern'
@@ -353,6 +480,23 @@
353 480 ]
354 481 ],
355 482 ];
356 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;
357 501 }
358 502 }