vira 26.7.2 → 26.9.0

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.
@@ -11,6 +11,8 @@ export type ViraTableKey = Readonly<{
11
11
  } & PartialWithUndefined<{
12
12
  /** If this is not provided, `key` will be used directly. */
13
13
  content: HtmlInterpolation;
14
+ /** If set to `true`, this header (and it's column) won't be rendered. */
15
+ disabled: boolean;
14
16
  }>>;
15
17
  /**
16
18
  * All header definitions for a {@link ViraTable} instance.
@@ -37,7 +37,10 @@ headers, originalData, dataMap, options = {}) {
37
37
  };
38
38
  });
39
39
  if (options.orientation === ViraTableOrientation.Horizontal) {
40
- const rows = headers.map((header) => {
40
+ const rows = filterMap(headers, (header) => {
41
+ if (header.disabled) {
42
+ return undefined;
43
+ }
41
44
  const headerCellArray = options.hideHeaders
42
45
  ? []
43
46
  : [
@@ -65,7 +68,7 @@ headers, originalData, dataMap, options = {}) {
65
68
  cells: allCells,
66
69
  data: undefined,
67
70
  };
68
- });
71
+ }, check.isTruthy);
69
72
  return {
70
73
  headerRow: undefined,
71
74
  rows,
@@ -75,25 +78,31 @@ headers, originalData, dataMap, options = {}) {
75
78
  else {
76
79
  const headerRow = options.hideHeaders
77
80
  ? []
78
- : headers.map((header) => {
81
+ : filterMap(headers, (header) => {
82
+ if (header.disabled) {
83
+ return undefined;
84
+ }
79
85
  return {
80
86
  content: header.content ?? header.key,
81
87
  key: header.key,
82
88
  data: undefined,
83
89
  };
84
- });
90
+ }, check.isTruthy);
85
91
  const rows = filterMap(mappedData, ({ cells, data }) => {
86
92
  if (!cells) {
87
93
  return undefined;
88
94
  }
89
95
  return {
90
- cells: headers.map((header) => {
96
+ cells: filterMap(headers, (header) => {
97
+ if (header.disabled) {
98
+ return undefined;
99
+ }
91
100
  return {
92
101
  content: cells[header.key],
93
102
  key: header.key,
94
103
  data,
95
104
  };
96
- }),
105
+ }, check.isTruthy),
97
106
  data,
98
107
  };
99
108
  }, check.isTruthy);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vira",
3
- "version": "26.7.2",
3
+ "version": "26.9.0",
4
4
  "description": "A simple and highly versatile design system using element-vir.",
5
5
  "keywords": [
6
6
  "design",
@@ -38,9 +38,9 @@
38
38
  "test:docs": "virmator docs check"
39
39
  },
40
40
  "dependencies": {
41
- "@augment-vir/assert": "^31.32.2",
42
- "@augment-vir/common": "^31.32.2",
43
- "@augment-vir/web": "^31.32.2",
41
+ "@augment-vir/assert": "^31.33.0",
42
+ "@augment-vir/common": "^31.33.0",
43
+ "@augment-vir/web": "^31.33.0",
44
44
  "colorjs.io": "^0.5.2",
45
45
  "date-vir": "^7.4.0",
46
46
  "device-navigation": "^4.5.5",
@@ -52,7 +52,7 @@
52
52
  "typed-event-target": "^4.1.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@augment-vir/test": "^31.32.2",
55
+ "@augment-vir/test": "^31.33.0",
56
56
  "@web/dev-server-esbuild": "^1.0.4",
57
57
  "@web/test-runner": "^0.20.2",
58
58
  "@web/test-runner-commands": "^0.9.0",
@@ -63,11 +63,11 @@
63
63
  "markdown-code-example-inserter": "^3.0.3",
64
64
  "typedoc": "^0.28.10",
65
65
  "typescript": "5.9.2",
66
- "vite": "^7.1.2",
66
+ "vite": "^7.1.3",
67
67
  "vite-tsconfig-paths": "^5.1.4"
68
68
  },
69
69
  "peerDependencies": {
70
- "element-vir": "^26.7.2"
70
+ "element-vir": "^26.9.0"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=22"