Merge remote-tracking branch 'origin/sub_laptop_3' into main_laptop_1
# Conflicts: # B09_Estimation/B09_Estimation_UI_Page.css # B09_Estimation/B09_Estimation_UI_Shell.ts # B09_Estimation/B09_Estimation_UI_Tabs_Bill_Edit.ts
This commit is contained in:
@@ -60,6 +60,8 @@ export interface DataTableOptions {
|
||||
onEdit?: (index: number, key: string, text: string) => void;
|
||||
/** 줄 꼴 class(본문 줄만 · 예 `is-title` = 굵게) — 빈 값이면 안 붙임 */
|
||||
rowClass?: (index: number) => string | null | undefined;
|
||||
/** 칸 꼴 class(본문 줄 · 글 상자 아닌 칸만 · 예 `is-picked` = 고른 칸 강조) — 빈 값이면 안 붙임 */
|
||||
cellClass?: (index: number, key: string) => string | null | undefined;
|
||||
}
|
||||
|
||||
export interface DataTable {
|
||||
@@ -139,6 +141,7 @@ function rowHtml(
|
||||
editable?: (index: number, key: string) => boolean,
|
||||
focus = false,
|
||||
extra: string | null | undefined = null,
|
||||
cellClass?: (key: string) => string | null | undefined,
|
||||
): string {
|
||||
let tr = "";
|
||||
for (let j = 0; j < cols.length; j++) {
|
||||
@@ -152,7 +155,12 @@ function rowHtml(
|
||||
}
|
||||
const [txt, empty] = formatCell(r[key], fmts[j], blank);
|
||||
const frz = left[j] !== null;
|
||||
const cls = [frz && "is-frozen", frz && left[j + 1] == null && "is-edge", empty && "is-empty"]
|
||||
const cls = [
|
||||
frz && "is-frozen",
|
||||
frz && left[j + 1] == null && "is-edge",
|
||||
empty && "is-empty",
|
||||
cellClass?.(key),
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" ");
|
||||
const attrs =
|
||||
@@ -218,6 +226,7 @@ export function renderDataTableHtml(o: DataTableOptions, win?: RowWindow): strin
|
||||
o.editable,
|
||||
o.focus === i,
|
||||
o.rowClass?.(i),
|
||||
o.cellClass ? (key) => o.cellClass?.(i, key) : undefined,
|
||||
);
|
||||
if (win) body += pad((n - to) * win.rowH, cols.length);
|
||||
const foot = o.total ? `<tfoot>${rowHtml(cols, fmts, left, o.total, false, blank)}</tfoot>` : "";
|
||||
|
||||
Reference in New Issue
Block a user