feat(M02): 일위대가 드롭다운 보이는 글 = 이름 규격 · 원문번호는 풍선 · 저장 값 번호 그대로(85-1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W4uKaV4ZBhsJN4GHG7yRj4
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
choicesOf,
|
||||
inputKey,
|
||||
isOutside,
|
||||
labelOf,
|
||||
rangeOf,
|
||||
storedOf,
|
||||
type ValueDoc,
|
||||
@@ -65,7 +66,12 @@ export function createValueControl(
|
||||
if (control instanceof HTMLSelectElement) {
|
||||
control.append(
|
||||
...(auto === null ? [el("option", { attrs: { value: "" }, text: "—" })] : []),
|
||||
...choices.map((c) => el("option", { attrs: { value: c.값 }, text: c.이름 })),
|
||||
...choices.map((c) =>
|
||||
el("option", {
|
||||
attrs: { value: c.값, ...(c.이름 !== c.값 ? { title: c.값 } : {}) },
|
||||
text: c.이름,
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
const empty = value === null || value === "";
|
||||
@@ -194,10 +200,15 @@ export function createInputsValueCard(opts: InputsValueOptions): InputsValueHand
|
||||
};
|
||||
if (opts.mode === "view") {
|
||||
const text = isEmpty(stored.값) ? auto : stored.값;
|
||||
const label = text === null ? "—" : labelOf(input, text);
|
||||
const shown = el("span", {
|
||||
className: `m02-inputval__value${isEmpty(stored.값) ? " is-auto" : ""}`,
|
||||
text: text === null ? "—" : String(text),
|
||||
attrs: isEmpty(stored.값) ? { title: VALUE_TEXT.auto } : {},
|
||||
text: label,
|
||||
attrs: isEmpty(stored.값)
|
||||
? { title: VALUE_TEXT.auto }
|
||||
: label !== String(text)
|
||||
? { title: String(text) }
|
||||
: {},
|
||||
});
|
||||
paintState();
|
||||
return el("div", { className: "m02-inputval__cell", children: [shown, state] });
|
||||
|
||||
Reference in New Issue
Block a user