Read QExcell theme colors from XLSX styles
This commit is contained in:
@@ -342,6 +342,38 @@ describe("excellOffice OOXML helpers", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("читает theme, tint и indexed цвета XLSX из styles.xml", () => {
|
||||
const styleTable = xlsxStylesXmlToCellFormatTable({
|
||||
styleSheet: {
|
||||
fonts: {
|
||||
font: [{ color: { theme: "1" } }, { color: { theme: "4", tint: "0.5" } }, { color: { indexed: "22" } }]
|
||||
},
|
||||
fills: {
|
||||
fill: [{}, {}, { patternFill: { fgColor: { theme: "6" } } }]
|
||||
},
|
||||
borders: {
|
||||
border: [{}, { left: { style: "thin", color: { indexed: "4" } } }]
|
||||
},
|
||||
cellXfs: {
|
||||
xf: [
|
||||
{ fontId: "0", fillId: "0", borderId: "0" },
|
||||
{ fontId: "1", fillId: "2", borderId: "1" },
|
||||
{ fontId: "2", fillId: "0", borderId: "0" }
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
expect(styleTable[0]).toBeUndefined();
|
||||
expect(styleTable[1]).toEqual({
|
||||
textColor: "A7C0DE",
|
||||
fillColor: "9BBB59",
|
||||
border: true,
|
||||
borderColor: "0000FF"
|
||||
});
|
||||
expect(styleTable[2]).toEqual({ textColor: "C0C0C0" });
|
||||
});
|
||||
|
||||
it("преобразует XML листа в модель QExcell", () => {
|
||||
const cells = worksheetXmlToCells(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user