@3mo/data-grid 0.16.0-preview.0 → 0.16.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.
@@ -738,6 +738,11 @@
738
738
  "type": "boolean",
739
739
  "default": "false"
740
740
  },
741
+ {
742
+ "name": "resizeController",
743
+ "type": "ResizeController<Promise<void>>",
744
+ "default": "\"new ResizeController(this, {\\n\\t\\tcallback: async ([entry]) => {\\n\\t\\t\\t// It is necessary to defer the callback to avoid\\n\\t\\t\\t// this resize-observer triggering other resize-observers in a loop\\n\\t\\t\\tawait new Promise(r => requestIdleCallback(r))\\n\\t\\t\\tthis.column.widthInPixels = entry?.contentRect.width ?? 0\\n\\t\\t}\\n\\t})\""
745
+ },
741
746
  {
742
747
  "name": "template",
743
748
  "description": "The template rendered into renderRoot. Invoked on each update to perform rendering tasks.",
@@ -844,16 +849,17 @@
844
849
  "type": "boolean",
845
850
  "default": "false"
846
851
  },
847
- {
848
- "name": "icon",
849
- "type": "MaterialIcon | undefined"
850
- },
851
852
  {
852
853
  "name": "disabled",
853
854
  "description": "Whether the list item is disabled",
854
855
  "type": "boolean",
855
856
  "default": "false"
856
857
  },
858
+ {
859
+ "name": "icon",
860
+ "description": "Icon to be displayed in the list item",
861
+ "type": "MaterialIcon | undefined"
862
+ },
857
863
  {
858
864
  "name": "preventClickOnSpace",
859
865
  "description": "Whether the list item should prevent click on space",
@@ -877,11 +883,6 @@
877
883
  "type": "SlotController",
878
884
  "default": "\"new SlotController(this)\""
879
885
  },
880
- {
881
- "name": "icon",
882
- "attribute": "icon",
883
- "type": "MaterialIcon | undefined"
884
- },
885
886
  {
886
887
  "name": "role",
887
888
  "type": "\"menuitem\"",
@@ -899,6 +900,12 @@
899
900
  "type": "boolean",
900
901
  "default": "false"
901
902
  },
903
+ {
904
+ "name": "icon",
905
+ "attribute": "icon",
906
+ "description": "Icon to be displayed in the list item",
907
+ "type": "MaterialIcon | undefined"
908
+ },
902
909
  {
903
910
  "name": "preventClickOnSpace",
904
911
  "attribute": "preventClickOnSpace",
@@ -915,11 +922,6 @@
915
922
  "name": "",
916
923
  "description": "Default slot for content"
917
924
  }
918
- ],
919
- "cssParts": [
920
- {
921
- "name": "icon"
922
- }
923
925
  ]
924
926
  },
925
927
  {
@@ -3697,6 +3699,10 @@
3697
3699
  "name": "menuOpen",
3698
3700
  "type": "boolean"
3699
3701
  },
3702
+ {
3703
+ "name": "resizeController",
3704
+ "type": "ResizeController<Promise<void>>"
3705
+ },
3700
3706
  {
3701
3707
  "name": "template",
3702
3708
  "description": "The template rendered into renderRoot. Invoked on each update to perform rendering tasks.",
@@ -3775,16 +3781,17 @@
3775
3781
  "type": "boolean",
3776
3782
  "default": "false"
3777
3783
  },
3778
- {
3779
- "name": "icon",
3780
- "type": "MaterialIcon | undefined"
3781
- },
3782
3784
  {
3783
3785
  "name": "disabled",
3784
3786
  "description": "Whether the list item is disabled",
3785
3787
  "type": "boolean",
3786
3788
  "default": "false"
3787
3789
  },
3790
+ {
3791
+ "name": "icon",
3792
+ "description": "Icon to be displayed in the list item",
3793
+ "type": "MaterialIcon | undefined"
3794
+ },
3788
3795
  {
3789
3796
  "name": "preventClickOnSpace",
3790
3797
  "description": "Whether the list item should prevent click on space",
@@ -3808,11 +3815,6 @@
3808
3815
  "type": "SlotController",
3809
3816
  "default": "\"new SlotController(this)\""
3810
3817
  },
3811
- {
3812
- "name": "icon",
3813
- "attribute": "icon",
3814
- "type": "MaterialIcon | undefined"
3815
- },
3816
3818
  {
3817
3819
  "name": "role",
3818
3820
  "type": "\"menuitem\"",
@@ -3830,6 +3832,12 @@
3830
3832
  "type": "boolean",
3831
3833
  "default": "false"
3832
3834
  },
3835
+ {
3836
+ "name": "icon",
3837
+ "attribute": "icon",
3838
+ "description": "Icon to be displayed in the list item",
3839
+ "type": "MaterialIcon | undefined"
3840
+ },
3833
3841
  {
3834
3842
  "name": "preventClickOnSpace",
3835
3843
  "attribute": "preventClickOnSpace",
@@ -3846,11 +3854,6 @@
3846
3854
  "name": "",
3847
3855
  "description": "Default slot for content"
3848
3856
  }
3849
- ],
3850
- "cssParts": [
3851
- {
3852
- "name": "icon"
3853
- }
3854
3857
  ]
3855
3858
  },
3856
3859
  {
@@ -5743,7 +5746,7 @@
5743
5746
  {
5744
5747
  "name": "isIntersecting",
5745
5748
  "type": "boolean",
5746
- "default": "false"
5749
+ "default": "true"
5747
5750
  },
5748
5751
  {
5749
5752
  "name": "dataRecord",
@@ -5767,7 +5770,7 @@
5767
5770
  "name": "isIntersecting",
5768
5771
  "attribute": "isIntersecting",
5769
5772
  "type": "boolean",
5770
- "default": "false"
5773
+ "default": "true"
5771
5774
  },
5772
5775
  {
5773
5776
  "name": "dataRecord",
@@ -5817,7 +5820,7 @@
5817
5820
  {
5818
5821
  "name": "isIntersecting",
5819
5822
  "type": "boolean",
5820
- "default": "false"
5823
+ "default": "true"
5821
5824
  },
5822
5825
  {
5823
5826
  "name": "dataRecord",
@@ -5841,7 +5844,7 @@
5841
5844
  "name": "isIntersecting",
5842
5845
  "attribute": "isIntersecting",
5843
5846
  "type": "boolean",
5844
- "default": "false"
5847
+ "default": "true"
5845
5848
  },
5846
5849
  {
5847
5850
  "name": "dataRecord",
@@ -1 +1 @@
1
- {"version":3,"file":"DataGridRow.d.ts","sourceRoot":"","sources":["../../rows/DataGridRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAgC,KAAK,kBAAkB,EAAoB,MAAM,WAAW,CAAA;AAK7H,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAyD,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAEvH,8BAAsB,WAAW,CAAC,KAAK,EAAE,eAAe,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,CAAE,SAAQ,SAAS;IACnF,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,EA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,CAAC,KAAK,EAAE,GAAG,CAAC;IAIjC,SAAS;cAMC,WAAW;cAKX,YAAY;IAItB,OAAO,CAAC,GAAG,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAShE,SAAS,KAAK,UAAU,YAEvB;IAED,WAAoB,MAAM,kCA8IzB;IAED,cAAuB,QAAQ,uBAmB9B;IAED,SAAS,CAAC,QAAQ,KAAK,WAAW,IAAI,kBAAkB,CAAA;IAExD,SAAS,KAAK,uBAAuB,uBAepC;IAED,SAAS,KAAK,iBAAiB,uBAe9B;IAED,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAYlG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG9B;IAED,SAAS,KAAK,cAAc,uBAE3B;IAED,SAAS,KAAK,6BAA6B,uBAS1C;IAED,SAAS,KAAK,eAAe,uBAY5B;IAED,OAAO,CAAC,YAAY;IAIpB,SAAS,CAAC,kBAAkB;cAYZ,wBAAwB;cAKxB,wBAAwB;YAK1B,yCAAyC;IAQjD,eAAe,CAAC,KAAK,CAAC,EAAE,YAAY;IAY1C,SAAS,CAAC,2BAA2B,CAAC,IAAI,EAAE,OAAO;IAQnD,OAAO,KAAK,eAAe,GAI1B;IAED,OAAO,KAAK,mBAAmB,GAE9B;IAEK,gBAAgB;IAKtB,aAAa;CAQb;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,kBAAkB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;KACxC;CACD"}
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { css, property, Component, html, query, queryAll, style, LitElement, live } from '@a11d/lit';
2
+ import { css, property, Component, html, query, queryAll, LitElement, live } from '@a11d/lit';
3
3
  import { equals } from '@a11d/equals';
4
4
  import { DirectionsByLanguage } from '@3mo/localization';
5
5
  import { popover } from '@3mo/popover';
@@ -8,7 +8,7 @@ import { DataGridPrimaryContextMenuItem, DataGridSelectability } from '../index.
8
8
  export class DataGridRow extends Component {
9
9
  constructor() {
10
10
  super(...arguments);
11
- this.isIntersecting = false;
11
+ this.isIntersecting = true;
12
12
  this.delegateToCell = (method) => (e) => {
13
13
  const target = e.target;
14
14
  target?.[method]?.(e);
@@ -33,9 +33,7 @@ export class DataGridRow extends Component {
33
33
  }
34
34
  initialized() {
35
35
  this.toggleAttribute('mo-data-grid-row', true);
36
- if (this.isIntersecting === false) {
37
- this.dataGrid.rowIntersectionObserver?.observe(this);
38
- }
36
+ this.dataGrid.rowIntersectionObserver?.observe(this);
39
37
  }
40
38
  disconnected() {
41
39
  this.dataGrid.rowIntersectionObserver?.unobserve?.(this);
@@ -60,6 +58,25 @@ export class DataGridRow extends Component {
60
58
  width: 100%;
61
59
  }
62
60
 
61
+ #detailsExpanderContainer {
62
+ position: sticky;
63
+ z-index: 2;
64
+ inset-inline-start: 0px;
65
+ background: var(--mo-data-grid-sticky-expander-part-color, var(--mo-data-grid-sticky-part-color));
66
+ }
67
+
68
+ #selectionContainer {
69
+ width: var(--mo-data-grid-column-selection-width);
70
+ position: sticky;
71
+ z-index: 2;
72
+ inset-inline-start: 0px;
73
+ height: 100%;
74
+ background: var(--mo-data-grid-sticky-part-color);
75
+ &[data-has-details] {
76
+ inset-inline-start: 20px;
77
+ }
78
+ }
79
+
63
80
  :host(:hover) {
64
81
  #contentContainer {
65
82
  --mo-data-grid-sticky-part-color: color-mix(in srgb, var(--mo-color-surface), var(--mo-color-accent) 25%) !important;
@@ -93,6 +110,15 @@ export class DataGridRow extends Component {
93
110
  cursor: pointer;
94
111
  }
95
112
 
113
+ #contextMenuIconButtonContainer {
114
+ height: 100%;
115
+ place-self: end;
116
+ position: sticky;
117
+ inset-inline-end: 0px;
118
+ z-index: 3;
119
+ background: var(--mo-data-grid-sticky-part-color);
120
+ }
121
+
96
122
  #contextMenuIconButton {
97
123
  opacity: 0.5;
98
124
  color: var(--mo-color-gray);
@@ -188,8 +214,7 @@ export class DataGridRow extends Component {
188
214
  }
189
215
  get detailsExpanderTemplate() {
190
216
  return this.dataGrid.hasDetails === false ? html.nothing : html `
191
- <mo-flex justifyContent='center' alignItems='center'
192
- ${style({ position: 'sticky', zIndex: '2', insetInlineStart: '0px', background: 'var(--mo-data-grid-sticky-expander-part-color, var(--mo-data-grid-sticky-part-color))' })}
217
+ <mo-flex id='detailsExpanderContainer' justifyContent='center' alignItems='center'
193
218
  @click=${(e) => e.stopPropagation()}
194
219
  @dblclick=${(e) => e.stopPropagation()}
195
220
  >
@@ -206,7 +231,7 @@ export class DataGridRow extends Component {
206
231
  get selectionTemplate() {
207
232
  return this.dataGrid.hasSelection === false || this.dataGrid.selectionCheckboxesHidden ? html.nothing : html `
208
233
  <mo-flex id='selectionContainer' justifyContent='center' alignItems='center'
209
- ${style({ width: 'var(--mo-data-grid-column-selection-width)', position: 'sticky', zIndex: '2', insetInlineStart: this.dataGrid.hasDetails ? '20px' : '0px', height: '100%', background: 'var(--mo-data-grid-sticky-part-color)' })}
234
+ ?data-has-details=${this.dataGrid.hasDetails}
210
235
  @click=${(e) => e.stopPropagation()}
211
236
  @dblclick=${(e) => e.stopPropagation()}
212
237
  >
@@ -235,7 +260,7 @@ export class DataGridRow extends Component {
235
260
  }
236
261
  get contextMenuIconButtonTemplate() {
237
262
  return this.dataGrid.hasContextMenu === false ? html.nothing : html `
238
- <mo-flex justifyContent='center' ${style({ height: '100%', placeSelf: 'end', position: 'sticky', insetInlineEnd: '0px', zIndex: '3', background: 'var(--mo-data-grid-sticky-part-color)' })}>
263
+ <mo-flex id='contextMenuIconButtonContainer' justifyContent='center'>
239
264
  <mo-icon-button id='contextMenuIconButton' icon='more_vert' dense
240
265
  @click=${this.openContextMenu}
241
266
  @dblclick=${(e) => e.stopPropagation()}
@@ -328,14 +353,7 @@ __decorate([
328
353
  query('#contentContainer')
329
354
  ], DataGridRow.prototype, "content", void 0);
330
355
  __decorate([
331
- property({
332
- type: Boolean,
333
- updated() {
334
- if (this.isIntersecting) {
335
- this.dataGrid.rowIntersectionObserver?.unobserve?.(this);
336
- }
337
- }
338
- })
356
+ property({ type: Boolean })
339
357
  ], DataGridRow.prototype, "isIntersecting", void 0);
340
358
  __decorate([
341
359
  property({ type: Object })