PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.7.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.7.0
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 +245 -307 3.2.02.7.0 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,8 @@
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 - 'range' => [
68 - ['priority' => 301, 'filename' => 'setSliderFieldValue.min.js', 'path' => 'showValue'],
69 - ],
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 60 'country' => [
80 61 ['priority' => 101, 'filename' => 'observeElm.min.js'],
81 62 ['priority' => 301, 'filename' => 'bit-country-field.min.js'],
82 63 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
@@ -93,8 +74,15 @@
93 74 ['priority' => 301, 'filename' => 'bit-select-field.min.js'],
94 75 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
95 76 ['priority' => 101, 'filename' => 'observeElm.min.js'],
96 77 ],
78 + 'advanced-file-up' => [
79 + ['priority' => 101, 'filename' => 'observeElm.min.js'],
80 + ['priority' => 202, 'filename' => 'bit-filepond.min.js'],
81 + ['priority' => 301, 'filename' => 'bit-advanced-file-up-field.min.js'],
82 + ['priority' => 101, 'filename' => 'advancedFileHandle.min.js'],
83 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
84 + ],
97 85 'file-up' => [
98 86 ['priority' => 301, 'filename' => 'bit-file-up-field.min.js'],
99 87 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
100 88 ],
@@ -101,88 +89,80 @@
101 89 'phone-number' => [
102 90 ['priority' => 101, 'filename' => 'observeElm.min.js'],
103 91 ['priority' => 301, 'filename' => 'bit-phone-number-field.min.js'],
104 92 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
105 - // ['priority' => 101, 'filename' => 'observeElm.min.js'],
93 + ['priority' => 101, 'filename' => 'observeElm.min.js'],
106 94 ],
107 - 'section' => [
108 - ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
95 + 'paypal' => [
96 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
97 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
98 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
99 + ['priority' => 301, 'filename' => 'bit-paypal-field.min.js'],
109 100 ],
101 + 'stripe' => [
102 + ['priority' => 201, 'filename' => 'bitsFetchFront.min.js'],
103 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
104 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
105 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
106 + ['priority' => 301, 'filename' => 'bit-stripe-field.min.js'],
107 + ],
110 108 'repeater' => [
111 - ['priority' => 101, 'filename' => 'hideChildFldHandle.min.js'],
112 - ['priority' => 102, 'filename' => 'bit-repeater-field.min.js'],
109 + ['priority' => 301, 'filename' => 'bit-repeater-field.min.js'],
113 110 ['priority' => 701, 'filename' => 'checkRepeatedField.min.js'],
114 - ['priority' => 701, 'filename' => 'isRepeaterField.min.js'],
115 111 ['priority' => 701, 'filename' => 'getRepeatedIndexes.min.js'],
116 112 ['priority' => 701, 'filename' => 'getIndexesBaseOnConditions.min.js'],
117 113 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
118 114 ],
115 + 'razorpay' => [
116 + ['priority' => 201, 'filename' => 'isFormValidatedWithoutError.min.js'],
117 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
118 + ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
119 + ['priority' => 301, 'filename' => 'bit-razorpay-field.min.js'],
120 + ],
121 + 'radio' => [
122 + ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
123 + ],
124 + 'check' => [
125 + ['priority' => 301, 'filename' => 'OtherOptionJS', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'addOtherOpt'],
126 + ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
127 + ],
128 + 'image-select' => [
129 + ['priority' => 301, 'filename' => 'CheckDisableOnMax', 'scriptTyp' => 'custom', 'source' => $customSource, 'path' => 'valid->disableOnMax'],
130 + ],
119 131 'recaptcha' => [
120 132 ['priority' => 301, 'filename' => 'bit-recaptcha-field.min.js'],
121 - ['priority' => 302, 'filename' => 'scriptLoader.min.js'],
122 - ['priority' => 303, 'filename' => 'initRecaptchaFld.min.js'],
123 133 ],
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 134 'decision-box' => [
134 135 ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
135 136 ],
136 - 'gdpr' => [
137 - ['priority' => 101, 'filename' => 'decisionFldHandle.min.js'],
137 + 'signature' => [
138 + ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
139 + ['priority' => 301, 'filename' => 'bit-signature-field.min.js'],
138 140 ],
139 141 'rating' => [
140 142 ['priority' => 201, 'filename' => 'customFieldsReset.min.js'],
141 143 ['priority' => 301, 'filename' => 'bit-rating-field.min.js'],
142 144 ],
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 145 ];
146 + }
179 147
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);
148 + public static function filePondPlugins($plugin)
149 + {
150 + $plugins = [
151 + 'allowFileSizeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-size.min.js'],
152 + 'allowFileTypeValidation' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-file-validate-type.min.js'],
153 + 'allowImageCrop' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-crop.min.js'],
154 + 'allowImagePreview' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-preview.min.js'],
155 + 'allowImageResize' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-resize.min.js'],
156 + 'allowImageTransform' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-transform.min.js'],
157 + 'allowImageValidateSize' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-image-validate-size.min.js'],
158 + 'allowPreview' => ['priority' => 201, 'filename' => 'bit-filepond-plugin-media-preview.min.js'],
159 + ];
160 + if (array_key_exists($plugin, $plugins)) {
161 + return $plugins[$plugin];
162 + }
163 +
164 + return false;
185 165 }
186 166
187 167 public static function getAllFldConfs()
188 168 {
@@ -193,130 +173,133 @@
193 173 // var is for variable value
194 174 // path is for field path [ for multiple paths]
195 175 // val is for static value
196 176 $configs = [
197 -
198 177 '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],
178 + 'fieldKey' => ['var' => 'fieldKey'],
179 + 'options' => ['path' => 'optionsList'],
180 + 'placeholder' => ['path' => 'ph'],
181 + 'classNames' => ['path' => 'customClasses'],
182 + 'attributes' => ['path' => 'customAttributes'],
183 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
184 + 'separator' => ['val' => BITFORMS_BF_SEPARATOR],
185 + 'mn' => ['path' => 'mn', 'val' => 0],
186 + 'mx' => ['path' => 'mx', 'val' => 0],
187 + 'disableOnMax' => ['path' => 'valid->disableOnMax', 'val' => false],
214 188 ],
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 189 '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' => ''],
190 + 'fieldKey' => ['var' => 'fieldKey'],
191 + 'options' => ['path' => 'options'],
192 + 'placeholder' => ['path' => 'ph'],
193 + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
194 + 'classNames' => ['path' => 'customClasses'],
195 + 'attributes' => ['path' => 'customAttributes'],
196 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
240 197 ],
241 198 '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' => ''],
199 + 'fieldKey' => ['var' => 'fieldKey'],
200 + 'options' => ['path' => 'options'],
201 + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/currencies/'],
202 + 'classNames' => ['path' => 'customClasses'],
203 + 'attributes' => ['path' => 'customAttributes'],
204 + 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
252 205 ],
253 206 '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' => ''],
207 + 'fieldKey' => ['var' => 'fieldKey'],
208 + 'options' => ['path' => 'options'],
209 + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/countries/'],
210 + 'classNames' => ['path' => 'customClasses'],
211 + 'attributes' => ['path' => 'customAttributes']
264 212 ],
265 213 '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'],
214 + 'fieldKey' => ['var' => 'fieldKey'],
215 + 'formID' => ['var' => 'formId'],
216 + 'maxSizeErrMsg' => ['path' => ['err->maxSize->msg', 'err->maxSize->dflt']],
217 + 'minFileErrMsg' => ['path' => ['err->minFile->msg', 'err->minFile->dflt']],
218 + 'maxFileErrMsg' => ['path' => ['err->maxFile->msg', 'err->maxFile->dflt']],
219 + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload/'],
220 + 'classNames' => ['path' => 'customClasses'],
221 + 'attributes' => ['path' => 'customAttributes'],
222 + 'fieldName' => ['path' => 'fieldName'],
294 223 ],
224 + 'paypal' => [
225 + 'payIntegID' => ['path' => 'payIntegID'],
226 + 'style' => ['path' => 'style'],
227 + 'currency' => ['path' => 'currency', 'val' => 'USD'],
228 + 'amount' => ['path' => 'amount', 'val' => 0],
229 + 'amountFld' => ['path' => 'amountFld', 'val' => ''],
230 + 'shipping' => ['path' => 'shipping', 'val' => 0],
231 + 'shippingVal' => ['path' => 'shippingFld', 'val' => ''],
232 + 'tax' => ['path' => 'tax', 'val' => 0],
233 + 'taxVal' => ['path' => 'taxFld', 'val' => ''],
234 + 'description' => ['path' => 'description', 'val' => ''],
235 + 'descFld' => ['path' => 'descFld', 'val' => ''],
236 + 'payType' => ['path' => 'payType', 'val' => 'payment'],
237 + 'planId' => ['path' => 'planId', 'val' => ''],
238 + 'locale' => ['path' => 'locale', 'val' => 'en_US'],
239 + 'disableFunding' => ['path' => 'disableFunding', 'val' => ''],
240 + 'fieldKey' => ['var' => 'fieldKey'],
241 + 'clientId' => ['path' => 'clientId'],
242 + 'contentId' => ['var' => 'contentId'],
243 + 'namespace' => ['val' => 'bit-paypal-__$contentId__'],
244 + ],
245 + 'stripe' => [
246 + 'payIntegID' => ['path' => 'payIntegID'],
247 + 'locale' => ['path' => 'config->options->locale', 'val' => 'en'],
248 + 'amountType' => ['path' => 'config->amountType', 'val'=> 'fixed'],
249 + 'fieldKey' => ['var' => 'fieldKey'],
250 + 'contentId' => ['var' => 'contentId'],
251 + 'publishableKey' => ['path' => 'publishableKey'],
252 + ],
253 + 'advanced-file-up' => [
254 + 'fieldKey' => ['var' => 'fieldKey'],
255 + 'formID' => ['var' => 'formId'],
256 + 'configSetting' => ['path' => 'config'],
257 + 'ajaxURL' => ['val' => admin_url('admin-ajax.php')],
258 + 'nonce' => ['val' => wp_create_nonce('bitforms_save')],
259 + 'uploadFileToServer' => ['val' => 1],
260 + 'fieldName' => ['path' => 'fieldName'],
261 + ],
262 + 'razorpay' => [
263 + 'fieldKey' => ['var' => 'fieldKey'],
264 + 'options' => ['path' => 'options'],
265 + 'payIntegID' => ['path' => 'payIntegID'],
266 + 'payType' => ['path' =>'payType', 'val' => ''],
267 + 'clientId' => ['path' => 'clientId'],
268 + 'contentId' => ['var' => 'contentId'],
269 + ],
295 270 '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' => ''],
271 + 'fieldKey' => ['var' => 'fieldKey'],
272 + 'fieldName' => ['path' => 'fieldName'],
273 + 'contentId' => ['var' => 'contentId'],
274 + 'defaultRow' => ['path' => 'defaultRow', 'val' => 1],
275 + 'minimumRow' => ['path' => 'minRow', 'val' => 1],
276 + 'maximumRow' => ['path' => 'maxRow', 'val' => 0],
277 + 'showAddBtn' => ['path' => 'addBtn->show', 'val' => false],
278 + 'showAddToEndBtn' => ['path' => 'addToEndBtn->show', 'val' => false],
279 + 'defaultValue' => ['path' => 'val', 'val' => ''],
303 280 ],
281 + 'signature' => [
282 + 'fieldKey' => ['var' => 'fieldKey'],
283 + 'contentId' => ['var' => 'contentId'],
284 + 'maxWidth' => ['path' => 'config->maxWidth', 'val' => '1'],
285 + 'penColor' => ['path' => 'config->penColor', 'val'=> '#000000'],
286 + 'backgroundColor' => ['path' => 'config->backgroundColor', 'val' => '#ffffff'],
287 + 'imgTyp' => ['path' => 'config->imgTyp', 'val' => 'image/png'],
288 + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/signature/']
289 + ],
304 290 'rating' => [
305 291 'fieldKey' => ['var' => 'fieldKey'],
306 292 'contentId' => ['var' => 'contentId'],
307 293 'options' => ['path' => 'opt'],
294 + 'showReviewLblOnHover' => ['path' => 'showReviewLblOnHover'],
295 + 'showReviewLblOnSelect' => ['path' => 'showReviewLblOnSelect'],
308 296 'selectedRating' => ['path' => 'selectedRating'],
309 297 'defaultValue' => ['path' => ['val', 'config->defaultValue'], 'val'=> ''],
310 - ],
311 - 'hcaptcha'=> [
312 - 'fieldKey' => ['var'=>'fieldKey']
313 - ],
298 + ]
314 299 ];
315 - /**
316 - * Allow add-on plugins to extend field config mappings.
317 - */
318 - return apply_filters('bitform_field_config_paths', $configs);
300 +
301 + return $configs;
319 302 }
320 303
321 304 public static function multiStepFiles()
322 305 {
@@ -327,17 +310,8 @@
327 310 ['priority' => 700, 'filename' => 'bit-multi-step-form.min.js'],
328 311 ];
329 312 }
330 313
331 - public static function conversationalFormFiles()
332 - {
333 - return [
334 - ['priority' => 202, 'filename' => 'saveFormProgress.min.js'],
335 - ['priority' => 700, 'filename' => 'bit-conversational-form.min.js'],
336 - ['priority' => 700, 'filename' => 'handleConversationalFormMsg.min.js'],
337 - ];
338 - }
339 -
340 314 public static function frontendScriptFile()
341 315 {
342 316 return [
343 317 'observeElm' => ['priority' => 101, 'filename' => 'observeElm.min.js'],
@@ -344,52 +318,33 @@
344 318 'hidden-token-field' => ['priority' => 300, 'filename' => 'hidden-token-field.min.js'],
345 319 ];
346 320 }
347 321
348 - public static function validationAndOtherScriptFile()
322 + public static function validationScriptFile()
349 323 {
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
324 + return [
325 + 'checkFldValidation' => ['priority' => 701, 'filename' => 'checkFldValidation.min.js'],
326 + 'checkMinMaxOptions' => ['priority' => 702, 'filename' => 'checkMinMaxOptions.min.js'],
327 + 'customOptionValidation' => ['priority' => 702, 'filename' => 'customOptionValidation.min.js'],
328 + 'dcsnbxFldValidation' => ['priority' => 702, 'filename' => 'dcsnbxFldValidation.min.js'],
329 + 'emailFldValidation' => ['priority' => 702, 'filename' => 'emailFldValidation.min.js'],
330 + 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'],
331 + 'advanceFileupFldValidation' => ['priority' => 702, 'filename' => 'advanceFileUpFldValidation.min.js'],
332 + 'phoneNumberFldValidation' => ['priority' => 702, 'filename' => 'phoneNumberFldValidation.min.js'],
333 + 'generateBackslashPattern' => ['priority' => 700, 'filename' => 'generateBackslashPattern.min.js'],
334 + 'nmbrFldValidation' => ['priority' => 702, 'filename' => 'nmbrFldValidation.min.js'],
335 + 'regexPatternValidation' => ['priority' => 701, 'filename' => 'regexPatternValidation.min.js'], // load before generateBackslashPattern file, then load regexPatternValidation
336 + 'requiredFldValidation' => ['priority' => 700, 'filename' => 'requiredFldValidation.min.js'],
337 + 'urlFldValidation' => ['priority' => 702, 'filename' => 'urlFldValidation.min.js'],
338 + 'validation' => ['priority' => 705, 'filename' => 'validateForm.min.js'], // last priority for validation script
339 + 'conditionalLogic' => ['priority' => 705, 'filename' => 'bit-conditionals.min.js'], // last priority for validation script
340 + 'validateFocusLost' => ['priority' => 706, 'filename' => 'validate-focus.min.js'], // last priority for validation script
379 341 ];
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 342 }
386 343
387 344 public static function validationScriptFileMapping($fieldType)
388 345 {
389 - // Pro filter callbacks type-hint string; never let null/non-string through.
390 - $fieldType = is_string($fieldType) ? $fieldType : '';
391 - $textTypeField = ['text', 'password', 'username', 'color'];
346 + $textTypeField = ['text', 'password', 'username', 'date', 'datetime-local', 'time', 'month', 'week', 'color'];
392 347 if (in_array($fieldType, $textTypeField)) {
393 348 $fieldType = 'text';
394 349 }
395 350 $fields =
@@ -394,53 +349,15 @@
394 349 }
395 350 $fields =
396 351 [
397 352 'text' => [
398 - 'bit-input-mask' => [
399 - 'paths' => ['valid->inputMask'],
400 - ],
401 - 'inputMaskValidation' => [
402 - 'paths' => ['valid->inputMask'],
353 + 'regexPatternValidation' => [
354 + 'paths' => ['valid->regexr'],
403 355 'dependencies' => [
404 - 'generateBackslashPattern',
405 - 'validation',
356 + 'generateBackslashPattern'
406 357 ]
407 - ],
408 - 'setBitInputMaskToInput' => [
409 - 'paths' => ['valid->inputMask'],
410 - 'dependencies' => [
411 - 'bit-input-mask'
412 - ]
413 - ],
414 - 'textLengthValidation' => [
415 - 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->minword', 'valid->maxword']
416 - ],
417 - 'confirmFldMatch' => [
418 - 'paths' => ['parentFieldKey'],
419 358 ]
420 -
421 359 ],
422 - 'textarea' => [
423 - 'bit-input-mask' => [
424 - 'paths' => ['valid->inputMask'],
425 - ],
426 - 'inputMaskValidation' => [
427 - 'paths' => ['valid->inputMask'],
428 - 'dependencies' => [
429 - 'generateBackslashPattern',
430 - 'validation',
431 - ]
432 - ],
433 - 'setBitInputMaskToInput' => [
434 - 'paths' => ['valid->inputMask'],
435 - 'dependencies' => [
436 - 'bit-input-mask'
437 - ]
438 - ],
439 - 'textLengthValidation' => [
440 - 'paths' => ['valid->minlength', 'valid->maxlength', 'valid->minword', 'valid->maxword']
441 - ]
442 - ],
443 360 'email' => [
444 361 'emailFldValidation' => [
445 362 'paths' => ['err->invalid->show'],
446 363 'dependencies' => [
@@ -446,11 +363,8 @@
446 363 'dependencies' => [
447 364 'generateBackslashPattern'
448 365 ]
449 366 ],
450 - 'confirmFldMatch' => [
451 - 'paths' => ['parentFieldKey'],
452 - ]
453 367 ],
454 368 'number' => [
455 369 'nmbrFldValidation' => [
456 370 'paths' => ['mn', 'mx']
@@ -455,35 +369,52 @@
455 369 'nmbrFldValidation' => [
456 370 'paths' => ['mn', 'mx']
457 371 ]
458 372 ],
459 - 'range' => [
460 - 'checkMinMaxValue' => [
461 - 'paths' => ['mn', 'mx']
373 + 'radio' => [
374 + 'customOptionValidation' => [
375 + 'paths' => ['valid->otherOptReq'],
462 376 ]
463 377 ],
464 - 'url' => [
465 - 'urlFldValidation' => [
466 - 'paths' => ['err->invalid->show'],
378 + 'check' => [
379 + 'checkMinMaxOptions' => [
380 + 'paths' => ['mn', 'mx'],
467 381 'dependencies' => [
468 - 'generateBackslashPattern'
382 + 'checkFldValidation'
469 383 ]
470 384 ],
471 - 'bit-input-mask' => [
472 - 'paths' => ['valid->inputMask'],
385 + 'customOptionValidation' => [
386 + 'paths' => ['valid->otherOptReq'],
387 + ]
388 + ],
389 + 'select' => [
390 + 'checkMinMaxOptions' => [
391 + 'paths' => ['mn', 'mx'],
392 + 'dependencies' => [
393 + 'checkFldValidation'
394 + ]
473 395 ],
474 - 'inputMaskValidation' => [
475 - 'paths' => ['valid->inputMask'],
396 + ],
397 + 'image-select' => [
398 + 'checkMinMaxOptions' => [
399 + 'paths' => ['mn', 'mx'],
476 400 'dependencies' => [
477 - 'generateBackslashPattern',
478 - 'validation',
401 + 'checkFldValidation'
479 402 ]
480 403 ],
481 - 'setBitInputMaskToInput' => [
482 - 'paths' => ['valid->inputMask'],
404 + ],
405 + 'url' => [
406 + 'regexPatternValidation' => [
407 + 'paths' => ['valid->regexr'],
483 408 'dependencies' => [
484 - 'bit-input-mask'
409 + 'generateBackslashPattern'
485 410 ]
411 + ],
412 + 'urlFldValidation' => [
413 + 'paths' => ['err->invalid->show'],
414 + 'dependencies' => [
415 + 'generateBackslashPattern'
416 + ]
486 417 ]
487 418 ],
488 419 'decision-box' => [
489 420 'dcsnbxFldValidation' => [
@@ -489,15 +420,15 @@
489 420 'dcsnbxFldValidation' => [
490 421 'paths' => ['valid->req']
491 422 ]
492 423 ],
493 - 'gdpr' => [
494 - 'dcsnbxFldValidation' => [
424 + 'file-up' => [
425 + 'fileupFldValidation' => [
495 426 'paths' => ['valid->req']
496 427 ]
497 428 ],
498 - 'file-up' => [
499 - 'fileupFldValidation' => [
429 + 'advanced-file-up' => [
430 + 'advanceFileupFldValidation' => [
500 431 'paths' => ['valid->req']
501 432 ]
502 433 ],
503 434 'phone-number' => [
@@ -504,21 +435,28 @@
504 435 'phoneNumberFldValidation' => [
505 436 'paths' => ['err->invalid->show'],
506 437 ]
507 438 ],
508 - 'address' => [
509 - 'addressZipFldValidation' => [
510 - 'paths' => ['config->zipValidation'],
511 - 'dependencies' => [
512 - 'validation',
513 - ]
514 - ]
515 - ],
516 439 ];
517 - $mapping = isset($fields[$fieldType]) ? $fields[$fieldType] : [];
440 + return isset($fields[$fieldType]) ? $fields[$fieldType] : [];
441 + }
518 442
519 - /**
520 - * Allow pro add-ons to extend/override mapping per field type.
521 - */
522 - return apply_filters('bitform_field_validation_script_file_mapping', $mapping, $fieldType);
443 + public static function formAbandonmentNeededFiles($abandonType = null)
444 + {
445 + $files = [
446 + 'draftButton' => [
447 + ['priority' => 401, 'filename' => 'saveDraftButtonEvent.js']
448 + ],
449 + 'autoSave' => [
450 + ['priority' => 201, 'filename' => 'bit-page-lifecycle.min.js'],
451 + ['priority' => 402, 'filename' => 'autoSavePartial.min.js'],
452 + ]
453 + ];
454 +
455 + $required = [
456 + ['priority' => 402, 'filename' => 'bit-form-abandonment.min.js'],
457 + ['priority' => 401, 'filename' => 'saveFormProgress.min.js'],
458 + ['priority' => 701, 'filename' => 'setFieldValues.min.js'],
459 + ];
460 + return isset($files[$abandonType]) ? array_merge($files[$abandonType], $required) : $required;
523 461 }
524 462 }