sveltacular 0.0.50 → 0.0.51

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.
@@ -39,6 +39,10 @@ const format = (row, key) => {
39
39
  const col = cols.find((col2) => col2.key === key);
40
40
  if (!col)
41
41
  return row[key];
42
+ if ((row[key] === null || row[key] === void 0) && col.nullText)
43
+ return col.nullText;
44
+ if (String(row[key]).trim() === "" && col.emptyText)
45
+ return col.emptyText;
42
46
  if (col.format)
43
47
  return col.format(row, key);
44
48
  return row[key];
@@ -3,6 +3,8 @@ export type DataCol<T extends DataRow = DataRow> = {
3
3
  key: string;
4
4
  label: string;
5
5
  type?: string;
6
+ nullText?: string;
7
+ emptyText?: string;
6
8
  format?: (row: T, key: keyof T) => string;
7
9
  link?: (row: T, key: keyof T) => string;
8
10
  hide?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltacular",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "description": "A Svelte component library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",