- 위험 채움 토큰 밝음 #e5484d → #d6363c(흰 글 3.91 → 4.72) · 어두움 5.6 · 위험 글 #c0392b 그대로 - 새 부품 계산 줄(ui_template_calc_row) — B08 수리집수면적표 b08-hydro__row · 식 칸 배치를 대신함 - 표 부품 칸 램프(ui-data-table__lamp · --only · ✓) — B08 집계표 · 거리이정표 · B09 설계내역 램프 CSS 세 벌을 걷음(표지 class 는 풍선 · 가이드용으로 남김) - 모달 넓은 중간 창(wide + width 1100px · 1100 × 680) — B09 운반 창 손 인라인 크기를 걷음 - 값 목록 규칙 꼴(rule) — ☰ 설정 규칙 줄 ul/li 를 걷음 - 접이 구역 머리(createCollapsibleHead = 패널 머리 + 접는 제목) — B08 구조물도 「조합 연결」 제목(옛 b08-sheets__title)을 대신함 - 일반 화면 틀 좁은 폭 · 입력 칸 2열 · 끝 단추 줄 — D01 · E01 이 B02 CSS 를 빌리던 것을 끊음(가이드 장면 선택자 맞춤) - 부품 모음 견본 · 지킴 시험 test_557_2 · 낡은 시험(198_1 · 247_1 · 251_1 · 257_1 · 276_1 · 551_1)은 부품 CSS · 새 class 로 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
66 lines
3.0 KiB
Python
66 lines
3.0 KiB
Python
"""257-1 B09 위 탭 「설계내역」(총괄설계내역서 · 설계내역서 한 묶음) · 설계내역서 단가연결 칸 램프.
|
|
|
|
- 위 탭 = `TAB_GROUPS` 「설계내역」[total, bill] · 옛 두 위 탭 없음
|
|
- 단가연결 칸 = 줄 칸 class `b09-bill__lamp`(+ 연결 `is-linked`) · 풍선 = 글(대가N · 연결됨 · 단가연결)
|
|
- 머리 = 「단가↵연결」 · 폭 44 · 머리 CSS pre-line
|
|
"""
|
|
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
if str(ROOT) not in sys.path:
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from resources.tester.test_184_3_b09_bill_menu import ROWS, SRC, _node, _ts # noqa: E402
|
|
|
|
JS = """
|
|
const ctx = { sheets: { bill: { rows: __ROWS__, totals: null } }, payload: {}, user: {}, setUser() {} };
|
|
const table = buildBill(ctx);
|
|
const at = (key) => table.rows.findIndex((r) => r.key === key);
|
|
const keys = ["earth:4", "earth:5", "hand:a", "mat:M1", "fee", "sec:1"];
|
|
const col = table.columns.find((c) => c.key === "connect");
|
|
console.log(JSON.stringify({
|
|
col: { label: col.label, width: col.width, title: col.title },
|
|
cls: keys.map((k) => table.cellClass(at(k), "connect")),
|
|
tip: keys.map((k) => table.tip(at(k), "connect")),
|
|
other: table.cellClass(at("earth:4"), "qty"),
|
|
groups: TAB_GROUPS.map(([label, tabs]) => [label, tabs]),
|
|
}));
|
|
"""
|
|
|
|
|
|
def test_램프_칸_class_풍선_머리():
|
|
body = JS.replace("__ROWS__", json.dumps(ROWS, ensure_ascii=False))
|
|
out = json.loads(_node(_ts([*SRC, "UI_Tabs_Bill"]) + body))
|
|
assert out["col"] == {"label": "단가\n연결", "width": 44, "title": "단가연결"}
|
|
assert (
|
|
out["cls"]
|
|
== [
|
|
"ui-data-table__lamp ui-data-table__lamp--only b09-bill__lamp is-linked", # 자동 줄 · 호표 연결
|
|
"ui-data-table__lamp ui-data-table__lamp--only b09-bill__lamp", # 연결 없음 = 노랑
|
|
"ui-data-table__lamp ui-data-table__lamp--only b09-bill__lamp is-linked", # 손 줄 · 비고 대가3
|
|
None, # 자재 줄 = 연결 대상 아님
|
|
None,
|
|
None, # 묶음 줄
|
|
]
|
|
)
|
|
assert out["tip"] == ["연결됨", "단가연결", "대가3", None, None, None]
|
|
assert out["other"] is None
|
|
labels = [g[0] for g in out["groups"]]
|
|
assert "설계내역" in labels and "총괄설계내역서" not in labels and "설계내역서" not in labels
|
|
assert ["설계내역", ["total", "bill"]] in out["groups"]
|
|
|
|
|
|
def test_CSS_램프_초록_노랑_머리_줄바꿈():
|
|
css = (ROOT / "B09_Estimation" / "B09_Estimation_UI_Page.css").read_text("utf-8")
|
|
part = (ROOT / "ui_template" / "ui_template_data_table.css").read_text(
|
|
"utf-8"
|
|
) # 꼴 = 표 부품(557-2)
|
|
assert "td.ui-data-table__lamp::before" in part and "var(--color-warning)" in part
|
|
assert "td.ui-data-table__lamp.is-linked::before" in part and "var(--color-success)" in part
|
|
assert "td.ui-data-table__lamp--only" in part and "b09-bill__lamp" not in css
|
|
head = css.split("[data-b09-table] thead th {", 1)[1].split("}", 1)[0]
|
|
assert "white-space: pre-line" in head
|