abstract-sheet 0.0.3 → 0.0.5
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/README.md +1 -1
- package/lib/abstract-sheet/abstract-sheet-xsd.d.ts +1 -1
- package/lib/abstract-sheet/abstract-sheet-xsd.d.ts.map +1 -1
- package/lib/abstract-sheet/abstract-sheet-xsd.js +41 -45
- package/lib/abstract-sheet/abstract-sheet-xsd.js.map +1 -1
- package/lib/abstract-sheet/abstract-sheet.d.ts +23 -9
- package/lib/abstract-sheet/abstract-sheet.d.ts.map +1 -1
- package/lib/abstract-sheet/abstract-sheet.js.map +1 -1
- package/lib/abstract-sheet-exporters/_style.d.ts +3 -0
- package/lib/abstract-sheet-exporters/_style.d.ts.map +1 -0
- package/lib/abstract-sheet-exporters/_style.js +113 -0
- package/lib/abstract-sheet-exporters/_style.js.map +1 -0
- package/lib/abstract-sheet-exporters/_xlsx-sheet.d.ts +2 -3
- package/lib/abstract-sheet-exporters/_xlsx-sheet.d.ts.map +1 -1
- package/lib/abstract-sheet-exporters/_xlsx-sheet.js +14 -116
- package/lib/abstract-sheet-exporters/_xlsx-sheet.js.map +1 -1
- package/lib/abstract-sheet-exporters/csv.d.ts +2 -2
- package/lib/abstract-sheet-exporters/csv.d.ts.map +1 -1
- package/lib/abstract-sheet-exporters/csv.js +19 -16
- package/lib/abstract-sheet-exporters/csv.js.map +1 -1
- package/lib/abstract-sheet-exporters/index.d.ts +1 -0
- package/lib/abstract-sheet-exporters/index.d.ts.map +1 -1
- package/lib/abstract-sheet-exporters/index.js +1 -0
- package/lib/abstract-sheet-exporters/index.js.map +1 -1
- package/lib/abstract-sheet-exporters/react.d.ts +5 -0
- package/lib/abstract-sheet-exporters/react.d.ts.map +1 -0
- package/lib/abstract-sheet-exporters/react.js +135 -0
- package/lib/abstract-sheet-exporters/react.js.map +1 -0
- package/lib/abstract-sheet-exporters/xlsx.d.ts +1 -1
- package/lib/abstract-sheet-exporters/xlsx.d.ts.map +1 -1
- package/lib/abstract-sheet-exporters/xlsx.js +8 -5
- package/lib/abstract-sheet-exporters/xlsx.js.map +1 -1
- package/lib/abstract-sheet-xml/abstract-sheet-xml.d.ts +3 -1
- package/lib/abstract-sheet-xml/abstract-sheet-xml.d.ts.map +1 -1
- package/lib/abstract-sheet-xml/abstract-sheet-xml.js +34 -23
- package/lib/abstract-sheet-xml/abstract-sheet-xml.js.map +1 -1
- package/package.json +6 -2
- package/src/abstract-sheet/abstract-sheet-xsd.ts +41 -45
- package/src/abstract-sheet/abstract-sheet-xsd.xml +41 -45
- package/src/abstract-sheet/abstract-sheet.ts +11 -12
- package/src/abstract-sheet-exporters/_style.ts +113 -0
- package/src/abstract-sheet-exporters/_xlsx-sheet.ts +19 -121
- package/src/abstract-sheet-exporters/csv.ts +23 -19
- package/src/abstract-sheet-exporters/index.ts +1 -0
- package/src/abstract-sheet-exporters/react.tsx +185 -0
- package/src/abstract-sheet-exporters/xlsx.ts +9 -6
- package/src/abstract-sheet-xml/abstract-sheet-xml.ts +36 -23
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const xsd = "<?xml version=\"1.
|
|
1
|
+
export declare const xsd = "<?xml version=\"1.1\" encoding=\"UTF-8\"?>\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n\n\t<xs:element name=\"AbstractSheet\">\n\t\t<xs:complexType>\n\t\t\t<xs:sequence>\n\t\t\t\t<xs:element name=\"Styles\" type=\"Styles\" minOccurs=\"0\" maxOccurs=\"1\" />\n\t\t\t\t<xs:element name=\"Sheet\" type=\"Sheet\" />\n\t\t\t</xs:sequence>\n\t\t</xs:complexType>\n\t</xs:element>\n\n\t<xs:complexType name=\"Sheet\">\n\t\t<xs:sequence>\n\t\t\t<xs:element name=\"Cells\" type=\"Cells\" />\n\t\t\t<xs:element name=\"RowInfos\" type=\"RowInfos\" minOccurs=\"0\" maxOccurs=\"1\" />\n\t\t\t<xs:element name=\"ColInfos\" type=\"ColInfos\" minOccurs=\"0\" maxOccurs=\"1\" />\n\t\t</xs:sequence>\n\t\t<xs:attribute name=\"name\" type=\"xs:string\" use=\"required\" />\n\t\t<xs:attribute name=\"direction\">\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:restriction base=\"xs:string\">\n\t\t\t\t\t<xs:enumeration value=\"row\" />\n\t\t\t\t\t<xs:enumeration value=\"col\" />\n\t\t\t\t</xs:restriction>\n\t\t\t</xs:simpleType>\n\t\t</xs:attribute>\n\t</xs:complexType>\n\n\t<xs:complexType name=\"ColInfos\">\n\t\t<xs:sequence>\n\t\t\t<xs:element name=\"ColInfo\" type=\"ColInfo\" />\n\t\t</xs:sequence>\n\t</xs:complexType>\n\n\t<xs:complexType name=\"ColInfo\">\n\t\t<xs:attribute name=\"hidden\" type=\"xs:boolean\" />\n\t\t<xs:attribute name=\"widthPixels\" type=\"xs:integer\" />\n\t</xs:complexType>\n\n\t<xs:complexType name=\"RowInfos\">\n\t\t<xs:sequence>\n\t\t\t<xs:element name=\"RowInfo\" type=\"RowInfo\" />\n\t\t</xs:sequence>\n\t</xs:complexType>\n\n\t<xs:complexType name=\"RowInfo\">\n\t\t<xs:attribute name=\"hidden\" type=\"xs:boolean\" />\n\t\t<xs:attribute name=\"heightPixels\" type=\"xs:integer\" />\n\t</xs:complexType>\n\n\t<xs:complexType name=\"Cells\">\n\t\t<xs:sequence>\n\t\t\t<xs:element name=\"Cell\" type=\"Cell\" />\n\t\t</xs:sequence>\n\t</xs:complexType>\n\n\t<xs:complexType name=\"Cell\">\n\t\t<xs:attribute name=\"number\" type=\"xs:string\" use=\"optional\" />\n\t\t<xs:attribute name=\"text\" type=\"xs:string\" use=\"optional\" />\n\t\t<xs:attribute name=\"bool\" type=\"xs:string\" use=\"optional\" />\n\t\t<xs:attribute name=\"date\" type=\"xs:string\" use=\"optional\" />\n\t\t<xs:attribute name=\"styles\" type=\"xs:string\" />\n\t</xs:complexType>\n\n\t<xs:complexType name=\"Styles\">\n\t\t<xs:sequence>\n\t\t\t<xs:element name=\"Style\" minOccurs=\"0\" maxOccurs=\"unbounded\" />\n\t\t</xs:sequence>\n\t</xs:complexType>\n\n\t<xs:complexType name=\"Style\">\n\t\t<xs:attribute name=\"name\" type=\"xs:string\" use=\"required\" />\n\t\t<xs:attribute name=\"vertical\">\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:restriction base=\"xs:string\">\n\t\t\t\t\t<xs:enumeration value=\"top\" />\n\t\t\t\t\t<xs:enumeration value=\"center\" />\n\t\t\t\t\t<xs:enumeration value=\"bottom\" />\n\t\t\t\t</xs:restriction>\n\t\t\t</xs:simpleType>\n\t\t</xs:attribute>\n\t\t<xs:attribute name=\"horizontal\">\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:restriction base=\"xs:string\">\n\t\t\t\t\t<xs:enumeration value=\"left\" />\n\t\t\t\t\t<xs:enumeration value=\"center\" />\n\t\t\t\t\t<xs:enumeration value=\"right\" />\n\t\t\t\t</xs:restriction>\n\t\t\t</xs:simpleType>\n\t\t</xs:attribute>\n\t\t<xs:attribute name=\"wrapText\" type=\"xs:boolean\" />\n\t\t<xs:attribute name=\"textRotation\" type=\"xs:double\" />\n\t\t<xs:attribute name=\"borderStyle\" type=\"BorderStyle\" />\n\t\t<xs:attribute name=\"borderColor\" type=\"BorderColor\" />\n\t\t<xs:attribute name=\"fillType\">\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:restriction base=\"xs:string\">\n\t\t\t\t\t<xs:enumeration value=\"solid\" />\n\t\t\t\t\t<xs:enumeration value=\"none\" />\n\t\t\t\t</xs:restriction>\n\t\t\t</xs:simpleType>\n\t\t</xs:attribute>\n\t\t<xs:attribute name=\"foreground\" type=\"HexColorWithOpacity\" />\n\t\t<xs:attribute name=\"background\" type=\"HexColorWithOpacity\" />\n\t\t<xs:attribute name=\"bold\" type=\"xs:boolean\" />\n\t\t<xs:attribute name=\"color\" type=\"HexColorWithOpacity\" />\n\t\t<xs:attribute name=\"italic\" type=\"xs:boolean\" />\n\t\t<xs:attribute name=\"font\" type=\"xs:string\" />\n\t\t<xs:attribute name=\"strike\" type=\"xs:boolean\" />\n\t\t<xs:attribute name=\"size\" type=\"xs:double\" />\n\t\t<xs:attribute name=\"underline\" type=\"xs:boolean\" />\n\t\t<xs:attribute name=\"script\">\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:restriction base=\"xs:string\">\n\t\t\t\t\t<xs:enumeration value=\"superscript\" />\n\t\t\t\t\t<xs:enumeration value=\"subscript\" />\n\t\t\t\t</xs:restriction>\n\t\t\t</xs:simpleType>\n\t\t</xs:attribute>\n\t\t<xs:attribute name=\"numberFormat\" type=\"xs:string\" />\n\t</xs:complexType>\n\n\t<xs:simpleType name=\"HexColorWithOpacity\">\n\t\t<xs:restriction base=\"xs:string\">\n\t\t\t<xs:pattern value=\"#[0-9a-fA-F]{8}\" />\n\t\t</xs:restriction>\n\t</xs:simpleType>\n\n\t<xs:simpleType name=\"BorderColor\">\n\t\t<xs:restriction base=\"xs:string\">\n\t\t\t<xs:pattern value=\"^#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})(\\s#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})){0,3}$\" />\n\t\t</xs:restriction>\n\t</xs:simpleType>\n\n\t<xs:simpleType name=\"BorderStyle\">\n\t\t<xs:restriction base=\"xs:string\">\n\t\t\t<xs:pattern value=\"^(dashDotDot|dashDot|dashed|dotted|hair|mediumDashDotDot|mediumDashDot|mediumDashed|medium|slantDashDot|thick|thin)(\\s(dashDotDot|dashDot|dashed|dotted|hair|mediumDashDotDot|mediumDashDot|mediumDashed|medium|slantDashDot|thick|thin)){0,3}$\" />\n\t\t</xs:restriction>\n\t</xs:simpleType>\n\n</xs:schema>";
|
|
2
2
|
//# sourceMappingURL=abstract-sheet-xsd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-sheet-xsd.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet/abstract-sheet-xsd.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"abstract-sheet-xsd.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet/abstract-sheet-xsd.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,+1KA6IH,CAAC"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.xsd = void 0;
|
|
4
|
-
exports.xsd = `<?xml version="1.
|
|
4
|
+
exports.xsd = `<?xml version="1.1" encoding="UTF-8"?>
|
|
5
5
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
|
6
6
|
|
|
7
7
|
<xs:element name="AbstractSheet">
|
|
8
8
|
<xs:complexType>
|
|
9
9
|
<xs:sequence>
|
|
10
|
-
<xs:element name="Styles" type="Styles" minOccurs="0" />
|
|
11
|
-
<xs:element name="
|
|
10
|
+
<xs:element name="Styles" type="Styles" minOccurs="0" maxOccurs="1" />
|
|
11
|
+
<xs:element name="Sheet" type="Sheet" />
|
|
12
12
|
</xs:sequence>
|
|
13
13
|
</xs:complexType>
|
|
14
14
|
</xs:element>
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
<xs:complexType name="Sheets">
|
|
18
|
-
<xs:sequence>
|
|
19
|
-
<xs:element name="Sheet" type="Sheet" minOccurs="0" />
|
|
20
|
-
</xs:sequence>
|
|
21
|
-
</xs:complexType>
|
|
22
|
-
|
|
23
16
|
<xs:complexType name="Sheet">
|
|
24
17
|
<xs:sequence>
|
|
25
|
-
<xs:element name="
|
|
18
|
+
<xs:element name="Cells" type="Cells" />
|
|
26
19
|
<xs:element name="RowInfos" type="RowInfos" minOccurs="0" maxOccurs="1" />
|
|
27
20
|
<xs:element name="ColInfos" type="ColInfos" minOccurs="0" maxOccurs="1" />
|
|
28
21
|
</xs:sequence>
|
|
29
22
|
<xs:attribute name="name" type="xs:string" use="required" />
|
|
23
|
+
<xs:attribute name="direction">
|
|
24
|
+
<xs:simpleType>
|
|
25
|
+
<xs:restriction base="xs:string">
|
|
26
|
+
<xs:enumeration value="row" />
|
|
27
|
+
<xs:enumeration value="col" />
|
|
28
|
+
</xs:restriction>
|
|
29
|
+
</xs:simpleType>
|
|
30
|
+
</xs:attribute>
|
|
30
31
|
</xs:complexType>
|
|
31
32
|
|
|
32
33
|
<xs:complexType name="ColInfos">
|
|
@@ -51,43 +52,20 @@ exports.xsd = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
51
52
|
<xs:attribute name="heightPixels" type="xs:integer" />
|
|
52
53
|
</xs:complexType>
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
<xs:complexType name="Rows">
|
|
56
|
-
<xs:sequence>
|
|
57
|
-
<xs:element name="Row" type="Row" />
|
|
58
|
-
</xs:sequence>
|
|
59
|
-
</xs:complexType>
|
|
60
|
-
|
|
61
|
-
<xs:complexType name="Row">
|
|
55
|
+
<xs:complexType name="Cells">
|
|
62
56
|
<xs:sequence>
|
|
63
57
|
<xs:element name="Cell" type="Cell" />
|
|
64
58
|
</xs:sequence>
|
|
65
59
|
</xs:complexType>
|
|
66
60
|
|
|
67
61
|
<xs:complexType name="Cell">
|
|
68
|
-
<xs:attribute name="
|
|
62
|
+
<xs:attribute name="number" type="xs:string" use="optional" />
|
|
63
|
+
<xs:attribute name="text" type="xs:string" use="optional" />
|
|
64
|
+
<xs:attribute name="bool" type="xs:string" use="optional" />
|
|
65
|
+
<xs:attribute name="date" type="xs:string" use="optional" />
|
|
69
66
|
<xs:attribute name="styles" type="xs:string" />
|
|
70
|
-
<xs:attribute name="type">
|
|
71
|
-
<xs:simpleType>
|
|
72
|
-
<xs:restriction base="xs:string">
|
|
73
|
-
<xs:enumeration value="string" />
|
|
74
|
-
<xs:enumeration value="number" />
|
|
75
|
-
</xs:restriction>
|
|
76
|
-
</xs:simpleType>
|
|
77
|
-
</xs:attribute>
|
|
78
67
|
</xs:complexType>
|
|
79
68
|
|
|
80
|
-
<xs:simpleType name="NumberOrString">
|
|
81
|
-
<xs:union>
|
|
82
|
-
<xs:simpleType>
|
|
83
|
-
<xs:restriction base="xs:double" />
|
|
84
|
-
</xs:simpleType>
|
|
85
|
-
<xs:simpleType>
|
|
86
|
-
<xs:restriction base="xs:string" />
|
|
87
|
-
</xs:simpleType>
|
|
88
|
-
</xs:union>
|
|
89
|
-
</xs:simpleType>
|
|
90
|
-
|
|
91
69
|
<xs:complexType name="Styles">
|
|
92
70
|
<xs:sequence>
|
|
93
71
|
<xs:element name="Style" minOccurs="0" maxOccurs="unbounded" />
|
|
@@ -115,9 +93,9 @@ exports.xsd = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
115
93
|
</xs:simpleType>
|
|
116
94
|
</xs:attribute>
|
|
117
95
|
<xs:attribute name="wrapText" type="xs:boolean" />
|
|
118
|
-
<xs:attribute name="textRotation" type="xs:
|
|
119
|
-
<xs:attribute name="borderStyle" type="
|
|
120
|
-
<xs:attribute name="borderColor" type="
|
|
96
|
+
<xs:attribute name="textRotation" type="xs:double" />
|
|
97
|
+
<xs:attribute name="borderStyle" type="BorderStyle" />
|
|
98
|
+
<xs:attribute name="borderColor" type="BorderColor" />
|
|
121
99
|
<xs:attribute name="fillType">
|
|
122
100
|
<xs:simpleType>
|
|
123
101
|
<xs:restriction base="xs:string">
|
|
@@ -126,10 +104,10 @@ exports.xsd = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
126
104
|
</xs:restriction>
|
|
127
105
|
</xs:simpleType>
|
|
128
106
|
</xs:attribute>
|
|
129
|
-
<xs:attribute name="foreground" type="
|
|
130
|
-
<xs:attribute name="background" type="
|
|
107
|
+
<xs:attribute name="foreground" type="HexColorWithOpacity" />
|
|
108
|
+
<xs:attribute name="background" type="HexColorWithOpacity" />
|
|
131
109
|
<xs:attribute name="bold" type="xs:boolean" />
|
|
132
|
-
<xs:attribute name="color" type="
|
|
110
|
+
<xs:attribute name="color" type="HexColorWithOpacity" />
|
|
133
111
|
<xs:attribute name="italic" type="xs:boolean" />
|
|
134
112
|
<xs:attribute name="font" type="xs:string" />
|
|
135
113
|
<xs:attribute name="strike" type="xs:boolean" />
|
|
@@ -146,5 +124,23 @@ exports.xsd = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
146
124
|
<xs:attribute name="numberFormat" type="xs:string" />
|
|
147
125
|
</xs:complexType>
|
|
148
126
|
|
|
127
|
+
<xs:simpleType name="HexColorWithOpacity">
|
|
128
|
+
<xs:restriction base="xs:string">
|
|
129
|
+
<xs:pattern value="#[0-9a-fA-F]{8}" />
|
|
130
|
+
</xs:restriction>
|
|
131
|
+
</xs:simpleType>
|
|
132
|
+
|
|
133
|
+
<xs:simpleType name="BorderColor">
|
|
134
|
+
<xs:restriction base="xs:string">
|
|
135
|
+
<xs:pattern value="^#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})(\\s#([0-9a-fA-F]{6}|[0-9a-fA-F]{8})){0,3}$" />
|
|
136
|
+
</xs:restriction>
|
|
137
|
+
</xs:simpleType>
|
|
138
|
+
|
|
139
|
+
<xs:simpleType name="BorderStyle">
|
|
140
|
+
<xs:restriction base="xs:string">
|
|
141
|
+
<xs:pattern value="^(dashDotDot|dashDot|dashed|dotted|hair|mediumDashDotDot|mediumDashDot|mediumDashed|medium|slantDashDot|thick|thin)(\\s(dashDotDot|dashDot|dashed|dotted|hair|mediumDashDotDot|mediumDashDot|mediumDashed|medium|slantDashDot|thick|thin)){0,3}$" />
|
|
142
|
+
</xs:restriction>
|
|
143
|
+
</xs:simpleType>
|
|
144
|
+
|
|
149
145
|
</xs:schema>`;
|
|
150
146
|
//# sourceMappingURL=abstract-sheet-xsd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-sheet-xsd.js","sourceRoot":"","sources":["../../src/abstract-sheet/abstract-sheet-xsd.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG
|
|
1
|
+
{"version":3,"file":"abstract-sheet-xsd.js","sourceRoot":"","sources":["../../src/abstract-sheet/abstract-sheet-xsd.ts"],"names":[],"mappings":";;;AAAa,QAAA,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA6IN,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
export type AbstractSheet = {
|
|
2
|
-
readonly sheets:
|
|
2
|
+
readonly sheets: ReadonlyArray<Sheet>;
|
|
3
3
|
readonly styles?: Styles;
|
|
4
|
+
readonly name?: string;
|
|
4
5
|
};
|
|
5
|
-
export type Sheets = ReadonlyArray<Sheet>;
|
|
6
6
|
export type Sheet = {
|
|
7
7
|
readonly name: string;
|
|
8
|
-
readonly
|
|
8
|
+
readonly cells: ReadonlyArray<Cells>;
|
|
9
9
|
readonly colInfo?: ColInfos;
|
|
10
10
|
readonly rowInfo?: RowInfos;
|
|
11
|
+
readonly direction?: "row" | "col";
|
|
11
12
|
};
|
|
12
13
|
export type ColInfos = ReadonlyArray<ColInfo>;
|
|
13
14
|
export type ColInfo = {
|
|
@@ -19,14 +20,27 @@ export type RowInfo = {
|
|
|
19
20
|
readonly hidden?: boolean;
|
|
20
21
|
readonly heightPixels?: number;
|
|
21
22
|
};
|
|
22
|
-
export type
|
|
23
|
-
export type
|
|
24
|
-
export type Cell = {
|
|
25
|
-
readonly value: string | number;
|
|
23
|
+
export type Cells = ReadonlyArray<Cell>;
|
|
24
|
+
export type Cell = (NumberCell | TextCell | BoolCell | DateCell) & {
|
|
26
25
|
readonly styles?: ReadonlyArray<string>;
|
|
27
|
-
readonly type: CellType;
|
|
28
26
|
};
|
|
29
|
-
export type
|
|
27
|
+
export type NumberCell = {
|
|
28
|
+
readonly type: "number";
|
|
29
|
+
readonly value: string | number | boolean | Date;
|
|
30
|
+
};
|
|
31
|
+
export type TextCell = {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly value: string | number | boolean | Date;
|
|
34
|
+
};
|
|
35
|
+
export type BoolCell = {
|
|
36
|
+
readonly type: "boolean";
|
|
37
|
+
readonly value: string | number | boolean | Date;
|
|
38
|
+
};
|
|
39
|
+
export type DateCell = {
|
|
40
|
+
readonly type: "date";
|
|
41
|
+
readonly value: string | number | boolean | Date;
|
|
42
|
+
};
|
|
43
|
+
export type CellType = Cell["type"];
|
|
30
44
|
export type Styles = ReadonlyArray<Style>;
|
|
31
45
|
export type Style = {
|
|
32
46
|
readonly name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-sheet.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet/abstract-sheet.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"abstract-sheet.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet/abstract-sheet.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,Q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CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,WAAW,CAAC;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,YAAY,gKAaR,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACxD,eAAO,MAAM,iBAAiB;;CAAsD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-sheet.js","sourceRoot":"","sources":["../../src/abstract-sheet/abstract-sheet.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"abstract-sheet.js","sourceRoot":"","sources":["../../src/abstract-sheet/abstract-sheet.ts"],"names":[],"mappings":";;;AAmEA,MAAM,YAAY,GAAG;IACnB,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,kBAAkB;IAClB,eAAe;IACf,cAAc;IACd,QAAQ;IACR,cAAc;IACd,OAAO;IACP,MAAM;CACE,CAAC;AAGE,QAAA,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_style.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet-exporters/_style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CA8G7C"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createStyle = void 0;
|
|
4
|
+
function createStyle(style) {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
6
|
+
let s = {};
|
|
7
|
+
if (style.vertical || style.horizontal || style.wrapText !== undefined || style.textRotation !== undefined) {
|
|
8
|
+
s.alignment = {};
|
|
9
|
+
if (style.vertical) {
|
|
10
|
+
s.alignment.vertical = style.vertical;
|
|
11
|
+
}
|
|
12
|
+
if (style.horizontal) {
|
|
13
|
+
s.alignment.horizontal = style.horizontal;
|
|
14
|
+
}
|
|
15
|
+
if (style.wrapText !== undefined) {
|
|
16
|
+
s.alignment.wrapText = style.wrapText;
|
|
17
|
+
}
|
|
18
|
+
if (style.textRotation !== undefined) {
|
|
19
|
+
s.alignment.textRotation = style.textRotation;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (style.fillType || style.foreground || style.background) {
|
|
23
|
+
s.fill = {};
|
|
24
|
+
if (style.fillType) {
|
|
25
|
+
s.fill.patternType = style.fillType;
|
|
26
|
+
}
|
|
27
|
+
if (style.foreground) {
|
|
28
|
+
s.fill.fgColor = { rgb: style.foreground.slice(1) };
|
|
29
|
+
}
|
|
30
|
+
if (style.background) {
|
|
31
|
+
s.fill.bgColor = { rgb: style.background.slice(1) };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (style.borderStyle || style.borderColor) {
|
|
35
|
+
s.border = {};
|
|
36
|
+
if (((_a = style.borderStyle) === null || _a === void 0 ? void 0 : _a.top) || ((_b = style.borderColor) === null || _b === void 0 ? void 0 : _b.top)) {
|
|
37
|
+
s.border.top = {};
|
|
38
|
+
}
|
|
39
|
+
if ((_c = style.borderStyle) === null || _c === void 0 ? void 0 : _c.top) {
|
|
40
|
+
s.border.top.style = style.borderStyle.top;
|
|
41
|
+
}
|
|
42
|
+
if ((_d = style.borderColor) === null || _d === void 0 ? void 0 : _d.top) {
|
|
43
|
+
s.border.top.color = { rgb: style.borderColor.top.slice(1) };
|
|
44
|
+
}
|
|
45
|
+
if (((_e = style.borderStyle) === null || _e === void 0 ? void 0 : _e.right) || ((_f = style.borderColor) === null || _f === void 0 ? void 0 : _f.right)) {
|
|
46
|
+
s.border.right = {};
|
|
47
|
+
}
|
|
48
|
+
if ((_g = style.borderStyle) === null || _g === void 0 ? void 0 : _g.right) {
|
|
49
|
+
s.border.right.style = style.borderStyle.right;
|
|
50
|
+
}
|
|
51
|
+
if ((_h = style.borderColor) === null || _h === void 0 ? void 0 : _h.right) {
|
|
52
|
+
s.border.right.color = { rgb: style.borderColor.right.slice(1) };
|
|
53
|
+
}
|
|
54
|
+
if (((_j = style.borderStyle) === null || _j === void 0 ? void 0 : _j.bottom) || ((_k = style.borderColor) === null || _k === void 0 ? void 0 : _k.bottom)) {
|
|
55
|
+
s.border.bottom = {};
|
|
56
|
+
}
|
|
57
|
+
if ((_l = style.borderStyle) === null || _l === void 0 ? void 0 : _l.bottom) {
|
|
58
|
+
s.border.bottom.style = style.borderStyle.bottom;
|
|
59
|
+
}
|
|
60
|
+
if ((_m = style.borderColor) === null || _m === void 0 ? void 0 : _m.bottom) {
|
|
61
|
+
s.border.bottom.color = { rgb: style.borderColor.bottom.slice(1) };
|
|
62
|
+
}
|
|
63
|
+
if (((_o = style.borderStyle) === null || _o === void 0 ? void 0 : _o.left) || ((_p = style.borderColor) === null || _p === void 0 ? void 0 : _p.left)) {
|
|
64
|
+
s.border.left = {};
|
|
65
|
+
}
|
|
66
|
+
if ((_q = style.borderStyle) === null || _q === void 0 ? void 0 : _q.left) {
|
|
67
|
+
s.border.left.style = style.borderStyle.left;
|
|
68
|
+
}
|
|
69
|
+
if ((_r = style.borderColor) === null || _r === void 0 ? void 0 : _r.left) {
|
|
70
|
+
s.border.left.color = { rgb: style.borderColor.left.slice(1) };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (style.bold !== undefined ||
|
|
74
|
+
style.color ||
|
|
75
|
+
style.italic !== undefined ||
|
|
76
|
+
style.font ||
|
|
77
|
+
style.strike !== undefined ||
|
|
78
|
+
style.size !== undefined ||
|
|
79
|
+
style.underline !== undefined ||
|
|
80
|
+
style.script) {
|
|
81
|
+
s.font = {};
|
|
82
|
+
if (style.bold !== undefined) {
|
|
83
|
+
s.font.bold = style.bold;
|
|
84
|
+
}
|
|
85
|
+
if (style.color) {
|
|
86
|
+
s.font.color = { rgb: style.color.slice(1) };
|
|
87
|
+
}
|
|
88
|
+
if (style.italic !== undefined) {
|
|
89
|
+
s.font.italic = style.italic;
|
|
90
|
+
}
|
|
91
|
+
if (style.font) {
|
|
92
|
+
s.font.name = style.font;
|
|
93
|
+
}
|
|
94
|
+
if (style.strike !== undefined) {
|
|
95
|
+
s.font.strike = style.strike;
|
|
96
|
+
}
|
|
97
|
+
if (style.size !== undefined) {
|
|
98
|
+
s.font.sz = style.size;
|
|
99
|
+
}
|
|
100
|
+
if (style.underline !== undefined) {
|
|
101
|
+
s.font.underline = style.underline;
|
|
102
|
+
}
|
|
103
|
+
if (style.script !== undefined) {
|
|
104
|
+
s.font.vertAlign = style.script;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (style.numberFormat !== undefined) {
|
|
108
|
+
s.font.numFmt = style.numberFormat;
|
|
109
|
+
}
|
|
110
|
+
return s;
|
|
111
|
+
}
|
|
112
|
+
exports.createStyle = createStyle;
|
|
113
|
+
//# sourceMappingURL=_style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_style.js","sourceRoot":"","sources":["../../src/abstract-sheet-exporters/_style.ts"],"names":[],"mappings":";;;AAEA,SAAgB,WAAW,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E,CAAC;YAClC,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACrC,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC/B,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;QAClC,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACrC,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IACrC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AA9GD,kCA8GC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as XLSX from "xlsx-js-style";
|
|
2
|
-
import {
|
|
3
|
-
export declare function xlsxWorkSheet(
|
|
4
|
-
export declare function createStyle(style: Style): any;
|
|
2
|
+
import { Sheet } from "../abstract-sheet/abstract-sheet";
|
|
3
|
+
export declare function xlsxWorkSheet(sheet: Sheet, styles: Record<string, any>): XLSX.WorkSheet;
|
|
5
4
|
//# sourceMappingURL=_xlsx-sheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_xlsx-sheet.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet-exporters/_xlsx-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"_xlsx-sheet.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet-exporters/_xlsx-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAY,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEnE,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CA+BvF"}
|
|
@@ -23,14 +23,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.xlsxWorkSheet = void 0;
|
|
27
27
|
const XLSX = __importStar(require("xlsx-js-style"));
|
|
28
|
-
function xlsxWorkSheet(
|
|
28
|
+
function xlsxWorkSheet(sheet, styles) {
|
|
29
29
|
var _a, _b;
|
|
30
30
|
let colMax = -1;
|
|
31
31
|
const cells = {};
|
|
32
|
-
for (let ri = 0; ri <
|
|
33
|
-
const r =
|
|
32
|
+
for (let ri = 0; ri < sheet.cells.length; ri++) {
|
|
33
|
+
const r = sheet.cells[ri];
|
|
34
34
|
colMax = Math.max(r.length, colMax);
|
|
35
35
|
for (let ci = 0; ci < r.length; ci++) {
|
|
36
36
|
const c = r[ci];
|
|
@@ -40,16 +40,23 @@ function xlsxWorkSheet(s, styles) {
|
|
|
40
40
|
s = Object.assign(Object.assign({}, s), styles[style]);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
const key = sheet.direction === "col" ? `${XLSX.utils.encode_col(ri)}${ci + 1}` : `${XLSX.utils.encode_col(ci)}${ri + 1}`;
|
|
44
|
+
cells[key] = { v: c.value, t: cellObject(c.type), s };
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
return Object.assign({ "!type": "sheet", "!ref": `A1:${
|
|
47
|
+
return Object.assign({ "!type": "sheet", "!ref": `A1:${sheet.direction === "col"
|
|
48
|
+
? `${XLSX.utils.encode_col(sheet.cells.length)}${colMax}`
|
|
49
|
+
: `${XLSX.utils.encode_col(colMax)}${sheet.cells.length}`}`, "!cols": (_a = sheet.colInfo) === null || _a === void 0 ? void 0 : _a.map((i) => { var _a; return ({ wpx: (_a = i.widthPixels) !== null && _a !== void 0 ? _a : 64, hidden: i.hidden }); }), "!rows": (_b = sheet.rowInfo) === null || _b === void 0 ? void 0 : _b.map((i) => { var _a; return ({ hpx: (_a = i.heightPixels) !== null && _a !== void 0 ? _a : 15, hidden: i.hidden }); }) }, cells);
|
|
47
50
|
}
|
|
48
51
|
exports.xlsxWorkSheet = xlsxWorkSheet;
|
|
49
|
-
const
|
|
52
|
+
const cellObject = (colType) => {
|
|
50
53
|
switch (colType) {
|
|
51
54
|
case "number":
|
|
52
55
|
return "n";
|
|
56
|
+
case "boolean":
|
|
57
|
+
return "b";
|
|
58
|
+
case "date":
|
|
59
|
+
return "d";
|
|
53
60
|
case undefined:
|
|
54
61
|
case "string":
|
|
55
62
|
return "s";
|
|
@@ -59,113 +66,4 @@ const columnType = (colType) => {
|
|
|
59
66
|
}
|
|
60
67
|
};
|
|
61
68
|
const exhaustiveCheck = (check) => check;
|
|
62
|
-
function createStyle(style) {
|
|
63
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
64
|
-
let s = {};
|
|
65
|
-
if (style.vertical || style.horizontal || style.wrapText !== undefined || style.textRotation !== undefined) {
|
|
66
|
-
s.alignment = {};
|
|
67
|
-
if (style.vertical) {
|
|
68
|
-
s.alignment.vertical = style.vertical;
|
|
69
|
-
}
|
|
70
|
-
if (style.horizontal) {
|
|
71
|
-
s.alignment.horizontal = style.horizontal;
|
|
72
|
-
}
|
|
73
|
-
if (style.wrapText !== undefined) {
|
|
74
|
-
s.alignment.wrapText = style.wrapText;
|
|
75
|
-
}
|
|
76
|
-
if (style.textRotation !== undefined) {
|
|
77
|
-
s.alignment.textRotation = style.textRotation;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (style.fillType || style.foreground || style.background) {
|
|
81
|
-
s.fill = {};
|
|
82
|
-
if (style.fillType) {
|
|
83
|
-
s.fill.patternType = style.fillType;
|
|
84
|
-
}
|
|
85
|
-
if (style.foreground) {
|
|
86
|
-
s.fill.fgColor = { rgb: style.foreground };
|
|
87
|
-
}
|
|
88
|
-
if (style.background) {
|
|
89
|
-
s.fill.bgColor = { rgb: style.background };
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (style.borderStyle || style.borderColor) {
|
|
93
|
-
s.border = {};
|
|
94
|
-
if (((_a = style.borderStyle) === null || _a === void 0 ? void 0 : _a.top) || ((_b = style.borderColor) === null || _b === void 0 ? void 0 : _b.top)) {
|
|
95
|
-
s.border.top = {};
|
|
96
|
-
}
|
|
97
|
-
if ((_c = style.borderStyle) === null || _c === void 0 ? void 0 : _c.top) {
|
|
98
|
-
s.border.top.style = style.borderStyle.top;
|
|
99
|
-
}
|
|
100
|
-
if ((_d = style.borderColor) === null || _d === void 0 ? void 0 : _d.top) {
|
|
101
|
-
s.border.top.color = { rgb: style.borderColor.top };
|
|
102
|
-
}
|
|
103
|
-
if (((_e = style.borderStyle) === null || _e === void 0 ? void 0 : _e.right) || ((_f = style.borderColor) === null || _f === void 0 ? void 0 : _f.right)) {
|
|
104
|
-
s.border.right = {};
|
|
105
|
-
}
|
|
106
|
-
if ((_g = style.borderStyle) === null || _g === void 0 ? void 0 : _g.right) {
|
|
107
|
-
s.border.right.style = style.borderStyle.right;
|
|
108
|
-
}
|
|
109
|
-
if ((_h = style.borderColor) === null || _h === void 0 ? void 0 : _h.right) {
|
|
110
|
-
s.border.right.color = { rgb: style.borderColor.right };
|
|
111
|
-
}
|
|
112
|
-
if (((_j = style.borderStyle) === null || _j === void 0 ? void 0 : _j.bottom) || ((_k = style.borderColor) === null || _k === void 0 ? void 0 : _k.bottom)) {
|
|
113
|
-
s.border.bottom = {};
|
|
114
|
-
}
|
|
115
|
-
if ((_l = style.borderStyle) === null || _l === void 0 ? void 0 : _l.bottom) {
|
|
116
|
-
s.border.bottom.style = style.borderStyle.bottom;
|
|
117
|
-
}
|
|
118
|
-
if ((_m = style.borderColor) === null || _m === void 0 ? void 0 : _m.bottom) {
|
|
119
|
-
s.border.bottom.color = { rgb: style.borderColor.bottom };
|
|
120
|
-
}
|
|
121
|
-
if (((_o = style.borderStyle) === null || _o === void 0 ? void 0 : _o.left) || ((_p = style.borderColor) === null || _p === void 0 ? void 0 : _p.left)) {
|
|
122
|
-
s.border.left = {};
|
|
123
|
-
}
|
|
124
|
-
if ((_q = style.borderStyle) === null || _q === void 0 ? void 0 : _q.left) {
|
|
125
|
-
s.border.left.style = style.borderStyle.left;
|
|
126
|
-
}
|
|
127
|
-
if ((_r = style.borderColor) === null || _r === void 0 ? void 0 : _r.left) {
|
|
128
|
-
s.border.left.color = { rgb: style.borderColor.left };
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (style.bold !== undefined ||
|
|
132
|
-
style.color ||
|
|
133
|
-
style.italic !== undefined ||
|
|
134
|
-
style.font ||
|
|
135
|
-
style.strike !== undefined ||
|
|
136
|
-
style.size !== undefined ||
|
|
137
|
-
style.underline !== undefined ||
|
|
138
|
-
style.script) {
|
|
139
|
-
s.font = {};
|
|
140
|
-
if (style.bold !== undefined) {
|
|
141
|
-
s.font.bold = style.bold;
|
|
142
|
-
}
|
|
143
|
-
if (style.color) {
|
|
144
|
-
s.font.color = { rgb: style.color };
|
|
145
|
-
}
|
|
146
|
-
if (style.italic !== undefined) {
|
|
147
|
-
s.font.italic = style.italic;
|
|
148
|
-
}
|
|
149
|
-
if (style.font) {
|
|
150
|
-
s.font.name = style.font;
|
|
151
|
-
}
|
|
152
|
-
if (style.strike !== undefined) {
|
|
153
|
-
s.font.strike = style.strike;
|
|
154
|
-
}
|
|
155
|
-
if (style.size !== undefined) {
|
|
156
|
-
s.font.sz = style.size;
|
|
157
|
-
}
|
|
158
|
-
if (style.underline !== undefined) {
|
|
159
|
-
s.font.underline = style.underline;
|
|
160
|
-
}
|
|
161
|
-
if (style.script !== undefined) {
|
|
162
|
-
s.font.vertAlign = style.script;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (style.numberFormat !== undefined) {
|
|
166
|
-
s.font.numFmt = style.numberFormat;
|
|
167
|
-
}
|
|
168
|
-
return s;
|
|
169
|
-
}
|
|
170
|
-
exports.createStyle = createStyle;
|
|
171
69
|
//# sourceMappingURL=_xlsx-sheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_xlsx-sheet.js","sourceRoot":"","sources":["../../src/abstract-sheet-exporters/_xlsx-sheet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAGtC,SAAgB,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"_xlsx-sheet.js","sourceRoot":"","sources":["../../src/abstract-sheet-exporters/_xlsx-sheet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAGtC,SAAgB,aAAa,CAAC,KAAY,EAAE,MAA2B;;IACrE,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC;IAChB,MAAM,KAAK,GAAoC,EAAE,CAAC;IAClD,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;QAC/C,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,CAAE,CAAC;QAC3B,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;YACrC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAE,CAAC;YACjB,IAAI,CAAC,GAAuB,SAAS,CAAC;YACtC,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBAC3B,KAAK,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;oBAC7B,CAAC,mCAAQ,CAAE,GAAK,MAAM,CAAC,KAAK,CAAC,CAAE,CAAC;gBAClC,CAAC;YACH,CAAC;YACD,M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D,sCA+BC;AAED,MAAM,UAAU,GAAG,CAAC,OAA6B,EAAwB,EAAE;IACzE,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,GAAG,CAAC;QACb,KAAK,MAAM;YACT,OAAO,GAAG,CAAC;QACb,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;QACb;YACE,eAAe,CAAC,OAAO,CAAC,CAAC;YACzB,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAY,EAAS,EAAE,CAAC,KAAK,CAAC"}
|
|
@@ -3,7 +3,7 @@ export type CsvFile = {
|
|
|
3
3
|
readonly name: string;
|
|
4
4
|
readonly csv: string;
|
|
5
5
|
};
|
|
6
|
-
export declare function toCsv(
|
|
6
|
+
export declare function toCsv(abstractSheets: ReadonlyArray<AbstractSheet>, options?: {
|
|
7
7
|
readonly separator?: string;
|
|
8
8
|
readonly rowSeparator?: string;
|
|
9
9
|
readonly noTrailingSeparator?: boolean;
|
|
@@ -12,5 +12,5 @@ export declare function toCsv(as: AbstractSheet, options?: {
|
|
|
12
12
|
readonly forceQuotes?: boolean;
|
|
13
13
|
readonly rawNumber?: boolean;
|
|
14
14
|
readonly dateFormat?: string;
|
|
15
|
-
}): ReadonlyArray<CsvFile
|
|
15
|
+
}): ReadonlyArray<ReadonlyArray<CsvFile>>;
|
|
16
16
|
//# sourceMappingURL=csv.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet-exporters/csv.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/abstract-sheet-exporters/csv.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAIjE,MAAM,MAAM,OAAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,wBAAgB,KAAK,CACnB,cAAc,EAAE,aAAa,CAAC,aAAa,CAAC,EAC5C,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,GACA,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAoBvC"}
|