@guiexpert/table 1.0.12 → 1.0.15

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 (150) hide show
  1. package/README.md +10 -11
  2. package/index.cjs +314 -0
  3. package/{src/index.d.ts → index.d.ts} +1 -0
  4. package/index.js +3742 -0
  5. package/{src/lib → lib}/table/data/common/checkbox-column-def.d.ts +1 -0
  6. package/{src/lib → lib}/table/data/common/tree-row-if.d.ts +3 -3
  7. package/{src/lib → lib}/table/data/common/tree-row.d.ts +1 -0
  8. package/{src/lib → lib}/table/data/tablemodel/areamodel/area-model-tree.d.ts +8 -6
  9. package/lib/table/factory/tree-factory.d.ts +6 -0
  10. package/lib/table/instanceof-workaround.d.ts +3 -0
  11. package/{src/lib → lib}/table/service/convenience-dom.service.d.ts +1 -1
  12. package/lib/table/service/tree-row.service.d.ts +5 -0
  13. package/{src/lib → lib}/table/table-scope.d.ts +2 -1
  14. package/package.json +20 -5
  15. package/index.cjs.d.ts +0 -1
  16. package/index.cjs.js +0 -5570
  17. package/index.esm.js +0 -5440
  18. package/src/lib/table/factory/tree-factory.d.ts +0 -6
  19. package/src/lib/table/service/tree-row.service.d.ts +0 -5
  20. /package/{src/lib → lib}/table/action/action-id.type.d.ts +0 -0
  21. /package/{src/lib → lib}/table/action/on-action-triggered.if.d.ts +0 -0
  22. /package/{src/lib → lib}/table/action/osx-shortcut-actionId-mapping.d.ts +0 -0
  23. /package/{src/lib → lib}/table/action/shortcut-actionid-mapping.type.d.ts +0 -0
  24. /package/{src/lib → lib}/table/action/shortcut.service.d.ts +0 -0
  25. /package/{src/lib → lib}/table/action/windows-shortcut-actionId-mapping.d.ts +0 -0
  26. /package/{src/lib → lib}/table/checkbox/checkbox-model.d.ts +0 -0
  27. /package/{src/lib → lib}/table/checkbox/checkbox-model.if.d.ts +0 -0
  28. /package/{src/lib → lib}/table/checkbox/tree-checkbox-model.d.ts +0 -0
  29. /package/{src/lib → lib}/table/color/color-rgb.d.ts +0 -0
  30. /package/{src/lib → lib}/table/color/color-rgb.if.d.ts +0 -0
  31. /package/{src/lib → lib}/table/color/ge-css-color-util.d.ts +0 -0
  32. /package/{src/lib → lib}/table/color/three-color-gradient-arg.d.ts +0 -0
  33. /package/{src/lib → lib}/table/color/three-color-gradient-arg.if.d.ts +0 -0
  34. /package/{src/lib → lib}/table/color/two-color-gradient-arg.d.ts +0 -0
  35. /package/{src/lib → lib}/table/color/two-color-gradient-arg.if.d.ts +0 -0
  36. /package/{src/lib → lib}/table/css-vars.d.ts +0 -0
  37. /package/{src/lib → lib}/table/data/chunk/chunk.data-event.d.ts +0 -0
  38. /package/{src/lib → lib}/table/data/chunk/chunk.data-event.if.d.ts +0 -0
  39. /package/{src/lib → lib}/table/data/chunk/request-chunk.d.ts +0 -0
  40. /package/{src/lib → lib}/table/data/chunk/request-chunk.if.d.ts +0 -0
  41. /package/{src/lib → lib}/table/data/common/aligns.d.ts +0 -0
  42. /package/{src/lib → lib}/table/data/common/area-map-factory.d.ts +0 -0
  43. /package/{src/lib → lib}/table/data/common/area-map.d.ts +0 -0
  44. /package/{src/lib → lib}/table/data/common/area-map.type.d.ts +0 -0
  45. /package/{src/lib → lib}/table/data/common/args-adjust-columns-to-row-parent-params.d.ts +0 -0
  46. /package/{src/lib → lib}/table/data/common/args-render-cell-div.d.ts +0 -0
  47. /package/{src/lib → lib}/table/data/common/boolean-function.d.ts +0 -0
  48. /package/{src/lib → lib}/table/data/common/cell-range.d.ts +0 -0
  49. /package/{src/lib → lib}/table/data/common/checked-type.d.ts +0 -0
  50. /package/{src/lib → lib}/table/data/common/event/ge-cell-indices.d.ts +0 -0
  51. /package/{src/lib → lib}/table/data/common/event/ge-key-event.d.ts +0 -0
  52. /package/{src/lib → lib}/table/data/common/event/ge-model-change-event.d.ts +0 -0
  53. /package/{src/lib → lib}/table/data/common/event/ge-mouse-event.d.ts +0 -0
  54. /package/{src/lib → lib}/table/data/common/event/input/table-cell-update-event.d.ts +0 -0
  55. /package/{src/lib → lib}/table/data/common/event/input/table-cell-update-event.if.d.ts +0 -0
  56. /package/{src/lib → lib}/table/data/common/filter-function.d.ts +0 -0
  57. /package/{src/lib → lib}/table/data/common/get-t.d.ts +0 -0
  58. /package/{src/lib → lib}/table/data/common/index-and-px.d.ts +0 -0
  59. /package/{src/lib → lib}/table/data/common/size.d.ts +0 -0
  60. /package/{src/lib → lib}/table/data/common/size.if.d.ts +0 -0
  61. /package/{src/lib → lib}/table/data/common/sizes.d.ts +0 -0
  62. /package/{src/lib → lib}/table/data/common/sort-item.d.ts +0 -0
  63. /package/{src/lib → lib}/table/data/common/sort-state.type.d.ts +0 -0
  64. /package/{src/lib → lib}/table/data/common/tree-arrow.type.d.ts +0 -0
  65. /package/{src/lib → lib}/table/data/common/value-label.d.ts +0 -0
  66. /package/{src/lib → lib}/table/data/common/value-label.if.d.ts +0 -0
  67. /package/{src/lib → lib}/table/data/div-scope.type.d.ts +0 -0
  68. /package/{src/lib → lib}/table/data/event/mouse-target-data.d.ts +0 -0
  69. /package/{src/lib → lib}/table/data/geo-data.d.ts +0 -0
  70. /package/{src/lib → lib}/table/data/options/auto-restore-options.d.ts +0 -0
  71. /package/{src/lib → lib}/table/data/options/auto-restore-options.if.d.ts +0 -0
  72. /package/{src/lib → lib}/table/data/options/default-row-heights.d.ts +0 -0
  73. /package/{src/lib → lib}/table/data/options/default-row-heights.if.d.ts +0 -0
  74. /package/{src/lib → lib}/table/data/options/icon.d.ts +0 -0
  75. /package/{src/lib → lib}/table/data/options/icon.if.d.ts +0 -0
  76. /package/{src/lib → lib}/table/data/options/sorted-options.d.ts +0 -0
  77. /package/{src/lib → lib}/table/data/options/sorted-options.if.d.ts +0 -0
  78. /package/{src/lib → lib}/table/data/options/table-options.d.ts +0 -0
  79. /package/{src/lib → lib}/table/data/options/table-options.if.d.ts +0 -0
  80. /package/{src/lib → lib}/table/data/options/tree-options.d.ts +0 -0
  81. /package/{src/lib → lib}/table/data/options/tree-options.if.d.ts +0 -0
  82. /package/{src/lib → lib}/table/data/side-ident.type.d.ts +0 -0
  83. /package/{src/lib → lib}/table/data/table-model-and-options.d.ts +0 -0
  84. /package/{src/lib → lib}/table/data/table-model-and-options.if.d.ts +0 -0
  85. /package/{src/lib → lib}/table/data/tablemodel/area-ident.type.d.ts +0 -0
  86. /package/{src/lib → lib}/table/data/tablemodel/areamodel/abstract-area-model.d.ts +0 -0
  87. /package/{src/lib → lib}/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +0 -0
  88. /package/{src/lib → lib}/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +0 -0
  89. /package/{src/lib → lib}/table/data/tablemodel/areamodel/area-model-hidden.d.ts +0 -0
  90. /package/{src/lib → lib}/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.d.ts +0 -0
  91. /package/{src/lib → lib}/table/data/tablemodel/areamodel/area-model-object-array.d.ts +0 -0
  92. /package/{src/lib → lib}/table/data/tablemodel/areamodel/area-model.d.ts +0 -0
  93. /package/{src/lib → lib}/table/data/tablemodel/areamodel/area-model.if.d.ts +0 -0
  94. /package/{src/lib → lib}/table/data/tablemodel/areamodel/async-area-model-object-array.d.ts +0 -0
  95. /package/{src/lib → lib}/table/data/tablemodel/areamodel/col-and-rowspan-model.d.ts +0 -0
  96. /package/{src/lib → lib}/table/data/tablemodel/areamodel/has-default-row-height-if.d.ts +0 -0
  97. /package/{src/lib → lib}/table/data/tablemodel/cellgroup/cell-group-ext.d.ts +0 -0
  98. /package/{src/lib → lib}/table/data/tablemodel/cellgroup/cell-group.d.ts +0 -0
  99. /package/{src/lib → lib}/table/data/tablemodel/cellgroup/cell-group.if.d.ts +0 -0
  100. /package/{src/lib → lib}/table/data/tablemodel/cellgroup/cellgroup-factory.d.ts +0 -0
  101. /package/{src/lib → lib}/table/data/tablemodel/column/column-def.d.ts +0 -0
  102. /package/{src/lib → lib}/table/data/tablemodel/column/column-def.if.d.ts +0 -0
  103. /package/{src/lib → lib}/table/data/tablemodel/padding.d.ts +0 -0
  104. /package/{src/lib → lib}/table/data/tablemodel/table-model.d.ts +0 -0
  105. /package/{src/lib → lib}/table/data/tablemodel/table-model.if.d.ts +0 -0
  106. /package/{src/lib → lib}/table/ele-scope.d.ts +0 -0
  107. /package/{src/lib → lib}/table/event-adapter.d.ts +0 -0
  108. /package/{src/lib → lib}/table/event-listener.if.d.ts +0 -0
  109. /package/{src/lib → lib}/table/factory/table-factory.d.ts +0 -0
  110. /package/{src/lib → lib}/table/focus/focus-model.d.ts +0 -0
  111. /package/{src/lib → lib}/table/focus/focus-model.if.d.ts +0 -0
  112. /package/{src/lib → lib}/table/focus/focus.type.d.ts +0 -0
  113. /package/{src/lib → lib}/table/input-handler.d.ts +0 -0
  114. /package/{src/lib → lib}/table/mouse-handler.d.ts +0 -0
  115. /package/{src/lib → lib}/table/render-scope.d.ts +0 -0
  116. /package/{src/lib → lib}/table/renderer/cell-group-ext-cell-renderer.d.ts +0 -0
  117. /package/{src/lib → lib}/table/renderer/cell-render.if.d.ts +0 -0
  118. /package/{src/lib → lib}/table/renderer/checkbox-boolean-property-cell-renderer.d.ts +0 -0
  119. /package/{src/lib → lib}/table/renderer/checkbox-cell-renderer.d.ts +0 -0
  120. /package/{src/lib → lib}/table/renderer/date-to-int-date-cell-renderer.d.ts +0 -0
  121. /package/{src/lib → lib}/table/renderer/date-to-iso-cell-renderer.d.ts +0 -0
  122. /package/{src/lib → lib}/table/renderer/date-to-locale-date-cell-renderer.d.ts +0 -0
  123. /package/{src/lib → lib}/table/renderer/date-to-tec-cell-renderer.d.ts +0 -0
  124. /package/{src/lib → lib}/table/renderer/edit/edit-cell-renderer.type.d.ts +0 -0
  125. /package/{src/lib → lib}/table/renderer/edit/edit-input-pipe-for-number.d.ts +0 -0
  126. /package/{src/lib → lib}/table/renderer/edit/edit-input-pipe.if.d.ts +0 -0
  127. /package/{src/lib → lib}/table/renderer/edit/input-cell-renderer.d.ts +0 -0
  128. /package/{src/lib → lib}/table/renderer/edit/select-cell-renderer.d.ts +0 -0
  129. /package/{src/lib → lib}/table/renderer/male-female-to-icon-cell-renderer.d.ts +0 -0
  130. /package/{src/lib → lib}/table/renderer/number-cell-renderer.d.ts +0 -0
  131. /package/{src/lib → lib}/table/renderer/progress-bar-cell-renderer.d.ts +0 -0
  132. /package/{src/lib → lib}/table/renderer/renderer-cleanup-fn.type.d.ts +0 -0
  133. /package/{src/lib → lib}/table/renderer/renderer.d.ts +0 -0
  134. /package/{src/lib → lib}/table/renderer/star-rating-cell-renderer.d.ts +0 -0
  135. /package/{src/lib → lib}/table/renderer/true-false-cell-renderer.d.ts +0 -0
  136. /package/{src/lib → lib}/table/selection/selection-model.d.ts +0 -0
  137. /package/{src/lib → lib}/table/selection/selection-model.if.d.ts +0 -0
  138. /package/{src/lib → lib}/table/selection/selection-service.d.ts +0 -0
  139. /package/{src/lib → lib}/table/selection/selection.type.d.ts +0 -0
  140. /package/{src/lib → lib}/table/service/abstract-store-state.service.d.ts +0 -0
  141. /package/{src/lib → lib}/table/service/data/collapsed-expanded.data.d.ts +0 -0
  142. /package/{src/lib → lib}/table/service/data/html-style.type.d.ts +0 -0
  143. /package/{src/lib → lib}/table/service/dom-service.if.d.ts +0 -0
  144. /package/{src/lib → lib}/table/service/ge-filter.service.d.ts +0 -0
  145. /package/{src/lib → lib}/table/service/simple-dom-service.d.ts +0 -0
  146. /package/{src/lib → lib}/table/service/sorter.service.d.ts +0 -0
  147. /package/{src/lib → lib}/table/service/store-state-collapsed-expand.service.d.ts +0 -0
  148. /package/{src/lib → lib}/table/service/store-state-scroll-pos.service.d.ts +0 -0
  149. /package/{src/lib → lib}/table/service/store-state-sorting.service.d.ts +0 -0
  150. /package/{src/lib → lib}/table/table-api.d.ts +0 -0
package/index.js ADDED
@@ -0,0 +1,3742 @@
1
+ function O(h) {
2
+ return h && h.type === "TreeRow";
3
+ }
4
+ function z(h) {
5
+ return h && h.type === "AreaModelTree";
6
+ }
7
+ function be(h) {
8
+ return h && h.type === "CheckboxColumnDef";
9
+ }
10
+ class X {
11
+ constructor(e = -1, t = -1, o = -1, i = -1, s, r, l, n = 0, d = 0, a = 0, c = "") {
12
+ this.rowIndex = e, this.rowTop = t, this.columnIndex = o, this.columnLeft = i, this.areaIdent = s, this.sideIdent = r, this.originalEvent = l, this.clickCount = n, this.draggingX = d, this.draggingY = a, this.action = c;
13
+ }
14
+ clone() {
15
+ return new X(
16
+ this.rowIndex,
17
+ this.rowTop,
18
+ this.columnIndex,
19
+ this.columnLeft,
20
+ this.areaIdent,
21
+ this.sideIdent,
22
+ this.originalEvent,
23
+ this.clickCount,
24
+ this.draggingX,
25
+ this.draggingY,
26
+ this.action
27
+ );
28
+ }
29
+ }
30
+ class F {
31
+ constructor(e = ">", t = "", o = []) {
32
+ this.content = e, this.style = t, this.classes = o;
33
+ }
34
+ }
35
+ class ae {
36
+ constructor(e = new F(
37
+ ">",
38
+ "transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
39
+ ["gt-table-tree-arrow-expanded"]
40
+ ), t = new F(
41
+ ">",
42
+ "",
43
+ ["ge-table-tree-arrow-collapsed"]
44
+ ), o = new F(
45
+ ">",
46
+ "color:transparent;",
47
+ ["gt-table-tree-arrow-hidden"]
48
+ ), i = new F(
49
+ "↕",
50
+ "",
51
+ ["gt-table-tree-arrow-expanded-all"]
52
+ )) {
53
+ this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = o, this.arrowExpandCollapseAll = i;
54
+ }
55
+ }
56
+ class de {
57
+ constructor(e = new F("↑", "", ["ge-header-sorted-asc"]), t = new F("↓", "", ["ge-header-sorted-desc"]), o = new F("↑", "color:transparent;", [])) {
58
+ this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = o;
59
+ }
60
+ }
61
+ class pe {
62
+ constructor(e) {
63
+ this.domService = e;
64
+ }
65
+ setStyle(e, t, o) {
66
+ return this.domService.setStyle(e, t, o), e;
67
+ }
68
+ applyStyle(e, t) {
69
+ for (const o in t)
70
+ this.domService.setStyle(e, o, t[o]);
71
+ return e;
72
+ }
73
+ applyDisplayNoneStyle(e) {
74
+ return this.domService.setStyle(e, "display", "none"), e;
75
+ }
76
+ applyDisplayBlockStyle(e) {
77
+ return this.domService.setStyle(e, "display", "block"), e;
78
+ }
79
+ applyStyleInPx(e, t) {
80
+ return Object.entries(t).forEach(([o, i]) => this.domService.setStyle(e, o, i + "px")), e;
81
+ }
82
+ applyStylePosistionRelative(e) {
83
+ return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
84
+ }
85
+ applyStylePosistionAbsolute(e) {
86
+ return this.domService.setStyle(e, "position", "absolute"), e;
87
+ }
88
+ applyStyleFullSize(e) {
89
+ return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
90
+ }
91
+ applyStyleOverflowAuto(e = "auto", t = "auto", o) {
92
+ return this.domService.setStyle(o, "overflow-x", e), this.domService.setStyle(o, "overflow-y", t), o;
93
+ }
94
+ applyStyleNoPadding(e) {
95
+ return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
96
+ }
97
+ appendRelativeChildDiv(e) {
98
+ const t = this.applyStylePosistionRelative(
99
+ this.applyStyleFullSize(
100
+ this.applyStyleNoPadding(
101
+ this.domService.createElement("div")
102
+ )
103
+ )
104
+ );
105
+ return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
106
+ }
107
+ appendText(e, t) {
108
+ const o = this.domService.createText(t);
109
+ return this.domService.appendChild(e, o), o;
110
+ }
111
+ addClass(e, t) {
112
+ return e.includes(" ") ? e.split(" ").forEach((o) => this.domService.addClass(t, o)) : this.domService.addClass(t, e), t;
113
+ }
114
+ addClasses(e, t) {
115
+ if (e)
116
+ for (const o of e)
117
+ this.domService.addClass(t, o);
118
+ return t;
119
+ }
120
+ setAttribute(e, t, o) {
121
+ return t && o && this.domService.setAttribute(e, t, o), e;
122
+ }
123
+ createAreaDivWithClass(e, t, o, i) {
124
+ const s = this.domService.createElement("div");
125
+ return this.addClass(e, s), this.domService.setAttribute(s, "data-area", o), this.domService.setAttribute(s, "data-side", i), this.domService.appendChild(t, s), s;
126
+ }
127
+ createDivWithClass(e, t) {
128
+ const o = this.domService.createElement("div");
129
+ return this.addClass(e, o), this.domService.appendChild(t, o), o;
130
+ }
131
+ addRowDiv(e, t, o = -1, i, s, r = "") {
132
+ const l = t.index ?? -1, n = this.getDivOrCreateDiv(l, e);
133
+ if (this.domService.addClass(n, "ge-table-row-div"), this.domService.addClass(n, `ge-table-row-div-${t.index}`), i === "body" && s === "center") {
134
+ const d = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
135
+ this.domService.addClass(n, `ge-table-row-${d}`);
136
+ }
137
+ if (this.domService.setStyle(n, "display", "clip"), this.domService.setStyle(n, "position", "absolute"), this.domService.setStyle(n, "left", `${t.left}px`), this.domService.setStyle(n, "top", `${t.top}px`), this.domService.setStyle(n, "width", `${t.width}px`), this.domService.setStyle(n, "height", `${t.height}px`), this.domService.setAttribute(n, "data-row-index", `${o}`), this.domService.setAttribute(n, "data-area", `${i}`), r) {
138
+ const d = this.domService.createText(r);
139
+ this.domService.appendChild(n, d);
140
+ }
141
+ return this.domService.appendChild(e.child, n), n;
142
+ }
143
+ addColumnDiv(e, t, o = -1, i = -1, s, r, l = "", n, d, a = void 0, c) {
144
+ const g = d == null ? void 0 : d.treeOptions, m = d == null ? void 0 : d.showCheckboxWihoutExtraColumn, b = this.domService.createElement("div");
145
+ this.domService.addClass(b, "ge-table-col-div"), this.domService.addClass(b, `ge-table-col-div-${t.index}`), this.domService.setAttribute(b, "data-col-index", `${t.index}`), this.domService.setAttribute(b, "data-row-index", `${o}`), this.domService.setAttribute(b, "data-area", `${s}`);
146
+ const w = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
147
+ if (s === "body" && r === "center" && this.domService.addClass(b, `ge-table-column-${w}`), this.domService.setStyle(b, "display", "clip"), this.domService.setStyle(b, "position", "absolute"), this.domService.setStyle(b, "left", `${t.left}px`), this.domService.setStyle(b, "top", `${t.top}px`), this.domService.setStyle(b, "width", `${t.width}px`), this.domService.setStyle(b, "height", `${t.height}px`), n && n !== "none" && (this.domService.addClass(b, "ge-table-col-tree"), this.addArrowDiv(b, n, g, o, i, s)), m && i === 0 && a && this.addCheckboxToDiv(b, a, s, o), l) {
148
+ const u = n !== "none" && i === 0;
149
+ this.addLabelDiv(b, l, u, o, i, s);
150
+ }
151
+ return c && this.addSortedIcon(b, c, d == null ? void 0 : d.sortedOptions, i), this.domService.appendChild(e, b), b;
152
+ }
153
+ addCheckboxToDiv(e, t, o, i) {
154
+ const s = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
155
+ return s.innerHTML = `
156
+ <input
157
+ type="checkbox"
158
+ data-area="${o}"
159
+ data-row-index="${i}"
160
+ data-input-type="checkbox"
161
+ ${r}
162
+ class="ge-table-row-checkbox"> `, this.domService.setStyle(s, "display", "inline"), this.domService.setStyle(s, "width", "inherit"), this.domService.setAttribute(s, "data-row-index", `${i}`), this.domService.appendChild(e, s), s;
163
+ }
164
+ addLabelDiv(e, t = "", o = !1, i = -1, s = -1, r = "body") {
165
+ const l = this.domService.createElement("div");
166
+ if (this.domService.addClass(l, "ge-table-label-div"), this.domService.setStyle(l, "position", "relative"), this.domService.setStyle(l, "background", "transparent"), this.domService.setStyle(l, "width", "100%"), this.domService.setStyle(l, "height", "100%"), this.domService.setAttribute(l, "data-row-index", `${i}`), this.domService.setAttribute(l, "data-col-index", `${s}`), this.domService.setAttribute(l, "data-area", `${r}`), t)
167
+ if (o) {
168
+ const n = this.domService.createText(t);
169
+ this.domService.appendChild(l, n);
170
+ } else {
171
+ const n = this.domService.createElement("div");
172
+ this.domService.appendChild(l, n);
173
+ const d = this.domService.createText(t);
174
+ this.domService.addClass(n, "ge-table-label"), this.domService.appendChild(n, d), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${s}`), this.domService.setAttribute(n, "data-area", `${r}`);
175
+ }
176
+ return this.domService.appendChild(e, l), l;
177
+ }
178
+ addSortedIcon(e, t = "", o = new de(), i = -1) {
179
+ const s = this.domService.createElement("div");
180
+ this.domService.addClass(s, "ge-table-sorted-icon-div"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "top", "0"), this.domService.setStyle(s, "right", "0"), this.domService.setStyle(s, "width", "20px"), this.domService.setStyle(s, "background", "transparent"), this.domService.setStyle(s, "cursor", "pointer"), this.domService.setAttribute(s, "data-col-index", `${i}`), this.domService.setAttribute(s, "data-area", "header");
181
+ let r;
182
+ t === "asc" ? r = o.iconAsc : t === "desc" ? r = o.iconDesc : r = o.iconPlaceholder;
183
+ const l = r.content, n = this.domService.createText(l);
184
+ this.domService.appendChild(s, n), r.style && this.applyStyleString(s, r.style);
185
+ for (const d of r.classes)
186
+ this.domService.addClass(s, d);
187
+ return this.domService.appendChild(e, s), s;
188
+ }
189
+ addArrowDiv(e, t = "none", o = new ae(), i = -1, s = -1, r = "body") {
190
+ const l = this.domService.createElement("div");
191
+ this.domService.addClass(l, "ge-table-tree-arrow-div"), this.domService.setStyle(l, "display", "inline-block"), this.domService.setStyle(l, "position", ""), this.domService.setStyle(l, "width", "20px"), this.domService.setStyle(l, "background", "transparent"), this.domService.setStyle(l, "cursor", "pointer"), this.domService.setAttribute(l, "data-row-index", `${i}`), this.domService.setAttribute(l, "data-col-index", `${s}`), this.domService.setAttribute(l, "data-area", `${r}`);
192
+ let n;
193
+ t === "expanded" ? n = o.arrowExpanded : t === "collapsed" ? n = o.arrowCollapsed : n = o.arrowPlaceholder;
194
+ const d = n.content, a = this.domService.createText(d);
195
+ this.domService.appendChild(l, a), n.style && this.applyStyleString(l, n.style);
196
+ for (const c of n.classes)
197
+ this.domService.addClass(l, c);
198
+ return this.domService.appendChild(e, l), l;
199
+ }
200
+ addColumnBorderDivs(e, t, o, i, s) {
201
+ if (e.verticalBorderVisible) {
202
+ const r = `ge-table-${i}-${s}-vertical-border`;
203
+ this.addVerticalBorder(o, t, r);
204
+ }
205
+ if (e.horizontalBorderVisible) {
206
+ const r = `ge-table-${i}-${s}-horizontal-border`;
207
+ this.addHorizontalBorder(o, t, r);
208
+ }
209
+ return t;
210
+ }
211
+ addHorizontalBorder(e, t, o = "ge-table-body-center-horizontal-border") {
212
+ const i = this.domService.createElement("div");
213
+ return this.domService.addClass(i, o), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${e.left}px`), this.domService.setStyle(i, "top", `${e.top}px`), this.domService.setStyle(i, "width", `${e.width}px`), this.domService.setStyle(i, "height", "1px"), this.domService.appendChild(t, i), i;
214
+ }
215
+ addFocusBorderDivs(e, t, o) {
216
+ let i = this.domService.createElement("div");
217
+ return this.domService.addClass(i, "ge-table-focus-border"), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left}px`), this.domService.setStyle(i, "top", `${t.top}px`), this.domService.setStyle(i, "width", "1px"), this.domService.setStyle(i, "height", `${t.height}px`), this.applyStyle(i, o), this.domService.appendChild(e, i), i = this.domService.createElement("div"), this.domService.addClass(i, "ge-table-focus-border"), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left + t.width - 1}px`), this.domService.setStyle(i, "top", `${t.top}px`), this.domService.setStyle(i, "width", "1px"), this.domService.setStyle(i, "height", `${t.height}px`), this.applyStyle(i, o), this.domService.appendChild(e, i), i = this.domService.createElement("div"), this.domService.addClass(i, "ge-table-focus-border"), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left}px`), this.domService.setStyle(i, "top", `${t.top}px`), this.domService.setStyle(i, "width", `${t.width}px`), this.domService.setStyle(i, "height", "1px"), this.applyStyle(i, o), this.domService.appendChild(e, i), i = this.domService.createElement("div"), this.domService.addClass(i, "ge-table-focus-border"), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left}px`), this.domService.setStyle(i, "top", `${t.top + t.height - 1}px`), this.domService.setStyle(i, "width", `${t.width}px`), this.domService.setStyle(i, "height", "1px"), this.applyStyle(i, o), this.domService.appendChild(e, i), e;
218
+ }
219
+ addVerticalBorder(e, t, o = "ge-table-body-center-vertical-border") {
220
+ const i = this.domService.createElement("div");
221
+ return this.domService.addClass(i, o), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${e.left}px`), this.domService.setStyle(i, "top", `${e.top}px`), this.domService.setStyle(i, "width", "1px"), this.domService.setStyle(i, "height", `${e.height}px`), this.domService.appendChild(t, i), i;
222
+ }
223
+ addDiv(e, t, o = "") {
224
+ const i = this.domService.createElement("div");
225
+ return o && this.domService.addClass(i, o), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left}px`), this.domService.setStyle(i, "top", `${t.top}px`), this.domService.setStyle(i, "width", `${t.width}px`), this.domService.setStyle(i, "height", `${t.height}px`), this.domService.appendChild(e, i), i;
226
+ }
227
+ applyStyleString(e, t) {
228
+ const o = t.split(";").map((i) => i.trim()).filter((i) => i);
229
+ for (const i of o) {
230
+ const [s, r] = i.split(":");
231
+ this.domService.setStyle(e, s.trim(), r.trim());
232
+ }
233
+ }
234
+ getDivOrCreateDiv(e, t) {
235
+ let o = t.cache[e];
236
+ return o ? (o.innerText = "", o) : (o = this.domService.createElement("div"), t.cache[e] = o, o);
237
+ }
238
+ }
239
+ const Y = (h) => h === "header" ? "header" : h === "footer" ? "footer" : "body";
240
+ class fe {
241
+ constructor(e, t) {
242
+ if (this.rowIdx = -1, this.colIdx = -1, this.action = null, this.inputType = null, this.className = "", e !== null && (e instanceof HTMLDivElement || e instanceof HTMLSpanElement || e instanceof HTMLInputElement)) {
243
+ this.className = e.className, this.action = e.getAttribute("data-ge-action"), this.inputType = e.getAttribute("data-input-type"), this.rowIdx = Number(e.getAttribute("data-row-index")), this.colIdx = Number(e.getAttribute("data-col-index"));
244
+ const o = e.getAttribute("data-area");
245
+ if (o && (this.areaIdent = Y(o), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
246
+ const i = e;
247
+ this.value = i.value;
248
+ }
249
+ }
250
+ }
251
+ }
252
+ class me {
253
+ constructor(e) {
254
+ this.tableScope = e, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, this.tableScope.hostElement.addEventListener("click", this.onHostElementClicked.bind(this)), this.tableScope.hostElement.addEventListener("dblclick", this.onHostElementDblClicked.bind(this)), this.tableScope.hostElement.addEventListener("mousedown", this.onMouseDown.bind(this)), this.tableScope.hostElement.addEventListener("mousemove", this.onMouseMove.bind(this)), this.tableScope.hostElement.addEventListener("mouseup", this.onMouseUp.bind(this)), this.tableScope.hostElement.addEventListener("contextmenu", this.onContextmenu.bind(this)), this.tableScope.hostElement._MouseHandler = "true", this.tableScope.scrollViewport.addEventListener("scroll", this.tableScope.adjustAfterScrolling.bind(this.tableScope)), [window, this.tableScope.hostElement].forEach(
255
+ (t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
256
+ );
257
+ }
258
+ onContextmenu(e) {
259
+ this.mouseEvent = e;
260
+ const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
261
+ this.tableScope.contextmenu(t);
262
+ }
263
+ onHostElementClicked(e) {
264
+ const t = new fe(e.target, this.tableScope);
265
+ if (t.action === "toggleExpandCollapseAll")
266
+ this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
267
+ else if (t.inputType === "checkbox" && t.areaIdent)
268
+ this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
269
+ else if (O(t.row) && t.areaModel) {
270
+ const o = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
271
+ if (console.info(i, o), o || i) {
272
+ e.preventDefault(), e.stopPropagation();
273
+ const s = t.row;
274
+ s.expanded = !s.expanded, "recalcVisibleTreeRows" in t.areaModel && t.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(s);
275
+ }
276
+ }
277
+ if (t.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
278
+ const o = this.tableScope.tableOptions.getFocusModel();
279
+ o == null || o.clear(), o == null || o.setFocus(t.rowIdx, t.colIdx);
280
+ }
281
+ this.publishGeMouseEvent(e, 1);
282
+ }
283
+ onHostElementDblClicked(e) {
284
+ if (e.target instanceof HTMLElement) {
285
+ const t = e.target, o = t.getAttribute("data-area"), i = Y(o), s = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), l = this.tableScope.tableModel.getAreaModel(i);
286
+ if (o && i === "header")
287
+ this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, s, r));
288
+ else if (t.getAttribute("data-row-index")) {
289
+ const n = l.getRowByIndex(s);
290
+ if (o && i === "body" && l.isEditable(s, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(s, r)), O(n) && r === this.getArrowColumnIndex()) {
291
+ e.preventDefault(), e.stopPropagation();
292
+ const d = n;
293
+ d.expanded = !d.expanded, "recalcVisibleTreeRows" in l && l.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(d);
294
+ }
295
+ }
296
+ }
297
+ this.publishGeMouseEvent(e, 2);
298
+ }
299
+ publishGeMouseEvent(e, t) {
300
+ var o;
301
+ this.mouseEvent = e, this.geMouseEventOld = (o = this.geMouseEvent) == null ? void 0 : o.clone(), this.geMouseEvent = this.tableScope.createGeMouseEvent(e), this.geMouseEvent && (this.geMouseEvent.clickCount = t), this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld);
302
+ }
303
+ updateCollapsedExpandedState(e) {
304
+ var o, i, s, r, l;
305
+ const t = (i = (o = this.tableScope.tableOptions) == null ? void 0 : o.autoRestoreOptions) == null ? void 0 : i.getRowId;
306
+ if (t) {
307
+ const n = (s = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : s.collapsedExpandedStateGet().mode, d = n === "collapsed" && !e.expanded || n === "expanded" && e.expanded, a = n === "collapsed" && e.expanded || n === "expanded" && !e.expanded, c = t(e.data);
308
+ d ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(c) : a && ((l = this.tableScope.storeStateCollapsedExpandService) == null || l.collapsedStateIdsRemove(c));
309
+ }
310
+ }
311
+ getArrowColumnIndex() {
312
+ return this.tableScope.tableModel.isRowCheckboxVisible() ? 1 : 0;
313
+ }
314
+ onMouseDown(e) {
315
+ this.mouseEvent = e, this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent), this.tableScope.onMouseDown(this.startMouseEvent), this.mouseDown = !0;
316
+ }
317
+ onMouseMove(e) {
318
+ this.mouseEvent = e, this.mouseDown ? (this.dragging = !0, requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))) : requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
319
+ }
320
+ onMouseUp(e) {
321
+ this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1;
322
+ }
323
+ mouseDraggingOnFrame() {
324
+ var e;
325
+ if (this.mouseEvent) {
326
+ const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
327
+ (e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(t);
328
+ }
329
+ }
330
+ mouseDraggingEndOnFrame() {
331
+ var e;
332
+ if (this.mouseEvent) {
333
+ const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
334
+ (e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingEndOnFrame(t);
335
+ }
336
+ }
337
+ mouseMoveOnFrame() {
338
+ if (this.mouseEvent) {
339
+ const e = this.tableScope.createGeMouseEvent(this.mouseEvent);
340
+ this.tableScope.mouseMove(e);
341
+ }
342
+ }
343
+ }
344
+ class we {
345
+ constructor(e) {
346
+ this.tableScope = e;
347
+ }
348
+ updateCells(e) {
349
+ this.tableScope.updateCells(e);
350
+ }
351
+ externalFilterChanged() {
352
+ this.tableScope.externalFilterChanged();
353
+ }
354
+ scrollToPixel(e = 0, t = 0) {
355
+ }
356
+ scrollToIndex(e = 0, t = 0) {
357
+ }
358
+ setHeaderVisible(e = !0) {
359
+ }
360
+ setColumnVisible(e, t = !0) {
361
+ }
362
+ isColumnVisible(e) {
363
+ return !0;
364
+ }
365
+ isHeaderVisible() {
366
+ return !0;
367
+ }
368
+ setFooterVisible(e = !0) {
369
+ }
370
+ isFooterVisible() {
371
+ return !0;
372
+ }
373
+ repaint() {
374
+ this.tableScope.repaint();
375
+ }
376
+ }
377
+ class K {
378
+ constructor(e) {
379
+ this.getStorageKeyFn = e;
380
+ }
381
+ autoConvertMapToObject(e) {
382
+ const t = {};
383
+ if (e instanceof Map) {
384
+ const o = e;
385
+ for (const i of [...o]) {
386
+ const [
387
+ s,
388
+ r
389
+ ] = i;
390
+ t[s] = r;
391
+ }
392
+ }
393
+ return t;
394
+ }
395
+ checkAndPersistItem(e, t) {
396
+ const o = this.getStorageKeyFn;
397
+ if (o) {
398
+ const i = o();
399
+ if (i) {
400
+ const s = i + e;
401
+ if ((t + "").includes("Map")) {
402
+ const r = this.autoConvertMapToObject(t);
403
+ this.persistItem(s, r);
404
+ } else
405
+ this.persistItem(s, t);
406
+ }
407
+ }
408
+ }
409
+ persistItem(e, t) {
410
+ t ? localStorage.setItem(e, JSON.stringify(t)) : localStorage.removeItem(e);
411
+ }
412
+ loadFromLocalStorage(e) {
413
+ const t = localStorage.getItem(e);
414
+ return t ? JSON.parse(t) : null;
415
+ }
416
+ // private loadItems() {
417
+ // const fn = this.getStorageKeyFn;
418
+ // if (fn) {
419
+ // const key = fn();
420
+ // if (key) {
421
+ // // A main key is given by function from options
422
+ // const subKey = key + this.CHECKED_STATE;
423
+ // const arr = this.loadFromLocalStorage<Array<string | number>>(subKey);
424
+ // if (arr) {
425
+ // this.checkedStateIds.length = 0;
426
+ // arr.forEach(a => this.checkedStateIds.push(a));
427
+ // }
428
+ //
429
+ // const subKey2 = key + this.COLLAPSED_EXPANDED_STATE;
430
+ // const data = this.loadFromLocalStorage<CollapsedExpandedData>(subKey2);
431
+ // if (data) {
432
+ // this.collapsedExpandedState = data;
433
+ // }
434
+ //
435
+ // const subKey3 = key + this.SELECTED_STATE;
436
+ // const arr3 = this.loadFromLocalStorage<object>(subKey3);
437
+ // if (arr3) {
438
+ // const map: Map<string | number, string[]> = new Map(Object.entries(arr3));
439
+ // if (map) {
440
+ // this.selectedStateIds.clear();
441
+ // map.forEach((col, k) => this.selectedStateIds.set(k, col));
442
+ // }
443
+ // }
444
+ //
445
+ // const subKey4 = key + this.SCROLL_STATE;
446
+ // let scrollOffset = this.loadFromLocalStorage<[number, number]>(subKey4);
447
+ // this.scrollOffset = scrollOffset ? scrollOffset : [0, 0];
448
+ // }
449
+ // }
450
+ // }
451
+ }
452
+ class Se extends K {
453
+ constructor(e) {
454
+ super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
455
+ }
456
+ getScrollOffset() {
457
+ return this.scrollOffset;
458
+ }
459
+ updateScrollOffset(e) {
460
+ this.scrollOffset = e, this.checkAndPersistItem(this.SCROLL_STATE, this.scrollOffset);
461
+ }
462
+ load() {
463
+ const e = this.getStorageKeyFn;
464
+ if (e) {
465
+ const t = e();
466
+ if (t) {
467
+ const o = t + this.SCROLL_STATE;
468
+ let i = this.loadFromLocalStorage(o);
469
+ this.scrollOffset = i || [0, 0];
470
+ }
471
+ }
472
+ }
473
+ }
474
+ class xe {
475
+ constructor(e = "collapsed", t = [], o = !1, i = !1) {
476
+ this.mode = e, this.rowIds = t, this.allCollapsed = o, this.allExpanded = i;
477
+ }
478
+ }
479
+ class ye extends K {
480
+ constructor(e) {
481
+ super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new xe(), this.load();
482
+ }
483
+ collapsedExpandedStateGet() {
484
+ return this.collapsedExpandedState;
485
+ }
486
+ collapsedExpandedStateIncludes(e) {
487
+ return this.collapsedExpandedState.rowIds.includes(e);
488
+ }
489
+ collapsedStateIdsPush(e) {
490
+ this.collapsedExpandedState.rowIds.includes(e) || (this.collapsedExpandedState.rowIds.push(e), this.collapsedExpandedState.allCollapsed = !1, this.collapsedExpandedState.allExpanded = !1, this.persist());
491
+ }
492
+ collapsedStateIdsRemove(e) {
493
+ const t = this.collapsedExpandedState.rowIds.indexOf(e);
494
+ t !== -1 && (this.collapsedExpandedState.rowIds.splice(t, 1), this.collapsedExpandedState.allCollapsed = !1, this.collapsedExpandedState.allExpanded = !1, this.persist());
495
+ }
496
+ collapsedStateAll(e) {
497
+ this.collapsedExpandedState.rowIds = [], this.collapsedExpandedState.mode = e ? "collapsed" : "expanded", this.collapsedExpandedState.allCollapsed = !e, this.collapsedExpandedState.allExpanded = e, this.persist();
498
+ }
499
+ load() {
500
+ const e = this.getStorageKeyFn;
501
+ if (e) {
502
+ const t = e();
503
+ if (t) {
504
+ const o = t + this.COLLAPSED_EXPANDED_STATE, i = this.loadFromLocalStorage(o);
505
+ i && (this.collapsedExpandedState = i);
506
+ }
507
+ }
508
+ }
509
+ persist() {
510
+ this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
511
+ }
512
+ }
513
+ class Ce extends K {
514
+ constructor(e) {
515
+ super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
516
+ }
517
+ getSortItems() {
518
+ return this.sortItems;
519
+ }
520
+ setSortItems(e) {
521
+ this.sortItems = e, this.checkAndPersistItem(this.SORTING_STATE, this.sortItems);
522
+ }
523
+ load() {
524
+ const e = this.getStorageKeyFn;
525
+ if (e) {
526
+ const t = e();
527
+ if (t) {
528
+ const o = t + this.SORTING_STATE;
529
+ let i = this.loadFromLocalStorage(o);
530
+ this.sortItems = i || [];
531
+ }
532
+ }
533
+ }
534
+ }
535
+ class $ {
536
+ constructor(e = 0, t = 0, o = 0, i = 0, s) {
537
+ this.left = e, this.width = t, this.height = o, this.top = i, this.index = s;
538
+ }
539
+ }
540
+ class ve {
541
+ constructor(e, t, o, i) {
542
+ this.hostElement = e, this.tableModel = t, this.dom = o, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new $(), this.areaBodyCenterGeo = new $(), this.areaBodyEastGeo = new $();
543
+ const s = this.hostElement;
544
+ s.innerText = "", this.dom.setAttribute(s, "tabindex", "0"), this.dom.setStyle(
545
+ this.dom.addClass("ge-table", s),
546
+ "position",
547
+ "relative"
548
+ ), this.hoverRow = o.applyStylePosistionAbsolute(
549
+ o.createDivWithClass("ge-table-hover-row", s)
550
+ ), this.hoverColumn = o.applyStylePosistionAbsolute(
551
+ o.createDivWithClass("ge-table-hover-column", s)
552
+ ), this.areaHeaderWest = o.appendRelativeChildDiv(
553
+ o.applyStylePosistionAbsolute(
554
+ o.createAreaDivWithClass("ge-table-header ge-table-header-west", s, "header", "west")
555
+ )
556
+ ), this.areaHeaderCenter = o.appendRelativeChildDiv(
557
+ o.applyStylePosistionAbsolute(
558
+ o.createAreaDivWithClass("ge-table-header ge-table-header-center", s, "header", "center")
559
+ )
560
+ ), this.areaHeaderEast = o.appendRelativeChildDiv(
561
+ o.applyStylePosistionAbsolute(
562
+ o.createAreaDivWithClass("ge-table-header ge-table-header-east", s, "body", "east")
563
+ )
564
+ ), this.areaBodyWest = o.appendRelativeChildDiv(
565
+ o.applyStylePosistionAbsolute(
566
+ o.createAreaDivWithClass("ge-table-body ge-table-body-west", s, "body", "west")
567
+ )
568
+ ), this.areaBodyEast = o.appendRelativeChildDiv(
569
+ o.applyStylePosistionAbsolute(
570
+ o.createAreaDivWithClass("ge-table-body ge-table-body-east", s, "body", "east")
571
+ )
572
+ ), this.areaFooterWest = o.appendRelativeChildDiv(
573
+ o.applyStylePosistionAbsolute(
574
+ o.createAreaDivWithClass("ge-table-footer ge-table-footer-west", s, "footer", "west")
575
+ )
576
+ ), this.areaFooterCenter = o.appendRelativeChildDiv(
577
+ o.applyStylePosistionAbsolute(
578
+ o.createAreaDivWithClass("ge-table-footer ge-table-footer-center", s, "footer", "center")
579
+ )
580
+ ), this.areaFooterEast = o.appendRelativeChildDiv(
581
+ o.applyStylePosistionAbsolute(
582
+ o.createAreaDivWithClass("ge-table-footer ge-table-footer-east", s, "footer", "east")
583
+ )
584
+ ), this.scrollViewport = o.applyStyleOverflowAuto(
585
+ this.tableOptions.overflowX ?? "auto",
586
+ this.tableOptions.overflowY ?? "auto",
587
+ o.applyStyleNoPadding(
588
+ o.applyStylePosistionAbsolute(
589
+ o.createAreaDivWithClass("ge-table-scroll-viewport", s, "body", "center")
590
+ )
591
+ )
592
+ ), this.contentWrapperDiv = o.applyStyleNoPadding(
593
+ o.applyStylePosistionRelative(
594
+ o.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
595
+ )
596
+ ), this.contentDiv = o.applyStyleNoPadding(
597
+ o.applyStylePosistionRelative(
598
+ o.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
599
+ )
600
+ ), this.areaBodyCenter = o.appendRelativeChildDiv(
601
+ o.createDivWithClass("ge-table-body-center", this.contentDiv)
602
+ ), this.borderHeaderBottom = o.applyStylePosistionAbsolute(
603
+ o.createDivWithClass("ge-table-header-border", s)
604
+ ), this.borderFixedWest = o.applyStylePosistionAbsolute(
605
+ o.createDivWithClass("ge-table-west-fixed-column-border", s)
606
+ ), this.borderFixedEast = o.applyStylePosistionAbsolute(
607
+ o.createDivWithClass("ge-table-east-fixed-column-border", s)
608
+ ), this.borderFooterTop = o.applyStylePosistionAbsolute(
609
+ o.createDivWithClass("ge-table-footer-border", s)
610
+ );
611
+ }
612
+ adjustContainersAndRows() {
613
+ const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, o = this.hostElement.clientHeight;
614
+ this.dom.applyStyle(this.scrollViewport, {
615
+ width: `${t - e.left}px`,
616
+ height: `${o - e.top}px`,
617
+ top: `${e.top}px`,
618
+ left: `${e.left}px`
619
+ }), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
620
+ width: `${this.scrollViewport.clientWidth}px`,
621
+ height: `${this.scrollViewport.clientHeight}px`,
622
+ top: `${this.scrollTop}px`,
623
+ left: `${this.scrollViewport.scrollLeft}px`
624
+ }), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = o - e.top - e.bottom, this.areaBodyWestGeo.top = e.top, this.areaBodyWestGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyWest.parent, this.areaBodyWestGeo), this.tableOptions.fixedWestSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
625
+ this.dom.applyStyle(this.borderFixedWest, {
626
+ width: "1px",
627
+ height: `${this.areaBodyWestGeo.height}px`,
628
+ top: `${this.areaBodyWestGeo.top}px`,
629
+ left: `${this.areaBodyWestGeo.width}px`
630
+ })
631
+ ) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = o - e.top - e.bottom, this.areaBodyEastGeo.top = e.top, this.areaBodyEastGeo.left = t - e.right, this.dom.applyStyleInPx(this.areaBodyEast.parent, this.areaBodyEastGeo), this.tableOptions.fixedEastSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
632
+ this.dom.applyStyle(this.borderFixedEast, {
633
+ width: "1px",
634
+ height: `${this.areaBodyEastGeo.height}px`,
635
+ top: `${this.areaBodyEastGeo.top}px`,
636
+ left: `${this.areaBodyEastGeo.left}px`
637
+ })
638
+ ) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height = o - e.top - e.bottom, this.areaBodyCenterGeo.top = 0, this.areaBodyCenterGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyCenter.parent, this.areaBodyCenterGeo), this.dom.applyStyle(this.areaHeaderCenter.parent, {
639
+ width: `${t - e.left - e.right}px`,
640
+ height: `${e.top}px`,
641
+ top: "0",
642
+ left: `${e.left}px`
643
+ }), this.dom.applyStyle(this.areaHeaderWest.parent, {
644
+ width: `${e.left}px`,
645
+ height: `${e.top}px`,
646
+ top: "0",
647
+ left: "0"
648
+ }), this.dom.applyStyle(this.areaHeaderEast.parent, {
649
+ width: `${e.right}px`,
650
+ height: `${e.top}px`,
651
+ top: "0",
652
+ left: `${t - e.right}px`
653
+ }), this.tableOptions.headerSeparatorBorderVisible && this.tableModel.isHeaderVisibe() ? this.dom.applyDisplayBlockStyle(
654
+ this.dom.applyStyle(this.borderHeaderBottom, {
655
+ width: `${t}px`,
656
+ height: "1px",
657
+ top: `${e.top}px`,
658
+ left: "0px"
659
+ })
660
+ ) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
661
+ width: `${e.left}px`,
662
+ height: `${e.bottom}px`,
663
+ top: `${o - e.bottom}px`,
664
+ left: "0"
665
+ }), this.dom.applyStyle(this.areaFooterCenter.parent, {
666
+ width: `${t - e.left - e.right}px`,
667
+ height: `${e.bottom}px`,
668
+ top: `${o - e.bottom}px`,
669
+ left: `${e.left}px`
670
+ }), this.dom.applyStyle(this.areaFooterEast.parent, {
671
+ width: `${e.right}px`,
672
+ height: `${e.bottom}px`,
673
+ top: `${o - e.bottom}px`,
674
+ left: `${t - e.right}px`
675
+ }), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
676
+ this.dom.applyStyle(this.borderFooterTop, {
677
+ width: `${t}px`,
678
+ height: "1px",
679
+ top: `${o - e.bottom}px`,
680
+ left: "0px"
681
+ })
682
+ ) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
683
+ }
684
+ adjustAfterScrolling() {
685
+ }
686
+ resetSizeOfWrapperDiv() {
687
+ const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
688
+ this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
689
+ }
690
+ }
691
+ class E {
692
+ constructor(e, t, o, i, s = !1) {
693
+ this.r1 = e, this.c1 = t, this.r2 = o, this.c2 = i, this.gammaRange = s;
694
+ }
695
+ static create(e) {
696
+ return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
697
+ e.rowIndex1,
698
+ e.columnIndex1,
699
+ e.rowIndex2,
700
+ e.columnIndex2,
701
+ e.gammaRange
702
+ );
703
+ }
704
+ static singleCell(e, t) {
705
+ return new E(e, t, e, t);
706
+ }
707
+ static singleRow(e) {
708
+ return new E(e, 0, e, Number.MAX_SAFE_INTEGER);
709
+ }
710
+ static singleColumn(e) {
711
+ return new E(0, e, Number.MAX_SAFE_INTEGER, e);
712
+ }
713
+ isInRange(e, t) {
714
+ return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
715
+ }
716
+ }
717
+ class Re {
718
+ constructor(e, t) {
719
+ this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
720
+ }
721
+ init() {
722
+ if (this.areaModel.getMaxColspan() < 2 && this.areaModel.getMaxRowspan() < 2)
723
+ return;
724
+ this.colAndRowspanRanges = [];
725
+ const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
726
+ for (let o = 0; o < e; o++)
727
+ for (let i = 0; i < t; i++) {
728
+ let s = this.areaModel.getColspanAt(o, i), r = this.areaModel.getRowspanAt(o, i);
729
+ if (s > 1 || r > 1) {
730
+ s === 0 && (s = 1), r === 0 && (r = 1);
731
+ const l = this.areaModel.hasOwnProperty("gammaCells");
732
+ this.colAndRowspanRanges.push(
733
+ new E(o, i, o + r - 1, i + s - 1, l)
734
+ );
735
+ }
736
+ }
737
+ }
738
+ getRanges() {
739
+ return this.colAndRowspanRanges ? this.colAndRowspanRanges : [];
740
+ }
741
+ isInRange(e, t) {
742
+ if (this.colAndRowspanRanges) {
743
+ for (const o of this.colAndRowspanRanges)
744
+ if (o.isInRange(e, t))
745
+ return !0;
746
+ }
747
+ return !1;
748
+ }
749
+ }
750
+ class k {
751
+ constructor(e, t, o) {
752
+ this.header = e, this.body = t, this.footer = o;
753
+ }
754
+ }
755
+ class Ae extends ve {
756
+ constructor(e, t, o, i) {
757
+ var r, l;
758
+ super(e, t, o, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
759
+ header: [],
760
+ body: [],
761
+ footer: []
762
+ }, this.tree = !1, this.colAndRowspanModels = new k(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (l = this.tableOptions) != null && l.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), z(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
763
+ (n) => {
764
+ var d;
765
+ this.colAndRowspanModels[n] = new Re(t, t.getAreaModel(n)), (d = this.colAndRowspanModels[n]) == null || d.init();
766
+ }
767
+ );
768
+ }
769
+ isEditing() {
770
+ return this.editing;
771
+ }
772
+ resetEditorRenderer() {
773
+ this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
774
+ }
775
+ clearSelection() {
776
+ if (this.getSelectionModel) {
777
+ const e = this.getSelectionModel();
778
+ e == null || e.clear();
779
+ }
780
+ }
781
+ initRenderEditor(e, t) {
782
+ var i;
783
+ let o = (i = this.tableModel.getColumnDef(t)) == null ? void 0 : i.getEditRenderer;
784
+ if (o || (o = this.tableOptions.getEditRenderer), o)
785
+ if (this.editorRenderer = o(e, t), this.editorRenderer) {
786
+ this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
787
+ const s = document.querySelector("input.ge-table-cell-editor-input");
788
+ s && s.focus();
789
+ } else
790
+ this.resetEditorRenderer();
791
+ }
792
+ repaint() {
793
+ this.adjustAfterScrolling();
794
+ }
795
+ adjustAfterScrolling() {
796
+ var e;
797
+ for (const t of this.removables)
798
+ t.remove();
799
+ this.hideHoverRow(), this.hideHoverColumn(), this.scrollTop = this.scrollViewport.scrollTop, this.scrollLeft = this.scrollViewport.scrollLeft, this.debounce(this.checkForScrollPosSaving.bind(this)), this.scrollFactorY = this.scrollTop / (this.scrollViewport.scrollHeight - this.scrollViewport.clientHeight), this.scrollFactorX = this.scrollLeft / (this.scrollViewport.scrollWidth - this.scrollViewport.clientWidth), isNaN(this.scrollFactorY) && (this.scrollFactorY = 0), isNaN(this.scrollFactorX) && (this.scrollFactorX = 0), this.adjustBody(), this.adjustArea("footer"), this.adjustArea("header"), this.tableOptions.tableTopBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
800
+ new $(0, this.hostElement.clientWidth, 1, 0),
801
+ this.hostElement,
802
+ "ge-table-border"
803
+ )), this.tableOptions.tableBottomBorderVisible && this.removables.push(this.dom.addHorizontalBorder(
804
+ new $(0, this.hostElement.clientWidth, 1, this.hostElement.clientHeight - 1),
805
+ this.hostElement,
806
+ "ge-table-border"
807
+ )), this.tableModel.getFixedLeftColumnCount() > 0 && this.removables.push(this.dom.addVerticalBorder(
808
+ new $(this.areaBodyWest.child.clientWidth, 1, this.hostElement.clientHeight, 0),
809
+ this.hostElement,
810
+ "ge-table-body-west-vertical-border"
811
+ )), ((e = this.tableModel.getAreaModel("header")) == null ? void 0 : e.getRowCount()) > 0 && this.removables.push(this.dom.addHorizontalBorder(
812
+ new $(0, this.hostElement.clientWidth, 1, this.areaHeaderCenter.child.clientHeight),
813
+ this.hostElement,
814
+ "ge-table-body-west-vertical-border"
815
+ ));
816
+ }
817
+ checkForScrollPosSaving() {
818
+ var e, t;
819
+ this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
820
+ }
821
+ updateCells(e) {
822
+ e.forEach(
823
+ (t) => this.tableModel.getAreaModel(t.area).setValue(t.rowIndex, t.columnIndex, t.value)
824
+ ), this.repaint();
825
+ }
826
+ getAreaAndSideIdentByAttr(e) {
827
+ if (e) {
828
+ const t = this.getStringByAttr(e, "data-area"), o = this.getStringByAttr(e, "data-side");
829
+ if (o && t)
830
+ return [t, o];
831
+ }
832
+ return [void 0, void 0];
833
+ }
834
+ getArea(e, t) {
835
+ if (e === "header") {
836
+ if (t === "west")
837
+ return this.areaHeaderWest;
838
+ if (t === "center")
839
+ return this.areaHeaderCenter;
840
+ if (t === "east")
841
+ return this.areaHeaderEast;
842
+ } else if (e === "body") {
843
+ if (t === "west")
844
+ return this.areaBodyWest;
845
+ if (t === "center")
846
+ return this.areaBodyCenter;
847
+ if (t === "east")
848
+ return this.areaBodyEast;
849
+ } else if (e === "footer") {
850
+ if (t === "west")
851
+ return this.areaFooterWest;
852
+ if (t === "center")
853
+ return this.areaFooterCenter;
854
+ if (t === "east")
855
+ return this.areaFooterEast;
856
+ }
857
+ throw Error(`Wrong area identifier: row:${e}, col:${t}`);
858
+ }
859
+ adjustBody() {
860
+ const e = this.areaBodyCenterGeo.height - this.tableModel.getContentHeightInPixel(), t = this.scrollFactorY * e;
861
+ this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
862
+ }
863
+ getNumberByAttr(e, t) {
864
+ var o;
865
+ if (e) {
866
+ const i = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
867
+ if (i)
868
+ return Number(i);
869
+ }
870
+ return -1;
871
+ }
872
+ getStringByAttr(e, t) {
873
+ var o;
874
+ if (e) {
875
+ const i = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
876
+ if (i)
877
+ return i;
878
+ }
879
+ return "";
880
+ }
881
+ adjustArea(e, t = 0) {
882
+ var u;
883
+ const o = this.getArea(e, "west"), i = this.getArea(e, "center"), s = this.getArea(e, "east"), r = i.child.clientHeight;
884
+ o.child.innerText = "", i.child.innerText = "", s.child.innerText = "";
885
+ const l = 0, n = this.areaBodyCenterGeo.width, d = this.tableModel.getPadding(), a = this.tableModel.getAreaModel(e), c = a.getRowCount();
886
+ for (; this.cleanupFunctions[e].length; ) {
887
+ const p = this.cleanupFunctions[e].shift();
888
+ p && p();
889
+ }
890
+ let g = t;
891
+ const m = this.tableModel.getColumnCount(), b = this.tableModel.getFixedRightColumnCount(), w = this.tableModel.getFixedLeftColumnCount();
892
+ for (let p = 0; p < c; p++) {
893
+ const C = g, v = p === c - 1, R = this.tableModel.getRowHeight(e, p);
894
+ if (C + R > 0) {
895
+ this.firstVisibleRowIndex = p;
896
+ let y = { left: l, width: n, height: R, top: C, index: p }, S = this.dom.addRowDiv(i, y, p, e, "center");
897
+ const T = w;
898
+ if (this.adjustColumnsToRowParent({
899
+ areaIdent: e,
900
+ sideIdent: "center",
901
+ areaModel: a,
902
+ geo: y,
903
+ parent: S,
904
+ rowIndex: p,
905
+ columnIndexStart: T,
906
+ columnIndexEnd: m - b - 1,
907
+ verticalFixed: !1,
908
+ lastRowOfModel: v
909
+ }), d.left > 0 && (y = { left: l, width: this.areaBodyWestGeo.width, height: R, top: C, index: p }, S = this.dom.addRowDiv(o, y, p, e, "west"), this.adjustColumnsToRowParent({
910
+ areaIdent: e,
911
+ sideIdent: "west",
912
+ areaModel: a,
913
+ geo: y,
914
+ parent: S,
915
+ rowIndex: p,
916
+ columnIndexStart: 0,
917
+ columnIndexEnd: T - 1,
918
+ verticalFixed: !0,
919
+ lastRowOfModel: v
920
+ })), d.right > 0 && (y = { left: l, width: this.areaBodyEastGeo.width, height: R, top: C, index: p }, S = this.dom.addRowDiv(s, y, p, e, "east"), this.adjustColumnsToRowParent({
921
+ areaIdent: e,
922
+ sideIdent: "east",
923
+ areaModel: a,
924
+ geo: y,
925
+ parent: S,
926
+ rowIndex: p,
927
+ columnIndexStart: m - b,
928
+ columnIndexEnd: m - 1,
929
+ verticalFixed: !0,
930
+ lastRowOfModel: v
931
+ })), e === "header" && this.tree && p === c - 1) {
932
+ const A = this.dom.applyStyle(
933
+ this.dom.setAttribute(
934
+ this.dom.addDiv(S, new $(16, 20, 20, 8)),
935
+ "data-ge-action",
936
+ "toggleExpandCollapseAll"
937
+ ),
938
+ { cursor: "pointer" }
939
+ ), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
940
+ if (M) {
941
+ const V = this.dom.domService.createText(M.content);
942
+ this.dom.domService.appendChild(A, V), M.style && this.dom.applyStyleString(A, M.style);
943
+ }
944
+ }
945
+ }
946
+ if (g = g + R, g > r)
947
+ break;
948
+ }
949
+ if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
950
+ const p = ((u = this.colAndRowspanModels[e]) == null ? void 0 : u.getRanges()) ?? [];
951
+ if (p.length)
952
+ for (const C of p) {
953
+ let v = 0, R = i.child, y = "center";
954
+ if (C.c1 < w)
955
+ R = o.child, y = "west";
956
+ else if (b > 0 && C.c1 >= m - b)
957
+ R = s.child, y = "east";
958
+ else {
959
+ const S = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
960
+ v = this.scrollFactorX * S - this.areaBodyWestGeo.width, y = "center";
961
+ }
962
+ this.drawBigCell(C, v, t, a, R, y);
963
+ }
964
+ }
965
+ }
966
+ /**
967
+ * Draws big cells (rowspan and or colspan) in body/center
968
+ * @param range CellRange
969
+ * @param xStart X position in pixel for top left corner
970
+ * @param yStart Y position in pixel for top left corner
971
+ * @param areaModel AreaModelIf
972
+ * @param parentDiv Parent div as HTMLDivElement
973
+ * @param sideIdent SideIdent (west,center,east)
974
+ * @protected
975
+ */
976
+ drawBigCell(e, t, o, i, s, r) {
977
+ const l = o + this.getRowHeights(0, e.r1 - 1, i).reduce((u, p) => u + p, 0), n = this.tableModel.getColumnCount(), d = this.tableModel.getFixedRightColumnCount();
978
+ let a = 0;
979
+ d > 0 && e.c1 >= n - d && (a = n - d);
980
+ const c = t + this.getColumnWidths(a, e.c1 - 1).reduce((u, p) => u + p, 0), g = this.getRowHeights(e.r1, e.r2, i).reduce((u, p) => u + p, 0), m = this.getColumnWidths(e.c1, e.c2).reduce((u, p) => u + p, 0);
981
+ let b = !1;
982
+ const w = this.getSelectionModel ? this.getSelectionModel() : void 0;
983
+ w && (b = w.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
984
+ areaModel: i,
985
+ areaIdent: i.areaIdent,
986
+ sideIdent: r,
987
+ rowIndex: e.r1,
988
+ columnIndex: e.c1,
989
+ left: c,
990
+ top: l,
991
+ width: m,
992
+ height: g,
993
+ parent: s,
994
+ cellSelected: b,
995
+ lastRowOfModel: !0,
996
+ gammaRange: e.gammaRange
997
+ })) : this.renderCell({
998
+ areaModel: i,
999
+ areaIdent: i.areaIdent,
1000
+ sideIdent: r,
1001
+ rowIndex: e.r1,
1002
+ columnIndex: e.c1,
1003
+ left: c,
1004
+ top: l,
1005
+ width: m,
1006
+ height: g,
1007
+ parent: s,
1008
+ cellSelected: b,
1009
+ lastRowOfModel: !0,
1010
+ gammaRange: e.gammaRange
1011
+ }), i.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1012
+ rowIndex: e.r1,
1013
+ columnIndex: e.c1,
1014
+ cellLeft: c,
1015
+ cellTop: l,
1016
+ cellWidth: m,
1017
+ cellHeight: g,
1018
+ parent: s
1019
+ });
1020
+ }
1021
+ findRowOfImportantRowspanCell(e, t, o) {
1022
+ const i = e.getMaxRowspan();
1023
+ for (let s = t - 1; s > -1; s--) {
1024
+ const r = e.getRowspanAt(s, o);
1025
+ if (r > 1 && s + r + 1 >= t)
1026
+ return s;
1027
+ if (t - s > i)
1028
+ return -1;
1029
+ }
1030
+ return -1;
1031
+ }
1032
+ adjustColumnsToRowParent({
1033
+ areaIdent: e,
1034
+ sideIdent: t,
1035
+ areaModel: o,
1036
+ geo: i,
1037
+ parent: s,
1038
+ rowIndex: r,
1039
+ columnIndexStart: l,
1040
+ columnIndexEnd: n,
1041
+ verticalFixed: d = !1,
1042
+ lastRowOfModel: a = !1
1043
+ }) {
1044
+ var w;
1045
+ this.scrollViewportLeft = this.scrollViewport.scrollLeft;
1046
+ let c = 0;
1047
+ if (!d) {
1048
+ const u = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
1049
+ c = this.scrollFactorX * u;
1050
+ }
1051
+ const g = 0, m = !!(e === "body" && t);
1052
+ let b = c;
1053
+ for (let u = l; u <= n; u++) {
1054
+ const p = b, C = this.tableModel.getColumnWidth(u);
1055
+ if (C > 0 && p + C > 0) {
1056
+ let v = i.height;
1057
+ const R = o.getRowspanAt(r, u), y = o.getColspanAt(r, u);
1058
+ R > 1 && (v = this.getRowHeights(r, r + R - 1, o).reduce((A, M) => A + M, 0));
1059
+ let S = C;
1060
+ y > 1 && (S = this.getColumnWidths(u, u + y - 1).reduce((A, M) => A + M, 0));
1061
+ let T = !1;
1062
+ if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (w = this.colAndRowspanModels[e]) != null && w.isInRange(r, u) && (T = !0), this.draggingTargetColumnIndex === u && e !== "header") {
1063
+ this.renderDragTargetDiv(s, p, g, S, v);
1064
+ const A = { left: p, top: g, width: S, height: v };
1065
+ this.dom.addColumnBorderDivs(this.tableOptions, s, A, e, t);
1066
+ } else {
1067
+ const A = this.renderSelectedBackgroundDiv(T, m, t, o, r, u, s, p, g, S, v);
1068
+ T || this.renderCell({
1069
+ areaModel: o,
1070
+ areaIdent: e,
1071
+ sideIdent: t,
1072
+ rowIndex: r,
1073
+ columnIndex: u,
1074
+ left: p,
1075
+ top: g,
1076
+ width: S,
1077
+ height: v,
1078
+ parent: s,
1079
+ cellSelected: A,
1080
+ lastRowOfModel: a,
1081
+ gammaRange: !0
1082
+ }), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
1083
+ rowIndex: r,
1084
+ columnIndex: u,
1085
+ cellLeft: p,
1086
+ cellTop: g,
1087
+ cellWidth: S,
1088
+ cellHeight: v,
1089
+ parent: s
1090
+ });
1091
+ }
1092
+ }
1093
+ if (b = b + C, b > this.areaBodyCenterGeo.width)
1094
+ break;
1095
+ }
1096
+ this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new $(b - 1, 1, i.height, 0), s);
1097
+ }
1098
+ getTreeArrowColumnIndex() {
1099
+ return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
1100
+ }
1101
+ addAndRenderCellDiv({
1102
+ areaModel: e,
1103
+ areaIdent: t,
1104
+ sideIdent: o,
1105
+ rowIndex: i,
1106
+ index: s,
1107
+ left: r,
1108
+ width: l,
1109
+ height: n,
1110
+ top: d,
1111
+ parent: a,
1112
+ lastRowOfModel: c
1113
+ }) {
1114
+ var J;
1115
+ const m = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === s ? this.editorRenderer : e.getCellRenderer(i, s), b = { left: r, width: l, height: n, top: d, index: s }, w = e.getRowByIndex(i);
1116
+ let u = "none";
1117
+ if (s === this.getTreeArrowColumnIndex() && O(w)) {
1118
+ const x = w;
1119
+ (J = x.children) != null && J.length ? x.expanded ? u = "expanded" : u = "collapsed" : u = "hidden";
1120
+ }
1121
+ let C;
1122
+ if (t === "header") {
1123
+ const x = this.tableModel.getColumnDef(s);
1124
+ (!(x != null && x.sortIconVisible) || x != null && x.sortIconVisible()) && (C = x == null ? void 0 : x.sortState);
1125
+ }
1126
+ const v = e.getValueAt(i, s), R = m ? "" : `${v}`, y = e.isRowChecked(i), S = this.dom.addColumnDiv(
1127
+ a,
1128
+ b,
1129
+ i,
1130
+ s,
1131
+ t,
1132
+ o,
1133
+ R,
1134
+ u,
1135
+ this.tableOptions,
1136
+ y,
1137
+ C
1138
+ ), T = e.getTooltipAt(i, s);
1139
+ T && this.dom.setAttribute(S, "title", T);
1140
+ const A = this.tableModel.getColumnDef(s);
1141
+ A && A.classes[t] && this.dom.addClasses(A.classes[t], S);
1142
+ let M;
1143
+ m && (M = m.render(S, i, s, t, e, v, this.dom.domService));
1144
+ const V = e.getCustomClassesAt(i, s);
1145
+ if (V.length && this.dom.addClasses(V, S), this.dom.addColumnBorderDivs(this.tableOptions, a, b, t, o), c && this.dom.addHorizontalBorder({ left: r, width: l, height: n, top: d + n }, a), this.getFocusModel && t === "body") {
1146
+ const x = this.getFocusModel();
1147
+ x != null && x.hasFocus(i, s) && this.dom.addFocusBorderDivs(a, b, {});
1148
+ }
1149
+ t === "header" && this.dom.setAttribute(S, "data-ge-action", "drag-column");
1150
+ const W = e.getCustomStyleAt(i, s);
1151
+ if (W)
1152
+ for (const x in W)
1153
+ this.dom.setStyle(S, x, W[x]);
1154
+ return [S, M];
1155
+ }
1156
+ getColumnWidths(e, t) {
1157
+ const o = [];
1158
+ for (let i = e; i <= t; i++)
1159
+ o.push(this.tableModel.getColumnWidth(i));
1160
+ return o;
1161
+ }
1162
+ getRowHeights(e, t, o) {
1163
+ const i = [];
1164
+ for (let s = e; s <= t; s++)
1165
+ i.push(o.getRowHeight(s));
1166
+ return i;
1167
+ }
1168
+ adjustHoverRows(e) {
1169
+ if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
1170
+ const t = this.hostElement.clientWidth, o = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), i = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
1171
+ this.dom.applyStyle(this.hoverRow, {
1172
+ left: "0",
1173
+ top: i + "px",
1174
+ width: t + "px",
1175
+ height: o + "px",
1176
+ display: "block"
1177
+ });
1178
+ } else
1179
+ this.hideHoverRow();
1180
+ }
1181
+ hideHoverRow() {
1182
+ this.dom.applyStyle(this.hoverRow, {
1183
+ display: "none"
1184
+ });
1185
+ }
1186
+ adjustHoverColumns(e) {
1187
+ if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
1188
+ const t = this.hostElement.clientHeight, o = this.tableModel.getColumnWidth(e.columnIndex), i = this.areaBodyWestGeo.width, s = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - i;
1189
+ this.dom.applyStyle(this.hoverColumn, {
1190
+ left: s + "px",
1191
+ top: "0px",
1192
+ width: o + "px",
1193
+ height: t + "px",
1194
+ display: "block"
1195
+ });
1196
+ } else
1197
+ this.hideHoverColumn();
1198
+ }
1199
+ hideHoverColumn() {
1200
+ this.dom.applyStyle(this.hoverColumn, {
1201
+ display: "none"
1202
+ });
1203
+ }
1204
+ debounce(e, t = 1e3) {
1205
+ this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
1206
+ }
1207
+ renderDragTargetDiv(e, t, o, i, s) {
1208
+ const r = this.dom.applyStylePosistionAbsolute(
1209
+ this.dom.createDivWithClass("ge-table-drop-zone", e)
1210
+ );
1211
+ return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${o}px`), this.dom.setStyle(r, "width", `${i}px`), this.dom.setStyle(r, "height", `${s}px`), r;
1212
+ }
1213
+ renderSelectedBackgroundDiv(e, t, o, i, s, r, l, n, d, a, c) {
1214
+ let g = !1;
1215
+ if (!e && t && i.isSelectable(s, r) && this.getSelectionModel) {
1216
+ const m = this.getSelectionModel();
1217
+ if (m) {
1218
+ const b = m.getSelectionCount(s, r);
1219
+ g = b > 0;
1220
+ for (let w = 0; w < b; w++) {
1221
+ const u = this.dom.applyStylePosistionAbsolute(
1222
+ // ge-table-body-west-selected-range
1223
+ this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${o}-selected-range`, l)
1224
+ );
1225
+ this.dom.setStyle(u, "left", `${n}px`), this.dom.setStyle(u, "top", `${d}px`), this.dom.setStyle(u, "width", `${a}px`), this.dom.setStyle(u, "height", `${c}px`);
1226
+ }
1227
+ }
1228
+ }
1229
+ return g;
1230
+ }
1231
+ renderCell({
1232
+ areaModel: e,
1233
+ areaIdent: t,
1234
+ sideIdent: o,
1235
+ rowIndex: i,
1236
+ columnIndex: s,
1237
+ left: r,
1238
+ top: l,
1239
+ width: n,
1240
+ height: d,
1241
+ parent: a,
1242
+ cellSelected: c,
1243
+ lastRowOfModel: g,
1244
+ gammaRange: m
1245
+ }) {
1246
+ const [b, w] = this.addAndRenderCellDiv({
1247
+ areaModel: e,
1248
+ areaIdent: t,
1249
+ sideIdent: o,
1250
+ rowIndex: i,
1251
+ index: s,
1252
+ left: r,
1253
+ width: n,
1254
+ height: d,
1255
+ top: l,
1256
+ parent: a,
1257
+ lastRowOfModel: g,
1258
+ gammaRange: m
1259
+ });
1260
+ c && this.dom.addClass(`ge-table-${t}-${o}-selected-range`, b), w && this.cleanupFunctions[t].push(w);
1261
+ }
1262
+ renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: o, cellTop: i, cellWidth: s, cellHeight: r, parent: l }) {
1263
+ const n = this.dom.domService, d = this.tableOptions.columnResizeHandleWidthInPx ?? 2, a = n.createElement("div");
1264
+ n.setAttribute(a, "data-col-index", `${t}`), n.setAttribute(a, "data-row-index", `${e}`), n.setAttribute(a, "data-area", "header"), n.setAttribute(a, "data-ge-action", "resize-column"), n.addClass(a, "ge-table-column-resize-handle"), n.setStyle(a, "display", "clip"), n.setStyle(a, "position", "absolute"), n.setStyle(a, "cursor", "col-resize"), n.setStyle(a, "left", `${o + s - d}px`), n.setStyle(a, "top", `${i}px`), n.setStyle(a, "width", `${d}px`), n.setStyle(a, "height", `${r}px`), n.appendChild(l, a);
1265
+ }
1266
+ }
1267
+ class Ee {
1268
+ constructor(e, t) {
1269
+ this.columnIndex = e, this.sortState = t;
1270
+ }
1271
+ }
1272
+ class Me {
1273
+ constructor(e) {
1274
+ this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
1275
+ }
1276
+ onHostElementChanged(e) {
1277
+ if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
1278
+ const t = e.target, o = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), s = t.getAttribute("data-col-index");
1279
+ if (o && i && s) {
1280
+ const r = Y(o), l = Number(i), n = Number(s);
1281
+ this.tableScope.updateModelValueAfterEdit(r, l, n, t.value);
1282
+ }
1283
+ }
1284
+ }
1285
+ }
1286
+ class Ie {
1287
+ constructor(e = -1, t = -1) {
1288
+ this.rowIndex = e, this.columnIndex = t;
1289
+ }
1290
+ }
1291
+ class U {
1292
+ constructor(e) {
1293
+ this.cells = e;
1294
+ }
1295
+ static createSingle(e, t) {
1296
+ return new U([new Ie(e, t)]);
1297
+ }
1298
+ }
1299
+ class ke {
1300
+ constructor(e) {
1301
+ var t, o;
1302
+ this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (o = this.tableScope.tableOptions) != null && o.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
1303
+ }
1304
+ onMouseClicked(e, t) {
1305
+ var s, r, l, n, d, a, c;
1306
+ let o = !1, i = !1;
1307
+ if (this.getSelectionModel && this.getFocusModel) {
1308
+ const g = this.getSelectionModel(), m = this.getFocusModel();
1309
+ g && m && (m.hasFocus(e.rowIndex, e.columnIndex) || (m.setFocus(e.rowIndex, e.columnIndex), o = !0), (s = e.originalEvent) != null && s.shiftKey || g.hasSelection() && (g.clear(), o = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (g.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, o = !0) : (l = e.originalEvent) != null && l.ctrlKey || (n = e.originalEvent) != null && n.metaKey ? (g.addSelection(E.singleCell(e.rowIndex, e.columnIndex)), i = !0, o = !0) : (d = e.originalEvent) != null && d.altKey && ((a = e.originalEvent) != null && a.ctrlKey || (c = e.originalEvent) != null && c.metaKey) && (g.removeSelection(E.singleCell(e.rowIndex, e.columnIndex)), i = !0, o = !0));
1310
+ }
1311
+ return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), o;
1312
+ }
1313
+ onActionTriggered(e) {
1314
+ if (this.getSelectionModel && this.getFocusModel) {
1315
+ const t = this.getSelectionModel(), o = this.getFocusModel();
1316
+ if (t && o) {
1317
+ if (e === "SELECT_ALL")
1318
+ return t.selectAll(), this.tableScope.repaint(), !0;
1319
+ if (e === "DESELECT_ALL")
1320
+ return t.clear(), this.tableScope.repaint(), !0;
1321
+ if (e === "TOGGLE_SELECTION") {
1322
+ const [i, s] = o.getFocus();
1323
+ return t.togglePoint(i, s), this.tableScope.repaint(), !0;
1324
+ }
1325
+ }
1326
+ }
1327
+ return !1;
1328
+ }
1329
+ createRangeByEvents(e, t) {
1330
+ t || (t = e);
1331
+ const o = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), s = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), r = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
1332
+ return E.create({
1333
+ rowIndex1: o,
1334
+ columnIndex1: s,
1335
+ rowIndex2: i,
1336
+ columnIndex2: r
1337
+ });
1338
+ }
1339
+ }
1340
+ class Te {
1341
+ get() {
1342
+ return {
1343
+ f2: "START_EDITING",
1344
+ space: "TOGGLE_SELECTION",
1345
+ "ctrl+num_add": "SELECT_ALL",
1346
+ "ctrl+a": "SELECT_ALL",
1347
+ "ctrl+shift+a": "DESELECT_ALL",
1348
+ "ctrl+x": "DESELECT_ALL",
1349
+ "ctrl+num_subtract": "DESELECT_ALL",
1350
+ "cmd -": "DESELECT_ALL",
1351
+ arrowup: "NAVIGATE_UP",
1352
+ arrowdown: "NAVIGATE_DOWN",
1353
+ arrowleft: "NAVIGATE_LEFT",
1354
+ arrowright: "NAVIGATE_RIGHT"
1355
+ };
1356
+ }
1357
+ }
1358
+ class _e {
1359
+ get() {
1360
+ return {
1361
+ f2: "START_EDITING",
1362
+ space: "TOGGLE_SELECTION",
1363
+ "ctrl+num_add": "SELECT_ALL",
1364
+ "cmd+a": "SELECT_ALL",
1365
+ "ctrl+a": "SELECT_ALL",
1366
+ "cmd+x": "DESELECT_ALL",
1367
+ "cmd+shift+a": "DESELECT_ALL",
1368
+ "ctrl+shift+a": "DESELECT_ALL",
1369
+ "ctrl+num_subtract": "DESELECT_ALL",
1370
+ "ctrl -": "DESELECT_ALL",
1371
+ arrowup: "NAVIGATE_UP",
1372
+ arrowdown: "NAVIGATE_DOWN",
1373
+ arrowleft: "NAVIGATE_LEFT",
1374
+ arrowright: "NAVIGATE_RIGHT"
1375
+ };
1376
+ }
1377
+ }
1378
+ class De {
1379
+ constructor(e) {
1380
+ this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
1381
+ }
1382
+ addListener(e) {
1383
+ this.listener.includes(e) || this.listener.push(e);
1384
+ }
1385
+ init() {
1386
+ this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new _e().get()) : Object.assign(this.shortcutActionIdMapping, new Te().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
1387
+ }
1388
+ isMacintosh() {
1389
+ return navigator.platform.indexOf("Mac") > -1;
1390
+ }
1391
+ isDebug() {
1392
+ return this.isLocalhost();
1393
+ }
1394
+ isLocalhost() {
1395
+ return location.hostname === "localhost" || location.hostname === "127.0.0.1";
1396
+ }
1397
+ onKeyDown(e) {
1398
+ const t = this.findEnty(e);
1399
+ t && this.emit(t) && (e.preventDefault(), e.stopPropagation());
1400
+ }
1401
+ emit(e) {
1402
+ this.isDebug() && console.debug("ShortcutService emit:", e);
1403
+ let t = !1;
1404
+ for (const o of this.listener)
1405
+ o.onActionTriggered(e) && (t = !0);
1406
+ return t;
1407
+ }
1408
+ findEnty(e) {
1409
+ const t = this.getTokenByEvent(e);
1410
+ this.isDebug() && console.debug("ShortcutService tokens:", t);
1411
+ for (const o in this.shortcutActionIdMapping) {
1412
+ const i = o.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[\+ ]/g).sort();
1413
+ if (this.areTokensEquals(t, i))
1414
+ return this.shortcutActionIdMapping[o];
1415
+ }
1416
+ }
1417
+ areTokensEquals(e, t) {
1418
+ if (e.length !== t.length || e.length === 0)
1419
+ return !1;
1420
+ for (let o = 0; o < e.length; o++)
1421
+ if (e[o] !== t[o])
1422
+ return !1;
1423
+ return !0;
1424
+ }
1425
+ getTokenByEvent(e) {
1426
+ const t = [];
1427
+ return e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.code && t.push(e.code.toLowerCase().replace(/key/g, "")), t.sort();
1428
+ }
1429
+ }
1430
+ class Q {
1431
+ onCheckboxChanged(e) {
1432
+ }
1433
+ onContextmenu(e) {
1434
+ }
1435
+ onModelChanged(e) {
1436
+ }
1437
+ onMouseClicked(e) {
1438
+ }
1439
+ onMouseDragging(e) {
1440
+ }
1441
+ onMouseDraggingEnd(e) {
1442
+ }
1443
+ onMouseMoved(e) {
1444
+ }
1445
+ }
1446
+ class $e {
1447
+ setStyle(e, t, o) {
1448
+ return e.style[t] = o, e;
1449
+ }
1450
+ appendText(e, t) {
1451
+ const o = this.createText(t);
1452
+ return this.appendChild(e, o), o;
1453
+ }
1454
+ addClass(e, t) {
1455
+ return t.includes(" ") ? t.split(" ").forEach((o) => e.classList.add(o)) : e.classList.add(t), e;
1456
+ }
1457
+ appendChild(e, t) {
1458
+ e.appendChild(t);
1459
+ }
1460
+ createElement(e) {
1461
+ return document.createElement(e);
1462
+ }
1463
+ createText(e) {
1464
+ return document.createTextNode(e);
1465
+ }
1466
+ setAttribute(e, t, o) {
1467
+ e.setAttribute(t, o);
1468
+ }
1469
+ }
1470
+ class Fe {
1471
+ render(e, t, o, i, s, r, l) {
1472
+ if (s.isEditable(t, o)) {
1473
+ l.addClass(e, "ge-table-row-input-div");
1474
+ const n = s.getValueAt(t, o);
1475
+ e.innerHTML = `
1476
+ <input
1477
+ type="text"
1478
+ value="${n}"
1479
+ autofocus
1480
+ onfocus="this.setSelectionRange(0, this.value.length)"
1481
+ data-listen="change"
1482
+ data-area="${i}"
1483
+ data-row-index="${t}"
1484
+ data-col-index="${o}"
1485
+ data-input-type="text"
1486
+ style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
1487
+ class="ge-table-cell-editor-input">`;
1488
+ }
1489
+ }
1490
+ }
1491
+ class Le {
1492
+ constructor(e = "none", t = "single") {
1493
+ this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
1494
+ }
1495
+ getSelectionCount(e, t) {
1496
+ let o = 0;
1497
+ for (const i of this.ranges)
1498
+ i.isInRange(e, t) && o++;
1499
+ return this.allSelected && o++, this.isInNegativeRange(e, t) && (o = 0), o;
1500
+ }
1501
+ isInNegativeRange(e, t) {
1502
+ for (const o of this.negativeRanges)
1503
+ if (o.isInRange(e, t))
1504
+ return !0;
1505
+ return !1;
1506
+ }
1507
+ getRanges() {
1508
+ return this.ranges;
1509
+ }
1510
+ clear() {
1511
+ this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
1512
+ }
1513
+ hasSelection() {
1514
+ return !!this.ranges.length;
1515
+ }
1516
+ selectAll() {
1517
+ this.allSelected = !0;
1518
+ }
1519
+ addSelection(e) {
1520
+ this.addRange(e);
1521
+ }
1522
+ removeSelection(e) {
1523
+ if (this.selectionType === "none")
1524
+ return;
1525
+ let t = e;
1526
+ this.selectionType === "row" ? t = E.singleRow(e.r1) : this.selectionType === "column" && (t = E.singleColumn(e.c1)), this.negativeRanges.push(t);
1527
+ }
1528
+ togglePoint(e, t) {
1529
+ this.getSelectionCount(e, t) > 0 ? this.removeSelection(E.singleCell(e, t)) : this.addSelection(E.singleCell(e, t));
1530
+ }
1531
+ addRange(e) {
1532
+ this.selectionType !== "none" && (this.allSelected = !1, this.selectionMode === "single" && (this.ranges = []), this.selectionType === "row" ? (e.c1 = 0, e.c2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "column" ? (e.r1 = 0, e.r2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "cell" ? (e.r2 = e.r1, e.c2 = e.c1) : this.selectionType, this.ranges.push(e));
1533
+ }
1534
+ }
1535
+ class Oe {
1536
+ constructor(e = "none") {
1537
+ this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
1538
+ }
1539
+ clearChanged() {
1540
+ this.changed = !1;
1541
+ }
1542
+ hasChanged() {
1543
+ return this.changed;
1544
+ }
1545
+ clear() {
1546
+ this.rowIndex = -1, this.columnIndex = -1;
1547
+ }
1548
+ setFocus(e, t) {
1549
+ (this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
1550
+ }
1551
+ hasFocus(e, t) {
1552
+ return this.rowIndex === e && this.columnIndex === t;
1553
+ }
1554
+ getFocus() {
1555
+ return [this.rowIndex, this.columnIndex];
1556
+ }
1557
+ }
1558
+ const Pe = new Le(), He = new Oe("cell");
1559
+ class N {
1560
+ constructor() {
1561
+ this.overflowX = "auto", this.overflowY = "auto", this.horizontalBorderVisible = !0, this.verticalBorderVisible = !0, this.footerSeparatorBorderVisible = !0, this.headerSeparatorBorderVisible = !0, this.fixedEastSeparatorBorderVisible = !0, this.fixedWestSeparatorBorderVisible = !0, this.tableTopBorderVisible = !0, this.tableBottomBorderVisible = !0, this.hoverRowVisible = !0, this.hoverColumnVisible = !0, this.columnsResizable = !0, this.columnsDraggable = !0, this.columnResizeHandleWidthInPx = 4, this.defaultRowHeights = {
1562
+ header: 34,
1563
+ body: 34,
1564
+ footer: 34
1565
+ }, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new ae(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new de(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new Fe(), this.getSelectionModel = () => Pe, this.getFocusModel = () => He;
1566
+ }
1567
+ }
1568
+ class he extends Ae {
1569
+ constructor(e, t, o, i, s) {
1570
+ var r;
1571
+ if (super(
1572
+ e,
1573
+ t,
1574
+ new pe(o),
1575
+ i
1576
+ ), this.eventListener = s, this.selectionService = new ke(this), this.api = new we(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, s || (this.eventListener = new Q()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
1577
+ const l = this.tableOptions.autoRestoreOptions, n = l.getStorageKeyFn;
1578
+ n && (l.autoRestoreScrollPosition && (this.storeScrollPosStateService = new Se(n)), l.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new ye(n)), l.autoRestoreSortingState && (this.storeSortingService = new Ce(n)));
1579
+ }
1580
+ this.mouseHandler = new me(this), this.inputHandler = new Me(this), this.shortcutService = new De(this), this.shortcutService.addListener(this.selectionService);
1581
+ }
1582
+ static create(e, t, o = new N(), i = new Q(), s = new $e()) {
1583
+ return new he(
1584
+ e,
1585
+ t,
1586
+ s,
1587
+ o,
1588
+ i
1589
+ );
1590
+ }
1591
+ onActionTriggered(e) {
1592
+ if (e === "NAVIGATE_DOWN" && this.changeFocusCell(0, 1) || e === "NAVIGATE_UP" && this.changeFocusCell(0, -1) || e === "NAVIGATE_LEFT" && this.changeFocusCell(-1, 0) || e === "NAVIGATE_RIGHT" && this.changeFocusCell(1, 0))
1593
+ return !0;
1594
+ if (e === "START_EDITING" && this.getFocusModel) {
1595
+ const t = this.getFocusModel();
1596
+ if (t) {
1597
+ const [o, i] = t.getFocus();
1598
+ this.tableModel.getBodyModel().isEditable(o, i) && (this.clearSelection(), this.initRenderEditor(o, i));
1599
+ }
1600
+ return !0;
1601
+ }
1602
+ return !1;
1603
+ }
1604
+ updateModelValueAfterEdit(e, t, o, i) {
1605
+ e === "body" && this.tableModel.getAreaModel(e).setValue(t, o, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(U.createSingle(t, o)), this.hostElement.focus());
1606
+ }
1607
+ getApi() {
1608
+ return this.api;
1609
+ }
1610
+ /*
1611
+ * Called by the table component
1612
+ */
1613
+ firstInit() {
1614
+ var e;
1615
+ return this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition(), this;
1616
+ }
1617
+ createGeMouseEvent(e) {
1618
+ const t = new X();
1619
+ if (t.originalEvent = e, e) {
1620
+ const o = e.target;
1621
+ if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(o), t.rowIndex = this.getNumberByAttr(o, "data-row-index"), t.columnIndex = this.getNumberByAttr(o, "data-col-index"), t.action = this.getStringByAttr(o, "data-ge-action"), t.areaIdent) {
1622
+ const i = this.tableModel.getAreaModel(t.areaIdent);
1623
+ t.rowTop = i.getYPosByRowIndex(t.rowIndex);
1624
+ }
1625
+ if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
1626
+ const i = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, s = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
1627
+ this.debugOnce(s, i);
1628
+ }
1629
+ }
1630
+ return t;
1631
+ }
1632
+ onMouseDown(e) {
1633
+ e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.dragFrom = this.mouseStartColumnIndex));
1634
+ }
1635
+ mouseDraggingOnFrame(e) {
1636
+ this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows()), this.repaint());
1637
+ }
1638
+ mouseDraggingEndOnFrame(e) {
1639
+ this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && this.repaint(), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.mouseStartAction = "";
1640
+ }
1641
+ mouseMove(e) {
1642
+ this.eventListener.onMouseMoved(e), this.adjustHoverRows(e), this.adjustHoverColumns(e);
1643
+ }
1644
+ contextmenu(e) {
1645
+ this.eventListener.onContextmenu(e);
1646
+ }
1647
+ toggleExpandCollapseAll(e = !0) {
1648
+ var o;
1649
+ const t = this.tableModel.getBodyModel();
1650
+ z(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (o = this.storeStateCollapsedExpandService) == null || o.collapsedStateAll(e));
1651
+ }
1652
+ toggleRowCheckbox(e, t, o) {
1653
+ var n;
1654
+ const i = this.tableModel.getAreaModel(o), s = i.isRowChecked(e), r = s === void 0 || s === "semi" || s === "none";
1655
+ i.setRowChecked(e, r), this.repaint();
1656
+ const l = (n = i.rowSelectionModel) == null ? void 0 : n.getCheckedRows();
1657
+ this.eventListener.onCheckboxChanged(l || []);
1658
+ }
1659
+ onMouseClicked(e, t) {
1660
+ let o = this.selectionService.onMouseClicked(e, t);
1661
+ if (!o && this.getFocusModel) {
1662
+ const i = this.getFocusModel();
1663
+ i && (o = i.hasChanged(), i.clearChanged(), o && this.resetEditorRenderer());
1664
+ }
1665
+ this.eventListener.onMouseClicked(e), o && this.debounce(this.repaint.bind(this), 10);
1666
+ }
1667
+ externalFilterChanged(e = !0) {
1668
+ const t = this.tableOptions.externalFilterFunction;
1669
+ t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
1670
+ }
1671
+ onHeaderDblClicked(e, t, o) {
1672
+ var s, r;
1673
+ const i = this.tableModel.getColumnDef(o);
1674
+ if (i != null && i.sortable && i.sortable()) {
1675
+ e.preventDefault(), e.stopPropagation();
1676
+ const l = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, n = i.sortState ?? "", d = l[(l.indexOf(n) + 1) % l.length], a = new Ee(o, d);
1677
+ this.tableModel.doSort([a]) && ((s = this.tableModel.getColumnDefs()) == null || s.forEach((g) => g.sortState = ""), i.sortState = d), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([a]);
1678
+ }
1679
+ }
1680
+ changeFocusCell(e, t) {
1681
+ if (!this.isEditing() && this.getFocusModel) {
1682
+ const o = this.getFocusModel();
1683
+ if (o) {
1684
+ const [i, s] = o.getFocus();
1685
+ return o.setFocus(i + t, s + e), this.repaint(), !0;
1686
+ }
1687
+ }
1688
+ return !1;
1689
+ }
1690
+ resizeColumn(e) {
1691
+ this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
1692
+ }
1693
+ clearSelectionModel() {
1694
+ var e;
1695
+ this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
1696
+ }
1697
+ debugOnce(e, t) {
1698
+ var o;
1699
+ console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (o = this.mouseHandler.mouseEvent) == null ? void 0 : o.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
1700
+ }
1701
+ autoRestoreScrollPosition() {
1702
+ var e;
1703
+ if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
1704
+ const o = this.storeScrollPosStateService.getScrollOffset();
1705
+ o && this.scrollViewport.scrollTo(...o);
1706
+ }
1707
+ }
1708
+ autoRestoreSortingState() {
1709
+ var e, t;
1710
+ if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
1711
+ const o = this.storeSortingService.getSortItems();
1712
+ o != null && o.length && this.tableModel.getBodyModel().doSort(o);
1713
+ }
1714
+ }
1715
+ autoRestoreCollapsedExpandedState() {
1716
+ var e, t;
1717
+ if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
1718
+ const o = this.tableOptions.autoRestoreOptions, i = o.getRowId;
1719
+ if (o.autoRestoreCollapsedExpandedState && i) {
1720
+ const s = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
1721
+ if (z(r)) {
1722
+ const l = r, n = r.getRowCount();
1723
+ for (let d = 0; d < n; d++) {
1724
+ const a = r.getRowByIndex(d);
1725
+ if (a)
1726
+ if (s.allExpanded)
1727
+ a.expanded = !0;
1728
+ else if (s.allCollapsed)
1729
+ a.expanded = !1;
1730
+ else {
1731
+ const c = i(a.data);
1732
+ s.mode === "expanded" ? a.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c) : s.mode === "collapsed" && (a.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c));
1733
+ }
1734
+ }
1735
+ l.recalcVisibleTreeRows();
1736
+ }
1737
+ }
1738
+ }
1739
+ }
1740
+ }
1741
+ class ce {
1742
+ }
1743
+ ce.themes = ["light", "combat", "paper", "blackboard"];
1744
+ ce.vars = {
1745
+ light: `:root [data-theme="light"] {
1746
+ --ge-table-bg: rgba(255,255,255, 0.5);
1747
+ --ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
1748
+ --ge-table-header-center-bg: rgba(233, 233, 233, 0.5);
1749
+ --ge-table-header-east-bg: rgba(233, 233, 233, 0.5);
1750
+ --ge-table-header-west-text: #000;
1751
+ --ge-table-header-center-text: #000;
1752
+ --ge-table-header-east-text: #000;
1753
+ --ge-table-header-west-horizontal-border: #ddd;
1754
+ --ge-table-header-west-vertical-border: #ccc;
1755
+ --ge-table-header-center-horizontal-border: #ddd;
1756
+ --ge-table-header-center-vertical-border: #ccc;
1757
+ --ge-table-header-east-horizontal-border: #ddd;
1758
+ --ge-table-header-east-vertical-border: #ccc;
1759
+ --ge-table-body-west-bg: rgba(233, 233, 233, 0.5);
1760
+ --ge-table-body-center-bg: rgba(255,255,255, 0.5);
1761
+ --ge-table-body-east-bg: rgba(233, 233, 233, 0.5);
1762
+ --ge-table-body-west-text: #000;
1763
+ --ge-table-body-center-text: #000;
1764
+ --ge-table-body-east-text: #000;
1765
+ --ge-table-body-west-horizontal-border: #ddd;
1766
+ --ge-table-body-west-vertical-border: #ccc;
1767
+ --ge-table-body-center-horizontal-border: #bbb;
1768
+ --ge-table-body-center-vertical-border: #ddd;
1769
+ --ge-table-body-east-horizontal-border: #ddd;
1770
+ --ge-table-body-east-vertical-border: #ccc;
1771
+ --ge-table-body-west-selected-range-bg: rgba(0, 152, 219, 0.4);
1772
+ --ge-table-body-center-selected-range-bg: rgba(0, 152, 219, 0.4);
1773
+ --ge-table-body-east-selected-range-bg: rgba(0, 152, 219, 0.4);
1774
+ --ge-table-body-west-selected-range-text: #000;
1775
+ --ge-table-body-center-selected-range-text: #000;
1776
+ --ge-table-body-east-selected-range-text: #000;
1777
+ --ge-table-footer-west-bg: rgba(233, 233, 233, 0.5);
1778
+ --ge-table-footer-center-bg: rgba(233, 233, 233, 0.5);
1779
+ --ge-table-footer-east-bg: rgba(233, 233, 233, 0.5);
1780
+ --ge-table-footer-west-text: #000;
1781
+ --ge-table-footer-center-text: #000;
1782
+ --ge-table-footer-east-text: #000;
1783
+ --ge-table-footer-west-horizontal-border: #ddd;
1784
+ --ge-table-footer-west-vertical-border: #ccc;
1785
+ --ge-table-footer-center-horizontal-border: #ddd;
1786
+ --ge-table-footer-center-vertical-border: #ccc;
1787
+ --ge-table-footer-east-horizontal-border: #ddd;
1788
+ --ge-table-footer-east-vertical-border: #ccc;
1789
+ --ge-table-border: #ccc;
1790
+ --ge-table-row-odd-bg: transparent;
1791
+ --ge-table-row-even-bg: transparent;
1792
+ --ge-table-column-odd-bg: transparent;
1793
+ --ge-table-column-even-bg: transparent;
1794
+ --ge-table-hover-column-bg: rgba(0, 224, 255, 0.27);
1795
+ --ge-table-hover-row-bg: rgba(0, 224, 255, 0.27);
1796
+ --ge-table-focus-border: rgb(0, 255, 255);
1797
+ --ge-table-color-error-text: #e00034;
1798
+ --ge-table-tree-arrow-collapsed-color: #e00034;
1799
+ --ge-table-column-resize-handle-border: rgb(0, 255, 255);
1800
+ --ge-table-dragged-col-div-bg: lightcyan;
1801
+ --ge-table-drop-zone-bg: rgba(244, 255, 242, 0.6);
1802
+ }`,
1803
+ combat: `:root [data-theme="combat"] {
1804
+ --ge-table-bg: #101010;
1805
+ --ge-table-header-west-bg: #101010;
1806
+ --ge-table-header-center-bg: #101010;
1807
+ --ge-table-header-east-bg: #101010;
1808
+ --ge-table-header-west-text: oklch(100% 0 0);
1809
+ --ge-table-header-center-text: oklch(100% 0 0);
1810
+ --ge-table-header-east-text: oklch(100% 0 0);
1811
+ --ge-table-header-west-horizontal-border: oklch(100% 0 0 / 0%);
1812
+ --ge-table-header-west-vertical-border: oklch(100% 0 0 / 0%);
1813
+ --ge-table-header-center-horizontal-border: oklch(100% 0 0 / 0%);
1814
+ --ge-table-header-center-vertical-border: oklch(100% 0 0 / 0%);
1815
+ --ge-table-header-east-horizontal-border: oklch(100% 0 0 / 0%);
1816
+ --ge-table-header-east-vertical-border: oklch(100% 0 0 / 0%);
1817
+ --ge-table-body-west-bg: #101010;
1818
+ --ge-table-body-center-bg: #101010;
1819
+ --ge-table-body-east-bg: #101010;
1820
+ --ge-table-body-west-text: #b6b4b4;
1821
+ --ge-table-body-center-text: #b6b4b4;
1822
+ --ge-table-body-east-text: #b6b4b4;
1823
+ --ge-table-body-west-horizontal-border: oklch(100% 0 0 / 0%);
1824
+ --ge-table-body-west-vertical-border: oklch(100% 0 0 / 0%);
1825
+ --ge-table-body-center-horizontal-border: oklch(100% 0 0 / 0%);
1826
+ --ge-table-body-center-vertical-border: oklch(100% 0 0 / 0%);
1827
+ --ge-table-body-east-horizontal-border: oklch(100% 0 0 / 0%);
1828
+ --ge-table-body-east-vertical-border: oklch(100% 0 0 / 0%);
1829
+ --ge-table-body-west-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
1830
+ --ge-table-body-center-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
1831
+ --ge-table-body-east-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
1832
+ --ge-table-body-west-selected-range-text: #f00032;
1833
+ --ge-table-body-center-selected-range-text: #f00032;
1834
+ --ge-table-body-east-selected-range-text: #f00032;
1835
+ --ge-table-footer-west-bg: #101010;
1836
+ --ge-table-footer-center-bg: #101010;
1837
+ --ge-table-footer-east-bg: #101010;
1838
+ --ge-table-footer-west-text: oklch(100% 0 0);
1839
+ --ge-table-footer-center-text: oklch(100% 0 0);
1840
+ --ge-table-footer-east-text: oklch(100% 0 0);
1841
+ --ge-table-footer-west-horizontal-border: oklch(100% 0 0 / 0%);
1842
+ --ge-table-footer-west-vertical-border: oklch(100% 0 0 / 0%);
1843
+ --ge-table-footer-center-horizontal-border: oklch(100% 0 0 / 0%);
1844
+ --ge-table-footer-center-vertical-border: oklch(100% 0 0 / 0%);
1845
+ --ge-table-footer-east-horizontal-border: oklch(100% 0 0 / 0%);
1846
+ --ge-table-footer-east-vertical-border: oklch(100% 0 0 / 0%);
1847
+ --ge-table-border: oklch(100% 0 0 / 0%);
1848
+ --ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
1849
+ --ge-table-row-even-bg: oklch(100% 0 0 / 0%);
1850
+ --ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
1851
+ --ge-table-column-even-bg: oklch(100% 0 0 / 0%);
1852
+ --ge-table-hover-column-bg: oklch(34% 0.25 3.6 / 27%);
1853
+ --ge-table-hover-row-bg: oklch(34% 0.25 3.6 / 27%);
1854
+ --ge-table-focus-border: oklch(40% 0.25 3.6);
1855
+ --ge-table-color-error-text: oklch(65% 0.31 43.2);
1856
+ --ge-table-tree-arrow-collapsed-color: #e00034;
1857
+ --ge-table-column-resize-handle-border: oklch(63% 0.31 43.2);
1858
+ --ge-table-dragged-col-div-bg: #2c2e33;
1859
+ --ge-table-drop-zone-bg: #101010;
1860
+ }`,
1861
+ paper: `:root [data-theme="paper"] {
1862
+ --ge-table-bg: #e7e5df;
1863
+ --ge-table-header-west-bg: oklch(80% 0.02 99 / 48%);
1864
+ --ge-table-header-center-bg: oklch(80% 0.02 99 / 48%);
1865
+ --ge-table-header-east-bg: oklch(80% 0.02 99 / 48%);
1866
+ --ge-table-header-west-text: #111;
1867
+ --ge-table-header-center-text: #111;
1868
+ --ge-table-header-east-text: #111;
1869
+ --ge-table-header-west-horizontal-border: oklch(100% 0 0 / 0%);
1870
+ --ge-table-header-west-vertical-border: oklch(100% 0 0 / 0%);
1871
+ --ge-table-header-center-horizontal-border: oklch(100% 0 0 / 0%);
1872
+ --ge-table-header-center-vertical-border: oklch(100% 0 0 / 0%);
1873
+ --ge-table-header-east-horizontal-border: oklch(100% 0 0 / 0%);
1874
+ --ge-table-header-east-vertical-border: oklch(100% 0 0 / 0%);
1875
+ --ge-table-body-west-bg: oklch(80% 0.02 99 / 48%);
1876
+ --ge-table-body-center-bg: #e7e5df;
1877
+ --ge-table-body-east-bg: oklch(80% 0.02 99 / 48%);
1878
+ --ge-table-body-west-text: #000;
1879
+ --ge-table-body-center-text: #000;
1880
+ --ge-table-body-east-text: #000;
1881
+ --ge-table-body-west-horizontal-border: oklch(100% 0 0 / 0%);
1882
+ --ge-table-body-west-vertical-border: oklch(100% 0 0 / 0%);
1883
+ --ge-table-body-center-horizontal-border: oklch(100% 0 0 / 0%);
1884
+ --ge-table-body-center-vertical-border: oklch(100% 0 0 / 0%);
1885
+ --ge-table-body-east-horizontal-border: oklch(100% 0 0 / 0%);
1886
+ --ge-table-body-east-vertical-border: oklch(100% 0 0 / 0%);
1887
+ --ge-table-body-west-selected-range-bg: #cfcdc2;
1888
+ --ge-table-body-center-selected-range-bg: #cfcdc2;
1889
+ --ge-table-body-east-selected-range-bg: #cfcdc2;
1890
+ --ge-table-body-west-selected-range-text: #000;
1891
+ --ge-table-body-center-selected-range-text: #000;
1892
+ --ge-table-body-east-selected-range-text: #000;
1893
+ --ge-table-footer-west-bg: oklch(80% 0.02 99 / 48%);
1894
+ --ge-table-footer-center-bg: oklch(80% 0.02 99 / 48%);
1895
+ --ge-table-footer-east-bg: oklch(80% 0.02 99 / 48%);
1896
+ --ge-table-footer-west-text: #111;
1897
+ --ge-table-footer-center-text: #111;
1898
+ --ge-table-footer-east-text: #111;
1899
+ --ge-table-footer-west-horizontal-border: oklch(100% 0 0 / 0%);
1900
+ --ge-table-footer-west-vertical-border: oklch(100% 0 0 / 0%);
1901
+ --ge-table-footer-center-horizontal-border: oklch(100% 0 0 / 0%);
1902
+ --ge-table-footer-center-vertical-border: oklch(100% 0 0 / 0%);
1903
+ --ge-table-footer-east-horizontal-border: oklch(100% 0 0 / 0%);
1904
+ --ge-table-footer-east-vertical-border: oklch(100% 0 0 / 0%);
1905
+ --ge-table-border: oklch(100% 0 0 / 0%);
1906
+ --ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
1907
+ --ge-table-row-even-bg: oklch(100% 0 0 / 0%);
1908
+ --ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
1909
+ --ge-table-column-even-bg: oklch(100% 0 0 / 0%);
1910
+ --ge-table-hover-column-bg: oklch(5% 0.2 266.40000000000003 / 9%);
1911
+ --ge-table-hover-row-bg: oklch(5% 0.2 266.40000000000003 / 9%);
1912
+ --ge-table-focus-border: oklch(100% 0.19 205.20000000000002);
1913
+ --ge-table-color-error-text: oklch(45% 0.25 43.2);
1914
+ --ge-table-tree-arrow-collapsed-color: #e00034;
1915
+ --ge-table-column-resize-handle-border: oklch(100% 0.19 205.20000000000002 / 71%);
1916
+ --ge-table-dragged-col-div-bg: #2c2e33;
1917
+ --ge-table-drop-zone-bg: #e7e5df;
1918
+ }`,
1919
+ blackboard: `:root [data-theme="dark"] {
1920
+ --ge-table-bg: #0c1021;
1921
+ --ge-table-header-west-bg: #0c1021;
1922
+ --ge-table-header-center-bg: #0c1021;
1923
+ --ge-table-header-east-bg: #0c1021;
1924
+ --ge-table-header-west-text: #e0df85;
1925
+ --ge-table-header-center-text: #e0df85;
1926
+ --ge-table-header-east-text: #e0df85;
1927
+ --ge-table-header-west-horizontal-border: transparent;
1928
+ --ge-table-header-west-vertical-border: transparent;
1929
+ --ge-table-header-center-horizontal-border: transparent;
1930
+ --ge-table-header-center-vertical-border: transparent;
1931
+ --ge-table-header-east-horizontal-border: transparent;
1932
+ --ge-table-header-east-vertical-border: transparent;
1933
+ --ge-table-body-west-bg: #0c1021;
1934
+ --ge-table-body-center-bg: #0c1021;
1935
+ --ge-table-body-east-bg: #0c1021;
1936
+ --ge-table-body-west-text: #a7a7a7;
1937
+ --ge-table-body-center-text: #a7a7a7;
1938
+ --ge-table-body-east-text: #a7a7a7;
1939
+ --ge-table-body-west-horizontal-border: transparent;
1940
+ --ge-table-body-west-vertical-border: transparent;
1941
+ --ge-table-body-center-horizontal-border: transparent;
1942
+ --ge-table-body-center-vertical-border: transparent;
1943
+ --ge-table-body-east-horizontal-border: transparent;
1944
+ --ge-table-body-east-vertical-border: transparent;
1945
+ --ge-table-body-west-selected-range-bg: #758129;
1946
+ --ge-table-body-center-selected-range-bg: #758129;
1947
+ --ge-table-body-east-selected-range-bg: #758129;
1948
+ --ge-table-body-west-selected-range-text: oklch(100% 0 0);
1949
+ --ge-table-body-center-selected-range-text: oklch(100% 0 0);
1950
+ --ge-table-body-east-selected-range-text: oklch(100% 0 0);
1951
+ --ge-table-footer-west-bg: #0c1021;
1952
+ --ge-table-footer-center-bg: #0c1021;
1953
+ --ge-table-footer-east-bg: #0c1021;
1954
+ --ge-table-footer-west-text: #e0df85;
1955
+ --ge-table-footer-center-text: #e0df85;
1956
+ --ge-table-footer-east-text: #e0df85;
1957
+ --ge-table-footer-west-horizontal-border: transparent;
1958
+ --ge-table-footer-west-vertical-border: transparent;
1959
+ --ge-table-footer-center-horizontal-border: transparent;
1960
+ --ge-table-footer-center-vertical-border: otransparent;
1961
+ --ge-table-footer-east-horizontal-border: transparent;
1962
+ --ge-table-footer-east-vertical-border: transparent;
1963
+ --ge-table-border: oklch(0% 0 0);
1964
+ --ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
1965
+ --ge-table-row-even-bg: oklch(100% 0 0 / 0%);
1966
+ --ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
1967
+ --ge-table-column-even-bg: oklch(100% 0 0 / 0%);
1968
+ --ge-table-hover-column-bg: #a9a9a9;
1969
+ --ge-table-hover-row-bg: #a9a9a9;
1970
+ --ge-table-focus-border: #e1ff00;
1971
+ --ge-table-color-error-text: #ff0040;
1972
+ --ge-table-tree-arrow-collapsed-color: #e00034;
1973
+ --ge-table-column-resize-handle-border: oklch(0% 0 0);
1974
+ --ge-table-dragged-col-div-bg: #2c2e33;
1975
+ --ge-table-drop-zone-bg: #758129;
1976
+ }`
1977
+ };
1978
+ class Z {
1979
+ constructor(e, t = !0, o, i, s = 0, r = !1, l = !1) {
1980
+ this.data = e, this.expanded = t, this.children = o, this.parent = i, this.deep = s, this.checked = r, this.keep = l, this.type = "TreeRow";
1981
+ }
1982
+ }
1983
+ class j {
1984
+ static buildTreeRows(e, t = "children", o = 12) {
1985
+ const i = [];
1986
+ for (const s of e)
1987
+ i.push(j.buildTreeRow(s, t, void 0, 0, o));
1988
+ return i;
1989
+ }
1990
+ static buildTreeRow(e, t = "children", o = new Z(e, !0, [], void 0, 0), i = 0, s = 12) {
1991
+ var l;
1992
+ if (i > s)
1993
+ return console.warn("Max deep limit reached: ", i), o;
1994
+ const r = e[t];
1995
+ if (r)
1996
+ for (const n of r) {
1997
+ const d = new Z(n, !0, [], o, i + 1);
1998
+ if ((l = o.children) == null || l.push(d), j.buildTreeRow(
1999
+ n,
2000
+ t,
2001
+ d,
2002
+ i + 1
2003
+ ), i > s)
2004
+ return console.warn("Max deep limit reached: ", i), o;
2005
+ }
2006
+ return o;
2007
+ }
2008
+ }
2009
+ class P {
2010
+ constructor(e = 34, t = 34, o = 34) {
2011
+ this.header = e, this.body = t, this.footer = o;
2012
+ }
2013
+ }
2014
+ class f {
2015
+ constructor(e = 100, t = "px") {
2016
+ this.value = e, this.unit = t;
2017
+ }
2018
+ }
2019
+ const Ve = () => !0, ee = () => !1;
2020
+ class H {
2021
+ constructor(e, t, o = new f(100, "px"), i = new k(), s = new k(), r = new f(100, "px"), l = new f(100, "px"), n, d, a, c, g, m, b, w, u = () => this.visible) {
2022
+ this.property = e, this.headerLabel = t, this.width = o, this.classes = i, this.rendererMap = s, this.minWidth = r, this.maxWidth = l, this.sortable = n, this.sortComparator = d, this.sortState = a, this.sortStatesOrder = c, this.sortIconVisible = g, this.editable = m, this.getEditRenderer = b, this.editInputPipe = w, this.isVisible = u, this.visible = !0;
2023
+ }
2024
+ static bodyRenderer(e) {
2025
+ return new k(
2026
+ void 0,
2027
+ e,
2028
+ void 0
2029
+ );
2030
+ }
2031
+ static create(e) {
2032
+ const t = new k(
2033
+ e.headerRenderer,
2034
+ e.bodyRenderer,
2035
+ e.footerRenderer
2036
+ ), o = new k(
2037
+ e.headerClasses,
2038
+ e.bodyClasses,
2039
+ e.footerClasses
2040
+ ), i = e.sortIconVisible ?? e.sortable ?? ee, s = e.editable ?? e.editable ?? ee, r = e.isVisible ?? e.isVisible ?? Ve;
2041
+ return new H(
2042
+ e.property ?? "",
2043
+ e.headerLabel ?? "",
2044
+ e.width ?? new f(100, "px"),
2045
+ o,
2046
+ t,
2047
+ e.minWidth ?? new f(100, "px"),
2048
+ e.maxWidth ?? new f(100, "px"),
2049
+ e.sortable,
2050
+ e.sortComparator,
2051
+ e.sortState,
2052
+ e.sortStatesOrder,
2053
+ i,
2054
+ s,
2055
+ e.getEditRenderer,
2056
+ e.editInputPipe,
2057
+ r
2058
+ );
2059
+ }
2060
+ }
2061
+ const Ke = new f(300, "px"), Ue = new f(290, "px"), qe = new f(280, "px"), Je = new f(270, "px"), Qe = new f(260, "px"), Ze = new f(250, "px"), et = new f(240, "px"), tt = new f(230, "px"), ot = new f(220, "px"), it = new f(210, "px"), te = new f(200, "px"), st = new f(190, "px"), rt = new f(180, "px"), lt = new f(170, "px"), nt = new f(160, "px"), at = new f(150, "px"), dt = new f(140, "px"), ht = new f(130, "px"), ct = new f(120, "px"), ut = new f(110, "px"), gt = new f(100, "px"), bt = new f(90, "px"), pt = new f(80, "px"), ft = new f(70, "px"), mt = new f(60, "px"), wt = new f(50, "px"), St = new f(40, "px"), xt = new f(30, "px"), yt = new f(20, "px"), Ct = new f(10, "px"), vt = new f(0, "px");
2062
+ class q {
2063
+ constructor(e, t = [], o = -1) {
2064
+ this.areaIdent = e, this.columnDefs = t, this.defaultRowHeight = o, this.rowSelectionModel = void 0, this.yPositions = [], this.cellRenderers = t.map((i) => i.rendererMap[e]);
2065
+ }
2066
+ getTooltipAt(e, t) {
2067
+ return "";
2068
+ }
2069
+ getCellRenderer(e, t) {
2070
+ if (t < this.cellRenderers.length)
2071
+ return this.cellRenderers[t];
2072
+ }
2073
+ getColspanAt(e, t) {
2074
+ return 0;
2075
+ }
2076
+ getCustomClassesAt(e, t) {
2077
+ return [];
2078
+ }
2079
+ getCustomStyleAt(e, t) {
2080
+ }
2081
+ getRowspanAt(e, t) {
2082
+ return 0;
2083
+ }
2084
+ getRowByIndex(e) {
2085
+ }
2086
+ isRowCheckable(e) {
2087
+ return !0;
2088
+ }
2089
+ isRowChecked(e) {
2090
+ var o;
2091
+ const t = this.getRowByIndex(e);
2092
+ return (o = this.rowSelectionModel) == null ? void 0 : o.isRowChecked(t);
2093
+ }
2094
+ setRowChecked(e, t) {
2095
+ if (this.rowSelectionModel) {
2096
+ const o = this.getRowByIndex(e);
2097
+ this.rowSelectionModel.checkRow(o, t);
2098
+ }
2099
+ }
2100
+ getMaxColspan() {
2101
+ return 31;
2102
+ }
2103
+ getMaxRowspan() {
2104
+ return 31;
2105
+ }
2106
+ getYPosByRowIndex(e) {
2107
+ return this.defaultRowHeight > 0 ? this.defaultRowHeight * e : this.yPositions[e];
2108
+ }
2109
+ init() {
2110
+ !this.yPositions.length && this.getRowCount() !== void 0 && this.defaultRowHeight === -1 && this.calcYPositions();
2111
+ }
2112
+ isFilterable() {
2113
+ return this.areaIdent === "body";
2114
+ }
2115
+ doSort(e) {
2116
+ return !1;
2117
+ }
2118
+ isEditable(e, t) {
2119
+ return this.columnDefs && t < this.columnDefs.length && this.columnDefs[t].editable ? this.columnDefs[t].editable() : !1;
2120
+ }
2121
+ setValue(e, t, o) {
2122
+ var l;
2123
+ const i = (l = this.columnDefs[t]) == null ? void 0 : l.editInputPipe;
2124
+ i && (o = i(o, e, t));
2125
+ const s = this.getRowByIndex(e), r = this.columnDefs[t].property;
2126
+ return r.includes(".") ? this.setPropertyValue(s, r.split("."), o) : (s[r] = o, !0);
2127
+ }
2128
+ isSelectable(e, t) {
2129
+ return !0;
2130
+ }
2131
+ changeColumnOrder(e, t) {
2132
+ this.arrayMove(this.cellRenderers, e, t);
2133
+ }
2134
+ setPropertyValue(e, t, o) {
2135
+ const i = t.shift();
2136
+ if (i) {
2137
+ let s = e[i];
2138
+ return s && t.length ? this.setPropertyValue(s, t, o) : (e[i] = o, !0);
2139
+ }
2140
+ return !1;
2141
+ }
2142
+ arrayMove(e, t, o) {
2143
+ const i = e.splice(t, 1)[0];
2144
+ return e.splice(o, 0, i), e;
2145
+ }
2146
+ calcYPositions() {
2147
+ const e = this.getRowCount();
2148
+ this.yPositions = new Array(e + 1), this.yPositions[0] = 0;
2149
+ for (let t = 0; t < e; t++)
2150
+ this.yPositions[t + 1] = this.getRowHeight(t) + this.yPositions[t];
2151
+ }
2152
+ }
2153
+ class _ extends q {
2154
+ constructor(e, t, o, i = []) {
2155
+ super(e, i, o), this.areaIdent = e, this.arr = t, this.defaultRowHeight = o, this.columnDefs = i, this.filteredArr = [...t];
2156
+ }
2157
+ externalFilterChanged(e) {
2158
+ this.filteredArr = this.arr ? this.arr.filter(e) : [];
2159
+ }
2160
+ getRowCount() {
2161
+ return this.filteredArr ? this.filteredArr.length : 0;
2162
+ }
2163
+ getValueAt(e, t) {
2164
+ return this.filteredArr[e][t];
2165
+ }
2166
+ setValue(e, t, o) {
2167
+ var s;
2168
+ const i = (s = this.columnDefs[t]) == null ? void 0 : s.editInputPipe;
2169
+ return i && (o = i(o, e, t)), this.arr[e][t] = o, !0;
2170
+ }
2171
+ getRowByIndex(e) {
2172
+ return this.filteredArr[e];
2173
+ }
2174
+ getRowHeight(e) {
2175
+ return this.defaultRowHeight;
2176
+ }
2177
+ changeColumnOrder(e, t) {
2178
+ this.filteredArr.forEach((o) => this.arrayMove(o, e, t)), super.changeColumnOrder(e, t);
2179
+ }
2180
+ }
2181
+ class D {
2182
+ constructor(e = "body") {
2183
+ this.areaIdent = e, this.rowSelectionModel = void 0;
2184
+ }
2185
+ getRowCount() {
2186
+ return 0;
2187
+ }
2188
+ getValueAt(e, t) {
2189
+ return "";
2190
+ }
2191
+ getCellRenderer(e, t) {
2192
+ }
2193
+ getRowHeight(e) {
2194
+ return 0;
2195
+ }
2196
+ getColspanAt(e, t) {
2197
+ return 0;
2198
+ }
2199
+ getCustomClassesAt(e, t) {
2200
+ return [];
2201
+ }
2202
+ getCustomStyleAt(e, t) {
2203
+ }
2204
+ getRowspanAt(e, t) {
2205
+ return 0;
2206
+ }
2207
+ getRowByIndex(e) {
2208
+ }
2209
+ isRowCheckable(e) {
2210
+ return !1;
2211
+ }
2212
+ isRowChecked(e) {
2213
+ }
2214
+ setRowChecked(e, t) {
2215
+ }
2216
+ getTooltipAt(e, t) {
2217
+ return "";
2218
+ }
2219
+ getMaxColspan() {
2220
+ return 0;
2221
+ }
2222
+ getMaxRowspan() {
2223
+ return 0;
2224
+ }
2225
+ getYPosByRowIndex(e) {
2226
+ return 0;
2227
+ }
2228
+ init() {
2229
+ }
2230
+ externalFilterChanged(e) {
2231
+ }
2232
+ isFilterable() {
2233
+ return !1;
2234
+ }
2235
+ doSort(e) {
2236
+ return !1;
2237
+ }
2238
+ isEditable(e, t) {
2239
+ return !1;
2240
+ }
2241
+ setValue(e, t, o) {
2242
+ return !1;
2243
+ }
2244
+ isSelectable(e, t) {
2245
+ return !1;
2246
+ }
2247
+ changeColumnOrder(e, t) {
2248
+ }
2249
+ }
2250
+ class Be {
2251
+ flattenTree(e, t = []) {
2252
+ var o;
2253
+ for (const i of e)
2254
+ this.isVisible(i) && t.push(i), (o = i.children) != null && o.length && this.flattenTree(i.children, t);
2255
+ return t;
2256
+ }
2257
+ isVisible(e) {
2258
+ return e.parent ? e.parent.expanded ? this.isVisible(e.parent) : !1 : !0;
2259
+ }
2260
+ }
2261
+ class ue {
2262
+ genericSortComparator(e, t, o) {
2263
+ if (typeof e == "number" && typeof t == "number")
2264
+ return o * (e - t);
2265
+ if (typeof e == "string" && typeof t == "string")
2266
+ return o * e.localeCompare(t);
2267
+ if (typeof e == "boolean" && typeof t == "boolean")
2268
+ return o * ((e ? -1 : 1) - (t ? -1 : 1));
2269
+ if (e instanceof Date && t instanceof Date)
2270
+ return o * (e.getTime() - t.getTime());
2271
+ if (e instanceof Array && t instanceof Array) {
2272
+ const i = e, s = t;
2273
+ if (i.length && s.length)
2274
+ return this.genericSortComparator(i[0], s[0], o);
2275
+ }
2276
+ return o * ("" + e).localeCompare("" + t);
2277
+ }
2278
+ }
2279
+ class oe extends q {
2280
+ constructor(e, t, o, i = []) {
2281
+ super(e, i, o), this.areaIdent = e, this.rows = t, this.defaultRowHeight = o, this.columnDefs = i, this.type = "AreaModelTree", this.sorterService = new ue(), this.service = new Be(), this.properties = i.map((s) => s.property), this.flattenRows = this.service.flattenTree(t), this.filteredFlattenRows = [...this.flattenRows];
2282
+ }
2283
+ changeColumnOrder(e, t) {
2284
+ this.arrayMove(this.properties, e, t), super.changeColumnOrder(e, t);
2285
+ }
2286
+ recalcVisibleTreeRows() {
2287
+ this.filteredFlattenRows = this.service.flattenTree(this.rows);
2288
+ }
2289
+ getFilteredFlattenRows() {
2290
+ return this.filteredFlattenRows;
2291
+ }
2292
+ getRowCount() {
2293
+ let e = 0;
2294
+ for (const t of this.filteredFlattenRows)
2295
+ this.service.isVisible(t) && e++;
2296
+ return e;
2297
+ }
2298
+ getValueAt(e, t) {
2299
+ const o = this.getRowByIndex(e);
2300
+ if (o) {
2301
+ const i = this.properties[t];
2302
+ if (i)
2303
+ return i.includes(".") ? this.getPropertyValue(o.data, i.split(".")) : o.data[i];
2304
+ }
2305
+ return "";
2306
+ }
2307
+ getRowHeight(e) {
2308
+ return this.defaultRowHeight;
2309
+ }
2310
+ getCustomClassesAt(e, t) {
2311
+ return ["ge-table-tree-cell", "ge-table-tree-deep-" + this.filteredFlattenRows[e].deep];
2312
+ }
2313
+ getRowByIndex(e) {
2314
+ return this.filteredFlattenRows[e];
2315
+ }
2316
+ getValueByT(e, t) {
2317
+ return t.includes(".") ? this.getPropertyValue(e, t.split(".")) : e[t];
2318
+ }
2319
+ externalFilterChanged(e) {
2320
+ this.lastPredictFn = e, this.doFiltering();
2321
+ }
2322
+ doSort(e) {
2323
+ const { columnIndex: t, sortState: o } = e[e.length - 1], i = o === "asc" ? 1 : o === "desc" ? -1 : 0, s = this.properties[t];
2324
+ return this.treeSort(this.rows, s, i), this.flattenRows = this.service.flattenTree(this.rows), this.filteredFlattenRows = [...this.flattenRows], !0;
2325
+ }
2326
+ toggleExpandCollapseAll(e) {
2327
+ this.expandAllRecursive(this.rows, e), this.flattenRows = this.service.flattenTree(this.rows), this.doFiltering();
2328
+ }
2329
+ setAllParentsOk(e) {
2330
+ return e.parent && (e.parent.keep = !0, this.setAllParentsOk(e.parent)), !1;
2331
+ }
2332
+ setValue(e, t, o) {
2333
+ var r;
2334
+ const i = (r = this.columnDefs[t]) == null ? void 0 : r.editInputPipe;
2335
+ i && (o = i(o, e, t));
2336
+ const s = this.getRowByIndex(e);
2337
+ if (s) {
2338
+ const l = s.data, n = this.columnDefs[t].property;
2339
+ return n.includes(".") ? this.setPropertyValue(l, n.split("."), o) : (l[n] = o, !0);
2340
+ }
2341
+ return !1;
2342
+ }
2343
+ genericTreeTableSortComparator(e, t) {
2344
+ return (o, i) => {
2345
+ const s = this.getValueByT(o.data, e), r = this.getValueByT(i.data, e);
2346
+ return this.sorterService.genericSortComparator(s, r, t);
2347
+ };
2348
+ }
2349
+ expandAllRecursive(e, t) {
2350
+ for (const o of e)
2351
+ o.expanded = t, o.children && this.expandAllRecursive(o.children, t);
2352
+ }
2353
+ doFiltering() {
2354
+ if (!this.lastPredictFn)
2355
+ this.filteredFlattenRows = [...this.flattenRows ? this.flattenRows : []];
2356
+ else {
2357
+ this.flattenRows || (this.flattenRows = []);
2358
+ let e = 0;
2359
+ this.flattenRows.forEach((o) => {
2360
+ e = Math.max(e, o.deep);
2361
+ });
2362
+ const t = this.flattenRows.filter(
2363
+ (o, i, s) => this.lastPredictFn(o, i, s)
2364
+ );
2365
+ this.flattenRows.forEach((o) => o.keep = !1), this.flattenRows.forEach((o) => {
2366
+ t.includes(o) && (o.keep = !0, this.setAllParentsOk(o));
2367
+ }), this.filteredFlattenRows = this.flattenRows.filter(
2368
+ (o, i, s) => o.keep
2369
+ );
2370
+ }
2371
+ }
2372
+ getPropertyValue(e, t) {
2373
+ const o = t.shift();
2374
+ let i = e[o];
2375
+ return i && t.length ? this.getPropertyValue(i, t) : i;
2376
+ }
2377
+ treeSort(e, t, o) {
2378
+ e.sort(this.genericTreeTableSortComparator(t, o));
2379
+ for (const i of e)
2380
+ i.children && this.treeSort(i.children, t, o);
2381
+ }
2382
+ }
2383
+ class ie {
2384
+ constructor(e = []) {
2385
+ this.allRootNodes = e;
2386
+ }
2387
+ checkRow(e, t) {
2388
+ if (e.checked = t, e.children)
2389
+ for (const o of e.children)
2390
+ this.checkRow(o, t);
2391
+ this.autoCheckParent(e.parent);
2392
+ }
2393
+ checkAll(e) {
2394
+ for (const t of this.allRootNodes)
2395
+ t.checked = !1, t.children && this.checkAll(t.children);
2396
+ }
2397
+ getCheckedRows() {
2398
+ const e = [];
2399
+ return this.addSelectedRecursive(this.allRootNodes, e), e;
2400
+ }
2401
+ isRowChecked(e) {
2402
+ if (e.checked)
2403
+ return "full";
2404
+ const t = this.areAllChildrenChecked(e), o = this.areAllChildrenUnchecked(e);
2405
+ return !t && !o ? "semi" : "none";
2406
+ }
2407
+ setCheckedRows(e) {
2408
+ this.addCheckedRows(e);
2409
+ }
2410
+ addCheckedRows(e) {
2411
+ for (const t of e)
2412
+ t.checked = !0;
2413
+ }
2414
+ autoCheckParent(e) {
2415
+ if (e) {
2416
+ const t = this.areAllChildrenChecked(e), o = this.areAllChildrenUnchecked(e);
2417
+ t ? e.checked = !0 : e.checked = !1, this.autoCheckParent(e.parent);
2418
+ }
2419
+ }
2420
+ areAllChildrenChecked(e) {
2421
+ var t, o;
2422
+ if ((t = e.children) != null && t.length) {
2423
+ for (const i of e.children)
2424
+ if (!i.checked || (o = i.children) != null && o.length && !this.areAllChildrenChecked(i))
2425
+ return !1;
2426
+ }
2427
+ return !0;
2428
+ }
2429
+ areAllChildrenUnchecked(e) {
2430
+ var t, o;
2431
+ if ((t = e.children) != null && t.length) {
2432
+ for (const i of e.children)
2433
+ if (i.checked || (o = i.children) != null && o.length && !this.areAllChildrenUnchecked(i))
2434
+ return !1;
2435
+ }
2436
+ return !0;
2437
+ }
2438
+ addSelectedRecursive(e, t) {
2439
+ for (const o of e)
2440
+ o.checked && t.push(o), o.children && this.addSelectedRecursive(o.children, t);
2441
+ }
2442
+ }
2443
+ class se {
2444
+ constructor(e = 0, t = 0, o = 0, i = 0) {
2445
+ this.top = e, this.right = t, this.bottom = o, this.left = i;
2446
+ }
2447
+ }
2448
+ class We {
2449
+ constructor() {
2450
+ this.checkedRows = [];
2451
+ }
2452
+ getCheckedRows() {
2453
+ return this.checkedRows;
2454
+ }
2455
+ setCheckedRows(e) {
2456
+ this.checkedRows = e;
2457
+ }
2458
+ addCheckedRows(e) {
2459
+ this.checkedRows || (this.checkedRows = []);
2460
+ for (const t of e)
2461
+ this.checkedRows.includes(t) || this.checkedRows.push(t);
2462
+ }
2463
+ checkRow(e, t) {
2464
+ this.checkedRows || (this.checkedRows = []), t ? this.checkedRows.includes(e) || this.checkedRows.push(e) : this.removeSelectedRow(e);
2465
+ }
2466
+ isRowChecked(e) {
2467
+ return this.checkedRows && this.checkedRows.includes(e) ? "full" : "none";
2468
+ }
2469
+ checkAll(e) {
2470
+ this.checkedRows = [];
2471
+ }
2472
+ removeSelectedRow(e) {
2473
+ if (this.checkedRows) {
2474
+ const t = this.checkedRows.indexOf(e);
2475
+ t > -1 && this.checkedRows.splice(t, 1);
2476
+ }
2477
+ }
2478
+ }
2479
+ class G {
2480
+ constructor(e, t, o, i = 0, s = 0, r = !1, l = new P(), n = [], d = [], a = -1, c = 0, g = 400, m = () => {
2481
+ }) {
2482
+ var b, w, u, p;
2483
+ this.headerAreaModel = e, this.bodyAreaModel = t, this.footerAreaModel = o, this.fixedLeftColumnCount = i, this.fixedRightColumnCount = s, this.rowCheckboxVisible = r, this.defaultRowHeights = l, this.columnDefs = n, this.columnSizes = d, this.overridingColumnWidth = a, this.columnCount = c, this.parentSize = g, this.getSelectionModel = m, this.rowCount = 0, this.contentHeightInPx = 0, this.contentWidthInPx = 0, this.padding = new se(0, 0, 0, 0), this.xPositions = [], e.areaIdent = "header", t.areaIdent = "body", o.areaIdent = "footer", this.columnCount || ((b = this.columnDefs) != null && b.length ? this.columnCount = this.columnDefs.length : (w = this.columnSizes) != null && w.length && (this.columnCount = (u = this.columnSizes) == null ? void 0 : u.length)), (p = this.columnDefs) != null && p.length && be(this.columnDefs[0]) && !t.rowSelectionModel && (t.rowSelectionModel = new We());
2484
+ }
2485
+ init() {
2486
+ this.recalcSize(this.parentSize), this.overridingColumnWidth === -1 && this.calcXPositions(), this.headerAreaModel && this.headerAreaModel.init(), this.bodyAreaModel && this.bodyAreaModel.init(), this.footerAreaModel && this.footerAreaModel.init();
2487
+ }
2488
+ getColumnCount() {
2489
+ return this.columnCount;
2490
+ }
2491
+ setColumnWidth(e, t) {
2492
+ var o;
2493
+ t = Math.max(0, t), this.overridingColumnWidth !== -1 && (this.overridingColumnWidth = t), e > -1 && e < ((o = this.columnSizes) == null ? void 0 : o.length) && (this.columnSizes[e] = t), this.recalcContentWidthInPx();
2494
+ }
2495
+ getColumnWidth(e) {
2496
+ var o;
2497
+ const t = this.getColumnDef(e);
2498
+ return t && t.isVisible && !t.isVisible() ? 0 : this.overridingColumnWidth !== -1 ? this.overridingColumnWidth : e > -1 && e < ((o = this.columnSizes) == null ? void 0 : o.length) ? this.columnSizes[e] : 0;
2499
+ }
2500
+ getXPosByColumnIndex(e) {
2501
+ return e === 0 ? 0 : this.overridingColumnWidth > -1 ? this.overridingColumnWidth * e : this.xPositions[e];
2502
+ }
2503
+ recalcSize(e) {
2504
+ this.recalcColumnWidthes(e), this.recalcHeightAndPadding();
2505
+ }
2506
+ recalcHeightAndPadding() {
2507
+ const e = this.getAreaModel("body");
2508
+ this.rowCount = e.getRowCount(), this.contentHeightInPx = this.getAreaHeight("body"), this.recalcContentWidthInPx(), this.recalcPadding();
2509
+ }
2510
+ recalcPadding() {
2511
+ const e = this.getSideAreaWidth("west"), t = this.getSideAreaWidth("east"), o = this.getAreaHeight("header"), i = this.getAreaHeight("footer");
2512
+ this.padding = new se(
2513
+ o,
2514
+ t,
2515
+ i,
2516
+ e
2517
+ );
2518
+ }
2519
+ getPadding() {
2520
+ return this.padding;
2521
+ }
2522
+ getContentHeightInPixel() {
2523
+ return this.contentHeightInPx;
2524
+ }
2525
+ getContentWidthInPixel() {
2526
+ return this.contentWidthInPx;
2527
+ }
2528
+ getRowHeight(e, t) {
2529
+ return this.getAreaModel(e).getRowHeight(t);
2530
+ }
2531
+ getModel(e) {
2532
+ return this.getAreaModel(e);
2533
+ }
2534
+ getAreaHeight(e) {
2535
+ const t = this.getModel(e), o = t.getRowCount();
2536
+ if (this.defaultRowHeights[e])
2537
+ return o * this.defaultRowHeights[e];
2538
+ let i = 0;
2539
+ for (let s = 0; s < o; s++)
2540
+ i = i + t.getRowHeight(s);
2541
+ return i;
2542
+ }
2543
+ getSideAreaWidth(e) {
2544
+ const [t, o] = this.getSideStartAndEndColumnIndex(e);
2545
+ let i = 0;
2546
+ for (let s = t; s <= o; s++)
2547
+ i = i + this.getColumnWidth(s);
2548
+ return i;
2549
+ }
2550
+ getSideStartAndEndColumnIndex(e) {
2551
+ const t = this.getFixedLeftColumnCount(), o = this.getFixedRightColumnCount();
2552
+ let i = 0, s = this.columnCount - 1;
2553
+ return e === "west" ? s = t - 1 : e === "east" ? i = this.columnCount - o : (i = t, s = this.columnCount - o - 1), [i, s];
2554
+ }
2555
+ getColumnDef(e) {
2556
+ if (e < this.columnDefs.length)
2557
+ return this.columnDefs[e];
2558
+ }
2559
+ getFixedLeftColumnCount() {
2560
+ return this.fixedLeftColumnCount;
2561
+ }
2562
+ getFixedRightColumnCount() {
2563
+ return this.fixedRightColumnCount;
2564
+ }
2565
+ getAreaModel(e) {
2566
+ if (e === "header")
2567
+ return this.headerAreaModel;
2568
+ if (e === "body")
2569
+ return this.bodyAreaModel;
2570
+ if (e === "footer")
2571
+ return this.footerAreaModel;
2572
+ throw new Error("Wrong ident.");
2573
+ }
2574
+ getBodyModel() {
2575
+ return this.bodyAreaModel;
2576
+ }
2577
+ isFooterVisibe() {
2578
+ var e;
2579
+ return (((e = this.footerAreaModel) == null ? void 0 : e.getRowCount()) ?? 0) > 0;
2580
+ }
2581
+ isHeaderVisibe() {
2582
+ var e;
2583
+ return (((e = this.headerAreaModel) == null ? void 0 : e.getRowCount()) ?? 0) > 0;
2584
+ }
2585
+ isRowCheckboxVisible() {
2586
+ return this.rowCheckboxVisible;
2587
+ }
2588
+ externalFilterChanged(e) {
2589
+ this.getAreaModel("body").externalFilterChanged(e);
2590
+ }
2591
+ doSort(e) {
2592
+ return this.getAreaModel("body").doSort(e);
2593
+ }
2594
+ getColumnDefs() {
2595
+ return this.columnDefs;
2596
+ }
2597
+ getColumnProperty(e) {
2598
+ return this.columnDefs[e].property;
2599
+ }
2600
+ getBodyRowByIndex(e) {
2601
+ return this.getBodyModel().getRowByIndex(e);
2602
+ }
2603
+ isSortable(e) {
2604
+ return this.columnDefs && e < this.columnDefs.length && this.columnDefs[e].sortable ? this.columnDefs[e].sortable() : !1;
2605
+ }
2606
+ changeColumnOrder(e, t) {
2607
+ var o, i, s;
2608
+ this.arrayMove(this.columnDefs, e, t), this.arrayMove(this.columnSizes, e, t), (o = this.headerAreaModel) == null || o.changeColumnOrder(e, t), (i = this.bodyAreaModel) == null || i.changeColumnOrder(e, t), (s = this.footerAreaModel) == null || s.changeColumnOrder(e, t), this.calcXPositions();
2609
+ }
2610
+ recalcColumnWidthes(e) {
2611
+ var t, o, i;
2612
+ !((t = this.columnDefs) != null && t.length) && !((o = this.columnSizes) != null && o.length) && (this.columnSizes = new Array(this.getColumnCount()).fill(this.overridingColumnWidth)), (i = this.columnDefs) != null && i.length && (this.columnSizes = this.columnDefs.map((s) => {
2613
+ if (s.width.unit === "%" && e) {
2614
+ let r = Math.floor(s.width.value * e / 100);
2615
+ if (s.minWidth) {
2616
+ let l = s.minWidth.unit === "px" ? s.minWidth.value : Math.floor(s.minWidth.value * e / 100);
2617
+ r = Math.max(l, r);
2618
+ }
2619
+ if (s.maxWidth) {
2620
+ let l = s.maxWidth.unit === "px" ? s.maxWidth.value : Math.floor(s.maxWidth.value * e / 100);
2621
+ r = Math.min(l, r);
2622
+ }
2623
+ return r;
2624
+ }
2625
+ return s.width.value;
2626
+ }));
2627
+ }
2628
+ arrayMove(e, t, o) {
2629
+ const i = e.splice(t, 1)[0];
2630
+ return e.splice(o, 0, i), e;
2631
+ }
2632
+ recalcContentWidthInPx() {
2633
+ this.contentWidthInPx = this.getSideAreaWidth("center");
2634
+ }
2635
+ calcXPositions() {
2636
+ const e = this.getColumnCount();
2637
+ this.xPositions = new Array(e + 1), this.xPositions[0] = 0;
2638
+ for (let t = 0; t < e; t++)
2639
+ this.xPositions[t + 1] = this.getColumnWidth(t) + this.xPositions[t];
2640
+ }
2641
+ }
2642
+ class Ge extends q {
2643
+ constructor(e, t, o, i = []) {
2644
+ super(e, i, o), this.areaIdent = e, this.rows = t, this.defaultRowHeight = o, this.columnDefs = i, this.sorterService = new ue(), this.filteredRows = [...t], this.properties = i.map((s) => s.property);
2645
+ }
2646
+ getRowCount() {
2647
+ var e;
2648
+ return ((e = this.filteredRows) == null ? void 0 : e.length) ?? 0;
2649
+ }
2650
+ getValueAt(e, t) {
2651
+ const o = this.properties[t];
2652
+ let i = this.filteredRows[e];
2653
+ return O(i) && (i = i.data), i ? this.getValueByT(i, o) : "";
2654
+ }
2655
+ getFilteredRows() {
2656
+ return this.filteredRows;
2657
+ }
2658
+ getAllRows() {
2659
+ return this.rows;
2660
+ }
2661
+ getRowHeight(e) {
2662
+ return this.defaultRowHeight;
2663
+ }
2664
+ getRowByIndex(e) {
2665
+ return this.filteredRows[e];
2666
+ }
2667
+ externalFilterChanged(e) {
2668
+ this.filteredRows = this.rows ? this.rows.filter(e) : [];
2669
+ }
2670
+ doSort(e) {
2671
+ for (const t of e) {
2672
+ const { columnIndex: o, sortState: i } = t, s = i === "asc" ? 1 : i === "desc" ? -1 : 0, r = this.properties[o];
2673
+ this.filteredRows = this.filteredRows.sort(this.genericFlatTableSortComparator(r, s));
2674
+ }
2675
+ return !0;
2676
+ }
2677
+ getValueByT(e, t) {
2678
+ return t.includes(".") ? this.getPropertyValue(e, t.split(".")) : e[t];
2679
+ }
2680
+ changeColumnOrder(e, t) {
2681
+ this.arrayMove(this.properties, e, t), super.changeColumnOrder(e, t);
2682
+ }
2683
+ genericFlatTableSortComparator(e, t) {
2684
+ return (o, i) => {
2685
+ const s = this.getValueByT(o, e), r = this.getValueByT(i, e);
2686
+ return this.sorterService.genericSortComparator(s, r, t);
2687
+ };
2688
+ }
2689
+ getPropertyValue(e, t) {
2690
+ const o = t.shift();
2691
+ let i = e[o];
2692
+ return i && t.length ? this.getPropertyValue(i, t) : i;
2693
+ }
2694
+ }
2695
+ class re extends Ge {
2696
+ constructor(e, t, o, i) {
2697
+ super(
2698
+ e,
2699
+ t,
2700
+ i,
2701
+ o
2702
+ ), this.areaIdent = e, this.rows = t, this.columnDefs = o, this.defaultRowHeight = i;
2703
+ }
2704
+ }
2705
+ class L {
2706
+ static createTableModel(e) {
2707
+ var t, o, i, s, r, l, n, d, a, c, g, m, b, w;
2708
+ if (e.defaultRowHeights === void 0)
2709
+ if ((t = e.tableOptions) != null && t.defaultRowHeights)
2710
+ e.defaultRowHeights = e.tableOptions.defaultRowHeights;
2711
+ else {
2712
+ if (e.defaultRowHeights = new P(), e.headerAreaModel && "defaultRowHeight" in e.headerAreaModel) {
2713
+ const u = e.headerAreaModel.defaultRowHeight;
2714
+ u > -1 && (e.defaultRowHeights.header = u);
2715
+ }
2716
+ if (e.bodyAreaModel && "defaultRowHeight" in e.bodyAreaModel) {
2717
+ const u = e.bodyAreaModel.defaultRowHeight;
2718
+ u > -1 && (e.defaultRowHeights.body = u);
2719
+ }
2720
+ if (e.footerAreaModel && "defaultRowHeight" in e.footerAreaModel) {
2721
+ const u = e.footerAreaModel.defaultRowHeight;
2722
+ u > -1 && (e.defaultRowHeights.footer = u);
2723
+ }
2724
+ }
2725
+ if (e.columnDefs === void 0 && ((o = e.properties) != null && o.length ? e.columnDefs = e.properties.map((u) => new H(u, u.toUpperCase(), te)) : (i = e.rows) != null && i.length ? e.columnDefs = Object.keys(e.rows[0]).map((u) => new H(u, u.toUpperCase(), te)) : e.columnDefs = []), e.columnCount === void 0 && ((s = e.columnDefs) != null && s.length ? e.columnCount = e.columnDefs.length : (r = e.headerData) != null && r.length ? e.columnCount = e.headerData[0].length : (l = e.columnSizes) != null && l.length ? e.columnCount = (n = e.columnSizes) == null ? void 0 : n.length : console.warn('Property "columnCount" is missing and cannot be derived from other properties.')), e.headerAreaModel || ((d = e.headerData) != null && d.length ? e.headerAreaModel = new _(
2726
+ "header",
2727
+ e.headerData,
2728
+ e.defaultRowHeights.header,
2729
+ e.columnDefs
2730
+ ) : (a = e.columnDefs) != null && a.length ? e.headerAreaModel = new _(
2731
+ "header",
2732
+ [e.columnDefs.map((u) => u.headerLabel)],
2733
+ e.defaultRowHeights.header,
2734
+ e.columnDefs
2735
+ ) : e.headerAreaModel = new D("header")), e.footerAreaModel || ((c = e.footerData) != null && c.length ? e.footerAreaModel = new _(
2736
+ "footer",
2737
+ e.footerData,
2738
+ e.defaultRowHeights.footer,
2739
+ e.columnDefs
2740
+ ) : e.footerAreaModel = new D("footer")), !e.bodyAreaModel)
2741
+ if (e.rows)
2742
+ if ((g = e.rows) != null && g.length && O(e.rows[0])) {
2743
+ const u = e.rows;
2744
+ e.bodyAreaModel = new oe(
2745
+ "body",
2746
+ u,
2747
+ e.defaultRowHeights.body,
2748
+ e.columnDefs
2749
+ ), (e.columnDefs[0].property === "CheckboxColumn" || (m = e.tableOptions) != null && m.showCheckboxWihoutExtraColumn) && (e.bodyAreaModel.rowSelectionModel = new ie(u));
2750
+ } else
2751
+ e.bodyAreaModel = new re(
2752
+ "body",
2753
+ e.rows,
2754
+ e.columnDefs,
2755
+ e.defaultRowHeights.body
2756
+ );
2757
+ else
2758
+ e.bodyData ? e.bodyAreaModel = new _(
2759
+ "body",
2760
+ e.bodyData,
2761
+ e.defaultRowHeights.body
2762
+ ) : e.bodyAreaModel = new D("body");
2763
+ return e.fixedLeftColumnCount === void 0 && (e.fixedLeftColumnCount = 0), e.fixedRightColumnCount === void 0 && (e.fixedRightColumnCount = 0), e.rowCheckboxVisible === void 0 && (e.rowCheckboxVisible = !1), e.overridingColumnWidth === void 0 && (e.overridingColumnWidth = -1), !e.getSelectionModel && ((b = e.tableOptions) != null && b.getSelectionModel) && (e.getSelectionModel = (w = e.tableOptions) == null ? void 0 : w.getSelectionModel), new G(
2764
+ e.headerAreaModel,
2765
+ e.bodyAreaModel,
2766
+ e.footerAreaModel,
2767
+ e.fixedLeftColumnCount,
2768
+ e.fixedRightColumnCount,
2769
+ e.rowCheckboxVisible,
2770
+ e.defaultRowHeights,
2771
+ e.columnDefs,
2772
+ e.columnSizes,
2773
+ e.overridingColumnWidth,
2774
+ e.columnCount,
2775
+ e.parentSize,
2776
+ e.getSelectionModel
2777
+ );
2778
+ }
2779
+ static buildByTypedRowsParam(e) {
2780
+ return L.buildByTypedRows(
2781
+ e.rows ?? [],
2782
+ e.columnDefs,
2783
+ e.tableOptions ?? new N(),
2784
+ e.fixedLeftColumnCount ?? 0,
2785
+ e.fixedRightColumnCount ?? 0
2786
+ );
2787
+ }
2788
+ static buildByTypedRows(e, t, o = new N(), i = 0, s = 0) {
2789
+ const r = o.defaultRowHeights, l = t[0].property === "CheckboxColumn";
2790
+ if (e != null && e.length && O(e[0])) {
2791
+ const n = e, d = new oe(
2792
+ "body",
2793
+ n,
2794
+ r.body,
2795
+ t
2796
+ );
2797
+ return (l || o.showCheckboxWihoutExtraColumn) && (d.rowSelectionModel = new ie(n)), L.createByAreaModelsParam({
2798
+ headerAreaModel: new _("header", [t.map((a) => a.headerLabel)], r.header),
2799
+ bodyAreaModel: d,
2800
+ footerAreaModel: new _("footer", [], r.footer),
2801
+ columnDefs: t,
2802
+ fixedLeftColumnCount: i,
2803
+ fixedRightColumnCount: s,
2804
+ defaultRowHeights: o.defaultRowHeights,
2805
+ rowCheckboxVisible: !1,
2806
+ columnSizes: [],
2807
+ columnCount: t.length,
2808
+ overridingColumnWidth: -1
2809
+ });
2810
+ }
2811
+ return L.createByObjectArrayParam({
2812
+ rows: e,
2813
+ columnDefs: t,
2814
+ fixedLeftColumnCount: i,
2815
+ fixedRightColumnCount: s,
2816
+ defaultRowHeights: o.defaultRowHeights
2817
+ });
2818
+ }
2819
+ static createByObjectArrayParam(e) {
2820
+ const t = e.rowCheckboxVisible !== void 0 ? e.rowCheckboxVisible : !1;
2821
+ return L.createByObjectArray(
2822
+ e.rows,
2823
+ e.header ?? [],
2824
+ e.footer ?? [],
2825
+ e.fixedLeftColumnCount ?? 0,
2826
+ e.fixedRightColumnCount ?? 0,
2827
+ t,
2828
+ e.defaultRowHeights ?? new P(),
2829
+ e.columnDefs ?? [],
2830
+ e.columnSizes ?? []
2831
+ );
2832
+ }
2833
+ static createByAreaModels(e = new D(), t, o = new D(), i = 0, s = 0, r = !1, l = new P(), n, d = [], a = -1, c) {
2834
+ return new G(
2835
+ e,
2836
+ t,
2837
+ o,
2838
+ i,
2839
+ s,
2840
+ r,
2841
+ l,
2842
+ n,
2843
+ d,
2844
+ a,
2845
+ c
2846
+ );
2847
+ }
2848
+ static createByAreaModelsParam(e) {
2849
+ return L.createByAreaModels(
2850
+ e.headerAreaModel ?? new D(),
2851
+ e.bodyAreaModel,
2852
+ e.footerAreaModel ?? new D(),
2853
+ e.fixedLeftColumnCount ?? 0,
2854
+ e.fixedRightColumnCount ?? 0,
2855
+ e.rowCheckboxVisible === void 0 ? !1 : e.rowCheckboxVisible,
2856
+ e.defaultRowHeights,
2857
+ e.columnDefs ?? [],
2858
+ e.columnSizes ?? [],
2859
+ e.overridingColumnWidth ?? -1,
2860
+ e.columnCount ?? 0
2861
+ );
2862
+ }
2863
+ static createByObjectArray(e, t = [], o = [], i = 0, s = 0, r = !1, l = new P(), n, d = []) {
2864
+ let a;
2865
+ t != null && t.length ? a = new _("header", t, l.header, n) : n != null && n.length ? a = new _("header", [n.map((m) => m.headerLabel)], l.header, n) : a = new D();
2866
+ const c = o ? new _("footer", o, l.footer, n) : new D(), g = new re("body", e, n, l.body);
2867
+ return new G(
2868
+ a,
2869
+ g,
2870
+ c,
2871
+ i,
2872
+ s,
2873
+ r,
2874
+ l,
2875
+ n,
2876
+ d
2877
+ );
2878
+ }
2879
+ }
2880
+ const Rt = [
2881
+ //"COPY_2_CLIPBOARD",
2882
+ "START_EDITING",
2883
+ "TOGGLE_SELECTION",
2884
+ "SELECT_ALL",
2885
+ "DESELECT_ALL",
2886
+ "NAVIGATE_LEFT",
2887
+ "NAVIGATE_RIGHT",
2888
+ "NAVIGATE_UP",
2889
+ "NAVIGATE_DOWN"
2890
+ //
2891
+ // "ENTER_PRESSED",
2892
+ // "HOME_PRESSED",
2893
+ // "SPACE_PRESSED",
2894
+ // "END_PRESSED",
2895
+ // "PAGEUP_PRESSED",
2896
+ // "PAGEDOWN_PRESSED"
2897
+ ];
2898
+ class At {
2899
+ constructor(e, t) {
2900
+ this.tableModel = e, this.tableOptions = t;
2901
+ }
2902
+ }
2903
+ class ze {
2904
+ constructor(e, t, o, i, s, r, l) {
2905
+ this.emmitDataKey = e, this.emmitCancelKey = t, this.queryId = o, this.filter = i, this.sorting = s, this.startIndex = r, this.endIndex = l;
2906
+ }
2907
+ }
2908
+ class Et extends ze {
2909
+ constructor(e, t, o, i, s, r, l, n) {
2910
+ super(
2911
+ e,
2912
+ t,
2913
+ o,
2914
+ i,
2915
+ s,
2916
+ r,
2917
+ l
2918
+ ), this.rows = n;
2919
+ }
2920
+ }
2921
+ class Ne {
2922
+ constructor(e, t) {
2923
+ this.value = e, this.label = t;
2924
+ }
2925
+ }
2926
+ class Mt {
2927
+ constructor(e, t) {
2928
+ this.index = e, this.px = t;
2929
+ }
2930
+ }
2931
+ const It = { body: ["ge-table-text-align-left"] }, kt = { body: ["ge-table-text-align-center"] }, Tt = { body: ["ge-table-text-align-right"] }, _t = {
2932
+ header: ["ge-table-text-align-left"],
2933
+ body: ["ge-table-text-align-left"],
2934
+ footer: ["ge-table-text-align-left"]
2935
+ }, Dt = {
2936
+ header: ["ge-table-text-align-center"],
2937
+ body: ["ge-table-text-align-center"],
2938
+ footer: ["ge-table-text-align-center"]
2939
+ }, $t = {
2940
+ header: ["ge-table-text-align-right"],
2941
+ body: ["ge-table-text-align-right"],
2942
+ footer: ["ge-table-text-align-right"]
2943
+ };
2944
+ class le {
2945
+ render(e, t, o, i, s, r, l) {
2946
+ if (s.isRowCheckable(t)) {
2947
+ l.addClass(e, "ge-table-row-checkbox-div");
2948
+ const n = s.isRowChecked(t), d = n === "full" ? "checked" : "", a = n === "semi" ? '<span style="opacity: 0.4;">✓<span>' : "";
2949
+ e.innerHTML = `
2950
+ <input
2951
+ type="checkbox"
2952
+ data-area="${i}"
2953
+ data-row-index="${t}"
2954
+ data-col-index="${o}"
2955
+ data-input-type="checkbox"
2956
+ ${d}
2957
+ class="ge-table-row-checkbox">
2958
+ ${a} `;
2959
+ }
2960
+ }
2961
+ }
2962
+ class Ft {
2963
+ constructor() {
2964
+ this.type = "CheckboxColumnDef", this.property = "CheckboxColumn", this.headerLabel = "", this.width = new f(50, "px"), this.minWidth = new f(50, "px"), this.maxWidth = new f(100, "px"), this.rendererMap = new k(new le(), new le(), void 0), this.classes = new k(
2965
+ [],
2966
+ ["ge-table-text-align-left"],
2967
+ []
2968
+ );
2969
+ }
2970
+ }
2971
+ class Lt {
2972
+ static body(e) {
2973
+ return new k(
2974
+ void 0,
2975
+ e,
2976
+ void 0
2977
+ );
2978
+ }
2979
+ }
2980
+ class Ot {
2981
+ constructor(e = "down", t) {
2982
+ this.status = e, this.originalEvent = t;
2983
+ }
2984
+ }
2985
+ class Pt {
2986
+ constructor(e, t, o, i) {
2987
+ this.area = e, this.rowIndex = t, this.columnIndex = o, this.value = i;
2988
+ }
2989
+ }
2990
+ class Ht {
2991
+ constructor() {
2992
+ this.autoRestoreSortingState = !1, this.autoRestoreCollapsedExpandedState = !1, this.autoRestoreScrollPosition = !1, this.autoRestoreCheckedState = !1, this.autoRestoreSelectedState = !1, this.getStorageKeyFn = void 0, this.isSame = (e, t, o) => {
2993
+ if (e && t && o.getRowId) {
2994
+ const i = o.getRowId(e), s = o.getRowId(t);
2995
+ return i === s;
2996
+ }
2997
+ return !1;
2998
+ }, this.getRowId = (e) => {
2999
+ if (e) {
3000
+ for (const t of ["id", "uuid"]) {
3001
+ const o = e[t];
3002
+ if (o != null)
3003
+ return o;
3004
+ }
3005
+ try {
3006
+ return JSON.stringify(e);
3007
+ } catch (t) {
3008
+ console.error(t);
3009
+ }
3010
+ }
3011
+ return console.warn('One of following options set to true without a valid "getRowId()": autoRestoreExpandedState, autoRestoreCheckedState.'), -1;
3012
+ };
3013
+ }
3014
+ }
3015
+ class je {
3016
+ constructor(e, t, o, i = !1, s = "normal", r = void 0) {
3017
+ this.data = e, this.property = t, this.toggle = o, this.closed = i, this.visibility = s, this.children = r, this.impl = "CellGroup";
3018
+ }
3019
+ }
3020
+ class Xe extends je {
3021
+ constructor(e, t = 0, o = 0, i) {
3022
+ super(
3023
+ e.data,
3024
+ e.property,
3025
+ e.toggle,
3026
+ e.closed,
3027
+ e.visibility,
3028
+ e.children
3029
+ ), this.rowIndex = t, this.childIndex = o, this.parent = i, this.impl = "CellGroupExt", this.children = void 0, this.leftNeighbour = void 0, this.rightNeighbour = void 0;
3030
+ }
3031
+ ownColumn() {
3032
+ return !!this.property;
3033
+ }
3034
+ toString() {
3035
+ return this.data + "";
3036
+ }
3037
+ // TODO hier gehts weiter!!!!!!!!!!!
3038
+ getColumnIndex() {
3039
+ return this.parent ? this.parent.getColumnIndex() + this.childIndex : (this.leftNeighbour, 0);
3040
+ }
3041
+ //
3042
+ // getLeftClaimedSpaces(): number{
3043
+ // if (this.leftNeighbour) {
3044
+ //
3045
+ // }
3046
+ // return 0;
3047
+ // }
3048
+ // getSumOfLeafs(cg: CellGroupExt, sum: number = 0): number {
3049
+ // if (cg.children?.length) {
3050
+ // for (let i = 0; i < cg.children.length; i++) {
3051
+ // const child = cg.children[i];
3052
+ // if (child.children?.length) {
3053
+ // sum = this.getSumOfLeafs(child, sum);
3054
+ // } else {
3055
+ // sum++;
3056
+ // }
3057
+ // }
3058
+ // }
3059
+ // if (this.ownColumn()) {
3060
+ // sum++;
3061
+ // }
3062
+ // //console.info(cg.data, sum)
3063
+ // return sum;
3064
+ // }
3065
+ //
3066
+ // getBiggestChildColumnIndex(): number {
3067
+ // if (this.children?.length) {
3068
+ // return Math.max(...this.children.map(c => c.getBiggestChildColumnIndex()));
3069
+ // }
3070
+ // return this.childIndex;
3071
+ // }
3072
+ isVisible() {
3073
+ return this.parent ? this.visibility === "always" ? this.parent.isVisible() : this.visibility === "normal" || !this.visibility ? this.parent.isVisible() && !this.parent.closed : this.visibility === "inverted" ? this.parent.isVisible() && this.parent.closed : !0 : !0;
3074
+ }
3075
+ // should be rendered
3076
+ claimsSpace() {
3077
+ return this.isVisible() && (this.ownColumn() || this.closed);
3078
+ }
3079
+ getColumnCount(e = this, t = 0) {
3080
+ var o;
3081
+ if (e != null && e.claimsSpace() && t++, (o = e == null ? void 0 : e.children) != null && o.length)
3082
+ for (const i of e.children)
3083
+ t = this.getColumnCount(i, t);
3084
+ return t;
3085
+ }
3086
+ getRowSpan(e = this, t) {
3087
+ return e != null && e.claimsSpace() ? t - this.getParentCount(e, 0) : 1;
3088
+ }
3089
+ getParentCount(e = this, t = 0) {
3090
+ return e.parent && (t = t + 1 + this.getParentCount(e.parent, t)), t;
3091
+ }
3092
+ log(e) {
3093
+ const t = " ".substring(0, 2 * this.rowIndex), o = `${this.getColumnIndex()}`, i = `${this.getColumnCount(this)}`, s = `${this.getRowSpan(this, e)}`, r = `${this.getParentCount(this)}`;
3094
+ if (console.info(`${t + this.data}
3095
+ childIndex:${this.childIndex}
3096
+ row:${this.rowIndex}
3097
+ col:${o}
3098
+ vis:${this.visibility}
3099
+ closed:${this.closed}
3100
+ isVisible:${this.isVisible()}
3101
+ ownColumn:${this.ownColumn()}
3102
+ claimsSpace:${this.claimsSpace()}
3103
+ colCount:${i}
3104
+ rowSpan:${s}
3105
+ pc:${r}`.replace(/[ \n]+/g, " ")), this.children)
3106
+ for (const l of this.children)
3107
+ l.log(e);
3108
+ }
3109
+ }
3110
+ class I {
3111
+ static buildColumnDefs(e, t = []) {
3112
+ for (const o of e)
3113
+ o.property && t.push(
3114
+ H.create({
3115
+ property: o.property,
3116
+ headerLabel: o.data ? o.data : o.property,
3117
+ isVisible: () => typeof o.isVisible == "function" ? o.isVisible() : !0
3118
+ })
3119
+ ), o.children && I.buildColumnDefs(o.children, t);
3120
+ return t;
3121
+ }
3122
+ /*
3123
+ static buildDeepMap(
3124
+ cellGroups: CellGroupIf[],
3125
+ ret: { [key: string]: number } = {},
3126
+ deep = 0
3127
+ ): { [key: string]: number } {
3128
+
3129
+ for (const cellGroup of cellGroups) {
3130
+ //if (cellGroup.property) {
3131
+ ret[cellGroup.data] = deep;
3132
+ //}
3133
+ if (cellGroup.children) {
3134
+ CellgroupFactory.buildDeepMap(cellGroup.children, ret, deep + 1);
3135
+ }
3136
+ }
3137
+ return ret;
3138
+ }
3139
+ */
3140
+ static buildGroupExts(e, t = [], o = 0, i) {
3141
+ let s;
3142
+ for (let r = 0; r < e.length; r++) {
3143
+ const l = e[r], n = new Xe(l, o, r, i);
3144
+ s && (n.leftNeighbour = s, s.rightNeighbour = n), t.push(n), l.children && (n.children = I.buildGroupExts(l.children, [], o + 1, n)), s = n;
3145
+ }
3146
+ return t;
3147
+ }
3148
+ static flattenGroupExts(e, t = []) {
3149
+ for (const o of e)
3150
+ t.push(o), o.children && I.flattenGroupExts(o.children, t);
3151
+ return t;
3152
+ }
3153
+ /*
3154
+
3155
+ Gold Hohenwarte
3156
+ Gold AB Gold CD HOH AB HOH CD
3157
+ . Gold A Gold B Gold C Gold D Gold Sum . HOH Loc HOH A HOH B HOH C HOH D
3158
+
3159
+ */
3160
+ static buildArrayOfArrays(e, t) {
3161
+ var s;
3162
+ let o = -1, i = 99999;
3163
+ for (const r of e) {
3164
+ if (r.rowIndex <= i) {
3165
+ o++;
3166
+ for (let l = 0; l < t.length; l++)
3167
+ t[l][o] = null;
3168
+ }
3169
+ if (t[r.rowIndex][o] = r, i = r.rowIndex, r.ownColumn() && ((s = r.children) != null && s.length)) {
3170
+ for (let l = r.rowIndex + 1; l < t.length; l++)
3171
+ t[l][o] = void 0;
3172
+ o++;
3173
+ for (let l = 0; l < t.length; l++)
3174
+ t[l][o] = null;
3175
+ }
3176
+ }
3177
+ return t;
3178
+ }
3179
+ static iterateThrowColumns(e = [], t) {
3180
+ var o;
3181
+ for (const i of t)
3182
+ e.push(i.data + " rowIndex:" + i.rowIndex), (o = i.children) != null && o.length && I.iterateThrowColumns(e, i.children);
3183
+ }
3184
+ }
3185
+ class Vt {
3186
+ constructor() {
3187
+ this.areaIdent = "body", this.rowSelectionModel = void 0;
3188
+ }
3189
+ changeColumnOrder(e, t) {
3190
+ }
3191
+ doSort(e) {
3192
+ return !1;
3193
+ }
3194
+ externalFilterChanged(e) {
3195
+ }
3196
+ getCellRenderer(e, t) {
3197
+ }
3198
+ getColspanAt(e, t) {
3199
+ return 0;
3200
+ }
3201
+ getCustomClassesAt(e, t) {
3202
+ return [];
3203
+ }
3204
+ getCustomStyleAt(e, t) {
3205
+ }
3206
+ getMaxColspan() {
3207
+ return 0;
3208
+ }
3209
+ getMaxRowspan() {
3210
+ return 0;
3211
+ }
3212
+ getRowByIndex(e) {
3213
+ }
3214
+ getRowCount() {
3215
+ return 0;
3216
+ }
3217
+ getRowHeight(e) {
3218
+ return 0;
3219
+ }
3220
+ getRowspanAt(e, t) {
3221
+ return 0;
3222
+ }
3223
+ getTooltipAt(e, t) {
3224
+ }
3225
+ getValueAt(e, t) {
3226
+ }
3227
+ getYPosByRowIndex(e) {
3228
+ return 0;
3229
+ }
3230
+ init() {
3231
+ }
3232
+ isEditable(e, t) {
3233
+ return !1;
3234
+ }
3235
+ isFilterable() {
3236
+ return !1;
3237
+ }
3238
+ isRowCheckable(e) {
3239
+ return !1;
3240
+ }
3241
+ isRowChecked(e) {
3242
+ }
3243
+ isSelectable(e, t) {
3244
+ return !1;
3245
+ }
3246
+ setRowChecked(e, t) {
3247
+ }
3248
+ setValue(e, t, o) {
3249
+ return !1;
3250
+ }
3251
+ }
3252
+ class Ye {
3253
+ render(e, t, o, i, s, r, l) {
3254
+ const n = r != null && r.data ? r.data : "";
3255
+ e.innerHTML = `${n}`;
3256
+ }
3257
+ }
3258
+ class Bt {
3259
+ constructor(e = "header", t, o = [], i) {
3260
+ var s;
3261
+ this.areaIdent = e, this.groups = t, this.columnDefs = o, this.defaultRowHeight = i, this.gammaCells = !0, this.groupExts = [], this.cellGroupExtCellRenderer = new Ye(), this.groupExts = I.buildGroupExts(t), console.info(this.groupExts), console.info(this.getAllLeafs()), console.info(this.getMaxRowCount());
3262
+ for (const r of this.groupExts)
3263
+ r.log(this.getMaxRowCount());
3264
+ this.arr = this.buildArray(), !((s = this.columnDefs) != null && s.length) && e === "header" && (this.columnDefs = I.buildColumnDefs(t)), console.info("this.columnDefs", this.columnDefs), console.info("this.arr", this.arr);
3265
+ }
3266
+ getAllLeafs() {
3267
+ return I.flattenGroupExts(this.groupExts).filter((t) => !t.children);
3268
+ }
3269
+ getMaxRowCount() {
3270
+ const e = this.getAllLeafs();
3271
+ return e != null && e.length ? 1 + Math.max(...e.map((t) => t.getParentCount(t))) : 0;
3272
+ }
3273
+ buildArray() {
3274
+ console.info("");
3275
+ let e = I.flattenGroupExts(this.groupExts);
3276
+ const t = e.length, o = 1 + Math.max(...e.map((l) => l.rowIndex));
3277
+ console.info("max row/col:", o + "/" + t);
3278
+ const i = [];
3279
+ I.iterateThrowColumns(i, this.groupExts), console.info(i);
3280
+ const s = Array.from(Array(o).keys()).map((l) => []);
3281
+ let r = I.buildArrayOfArrays(e, s);
3282
+ return console.table(r), r;
3283
+ }
3284
+ changeColumnOrder(e, t) {
3285
+ }
3286
+ doSort(e) {
3287
+ return !1;
3288
+ }
3289
+ externalFilterChanged(e) {
3290
+ }
3291
+ getCellRenderer(e, t) {
3292
+ return this.cellGroupExtCellRenderer;
3293
+ }
3294
+ getColspanAt(e, t) {
3295
+ const o = this.getValueAt(e, t);
3296
+ return o ? o.getColumnCount() : 0;
3297
+ }
3298
+ getCustomClassesAt(e, t) {
3299
+ return [];
3300
+ }
3301
+ getCustomStyleAt(e, t) {
3302
+ }
3303
+ getMaxColspan() {
3304
+ return 12;
3305
+ }
3306
+ getMaxRowspan() {
3307
+ return 12;
3308
+ }
3309
+ getRowByIndex(e) {
3310
+ }
3311
+ getRowCount() {
3312
+ return this.arr ? this.arr.length : 0;
3313
+ }
3314
+ getRowspanAt(e, t) {
3315
+ const o = this.getValueAt(e, t);
3316
+ if (o) {
3317
+ const i = this.getRowCount();
3318
+ return o.getRowSpan(o, i);
3319
+ }
3320
+ return 0;
3321
+ }
3322
+ getTooltipAt(e, t) {
3323
+ return "";
3324
+ }
3325
+ getValueAt(e, t) {
3326
+ return this.arr[e][t];
3327
+ }
3328
+ getYPosByRowIndex(e) {
3329
+ return 0;
3330
+ }
3331
+ init() {
3332
+ }
3333
+ getRowHeight(e) {
3334
+ return this.defaultRowHeight;
3335
+ }
3336
+ isEditable(e, t) {
3337
+ return !1;
3338
+ }
3339
+ isFilterable() {
3340
+ return !1;
3341
+ }
3342
+ isRowCheckable(e) {
3343
+ return !1;
3344
+ }
3345
+ isRowChecked(e) {
3346
+ }
3347
+ isSelectable(e, t) {
3348
+ return !1;
3349
+ }
3350
+ setRowChecked(e, t) {
3351
+ }
3352
+ setValue(e, t, o) {
3353
+ return !1;
3354
+ }
3355
+ }
3356
+ class Wt {
3357
+ filterPredict(e, t, o = this.objectToString.bind(this)) {
3358
+ if (!e)
3359
+ return !1;
3360
+ if (!t)
3361
+ return !0;
3362
+ t = t.toLowerCase();
3363
+ const i = "+", s = "-", r = t.toLowerCase().split(" ").filter((c) => c !== i && c !== s && c !== ""), l = r.filter((c) => !c.startsWith(i) && !c.startsWith(s)), n = r.filter((c) => c.startsWith(i)).map((c) => c.replace(/\+/g, "")), d = r.filter((c) => c.startsWith(s)).map((c) => c.replace(/-/g, ""));
3364
+ let a = !l.length;
3365
+ for (let c = 0; c < l.length; c++)
3366
+ (a || o(e).includes(l[c])) && (a = !0);
3367
+ if (!a)
3368
+ return !1;
3369
+ for (let c = 0; c < n.length; c++)
3370
+ if (!o(e).includes(n[c]))
3371
+ return !1;
3372
+ for (let c = 0; c < d.length; c++)
3373
+ if (o(e).includes(d[c]))
3374
+ return !1;
3375
+ return !0;
3376
+ }
3377
+ filterRows(e, t, o = (i) => JSON.stringify(i).toLowerCase()) {
3378
+ if (!e)
3379
+ return [];
3380
+ if (!t)
3381
+ return [...e];
3382
+ t = t.toLowerCase();
3383
+ const i = "+", s = "-", r = t.toLowerCase().split(" ").filter((a) => a !== i && a !== s && a !== ""), l = r.filter((a) => !a.startsWith(i) && !a.startsWith(s)), n = r.filter((a) => a.startsWith(i)).map((a) => a.replace(/\+/g, "")), d = r.filter((a) => a.startsWith(s)).map((a) => a.replace(/-/g, ""));
3384
+ return e == null ? void 0 : e.filter((a) => {
3385
+ let c = !l.length;
3386
+ for (let g = 0; g < l.length; g++)
3387
+ (c || o(a).includes(l[g])) && (c = !0);
3388
+ if (!c)
3389
+ return !1;
3390
+ for (let g = 0; g < n.length; g++)
3391
+ if (!o(a).includes(n[g]))
3392
+ return !1;
3393
+ for (let g = 0; g < d.length; g++)
3394
+ if (o(a).includes(d[g]))
3395
+ return !1;
3396
+ return !0;
3397
+ });
3398
+ }
3399
+ objectToString(e) {
3400
+ if (!e)
3401
+ return "";
3402
+ const t = [], o = Object.keys(e);
3403
+ for (let i = 0; i < o.length; i++) {
3404
+ const s = o[i];
3405
+ t.push(e[s]);
3406
+ }
3407
+ return t.join(" ").toLowerCase();
3408
+ }
3409
+ }
3410
+ class Gt {
3411
+ static bodyRenderer(e) {
3412
+ return new k(void 0, e, void 0);
3413
+ }
3414
+ }
3415
+ class zt {
3416
+ constructor(e, t = !0, o = !1) {
3417
+ this.property = e, this.skipCheckableCheck = t, this.readonly = o;
3418
+ }
3419
+ render(e, t, o, i, s, r, l) {
3420
+ if (this.readonly || this.skipCheckableCheck || s.isRowCheckable(t)) {
3421
+ l.addClass(e, "ge-table-row-checkbox-div");
3422
+ const n = s.getRowByIndex(t), a = s.getValueByT(n, this.property) === !0 ? "checked" : "", c = this.readonly ? " readonly " : "";
3423
+ if (l.addClass(e, "ge-padding-property-checkbox"), e.innerHTML = `
3424
+ <input
3425
+ type="checkbox"
3426
+ data-area="${i}"
3427
+ data-row-index="${t}"
3428
+ data-col-index="${o}"
3429
+ data-property-index="${this.property}"
3430
+ data-input-type="checkbox"
3431
+ ${a}
3432
+ ${c}
3433
+ class="ge-input-checkbox">`, !this.readonly) {
3434
+ const g = e.querySelector(".ge-input-checkbox");
3435
+ g && g.addEventListener("click", (m, b) => (n[this.property] = !n[this.property], !0));
3436
+ }
3437
+ }
3438
+ }
3439
+ }
3440
+ class Nt {
3441
+ render(e, t, o, i, s, r, l) {
3442
+ r && (e.innerText = new Date(r).toISOString());
3443
+ }
3444
+ }
3445
+ class jt {
3446
+ constructor() {
3447
+ this.formatter = new Intl.DateTimeFormat("de-DE", {
3448
+ year: "numeric",
3449
+ month: "2-digit",
3450
+ day: "2-digit"
3451
+ });
3452
+ }
3453
+ render(e, t, o, i, s, r, l) {
3454
+ if (r) {
3455
+ let n = "";
3456
+ try {
3457
+ n = this.formatter.format(new Date(r));
3458
+ } catch {
3459
+ n = r;
3460
+ }
3461
+ e.innerHTML = `
3462
+ <div class="ge-table-label-div" data-row-index="${t}" data-col-index="${o}" data-area="${i}" style="position: relative; background: transparent; width: 100%; height: 100%;">
3463
+ <div class="ge-table-label" data-row-index="${t}" data-col-index="${o}" data-area="${i}">${n}</div>
3464
+ </div>`;
3465
+ }
3466
+ }
3467
+ }
3468
+ class Xt {
3469
+ render(e, t, o, i, s, r, l) {
3470
+ r && (e.innerText = new Date(r).toLocaleDateString());
3471
+ }
3472
+ }
3473
+ class Yt {
3474
+ render(e, t, o, i, s, r, l) {
3475
+ r === "male" || r === "m" ? e.innerText = "♂" : (r === "female" || r === "f") && (e.innerText = "♀");
3476
+ }
3477
+ }
3478
+ class Kt {
3479
+ render(e, t, o, i, s, r, l) {
3480
+ r === "true" || r === !0 ? e.innerHTML = '<span class="ge-true-text-color">✅</span>' : r === "false" || r === !1 ? e.innerHTML = '<span class="ge-false-text-color">❌</span>' : e.innerText = "";
3481
+ }
3482
+ }
3483
+ class Ut {
3484
+ render(e, t, o, i, s, r, l) {
3485
+ r && (e.innerText = new Date(r).toISOString().replace(/T/g, " ").replace(/\..*/g, ""));
3486
+ }
3487
+ }
3488
+ class qt {
3489
+ constructor(e = Number.MIN_SAFE_INTEGER, t = Number.MAX_SAFE_INTEGER) {
3490
+ this.min = e, this.max = t;
3491
+ }
3492
+ render(e, t, o, i, s, r, l) {
3493
+ r && (e.innerText = r, (typeof r == "string" || isNaN(r) || r < this.min || r > this.max) && l.addClass(e, "ge-cell-error"));
3494
+ }
3495
+ }
3496
+ class Jt {
3497
+ constructor(e) {
3498
+ this.property = e;
3499
+ }
3500
+ render(e, t, o, i, s, r, l) {
3501
+ l.addClass(e, "ge-star-rating-div");
3502
+ const n = s.getRowByIndex(t), d = +("" + s.getValueByT(n, this.property));
3503
+ if (!isNaN(d)) {
3504
+ const a = [];
3505
+ for (let g = 0; g < d; g++)
3506
+ a.push("★");
3507
+ const c = a.join(" ");
3508
+ e.innerHTML = `
3509
+ <div class="ge-table-label-div" data-row-index="${t}" data-col-index="${o}" data-area="${i}" style="position: relative; background: transparent; width: 100%; height: 100%;">
3510
+ <div class="ge-table-label" data-row-index="${t}" data-col-index="${o}" data-area="${i}">${c}</div>
3511
+ </div>`;
3512
+ }
3513
+ }
3514
+ }
3515
+ class Qt {
3516
+ constructor(e, t = 100, o = !1) {
3517
+ this.property = e, this.maxValue = t, this.labelVisible = o;
3518
+ }
3519
+ render(e, t, o, i, s, r, l) {
3520
+ l.addClass(e, "ge-star-rating-div");
3521
+ const n = s.getRowByIndex(t), d = +("" + s.getValueByT(n, this.property));
3522
+ if (!isNaN(d)) {
3523
+ const a = d * 100 / this.maxValue, c = this.labelVisible ? Math.round(a) + "%" : "";
3524
+ e.innerHTML = `
3525
+ <div class="ge-table-label-div"
3526
+ data-row-index="${t}"
3527
+ data-col-index="${o}"
3528
+ data-area="${i}"
3529
+ title="${c}"
3530
+ style="position: relative; background: transparent; width: 100%; height: 100%;">
3531
+ <div class="ge-table-progress-container"
3532
+ style="width:100%;height:50%;padding:0;margin-top:6px;"
3533
+ data-row-index="${t}"
3534
+ data-col-index="${o}"
3535
+ data-area="${i}">
3536
+ <div class="ge-table-progress-bar"
3537
+ style="width:${a}%;height:100%;padding:0;margin:0;"
3538
+ data-row-index="${t}"
3539
+ data-col-index="${o}"
3540
+ data-area="${i}">&nbsp;
3541
+ </div>
3542
+ </div>
3543
+ </div>`;
3544
+ }
3545
+ }
3546
+ }
3547
+ const Zt = function(h, e, t) {
3548
+ return h ? Number(h) : "";
3549
+ };
3550
+ class ge {
3551
+ constructor(e) {
3552
+ this.options = e;
3553
+ }
3554
+ static create(e) {
3555
+ return new ge(
3556
+ e.map((t) => new Ne(t, t))
3557
+ );
3558
+ }
3559
+ render(e, t, o, i, s, r, l) {
3560
+ if (s.isEditable(t, o)) {
3561
+ l.addClass(e, "ge-table-row-select-div");
3562
+ const n = s.getValueAt(t, o);
3563
+ let d = [];
3564
+ for (let c of this.options) {
3565
+ const g = c.value === n ? " selected " : "";
3566
+ d.push(`<option value="${c.value}" ${g}>${c.label}</option>`);
3567
+ }
3568
+ const a = d.join("");
3569
+ e.innerHTML = `
3570
+ <select
3571
+ type="text"
3572
+ value="${n}"
3573
+ autofocus
3574
+ data-listen="change"
3575
+ data-area="${i}"
3576
+ data-row-index="${t}"
3577
+ data-col-index="${o}"
3578
+ data-input-type="text"
3579
+ style="width:100%;height:100%;border:0;padding:0 0 0 8px;"
3580
+ class="ge-table-cell-editor-select">${a}</select>`;
3581
+ }
3582
+ }
3583
+ }
3584
+ class eo {
3585
+ constructor(e, t, o) {
3586
+ this.r = e, this.g = t, this.b = o;
3587
+ }
3588
+ }
3589
+ class ne {
3590
+ constructor(e, t, o, i) {
3591
+ this.minValue = e, this.minColor = t, this.maxValue = o, this.maxColor = i;
3592
+ }
3593
+ }
3594
+ class B {
3595
+ static normalize(e, t, o, i = 0, s = 1) {
3596
+ return (e - t) / (o - t) * (s - i) + i;
3597
+ }
3598
+ static getTwoColorGradientRGB(e, t) {
3599
+ const o = B.normalize(e, t.minValue, t.maxValue, 0, 1), i = t.maxColor.r - t.minColor.r, s = t.maxColor.g - t.minColor.g, r = t.maxColor.b - t.minColor.b, l = i * o + t.minColor.r, n = s * o + t.minColor.g, d = r * o + t.minColor.b;
3600
+ return `rgb(${Math.round(l)}, ${Math.round(n)}, ${Math.round(d)})`;
3601
+ }
3602
+ static getThreeColorGradientRGB(e, t) {
3603
+ return e < t.middleValue ? B.getTwoColorGradientRGB(e, new ne(t.minValue, t.minColor, t.middleValue, t.middleColor)) : e > t.middleValue ? B.getTwoColorGradientRGB(e, new ne(t.middleValue, t.middleColor, t.maxValue, t.maxColor)) : `rgb(${t.middleColor.r}, ${t.middleColor.g}, ${t.middleColor.b})`;
3604
+ }
3605
+ }
3606
+ class to {
3607
+ constructor(e, t, o, i, s, r) {
3608
+ this.minValue = e, this.minColor = t, this.middleValue = o, this.middleColor = i, this.maxValue = s, this.maxColor = r;
3609
+ }
3610
+ }
3611
+ export {
3612
+ q as AbstractAreaModel,
3613
+ Lt as AreaMapFactory,
3614
+ Vt as AreaModel,
3615
+ _ as AreaModelArrayOfArrays,
3616
+ Bt as AreaModelCellGroups,
3617
+ D as AreaModelHidden,
3618
+ re as AreaModelObjectArrayWithColumndefs,
3619
+ Ge as AreaModelObjectyArray,
3620
+ oe as AreaModelTree,
3621
+ k as AreaObjectMap,
3622
+ Ht as AutoRestoreOptions,
3623
+ je as CellGroup,
3624
+ Xe as CellGroupExt,
3625
+ Ye as CellGroupExtCellRenderer,
3626
+ E as CellRange,
3627
+ I as CellgroupFactory,
3628
+ zt as CheckboxBooleanPropertyCellRenderer,
3629
+ le as CheckboxCellRenderer,
3630
+ Ft as CheckboxColumnDef,
3631
+ We as CheckboxModel,
3632
+ Et as ChunkData,
3633
+ Re as ColAndRowspanModel,
3634
+ xe as CollapsedExpandedData,
3635
+ eo as ColorRgb,
3636
+ H as ColumnDef,
3637
+ pe as ConvenienceDomService,
3638
+ ce as CssVars,
3639
+ jt as DateToIntlDDMMYYYYCellRenderer,
3640
+ Nt as DateToIsoCellRenderer,
3641
+ Xt as DateToLocaleDateCellRenderer,
3642
+ Ut as DateToTecCellRenderer,
3643
+ P as DefaultRowHeights,
3644
+ ve as EleScope,
3645
+ Q as EventAdapter,
3646
+ ee as FalseFn,
3647
+ Oe as FocusModel,
3648
+ Ie as GeCellIndices,
3649
+ B as GeCssColorUtil,
3650
+ Wt as GeFilterService,
3651
+ Ot as GeKeyEvent,
3652
+ U as GeModelChangeEvent,
3653
+ X as GeMouseEvent,
3654
+ $ as GeoData,
3655
+ F as Icon,
3656
+ Mt as IndexAndPx,
3657
+ Fe as InputCellRenderer,
3658
+ Me as InputHandler,
3659
+ Yt as MaleFemaleToIconCellRenderer,
3660
+ me as MouseHandler,
3661
+ fe as MouseTargetData,
3662
+ qt as NumberCellRenderer,
3663
+ _e as OsxShortcutActionIdMapping,
3664
+ se as Padding,
3665
+ Qt as ProgressBarCellRenderer,
3666
+ Ae as RenderScope,
3667
+ Gt as Renderer,
3668
+ ze as RequestChunk,
3669
+ ge as SelectCellRenderer,
3670
+ Le as SelectionModel,
3671
+ ke as SelectionService,
3672
+ De as ShortcutService,
3673
+ $e as SimpleDomService,
3674
+ f as Size,
3675
+ Ee as SortItem,
3676
+ de as SortedOptions,
3677
+ Jt as StarRatingCellRenderer,
3678
+ ye as StoreStateCollapsedExpandService,
3679
+ Se as StoreStateScrollPosService,
3680
+ Ce as StoreStateSortingService,
3681
+ we as TableApi,
3682
+ Pt as TableCellUpdateEvent,
3683
+ L as TableFactory,
3684
+ G as TableModel,
3685
+ At as TableModelAndOptions,
3686
+ N as TableOptions,
3687
+ he as TableScope,
3688
+ to as ThreeColorGradientArg,
3689
+ ie as TreeCheckboxModel,
3690
+ j as TreeFactory,
3691
+ ae as TreeOptions,
3692
+ Z as TreeRow,
3693
+ Be as TreeRowService,
3694
+ Kt as TrueFalseCellRenderer,
3695
+ Ve as TrueFn,
3696
+ ne as TwoColorGradientArg,
3697
+ Ne as ValueLabel,
3698
+ Te as WindowsShortcutActionIdMapping,
3699
+ Rt as actionIds,
3700
+ Dt as allCenter,
3701
+ _t as allLeft,
3702
+ $t as allRight,
3703
+ kt as bodyCenter,
3704
+ It as bodyLeft,
3705
+ Tt as bodyRight,
3706
+ Zt as editInputPipeForNumber,
3707
+ Y as getAreaIdentByString,
3708
+ z as isAreaModelTree,
3709
+ be as isCheckboxColumnDef,
3710
+ O as isTreeRow,
3711
+ vt as px0,
3712
+ Ct as px10,
3713
+ gt as px100,
3714
+ ut as px110,
3715
+ ct as px120,
3716
+ ht as px130,
3717
+ dt as px140,
3718
+ at as px150,
3719
+ nt as px160,
3720
+ lt as px170,
3721
+ rt as px180,
3722
+ st as px190,
3723
+ yt as px20,
3724
+ te as px200,
3725
+ it as px210,
3726
+ ot as px220,
3727
+ tt as px230,
3728
+ et as px240,
3729
+ Ze as px250,
3730
+ Qe as px260,
3731
+ Je as px270,
3732
+ qe as px280,
3733
+ Ue as px290,
3734
+ xt as px30,
3735
+ Ke as px300,
3736
+ St as px40,
3737
+ wt as px50,
3738
+ mt as px60,
3739
+ ft as px70,
3740
+ pt as px80,
3741
+ bt as px90
3742
+ };