javascript-excel 2.0.0-alpha.2 → 2.0.0-alpha.3

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.
Files changed (65) hide show
  1. package/README.md +151 -21
  2. package/dist/address-DUn7-5OS.js +75 -0
  3. package/dist/address-DZBHchLv.cjs +122 -0
  4. package/dist/{auto-width-2oBzjeNG.d.cts → auto-width-DRHsPKNk.d.cts} +1 -1
  5. package/dist/cells-CPXU722t.cjs +33 -0
  6. package/dist/cells-CrMF8h_t.js +28 -0
  7. package/dist/colors-B8Nf_xTx.js +114 -0
  8. package/dist/colors-oBpjx97l.cjs +119 -0
  9. package/dist/csv.d.cts +4 -1
  10. package/dist/csv.d.ts +4 -1
  11. package/dist/dataset-KeMzHCGl.js +664 -0
  12. package/dist/dataset-UUZCzsi3.cjs +687 -0
  13. package/dist/dates-BXcSWf9_.js +64 -0
  14. package/dist/dates-CA1dCizp.cjs +75 -0
  15. package/dist/dom.cjs +5 -2
  16. package/dist/dom.d.cts +5 -2
  17. package/dist/dom.d.ts +4 -1
  18. package/dist/dom.js +4 -1
  19. package/dist/{numfmt-Dv6AjopS.cjs → dos-time-FZ7-1tot.cjs} +0 -199
  20. package/dist/{numfmt-BBgB7iQA.js → dos-time-dD0z1YWU.js} +2 -177
  21. package/dist/format.cjs +1264 -0
  22. package/dist/format.d.cts +59 -0
  23. package/dist/format.d.ts +59 -0
  24. package/dist/format.js +1262 -0
  25. package/dist/import.cjs +10 -0
  26. package/dist/import.d.cts +10 -0
  27. package/dist/import.d.ts +10 -0
  28. package/dist/import.js +1 -0
  29. package/dist/index.cjs +24 -607
  30. package/dist/index.d.cts +32 -6
  31. package/dist/index.d.ts +31 -5
  32. package/dist/index.js +10 -594
  33. package/dist/{warnings-C_12PT4t.d.cts → model-0JikLfuM.d.cts} +1 -41
  34. package/dist/{warnings-DXJKe1lx.d.ts → model-0JikLfuM.d.ts} +1 -41
  35. package/dist/numfmt-BmEbm78Y.cjs +125 -0
  36. package/dist/numfmt-DCDrX9P1.js +114 -0
  37. package/dist/pipeline-BAJtzBdW.js +1085 -0
  38. package/dist/pipeline-Bnf7EU3X.cjs +1132 -0
  39. package/dist/pipeline-CctEa86r.d.cts +186 -0
  40. package/dist/pipeline-I8SLmV9S.d.ts +186 -0
  41. package/dist/{read-Ym1voUct.cjs → read-CZEWV4rK.cjs} +181 -17
  42. package/dist/{read-DDN5ZsPe.js → read-LWti17lz.js} +169 -5
  43. package/dist/read.cjs +1 -1
  44. package/dist/read.d.cts +78 -4
  45. package/dist/read.d.ts +78 -4
  46. package/dist/read.js +1 -1
  47. package/dist/render.cjs +751 -0
  48. package/dist/render.d.cts +215 -0
  49. package/dist/render.d.ts +215 -0
  50. package/dist/render.js +732 -0
  51. package/dist/{sheet-names-uT2EH5Ui.js → sheet-names-7p-joVsG.js} +2 -101
  52. package/dist/{sheet-names-qpXsvMpM.cjs → sheet-names-B8U5RAW0.cjs} +14 -167
  53. package/dist/warnings-B1v58nCZ.d.cts +41 -0
  54. package/dist/warnings-B1v58nCZ.d.ts +41 -0
  55. package/dist/worker.cjs +10 -2
  56. package/dist/worker.d.cts +10 -4
  57. package/dist/worker.d.ts +10 -4
  58. package/dist/worker.js +10 -2
  59. package/dist/{write-CYpLGuzl.d.ts → write-DM6ieuQY.d.ts} +2 -1
  60. package/dist/{write-DubvcG-x.js → write-DjgWy1PK.js} +5 -2
  61. package/dist/{write-C5JgeIar.d.cts → write-DtjfdIFm.d.cts} +2 -1
  62. package/dist/{write-BOh9jfu1.cjs → write-f9kcYf5K.cjs} +31 -28
  63. package/package.json +32 -1
  64. package/dist/read-C6L7Nyy3.d.cts +0 -78
  65. package/dist/read-Ddkks7qC.d.ts +0 -78
@@ -0,0 +1,59 @@
1
+ /**
2
+ * javascript-excel/format: renders values with Excel number formats
3
+ * (docs/api.md §5.7), for viewers, previews and "as displayed" text.
4
+ *
5
+ * Dates are formatted from Excel serials, so the result does not depend on
6
+ * the time zone. Locale data (separators, month and day names, the short
7
+ * date) comes from Intl. Nothing here throws for a malformed code: unknown
8
+ * characters are shown as literal text.
9
+ *
10
+ * @module javascript-excel/format
11
+ */
12
+ import { a as Cell, b as NumFmt, o as CellErrorValue, s as CellInput, w as RichText } from "./model-0JikLfuM.cjs";
13
+ /** What `formatValue` accepts: a cell's value. A Date is converted to a serial first (`dateZone`, `date1904`). */
14
+ export type FormatInput = number | string | boolean | Date | CellErrorValue | RichText | null | undefined;
15
+ /** Options for `formatValue` and `formatCell`. */
16
+ export interface FormatOptions {
17
+ /** BCP 47 locale for separators, month and day names and locale-dependent built-in formats. Default 'en-US'. */
18
+ locale?: string | undefined;
19
+ /** The workbook uses the 1904 date system (`workbook.date1904`). Default false. */
20
+ date1904?: boolean | undefined;
21
+ /** How a Date input becomes a serial: its local or its UTC fields. Default 'local', as the writer (§3.4.1). Serial inputs ignore it. */
22
+ dateZone?: "local" | "utc" | undefined;
23
+ /** Characters available to the General format before it rounds or switches to scientific notation. Default 11 `[to verify]`. */
24
+ generalWidth?: number | undefined;
25
+ /** The workbook's custom indexed palette (`workbook.indexedColors`), for [ColorN] colours. */
26
+ indexedColors?: readonly string[] | undefined;
27
+ }
28
+ /** A formatted value. */
29
+ export interface FormattedValue {
30
+ /** The text Excel shows, without the repeat characters of a `*x` fill. */
31
+ text: string;
32
+ /** Colour from the format section ([Red], [Color10]) as ARGB 'FFRRGGBB'. Overrides the font colour. */
33
+ color?: string | undefined;
34
+ /**
35
+ * A `*x` fill: repeat `char` at `at` (an index into `text`) until the cell is full.
36
+ * Also used with `char: '#'` and `text: ''` for a date Excel cannot show (negative or past 9999-12-31): the cell fills with '#'.
37
+ */
38
+ fill?: {
39
+ char: string;
40
+ at: number;
41
+ } | undefined;
42
+ /** How Excel aligns the value under 'general' horizontal alignment: numbers and dates right, text left, booleans and errors centred. */
43
+ align: "left" | "center" | "right";
44
+ }
45
+ /**
46
+ * Formats a value with a number format, as Excel shows it in a cell.
47
+ *
48
+ * `numFmt` is a built-in id or a format code (§3.5.5); undefined is General.
49
+ * Numbers are serials for date formats. A Date is converted with
50
+ * `dateToSerial` (`dateZone`, `date1904`). Text uses the format's text
51
+ * section; booleans show TRUE/FALSE and errors as written, whatever the format.
52
+ */
53
+ export declare function formatValue(value: FormatInput, numFmt?: NumFmt, options?: FormatOptions): FormattedValue;
54
+ /**
55
+ * Formats a cell (§3.4) with its own number format (`cell.style.numFmt`).
56
+ * A formula cell shows its cached value; without one the text is empty.
57
+ */
58
+ export declare function formatCell(cell: CellInput, options?: FormatOptions): FormattedValue;
59
+ export type { Cell, CellErrorValue, CellInput, NumFmt, RichText };
@@ -0,0 +1,59 @@
1
+ /**
2
+ * javascript-excel/format: renders values with Excel number formats
3
+ * (docs/api.md §5.7), for viewers, previews and "as displayed" text.
4
+ *
5
+ * Dates are formatted from Excel serials, so the result does not depend on
6
+ * the time zone. Locale data (separators, month and day names, the short
7
+ * date) comes from Intl. Nothing here throws for a malformed code: unknown
8
+ * characters are shown as literal text.
9
+ *
10
+ * @module javascript-excel/format
11
+ */
12
+ import { a as Cell, b as NumFmt, o as CellErrorValue, s as CellInput, w as RichText } from "./model-0JikLfuM.js";
13
+ /** What `formatValue` accepts: a cell's value. A Date is converted to a serial first (`dateZone`, `date1904`). */
14
+ export type FormatInput = number | string | boolean | Date | CellErrorValue | RichText | null | undefined;
15
+ /** Options for `formatValue` and `formatCell`. */
16
+ export interface FormatOptions {
17
+ /** BCP 47 locale for separators, month and day names and locale-dependent built-in formats. Default 'en-US'. */
18
+ locale?: string | undefined;
19
+ /** The workbook uses the 1904 date system (`workbook.date1904`). Default false. */
20
+ date1904?: boolean | undefined;
21
+ /** How a Date input becomes a serial: its local or its UTC fields. Default 'local', as the writer (§3.4.1). Serial inputs ignore it. */
22
+ dateZone?: "local" | "utc" | undefined;
23
+ /** Characters available to the General format before it rounds or switches to scientific notation. Default 11 `[to verify]`. */
24
+ generalWidth?: number | undefined;
25
+ /** The workbook's custom indexed palette (`workbook.indexedColors`), for [ColorN] colours. */
26
+ indexedColors?: readonly string[] | undefined;
27
+ }
28
+ /** A formatted value. */
29
+ export interface FormattedValue {
30
+ /** The text Excel shows, without the repeat characters of a `*x` fill. */
31
+ text: string;
32
+ /** Colour from the format section ([Red], [Color10]) as ARGB 'FFRRGGBB'. Overrides the font colour. */
33
+ color?: string | undefined;
34
+ /**
35
+ * A `*x` fill: repeat `char` at `at` (an index into `text`) until the cell is full.
36
+ * Also used with `char: '#'` and `text: ''` for a date Excel cannot show (negative or past 9999-12-31): the cell fills with '#'.
37
+ */
38
+ fill?: {
39
+ char: string;
40
+ at: number;
41
+ } | undefined;
42
+ /** How Excel aligns the value under 'general' horizontal alignment: numbers and dates right, text left, booleans and errors centred. */
43
+ align: "left" | "center" | "right";
44
+ }
45
+ /**
46
+ * Formats a value with a number format, as Excel shows it in a cell.
47
+ *
48
+ * `numFmt` is a built-in id or a format code (§3.5.5); undefined is General.
49
+ * Numbers are serials for date formats. A Date is converted with
50
+ * `dateToSerial` (`dateZone`, `date1904`). Text uses the format's text
51
+ * section; booleans show TRUE/FALSE and errors as written, whatever the format.
52
+ */
53
+ export declare function formatValue(value: FormatInput, numFmt?: NumFmt, options?: FormatOptions): FormattedValue;
54
+ /**
55
+ * Formats a cell (§3.4) with its own number format (`cell.style.numFmt`).
56
+ * A formula cell shows its cached value; without one the text is empty.
57
+ */
58
+ export declare function formatCell(cell: CellInput, options?: FormatOptions): FormattedValue;
59
+ export type { Cell, CellErrorValue, CellInput, NumFmt, RichText };