Merge branch 'kangsun' into 'dev'

관리자 웹자원 업데이트

See merge request korea-research/korea-research!25
This commit is contained in:
이강선 매니저/ST
2025-06-23 02:31:24 +00:00
98 changed files with 1965 additions and 23 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1507,6 +1507,8 @@ function Modal() {
onActivate: actions.focusActivate,
onDeactivate: actions.focusDeactivate,
allowOutsideClick: props.clickOutside ? true : false,
// 2025.06.23 자동 포커스 막기 추가
initialFocus: false,
});
// state
@@ -1571,7 +1573,7 @@ function Modal() {
function setupActions() {
const { getTopDepth, setLayerOpacity, enableScrollLock, disableScrollLock } = etUI.hooks.useLayer();
actions.focusActivate = () => {};
actions.focusActivate = () => { };
actions.focusDeactivate = () => {
close();
@@ -1583,7 +1585,7 @@ function Modal() {
setLayerOpacity(DIMM_OPACITY);
enableScrollLock();
if ($modalDimm) gsap.timeline().to($modalDimm, {duration: 0, display: 'block', opacity: 0}).to($modalDimm, { duration: 0.15, opacity: 1 });
if ($modalDimm) gsap.timeline().to($modalDimm, { duration: 0, display: 'block', opacity: 0 }).to($modalDimm, { duration: 0.15, opacity: 1 });
gsap
.timeline()

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,567 @@
/**
* Check if the value is an array
* @param value {any}
* @returns {arg is any[]}
*/
function isArray(value) {
return Array.isArray(value);
}
/**
* 설명
* @param cleanups {function[]}
*/
function allCleanups(cleanups) {
cleanups.forEach((cleanup) => cleanup());
}
;
// boolean 관련 기능
;
// 날짜 관련 기능
;
/**
* set attribute
* @param { Element } parent
* @param opts
*/
function setProperty(parent, ...opts) {
if (opts.length === 2) {
const [property, value] = opts;
parent?.setAttribute(property, value);
} else if (opts.length === 3) {
const [selector, property, value] = opts;
parent.querySelector(selector)?.setAttribute(property, value);
}
}
/**
* get attribute
* @param { Element } parent
* @param { String } selector
* @param { String } property
*/
function getProperty(parent, selector, property) {
parent.querySelector(selector)?.getAttribute(property);
}
/**
* set style
* @param { Element } parent
* @param { String } selector
* @param { String } property
* @param { any } value
*/
function setStyle(parent, selector, property, value) {
if (parent.querySelector(selector)) {
parent.querySelector(selector).style[property] = value;
}
}
/**
* gsap의 SplitText를 활용하여 문자를 분리하여 마스크 가능하게 해준다.
* @param selector {string}
* @param type {'lines'|'words'|'chars'}
* @returns [HTMLElement[], HTMLElement[]]
*/
function splitTextMask(selector, type = 'lines', isOverflow = true) {
let $quote;
function wrap(el, wrapper) {
el.parentNode.insertBefore(wrapper, el);
wrapper.appendChild(el);
}
if (typeof selector === String) {
$quote = document.querySelector(selector);
} else {
$quote = selector;
}
// const $quote = document.querySelector(selector),
const mySplitText = new SplitText($quote, { type });
const $splitted = mySplitText[type];
const $lineWrap = [];
$splitted.forEach(($el, index) => {
const $div = document.createElement('div');
if (isOverflow) {
$div.style.overflow = 'hidden';
}
$div.style.position = 'relative';
// $div.style.display = 'block';
$div.style.display = 'inline-block';
$div.classList.add('split-text-wrap');
wrap($el, $div);
$lineWrap.push($div);
});
return [$splitted, $lineWrap];
}
function splitTextMaskBlock(selector, type = 'lines', isOverflow = true) {
let $quote;
function wrap(el, wrapper) {
el.parentNode.insertBefore(wrapper, el);
wrapper.appendChild(el);
}
if (typeof selector === 'string') {
$quote = document.querySelector(selector);
} else {
$quote = selector;
}
// const $quote = document.querySelector(selector),
if ([...$quote.children].some((el) => el.classList.contains('split-text-wrap'))) {
return;
}
const mySplitText = new SplitText($quote, { type });
const $splitted = mySplitText[type];
const $lineWrap = [];
$splitted.forEach(($el, index) => {
const $div = document.createElement('div');
if (isOverflow) {
$div.style.overflow = 'hidden';
}
$div.style.position = 'relative';
$div.style.display = 'block';
$div.classList.add('split-text-wrap');
wrap($el, $div);
$lineWrap.push($div);
});
return [$splitted, $lineWrap];
}
/**
*
* @param el {string|HTMLElement}
* @returns {Node}
*/
function wrapMask(el) {
const $el = etUI.utils.selectorStringToElement(el);
if ($el.parentNode.classList.contains('ui-mask')) {
return $el.parentNode;
}
function wrap(el, wrapper) {
el.parentNode.insertBefore(wrapper, el);
wrapper.appendChild(el);
}
const style = window.getComputedStyle($el);
const $div = document.createElement('div');
$div.style.overflow = 'hidden';
$div.style.position = style.position || null;
if (style.position === 'absolute' || style.position === 'fixed') {
$div.style.top = style.top;
$div.style.left = style.left;
$div.style.right = style.right;
$div.style.bottom = style.bottom;
$el.style.top = 0;
$el.style.left = 0;
$el.style.right = 0;
$el.style.bottom = 0;
}
$div.style.display = style.display || null;
$div.classList.add('ui-mask');
wrap($el, $div);
return $div;
}
/**
*
*/
function setDocHeight() {
document.querySelector('body').style.setProperty('--doc-height', window.innerHeight + 'px');
document.querySelector('body').dataset.docHeight = window.innerHeight;
}
/**
*
* @param arrBreakPointName
* @param arrBreakPoint
* @returns {{}}
*/
function getMediaQueryCondition(arrBreakPointName, arrBreakPoint) {
if (arrBreakPointName.length !== arrBreakPoint.length + 1) {
console.error('arrBreakPointName.length !== arrBreakPoint.length + 1');
return;
}
const mediaQueryCondition = {};
const arr = [],
length = arrBreakPoint.length;
arr.push(`(max-width: ${arrBreakPoint[0] - 1}px)`);
new Array(length - 1).fill(0).forEach((_, index) => {
arr.push(`(min-width: ${arrBreakPoint[index]}px) and (max-width: ${arrBreakPoint[index + 1] - 1}px)`);
});
arr.push(`(min-width: ${arrBreakPoint[length - 1]}px)`);
arrBreakPointName.forEach((name, index) => {
mediaQueryCondition[name] = arr[index];
});
mediaQueryCondition['reduceMotion'] = '(prefers-reduced-motion: reduce)';
mediaQueryCondition['isDark'] = '(prefers-color-scheme: dark)';
mediaQueryCondition['isLight'] = '(prefers-color-scheme: light)';
return mediaQueryCondition;
}
/**
*
* @param fn
*/
function ready(fn) {
if (document.readyState !== 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
/**
*
* @param {string | NodeList} target
* @returns {HTMLElement | null}
*/
function firstNode(target) {
if (typeof target === 'string') {
return document.querySelector(target);
} else if (NodeList.prototype.isPrototypeOf(target)) {
if (target.length <= 0) {
return null;
}
return target[0];
} else if (Array.isArray(target)) {
return target[0];
}
}
/**
*
* @param {string | NodeList} target
* @returns {HTMLElement | null}
*/
function lastNode(target) {
if (typeof target === 'string') {
return document.querySelectorAll(target)[document.querySelectorAll(target).length - 1];
} else if (NodeList.prototype.isPrototypeOf(target)) {
if (target.length <= 0) {
return null;
}
return target[target.length - 1];
} else if (Array.isArray(target)) {
return target[target.length - 1];
}
}
/**
*
* @param str
* @returns {*[]}
*/
function parseHTML(str) {
const tmp = document.implementation.createHTMLDocument('');
tmp.body.innerHTML = str;
return [...tmp.body.childNodes];
}
/**
*
*/
function setupLenis() {
const lenis = new Lenis(etUI.config.lenis.options || {});
lenis.on('scroll', (e) => {
console.log(e);
});
lenis.on('scroll', ScrollTrigger.update);
gsap.ticker.add((time) => {
lenis.raf(time * etUI.config.lenis.speed || 1000);
});
gsap.ticker.lagSmoothing(etUI.config.lenis.lagSmoothing);
etUI.lenis = lenis;
}
/**
*
* @param selector {string|HTMLElement}
* @returns {Element|*}
*/
function selectorStringToElement(selector) {
if (typeof selector === 'string') {
return document.querySelector(selector);
} else {
return selector;
}
}
/**
* 페이지의 모든 요소를 탐색하여 고정된 요소들의 높이를 계산합니다.
* 속성 값이 fixed, sticky인경유 클래스 추가할지 협의해야합니다.
* 테스트중
* @returns {number} 고정된 요소들의 총 높이
*/
function calculateFixedElementsHeight() {
const fixedElements = document.querySelectorAll('.fixed, .sticky');
let totalFixedHeight = 0;
fixedElements.forEach((element) => {
const style = window.getComputedStyle(element);
if (style.position === 'fixed' || style.position === 'sticky') {
const height = parseFloat(style.height) || 0;
const top = parseFloat(style.top) || 0;
totalFixedHeight += height + top;
}
});
return totalFixedHeight;
}
/**
* 특정 요소 또는 위치로 부드럽게 스크롤합니다.
* @param {HTMLElement|number} target - 스크롤할 목표 요소 또는 위치.
* @param {Object} options - 스크롤 옵션 객체.
* @param {number} [options.offset=0] - 추가 오프셋 값.
*/
function scrollToPosition(target, { offset = 0 } = {}) {
const totalFixedHeight = calculateFixedElementsHeight();
const totalOffset = totalFixedHeight + offset;
const targetPosition =
typeof target === 'number'
? target - totalOffset
: target instanceof HTMLElement
? target.offsetTop - totalOffset
: (() => {
throw new Error('target must be an HTMLElement or a number');
})();
window.scrollTo({ top: targetPosition, behavior: 'smooth' });
}
;
function debounce(callback, delay = 250) {
let timeoutId;
return function (...args) {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
callback.apply(this, args);
}, delay);
};
}
function throttle(callback, delay = 250) {
let isThrottled = false;
let args;
let context;
function wrapper(...wrapperArgs) {
if (isThrottled) {
args = wrapperArgs;
context = this;
return;
}
isThrottled = true;
callback.apply(this, wrapperArgs);
setTimeout(() => {
isThrottled = false;
if (args) {
wrapper.apply(context, args);
args = context = null;
}
}, delay);
}
return wrapper;
}
function isMarkerQS() {
return location.search.includes('marker121212');
}
function triggerEvent(el, eventType) {
if (typeof eventType === 'string' && typeof el[eventType] === 'function') {
el[eventType]();
} else {
const event = typeof eventType === 'string' ? new Event(eventType, { bubbles: true }) : eventType;
el.dispatchEvent(event);
}
}
;
// 연산 관련 (자료형Number + number)
function getBlendOpacity(opacity, length) {
if (length === 1) {
return opacity;
}
return 1 - Math.pow(1 - opacity, 1 / length);
}
;
// object 관련 기능
/**
* compare obj
* @param { Object } obj1
* @param { Object } obj2
* @returns Boolean
*/
function shallowCompare(obj1, obj2) {
const keys = [...Object.keys(obj1), Object.keys(obj2)];
for (const key of keys) {
if (typeof obj1[key] === 'object' && typeof obj2[key] === 'object') {
if (!etUI.utils.shallowCompare(obj1[key], obj2[key])) {
return false;
}
} else {
const role = !obj2[key] || typeof obj1[key] === 'function';
if (!role && obj1[key] !== obj2[key]) {
return false;
}
}
}
return true;
}
function isDeepEqual(object1, object2) {
const objKeys1 = Object.keys(object1);
const objKeys2 = Object.keys(object2);
if (objKeys1.length !== objKeys2.length) return false;
for (var key of objKeys1) {
const value1 = object1[key];
const value2 = object2[key];
const isObjects = isObject(value1) && isObject(value2);
if ((isObjects && !isDeepEqual(value1, value2)) || (!isObjects && value1 !== value2)) {
return false;
}
}
return true;
}
function isObject(object) {
return object != null && typeof object === 'object';
}
/**
*
* @param obj
* @param key
* @returns {*}
*/
function getValueFromNestedObject(obj, key) {
const keys = key.split('.');
return keys.reduce((acc, currKey) => {
return acc && acc[currKey] !== undefined ? acc[currKey] : undefined;
}, obj);
}
;
/**
* Reverse a string
* @param str {string}
* @returns {string}
*/
function reverseString(str) {
return str.split('').reverse().join('');
}
/**
* Get a random id
* @returns {string}
*/
function getRandomId() {
return Math.random().toString(36).substring(2);
}
/**
*
* @param prefix
* @returns {string}
*/
function getRandomUIID(prefix = 'ui') {
return `${prefix}-${getRandomId()}`;
}
/**
* 첫글자만 대문자로 변환
* @param word
* @returns {string}
*/
function capitalize(word) {
return word.charAt(0).toUpperCase() + word.slice(1)
}
/**
* 첫글자만 소문자로 변환
* @param word
* @returns {string}
*/
function uncapitalize(word) {
return word.charAt(0).toLowerCase() + word.slice(1)
}
function addPrefixCamelString(str, prefix){
// dimmClick => propsDimmClick
return prefix + etUI.utils.capitalize(str)
}
function removePrefixCamelString(str, prefix){
const regExp = new RegExp(`^${prefix}`, 'g')
return etUI.utils.uncapitalize(str.replaceAll(regExp, ''))
}
function countCharacters(str) {
let count = 0;
for (let i = 0; i < str.length; i++) {
// Check if the character is English
if (/[a-zA-Z]/.test(str[i])) {
count += 1;
}
// Check if the character is Korean or other 2-byte character
else if (str.charCodeAt(i) > 127) {
count += 2;
}
// Special characters
else {
count += 1;
}
}
return count;
}

View File

@@ -4846,13 +4846,17 @@ input[type=number] {
outline: none;
}
.component-input .input-field-btn {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
height: 100%;
padding: 0rem 0.8rem;
background-color: skyblue;
padding-right: 1.6rem;
}
.component-input .input-field-btn.clear {
display: none;
@@ -5373,8 +5377,8 @@ input[type=number] {
border: 0.1rem solid #DEE2E6;
border-radius: 0.2rem;
color: #333333;
font-size: 1.6rem;
line-height: 1.4;
font-size: 1.4rem;
line-height: 1.6;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
@@ -5497,7 +5501,7 @@ input[type=number] {
background-color: #eeeeee;
border: 1px solid #cccccc;
color: #999999;
font-size: 1.6rem;
font-size: 1.4rem;
line-height: 1.4;
cursor: pointer;
}
@@ -6441,7 +6445,7 @@ input[type=number] {
z-index: 10;
top: 0;
height: 64px;
background-color: #2F742A;
background-color: #2f742a;
}
.header .inner {
padding-left: 1.6rem;
@@ -6475,7 +6479,7 @@ input[type=number] {
padding-left: 2.5rem;
font-size: 2.2rem;
font-weight: 700;
color: #FFFFFF;
color: #ffffff;
}
.header .inner .header-left .logo-tit:before {
position: absolute;
@@ -6483,7 +6487,7 @@ input[type=number] {
display: block;
width: 0.1rem;
height: 1.6rem;
background-color: #F1F3F5;
background-color: #f1f3f5;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
@@ -6497,7 +6501,7 @@ input[type=number] {
-webkit-align-items: center;
align-items: center;
font-size: 1.6rem;
color: #FFFFFF;
color: #ffffff;
}
.header .inner .header-right .user {
margin-right: 0.8rem;
@@ -6515,7 +6519,7 @@ input[type=number] {
display: block;
border-radius: 0.4rem;
font-size: 1.4rem;
color: #FFFFFF;
color: #ffffff;
background: rgba(0, 0, 0, 0.2);
}
.header .inner .main-menu {
@@ -6536,7 +6540,7 @@ input[type=number] {
height: 100%;
}
.header .inner .main-menu .menu-item.active a {
color: #FFAD0A;
color: #ffad0a;
}
.header .inner .main-menu .menu-item:hover .sub-menu {
display: block;
@@ -6552,9 +6556,9 @@ input[type=number] {
-webkit-justify-content: center;
justify-content: center;
height: 100%;
font-size: 2rem;
font-size: 1.8rem;
font-weight: 600;
color: #FFFFFF;
color: #ffffff;
}
.header .inner .main-menu .sub-menu {
display: none;
@@ -6563,7 +6567,7 @@ input[type=number] {
position: absolute;
z-index: 100;
top: 5.5rem;
background-color: #FFFFFF;
background-color: #ffffff;
border-radius: 0.4rem;
overflow: hidden;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
@@ -6575,7 +6579,7 @@ input[type=number] {
font-size: 1.5rem;
}
.header .inner .main-menu .sub-menu .sub-menu-item a:hover {
background-color: #F1F5FE;
background-color: #f1f5fe;
}
.header .inner .main-menu .sub-menu .sub-menu-item + li {
margin-top: 0.4rem;
@@ -6698,6 +6702,9 @@ table {
width: 100%;
border-collapse: collapse;
}
table a {
text-decoration: underline;
}
table th {
background-color: #f1f3f5 !important;
}
@@ -7162,6 +7169,91 @@ table tbody th {
background-color: #f1f3f5;
}
.dounut-chart-area {
padding: 1.6rem 2.4rem;
display: -webkit-box;
display: -webkit-flex;
display: flex;
gap: 2.4rem;
background-color: #F1F3F5;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.dounut-chart-area .chart-group {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
padding: 2.4rem 3.2rem;
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
background-color: #ffffff;
}
.dounut-chart-area .chart-group dl {
color: #212529;
}
.dounut-chart-area .chart-group dl dt strong {
display: block;
font-size: 2rem;
font-weight: 700;
}
.dounut-chart-area .chart-group dl dt span {
margin-top: 0.4rem;
display: block;
font-size: 1.4rem;
color: #495057;
}
.dounut-chart-area .chart-group dl dd {
margin-top: 3.2rem;
}
.dounut-chart-area .chart-group dl dd .percent {
position: relative;
display: block;
font-size: 5.6rem;
font-weight: 700;
}
.dounut-chart-area .chart-group dl dd .percent::after {
position: absolute;
content: "%";
display: block;
right: -1.8rem;
top: 0;
}
.dounut-chart-area .chart-group dl dd .d-flex {
margin-top: 0.8rem;
gap: 0.2rem;
color: #495057;
}
.donut-chart {
--percent: 75;
width: 160px;
height: 160px;
border-radius: 50%;
background: conic-gradient(#95BA45 -webkit-calc(75 * 1%), #E9ECEF 0%);
background: conic-gradient(#95BA45 calc(75 * 1%), #E9ECEF 0%);
background: conic-gradient(#95BA45 -webkit-calc(var(--percent) * 1%), #E9ECEF 0%);
background: conic-gradient(#95BA45 calc(var(--percent) * 1%), #E9ECEF 0%);
position: relative;
}
.donut-chart::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 60%;
height: 60%;
background: #fff;
border-radius: 50%;
}
/* https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css */
table.dataTable td.dt-control {
text-align: center;
@@ -9193,7 +9285,7 @@ span.CodeMirror-selectedtext {
* 레이아웃
*/
body {
font-family: "Lato", "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}
.uid-container {

File diff suppressed because one or more lines are too long