@companycam/slab-web 2.2.1 → 2.2.3

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.
package/index.mjs CHANGED
@@ -18673,15 +18673,17 @@ const mC = w.button`
18673
18673
  onSortingChange: u,
18674
18674
  ...d
18675
18675
  }) => {
18676
- const [p, f] = ae(() => [...r]), [g, m] = ae([]), h = c ?? g, v = c !== void 0, y = ($) => {
18677
- u && u($), v || m($);
18678
- }, b = gC({
18679
- columns: [...t],
18676
+ const [p, f] = ae(() => [...r]), [g, m] = ae([]), h = c ?? g, v = c !== void 0, b = gC({
18677
+ // asserting columns as a mutable type because react-table expects one, but in reality we shouldn't mutate the array
18678
+ columns: t,
18680
18679
  data: p,
18681
18680
  state: {
18682
- sorting: [...h]
18681
+ // asserting sorting as a mutable type because react-table expects one, but in reality we shouldn't mutate the array
18682
+ sorting: h
18683
+ },
18684
+ onSortingChange: ($) => {
18685
+ u && u($), v || m($);
18683
18686
  },
18684
- onSortingChange: y,
18685
18687
  getCoreRowModel: sC(),
18686
18688
  getPaginationRowModel: cC(),
18687
18689
  getSortedRowModel: v ? void 0 : uC(),
@@ -1,14 +1,13 @@
1
1
  import { ComponentPropsWithRef } from 'react';
2
- import { Row, CellContext, ColumnDef, ColumnSort, OnChangeFn, SortingState } from '@tanstack/react-table';
2
+ import { CellContext, ColumnDef, ColumnSort, OnChangeFn, Row, SortingState } from '@tanstack/react-table';
3
3
  import { CellSize } from '../shared/types';
4
- type FilteredCellSize = Exclude<CellSize, 'auto'>;
5
- type TableProps<T> = ComponentPropsWithRef<'table'> & {
4
+ export type TableProps<T> = ComponentPropsWithRef<'table'> & {
6
5
  defaultData: readonly T[];
7
6
  /** Pulls in our spacing tokens for easy margin setting (e.g., `ccMargin="0 m xl"`). */
8
7
  ccMargin?: string;
9
8
  columns: readonly Readonly<ColumnDef<T, unknown>>[];
10
9
  /** Make sure this matches the number of `columns` */
11
- columnSizes: readonly FilteredCellSize[];
10
+ columnSizes: readonly CellSize[];
12
11
  /** Array of columns to sort by default, provided column id and whether or not sort should be descending */
13
12
  defaultSortedColumns?: readonly Readonly<{
14
13
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companycam/slab-web",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "main": "./index.js",
5
5
  "module": "./index.mjs",
6
6
  "types": "./index.d.ts",