feat(프로젝트): 시각 고르기를 공용 시각 팝업으로 — 옵션 알림 시각·긴급 공지 띄울 시각

- project.js openTimePopover·enhanceTimeInput(PJLib): 날짜 팝업 모양, 시 00~23·분 5분 단위, 끝에서 멈춤
- 모달 dialog 안이면 그 창 안 popover, 아니면 body

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 15:22:00 +09:00
parent 8bcf9b4b20
commit aa701ed611
16 changed files with 166 additions and 107 deletions
@@ -2,7 +2,7 @@
{% block head_extra %}
{# 출고리스트 작성 팝업의 날짜 칸은 프로젝트 화면의 날짜 팝업을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<link rel="stylesheet" href="/static/cupang.css?v=20261023d" />
<script>window.PJ_LIB_ONLY = true; window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
@@ -249,7 +249,7 @@
{% endblock %}
{% block scripts %}
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
<script src="/static/cupang-outbound.js?v=20261023d" defer></script>
<script>
(function () {
@@ -2,7 +2,7 @@
{% block head_extra %}
{# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<script>window.PJ_LIB_ONLY = true; window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
{% endblock %}
@@ -64,7 +64,7 @@
</section>
</div>
<script>window.NTC_PEOPLE = {{ people | tojson }};</script>
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/erp-notice-admin.js?v=20261012b" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
<script src="/static/erp-notice-admin.js?v=20261111a" defer></script>
{% endif %}
{% endblock %}
+2
View File
@@ -17,6 +17,8 @@
- 용어는 **"업무"**(2026-10-13 "작업"에서 다시 통일 — 화면·메시지·알림 제목, 코드·DB 는 그대로)·"세부 업무"·"메인 업무 추가". ERP 메뉴 이름은 "Project"(`app/main.py` 모듈 목록 title).
- 화면 기능을 바꾸면 도움말(`/project/help`)도 같이 고친다.
- UI 버그는 로컬 헤드리스 크롬/엣지로 렌더·좌표 덤프해 재현 후 고칠 것.
- **시각 고르기 = 공용 시각 팝업**(2026-11-11, `openTimePopover`·`enhanceTimeInput`, `PJLib` 로도) — 날짜 팝업 모양, 시 00~23·분 5분 단위, 끝에서 멈춤.
프로젝트(긴급 공지 포함)에서 `<input type="time">` 기본 시계 금지. 모달 dialog 안 칸이면 그 창 안에 popover 로 붙음(body 면 inert 로 마우스가 안 먹음).
- 날짜 팝업(`openDatePopover`·`enhanceDateInput`·`.pj-datepop` CSS)은 다른 모듈용 공용 복사본이 있다 — `app/static/erp-datepop.js`·`.css`
(2026-10-27, 휴가 신청 날짜 칸). 모양·동작을 바꾸면 그쪽도 같이 고칠 것(나중에 프로젝트도 공용 파일로 옮기면 하나가 됨).
@@ -129,4 +129,4 @@
document.documentElement.dataset.pjFont = pf;
} catch (_) {}
</script>
<script src="/static/project-options.js?v=20261111d" defer></script>
<script src="/static/project-options.js?v=20261111e" defer></script>
@@ -1,7 +1,7 @@
{% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -289,5 +289,5 @@
<script src="/static/project-goal-text.js?v=20261026a" defer></script>
<script src="/static/project-meeting-cells.js?v=20261012a" defer></script>
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -207,5 +207,5 @@
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project-goal-text.js?v=20261026a" defer></script>
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -106,5 +106,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -108,5 +108,5 @@
});
})();
</script>
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -476,5 +476,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261111e" />
<link rel="stylesheet" href="/static/project.css?v=20261111f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261111c" defer></script>
<script src="/static/project.js?v=20261111d" defer></script>
{% endblock %}
+1
View File
@@ -54,6 +54,7 @@
});
// ── 날짜 — 프로젝트 날짜 팝업 ──
L.enhanceDateInput(dateEl, { placeholder: "날짜(비우면 바로)" });
if (L.enhanceTimeInput) L.enhanceTimeInput(timeEl, { placeholder: "00:00" }); // 프로젝트 공용 시각 팝업(5분 단위)
// ── 받는 사람 — 프로젝트 멤버 고르기 모양 ──
peopleBox.innerHTML = people.map(L.memberPickHtml).join("") || '<span class="pj-empty-sm">등록된 사람이 없습니다.</span>';
function toAll() { return root.querySelector('input[name="ntc-to"]:checked').value === "all"; }
+5 -81
View File
@@ -63,88 +63,12 @@
btn.classList.toggle("is-empty", !v);
}
// ── 시각 고르기 팝업(2026-11-11) — 날짜 팝업(.pj-datepop)과 같은 카드·꼬리·파란 선택.
// 시(00~23)·분(00~55, 5분 단위) 두 열, 브라우저 기본 시계처럼 돌아가지 않고 끝에서 멈춘다.
// 모달 창 위에 떠야 해서 popover(top layer) — 단 옵션 창(dialog) **안에** 붙인다: 모달이 열려 있으면 창 밖 요소는
// inert 라 body 에 붙이면 휠·마우스 오버·클릭이 모두 안 먹었다(2026-11-11). 시 = 바꾸고 열어 둠, 분 = 바꾸고 닫음.
// [확인] = 지금 값 저장 후 닫기, [지우기] = 시각 비우고 닫기(저장 버튼을 눌러야 서버에 반영).
let timePop = null, timePopOff = null;
function closeTimePop() {
if (!timePop) return;
if (timePopOff) timePopOff();
try { timePop.hidePopover(); } catch (_) {}
timePop.remove(); timePop = timePopOff = null;
}
function pad2(n) { return (n < 10 ? "0" : "") + n; }
// 시각 고르기 = 프로젝트 공용 날짜 팝업 모양 시각 팝업(project.js openTimePopover — 옵션 창 안에 붙어 휠·클릭이 먹음)
function openTimePop(btn) {
closeTimePop();
const cur = btn.dataset.value || "";
let h = cur ? cur.slice(0, 2) : "", m = cur ? cur.slice(3, 5) : "";
const pop = document.createElement("div");
pop.className = "pj-datepop pj-timepop";
pop.setAttribute("popover", "manual");
function col(kind, list, sel) {
return '<div class="pj-tp-col" data-kind="' + kind + '">' + list.map(function (v) {
return '<button type="button" class="pj-tp-item' + (v === sel ? " is-selected" : "") + '" data-v="' + v + '">' + v + "</button>";
}).join("") + "</div>";
}
const hours = [], mins = [];
for (let i = 0; i < 24; i++) hours.push(pad2(i));
for (let i = 0; i < 60; i += 5) mins.push(pad2(i));
function paintHead() { pop.querySelector(".pj-tp-value").textContent = (h || "--") + ":" + (m || "--"); }
pop.innerHTML = '<div class="pj-dp-fields"><span class="pj-dp-field is-active pj-tp-value"></span></div>' +
'<div class="pj-tp-heads"><span>시</span><span>분</span></div>' +
'<div class="pj-tp-cols">' + col("h", hours, h) + col("m", mins, m) + "</div>" +
'<div class="pj-dp-foot"><button type="button" class="pj-dp-link" data-tp="clear">지우기</button>' +
'<button type="button" class="pj-dp-link" data-tp="ok">확인</button></div>';
paintHead();
dialog.appendChild(pop);
try { pop.showPopover(); } catch (_) {}
function commit() { if (h) setTimeBtn(btn, h + ":" + (m || "00")); }
pop.addEventListener("click", function (e) {
const it = e.target.closest(".pj-tp-item");
if (it) {
const kind = it.parentNode.dataset.kind;
it.parentNode.querySelectorAll(".is-selected").forEach(function (x) { x.classList.remove("is-selected"); });
it.classList.add("is-selected");
if (kind === "h") { h = it.dataset.v; if (!m) m = "00"; } else { m = it.dataset.v; if (!h) h = "09"; }
paintHead(); commit();
if (kind === "m") closeTimePop();
return;
}
const act = e.target.closest("[data-tp]");
if (!act) return;
if (act.dataset.tp === "clear") { h = m = ""; setTimeBtn(btn, ""); }
else commit();
closeTimePop(); btn.focus();
});
// 자리 — 앵커 아래(자리 없으면 위), 꼬리가 앵커 가운데(날짜 팝업 place 와 같음).
// 화면 배율(.pj-ui-scale zoom) 안이면 left/top 값도 배율만큼 줄어 보이므로 나눠 준다(currentCSSZoom).
const z = pop.currentCSSZoom || 1;
const r = btn.getBoundingClientRect();
const vw = document.documentElement.clientWidth, vh = document.documentElement.clientHeight;
const w = pop.offsetWidth * z, ph = pop.offsetHeight * z, ax = r.left + r.width / 2;
const left = Math.min(Math.max(8, ax - w / 2), vw - w - 8);
const below = r.bottom + 10 + ph <= vh - 8 || r.top - 10 - ph < 8;
pop.classList.toggle("is-above", !below);
pop.style.left = left / z + "px";
pop.style.top = (below ? r.bottom + 10 : r.top - 10 - ph) / z + "px";
pop.style.setProperty("--pj-dp-tail", Math.min(Math.max(ax - left, 16), w - 16) / z + "px");
// 고른 값이 보이게 — 열 안에서만 스크롤(맨 위 00 부터, 끝에서 멈춤)
pop.querySelectorAll(".pj-tp-col").forEach(function (c) {
const sel = c.querySelector(".is-selected");
if (sel) c.scrollTop = sel.offsetTop - c.offsetTop - (c.clientHeight - sel.offsetHeight) / 2;
});
function onDown(e) { if (!pop.contains(e.target) && !btn.contains(e.target)) closeTimePop(); }
function onKey(e) { if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); closeTimePop(); btn.focus(); } }
document.addEventListener("pointerdown", onDown, true);
document.addEventListener("keydown", onKey, true);
timePop = pop;
timePopOff = function () {
document.removeEventListener("pointerdown", onDown, true);
document.removeEventListener("keydown", onKey, true);
};
if (!window.PJLib || !window.PJLib.openTimePopover) return;
window.PJLib.openTimePopover(btn, { value: btn.dataset.value || "", onChange: function (v) { setTimeBtn(btn, v); } });
}
function closeTimePop() { if (window.PJLib && window.PJLib.closeTimePopover) window.PJLib.closeTimePopover(); }
function renumberTimes() {
if (!timesBox) return;
Array.from(timesBox.children).forEach(function (li, i) { li.firstChild.textContent = "알림 " + (i + 1); });
@@ -158,7 +82,7 @@
const tb = li.querySelector(".pj-time-btn"), del = li.querySelector(".pj-time-del");
setTimeBtn(tb, v);
tb.disabled = del.disabled = !sys;
tb.addEventListener("click", function () { if (timePop) closeTimePop(); else openTimePop(tb); });
tb.addEventListener("click", function () { if (document.querySelector(".pj-timepop")) closeTimePop(); else openTimePop(tb); });
del.addEventListener("click", function () { closeTimePop(); li.remove(); renumberTimes(); });
timesBox.appendChild(li);
renumberTimes();
+7 -5
View File
@@ -3306,14 +3306,16 @@ label.pj-options-row[for] { cursor: pointer; }
.pj-options-times { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pj-options-times li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pj-options-times li > span:first-child { min-width: 52px; color: var(--pj-ink-soft); }
.pj-options-times .pj-time-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid #d8dce2; border-radius: 8px; background: #fff; color: var(--pj-ink); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.pj-options-times .pj-time-btn:hover { border-color: #4573d2; }
.pj-options-times .pj-time-btn .material-symbols-outlined { font-size: 18px; color: #6d6e6f; }
.pj-options-times .pj-time-btn.is-empty .pj-time-text { color: #9aa1a9; }
.pj-time-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid #d8dce2; border-radius: 8px; background: #fff; color: var(--pj-ink); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.pj-time-btn:hover:not(:disabled) { border-color: #4573d2; }
.pj-time-btn:disabled { opacity: .6; cursor: default; }
.pj-time-btn .material-symbols-outlined { font-size: 18px; color: #6d6e6f; }
.pj-time-btn.is-empty .pj-time-text { color: #9aa1a9; }
.pj-options-times .pj-time-del { display: inline-flex; padding: 4px; border: 0; border-radius: 6px; background: none; color: #6d6e6f; cursor: pointer; }
.pj-options-times .pj-time-del:hover { background: #fdecec; color: #b42318; }
/* 시각 고르기 팝업 — 날짜 팝업(.pj-datepop) 모양 그대로 + 시·분 두 열(돌아가지 않는 목록). popover(top layer) 기본값을 지운다. */
.pj-timepop[popover] { inset: auto; margin: 0; overflow: visible; width: 200px; }
.pj-timepop { width: 200px; }
.pj-timepop[popover] { inset: auto; margin: 0; overflow: visible; }
.pj-tp-value { display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pj-tp-heads, .pj-tp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pj-tp-heads span { text-align: center; font-size: 12px; font-weight: 600; color: #6d6e6f; padding: 2px 0 4px; }
+130
View File
@@ -757,6 +757,135 @@
sync();
}
// ── 시각 고르기 팝업(2026-11-11, 프로젝트 공용 — Project 옵션 알림 시각·긴급 공지 띄울 시각) ──
// 날짜 팝업(.pj-datepop)과 같은 카드·꼬리·파란 선택. 시(00~23)·분(00~55, 5분 단위) 두 열 — 브라우저 기본
// 시계처럼 돌아가지 않고 끝에서 멈춘다. 시 = 바꾸고 열어 둠, 분 = 바꾸고 닫음, [확인] = 지금 값 넣고 닫기,
// [지우기] = 비우고 닫기. opts: { value: "HH:MM"|"", onChange(v) }.
// 모달 대화창(dialog[open]) 안의 칸이면 그 창 **안에** popover(top layer)로 붙인다 — 창 밖(body)에 붙이면
// 모달 때문에 inert 라 휠·마우스 오버·클릭이 안 먹는다. 그 밖에는 body(배율 .pj-ui-scale 밖).
let timePopEl = null, timePopCleanup = null;
function closeTimePopover() {
if (timePopCleanup) timePopCleanup();
timePopCleanup = null;
if (timePopEl) {
try { if (timePopEl.matches(":popover-open")) timePopEl.hidePopover(); } catch (_) {}
timePopEl.remove(); timePopEl = null;
}
}
function openTimePopover(anchor, opts) {
closeTimePopover();
const pad2 = function (n) { return (n < 10 ? "0" : "") + n; };
const cur = /^\d{2}:\d{2}/.test(opts.value || "") ? opts.value.slice(0, 5) : "";
let h = cur ? cur.slice(0, 2) : "", m = cur ? cur.slice(3, 5) : "";
const hours = [], mins = [];
for (let i = 0; i < 24; i++) hours.push(pad2(i));
for (let i = 0; i < 60; i += 5) mins.push(pad2(i));
function col(kind, list, sel) {
return '<div class="pj-tp-col" data-kind="' + kind + '">' + list.map(function (v) {
return '<button type="button" class="pj-tp-item' + (v === sel ? " is-selected" : "") + '" data-v="' + v + '">' + v + "</button>";
}).join("") + "</div>";
}
const pop = document.createElement("div");
pop.className = "pj-datepop pj-timepop";
pop.innerHTML = '<div class="pj-dp-fields"><span class="pj-dp-field is-active pj-tp-value"></span></div>' +
'<div class="pj-tp-heads"><span>시</span><span>분</span></div>' +
'<div class="pj-tp-cols">' + col("h", hours, h) + col("m", mins, m) + "</div>" +
'<div class="pj-dp-foot"><button type="button" class="pj-dp-link" data-tp="clear">지우기</button>' +
'<button type="button" class="pj-dp-link" data-tp="ok">확인</button></div>';
function paintHead() { pop.querySelector(".pj-tp-value").textContent = (h || "--") + ":" + (m || "--"); }
paintHead();
const host = anchor.closest("dialog[open]");
if (host) { pop.setAttribute("popover", "manual"); host.appendChild(pop); try { pop.showPopover(); } catch (_) {} }
else document.body.appendChild(pop);
function emit(v) { if (opts.onChange) opts.onChange(v); }
function commit() { if (h) emit(h + ":" + (m || "00")); }
pop.addEventListener("click", function (e) {
const it = e.target.closest(".pj-tp-item");
if (it) {
const kind = it.parentNode.dataset.kind;
it.parentNode.querySelectorAll(".is-selected").forEach(function (x) { x.classList.remove("is-selected"); });
it.classList.add("is-selected");
if (kind === "h") { h = it.dataset.v; if (!m) m = "00"; } else { m = it.dataset.v; if (!h) h = "09"; }
paintHead(); commit();
if (kind === "m") { closeTimePopover(); anchor.focus(); }
return;
}
const act = e.target.closest("[data-tp]");
if (!act) return;
if (act.dataset.tp === "clear") emit(""); else commit();
closeTimePopover(); anchor.focus();
});
// 자리 — 앵커 아래(자리 없으면 위), 꼬리가 앵커 가운데(openDatePopover place 와 같음).
// 배율(zoom) 안의 dialog 에 붙었으면 left/top 값도 배율만큼 줄어 보이므로 나눠 준다(currentCSSZoom).
const z = pop.currentCSSZoom || 1;
const r = anchor.getBoundingClientRect();
const vw = document.documentElement.clientWidth, vh = document.documentElement.clientHeight;
const w = pop.offsetWidth * z, ph = pop.offsetHeight * z, ax = r.left + r.width / 2;
const left = Math.min(Math.max(8, ax - w / 2), vw - w - 8);
const below = r.bottom + 10 + ph <= vh - 8 || r.top - 10 - ph < 8;
pop.classList.toggle("is-above", !below);
pop.style.left = left / z + "px";
pop.style.top = (below ? r.bottom + 10 : r.top - 10 - ph) / z + "px";
pop.style.setProperty("--pj-dp-tail", Math.min(Math.max(ax - left, 16), w - 16) / z + "px");
// 고른 값이 보이게 — 열 안에서만 스크롤(맨 위 00 부터, 끝에서 멈춤)
pop.querySelectorAll(".pj-tp-col").forEach(function (c) {
const sel = c.querySelector(".is-selected");
if (sel) c.scrollTop = sel.offsetTop - c.offsetTop - (c.clientHeight - sel.offsetHeight) / 2;
});
function onDown(e) { if (!pop.contains(e.target) && !anchor.contains(e.target)) closeTimePopover(); }
function onKey(e) { if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); closeTimePopover(); anchor.focus(); } }
document.addEventListener("pointerdown", onDown, true);
document.addEventListener("keydown", onKey, true);
window.addEventListener("resize", closeTimePopover);
timePopEl = pop;
timePopCleanup = function () {
document.removeEventListener("pointerdown", onDown, true);
document.removeEventListener("keydown", onKey, true);
window.removeEventListener("resize", closeTimePopover);
};
}
// <input type="time"> 를 시각 버튼으로 — 브라우저 기본 시계 대신 openTimePopover. input 은 숨긴 값 저장소
// (value 읽기/쓰기·change 이벤트 그대로, value 를 쓰면 버튼 글자도 바뀜 — enhanceDateInput 과 같은 방식).
function enhanceTimeInput(input, opts) {
if (!input || input.dataset.pjTime) return;
opts = opts || {};
input.dataset.pjTime = "1";
input.style.display = "none";
const btn = document.createElement("button");
btn.type = "button";
btn.className = "pj-time-btn";
btn.innerHTML = '<span class="pj-time-text"></span><span class="material-symbols-outlined">schedule</span>';
if (input.getAttribute("aria-label")) btn.setAttribute("aria-label", input.getAttribute("aria-label"));
input.after(btn);
const desc = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value");
Object.defineProperty(input, "value", {
configurable: true,
get: function () { return desc.get.call(this); },
set: function (v) { desc.set.call(this, v); sync(); },
});
function sync() {
const v = (input.value || "").slice(0, 5);
btn.querySelector(".pj-time-text").textContent = v || opts.placeholder || "시각 선택";
btn.classList.toggle("is-empty", !v);
btn.disabled = input.disabled;
btn.title = v ? "시각 변경" : "시각 지정";
}
btn.addEventListener("click", function (e) {
e.preventDefault();
if (timePopEl) { closeTimePopover(); return; }
openTimePopover(btn, {
value: input.value,
onChange: function (v) {
if ((input.value || "").slice(0, 5) === v) return;
input.value = v;
input.dispatchEvent(new Event("input", { bubbles: true }));
input.dispatchEvent(new Event("change", { bubbles: true }));
},
});
});
sync();
}
// ── 탭 그룹(뷰 탭/스코프 토글, 둘 다 .pj-view-tabs 마크업 공유)에 슬라이드
// 하이라이트를 붙인다 — is-active 를 단순 배경색 대신, 실제 위치가 움직이는
// 절대배치 요소 하나로 표현한다. 탭 클릭·초기 렌더·리사이즈마다 위치 재계산.
@@ -13609,6 +13738,7 @@
// 공용 말풍선만 켠다(프로젝트 알림 팝업 확인·실시간 동기화 등이 그 화면에서 돌지 않게).
window.PJLib = {
createDescEditor: createDescEditor, enhanceDateInput: enhanceDateInput,
enhanceTimeInput: enhanceTimeInput, openTimePopover: openTimePopover, closeTimePopover: closeTimePopover,
memberPickHtml: memberPickHtml, showToast: showToast,
};
document.addEventListener("DOMContentLoaded", function () {