@platned/ui 1.1.0 → 1.1.1

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.
@@ -198,13 +198,18 @@ interface DataTableFilterOptions {
198
198
  variant?: 'menu' | 'buttons' | 'tabs';
199
199
  /** Label of the "everything" choice of `buttons` and `tabs`. Default "All". */
200
200
  allLabel?: string;
201
+ /**
202
+ * Show the filter but don't let it be used, e.g. while the server can't filter by this column yet. A string says
203
+ * why, on hover. New in 1.1.1.
204
+ */
205
+ disabled?: boolean | string;
201
206
  }
202
207
  type DataTableField<TData> = ValueField<TData> & {
203
208
  /** Column id. Default: the key. */
204
209
  id?: string;
205
210
  /** Sort by this column. Default `true`, except for `badge` columns (lists). */
206
211
  sortable?: boolean;
207
- /** Can be hidden from the Columns menu. Default `true`. */
212
+ /** Can be hidden from its header menu and the View menu. Default `true`. */
208
213
  hideable?: boolean;
209
214
  /** A faceted filter for this column in the toolbar. */
210
215
  filter?: boolean | DataTableFilterOptions;
@@ -242,6 +247,8 @@ interface DataTableFilterMeta {
242
247
  options?: string[];
243
248
  variant: 'menu' | 'buttons' | 'tabs';
244
249
  allLabel: string;
250
+ /** Shown but not usable; a string says why. */
251
+ disabled?: boolean | string;
245
252
  /** The label and badge colour for one value, as the column shows it. */
246
253
  describe: (value: string) => {
247
254
  label: string;
@@ -325,7 +332,11 @@ interface DataTableViewOptionsProps<TData> {
325
332
  /** Trigger text. Default "View". */
326
333
  label?: string;
327
334
  }
328
- /** A "View" menu that shows and hides every column whose `enableHiding` is not false. */
335
+ /**
336
+ * A "View" menu that shows and hides every column whose `enableHiding` is not false. The button
337
+ * counts the hidden columns, and "Show all columns" brings them all back, so a column hidden from
338
+ * its header menu is never lost (1.1.1; before, the menu was also hidden below `lg`).
339
+ */
329
340
  declare function DataTableViewOptions<TData>({ table, label }: DataTableViewOptionsProps<TData>): react.JSX.Element | null;
330
341
  interface DataTablePaginationProps<TData> {
331
342
  table: Table<TData>;
@@ -547,6 +558,12 @@ interface DataTableManual {
547
558
  pagination?: boolean;
548
559
  /** Total rows on the server. Needed with `pagination`, so the pager knows the page count. */
549
560
  rowCount?: number;
561
+ /**
562
+ * With `filtering`: each filter's counts from the server, by column id, then value, e.g.
563
+ * `{ status: { active: 120, inactive: 4 } }`. The rows on hand are one page, so the table can't
564
+ * count them itself; a filter the server sends no counts for shows none. New in 1.1.1.
565
+ */
566
+ facets?: Record<string, Record<string, number>>;
550
567
  }
551
568
  interface DataTableSearchOptions {
552
569
  /** Filter one column instead of every column. */
@@ -554,6 +571,11 @@ interface DataTableSearchOptions {
554
571
  placeholder?: string;
555
572
  /** Accessible name. Default "Search". */
556
573
  label?: string;
574
+ /**
575
+ * Show the box but don't let it be used, e.g. while the server can't search yet. A string says why, on hover.
576
+ * New in 1.1.1.
577
+ */
578
+ disabled?: boolean | string;
557
579
  }
558
580
  interface DataTableRowLinkProps {
559
581
  href: string;
@@ -681,8 +703,13 @@ interface DataTableProps<TData, TValue = unknown> {
681
703
  * header row pinned. Works with horizontal scrolling and sticky columns, and caps the card list
682
704
  * in the responsive layout. The pattern of MUI's `TableContainer` + `stickyHeader` and Ant
683
705
  * Design's `scroll.y`. New in 0.7.1.
706
+ *
707
+ * `'fill'` takes the height of the parent instead (a flex column, or a box with a set height): the
708
+ * toolbar and pager stay put and the rows scroll in what is left, as on a list page whose heading
709
+ * stays fixed. Where the parent has no set height (a page that scrolls as a whole, on a phone) the
710
+ * table simply grows. New in 1.1.1.
684
711
  */
685
- maxHeight?: number | string;
712
+ maxHeight?: number | string | 'fill';
686
713
  manual?: DataTableManual;
687
714
  /** Controlled state. Any key you pass is controlled; the rest stay internal. */
688
715
  state?: Partial<DataTableState>;