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
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 +270 -290 3.1.42.15.3 View file →
@@ -42,14 +42,14 @@
42 42 submit js
43 43 custom js
44 44 */
45 45 $initSource = '\\BitCode\\BitForm\\Admin\\Form\\InitJs\\';
46 - $files = [
46 + $customSource = '\\BitCode\\BitForm\\Admin\\Form\\ExtraFieldJS\\';
47 + return [
47 48 'helperScript' => [
48 49 ['priority' => 101, 'filename' => 'bfSelect.min.js'],
49 50 ['priority' => 101, 'filename' => 'bfReset.min.js'],
50 51 ['priority' => 101, 'filename' => 'setBFMsg.min.js'],
51 - ['priority' => 101, 'filename' => 'bfSplit.min.js'],
52 52 ['priority' => 101, 'filename' => 'scrollToElm.min.js'],
53 53 ['priority' => 101, 'filename' => 'getFldKeyAndRowIndx.min.js'],
54 54 ['priority' => 101, 'filename' => 'moveToFirstErrFld.min.js'],
55 55 ['priority' => 101, 'filename' => 'bfValidationErrMsg.min.js'],
@@ -56,27 +56,11 @@
56 56 ['priority' => 101, 'filename' => 'setHiddenFld.min.js'],
57 57 ['priority' => 101, 'filename' => 'submit-form.min.js'],
58 58 ['priority' => 101, 'filename' => 'setStyleProperty.min.js']
59 59 ],
60 -
61 - 'text' => [
62 - ['priority' => 301, 'filename' => 'initTextLengthHelper.min.js', 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->maxword', 'valid->minword']],
63 - ],
64 - 'textarea' => [
65 - ['priority' => 301, 'filename' => 'initTextLengthHelper.min.js', 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->maxword', 'valid->minword']],
66 - ],
67 60 'range' => [
68 - ['priority' => 301, 'filename' => 'setSliderFieldValue.min.js', 'path' => 'showValue'],
61 + ['priority' => 301, 'filename' => 'SetSliderFieldValue', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'showValue'],
69 62 ],
70 - 'password' => [
71 - ['priority' => 301, 'filename' => 'initPasswordStrengthHelper.min.js', 'path' => 'valid->validations'],
72 - ['priority' => 301, 'filename' => 'bfTogglePasswordVisibility.min.js', 'path' => 'config->showPasswordIcon'],
73 - ],
74 - 'address' => [
75 - ['priority' => 101, 'filename' => 'observeElm.min.js'],
76 - ['priority' => 301, 'filename' => 'bit-address-field.min.js'],
77 - ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
78 - ],
79 63 'country' => [
80 64 ['priority' => 101, 'filename' => 'observeElm.min.js'],
81 65 ['priority' => 301, 'filename' => 'bit-country-field.min.js'],
82 66 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
@@ -93,8 +77,15 @@
93 77 ['priority' => 301, 'filename' => 'bit-select-field.min.js'],
94 78 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
95 79 ['priority' => 101, 'filename' => 'observeElm.min.js'],
96 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 + ],
97 88 'file-up' => [
98 89 ['priority' => 301, 'filename' => 'bit-file-up-field.min.js'],
99 90 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
100 91 ],
@@ -101,88 +92,88 @@
101 92 'phone-number' => [
102 93 ['priority' => 101, 'filename' => 'observeElm.min.js'],
103 94 ['priority' => 301, 'filename' => 'bit-phone-number-field.min.js'],
104 95 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
105 - // ['priority' => 101, 'filename' => 'observeElm.min.js'],
96 + ['priority' => 101, 'filename' => 'observeElm.min.js'],
106 97 ],
107 - 'section' => [
108 - ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
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'],
109 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 + ],
110 118 'repeater' => [
111 - ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
112 119 ['priority' => 102, 'filename' => 'bit-repeater-field.min.js'],
113 120 ['priority' => 701, 'filename' => 'checkRepeatedField.min.js'],
114 - ['priority' => 701, 'filename' => 'isRepeaterField.min.js'],
115 121 ['priority' => 701, 'filename' => 'getRepeatedIndexes.min.js'],
116 122 ['priority' => 701, 'filename' => 'getIndexesBaseOnConditions.min.js'],
117 123 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
118 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 + ],
119 142 'recaptcha' => [
120 143 ['priority' => 301, 'filename' => 'bit-recaptcha-field.min.js'],
121 - ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
122 - ['priority' => 303, 'filename' => 'initRecaptchaFld.min.js'],
123 144 ],
124 - 'hcaptcha' => [
125 - ['priority' => 301, 'filename' => 'bit-hcaptcha-field.min.js'],
126 - ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
127 - ['priority' => 303, 'filename' => 'initHCaptchaFld.min.js'],
128 - ],
129 - 'turnstile' => [
130 - ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
131 - ['priority' => 303, 'filename' => 'initTurnstileFld.min.js'],
132 - ],
133 145 'decision-box' => [
134 146 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
135 147 ],
136 - 'gdpr' => [
137 - ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
148 + 'signature' => [
149 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
150 + ['priority' => 301, 'filename' => 'bit-signature-field.min.js'],
138 151 ],
139 152 'rating' => [
140 153 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
141 154 ['priority' => 301, 'filename' => 'bit-rating-field.min.js'],
142 155 ],
143 - 'date' => [
144 - ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
145 - ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
146 - ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
147 - ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
148 - ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
149 - ],
150 - 'datetime-local' => [
151 - ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
152 - ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
153 - ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
154 - ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
155 - ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
156 - ],
157 - 'time' => [
158 - ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
159 - ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
160 - ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
161 - ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
162 - ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
163 - ],
164 - 'month' => [
165 - ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
166 - ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
167 - ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
168 - ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
169 - ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
170 - ],
171 - 'week' => [
172 - ['priority' => 301, 'filename' => 'bfDateFieldsLogicCheck.min.js'],
173 - ['priority' => 301, 'filename' => 'bfCalculateDateTimeDifference.min.js'],
174 - ['priority' => 301, 'filename' => 'bfAddOrSubtractDateTime.min.js'],
175 - ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
176 - ['priority' => 301, 'filename' => 'bfFormatDateTime.min.js'],
177 - ],
178 156 ];
157 + }
179 158
180 - /**
181 - * Allow add-on plugins (e.g. Pro) to register additional script files
182 - * without shipping those files/paths in the wp.org (free) package.
183 - */
184 - return apply_filters('bitform_script_file_priority_list', $files);
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;
185 176 }
186 177
187 178 public static function getAllFldConfs()
188 179 {
@@ -193,130 +184,149 @@
193 184 // var is for variable value
194 185 // path is for field path [ for multiple paths]
195 186 // val is for static value
196 187 $configs = [
197 -
198 188 'select' => [
199 - 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
200 - 'fieldKey' => ['var' => 'fieldKey'],
201 - 'options' => ['path' => 'optionsList'],
202 - 'placeholder' => ['path' => 'ph'],
203 - 'classNames' => ['path' => 'customClasses'],
204 - 'attributes' => ['path' => 'customAttributes'],
205 - 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
206 - 'separator' => ['val' => BITFORMS_BF_SEPARATOR],
207 - 'multipleSelect' => ['path' => 'config->multipleSelect', 'val' => false],
208 - 'showChip' => ['path' => 'config->showChip', 'val' => false],
209 - 'selectedOptClearable' => ['path' => 'config->selectedOptClearable', 'val' => true],
210 - 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
211 - 'showSearch' => ['path' => 'config->showSearch', 'val' => true],
212 - 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
213 - 'activeList' => ['path' => 'config->activeList', 'val' => 0],
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],
214 199 ],
215 - 'address' => [
216 - 'config' => (object) [],
217 - 'fieldKey' => ['var' => 'fieldKey'],
218 - 'contentId' => ['var' => 'contentId'],
219 - 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/address/'],
220 - 'fieldName' => ['path' => 'fieldName'],
221 - 'classNames' => ['path' => 'customClasses'],
222 - 'attributes' => ['path' => 'customAttributes'],
223 - 'defaultCountry' => ['path' => 'config->defaultCountry', 'val' => ''],
224 - 'zipValidation' => ['path' => 'config->zipValidation', 'val' => 'auto'],
225 - 'zipCustomRegex' => ['path' => 'config->zipCustomRegex', 'val' => ''],
226 -
227 - ],
228 200 'country' => [
229 - 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
230 - 'fieldKey' => ['var' => 'fieldKey'],
231 - 'options' => ['path' => 'options'],
232 - 'placeholder' => ['path' => 'ph'],
233 - 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
234 - 'classNames' => ['path' => 'customClasses'],
235 - 'attributes' => ['path' => 'customAttributes'],
236 - 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
237 - 'selectedCountryClearable' => ['path' => 'config->selectedCountryClearable', 'val' => true],
238 - 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
239 - 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
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'=> ''],
240 208 ],
241 209 'currency' => [
242 - 'config' => (object) [], // sentinel: blocks raw fldData.config
243 - 'fieldKey' => ['var' => 'fieldKey'],
244 - 'options' => ['path' => 'options'],
245 - 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
246 - 'classNames' => ['path' => 'customClasses'],
247 - 'attributes' => ['path' => 'customAttributes'],
248 - 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val' => ''],
249 - 'selectedCurrencyClearable' => ['path' => 'config->selectedCurrencyClearable', 'val' => true],
250 - 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
251 - 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
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'=> ''],
252 216 ],
253 217 'phone-number' => [
254 - 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
255 - 'fieldKey' => ['var' => 'fieldKey'],
256 - 'options' => ['path' => 'options'],
257 - 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
258 - 'classNames' => ['path' => 'customClasses'],
259 - 'attributes' => ['path' => 'customAttributes'],
260 - 'contentId' => ['var' => 'contentId'],
261 - 'selectedCountryClearable' => ['path' => 'config->selectedCountryClearable', 'val' => true],
262 - 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true],
263 - 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''],
218 + 'fieldKey' => ['var' => 'fieldKey'],
219 + 'options' => ['path' => 'options'],
220 + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
221 + 'classNames' => ['path' => 'customClasses'],
222 + 'attributes' => ['path' => 'customAttributes']
264 223 ],
265 224 'file-up' => [
266 - 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough;
267 - 'fieldKey' => ['var' => 'fieldKey'],
268 - 'formID' => ['var' => 'formId'],
269 - 'maxSizeErrMsg' => ['path' => ['err->maxSize->msg', 'err->maxSize->dflt']],
270 - 'minFileErrMsg' => ['path' => ['err->minFile->msg', 'err->minFile->dflt']],
271 - 'maxFileErrMsg' => ['path' => ['err->maxFile->msg', 'err->maxFile->dflt']],
272 - 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload'],
273 - 'classNames' => ['path' => 'customClasses'],
274 - 'attributes' => ['path' => 'customAttributes'],
275 - 'fieldName' => ['path' => 'fieldName'],
276 - 'contentId' => ['var' => 'contentId'],
277 - 'multiple' => ['path' => 'config->multiple', 'val' => false],
278 - 'allowMaxSize' => ['path' => 'config->allowMaxSize', 'val' => false],
279 - 'maxSize' => ['path' => 'config->maxSize', 'val' => 0],
280 - 'sizeUnit' => ['path' => 'config->sizeUnit', 'val' => 'KB'],
281 - 'isItTotalMax' => ['path' => 'config->isItTotalMax', 'val' => false],
282 - 'allowedFileType' => ['path' => 'config->allowedFileType', 'val' => ''],
283 - 'minFile' => ['path' => 'config->minFile', 'val' => 0],
284 - 'maxFile' => ['path' => 'config->maxFile', 'val' => 0],
285 - 'showSelectStatus' => ['path' => 'config->showSelectStatus', 'val' => false],
286 - 'fileSelectStatus' => ['path' => 'config->fileSelectStatus', 'val' => 'No File Selected'],
287 - 'oldFiles' => ['path' => 'config->oldFiles', 'val' => []],
288 - 'baseDLURL' => ['path' => 'config->baseDLURL', 'val' => ''],
289 - 'fileExistMsg' => ['val' => 'A file already exist'],
290 - 'showFileList' => ['path' => 'config->showFileList', 'val' => false],
291 - 'showFilePreview' => ['path' => 'config->showFilePreview', 'val' => false],
292 - 'showFileSize' => ['path' => 'config->showFileSize', 'val' => false],
293 - 'fileExistMsg' => ['path' => 'config->fileExistMsg', 'val' => 'A file already exist'],
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'],
294 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 + ],
295 297 'repeater' => [
296 - 'config' => (object) [],
297 - 'fieldKey' => ['var' => 'fieldKey'],
298 - 'fieldName' => ['path' => 'fieldName'],
299 - 'contentId' => ['var' => 'contentId'],
300 - 'showAddBtn' => ['path' => 'addBtn->show', 'val' => false],
301 - 'showAddToEndBtn' => ['path' => 'addToEndBtn->show', 'val' => false],
302 - 'defaultValue' => ['path' => 'val', 'val' => ''],
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' => ''],
303 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 + ],
304 317 'rating' => [
305 318 'fieldKey' => ['var' => 'fieldKey'],
306 319 'contentId' => ['var' => 'contentId'],
307 320 'options' => ['path' => 'opt'],
321 + 'showReviewLblOnHover' => ['path' => 'showReviewLblOnHover'],
322 + 'showReviewLblOnSelect' => ['path' => 'showReviewLblOnSelect'],
308 323 'selectedRating' => ['path' => 'selectedRating'],
309 324 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
310 - ],
311 - 'hcaptcha'=> [
312 - 'fieldKey' => ['var'=>'fieldKey']
313 - ],
325 + ]
314 326 ];
315 - /**
316 - * Allow add-on plugins to extend field config mappings.
317 - */
318 - return apply_filters('bitform_field_config_paths', $configs);
327 +
328 + return $configs;
319 329 }
320 330
321 331 public static function multiStepFiles()
322 332 {
@@ -346,48 +356,33 @@
346 356 }
347 357
348 358 public static function validationAndOtherScriptFile()
349 359 {
350 - $files = [
351 - 'confirmFldMatch' => ['priority' => 701, 'filename' => 'confirmFldMatch.min.js'],
352 - 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
353 - // 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
354 - // 'bfDatetimeFldValidation' => ['priority' => 702, 'filename' => 'bfDatetimeFldValidation.min.js'],
355 - 'bfParseDateTime' => ['priority' => 301, 'filename' => 'bfParseDateTime.min.js'],
356 - 'checkMinMaxValue' => ['priority' => 702, 'filename' => 'checkMinMaxValue.min.js'],
357 - 'textLengthValidation' => ['priority' => 702, 'filename' => 'textLengthValidation.min.js'],
358 - 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
359 - 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
360 - 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
361 - 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
362 - 'advanceFileupFldValidation' => ['priority' => 702, 'filename' => 'advanceFileUpFldValidation.min.js'],
363 - 'phoneNumberFldValidation' => ['priority' => 702, 'filename' => 'phoneNumberFldValidation.min.js'],
364 - 'currencyFldValidation' => ['priority' => 702, 'filename' => 'currencyFldValidation.min.js'],
365 - 'addressZipFldValidation' => ['priority' => 702, 'filename' => 'addressZipFldValidation.min.js'],
366 - 'generateBackslashPattern' => ['priority' => 700, 'filename' => 'generateBackslashPattern.min.js'],
367 - // 'nmbrFldValidation' => ['priority' => 702, 'filename' => 'nmbrFldValidation.min.js'],
368 - // 'regexPatternValidation' => ['priority' => 701, 'filename' => 'regexPatternValidation.min.js'], // load before generateBackslashPattern file, then load regexPatternValidation
369 - 'inputMaskValidation' => ['priority' => 701, 'filename' => 'inputMaskValidation.min.js'], // load before generateBackslashPattern file, then load inputMaskValidation
370 - 'bit-input-mask' => ['priority' => 701, 'filename' => 'bit-input-mask.min.js'], // load before generateBackslashPattern file, then load bit-input-mask
371 - 'setBitInputMaskToInput' => ['priority' => 702, 'filename' => 'setBitInputMaskToInput.min.js'], // load before generateBackslashPattern file, then load setBitInputMaskToInput
372 - 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
373 - 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
374 - 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
375 - 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
376 - 'resetPlaceholders' => ['priority' => 201, 'filename' => 'resetPlaceholders.min.js'],
377 - 'bfResetDefaultValue' => ['priority' => 201, 'filename' => 'bfResetDefaultValue.min.js'],
378 - 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
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 379 ];
380 -
381 - /**
382 - * Allow add-on plugins to register additional validation scripts.
383 - */
384 - return apply_filters('bitform_validation_and_other_script_files', $files);
385 380 }
386 381
387 382 public static function validationScriptFileMapping($fieldType)
388 383 {
389 - $textTypeField = ['text', 'password', 'username', 'color'];
384 + $textTypeField = ['text', 'password', 'username', 'date', 'datetime-local', 'time', 'month', 'week', 'color'];
390 385 if (in_array($fieldType, $textTypeField)) {
391 386 $fieldType = 'text';
392 387 }
393 388 $fields =
@@ -392,69 +387,60 @@
392 387 }
393 388 $fields =
394 389 [
395 390 'text' => [
396 - 'bit-input-mask' => [
397 - 'paths' => ['valid->inputMask'],
398 - ],
399 - 'inputMaskValidation' => [
400 - 'paths' => ['valid->inputMask'],
391 + 'regexPatternValidation' => [
392 + 'paths' => ['valid->regexr'],
401 393 'dependencies' => [
402 - 'generateBackslashPattern',
403 - 'validation',
394 + 'generateBackslashPattern'
404 395 ]
405 - ],
406 - 'setBitInputMaskToInput' => [
407 - 'paths' => ['valid->inputMask'],
396 + ]
397 + ],
398 + 'email' => [
399 + 'emailFldValidation' => [
400 + 'paths' => ['err->invalid->show'],
408 401 'dependencies' => [
409 - 'bit-input-mask'
402 + 'generateBackslashPattern'
410 403 ]
411 404 ],
412 - 'textLengthValidation' => [
413 - 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->minword', 'valid->maxword']
414 - ],
415 - 'confirmFldMatch' => [
416 - 'paths' => ['parentFieldKey'],
405 + ],
406 + 'number' => [
407 + 'nmbrFldValidation' => [
408 + 'paths' => ['mn', 'mx']
417 409 ]
418 -
419 410 ],
420 - 'textarea' => [
421 - 'bit-input-mask' => [
422 - 'paths' => ['valid->inputMask'],
423 - ],
424 - 'inputMaskValidation' => [
425 - 'paths' => ['valid->inputMask'],
411 + 'radio' => [
412 + 'customOptionValidation' => [
413 + 'paths' => ['valid->otherOptReq'],
414 + ]
415 + ],
416 + 'check' => [
417 + 'checkMinMaxOptions' => [
418 + 'paths' => ['mn', 'mx'],
426 419 'dependencies' => [
427 - 'generateBackslashPattern',
428 - 'validation',
420 + 'checkFldValidation'
429 421 ]
430 422 ],
431 - 'setBitInputMaskToInput' => [
432 - 'paths' => ['valid->inputMask'],
423 + 'customOptionValidation' => [
424 + 'paths' => ['valid->otherOptReq'],
425 + ]
426 + ],
427 + 'select' => [
428 + 'checkMinMaxOptions' => [
429 + 'paths' => ['mn', 'mx'],
433 430 'dependencies' => [
434 - 'bit-input-mask'
431 + 'checkFldValidation'
435 432 ]
436 433 ],
437 - 'textLengthValidation' => [
438 - 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->minword', 'valid->maxword']
439 - ]
440 434 ],
441 - 'email' => [
442 - 'emailFldValidation' => [
443 - 'paths' => ['err->invalid->show'],
435 + 'image-select' => [
436 + 'checkMinMaxOptions' => [
437 + 'paths' => ['mn', 'mx'],
444 438 'dependencies' => [
445 - 'generateBackslashPattern'
439 + 'checkFldValidation'
446 440 ]
447 441 ],
448 - 'confirmFldMatch' => [
449 - 'paths' => ['parentFieldKey'],
450 - ]
451 442 ],
452 - 'number' => [
453 - 'nmbrFldValidation' => [
454 - 'paths' => ['mn', 'mx']
455 - ]
456 - ],
457 443 'range' => [
458 444 'checkMinMaxValue' => [
459 445 'paths' => ['mn', 'mx']
460 446 ]
@@ -459,29 +445,19 @@
459 445 'paths' => ['mn', 'mx']
460 446 ]
461 447 ],
462 448 'url' => [
463 - 'urlFldValidation' => [
464 - 'paths' => ['err->invalid->show'],
449 + 'regexPatternValidation' => [
450 + 'paths' => ['valid->regexr'],
465 451 'dependencies' => [
466 452 'generateBackslashPattern'
467 453 ]
468 454 ],
469 - 'bit-input-mask' => [
470 - 'paths' => ['valid->inputMask'],
471 - ],
472 - 'inputMaskValidation' => [
473 - 'paths' => ['valid->inputMask'],
455 + 'urlFldValidation' => [
456 + 'paths' => ['err->invalid->show'],
474 457 'dependencies' => [
475 - 'generateBackslashPattern',
476 - 'validation',
458 + 'generateBackslashPattern'
477 459 ]
478 - ],
479 - 'setBitInputMaskToInput' => [
480 - 'paths' => ['valid->inputMask'],
481 - 'dependencies' => [
482 - 'bit-input-mask'
483 - ]
484 460 ]
485 461 ],
486 462 'decision-box' => [
487 463 'dcsnbxFldValidation' => [
@@ -487,15 +463,15 @@
487 463 'dcsnbxFldValidation' => [
488 464 'paths' => ['valid->req']
489 465 ]
490 466 ],
491 - 'gdpr' => [
492 - 'dcsnbxFldValidation' => [
467 + 'file-up' => [
468 + 'fileupFldValidation' => [
493 469 'paths' => ['valid->req']
494 470 ]
495 471 ],
496 - 'file-up' => [
497 - 'fileupFldValidation' => [
472 + 'advanced-file-up' => [
473 + 'advanceFileupFldValidation' => [
498 474 'paths' => ['valid->req']
499 475 ]
500 476 ],
501 477 'phone-number' => [
@@ -502,21 +478,25 @@
502 478 'phoneNumberFldValidation' => [
503 479 'paths' => ['err->invalid->show'],
504 480 ]
505 481 ],
506 - 'address' => [
507 - 'addressZipFldValidation' => [
508 - 'paths' => ['config->zipValidation'],
509 - 'dependencies' => [
510 - 'validation',
511 - ]
512 - ]
513 - ],
514 482 ];
515 - $mapping = isset($fields[$fieldType]) ? $fields[$fieldType] : [];
483 + return isset($fields[$fieldType]) ? $fields[$fieldType] : [];
484 + }
516 485
517 - /**
518 - * Allow pro add-ons to extend/override mapping per field type.
519 - */
520 - return apply_filters('bitform_field_validation_script_file_mapping', $mapping, $fieldType);
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;
521 501 }
522 502 }