schummar-table 0.50.0 → 0.50.4

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
@@ -3107,6 +3107,7 @@ function ResizeHandle() {
3107
3107
  const table = useTableContext();
3108
3108
  const columnId = useColumnContext();
3109
3109
  const enabled = table.useState((state) => state.props.enableColumnResize);
3110
+ const hasFilter = table.useState((state) => state.filters.get(columnId) !== void 0);
3110
3111
  function onPointerDown(event) {
3111
3112
  event.stopPropagation();
3112
3113
  event.target.setPointerCapture(event.pointerId);
@@ -3116,7 +3117,8 @@ function ResizeHandle() {
3116
3117
  const div = event.target;
3117
3118
  if (!div.hasPointerCapture(event.pointerId)) return;
3118
3119
  const parent = div.parentElement;
3119
- const width = Math.max(event.clientX - parent.getBoundingClientRect().left + 5, 50);
3120
+ const minWidth = hasFilter ? 80 : 50;
3121
+ const width = Math.max(event.clientX - parent.getBoundingClientRect().left + 5, minWidth);
3120
3122
  table.update((state) => {
3121
3123
  state.columnWidths.set(columnId, `${width}px`);
3122
3124
  });