@universal-material/data-grid 0.2.0 → 0.3.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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/custom-elements.json +114 -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/grid-column-def.d.ts +45 -11
  17. package/dist/grid-column-def.js +6 -2
  18. package/dist/grid-column-def.js.map +1 -1
  19. package/dist/grid-column.d.ts +23 -5
  20. package/dist/grid-column.js +32 -5
  21. package/dist/grid-column.js.map +1 -1
  22. package/dist/grid-i18n.js +14 -14
  23. package/dist/grid-i18n.js.map +1 -1
  24. package/dist/grid.d.ts +31 -10
  25. package/dist/grid.js +255 -55
  26. package/dist/grid.js.map +1 -1
  27. package/dist/grid.min.js +457 -418
  28. package/dist/grid.styles.js +42 -6
  29. package/dist/grid.styles.js.map +1 -1
  30. package/dist/render/cell.js +5 -2
  31. package/dist/render/cell.js.map +1 -1
  32. package/dist/row-model/columns.d.ts +21 -3
  33. package/dist/row-model/columns.js +14 -4
  34. package/dist/row-model/columns.js.map +1 -1
  35. package/dist/row-model/filter.d.ts +19 -4
  36. package/dist/row-model/filter.js +29 -9
  37. package/dist/row-model/filter.js.map +1 -1
  38. package/dist/row-model/format.js +1 -1
  39. package/dist/row-model/format.js.map +1 -1
  40. package/dist/state/grid-state.d.ts +2 -2
  41. package/dist/state/grid-state.js.map +1 -1
  42. package/package.json +1 -1
package/dist/grid.d.ts CHANGED
@@ -431,7 +431,8 @@ 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.
@@ -466,8 +467,8 @@ export interface GridColumnReorderEventDetail {
466
467
  * @cssprop --u-grid-sort-indicator-size - Size of the sort arrow. Default `1.125em`.
467
468
  * @cssprop --u-grid-drop-indicator-color - Drag-and-drop drop indicator color.
468
469
  * @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).
470
+ * @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`.
471
+ * @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
472
  * @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
473
  * @cssprop --u-grid-fixed-shadow-color - Shadow at the edge of fixed columns while scrolling.
473
474
  * @cssprop --u-grid-column-chooser-background-color - Column chooser background.
@@ -483,7 +484,7 @@ export interface GridColumnReorderEventDetail {
483
484
  * @cssprop --u-grid-header-filter-background-color - Header filter popover background.
484
485
  * @cssprop --u-grid-header-filter-shape - Header filter popover corner radius. Default `12px`.
485
486
  * @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.
487
+ * @cssprop --u-grid-skeleton-row-color - Color of the placeholders in rows still loading (remote rows, or `loading` with no rows).
487
488
  * @cssprop --u-grid-pager-height - Minimum height of the pager. Default `56px`.
488
489
  * @cssprop --u-grid-modified-cell-background-color - Background of edited, unsaved cells (`editMode="batch"`). Default: primary color at 10%.
489
490
  * @cssprop --u-grid-modified-cell-indicator-color - Corner mark of edited, unsaved cells (not shown by color alone). Default: primary color.
@@ -506,7 +507,7 @@ export interface GridColumnReorderEventDetail {
506
507
  * @csspart cell - Data cells (`<td>`).
507
508
  * @csspart selection-cell - Cells and header of the selection checkbox column.
508
509
  * @csspart selection-checkbox - The selection checkboxes (rows and "select all").
509
- * @csspart no-data - The cell rendered in the empty state.
510
+ * @csspart no-data - The cell rendered in the empty state, or the "Loading…" cell while `loading` has no rows.
510
511
  * @csspart header-cell - Column header cells (`<th>`), bands included.
511
512
  * @csspart band-header-cell - Band header cells (multi-level headers); they also match `header-cell`.
512
513
  * @csspart sort-indicator - The sort arrow (and priority number) in headers and group chips.
@@ -562,8 +563,8 @@ export interface GridColumnReorderEventDetail {
562
563
  * @csspart pager-button - Pager buttons (first, previous, page numbers, next, last).
563
564
  * @csspart page-size-select - The page size `<select>` of the pager.
564
565
  * @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`).
566
+ * @csspart load-panel - The load panel shown while a data source loads or `loading` is set (with rows).
567
+ * @csspart skeleton-row - Rows of a remote source not loaded yet (with `row`), or placeholder rows while `loading` has no rows.
567
568
  * @csspart error-row - The bar shown when the data source failed.
568
569
  * @csspart retry-button - The "Retry" button of the error bar.
569
570
  * @csspart search-highlight - Search matches (`<mark>`) in native cells (not in `renderer` cells).
@@ -602,6 +603,24 @@ export declare class DataGrid extends LitElement {
602
603
  * the translated "No data" text.
603
604
  */
604
605
  noDataRenderer: GridNoDataRenderer | null;
606
+ /**
607
+ * Shows the grid as loading, for `items` you are still fetching. With rows
608
+ * on screen, the load panel (`::part(load-panel)`) covers them; with no rows
609
+ * yet, a "Loading…" row and placeholder rows (`::part(skeleton-row)`) take
610
+ * the place of the empty state (`noDataRenderer` is not called). Placeholder
611
+ * rows are never data: not exported, selected, counted or focusable by API.
612
+ * Does not fire `u-grid-loading`/`u-grid-load`; with `dataSource`, it adds
613
+ * to the source's own loading state (the getter returns only what you set).
614
+ */
615
+ loading: boolean;
616
+ /**
617
+ * Wraps the column header labels in several lines instead of an ellipsis
618
+ * (the header row grows; `--u-grid-header-cell-height` is its minimum). A
619
+ * column's `headerWrap` wins. Auto-size measures the label in one line. If
620
+ * the toolbar and the headers take more than half of the visible height,
621
+ * the headers stop sticking (WCAG 2.4.11).
622
+ */
623
+ headerWrap: boolean;
605
624
  /**
606
625
  * Builds the detail of a row (master-detail; property only). With it, a
607
626
  * toggle column appears at the start and each expanded row is followed by
@@ -940,8 +959,9 @@ export declare class DataGrid extends LitElement {
940
959
  * Column filter (property only): a serializable expression such as
941
960
  * `[['age', '>', 30], 'and', ['name', 'contains', 'an']]`. The filter row
942
961
  * 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`.
962
+ * filter. A condition refers to its column by `path` or, for a computed
963
+ * column (`valueGetter` without `path`), by `name`. The grid keeps a frozen
964
+ * copy (never the host array). Setting it does not fire `u-grid-filter-change`.
945
965
  */
946
966
  get filterValue(): GridFilterExpression | null;
947
967
  set filterValue(value: GridFilterExpression | null | undefined);
@@ -1277,7 +1297,8 @@ export declare class DataGrid extends LitElement {
1277
1297
  clearFilter(): void;
1278
1298
  /**
1279
1299
  * The effective filter: `filterValue` `and` the search, as an expression
1280
- * (copy). The search becomes `[path, 'contains', text]` joined by `or`
1300
+ * (copy). The search becomes `[field, 'contains', text]` (`field`: the
1301
+ * `path`, or the `name` of a computed column) joined by `or`
1281
1302
  * over the visible filterable columns (number and date columns included:
1282
1303
  * `contains` matches their displayed text). `null` without filter.
1283
1304
  */