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