mig-schema-table 3.0.76 → 3.0.77

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.
@@ -23,7 +23,11 @@ import ThMenu from "./ThMenu";
23
23
  import { saveAs } from "file-saver";
24
24
  import { unparse } from "papaparse";
25
25
  const startOfTheWorldDate = new Date("1000-01-01 00:00:00Z");
26
- const intFormatter = new Intl.NumberFormat("nl-NL");
26
+ const numberFormatter = new Intl.NumberFormat("nl-NL");
27
+ const currencyFormatter = new Intl.NumberFormat("nl-NL", {
28
+ style: "currency",
29
+ currency: "EUR",
30
+ });
27
31
  function getSortByValue(propSchema, propConfig) {
28
32
  var _a;
29
33
  if ((propConfig === null || propConfig === void 0 ? void 0 : propConfig.sortByValue) !== undefined) {
@@ -149,10 +153,16 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
149
153
  case "boolean":
150
154
  prev[propName] = rawValue ? "✓" : "✕";
151
155
  return prev;
156
+ case "number":
152
157
  case "integer":
153
- prev[propName] = [undefined, null].includes(rawValue)
154
- ? ""
155
- : intFormatter.format(rawValue);
158
+ if (rawValue === undefined) {
159
+ prev[propName] = "";
160
+ return prev;
161
+ }
162
+ prev[propName] =
163
+ schema.format === "currency"
164
+ ? currencyFormatter.format(rawValue)
165
+ : numberFormatter.format(rawValue);
156
166
  return prev;
157
167
  // @ts-ignore
158
168
  case "string":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mig-schema-table",
3
- "version": "3.0.76",
3
+ "version": "3.0.77",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/"