1vendor([12],{ 2 3/***/ 443: 4/***/ (function(module, exports, __webpack_require__) { 5 6"use strict"; 7 8 9var _validator = __webpack_require__(72); 10 11var _validator2 = _interopRequireDefault(_validator); 12 13function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 14 15$.extend($.easing, { 16 def: 'easeOutQuint', 17 easeInQuint: function easeInQuint(x, t, b, c, d) { 18 return c * (t /= d) * t * t * t * t + b; 19 }, 20 easeOutQuint: function easeOutQuint(x, t, b, c, d) { 21 return c * ((t = t / d - 1) * t * t * t * t + 1) + b; 22 }, 23 easeInOutQuint: function easeInOutQuint(x, t, b, c, d) { 24 if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b; 25 return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; 26 }, 27 easeInExpo: function easeInExpo(x, t, b, c, d) { 28 return t === 0 ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; 29 }, 30 easeOutExpo: function easeOutExpo(x, t, b, c, d) { 31 return t === d ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; 32 }, 33 easeInOutExpo: function easeInOutExpo(x, t, b, c, d) { 34 if (t === 0) return b; 35 if (t === d) return b + c; 36 if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; 37 return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; 38 } 39}); 40 41document.addEventListener('DOMContentLoaded', function () { 42 return created(); 43}); 44window.addEventListener('load', function () { 45 return mounted(); 46}); 47 48var created = function created() { 49 new _validator2.default('.form-validation'); 50 if ($('[data-switch-target]').length > 0) toggles(); 51}; 52var mounted = function mounted() {}; 53 54// ãã°ã«éé 55var toggles = function toggles() { 56 $('[data-switch-target]').each(function () { 57 var target = $(this).data('switch-target'); 58 var type = getType($(this)); 59 var event = getEvent(type); 60 var $input = null; 61 62 if (type !== 'select' && type !== 'radio' && type !== 'checkbox') return false; 63 64 if (type === 'select') { 65 var selectName = $(this).find('select').eq(0).attr('name'); 66 $input = $(this).find('select[name=\'' + selectName + '\']'); 67 if ($input.find('option:selected').data('nest-flag') === 'show') { 68 toggleShow($('#' + target)); 69 } 70 } else { 71 var inputName = $(this).find('input').eq(0).attr('name'); 72 $input = $(this).find('input[name=\'' + inputName + '\']'); 73 if ($input.filter(':checked').data('nest-flag') === 'show') { 74 toggleShow($('#' + target)); 75 } 76 } 77 78 $input.on(event, function () { 79 var nestFlag = type === 'select' ? $(this).find('option:selected').data('nest-flag') : $(this).filter(':checked').data('nest-flag'); 80 if (nestFlag === 'show') { 81 toggleShow($('#' + target)); 82 } else { 83 toggleHide($('#' + target)); 84 } 85 }); 86 }); 87}; 88var toggleShow = function toggleShow($TARGET) { 89 return $TARGET.slideDown({ duration: 500, easing: 'easeOutExpo' }); 90}; 91var toggleHide = function toggleHide($TARGET) { 92 return $TARGET.slideUp({ duration: 500, easing: 'easeOutExpo' }); 93}; 94var getType = function getType($TARGET) { 95 if ($TARGET.find('input').attr('type') === 'radio') { 96 return 'radio'; 97 } else if ($TARGET.find('input').attr('type') === 'checkbox') { 98 return 'checkbox'; 99 } else if ($TARGET.find('select').length > 0) { 100 return 'select'; 101 } else if ($TARGET.find('textarea').length > 0) { 102 return 'textarea'; 103 } else { 104 return 'text'; 105 } 106}; 107var getEvent = function getEvent(TYPE) { 108 var types = { 109 radio: 'change', 110 checkbox: 'change', 111 select: 'change', 112 textarea: 'blur', 113 text: 'blur' 114 }; 115 return types[TYPE]; 116}; 117 118/***/ }), 119 120/***/ 72: 121/***/ (function(module, exports, __webpack_require__) { 122 123"use strict"; 124 125 126Object.defineProperty(exports, "__esModule", { 127 value: true 128}); 129 130var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 131 132function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 133 134// import YubinBango from './yubinbango.js' 135 136var Validator = function () { 137 function Validator(TARGET, OPTIONS) { 138 _classCallCheck(this, Validator); 139 140 this.check = { 141 required: function required(value) { 142 value = value == null ? '' : value; 143 return !value; 144 }, 145 required_radio: function required_radio(value) { 146 value = value == null ? '' : value; 147 return !value; 148 }, 149 required_checkbox: function required_checkbox(value) { 150 return !(value.length > 0); 151 }, 152 kana: function kana(value) { 153 value = value == null ? '' : value; 154 return !value.match(/^[ã¡-ã¶ã¼]*$/); 155 }, 156 kana_space: function kana_space(value) { 157 value = value == null ? '' : value; 158 return !value.match(/^[ã¡-ã¶ã¼ã ]*$/); 159 }, 160 email: function email(value) { 161 value = value == null ? '' : value; 162 return !value.match(/^[a-zA-Z0-9]{1}[a-zA-Z0-9_.-]*@{1}[a-z0-9_.-]{1,}\.[a-z0-9]{1,}$/); 163 }, 164 password: function password(value) { 165 value = value == null ? '' : value; 166 return !value.match(/^(?=.*?[a-z])(?=.*?\d)[a-z\d]{8,100}$/i); 167 }, 168 numeric: function numeric(value) { 169 value = value == null ? '' : value; 170 return !!value.match(/[^0-9]+/); 171 }, 172 alpha: function alpha(value) { 173 value = value == null ? '' : value; 174 return !value.match(/^[A-Za-z]*$/); 175 }, 176 alphaSpace: function alphaSpace(value) { 177 value = value == null ? '' : value; 178 return !value.match(/^[A-Za-zã ]*$/); 179 }, 180 alphaSpaceDot: function alphaSpaceDot(value) { 181 value = value == null ? '' : value; 182 return !value.match(/^[A-Za-zã \\.]*$/); 183 }, 184 alphaNum: function alphaNum(value) { 185 value = value == null ? '' : value; 186 return !value.match(/^[a-zA-Z0-9!#$%&()*+,.:;=?@[\]^_{}-]+$/); 187 }, 188 stamp: function stamp(value) { 189 value = value == null ? '' : value; 190 return !value.match(/^[a-zA-Z. ]+$/); 191 }, 192 birthday: function birthday(value) { 193 value = value == null ? '' : value; 194 return !value.match(/^[0-9\\.]+$/); 195 }, 196 zip: function zip(value) { 197 value = value == null ? '' : value; 198 return !value.match(/^\d{7}$/); 199 }, 200 agree: function agree(value) { 201 return !(value.length > 0); 202 }, 203 maxlength: function maxlength(value, _maxlength) { 204 if (value === undefined) return false;
205 return value.length > _maxlength; 206 }, 207 minlength: function minlength(value, _minlength) { 208 if (value === undefined) return false; 209 return value.length < _minlength; 210 }, 211 notSpaceOnly: function notSpaceOnly(value) { 212 return value.match(/^[ã ]*$/); 213 }, 214 weightCheck: function weightCheck(value) { 215 return value < 1000 || value > 4000; 216 }, 217 alphaUpper: function alphaUpper(value) { 218 value = value == null ? '' : value; 219 return !value.match(/^[A-Z]*$/); 220 }, 221 japanAlphaUpper: function japanAlphaUpper(value) { 222 value = value == null ? '' : value; 223 return !value.match(/^[A-Z\u3041-\u3093\u30A1-\u30F6\u30FC\u4E00-\u9FA0]+$/); 224 } 225 }; 226 227 this.$target = $(TARGET); 228 this.defaultOptions = { 229 autoScroll: true 230 }; 231 this.options = $.extend({}, this.defaultOptions, OPTIONS); 232 this.data = {}; 233 this.init(); 234 } 235 236 _createClass(Validator, [{ 237 key: 'init', 238 value: function init() { 239 this.setData(); 240 if (Object.keys(this.data).length > 0) { 241 this.handler(); 242 } 243 } 244 }, { 245 key: 'setData', 246 value: function setData() { 247 var _this = this; 248 this.$target.each(function () { 249 var type = _this.getType($(this)); 250 var form = $(this).closest('form').data('validation-form') !== undefined ? $(this).closest('form').data('validation-form') : 'no-name'; 251 var inputName = null; 252 253 if (type === 'select') { 254 inputName = $(this).find('select').eq(0).attr('name'); 255 } else if (type === 'textarea') { 256 inputName = $(this).find('textarea').eq(0).attr('name'); 257 } else { 258 inputName = $(this).find('input').eq(0).attr('name'); 259 } 260 261 var $input = $('[name=\'' + inputName + '\']'); 262 263 _this.data[inputName] = { 264 $ele: $(this), 265 form: form, 266 $input: $input, 267 type: type, 268 name: inputName, 269 isNest: !!($(this).data('nestform-key') !== undefined && $(this).data('nestform-value') !== undefined), 270 nestFlag: false, 271 $error: $(this).find('.form-error-text'), 272 validations: $(this).data('validation').split(' '), 273 autoAddress: $(this).data('auto_address') ? $(this).data('auto_address').split(' ') : undefined, 274 status: null 275 }; 276 }); 277 } 278 }, { 279 key: 'getType', 280 value: function getType($target) { 281 if ($target.find('input').attr('type') === 'radio') { 282 return 'radio'; 283 } else if ($target.find('input').attr('type') === 'checkbox') { 284 return 'checkbox'; 285 } else if ($target.find('select').length > 0) { 286 return 'select'; 287 } else if ($target.find('textarea').length > 0) { 288 return 'textarea'; 289 } else { 290 return 'text'; 291 } 292 } 293 }, { 294 key: 'getEvent', 295 value: function getEvent(type) { 296 var types = { 297 radio: 'change', 298 checkbox: 'change', 299 select: 'change', 300 textarea: 'blur', 301 text: 'blur' 302 }; 303 return types[type]; 304 } 305 }, { 306 key: 'getValue', 307 value: function getValue(type, $input) { 308 var value = null; 309 if (type === 'checkbox') { 310 value = $input.filter(':checked').map(function () { 311 return $(this).val(); 312 }); 313 } else if (type === 'radio') { 314 value = $input.filter(':checked').val(); 315 } else if (type === 'select') { 316 value = $input.find('option:selected').val(); 317 } else { 318 value = $input.val(); 319 } 320 return value || undefined; 321 } 322 }, { 323 key: 'halfVal', 324 value: function halfVal(str) { 325 return str.replace(/[A-Zï½-ï½ï¼-ï¼ï¼ï¼ï¼ï¼ï¼ ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ [\]^_ï½ï½ï½ï½]/g, function (s) { 326 return String.fromCharCode(s.charCodeAt(0) - 0xfee0); 327 }).replace(/[âï¼â]/g, '-').replace(/[ï½ã]/g, '').replace(/ã/g, ''); 328 } 329 }, { 330 key: 'onlyNumber', 331 value: function onlyNumber(str) { 332 return str.replace(/[^0-9]+/i, ''); 333 } 334 }, { 335 key: 'manualUppercase', 336 value: function manualUppercase(str) { 337 if ('I'.toLowerCase() !== 'i') { 338 return str.replace(/[a-z]/g, function (ch) {
339 return String.fromCharCode(ch.charCodeAt(0) & ~32); 340 }); 341 } else { 342 return str.toUpperCase(); 343 } 344 } 345 }, { 346 key: 'manualLowercase', 347 value: function manualLowercase(str) { 348 if ('i'.toUpperCase() !== 'I') { 349 return str.replace(/[A-Z]/g, function (ch) { 350 return String.fromCharCode(ch.charCodeAt(0) | 32); 351 }); 352 } else { 353 return str.toLowerCase(); 354 } 355 } 356 }, { 357 key: 'capitalize', 358 value: function capitalize(str) { 359 str = this.manualLowercase(str); 360 361 var str2 = ''; 362 str.split(/\s/).forEach(function (val) { 363 if (str2 !== '') str2 += ' '; 364 str2 += val.charAt(0).toUpperCase() + val.slice(1); 365 }); 366 367 var str3 = ''; 368 str2.split(/\./).forEach(function (val) { 369 if (str3 !== '') str3 += '.'; 370 str3 += val.charAt(0).toUpperCase() + val.slice(1); 371 }); 372 373 return str3; 374 } 375 }, { 376 key: 'autoAddress', 377 value: function autoAddress(code, target) { 378 fetch('/api/v1/address?zipCode=' + code).then(function (response) { 379 return response.json(); 380 }).then(function (res) { 381 var body = res.results; 382 // ï¼ã¤ã ãã®å ´åã¯ãã®ã¾ã¾ã»ãã 383 if (body.length === 1) { 384 $('[name=' + target.autoAddress[0] + ']').val(body[0].prefId); 385 $('[name=' + target.autoAddress[1] + ']').val(body[0].city); 386 } else if (body.length > 1 && typeof target.autoAddress[2] !== 'undefined') { 387 // è¤æ°ä½æãåå¨ããå ´åã¯é¸æè¢ã表示ããã 388 $('#' + target.autoAddress[2]).find('ul').remove(); 389 var $ul = $('<ul class="address-list">'); 390 var _iteratorNormalCompletion = true; 391 var _didIteratorError = false; 392 var _iteratorError = undefined; 393 394 try { 395 for (var _iterator = body[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { 396 var row = _step.value; 397 398 $ul.append($('<li>').text(row.state + row.city).data(target.autoAddress[0], row.prefId).data(target.autoAddress[1], row.city).on('click', function () { 399 $('[name=' + target.autoAddress[0] + ']').val($(this).data(target.autoAddress[0])); 400 $('[name=' + target.autoAddress[1] + ']').val($(this).data(target.autoAddress[1])); 401 $('#' + target.autoAddress[2]).find('ul').remove(); 402 $('#addressListClose').click(); 403 })); 404 } 405 } catch (err) { 406 _didIteratorError = true; 407 _iteratorError = err; 408 } finally { 409 try { 410 if (!_iteratorNormalCompletion && _iterator.return) { 411 _iterator.return(); 412 } 413 } finally { 414 if (_didIteratorError) { 415 throw _iteratorError; 416 } 417 } 418 } 419 420 $('#' + target.autoAddress[2]).append($ul); 421 $('#addressListButton').click(); 422 } 423 }); 424 425 // YubinBango.Coreã¯ä½¿ããªã 426 // new YubinBango.Core(code, address => { 427 // $(`[name=${target.autoAddress[0]}]`).val(address.region) 428 // $(`[name=${target.autoAddress[1]}]`).val(address.locality + address.street) 429 430 // target.autoAddress.forEach(key => { 431 // this.validation(this.data[key]) 432 // }) 433 // }) 434 } 435 }, { 436 key: 'handler', 437 value: function handler() { 438 for (var key in this.data) { 439 var target = this.data[key]; 440 441 this.handlerDefault(target); 442 this.handlerFocusOut(target); 443 this.handlerInputSupport(target); 444 445 if (target.validations.indexOf('password') >= 0 || target.validations.indexOf('login-password') >= 0) { 446 this.handlerPasswordIcon(target); 447 } 448 } 449 450 this.handlerSubmit(); 451 } 452 }, { 453 key: 'handlerFocusOut', 454 value: function handlerFocusOut(DATA) { 455 var _this2 = this; 456 457 var event = this.getEvent(DATA.type); 458 459 DATA.$input.on(event, function () { 460 if (DATA.validations.indexOf('email') > 0 || DATA.validations.indexOf('password') > 0 || DATA.validations.indexOf('numeric') > 0 || DATA.validations.indexOf('stamp') > 0 || DATA.validations.indexOf('birthday') > 0 || DATA.validations.indexOf('zip') > 0 || DATA.validations.indexOf('uppercase') > 0 || DATA.validations.indexOf('lowercase') > 0 || DATA.validations.indexOf('capitalize') > 0) { 461 DATA.$input.val(_this2.halfVal(DATA.$input.val())); 462 } 463 if (DATA.validations.indexOf('uppercase') > 0) { 464 DATA.$input.val(_this2.manualUppercase(DATA.$input.val())); 465 } 466 if (DATA.validations.indexOf('lowercase') > 0) { 467 DATA.$input.val(_this2.manualLowercase(DATA.$input.val())); 468 } 469 if (DATA.validations.indexOf('capitalize') > 0) { 470 DATA.$input.val(_this2.capitalize(DATA.$input.val())); 471 } 472 if (DATA.validations.indexOf('numeric') > 0 || DATA.validations.indexOf('zip') > 0) { 473 DATA.$input.val(_this2.onlyNumber(DATA.$input.val())); 474 } 475 _this2.validation(DATA); 476 477 if (DATA.name.indexOf('_sync') !== -1) { 478 var copy = DATA.name.split('_sync'); 479 $('[name=' + copy[0] + ']').val(DATA.$input.val()); 480 } 481 }); 482 } 483 }, { 484 key: 'handlerInputSupport', 485 value: function handlerInputSupport(DATA) { 486 var _this3 = this; 487 488 if (DATA.type !== 'text') return false;
489 490 DATA.$input.get(0).addEventListener('input', function () { 491 if (DATA.autoAddress && DATA.validations.indexOf('zip') > 0 && DATA.$input.val().length === 7) { 492 _this3.autoAddress(DATA.$input.val(), DATA); 493 } 494 }); 495 } 496 }, { 497 key: 'handlerSubmit', 498 value: function handlerSubmit() { 499 var _this = this; 500 501 this.$target.closest('form').on('submit', function () { 502 var formName = $(this).data('validation-form') || 'no-name'; 503 var isSuccess = true; 504 505 for (var key in _this.data) { 506 var target = _this.data[key]; 507 508 if (target.form === formName) { 509 _this.validation(target); 510 if (target.status === false) isSuccess = false; 511 } 512 } 513 514 if (!isSuccess) { 515 var position = $('.is-error').eq(0).closest('.form-box').offset() ? $('.is-error').eq(0).closest('.form-box').offset().top : $('.is-error').eq(0).offset().top; 516 var margin = COMMON.globalNavi.isSp ? COMMON.globalNavi.naviData.offset * -1 : 0; 517 if (_this.options.autoScroll) LIB.Scroll(position, { 518 merge: margin 519 }); 520 return false; 521 } 522 }); 523 } 524 }, { 525 key: 'handlerDefault', 526 value: function handlerDefault(DATA) { 527 var value = this.getValue(DATA.type, DATA.$input); 528 529 if (value) this.success(DATA); 530 } 531 }, { 532 key: 'handlerPasswordIcon', 533 value: function handlerPasswordIcon(DATA) { 534 DATA.$ele.find('.form-password_button').on('click', function () { 535 if ($(this).hasClass('icon-password_hide')) { 536 $(this).removeClass('icon-password_hide').addClass('icon-password_show'); 537 DATA.$input.attr('type', 'text'); 538 } else { 539 $(this).removeClass('icon-password_show').addClass('icon-password_hide'); 540 DATA.$input.attr('type', 'password'); 541 } 542 }); 543 } 544 }, { 545 key: 'validation', 546 value: function validation(DATA) { 547 var _this4 = this; 548 549 var errorType = null; 550 var value = this.getValue(DATA.type, DATA.$input); 551 var maxlength = parseInt(DATA.$input.attr('maxlength')) || null; 552 var minlength = parseInt(DATA.$input.attr('minlength')) || null; 553 554 if (DATA.isNest) { 555 var inputName = DATA.$ele.attr('data-nestform-key'); 556 var inputValue = DATA.$ele.attr('data-nestform-value').split(','); 557 558 if ($('input[name=' + inputName + ']').length > 0 && inputValue.indexOf($('input[name=' + inputName + ']:checked').val()) >= 0) { 559 DATA.nestFlag = true; 560 } else if ($('select[name=' + inputName + ']').length > 0 && inputValue.indexOf($('select[name=' + inputName + ']').find('option:selected').val()) >= 0) { 561 DATA.nestFlag = true; 562 } else { 563 DATA.nestFlag = false; 564 } 565 } 566 567 var isError = DATA.validations.some(function (type) { 568 if (type === 'required' && _this4.check.required(value)) { 569 errorType = 'required'; 570 } else if (type === 'required_radio' && _this4.check.required_radio(value)) { 571 errorType = 'required_radio'; 572 } else if (type === 'required_checkbox' && _this4.check.required_checkbox(value)) { 573 errorType = 'required_checkbox'; 574 } else if (type === 'kana' && _this4.check.kana(value)) { 575 errorType = 'kana'; 576 } else if (type === 'kana_space' && _this4.check.kana_space(value)) { 577 errorType = 'kana_space'; 578 } else if (type === 'email' && _this4.check.email(value)) { 579 errorType = 'email'; 580 } else if (type === 'password' && _this4.check.password(value)) { 581 errorType = 'password'; 582 } else if (type === 'alpha' && _this4.check.alpha(value)) { 583 errorType = 'alpha'; 584 } else if (type === 'alphaSpace' && _this4.check.alphaSpace(value)) { 585 errorType = 'alphaSpace'; 586 } else if (type === 'alphaSpaceDot' && _this4.check.alphaSpaceDot(value)) { 587 errorType = 'alphaSpaceDot'; 588 } else if (type === 'alphaNum' && _this4.check.alphaNum(value)) { 589 errorType = 'alphaNum'; 590 } else if (type === 'numeric' && _this4.check.numeric(value)) { 591 errorType = 'numeric'; 592 } else if (type === 'stamp' && _this4.check.stamp(value)) { 593 errorType = 'stamp'; 594 } else if (type === 'birthday' && _this4.check.birthday(value)) { 595 errorType = 'birthday'; 596 } else if (type === 'zip' && _this4.check.zip(value)) { 597 errorType = 'zip'; 598 } else if (type === 'agree' && _this4.check.agree(value)) { 599 errorType = 'agree'; 600 } else if (type === 'maxlength' && _this4.check.maxlength(value, maxlength)) { 601 errorType = 'maxlength'; 602 } else if (type === 'minlength' && _this4.check.minlength(value, minlength)) { 603 errorType = 'minlength'; 604 } else if (type === 'notSpaceOnly' && _this4.check.notSpaceOnly(value)) { 605 errorType = 'notSpaceOnly'; 606 } else if (type === 'weightCheck' && _this4.check.weightCheck(value)) { 607 errorType = 'weightCheck'; 608 } else if (type === 'alphaUpper' && _this4.check.alphaUpper(value)) { 609 errorType = 'alphaUpper'; 610 } else if (type === 'firstAlphaUpper' && maxlength === 1 && _this4.check.alphaUpper(value)) { 611 errorType = 'alphaUpper'; 612 } else if (type === 'japanAlphaUpper' && _this4.check.japanAlphaUpper(value)) { 613 errorType = 'japanAlphaUpper'; 614 } 615 616 return !!errorType; 617 }); 618 619 this.reset(DATA); 620 if (DATA.isNest && !DATA.nestFlag) { 621 errorType = null; 622 } else { 623 isError ? this.error(DATA, errorType) : this.success(DATA); 624 } 625 } 626 }, { 627 key: 'reset', 628 value: function reset(DATA) { 629 if (DATA.type === 'checkbox') { 630 DATA.$ele.find('.form-checkbox').removeClass('is-error is-success'); 631 } else if (DATA.type === 'radio') { 632 DATA.$ele.find('.form-radio').removeClass('is-error is-success'); 633 } else { 634 DATA.$input.removeClass('is-error is-success'); 635 } 636 DATA.$error.removeClass('is-error').text(''); 637 DATA.status = null; 638 } 639 }, { 640 key: 'error', 641 value: function error(DATA, errorType) { 642 if (DATA.type === 'checkbox') { 643 DATA.$ele.find('.form-checkbox').addClass('is-error'); 644 } else if (DATA.type === 'radio') { 645 DATA.$ele.find('.form-radio').addClass('is-error'); 646 } else { 647 DATA.$input.addClass('is-error'); 648 } 649 650 var length = null; 651 switch (errorType) { 652 case 'maxlength': 653 length = DATA.$input.attr('maxlength'); 654 break; 655 case 'minlength': 656 length = DATA.$input.attr('minlength'); 657 break; 658 default: 659 } 660 var message = length != null ? length + this.jpMessage(errorType) : this.jpMessage(errorType); 661 662 DATA.$error.addClass('is-error').text(message); 663 DATA.status = false;
664 } 665 }, { 666 key: 'success', 667 value: function success(DATA) { 668 var value = this.getValue(DATA.type, DATA.$input); 669 670 if (value) { 671 DATA.$input.addClass('is-success'); 672 DATA.status = true; 673 } 674 } 675 }, { 676 key: 'jpMessage', 677 value: function jpMessage(errorType) { 678 var errorMessage = null; 679 680 if (errorType === 'required') { 681 errorMessage = 'å¿ é é ç®ã§ã'; 682 } else if (errorType === 'required_radio') { 683 errorMessage = 'å¿ é é ç®ã§ã'; 684 } else if (errorType === 'required_checkbox') { 685 errorMessage = 'å¿ é é ç®ã§ã'; 686 } else if (errorType === 'kana') { 687 errorMessage = 'å ¨è§ã«ã¿ã«ãã§å ¥åãã¦ãã ãã'; 688 } else if (errorType === 'kana_space') { 689 errorMessage = 'å ¨è§ã«ã¿ã«ãã»ã¹ãã¼ã¹( )ã§å ¥åãã¦ãã ãã'; 690 } else if (errorType === 'numeric') { 691 errorMessage = 'åè§æ°åã§å ¥åãã¦ãã ãã'; 692 } else if (errorType === 'alpha') { 693 errorMessage = 'åè§è±åã§å ¥åãã¦ãã ãã'; 694 } else if (errorType === 'alphaSpace') { 695 errorMessage = 'åè§è±åã»ã¹ãã¼ã¹( )ã§å ¥åãã¦ãã ãã'; 696 } else if (errorType === 'alphaSpaceDot') { 697 errorMessage = 'åè§è±åã»ã¹ãã¼ã¹( )ã»ããã(.)ã§å ¥åãã¦ãã ãã'; 698 } else if (errorType === 'alphaNum') { 699 errorMessage = 'åè§è±æ°åã§å ¥åãã¦ãã ãã'; 700 } else if (errorType === 'stamp') { 701 errorMessage = 'åè§è±åã»ããã(.)ã»åè§ã¹ãã¼ã¹( )ã§å ¥åãã¦ãã ãã'; 702 } else if (errorType === 'birthday') { 703 errorMessage = 'åè§æ°åã»ããã(.)ã§å ¥åãã¦ãã ãã'; 704 } else if (errorType === 'zip') { 705 errorMessage = 'ãã¤ãã³æãã»7æåã§å ¥åãã¦ãã ãã'; 706 } else if (errorType === 'email') { 707 errorMessage = '@ã®åå¾ã¯åè§è±æ°åãå é ã«ãåè§è±æ°åã»ãã¤ãã³(-)ã»ã¢ã³ãã¼ã¹ã³ã¢(_)ã»ããã(.)ã§å ¥åãã¦ãã ãã'; 708 } else if (errorType === 'password') { 709 errorMessage = 'åè§è±æ°æ··åã§8æå以ä¸å ¥åãã¦ãã ãã'; 710 } else if (errorType === 'agree') { 711 errorMessage = 'åæããã¦ãã ãã'; 712 } else if (errorType === 'maxlength') { 713 errorMessage = 'æå以å ã§å ¥åãã¦ãã ããã'; 714 } else if (errorType === 'minlength') { 715 errorMessage = 'æå以ä¸ã§å ¥åãã¦ãã ããã'; 716 } else if (errorType === 'notSpaceOnly') { 717 errorMessage = 'ã¹ãã¼ã¹( )以å¤ãå ¥åãã¦ãã ãã'; 718 } else if (errorType === 'weightCheck') { 719 errorMessage = '1000ã4000ã®ç¯å²å ã§å ¥åãã¦ãã ãã'; 720 } else if (errorType === 'alphaUpper') { 721 errorMessage = 'åè§è±åã®å¤§æåã§å ¥åãã¦ãã ãã'; 722 } else if (errorType === 'firstAlphaUpper') { 723 errorMessage = 'åè§è±åã®å¤§æåã§å ¥åãã¦ãã ãã'; 724 } else if (errorType === 'japanAlphaUpper') { 725 errorMessage = 'ã²ãããªã»å ¨è§ã«ã¿ã«ãã»æ¼¢åã»ãã¼ãåï¼å¤§æåã®ã¿ï¼ã§å ¥åãã¦ãã ãã'; 726 } 727 728 return errorMessage; 729 } 730 }]); 731 732 return Validator; 733}(); 734 735exports.default = Validator; 736 737/***/ }) 738 739},[443]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.