@malloydata/render 0.0.54-dev230706212915 → 0.0.54

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.
@@ -27,6 +27,7 @@ const drill_1 = require("../drill");
27
27
  const container_1 = require("./container");
28
28
  const text_1 = require("./text");
29
29
  const utils_1 = require("./utils");
30
+ const tags_utils_1 = require("../tags_utils");
30
31
  class HTMLDashboardRenderer extends container_1.ContainerRenderer {
31
32
  constructor() {
32
33
  super(...arguments);
@@ -50,6 +51,9 @@ class HTMLDashboardRenderer extends container_1.ContainerRenderer {
50
51
  const rowElement = this.document.createElement('div');
51
52
  rowElement.style.position = 'relative';
52
53
  for (const field of dimensions) {
54
+ if ((0, tags_utils_1.isFieldHidden)(field)) {
55
+ continue;
56
+ }
53
57
  const renderer = this.childRenderers[field.name];
54
58
  const rendered = await renderer.render(row.cell(field));
55
59
  const renderedDimension = this.document.createElement('div');
@@ -76,6 +80,9 @@ class HTMLDashboardRenderer extends container_1.ContainerRenderer {
76
80
  const measuresContainer = this.document.createElement('div');
77
81
  measuresContainer.style.cssText = MEASURE_BOXES;
78
82
  for (const field of measures) {
83
+ if ((0, tags_utils_1.isFieldHidden)(field)) {
84
+ continue;
85
+ }
79
86
  const childRenderer = this.childRenderers[field.name];
80
87
  await (0, utils_1.yieldTask)();
81
88
  const rendered = await childRenderer.render(row.cell(field));
@@ -27,6 +27,7 @@ const drill_1 = require("../drill");
27
27
  const container_1 = require("./container");
28
28
  const number_1 = require("./number");
29
29
  const utils_1 = require("./utils");
30
+ const tags_utils_1 = require("../tags_utils");
30
31
  class HTMLTableRenderer extends container_1.ContainerRenderer {
31
32
  constructor() {
32
33
  super(...arguments);
@@ -40,6 +41,9 @@ class HTMLTableRenderer extends container_1.ContainerRenderer {
40
41
  }
41
42
  const header = this.document.createElement('tr');
42
43
  table.field.intrinsicFields.forEach(field => {
44
+ if ((0, tags_utils_1.isFieldHidden)(field)) {
45
+ return;
46
+ }
43
47
  let name = (0, utils_1.formatTitle)(this.options, field, this.options.dataStyles[field.name], field.parentExplore.queryTimezone);
44
48
  const childRenderer = this.childRenderers[name];
45
49
  const isNumeric = childRenderer instanceof number_1.HTMLNumberRenderer;
@@ -68,6 +72,9 @@ class HTMLTableRenderer extends container_1.ContainerRenderer {
68
72
  for (const row of table) {
69
73
  const rowElement = this.document.createElement('tr');
70
74
  for (const field of table.field.intrinsicFields) {
75
+ if ((0, tags_utils_1.isFieldHidden)(field)) {
76
+ continue;
77
+ }
71
78
  const childRenderer = this.childRenderers[field.name];
72
79
  const isNumeric = childRenderer instanceof number_1.HTMLNumberRenderer;
73
80
  await (0, utils_1.yieldTask)();
@@ -0,0 +1,2 @@
1
+ import { Field } from '@malloydata/malloy';
2
+ export declare function isFieldHidden(field: Field): string | boolean;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining
6
+ * a copy of this software and associated documentation files
7
+ * (the "Software"), to deal in the Software without restriction,
8
+ * including without limitation the rights to use, copy, modify, merge,
9
+ * publish, distribute, sublicense, and/or sell copies of the Software,
10
+ * and to permit persons to whom the Software is furnished to do so,
11
+ * subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be
14
+ * included in all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.isFieldHidden = void 0;
26
+ function isFieldHidden(field) {
27
+ return field.getTags().getMalloyTags().properties['hidden'];
28
+ }
29
+ exports.isFieldHidden = isFieldHidden;
30
+ //# sourceMappingURL=tags_utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/render",
3
- "version": "0.0.54-dev230706212915",
3
+ "version": "0.0.54",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "prepublishOnly": "npm run build"
19
19
  },
20
20
  "dependencies": {
21
- "@malloydata/malloy": "^0.0.54-dev230706212915",
21
+ "@malloydata/malloy": "^0.0.54",
22
22
  "@types/luxon": "^2.4.0",
23
23
  "lodash": "^4.17.20",
24
24
  "luxon": "^2.4.0",