@cj-tech-master/excelts 5.0.1 → 5.0.2-canary.20260125013858.d7abd28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/modules/excel/xlsx/xform/sheet/cf/conditional-formattings-xform.js +10 -0
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +9 -1
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +17 -10
- package/dist/cjs/modules/excel/xlsx/xform/sheet/cf/conditional-formattings-xform.js +10 -0
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +17 -10
- package/dist/esm/modules/excel/xlsx/xform/sheet/cf/conditional-formattings-xform.js +10 -0
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +17 -10
- package/dist/iife/excelts.iife.js +18 -7
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +3 -3
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +9 -1
- package/package.json +1 -1
|
@@ -22,6 +22,16 @@ class ConditionalFormattingsXform extends BaseXform {
|
|
|
22
22
|
if (rule.style) {
|
|
23
23
|
rule.dxfId = options.styles.addDxfStyle(rule.style);
|
|
24
24
|
}
|
|
25
|
+
// Ensure dataBar rules have required cfvo and color properties
|
|
26
|
+
if (rule.type === "dataBar") {
|
|
27
|
+
if (!rule.cfvo || rule.cfvo.length < 2) {
|
|
28
|
+
rule.cfvo = [{ type: "min" }, { type: "max" }];
|
|
29
|
+
}
|
|
30
|
+
if (!rule.color) {
|
|
31
|
+
// Default blue color for data bars (same as Excel's default)
|
|
32
|
+
rule.color = { argb: "FF638EC6" };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
25
35
|
});
|
|
26
36
|
});
|
|
27
37
|
}
|
|
@@ -201,7 +201,15 @@ declare class XLSX {
|
|
|
201
201
|
_processTableEntry(stream: IParseStream, model: any, name: string): Promise<void>;
|
|
202
202
|
_processWorksheetRelsEntry(stream: IParseStream, model: any, sheetNo: number): Promise<void>;
|
|
203
203
|
_processMediaEntry(stream: IParseStream, model: any, filename: string): Promise<void>;
|
|
204
|
-
|
|
204
|
+
/**
|
|
205
|
+
* Process a drawing XML entry.
|
|
206
|
+
*
|
|
207
|
+
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
208
|
+
* @param model - Model to populate
|
|
209
|
+
* @param name - Drawing name (e.g., "drawing1")
|
|
210
|
+
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
211
|
+
*/
|
|
212
|
+
_processDrawingEntry(stream: IParseStream, model: any, name: string, rawData?: Uint8Array): Promise<void>;
|
|
205
213
|
_processDrawingRelsEntry(entry: any, model: any, name: string): Promise<void>;
|
|
206
214
|
_processVmlDrawingEntry(entry: any, model: any, name: string): Promise<void>;
|
|
207
215
|
_processThemeEntry(stream: IParseStream, model: any, name: string): Promise<void>;
|
|
@@ -761,16 +761,26 @@ class XLSX {
|
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
764
|
+
/**
|
|
765
|
+
* Process a drawing XML entry.
|
|
766
|
+
*
|
|
767
|
+
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
768
|
+
* @param model - Model to populate
|
|
769
|
+
* @param name - Drawing name (e.g., "drawing1")
|
|
770
|
+
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
771
|
+
*/
|
|
772
|
+
async _processDrawingEntry(stream, model, name, rawData) {
|
|
773
|
+
// Use provided rawData if available (loadFromFiles path), otherwise collect from stream.
|
|
774
|
+
// In loadFromFiles, the stream is created from already-decoded text, and collecting from
|
|
775
|
+
// it may not work correctly due to PassThrough stream timing issues.
|
|
776
|
+
const data = rawData ?? (await this.collectStreamData(stream));
|
|
767
777
|
// Parse the drawing for normal processing (images, etc.)
|
|
768
778
|
const xform = new DrawingXform();
|
|
769
|
-
const xmlString = this.bufferToString(
|
|
779
|
+
const xmlString = this.bufferToString(data);
|
|
770
780
|
const drawing = await xform.parseStream(this.createTextStream(xmlString));
|
|
771
781
|
model.drawings[name] = drawing;
|
|
772
782
|
// Store raw data; reconcile() may later drop it if charts are not referenced.
|
|
773
|
-
model.rawDrawings[name] =
|
|
783
|
+
model.rawDrawings[name] = data;
|
|
774
784
|
}
|
|
775
785
|
async _processDrawingRelsEntry(entry, model, name) {
|
|
776
786
|
const xform = new RelationshipsXform();
|
|
@@ -887,11 +897,8 @@ class XLSX {
|
|
|
887
897
|
}
|
|
888
898
|
const drawingName = getDrawingNameFromPath(entryName);
|
|
889
899
|
if (drawingName) {
|
|
890
|
-
await this._processDrawingEntry(stream, model, drawingName);
|
|
891
|
-
//
|
|
892
|
-
if (rawData) {
|
|
893
|
-
model.rawDrawings[drawingName] = rawData;
|
|
894
|
-
}
|
|
900
|
+
await this._processDrawingEntry(stream, model, drawingName, rawData);
|
|
901
|
+
// rawData is now stored inside _processDrawingEntry
|
|
895
902
|
return true;
|
|
896
903
|
}
|
|
897
904
|
const drawingRelsName = getDrawingNameFromRelsPath(entryName);
|
|
@@ -25,6 +25,16 @@ class ConditionalFormattingsXform extends base_xform_1.BaseXform {
|
|
|
25
25
|
if (rule.style) {
|
|
26
26
|
rule.dxfId = options.styles.addDxfStyle(rule.style);
|
|
27
27
|
}
|
|
28
|
+
// Ensure dataBar rules have required cfvo and color properties
|
|
29
|
+
if (rule.type === "dataBar") {
|
|
30
|
+
if (!rule.cfvo || rule.cfvo.length < 2) {
|
|
31
|
+
rule.cfvo = [{ type: "min" }, { type: "max" }];
|
|
32
|
+
}
|
|
33
|
+
if (!rule.color) {
|
|
34
|
+
// Default blue color for data bars (same as Excel's default)
|
|
35
|
+
rule.color = { argb: "FF638EC6" };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
28
38
|
});
|
|
29
39
|
});
|
|
30
40
|
}
|
|
@@ -764,16 +764,26 @@ class XLSX {
|
|
|
764
764
|
});
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
767
|
+
/**
|
|
768
|
+
* Process a drawing XML entry.
|
|
769
|
+
*
|
|
770
|
+
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
771
|
+
* @param model - Model to populate
|
|
772
|
+
* @param name - Drawing name (e.g., "drawing1")
|
|
773
|
+
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
774
|
+
*/
|
|
775
|
+
async _processDrawingEntry(stream, model, name, rawData) {
|
|
776
|
+
// Use provided rawData if available (loadFromFiles path), otherwise collect from stream.
|
|
777
|
+
// In loadFromFiles, the stream is created from already-decoded text, and collecting from
|
|
778
|
+
// it may not work correctly due to PassThrough stream timing issues.
|
|
779
|
+
const data = rawData ?? (await this.collectStreamData(stream));
|
|
770
780
|
// Parse the drawing for normal processing (images, etc.)
|
|
771
781
|
const xform = new drawing_xform_1.DrawingXform();
|
|
772
|
-
const xmlString = this.bufferToString(
|
|
782
|
+
const xmlString = this.bufferToString(data);
|
|
773
783
|
const drawing = await xform.parseStream(this.createTextStream(xmlString));
|
|
774
784
|
model.drawings[name] = drawing;
|
|
775
785
|
// Store raw data; reconcile() may later drop it if charts are not referenced.
|
|
776
|
-
model.rawDrawings[name] =
|
|
786
|
+
model.rawDrawings[name] = data;
|
|
777
787
|
}
|
|
778
788
|
async _processDrawingRelsEntry(entry, model, name) {
|
|
779
789
|
const xform = new relationships_xform_1.RelationshipsXform();
|
|
@@ -890,11 +900,8 @@ class XLSX {
|
|
|
890
900
|
}
|
|
891
901
|
const drawingName = (0, ooxml_paths_1.getDrawingNameFromPath)(entryName);
|
|
892
902
|
if (drawingName) {
|
|
893
|
-
await this._processDrawingEntry(stream, model, drawingName);
|
|
894
|
-
//
|
|
895
|
-
if (rawData) {
|
|
896
|
-
model.rawDrawings[drawingName] = rawData;
|
|
897
|
-
}
|
|
903
|
+
await this._processDrawingEntry(stream, model, drawingName, rawData);
|
|
904
|
+
// rawData is now stored inside _processDrawingEntry
|
|
898
905
|
return true;
|
|
899
906
|
}
|
|
900
907
|
const drawingRelsName = (0, ooxml_paths_1.getDrawingNameFromRelsPath)(entryName);
|
|
@@ -22,6 +22,16 @@ class ConditionalFormattingsXform extends BaseXform {
|
|
|
22
22
|
if (rule.style) {
|
|
23
23
|
rule.dxfId = options.styles.addDxfStyle(rule.style);
|
|
24
24
|
}
|
|
25
|
+
// Ensure dataBar rules have required cfvo and color properties
|
|
26
|
+
if (rule.type === "dataBar") {
|
|
27
|
+
if (!rule.cfvo || rule.cfvo.length < 2) {
|
|
28
|
+
rule.cfvo = [{ type: "min" }, { type: "max" }];
|
|
29
|
+
}
|
|
30
|
+
if (!rule.color) {
|
|
31
|
+
// Default blue color for data bars (same as Excel's default)
|
|
32
|
+
rule.color = { argb: "FF638EC6" };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
25
35
|
});
|
|
26
36
|
});
|
|
27
37
|
}
|
|
@@ -761,16 +761,26 @@ class XLSX {
|
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
764
|
+
/**
|
|
765
|
+
* Process a drawing XML entry.
|
|
766
|
+
*
|
|
767
|
+
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
768
|
+
* @param model - Model to populate
|
|
769
|
+
* @param name - Drawing name (e.g., "drawing1")
|
|
770
|
+
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
771
|
+
*/
|
|
772
|
+
async _processDrawingEntry(stream, model, name, rawData) {
|
|
773
|
+
// Use provided rawData if available (loadFromFiles path), otherwise collect from stream.
|
|
774
|
+
// In loadFromFiles, the stream is created from already-decoded text, and collecting from
|
|
775
|
+
// it may not work correctly due to PassThrough stream timing issues.
|
|
776
|
+
const data = rawData ?? (await this.collectStreamData(stream));
|
|
767
777
|
// Parse the drawing for normal processing (images, etc.)
|
|
768
778
|
const xform = new DrawingXform();
|
|
769
|
-
const xmlString = this.bufferToString(
|
|
779
|
+
const xmlString = this.bufferToString(data);
|
|
770
780
|
const drawing = await xform.parseStream(this.createTextStream(xmlString));
|
|
771
781
|
model.drawings[name] = drawing;
|
|
772
782
|
// Store raw data; reconcile() may later drop it if charts are not referenced.
|
|
773
|
-
model.rawDrawings[name] =
|
|
783
|
+
model.rawDrawings[name] = data;
|
|
774
784
|
}
|
|
775
785
|
async _processDrawingRelsEntry(entry, model, name) {
|
|
776
786
|
const xform = new RelationshipsXform();
|
|
@@ -887,11 +897,8 @@ class XLSX {
|
|
|
887
897
|
}
|
|
888
898
|
const drawingName = getDrawingNameFromPath(entryName);
|
|
889
899
|
if (drawingName) {
|
|
890
|
-
await this._processDrawingEntry(stream, model, drawingName);
|
|
891
|
-
//
|
|
892
|
-
if (rawData) {
|
|
893
|
-
model.rawDrawings[drawingName] = rawData;
|
|
894
|
-
}
|
|
900
|
+
await this._processDrawingEntry(stream, model, drawingName, rawData);
|
|
901
|
+
// rawData is now stored inside _processDrawingEntry
|
|
895
902
|
return true;
|
|
896
903
|
}
|
|
897
904
|
const drawingRelsName = getDrawingNameFromRelsPath(entryName);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v5.0.
|
|
2
|
+
* @cj-tech-master/excelts v5.0.2-canary.20260125013858.d7abd28
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2026 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -13306,6 +13306,10 @@ var ExcelTS = (function(exports) {
|
|
|
13306
13306
|
cf.rules.forEach((rule) => {
|
|
13307
13307
|
if (!rule.priority) rule.priority = nextPriority++;
|
|
13308
13308
|
if (rule.style) rule.dxfId = options.styles.addDxfStyle(rule.style);
|
|
13309
|
+
if (rule.type === "dataBar") {
|
|
13310
|
+
if (!rule.cfvo || rule.cfvo.length < 2) rule.cfvo = [{ type: "min" }, { type: "max" }];
|
|
13311
|
+
if (!rule.color) rule.color = { argb: "FF638EC6" };
|
|
13312
|
+
}
|
|
13309
13313
|
});
|
|
13310
13314
|
});
|
|
13311
13315
|
}
|
|
@@ -21124,13 +21128,21 @@ var ExcelTS = (function(exports) {
|
|
|
21124
21128
|
});
|
|
21125
21129
|
}
|
|
21126
21130
|
}
|
|
21127
|
-
|
|
21128
|
-
|
|
21131
|
+
/**
|
|
21132
|
+
* Process a drawing XML entry.
|
|
21133
|
+
*
|
|
21134
|
+
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
21135
|
+
* @param model - Model to populate
|
|
21136
|
+
* @param name - Drawing name (e.g., "drawing1")
|
|
21137
|
+
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
21138
|
+
*/
|
|
21139
|
+
async _processDrawingEntry(stream, model, name, rawData) {
|
|
21140
|
+
const data = rawData ?? await this.collectStreamData(stream);
|
|
21129
21141
|
const xform = new DrawingXform();
|
|
21130
|
-
const xmlString = this.bufferToString(
|
|
21142
|
+
const xmlString = this.bufferToString(data);
|
|
21131
21143
|
const drawing = await xform.parseStream(this.createTextStream(xmlString));
|
|
21132
21144
|
model.drawings[name] = drawing;
|
|
21133
|
-
model.rawDrawings[name] =
|
|
21145
|
+
model.rawDrawings[name] = data;
|
|
21134
21146
|
}
|
|
21135
21147
|
async _processDrawingRelsEntry(entry, model, name) {
|
|
21136
21148
|
const relationships = await new RelationshipsXform().parseStream(entry);
|
|
@@ -21217,8 +21229,7 @@ var ExcelTS = (function(exports) {
|
|
|
21217
21229
|
}
|
|
21218
21230
|
const drawingName = getDrawingNameFromPath(entryName);
|
|
21219
21231
|
if (drawingName) {
|
|
21220
|
-
await this._processDrawingEntry(stream, model, drawingName);
|
|
21221
|
-
if (rawData) model.rawDrawings[drawingName] = rawData;
|
|
21232
|
+
await this._processDrawingEntry(stream, model, drawingName, rawData);
|
|
21222
21233
|
return true;
|
|
21223
21234
|
}
|
|
21224
21235
|
const drawingRelsName = getDrawingNameFromRelsPath(entryName);
|