PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.21.4
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.21.4
3.3.1 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 All 138 releases
← All changes | includes/Admin/Form/ScriptFilePriorityManager.php +401 -78 2.02.21.4 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,35 @@
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' => 'bfSplit.min.js'],
53 + ['priority' => 101, 'filename' => 'scrollToElm.min.js'],
54 + ['priority' => 101, 'filename' => 'getFldKeyAndRowIndx.min.js'],
55 + ['priority' => 101, 'filename' => 'moveToFirstErrFld.min.js'],
51 56 ['priority' => 101, 'filename' => 'bfValidationErrMsg.min.js'],
52 57 ['priority' => 101, 'filename' => 'setHiddenFld.min.js'],
53 58 ['priority' => 101, 'filename' => 'submit-form.min.js'],
54 59 ['priority' => 101, 'filename' => 'setStyleProperty.min.js']
55 60 ],
61 + 'range' => [
62 + ['priority' => 301, 'filename' => 'SetSliderFieldValue', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'showValue'],
63 + ],
56 64 'country' => [
57 65 ['priority' => 101, 'filename' => 'observeElm.min.js'],
58 - ['priority' => 201, 'filename' => 'bit-virtualized-list.min.js'],
59 66 ['priority' => 301, 'filename' => 'bit-country-field.min.js'],
60 - ['priority' => 501, 'filename' => 'Country', 'scriptTyp' => 'init', 'source' => $initSource],
61 67 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
62 68 ['priority' => 101, 'filename' => 'observeElm.min.js'],
63 69 ],
64 70 'currency' => [
65 71 ['priority' => 101, 'filename' => 'observeElm.min.js'],
66 - ['priority' => 201, 'filename' => 'bit-virtualized-list.min.js'],
67 72 ['priority' => 301, 'filename' => 'bit-currency-field.min.js'],
68 - ['priority' => 501, 'filename' => 'Currency', 'scriptTyp' => 'init', 'source' => $initSource],
69 73 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
70 74 ['priority' => 101, 'filename' => 'observeElm.min.js'],
71 75 ],
72 76 'select' => [
73 77 ['priority' => 101, 'filename' => 'observeElm.min.js'],
74 - ['priority' => 301, 'filename' => 'bit-dropdown-field.min.js'],
75 - ['priority' => 501, 'filename' => 'Select', 'scriptTyp' => 'init', 'source' => $initSource],
78 + ['priority' => 301, 'filename' => 'bit-select-field.min.js'],
76 79 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
77 80 ['priority' => 101, 'filename' => 'observeElm.min.js'],
78 81 ],
79 82 'advanced-file-up' => [
@@ -78,54 +81,144 @@
78 81 ],
79 82 'advanced-file-up' => [
80 83 ['priority' => 101, 'filename' => 'observeElm.min.js'],
81 84 ['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],
85 + ['priority' => 301, 'filename' => 'bit-advanced-file-up-field.min.js'],
84 86 ['priority' => 101, 'filename' => 'advancedFileHandle.min.js'],
85 87 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
86 88 ],
87 89 'file-up' => [
88 90 ['priority' => 301, 'filename' => 'bit-file-up-field.min.js'],
89 - ['priority' => 501, 'filename' => 'FileUpload', 'scriptTyp' => 'init', 'source' => $initSource],
90 91 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
91 92 ],
92 93 'phone-number' => [
93 94 ['priority' => 101, 'filename' => 'observeElm.min.js'],
94 - ['priority' => 201, 'filename' => 'bit-virtualized-list.min.js'],
95 95 ['priority' => 301, 'filename' => 'bit-phone-number-field.min.js'],
96 - ['priority' => 501, 'filename' => 'PhoneNumber', 'scriptTyp' => 'init', 'source' => $initSource],
97 96 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
98 97 ['priority' => 101, 'filename' => 'observeElm.min.js'],
99 98 ],
100 99 'paypal' => [
101 - ['priority' => 101, 'filename' => 'paymentSubmitResponse.min.js'],
100 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
101 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
102 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
102 103 ['priority' => 301, 'filename' => 'bit-paypal-field.min.js'],
103 - ['priority' => 601, 'filename' => 'Paypal', 'scriptTyp' => 'init', 'source' => $initSource],
104 104 ],
105 + 'stripe' => [
106 + ['priority' => 201, 'filename' => 'bitsFetchFront.min.js'],
107 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
108 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
109 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
110 + ['priority' => 301, 'filename' => 'bit-stripe-field.min.js'],
111 + ],
112 + 'mollie' => [
113 + ['priority' => 201, 'filename' => 'bitsFetchFront.min.js'],
114 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
115 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
116 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
117 + ['priority' => 301, 'filename' => 'bit-mollie-field.min.js'],
118 + ],
119 + 'section' => [
120 + ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
121 + ],
122 + 'repeater' => [
123 + ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
124 + ['priority' => 102, 'filename' => 'bit-repeater-field.min.js'],
125 + ['priority' => 701, 'filename' => 'checkRepeatedField.min.js'],
126 + ['priority' => 701, 'filename' => 'isRepeaterField.min.js'],
127 + ['priority' => 701, 'filename' => 'getRepeatedIndexes.min.js'],
128 + ['priority' => 701, 'filename' => 'getIndexesBaseOnConditions.min.js'],
129 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
130 + ],
105 131 'razorpay' => [
106 - ['priority' => 101, 'filename' => 'paymentSubmitResponse.min.js'],
132 + ['priority' => 201, 'filename' => 'replaceFieldAndSmartValues.min.js'],
133 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
134 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
135 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
107 136 ['priority' => 301, 'filename' => 'bit-razorpay-field.min.js'],
108 - ['priority' => 601, 'filename' => 'Razorpay', 'scriptTyp' => 'init', 'source' => $initSource],
109 137 ],
110 138 'radio' => [
111 - ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource],
139 + ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
112 140 ],
113 141 'check' => [
114 - ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource],
115 - ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource],
142 + ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
143 + ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
116 144 ],
145 + 'image-select' => [
146 + ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
147 + ],
117 148 'recaptcha' => [
118 149 ['priority' => 301, 'filename' => 'bit-recaptcha-field.min.js'],
119 - ['priority' => 601, 'filename' => 'Recaptcha', 'scriptTyp' => 'init', 'source' => $initSource],
120 150 ],
151 + 'hcaptcha' => [
152 + ['priority' => 301, 'filename' => 'bit-hcaptcha-field.min.js'],
153 + ],
121 154 'decision-box' => [
122 155 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
123 - ]
156 + ],
157 + 'gdpr' => [
158 + ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
159 + ],
160 + 'signature' => [
161 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
162 + ['priority' => 301, 'filename' => 'bit-signature-field.min.js'],
163 + ],
164 + 'rating' => [
165 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
166 + ['priority' => 301, 'filename' => 'bit-rating-field.min.js'],
167 + ],
168 + 'advanced-datetime' => [
169 + ['priority' => 101, 'filename' => 'observeElm.min.js'],
170 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
171 + ['priority' => 301, 'filename' => 'bit-advanced-datetime-field.min.js'],
172 + ['priority' => 301, 'filename' => 'bfDatetimeFldValidation.min.js'],
173 + ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
174 + ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
175 + ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
176 + ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
177 + ['priority' => 301, 'filename' => 'bfParseSpecialDateFormat.min.js'],
178 + ['priority' => 301, 'filename' => 'bfSetDateTimeConfigOption.min.js'],
179 + ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
180 + ],
181 + 'date' => [
182 + ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
183 + ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
184 + ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
185 + ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
186 + ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
187 + ],
188 + 'datetime-local' => [
189 + ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
190 + ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
191 + ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
192 + ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
193 + ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
194 + ],
195 + 'time' => [
196 + ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
197 + ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
198 + ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
199 + ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
200 + ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
201 + ],
202 + 'month' => [
203 + ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
204 + ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
205 + ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
206 + ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
207 + ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
208 + ],
209 + 'week' => [
210 + ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
211 + ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
212 + ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
213 + ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
214 + ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
215 + ],
124 216 ];
125 217 }
126 218
127 - public static function filePondPlugins($plugin) {
219 + public static function filePondPlugins($plugin)
220 + {
128 221 $plugins = [
129 222 'allowFileSizeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-size.min.js'],
130 223 'allowFileTypeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-type.min.js'],
131 224 'allowImageCrop' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-crop.min.js'],
@@ -141,12 +234,16 @@
141 234
142 235 return false;
143 236 }
144 237
145 - public static function fieldMissingConfigsProps($fieldType, $field) {
238 + public static function getAllFldConfs()
239 + {
240 + // $contentId = $fieldData['contentId'];
241 + // $fieldKey = $fieldData['fk'];
242 + // $field = $fieldData['field'];
146 243 // key is config path, value is field path
147 244 // var is for variable value
148 - // path is for field path
245 + // path is for field path [ for multiple paths]
149 246 // val is for static value
150 247 $configs = [
151 248 'select' => [
152 249 'fieldKey' => ['var' => 'fieldKey'],
@@ -153,9 +250,9 @@
153 250 'options' => ['path' => 'optionsList'],
154 251 'placeholder' => ['path' => 'ph'],
155 252 'classNames' => ['path' => 'customClasses'],
156 253 'attributes' => ['path' => 'customAttributes'],
157 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
254 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
158 255 'separator' => ['val' => BITFORMS_BF_SEPARATOR],
159 256 'mn' => ['path' => 'mn', 'val' => 0],
160 257 'mx' => ['path' => 'mx', 'val' => 0],
161 258 'disableOnMax' => ['path' => 'valid->disableOnMax', 'val' => false],
@@ -166,17 +263,19 @@
166 263 'placeholder' => ['path' => 'ph'],
167 264 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
168 265 'classNames' => ['path' => 'customClasses'],
169 266 'attributes' => ['path' => 'customAttributes'],
170 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
267 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
171 268 ],
172 269 'currency' => [
173 - 'fieldKey' => ['var' => 'fieldKey'],
174 - 'options' => ['path' => 'options'],
175 - 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
176 - 'classNames' => ['path' => 'customClasses'],
177 - 'attributes' => ['path' => 'customAttributes'],
178 - 'defaultValue' => ['path' => 'val', 'val' => isset($field->config->defaultValue) ? $field->config->defaultValue : ''],
270 + 'fieldKey' => ['var' => 'fieldKey'],
271 + 'options' => ['path' => 'options'],
272 + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
273 + 'classNames' => ['path' => 'customClasses'],
274 + 'attributes' => ['path' => 'customAttributes'],
275 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
276 + 'inputFormatOptions' => ['path' => 'inputFormatOptions'],
277 + 'valueFormatOptions' => ['path' => 'valueFormatOptions'],
179 278 ],
180 279 'phone-number' => [
181 280 'fieldKey' => ['var' => 'fieldKey'],
182 281 'options' => ['path' => 'options'],
@@ -181,18 +280,22 @@
181 280 'fieldKey' => ['var' => 'fieldKey'],
182 281 'options' => ['path' => 'options'],
183 282 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
184 283 'classNames' => ['path' => 'customClasses'],
185 - 'attributes' => ['path' => 'customAttributes']
284 + 'attributes' => ['path' => 'customAttributes'],
285 + 'contentId' => ['var' => 'contentId'],
186 286 ],
187 287 'file-up' => [
188 288 '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'],
289 + 'formID' => ['var' => 'formId'],
290 + 'maxSizeErrMsg' => ['path' => ['err->maxSize->msg', 'err->maxSize->dflt']],
291 + 'minFileErrMsg' => ['path' => ['err->minFile->msg', 'err->minFile->dflt']],
292 + 'maxFileErrMsg' => ['path' => ['err->maxFile->msg', 'err->maxFile->dflt']],
192 293 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload/'],
193 294 'classNames' => ['path' => 'customClasses'],
194 - 'attributes' => ['path' => 'customAttributes']
295 + 'attributes' => ['path' => 'customAttributes'],
296 + 'fieldName' => ['path' => 'fieldName'],
297 + 'contentId' => ['var' => 'contentId'],
195 298 ],
196 299 'paypal' => [
197 300 'payIntegID' => ['path' => 'payIntegID'],
198 301 'style' => ['path' => 'style'],
@@ -208,73 +311,157 @@
208 311 'payType' => ['path' => 'payType', 'val' => 'payment'],
209 312 'planId' => ['path' => 'planId', 'val' => ''],
210 313 'locale' => ['path' => 'locale', 'val' => 'en_US'],
211 314 'disableFunding' => ['path' => 'disableFunding', 'val' => ''],
315 + 'fieldKey' => ['var' => 'fieldKey'],
316 + 'clientId' => ['path' => 'clientId'],
317 + 'contentId' => ['var' => 'contentId'],
318 + 'namespace' => ['val' => 'bit-paypal-__$contentId__'],
212 319 ],
320 + 'stripe' => [
321 + 'payIntegID' => ['path' => 'payIntegID'],
322 + 'locale' => ['path' => 'config->options->locale', 'val' => 'en'],
323 + 'amountType' => ['path' => 'config->amountType', 'val'=> 'fixed'],
324 + 'fieldKey' => ['var' => 'fieldKey'],
325 + 'contentId' => ['var' => 'contentId'],
326 + 'publishableKey' => ['path' => 'publishableKey'],
327 + ],
328 + 'mollie' => [
329 + 'payIntegID' => ['path' => 'payIntegID'],
330 + 'locale' => ['path' => 'config->locale', 'val' => 'en'],
331 + 'amountType' => ['path' => 'config->amountType', 'val'=> 'fixed'],
332 + 'fieldKey' => ['var' => 'fieldKey'],
333 + 'contentId' => ['var' => 'contentId'],
334 + 'apiKey' => ['path' => 'apiKey'],
335 + 'payment_method' => ['path' => 'config->payment_method', 'val' => ['creditcard']],
336 + 'description' => ['path' => 'config->description', 'val' => ''],
337 + 'amount' => ['path' => 'config->amount', 'val' => 0],
338 + 'currency' => ['path' => 'config->currency', 'val' => 'EUR'],
339 + ],
213 340 'advanced-file-up' => [
214 341 'fieldKey' => ['var' => 'fieldKey'],
215 - 'formID' => ['var' => 'formID'],
342 + 'formID' => ['var' => 'formId'],
216 343 'configSetting' => ['path' => 'config'],
217 344 'ajaxURL' => ['val' => admin_url('admin-ajax.php')],
218 345 'nonce' => ['val' => wp_create_nonce('bitforms_save')],
219 346 'uploadFileToServer' => ['val' => 1],
347 + 'fieldName' => ['path' => 'fieldName'],
348 + 'contentId' => ['var' => 'contentId'],
220 349 ],
350 + 'advanced-datetime' => [
351 + 'fieldKey' => ['var' => 'fieldKey'],
352 + 'formID' => ['var' => 'formId'],
353 + 'configSetting' => ['path' => 'config'],
354 + 'fieldName' => ['path' => 'fieldName'],
355 + 'contentId' => ['var' => 'contentId'],
356 + ],
221 357 'razorpay' => [
222 - 'fieldKey' => ['var' => 'fieldKey'],
223 - 'options' => ['path' => 'options'],
224 - 'payIntegID' => ['path' => 'payIntegID'],
225 - 'payType' => ['path' =>'payType', 'val' => ''],
358 + 'fieldKey' => ['var' => 'fieldKey'],
359 + 'options' => ['path' => 'options'],
360 + 'payIntegID' => ['path' => 'payIntegID'],
361 + 'payType' => ['path' =>'payType', 'val' => ''],
362 + 'clientId' => ['path' => 'clientId'],
363 + 'contentId' => ['var' => 'contentId'],
364 + 'includeOrderId' => ['path' => 'includeOrderId', 'val' => false],
365 + 'newOrderId' => ['path' => 'newOrderId', 'val' => false],
366 + 'orderIdFld' => ['path' => 'orderIdFld', 'val' => ''],
367 + 'formID' => ['var' => 'formId'],
226 368 ],
369 + 'repeater' => [
370 + 'fieldKey' => ['var' => 'fieldKey'],
371 + 'fieldName' => ['path' => 'fieldName'],
372 + 'contentId' => ['var' => 'contentId'],
373 + 'defaultRow' => ['path' => 'defaultRow', 'val' => 1],
374 + 'minimumRow' => ['path' => 'minRow', 'val' => 1],
375 + 'maximumRow' => ['path' => 'maxRow', 'val' => 0],
376 + 'showAddBtn' => ['path' => 'addBtn->show', 'val' => false],
377 + 'showAddToEndBtn' => ['path' => 'addToEndBtn->show', 'val' => false],
378 + 'defaultValue' => ['path' => 'val', 'val' => ''],
379 + ],
380 + 'signature' => [
381 + 'fieldKey' => ['var' => 'fieldKey'],
382 + 'contentId' => ['var' => 'contentId'],
383 + 'maxWidth' => ['path' => 'config->maxWidth', 'val' => '1'],
384 + 'penColor' => ['path' => 'config->penColor', 'val'=> '#000000'],
385 + 'backgroundColor' => ['path' => 'config->backgroundColor', 'val' => '#ffffff'],
386 + 'imgTyp' => ['path' => 'config->imgTyp', 'val' => 'image/png'],
387 + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/signature/']
388 + ],
389 + 'rating' => [
390 + 'fieldKey' => ['var' => 'fieldKey'],
391 + 'contentId' => ['var' => 'contentId'],
392 + 'options' => ['path' => 'opt'],
393 + 'showReviewLblOnHover' => ['path' => 'showReviewLblOnHover'],
394 + 'showReviewLblOnSelect' => ['path' => 'showReviewLblOnSelect'],
395 + 'selectedRating' => ['path' => 'selectedRating'],
396 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
397 + ]
227 398 ];
228 399
229 - return isset($configs[$fieldType]) ? $configs[$fieldType] : [];
400 + return $configs;
230 401 }
231 402
232 - public static function frontendScriptFile() {
403 + public static function multiStepFiles()
404 + {
233 405 return [
234 - 'observeElm' => ['priority' => 101, 'filename' => 'observeElm.min.js'],
235 - 'hidden-token-field' => ['priority' => 300, 'filename' => 'hidden-token-field.min.js'],
406 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
407 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
408 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
409 + ['priority' => 700, 'filename' => 'bit-multi-step-form.min.js'],
236 410 ];
237 411 }
238 412
239 - public static function validationScriptFile() {
413 + public static function conversationalFormFiles()
414 + {
240 415 return [
241 - 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
242 - 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
243 - 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
244 - 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
245 - 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
246 - 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
247 - 'advanceFileupFldValidation' => ['priority' => 702, 'filename' => 'advanceFileUpFldValidation.min.js'],
248 - 'phoneNumberFldValidation' => ['priority' => 702, 'filename' => 'phoneNumberFldValidation.min.js'],
249 - 'generateBackslashPattern' => ['priority' => 700, 'filename' => 'generateBackslashPattern.min.js'],
250 - 'nmbrFldValidation' => ['priority' => 702, 'filename' => 'nmbrFldValidation.min.js'],
251 - 'regexPatternValidation' => ['priority' => 701, 'filename' => 'regexPatternValidation.min.js'], // load before generateBackslashPattern file, then load regexPatternValidation
252 - 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
253 - 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
254 - 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
255 - 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
256 - 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
416 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
417 + ['priority' => 700, 'filename' => 'bit-conversational-form.min.js'],
418 + ['priority' => 700, 'filename' => 'handleConversationalFormMsg.min.js'],
257 419 ];
258 420 }
259 421
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 - ],
422 + public static function frontendScriptFile()
423 + {
424 + return [
425 + 'observeElm' => ['priority' => 101, 'filename' => 'observeElm.min.js'],
426 + 'hidden-token-field' => ['priority' => 300, 'filename' => 'hidden-token-field.min.js'],
270 427 ];
428 + }
271 429
272 - return $commonFunctions;
430 + public static function validationAndOtherScriptFile()
431 + {
432 + return [
433 + 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
434 + 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
435 + 'bfDatetimeFldValidation' => ['priority' => 702, 'filename' => 'bfDatetimeFldValidation.min.js'],
436 + 'bfParseDateTime' => ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
437 + 'checkMinMaxValue' => ['priority' => 702, 'filename' => 'checkMinMaxValue.min.js'],
438 + 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
439 + 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
440 + 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
441 + 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
442 + 'advanceFileupFldValidation' => ['priority' => 702, 'filename' => 'advanceFileUpFldValidation.min.js'],
443 + 'phoneNumberFldValidation' => ['priority' => 702, 'filename' => 'phoneNumberFldValidation.min.js'],
444 + 'currencyFldValidation' => ['priority' => 702, 'filename' => 'currencyFldValidation.min.js'],
445 + 'generateBackslashPattern' => ['priority' => 700, 'filename' => 'generateBackslashPattern.min.js'],
446 + 'nmbrFldValidation' => ['priority' => 702, 'filename' => 'nmbrFldValidation.min.js'],
447 + 'regexPatternValidation' => ['priority' => 701, 'filename' => 'regexPatternValidation.min.js'], // load before generateBackslashPattern file, then load regexPatternValidation
448 + 'inputMaskValidation' => ['priority' => 701, 'filename' => 'inputMaskValidation.min.js'], // load before generateBackslashPattern file, then load inputMaskValidation
449 + 'bit-input-mask' => ['priority' => 701, 'filename' => 'bit-input-mask.min.js'], // load before generateBackslashPattern file, then load bit-input-mask
450 + 'setBitInputMaskToInput' => ['priority' => 702, 'filename' => 'setBitInputMaskToInput.min.js'], // load before generateBackslashPattern file, then load setBitInputMaskToInput
451 + 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
452 + 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
453 + 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
454 + 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
455 + 'resetPlaceholders' => ['priority' => 201, 'filename' => 'resetPlaceholders.min.js'],
456 + 'bfResetDefaultValue' => ['priority' => 201, 'filename' => 'bfResetDefaultValue.min.js'],
457 + 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
458 + ];
273 459 }
274 460
275 - public static function validationScriptFileMapping($fieldType) {
276 - $textTypeField = ['text', 'password', 'username', 'url', 'date', 'datetime-local', 'time', 'month', 'week', 'color'];
461 + public static function validationScriptFileMapping($fieldType)
462 + {
463 + $textTypeField = ['text', 'password', 'username', 'color'];
277 464 if (in_array($fieldType, $textTypeField)) {
278 465 $fieldType = 'text';
279 466 }
280 467 $fields =
@@ -284,10 +471,44 @@
284 471 'paths' => ['valid->regexr'],
285 472 'dependencies' => [
286 473 'generateBackslashPattern'
287 474 ]
475 + ],
476 + 'bit-input-mask' => [
477 + 'paths' => ['valid->inputMask'],
478 + ],
479 + 'inputMaskValidation' => [
480 + 'paths' => ['valid->inputMask'],
481 + 'dependencies' => [
482 + 'generateBackslashPattern',
483 + 'validation',
484 + ]
485 + ],
486 + 'setBitInputMaskToInput' => [
487 + 'paths' => ['valid->inputMask'],
488 + 'dependencies' => [
489 + 'bit-input-mask'
490 + ]
288 491 ]
289 492 ],
493 + 'textarea' => [
494 + 'bit-input-mask' => [
495 + 'paths' => ['valid->inputMask'],
496 + ],
497 + 'inputMaskValidation' => [
498 + 'paths' => ['valid->inputMask'],
499 + 'dependencies' => [
500 + 'generateBackslashPattern',
501 + 'validation',
502 + ]
503 + ],
504 + 'setBitInputMaskToInput' => [
505 + 'paths' => ['valid->inputMask'],
506 + 'dependencies' => [
507 + 'bit-input-mask'
508 + ]
509 + ]
510 + ],
290 511 'email' => [
291 512 'emailFldValidation' => [
292 513 'paths' => ['err->invalid->show'],
293 514 'dependencies' => [
@@ -323,14 +544,49 @@
323 544 'checkFldValidation'
324 545 ]
325 546 ],
326 547 ],
548 + 'image-select' => [
549 + 'checkMinMaxOptions' => [
550 + 'paths' => ['mn', 'mx'],
551 + 'dependencies' => [
552 + 'checkFldValidation'
553 + ]
554 + ],
555 + ],
556 + 'range' => [
557 + 'checkMinMaxValue' => [
558 + 'paths' => ['mn', 'mx']
559 + ]
560 + ],
327 561 'url' => [
562 + 'regexPatternValidation' => [
563 + 'paths' => ['valid->regexr'],
564 + 'dependencies' => [
565 + 'generateBackslashPattern'
566 + ]
567 + ],
328 568 'urlFldValidation' => [
329 569 'paths' => ['err->invalid->show'],
330 570 'dependencies' => [
331 571 'generateBackslashPattern'
332 572 ]
573 + ],
574 + 'bit-input-mask' => [
575 + 'paths' => ['valid->inputMask'],
576 + ],
577 + 'inputMaskValidation' => [
578 + 'paths' => ['valid->inputMask'],
579 + 'dependencies' => [
580 + 'generateBackslashPattern',
581 + 'validation',
582 + ]
583 + ],
584 + 'setBitInputMaskToInput' => [
585 + 'paths' => ['valid->inputMask'],
586 + 'dependencies' => [
587 + 'bit-input-mask'
588 + ]
333 589 ]
334 590 ],
335 591 'decision-box' => [
336 592 'dcsnbxFldValidation' => [
@@ -336,8 +592,13 @@
336 592 'dcsnbxFldValidation' => [
337 593 'paths' => ['valid->req']
338 594 ]
339 595 ],
596 + 'gdpr' => [
597 + 'dcsnbxFldValidation' => [
598 + 'paths' => ['valid->req']
599 + ]
600 + ],
340 601 'file-up' => [
341 602 'fileupFldValidation' => [
342 603 'paths' => ['valid->req']
343 604 ]
@@ -351,8 +612,70 @@
351 612 'phoneNumberFldValidation' => [
352 613 'paths' => ['err->invalid->show'],
353 614 ]
354 615 ],
616 + 'currency' => [
617 + 'currencyFldValidation' => [
618 + 'paths' => ['err->minValue->show', 'err->maxValue->show'],
619 + ]
620 + ],
621 + 'date' => [
622 + 'bfDatetimeFldValidation' => [
623 + 'paths' => ['mn', 'mx'],
624 + 'dependencies' => [
625 + 'bfParseDateTime'
626 + ]
627 + ],
628 + ],
629 + 'time' => [
630 + 'bfDatetimeFldValidation' => [
631 + 'paths' => ['mn', 'mx'],
632 + 'dependencies' => [
633 + 'bfParseDateTime'
634 + ]
635 + ],
636 + ],
637 + 'week' => [
638 + 'bfDatetimeFldValidation' => [
639 + 'paths' => ['mn', 'mx'],
640 + 'dependencies' => [
641 + 'bfParseDateTime'
642 + ]
643 + ],
644 + ],
645 + 'month' => [
646 + 'bfDatetimeFldValidation' => [
647 + 'paths' => ['mn', 'mx'],
648 + 'dependencies' => [
649 + 'bfParseDateTime'
650 + ]
651 + ],
652 + ],
653 + 'datetime-local' => [
654 + 'bfDatetimeFldValidation' => [
655 + 'paths' => ['mn', 'mx'],
656 + 'dependencies' => [
657 + 'bfParseDateTime'
658 + ]
659 + ],
660 + ],
355 661 ];
356 662 return isset($fields[$fieldType]) ? $fields[$fieldType] : [];
663 + }
664 +
665 + public static function formAbandonmentNeededFiles($abandonType = null)
666 + {
667 + $files = [
668 + 'autoSave' => [
669 + ['priority' => 201, 'filename' => 'bit-page-lifecycle.min.js'],
670 + ['priority' => 402, 'filename' => 'autoSavePartial.min.js'],
671 + ]
672 + ];
673 +
674 + $required = [
675 + ['priority' => 402, 'filename' => 'bit-form-abandonment.min.js'],
676 + ['priority' => 401, 'filename' => 'saveFormProgress.min.js'],
677 + ['priority' => 701, 'filename' => 'setFieldValues.min.js'],
678 + ];
679 + return isset($files[$abandonType]) ? array_merge($files[$abandonType], $required) : $required;
357 680 }
358 681 }