Fit manual order grid columns and rows to cell content

This commit is contained in:
2026-10-22 20:00:19 +09:00
parent 827cb3b0a8
commit ae50500655
3 changed files with 12 additions and 8 deletions
+7 -5
View File
@@ -9,13 +9,15 @@
#manual-save-status[data-state="saving"] { color:#1d4ed8; }
#manual-save-retry { border:1px solid #fecaca; background:#fff1f2; padding:3px 9px; border-radius:4px; cursor:pointer; }
.manual-grid-scroll { flex:1; min-height:200px; overflow:auto; background:white; border:1px solid #cbd5e1; border-radius:8px; }
table.manual-grid { border-collapse:separate; border-spacing:0; table-layout:fixed; width:max-content; min-width:100%; margin:0; font-size:13px; color:#1e293b; }
.manual-grid th,.manual-grid td { box-sizing:border-box; min-width:150px; width:150px; max-width:150px; padding:7px 9px; border:0; border-right:1px solid #e2e8f0; border-bottom:1px solid #e2e8f0; text-align:left; vertical-align:top; white-space:pre-wrap; overflow-wrap:anywhere; line-height:20px; background:white; }
.manual-grid th { position:sticky; z-index:2; top:24px; background:#f1f5f9; font-weight:600; height:35px; }
table.manual-grid { border-collapse:separate; border-spacing:0; table-layout:auto; width:max-content; margin:0; font-size:13px; color:#1e293b; }
.manual-grid th,.manual-grid td { box-sizing:border-box; padding:4px 9px; border:0; border-right:1px solid #e2e8f0; border-bottom:1px solid #e2e8f0; text-align:left; vertical-align:middle; white-space:pre; overflow-wrap:normal; line-height:1.4; background:white; }
.manual-grid th { position:sticky; z-index:2; top:24px; background:#f1f5f9; font-weight:600; text-align:center; padding:6px 9px; }
.manual-grid thead tr:first-child th { top:0; height:24px; padding:1px 9px; text-align:center; color:#64748b; font-size:11px; background:#e9eef5; }
.manual-grid td:first-child,.manual-grid th:first-child { position:sticky; left:0; min-width:65px; width:65px; max-width:65px; background:#f1f5f9; color:#64748b; text-align:center; z-index:1; white-space:nowrap; }
.manual-grid td:first-child,.manual-grid th:first-child { position:sticky; left:0; background:#f1f5f9; color:#64748b; text-align:center; z-index:1; white-space:nowrap; }
.manual-grid th:first-child { z-index:3; }
.manual-grid td:nth-child(9),.manual-grid th:nth-child(9),.manual-grid td:nth-child(16),.manual-grid th:nth-child(16) { min-width:280px; width:280px; max-width:280px; }
.manual-row-index { display:flex; align-items:center; justify-content:center; gap:6px; cursor:pointer; }
.manual-grid input[type="checkbox"] { display:block; width:14px; height:14px; margin:0; flex-shrink:0; }
.manual-grid th input[type="checkbox"] { margin:0 auto; }
.manual-grid td[contenteditable]:focus { outline:2px solid #2563eb; outline-offset:-2px; background:#eff6ff; }
.manual-grid td[data-dirty="true"] { background:#fffbeb; }
.manual-grid td[data-error="true"] { background:#fff1f2; box-shadow:inset 0 -2px #e11d48; }
+3 -1
View File
@@ -104,7 +104,9 @@
data.rows.forEach((row, index) => {
const tr = body.insertRow(), number = tr.insertCell(), check = document.createElement('input');
check.type = 'checkbox'; check.dataset.rowId = row.id; check.setAttribute('aria-label', `${index + 1}행 선택`);
number.append(check, document.createTextNode(` ${index + 1}`));
const rowIndex = document.createElement('label'), rowNumber = document.createElement('span');
rowIndex.className = 'manual-row-index'; rowNumber.textContent = index + 1;
rowIndex.append(check, rowNumber); number.append(rowIndex);
row.cells.forEach((value, column) => {
const td = tr.insertCell(); td.textContent = value; td.contentEditable = 'plaintext-only'; td.tabIndex = 0;
td.dataset.id = row.id; td.dataset.column = column; td.setAttribute('aria-label', `${index + 1}행 ${headers[column] || columnLetter(column)}`);
+2 -2
View File
@@ -17,7 +17,7 @@
/>
<link rel="stylesheet" href="{{ root_path }}/static/css/cs_records.css?v=21" />
<link rel="stylesheet" href="{{ root_path }}/static/css/return_filters.css?v=1" />
<link rel="stylesheet" href="{{ root_path }}/static/css/manual_grid.css?v=1" />
<link rel="stylesheet" href="{{ root_path }}/static/css/manual_grid.css?v=2" />
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
<script>
// 서브경로 호스팅 정보 — JS 가 fetch 시 prefix 로 사용한다.
@@ -4031,7 +4031,7 @@
</main>
</div>
<script src="{{ root_path }}/static/js/app.js?v=73"></script>
<script src="{{ root_path }}/static/js/manual_grid.js?v=1"></script>
<script src="{{ root_path }}/static/js/manual_grid.js?v=2"></script>
<script src="{{ root_path }}/static/js/cs_records.js?v=19"></script>
<script src="{{ root_path }}/static/js/mall_event.js?v=7"></script>
<script src="{{ root_path }}/static/js/milkrun_gsheet.js?v=8"></script>