vira 25.12.3 → 25.13.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.
@@ -6,7 +6,7 @@ export * from './pop-up/vira-menu-trigger.element.js';
6
6
  export * from './pop-up/vira-menu.element.js';
7
7
  export * from './pop-up/vira-pop-up-menu.element.js';
8
8
  export * from './pop-up/vira-pop-up-trigger.element.js';
9
- export * from './table/define-table.js';
9
+ export * from './table/create-table.js';
10
10
  export * from './table/vira-table.element.js';
11
11
  export * from './vira-bold-text.element.js';
12
12
  export * from './vira-button.element.js';
@@ -6,7 +6,7 @@ export * from './pop-up/vira-menu-trigger.element.js';
6
6
  export * from './pop-up/vira-menu.element.js';
7
7
  export * from './pop-up/vira-pop-up-menu.element.js';
8
8
  export * from './pop-up/vira-pop-up-trigger.element.js';
9
- export * from './table/define-table.js';
9
+ export * from './table/create-table.js';
10
10
  export * from './table/vira-table.element.js';
11
11
  export * from './vira-bold-text.element.js';
12
12
  export * from './vira-button.element.js';
@@ -7,19 +7,30 @@ import { type HtmlInterpolation } from 'element-vir';
7
7
  */
8
8
  export type ViraTableCell<Columns extends ViraTableColumns | undefined = undefined> = undefined extends Columns ? Record<PropertyKey, HtmlInterpolation> : Record<ArrayElement<Exclude<Columns, undefined>>['key'], HtmlInterpolation>;
9
9
  /**
10
- * A column definition for {@link ViraTableSetup}.
10
+ * An individual column definition in {@link ViraTableColumns}.
11
11
  *
12
12
  * @category Internal
13
13
  */
14
- export type ViraTableColumns = ReadonlyArray<Readonly<{
14
+ export type ViraTableColumn = Readonly<{
15
15
  /** The key that cells must use to set a value for this column. */
16
16
  key: PropertyKey;
17
- /** This will be displayed in the header for this column. */
18
- label: HtmlInterpolation;
19
17
  } & PartialWithUndefined<{
18
+ /**
19
+ * This will be displayed in the header for this column. If no `label` is provided, the
20
+ * `key` will be used.
21
+ */
22
+ label: HtmlInterpolation;
20
23
  /** If set to `true`, this column will not be rendered. */
21
24
  hide: boolean;
22
- }>>>;
25
+ /** If true, this column is a header column, so all cells in it will be rendered as headers. */
26
+ isHeader: boolean;
27
+ }>>;
28
+ /**
29
+ * A column definition for {@link ViraTableSetup}.
30
+ *
31
+ * @category Internal
32
+ */
33
+ export type ViraTableColumns = ReadonlyArray<ViraTableColumn>;
23
34
  /**
24
35
  * An individual row in {@link ViraTableSetup}.
25
36
  *
@@ -1,6 +1,6 @@
1
1
  import { type PartialWithUndefined } from '@augment-vir/common';
2
2
  import { type AttributeValues, type CSSResult } from 'element-vir';
3
- import { type ViraTableRow, type ViraTableSetup } from './define-table.js';
3
+ import { type ViraTableRow, type ViraTableSetup } from './create-table.js';
4
4
  /**
5
5
  * Element tagnames that have passthroughs setup for them in {@link ViraTable}.
6
6
  *
@@ -59,15 +59,16 @@ export const ViraTable = defineViraElement()({
59
59
  if (column.hide) {
60
60
  return nothing;
61
61
  }
62
+ const cellElement = column.isHeader ? 'th' : 'td';
62
63
  return html `
63
- <td
64
+ <${cellElement}
64
65
  ${inputs.attributePassthrough?.td
65
66
  ? attributes(inputs.attributePassthrough.td)
66
67
  : nothing}
67
68
  style=${ifDefined(inputs.stylePassthrough?.td)}
68
69
  >
69
70
  ${row.cells[column.key]}
70
- </td>
71
+ </${cellElement}>
71
72
  `;
72
73
  });
73
74
  const isClickable = !inputs.preventRowClicks && !row.disabled;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vira",
3
- "version": "25.12.3",
3
+ "version": "25.13.0",
4
4
  "description": "A simple and highly versatile design system using element-vir.",
5
5
  "keywords": [
6
6
  "design",
@@ -67,7 +67,7 @@
67
67
  "vite-tsconfig-paths": "^5.1.4"
68
68
  },
69
69
  "peerDependencies": {
70
- "element-vir": "^25.12.3"
70
+ "element-vir": "^25.13.0"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=22"