@universal-material/data-grid 0.2.0 → 0.3.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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/custom-elements.json +118 -15
  3. package/dist/data/data-source.d.ts +6 -2
  4. package/dist/data/data-source.js.map +1 -1
  5. package/dist/export-xlsx/index.d.ts +2 -1
  6. package/dist/export-xlsx/index.js +4 -2
  7. package/dist/export-xlsx/index.js.map +1 -1
  8. package/dist/features/column-chooser.js +1 -1
  9. package/dist/features/column-chooser.js.map +1 -1
  10. package/dist/features/filter-row.d.ts +1 -0
  11. package/dist/features/filter-row.js +13 -8
  12. package/dist/features/filter-row.js.map +1 -1
  13. package/dist/features/header-filter.d.ts +4 -1
  14. package/dist/features/header-filter.js +7 -5
  15. package/dist/features/header-filter.js.map +1 -1
  16. package/dist/features/scroll-port.d.ts +7 -0
  17. package/dist/features/scroll-port.js +22 -0
  18. package/dist/features/scroll-port.js.map +1 -1
  19. package/dist/grid-column-def.d.ts +45 -11
  20. package/dist/grid-column-def.js +6 -2
  21. package/dist/grid-column-def.js.map +1 -1
  22. package/dist/grid-column.d.ts +23 -5
  23. package/dist/grid-column.js +32 -5
  24. package/dist/grid-column.js.map +1 -1
  25. package/dist/grid-i18n.js +14 -14
  26. package/dist/grid-i18n.js.map +1 -1
  27. package/dist/grid.d.ts +36 -10
  28. package/dist/grid.js +298 -56
  29. package/dist/grid.js.map +1 -1
  30. package/dist/grid.min.js +445 -387
  31. package/dist/grid.styles.js +60 -5
  32. package/dist/grid.styles.js.map +1 -1
  33. package/dist/render/cell.js +5 -2
  34. package/dist/render/cell.js.map +1 -1
  35. package/dist/row-model/columns.d.ts +21 -3
  36. package/dist/row-model/columns.js +14 -4
  37. package/dist/row-model/columns.js.map +1 -1
  38. package/dist/row-model/filter.d.ts +19 -4
  39. package/dist/row-model/filter.js +29 -9
  40. package/dist/row-model/filter.js.map +1 -1
  41. package/dist/row-model/format.js +1 -1
  42. package/dist/row-model/format.js.map +1 -1
  43. package/dist/state/grid-state.d.ts +2 -2
  44. package/dist/state/grid-state.js.map +1 -1
  45. package/package.json +1 -1
package/dist/grid.d.ts CHANGED
@@ -431,10 +431,12 @@ export interface GridColumnReorderEventDetail {
431
431
  * @cssprop --u-grid-toolbar-padding - Padding of the bar. Default `8px 16px`.
432
432
  * @cssprop --u-grid-toolbar-block-padding - Block padding of the bar. Default `8px`.
433
433
  * @cssprop --u-grid-toolbar-inline-padding - Inline padding of the bar. Default: the cell inline padding.
434
- * @cssprop --u-grid-header-cell-height - Height of the column header cells. Default `46px`.
434
+ * @cssprop --u-grid-toolbar-gap - Space between the bar items and between its lines (a `gap` value). Default `8px`. A change at runtime applies at the next toolbar layout (resize or item change).
435
+ * @cssprop --u-grid-header-cell-height - Minimum height of the column header cells (rows with `header-wrap` grow). Default `46px`.
435
436
  * @cssprop --u-grid-header-cell-padding - Header cell padding.
436
437
  * @cssprop --u-grid-header-cell-font-size - Header cell font size. Default `0.8125rem`.
437
438
  * @cssprop --u-grid-header-cell-font-weight - Header cell font weight.
439
+ * @cssprop --u-grid-header-cell-max-lines - With `header-wrap`, max lines of the default header label (ellipsis on the last). Integer or `none` (default).
438
440
  * @cssprop --u-grid-cell-padding - Data cell padding (shorthand; wins over the longhands). Default `13px 16px`.
439
441
  * @cssprop --u-grid-cell-block-padding - Block padding of data and header cells; wins over the old `--u-table-cell-padding` and `--u-grid-data-cell-padding`. Default `13px`.
440
442
  * @cssprop --u-grid-cell-inline-padding - Inline padding of data and header cells; wins over the old `--u-table-cell-padding` and `--u-grid-data-cell-padding`. Default `16px`.
@@ -466,8 +468,8 @@ export interface GridColumnReorderEventDetail {
466
468
  * @cssprop --u-grid-sort-indicator-size - Size of the sort arrow. Default `1.125em`.
467
469
  * @cssprop --u-grid-drop-indicator-color - Drag-and-drop drop indicator color.
468
470
  * @cssprop --u-grid-drop-indicator-width - Drop indicator thickness. Default `3px`.
469
- * @cssprop --u-grid-resize-handle-width - Invisible resize hit area at the end of each header cell (over the end padding, capped to it; the cursor changes on hover). Default `8px`.
470
- * @cssprop --u-grid-column-header-menu-button-size - Size of the "⋮" column header menu button and of the header filter button. Default `24px` (WCAG 2.5.8).
471
+ * @cssprop --u-grid-resize-handle-width - Invisible resize area at the end of each header cell, over its end padding (the header buttons reach up to it). Default `8px`.
472
+ * @cssprop --u-grid-column-header-menu-button-size - Size of the header "⋮" and filter buttons, side by side. Default `24px` (WCAG 2.5.8; below it, add spacing).
471
473
  * @cssprop --u-grid-resize-handle-color - Color of the separator shown at the column edge while dragging to resize. Default: `--u-grid-drop-indicator-color`.
472
474
  * @cssprop --u-grid-fixed-shadow-color - Shadow at the edge of fixed columns while scrolling.
473
475
  * @cssprop --u-grid-column-chooser-background-color - Column chooser background.
@@ -483,7 +485,7 @@ export interface GridColumnReorderEventDetail {
483
485
  * @cssprop --u-grid-header-filter-background-color - Header filter popover background.
484
486
  * @cssprop --u-grid-header-filter-shape - Header filter popover corner radius. Default `12px`.
485
487
  * @cssprop --u-grid-load-panel-background-color - Background of the load panel.
486
- * @cssprop --u-grid-skeleton-row-color - Color of the placeholders in rows still loading.
488
+ * @cssprop --u-grid-skeleton-row-color - Color of the placeholders in rows still loading (remote rows, or `loading` with no rows).
487
489
  * @cssprop --u-grid-pager-height - Minimum height of the pager. Default `56px`.
488
490
  * @cssprop --u-grid-modified-cell-background-color - Background of edited, unsaved cells (`editMode="batch"`). Default: primary color at 10%.
489
491
  * @cssprop --u-grid-modified-cell-indicator-color - Corner mark of edited, unsaved cells (not shown by color alone). Default: primary color.
@@ -506,7 +508,7 @@ export interface GridColumnReorderEventDetail {
506
508
  * @csspart cell - Data cells (`<td>`).
507
509
  * @csspart selection-cell - Cells and header of the selection checkbox column.
508
510
  * @csspart selection-checkbox - The selection checkboxes (rows and "select all").
509
- * @csspart no-data - The cell rendered in the empty state.
511
+ * @csspart no-data - The cell rendered in the empty state, or the "Loading…" cell while `loading` has no rows.
510
512
  * @csspart header-cell - Column header cells (`<th>`), bands included.
511
513
  * @csspart band-header-cell - Band header cells (multi-level headers); they also match `header-cell`.
512
514
  * @csspart sort-indicator - The sort arrow (and priority number) in headers and group chips.
@@ -562,8 +564,8 @@ export interface GridColumnReorderEventDetail {
562
564
  * @csspart pager-button - Pager buttons (first, previous, page numbers, next, last).
563
565
  * @csspart page-size-select - The page size `<select>` of the pager.
564
566
  * @csspart page-info - The "Page x of y (n items)" text of the pager.
565
- * @csspart load-panel - The load panel shown while a data source loads.
566
- * @csspart skeleton-row - Rows of a remote source not loaded yet (with `row`).
567
+ * @csspart load-panel - The load panel shown while a data source loads or `loading` is set (with rows).
568
+ * @csspart skeleton-row - Rows of a remote source not loaded yet (with `row`), or placeholder rows while `loading` has no rows.
567
569
  * @csspart error-row - The bar shown when the data source failed.
568
570
  * @csspart retry-button - The "Retry" button of the error bar.
569
571
  * @csspart search-highlight - Search matches (`<mark>`) in native cells (not in `renderer` cells).
@@ -602,6 +604,28 @@ export declare class DataGrid extends LitElement {
602
604
  * the translated "No data" text.
603
605
  */
604
606
  noDataRenderer: GridNoDataRenderer | null;
607
+ /**
608
+ * Shows the grid as loading, for `items` you are still fetching. With rows
609
+ * on screen, the load panel (`::part(load-panel)`) covers them; with no rows
610
+ * yet, a "Loading…" row and placeholder rows (`::part(skeleton-row)`) take
611
+ * the place of the empty state (`noDataRenderer` is not called). Placeholder
612
+ * rows are never data: not exported, selected, counted or focusable by API.
613
+ * Does not fire `u-grid-loading`/`u-grid-load`; with `dataSource`, it adds
614
+ * to the source's own loading state (the getter returns only what you set).
615
+ */
616
+ loading: boolean;
617
+ /**
618
+ * Wraps the column header labels in several lines instead of an ellipsis
619
+ * (the header row grows; `--u-grid-header-cell-height` is its minimum). It
620
+ * breaks only between words (hyphenation follows the `lang`); a word longer
621
+ * than the column ends in an ellipsis, and `--u-grid-header-cell-max-lines`
622
+ * limits the lines. A cut default label shows its full text as a tooltip on
623
+ * hover; from the keyboard, widen the column (Alt+→) or auto-size it from
624
+ * the header menu. A column's `headerWrap` wins. Auto-size measures the
625
+ * label in one line. If the toolbar and the headers take more than half of
626
+ * the visible height, the headers stop sticking (WCAG 2.4.11).
627
+ */
628
+ headerWrap: boolean;
605
629
  /**
606
630
  * Builds the detail of a row (master-detail; property only). With it, a
607
631
  * toggle column appears at the start and each expanded row is followed by
@@ -940,8 +964,9 @@ export declare class DataGrid extends LitElement {
940
964
  * Column filter (property only): a serializable expression such as
941
965
  * `[['age', '>', 30], 'and', ['name', 'contains', 'an']]`. The filter row
942
966
  * and the header filter read and write it, so it always holds the current
943
- * filter. The grid keeps a frozen copy (never the host array). Setting it
944
- * does not fire `u-grid-filter-change`.
967
+ * filter. A condition refers to its column by `path` or, for a computed
968
+ * column (`valueGetter` without `path`), by `name`. The grid keeps a frozen
969
+ * copy (never the host array). Setting it does not fire `u-grid-filter-change`.
945
970
  */
946
971
  get filterValue(): GridFilterExpression | null;
947
972
  set filterValue(value: GridFilterExpression | null | undefined);
@@ -1277,7 +1302,8 @@ export declare class DataGrid extends LitElement {
1277
1302
  clearFilter(): void;
1278
1303
  /**
1279
1304
  * The effective filter: `filterValue` `and` the search, as an expression
1280
- * (copy). The search becomes `[path, 'contains', text]` joined by `or`
1305
+ * (copy). The search becomes `[field, 'contains', text]` (`field`: the
1306
+ * `path`, or the `name` of a computed column) joined by `or`
1281
1307
  * over the visible filterable columns (number and date columns included:
1282
1308
  * `contains` matches their displayed text). `null` without filter.
1283
1309
  */