| @@ -70,8 +70,13 @@ | ||
| 70 | 70 | 'password' => [ |
| 71 | 71 | ['priority' => 301, 'filename' => 'initPasswordStrengthHelper.min.js', 'path' => 'valid->validations'], |
| 72 | 72 | ['priority' => 301, 'filename' => 'bfTogglePasswordVisibility.min.js', 'path' => 'config->showPasswordIcon'], |
| 73 | 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 | + ], | |
| 74 | 79 | 'country' => [ |
| 75 | 80 | ['priority' => 101, 'filename' => 'observeElm.min.js'], |
| 76 | 81 | ['priority' => 301, 'filename' => 'bit-country-field.min.js'], |
| 77 | 82 | ['priority' => 201, 'filename' => 'customFieldsReset.min.js'], |
| @@ -202,11 +207,25 @@ | ||
| 202 | 207 | 'multipleSelect' => ['path' => 'config->multipleSelect', 'val' => false], |
| 203 | 208 | 'showChip' => ['path' => 'config->showChip', 'val' => false], |
| 204 | 209 | 'selectedOptClearable' => ['path' => 'config->selectedOptClearable', 'val' => true], |
| 205 | 210 | 'searchClearable' => ['path' => 'config->searchClearable', 'val' => true], |
| 211 | + 'showSearch' => ['path' => 'config->showSearch', 'val' => true], | |
| 206 | 212 | 'searchPlaceholder' => ['path' => 'config->searchPlaceholder', 'val' => ''], |
| 207 | 213 | 'activeList' => ['path' => 'config->activeList', 'val' => 0], |
| 208 | 214 | ], |
| 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 | + ], | |
| 209 | 228 | 'country' => [ |
| 210 | 229 | 'config' => (object) [], // sentinel: blocks raw fldData.config passthrough; |
| 211 | 230 | 'fieldKey' => ['var' => 'fieldKey'], |
| 212 | 231 | 'options' => ['path' => 'options'], |
| @@ -249,9 +268,9 @@ | ||
| 249 | 268 | 'formID' => ['var' => 'formId'], |
| 250 | 269 | 'maxSizeErrMsg' => ['path' => ['err->maxSize->msg', 'err->maxSize->dflt']], |
| 251 | 270 | 'minFileErrMsg' => ['path' => ['err->minFile->msg', 'err->minFile->dflt']], |
| 252 | 271 | 'maxFileErrMsg' => ['path' => ['err->maxFile->msg', 'err->maxFile->dflt']], |
| 253 | - 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload/'], | |
| 272 | + 'assetsURL' => ['val' => BITFORMS_ROOT_URI . '/static/file-upload'], | |
| 254 | 273 | 'classNames' => ['path' => 'customClasses'], |
| 255 | 274 | 'attributes' => ['path' => 'customAttributes'], |
| 256 | 275 | 'fieldName' => ['path' => 'fieldName'], |
| 257 | 276 | 'contentId' => ['var' => 'contentId'], |
| @@ -264,8 +283,10 @@ | ||
| 264 | 283 | 'minFile' => ['path' => 'config->minFile', 'val' => 0], |
| 265 | 284 | 'maxFile' => ['path' => 'config->maxFile', 'val' => 0], |
| 266 | 285 | 'showSelectStatus' => ['path' => 'config->showSelectStatus', 'val' => false], |
| 267 | 286 | 'fileSelectStatus' => ['path' => 'config->fileSelectStatus', 'val' => 'No File Selected'], |
| 287 | + 'oldFiles' => ['path' => 'config->oldFiles', 'val' => []], | |
| 288 | + 'baseDLURL' => ['path' => 'config->baseDLURL', 'val' => ''], | |
| 268 | 289 | 'fileExistMsg' => ['val' => 'A file already exist'], |
| 269 | 290 | 'showFileList' => ['path' => 'config->showFileList', 'val' => false], |
| 270 | 291 | 'showFilePreview' => ['path' => 'config->showFilePreview', 'val' => false], |
| 271 | 292 | 'showFileSize' => ['path' => 'config->showFileSize', 'val' => false], |
| @@ -340,8 +361,9 @@ | ||
| 340 | 361 | 'fileupFldValidation' => ['priority' => 702, 'filename' => 'fileupFldValidation.min.js'], |
| 341 | 362 | 'advanceFileupFldValidation' => ['priority' => 702, 'filename' => 'advanceFileUpFldValidation.min.js'], |
| 342 | 363 | 'phoneNumberFldValidation' => ['priority' => 702, 'filename' => 'phoneNumberFldValidation.min.js'], |
| 343 | 364 | 'currencyFldValidation' => ['priority' => 702, 'filename' => 'currencyFldValidation.min.js'], |
| 365 | + 'addressZipFldValidation' => ['priority' => 702, 'filename' => 'addressZipFldValidation.min.js'], | |
| 344 | 366 | 'generateBackslashPattern' => ['priority' => 700, 'filename' => 'generateBackslashPattern.min.js'], |
| 345 | 367 | // 'nmbrFldValidation' => ['priority' => 702, 'filename' => 'nmbrFldValidation.min.js'], |
| 346 | 368 | // 'regexPatternValidation' => ['priority' => 701, 'filename' => 'regexPatternValidation.min.js'], // load before generateBackslashPattern file, then load regexPatternValidation |
| 347 | 369 | 'inputMaskValidation' => ['priority' => 701, 'filename' => 'inputMaskValidation.min.js'], // load before generateBackslashPattern file, then load inputMaskValidation |
| @@ -363,8 +385,10 @@ | ||
| 363 | 385 | } |
| 364 | 386 | |
| 365 | 387 | public static function validationScriptFileMapping($fieldType) |
| 366 | 388 | { |
| 389 | + // Pro filter callbacks type-hint string; never let null/non-string through. | |
| 390 | + $fieldType = is_string($fieldType) ? $fieldType : ''; | |
| 367 | 391 | $textTypeField = ['text', 'password', 'username', 'color']; |
| 368 | 392 | if (in_array($fieldType, $textTypeField)) { |
| 369 | 393 | $fieldType = 'text'; |
| 370 | 394 | } |
| @@ -478,8 +502,16 @@ | ||
| 478 | 502 | ], |
| 479 | 503 | 'phone-number' => [ |
| 480 | 504 | 'phoneNumberFldValidation' => [ |
| 481 | 505 | 'paths' => ['err->invalid->show'], |
| 506 | + ] | |
| 507 | + ], | |
| 508 | + 'address' => [ | |
| 509 | + 'addressZipFldValidation' => [ | |
| 510 | + 'paths' => ['config->zipValidation'], | |
| 511 | + 'dependencies' => [ | |
| 512 | + 'validation', | |
| 513 | + ] | |
| 482 | 514 | ] |
| 483 | 515 | ], |
| 484 | 516 | ]; |
| 485 | 517 | $mapping = isset($fields[$fieldType]) ? $fields[$fieldType] : []; |