chore(853-3): 불러오기 화면 죽은 것 · 글 키 걷음 — 묶음 ④
- logic/M02_MasterTemplete_Hopyo_Unit.ts(TS import 0) + helper_m02_hopyo_unit.cjs(부르는 시험 0) 지움 - Hopyo_SheetNav.dropGrid · Hopyo_Side 표지 data-hopyo-wizard-open(읽는 곳 0) 지움 - Hopyo.css 선택자 열(m02-hopyo__search · table · parts · part · times · unit · unit-text · acts — TS · html 0 · 조립 이름 0)과 딸린 주석 지움 - 글 키(저장소 전체 ts · js · cjs · py · html 낱말 찾기 · 조립 키 M02_TreeCopyTo* 셋 뺌): ui_template_locale_m2 247 → 173(−74 · 불러오기 Sk · Left · HopyoUnit · HopyoKid · Lost · Elem) · ui_template_locale_m2_judge 81 → 18(−63 · 옛 판정 · 확인 창) - test_720 의 옛 장부 단추 글자 확인 두 줄 뺌(815-2 에 걷힌 buildHopyoLedger · 전부터 실패하던 글자 시험) - typecheck 0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,57 +24,6 @@
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.m02-hopyo__search {
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
/* 실무자료 표 — 한글은 낱말 단위로만 줄바꿈(두세 글자마다 안 갈라짐) · 너무 긴 낱말만 쪼갬 */
|
||||
.m02-hopyo__table :is(th, td) {
|
||||
word-break: keep-all;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* 우리 로직 칸 — 대상 여럿 = 칸 안 여러 줄(이름 · 키 · 몫 · 배 칸 · [옵션]) */
|
||||
.m02-hopyo__parts {
|
||||
min-width: 11em;
|
||||
}
|
||||
|
||||
.m02-hopyo__part {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--spacing-4);
|
||||
}
|
||||
|
||||
.m02-hopyo__part + .m02-hopyo__part {
|
||||
margin-top: var(--spacing-4);
|
||||
}
|
||||
|
||||
.m02-hopyo__times {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
.m02-hopyo__unit {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-4);
|
||||
}
|
||||
|
||||
/* 단위 환산 칸 앞뒤 글 — 「엑셀 1 ㎡ = 우리 [ ] 본」 */
|
||||
.m02-hopyo__unit-text {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-sm);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.m02-hopyo__acts {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.m02-hopyo__acts > button + button {
|
||||
margin-left: var(--spacing-4);
|
||||
}
|
||||
|
||||
/* 엑셀 보기(329) — 왼쪽 읽기 전용 시트 · 오른쪽 호표 목록 */
|
||||
.m02-hopyo-sheet {
|
||||
display: grid;
|
||||
|
||||
@@ -65,7 +65,6 @@ export function gridOf(id: string, scope: HopyoScope, key: string): Promise<Hopy
|
||||
got.catch(() => kept?.got === got && (kept = null));
|
||||
return got;
|
||||
}
|
||||
export const dropGrid = (): void => void (kept = null);
|
||||
|
||||
/** 역할 시트 탭 글 통일 — 역할 → 시트 id */
|
||||
export function nameTabs(book: Workbook, grid: HopyoGrid): Partial<Record<Role, string>> {
|
||||
|
||||
@@ -48,7 +48,6 @@ export function buildHopyoSection(opt: HopyoSectionOptions): HopyoSection {
|
||||
start.classList.add("m02-layers__btn");
|
||||
start.title =
|
||||
"파일 하나 — 경쟁사 엑셀(.xls · .xlsx) 또는 경쟁사 파일(.estx · .STC) → 우리 정보로 다시 만듦(한시 · 끝내거나 떠나면 올린 파일 지움)";
|
||||
start.dataset.hopyoWizardOpen = "";
|
||||
const jobs = el("div", { className: "m02-hopyo-side", attrs: { "data-hopyo-jobs": "" } });
|
||||
const body = el("div", {
|
||||
className: "m02-hopyo-side",
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
/* =============================================================================
|
||||
* M02_MasterTemplete_Hopyo_Unit.ts — 확인 창 대상 이름 옆 「단위 환산」 칸의 보이기 판정(PLAN 784-2 · 요구 635-2).
|
||||
* 순수 계산(화면 · fetch 없음) — 숨김 조건 · 두 단위 글 재료 · 추정 두께.
|
||||
* · same = 배 1 · 단위 같음(서버 갈래 같음 · 두 단위 · 단위표 1) → 칸 숨김 · 「단위 같음 ×1」
|
||||
* · quota = 배가 몫(0.1)과 같음 → 칸 숨김 · 「몫 0.1」 만
|
||||
* · input = 빈칸 · 추정 · 그 밖 → 입력 칸 「엑셀 1 ㎡ = 우리 [ ] 본」
|
||||
* 값 자체(배)는 안 바꿈 — 서버 `Match.factor` 가 낸 배 · 갈래를 보이기만 다르게.
|
||||
* ========================================================================== */
|
||||
|
||||
export interface UnitPart {
|
||||
배: number | null;
|
||||
몫?: number | null;
|
||||
환산?: { 배: number | null; 갈래: string } | null;
|
||||
단위?: string | null;
|
||||
}
|
||||
|
||||
export type UnitMode = "same" | "quota" | "input";
|
||||
|
||||
export interface UnitView {
|
||||
mode: UnitMode;
|
||||
/** 엑셀 단위 · 우리 단위(빈 글 = 모름) */
|
||||
from: string;
|
||||
to: string;
|
||||
/** 추정 갈래 — 두께 m(㎡ → ㎥ 일 때만 · 아니면 null) */
|
||||
thick: number | null;
|
||||
estimated: boolean;
|
||||
}
|
||||
|
||||
const plain = (u: string | null | undefined): string =>
|
||||
String(u ?? "")
|
||||
.replace(/\s+/g, "")
|
||||
.replace("㎡", "m2")
|
||||
.replace("㎥", "m3")
|
||||
.toLowerCase();
|
||||
const close = (a: number, b: number): boolean => Math.abs(a - b) < 1e-9;
|
||||
|
||||
export function unitView(
|
||||
p: UnitPart,
|
||||
from: string | null | undefined,
|
||||
to?: string | null,
|
||||
): UnitView {
|
||||
const f = String(from ?? "").trim();
|
||||
const t = String(to ?? p.단위 ?? "").trim();
|
||||
const quota = p.몫 != null && p.몫 !== 1; // 몫 1 = 몫 없음과 같음
|
||||
const kind = p.환산?.갈래;
|
||||
const unitSame = kind
|
||||
? kind === "같음" || kind === "두 단위" || (kind === "단위표" && p.환산?.배 === 1)
|
||||
: plain(f) !== "" && plain(f) === plain(t);
|
||||
const at = quota ? (p.몫 as number) : 1;
|
||||
const hidden = p.배 !== null && close(p.배, at) && unitSame;
|
||||
const estimated = kind === "추정";
|
||||
const thick =
|
||||
estimated && plain(f) === "m2" && plain(t) === "m3" && p.환산?.배 != null ? p.환산.배 : null;
|
||||
return {
|
||||
mode: hidden ? (quota ? "quota" : "same") : "input",
|
||||
from: f,
|
||||
to: t,
|
||||
thick,
|
||||
estimated,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user