@genexus/genexus-ide-ui 0.0.10 → 0.0.11

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 (89) hide show
  1. package/README.md +18 -256
  2. package/dist/cjs/ch-grid-row-actions.cjs.entry.js +30 -1
  3. package/dist/cjs/ch-grid-rowset-legend.cjs.entry.js +16 -3
  4. package/dist/cjs/ch-grid_9.cjs.entry.js +292 -247
  5. package/dist/cjs/ch-suggest.cjs.entry.js +9 -8
  6. package/dist/cjs/ch-tree-item.cjs.entry.js +1 -1
  7. package/dist/cjs/genexus-ide-ui.cjs.js +1 -1
  8. package/dist/cjs/gx-ide-test.cjs.entry.js +3 -2
  9. package/dist/cjs/gxg-combo-box_8.cjs.entry.js +69 -54
  10. package/dist/cjs/gxg-form-text.cjs.entry.js +23 -13
  11. package/dist/cjs/gxg-form-textarea.cjs.entry.js +1 -1
  12. package/dist/cjs/gxg-list-box-item.cjs.entry.js +5 -2
  13. package/dist/cjs/gxg-list-box.cjs.entry.js +1 -1
  14. package/dist/cjs/gxg-test.cjs.entry.js +5 -3
  15. package/dist/cjs/gxg-tree-item.cjs.entry.js +1 -1
  16. package/dist/cjs/gxg-tree.cjs.entry.js +2 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/collection/common/render-tree.js +2 -1
  19. package/dist/collection/components/_test/test.js +1 -1
  20. package/dist/components/ch-grid-row-actions.js +52 -4
  21. package/dist/components/ch-grid-rowset-legend.js +32 -1
  22. package/dist/components/ch-grid2.js +295 -249
  23. package/dist/components/ch-suggest.js +10 -9
  24. package/dist/components/ch-tree-item.js +1 -1
  25. package/dist/components/combo-box-item.js +18 -18
  26. package/dist/components/combo-box.js +51 -36
  27. package/dist/components/form-text.js +25 -13
  28. package/dist/components/gx-ide-test.js +3 -2
  29. package/dist/components/gxg-form-textarea.js +1 -1
  30. package/dist/components/gxg-list-box-item.js +5 -2
  31. package/dist/components/gxg-list-box.js +1 -1
  32. package/dist/components/gxg-test.js +5 -3
  33. package/dist/components/gxg-tree-item2.js +1 -2
  34. package/dist/components/gxg-tree2.js +2 -1
  35. package/dist/esm/ch-grid-row-actions.entry.js +31 -2
  36. package/dist/esm/ch-grid-rowset-legend.entry.js +19 -2
  37. package/dist/esm/ch-grid_9.entry.js +292 -247
  38. package/dist/esm/ch-suggest.entry.js +9 -8
  39. package/dist/esm/ch-tree-item.entry.js +1 -1
  40. package/dist/esm/genexus-ide-ui.js +1 -1
  41. package/dist/esm/gx-ide-test.entry.js +3 -2
  42. package/dist/esm/gxg-combo-box_8.entry.js +69 -54
  43. package/dist/esm/gxg-form-text.entry.js +23 -13
  44. package/dist/esm/gxg-form-textarea.entry.js +1 -1
  45. package/dist/esm/gxg-list-box-item.entry.js +5 -2
  46. package/dist/esm/gxg-list-box.entry.js +1 -1
  47. package/dist/esm/gxg-test.entry.js +5 -3
  48. package/dist/esm/gxg-tree-item.entry.js +1 -1
  49. package/dist/esm/gxg-tree.entry.js +2 -1
  50. package/dist/esm/loader.js +1 -1
  51. package/dist/genexus-ide-ui/genexus-ide-ui.css +2 -2
  52. package/dist/genexus-ide-ui/genexus-ide-ui.esm.js +1 -1
  53. package/dist/genexus-ide-ui/p-01795e05.entry.js +1 -0
  54. package/dist/genexus-ide-ui/p-1367be09.entry.js +1 -0
  55. package/dist/genexus-ide-ui/p-18c86754.entry.js +1 -0
  56. package/dist/genexus-ide-ui/p-26b1d9c2.entry.js +1 -0
  57. package/dist/genexus-ide-ui/p-3c6099ff.entry.js +1 -0
  58. package/dist/genexus-ide-ui/p-4144fe18.entry.js +1 -0
  59. package/dist/genexus-ide-ui/p-421bd2fb.entry.js +1 -0
  60. package/dist/genexus-ide-ui/p-5faaf0e5.entry.js +1 -0
  61. package/dist/genexus-ide-ui/{p-45bf6aaf.entry.js → p-7b79281c.entry.js} +1 -1
  62. package/dist/genexus-ide-ui/p-7dead490.entry.js +1 -0
  63. package/dist/genexus-ide-ui/p-8f89e354.entry.js +1 -0
  64. package/dist/genexus-ide-ui/{p-bb9e6db0.entry.js → p-a04ce551.entry.js} +1 -1
  65. package/dist/genexus-ide-ui/{p-3546b5f7.entry.js → p-c0360787.entry.js} +1 -1
  66. package/dist/genexus-ide-ui/{p-4c6b4be3.entry.js → p-f23610f0.entry.js} +1 -1
  67. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/grid/ch-grid.css +0 -9
  68. package/dist/node_modules/@genexus/chameleon-controls-library/dist/collection/components/grid/grid-row-actions/ch-grid-row-actions.css +3 -0
  69. package/dist/node_modules/@genexus/gemini/dist/collection/components/combo-box-item/combo-box-item.css +14 -14
  70. package/dist/node_modules/@genexus/gemini/dist/collection/components/form-text/form-text.css +1 -1
  71. package/dist/node_modules/@genexus/gemini/dist/collection/components/form-textarea/form-textarea.css +1 -1
  72. package/dist/node_modules/@genexus/gemini/dist/collection/components/list-box/list-box.css +1 -1
  73. package/dist/node_modules/@genexus/gemini/dist/collection/components/list-box-item/list-box-item.css +12 -9
  74. package/dist/types/common/render-tree.d.ts +1 -1
  75. package/package.json +2 -2
  76. package/dist/cjs/ch-grid-rowset-legend-d29e1c7d.js +0 -22
  77. package/dist/components/ch-grid-rowset-legend2.js +0 -35
  78. package/dist/esm/ch-grid-rowset-legend-d6a0dd68.js +0 -20
  79. package/dist/genexus-ide-ui/p-17827fd8.js +0 -1
  80. package/dist/genexus-ide-ui/p-4298cd04.entry.js +0 -1
  81. package/dist/genexus-ide-ui/p-5aa4d5cc.entry.js +0 -1
  82. package/dist/genexus-ide-ui/p-715bf2d4.entry.js +0 -1
  83. package/dist/genexus-ide-ui/p-761e8fa3.entry.js +0 -1
  84. package/dist/genexus-ide-ui/p-93f9f73b.entry.js +0 -1
  85. package/dist/genexus-ide-ui/p-b218be5e.entry.js +0 -1
  86. package/dist/genexus-ide-ui/p-c0a96223.entry.js +0 -1
  87. package/dist/genexus-ide-ui/p-c132ce73.entry.js +0 -1
  88. package/dist/genexus-ide-ui/p-d3e6590c.entry.js +0 -1
  89. package/dist/genexus-ide-ui/p-d57c8f13.entry.js +0 -1
@@ -1,5 +1,4 @@
1
1
  import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { C as ChGridRowsetLegend } from './ch-grid-rowset-legend2.js';
3
2
  import { m as mouseEventModifierKey } from './helpers.js';
4
3
  import { d as defineCustomElement$4 } from './ch-grid-settings2.js';
5
4
  import { d as defineCustomElement$3 } from './ch-grid-settings-columns2.js';
@@ -205,7 +204,6 @@ class HTMLChGridRowElement extends HTMLElement {
205
204
  return this.parentGrid;
206
205
  }
207
206
  }
208
- HTMLChGridRowElement.TAG_NAME = "CH-GRID-ROW";
209
207
  if (!customElements.get("ch-grid-row")) {
210
208
  customElements.define("ch-grid-row", HTMLChGridRowElement);
211
209
  }
@@ -289,19 +287,18 @@ class HTMLChGridRowsetElement extends HTMLElement {
289
287
  }
290
288
  hasLegend() {
291
289
  var _a;
292
- return ((_a = this.firstElementChild) === null || _a === void 0 ? void 0 : _a.tagName) === ChGridRowsetLegend.TAG_NAME;
290
+ return ((_a = this.firstElementChild) === null || _a === void 0 ? void 0 : _a.tagName) === "ch-grid-rowset-legend";
293
291
  }
294
292
  isNestedRow() {
295
- return this.parentElement.tagName === HTMLChGridRowElement.TAG_NAME;
293
+ return this.parentElement.tagName === "CH-GRID-ROW";
296
294
  }
297
295
  getParentRowset() {
298
296
  const node = this.parentElement.closest("ch-grid-rowset, ch-grid");
299
- if (node.tagName === HTMLChGridRowsetElement.TAG_NAME) {
297
+ if (node.tagName === "CH-GRID-ROWSET") {
300
298
  return node;
301
299
  }
302
300
  }
303
301
  }
304
- HTMLChGridRowsetElement.TAG_NAME = "CH-GRID-ROWSET";
305
302
  if (!customElements.get("ch-grid-rowset")) {
306
303
  customElements.define("ch-grid-rowset", HTMLChGridRowsetElement);
307
304
  }
@@ -447,7 +444,10 @@ class HTMLChGridCellElement extends HTMLElement {
447
444
  }));
448
445
  }
449
446
  actionClickHandler() {
450
- // TODO
447
+ this.dispatchEvent(new CustomEvent("cellRowActionClicked", {
448
+ bubbles: true,
449
+ composed: true
450
+ }));
451
451
  }
452
452
  definePlain() {
453
453
  this.cellType = ChGridCellType.Plain;
@@ -488,10 +488,11 @@ class HTMLChGridCellElement extends HTMLElement {
488
488
  this.action.addEventListener("click", this.actionClickHandler.bind(this));
489
489
  }
490
490
  if (this.rowSelector) {
491
- this.addEventListener("mousedown", (eventInfo) => eventInfo.stopPropagation());
492
491
  this.selector = this.shadowRoot.querySelector("[part='selector']");
492
+ this.selector.addEventListener("mousedown", (eventInfo) => eventInfo.stopPropagation());
493
493
  this.selector.addEventListener("click", this.selectorClickHandler.bind(this));
494
494
  this.selectorLabel = this.shadowRoot.querySelector("[part='selector-label']");
495
+ this.selectorLabel.addEventListener("mousedown", (eventInfo) => eventInfo.stopPropagation());
495
496
  this.selectorLabel.addEventListener("click", this.selectorLabelClickHandler.bind(this));
496
497
  }
497
498
  }
@@ -513,80 +514,90 @@ class HTMLChGridCellElement extends HTMLElement {
513
514
  }
514
515
  }
515
516
  }
516
- HTMLChGridCellElement.TAG_NAME = "CH-GRID-CELL";
517
517
  if (!customElements.get("ch-grid-cell")) {
518
518
  customElements.define("ch-grid-cell", HTMLChGridCellElement);
519
519
  }
520
520
 
521
521
  class ChGridManagerColumnDrag {
522
- constructor(columnId, columns) {
522
+ constructor(columnId, columns, isRTL) {
523
523
  this.lastTargetOrder = 0;
524
+ this.isRTL = isRTL;
524
525
  this.columns = columns.map(column => ({
525
- column,
526
+ element: column,
526
527
  rect: column.getBoundingClientRect(),
527
528
  translateX: 0,
528
529
  order: column.order
529
530
  }));
530
- this.column = this.columns.find(item => item.column.columnId === columnId);
531
+ this.column = this.columns.find(item => item.element.columnId === columnId);
531
532
  this.columns.forEach(this.setColumnHiddenRect.bind(this));
532
533
  }
533
534
  dragging(position) {
534
535
  /**
535
536
  * Indica el orden inicial de la columna que se está arrastrando
536
537
  */
537
- const sourceOrder = this.column.column.order;
538
+ const sourceOrder = this.column.element.order;
538
539
  /**
539
540
  * Indica a qué grupo de fijación pertenece la columna que se está arrastrando
540
541
  */
541
- const sourceFreeze = this.column.column.freeze;
542
+ const sourceFreeze = this.column.element.freeze;
542
543
  let targetOrder = 0;
543
544
  let targetOrderChanged = false;
544
545
  this.column.translateX = 0;
545
546
  this.columns
546
- .filter(item => item.column.freeze === sourceFreeze)
547
- .forEach(item => {
547
+ .filter(column => column.element.freeze === sourceFreeze)
548
+ .forEach(column => {
548
549
  /**
549
550
  * Indica el orden de la columna actual
550
551
  */
551
- const columnOrder = item.column.order;
552
+ const columnOrder = column.element.order;
552
553
  /**
553
554
  * Indica si la columna que se está arrastrando estaba a la derecha o
554
555
  * a la izquierda de la actual cuando se inició el arrastre para
555
- * trasladarla en la dirección correspondiente.
556
+ * incrementar el orden según corresponda.
556
557
  */
557
- const dragDirection = sourceOrder > columnOrder ? -1 : 1;
558
+ const dragDirection = sourceOrder > columnOrder ? 1 : -1;
558
559
  /**
559
560
  * Indica si la columna actual hay que desplazarla a la derecha o
560
561
  * a la izquierda cuando se cruce con la columna arrastrada.
561
562
  */
562
- const shiftDirection = sourceOrder > columnOrder ? 1 : -1;
563
- if (item.rect.left < position &&
564
- position < item.rect.right &&
563
+ const shiftDirection = (sourceOrder > columnOrder ? 1 : -1) * (this.isRTL ? -1 : 1);
564
+ if (column.rect.left < position &&
565
+ position < column.rect.right &&
565
566
  columnOrder !== sourceOrder) {
566
567
  /*
567
568
  La posicion actual del mouse está dentro de la columna actual y
568
569
  no es la columna que se está arrastrando
569
570
  */
570
- this.swapColumnPosition(item, dragDirection, shiftDirection);
571
+ this.swapColumnPosition(column, shiftDirection);
572
+ // actualizo el orden de la columna actual
573
+ column.order = column.element.order + dragDirection;
571
574
  targetOrder = columnOrder;
572
575
  }
573
- else if (position < item.rect.left && columnOrder < sourceOrder) {
576
+ else if (position < column.rect.left &&
577
+ (this.isRTL ? columnOrder > sourceOrder : columnOrder < sourceOrder)) {
574
578
  /*
575
579
  La posicion actual del mouse está a la izquierda de la columna actual
576
580
  haciendo que la columna arrastrada cruce la actual.
577
581
  */
578
- this.swapColumnPosition(item, dragDirection, shiftDirection);
579
- if (!targetOrder || columnOrder < targetOrder) {
582
+ this.swapColumnPosition(column, shiftDirection);
583
+ // actualizo el orden de la columna actual
584
+ column.order = column.element.order + dragDirection;
585
+ if (!targetOrder ||
586
+ (this.isRTL ? columnOrder > targetOrder : columnOrder < targetOrder)) {
580
587
  targetOrder = columnOrder;
581
588
  }
582
589
  }
583
- else if (position > item.rect.right && columnOrder > sourceOrder) {
590
+ else if (position > column.rect.right &&
591
+ (this.isRTL ? columnOrder < sourceOrder : columnOrder > sourceOrder)) {
584
592
  /*
585
593
  La posicion actual del mouse está a la derecha de la columna actual
586
594
  haciendo que la columna arrastrada cruce la actual.
587
595
  */
588
- this.swapColumnPosition(item, dragDirection, shiftDirection);
589
- if (!targetOrder || columnOrder > targetOrder) {
596
+ this.swapColumnPosition(column, shiftDirection);
597
+ // actualizo el orden de la columna actual
598
+ column.order = column.element.order + dragDirection;
599
+ if (!targetOrder ||
600
+ (this.isRTL ? columnOrder < targetOrder : columnOrder > targetOrder)) {
590
601
  targetOrder = columnOrder;
591
602
  }
592
603
  }
@@ -595,84 +606,84 @@ class ChGridManagerColumnDrag {
595
606
  La posicion actual del mouse NO está dentro de la columna actual ni
596
607
  la cruza.
597
608
  */
598
- this.resetColumnPosition(item);
609
+ this.resetColumnPosition(column);
599
610
  }
600
611
  });
601
- this.column.order = targetOrder ? targetOrder : this.column.column.order;
612
+ this.column.order = targetOrder ? targetOrder : this.column.element.order;
602
613
  targetOrderChanged = targetOrder !== this.lastTargetOrder;
603
614
  this.lastTargetOrder = targetOrder;
604
615
  return targetOrderChanged;
605
616
  }
606
617
  dragEnd() {
607
- this.columns.forEach(item => {
608
- item.column.order = item.order;
609
- item.translateX = 0;
618
+ this.columns.forEach(column => {
619
+ column.element.order = column.order;
620
+ column.translateX = 0;
610
621
  });
611
622
  }
612
623
  getColumnStyle(column) {
613
624
  return {
614
- [`--ch-grid-column-${column.physicalOrder}-transform`]: `translateX(${this.columns[column.physicalOrder - 1].translateX}px)`
625
+ [`--ch-grid-column-${column.physicalOrder}-transform`]: `translateX(${this.columns.find(columnItem => columnItem.element === column)
626
+ .translateX}px)`
615
627
  };
616
628
  }
617
629
  getColumnsFirstLast() {
618
630
  let itemFirst;
619
631
  let itemLast;
620
632
  this.columns.forEach(item => {
621
- if (!item.column.hidden && (!itemFirst || item.order < itemFirst.order)) {
633
+ if (!item.element.hidden &&
634
+ (!itemFirst || item.order < itemFirst.order)) {
622
635
  itemFirst = item;
623
636
  }
624
- if (!item.column.hidden && (!itemLast || item.order > itemLast.order)) {
637
+ if (!item.element.hidden && (!itemLast || item.order > itemLast.order)) {
625
638
  itemLast = item;
626
639
  }
627
640
  });
628
641
  return {
629
- columnFirst: itemFirst.column,
630
- columnLast: itemLast.column
642
+ columnFirst: itemFirst.element,
643
+ columnLast: itemLast.element
631
644
  };
632
645
  }
633
- swapColumnPosition(column, dragDirection, shiftDirection) {
646
+ swapColumnPosition(column, shiftDirection) {
634
647
  // desplazo la columna actual para ocupar el espacio que dejó
635
648
  // la columna arrastrada
636
649
  column.translateX = this.column.rect.width * shiftDirection;
637
- // actualizo el orden de la columna actual
638
- column.order = column.column.order + shiftDirection;
639
650
  // desplazo la columna que se está arrastrando para que ocupe el
640
651
  // espacio que dejó la columna actual
641
- this.column.translateX += column.rect.width * dragDirection;
652
+ this.column.translateX += column.rect.width * (shiftDirection * -1);
642
653
  }
643
654
  resetColumnPosition(column) {
644
655
  // no desplazo la columna actual
645
656
  column.translateX = 0;
646
657
  // asigno su posición original
647
- column.order = column.column.order;
658
+ column.order = column.element.order;
648
659
  }
649
- setColumnHiddenRect(item) {
650
- if (item.column.hidden) {
651
- const columnSibling = this.getPreviousSiblingVisible(item) ||
652
- this.getNextSiblingVisible(item);
653
- item.rect = new DOMRect(item.column.order < columnSibling.column.order
660
+ setColumnHiddenRect(column) {
661
+ if (column.element.hidden) {
662
+ const columnSibling = this.getPreviousSiblingVisible(column) ||
663
+ this.getNextSiblingVisible(column);
664
+ column.rect = new DOMRect(column.element.order < columnSibling.element.order
654
665
  ? columnSibling.rect.left
655
666
  : columnSibling.rect.right, columnSibling.rect.y, 0, columnSibling.rect.height);
656
667
  }
657
668
  }
658
669
  getPreviousSiblingVisible(hidden) {
659
670
  let previous;
660
- this.columns.forEach(item => {
661
- if (!item.column.hidden &&
662
- item.column.order < hidden.column.order &&
663
- (!previous || item.column.order > previous.column.order)) {
664
- previous = item;
671
+ this.columns.forEach(column => {
672
+ if (!column.element.hidden &&
673
+ column.element.order < hidden.element.order &&
674
+ (!previous || column.element.order > previous.element.order)) {
675
+ previous = column;
665
676
  }
666
677
  });
667
678
  return previous;
668
679
  }
669
680
  getNextSiblingVisible(hidden) {
670
681
  let next;
671
- this.columns.forEach(item => {
672
- if (!item.column.hidden &&
673
- item.column.order > hidden.column.order &&
674
- (!next || item.column.order < next.column.order)) {
675
- next = item;
682
+ this.columns.forEach(column => {
683
+ if (!column.element.hidden &&
684
+ column.element.order > hidden.element.order &&
685
+ (!next || column.element.order < next.element.order)) {
686
+ next = column;
676
687
  }
677
688
  });
678
689
  return next;
@@ -680,12 +691,13 @@ class ChGridManagerColumnDrag {
680
691
  }
681
692
 
682
693
  class ChGridManagerColumns {
683
- constructor(grid) {
694
+ constructor(manager) {
684
695
  this.columnsetObserver = new MutationObserver(this.reloadColumns.bind(this));
685
696
  this.columnResizeObserver = new ResizeObserver(this.resizeColumnHandler.bind(this));
686
697
  this.columnsDisplay = [];
687
- this.grid = grid;
688
- this.columns = Array.from(this.grid.el.querySelectorAll("ch-grid-column"));
698
+ this.columnsWidth = [];
699
+ this.manager = manager;
700
+ this.columns = Array.from(this.manager.grid.querySelectorAll("ch-grid-column"));
689
701
  this.observeColumnset();
690
702
  this.defineColumns(this.columns);
691
703
  this.defineColumnsVariables();
@@ -773,7 +785,7 @@ class ChGridManagerColumns {
773
785
  this.columnsDisplay[i].setAttribute("slot", "column-display");
774
786
  this.columnsDisplay[i].setAttribute("class", column.displayObserverClass);
775
787
  this.columnsDisplay[i].column = column;
776
- this.grid.el.appendChild(this.columnsDisplay[i]);
788
+ this.manager.grid.appendChild(this.columnsDisplay[i]);
777
789
  }
778
790
  }
779
791
  defineColumnResizeObserver(column) {
@@ -782,14 +794,14 @@ class ChGridManagerColumns {
782
794
  defineColumnType(column) {
783
795
  switch (column.columnType) {
784
796
  case "tree":
785
- this.grid.el
797
+ this.manager.grid
786
798
  .querySelectorAll(`ch-grid-cell:nth-child(${column.physicalOrder})`)
787
799
  .forEach((cell) => {
788
800
  cell.type = ChGridCellType.TreeNode;
789
801
  });
790
802
  break;
791
803
  case "rich":
792
- this.grid.el
804
+ this.manager.grid
793
805
  .querySelectorAll(`ch-grid-cell:nth-child(${column.physicalOrder})`)
794
806
  .forEach((cell) => {
795
807
  cell.rowDrag = column.richRowDrag;
@@ -853,10 +865,10 @@ class ChGridManagerColumns {
853
865
  });
854
866
  }
855
867
  observeColumnset() {
856
- this.columnsetObserver.observe(this.grid.el.querySelector("ch-grid-columnset"), { childList: true });
868
+ this.columnsetObserver.observe(this.manager.grid.querySelector("ch-grid-columnset"), { childList: true });
857
869
  }
858
870
  reloadColumns() {
859
- const columns = Array.from(this.grid.el.querySelectorAll("ch-grid-column"));
871
+ const columns = Array.from(this.manager.grid.querySelectorAll("ch-grid-column"));
860
872
  const columnsAdded = columns.filter(column => !this.columns.includes(column));
861
873
  const columnsRemoved = this.columns.filter(column => !columns.includes(column));
862
874
  if (columnsAdded.length || columnsRemoved.length) {
@@ -871,8 +883,9 @@ class ChGridManagerColumns {
871
883
  resizeColumnHandler(entries) {
872
884
  for (const entry of entries) {
873
885
  const column = entry.target;
874
- this.grid.gridMainEl.style.setProperty(`--ch-grid-column-${column.physicalOrder}-width`, `${entry.contentRect.width}px`);
886
+ this.columnsWidth[column.physicalOrder - 1] = entry.contentRect.width;
875
887
  }
888
+ this.manager.setColumnWidthVariables(this.columnsWidth);
876
889
  }
877
890
  getColumnUniqueId() {
878
891
  const uniqueId = Date.now().toString(36) + Math.random().toString(36).substring(2);
@@ -887,7 +900,7 @@ class ChGridManagerColumns {
887
900
  });
888
901
  }
889
902
  adjustBaseLayer() {
890
- this.grid.baseLayer = this.columns.length;
903
+ this.manager.setBaseLayer(this.columns.length);
891
904
  }
892
905
  fnSortByOrder(columnA, columnB) {
893
906
  if (columnA.order < columnB.order) {
@@ -901,20 +914,20 @@ class ChGridManagerColumns {
901
914
  }
902
915
 
903
916
  class ChGridManagerSelection {
904
- constructor(grid) {
917
+ constructor(manager) {
905
918
  this.selectionStateNone = {
906
919
  rowFocused: null,
907
920
  rowsSelected: [],
908
921
  cellSelected: null
909
922
  };
910
- this.grid = grid;
923
+ this.manager = manager;
911
924
  }
912
925
  select(state, row, cell, append, range) {
913
926
  var _a;
914
- if (this.grid.rowSelectionMode === "none") {
927
+ if (this.manager.grid.rowSelectionMode === "none") {
915
928
  return this.selectionStateNone;
916
929
  }
917
- else if (this.grid.rowSelectionMode !== "multiple") {
930
+ else if (this.manager.grid.rowSelectionMode !== "multiple") {
918
931
  append = false;
919
932
  range = false;
920
933
  }
@@ -923,7 +936,7 @@ class ChGridManagerSelection {
923
936
  let cellSelected = state.cellSelected;
924
937
  rowFocused = row;
925
938
  if (range) {
926
- const rangeRows = this.grid.manager.getRowsRange((_a = this.rangeStart) !== null && _a !== void 0 ? _a : row, row);
939
+ const rangeRows = this.manager.getRowsRange((_a = this.rangeStart) !== null && _a !== void 0 ? _a : row, row);
927
940
  if (this.rangeValue) {
928
941
  if (append) {
929
942
  rowsSelected = Array.from(new Set(rowsSelected.concat(rangeRows)));
@@ -934,7 +947,7 @@ class ChGridManagerSelection {
934
947
  }
935
948
  cellSelected =
936
949
  cell ||
937
- row.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.grid.manager.getFirstColumn());
950
+ row.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.manager.getFirstColumn());
938
951
  }
939
952
  else {
940
953
  rowsSelected = rowsSelected.filter(rowSelected => !rangeRows.includes(rowSelected));
@@ -952,7 +965,7 @@ class ChGridManagerSelection {
952
965
  rowsSelected = [...rowsSelected, row];
953
966
  cellSelected =
954
967
  cell ||
955
- row.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.grid.manager.getFirstColumn());
968
+ row.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.manager.getFirstColumn());
956
969
  }
957
970
  }
958
971
  else {
@@ -964,26 +977,26 @@ class ChGridManagerSelection {
964
977
  : [row];
965
978
  cellSelected =
966
979
  cell ||
967
- row.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.grid.manager.getFirstColumn());
980
+ row.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.manager.getFirstColumn());
968
981
  }
969
982
  return { rowFocused, rowsSelected, cellSelected };
970
983
  }
971
984
  selectAll(state, value = true) {
972
985
  var _a;
973
- if (this.grid.rowSelectionMode === "none") {
986
+ if (this.manager.grid.rowSelectionMode === "none") {
974
987
  return this.selectionStateNone;
975
988
  }
976
- const rows = this.grid.manager.getRows();
989
+ const rows = this.manager.getRows();
977
990
  let rowFocused = state.rowFocused;
978
991
  let rowsSelected = state.rowsSelected;
979
992
  let cellSelected = state.cellSelected;
980
993
  if (value) {
981
- rowFocused = rowFocused !== null && rowFocused !== void 0 ? rowFocused : this.grid.manager.getFirstRow();
994
+ rowFocused = rowFocused !== null && rowFocused !== void 0 ? rowFocused : this.manager.getFirstRow();
982
995
  rowsSelected = rows;
983
- cellSelected = rowFocused.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.grid.manager.getFirstColumn());
996
+ cellSelected = rowFocused.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.manager.getFirstColumn());
984
997
  }
985
998
  else {
986
- rowFocused = rowFocused !== null && rowFocused !== void 0 ? rowFocused : this.grid.manager.getFirstRow();
999
+ rowFocused = rowFocused !== null && rowFocused !== void 0 ? rowFocused : this.manager.getFirstRow();
987
1000
  rowsSelected = [];
988
1001
  cellSelected = null;
989
1002
  }
@@ -1010,37 +1023,37 @@ class ChGridManagerSelection {
1010
1023
  }
1011
1024
  selectFirstRow(state, append) {
1012
1025
  var _a;
1013
- if (this.grid.rowSelectionMode === "none") {
1026
+ if (this.manager.grid.rowSelectionMode === "none") {
1014
1027
  return this.selectionStateNone;
1015
1028
  }
1016
- else if (this.grid.rowSelectionMode !== "multiple") {
1029
+ else if (this.manager.grid.rowSelectionMode !== "multiple") {
1017
1030
  append = false;
1018
1031
  }
1019
- const firstRow = this.grid.manager.getFirstRow();
1032
+ const firstRow = this.manager.getFirstRow();
1020
1033
  let rowFocused = state.rowFocused;
1021
1034
  let rowsSelected = state.rowsSelected;
1022
1035
  let cellSelected = state.cellSelected;
1023
1036
  if (firstRow) {
1024
1037
  if (append) {
1025
- const rangeRows = this.grid.manager.getRowsRange(rowFocused !== null && rowFocused !== void 0 ? rowFocused : firstRow, firstRow);
1038
+ const rangeRows = this.manager.getRowsRange(rowFocused !== null && rowFocused !== void 0 ? rowFocused : firstRow, firstRow);
1026
1039
  rowsSelected = Array.from(new Set(rowsSelected.concat(rangeRows)));
1027
1040
  }
1028
1041
  else {
1029
1042
  rowsSelected = [firstRow];
1030
1043
  }
1031
1044
  rowFocused = firstRow;
1032
- cellSelected = firstRow.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.grid.manager.getFirstColumn());
1045
+ cellSelected = firstRow.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.manager.getFirstColumn());
1033
1046
  }
1034
1047
  return { rowFocused, rowsSelected, cellSelected };
1035
1048
  }
1036
1049
  selectPreviousRow(state, append) {
1037
- if (this.grid.rowSelectionMode === "none") {
1050
+ if (this.manager.grid.rowSelectionMode === "none") {
1038
1051
  return this.selectionStateNone;
1039
1052
  }
1040
- else if (this.grid.rowSelectionMode !== "multiple") {
1053
+ else if (this.manager.grid.rowSelectionMode !== "multiple") {
1041
1054
  append = false;
1042
1055
  }
1043
- const previousRow = this.grid.manager.getPreviousRow(state.rowFocused);
1056
+ const previousRow = this.manager.getPreviousRow(state.rowFocused);
1044
1057
  let rowFocused = state.rowFocused;
1045
1058
  let rowsSelected = state.rowsSelected;
1046
1059
  let cellSelected = state.cellSelected;
@@ -1063,18 +1076,18 @@ class ChGridManagerSelection {
1063
1076
  rowsSelected = [previousRow];
1064
1077
  }
1065
1078
  rowFocused = previousRow;
1066
- cellSelected = previousRow.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.grid.manager.getFirstColumn());
1079
+ cellSelected = previousRow.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.manager.getFirstColumn());
1067
1080
  }
1068
1081
  return { rowFocused, rowsSelected, cellSelected };
1069
1082
  }
1070
1083
  selectNextRow(state, append) {
1071
- if (this.grid.rowSelectionMode === "none") {
1084
+ if (this.manager.grid.rowSelectionMode === "none") {
1072
1085
  return this.selectionStateNone;
1073
1086
  }
1074
- else if (this.grid.rowSelectionMode !== "multiple") {
1087
+ else if (this.manager.grid.rowSelectionMode !== "multiple") {
1075
1088
  append = false;
1076
1089
  }
1077
- const nextRow = this.grid.manager.getNextRow(state.rowFocused);
1090
+ const nextRow = this.manager.getNextRow(state.rowFocused);
1078
1091
  let rowFocused = state.rowFocused;
1079
1092
  let rowsSelected = state.rowsSelected;
1080
1093
  let cellSelected = state.cellSelected;
@@ -1098,52 +1111,52 @@ class ChGridManagerSelection {
1098
1111
  rowsSelected = [nextRow];
1099
1112
  }
1100
1113
  rowFocused = nextRow;
1101
- cellSelected = nextRow.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.grid.manager.getFirstColumn());
1114
+ cellSelected = nextRow.getCell((cellSelected === null || cellSelected === void 0 ? void 0 : cellSelected.column) || this.manager.getFirstColumn());
1102
1115
  }
1103
1116
  return { rowFocused, rowsSelected, cellSelected };
1104
1117
  }
1105
1118
  selectLastRow(state, append) {
1106
1119
  var _a;
1107
- if (this.grid.rowSelectionMode === "none") {
1120
+ if (this.manager.grid.rowSelectionMode === "none") {
1108
1121
  return this.selectionStateNone;
1109
1122
  }
1110
- else if (this.grid.rowSelectionMode !== "multiple") {
1123
+ else if (this.manager.grid.rowSelectionMode !== "multiple") {
1111
1124
  append = false;
1112
1125
  }
1113
- const firstRow = this.grid.manager.getLastRow();
1126
+ const firstRow = this.manager.getLastRow();
1114
1127
  let rowFocused = state.rowFocused;
1115
1128
  let rowsSelected = state.rowsSelected;
1116
1129
  let cellSelected = state.cellSelected;
1117
1130
  if (firstRow) {
1118
1131
  if (append) {
1119
- const rangeRows = this.grid.manager.getRowsRange(rowFocused !== null && rowFocused !== void 0 ? rowFocused : firstRow, firstRow);
1132
+ const rangeRows = this.manager.getRowsRange(rowFocused !== null && rowFocused !== void 0 ? rowFocused : firstRow, firstRow);
1120
1133
  rowsSelected = Array.from(new Set(rowsSelected.concat(rangeRows)));
1121
1134
  }
1122
1135
  else {
1123
1136
  rowsSelected = [firstRow];
1124
1137
  }
1125
1138
  rowFocused = firstRow;
1126
- cellSelected = firstRow.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.grid.manager.getFirstColumn());
1139
+ cellSelected = firstRow.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.manager.getFirstColumn());
1127
1140
  }
1128
1141
  return { rowFocused, rowsSelected, cellSelected };
1129
1142
  }
1130
1143
  selectPreviousPageRow(state, append) {
1131
1144
  var _a;
1132
- if (this.grid.rowSelectionMode === "none") {
1145
+ if (this.manager.grid.rowSelectionMode === "none") {
1133
1146
  return this.selectionStateNone;
1134
1147
  }
1135
- else if (this.grid.rowSelectionMode !== "multiple") {
1148
+ else if (this.manager.grid.rowSelectionMode !== "multiple") {
1136
1149
  append = false;
1137
1150
  }
1138
- const rows = this.grid.manager.getRows();
1139
- const rowsPerPage = this.grid.manager.getRowsPerPage();
1151
+ const rows = this.manager.getRows();
1152
+ const rowsPerPage = this.manager.getRowsPerPage();
1140
1153
  let rowFocused = state.rowFocused;
1141
1154
  let rowsSelected = state.rowsSelected;
1142
1155
  let cellSelected = state.cellSelected;
1143
1156
  const previousPageRow = rows[Math.max(rows.indexOf(rowFocused) - rowsPerPage, 0)];
1144
1157
  if (previousPageRow) {
1145
1158
  if (append) {
1146
- const rangeRows = this.grid.manager.getRowsRange(rowFocused !== null && rowFocused !== void 0 ? rowFocused : previousPageRow, previousPageRow);
1159
+ const rangeRows = this.manager.getRowsRange(rowFocused !== null && rowFocused !== void 0 ? rowFocused : previousPageRow, previousPageRow);
1147
1160
  rowsSelected = Array.from(new Set(rowsSelected.concat(rangeRows)));
1148
1161
  }
1149
1162
  else {
@@ -1153,27 +1166,27 @@ class ChGridManagerSelection {
1153
1166
  : [previousPageRow];
1154
1167
  }
1155
1168
  rowFocused = previousPageRow;
1156
- cellSelected = previousPageRow.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.grid.manager.getFirstColumn());
1169
+ cellSelected = previousPageRow.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.manager.getFirstColumn());
1157
1170
  }
1158
1171
  return { rowFocused, rowsSelected, cellSelected };
1159
1172
  }
1160
1173
  selectNextPageRow(state, append) {
1161
1174
  var _a;
1162
- if (this.grid.rowSelectionMode === "none") {
1175
+ if (this.manager.grid.rowSelectionMode === "none") {
1163
1176
  return this.selectionStateNone;
1164
1177
  }
1165
- else if (this.grid.rowSelectionMode !== "multiple") {
1178
+ else if (this.manager.grid.rowSelectionMode !== "multiple") {
1166
1179
  append = false;
1167
1180
  }
1168
- const rows = this.grid.manager.getRows();
1169
- const rowsPerPage = this.grid.manager.getRowsPerPage();
1181
+ const rows = this.manager.getRows();
1182
+ const rowsPerPage = this.manager.getRowsPerPage();
1170
1183
  let rowFocused = state.rowFocused;
1171
1184
  let rowsSelected = state.rowsSelected;
1172
1185
  let cellSelected = state.cellSelected;
1173
1186
  const nextPageRow = rows[Math.min(rows.indexOf(rowFocused) + rowsPerPage, rows.length - 1)];
1174
1187
  if (nextPageRow) {
1175
1188
  if (append) {
1176
- const rangeRows = this.grid.manager.getRowsRange(rowFocused !== null && rowFocused !== void 0 ? rowFocused : nextPageRow, nextPageRow);
1189
+ const rangeRows = this.manager.getRowsRange(rowFocused !== null && rowFocused !== void 0 ? rowFocused : nextPageRow, nextPageRow);
1177
1190
  rowsSelected = Array.from(new Set(rowsSelected.concat(rangeRows)));
1178
1191
  }
1179
1192
  else {
@@ -1183,19 +1196,19 @@ class ChGridManagerSelection {
1183
1196
  : [nextPageRow];
1184
1197
  }
1185
1198
  rowFocused = nextPageRow;
1186
- cellSelected = nextPageRow.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.grid.manager.getFirstColumn());
1199
+ cellSelected = nextPageRow.getCell(((_a = state.cellSelected) === null || _a === void 0 ? void 0 : _a.column) || this.manager.getFirstColumn());
1187
1200
  }
1188
1201
  return { rowFocused, rowsSelected, cellSelected };
1189
1202
  }
1190
1203
  selectPreviousCell(state) {
1191
- if (this.grid.rowSelectionMode === "none") {
1204
+ if (this.manager.grid.rowSelectionMode === "none") {
1192
1205
  return this.selectionStateNone;
1193
1206
  }
1194
1207
  const rowFocused = state.rowFocused;
1195
1208
  let rowsSelected = state.rowsSelected;
1196
1209
  let cellSelected = state.cellSelected;
1197
1210
  if (cellSelected) {
1198
- const nextCell = this.grid.manager.getPreviousCell(cellSelected);
1211
+ const nextCell = this.manager.getPreviousCell(cellSelected);
1199
1212
  if (nextCell) {
1200
1213
  cellSelected = nextCell;
1201
1214
  }
@@ -1205,20 +1218,20 @@ class ChGridManagerSelection {
1205
1218
  rowsSelected = [...rowsSelected, rowFocused];
1206
1219
  }
1207
1220
  if (!cellSelected) {
1208
- cellSelected = rowFocused.getCell(this.grid.manager.getFirstColumn());
1221
+ cellSelected = rowFocused.getCell(this.manager.getFirstColumn());
1209
1222
  }
1210
1223
  }
1211
1224
  return { rowFocused, rowsSelected, cellSelected };
1212
1225
  }
1213
1226
  selectNextCell(state) {
1214
- if (this.grid.rowSelectionMode === "none") {
1227
+ if (this.manager.grid.rowSelectionMode === "none") {
1215
1228
  return this.selectionStateNone;
1216
1229
  }
1217
1230
  const rowFocused = state.rowFocused;
1218
1231
  let rowsSelected = state.rowsSelected;
1219
1232
  let cellSelected = state.cellSelected;
1220
1233
  if (cellSelected) {
1221
- const nextCell = this.grid.manager.getNextCell(cellSelected);
1234
+ const nextCell = this.manager.getNextCell(cellSelected);
1222
1235
  if (nextCell) {
1223
1236
  cellSelected = nextCell;
1224
1237
  }
@@ -1228,7 +1241,7 @@ class ChGridManagerSelection {
1228
1241
  rowsSelected = [...rowsSelected, rowFocused];
1229
1242
  }
1230
1243
  if (!cellSelected) {
1231
- cellSelected = rowFocused.getCell(this.grid.manager.getFirstColumn());
1244
+ cellSelected = rowFocused.getCell(this.manager.getFirstColumn());
1232
1245
  }
1233
1246
  }
1234
1247
  return { rowFocused, rowsSelected, cellSelected };
@@ -1238,7 +1251,7 @@ class ChGridManagerSelection {
1238
1251
  if (row) {
1239
1252
  if (range) {
1240
1253
  const value = !row.marked;
1241
- const rows = this.grid.manager.getRowsRange((_a = this.lastRowMarked) !== null && _a !== void 0 ? _a : row, row);
1254
+ const rows = this.manager.getRowsRange((_a = this.lastRowMarked) !== null && _a !== void 0 ? _a : row, row);
1242
1255
  this.lastRowMarked = row;
1243
1256
  if (value) {
1244
1257
  return currentRowsMarked.concat(rows.filter(row => !currentRowsMarked.includes(row)));
@@ -1261,14 +1274,14 @@ class ChGridManagerSelection {
1261
1274
  }
1262
1275
  markAllRows(value = true) {
1263
1276
  if (value) {
1264
- return this.grid.manager.getRows();
1277
+ return this.manager.getRows();
1265
1278
  }
1266
1279
  else {
1267
1280
  return [];
1268
1281
  }
1269
1282
  }
1270
1283
  syncRowSelector(rows, previous = [], selectorMode) {
1271
- const columnSelector = this.grid.manager.columns.getColumnSelector();
1284
+ const columnSelector = this.manager.columns.getColumnSelector();
1272
1285
  if ((columnSelector === null || columnSelector === void 0 ? void 0 : columnSelector.richRowSelectorMode) === selectorMode) {
1273
1286
  const indexColumnSelector = columnSelector.physicalOrder - 1;
1274
1287
  previous === null || previous === void 0 ? void 0 : previous.filter(x => !rows.includes(x)).forEach(row => {
@@ -1284,7 +1297,7 @@ class ChGridManagerSelection {
1284
1297
  if (rows.length === 0) {
1285
1298
  columnSelector.richRowSelectorState = "";
1286
1299
  }
1287
- else if (rows.length === this.grid.manager.getRows().length) {
1300
+ else if (rows.length === this.manager.getRows().length) {
1288
1301
  columnSelector.richRowSelectorState = "checked";
1289
1302
  }
1290
1303
  else {
@@ -1293,7 +1306,7 @@ class ChGridManagerSelection {
1293
1306
  }
1294
1307
  }
1295
1308
  sortRowsSelected(rowsSelected) {
1296
- const rows = Array.from(this.grid.el.querySelectorAll(`${HTMLChGridRowElement.TAG_NAME}`));
1309
+ const rows = Array.from(this.manager.grid.querySelectorAll("ch-grid-row"));
1297
1310
  return rowsSelected.sort((rowA, rowB) => {
1298
1311
  const rowAIndex = rows.indexOf(rowA);
1299
1312
  const rowBIndex = rows.indexOf(rowB);
@@ -1307,7 +1320,7 @@ class ChGridManagerSelection {
1307
1320
  });
1308
1321
  }
1309
1322
  isContiguousSelection(sortedRowsSelected) {
1310
- const rows = Array.from(this.grid.el.querySelectorAll(`${HTMLChGridRowElement.TAG_NAME}`)).filter(row => row.isVisible());
1323
+ const rows = Array.from(this.manager.grid.querySelectorAll("ch-grid-row")).filter(row => row.isVisible());
1311
1324
  if (sortedRowsSelected.length === 0) {
1312
1325
  return false;
1313
1326
  }
@@ -1323,13 +1336,13 @@ class ChGridManagerSelection {
1323
1336
  }
1324
1337
 
1325
1338
  class ChGridManagerRowDrag {
1326
- constructor(grid) {
1339
+ constructor(manager) {
1327
1340
  this.dragMouseMoveFn = this.dragMouseMoveHandler.bind(this);
1328
- this.grid = grid;
1341
+ this.manager = manager;
1329
1342
  }
1330
1343
  dragStart(row) {
1331
1344
  this.row = row;
1332
- this.rowIndex = this.grid.manager.getGridRowIndex(row);
1345
+ this.rowIndex = this.manager.getGridRowIndex(row);
1333
1346
  this.defineListeners();
1334
1347
  this.createRowShadow();
1335
1348
  this.floatRow();
@@ -1337,11 +1350,11 @@ class ChGridManagerRowDrag {
1337
1350
  }
1338
1351
  dragMouseMoveHandler(eventInfo) {
1339
1352
  const target = eventInfo.target;
1340
- const rowHover = target.closest(HTMLChGridRowElement.TAG_NAME);
1353
+ const rowHover = target.closest("ch-grid-row");
1341
1354
  if (rowHover &&
1342
1355
  rowHover.parentElement === this.row.parentElement &&
1343
- rowHover.grid === this.grid.el) {
1344
- const rowHoverIndex = this.grid.manager.getGridRowIndex(rowHover);
1356
+ rowHover.grid === this.manager.grid) {
1357
+ const rowHoverIndex = this.manager.getGridRowIndex(rowHover);
1345
1358
  const rowHoverGridPosition = rowHoverIndex + 2; // +1 RowHeaderColumn, +1 array start at 1
1346
1359
  const offsetPosition = this.rowIndex < rowHoverIndex ? -1 : 1;
1347
1360
  if (this.rowShadow.style.getPropertyValue("--row-shadow-row-start") !==
@@ -1357,7 +1370,7 @@ class ChGridManagerRowDrag {
1357
1370
  dragMouseUpHandler() {
1358
1371
  document.removeEventListener("mousemove", this.dragMouseMoveFn);
1359
1372
  const dropPosition = parseInt(this.rowShadow.style.getPropertyValue("--row-shadow-row-start"));
1360
- const rowDrop = this.grid.el
1373
+ const rowDrop = this.manager.grid
1361
1374
  .querySelectorAll("ch-grid-row")
1362
1375
  .item(dropPosition - 2);
1363
1376
  if (dropPosition < this.rowIndex + 2) {
@@ -1380,10 +1393,10 @@ class ChGridManagerRowDrag {
1380
1393
  });
1381
1394
  }
1382
1395
  createRowShadow() {
1383
- const rowHeight = this.grid.manager.getRowHeight(this.row);
1396
+ const rowHeight = this.manager.getRowHeight(this.row);
1384
1397
  this.rowShadow = document.createElement("div");
1385
1398
  this.rowShadow.style.display = "contents";
1386
- this.grid.manager.getColumnsWidth().forEach(width => {
1399
+ this.manager.getColumnsWidth().forEach(width => {
1387
1400
  const column = document.createElement("div");
1388
1401
  column.style.opacity = "0";
1389
1402
  column.style.minWidth = width;
@@ -1393,15 +1406,15 @@ class ChGridManagerRowDrag {
1393
1406
  });
1394
1407
  }
1395
1408
  floatRow() {
1396
- const columnsWidth = this.grid.manager.getColumnsWidth();
1397
- const rowWidth = this.grid.gridMainEl.clientWidth;
1409
+ const columnsWidth = this.manager.getColumnsWidth();
1410
+ const rowWidth = this.manager.gridLayout.clientWidth;
1398
1411
  this.row.before(this.rowShadow);
1399
1412
  this.row.setAttribute("dragging", "");
1400
1413
  this.row.style.width = `${rowWidth}px`;
1401
1414
  this.row
1402
1415
  .querySelectorAll(":scope > ch-grid-cell")
1403
1416
  .forEach((cell, i) => {
1404
- const columnPosition = parseInt(this.grid.gridMainEl.style.getPropertyValue(`--ch-grid-column-${i + 1}-position`));
1417
+ const columnPosition = parseInt(this.manager.gridLayout.style.getPropertyValue(`--ch-grid-column-${i + 1}-position`));
1405
1418
  if (!cell.hidden) {
1406
1419
  cell.style.width = columnsWidth[columnPosition - 1];
1407
1420
  cell.style.order = `${columnPosition}`;
@@ -1425,55 +1438,75 @@ class ChGridManagerRowDrag {
1425
1438
  }
1426
1439
  }
1427
1440
 
1441
+ class ChGridManagerRowActions {
1442
+ constructor(manager) {
1443
+ var _a;
1444
+ this.manager = manager;
1445
+ (_a = this.manager.grid
1446
+ .querySelectorAll("ch-grid-row-actions")) === null || _a === void 0 ? void 0 : _a.forEach(rowActions => {
1447
+ if (rowActions.showOnRowHover) {
1448
+ this.showOnRowHover = rowActions;
1449
+ }
1450
+ if (rowActions.showOnRowActions) {
1451
+ this.showOnRowActions = rowActions;
1452
+ }
1453
+ if (rowActions.showOnRowContext) {
1454
+ this.showOnRowContext = rowActions;
1455
+ }
1456
+ });
1457
+ }
1458
+ }
1459
+
1460
+ var StyleRule;
1461
+ (function (StyleRule) {
1462
+ StyleRule[StyleRule["BASE_LAYER"] = 0] = "BASE_LAYER";
1463
+ StyleRule[StyleRule["COLUMNS_WIDTH"] = 1] = "COLUMNS_WIDTH";
1464
+ })(StyleRule || (StyleRule = {}));
1428
1465
  class ChGridManager {
1429
1466
  constructor(grid) {
1467
+ this.styleSheet = new CSSStyleSheet();
1430
1468
  this.grid = grid;
1431
- this.columnsManager = new ChGridManagerColumns(this.grid);
1432
- this.selectionManager = new ChGridManagerSelection(this.grid);
1469
+ this.styleSheet.insertRule(`:host {}`, StyleRule.BASE_LAYER);
1470
+ this.styleSheet.insertRule(".main {}", StyleRule.COLUMNS_WIDTH);
1471
+ this.grid.shadowRoot.adoptedStyleSheets.push(this.styleSheet);
1472
+ this.columns = new ChGridManagerColumns(this);
1473
+ this.selection = new ChGridManagerSelection(this);
1474
+ this.rowActions = new ChGridManagerRowActions(this);
1433
1475
  }
1434
- get selection() {
1435
- return this.selectionManager;
1476
+ get gridLayout() {
1477
+ return this.gridLayoutElement;
1436
1478
  }
1437
- get columns() {
1438
- return this.columnsManager;
1439
- }
1440
- gridDidLoad() {
1441
- if (this.isRowActionsEnabled()) {
1442
- this.observeMainScroll();
1443
- }
1479
+ componentDidLoad(gridLayout) {
1480
+ this.gridLayoutElement = gridLayout;
1444
1481
  }
1445
1482
  getColumns() {
1446
- return this.columnsManager.getColumns();
1483
+ return this.columns.getColumns();
1447
1484
  }
1448
1485
  getColumnsWidth() {
1449
- return getComputedStyle(this.grid.gridMainEl).gridTemplateColumns.split(" ");
1486
+ return getComputedStyle(this.gridLayout).gridTemplateColumns.split(" ");
1450
1487
  }
1451
1488
  getColumnsetHeight() {
1452
- const gridColumnsHeight = getComputedStyle(this.grid.gridMainEl).gridTemplateRows.split(" ");
1489
+ const gridColumnsHeight = getComputedStyle(this.gridLayout).gridTemplateRows.split(" ");
1453
1490
  return parseInt(gridColumnsHeight[0]) || 0;
1454
1491
  }
1455
1492
  getFirstColumn() {
1456
- return this.columnsManager.getColumnsFirstLast().columnFirst;
1493
+ return this.columns.getColumnsFirstLast().columnFirst;
1457
1494
  }
1458
1495
  getFirstRow() {
1459
- return this.grid.el.querySelector(`${HTMLChGridRowElement.TAG_NAME.toLowerCase()}`);
1496
+ return this.grid.querySelector("ch-grid-row");
1460
1497
  }
1461
1498
  getScrollOffsetTop() {
1462
- return this.grid.gridMainEl.offsetTop + this.getColumnsetHeight();
1499
+ return this.gridLayout.offsetTop + this.getColumnsetHeight();
1463
1500
  }
1464
1501
  getScrollOffsetLeft() {
1465
- return this.grid.manager.columns
1466
- .getColumns(true)
1467
- .reduce((offsetRight, column) => {
1502
+ return this.columns.getColumns(true).reduce((offsetRight, column) => {
1468
1503
  return column.freeze === "start" && !column.hidden
1469
1504
  ? offsetRight + column.offsetWidth
1470
1505
  : offsetRight;
1471
1506
  }, 0);
1472
1507
  }
1473
1508
  getScrollOffsetRight() {
1474
- return this.grid.manager.columns
1475
- .getColumns(true)
1476
- .reduce((offsetRight, column) => {
1509
+ return this.columns.getColumns(true).reduce((offsetRight, column) => {
1477
1510
  return column.freeze === "end" && !column.hidden
1478
1511
  ? offsetRight + column.offsetWidth
1479
1512
  : offsetRight;
@@ -1498,7 +1531,7 @@ class ChGridManager {
1498
1531
  }
1499
1532
  getPreviousCell(current) {
1500
1533
  const columnOrder = current.column.order;
1501
- const previousColumn = this.grid.manager.columns
1534
+ const previousColumn = this.columns
1502
1535
  .getColumns()
1503
1536
  .reduce((previous, column) => {
1504
1537
  return column.order < columnOrder &&
@@ -1513,9 +1546,7 @@ class ChGridManager {
1513
1546
  }
1514
1547
  getNextCell(current) {
1515
1548
  const columnOrder = current.column.order;
1516
- const nextColumn = this.grid.manager.columns
1517
- .getColumns()
1518
- .reduce((previous, column) => {
1549
+ const nextColumn = this.columns.getColumns().reduce((previous, column) => {
1519
1550
  return column.order > columnOrder &&
1520
1551
  !column.hidden &&
1521
1552
  (!previous || column.order < previous.order)
@@ -1527,27 +1558,27 @@ class ChGridManager {
1527
1558
  }
1528
1559
  }
1529
1560
  getGridRowIndex(row) {
1530
- return Array.prototype.indexOf.call(this.grid.el.querySelectorAll(`${HTMLChGridRowElement.TAG_NAME}, ${ChGridRowsetLegend.TAG_NAME}`), row);
1561
+ return Array.prototype.indexOf.call(this.grid.querySelectorAll("ch-grid-row, ch-grid-rowset-legend"), row);
1531
1562
  }
1532
1563
  getRowsetRowIndex(row) {
1533
1564
  return Array.prototype.indexOf.call(row.parentElement.children, row);
1534
1565
  }
1535
1566
  getRowHeight(row) {
1536
- const gridRowsHeight = getComputedStyle(this.grid.gridMainEl).gridTemplateRows.split(" ");
1567
+ const gridRowsHeight = getComputedStyle(this.gridLayout).gridTemplateRows.split(" ");
1537
1568
  const rowIndex = this.getGridRowIndex(row) + 1;
1538
1569
  return parseInt(gridRowsHeight[rowIndex]) || 0;
1539
1570
  }
1540
1571
  getRowsPerPage() {
1541
- const gridHeight = this.grid.gridMainEl.clientHeight;
1572
+ const gridHeight = this.gridLayout.clientHeight;
1542
1573
  const columnsHeight = this.getColumnsetHeight();
1543
1574
  const rowHeight = this.getRowHeight(this.getFirstRow());
1544
1575
  return Math.floor((gridHeight - columnsHeight) / rowHeight);
1545
1576
  }
1546
1577
  getRow(rowId) {
1547
- return this.grid.el.querySelector(`ch-grid-row[rowid="${rowId}"]`);
1578
+ return this.grid.querySelector(`ch-grid-row[rowid="${rowId}"]`);
1548
1579
  }
1549
1580
  getRows(state = "all") {
1550
- const rows = Array.from(this.grid.el.querySelectorAll(`ch-grid-row`));
1581
+ const rows = Array.from(this.grid.querySelectorAll(`ch-grid-row`));
1551
1582
  if (state === "visible") {
1552
1583
  return rows.filter(row => row.isVisible());
1553
1584
  }
@@ -1556,7 +1587,7 @@ class ChGridManager {
1556
1587
  }
1557
1588
  }
1558
1589
  getRowsSelected() {
1559
- return Array.from(this.grid.el.querySelectorAll(`ch-grid-row[selected]`));
1590
+ return Array.from(this.grid.querySelectorAll(`ch-grid-row[selected]`));
1560
1591
  }
1561
1592
  getRowsRange(start, end) {
1562
1593
  const rows = this.getRows();
@@ -1574,11 +1605,11 @@ class ChGridManager {
1574
1605
  isRowActionsEventTarget(eventInfo) {
1575
1606
  return (eventInfo
1576
1607
  .composedPath()
1577
- .find((target) => { var _a; return (_a = target.classList) === null || _a === void 0 ? void 0 : _a.contains("row-actions"); }) != null);
1608
+ .find((target) => target.tagName === "CH-GRID-ROW-ACTIONS") != null);
1578
1609
  }
1579
1610
  getCell(cellId, rowId, columnId) {
1580
1611
  if (cellId) {
1581
- return this.grid.el.querySelector(`ch-grid-cell[cellid="${cellId}"]`);
1612
+ return this.grid.querySelector(`ch-grid-cell[cellid="${cellId}"]`);
1582
1613
  }
1583
1614
  else if (rowId && columnId) {
1584
1615
  const row = this.getRow(rowId);
@@ -1594,7 +1625,7 @@ class ChGridManager {
1594
1625
  .find((target) => target.tagName === "CH-GRID-CELL");
1595
1626
  }
1596
1627
  columnDragStart(columnId) {
1597
- this.columnDragManager = new ChGridManagerColumnDrag(columnId, this.columnsManager.getColumns());
1628
+ this.columnDragManager = new ChGridManagerColumnDrag(columnId, this.columns.getColumns(), this.isRTLDirection());
1598
1629
  }
1599
1630
  columnDragging(position) {
1600
1631
  return this.columnDragManager.dragging(position);
@@ -1604,43 +1635,38 @@ class ChGridManager {
1604
1635
  this.columnDragManager = null;
1605
1636
  }
1606
1637
  rowDragStart(row) {
1607
- this.rowDragManager = new ChGridManagerRowDrag(this.grid);
1638
+ this.rowDragManager = new ChGridManagerRowDrag(this);
1608
1639
  this.rowDragManager.dragStart(row);
1609
1640
  }
1610
1641
  getGridStyle() {
1611
1642
  return Object.assign(Object.assign(Object.assign(Object.assign({ display: "grid" }, this.getGridTemplateColumns()), this.getRowBoxSimulationStyle()), this.getDragTransitionStyle()), this.getColumnsStyle());
1612
1643
  }
1613
- isRowActionsEnabled() {
1614
- const slot = this.grid.gridRowActionsEl
1615
- .firstElementChild;
1616
- return slot.assignedElements().length > 0;
1644
+ setBaseLayer(value) {
1645
+ this.styleSheet.deleteRule(StyleRule.BASE_LAYER);
1646
+ this.styleSheet.insertRule(`:host { --ch-grid-base-layer: ${value}; }`, StyleRule.BASE_LAYER);
1617
1647
  }
1618
- setRowActionsPosition(row) {
1619
- if (row) {
1620
- this.grid.gridRowActionsEl.setAttribute("show", "");
1621
- this.grid.gridRowActionsEl.style.setProperty("--ch-grid-row-highlighted-top", `${this.getRowTop(row)}px`);
1622
- }
1623
- else {
1624
- this.grid.gridRowActionsEl.removeAttribute("show");
1625
- this.grid.gridRowActionsEl.style.removeProperty("--ch-grid-row-highlighted-top");
1626
- }
1648
+ setColumnWidthVariables(columnsWidth) {
1649
+ this.styleSheet.deleteRule(StyleRule.COLUMNS_WIDTH);
1650
+ this.styleSheet.insertRule(`.main { ${columnsWidth
1651
+ .map((columnWidth, columnIndex) => `--ch-grid-column-${columnIndex + 1}-width:${columnWidth}px;`)
1652
+ .join("\n")} }`, StyleRule.COLUMNS_WIDTH);
1627
1653
  }
1628
1654
  ensureRowVisible(row) {
1629
- let node = row.parentElement.closest(`${HTMLChGridRowElement.TAG_NAME}, ${HTMLChGridRowsetElement.TAG_NAME}`);
1630
- const { columnFirst } = this.columnsManager.getColumnsFirstLast();
1655
+ let node = row.parentElement.closest("ch-grid-row, ch-grid-rowset");
1656
+ const { columnFirst } = this.columns.getColumnsFirstLast();
1631
1657
  while (node) {
1632
1658
  node.collapsed = false;
1633
- node = node.parentElement.closest(`${HTMLChGridRowElement.TAG_NAME}, ${HTMLChGridRowsetElement.TAG_NAME}`);
1659
+ node = node.parentElement.closest("ch-grid-row, ch-grid-rowset");
1634
1660
  }
1635
1661
  if (row.children[columnFirst.physicalOrder]) {
1636
1662
  this.ensureVisible(row.children[columnFirst.physicalOrder]);
1637
1663
  }
1638
1664
  }
1639
1665
  ensureCellVisible(cell) {
1640
- let node = cell.closest(`${HTMLChGridRowElement.TAG_NAME}, ${HTMLChGridRowsetElement.TAG_NAME}`);
1666
+ let node = cell.closest("ch-grid-row, ch-grid-rowset");
1641
1667
  while (!cell.isVisible() && node) {
1642
1668
  node.collapsed = false;
1643
- node = node.parentElement.closest(`${HTMLChGridRowElement.TAG_NAME}, ${HTMLChGridRowsetElement.TAG_NAME}`);
1669
+ node = node.parentElement.closest("ch-grid-row, ch-grid-rowset");
1644
1670
  }
1645
1671
  if (!cell.isVisible()) {
1646
1672
  cell.column.hidden = false;
@@ -1649,7 +1675,7 @@ class ChGridManager {
1649
1675
  }
1650
1676
  ensureVisible(cell) {
1651
1677
  const isColumnFreeze = ["start", "end"].includes(cell.column.freeze);
1652
- const scroll = this.grid.gridMainEl;
1678
+ const scroll = this.gridLayout;
1653
1679
  const scrollOffsetTop = this.getScrollOffsetTop();
1654
1680
  const scrollOffsetLeft = this.getScrollOffsetLeft();
1655
1681
  const scrollOffsetRight = this.getScrollOffsetRight();
@@ -1684,7 +1710,7 @@ class ChGridManager {
1684
1710
  }
1685
1711
  getGridTemplateColumns() {
1686
1712
  return {
1687
- "grid-template-columns": this.columnsManager
1713
+ "grid-template-columns": this.columns
1688
1714
  .getColumns()
1689
1715
  .map(column => `var(--ch-grid-column-${column.physicalOrder}-size)`)
1690
1716
  .join(" ")
@@ -1693,7 +1719,7 @@ class ChGridManager {
1693
1719
  getRowBoxSimulationStyle() {
1694
1720
  const { columnFirst, columnLast } = this.columnDragManager
1695
1721
  ? this.columnDragManager.getColumnsFirstLast()
1696
- : this.columnsManager.getColumnsFirstLast();
1722
+ : this.columns.getColumnsFirstLast();
1697
1723
  if (!columnFirst || !columnLast) {
1698
1724
  return null;
1699
1725
  }
@@ -1706,17 +1732,13 @@ class ChGridManager {
1706
1732
  [`--ch-grid-column-${columnLast.physicalOrder}-padding-end`]: "var(--ch-grid-fallback, inherit)"
1707
1733
  };
1708
1734
  }
1709
- getRowTop(row) {
1710
- const cell = row.firstElementChild;
1711
- return cell.offsetTop;
1712
- }
1713
1735
  getDragTransitionStyle() {
1714
1736
  return {
1715
1737
  "--column-drag-transition-duration": this.columnDragManager ? ".2s" : "0s"
1716
1738
  };
1717
1739
  }
1718
1740
  getColumnsStyle() {
1719
- return this.columnsManager.getColumns().reduce((style, column) => {
1741
+ return this.columns.getColumns().reduce((style, column) => {
1720
1742
  return Object.assign(Object.assign({}, style), this.getColumnStyle(column));
1721
1743
  }, {});
1722
1744
  }
@@ -1755,7 +1777,7 @@ class ChGridManager {
1755
1777
  }
1756
1778
  getColumnFreezeEndStyle(column) {
1757
1779
  const calcItems = ["0px"];
1758
- for (let i = this.columnsManager.getColumns().length; i > column.order; i--) {
1780
+ for (let i = this.columns.getColumns().length; i > column.order; i--) {
1759
1781
  calcItems.push(`var(--ch-grid-column-${i}-width)`);
1760
1782
  }
1761
1783
  return {
@@ -1780,12 +1802,12 @@ class ChGridManager {
1780
1802
  [`--ch-grid-column-${column.physicalOrder}-content`]: column.order === 1 ? "''" : "none"
1781
1803
  };
1782
1804
  }
1783
- observeMainScroll() {
1784
- this.grid.gridMainEl.addEventListener("scroll", () => this.grid.gridRowActionsEl.style.setProperty("--ch-grid-scroll-v", `${this.grid.gridMainEl.scrollTop}px`), { passive: true });
1805
+ isRTLDirection() {
1806
+ return getComputedStyle(this.grid).direction === "rtl";
1785
1807
  }
1786
1808
  }
1787
1809
 
1788
- const chGridCss = ":host{display:flex;position:relative;flex-direction:column;--ch-grid-cell-active-layer:calc(var(--ch-grid-base-layer) * 1);--ch-grid-column-header-layer:calc(var(--ch-grid-base-layer) * 2);--ch-grid-column-freeze-layer:calc(var(--ch-grid-base-layer) * 4);--ch-grid-column-active-layer:calc(var(--ch-grid-base-layer) * 8);--ch-grid-settings-layer:calc(var(--ch-grid-base-layer) * 16)}.main{display:none;grid-auto-flow:dense;overflow-x:auto;user-select:none}.row-actions{position:absolute;top:calc( var(--ch-grid-row-highlighted-top, 0px) - var(--ch-grid-scroll-v, 0px) )}.row-actions:not([show]){display:none}";
1810
+ const chGridCss = ":host{display:flex;position:relative;flex-direction:column;--ch-grid-cell-active-layer:calc(var(--ch-grid-base-layer) * 1);--ch-grid-column-header-layer:calc(var(--ch-grid-base-layer) * 2);--ch-grid-column-freeze-layer:calc(var(--ch-grid-base-layer) * 4);--ch-grid-column-active-layer:calc(var(--ch-grid-base-layer) * 8);--ch-grid-settings-layer:calc(var(--ch-grid-base-layer) * 16)}.main{display:none;grid-auto-flow:dense;overflow-x:auto;user-select:none}";
1789
1811
 
1790
1812
  const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
1791
1813
  constructor() {
@@ -1816,49 +1838,36 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
1816
1838
  * A boolean indicating whether the user can drag column headers to reorder columns.
1817
1839
  */
1818
1840
  this.allowColumnReorder = true;
1819
- this.styleSheet = new CSSStyleSheet();
1820
- }
1821
- baseLayerHandler(value) {
1822
- this.styleSheet.replace(`:host { --ch-grid-base-layer: ${value} ;}`);
1823
- }
1824
- componentWillLoad() {
1825
- this.manager = new ChGridManager(this);
1826
- this.gridStyle = this.manager.getGridStyle();
1827
- this.rowsSelected = this.manager.getRowsSelected();
1828
- this.el.shadowRoot.adoptedStyleSheets.push(this.styleSheet);
1829
- }
1830
- componentDidLoad() {
1831
- this.manager.gridDidLoad();
1832
- this.gridRowActionsEnabled = this.manager.isRowActionsEnabled();
1833
1841
  }
1834
- componentShouldUpdate(_newValue, _oldValue, name) {
1835
- if (name === "rowFocused" ||
1836
- name === "rowHighlighted" ||
1837
- name === "rowSelected" ||
1838
- name === "rowsMarked" ||
1839
- name === "cellSelected") {
1840
- return false;
1842
+ rowFocusedHandler(row, previous) {
1843
+ if (row) {
1844
+ row.focused = true;
1845
+ }
1846
+ if (previous) {
1847
+ previous.focused = false;
1841
1848
  }
1842
1849
  }
1843
1850
  rowHighlightedHandler(row, previous) {
1851
+ var _a, _b;
1852
+ // highlight
1844
1853
  if (row) {
1845
1854
  row.highlighted = true;
1846
1855
  }
1847
1856
  if (previous) {
1848
1857
  previous.highlighted = false;
1849
1858
  }
1850
- if (this.gridRowActionsEnabled) {
1851
- this.manager.setRowActionsPosition(row);
1852
- }
1853
- }
1854
- rowFocusedHandler(row, previous) {
1859
+ // actions
1855
1860
  if (row) {
1856
- row.focused = true;
1861
+ (_a = this.manager.rowActions.showOnRowHover) === null || _a === void 0 ? void 0 : _a.openRowHover(row);
1857
1862
  }
1858
- if (previous) {
1859
- previous.focused = false;
1863
+ else {
1864
+ (_b = this.manager.rowActions.showOnRowHover) === null || _b === void 0 ? void 0 : _b.close();
1860
1865
  }
1861
1866
  }
1867
+ rowsMarkedHandler(rows, previous) {
1868
+ this.manager.selection.syncRowSelector(rows, previous, "mark");
1869
+ this.rowMarkingChanged.emit({ rowsId: rows.map(row => row.rowId) });
1870
+ }
1862
1871
  rowsSelectedHandler(rows, previous) {
1863
1872
  if (previous) {
1864
1873
  previous
@@ -1871,10 +1880,6 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
1871
1880
  this.manager.selection.syncRowSelector(rows, previous, "select");
1872
1881
  this.selectionChanged.emit({ rowsId: rows.map(row => row.rowId) });
1873
1882
  }
1874
- rowsMarkedHandler(rows, previous) {
1875
- this.manager.selection.syncRowSelector(rows, previous, "mark");
1876
- this.rowMarkingChanged.emit({ rowsId: rows.map(row => row.rowId) });
1877
- }
1878
1883
  cellSelectedHandler(cell, previous) {
1879
1884
  if (cell) {
1880
1885
  cell.selected = true;
@@ -1888,6 +1893,23 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
1888
1893
  columnId: this.cellSelected ? this.cellSelected.column.columnId : null
1889
1894
  });
1890
1895
  }
1896
+ componentWillLoad() {
1897
+ this.manager = new ChGridManager(this.el);
1898
+ this.gridStyle = this.manager.getGridStyle();
1899
+ this.rowsSelected = this.manager.getRowsSelected();
1900
+ }
1901
+ componentDidLoad() {
1902
+ this.manager.componentDidLoad(this.gridLayoutElement);
1903
+ }
1904
+ componentShouldUpdate(_newValue, _oldValue, name) {
1905
+ if (name === "rowFocused" ||
1906
+ name === "rowHighlighted" ||
1907
+ name === "rowSelected" ||
1908
+ name === "rowsMarked" ||
1909
+ name === "cellSelected") {
1910
+ return false;
1911
+ }
1912
+ }
1891
1913
  focusHandler() {
1892
1914
  if (this.rowSelectionMode !== "none") {
1893
1915
  this.rowFocused = this.rowsSelected[0] || this.manager.getFirstRow();
@@ -2030,6 +2052,11 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
2030
2052
  this.rowsMarked = this.manager.selection.markRow(this.manager.getRowEventTarget(eventInfo), eventInfo.detail.checked, eventInfo.detail.range, this.rowsMarked);
2031
2053
  }
2032
2054
  }
2055
+ cellRowActionClickedHandler(eventInfo) {
2056
+ var _a;
2057
+ const cell = eventInfo.target;
2058
+ (_a = this.manager.rowActions.showOnRowActions) === null || _a === void 0 ? void 0 : _a.openRowActions(cell);
2059
+ }
2033
2060
  columnStyleChangedHandler() {
2034
2061
  if (this.manager) {
2035
2062
  this.gridStyle = this.manager.getGridStyle();
@@ -2060,10 +2087,10 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
2060
2087
  this.manager.ensureCellVisible(eventInfo.target);
2061
2088
  }
2062
2089
  settingsShowClickedHandler() {
2063
- this.gridSettingsUI.show = true;
2090
+ this.settingsUI.show = true;
2064
2091
  }
2065
2092
  settingsCloseClickedHandler() {
2066
- this.gridSettingsUI.show = false;
2093
+ this.settingsUI.show = false;
2067
2094
  }
2068
2095
  /**
2069
2096
  * Retrieves the rowId of the currently focused row.
@@ -2150,6 +2177,28 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
2150
2177
  rowFocused === null || rowFocused === void 0 ? void 0 : rowFocused.ensureVisible();
2151
2178
  }
2152
2179
  }
2180
+ /**
2181
+ * Mark or unmark a row.
2182
+ * @param rowId - The rowId of the row to select or deselect.
2183
+ * @param marked - A boolean indicating whether to mark or unmark the row.
2184
+ */
2185
+ async markRow(rowId, marked = true) {
2186
+ const columnSelector = this.manager.columns.getColumnSelector();
2187
+ const row = this.manager.getRow(rowId);
2188
+ if (row && (columnSelector === null || columnSelector === void 0 ? void 0 : columnSelector.richRowSelectorMode) === "mark") {
2189
+ this.rowsMarked = this.manager.selection.markRow(row, marked, false, this.rowsMarked);
2190
+ }
2191
+ }
2192
+ /**
2193
+ * Mark or unmark all rows.
2194
+ * @param marked - A boolean indicating whether to mark or unmark all rows.
2195
+ */
2196
+ async markAllRows(marked = true) {
2197
+ const columnSelector = this.manager.columns.getColumnSelector();
2198
+ if ((columnSelector === null || columnSelector === void 0 ? void 0 : columnSelector.richRowSelectorMode) === "mark") {
2199
+ this.rowsMarked = this.manager.selection.markAllRows(marked);
2200
+ }
2201
+ }
2153
2202
  /**
2154
2203
  * Expands a row, showing its children.
2155
2204
  * @param rowId - The rowId of the row to expand.
@@ -2307,22 +2356,18 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
2307
2356
  row.collapsed = false;
2308
2357
  }
2309
2358
  }
2310
- render() {
2311
- return (h(Host, { tabindex: this.rowSelectionMode !== "none" ? "0" : false }, h("header", { part: "header" }, h("slot", { name: "header" })), h("section", { class: "main", style: this.gridStyle, part: "main", ref: el => (this.gridMainEl = el) }, h("slot", null)), h("aside", null, this.renderSettings(), h("slot", { name: "column-display" }), this.renderRowActions()), h("footer", { part: "footer" }, h("slot", { name: "footer" }))));
2312
- }
2313
2359
  renderSettings() {
2314
- return (h("ch-grid-settings", { grid: this.el, ref: el => (this.gridSettingsUI = el), exportparts: "\n mask:settings-mask,\n window:settings-window,\n header:settings-header,\n caption:settings-caption,\n close:settings-close,\n main:settings-main,\n footer:settings-footer\n " }, h("slot", { name: "settings" }, h("ch-grid-settings-columns", { part: "settings-columns", columns: [...this.manager.getColumns()], exportparts: "\n column:settings-columns-item,\n column-label:settings-columns-label,\n column-visible:settings-columns-visible,\n column-visible-checked:settings-columns-visible-checked\n " }))));
2360
+ return (h("ch-grid-settings", { grid: this.el, ref: el => (this.settingsUI = el), exportparts: "\n mask:settings-mask,\n window:settings-window,\n header:settings-header,\n caption:settings-caption,\n close:settings-close,\n main:settings-main,\n footer:settings-footer\n " }, h("slot", { name: "settings" }, h("ch-grid-settings-columns", { part: "settings-columns", columns: [...this.manager.getColumns()], exportparts: "\n column:settings-columns-item,\n column-label:settings-columns-label,\n column-visible:settings-columns-visible,\n column-visible-checked:settings-columns-visible-checked\n " }))));
2315
2361
  }
2316
- renderRowActions() {
2317
- return (h("section", { class: "row-actions", part: "row-actions", ref: el => (this.gridRowActionsEl = el) }, h("slot", { name: "row-actions" })));
2362
+ render() {
2363
+ return (h(Host, { tabindex: this.rowSelectionMode !== "none" ? "0" : false }, h("header", { part: "header" }, h("slot", { name: "header" })), h("section", { class: "main", style: this.gridStyle, part: "main", ref: el => (this.gridLayoutElement = el) }, h("slot", null)), h("aside", null, this.renderSettings(), h("slot", { name: "column-display" }), h("slot", { name: "row-actions" })), h("footer", { part: "footer" }, h("slot", { name: "footer" }))));
2318
2364
  }
2319
2365
  get el() { return this; }
2320
2366
  static get watchers() { return {
2321
- "baseLayer": ["baseLayerHandler"],
2322
- "rowHighlighted": ["rowHighlightedHandler"],
2323
2367
  "rowFocused": ["rowFocusedHandler"],
2324
- "rowsSelected": ["rowsSelectedHandler"],
2368
+ "rowHighlighted": ["rowHighlightedHandler"],
2325
2369
  "rowsMarked": ["rowsMarkedHandler"],
2370
+ "rowsSelected": ["rowsSelectedHandler"],
2326
2371
  "cellSelected": ["cellSelectedHandler"]
2327
2372
  }; }
2328
2373
  static get style() { return chGridCss; }
@@ -2341,7 +2386,6 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
2341
2386
  "rowsSelected": [32],
2342
2387
  "cellSelected": [32],
2343
2388
  "gridStyle": [32],
2344
- "baseLayer": [32],
2345
2389
  "getFocusedRow": [64],
2346
2390
  "getHoveredRow": [64],
2347
2391
  "getSelectedRows": [64],
@@ -2350,6 +2394,8 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
2350
2394
  "selectRow": [64],
2351
2395
  "selectAllRows": [64],
2352
2396
  "selectCell": [64],
2397
+ "markRow": [64],
2398
+ "markAllRows": [64],
2353
2399
  "expandRow": [64],
2354
2400
  "collapseRow": [64],
2355
2401
  "rowEnsureVisible": [64],
@@ -2358,7 +2404,7 @@ const ChGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
2358
2404
  "getNextRow": [64],
2359
2405
  "getPreviousCell": [64],
2360
2406
  "getNextCell": [64]
2361
- }, [[1, "focus", "focusHandler"], [1, "blur", "blurHandler"], [8, "keydown", "windowKeyDownHandler"], [1, "keydown", "keyDownHandler"], [1, "mousemove", "mouseMoveHandler"], [1, "mouseleave", "mouseLeaveHandler"], [1, "mousedown", "clickHandler"], [1, "mouseup", "mouseUpHandler"], [1, "dblclick", "dblclickHandler"], [1, "columnSelectorClicked", "columnSelectorClickedHandler"], [1, "cellSelectorClicked", "cellSelectorClickedHandler"], [0, "columnHiddenChanged", "columnStyleChangedHandler"], [0, "columnOrderChanged", "columnStyleChangedHandler"], [0, "columnFreezeChanged", "columnStyleChangedHandler"], [0, "columnSizeChanging", "columnStyleChangedHandler"], [0, "columnFreezeChanged", "columnFreezeChangedHandler"], [0, "columnDragStarted", "columnDragStartHandler"], [0, "columnDragging", "columnDraggingHandler"], [0, "columnDragEnded", "columnDragEndHandler"], [0, "rowDragStarted", "rowDragStartHandler"], [0, "rowEnsureVisible", "rowEnsureVisibleHandler"], [0, "cellEnsureVisible", "cellEnsureVisibleHandler"], [0, "settingsShowClicked", "settingsShowClickedHandler"], [0, "settingsCloseClicked", "settingsCloseClickedHandler"]]]);
2407
+ }, [[1, "focus", "focusHandler"], [1, "blur", "blurHandler"], [8, "keydown", "windowKeyDownHandler"], [1, "keydown", "keyDownHandler"], [1, "mousemove", "mouseMoveHandler"], [1, "mouseleave", "mouseLeaveHandler"], [1, "mousedown", "clickHandler"], [1, "mouseup", "mouseUpHandler"], [1, "dblclick", "dblclickHandler"], [1, "columnSelectorClicked", "columnSelectorClickedHandler"], [1, "cellSelectorClicked", "cellSelectorClickedHandler"], [1, "cellRowActionClicked", "cellRowActionClickedHandler"], [0, "columnHiddenChanged", "columnStyleChangedHandler"], [0, "columnOrderChanged", "columnStyleChangedHandler"], [0, "columnFreezeChanged", "columnStyleChangedHandler"], [0, "columnSizeChanging", "columnStyleChangedHandler"], [0, "columnFreezeChanged", "columnFreezeChangedHandler"], [0, "columnDragStarted", "columnDragStartHandler"], [0, "columnDragging", "columnDraggingHandler"], [0, "columnDragEnded", "columnDragEndHandler"], [0, "rowDragStarted", "rowDragStartHandler"], [0, "rowEnsureVisible", "rowEnsureVisibleHandler"], [0, "cellEnsureVisible", "cellEnsureVisibleHandler"], [0, "settingsShowClicked", "settingsShowClickedHandler"], [0, "settingsCloseClicked", "settingsCloseClickedHandler"]]]);
2362
2408
  function defineCustomElement() {
2363
2409
  if (typeof customElements === "undefined") {
2364
2410
  return;