feat(grid): customize zebra stripe color

This commit is contained in:
lxk955 authored and GitHub committed 2026-10-04 10:31:39 +08:00
1 parent 4b48809c84
commit 89ecc63b9e
22 files changed
+107 -7

No files matched your search

@@ -143,6 +143,10 @@ describe("EDITOR_SETTINGS_DRAFT_KEYS", () => {
expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("dataGridCellDetailButtonVisible");
});
it("includes zebra row background in draft keys", () => {
expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("dataGridZebraRowBg");
});
it("includes dataGridCellDetailDialogDefault", () => {
expect(EDITOR_SETTINGS_DRAFT_KEYS).toContain("dataGridCellDetailDialogDefault");
});
@@ -475,4 +475,17 @@ describe("settingsTransfer", () => {
expect(transferCategoryForKey("csvNullMode")).toBe("data");
expect(collectTransferCategories(["csvNullMode", "csvQuoteMode"])).toEqual(["data"]);
});
it("round-trips zebra row background in data category", () => {
expect(transferCategoryForKey("dataGridZebraRowBg")).toBe("data");
const text = serializeSettingsTransfer({
...DEFAULT_EDITOR_SETTINGS,
dataGridZebraRowBg: "#232323",
});
const result = parseSettingsTransferFile(text);
expect(result.ok).toBe(true);
if (!result.ok) return;
expect(result.value.editorSettings.dataGridZebraRowBg).toBe("#232323");
});
});
@@ -76,6 +76,7 @@ export const EDITOR_SETTINGS_DRAFT_KEYS = [
"dataGridCellDetailDialogDefault",
"dataGridCrosshairHighlight",
"dataGridStripedRows",
"dataGridZebraRowBg",
"pageSize",
"tableOpenPageSize",
"tableOpenSortMode",
@@ -169,6 +169,7 @@ const SETTINGS_TRANSFER_CATEGORY_KEYS: Record<SettingsTransferCategoryId, readon
"dataGridCellDetailDialogDefault",
"dataGridCrosshairHighlight",
"dataGridStripedRows",
"dataGridZebraRowBg",
"flatteningMultiLineText",
"dataGridShowWhitespace",
"pageSize",
@@ -289,6 +290,7 @@ const PASS_THROUGH_BOOLEAN_KEYS = [
"showIndexIndicatorsInHeader",
"compactColumnHeaderActions",
"dataGridQuickEntry",
"dataGridStripedRows",
"flatteningMultiLineText",
"dataGridShowWhitespace",
"infiniteScroll",