docx 9.8.1 → 9.9.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/charts.cjs +18 -10
- package/dist/charts.iife.js +18 -10
- package/dist/charts.mjs +18 -10
- package/dist/charts.umd.cjs +18 -10
- package/dist/index.cjs +2300 -283
- package/dist/index.d.cts +605 -32
- package/dist/index.d.ts +605 -32
- package/dist/index.iife.js +2300 -283
- package/dist/index.mjs +2293 -284
- package/dist/index.umd.cjs +2300 -283
- package/dist/layout.cjs +50860 -0
- package/dist/layout.d.cts +385 -0
- package/dist/layout.d.ts +385 -0
- package/dist/layout.iife.js +50863 -0
- package/dist/layout.mjs +50856 -0
- package/dist/layout.umd.cjs +50864 -0
- package/dist/math.cjs +7 -7
- package/dist/math.iife.js +7 -7
- package/dist/math.mjs +7 -7
- package/dist/math.umd.cjs +7 -7
- package/dist/shapes.cjs +2051 -2470
- package/dist/shapes.iife.js +2051 -2470
- package/dist/shapes.mjs +2051 -2470
- package/dist/shapes.umd.cjs +2051 -2470
- package/dist/watermarks.cjs +4 -4
- package/dist/watermarks.iife.js +4 -4
- package/dist/watermarks.mjs +4 -4
- package/dist/watermarks.umd.cjs +4 -4
- package/package.json +18 -5
package/dist/charts.cjs
CHANGED
|
@@ -40,13 +40,17 @@ var DATE_FORMATS = {
|
|
|
40
40
|
years: "yyyy"
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
+
* A date as an error message writes it: ISO text in UTC, which is the same in every time zone, or "Invalid Date".
|
|
44
|
+
*/
|
|
45
|
+
var dateText$1 = (date) => Number.isFinite(date.getTime()) ? date.toISOString() : String(date);
|
|
46
|
+
/**
|
|
43
47
|
* Checks that a category is a date Excel can hold.
|
|
44
48
|
*
|
|
45
49
|
* @throws If it isn't a valid date from 1 March 1900 to 31 December 9999
|
|
46
50
|
*/
|
|
47
51
|
var checkDate = (date) => {
|
|
48
52
|
const time = date.getTime();
|
|
49
|
-
if (!(time >= FIRST_DATE && time < LAST_DATE + MILLISECONDS_PER_DAY)) throw new Error(`Invalid category date ${
|
|
53
|
+
if (!(time >= FIRST_DATE && time < LAST_DATE + MILLISECONDS_PER_DAY)) throw new Error(`Invalid category date ${dateText$1(date)}. Expected a date from 1900-03-01 to 9999-12-31`);
|
|
50
54
|
};
|
|
51
55
|
/**
|
|
52
56
|
* A date as Excel's serial number: days since 30 December 1899, with the time of day as a fraction. Dates are read in
|
|
@@ -153,9 +157,13 @@ var checkRange = (value, option, minimum, maximum) => {
|
|
|
153
157
|
if (value !== void 0 && !(value >= minimum && value <= maximum)) throw new Error(`Invalid ${option} ${value}. Expected a number from ${minimum} to ${maximum}`);
|
|
154
158
|
};
|
|
155
159
|
/**
|
|
156
|
-
* A value as an error message writes it: text in quotes, so "5" isn't mistaken for a number
|
|
160
|
+
* A value as an error message writes it: text in quotes, so "5" isn't mistaken for a number, and a date as ISO text, so
|
|
161
|
+
* the message is the same in every time zone.
|
|
157
162
|
*/
|
|
158
|
-
var quoted$1 = (value) =>
|
|
163
|
+
var quoted$1 = (value) => {
|
|
164
|
+
if (typeof value === "string") return `"${value}"`;
|
|
165
|
+
return value instanceof Date ? dateText$1(value) : String(value);
|
|
166
|
+
};
|
|
159
167
|
/**
|
|
160
168
|
* Checks that an option is a whole number in a range, if it is given.
|
|
161
169
|
*/
|
|
@@ -277,7 +285,7 @@ var checkGroups = (groups) => {
|
|
|
277
285
|
if (isGroup(categories[0])) return 1 + checkGroups(categories);
|
|
278
286
|
for (const category of categories) {
|
|
279
287
|
if (isGroup(category)) throw new Error(`Category group "${name}" holds categories and groups. A group holds one or the other`);
|
|
280
|
-
if (category instanceof Date) throw new Error(`Invalid category ${
|
|
288
|
+
if (category instanceof Date) throw new Error(`Invalid category ${quoted$1(category)} in group "${name}". Categories in groups are text or numbers, not dates`);
|
|
281
289
|
if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${quoted$1(category)} in group "${name}". Expected text or a finite number`);
|
|
282
290
|
}
|
|
283
291
|
return 1;
|
|
@@ -304,7 +312,7 @@ var checkCategories = (categories, { dates, groups, type }) => {
|
|
|
304
312
|
dated.forEach(checkDate);
|
|
305
313
|
return;
|
|
306
314
|
}
|
|
307
|
-
for (const category of plain) if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${
|
|
315
|
+
for (const category of plain) if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${quoted$1(category)}. Expected text or a finite number`);
|
|
308
316
|
};
|
|
309
317
|
var checkSeries = (series) => {
|
|
310
318
|
if (!Array.isArray(series) || series.length === 0) throw new Error("A chart needs at least one series");
|
|
@@ -811,7 +819,7 @@ var sheetRangeReference = (firstColumn, lastColumn, firstRow, rows = 1) => {
|
|
|
811
819
|
return rows === 1 && firstColumn === lastColumn ? `${SHEET_NAME}!${first}` : `${SHEET_NAME}!${first}:$${columnName(lastColumn)}$${firstRow + rows}`;
|
|
812
820
|
};
|
|
813
821
|
//#endregion
|
|
814
|
-
//#region \0@oxc-project+runtime@0.
|
|
822
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
|
|
815
823
|
function _typeof(o) {
|
|
816
824
|
"@babel/helpers - typeof";
|
|
817
825
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -821,7 +829,7 @@ function _typeof(o) {
|
|
|
821
829
|
}, _typeof(o);
|
|
822
830
|
}
|
|
823
831
|
//#endregion
|
|
824
|
-
//#region \0@oxc-project+runtime@0.
|
|
832
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
|
|
825
833
|
function toPrimitive(t, r) {
|
|
826
834
|
if ("object" != _typeof(t) || !t) return t;
|
|
827
835
|
var e = t[Symbol.toPrimitive];
|
|
@@ -833,13 +841,13 @@ function toPrimitive(t, r) {
|
|
|
833
841
|
return ("string" === r ? String : Number)(t);
|
|
834
842
|
}
|
|
835
843
|
//#endregion
|
|
836
|
-
//#region \0@oxc-project+runtime@0.
|
|
844
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
|
|
837
845
|
function toPropertyKey(t) {
|
|
838
846
|
var i = toPrimitive(t, "string");
|
|
839
847
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
840
848
|
}
|
|
841
849
|
//#endregion
|
|
842
|
-
//#region \0@oxc-project+runtime@0.
|
|
850
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
|
|
843
851
|
function _defineProperty(e, r, t) {
|
|
844
852
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
845
853
|
value: t,
|
|
@@ -849,7 +857,7 @@ function _defineProperty(e, r, t) {
|
|
|
849
857
|
}) : e[r] = t, e;
|
|
850
858
|
}
|
|
851
859
|
//#endregion
|
|
852
|
-
//#region \0@oxc-project+runtime@0.
|
|
860
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/objectSpread2.js
|
|
853
861
|
function ownKeys(e, r) {
|
|
854
862
|
var t = Object.keys(e);
|
|
855
863
|
if (Object.getOwnPropertySymbols) {
|
package/dist/charts.iife.js
CHANGED
|
@@ -40,13 +40,17 @@ var docxCharts = (function(exports, docx) {
|
|
|
40
40
|
years: "yyyy"
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
+
* A date as an error message writes it: ISO text in UTC, which is the same in every time zone, or "Invalid Date".
|
|
44
|
+
*/
|
|
45
|
+
var dateText$1 = (date) => Number.isFinite(date.getTime()) ? date.toISOString() : String(date);
|
|
46
|
+
/**
|
|
43
47
|
* Checks that a category is a date Excel can hold.
|
|
44
48
|
*
|
|
45
49
|
* @throws If it isn't a valid date from 1 March 1900 to 31 December 9999
|
|
46
50
|
*/
|
|
47
51
|
var checkDate = (date) => {
|
|
48
52
|
const time = date.getTime();
|
|
49
|
-
if (!(time >= FIRST_DATE && time < LAST_DATE + MILLISECONDS_PER_DAY)) throw new Error(`Invalid category date ${
|
|
53
|
+
if (!(time >= FIRST_DATE && time < LAST_DATE + MILLISECONDS_PER_DAY)) throw new Error(`Invalid category date ${dateText$1(date)}. Expected a date from 1900-03-01 to 9999-12-31`);
|
|
50
54
|
};
|
|
51
55
|
/**
|
|
52
56
|
* A date as Excel's serial number: days since 30 December 1899, with the time of day as a fraction. Dates are read in
|
|
@@ -153,9 +157,13 @@ var docxCharts = (function(exports, docx) {
|
|
|
153
157
|
if (value !== void 0 && !(value >= minimum && value <= maximum)) throw new Error(`Invalid ${option} ${value}. Expected a number from ${minimum} to ${maximum}`);
|
|
154
158
|
};
|
|
155
159
|
/**
|
|
156
|
-
* A value as an error message writes it: text in quotes, so "5" isn't mistaken for a number
|
|
160
|
+
* A value as an error message writes it: text in quotes, so "5" isn't mistaken for a number, and a date as ISO text, so
|
|
161
|
+
* the message is the same in every time zone.
|
|
157
162
|
*/
|
|
158
|
-
var quoted$1 = (value) =>
|
|
163
|
+
var quoted$1 = (value) => {
|
|
164
|
+
if (typeof value === "string") return `"${value}"`;
|
|
165
|
+
return value instanceof Date ? dateText$1(value) : String(value);
|
|
166
|
+
};
|
|
159
167
|
/**
|
|
160
168
|
* Checks that an option is a whole number in a range, if it is given.
|
|
161
169
|
*/
|
|
@@ -277,7 +285,7 @@ var docxCharts = (function(exports, docx) {
|
|
|
277
285
|
if (isGroup(categories[0])) return 1 + checkGroups(categories);
|
|
278
286
|
for (const category of categories) {
|
|
279
287
|
if (isGroup(category)) throw new Error(`Category group "${name}" holds categories and groups. A group holds one or the other`);
|
|
280
|
-
if (category instanceof Date) throw new Error(`Invalid category ${
|
|
288
|
+
if (category instanceof Date) throw new Error(`Invalid category ${quoted$1(category)} in group "${name}". Categories in groups are text or numbers, not dates`);
|
|
281
289
|
if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${quoted$1(category)} in group "${name}". Expected text or a finite number`);
|
|
282
290
|
}
|
|
283
291
|
return 1;
|
|
@@ -304,7 +312,7 @@ var docxCharts = (function(exports, docx) {
|
|
|
304
312
|
dated.forEach(checkDate);
|
|
305
313
|
return;
|
|
306
314
|
}
|
|
307
|
-
for (const category of plain) if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${
|
|
315
|
+
for (const category of plain) if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${quoted$1(category)}. Expected text or a finite number`);
|
|
308
316
|
};
|
|
309
317
|
var checkSeries = (series) => {
|
|
310
318
|
if (!Array.isArray(series) || series.length === 0) throw new Error("A chart needs at least one series");
|
|
@@ -811,7 +819,7 @@ var docxCharts = (function(exports, docx) {
|
|
|
811
819
|
return rows === 1 && firstColumn === lastColumn ? `${SHEET_NAME}!${first}` : `${SHEET_NAME}!${first}:$${columnName(lastColumn)}$${firstRow + rows}`;
|
|
812
820
|
};
|
|
813
821
|
//#endregion
|
|
814
|
-
//#region \0@oxc-project+runtime@0.
|
|
822
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
|
|
815
823
|
function _typeof(o) {
|
|
816
824
|
"@babel/helpers - typeof";
|
|
817
825
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -821,7 +829,7 @@ var docxCharts = (function(exports, docx) {
|
|
|
821
829
|
}, _typeof(o);
|
|
822
830
|
}
|
|
823
831
|
//#endregion
|
|
824
|
-
//#region \0@oxc-project+runtime@0.
|
|
832
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
|
|
825
833
|
function toPrimitive(t, r) {
|
|
826
834
|
if ("object" != _typeof(t) || !t) return t;
|
|
827
835
|
var e = t[Symbol.toPrimitive];
|
|
@@ -833,13 +841,13 @@ var docxCharts = (function(exports, docx) {
|
|
|
833
841
|
return ("string" === r ? String : Number)(t);
|
|
834
842
|
}
|
|
835
843
|
//#endregion
|
|
836
|
-
//#region \0@oxc-project+runtime@0.
|
|
844
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
|
|
837
845
|
function toPropertyKey(t) {
|
|
838
846
|
var i = toPrimitive(t, "string");
|
|
839
847
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
840
848
|
}
|
|
841
849
|
//#endregion
|
|
842
|
-
//#region \0@oxc-project+runtime@0.
|
|
850
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
|
|
843
851
|
function _defineProperty(e, r, t) {
|
|
844
852
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
845
853
|
value: t,
|
|
@@ -849,7 +857,7 @@ var docxCharts = (function(exports, docx) {
|
|
|
849
857
|
}) : e[r] = t, e;
|
|
850
858
|
}
|
|
851
859
|
//#endregion
|
|
852
|
-
//#region \0@oxc-project+runtime@0.
|
|
860
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/objectSpread2.js
|
|
853
861
|
function ownKeys(e, r) {
|
|
854
862
|
var t = Object.keys(e);
|
|
855
863
|
if (Object.getOwnPropertySymbols) {
|
package/dist/charts.mjs
CHANGED
|
@@ -39,13 +39,17 @@ var DATE_FORMATS = {
|
|
|
39
39
|
years: "yyyy"
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
|
+
* A date as an error message writes it: ISO text in UTC, which is the same in every time zone, or "Invalid Date".
|
|
43
|
+
*/
|
|
44
|
+
var dateText$1 = (date) => Number.isFinite(date.getTime()) ? date.toISOString() : String(date);
|
|
45
|
+
/**
|
|
42
46
|
* Checks that a category is a date Excel can hold.
|
|
43
47
|
*
|
|
44
48
|
* @throws If it isn't a valid date from 1 March 1900 to 31 December 9999
|
|
45
49
|
*/
|
|
46
50
|
var checkDate = (date) => {
|
|
47
51
|
const time = date.getTime();
|
|
48
|
-
if (!(time >= FIRST_DATE && time < LAST_DATE + MILLISECONDS_PER_DAY)) throw new Error(`Invalid category date ${
|
|
52
|
+
if (!(time >= FIRST_DATE && time < LAST_DATE + MILLISECONDS_PER_DAY)) throw new Error(`Invalid category date ${dateText$1(date)}. Expected a date from 1900-03-01 to 9999-12-31`);
|
|
49
53
|
};
|
|
50
54
|
/**
|
|
51
55
|
* A date as Excel's serial number: days since 30 December 1899, with the time of day as a fraction. Dates are read in
|
|
@@ -152,9 +156,13 @@ var checkRange = (value, option, minimum, maximum) => {
|
|
|
152
156
|
if (value !== void 0 && !(value >= minimum && value <= maximum)) throw new Error(`Invalid ${option} ${value}. Expected a number from ${minimum} to ${maximum}`);
|
|
153
157
|
};
|
|
154
158
|
/**
|
|
155
|
-
* A value as an error message writes it: text in quotes, so "5" isn't mistaken for a number
|
|
159
|
+
* A value as an error message writes it: text in quotes, so "5" isn't mistaken for a number, and a date as ISO text, so
|
|
160
|
+
* the message is the same in every time zone.
|
|
156
161
|
*/
|
|
157
|
-
var quoted$1 = (value) =>
|
|
162
|
+
var quoted$1 = (value) => {
|
|
163
|
+
if (typeof value === "string") return `"${value}"`;
|
|
164
|
+
return value instanceof Date ? dateText$1(value) : String(value);
|
|
165
|
+
};
|
|
158
166
|
/**
|
|
159
167
|
* Checks that an option is a whole number in a range, if it is given.
|
|
160
168
|
*/
|
|
@@ -276,7 +284,7 @@ var checkGroups = (groups) => {
|
|
|
276
284
|
if (isGroup(categories[0])) return 1 + checkGroups(categories);
|
|
277
285
|
for (const category of categories) {
|
|
278
286
|
if (isGroup(category)) throw new Error(`Category group "${name}" holds categories and groups. A group holds one or the other`);
|
|
279
|
-
if (category instanceof Date) throw new Error(`Invalid category ${
|
|
287
|
+
if (category instanceof Date) throw new Error(`Invalid category ${quoted$1(category)} in group "${name}". Categories in groups are text or numbers, not dates`);
|
|
280
288
|
if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${quoted$1(category)} in group "${name}". Expected text or a finite number`);
|
|
281
289
|
}
|
|
282
290
|
return 1;
|
|
@@ -303,7 +311,7 @@ var checkCategories = (categories, { dates, groups, type }) => {
|
|
|
303
311
|
dated.forEach(checkDate);
|
|
304
312
|
return;
|
|
305
313
|
}
|
|
306
|
-
for (const category of plain) if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${
|
|
314
|
+
for (const category of plain) if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${quoted$1(category)}. Expected text or a finite number`);
|
|
307
315
|
};
|
|
308
316
|
var checkSeries = (series) => {
|
|
309
317
|
if (!Array.isArray(series) || series.length === 0) throw new Error("A chart needs at least one series");
|
|
@@ -810,7 +818,7 @@ var sheetRangeReference = (firstColumn, lastColumn, firstRow, rows = 1) => {
|
|
|
810
818
|
return rows === 1 && firstColumn === lastColumn ? `${SHEET_NAME}!${first}` : `${SHEET_NAME}!${first}:$${columnName(lastColumn)}$${firstRow + rows}`;
|
|
811
819
|
};
|
|
812
820
|
//#endregion
|
|
813
|
-
//#region \0@oxc-project+runtime@0.
|
|
821
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
|
|
814
822
|
function _typeof(o) {
|
|
815
823
|
"@babel/helpers - typeof";
|
|
816
824
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -820,7 +828,7 @@ function _typeof(o) {
|
|
|
820
828
|
}, _typeof(o);
|
|
821
829
|
}
|
|
822
830
|
//#endregion
|
|
823
|
-
//#region \0@oxc-project+runtime@0.
|
|
831
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
|
|
824
832
|
function toPrimitive(t, r) {
|
|
825
833
|
if ("object" != _typeof(t) || !t) return t;
|
|
826
834
|
var e = t[Symbol.toPrimitive];
|
|
@@ -832,13 +840,13 @@ function toPrimitive(t, r) {
|
|
|
832
840
|
return ("string" === r ? String : Number)(t);
|
|
833
841
|
}
|
|
834
842
|
//#endregion
|
|
835
|
-
//#region \0@oxc-project+runtime@0.
|
|
843
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
|
|
836
844
|
function toPropertyKey(t) {
|
|
837
845
|
var i = toPrimitive(t, "string");
|
|
838
846
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
839
847
|
}
|
|
840
848
|
//#endregion
|
|
841
|
-
//#region \0@oxc-project+runtime@0.
|
|
849
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
|
|
842
850
|
function _defineProperty(e, r, t) {
|
|
843
851
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
844
852
|
value: t,
|
|
@@ -848,7 +856,7 @@ function _defineProperty(e, r, t) {
|
|
|
848
856
|
}) : e[r] = t, e;
|
|
849
857
|
}
|
|
850
858
|
//#endregion
|
|
851
|
-
//#region \0@oxc-project+runtime@0.
|
|
859
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/objectSpread2.js
|
|
852
860
|
function ownKeys(e, r) {
|
|
853
861
|
var t = Object.keys(e);
|
|
854
862
|
if (Object.getOwnPropertySymbols) {
|
package/dist/charts.umd.cjs
CHANGED
|
@@ -42,13 +42,17 @@
|
|
|
42
42
|
years: "yyyy"
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
+
* A date as an error message writes it: ISO text in UTC, which is the same in every time zone, or "Invalid Date".
|
|
46
|
+
*/
|
|
47
|
+
var dateText$1 = (date) => Number.isFinite(date.getTime()) ? date.toISOString() : String(date);
|
|
48
|
+
/**
|
|
45
49
|
* Checks that a category is a date Excel can hold.
|
|
46
50
|
*
|
|
47
51
|
* @throws If it isn't a valid date from 1 March 1900 to 31 December 9999
|
|
48
52
|
*/
|
|
49
53
|
var checkDate = (date) => {
|
|
50
54
|
const time = date.getTime();
|
|
51
|
-
if (!(time >= FIRST_DATE && time < LAST_DATE + MILLISECONDS_PER_DAY)) throw new Error(`Invalid category date ${
|
|
55
|
+
if (!(time >= FIRST_DATE && time < LAST_DATE + MILLISECONDS_PER_DAY)) throw new Error(`Invalid category date ${dateText$1(date)}. Expected a date from 1900-03-01 to 9999-12-31`);
|
|
52
56
|
};
|
|
53
57
|
/**
|
|
54
58
|
* A date as Excel's serial number: days since 30 December 1899, with the time of day as a fraction. Dates are read in
|
|
@@ -155,9 +159,13 @@
|
|
|
155
159
|
if (value !== void 0 && !(value >= minimum && value <= maximum)) throw new Error(`Invalid ${option} ${value}. Expected a number from ${minimum} to ${maximum}`);
|
|
156
160
|
};
|
|
157
161
|
/**
|
|
158
|
-
* A value as an error message writes it: text in quotes, so "5" isn't mistaken for a number
|
|
162
|
+
* A value as an error message writes it: text in quotes, so "5" isn't mistaken for a number, and a date as ISO text, so
|
|
163
|
+
* the message is the same in every time zone.
|
|
159
164
|
*/
|
|
160
|
-
var quoted$1 = (value) =>
|
|
165
|
+
var quoted$1 = (value) => {
|
|
166
|
+
if (typeof value === "string") return `"${value}"`;
|
|
167
|
+
return value instanceof Date ? dateText$1(value) : String(value);
|
|
168
|
+
};
|
|
161
169
|
/**
|
|
162
170
|
* Checks that an option is a whole number in a range, if it is given.
|
|
163
171
|
*/
|
|
@@ -279,7 +287,7 @@
|
|
|
279
287
|
if (isGroup(categories[0])) return 1 + checkGroups(categories);
|
|
280
288
|
for (const category of categories) {
|
|
281
289
|
if (isGroup(category)) throw new Error(`Category group "${name}" holds categories and groups. A group holds one or the other`);
|
|
282
|
-
if (category instanceof Date) throw new Error(`Invalid category ${
|
|
290
|
+
if (category instanceof Date) throw new Error(`Invalid category ${quoted$1(category)} in group "${name}". Categories in groups are text or numbers, not dates`);
|
|
283
291
|
if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${quoted$1(category)} in group "${name}". Expected text or a finite number`);
|
|
284
292
|
}
|
|
285
293
|
return 1;
|
|
@@ -306,7 +314,7 @@
|
|
|
306
314
|
dated.forEach(checkDate);
|
|
307
315
|
return;
|
|
308
316
|
}
|
|
309
|
-
for (const category of plain) if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${
|
|
317
|
+
for (const category of plain) if (typeof category !== "string" && !Number.isFinite(category)) throw new Error(`Invalid category ${quoted$1(category)}. Expected text or a finite number`);
|
|
310
318
|
};
|
|
311
319
|
var checkSeries = (series) => {
|
|
312
320
|
if (!Array.isArray(series) || series.length === 0) throw new Error("A chart needs at least one series");
|
|
@@ -813,7 +821,7 @@
|
|
|
813
821
|
return rows === 1 && firstColumn === lastColumn ? `${SHEET_NAME}!${first}` : `${SHEET_NAME}!${first}:$${columnName(lastColumn)}$${firstRow + rows}`;
|
|
814
822
|
};
|
|
815
823
|
//#endregion
|
|
816
|
-
//#region \0@oxc-project+runtime@0.
|
|
824
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/typeof.js
|
|
817
825
|
function _typeof(o) {
|
|
818
826
|
"@babel/helpers - typeof";
|
|
819
827
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -823,7 +831,7 @@
|
|
|
823
831
|
}, _typeof(o);
|
|
824
832
|
}
|
|
825
833
|
//#endregion
|
|
826
|
-
//#region \0@oxc-project+runtime@0.
|
|
834
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPrimitive.js
|
|
827
835
|
function toPrimitive(t, r) {
|
|
828
836
|
if ("object" != _typeof(t) || !t) return t;
|
|
829
837
|
var e = t[Symbol.toPrimitive];
|
|
@@ -835,13 +843,13 @@
|
|
|
835
843
|
return ("string" === r ? String : Number)(t);
|
|
836
844
|
}
|
|
837
845
|
//#endregion
|
|
838
|
-
//#region \0@oxc-project+runtime@0.
|
|
846
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/toPropertyKey.js
|
|
839
847
|
function toPropertyKey(t) {
|
|
840
848
|
var i = toPrimitive(t, "string");
|
|
841
849
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
842
850
|
}
|
|
843
851
|
//#endregion
|
|
844
|
-
//#region \0@oxc-project+runtime@0.
|
|
852
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/defineProperty.js
|
|
845
853
|
function _defineProperty(e, r, t) {
|
|
846
854
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
847
855
|
value: t,
|
|
@@ -851,7 +859,7 @@
|
|
|
851
859
|
}) : e[r] = t, e;
|
|
852
860
|
}
|
|
853
861
|
//#endregion
|
|
854
|
-
//#region \0@oxc-project+runtime@0.
|
|
862
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/objectSpread2.js
|
|
855
863
|
function ownKeys(e, r) {
|
|
856
864
|
var t = Object.keys(e);
|
|
857
865
|
if (Object.getOwnPropertySymbols) {
|