@malloydata/render 0.0.105-dev231127184813 → 0.0.105-dev231127212430

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.
@@ -72,18 +72,22 @@ const renderFieldContent = (row, f, options) => {
72
72
  .rowLimit=${options.pinnedHeader ? 1 : Infinity}
73
73
  ></malloy-table>`;
74
74
  }
75
+ let value = row.cell(f).value;
75
76
  if (options.pinnedHeader)
76
- return renderCell(f, '', {
77
- hideStartGutter: (0, util_1.isFirstChild)(f),
78
- hideEndGutter: (0, util_1.isLastChild)(f),
79
- });
80
- return renderCell(f, row.cell(f).value, {
77
+ value = '';
78
+ else if (f.isAtomicField() && f.isNumber())
79
+ value = value.toLocaleString();
80
+ return renderCell(f, value, {
81
81
  hideStartGutter: (0, util_1.isFirstChild)(f),
82
82
  hideEndGutter: (0, util_1.isLastChild)(f),
83
83
  });
84
84
  };
85
85
  const renderField = (row, f, options) => {
86
- return (0, lit_1.html) `<td class="column-cell">
86
+ return (0, lit_1.html) `<td
87
+ class="column-cell ${(0, class_map_js_1.classMap)({
88
+ numeric: f.isAtomicField() && f.isNumber(),
89
+ })}"
90
+ >
87
91
  ${renderFieldContent(row, f, options)}
88
92
  </td>`;
89
93
  };
@@ -95,7 +99,11 @@ const renderHeader = (f) => {
95
99
  const isLast = (0, util_1.isLastChild)(f);
96
100
  const isParentLast = (0, util_1.isLastChild)(f.parentExplore);
97
101
  const hideEndGutter = isLast && (isParentLast || isParentNotAField);
98
- return (0, lit_1.html) `<th class="column-cell">
102
+ return (0, lit_1.html) `<th
103
+ class="column-cell ${(0, class_map_js_1.classMap)({
104
+ numeric: f.isAtomicField() && f.isNumber(),
105
+ })}"
106
+ >
99
107
  ${renderCell(f, f.name, {
100
108
  hideStartGutter,
101
109
  hideEndGutter,
@@ -235,6 +243,10 @@ Table.styles = (0, lit_1.css) `
235
243
  color: var(--table-header-color);
236
244
  }
237
245
 
246
+ .column-cell.numeric {
247
+ text-align: right;
248
+ }
249
+
238
250
  .cell-wrapper {
239
251
  height: var(--table-row-height);
240
252
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/render",
3
- "version": "0.0.105-dev231127184813",
3
+ "version": "0.0.105-dev231127212430",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@lit/context": "^1.1.0",
27
- "@malloydata/malloy": "^0.0.105-dev231127184813",
27
+ "@malloydata/malloy": "^0.0.105-dev231127212430",
28
28
  "@types/luxon": "^2.4.0",
29
29
  "lit": "^3.0.2",
30
30
  "lodash": "^4.17.20",