fix(m02-df): 표준 표 판 제목을 고를 수 있게 — renderStandards opts.title(기본 true · 모달은 false)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BU9gbNE3aWFUvE61pS2WGt
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
gap: var(--spacing-8, 8px);
|
||||
}
|
||||
|
||||
.m02-df-std__head h3 {
|
||||
/* 첫 칸(제목 · 제목이 없으면 상태 글)이 단추를 오른쪽으로 밂 */
|
||||
.m02-df-std__head > :first-child {
|
||||
margin: 0 auto 0 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* 처음 값 = `_standard/단위표준.json` · `금액단위표준.json`(산림품셈 1-2-2 · 원문 흠 그대로 — 사용자가 고침)
|
||||
* 서버 = `M02_DF_Api` cfStandards · cfStandardsSave · cfStandardsReset(`/api/m02/df/standards`) → {unit, money, saved} ·
|
||||
* 고친 것은 `_data`(마스터에 안 씀)
|
||||
* `renderStandards(host, on)` = 시험판 안 「표준 표」 판(두 표 보기 · 칸 고치기 · 저장 · 처음 값으로)
|
||||
* `renderStandards(host, on, { title })` = 시험판 안 「표준 표」 판(두 표 보기 · 칸 고치기 · 저장 · 처음 값으로)
|
||||
* `standardsList()` = 단위 고르기 · 끝수 제안이 부르는 목록(동기 · 처음엔 번들 값 · 판이 서버 값을 받으면 그것)
|
||||
* 이 폴더째 지워도 됨.
|
||||
* ========================================================================== */
|
||||
@@ -185,8 +185,17 @@ function parseCell(key: string, text: string): string | number | null | undefine
|
||||
const show = (v: unknown): string =>
|
||||
v === null || v === undefined ? "" : typeof v === "number" ? v.toLocaleString() : String(v);
|
||||
|
||||
export interface StandardsOpts {
|
||||
/** 판 제목 「표준 표」 — 모달처럼 겉에 제목이 있으면 false(기본 true) */
|
||||
title?: boolean;
|
||||
}
|
||||
|
||||
/** 시험판 안 「표준 표」 판 */
|
||||
export function renderStandards(host: HTMLElement, on: StandardsOn = {}): void {
|
||||
export function renderStandards(
|
||||
host: HTMLElement,
|
||||
on: StandardsOn = {},
|
||||
opts: StandardsOpts = {},
|
||||
): void {
|
||||
let work = clone(current);
|
||||
let dirty = false;
|
||||
const state = el("span", { className: "m02-df-std__state" });
|
||||
@@ -334,7 +343,12 @@ export function renderStandards(host: HTMLElement, on: StandardsOn = {}): void {
|
||||
children: [
|
||||
el("div", {
|
||||
className: "m02-df-std__head",
|
||||
children: [el("h3", { text: tx("Title") }), state, reset, save],
|
||||
children: [
|
||||
...(opts.title === false ? [] : [el("h3", { text: tx("Title") })]),
|
||||
state,
|
||||
reset,
|
||||
save,
|
||||
],
|
||||
}),
|
||||
el("p", { className: "m02-df-std__hint", text: `${tx("Source")} · ${tx("Hint")}` }),
|
||||
body,
|
||||
|
||||
Reference in New Issue
Block a user