Socket
Socket
Sign inDemoInstall

mr-excel

Package Overview
Dependencies
14
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.0 to 4.0.0

.github/workflows/release.yml

23

CHANGELOG.md
# Changelog
## Version 4.0.0 (2023-1-6)
we have added the test and release packages. Additionally, we have addressed various issues, such as misspelling in the interface, problems with the extractExcelData function, shift top sheet problem (unit problem), and more.
### New Features
- Added tests
- Release Github package
### Improvements
- Reduced the size of the generated file.
- more
### Bug Fixes
- Corrected misspellings in interfaces.
- Fixed extractExcelData where the value will now return, and you need to specify if you want to use it in the backend.
- Resolved the issue of shifting the top in the sheet, fixing problems in units.
- more
## Version 3.2.0 (2023-12-29)

@@ -7,3 +28,3 @@

-Improvement in the formula section.
- Improvement in the formula section.

@@ -10,0 +31,0 @@ ## Version 3.0.3 (2023-12-12)

24

dist/excel-table.d.ts

@@ -46,3 +46,3 @@ /// <reference types="node" />

declare interface ConditinalFormating {
declare interface ConditionalFormatting {
type: "cells" | "dataBar" | "iconSet" | "colorScale" | "top";

@@ -64,3 +64,3 @@ start: string;

isArray?: boolean;
refrenceCells?: string;
referenceCells?: string;
formula: string;

@@ -93,3 +93,3 @@ returnType?: string;

backend?: boolean;
activateConditinalFormating?: boolean;
activateConditionalFormatting?: boolean;
fileName?: string;

@@ -108,3 +108,3 @@ generateType?: "nodebuffer" | "array" | "binarystring" | "base64";

declare function extractExcelData_2(uri: string): Promise<string>;
declare function extractExcelData_2(uri: string, isBackend?: boolean): Promise<unknown>;

@@ -134,3 +134,3 @@ declare interface Formula {

comment?: Comment_2 | string;
conditinalFormating?: ConditinalFormating;
conditionalFormatting?: ConditionalFormatting;
formula?: {

@@ -170,3 +170,3 @@ type: FormulaType;

declare type MultiStyleConditinFunction = (data: Header | string | number | undefined, object: null | Data, headerKey: string, rowIndex: number, colIndex: number, fromHeader: boolean) => MultiStyleValue | null;
declare type MultiStyleConditionFunction = (data: Header | string | number | undefined, object: null | Data, headerKey: string, rowIndex: number, colIndex: number, fromHeader: boolean) => MultiStyleValue | null;

@@ -205,4 +205,4 @@ declare interface MultiStyleRexValue {

withoutHeader?: boolean;
conditinalFormating?: ConditinalFormating[];
multiStyleConditin?: MultiStyleConditinFunction;
conditionalFormatting?: ConditionalFormatting[];
multiStyleCondition?: MultiStyleConditionFunction;
useSplitBaseOnMatch?: boolean;

@@ -222,4 +222,4 @@ convertStringToNumber?: boolean;

styleCellCondition?: StyleCellConditionFunction;
commentCodition?: CommentConditionFunction;
sortAndfilter?: SortAndFilter;
commentCondition?: CommentConditionFunction;
sortAndFilter?: SortAndFilter;
state?: "hidden" | "visible";

@@ -248,3 +248,3 @@ headerRowOption?: any;

type: SingleRefFormulaType;
refrenceCell: string;
referenceCell: string;
value?: number | string;

@@ -277,3 +277,3 @@ styleId?: string;

declare type StyleCellConditionFunction = (data: Header | string | number | undefined, object: Header | Data, colIndex: number, rowIndex: number, fromHeader: boolean, stylekeys: string[]) => string | null;
declare type StyleCellConditionFunction = (data: Header | string | number | undefined, object: Header | Data, rowIndex: number, colIndex: number, fromHeader: boolean, styleKeys: string[]) => string | null;

@@ -280,0 +280,0 @@ declare interface Styles {

@@ -8,3 +8,3 @@ export interface ExcelTable extends ExcelTableOption {

backend?: boolean;
activateConditinalFormating?: boolean;
activateConditionalFormatting?: boolean;
fileName?: string;

@@ -26,4 +26,4 @@ generateType?: "nodebuffer" | "array" | "binarystring" | "base64";

withoutHeader?: boolean;
conditinalFormating?: ConditinalFormating[];
multiStyleConditin?: MultiStyleConditinFunction;
conditionalFormatting?: ConditionalFormatting[];
multiStyleCondition?: MultiStyleConditionFunction;
useSplitBaseOnMatch?: boolean;

@@ -43,4 +43,4 @@ convertStringToNumber?: boolean;

styleCellCondition?: StyleCellConditionFunction;
commentCodition?: CommentConditionFunction;
sortAndfilter?: SortAndFilter;
commentCondition?: CommentConditionFunction;
sortAndFilter?: SortAndFilter;
state?: "hidden" | "visible";

@@ -58,3 +58,3 @@ headerRowOption?: any;

comment?: Comment | string;
conditinalFormating?: ConditinalFormating;
conditionalFormatting?: ConditionalFormatting;
formula?: {

@@ -106,3 +106,3 @@ type: FormulaType;

export type ProtectionOptionKey = "sheet" | "formatCells" | "formatColumns" | "formatRows" | "insertColumns" | "insertRows" | "insertHyperlinks" | "deleteColumns" | "deleteRows" | "sort" | "autoFilter" | "pivotTables";
export interface ConditinalFormating {
export interface ConditionalFormatting {
type: "cells" | "dataBar" | "iconSet" | "colorScale" | "top";

@@ -188,5 +188,5 @@ start: string;

}
export type MultiStyleConditinFunction = (data: Header | string | number | undefined, object: null | Data, headerKey: string, rowIndex: number, colIndex: number, fromHeader: boolean) => MultiStyleValue | null;
export type MultiStyleConditionFunction = (data: Header | string | number | undefined, object: null | Data, headerKey: string, rowIndex: number, colIndex: number, fromHeader: boolean) => MultiStyleValue | null;
export type CommentConditionFunction = (data: Header | string | number | undefined, object: null | Data, headerKey: string, rowIndex: number, colIndex: number, fromHeader: boolean) => Comment | string | false | undefined | null;
export type StyleCellConditionFunction = (data: Header | string | number | undefined, object: Header | Data, colIndex: number, rowIndex: number, fromHeader: boolean, stylekeys: string[]) => string | null;
export type StyleCellConditionFunction = (data: Header | string | number | undefined, object: Header | Data, rowIndex: number, colIndex: number, fromHeader: boolean, styleKeys: string[]) => string | null;
export type MergeRowDataConditionFunction = (data: Header | string | number | undefined, key: string | null, index: number, fromHeader: boolean) => boolean;

@@ -242,3 +242,3 @@ export interface SortAndFilter {

isArray?: boolean;
refrenceCells?: string;
referenceCells?: string;
formula: string;

@@ -250,3 +250,3 @@ returnType?: string;

type: SingleRefFormulaType;
refrenceCell: string;
referenceCell: string;
value?: number | string;

@@ -260,7 +260,7 @@ styleId?: string;

export interface StyleMapper {
conditinalFormating: {
conditionalFormatting: {
count: number;
value: string;
};
commentSintax: {
commentSyntax: {
value: {

@@ -267,0 +267,0 @@ [key: string]: string;

/// <reference types="node" />
import { ThemeOption } from "./Themes/theme";
import { ThemeOption } from "./themes/theme";
import { Data, ExcelTable, SideBySide } from "./data-model/excel-table";

@@ -4,0 +4,0 @@ import { ColWidthScaleFunction, RowHeightScaleFunction } from "./utils/create-excel-data";

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractExcelData = exports.themeBaseGenerate = exports.sideBySideLineByLine = exports.convertTableToExcel = exports.generateExcel = void 0;
const theme_1 = require("./Themes/theme");
const theme_1 = require("./themes/theme");
const create_excel_data_1 = require("./utils/create-excel-data");

@@ -11,3 +11,3 @@ const generate_excel_1 = require("./utils/generate-excel");

function convertTableToExcel(queryForTable, table, keepStyle, rowHeightScaleFunction, colWidthScaleFunction) {
const data = (0, create_excel_data_1.createExcelTabelBaseOnDomElement)(queryForTable, table, keepStyle, rowHeightScaleFunction, colWidthScaleFunction);
const data = (0, create_excel_data_1.createExcelTableBaseOnDomElement)(queryForTable, table, keepStyle, rowHeightScaleFunction, colWidthScaleFunction);
return (0, exports.generateExcel)(data);

@@ -14,0 +14,0 @@ }

@@ -0,6 +1,15 @@

declare function removeSpace(str: string): string;
declare function extendHexValue(hex: string): string;
export declare function hexToRgbArray(hex: string): number[];
export declare function generateContrastTextColor(b: string): "rgb(0,0,0)" | "rgb(255,255,255)" | undefined;
export declare function hexToRgbNegative(hex: string): string;
declare function valueToHex(c: number | string): string;
export declare function rgbToHex(rgb: string): string | null;
export declare function convertToHex(fgConvertor: string | undefined, backend: boolean | undefined): string | null;
export declare const exportedForTesting: {
removeSpace: typeof removeSpace;
valueToHex: typeof valueToHex;
extendHexValue: typeof extendHexValue;
};
export {};
//# sourceMappingURL=color.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertToHex = exports.rgbToHex = exports.hexToRgbNegative = exports.generateContrastTextColor = exports.hexToRgbArray = void 0;
exports.exportedForTesting = exports.convertToHex = exports.rgbToHex = exports.hexToRgbNegative = exports.generateContrastTextColor = exports.hexToRgbArray = void 0;
function removeSpace(str) {
return str.replace(/ /g, "");
}
function extendHexValue(hex) {
hex = hex.replace(/^#/, "");
if (hex.length == 3) {
const s0 = hex.charAt(0);
const s1 = hex.charAt(1);
const s2 = hex.charAt(2);
return s0 + s0 + s1 + s1 + s2 + s2;
}
else {
return hex;
}
}
function hexToRgbArray(hex) {
if (/^#?([a-f\d]{3})$/i.test(hex)) {
hex = extendHexValue(hex);
}
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);

@@ -28,3 +43,2 @@ return result

const textColor = bgLuminance > 0.5 ? "rgb(0,0,0)" : "rgb(255,255,255)";
;
return textColor;

@@ -34,2 +48,6 @@ }

function hexToRgbNegative(hex) {
// /(^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$)|(^#?([a-f\d]{3})$)/i;
if (/^#?([a-f\d]{3})$/i.test(hex)) {
hex = extendHexValue(hex);
}
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);

@@ -60,3 +78,5 @@ return result

}, true);
if ((spResult.length == 4 && spResult[3] == "0") || !validate) {
if ((spResult.length == 4 && spResult[3] == "0") ||
(spResult.length != 3 && spResult.length != 4) ||
!validate) {
return null;

@@ -85,5 +105,10 @@ }

}
return fgConvertor.replace("#", "");
return fgConvertor.replace(/^#/, "");
}
exports.convertToHex = convertToHex;
exports.exportedForTesting = {
removeSpace,
valueToHex,
extendHexValue,
};
//# sourceMappingURL=color.js.map
import { Comment } from "../data-model/excel-table";
export declare function commentConvertor(commentValue: Comment | string, mapStyle: {
[key: string]: string;
}, commentStyl: string): {
hasAuthour: boolean;
}, commentStyle: string): {
hasAuthor: boolean;
author: string | undefined;
commentStyl: string;
commentStyle: string;
commentStr: string[];
};
export declare function splitBaseOnbreackline(str: string): string[];
export declare function generateCommentTag(ref: string, comment: string[], style: string, auIndex: number): string;
export declare function splitBaseOnBreakLine(str: string): string[];
export declare function generateCommentTag(ref: string, comment: string[], style: string, authorIndex: number): string;
export declare const defaultCellCommentStyle: string;
//# sourceMappingURL=comment.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultCellCommentStyle = exports.generateCommentTag = exports.splitBaseOnbreackline = exports.commentConvertor = void 0;
function commentConvertor(commentValue, mapStyle, commentStyl) {
let hasAuthour = false;
exports.defaultCellCommentStyle = exports.generateCommentTag = exports.splitBaseOnBreakLine = exports.commentConvertor = void 0;
function commentConvertor(commentValue, mapStyle, commentStyle) {
let hasAuthor = false;
let commentStr;

@@ -10,3 +10,3 @@ let author;

if ("author" in commentValue && commentValue.author) {
hasAuthour = true;
hasAuthor = true;
author = commentValue.author;

@@ -17,3 +17,3 @@ }

if (typeof styleCom == "string") {
commentStyl = styleCom;
commentStyle = styleCom;
}

@@ -23,15 +23,15 @@ }

"comment" in commentValue && typeof commentValue.comment == "string"
? splitBaseOnbreackline(commentValue.comment)
? splitBaseOnBreakLine(commentValue.comment)
: [""];
}
else {
commentStr = commentValue ? splitBaseOnbreackline(commentValue) : [""];
commentStr = commentValue ? splitBaseOnBreakLine(commentValue) : [""];
}
if (hasAuthour) {
if (hasAuthor) {
commentStr.unshift(author + ":");
}
return {
hasAuthour,
hasAuthor,
author,
commentStyl,
commentStyle,
commentStr,

@@ -41,3 +41,3 @@ };

exports.commentConvertor = commentConvertor;
function splitBaseOnbreackline(str) {
function splitBaseOnBreakLine(str) {
// Split the string on \n or \r characters

@@ -47,13 +47,12 @@ var separateLines = str.split(/\r?\n|\r|\n/g);

}
exports.splitBaseOnbreackline = splitBaseOnbreackline;
function generateCommentTag(ref, comment, style, auIndex) {
exports.splitBaseOnBreakLine = splitBaseOnBreakLine;
function generateCommentTag(ref, comment, style, authorIndex) {
let result = '<comment ref="' +
ref +
'" authorId="' +
Math.max(0, auIndex - 1) +
Math.max(0, authorIndex - 1) +
'" shapeId="0">' +
" <text>";
;
"<text>";
let bac = "";
comment.forEach((v, vindex) => {
comment.forEach((v, indexValue) => {
let pr = "";

@@ -64,9 +63,13 @@ if (v.length == 0) {

}
if (vindex > 0) {
pr = 'xml:space="preserve"';
if (indexValue > 0) {
pr = ' xml:space="preserve"';
bac += "\n";
}
result += "<r>" + style + "<t " + pr + " >" + bac + v + "</t></r>";
result += "<r>" + style + "<t" + pr + ">" + bac + v + "</t></r>";
bac = "";
});
if (bac.length > 0 && result.indexOf("<r>") > 0) {
result =
result.substring(0, result.length - "</t></r>".length) + bac + "</t></r>";
}
result += "</text></comment>";

@@ -77,8 +80,7 @@ return result;

exports.defaultCellCommentStyle = "<rPr>" +
" <b />" +
' <sz val="9" />' +
' <color rgb="000000" />' +
' <rFont val="Tahoma" />' +
"<b />" +
'<sz val="9" />' +
'<color rgb="000000" />' +
'<rFont val="Tahoma" />' +
"</rPr>";
;
//# sourceMappingURL=comment.js.map

@@ -8,19 +8,19 @@ "use strict";

' xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">' +
" <Application>Microsoft Excel</Application>" +
" <DocSecurity>0</DocSecurity>" +
" <ScaleCrop>false</ScaleCrop>" +
" <HeadingPairs>" +
' <vt:vector size="2" baseType="variant">' +
" <vt:variant>" +
" <vt:lpstr>Worksheets</vt:lpstr>" +
" </vt:variant>" +
" <vt:variant>" +
" <vt:i4>" +
"<Application>Microsoft Excel</Application>" +
"<DocSecurity>0</DocSecurity>" +
"<ScaleCrop>false</ScaleCrop>" +
"<HeadingPairs>" +
'<vt:vector size="2" baseType="variant">' +
"<vt:variant>" +
"<vt:lpstr>Worksheets</vt:lpstr>" +
"</vt:variant>" +
"<vt:variant>" +
"<vt:i4>" +
sheetLength +
"</vt:i4>" +
" </vt:variant>" +
" </vt:vector>" +
" </HeadingPairs>" +
" <TitlesOfParts>" +
' <vt:vector size="' +
"</vt:variant>" +
"</vt:vector>" +
"</HeadingPairs>" +
"<TitlesOfParts>" +
'<vt:vector size="' +
sheetLength +

@@ -31,9 +31,9 @@ '" baseType="lpstr">' +

"" +
" </vt:vector>" +
" </TitlesOfParts>" +
" <Company></Company>" +
" <LinksUpToDate>false</LinksUpToDate>" +
" <SharedDoc>false</SharedDoc>" +
" <HyperlinksChanged>false</HyperlinksChanged>" +
" <AppVersion>16.0300</AppVersion>" +
"</vt:vector>" +
"</TitlesOfParts>" +
"<Company></Company>" +
"<LinksUpToDate>false</LinksUpToDate>" +
"<SharedDoc>false</SharedDoc>" +
"<HyperlinksChanged>false</HyperlinksChanged>" +
"<AppVersion>16.0300</AppVersion>" +
"</Properties>");

@@ -40,0 +40,0 @@ }

@@ -120,3 +120,3 @@ "use strict";

},
ريال: {
"ريال": {
key: 171,

@@ -123,0 +123,0 @@ value: '<numFmt numFmtId="171" formatCode="_ * #,##0.00_-[$ريال-429]_ ;_ * #,##0.00\\-[$ريال-429]_ ;_ * &quot;-&quot;??_-[$ريال-429]_ ;_ @_ " />',

@@ -5,7 +5,8 @@ "use strict";

function contentTypeGenerator(sheetContentType, commentId, arrTypes, sheetDrawers, checkboxForm, needCalcChain) {
let typeCheck = {};
return ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n' +
'<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">' +
' <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>' +
' <Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing" />' +
' <Default Extension="xml" ContentType="application/xml" />' +
'<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>' +
'<Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing" />' +
'<Default Extension="xml" ContentType="application/xml" />' +
"<Override" +

@@ -19,11 +20,20 @@ ' ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"' +

arrTypes.reduce((res, curr) => {
curr = curr.toLowerCase();
if (typeCheck[curr]) {
return res;
}
if (curr == "svg") {
typeCheck["png"] = true;
typeCheck["svg"] = true;
return (res +
'<Default Extension="png" ContentType="image/png"/>' +
' <Default Extension="svg" ContentType="image/svg+xml"/>');
'<Default Extension="svg" ContentType="image/svg+xml"/>');
}
else if (curr == "jpeg" || curr == "jpg") {
typeCheck["jpeg"] = true;
typeCheck["jpg"] = true;
return (res + '<Default Extension="' + curr + '" ContentType="image/jpeg"/>');
}
else {
typeCheck["curr"] = true;
return (res +

@@ -34,3 +44,3 @@ '<Default Extension="' +

curr +
'" />');
'"/>');
}

@@ -50,5 +60,5 @@ }, "") +

(needCalcChain
? `<Override PartName="/xl/calcChain.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"/>`
? '<Override PartName="/xl/calcChain.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"/>'
: "") +
' <Override PartName="/docProps/core.xml" ' +
'<Override PartName="/docProps/core.xml" ' +
' ContentType="application/vnd.openxmlformats-package.core-properties+xml" />' +

@@ -65,6 +75,8 @@ sheetDrawers.reduce((res, cu) => {

return (res +
`<Override PartName="/xl/ctrlProps/ctrlProp${index + 1}.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>`);
'<Override PartName="/xl/ctrlProps/ctrlProp' +
(index + 1) +
'.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>');
}, "")
: "") +
' <Override PartName="/docProps/app.xml" ' +
'<Override PartName="/docProps/app.xml" ' +
' ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" />' +

@@ -71,0 +83,0 @@ "</Types>");

@@ -16,70 +16,67 @@ "use strict";

: "") +
' <fonts count="' +
'<fonts count="' +
styles.font.count +
'">' +
" <font>" +
' <sz val="11" />' +
' <color theme="1" />' +
' <name val="Calibri" />' +
' <family val="2" />' +
' <scheme val="minor" />' +
" </font>" +
" <font>" +
' <sz val="11" />' +
' <color rgb="FFFF0000" />' +
' <name val="Calibri" />' +
' <family val="2" />' +
' <scheme val="minor" />' +
" </font>" +
" " +
"<font>" +
'<sz val="11" />' +
'<color theme="1" />' +
'<name val="Calibri" />' +
'<family val="2" />' +
'<scheme val="minor" />' +
"</font>" +
"<font>" +
'<sz val="11" />' +
'<color rgb="FFFF0000" />' +
'<name val="Calibri" />' +
'<family val="2" />' +
'<scheme val="minor" />' +
"</font>" +
styles.font.value +
" </fonts>" +
' <fills count="' +
"</fonts>" +
'<fills count="' +
styles.fill.count +
'">' +
" <fill>" +
' <patternFill patternType="none" />' +
" </fill>" +
" <fill>" +
' <patternFill patternType="lightGray" />' +
" </fill>" +
" " +
"<fill>" +
'<patternFill patternType="none" />' +
"</fill>" +
"<fill>" +
'<patternFill patternType="lightGray" />' +
"</fill>" +
styles.fill.value +
" </fills>" +
' <borders count="' +
"</fills>" +
'<borders count="' +
styles.border.count +
'">' +
" <border />" +
"<border />" +
styles.border.value +
" </borders>" +
' <cellStyleXfs count="1">' +
' <xf borderId="0" fillId="0" fontId="0" numFmtId="0" applyAlignment="1" applyFont="1" />' +
" </cellStyleXfs>" +
' <cellXfs count="' +
"</borders>" +
'<cellStyleXfs count="1">' +
'<xf borderId="0" fillId="0" fontId="0" numFmtId="0" applyAlignment="1" applyFont="1" />' +
"</cellStyleXfs>" +
'<cellXfs count="' +
styles.cell.count +
'">' +
' <xf borderId="0" fillId="0" fontId="0" numFmtId="0" xfId="0" applyAlignment="1"' +
'<xf borderId="0" fillId="0" fontId="0" numFmtId="0" xfId="0" applyAlignment="1"' +
' applyFont="1">' +
' <alignment readingOrder="0" shrinkToFit="0" vertical="bottom" wrapText="0" />' +
" </xf>" +
' <xf borderId="0" fillId="0" fontId="1" numFmtId="0" xfId="0" applyAlignment="1"' +
'<alignment readingOrder="0" shrinkToFit="0" vertical="bottom" wrapText="0" />' +
"</xf>" +
'<xf borderId="0" fillId="0" fontId="1" numFmtId="0" xfId="0" applyAlignment="1"' +
' applyFont="1">' +
' <alignment readingOrder="0" />' +
" </xf>" +
" " +
'<alignment readingOrder="0" />' +
"</xf>" +
styles.cell.value +
" </cellXfs>" +
' <cellStyles count="1">' +
' <cellStyle xfId="0" name="Normal" builtinId="0" />' +
" </cellStyles> " +
"</cellXfs>" +
'<cellStyles count="1">' +
'<cellStyle xfId="0" name="Normal" builtinId="0" />' +
"</cellStyles> " +
(addCF
? '<dxfs count="' +
styles.conditinalFormating.count +
styles.conditionalFormatting.count +
'" >' +
styles.conditinalFormating.value +
styles.conditionalFormatting.value +
"</dxfs>"
: '<dxfs count="0" />') +
" </styleSheet>");
"</styleSheet>");
}
exports.styleGenerator = styleGenerator;
//# sourceMappingURL=styles.js.map
import { ExcelTable } from "../data-model/excel-table";
export type RowHeightScaleFunction = (data: number, rowIndex: number, fromHeader: boolean) => number;
export type ColWidthScaleFunction = (data: number, colIndex: number) => number;
export declare function createExcelTabelBaseOnDomElement(queryForTable?: string, table?: HTMLTableElement, keepStyle?: boolean, rowHeightScaleFunction?: RowHeightScaleFunction, colWidthScaleFunction?: ColWidthScaleFunction): ExcelTable;
export declare function createExcelTableBaseOnDomElement(queryForTable?: string | null, table?: HTMLTableElement | null, keepStyle?: boolean, rowHeightScaleFunction?: RowHeightScaleFunction, colWidthScaleFunction?: ColWidthScaleFunction): ExcelTable;
//# sourceMappingURL=create-excel-data.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createExcelTabelBaseOnDomElement = void 0;
exports.createExcelTableBaseOnDomElement = void 0;
const color_1 = require("./color");
function generatRowsBaseOnColAndRowSpan(col, row, start, length, rowV, text, mergeString, data) {
function generateRowsBaseOnColAndRowSpan(col, row, start, length, rowV, text, mergeString, data) {
let rows = [];
let hasCol = true;
let hasRow = true;
let type = "both";

@@ -64,3 +62,3 @@ let mergeValue = [];

}
function createExcelTabelBaseOnDomElement(queryForTable, table, keepStyle, rowHeightScaleFunction, colWidthScaleFunction) {
function createExcelTableBaseOnDomElement(queryForTable, table, keepStyle, rowHeightScaleFunction, colWidthScaleFunction) {
var _a;

@@ -78,3 +76,3 @@ if (!queryForTable && !table) {

let head = [];
let datas = [];
let dataObjs = [];
let styleMap = {

@@ -86,9 +84,3 @@ header: {},

if (nodes) {
// let header = []
// let data = []
let headerSet = false;
let mergeMap = {};
// let headerLength = 0
// let head = []
// let datas = []
let cellStyleMap = {};

@@ -113,36 +105,48 @@ let headerLength = 0;

if (styles.borderBottomWidth !== "0px") {
if (!border) {
border = {};
const borderBottomColor = (0, color_1.rgbToHex)(styles.borderBottomColor);
if (borderBottomColor) {
if (!border) {
border = {};
}
border["bottom"] = {
style: "thin",
color: borderBottomColor,
};
}
border["bottom"] = {
style: "thin",
color: (0, color_1.rgbToHex)(styles.borderBottomColor),
};
}
if (styles.borderTopWidth !== "0px") {
if (!border) {
border = {};
const borderTopColor = (0, color_1.rgbToHex)(styles.borderTopColor);
if (borderTopColor) {
if (!border) {
border = {};
}
border["top"] = {
style: "thin",
color: borderTopColor,
};
}
border["top"] = {
style: "thin",
color: (0, color_1.rgbToHex)(styles.borderTopColor),
};
}
if (styles.borderLeftWidth !== "0px") {
if (!border) {
border = {};
const borderLeftColor = (0, color_1.rgbToHex)(styles.borderLeftColor);
if (borderLeftColor) {
if (!border) {
border = {};
}
border["left"] = {
style: "thin",
color: borderLeftColor,
};
}
border["left"] = {
style: "thin",
color: (0, color_1.rgbToHex)(styles.borderLeftColor),
};
}
if (styles.borderRightWidth !== "0px") {
if (!border) {
border = {};
const borderRightColor = (0, color_1.rgbToHex)(styles.borderRightColor);
if (borderRightColor) {
if (!border) {
border = {};
}
border["right"] = {
style: "thin",
color: borderRightColor,
};
}
border["right"] = {
style: "thin",
color: (0, color_1.rgbToHex)(styles.borderRightColor),
};
}

@@ -153,3 +157,7 @@ let backgroundColor = (0, color_1.rgbToHex)(styles.backgroundColor);

}
let style = Object.assign(Object.assign(Object.assign(Object.assign({}, (backgroundColor ? { backgroundColor } : {})), { bold: parseInt(styles.fontWeight) > 500, size: parseInt(styles.fontSize.substring(0, styles.fontSize.indexOf("p"))) }), (border ? { border } : {})), { alignment: Object.assign({ horizontal: styles.textAlign, vertical: "center" }, (styles.direction == "rtl" ? { rtl: true } : { ltr: true })) });
const fontSizeStyle = parseInt(styles.fontSize.substring(0, styles.fontSize.indexOf("p")));
let style = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (backgroundColor ? { backgroundColor } : {})), { bold: parseInt(styles.fontWeight) > 500 }), (isNaN(fontSizeStyle) ? {} : { size: fontSizeStyle })), (border ? { border } : {})), { alignment: Object.assign(Object.assign(Object.assign({}, (typeof styles.textAlign == "string" &&
styles.textAlign.length > 0
? { horizontal: styles.textAlign }
: {})), { vertical: "center" }), (styles.direction == "rtl" ? { rtl: true } : { ltr: true })) });
styleMap.header[rowIndex + "-" + index] = style;

@@ -165,9 +173,5 @@ cellStyleMap[rowIndex + "-" + index] = rowIndex + "-" + index;

}
head.push({
label: "c" + index,
colspan: n.getAttribute("colspan"),
rowspan: n.getAttribute("rowspan"),
text: n.textContent,
size: headWidth,
});
const colSpanValue = n.getAttribute("colspan");
const rowSpanValue = n.getAttribute("rowspan");
head.push(Object.assign(Object.assign(Object.assign(Object.assign({ label: "c" + index }, (colSpanValue ? { colspan: colSpanValue } : {})), (rowSpanValue ? { rowspan: rowSpanValue } : {})), { text: n.textContent }), (isNaN(headWidth) || headWidth <= 0 ? {} : { size: headWidth })));
});

@@ -179,4 +183,4 @@ }

let inMergeMode = false;
if (datas.length >= rowIndex) {
data = datas[rowIndex - 1];
if (dataObjs.length >= rowIndex) {
data = dataObjs[rowIndex - 1];
mergeString =

@@ -203,13 +207,13 @@ "mergeString" in data ? data.mergeString : "";

n.getAttribute("rowspan")) {
let mergeData = generatRowsBaseOnColAndRowSpan(n.getAttribute("colspan") * 1, n.getAttribute("rowspan") * 1, index, headerLength, data, n.textContent, mergeString, data);
if (datas.length < rowIndex) {
datas.push(...mergeData);
let mergeData = generateRowsBaseOnColAndRowSpan(n.getAttribute("colspan") * 1, n.getAttribute("rowspan") * 1, index, headerLength, data, n.textContent, mergeString, data);
if (dataObjs.length < rowIndex) {
dataObjs.push(...mergeData);
}
else {
mergeData.forEach((v, index) => {
if (datas.length < rowIndex + index) {
datas.push(...mergeData);
if (dataObjs.length < rowIndex + index) {
dataObjs.push(...mergeData);
}
else {
datas[rowIndex + index] = Object.assign(Object.assign({}, datas[rowIndex + index]), v);
dataObjs[rowIndex + index] = Object.assign(Object.assign({}, dataObjs[rowIndex + index]), v);
}

@@ -229,36 +233,48 @@ });

if (styles.borderBottomWidth !== "0px") {
if (!border) {
border = {};
const borderBottomColor = (0, color_1.rgbToHex)(styles.borderBottomColor);
if (borderBottomColor) {
if (!border) {
border = {};
}
border["bottom"] = {
style: "thin",
color: borderBottomColor,
};
}
border["bottom"] = {
style: "thin",
color: (0, color_1.rgbToHex)(styles.borderBottomColor),
};
}
if (styles.borderTopWidth !== "0px") {
if (!border) {
border = {};
const borderTopColor = (0, color_1.rgbToHex)(styles.borderTopColor);
if (borderTopColor) {
if (!border) {
border = {};
}
border["top"] = {
style: "thin",
color: borderTopColor,
};
}
border["top"] = {
style: "thin",
color: (0, color_1.rgbToHex)(styles.borderTopColor),
};
}
if (styles.borderLeftWidth !== "0px") {
if (!border) {
border = {};
const borderLeftColor = (0, color_1.rgbToHex)(styles.borderLeftColor);
if (borderLeftColor) {
if (!border) {
border = {};
}
border["left"] = {
style: "thin",
color: borderLeftColor,
};
}
border["left"] = {
style: "thin",
color: (0, color_1.rgbToHex)(styles.borderLeftColor),
};
}
if (styles.borderRightWidth !== "0px") {
if (!border) {
border = {};
const borderRightColor = (0, color_1.rgbToHex)(styles.borderRightColor);
if (borderRightColor) {
if (!border) {
border = {};
}
border["right"] = {
style: "thin",
color: borderRightColor,
};
}
border["right"] = {
style: "thin",
color: (0, color_1.rgbToHex)(styles.borderRightColor),
};
}

@@ -269,7 +285,11 @@ let backgroundColor = (0, color_1.rgbToHex)(styles.backgroundColor);

}
let style = Object.assign(Object.assign(Object.assign(Object.assign({}, (backgroundColor ? { backgroundColor } : {})), { bold: parseInt(styles.fontWeight) > 500, size: parseInt(styles.fontSize.substring(0, styles.fontSize.indexOf("p"))) }), (border ? { border } : {})), {
const fontSizeStyle = parseInt(styles.fontSize.substring(0, styles.fontSize.indexOf("p")));
let style = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (backgroundColor ? { backgroundColor } : {})), { bold: parseInt(styles.fontWeight) > 500 }), (isNaN(fontSizeStyle) ? {} : { size: fontSizeStyle })), (border ? { border } : {})), {
// backgroundColor: rgbToHex(styles.backgroundColor),
// colspan: n.getAttribute("colspan"),
// rowspan: n.getAttribute("rowspan"),
alignment: Object.assign({ horizontal: styles.textAlign, vertical: "center", direction: styles.direction }, (styles.direction == "rtl" ? { rtl: true } : { ltr: true })) });
alignment: Object.assign(Object.assign(Object.assign({}, (typeof styles.textAlign == "string" &&
styles.textAlign.length > 0
? { horizontal: styles.textAlign }
: {})), { vertical: "center" }), (styles.direction == "rtl" ? { rtl: true } : { ltr: true })) });
// data.rowStyle = "s" + st

@@ -291,7 +311,10 @@ styleMap.header[rowIndex + "-" + index] = style;

}
if (datas.length < rowIndex) {
datas.push(data);
if (typeof data.height == "string" && data.height.length == 0) {
delete data.height;
}
if (dataObjs.length < rowIndex) {
dataObjs.push(data);
}
else {
datas[rowIndex - 1] = data;
dataObjs[rowIndex - 1] = data;
}

@@ -307,8 +330,6 @@ }

sheet: [
{
headerHeight,
styleCellCondition: function (data, object, colIndex, rowIndex, fromHeader, stylekeys) {
Object.assign(Object.assign({}, (headerHeight ? { headerHeight } : {})), { styleCellCondition: function (data, object, rowIndex, colIndex, fromHeader, styleKeys) {
if (keepStyle) {
if (fromHeader) {
return stylekeys.includes(rowIndex - 1 + "-" + colIndex)
return styleKeys.includes(rowIndex - 1 + "-" + colIndex)
? rowIndex - 1 + "-" + colIndex

@@ -318,3 +339,3 @@ : "";

else {
return stylekeys.includes(rowIndex - 1 + "-" + colIndex)
return styleKeys.includes(rowIndex - 1 + "-" + colIndex)
? rowIndex - 1 + "-" + colIndex

@@ -327,6 +348,3 @@ : "";

}
},
data: datas,
headers: head,
},
}, data: dataObjs, headers: head }),
],

@@ -336,3 +354,3 @@ };

}
exports.createExcelTabelBaseOnDomElement = createExcelTabelBaseOnDomElement;
exports.createExcelTableBaseOnDomElement = createExcelTableBaseOnDomElement;
//# sourceMappingURL=create-excel-data.js.map

@@ -6,6 +6,10 @@ "use strict";

function getColRowBaseOnRefString(refString, cols) {
refString = refString.toUpperCase();
let column = refString.replace(/[0-9]/g, "");
if (column.length == 0) {
throw "Invalid Column";
}
let row = parseInt(refString.substring(column.length));
if (isNaN(row)) {
row = 0;
throw "Invalid Row";
}

@@ -12,0 +16,0 @@ row = Math.max(0, row - 1);

@@ -1,2 +0,2 @@

export declare function generateColumnName(cols: string[], num: number, startletter?: string, result?: string[], nextIndex?: number): string[];
export declare function generateColumnName(cols: string[], num: number, startLetter?: string, result?: string[], nextIndex?: number): string[];
//# sourceMappingURL=generate-column-name.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateColumnName = void 0;
function generateColumnName(cols, num, startletter = "", result = [], nextIndex = 0) {
function generateColumnName(cols, num, startLetter = "", result = [], nextIndex = -1) {
const length = cols.length;
for (let index = 0; index < length; index++) {
result.push(startletter + cols[index]);
result.push(startLetter + cols[index]);
}

@@ -9,0 +9,0 @@ if (num < result.length) {

@@ -5,2 +5,3 @@ "use strict";

function generateCellRowCol(string, formula, sheetIndex, styles) {
string = string.toUpperCase();
let cell = "";

@@ -10,5 +11,5 @@ if (formula.formula) {

let formulaStr = form.formula.indexOf("=") == 0 ? form.formula.substring(1) : form.formula;
let moltiInsertCell = string.indexOf(":") > 0;
let ref = form.refrenceCells ? form.refrenceCells : string;
let startRef = moltiInsertCell
let multiInsertCell = string.indexOf(":") > 0;
let ref = form.referenceCells ? form.referenceCells : string;
let startRef = multiInsertCell
? string.substring(0, string.indexOf(":"))

@@ -20,7 +21,12 @@ : string;

? form.returnType
: form.isArray || moltiInsertCell
: form.isArray || multiInsertCell
? ' t="str"'
: "";
let style = "styleId" in form ? ' s="' + styles[form.styleId].index + '"' : "";
let arrayStr = form.isArray || moltiInsertCell ? ' t="array" ref="' + ref + '"' : "";
let style = "styleId" in form &&
styles &&
typeof form.styleId === "string" &&
styles[form.styleId]
? ' s="' + styles[form.styleId].index + '"'
: "";
let arrayStr = form.isArray || multiInsertCell ? ' t="array" ref="' + ref + '"' : "";
cell =

@@ -52,7 +58,12 @@ '<c r="' +

if (form.noArgType == "NOW" || form.noArgType == "TODAY") {
const styleString = "styleId" in form ? 's="' + styles[form.styleId].index + '"' : "";
const styleString = "styleId" in form &&
styles &&
typeof form.styleId === "string" &&
styles[form.styleId]
? ' s="' + styles[form.styleId].index + '"'
: "";
cell =
'<c r="' +
string +
'" ' +
'"' +
styleString +

@@ -65,7 +76,12 @@ "><f>" +

let value = "NOW()";
const styleString = "styleId" in form ? 's="' + styles[form.styleId].index + '"' : "";
const styleString = "styleId" in form &&
styles &&
typeof form.styleId === "string" &&
styles[form.styleId]
? ' s="' + styles[form.styleId].index + '"'
: "";
cell =
'<c r="' +
string +
'" ' +
'"' +
styleString +

@@ -81,3 +97,3 @@ "><f>" +

}
else if (formula.refrenceCell) {
else if (formula.referenceCell) {
const form = formula;

@@ -92,7 +108,12 @@ let value = "";

}
const styleString = "styleId" in form ? 's="' + styles[form.styleId].index + '"' : "";
const styleString = "styleId" in form &&
styles &&
typeof form.styleId === "string" &&
styles[form.styleId]
? ' s="' + styles[form.styleId].index + '"'
: "";
cell =
'<c r="' +
string +
'" ' +
'"' +
styleString +

@@ -103,3 +124,3 @@ "><f>" +

"(" +
form.refrenceCell +
form.referenceCell.toUpperCase() +
value +

@@ -115,14 +136,14 @@ ")</f></c>";

string +
'" ' +
'"' +
(styles && typeof form.styleId === "string" && styles[form.styleId]
? 's="' + styles[form.styleId].index + '" '
? ' s="' + styles[form.styleId].index + '"'
: "") +
"> " +
" <f>" +
">" +
"<f>" +
form.type +
"(" +
form.start +
form.start.toUpperCase() +
":" +
form.end +
")</f> " +
form.end.toUpperCase() +
")</f>" +
"</c>";

@@ -129,0 +150,0 @@ }

@@ -1,3 +0,2 @@

export declare function toDataURL(url: string, callback: Function): void;
export declare const toDataURL2: (url: string, name: string) => Promise<void | File>;
export declare const toDataURL2: (url: string, name: string, isBackend?: boolean) => Promise<any>;
//# sourceMappingURL=image.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toDataURL2 = exports.toDataURL = void 0;
function toDataURL(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
var reader = new FileReader();
reader.onloadend = function () {
callback(reader.result);
};
reader.readAsDataURL(xhr.response);
};
xhr.open("GET", url);
xhr.responseType = "blob";
xhr.send();
}
exports.toDataURL = toDataURL;
const toDataURL2 = (url, name) => fetch(url)
exports.toDataURL2 = void 0;
const toDataURL2 = (url, name, isBackend = false) => fetch(url)
.then((response) => {
console.log(response);
return response.blob();
if (isBackend) {
return response.arrayBuffer();
}
else {
return response.blob();
}
})
.then((res) => {
return new File([res], name);
if (isBackend) {
// return Buffer.from(res)
return res;
}
else {
return new File([res], name);
}
})
.catch((err) => {
console.error(err);
throw err;
});
exports.toDataURL2 = toDataURL2;
// .then(blob => new Promise((resolve, reject) => {
// const reader = new FileReader()
// reader.onloadend = () => resolve(reader.result)
// reader.onerror = reject
// reader.readAsDataURL(blob)
// }))
//# sourceMappingURL=image.js.map
import { MultiStyleValue } from "../data-model/excel-table";
declare function splitBaseOnMatch(matchResult: string[], str: string): string[];
declare function splitAndMatching(v: string | RegExp, val: string, text: string, splittedText: boolean, splitValue: string[], matchValue: string[], styleMatchValue: string[], multiMode: boolean, useSplitBaseOnMatch?: boolean): {
v: string | RegExp;
text: string;
splittedText: true;
splitValue: string[];
matchValue: string[];
styleMatchValue: string[];
};
export declare function generateMultiStyleValue(multiStyle: MultiStyleValue, text: string, styles: {
[key: string]: string;
}, defStyleId: string, useSplitBaseOnMatch?: boolean): string;
export declare const exportedForTesting: {
splitBaseOnMatch: typeof splitBaseOnMatch;
splitAndMatching: typeof splitAndMatching;
};
export {};
//# sourceMappingURL=multi-value.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateMultiStyleValue = void 0;
exports.exportedForTesting = exports.generateMultiStyleValue = void 0;
const special_character_1 = require("./special-character");

@@ -19,4 +19,4 @@ function splitBaseOnMatch(matchResult, str) {

}
function splitAndMatching(v, val, text, textSplited, splitValue, matchValue, styleMatchValue, multiMode, useSplitBaseOnMatch) {
if (!textSplited) {
function splitAndMatching(v, val, text, splittedText, splitValue, matchValue, styleMatchValue, multiMode, useSplitBaseOnMatch) {
if (!splittedText) {
let matchV;

@@ -67,3 +67,3 @@ try {

}
textSplited = true;
splittedText = true;
}

@@ -137,3 +137,3 @@ else {

text,
textSplited,
splittedText,
splitValue,

@@ -150,3 +150,3 @@ matchValue,

let splitValue = [];
let textSplited = false;
let splittedText = false;
const keys = Object.keys(multiStyle);

@@ -159,4 +159,4 @@ keys.forEach((v) => {

else {
let result = splitAndMatching(v, typeof val == "string" ? val : "", text, textSplited, splitValue, matchValue, styleMatchValue, false, useSplitBaseOnMatch);
textSplited = result.textSplited;
let result = splitAndMatching(v, typeof val == "string" ? val : "", text, splittedText, splitValue, matchValue, styleMatchValue, false, useSplitBaseOnMatch);
splittedText = result.splittedText;
splitValue = result.splitValue;

@@ -175,4 +175,4 @@ matchValue = result.matchValue;

}
let result = splitAndMatching(element.reg, element.styleId, text, textSplited, splitValue, matchValue, styleMatchValue, true, useSplitBaseOnMatch);
textSplited = result.textSplited;
let result = splitAndMatching(element.reg, element.styleId, text, splittedText, splitValue, matchValue, styleMatchValue, true, useSplitBaseOnMatch);
splittedText = result.splittedText;
splitValue = result.splitValue;

@@ -193,5 +193,4 @@ matchValue = result.matchValue;

"<r>" +
" " +
elementStyle +
' <t xml:space="preserve">' +
'<t xml:space="preserve">' +
element +

@@ -203,8 +202,8 @@ "</t>" +

result +=
" <r> " +
styles[styleID] +
' <t xml:space="preserve">' +
"<r>" +
(styles[styleID] ? styles[styleID] : elementStyle) +
'<t xml:space="preserve">' +
matchElement +
"</t>" +
" </r>";
"</r>";
}

@@ -219,3 +218,3 @@ }

"<t>" +
(0, special_character_1.spCh)(splitValue[length]) +
(0, special_character_1.specialCharacterConverter)(splitValue[length]) +
"</t>" +

@@ -231,6 +230,10 @@ "</r>" +

else {
return "<si><t>" + (0, special_character_1.spCh)(text) + "</t></si>";
return "<si><t>" + (0, special_character_1.specialCharacterConverter)(text) + "</t></si>";
}
}
exports.generateMultiStyleValue = generateMultiStyleValue;
exports.exportedForTesting = {
splitBaseOnMatch,
splitAndMatching,
};
//# sourceMappingURL=multi-value.js.map

@@ -1,2 +0,2 @@

export declare function extractExcelData(uri: string): Promise<string>;
export declare function extractExcelData(uri: string, isBackend?: boolean): Promise<unknown>;
//# sourceMappingURL=read-utils.d.ts.map

@@ -51,8 +51,9 @@ "use strict";

const excel_util_1 = require("./excel-util");
function extractExcelData(uri) {
function extractExcelData(uri, isBackend = false) {
return __awaiter(this, void 0, void 0, function* () {
let queueSheet = [];
let nameMap = new Map();
let sharedStrings = [];
let sheetResultData = {};
let seenSheerdString = false;
let seenShardString = false;
function generateDataArray(filename, fileData) {

@@ -74,54 +75,122 @@ let resultData = [];

});
console.log(resultData);
}
sheetResultData[filename] = resultData;
if (filename.indexOf("xl/worksheets/sheet") == 0) {
let key = filename.substring(14, filename.lastIndexOf("."));
if (nameMap.has(key)) {
key = nameMap.get(key);
}
sheetResultData[key] =
resultData;
}
}
return yield fetch(uri)
.then((res) => {
console.log(res);
if (res == null || res == undefined) {
throw "response is null";
}
if (isBackend) {
return res.arrayBuffer();
}
return res.blob();
})
.then((res) => __awaiter(this, void 0, void 0, function* () {
return yield jszip_1.default.loadAsync(res).then(function (zip) {
Object.keys(zip.files).forEach(function (filename) {
zip.files[filename].async("string").then(function (fileData) {
if (filename.indexOf("sharedStrings") >= 0) {
let rows = fileData.match(/<si[\s\S\n]*?<\/si>/g);
if (Array.isArray(rows)) {
rows.forEach((va) => {
let t = va.match(/<t[\s\S\n]*?<\/t>/g);
if (Array.isArray(t)) {
let result = t.reduce((res, curr) => {
// console.log(curr)
return res + getValueWithinT(curr);
}, "");
sharedStrings.push(result);
}
});
let fileCounter = 0;
return yield new Promise((resolve, reject) => {
jszip_1.default.loadAsync(res).then(function (zip) {
const keys = Object.keys(zip.files);
fileCounter = keys.length;
let proxy = new Proxy({
counter: 0,
isNameSet: false,
}, {
set(obj, prop, value) {
if (prop === "isNameSet") {
obj.isNameSet = value;
return true;
}
seenSheerdString = true;
if (queueSheet.length > 0) {
queueSheet.forEach((v) => {
generateDataArray(v.filename, v.fileData);
});
queueSheet = [];
if (typeof value !== "number") {
throw "value most be number";
}
// console.log(sharedStrings)
}
if (filename.indexOf("sheet") >= 0) {
if (seenSheerdString) {
generateDataArray(filename, fileData);
obj.counter = value;
if (obj.isNameSet) {
if (obj.counter === fileCounter) {
resolve({
data: sheetResultData,
sheetName: nameMap.entries(),
});
}
}
else {
queueSheet.push({
filename,
fileData,
return true;
},
get(target, prop, receiver) {
if (prop === "isNameSet") {
return target.isNameSet;
}
// By default, it looks like Reflect.get(target, prop, receiver)
// which has a different value of `this`
return target.counter;
},
});
keys.forEach(function (filename) {
zip.files[filename].async("string").then(function (fileData) {
if (filename.indexOf("sharedStrings") >= 0) {
let rows = fileData.match(/<si[\s\S\n]*?<\/si>/g);
if (Array.isArray(rows)) {
rows.forEach((va) => {
let t = va.match(/<t[\s\S\n]*?<\/t>/g);
if (Array.isArray(t)) {
let result = t.reduce((res, curr) => {
return res + getValueWithinT(curr);
}, "");
sharedStrings.push(result);
}
});
}
seenShardString = true;
if (queueSheet.length > 0) {
queueSheet.forEach((v) => {
generateDataArray(v.filename, v.fileData);
});
queueSheet = [];
}
}
if (filename.indexOf("sheet") >= 0) {
if (seenShardString) {
generateDataArray(filename, fileData);
}
else {
queueSheet.push({
filename,
fileData,
});
}
}
if (filename.indexOf("workbook") >= 0) {
const sheetsTag = fileData.replace(/(.*[\n\s\S]*)(<sheets[\n\s\S]*?sheets>)(.*[\n\s\S]*)/, "$2");
const sheets = sheetsTag.split("<sheet ").slice(1);
sheets.forEach((v, i) => {
let name = "Sheet 1";
if (v.indexOf("name=") > 0) {
name = v.replace(/(.*[\n\s\S]*?)name="([^"]*)"(.*[\n\s\S]*)/, "$2");
}
let id = i + 1;
if (v.indexOf("sheetId=") > 0) {
id = Number(v.replace(/(.*[\n\s\S]*?)sheetId="([^"]*)"(.*[\n\s\S]*)/, "$2"));
if (isNaN(id)) {
id = i + 1;
}
}
nameMap.set("sheet" + id, name);
});
proxy.isNameSet = true;
}
}
proxy.counter++;
});
});
});
return "done";
});
}));
}))
.catch((e) => {
throw e;
});
});

@@ -128,0 +197,0 @@ }

@@ -9,3 +9,3 @@ "use strict";

let counterRow = {};
let reseted = {};
let resetMap = {};
for (let index = 0; index < lengthData; index++) {

@@ -30,3 +30,3 @@ const element = data[index];

data: [],
labelConter: 0,
labelCounter: 0,
seenAt: index,

@@ -42,5 +42,5 @@ };

}
if (!(name in reseted)) {
rowTable[name].labelConter = 0;
reseted[name] = true;
if (!(name in resetMap)) {
rowTable[name].labelCounter = 0;
resetMap[name] = true;
}

@@ -52,11 +52,11 @@ let newHeader = [];

let header = mainData.headers.reduce((res, curr, index) => {
rowTable[name].labelConter++;
if (headerLength < rowTable[name].labelConter) {
rowTable[name].labelCounter++;
if (headerLength < rowTable[name].labelCounter) {
newHeader.push({
label: "c" + rowTable[name].labelConter,
label: "c" + rowTable[name].labelCounter,
text: withText ? curr.text : "",
});
}
headerAsRow["c" + rowTable[name].labelConter] = curr.text;
return Object.assign(Object.assign({}, res), { [curr.label]: "c" + rowTable[name].labelConter });
headerAsRow["c" + rowTable[name].labelCounter] = curr.text;
return Object.assign(Object.assign({}, res), { [curr.label]: "c" + rowTable[name].labelCounter });
}, {});

@@ -66,6 +66,6 @@ rowTable[name].headers.push(...newHeader);

for (let space = 0; space < mainData.spaceX; space++) {
rowTable[name].labelConter++;
if (headerLength <= rowTable[name].labelConter) {
rowTable[name].labelCounter++;
if (headerLength <= rowTable[name].labelCounter) {
rowTable[name].headers.push({
label: "c" + rowTable[name].labelConter,
label: "c" + rowTable[name].labelCounter,
text: "",

@@ -126,3 +126,3 @@ });

}
reseted = {};
resetMap = {};
}

@@ -129,0 +129,0 @@ let keys = Object.keys(rowTable);

@@ -1,2 +0,2 @@

export declare const spCh: (str: string) => string;
export declare const specialCharacterConverter: (str: string) => string;
//# sourceMappingURL=special-character.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spCh = void 0;
const spCh = function (str) {
exports.specialCharacterConverter = void 0;
const specialCharacterConverter = function (str) {
return str

@@ -10,3 +10,3 @@ .replace(/\&/g, "&amp;")

};
exports.spCh = spCh;
exports.specialCharacterConverter = specialCharacterConverter;
//# sourceMappingURL=special-character.js.map
{
"name": "mr-excel",
"version": "3.2.0",
"version": "4.0.0",
"main": "dist/excel-table.umd.js",

@@ -9,4 +9,8 @@ "scripts": {

"build1": "tsc && vite build",
"bb":"npm run build && npm run build1",
"dev": "tsc -w"
"bb": "npm run build && npm run build1",
"dev": "tsc -w",
"test": "jest -- create",
"test:coverage": "jest --coverage",
"test:coverage-text-summary": "jest --coverage --coverageReporters=\"text-summary\"",
"test:coverage-json-summary": "jest --coverage --coverageReporters=\"json-summary\""
},

@@ -53,5 +57,9 @@ "description": "A versatile JavaScript library for effortlessly generating .xlsx files from input objects. Seamlessly create Excel spreadsheets with data, formatting, formulas, and more.",

"devDependencies": {
"@jest/globals": "^29.7.0",
"@types/file-saver": "2.0.5",
"compression-webpack-plugin": "10.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"terser-webpack-plugin": "5.3.9",
"ts-jest": "^29.1.1",
"ts-loader": "9.4.4",

@@ -58,0 +66,0 @@ "tsconfig-paths-webpack-plugin": "4.1.0",

@@ -8,3 +8,3 @@ export interface ExcelTable extends ExcelTableOption {

backend?: boolean;
activateConditinalFormating?: boolean;
activateConditionalFormatting?: boolean;
fileName?: string;

@@ -27,4 +27,4 @@ generateType?: "nodebuffer" | "array" | "binarystring" | "base64";

withoutHeader?: boolean;
conditinalFormating?: ConditinalFormating[];
multiStyleConditin?: MultiStyleConditinFunction;
conditionalFormatting?: ConditionalFormatting[];
multiStyleCondition?: MultiStyleConditionFunction;
useSplitBaseOnMatch?: boolean;

@@ -44,4 +44,4 @@ convertStringToNumber?: boolean;

styleCellCondition?: StyleCellConditionFunction;
commentCodition?: CommentConditionFunction;
sortAndfilter?: SortAndFilter;
commentCondition?: CommentConditionFunction;
sortAndFilter?: SortAndFilter;
state?: "hidden" | "visible";

@@ -59,3 +59,3 @@ headerRowOption?: any;

comment?: Comment | string;
conditinalFormating?: ConditinalFormating;
conditionalFormatting?: ConditionalFormatting;
formula?: {

@@ -126,3 +126,3 @@ type: FormulaType;

| "pivotTables";
export interface ConditinalFormating {
export interface ConditionalFormatting {
type: "cells" | "dataBar" | "iconSet" | "colorScale" | "top";

@@ -226,3 +226,3 @@ start: string;

}
export type MultiStyleConditinFunction = (
export type MultiStyleConditionFunction = (
data: Header | string | number | undefined,

@@ -247,6 +247,6 @@ object: null | Data,

object: Header | Data,
rowIndex: number,
colIndex: number,
rowIndex: number,
fromHeader: boolean,
stylekeys: string[]
styleKeys: string[]
) => string | null;

@@ -341,3 +341,3 @@ export type MergeRowDataConditionFunction = (

isArray?: boolean;
refrenceCells?: string;
referenceCells?: string;
formula: string;

@@ -349,3 +349,3 @@ returnType?: string;

type: SingleRefFormulaType;
refrenceCell: string;
referenceCell: string;
value?: number | string;

@@ -359,7 +359,7 @@ styleId?: string;

export interface StyleMapper {
conditinalFormating: {
conditionalFormatting: {
count: number;
value: string;
};
commentSintax: {
commentSyntax: {
value: {

@@ -366,0 +366,0 @@ [key: string]: string;

@@ -1,2 +0,2 @@

import { ThemeOption, themeGenerator } from "./Themes/theme";
import { ThemeOption, themeGenerator } from "./themes/theme";
import { Data, ExcelTable, SideBySide } from "./data-model/excel-table";

@@ -6,3 +6,3 @@ import {

RowHeightScaleFunction,
createExcelTabelBaseOnDomElement,
createExcelTableBaseOnDomElement,
} from "./utils/create-excel-data";

@@ -22,3 +22,3 @@ import { generateExcel as generateEx } from "./utils/generate-excel";

) {
const data = createExcelTabelBaseOnDomElement(
const data = createExcelTableBaseOnDomElement(
queryForTable,

@@ -25,0 +25,0 @@ table,

function removeSpace(str: string) {
return str.replace(/ /g, "");
}
function extendHexValue(hex: string) {
hex = hex.replace(/^#/, "");
if (hex.length == 3) {
const s0 = hex.charAt(0);
const s1 = hex.charAt(1);
const s2 = hex.charAt(2);
return s0 + s0 + s1 + s1 + s2 + s2;
} else {
return hex;
}
}
export function hexToRgbArray(hex: string): number[] {
if (/^#?([a-f\d]{3})$/i.test(hex)) {
hex = extendHexValue(hex);
}
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);

@@ -25,3 +39,3 @@ return result

// Determine whether the text should be dark or light based on luminance
const textColor = bgLuminance > 0.5 ? "rgb(0,0,0)" : "rgb(255,255,255)"; ;
const textColor = bgLuminance > 0.5 ? "rgb(0,0,0)" : "rgb(255,255,255)";

@@ -31,2 +45,6 @@ return textColor;

export function hexToRgbNegative(hex: string) {
// /(^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$)|(^#?([a-f\d]{3})$)/i;
if (/^#?([a-f\d]{3})$/i.test(hex)) {
hex = extendHexValue(hex);
}
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);

@@ -58,3 +76,7 @@ return result

}, true);
if ((spResult.length == 4 && spResult[3] == "0") || !validate) {
if (
(spResult.length == 4 && spResult[3] == "0") ||
(spResult.length != 3 && spResult.length != 4) ||
!validate
) {
return null;

@@ -92,3 +114,9 @@ }

}
return fgConvertor.replace("#", "");
return fgConvertor.replace(/^#/, "");
}
export const exportedForTesting = {
removeSpace,
valueToHex,
extendHexValue,
};

@@ -8,5 +8,5 @@ import { Comment } from "../data-model/excel-table";

},
commentStyl: string
commentStyle: string
) {
let hasAuthour = false;
let hasAuthor = false;
let commentStr: string[];

@@ -16,3 +16,3 @@ let author;

if ("author" in commentValue && commentValue.author) {
hasAuthour = true;
hasAuthor = true;
author = commentValue.author;

@@ -24,3 +24,3 @@ }

if (typeof styleCom == "string") {
commentStyl = styleCom;
commentStyle = styleCom;
}

@@ -30,20 +30,18 @@ }

"comment" in commentValue && typeof commentValue.comment == "string"
? splitBaseOnbreackline(commentValue.comment)
? splitBaseOnBreakLine(commentValue.comment)
: [""];
} else {
commentStr = commentValue ? splitBaseOnbreackline(commentValue) : [""];
commentStr = commentValue ? splitBaseOnBreakLine(commentValue) : [""];
}
if (hasAuthour) {
if (hasAuthor) {
commentStr.unshift(author + ":");
}
return {
hasAuthour,
hasAuthor,
author,
commentStyl,
commentStyle,
commentStr,
};
}
export function splitBaseOnbreackline(str: string): string[] {
export function splitBaseOnBreakLine(str: string): string[] {
// Split the string on \n or \r characters

@@ -58,3 +56,3 @@ var separateLines = str.split(/\r?\n|\r|\n/g);

style: string,
auIndex: number
authorIndex: number
) {

@@ -65,8 +63,7 @@ let result =

'" authorId="' +
Math.max(0, auIndex - 1) +
Math.max(0, authorIndex - 1) +
'" shapeId="0">' +
" <text>";
;
"<text>";
let bac = "";
comment.forEach((v, vindex) => {
comment.forEach((v, indexValue) => {
let pr = "";

@@ -78,9 +75,13 @@

}
if (vindex > 0) {
pr = 'xml:space="preserve"';
if (indexValue > 0) {
pr = ' xml:space="preserve"';
bac += "\n";
}
result += "<r>" + style + "<t " + pr + " >" + bac + v + "</t></r>";
result += "<r>" + style + "<t" + pr + ">" + bac + v + "</t></r>";
bac = "";
});
if (bac.length > 0 && result.indexOf("<r>") > 0) {
result =
result.substring(0, result.length - "</t></r>".length) + bac + "</t></r>";
}
result += "</text></comment>";

@@ -91,7 +92,6 @@ return result;

"<rPr>" +
" <b />" +
' <sz val="9" />' +
' <color rgb="000000" />' +
' <rFont val="Tahoma" />' +
"<b />" +
'<sz val="9" />' +
'<color rgb="000000" />' +
'<rFont val="Tahoma" />' +
"</rPr>";
;

@@ -6,19 +6,19 @@ export function appGenerator(sheetLength: number, sheetNameApp: string) {

' xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">' +
" <Application>Microsoft Excel</Application>" +
" <DocSecurity>0</DocSecurity>" +
" <ScaleCrop>false</ScaleCrop>" +
" <HeadingPairs>" +
' <vt:vector size="2" baseType="variant">' +
" <vt:variant>" +
" <vt:lpstr>Worksheets</vt:lpstr>" +
" </vt:variant>" +
" <vt:variant>" +
" <vt:i4>" +
"<Application>Microsoft Excel</Application>" +
"<DocSecurity>0</DocSecurity>" +
"<ScaleCrop>false</ScaleCrop>" +
"<HeadingPairs>" +
'<vt:vector size="2" baseType="variant">' +
"<vt:variant>" +
"<vt:lpstr>Worksheets</vt:lpstr>" +
"</vt:variant>" +
"<vt:variant>" +
"<vt:i4>" +
sheetLength +
"</vt:i4>" +
" </vt:variant>" +
" </vt:vector>" +
" </HeadingPairs>" +
" <TitlesOfParts>" +
' <vt:vector size="' +
"</vt:variant>" +
"</vt:vector>" +
"</HeadingPairs>" +
"<TitlesOfParts>" +
'<vt:vector size="' +
sheetLength +

@@ -29,11 +29,11 @@ '" baseType="lpstr">' +

"" +
" </vt:vector>" +
" </TitlesOfParts>" +
" <Company></Company>" +
" <LinksUpToDate>false</LinksUpToDate>" +
" <SharedDoc>false</SharedDoc>" +
" <HyperlinksChanged>false</HyperlinksChanged>" +
" <AppVersion>16.0300</AppVersion>" +
"</vt:vector>" +
"</TitlesOfParts>" +
"<Company></Company>" +
"<LinksUpToDate>false</LinksUpToDate>" +
"<SharedDoc>false</SharedDoc>" +
"<HyperlinksChanged>false</HyperlinksChanged>" +
"<AppVersion>16.0300</AppVersion>" +
"</Properties>"
);
}

@@ -138,3 +138,3 @@ import { FormatMap } from "../../data-model/excel-table";

},
ريال: {
"ريال": {
key: 171,

@@ -141,0 +141,0 @@ value:

@@ -1,3 +0,1 @@

import { Formula } from "../../data-model/excel-table";
export function contentTypeGenerator(

@@ -9,10 +7,13 @@ sheetContentType: string,

checkboxForm: string[],
needCalcChain:boolean
needCalcChain: boolean
) {
let typeCheck: {
[key: string]: boolean;
} = {};
return (
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n' +
'<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">' +
' <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>' +
' <Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing" />' +
' <Default Extension="xml" ContentType="application/xml" />' +
'<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>' +
'<Default Extension="vml" ContentType="application/vnd.openxmlformats-officedocument.vmlDrawing" />' +
'<Default Extension="xml" ContentType="application/xml" />' +
"<Override" +

@@ -26,9 +27,17 @@ ' ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"' +

arrTypes.reduce((res, curr) => {
curr = curr.toLowerCase();
if (typeCheck[curr]) {
return res;
}
if (curr == "svg") {
typeCheck["png"] = true;
typeCheck["svg"] = true;
return (
res +
'<Default Extension="png" ContentType="image/png"/>' +
' <Default Extension="svg" ContentType="image/svg+xml"/>'
'<Default Extension="svg" ContentType="image/svg+xml"/>'
);
} else if (curr == "jpeg" || curr == "jpg") {
typeCheck["jpeg"] = true;
typeCheck["jpg"] = true;
return (

@@ -38,2 +47,3 @@ res + '<Default Extension="' + curr + '" ContentType="image/jpeg"/>'

} else {
typeCheck["curr"] = true;
return (

@@ -45,3 +55,3 @@ res +

curr +
'" />'
'"/>'
);

@@ -64,5 +74,5 @@ }

(needCalcChain
? `<Override PartName="/xl/calcChain.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"/>`
? '<Override PartName="/xl/calcChain.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml"/>'
: "") +
' <Override PartName="/docProps/core.xml" ' +
'<Override PartName="/docProps/core.xml" ' +
' ContentType="application/vnd.openxmlformats-package.core-properties+xml" />' +

@@ -82,9 +92,9 @@ sheetDrawers.reduce((res, cu) => {

res +
`<Override PartName="/xl/ctrlProps/ctrlProp${
index + 1
}.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>`
'<Override PartName="/xl/ctrlProps/ctrlProp' +
(index + 1) +
'.xml" ContentType="application/vnd.ms-excel.controlproperties+xml"/>'
);
}, "")
: "") +
' <Override PartName="/docProps/app.xml" ' +
'<Override PartName="/docProps/app.xml" ' +
' ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" />' +

@@ -91,0 +101,0 @@ "</Types>"

@@ -16,69 +16,66 @@ import { StyleMapper } from "../../data-model/excel-table";

: "") +
' <fonts count="' +
'<fonts count="' +
styles.font.count +
'">' +
" <font>" +
' <sz val="11" />' +
' <color theme="1" />' +
' <name val="Calibri" />' +
' <family val="2" />' +
' <scheme val="minor" />' +
" </font>" +
" <font>" +
' <sz val="11" />' +
' <color rgb="FFFF0000" />' +
' <name val="Calibri" />' +
' <family val="2" />' +
' <scheme val="minor" />' +
" </font>" +
" " +
"<font>" +
'<sz val="11" />' +
'<color theme="1" />' +
'<name val="Calibri" />' +
'<family val="2" />' +
'<scheme val="minor" />' +
"</font>" +
"<font>" +
'<sz val="11" />' +
'<color rgb="FFFF0000" />' +
'<name val="Calibri" />' +
'<family val="2" />' +
'<scheme val="minor" />' +
"</font>" +
styles.font.value +
" </fonts>" +
' <fills count="' +
"</fonts>" +
'<fills count="' +
styles.fill.count +
'">' +
" <fill>" +
' <patternFill patternType="none" />' +
" </fill>" +
" <fill>" +
' <patternFill patternType="lightGray" />' +
" </fill>" +
" " +
"<fill>" +
'<patternFill patternType="none" />' +
"</fill>" +
"<fill>" +
'<patternFill patternType="lightGray" />' +
"</fill>" +
styles.fill.value +
" </fills>" +
' <borders count="' +
"</fills>" +
'<borders count="' +
styles.border.count +
'">' +
" <border />" +
"<border />" +
styles.border.value +
" </borders>" +
' <cellStyleXfs count="1">' +
' <xf borderId="0" fillId="0" fontId="0" numFmtId="0" applyAlignment="1" applyFont="1" />' +
" </cellStyleXfs>" +
' <cellXfs count="' +
"</borders>" +
'<cellStyleXfs count="1">' +
'<xf borderId="0" fillId="0" fontId="0" numFmtId="0" applyAlignment="1" applyFont="1" />' +
"</cellStyleXfs>" +
'<cellXfs count="' +
styles.cell.count +
'">' +
' <xf borderId="0" fillId="0" fontId="0" numFmtId="0" xfId="0" applyAlignment="1"' +
'<xf borderId="0" fillId="0" fontId="0" numFmtId="0" xfId="0" applyAlignment="1"' +
' applyFont="1">' +
' <alignment readingOrder="0" shrinkToFit="0" vertical="bottom" wrapText="0" />' +
" </xf>" +
' <xf borderId="0" fillId="0" fontId="1" numFmtId="0" xfId="0" applyAlignment="1"' +
'<alignment readingOrder="0" shrinkToFit="0" vertical="bottom" wrapText="0" />' +
"</xf>" +
'<xf borderId="0" fillId="0" fontId="1" numFmtId="0" xfId="0" applyAlignment="1"' +
' applyFont="1">' +
' <alignment readingOrder="0" />' +
" </xf>" +
" " +
'<alignment readingOrder="0" />' +
"</xf>" +
styles.cell.value +
" </cellXfs>" +
' <cellStyles count="1">' +
' <cellStyle xfId="0" name="Normal" builtinId="0" />' +
" </cellStyles> " +
"</cellXfs>" +
'<cellStyles count="1">' +
'<cellStyle xfId="0" name="Normal" builtinId="0" />' +
"</cellStyles> " +
(addCF
? '<dxfs count="' +
styles.conditinalFormating.count +
styles.conditionalFormatting.count +
'" >' +
styles.conditinalFormating.value +
styles.conditionalFormatting.value +
"</dxfs>"
: '<dxfs count="0" />') +
" </styleSheet>"
"</styleSheet>"
);
}

@@ -9,3 +9,3 @@ import {

function generatRowsBaseOnColAndRowSpan(
function generateRowsBaseOnColAndRowSpan(
col: number,

@@ -21,4 +21,2 @@ row: number,

let rows = [];
let hasCol = true;
let hasRow = true;
let type = "both";

@@ -83,5 +81,5 @@ let mergeValue = [];

export type ColWidthScaleFunction = (data: number, colIndex: number) => number;
export function createExcelTabelBaseOnDomElement(
queryForTable?: string,
table?: HTMLTableElement,
export function createExcelTableBaseOnDomElement(
queryForTable?: string|null,
table?: HTMLTableElement|null,
keepStyle?: boolean,

@@ -101,3 +99,3 @@ rowHeightScaleFunction?: RowHeightScaleFunction,

let head: any = [];
let datas: any = [];
let dataObjs: any = [];
let styleMap: any = {

@@ -109,9 +107,3 @@ header: {},

if (nodes) {
// let header = []
// let data = []
let headerSet = false;
let mergeMap = {};
// let headerLength = 0
// let head = []
// let datas = []
let cellStyleMap: any = {};

@@ -142,36 +134,48 @@ let headerLength = 0;

if (styles.borderBottomWidth !== "0px") {
if (!border) {
border = {};
const borderBottomColor = rgbToHex(styles.borderBottomColor);
if (borderBottomColor) {
if (!border) {
border = {};
}
border["bottom"] = {
style: "thin",
color: borderBottomColor,
};
}
border["bottom"] = {
style: "thin",
color: rgbToHex(styles.borderBottomColor)!,
};
}
if (styles.borderTopWidth !== "0px") {
if (!border) {
border = {};
const borderTopColor = rgbToHex(styles.borderTopColor);
if (borderTopColor) {
if (!border) {
border = {};
}
border["top"] = {
style: "thin",
color: borderTopColor,
};
}
border["top"] = {
style: "thin",
color: rgbToHex(styles.borderTopColor)!,
};
}
if (styles.borderLeftWidth !== "0px") {
if (!border) {
border = {};
const borderLeftColor = rgbToHex(styles.borderLeftColor);
if (borderLeftColor) {
if (!border) {
border = {};
}
border["left"] = {
style: "thin",
color: borderLeftColor,
};
}
border["left"] = {
style: "thin",
color: rgbToHex(styles.borderLeftColor)!,
};
}
if (styles.borderRightWidth !== "0px") {
if (!border) {
border = {};
const borderRightColor = rgbToHex(styles.borderRightColor);
if (borderRightColor) {
if (!border) {
border = {};
}
border["right"] = {
style: "thin",
color: borderRightColor,
};
}
border["right"] = {
style: "thin",
color: rgbToHex(styles.borderRightColor)!,
};
}

@@ -182,11 +186,15 @@ let backgroundColor = rgbToHex(styles.backgroundColor);

}
const fontSizeStyle = parseInt(
styles.fontSize.substring(0, styles.fontSize.indexOf("p"))
);
let style = {
...(backgroundColor ? { backgroundColor } : {}),
bold: parseInt(styles.fontWeight) > 500,
size: parseInt(
styles.fontSize.substring(0, styles.fontSize.indexOf("p"))
),
...(isNaN(fontSizeStyle) ? {} : { size: fontSizeStyle }),
...(border ? { border } : {}),
alignment: {
horizontal: styles.textAlign,
...(typeof styles.textAlign == "string" &&
styles.textAlign.length > 0
? { horizontal: styles.textAlign }
: {}),
vertical: "center",

@@ -208,8 +216,10 @@ ...(styles.direction == "rtl" ? { rtl: true } : { ltr: true }),

}
const colSpanValue = (n as any).getAttribute("colspan");
const rowSpanValue = (n as any).getAttribute("rowspan");
head.push({
label: "c" + index,
colspan: (n as any).getAttribute("colspan"),
rowspan: (n as any).getAttribute("rowspan"),
...(colSpanValue ? { colspan: colSpanValue } : {}),
...(rowSpanValue ? { rowspan: rowSpanValue } : {}),
text: (n as any).textContent,
size: headWidth,
...(isNaN(headWidth) || headWidth <= 0 ? {} : { size: headWidth }),
});

@@ -221,4 +231,4 @@ });

let inMergeMode = false;
if (datas.length >= rowIndex) {
data = datas[rowIndex - 1];
if (dataObjs.length >= rowIndex) {
data = dataObjs[rowIndex - 1];
mergeString =

@@ -246,3 +256,3 @@ "mergeString" in data ? (data.mergeString as string) : "";

) {
let mergeData = generatRowsBaseOnColAndRowSpan(
let mergeData = generateRowsBaseOnColAndRowSpan(
(n as any).getAttribute("colspan") * 1,

@@ -257,11 +267,11 @@ (n as any).getAttribute("rowspan") * 1,

);
if (datas.length < rowIndex) {
datas.push(...mergeData);
if (dataObjs.length < rowIndex) {
dataObjs.push(...mergeData);
} else {
mergeData.forEach((v, index) => {
if (datas.length < rowIndex + index) {
datas.push(...mergeData);
if (dataObjs.length < rowIndex + index) {
dataObjs.push(...mergeData);
} else {
datas[rowIndex + index] = {
...datas[rowIndex + index],
dataObjs[rowIndex + index] = {
...dataObjs[rowIndex + index],
...v,

@@ -282,36 +292,48 @@ };

if (styles.borderBottomWidth !== "0px") {
if (!border) {
border = {};
const borderBottomColor = rgbToHex(styles.borderBottomColor);
if (borderBottomColor) {
if (!border) {
border = {};
}
border["bottom"] = {
style: "thin",
color: borderBottomColor,
};
}
border["bottom"] = {
style: "thin",
color: rgbToHex(styles.borderBottomColor)!,
};
}
if (styles.borderTopWidth !== "0px") {
if (!border) {
border = {};
const borderTopColor = rgbToHex(styles.borderTopColor);
if (borderTopColor) {
if (!border) {
border = {};
}
border["top"] = {
style: "thin",
color: borderTopColor,
};
}
border["top"] = {
style: "thin",
color: rgbToHex(styles.borderTopColor)!,
};
}
if (styles.borderLeftWidth !== "0px") {
if (!border) {
border = {};
const borderLeftColor = rgbToHex(styles.borderLeftColor);
if (borderLeftColor) {
if (!border) {
border = {};
}
border["left"] = {
style: "thin",
color: borderLeftColor,
};
}
border["left"] = {
style: "thin",
color: rgbToHex(styles.borderLeftColor)!,
};
}
if (styles.borderRightWidth !== "0px") {
if (!border) {
border = {};
const borderRightColor = rgbToHex(styles.borderRightColor);
if (borderRightColor) {
if (!border) {
border = {};
}
border["right"] = {
style: "thin",
color: borderRightColor,
};
}
border["right"] = {
style: "thin",
color: rgbToHex(styles.borderRightColor)!,
};
}

@@ -322,8 +344,9 @@ let backgroundColor = rgbToHex(styles.backgroundColor);

}
const fontSizeStyle = parseInt(
styles.fontSize.substring(0, styles.fontSize.indexOf("p"))
);
let style = {
...(backgroundColor ? { backgroundColor } : {}),
bold: parseInt(styles.fontWeight) > 500,
size: parseInt(
styles.fontSize.substring(0, styles.fontSize.indexOf("p"))
),
...(isNaN(fontSizeStyle) ? {} : { size: fontSizeStyle }),
...(border ? { border } : {}),

@@ -334,5 +357,7 @@ // backgroundColor: rgbToHex(styles.backgroundColor),

alignment: {
horizontal: styles.textAlign,
...(typeof styles.textAlign == "string" &&
styles.textAlign.length > 0
? { horizontal: styles.textAlign }
: {}),
vertical: "center",
direction: styles.direction,
...(styles.direction == "rtl" ? { rtl: true } : { ltr: true }),

@@ -360,6 +385,9 @@ },

}
if (datas.length < rowIndex) {
datas.push(data);
if (typeof data.height == "string" && data.height.length == 0) {
delete data.height;
}
if (dataObjs.length < rowIndex) {
dataObjs.push(data);
} else {
datas[rowIndex - 1] = data;
dataObjs[rowIndex - 1] = data;
}

@@ -375,18 +403,18 @@ }

{
headerHeight,
...(headerHeight ? { headerHeight } : {}),
styleCellCondition: function (
data: Header | string | number | undefined,
object: Header | Data,
rowIndex: number,
colIndex: number,
rowIndex: number,
fromHeader: boolean,
stylekeys: string[]
styleKeys: string[]
) {
if (keepStyle) {
if (fromHeader) {
return stylekeys.includes(rowIndex - 1 + "-" + colIndex)
return styleKeys.includes(rowIndex - 1 + "-" + colIndex)
? rowIndex - 1 + "-" + colIndex
: "";
} else {
return stylekeys.includes(rowIndex - 1 + "-" + colIndex)
return styleKeys.includes(rowIndex - 1 + "-" + colIndex)
? rowIndex - 1 + "-" + colIndex

@@ -399,3 +427,3 @@ : "";

},
data: datas,
data: dataObjs,
headers: head,

@@ -402,0 +430,0 @@ },

@@ -10,6 +10,10 @@ import { generateColumnName } from "./generate-column-name";

} {
refString = refString.toUpperCase();
let column = refString.replace(/[0-9]/g, "");
if(column.length==0){
throw "Invalid Column"
}
let row = parseInt(refString.substring(column.length));
if (isNaN(row)) {
row = 0;
throw "Invalid Row"
}

@@ -16,0 +20,0 @@ row = Math.max(0, row - 1);

export function generateColumnName(
cols: string[],
num: number,
startletter: string = "",
startLetter: string = "",
result: string[] = [],
nextIndex: number = 0
nextIndex: number = -1
): string[] {
const length = cols.length;
for (let index = 0; index < length; index++) {
result.push(startletter + cols[index]);
result.push(startLetter + cols[index]);
}

@@ -12,0 +12,0 @@ if (num < result.length) {

@@ -19,2 +19,3 @@ import {

) {
string=string.toUpperCase();
let cell = "";

@@ -25,5 +26,5 @@ if ((<CustomFormulaSetting>formula).formula) {

form.formula.indexOf("=") == 0 ? form.formula.substring(1) : form.formula;
let moltiInsertCell = string.indexOf(":") > 0;
let ref = form.refrenceCells ? form.refrenceCells : string;
let startRef = moltiInsertCell
let multiInsertCell = string.indexOf(":") > 0;
let ref = form.referenceCells ? form.referenceCells : string;
let startRef = multiInsertCell
? string.substring(0, string.indexOf(":"))

@@ -35,9 +36,14 @@ : string;

? form.returnType
: form.isArray || moltiInsertCell
: form.isArray || multiInsertCell
? ' t="str"'
: "";
let style =
"styleId" in form ? ' s="' + styles![form.styleId!].index + '"' : "";
"styleId" in form &&
styles &&
typeof form.styleId === "string" &&
styles[form.styleId]
? ' s="' + styles![form.styleId!].index + '"'
: "";
let arrayStr =
form.isArray || moltiInsertCell ? ' t="array" ref="' + ref + '"' : "";
form.isArray || multiInsertCell ? ' t="array" ref="' + ref + '"' : "";
cell =

@@ -70,7 +76,12 @@ '<c r="' +

const styleString =
"styleId" in form ? 's="' + styles![form.styleId!].index + '"' : "";
"styleId" in form &&
styles &&
typeof form.styleId === "string" &&
styles[form.styleId]
? ' s="' + styles![form.styleId!].index + '"'
: "";
cell =
'<c r="' +
string +
'" ' +
'"' +
styleString +

@@ -83,7 +94,12 @@ "><f>" +

const styleString =
"styleId" in form ? 's="' + styles![form.styleId!].index + '"' : "";
"styleId" in form &&
styles &&
typeof form.styleId === "string" &&
styles[form.styleId]
? ' s="' + styles![form.styleId!].index + '"'
: "";
cell =
'<c r="' +
string +
'" ' +
'"' +
styleString +

@@ -98,3 +114,3 @@ "><f>" +

needCalcChain = true;
} else if ((<SingleRefFormulaSetting>formula).refrenceCell) {
} else if ((<SingleRefFormulaSetting>formula).referenceCell) {
const form = <SingleRefFormulaSetting>formula;

@@ -110,7 +126,12 @@ let value = "";

const styleString =
"styleId" in form ? 's="' + styles![form.styleId!].index + '"' : "";
"styleId" in form &&
styles &&
typeof form.styleId === "string" &&
styles[form.styleId]
? ' s="' + styles![form.styleId!].index + '"'
: "";
cell =
'<c r="' +
string +
'" ' +
'"' +
styleString +

@@ -121,3 +142,3 @@ "><f>" +

"(" +
form.refrenceCell +
form.referenceCell.toUpperCase() +
value +

@@ -132,14 +153,14 @@ ")</f></c>";

string +
'" ' +
'"' +
(styles && typeof form.styleId === "string" && styles[form.styleId]
? 's="' + styles[form.styleId].index + '" '
? ' s="' + styles[form.styleId].index + '"'
: "") +
"> " +
" <f>" +
">" +
"<f>" +
form.type +
"(" +
form.start +
form.start.toUpperCase() +
":" +
form.end +
")</f> " +
form.end.toUpperCase() +
")</f>" +
"</c>";

@@ -146,0 +167,0 @@ }

@@ -1,32 +0,24 @@

export function toDataURL(url: string, callback: Function) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
var reader = new FileReader();
reader.onloadend = function () {
callback(reader.result);
};
reader.readAsDataURL(xhr.response);
};
xhr.open("GET", url);
xhr.responseType = "blob";
xhr.send();
}
export const toDataURL2 = (url: string, name: string) =>
export const toDataURL2 = (
url: string,
name: string,
isBackend: boolean = false
) =>
fetch(url)
.then((response) => {
console.log(response);
return response.blob();
.then((response: any) => {
if (isBackend) {
return response.arrayBuffer();
} else {
return response.blob();
}
})
.then((res) => {
return new File([res], name);
if (isBackend) {
// return Buffer.from(res)
return res;
} else {
return new File([res], name);
}
})
.catch((err) => {
console.error(err);
throw err;
});
// .then(blob => new Promise((resolve, reject) => {
// const reader = new FileReader()
// reader.onloadend = () => resolve(reader.result)
// reader.onerror = reject
// reader.readAsDataURL(blob)
// }))

@@ -1,3 +0,3 @@

import { MultiStyleRexValue, MultiStyleValue } from "../data-model/excel-table";
import { spCh } from "./special-character";
import { MultiStyleValue } from "../data-model/excel-table";
import { specialCharacterConverter } from "./special-character";

@@ -25,3 +25,3 @@ function splitBaseOnMatch(matchResult: string[], str: string) {

text: string,
textSplited: boolean,
splittedText: boolean,
splitValue: string[],

@@ -33,3 +33,3 @@ matchValue: string[],

) {
if (!textSplited) {
if (!splittedText) {
let matchV;

@@ -75,3 +75,3 @@ try {

}
textSplited = true;
splittedText = true;
} else {

@@ -139,3 +139,3 @@ let newSplit: string[] = [];

text,
textSplited,
splittedText,
splitValue,

@@ -160,3 +160,3 @@ matchValue,

let splitValue: string[] = [];
let textSplited = false;
let splittedText = false;
const keys = Object.keys(multiStyle);

@@ -172,3 +172,3 @@ keys.forEach((v) => {

text,
textSplited,
splittedText,
splitValue,

@@ -180,3 +180,3 @@ matchValue,

);
textSplited = result.textSplited;
splittedText = result.splittedText;
splitValue = result.splitValue;

@@ -199,3 +199,3 @@ matchValue = result.matchValue;

text,
textSplited,
splittedText,
splitValue,

@@ -207,3 +207,3 @@ matchValue,

);
textSplited = result.textSplited;
splittedText = result.splittedText;
splitValue = result.splitValue;

@@ -225,5 +225,4 @@ matchValue = result.matchValue;

"<r>" +
" " +
elementStyle +
' <t xml:space="preserve">' +
'<t xml:space="preserve">' +
element +

@@ -235,8 +234,8 @@ "</t>" +

result +=
" <r> " +
styles[styleID] +
' <t xml:space="preserve">' +
"<r>" +
(styles[styleID] ? styles[styleID] : elementStyle) +
'<t xml:space="preserve">' +
matchElement +
"</t>" +
" </r>";
"</r>";
}

@@ -251,3 +250,3 @@ }

"<t>" +
spCh(splitValue[length]) +
specialCharacterConverter(splitValue[length]) +
"</t>" +

@@ -261,4 +260,9 @@ "</r>" +

} else {
return "<si><t>" + spCh(text) + "</t></si>";
return "<si><t>" + specialCharacterConverter(text) + "</t></si>";
}
}
export const exportedForTesting = {
splitBaseOnMatch,
splitAndMatching,
};

@@ -41,3 +41,6 @@ function hasTBeforeV(element: string) {

}
export async function extractExcelData(uri: string) {
export async function extractExcelData(
uri: string,
isBackend: boolean = false
) {
let queueSheet: {

@@ -47,5 +50,6 @@ filename: string;

}[] = [];
let nameMap = new Map<string, string>();
let sharedStrings: string[] = [];
let sheetResultData: ExtractResult = {};
let seenSheerdString = false;
let seenShardString = false;
function generateDataArray(filename: string, fileData: any) {

@@ -67,53 +71,135 @@ let resultData: ExtractedData = [];

});
console.log(resultData);
}
sheetResultData[filename] = resultData;
if (filename.indexOf("xl/worksheets/sheet") == 0) {
let key=filename.substring(14, filename.lastIndexOf("."))
if(nameMap.has(key)){
key=nameMap.get(key)!
}
sheetResultData[key] =
resultData;
}
}
return await fetch(uri)
.then((res) => {
console.log(res);
.then((res: any) => {
if (res == null || res == undefined) {
throw "response is null";
}
if (isBackend) {
return res.arrayBuffer();
}
return res.blob();
})
.then(async (res) => {
return await JSZip.loadAsync(res).then(function (zip) {
Object.keys(zip.files).forEach(function (filename) {
zip.files[filename].async("string").then(function (fileData) {
if (filename.indexOf("sharedStrings") >= 0) {
let rows = fileData.match(/<si[\s\S\n]*?<\/si>/g);
if (Array.isArray(rows)) {
rows.forEach((va) => {
let t = va.match(/<t[\s\S\n]*?<\/t>/g);
if (Array.isArray(t)) {
let result = t.reduce((res, curr) => {
// console.log(curr)
return res + getValueWithinT(curr);
}, "");
sharedStrings.push(result);
let fileCounter = 0;
return await new Promise((resolve, reject) => {
JSZip.loadAsync(res).then(function (zip) {
const keys = Object.keys(zip.files);
fileCounter = keys.length;
let proxy = new Proxy(
{
counter: 0,
isNameSet: false,
},
{
set(obj, prop, value) {
if (prop === "isNameSet") {
obj.isNameSet = value;
return true;
}
if (typeof value !== "number") {
throw "value most be number";
}
obj.counter = value;
if (obj.isNameSet) {
if (obj.counter === fileCounter) {
resolve({
data: sheetResultData,
sheetName: nameMap.entries(),
});
}
});
}
return true;
},
get(target, prop, receiver) {
if (prop === "isNameSet") {
return target.isNameSet;
}
// By default, it looks like Reflect.get(target, prop, receiver)
// which has a different value of `this`
return target.counter;
},
}
);
keys.forEach(function (filename) {
zip.files[filename].async("string").then(function (fileData) {
if (filename.indexOf("sharedStrings") >= 0) {
let rows = fileData.match(/<si[\s\S\n]*?<\/si>/g);
if (Array.isArray(rows)) {
rows.forEach((va) => {
let t = va.match(/<t[\s\S\n]*?<\/t>/g);
if (Array.isArray(t)) {
let result = t.reduce((res, curr) => {
return res + getValueWithinT(curr);
}, "");
sharedStrings.push(result);
}
});
}
seenShardString = true;
if (queueSheet.length > 0) {
queueSheet.forEach((v) => {
generateDataArray(v.filename, v.fileData);
});
queueSheet = [];
}
}
seenSheerdString = true;
if (queueSheet.length > 0) {
queueSheet.forEach((v) => {
generateDataArray(v.filename, v.fileData);
});
queueSheet = [];
if (filename.indexOf("sheet") >= 0) {
if (seenShardString) {
generateDataArray(filename, fileData);
} else {
queueSheet.push({
filename,
fileData,
});
}
}
// console.log(sharedStrings)
}
if (filename.indexOf("sheet") >= 0) {
if (seenSheerdString) {
generateDataArray(filename, fileData);
} else {
queueSheet.push({
filename,
fileData,
if (filename.indexOf("workbook") >= 0) {
const sheetsTag = fileData.replace(
/(.*[\n\s\S]*)(<sheets[\n\s\S]*?sheets>)(.*[\n\s\S]*)/,
"$2"
);
const sheets = sheetsTag.split("<sheet ").slice(1);
sheets.forEach((v, i) => {
let name = "Sheet 1";
if (v.indexOf("name=") > 0) {
name = v.replace(
/(.*[\n\s\S]*?)name="([^"]*)"(.*[\n\s\S]*)/,
"$2"
);
}
let id = i + 1;
if (v.indexOf("sheetId=") > 0) {
id = Number(
v.replace(
/(.*[\n\s\S]*?)sheetId="([^"]*)"(.*[\n\s\S]*)/,
"$2"
)
);
if (isNaN(id)) {
id = i + 1;
}
}
nameMap.set("sheet" + id, name);
});
proxy.isNameSet = true;
}
}
proxy.counter++;
});
});
});
return "done";
});
})
.catch((e) => {
throw e;
});
}

@@ -12,3 +12,3 @@ import {

data: Data[];
labelConter: number;
labelCounter: number;
seenAt: number;

@@ -29,3 +29,3 @@ headerIndex?: number;

let counterRow: SideBySideCounterRow = {};
let reseted: {
let resetMap: {
[key: string]: boolean;

@@ -53,3 +53,3 @@ } = {};

data: [],
labelConter: 0,
labelCounter: 0,
seenAt: index,

@@ -65,5 +65,5 @@ };

}
if (!(name in reseted)) {
rowTable[name].labelConter = 0;
reseted[name] = true;
if (!(name in resetMap)) {
rowTable[name].labelCounter = 0;
resetMap[name] = true;
}

@@ -80,13 +80,13 @@

} = mainData.headers.reduce((res, curr, index) => {
rowTable[name].labelConter++;
if (headerLength < rowTable[name].labelConter) {
rowTable[name].labelCounter++;
if (headerLength < rowTable[name].labelCounter) {
newHeader.push({
label: "c" + rowTable[name].labelConter,
label: "c" + rowTable[name].labelCounter,
text: withText ? curr.text : "",
});
}
headerAsRow["c" + rowTable[name].labelConter] = curr.text;
headerAsRow["c" + rowTable[name].labelCounter] = curr.text;
return {
...res,
[curr.label]: "c" + rowTable[name].labelConter,
[curr.label]: "c" + rowTable[name].labelCounter,
};

@@ -97,6 +97,6 @@ }, {});

for (let space = 0; space < mainData.spaceX; space++) {
rowTable[name].labelConter++;
if (headerLength <= rowTable[name].labelConter) {
rowTable[name].labelCounter++;
if (headerLength <= rowTable[name].labelCounter) {
rowTable[name].headers.push({
label: "c" + rowTable[name].labelConter,
label: "c" + rowTable[name].labelCounter,
text: "",

@@ -164,3 +164,3 @@ });

}
reseted = {};
resetMap = {};
}

@@ -167,0 +167,0 @@ let keys = Object.keys(rowTable);

@@ -1,6 +0,6 @@

export const spCh=function(str:string){
return str
.replace(/\&/g, "&amp;")
.replace(/\</g, "&lt;")
.replace(/\>/g, "&gt;");
}
export const specialCharacterConverter= function (str: string) {
return str
.replace(/\&/g, "&amp;")
.replace(/\</g, "&lt;")
.replace(/\>/g, "&gt;");
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc