fix : 소스정리

main
이범준 2 years ago
parent 3cd696695f
commit 54637a3e83

@ -410,6 +410,85 @@ String.prototype.isEmail = function() {
return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(this); return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(this);
}; };
class FimsFormFields extends FormFields {
/**
* form json data set
* element tag에 data-fmt-type 으로 데이타 format이 지정된 경우 해당 포맷으로 출력
* @param {object} formObj document.querySelector('form')
* @param {object} jsonData json type data
*/
set(obj){
document.querySelectorAll(this.children).forEach(input => {
let prop = input.getAttribute("data-map")
|| input.name
|| input.id;
if (!prop) return;
let dataItem = obj instanceof DataItem,
value = dataItem ? obj.getValue(prop) : obj[prop];
if ("radio" == input.type) {
if (value && value == input.value)
input.checked = true;
} else if("checkbox" == input.type) {
if (value && value == input.value)
input.checked = ("Y" === value);
} else if(input.tagName == "SELECT") {
for(let option of input.options) {
if(option.value == value){
option.selected = true;
} else {
option.selected = false;
}
}
} else {
if(value == null){
value = "";
}
// element data-fmt-type에 정의된 format 적용
// dt - yyyy-mm-dd HH:mm:ss, day - yyyy-mm-dd, time - HH:mm:ss, number - #,###
if(input.dataset.fmtType){
const fmtType = input.dataset.fmtType;
switch (fmtType) {
case 'dt' :
value = StrDateTimeFormat.format(value);
break;
case 'day' :
value = StrDateFormat.format(value);
break;
case 'time' :
value = StrTimeFormat.format(value);
break;
case 'number' :
value = CommaNumberFormat.format(value);
break;
default:
break;
}
}
if(input.name){
input.value = value;
//보안모드 마스킹 항목
if(input.tagName === 'INPUT' && input.id && input.classList.contains("privacy")){
let maskVal = value.replace(/[0-9a-zA-Z]/g, "*");
document.getElementById(input.id+"$mask").value = maskVal;
}
}
}
});
}
}
/** /**
* 숫자를 콤마 포멧으로 변환 * 숫자를 콤마 포멧으로 변환
**/ **/
@ -491,85 +570,6 @@ class CodeFormat {
} }
} }
class FimsFormFields extends FormFields {
/**
* form json data set
* element tag에 data-fmt-type 으로 데이타 format이 지정된 경우 해당 포맷으로 출력
* @param {object} formObj document.querySelector('form')
* @param {object} jsonData json type data
*/
set(obj){
document.querySelectorAll(this.children).forEach(input => {
let prop = input.getAttribute("data-map")
|| input.name
|| input.id;
if (!prop) return;
let dataItem = obj instanceof DataItem,
value = dataItem ? obj.getValue(prop) : obj[prop];
if ("radio" == input.type) {
if (value && value == input.value)
input.checked = true;
} else if("checkbox" == input.type) {
if (value && value == input.value)
input.checked = ("Y" === value);
} else if(input.tagName == "SELECT") {
for(let option of input.options) {
if(option.value == value){
option.selected = true;
} else {
option.selected = false;
}
}
} else {
if(value == null){
value = "";
}
// element data-fmt-type에 정의된 format 적용
// dt - yyyy-mm-dd HH:mm:ss, day - yyyy-mm-dd, time - HH:mm:ss, number - #,###
if(input.dataset.fmtType){
const fmtType = input.dataset.fmtType;
switch (fmtType) {
case 'dt' :
value = StrDateTimeFormat.format(value);
break;
case 'day' :
value = StrDateFormat.format(value);
break;
case 'time' :
value = StrTimeFormat.format(value);
break;
case 'number' :
value = CommaNumberFormat.format(value);
break;
default:
break;
}
}
if(input.name){
input.value = value;
//보안모드 마스킹 항목
if(input.tagName === 'INPUT' && input.id && input.classList.contains("privacy")){
let maskVal = value.replace(/[0-9a-zA-Z]/g, "*");
document.getElementById(input.id+"$mask").value = maskVal;
}
}
}
});
}
}
/** /**
* <pre> * <pre>

Loading…
Cancel
Save