@3mo/data-grid 0.8.8-rc.0 → 0.8.9

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.
@@ -38,7 +38,6 @@ export type DataGridSorting<TData> = DataGridSortingDefinition<TData> | Array<Da
38
38
  * @attr columns - The columns to be displayed in the DataGrid. It is an array of objects, where each object represents a column.
39
39
  * @attr headerHidden - Whether the header should be hidden.
40
40
  * @attr preventVerticalContentScroll - Whether the content should be prevented from scrolling vertically.
41
- * @attr virtualizationThreshold - The threshold from which the virtualization will kick in.
42
41
  * @attr page - The current page.
43
42
  * @attr pagination - The pagination mode. It can be either `auto` or a number.
44
43
  * @attr sorting - The sorting mode. It is an object with `selector` and `strategy` properties.
@@ -98,7 +97,6 @@ export declare class DataGrid<TData, TDetailsElement extends Element | undefined
98
97
  static readonly cellRelativeFontSize: LocalStorage<number>;
99
98
  static readonly pageSize: LocalStorage<number>;
100
99
  static readonly hasAlternatingBackground: LocalStorage<boolean>;
101
- protected static readonly virtualizationThreshold: number;
102
100
  readonly dataChange: EventDispatcher<Array<TData>>;
103
101
  readonly selectionChange: EventDispatcher<Array<TData>>;
104
102
  readonly pageChange: EventDispatcher<number>;
@@ -117,7 +115,6 @@ export declare class DataGrid<TData, TDetailsElement extends Element | undefined
117
115
  columns: DataGridColumn<TData, unknown>[];
118
116
  headerHidden: boolean;
119
117
  preventVerticalContentScroll: boolean;
120
- virtualizationThreshold: number;
121
118
  page: number;
122
119
  pagination?: DataGridPagination;
123
120
  sorting?: DataGridSorting<TData>;
@@ -145,9 +142,10 @@ export declare class DataGrid<TData, TDetailsElement extends Element | undefined
145
142
  exportable: boolean;
146
143
  cellFontSize: number;
147
144
  rowHeight: number;
148
- get rows(): Array<DataGridRow<TData, TDetailsElement>>;
149
145
  private readonly header?;
146
+ private readonly scroller?;
150
147
  private readonly content?;
148
+ readonly rows: Array<DataGridRow<TData, TDetailsElement>>;
151
149
  private readonly footer?;
152
150
  private readonly sidePanel?;
153
151
  private readonly columnsSlot?;
@@ -157,7 +155,6 @@ export declare class DataGrid<TData, TDetailsElement extends Element | undefined
157
155
  handlePaginationChange(pagination?: DataGridPagination): void;
158
156
  setData(data: Array<TData>, selectionBehavior?: DataGridSelectionBehaviorOnDataChange): void;
159
157
  get hasSelection(): boolean;
160
- get isUsingSubgrid(): boolean;
161
158
  selectAll(...parameters: Parameters<typeof this.selectionController.selectAll>): void;
162
159
  deselectAll(...parameters: Parameters<typeof this.selectionController.deselectAll>): void;
163
160
  select(...parameters: Parameters<typeof this.selectionController.select>): void;
@@ -200,6 +197,7 @@ export declare class DataGrid<TData, TDetailsElement extends Element | undefined
200
197
  protected readonly smallScreenObserverController: MediaQueryController;
201
198
  readonly themeController: ThemeController;
202
199
  readonly selectionController: DataGridSelectionController<TData>;
200
+ readonly rowIntersectionObserver?: IntersectionObserver;
203
201
  protected updated(...parameters: Parameters<Component['updated']>): void;
204
202
  protected firstUpdated(props: PropertyValues): void;
205
203
  static get styles(): import("@a11d/lit").CSSResult;
@@ -216,7 +214,6 @@ export declare class DataGrid<TData, TDetailsElement extends Element | undefined
216
214
  protected get noContentTemplate(): HTMLTemplateResult;
217
215
  protected get dataGridTemplate(): HTMLTemplateResult;
218
216
  protected get headerTemplate(): HTMLTemplateResult;
219
- private get shallVirtualize();
220
217
  private get rowsTemplate();
221
218
  getRowTemplate(data: TData, index?: number, level?: number): import("lit-html").TemplateResult;
222
219
  private handleRowDetailsOpenChange;
@@ -239,7 +236,7 @@ export declare class DataGrid<TData, TDetailsElement extends Element | undefined
239
236
  get dataColumnsWidths(): string[];
240
237
  get moreColumnWidth(): string | undefined;
241
238
  private lastScrollElementTop;
242
- private readonly handleScroll;
239
+ private handleScroll;
243
240
  getSorting(): DataGridSortingDefinition<TData>[];
244
241
  private getFlattenedData;
245
242
  get flattenedData(): TData[];
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../DataGrid.ts"],"names":[],"mappings":"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B;IAclC,SAAS,KAAK,cAAc,uBAa3B;IAED,IAAI,QAAQ,YAEX;IAED,IAAI,YAAY,uBAMf;IAED,SAAS,KAAK,eAAe,uBAa5B;IAED,SAAS,KAAK,sBAAsB,uBAEnC;IAED,SAAS,KAAK,4BAA4B,uBAEzC;IAED,SAAS,KAAK,kBAAkB,uBAE/B;IAED,SAAS,KAAK,wBAAwB,uBA2BrC;IAED,SAAS,KAAK,sBAAsB,uBAgBnC;IAID,OAAO,CAAC,2BAA2B;IAKnC,QAAQ,CAAC,0BAA0B,KAAI;IACvC,QAAQ,CAAC,4BAA4B,KAAI;IACzC,QAAQ,CAAC,uBAAuB,KAAI;IAEpC,IAAI,aAAa,aAQhB;IAED,IAAI,kBAAkB,uBAErB;IAED,IAAI,oBAAoB,uBAEvB;IAED,IAAI,iBAAiB,aAIpB;IAED,IAAI,eAAe,uBAElB;IAGD,OAAO,CAAC,oBAAoB,CAAI;IAEhC,OAAO,CAAC,YAAY;IAiBpB,UAAU;IAQV,OAAO,CAAE,gBAAgB;IAuBzB,IAAI,aAAa,YAEhB;IAED,SAAS,KAAK,UAAU,YAyBvB;IAED,IAAI,UAAU,YAOb;IAED,OAAO,KAAK,uBAAuB,GAelC;IAED,OAAO,KAAK,oBAAoB,GA2B/B;IAED,IAAI,cAAc,qCAEjB;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;KAC5C;CACD"}
package/dist/DataGrid.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var DataGrid_1;
2
2
  import { __decorate } from "tslib";
3
- import { property, component, Component, html, css, live, query, ifDefined, event, style, literal, staticHtml, cache } from '@a11d/lit';
3
+ import { property, component, Component, html, css, live, query, ifDefined, event, style, literal, staticHtml, cache, eventOptions, queryAll, repeat } from '@a11d/lit';
4
4
  import { NotificationComponent } from '@a11d/lit-application';
5
5
  import { LocalStorage } from '@a11d/local-storage';
6
6
  import { InstanceofAttributeController } from '@3mo/instanceof-attribute-controller';
@@ -10,11 +10,8 @@ import { ThemeController } from '@3mo/theme';
10
10
  import { observeMutation } from '@3mo/mutation-observer';
11
11
  import { MediaQueryController } from '@3mo/media-query-observer';
12
12
  import { Localizer } from '@3mo/localization';
13
- import { ContextMenu } from '@3mo/context-menu';
14
13
  import { CsvGenerator, DataGridColumnComponent, DataGridSidePanelTab } from './index.js';
15
14
  import { DataGridSelectionController } from './DataGridSelectionController.js';
16
- import * as System from 'detect-browser';
17
- import { observeResize } from '@3mo/resize-observer';
18
15
  Localizer.register('en', {
19
16
  '${count:pluralityNumber} entries selected': [
20
17
  '1 entry selected',
@@ -62,7 +59,6 @@ export var DataGridEditability;
62
59
  * @attr columns - The columns to be displayed in the DataGrid. It is an array of objects, where each object represents a column.
63
60
  * @attr headerHidden - Whether the header should be hidden.
64
61
  * @attr preventVerticalContentScroll - Whether the content should be prevented from scrolling vertically.
65
- * @attr virtualizationThreshold - The threshold from which the virtualization will kick in.
66
62
  * @attr page - The current page.
67
63
  * @attr pagination - The pagination mode. It can be either `auto` or a number.
68
64
  * @attr sorting - The sorting mode. It is an object with `selector` and `strategy` properties.
@@ -124,7 +120,6 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
124
120
  this.columns = new Array();
125
121
  this.headerHidden = false;
126
122
  this.preventVerticalContentScroll = false;
127
- this.virtualizationThreshold = DataGrid_1.virtualizationThreshold;
128
123
  this.page = 1;
129
124
  this.selectionMode = DataGridSelectionMode.None;
130
125
  this.selectedData = new Array();
@@ -159,27 +154,6 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
159
154
  this.moreColumnWidthInPixels = 0;
160
155
  // eslint-disable-next-line @typescript-eslint/member-ordering
161
156
  this.lastScrollElementTop = 0;
162
- this.handleScroll = (e) => {
163
- if (this.preventFabCollapse === false) {
164
- if (!e.composed) {
165
- e.preventDefault();
166
- e.target?.dispatchEvent(new Event('scroll', { composed: true, bubbles: true }));
167
- if (this.hasFabs) {
168
- const targetElement = e.composedPath()[0];
169
- const scrollTop = targetElement.scrollTop;
170
- const isUpScrolling = scrollTop <= this.lastScrollElementTop;
171
- this.fabSlotCollapsed = !isUpScrolling;
172
- this.lastScrollElementTop = scrollTop <= 0 ? 0 : scrollTop;
173
- }
174
- }
175
- }
176
- };
177
- }
178
- get rows() {
179
- const root = this.shallVirtualize
180
- ? this.renderRoot.querySelector('mo-virtualized-scroller')?.renderRoot?.firstElementChild
181
- : this.renderRoot;
182
- return [...root?.querySelectorAll('[mo-data-grid-row]') ?? []];
183
157
  }
184
158
  setPage(page) {
185
159
  this.page = page;
@@ -210,9 +184,6 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
210
184
  get hasSelection() {
211
185
  return this.selectionController.hasSelection;
212
186
  }
213
- get isUsingSubgrid() {
214
- return System.detect()?.name !== 'safari' && System.detect()?.os !== 'iOS';
215
- }
216
187
  selectAll(...parameters) {
217
188
  return this.selectionController.selectAll(...parameters);
218
189
  }
@@ -379,6 +350,15 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
379
350
  this.sidePanel?.requestUpdate();
380
351
  this.footer?.requestUpdate();
381
352
  this.rows.forEach(row => row.requestUpdate());
353
+ // @ts-expect-error rowIntersectionObserver is initialized once here
354
+ this.rowIntersectionObserver ?? (this.rowIntersectionObserver = new IntersectionObserver(entries => {
355
+ entries.forEach(({ target, isIntersecting }) => {
356
+ target.isIntersecting = isIntersecting;
357
+ });
358
+ }, {
359
+ root: this.scroller,
360
+ rootMargin: '100% 0px',
361
+ }));
382
362
  return super.updated(...parameters);
383
363
  }
384
364
  firstUpdated(props) {
@@ -420,11 +400,13 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
420
400
  }
421
401
 
422
402
  :host([preventVerticalContentScroll]) mo-scroller {
423
- overflow-y: hidden;
424
- }
403
+ mo-scroller {
404
+ overflow-y: hidden;
405
+ }
425
406
 
426
- :host([preventVerticalContentScroll]) mo-scroller::part(container) {
427
- position: relative;
407
+ mo-scroller::part(container) {
408
+ position: relative;
409
+ }
428
410
  }
429
411
 
430
412
  :host(:not([selectionMode="none"])) {
@@ -437,9 +419,6 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
437
419
 
438
420
  #content {
439
421
  width: fit-content;
440
- }
441
-
442
- :host([subgrid]) #content {
443
422
  min-width: 100%;
444
423
  height: min-content;
445
424
  min-height: 100%;
@@ -448,22 +427,11 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
448
427
  #toolbar {
449
428
  position: relative;
450
429
  padding: var(--mo-data-grid-toolbar-padding);
451
- }
452
430
 
453
- #toolbar mo-icon-button {
454
- align-self: flex-start;
455
- color: var(--mo-color-gray);
456
- }
457
-
458
- .row:hover .contextMenuIconButton {
459
- color: var(--mo-color-accent);
460
- opacity: 1;
461
- }
462
-
463
- .contextMenuIconButton {
464
- transition: 250ms;
465
- opacity: 0.5;
466
- color: var(--mo-color-gray);
431
+ mo-icon-button {
432
+ align-self: flex-start;
433
+ color: var(--mo-color-gray);
434
+ }
467
435
  }
468
436
 
469
437
  #flexSelectionToolbar {
@@ -472,31 +440,36 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
472
440
  inset: 0px;
473
441
  width: 100%;
474
442
  height: 100%;
475
- z-index: 1;
476
- }
443
+ z-index: 5;
477
444
 
478
- #flexSelectionToolbar > mo-flex {
479
- background: var(--mo-data-grid-selection-background);
480
- height: 100%;
481
- align-items: center;
482
- }
445
+ & > mo-flex {
446
+ background: var(--mo-data-grid-selection-background);
447
+ height: 100%;
448
+ align-items: center;
449
+ }
483
450
 
484
- #flexSelectionToolbar mo-icon-button {
485
- align-self: center;
486
- color: var(--mo-color-foreground);
451
+ mo-icon-button {
452
+ align-self: center;
453
+ color: var(--mo-color-foreground);
454
+ }
487
455
  }
488
456
 
489
- #flexActions {
490
- align-items: center;
491
- justify-content: center;
492
- padding-inline: 14px 6px;
493
- margin: 6px 0;
494
- cursor: pointer;
495
- background: var(--mo-color-accent-transparent);
457
+ mo-popover-container {
496
458
  height: calc(100% - calc(2 * 6px));
497
459
  max-height: 45px;
460
+ margin: 6px 0;
461
+
462
+ #flexActions {
463
+ align-items: center;
464
+ justify-content: center;
465
+ padding-inline: 14px 6px;
466
+ cursor: pointer;
467
+ background: var(--mo-color-accent-transparent);
468
+ height: 100%;
469
+ }
498
470
  }
499
471
 
472
+
500
473
  #fab {
501
474
  position: absolute;
502
475
  inset-inline-end: 16px;
@@ -537,15 +510,15 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
537
510
  position: relative;
538
511
  height: 100%;
539
512
  width: 100%;
540
- }
541
513
 
542
- #overlayModeContainer mo-data-grid-side-panel {
543
- position: absolute;
544
- inset: 0;
545
- width: 100%;
546
- height: 100%;
547
- z-index: 1;
548
- background-color: var(--mo-color-surface);
514
+ mo-data-grid-side-panel {
515
+ position: absolute;
516
+ inset: 0;
517
+ width: 100%;
518
+ height: 100%;
519
+ z-index: 1;
520
+ background-color: var(--mo-color-surface);
521
+ }
549
522
  }
550
523
  `;
551
524
  }
@@ -625,22 +598,6 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
625
598
  get dataGridTemplate() {
626
599
  this.provideCssColumnsProperties();
627
600
  this.toggleAttribute('hasDetails', this.hasDetails);
628
- this.toggleAttribute('subgrid', this.isUsingSubgrid);
629
- if (!this.isUsingSubgrid) {
630
- return html `
631
- <mo-flex ${style({ flexGrow: '1', position: 'relative' })}>
632
- <mo-grid rows='* auto' ${style({ flexGrow: '1' })}>
633
- <mo-scroller ${style({ minHeight: 'var(--mo-data-grid-content-min-height, calc(var(--mo-data-grid-min-visible-rows, 2.5) * var(--mo-data-grid-row-height) + var(--mo-data-grid-header-height)))' })}>
634
- <mo-grid ${style({ height: '100%' })} rows='auto *'>
635
- ${this.headerTemplate}
636
- ${this.contentTemplate}
637
- </mo-grid>
638
- </mo-scroller>
639
- ${this.footerTemplate}
640
- </mo-grid>
641
- </mo-flex>
642
- `;
643
- }
644
601
  return html `
645
602
  <mo-grid rows='* auto' ${style({ position: 'relative', height: '100%' })}>
646
603
  <mo-scroller
@@ -648,11 +605,11 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
648
605
  @scroll=${this.handleScroll}
649
606
  >
650
607
  <mo-grid id='content' autoRows='min-content' columns='var(--mo-data-grid-columns)'>
651
- ${this.headerTemplate}
652
- ${this.contentTemplate}
608
+ ${cache(this.headerTemplate)}
609
+ ${cache(this.contentTemplate)}
653
610
  </mo-grid>
654
611
  </mo-scroller>
655
- ${this.footerTemplate}
612
+ ${cache(this.footerTemplate)}
656
613
  </mo-grid>
657
614
  `;
658
615
  }
@@ -661,38 +618,9 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
661
618
  <mo-data-grid-header .dataGrid=${this}></mo-data-grid-header>
662
619
  `;
663
620
  }
664
- get shallVirtualize() {
665
- return false && !this.preventVerticalContentScroll && this.renderData.length > this.virtualizationThreshold;
666
- }
667
621
  get rowsTemplate() {
668
- const getRowTemplate = (data, index) => this.getRowTemplate(data, index);
669
- const content = this.shallVirtualize === false
670
- ? this.renderData.map(getRowTemplate)
671
- : html `<mo-virtualized-scroller .items=${this.renderData} .getItemTemplate=${getRowTemplate} exportparts='row'></mo-virtualized-scroller>`;
672
- return this.isUsingSubgrid ? html `${content}` : html `
673
- <mo-flex direction='horizontal'>
674
- <mo-scroller
675
- ${style({ flexGrow: '1', gridRow: '2', gridColumn: '1 / last-line', overflowX: 'hidden' })}
676
- ${observeResize(() => this.requestUpdate())}
677
- @scroll=${this.handleScroll}
678
- >
679
- ${content}
680
- </mo-scroller>
681
- ${!this.hasContextMenu ? html.nothing : html `
682
- <mo-flex ${style({ position: 'sticky', right: '0' })}>
683
- ${this.renderData.map((_, i) => html `
684
- <mo-flex class='row' alignItems='center' justifyContent='center'
685
- ${style({ height: 'var(--mo-data-grid-row-height)', backgroundColor: 'var(--mo-data-grid-sticky-part-color)' })}
686
- >
687
- <mo-icon-button class='contextMenuIconButton' dense icon='more_vert'
688
- ${style({ backgroundColor: this.rows[i]?.contextMenuOpen ? 'var(--mo-color-foreground)' : undefined, opacity: this.rows[i]?.contextMenuOpen ? '1' : undefined })}
689
- @click=${(e) => this.rows[i]?.openContextMenu.call(this.rows[i], e)}
690
- ></mo-icon-button>
691
- </mo-flex>
692
- `)}
693
- </mo-flex>
694
- `}
695
- </mo-flex>
622
+ return html `
623
+ ${repeat(this.renderData, data => data, (data, index) => this.getRowTemplate(data, index))}
696
624
  `;
697
625
  }
698
626
  getRowTemplate(data, index, level = 0) {
@@ -775,10 +703,16 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
775
703
  ${t('${count:pluralityNumber} entries selected', { count: this.selectedData.length })}
776
704
  </div>
777
705
  ${!this.getRowContextMenuTemplate ? html.nothing : html `
778
- <mo-flex id='flexActions' direction='horizontal' @click=${(e) => ContextMenu.open(e, this.getRowContextMenuTemplate?.(this.selectedData) ?? html.nothing)}>
779
- <div ${style({ flex: '1' })}>${t('Options')}</div>
780
- <mo-icon-button dense icon='arrow_drop_down' ${style({ display: 'flex', alignItems: 'center', justifyContent: 'center' })}></mo-icon-button>
781
- </mo-flex>
706
+ <mo-popover-container fixed>
707
+ <mo-flex id='flexActions' direction='horizontal'>
708
+ <div ${style({ flex: '1' })}>${t('Options')}</div>
709
+ <mo-icon-button dense icon='arrow_drop_down' ${style({ display: 'flex', alignItems: 'center', justifyContent: 'center' })}></mo-icon-button>
710
+ </mo-flex>
711
+
712
+ <mo-menu slot='popover'>
713
+ ${this.getRowContextMenuTemplate?.(this.selectedData) ?? html.nothing}
714
+ </mo-menu>
715
+ </mo-popover-container>
782
716
  `}
783
717
  <div ${style({ flex: '1' })}></div>
784
718
  <mo-icon-button icon='close'
@@ -835,6 +769,21 @@ let DataGrid = DataGrid_1 = class DataGrid extends Component {
835
769
  get moreColumnWidth() {
836
770
  return this.sidePanelHidden && !this.hasContextMenu ? undefined : window.getComputedStyle(this).getPropertyValue('--mo-data-grid-column-more-width');
837
771
  }
772
+ handleScroll(e) {
773
+ if (this.preventFabCollapse === false) {
774
+ if (!e.composed) {
775
+ e.preventDefault();
776
+ e.target?.dispatchEvent(new Event('scroll', { composed: true, bubbles: true }));
777
+ if (this.hasFabs) {
778
+ const targetElement = e.composedPath()[0];
779
+ const scrollTop = targetElement.scrollTop;
780
+ const isUpScrolling = scrollTop <= this.lastScrollElementTop;
781
+ this.fabSlotCollapsed = !isUpScrolling;
782
+ this.lastScrollElementTop = scrollTop <= 0 ? 0 : scrollTop;
783
+ }
784
+ }
785
+ }
786
+ }
838
787
  getSorting() {
839
788
  return !this.sorting
840
789
  ? []
@@ -945,7 +894,6 @@ DataGrid.rowHeight = new LocalStorage('DataGrid.RowHeight', 35);
945
894
  DataGrid.cellRelativeFontSize = new LocalStorage('DataGrid.CellRelativeFontSize', 0.8);
946
895
  DataGrid.pageSize = new LocalStorage('DataGrid.PageSize', 25);
947
896
  DataGrid.hasAlternatingBackground = new LocalStorage('DataGrid.HasAlternatingBackground', true);
948
- DataGrid.virtualizationThreshold = 50;
949
897
  __decorate([
950
898
  event()
951
899
  ], DataGrid.prototype, "dataChange", void 0);
@@ -1005,9 +953,6 @@ __decorate([
1005
953
  __decorate([
1006
954
  property({ type: Boolean, reflect: true })
1007
955
  ], DataGrid.prototype, "preventVerticalContentScroll", void 0);
1008
- __decorate([
1009
- property({ type: Number })
1010
- ], DataGrid.prototype, "virtualizationThreshold", void 0);
1011
956
  __decorate([
1012
957
  property({ type: Number })
1013
958
  ], DataGrid.prototype, "page", void 0);
@@ -1104,9 +1049,15 @@ __decorate([
1104
1049
  __decorate([
1105
1050
  query('mo-data-grid-header')
1106
1051
  ], DataGrid.prototype, "header", void 0);
1052
+ __decorate([
1053
+ query('mo-scroller')
1054
+ ], DataGrid.prototype, "scroller", void 0);
1107
1055
  __decorate([
1108
1056
  query('#content')
1109
1057
  ], DataGrid.prototype, "content", void 0);
1058
+ __decorate([
1059
+ queryAll('[mo-data-grid-row]')
1060
+ ], DataGrid.prototype, "rows", void 0);
1110
1061
  __decorate([
1111
1062
  query('mo-data-grid-footer')
1112
1063
  ], DataGrid.prototype, "footer", void 0);
@@ -1116,6 +1067,9 @@ __decorate([
1116
1067
  __decorate([
1117
1068
  query('slot[name=column]')
1118
1069
  ], DataGrid.prototype, "columnsSlot", void 0);
1070
+ __decorate([
1071
+ eventOptions({ passive: true })
1072
+ ], DataGrid.prototype, "handleScroll", null);
1119
1073
  DataGrid = DataGrid_1 = __decorate([
1120
1074
  component('mo-data-grid')
1121
1075
  ], DataGrid);
@@ -1 +1 @@
1
- {"version":3,"file":"DataGridCell.d.ts","sourceRoot":"","sources":["../DataGridCell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAA6C,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAGpH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,KAAK,cAAc,EAAuB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAOvF;;;;;;GAMG;AACH,qBACa,YAAY,CAAC,MAAM,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,GAAG,EAAE,eAAe,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,CAAE,SAAQ,SAAS;IAC1H,KAAK,EAAG,MAAM,CAAA;IACd,MAAM,EAAG,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IACtC,GAAG,EAAG,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;IAQlE,OAAO,CAAC,OAAO,CAAQ;IAE1B,IAAI,QAAQ,6DAA+B;IAC3C,IAAI,IAAI,UAA2B;IACnC,IAAI,YAAY,+/CAAsC;IAEtD,OAAO,KAAK,SAAS,GAAkD;IACvE,OAAO,KAAK,QAAQ,GAA0D;IAE9E,OAAO,KAAK,gBAAgB,GAAuD;IAEnF,OAAO,KAAK,UAAU,GAIrB;IAED,IAAI,SAAS,YAGZ;IAED,SAAS,CA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,GAA0D;IAE9E,OAAO,KAAK,gBAAgB,GAAuD;IAEnF,OAAO,KAAK,UAAU,GAIrB;IAED,IAAI,SAAS,YAGZ;IAED,SAAS,CAAC,QAAQ,CAAC,eAAe,kBAA4B;IAG9D,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,YAAY;IAO/C,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU;cAQ7B,aAAa,CAAC,KAAK,EAAE,aAAa;IA2ClD,OAAO,CAAC,SAAS;IAWjB,WAAoB,MAAM,kCAgDzB;IAED,OAAO,KAAK,OAAO,GAAmC;IAEtD,cAAuB,QAAQ,uBAa9B;IAED,OAAO,KAAK,eAAe,GAK1B;IAED,OAAO,KAAK,mBAAmB,GAE9B;CACD;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAA;KAC1C;CACD"}
@@ -114,10 +114,6 @@ let DataGridCell = class DataGridCell extends Component {
114
114
  outline: none;
115
115
  }
116
116
 
117
- md-focus-ring {
118
- --md-focus-ring-shape: var(--mo-border-radius);
119
- }
120
-
121
117
  :host([isEditing]) {
122
118
  display: grid;
123
119
  }
@@ -164,16 +160,14 @@ let DataGridCell = class DataGridCell extends Component {
164
160
  else {
165
161
  this.setAttribute('tabindex', '-1');
166
162
  }
167
- if (this.dataGrid.isUsingSubgrid) {
168
- this.toggleAttribute('sticky', this.column.sticky !== undefined);
169
- this.toggleAttribute('sticking', !this.column.intersecting);
170
- this.style.insetInline = this.column.stickyColumnInsetInline;
171
- }
163
+ this.toggleAttribute('sticky', this.column.sticky !== undefined);
164
+ this.toggleAttribute('sticking', this.column.intersecting === false);
165
+ this.style.insetInline = this.column.stickyColumnInsetInline;
172
166
  return this.isEditing ? this.editContentTemplate : this.contentTemplate;
173
167
  }
174
168
  get contentTemplate() {
175
169
  return html `
176
- <md-focus-ring inward .control=${this} ?visible=${this.focusController.focused}></md-focus-ring>
170
+ ${!this.focusController.focused ? html.nothing : html `<mo-focus-ring inward visible></mo-focus-ring>`}
177
171
  ${this.column.getContentTemplate?.(this.value, this.data) ?? html `${this.value}`}
178
172
  `;
179
173
  }
@@ -174,7 +174,7 @@ __decorate([
174
174
  async updated(value) {
175
175
  if (value === true) {
176
176
  await this.updateComplete;
177
- await new Promise(resolve => setTimeout(resolve, 10));
177
+ await new Promise(r => requestAnimationFrame(r));
178
178
  this.pageNumberField.focus();
179
179
  this.pageNumberField.select();
180
180
  }
@@ -186,7 +186,7 @@ __decorate([
186
186
  async updated(value) {
187
187
  if (value === true) {
188
188
  await this.updateComplete;
189
- await new Promise(resolve => setTimeout(resolve, 10));
189
+ await new Promise(r => requestAnimationFrame(r));
190
190
  this.pageSizeSelectField.focus();
191
191
  this.pageSizeSelectField.open = true;
192
192
  }
@@ -11,8 +11,6 @@ export declare class DataGridHeader<TData> extends Component {
11
11
  private readonly handleDataGridDataChange;
12
12
  private readonly handleDataGridSelectionChange;
13
13
  static get styles(): import("@a11d/lit").CSSResult;
14
- private get skeletonColumns();
15
- private get separatorAdjustedColumns();
16
14
  protected get template(): import("lit-html").HTMLTemplateResult;
17
15
  private get detailsExpanderTemplate();
18
16
  private get selectionTemplate();
@@ -1 +1 @@
1
- {"version":3,"file":"DataGridHeader.d.ts","sourceRoot":"","sources":["../DataGridHeader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAsD,MAAM,WAAW,CAAA;AAKpG,OAAO,EAAuE,KAAK,QAAQ,EAAwB,MAAM,YAAY,CAAA;AAErI,qBACa,cAAc,CAAC,KAAK,CAAE,SAAQ,SAAS;IAC1C,QAAQ,CAAC,UAAU,EAAG,eAAe,CAAC,MAAM,CAAC,CAAA;IAC7C,QAAQ,CAAC,mBAAmB,EAAG,eAAe,CAAC,MAAM,CAAC,CAAA;IAEnC,QAAQ,EAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAC/C,SAAS,EAAE,iBAAiB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