microsoft-graph 2.31.1 → 2.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/models/Cell.d.ts +24 -33
- package/dist/cjs/models/Cell.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFormat.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js +1 -0
- package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.js +1 -5
- package/dist/cjs/services/cell.d.ts +12 -0
- package/dist/cjs/services/cell.d.ts.map +1 -0
- package/dist/cjs/services/cell.js +25 -0
- package/dist/cjs/services/dataSource.js +7 -9
- package/dist/cjs/services/stringCaseConversion.d.ts +6 -0
- package/dist/cjs/services/stringCaseConversion.d.ts.map +1 -1
- package/dist/cjs/services/stringCaseConversion.js +12 -0
- package/dist/cjs/tasks/iterateRows.d.ts +0 -1
- package/dist/cjs/tasks/iterateRows.d.ts.map +1 -1
- package/dist/cjs/tasks/iterateRows.js +59 -39
- package/dist/cjs/tasks/iterateWorkbookRange.d.ts.map +1 -1
- package/dist/cjs/tasks/iterateWorkbookRange.js +5 -7
- package/dist/cjs/tasks/readFirstRow.d.ts +18 -0
- package/dist/cjs/tasks/readFirstRow.d.ts.map +1 -0
- package/dist/cjs/tasks/readFirstRow.js +31 -0
- package/dist/cjs/tasks/readRows.d.ts +20 -0
- package/dist/cjs/tasks/readRows.d.ts.map +1 -0
- package/dist/cjs/tasks/readRows.js +28 -0
- package/dist/cjs/tasks/readWorkbookRows.d.ts.map +1 -1
- package/dist/cjs/tasks/readWorkbookRows.js +5 -8
- package/dist/cjs/tasks/updateFirstRow.d.ts +26 -0
- package/dist/cjs/tasks/updateFirstRow.d.ts.map +1 -0
- package/dist/cjs/tasks/updateFirstRow.js +33 -0
- package/dist/cjs/tasks/updateRows.d.ts +26 -0
- package/dist/cjs/tasks/updateRows.d.ts.map +1 -0
- package/dist/cjs/tasks/updateRows.js +255 -0
- package/dist/cjs/tasks/writeWorkbookRows.js +4 -4
- package/dist/esm/models/Cell.d.ts +24 -33
- package/dist/esm/models/Cell.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFormat.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFormat.js +1 -0
- package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.js +1 -5
- package/dist/esm/services/cell.d.ts +12 -0
- package/dist/esm/services/cell.d.ts.map +1 -0
- package/dist/esm/services/cell.js +22 -0
- package/dist/esm/services/dataSource.js +6 -8
- package/dist/esm/services/stringCaseConversion.d.ts +6 -0
- package/dist/esm/services/stringCaseConversion.d.ts.map +1 -1
- package/dist/esm/services/stringCaseConversion.js +11 -0
- package/dist/esm/tasks/iterateRows.d.ts +0 -1
- package/dist/esm/tasks/iterateRows.d.ts.map +1 -1
- package/dist/esm/tasks/iterateRows.js +59 -39
- package/dist/esm/tasks/iterateWorkbookRange.d.ts.map +1 -1
- package/dist/esm/tasks/iterateWorkbookRange.js +5 -7
- package/dist/esm/tasks/readFirstRow.d.ts +18 -0
- package/dist/esm/tasks/readFirstRow.d.ts.map +1 -0
- package/dist/esm/tasks/readFirstRow.js +25 -0
- package/dist/esm/tasks/readRows.d.ts +20 -0
- package/dist/esm/tasks/readRows.d.ts.map +1 -0
- package/dist/esm/tasks/readRows.js +25 -0
- package/dist/esm/tasks/readWorkbookRows.d.ts.map +1 -1
- package/dist/esm/tasks/readWorkbookRows.js +5 -8
- package/dist/esm/tasks/updateFirstRow.d.ts +26 -0
- package/dist/esm/tasks/updateFirstRow.d.ts.map +1 -0
- package/dist/esm/tasks/updateFirstRow.js +27 -0
- package/dist/esm/tasks/updateRows.d.ts +26 -0
- package/dist/esm/tasks/updateRows.d.ts.map +1 -0
- package/dist/esm/tasks/updateRows.js +249 -0
- package/dist/esm/tasks/writeWorkbookRows.js +4 -4
- package/docs/api/Cell.md +39 -55
- package/docs/api/CellFormat.md +8 -32
- package/docs/api/README.md +5 -1
- package/docs/api/getWorkbookRangeFormat.md +1 -1
- package/docs/api/getWorkbookWorksheetRange.md +1 -1
- package/docs/api/iterateRows.md +7 -11
- package/docs/api/readFirstRow.md +40 -0
- package/docs/api/readRows.md +40 -0
- package/docs/api/readWorkbookRows.md +1 -1
- package/docs/api/stringCaseConversion.md +22 -0
- package/docs/api/updateFirstRow.md +45 -0
- package/docs/api/updateRows.md +51 -0
- package/package.json +121 -21
- package/dist/cjs/services/cellFormat.d.ts +0 -15
- package/dist/cjs/services/cellFormat.d.ts.map +0 -1
- package/dist/cjs/services/cellFormat.js +0 -16
- package/dist/esm/services/cellFormat.d.ts +0 -15
- package/dist/esm/services/cellFormat.d.ts.map +0 -1
- package/dist/esm/services/cellFormat.js +0 -13
|
@@ -24,32 +24,6 @@ export type Cell = {
|
|
|
24
24
|
* Formatting that is applied to the value to derive the text representation.
|
|
25
25
|
*/
|
|
26
26
|
format: CellFormat;
|
|
27
|
-
/**
|
|
28
|
-
* Style applied to the cell to affect its appearance, like color, borders, alignment, etc.
|
|
29
|
-
*/
|
|
30
|
-
style: CellStyle;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* CellValue represents the value of a cell in a spreadsheet.
|
|
34
|
-
* @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
|
|
35
|
-
*/
|
|
36
|
-
export type CellValue = string | number | boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Text content of a cell in a worksheet.
|
|
39
|
-
* @remarks This is a string that represents the text displayed in the cell, which may differ from the actual value of the cell (e.g., due to formatting).
|
|
40
|
-
*/
|
|
41
|
-
export type CellText = string;
|
|
42
|
-
/**
|
|
43
|
-
* Format to be applied to a cell value to convert it to text to display to the user.
|
|
44
|
-
* @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
|
|
45
|
-
*/
|
|
46
|
-
export type CellFormat = string & {
|
|
47
|
-
__brand: "CellFormat";
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Style applied to the cell to affect its appearance, like color, borders, alignment, etc.
|
|
51
|
-
*/
|
|
52
|
-
export type CellStyle = {
|
|
53
27
|
/**
|
|
54
28
|
* Number of cell merges (WRITE ONLY).
|
|
55
29
|
* @remarks Due to API limitations, this value is never populated when reading a cell, but it can be set when writing a cell.
|
|
@@ -73,10 +47,10 @@ export type CellStyle = {
|
|
|
73
47
|
* @experimental
|
|
74
48
|
*/
|
|
75
49
|
borders: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
50
|
+
edgeTop?: Border | undefined;
|
|
51
|
+
edgeBottom?: Border | undefined;
|
|
52
|
+
edgeLeft?: Border | undefined;
|
|
53
|
+
edgeRight?: Border | undefined;
|
|
80
54
|
insideVertical?: Border | undefined;
|
|
81
55
|
insideHorizontal?: Border | undefined;
|
|
82
56
|
diagonalDown?: Border | undefined;
|
|
@@ -102,15 +76,32 @@ export type CellStyle = {
|
|
|
102
76
|
underline?: CellUnderline;
|
|
103
77
|
};
|
|
104
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* CellValue represents the value of a cell in a spreadsheet.
|
|
81
|
+
* @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
|
|
82
|
+
*/
|
|
83
|
+
export type CellValue = string | number | boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Text content of a cell in a worksheet.
|
|
86
|
+
* @remarks This is a string that represents the text displayed in the cell, which may differ from the actual value of the cell (e.g., due to formatting).
|
|
87
|
+
*/
|
|
88
|
+
export type CellText = string;
|
|
89
|
+
/**
|
|
90
|
+
* Format to be applied to a cell value to convert it to text to display to the user.
|
|
91
|
+
* @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
|
|
92
|
+
*/
|
|
93
|
+
export type CellFormat = string & {
|
|
94
|
+
__brand: "CellFormat";
|
|
95
|
+
};
|
|
105
96
|
/**
|
|
106
97
|
* The amount of detail that we're reading from a cell.
|
|
107
98
|
*/
|
|
108
99
|
export type CellScope = {
|
|
109
|
-
/** Raw cell value. CHEAP (
|
|
100
|
+
/** Raw cell value. CHEAP (+1 op per 10K cells, no additional op with `text` or `format`) */
|
|
110
101
|
values: boolean;
|
|
111
|
-
/** Formatted value, as presented to the user. CHEAP (
|
|
102
|
+
/** Formatted value, as presented to the user. CHEAP (+1 op per 10K cells, no additional call op `values` or `format`) */
|
|
112
103
|
text: boolean;
|
|
113
|
-
/** Logic used to format values to text. CHEAP (
|
|
104
|
+
/** Logic used to format values to text. CHEAP (+1 op per 10K cells, no additional call op `values` or `text`) */
|
|
114
105
|
format: boolean;
|
|
115
106
|
/** Content position with the cell. VERY EXPENSIVE (+1 op per cell) */
|
|
116
107
|
alignment: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../../src/models/Cell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,IAAI,GAAG;IAClB;;;OAGG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;IAEnB
|
|
1
|
+
{"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../../src/models/Cell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,IAAI,GAAG;IAClB;;;OAGG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;IAEnB;;;;OAIG;IACH,KAAK,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IAEF;;;OAGG;IACH,SAAS,EAAE;QACV,UAAU,CAAC,EAAE,uBAAuB,CAAC;QACrC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;QACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAC/B,CAAC;IAEF;;;OAGG;IACH,OAAO,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACpC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACtC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAClC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAChC,CAAC;IAEF;;;OAGG;IACH,IAAI,EAAE;QACL,KAAK,CAAC,EAAE,KAAK,CAAC;KACd,CAAC;IACF;;;OAGG;IACH,IAAI,EAAE;QACL,IAAI,CAAC,EAAE,QAAQ,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,SAAS,CAAC,EAAE,aAAa,CAAC;KAC1B,CAAC;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IACjC,OAAO,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,4FAA4F;IAC5F,MAAM,EAAE,OAAO,CAAC;IAEhB,yHAAyH;IACzH,IAAI,EAAE,OAAO,CAAC;IAEd,iHAAiH;IACjH,MAAM,EAAE,OAAO,CAAC;IAEhB,sEAAsE;IACtE,SAAS,EAAE,OAAO,CAAC;IAEnB,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;IAEjB,8DAA8D;IAC9D,IAAI,EAAE,OAAO,CAAC;IAEd,kDAAkD;IAClD,IAAI,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,uBAAuB,GAAG,aAAa,CAAC;AAE7I,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,CAAC;AAE5F,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,kBAAkB,GAAG,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFormat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFormat.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAmBjI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CA2BrM"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
* Fetch a range.
|
|
4
|
-
* @module getWorkbookWorksheetRange
|
|
5
|
-
* @category Operations
|
|
6
|
-
*/
|
|
2
|
+
// TODO: Rename to getWorkbookRangeValueTextFormat
|
|
7
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
4
|
exports.default = getWorkbookWorksheetRange;
|
|
9
5
|
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cell utilities.
|
|
3
|
+
* @module CellFormat
|
|
4
|
+
* @category Services
|
|
5
|
+
*/
|
|
6
|
+
import type { CellFormat, CellScope } from "../models/Cell.ts";
|
|
7
|
+
export declare const generalCellFormat: CellFormat;
|
|
8
|
+
export declare const textCellFormat: CellFormat;
|
|
9
|
+
export declare const numberCellFormat: CellFormat;
|
|
10
|
+
export declare const accountingCellFormat: CellFormat;
|
|
11
|
+
export declare const defaultCellScope: CellScope;
|
|
12
|
+
//# sourceMappingURL=cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../../src/services/cell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE/D,eAAO,MAAM,iBAAiB,EAAgB,UAAU,CAAC;AACzD,eAAO,MAAM,cAAc,EAAU,UAAU,CAAC;AAChD,eAAO,MAAM,gBAAgB,EAAiB,UAAU,CAAC;AACzD,eAAO,MAAM,oBAAoB,EAA2D,UAAU,CAAC;AAMvG,eAAO,MAAM,gBAAgB,EAAE,SAQ9B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cell utilities.
|
|
4
|
+
* @module CellFormat
|
|
5
|
+
* @category Services
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.defaultCellScope = exports.accountingCellFormat = exports.numberCellFormat = exports.textCellFormat = exports.generalCellFormat = void 0;
|
|
9
|
+
exports.generalCellFormat = "General";
|
|
10
|
+
exports.textCellFormat = "@";
|
|
11
|
+
exports.numberCellFormat = "#,##0.00";
|
|
12
|
+
exports.accountingCellFormat = '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)';
|
|
13
|
+
// export const currencyCellFormat = "$#,##0.00" as CellFormat;
|
|
14
|
+
// export const percentageCellFormat = "0.00%" as CellFormat;
|
|
15
|
+
// export const dateShortCellFormat = "dd/mm/yyyy" as CellFormat;
|
|
16
|
+
// export const timeCellFormat = "h:mm:ss AM/PM" as CellFormat;
|
|
17
|
+
exports.defaultCellScope = {
|
|
18
|
+
values: true,
|
|
19
|
+
text: true,
|
|
20
|
+
format: true,
|
|
21
|
+
alignment: false,
|
|
22
|
+
borders: false,
|
|
23
|
+
fill: false,
|
|
24
|
+
font: false,
|
|
25
|
+
};
|
|
@@ -25,7 +25,7 @@ const getWorkbookWorksheetUsedRangeRef_ts_1 = __importDefault(require("../operat
|
|
|
25
25
|
const readWorkbookRows_ts_1 = __importDefault(require("../tasks/readWorkbookRows.js"));
|
|
26
26
|
const addressManipulation_ts_1 = require("./addressManipulation.js");
|
|
27
27
|
const cartesianAddress_ts_1 = require("./cartesianAddress.js");
|
|
28
|
-
const
|
|
28
|
+
const cell_ts_1 = require("./cell.js");
|
|
29
29
|
/**
|
|
30
30
|
* Define a datasource from an entire worksheet.
|
|
31
31
|
* @template T Type of the record, extending RecordBase.
|
|
@@ -173,14 +173,12 @@ function recordToRow(record, source) {
|
|
|
173
173
|
return {
|
|
174
174
|
value: cell.value ?? "",
|
|
175
175
|
text: cell.text ?? (cell.value ?? "").toString(),
|
|
176
|
-
format: cell.format ??
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
font: {},
|
|
183
|
-
},
|
|
176
|
+
format: cell.format ?? cell_ts_1.generalCellFormat,
|
|
177
|
+
merge: {},
|
|
178
|
+
alignment: {},
|
|
179
|
+
borders: {},
|
|
180
|
+
fill: {},
|
|
181
|
+
font: {},
|
|
184
182
|
};
|
|
185
183
|
});
|
|
186
184
|
return row;
|
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
* @returns The camelCase string.
|
|
10
10
|
*/
|
|
11
11
|
export declare function kebabToCamelCase(str: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Converts a camelCase string to PascalCase.
|
|
14
|
+
* @param str - The camelCase string.
|
|
15
|
+
* @returns The PascalCase string.
|
|
16
|
+
*/
|
|
17
|
+
export declare function camelCaseToPascalCase(str: string): string;
|
|
12
18
|
//# sourceMappingURL=stringCaseConversion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringCaseConversion.d.ts","sourceRoot":"","sources":["../../../src/services/stringCaseConversion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIpD"}
|
|
1
|
+
{"version":3,"file":"stringCaseConversion.d.ts","sourceRoot":"","sources":["../../../src/services/stringCaseConversion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKzD"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.kebabToCamelCase = kebabToCamelCase;
|
|
9
|
+
exports.camelCaseToPascalCase = camelCaseToPascalCase;
|
|
9
10
|
/**
|
|
10
11
|
* Converts a kebab-case string to camelCase.
|
|
11
12
|
* @param str - The kebab-case string.
|
|
@@ -16,3 +17,14 @@ function kebabToCamelCase(str) {
|
|
|
16
17
|
.replace(/^-+|-+$/g, "") // Remove leading and trailing dashes
|
|
17
18
|
.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
18
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Converts a camelCase string to PascalCase.
|
|
22
|
+
* @param str - The camelCase string.
|
|
23
|
+
* @returns The PascalCase string.
|
|
24
|
+
*/
|
|
25
|
+
function camelCaseToPascalCase(str) {
|
|
26
|
+
if (!str) {
|
|
27
|
+
return str;
|
|
28
|
+
}
|
|
29
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
30
|
+
}
|
|
@@ -25,7 +25,6 @@ export type IteratedRow = {
|
|
|
25
25
|
* @param rangeRef Reference to the workbook range to iterate over.
|
|
26
26
|
* @param scope Amount of detail to include for each cell.
|
|
27
27
|
* @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
|
|
28
|
-
* @remarks Including `style` in the scope requires over three operations for each and every cell. Use this sparingly!
|
|
29
28
|
* @experimental
|
|
30
29
|
* @example
|
|
31
30
|
* for await (const { row } of iterateRows(rangeRef)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterateRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateRows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAuC,SAAS,
|
|
1
|
+
{"version":3,"file":"iterateRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateRows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAuC,SAAS,EAA6D,MAAM,mBAAmB,CAAC;AAIzJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAUnE;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAuB,WAAW,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,GAAE,OAAO,CAAC,SAAS,CAAoB,EAAE,oBAAoB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,WAAW,CAAC,CAgDnL"}
|
|
@@ -18,20 +18,19 @@ const getWorkbookWorksheetRange_ts_1 = __importDefault(require("../operations/wo
|
|
|
18
18
|
const listWorkbookRangeBorders_ts_1 = __importDefault(require("../operations/workbookRange/listWorkbookRangeBorders.js"));
|
|
19
19
|
const addressManipulation_ts_1 = require("../services/addressManipulation.js");
|
|
20
20
|
const batch_ts_1 = require("../services/batch.js");
|
|
21
|
-
const
|
|
21
|
+
const cell_ts_1 = require("../services/cell.js");
|
|
22
22
|
/**
|
|
23
23
|
* Iterate over the rows in a given worksheet range.
|
|
24
24
|
* @param rangeRef Reference to the workbook range to iterate over.
|
|
25
25
|
* @param scope Amount of detail to include for each cell.
|
|
26
26
|
* @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
|
|
27
|
-
* @remarks Including `style` in the scope requires over three operations for each and every cell. Use this sparingly!
|
|
28
27
|
* @experimental
|
|
29
28
|
* @example
|
|
30
29
|
* for await (const { row } of iterateRows(rangeRef)) {
|
|
31
30
|
* console.log(row);
|
|
32
31
|
* }
|
|
33
32
|
*/
|
|
34
|
-
async function* iterateRows(rangeRef, scope =
|
|
33
|
+
async function* iterateRows(rangeRef, scope = cell_ts_1.defaultCellScope, maxCellsPerOperation = null) {
|
|
35
34
|
const totalColumnCount = (0, addressManipulation_ts_1.countAddressColumns)(rangeRef.address);
|
|
36
35
|
const totalRowCount = (0, addressManipulation_ts_1.countAddressRows)(rangeRef.address);
|
|
37
36
|
const maxRowsPerOperation = calculateMaxRowsPerOperation(totalColumnCount, maxCellsPerOperation);
|
|
@@ -46,12 +45,20 @@ async function* iterateRows(rangeRef, scope = defaultScope, maxCellsPerOperation
|
|
|
46
45
|
const value = (range?.values?.[operationRowOffset]?.[columnOffset] ?? ""); // The root of these is undefined if that detail isn't in scope
|
|
47
46
|
const text = (range?.text?.[operationRowOffset]?.[columnOffset] ?? "");
|
|
48
47
|
const format = (range?.numberFormat?.[operationRowOffset]?.[columnOffset] ?? "");
|
|
49
|
-
const
|
|
48
|
+
const merge = {}; // No API available to retrieve merge information
|
|
49
|
+
const alignment = await getAlignment(rangeRef, scope);
|
|
50
|
+
const borders = await getBorders(rangeRef, scope);
|
|
51
|
+
const fill = await getFill(rangeRef, scope);
|
|
52
|
+
const font = await getFont(rangeRef, scope);
|
|
50
53
|
cells.push({
|
|
51
54
|
value,
|
|
52
55
|
text,
|
|
53
56
|
format,
|
|
54
|
-
|
|
57
|
+
merge,
|
|
58
|
+
alignment,
|
|
59
|
+
borders,
|
|
60
|
+
fill,
|
|
61
|
+
font,
|
|
55
62
|
});
|
|
56
63
|
}
|
|
57
64
|
const offset = (operationRowStart + operationRowOffset);
|
|
@@ -66,41 +73,43 @@ async function* iterateRows(rangeRef, scope = defaultScope, maxCellsPerOperation
|
|
|
66
73
|
}
|
|
67
74
|
}
|
|
68
75
|
}
|
|
69
|
-
async function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
76
|
+
async function getFont(rangeRef, scope) {
|
|
77
|
+
if (!scope.font) {
|
|
78
|
+
return {};
|
|
79
|
+
}
|
|
80
|
+
const response = await (0, getWorkbookRangeFont_ts_1.default)(rangeRef);
|
|
74
81
|
return {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
82
|
+
name: response?.name,
|
|
83
|
+
size: response?.size,
|
|
84
|
+
color: response?.color,
|
|
85
|
+
bold: response?.bold,
|
|
86
|
+
italic: response?.italic,
|
|
87
|
+
underline: response?.underline,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
async function getFill(rangeRef, scope) {
|
|
91
|
+
if (!scope.fill) {
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
const response = await (0, getWorkbookRangeFill_ts_1.default)(rangeRef);
|
|
95
|
+
return {
|
|
96
|
+
color: response?.color,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
async function getBorders(rangeRef, scope) {
|
|
100
|
+
if (!scope.borders) {
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
const response = await (0, listWorkbookRangeBorders_ts_1.default)(rangeRef);
|
|
104
|
+
return {
|
|
105
|
+
edgeTop: extractBorderStyle(response, "EdgeTop"),
|
|
106
|
+
edgeBottom: extractBorderStyle(response, "EdgeBottom"),
|
|
107
|
+
edgeLeft: extractBorderStyle(response, "EdgeLeft"),
|
|
108
|
+
edgeRight: extractBorderStyle(response, "EdgeRight"),
|
|
109
|
+
insideVertical: extractBorderStyle(response, "InsideVertical"),
|
|
110
|
+
insideHorizontal: extractBorderStyle(response, "InsideHorizontal"),
|
|
111
|
+
diagonalDown: extractBorderStyle(response, "DiagonalDown"),
|
|
112
|
+
diagonalUp: extractBorderStyle(response, "DiagonalUp"),
|
|
104
113
|
};
|
|
105
114
|
function extractBorderStyle(borders, side) {
|
|
106
115
|
if (!borders) {
|
|
@@ -117,6 +126,17 @@ async function getStyle(rangeRef, scope) {
|
|
|
117
126
|
};
|
|
118
127
|
}
|
|
119
128
|
}
|
|
129
|
+
async function getAlignment(rangeRef, scope) {
|
|
130
|
+
if (!scope.alignment) {
|
|
131
|
+
return {};
|
|
132
|
+
}
|
|
133
|
+
const response = await (0, getWorkbookRangeFormat_ts_1.default)(rangeRef);
|
|
134
|
+
return {
|
|
135
|
+
vertical: response?.verticalAlignment,
|
|
136
|
+
horizontal: response?.horizontalAlignment,
|
|
137
|
+
wrapText: response?.wrapText ?? undefined,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
120
140
|
function calculateMaxRowsPerOperation(columnCount, overwriteMaxCellsPerOperation) {
|
|
121
141
|
const maxCellsPerOperation = overwriteMaxCellsPerOperation ?? batch_ts_1.maxCellsPerRequest;
|
|
122
142
|
const maxRowsPerOperation = Math.floor(maxCellsPerOperation / columnCount);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAOnE;;;;;;;;GAQG;AACH,wBAA+B,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,uBAAuB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"iterateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAOnE;;;;;;;;GAQG;AACH,wBAA+B,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,uBAAuB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CAAC,CA+DhL"}
|
|
@@ -58,13 +58,11 @@ async function* iterateWorkbookRange(rangeRef, overwriteRowsPerRequest = null) {
|
|
|
58
58
|
text: text[r]?.[c] ?? "",
|
|
59
59
|
value: values[r]?.[c] ?? "",
|
|
60
60
|
format: format?.[r]?.[c] ?? "",
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
font: {},
|
|
67
|
-
},
|
|
61
|
+
merge: {},
|
|
62
|
+
alignment: {},
|
|
63
|
+
borders: {},
|
|
64
|
+
fill: {},
|
|
65
|
+
font: {},
|
|
68
66
|
}));
|
|
69
67
|
yield {
|
|
70
68
|
rowOffset: offset,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the first row from a given workbook range.
|
|
3
|
+
* @module readFirstRow
|
|
4
|
+
* @category Tasks
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
import type { Cell } from "../models/Cell.ts";
|
|
8
|
+
import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
|
|
9
|
+
/** * Read the first row from a given workbook range.
|
|
10
|
+
* @param rangeRef Reference to the workbook range to read.
|
|
11
|
+
* @param scope Amount of detail to include for each cell.
|
|
12
|
+
* @returns A promise that resolves to an array of cells in the first row.
|
|
13
|
+
* @remarks Particularly useful for reading header rows.
|
|
14
|
+
* @example
|
|
15
|
+
* const firstRow = await readFirstRow(rangeRef);
|
|
16
|
+
*/
|
|
17
|
+
export default function readFirstRow(rangeRef: WorkbookRangeRef, scope?: import("../models/Cell.ts").CellScope): Promise<Cell[]>;
|
|
18
|
+
//# sourceMappingURL=readFirstRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readFirstRow.d.ts","sourceRoot":"","sources":["../../../src/tasks/readFirstRow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE;;;;;;;GAOG;AACH,wBAA8B,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,wCAAmB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAQhH"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Read the first row from a given workbook range.
|
|
4
|
+
* @module readFirstRow
|
|
5
|
+
* @category Tasks
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = readFirstRow;
|
|
13
|
+
const InvalidArgumentError_ts_1 = __importDefault(require("../errors/InvalidArgumentError.js"));
|
|
14
|
+
const addressManipulation_ts_1 = require("../services/addressManipulation.js");
|
|
15
|
+
const cell_ts_1 = require("../services/cell.js");
|
|
16
|
+
const iterateRows_ts_1 = require("./iterateRows.js");
|
|
17
|
+
/** * Read the first row from a given workbook range.
|
|
18
|
+
* @param rangeRef Reference to the workbook range to read.
|
|
19
|
+
* @param scope Amount of detail to include for each cell.
|
|
20
|
+
* @returns A promise that resolves to an array of cells in the first row.
|
|
21
|
+
* @remarks Particularly useful for reading header rows.
|
|
22
|
+
* @example
|
|
23
|
+
* const firstRow = await readFirstRow(rangeRef);
|
|
24
|
+
*/
|
|
25
|
+
async function readFirstRow(rangeRef, scope = cell_ts_1.defaultCellScope) {
|
|
26
|
+
const firstRowRef = (0, addressManipulation_ts_1.subRange)(rangeRef, 0, 1);
|
|
27
|
+
for await (const { cells } of (0, iterateRows_ts_1.iterateRows)(firstRowRef, scope)) {
|
|
28
|
+
return cells;
|
|
29
|
+
}
|
|
30
|
+
throw new InvalidArgumentError_ts_1.default("No rows in the specified range.");
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read all rows from a given workbook range.
|
|
3
|
+
* @module readRows
|
|
4
|
+
* @category Tasks
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
import type { Cell } from "../models/Cell.ts";
|
|
8
|
+
import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
|
|
9
|
+
/**
|
|
10
|
+
* Read all rows from a given workbook range.
|
|
11
|
+
* @param rangeRef Reference to the workbook range to read.
|
|
12
|
+
* @param scope Amount of detail to include for each cell.
|
|
13
|
+
* @returns A promise that resolves to an array of rows, each containing an array of cells.
|
|
14
|
+
* @remarks Where practical, prefer using {@link iterateRows} for more efficient memory usage.
|
|
15
|
+
* @experimental
|
|
16
|
+
* @example
|
|
17
|
+
* const rows = await readRows(rangeRef);
|
|
18
|
+
*/
|
|
19
|
+
export default function readRows(rangeRef: WorkbookRangeRef, scope?: import("../models/Cell.ts").CellScope): Promise<Cell[][]>;
|
|
20
|
+
//# sourceMappingURL=readRows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/readRows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAInE;;;;;;;;;GASG;AACH,wBAA8B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,wCAAmB,GAAG,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAO9G"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Read all rows from a given workbook range.
|
|
4
|
+
* @module readRows
|
|
5
|
+
* @category Tasks
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = readRows;
|
|
10
|
+
const cell_ts_1 = require("../services/cell.js");
|
|
11
|
+
const iterateRows_ts_1 = require("./iterateRows.js");
|
|
12
|
+
/**
|
|
13
|
+
* Read all rows from a given workbook range.
|
|
14
|
+
* @param rangeRef Reference to the workbook range to read.
|
|
15
|
+
* @param scope Amount of detail to include for each cell.
|
|
16
|
+
* @returns A promise that resolves to an array of rows, each containing an array of cells.
|
|
17
|
+
* @remarks Where practical, prefer using {@link iterateRows} for more efficient memory usage.
|
|
18
|
+
* @experimental
|
|
19
|
+
* @example
|
|
20
|
+
* const rows = await readRows(rangeRef);
|
|
21
|
+
*/
|
|
22
|
+
async function readRows(rangeRef, scope = cell_ts_1.defaultCellScope) {
|
|
23
|
+
const rows = [];
|
|
24
|
+
for await (const { cells } of (0, iterateRows_ts_1.iterateRows)(rangeRef, scope)) {
|
|
25
|
+
rows.push(cells);
|
|
26
|
+
}
|
|
27
|
+
return rows;
|
|
28
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readWorkbookRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/readWorkbookRows.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"readWorkbookRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/readWorkbookRows.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAOnE;;;;;;;GAOG;AACH,wBAA+B,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,wBAAwB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAwD9I"}
|
|
@@ -15,13 +15,6 @@ const addressManipulation_ts_1 = require("../services/addressManipulation.js");
|
|
|
15
15
|
const addressOffset_ts_1 = require("../services/addressOffset.js");
|
|
16
16
|
const batch_ts_1 = require("../services/batch.js");
|
|
17
17
|
const workbookRange_ts_1 = require("../services/workbookRange.js");
|
|
18
|
-
const emptyStyle = {
|
|
19
|
-
merge: {},
|
|
20
|
-
alignment: {},
|
|
21
|
-
borders: {},
|
|
22
|
-
fill: {},
|
|
23
|
-
font: {},
|
|
24
|
-
};
|
|
25
18
|
/**
|
|
26
19
|
* Iterates over the rows in a given worksheet range.
|
|
27
20
|
*
|
|
@@ -63,7 +56,11 @@ async function* readWorkbookRows(rangeRef, overwriteMaxRowsPerChunk = null) {
|
|
|
63
56
|
text: text[r]?.[c] ?? "",
|
|
64
57
|
value: values[r]?.[c] ?? "",
|
|
65
58
|
format: numberFormat?.[r]?.[c] ?? "",
|
|
66
|
-
|
|
59
|
+
merge: {},
|
|
60
|
+
alignment: {},
|
|
61
|
+
borders: {},
|
|
62
|
+
fill: {},
|
|
63
|
+
font: {},
|
|
67
64
|
}));
|
|
68
65
|
yield row;
|
|
69
66
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update first row in a given workbook range.
|
|
3
|
+
* @module updateFirstRow
|
|
4
|
+
* @category Tasks
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
import type { Cell } from "../models/Cell.ts";
|
|
8
|
+
import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
|
|
9
|
+
/**
|
|
10
|
+
* Update first row in a given workbook range.
|
|
11
|
+
* @param originRef Reference to the workbook range to update. Only the upper-left cell is used as an origin point.
|
|
12
|
+
* @param cells Array of arrays of cells to update in the specified range.
|
|
13
|
+
* @remarks `undefined` values are left unchanged. Applying styling to cells is slow, use sparingly.
|
|
14
|
+
* @experimental
|
|
15
|
+
* @example
|
|
16
|
+
* // Basic example:
|
|
17
|
+
* await updateFirstRow(rangeRef, [{ value: 1 }, { value: 2 }]);
|
|
18
|
+
*
|
|
19
|
+
* // Advanced example with cell formatting:
|
|
20
|
+
* await updateRows(rangeRef, [
|
|
21
|
+
* { value: "Column A", style: { alignment: { horizontal: "Right" }, font: { bold: true } } },
|
|
22
|
+
* { value: "Column B", style: { alignment: { horizontal: "Right" }, font: { bold: true } } }
|
|
23
|
+
* ]);
|
|
24
|
+
*/
|
|
25
|
+
export default function updateFirstRow(originRef: WorkbookRangeRef, cells: Partial<Cell>[]): Promise<void>;
|
|
26
|
+
//# sourceMappingURL=updateFirstRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateFirstRow.d.ts","sourceRoot":"","sources":["../../../src/tasks/updateFirstRow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE;;;;;;;;;;;;;;;GAeG;AACH,wBAA8B,cAAc,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/G"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Update first row in a given workbook range.
|
|
4
|
+
* @module updateFirstRow
|
|
5
|
+
* @category Tasks
|
|
6
|
+
* @experimental
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = updateFirstRow;
|
|
13
|
+
const updateRows_ts_1 = __importDefault(require("./updateRows.js"));
|
|
14
|
+
/**
|
|
15
|
+
* Update first row in a given workbook range.
|
|
16
|
+
* @param originRef Reference to the workbook range to update. Only the upper-left cell is used as an origin point.
|
|
17
|
+
* @param cells Array of arrays of cells to update in the specified range.
|
|
18
|
+
* @remarks `undefined` values are left unchanged. Applying styling to cells is slow, use sparingly.
|
|
19
|
+
* @experimental
|
|
20
|
+
* @example
|
|
21
|
+
* // Basic example:
|
|
22
|
+
* await updateFirstRow(rangeRef, [{ value: 1 }, { value: 2 }]);
|
|
23
|
+
*
|
|
24
|
+
* // Advanced example with cell formatting:
|
|
25
|
+
* await updateRows(rangeRef, [
|
|
26
|
+
* { value: "Column A", style: { alignment: { horizontal: "Right" }, font: { bold: true } } },
|
|
27
|
+
* { value: "Column B", style: { alignment: { horizontal: "Right" }, font: { bold: true } } }
|
|
28
|
+
* ]);
|
|
29
|
+
*/
|
|
30
|
+
async function updateFirstRow(originRef, cells) {
|
|
31
|
+
const rows = [cells];
|
|
32
|
+
await (0, updateRows_ts_1.default)(originRef, rows);
|
|
33
|
+
}
|