schummar-table 0.50.3 → 0.50.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.
@@ -10,4 +10,4 @@ var __export = (all) => {
10
10
  };
11
11
 
12
12
  //#endregion
13
- export { __export };
13
+ export { __export as t };
@@ -31,5 +31,5 @@ var CsvExporter = class {
31
31
  };
32
32
 
33
33
  //#endregion
34
- export { CsvExporter };
35
- //# sourceMappingURL=csvExporter-DRm4V8We.js.map
34
+ export { CsvExporter as t };
35
+ //# sourceMappingURL=csvExporter-CqTylAk9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"csvExporter-DRm4V8We.js","names":["options: CsvExporterOptions","stringValue: string"],"sources":["../src/exporters/csvExporter.ts"],"sourcesContent":["import { BlobExporter, StringExporter } from './exporter';\n\nexport interface CsvExporterOptions {\n sepPrefix?: boolean;\n separator?: string;\n quote?: string;\n eol?: string;\n}\n\nexport default class CsvExporter implements StringExporter, BlobExporter {\n readonly type = 'csv';\n readonly fileEnding = 'csv';\n\n constructor(public readonly options: CsvExporterOptions = {}) {}\n\n exportToString(\n columns: (string | number | Date)[],\n rows: (string | number | Date)[][],\n options = this.options,\n ): string {\n const { sepPrefix, separator = '\\t', quote = '\"', eol = '\\n' } = options;\n\n const cells = [columns, ...rows].map((line) =>\n line.map((value) => {\n let stringValue: string;\n if (typeof value === 'number') {\n stringValue = String(value);\n } else if (value instanceof Date) {\n stringValue = value.toISOString();\n } else {\n stringValue = value;\n }\n\n if (![separator, quote, eol].some((c) => stringValue.includes(c))) {\n return value;\n }\n\n const clean = stringValue.replace(new RegExp(quote, 'g'), `${quote}${quote}`);\n return `${quote}${clean}${quote}`;\n }),\n );\n\n return (\n (sepPrefix ? `SEP=${separator}\\n` : '') + cells.map((line) => line.join(separator)).join(eol)\n );\n }\n\n exportToBlob(columns: (string | number | Date)[], rows: (string | number | Date)[][]): Blob {\n const data = this.exportToString(columns, rows, {\n ...this.options,\n sepPrefix: this.options.sepPrefix ?? true,\n });\n return new Blob([data], { type: 'text/csv' });\n }\n}\n"],"mappings":";AASA,IAAqB,cAArB,MAAyE;CAIvE,YAAY,AAAgBA,UAA8B,EAAE,EAAE;EAAlC;cAHZ;oBACM;;CAItB,eACE,SACA,MACA,UAAU,KAAK,SACP;EACR,MAAM,EAAE,WAAW,YAAY,KAAM,QAAQ,MAAK,MAAM,SAAS;EAEjE,MAAM,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,SACpC,KAAK,KAAK,UAAU;GAClB,IAAIC;AACJ,OAAI,OAAO,UAAU,SACnB,eAAc,OAAO,MAAM;YAClB,iBAAiB,KAC1B,eAAc,MAAM,aAAa;OAEjC,eAAc;AAGhB,OAAI,CAAC;IAAC;IAAW;IAAO;IAAI,CAAC,MAAM,MAAM,YAAY,SAAS,EAAE,CAAC,CAC/D,QAAO;AAIT,UAAO,GAAG,QADI,YAAY,QAAQ,IAAI,OAAO,OAAO,IAAI,EAAE,GAAG,QAAQ,QAAQ,GACnD;IAC1B,CACH;AAED,UACG,YAAY,OAAO,UAAU,MAAM,MAAM,MAAM,KAAK,SAAS,KAAK,KAAK,UAAU,CAAC,CAAC,KAAK,IAAI;;CAIjG,aAAa,SAAqC,MAA0C;EAC1F,MAAM,OAAO,KAAK,eAAe,SAAS,MAAM;GAC9C,GAAG,KAAK;GACR,WAAW,KAAK,QAAQ,aAAa;GACtC,CAAC;AACF,SAAO,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"csvExporter-CqTylAk9.js","names":["options: CsvExporterOptions","stringValue: string"],"sources":["../src/exporters/csvExporter.ts"],"sourcesContent":["import { BlobExporter, StringExporter } from './exporter';\n\nexport interface CsvExporterOptions {\n sepPrefix?: boolean;\n separator?: string;\n quote?: string;\n eol?: string;\n}\n\nexport default class CsvExporter implements StringExporter, BlobExporter {\n readonly type = 'csv';\n readonly fileEnding = 'csv';\n\n constructor(public readonly options: CsvExporterOptions = {}) {}\n\n exportToString(\n columns: (string | number | Date)[],\n rows: (string | number | Date)[][],\n options = this.options,\n ): string {\n const { sepPrefix, separator = '\\t', quote = '\"', eol = '\\n' } = options;\n\n const cells = [columns, ...rows].map((line) =>\n line.map((value) => {\n let stringValue: string;\n if (typeof value === 'number') {\n stringValue = String(value);\n } else if (value instanceof Date) {\n stringValue = value.toISOString();\n } else {\n stringValue = value;\n }\n\n if (![separator, quote, eol].some((c) => stringValue.includes(c))) {\n return value;\n }\n\n const clean = stringValue.replace(new RegExp(quote, 'g'), `${quote}${quote}`);\n return `${quote}${clean}${quote}`;\n }),\n );\n\n return (\n (sepPrefix ? `SEP=${separator}\\n` : '') + cells.map((line) => line.join(separator)).join(eol)\n );\n }\n\n exportToBlob(columns: (string | number | Date)[], rows: (string | number | Date)[][]): Blob {\n const data = this.exportToString(columns, rows, {\n ...this.options,\n sepPrefix: this.options.sepPrefix ?? true,\n });\n return new Blob([data], { type: 'text/csv' });\n }\n}\n"],"mappings":";AASA,IAAqB,cAArB,MAAyE;CAIvE,YAAY,AAAgBA,UAA8B,EAAE,EAAE;EAAlC;cAHZ;oBACM;;CAItB,eACE,SACA,MACA,UAAU,KAAK,SACP;EACR,MAAM,EAAE,WAAW,YAAY,KAAM,QAAQ,MAAK,MAAM,SAAS;EAEjE,MAAM,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,SACpC,KAAK,KAAK,UAAU;GAClB,IAAIC;AACJ,OAAI,OAAO,UAAU,SACnB,eAAc,OAAO,MAAM;YAClB,iBAAiB,KAC1B,eAAc,MAAM,aAAa;OAEjC,eAAc;AAGhB,OAAI,CAAC;IAAC;IAAW;IAAO;IAAI,CAAC,MAAM,MAAM,YAAY,SAAS,EAAE,CAAC,CAC/D,QAAO;AAIT,UAAO,GAAG,QADI,YAAY,QAAQ,IAAI,OAAO,OAAO,IAAI,EAAE,GAAG,QAAQ,QAAQ,GACnD;IAC1B,CACH;AAED,UACG,YAAY,OAAO,UAAU,MAAM,MAAM,MAAM,KAAK,SAAS,KAAK,KAAK,UAAU,CAAC,CAAC,KAAK,IAAI;;CAIjG,aAAa,SAAqC,MAA0C;EAC1F,MAAM,OAAO,KAAK,eAAe,SAAS,MAAM;GAC9C,GAAG,KAAK;GACR,WAAW,KAAK,QAAQ,aAAa;GACtC,CAAC;AACF,SAAO,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,MAAM,YAAY,CAAC"}
@@ -1,4 +1,4 @@
1
- import { BlobExporter, StringExporter } from "./exporter-ztSF5GbY.cjs";
1
+ import { i as StringExporter, t as BlobExporter } from "./exporter-ZZesPOOU.cjs";
2
2
 
3
3
  //#region src/exporters/csvExporter.d.ts
4
4
  interface CsvExporterOptions {
@@ -1,4 +1,4 @@
1
- import { BlobExporter, StringExporter } from "./exporter-BxgFAyWA.js";
1
+ import { i as StringExporter, t as BlobExporter } from "./exporter-zK7PhTrL.js";
2
2
 
3
3
  //#region src/exporters/csvExporter.d.ts
4
4
  interface CsvExporterOptions {
@@ -1,3 +1,3 @@
1
- import { CsvExporter } from "./csvExporter-DRm4V8We.js";
1
+ import { t as CsvExporter } from "./csvExporter-CqTylAk9.js";
2
2
 
3
3
  export { CsvExporter as default };
@@ -1,4 +1,4 @@
1
- import { BlobExporter } from "./exporter-ztSF5GbY.cjs";
1
+ import { t as BlobExporter } from "./exporter-ZZesPOOU.cjs";
2
2
 
3
3
  //#region src/exporters/excelExporter.d.ts
4
4
  declare class ExcelExporter implements BlobExporter {
@@ -1,4 +1,4 @@
1
- import { BlobExporter } from "./exporter-BxgFAyWA.js";
1
+ import { t as BlobExporter } from "./exporter-zK7PhTrL.js";
2
2
 
3
3
  //#region src/exporters/excelExporter.d.ts
4
4
  declare class ExcelExporter implements BlobExporter {
@@ -20,5 +20,5 @@ interface ExportOptions {
20
20
  all?: boolean;
21
21
  }
22
22
  //#endregion
23
- export { BlobExporter, ExportOptions, ExporterEntry, StringExporter };
24
- //# sourceMappingURL=exporter-BxgFAyWA.d.ts.map
23
+ export { StringExporter as i, ExportOptions as n, ExporterEntry as r, BlobExporter as t };
24
+ //# sourceMappingURL=exporter-ZZesPOOU.d.cts.map
@@ -20,5 +20,5 @@ interface ExportOptions {
20
20
  all?: boolean;
21
21
  }
22
22
  //#endregion
23
- export { BlobExporter, ExportOptions, ExporterEntry, StringExporter };
24
- //# sourceMappingURL=exporter-ztSF5GbY.d.cts.map
23
+ export { StringExporter as i, ExportOptions as n, ExporterEntry as r, BlobExporter as t };
24
+ //# sourceMappingURL=exporter-zK7PhTrL.d.ts.map
package/dist/index.cjs CHANGED
@@ -2793,10 +2793,10 @@ function calc(props, cache) {
2793
2793
  ...column,
2794
2794
  value
2795
2795
  }));
2796
- else if (props.columns !== void 0) inputColumns = props.columns.map((column) => ({
2796
+ else if (props.columns !== void 0) inputColumns = props.columns.map((column) => column && {
2797
2797
  ...column,
2798
2798
  dependecies: void 0
2799
- }));
2799
+ });
2800
2800
  const globalDefaults = props.defaultColumnProps;
2801
2801
  const mapColumn = ({ id: _id, header, exportHeader, footer, value, renderCell, exportCell, sortBy, disableSort, hidden, classes, styles, filter, width, displaySize }, index) => {
2802
2802
  const id$1 = _id ?? index;