@guiexpert/table 1.0.11 → 1.0.13

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