From aa701ed61198c33349c01a9144f43435444939a9 Mon Sep 17 00:00:00 2001 From: king Date: Wed, 11 Nov 2026 15:22:00 +0900 Subject: [PATCH] =?UTF-8?q?feat(=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8):=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=81=20=EA=B3=A0=EB=A5=B4=EA=B8=B0=EB=A5=BC=20?= =?UTF-8?q?=EA=B3=B5=EC=9A=A9=20=EC=8B=9C=EA=B0=81=20=ED=8C=9D=EC=97=85?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=E2=80=94=20=EC=98=B5=EC=85=98=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20=EC=8B=9C=EA=B0=81=C2=B7=EA=B8=B4=EA=B8=89=20?= =?UTF-8?q?=EA=B3=B5=EC=A7=80=20=EB=9D=84=EC=9A=B8=20=EC=8B=9C=EA=B0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - project.js openTimePopover·enhanceTimeInput(PJLib): 날짜 팝업 모양, 시 00~23·분 5분 단위, 끝에서 멈춤 - 모달 dialog 안이면 그 창 안 popover, 아니면 body Co-Authored-By: Claude Opus 5.5 --- .../cupang/templates/cupang/index.html | 4 +- .../notice/templates/notice/admin.html | 6 +- app/modules/project/CLAUDE.md | 2 + .../project/templates/project/_options.html | 2 +- .../templates/project/goal_meeting.html | 4 +- .../project/templates/project/goals.html | 4 +- .../project/templates/project/help.html | 2 +- .../project/templates/project/inbox.html | 4 +- .../project/templates/project/mytasks.html | 4 +- .../project/templates/project/notifier.html | 4 +- .../project/templates/project/project.html | 4 +- .../project/templates/project/trash.html | 4 +- app/static/erp-notice-admin.js | 1 + app/static/project-options.js | 86 +----------- app/static/project.css | 12 +- app/static/project.js | 130 ++++++++++++++++++ 16 files changed, 166 insertions(+), 107 deletions(-) diff --git a/app/modules/cupang/templates/cupang/index.html b/app/modules/cupang/templates/cupang/index.html index 98f2c82..9cca8e8 100644 --- a/app/modules/cupang/templates/cupang/index.html +++ b/app/modules/cupang/templates/cupang/index.html @@ -2,7 +2,7 @@ {% block head_extra %} {# 출고리스트 작성 팝업의 날짜 칸은 프로젝트 화면의 날짜 팝업을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #} - + @@ -249,7 +249,7 @@ {% endblock %} {% block scripts %} - + {% endblock %} @@ -64,7 +64,7 @@ - - + + {% endif %} {% endblock %} diff --git a/app/modules/project/CLAUDE.md b/app/modules/project/CLAUDE.md index f0260d6..9766e11 100644 --- a/app/modules/project/CLAUDE.md +++ b/app/modules/project/CLAUDE.md @@ -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분 단위, 끝에서 멈춤. + 프로젝트(긴급 공지 포함)에서 `` 기본 시계 금지. 모달 dialog 안 칸이면 그 창 안에 popover 로 붙음(body 면 inert 로 마우스가 안 먹음). - 날짜 팝업(`openDatePopover`·`enhanceDateInput`·`.pj-datepop` CSS)은 다른 모듈용 공용 복사본이 있다 — `app/static/erp-datepop.js`·`.css` (2026-10-27, 휴가 신청 날짜 칸). 모양·동작을 바꾸면 그쪽도 같이 고칠 것(나중에 프로젝트도 공용 파일로 옮기면 하나가 됨). diff --git a/app/modules/project/templates/project/_options.html b/app/modules/project/templates/project/_options.html index 85c12bc..90722c4 100644 --- a/app/modules/project/templates/project/_options.html +++ b/app/modules/project/templates/project/_options.html @@ -129,4 +129,4 @@ document.documentElement.dataset.pjFont = pf; } catch (_) {} - + diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index c2cde64..1730ba3 100644 --- a/app/modules/project/templates/project/goal_meeting.html +++ b/app/modules/project/templates/project/goal_meeting.html @@ -1,7 +1,7 @@ {% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -289,5 +289,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index 873ebeb..259b40a 100644 --- a/app/modules/project/templates/project/goals.html +++ b/app/modules/project/templates/project/goals.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -207,5 +207,5 @@ {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index 490919e..5a56f18 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 4e8e49c..95ce10b 100644 --- a/app/modules/project/templates/project/inbox.html +++ b/app/modules/project/templates/project/inbox.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -106,5 +106,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html index 9d86221..6db9cca 100644 --- a/app/modules/project/templates/project/mytasks.html +++ b/app/modules/project/templates/project/mytasks.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -100,5 +100,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/notifier.html b/app/modules/project/templates/project/notifier.html index 2e53ea8..307cf59 100644 --- a/app/modules/project/templates/project/notifier.html +++ b/app/modules/project/templates/project/notifier.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -108,5 +108,5 @@ }); })(); - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 41c224a..53c2232 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + @@ -476,5 +476,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index 5854896..83371c9 100644 --- a/app/modules/project/templates/project/trash.html +++ b/app/modules/project/templates/project/trash.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -70,5 +70,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/static/erp-notice-admin.js b/app/static/erp-notice-admin.js index 0f2f59f..0b86af3 100644 --- a/app/static/erp-notice-admin.js +++ b/app/static/erp-notice-admin.js @@ -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("") || '등록된 사람이 없습니다.'; function toAll() { return root.querySelector('input[name="ntc-to"]:checked').value === "all"; } diff --git a/app/static/project-options.js b/app/static/project-options.js index 500f0ea..8ceb84b 100644 --- a/app/static/project-options.js +++ b/app/static/project-options.js @@ -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 '
' + list.map(function (v) { - return '"; - }).join("") + "
"; - } - 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 = '
' + - '
시분
' + - '
' + col("h", hours, h) + col("m", mins, m) + "
" + - '
' + - '
'; - 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(); diff --git a/app/static/project.css b/app/static/project.css index 25d1615..cf8016a 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -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; } diff --git a/app/static/project.js b/app/static/project.js index 4cc6359..7b85276 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -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 '
' + list.map(function (v) { + return '"; + }).join("") + "
"; + } + const pop = document.createElement("div"); + pop.className = "pj-datepop pj-timepop"; + pop.innerHTML = '
' + + '
시분
' + + '
' + col("h", hours, h) + col("m", mins, m) + "
" + + '
' + + '
'; + 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); + }; + } + // 를 시각 버튼으로 — 브라우저 기본 시계 대신 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 = 'schedule'; + 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 () {