@finos/legend-data-cube 0.0.2

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 (517) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/lib/application/DataCubeDocumentation.d.ts +22 -0
  4. package/lib/application/DataCubeDocumentation.d.ts.map +1 -0
  5. package/lib/application/DataCubeDocumentation.js +23 -0
  6. package/lib/application/DataCubeDocumentation.js.map +1 -0
  7. package/lib/components/DataCube.d.ts +19 -0
  8. package/lib/components/DataCube.d.ts.map +1 -0
  9. package/lib/components/DataCube.js +67 -0
  10. package/lib/components/DataCube.js.map +1 -0
  11. package/lib/components/DataCubeProvider.d.ts +27 -0
  12. package/lib/components/DataCubeProvider.d.ts.map +1 -0
  13. package/lib/components/DataCubeProvider.js +34 -0
  14. package/lib/components/DataCubeProvider.js.map +1 -0
  15. package/lib/components/application/DataCubeAlert.d.ts +44 -0
  16. package/lib/components/application/DataCubeAlert.d.ts.map +1 -0
  17. package/lib/components/application/DataCubeAlert.js +83 -0
  18. package/lib/components/application/DataCubeAlert.js.map +1 -0
  19. package/lib/components/application/DataCubeDocumentationPanel.d.ts +19 -0
  20. package/lib/components/application/DataCubeDocumentationPanel.d.ts.map +1 -0
  21. package/lib/components/application/DataCubeDocumentationPanel.js +32 -0
  22. package/lib/components/application/DataCubeDocumentationPanel.js.map +1 -0
  23. package/lib/components/application/DataCubeLayoutManager.d.ts +27 -0
  24. package/lib/components/application/DataCubeLayoutManager.d.ts.map +1 -0
  25. package/lib/components/application/DataCubeLayoutManager.js +116 -0
  26. package/lib/components/application/DataCubeLayoutManager.js.map +1 -0
  27. package/lib/components/application/DataCubeSettingsPanel.d.ts +19 -0
  28. package/lib/components/application/DataCubeSettingsPanel.d.ts.map +1 -0
  29. package/lib/components/application/DataCubeSettingsPanel.js +53 -0
  30. package/lib/components/application/DataCubeSettingsPanel.js.map +1 -0
  31. package/lib/components/editor/DataCubeEditor.d.ts +22 -0
  32. package/lib/components/editor/DataCubeEditor.d.ts.map +1 -0
  33. package/lib/components/editor/DataCubeEditor.js +51 -0
  34. package/lib/components/editor/DataCubeEditor.js.map +1 -0
  35. package/lib/components/editor/DataCubeEditorColumnPropertiesPanel.d.ts +22 -0
  36. package/lib/components/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -0
  37. package/lib/components/editor/DataCubeEditorColumnPropertiesPanel.js +274 -0
  38. package/lib/components/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -0
  39. package/lib/components/editor/DataCubeEditorColumnsPanel.d.ts +22 -0
  40. package/lib/components/editor/DataCubeEditorColumnsPanel.d.ts.map +1 -0
  41. package/lib/components/editor/DataCubeEditorColumnsPanel.js +35 -0
  42. package/lib/components/editor/DataCubeEditorColumnsPanel.js.map +1 -0
  43. package/lib/components/editor/DataCubeEditorColumnsSelector.d.ts +32 -0
  44. package/lib/components/editor/DataCubeEditorColumnsSelector.d.ts.map +1 -0
  45. package/lib/components/editor/DataCubeEditorColumnsSelector.js +307 -0
  46. package/lib/components/editor/DataCubeEditorColumnsSelector.js.map +1 -0
  47. package/lib/components/editor/DataCubeEditorGeneralPropertiesPanel.d.ts +22 -0
  48. package/lib/components/editor/DataCubeEditorGeneralPropertiesPanel.d.ts.map +1 -0
  49. package/lib/components/editor/DataCubeEditorGeneralPropertiesPanel.js +167 -0
  50. package/lib/components/editor/DataCubeEditorGeneralPropertiesPanel.js.map +1 -0
  51. package/lib/components/editor/DataCubeEditorHorizontalPivotsPanel.d.ts +22 -0
  52. package/lib/components/editor/DataCubeEditorHorizontalPivotsPanel.d.ts.map +1 -0
  53. package/lib/components/editor/DataCubeEditorHorizontalPivotsPanel.js +29 -0
  54. package/lib/components/editor/DataCubeEditorHorizontalPivotsPanel.js.map +1 -0
  55. package/lib/components/editor/DataCubeEditorSortsPanel.d.ts +22 -0
  56. package/lib/components/editor/DataCubeEditorSortsPanel.d.ts.map +1 -0
  57. package/lib/components/editor/DataCubeEditorSortsPanel.js +62 -0
  58. package/lib/components/editor/DataCubeEditorSortsPanel.js.map +1 -0
  59. package/lib/components/editor/DataCubeEditorVerticalPivotsPanel.d.ts +22 -0
  60. package/lib/components/editor/DataCubeEditorVerticalPivotsPanel.d.ts.map +1 -0
  61. package/lib/components/editor/DataCubeEditorVerticalPivotsPanel.js +25 -0
  62. package/lib/components/editor/DataCubeEditorVerticalPivotsPanel.js.map +1 -0
  63. package/lib/components/extend/DataCubeColumnEditor.d.ts +22 -0
  64. package/lib/components/extend/DataCubeColumnEditor.d.ts.map +1 -0
  65. package/lib/components/extend/DataCubeColumnEditor.js +169 -0
  66. package/lib/components/extend/DataCubeColumnEditor.js.map +1 -0
  67. package/lib/components/filter/DataCubeFilterEditor.d.ts +22 -0
  68. package/lib/components/filter/DataCubeFilterEditor.d.ts.map +1 -0
  69. package/lib/components/filter/DataCubeFilterEditor.js +312 -0
  70. package/lib/components/filter/DataCubeFilterEditor.js.map +1 -0
  71. package/lib/components/grid/DataCubeGrid.d.ts +27 -0
  72. package/lib/components/grid/DataCubeGrid.d.ts.map +1 -0
  73. package/lib/components/grid/DataCubeGrid.js +241 -0
  74. package/lib/components/grid/DataCubeGrid.js.map +1 -0
  75. package/lib/components/grid/DataCubeGridShared.d.ts +18 -0
  76. package/lib/components/grid/DataCubeGridShared.d.ts.map +1 -0
  77. package/lib/components/grid/DataCubeGridShared.js +25 -0
  78. package/lib/components/grid/DataCubeGridShared.js.map +1 -0
  79. package/lib/components/shared/DataCubeFormUtils.d.ts +54 -0
  80. package/lib/components/shared/DataCubeFormUtils.d.ts.map +1 -0
  81. package/lib/components/shared/DataCubeFormUtils.js +251 -0
  82. package/lib/components/shared/DataCubeFormUtils.js.map +1 -0
  83. package/lib/components/shared/DataCubePureCodeEditorUtils.d.ts +22 -0
  84. package/lib/components/shared/DataCubePureCodeEditorUtils.d.ts.map +1 -0
  85. package/lib/components/shared/DataCubePureCodeEditorUtils.js +64 -0
  86. package/lib/components/shared/DataCubePureCodeEditorUtils.js.map +1 -0
  87. package/lib/index.css +17 -0
  88. package/lib/index.css.map +1 -0
  89. package/lib/index.d.ts +21 -0
  90. package/lib/index.d.ts.map +1 -0
  91. package/lib/index.js +21 -0
  92. package/lib/index.js.map +1 -0
  93. package/lib/package.json +89 -0
  94. package/lib/stores/DataCubeState.d.ts +32 -0
  95. package/lib/stores/DataCubeState.d.ts.map +1 -0
  96. package/lib/stores/DataCubeState.js +84 -0
  97. package/lib/stores/DataCubeState.js.map +1 -0
  98. package/lib/stores/DataCubeViewState.d.ts +50 -0
  99. package/lib/stores/DataCubeViewState.d.ts.map +1 -0
  100. package/lib/stores/DataCubeViewState.js +109 -0
  101. package/lib/stores/DataCubeViewState.js.map +1 -0
  102. package/lib/stores/core/DataCubeConfiguration.d.ts +107 -0
  103. package/lib/stores/core/DataCubeConfiguration.d.ts.map +1 -0
  104. package/lib/stores/core/DataCubeConfiguration.js +185 -0
  105. package/lib/stores/core/DataCubeConfiguration.js.map +1 -0
  106. package/lib/stores/core/DataCubeConfigurationBuilder.d.ts +25 -0
  107. package/lib/stores/core/DataCubeConfigurationBuilder.d.ts.map +1 -0
  108. package/lib/stores/core/DataCubeConfigurationBuilder.js +50 -0
  109. package/lib/stores/core/DataCubeConfigurationBuilder.js.map +1 -0
  110. package/lib/stores/core/DataCubeInfoState.d.ts +33 -0
  111. package/lib/stores/core/DataCubeInfoState.d.ts.map +1 -0
  112. package/lib/stores/core/DataCubeInfoState.js +48 -0
  113. package/lib/stores/core/DataCubeInfoState.js.map +1 -0
  114. package/lib/stores/core/DataCubeQueryBuilder.d.ts +35 -0
  115. package/lib/stores/core/DataCubeQueryBuilder.d.ts.map +1 -0
  116. package/lib/stores/core/DataCubeQueryBuilder.js +130 -0
  117. package/lib/stores/core/DataCubeQueryBuilder.js.map +1 -0
  118. package/lib/stores/core/DataCubeQueryBuilderUtils.d.ts +50 -0
  119. package/lib/stores/core/DataCubeQueryBuilderUtils.d.ts.map +1 -0
  120. package/lib/stores/core/DataCubeQueryBuilderUtils.js +320 -0
  121. package/lib/stores/core/DataCubeQueryBuilderUtils.js.map +1 -0
  122. package/lib/stores/core/DataCubeQueryEngine.d.ts +224 -0
  123. package/lib/stores/core/DataCubeQueryEngine.d.ts.map +1 -0
  124. package/lib/stores/core/DataCubeQueryEngine.js +286 -0
  125. package/lib/stores/core/DataCubeQueryEngine.js.map +1 -0
  126. package/lib/stores/core/DataCubeQuerySnapshot.d.ts +89 -0
  127. package/lib/stores/core/DataCubeQuerySnapshot.d.ts.map +1 -0
  128. package/lib/stores/core/DataCubeQuerySnapshot.js +82 -0
  129. package/lib/stores/core/DataCubeQuerySnapshot.js.map +1 -0
  130. package/lib/stores/core/DataCubeQuerySnapshotBuilder.d.ts +33 -0
  131. package/lib/stores/core/DataCubeQuerySnapshotBuilder.d.ts.map +1 -0
  132. package/lib/stores/core/DataCubeQuerySnapshotBuilder.js +260 -0
  133. package/lib/stores/core/DataCubeQuerySnapshotBuilder.js.map +1 -0
  134. package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.d.ts +30 -0
  135. package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.d.ts.map +1 -0
  136. package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.js +125 -0
  137. package/lib/stores/core/DataCubeQuerySnapshotBuilderUtils.js.map +1 -0
  138. package/lib/stores/core/DataCubeQuerySnapshotManager.d.ts +47 -0
  139. package/lib/stores/core/DataCubeQuerySnapshotManager.d.ts.map +1 -0
  140. package/lib/stores/core/DataCubeQuerySnapshotManager.js +84 -0
  141. package/lib/stores/core/DataCubeQuerySnapshotManager.js.map +1 -0
  142. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.d.ts +28 -0
  143. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.d.ts.map +1 -0
  144. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.js +25 -0
  145. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation.js.map +1 -0
  146. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.d.ts +27 -0
  147. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.d.ts.map +1 -0
  148. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.js +39 -0
  149. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.js.map +1 -0
  150. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.d.ts +27 -0
  151. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.d.ts.map +1 -0
  152. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.js +47 -0
  153. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.js.map +1 -0
  154. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.d.ts +27 -0
  155. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.d.ts.map +1 -0
  156. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.js +44 -0
  157. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__First.js.map +1 -0
  158. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.d.ts +27 -0
  159. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.d.ts.map +1 -0
  160. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.js +53 -0
  161. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.js.map +1 -0
  162. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.d.ts +27 -0
  163. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.d.ts.map +1 -0
  164. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.js +44 -0
  165. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.js.map +1 -0
  166. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.d.ts +27 -0
  167. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.d.ts.map +1 -0
  168. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.js +39 -0
  169. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.js.map +1 -0
  170. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.d.ts +27 -0
  171. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.d.ts.map +1 -0
  172. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.js +39 -0
  173. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.js.map +1 -0
  174. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.d.ts +27 -0
  175. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.d.ts.map +1 -0
  176. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.js +39 -0
  177. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.js.map +1 -0
  178. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.d.ts +27 -0
  179. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.d.ts.map +1 -0
  180. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.js +39 -0
  181. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.js.map +1 -0
  182. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.d.ts +27 -0
  183. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.d.ts.map +1 -0
  184. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.js +39 -0
  185. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.js.map +1 -0
  186. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.d.ts +27 -0
  187. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.d.ts.map +1 -0
  188. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.js +44 -0
  189. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.js.map +1 -0
  190. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.d.ts +27 -0
  191. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.d.ts.map +1 -0
  192. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.js +39 -0
  193. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.js.map +1 -0
  194. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.d.ts +27 -0
  195. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.d.ts.map +1 -0
  196. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.js +39 -0
  197. package/lib/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.js.map +1 -0
  198. package/lib/stores/core/filter/DataCubeQueryFilterEditorState.d.ts +36 -0
  199. package/lib/stores/core/filter/DataCubeQueryFilterEditorState.d.ts.map +1 -0
  200. package/lib/stores/core/filter/DataCubeQueryFilterEditorState.js +153 -0
  201. package/lib/stores/core/filter/DataCubeQueryFilterEditorState.js.map +1 -0
  202. package/lib/stores/core/filter/DataCubeQueryFilterOperation.d.ts +32 -0
  203. package/lib/stores/core/filter/DataCubeQueryFilterOperation.d.ts.map +1 -0
  204. package/lib/stores/core/filter/DataCubeQueryFilterOperation.js +48 -0
  205. package/lib/stores/core/filter/DataCubeQueryFilterOperation.js.map +1 -0
  206. package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.d.ts +34 -0
  207. package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.d.ts.map +1 -0
  208. package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.js +59 -0
  209. package/lib/stores/core/filter/DataCubeQueryFilterOperation__Contain.js.map +1 -0
  210. package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.d.ts +34 -0
  211. package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.d.ts.map +1 -0
  212. package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.js +64 -0
  213. package/lib/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.js.map +1 -0
  214. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.d.ts +34 -0
  215. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.d.ts.map +1 -0
  216. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.js +59 -0
  217. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWith.js.map +1 -0
  218. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.d.ts +34 -0
  219. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.d.ts.map +1 -0
  220. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.js +64 -0
  221. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.js.map +1 -0
  222. package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.d.ts +34 -0
  223. package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.d.ts.map +1 -0
  224. package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.js +136 -0
  225. package/lib/stores/core/filter/DataCubeQueryFilterOperation__Equal.js.map +1 -0
  226. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.d.ts +34 -0
  227. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.d.ts.map +1 -0
  228. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.js +64 -0
  229. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.js.map +1 -0
  230. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.d.ts +34 -0
  231. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.d.ts.map +1 -0
  232. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.js +64 -0
  233. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.js.map +1 -0
  234. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.d.ts +34 -0
  235. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.d.ts.map +1 -0
  236. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.js +65 -0
  237. package/lib/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.js.map +1 -0
  238. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.d.ts +34 -0
  239. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.d.ts.map +1 -0
  240. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.js +67 -0
  241. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.js.map +1 -0
  242. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.d.ts +34 -0
  243. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.d.ts.map +1 -0
  244. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.js +64 -0
  245. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.js.map +1 -0
  246. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.d.ts +34 -0
  247. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.d.ts.map +1 -0
  248. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.js +67 -0
  249. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.js.map +1 -0
  250. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.d.ts +34 -0
  251. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.d.ts.map +1 -0
  252. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.js +64 -0
  253. package/lib/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.js.map +1 -0
  254. package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.d.ts +31 -0
  255. package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.d.ts.map +1 -0
  256. package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.js +64 -0
  257. package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.js.map +1 -0
  258. package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.d.ts +31 -0
  259. package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.d.ts.map +1 -0
  260. package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.js +64 -0
  261. package/lib/stores/core/filter/DataCubeQueryFilterOperation__IsNull.js.map +1 -0
  262. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.d.ts +34 -0
  263. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.d.ts.map +1 -0
  264. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.js +67 -0
  265. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThan.js.map +1 -0
  266. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.d.ts +34 -0
  267. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.d.ts.map +1 -0
  268. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.js +64 -0
  269. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.js.map +1 -0
  270. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.d.ts +34 -0
  271. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.d.ts.map +1 -0
  272. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.js +67 -0
  273. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.js.map +1 -0
  274. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.d.ts +34 -0
  275. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.d.ts.map +1 -0
  276. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.js +64 -0
  277. package/lib/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.js.map +1 -0
  278. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.d.ts +34 -0
  279. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.d.ts.map +1 -0
  280. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.js +59 -0
  281. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotContain.js.map +1 -0
  282. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.d.ts +34 -0
  283. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.d.ts.map +1 -0
  284. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.js +59 -0
  285. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.js.map +1 -0
  286. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.d.ts +34 -0
  287. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.d.ts.map +1 -0
  288. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.js +69 -0
  289. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.js.map +1 -0
  290. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.d.ts +34 -0
  291. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.d.ts.map +1 -0
  292. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.js +64 -0
  293. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.js.map +1 -0
  294. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.d.ts +34 -0
  295. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.d.ts.map +1 -0
  296. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.js +64 -0
  297. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.js.map +1 -0
  298. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.d.ts +34 -0
  299. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.d.ts.map +1 -0
  300. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.js +65 -0
  301. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.js.map +1 -0
  302. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.d.ts +34 -0
  303. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.d.ts.map +1 -0
  304. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.js +59 -0
  305. package/lib/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.js.map +1 -0
  306. package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.d.ts +34 -0
  307. package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.d.ts.map +1 -0
  308. package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.js +59 -0
  309. package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWith.js.map +1 -0
  310. package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.d.ts +34 -0
  311. package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.d.ts.map +1 -0
  312. package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.js +64 -0
  313. package/lib/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.js.map +1 -0
  314. package/lib/stores/editor/DataCubeEditorColumnPropertiesPanelState.d.ts +37 -0
  315. package/lib/stores/editor/DataCubeEditorColumnPropertiesPanelState.d.ts.map +1 -0
  316. package/lib/stores/editor/DataCubeEditorColumnPropertiesPanelState.js +68 -0
  317. package/lib/stores/editor/DataCubeEditorColumnPropertiesPanelState.js.map +1 -0
  318. package/lib/stores/editor/DataCubeEditorColumnsPanelState.d.ts +58 -0
  319. package/lib/stores/editor/DataCubeEditorColumnsPanelState.d.ts.map +1 -0
  320. package/lib/stores/editor/DataCubeEditorColumnsPanelState.js +127 -0
  321. package/lib/stores/editor/DataCubeEditorColumnsPanelState.js.map +1 -0
  322. package/lib/stores/editor/DataCubeEditorColumnsSelectorState.d.ts +42 -0
  323. package/lib/stores/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -0
  324. package/lib/stores/editor/DataCubeEditorColumnsSelectorState.js +75 -0
  325. package/lib/stores/editor/DataCubeEditorColumnsSelectorState.js.map +1 -0
  326. package/lib/stores/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts +35 -0
  327. package/lib/stores/editor/DataCubeEditorGeneralPropertiesPanelState.d.ts.map +1 -0
  328. package/lib/stores/editor/DataCubeEditorGeneralPropertiesPanelState.js +59 -0
  329. package/lib/stores/editor/DataCubeEditorGeneralPropertiesPanelState.js.map +1 -0
  330. package/lib/stores/editor/DataCubeEditorHorizontalPivotsPanelState.d.ts +38 -0
  331. package/lib/stores/editor/DataCubeEditorHorizontalPivotsPanelState.d.ts.map +1 -0
  332. package/lib/stores/editor/DataCubeEditorHorizontalPivotsPanelState.js +75 -0
  333. package/lib/stores/editor/DataCubeEditorHorizontalPivotsPanelState.js.map +1 -0
  334. package/lib/stores/editor/DataCubeEditorMutableConfiguration.d.ts +107 -0
  335. package/lib/stores/editor/DataCubeEditorMutableConfiguration.d.ts.map +1 -0
  336. package/lib/stores/editor/DataCubeEditorMutableConfiguration.js +467 -0
  337. package/lib/stores/editor/DataCubeEditorMutableConfiguration.js.map +1 -0
  338. package/lib/stores/editor/DataCubeEditorPanelState.d.ts +29 -0
  339. package/lib/stores/editor/DataCubeEditorPanelState.d.ts.map +1 -0
  340. package/lib/stores/editor/DataCubeEditorPanelState.js +17 -0
  341. package/lib/stores/editor/DataCubeEditorPanelState.js.map +1 -0
  342. package/lib/stores/editor/DataCubeEditorSortsPanelState.d.ts +41 -0
  343. package/lib/stores/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -0
  344. package/lib/stores/editor/DataCubeEditorSortsPanelState.js +86 -0
  345. package/lib/stores/editor/DataCubeEditorSortsPanelState.js.map +1 -0
  346. package/lib/stores/editor/DataCubeEditorState.d.ts +64 -0
  347. package/lib/stores/editor/DataCubeEditorState.d.ts.map +1 -0
  348. package/lib/stores/editor/DataCubeEditorState.js +155 -0
  349. package/lib/stores/editor/DataCubeEditorState.js.map +1 -0
  350. package/lib/stores/editor/DataCubeEditorVerticalPivotsPanelState.d.ts +35 -0
  351. package/lib/stores/editor/DataCubeEditorVerticalPivotsPanelState.d.ts.map +1 -0
  352. package/lib/stores/editor/DataCubeEditorVerticalPivotsPanelState.js +58 -0
  353. package/lib/stores/editor/DataCubeEditorVerticalPivotsPanelState.js.map +1 -0
  354. package/lib/stores/engine/DataCubeApplicationEngine.d.ts +55 -0
  355. package/lib/stores/engine/DataCubeApplicationEngine.d.ts.map +1 -0
  356. package/lib/stores/engine/DataCubeApplicationEngine.js +33 -0
  357. package/lib/stores/engine/DataCubeApplicationEngine.js.map +1 -0
  358. package/lib/stores/engine/DataCubeEngine.d.ts +124 -0
  359. package/lib/stores/engine/DataCubeEngine.d.ts.map +1 -0
  360. package/lib/stores/engine/DataCubeEngine.js +182 -0
  361. package/lib/stores/engine/DataCubeEngine.js.map +1 -0
  362. package/lib/stores/engine/DataCubeLayoutManagerState.d.ts +62 -0
  363. package/lib/stores/engine/DataCubeLayoutManagerState.d.ts.map +1 -0
  364. package/lib/stores/engine/DataCubeLayoutManagerState.js +133 -0
  365. package/lib/stores/engine/DataCubeLayoutManagerState.js.map +1 -0
  366. package/lib/stores/engine/DataCubeQuery.d.ts +40 -0
  367. package/lib/stores/engine/DataCubeQuery.d.ts.map +1 -0
  368. package/lib/stores/engine/DataCubeQuery.js +79 -0
  369. package/lib/stores/engine/DataCubeQuery.js.map +1 -0
  370. package/lib/stores/extend/DataCubeColumnEditorState.d.ts +61 -0
  371. package/lib/stores/extend/DataCubeColumnEditorState.d.ts.map +1 -0
  372. package/lib/stores/extend/DataCubeColumnEditorState.js +260 -0
  373. package/lib/stores/extend/DataCubeColumnEditorState.js.map +1 -0
  374. package/lib/stores/extend/DataCubeExtendManagerState.d.ts +46 -0
  375. package/lib/stores/extend/DataCubeExtendManagerState.d.ts.map +1 -0
  376. package/lib/stores/extend/DataCubeExtendManagerState.js +119 -0
  377. package/lib/stores/extend/DataCubeExtendManagerState.js.map +1 -0
  378. package/lib/stores/filter/DataCubeFilterEditorState.d.ts +61 -0
  379. package/lib/stores/filter/DataCubeFilterEditorState.d.ts.map +1 -0
  380. package/lib/stores/filter/DataCubeFilterEditorState.js +228 -0
  381. package/lib/stores/filter/DataCubeFilterEditorState.js.map +1 -0
  382. package/lib/stores/grid/DataCubeGridClientEngine.d.ts +93 -0
  383. package/lib/stores/grid/DataCubeGridClientEngine.d.ts.map +1 -0
  384. package/lib/stores/grid/DataCubeGridClientEngine.js +364 -0
  385. package/lib/stores/grid/DataCubeGridClientEngine.js.map +1 -0
  386. package/lib/stores/grid/DataCubeGridClientExportEngine.d.ts +31 -0
  387. package/lib/stores/grid/DataCubeGridClientExportEngine.d.ts.map +1 -0
  388. package/lib/stores/grid/DataCubeGridClientExportEngine.js +152 -0
  389. package/lib/stores/grid/DataCubeGridClientExportEngine.js.map +1 -0
  390. package/lib/stores/grid/DataCubeGridConfigurationBuilder.d.ts +180 -0
  391. package/lib/stores/grid/DataCubeGridConfigurationBuilder.d.ts.map +1 -0
  392. package/lib/stores/grid/DataCubeGridConfigurationBuilder.js +649 -0
  393. package/lib/stores/grid/DataCubeGridConfigurationBuilder.js.map +1 -0
  394. package/lib/stores/grid/DataCubeGridControllerState.d.ts +89 -0
  395. package/lib/stores/grid/DataCubeGridControllerState.d.ts.map +1 -0
  396. package/lib/stores/grid/DataCubeGridControllerState.js +342 -0
  397. package/lib/stores/grid/DataCubeGridControllerState.js.map +1 -0
  398. package/lib/stores/grid/DataCubeGridMenuBuilder.d.ts +19 -0
  399. package/lib/stores/grid/DataCubeGridMenuBuilder.d.ts.map +1 -0
  400. package/lib/stores/grid/DataCubeGridMenuBuilder.js +687 -0
  401. package/lib/stores/grid/DataCubeGridMenuBuilder.js.map +1 -0
  402. package/lib/stores/grid/DataCubeGridQueryBuilder.d.ts +23 -0
  403. package/lib/stores/grid/DataCubeGridQueryBuilder.d.ts.map +1 -0
  404. package/lib/stores/grid/DataCubeGridQueryBuilder.js +130 -0
  405. package/lib/stores/grid/DataCubeGridQueryBuilder.js.map +1 -0
  406. package/lib/stores/grid/DataCubeGridQuerySnapshotBuilder.d.ts +27 -0
  407. package/lib/stores/grid/DataCubeGridQuerySnapshotBuilder.d.ts.map +1 -0
  408. package/lib/stores/grid/DataCubeGridQuerySnapshotBuilder.js +66 -0
  409. package/lib/stores/grid/DataCubeGridQuerySnapshotBuilder.js.map +1 -0
  410. package/lib/stores/grid/DataCubeGridState.d.ts +55 -0
  411. package/lib/stores/grid/DataCubeGridState.d.ts.map +1 -0
  412. package/lib/stores/grid/DataCubeGridState.js +114 -0
  413. package/lib/stores/grid/DataCubeGridState.js.map +1 -0
  414. package/package.json +89 -0
  415. package/src/application/DataCubeDocumentation.ts +22 -0
  416. package/src/components/DataCube.tsx +157 -0
  417. package/src/components/DataCubeProvider.tsx +58 -0
  418. package/src/components/application/DataCubeAlert.tsx +173 -0
  419. package/src/components/application/DataCubeDocumentationPanel.tsx +42 -0
  420. package/src/components/application/DataCubeLayoutManager.tsx +190 -0
  421. package/src/components/application/DataCubeSettingsPanel.tsx +205 -0
  422. package/src/components/editor/DataCubeEditor.tsx +114 -0
  423. package/src/components/editor/DataCubeEditorColumnPropertiesPanel.tsx +1210 -0
  424. package/src/components/editor/DataCubeEditorColumnsPanel.tsx +121 -0
  425. package/src/components/editor/DataCubeEditorColumnsSelector.tsx +596 -0
  426. package/src/components/editor/DataCubeEditorGeneralPropertiesPanel.tsx +786 -0
  427. package/src/components/editor/DataCubeEditorHorizontalPivotsPanel.tsx +61 -0
  428. package/src/components/editor/DataCubeEditorSortsPanel.tsx +166 -0
  429. package/src/components/editor/DataCubeEditorVerticalPivotsPanel.tsx +43 -0
  430. package/src/components/extend/DataCubeColumnEditor.tsx +366 -0
  431. package/src/components/filter/DataCubeFilterEditor.tsx +907 -0
  432. package/src/components/grid/DataCubeGrid.tsx +384 -0
  433. package/src/components/grid/DataCubeGridShared.tsx +45 -0
  434. package/src/components/shared/DataCubeFormUtils.tsx +574 -0
  435. package/src/components/shared/DataCubePureCodeEditorUtils.tsx +91 -0
  436. package/src/index.tsx +22 -0
  437. package/src/stores/DataCubeState.tsx +100 -0
  438. package/src/stores/DataCubeViewState.ts +129 -0
  439. package/src/stores/core/DataCubeConfiguration.ts +240 -0
  440. package/src/stores/core/DataCubeConfigurationBuilder.ts +66 -0
  441. package/src/stores/core/DataCubeInfoState.ts +61 -0
  442. package/src/stores/core/DataCubeQueryBuilder.ts +296 -0
  443. package/src/stores/core/DataCubeQueryBuilderUtils.ts +514 -0
  444. package/src/stores/core/DataCubeQueryEngine.ts +327 -0
  445. package/src/stores/core/DataCubeQuerySnapshot.ts +191 -0
  446. package/src/stores/core/DataCubeQuerySnapshotBuilder.ts +406 -0
  447. package/src/stores/core/DataCubeQuerySnapshotBuilderUtils.ts +197 -0
  448. package/src/stores/core/DataCubeQuerySnapshotManager.ts +148 -0
  449. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation.ts +47 -0
  450. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Average.tsx +52 -0
  451. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Count.tsx +61 -0
  452. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__First.tsx +57 -0
  453. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__JoinStrings.tsx +81 -0
  454. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Last.tsx +57 -0
  455. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Max.tsx +52 -0
  456. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Min.tsx +52 -0
  457. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevPopulation.tsx +55 -0
  458. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__StdDevSample.tsx +52 -0
  459. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__Sum.tsx +52 -0
  460. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__UniqueValue.tsx +57 -0
  461. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__VariancePopulation.tsx +52 -0
  462. package/src/stores/core/aggregation/DataCubeQueryAggregateOperation__VarianceSample.tsx +52 -0
  463. package/src/stores/core/filter/DataCubeQueryFilterEditorState.ts +231 -0
  464. package/src/stores/core/filter/DataCubeQueryFilterOperation.ts +96 -0
  465. package/src/stores/core/filter/DataCubeQueryFilterOperation__Contain.tsx +88 -0
  466. package/src/stores/core/filter/DataCubeQueryFilterOperation__ContainCaseInsensitive.tsx +94 -0
  467. package/src/stores/core/filter/DataCubeQueryFilterOperation__EndWith.tsx +88 -0
  468. package/src/stores/core/filter/DataCubeQueryFilterOperation__EndWithCaseInsensitive.tsx +94 -0
  469. package/src/stores/core/filter/DataCubeQueryFilterOperation__Equal.tsx +170 -0
  470. package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitive.tsx +94 -0
  471. package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualCaseInsensitiveColumn.tsx +92 -0
  472. package/src/stores/core/filter/DataCubeQueryFilterOperation__EqualColumn.tsx +93 -0
  473. package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThan.tsx +96 -0
  474. package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanColumn.tsx +92 -0
  475. package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqual.tsx +96 -0
  476. package/src/stores/core/filter/DataCubeQueryFilterOperation__GreaterThanOrEqualColumn.tsx +92 -0
  477. package/src/stores/core/filter/DataCubeQueryFilterOperation__IsNotNull.tsx +92 -0
  478. package/src/stores/core/filter/DataCubeQueryFilterOperation__IsNull.tsx +89 -0
  479. package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThan.tsx +96 -0
  480. package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanColumn.tsx +92 -0
  481. package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqual.tsx +96 -0
  482. package/src/stores/core/filter/DataCubeQueryFilterOperation__LessThanOrEqualColumn.tsx +92 -0
  483. package/src/stores/core/filter/DataCubeQueryFilterOperation__NotContain.tsx +91 -0
  484. package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEndWith.tsx +91 -0
  485. package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqual.tsx +101 -0
  486. package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitive.tsx +97 -0
  487. package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualCaseInsensitiveColumn.tsx +95 -0
  488. package/src/stores/core/filter/DataCubeQueryFilterOperation__NotEqualColumn.tsx +96 -0
  489. package/src/stores/core/filter/DataCubeQueryFilterOperation__NotStartWith.tsx +91 -0
  490. package/src/stores/core/filter/DataCubeQueryFilterOperation__StartWith.tsx +88 -0
  491. package/src/stores/core/filter/DataCubeQueryFilterOperation__StartWithCaseInsensitive.tsx +94 -0
  492. package/src/stores/editor/DataCubeEditorColumnPropertiesPanelState.ts +111 -0
  493. package/src/stores/editor/DataCubeEditorColumnsPanelState.ts +198 -0
  494. package/src/stores/editor/DataCubeEditorColumnsSelectorState.ts +115 -0
  495. package/src/stores/editor/DataCubeEditorGeneralPropertiesPanelState.ts +87 -0
  496. package/src/stores/editor/DataCubeEditorHorizontalPivotsPanelState.ts +132 -0
  497. package/src/stores/editor/DataCubeEditorMutableConfiguration.ts +677 -0
  498. package/src/stores/editor/DataCubeEditorPanelState.ts +37 -0
  499. package/src/stores/editor/DataCubeEditorSortsPanelState.ts +147 -0
  500. package/src/stores/editor/DataCubeEditorState.tsx +206 -0
  501. package/src/stores/editor/DataCubeEditorVerticalPivotsPanelState.ts +110 -0
  502. package/src/stores/engine/DataCubeApplicationEngine.tsx +120 -0
  503. package/src/stores/engine/DataCubeEngine.ts +276 -0
  504. package/src/stores/engine/DataCubeLayoutManagerState.ts +184 -0
  505. package/src/stores/engine/DataCubeQuery.ts +130 -0
  506. package/src/stores/extend/DataCubeColumnEditorState.tsx +365 -0
  507. package/src/stores/extend/DataCubeExtendManagerState.tsx +175 -0
  508. package/src/stores/filter/DataCubeFilterEditorState.tsx +327 -0
  509. package/src/stores/grid/DataCubeGridClientEngine.ts +506 -0
  510. package/src/stores/grid/DataCubeGridClientExportEngine.ts +173 -0
  511. package/src/stores/grid/DataCubeGridConfigurationBuilder.tsx +940 -0
  512. package/src/stores/grid/DataCubeGridControllerState.ts +493 -0
  513. package/src/stores/grid/DataCubeGridMenuBuilder.tsx +861 -0
  514. package/src/stores/grid/DataCubeGridQueryBuilder.ts +195 -0
  515. package/src/stores/grid/DataCubeGridQuerySnapshotBuilder.ts +125 -0
  516. package/src/stores/grid/DataCubeGridState.ts +155 -0
  517. package/tsconfig.json +164 -0
@@ -0,0 +1,940 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /***************************************************************************************
18
+ * [GRID]
19
+ *
20
+ * These are utilities used to build the configuration for the grid client,
21
+ * AG Grid, from the query snapshot.
22
+ ***************************************************************************************/
23
+
24
+ import {
25
+ _findCol,
26
+ type DataCubeQuerySnapshot,
27
+ type DataCubeQuerySnapshotColumn,
28
+ } from '../core/DataCubeQuerySnapshot.js';
29
+ import type {
30
+ ColDef,
31
+ ColGroupDef,
32
+ GridOptions,
33
+ ICellRendererParams,
34
+ } from '@ag-grid-community/core';
35
+ import {
36
+ GridClientSortDirection,
37
+ INTERNAL__GRID_CLIENT_COLUMN_MIN_WIDTH,
38
+ INTERNAL__GridClientUtilityCssClassName,
39
+ generateFontFamilyUtilityClassName,
40
+ generateFontSizeUtilityClassName,
41
+ generateFontUnderlineUtilityClassName,
42
+ generateTextAlignUtilityClassName,
43
+ generateTextColorUtilityClassName,
44
+ generateBackgroundColorUtilityClassName,
45
+ generateFontCaseUtilityClassName,
46
+ GridClientPinnedAlignement,
47
+ INTERNAL__GRID_CLIENT_ROW_HEIGHT,
48
+ INTERNAL__GRID_CLIENT_AUTO_RESIZE_PADDING,
49
+ INTERNAL__GRID_CLIENT_HEADER_HEIGHT,
50
+ INTERNAL__GRID_CLIENT_TOOLTIP_SHOW_DELAY,
51
+ INTERNAL__GRID_CLIENT_SIDE_BAR_WIDTH,
52
+ INTERNAL__GRID_CLIENT_ROW_GROUPING_COUNT_AGG_COLUMN_ID,
53
+ INTERNAL__GRID_CLIENT_MISSING_VALUE,
54
+ INTERNAL__GRID_CLIENT_DATA_FETCH_MANUAL_TRIGGER_COLUMN_ID,
55
+ INTERNAL__GRID_CLIENT_PIVOT_COLUMN_GROUP_COLOR_ROTATION_SIZE,
56
+ INTERNAL__GRID_CLIENT_TREE_COLUMN_ID,
57
+ } from './DataCubeGridClientEngine.js';
58
+ import {
59
+ getNonNullableEntry,
60
+ getNullableLastEntry,
61
+ getQueryParameters,
62
+ getQueryParameterValue,
63
+ guaranteeNonNullable,
64
+ isNonNullable,
65
+ isNullable,
66
+ isNumber,
67
+ isValidUrl,
68
+ } from '@finos/legend-shared';
69
+ import type {
70
+ DataCubeColumnConfiguration,
71
+ DataCubeConfiguration,
72
+ } from '../core/DataCubeConfiguration.js';
73
+ import {
74
+ DataCubeColumnDataType,
75
+ DataCubeColumnPinPlacement,
76
+ DataCubeNumberScale,
77
+ DEFAULT_ROW_BUFFER,
78
+ DEFAULT_URL_LABEL_QUERY_PARAM,
79
+ getDataType,
80
+ DataCubeQuerySortOperator,
81
+ DataCubeColumnKind,
82
+ DEFAULT_MISSING_VALUE_DISPLAY_TEXT,
83
+ PIVOT_COLUMN_NAME_VALUE_SEPARATOR,
84
+ isPivotResultColumnName,
85
+ } from '../core/DataCubeQueryEngine.js';
86
+ import type { CustomLoadingCellRendererProps } from '@ag-grid-community/react';
87
+ import { DataCubeIcon } from '@finos/legend-art';
88
+ import type { DataCubeViewState } from '../DataCubeViewState.js';
89
+
90
+ // --------------------------------- UTILITIES ---------------------------------
91
+
92
+ function scaleNumber(
93
+ value: number,
94
+ type: DataCubeNumberScale | undefined,
95
+ ): { value: number; unit: string | undefined } {
96
+ switch (type) {
97
+ case DataCubeNumberScale.PERCENT:
98
+ return { value: value * 1e2, unit: '%' };
99
+ case DataCubeNumberScale.BASIS_POINT:
100
+ return { value: value * 1e4, unit: 'bp' };
101
+ case DataCubeNumberScale.THOUSANDS:
102
+ return { value: value / 1e3, unit: 'k' };
103
+ case DataCubeNumberScale.MILLIONS:
104
+ return { value: value / 1e6, unit: 'm' };
105
+ case DataCubeNumberScale.BILLIONS:
106
+ return { value: value / 1e9, unit: 'b' };
107
+ case DataCubeNumberScale.TRILLIONS:
108
+ return { value: value / 1e12, unit: 't' };
109
+ case DataCubeNumberScale.AUTO:
110
+ return scaleNumber(
111
+ value,
112
+ value >= 1e12
113
+ ? DataCubeNumberScale.TRILLIONS
114
+ : value >= 1e9
115
+ ? DataCubeNumberScale.BILLIONS
116
+ : value >= 1e6
117
+ ? DataCubeNumberScale.MILLIONS
118
+ : value >= 1e3
119
+ ? DataCubeNumberScale.THOUSANDS
120
+ : undefined,
121
+ );
122
+ default:
123
+ return { value, unit: undefined };
124
+ }
125
+ }
126
+
127
+ function DataCubeGridLoadingCellRenderer(
128
+ props: CustomLoadingCellRendererProps,
129
+ ) {
130
+ if (props.node.failedLoad) {
131
+ return <span className="inline-flex items-center">#ERR</span>;
132
+ }
133
+ return (
134
+ <span className="inline-flex items-center">
135
+ <DataCubeIcon.Loader className="mr-1 animate-spin stroke-2" />
136
+ Loading
137
+ </span>
138
+ );
139
+ }
140
+
141
+ // --------------------------------- BUILDING BLOCKS ---------------------------------
142
+
143
+ type ColumnData = {
144
+ name: string;
145
+ snapshot: DataCubeQuerySnapshot;
146
+ column: DataCubeColumnConfiguration;
147
+ configuration: DataCubeConfiguration;
148
+ };
149
+
150
+ function getCellRenderer(columnData: ColumnData) {
151
+ const { column } = columnData;
152
+ const dataType = getDataType(column.type);
153
+ if (dataType === DataCubeColumnDataType.TEXT && column.displayAsLink) {
154
+ return function LinkRenderer(params: ICellRendererParams) {
155
+ const isUrl = isValidUrl(params.value);
156
+ if (!isUrl) {
157
+ return params.value;
158
+ }
159
+ const url = params.value as string;
160
+ const label = getQueryParameterValue(
161
+ column.linkLabelParameter ?? DEFAULT_URL_LABEL_QUERY_PARAM,
162
+ getQueryParameters(url, true),
163
+ );
164
+ return (
165
+ <a
166
+ href={url}
167
+ target="_blank"
168
+ rel="noreferrer"
169
+ className="text-blue-600 underline"
170
+ >
171
+ {label ?? url}
172
+ </a>
173
+ );
174
+ };
175
+ }
176
+ return null;
177
+ }
178
+
179
+ function _displaySpec(columnData: ColumnData) {
180
+ const { name, snapshot, column, configuration } = columnData;
181
+ const dataType = getDataType(column.type);
182
+
183
+ const fontFamily = column.fontFamily ?? configuration.fontFamily;
184
+ const fontSize = column.fontSize ?? configuration.fontSize;
185
+ const fontBold = column.fontBold ?? configuration.fontBold;
186
+ const fontItalic = column.fontItalic ?? configuration.fontItalic;
187
+ const fontStrikethrough =
188
+ column.fontStrikethrough ?? configuration.fontStrikethrough;
189
+ const fontUnderline = column.fontUnderline ?? configuration.fontUnderline;
190
+ const fontCase = column.fontCase ?? configuration.fontCase;
191
+ const textAlign = column.textAlign ?? configuration.textAlign;
192
+ const normalForegroundColor =
193
+ column.normalForegroundColor ?? configuration.normalForegroundColor;
194
+ const normalBackgroundColor =
195
+ column.normalBackgroundColor ?? configuration.normalBackgroundColor;
196
+
197
+ const negativeForegroundColor =
198
+ column.negativeForegroundColor ?? configuration.negativeForegroundColor;
199
+ const negativeBackgroundColor =
200
+ column.negativeBackgroundColor ?? configuration.negativeBackgroundColor;
201
+ const zeroForegroundColor =
202
+ column.zeroForegroundColor ?? configuration.zeroForegroundColor;
203
+ const zeroBackgroundColor =
204
+ column.zeroBackgroundColor ?? configuration.zeroBackgroundColor;
205
+ const errorForegroundColor =
206
+ column.errorForegroundColor ?? configuration.errorForegroundColor;
207
+ const errorBackgroundColor =
208
+ column.errorBackgroundColor ?? configuration.errorBackgroundColor;
209
+ return {
210
+ // disabling cell data type inference can grid performance
211
+ // especially when this information is only necessary for cell value editor
212
+ cellDataType: false,
213
+ hide:
214
+ column.hideFromView ||
215
+ !column.isSelected ||
216
+ Boolean(
217
+ snapshot.data.pivot &&
218
+ !snapshot.data.pivot.castColumns.find((col) => col.name === name),
219
+ ),
220
+ lockVisible:
221
+ !column.isSelected ||
222
+ Boolean(
223
+ snapshot.data.pivot &&
224
+ !snapshot.data.pivot.castColumns.find((col) => col.name === name),
225
+ ),
226
+ pinned:
227
+ column.pinned !== undefined
228
+ ? column.pinned === DataCubeColumnPinPlacement.RIGHT
229
+ ? GridClientPinnedAlignement.RIGHT
230
+ : GridClientPinnedAlignement.LEFT
231
+ : null,
232
+ headerClass: isPivotResultColumnName(name)
233
+ ? 'pl-1 border border-neutral-300'
234
+ : 'pl-1 border border-neutral-200',
235
+ cellClassRules: {
236
+ [generateFontFamilyUtilityClassName(fontFamily)]: () => true,
237
+ [generateFontSizeUtilityClassName(fontSize)]: () => true,
238
+ [INTERNAL__GridClientUtilityCssClassName.FONT_BOLD]: () => fontBold,
239
+ [INTERNAL__GridClientUtilityCssClassName.FONT_ITALIC]: () => fontItalic,
240
+ [INTERNAL__GridClientUtilityCssClassName.FONT_STRIKETHROUGH]: () =>
241
+ fontStrikethrough,
242
+ [generateFontUnderlineUtilityClassName(fontUnderline)]: () =>
243
+ Boolean(fontUnderline),
244
+ [generateFontCaseUtilityClassName(fontCase)]: (params) =>
245
+ dataType === DataCubeColumnDataType.TEXT && Boolean(fontCase),
246
+ [generateTextAlignUtilityClassName(textAlign)]: () => true,
247
+ [generateTextColorUtilityClassName(normalForegroundColor, 'normal')]:
248
+ () => true,
249
+ [generateBackgroundColorUtilityClassName(
250
+ normalBackgroundColor,
251
+ 'normal',
252
+ )]: () => true,
253
+ [generateTextColorUtilityClassName(zeroForegroundColor, 'zero')]: (
254
+ params,
255
+ ) =>
256
+ dataType === DataCubeColumnDataType.NUMBER &&
257
+ isNumber(params.value) &&
258
+ params.value === 0,
259
+ [generateBackgroundColorUtilityClassName(zeroBackgroundColor, 'zero')]: (
260
+ params,
261
+ ) =>
262
+ dataType === DataCubeColumnDataType.NUMBER &&
263
+ isNumber(params.value) &&
264
+ params.value === 0,
265
+ [generateTextColorUtilityClassName(negativeForegroundColor, 'negative')]:
266
+ (params) =>
267
+ dataType === DataCubeColumnDataType.NUMBER &&
268
+ isNumber(params.value) &&
269
+ params.value < 0,
270
+ [generateBackgroundColorUtilityClassName(
271
+ negativeBackgroundColor,
272
+ 'negative',
273
+ )]: (params) =>
274
+ dataType === DataCubeColumnDataType.NUMBER &&
275
+ isNumber(params.value) &&
276
+ params.value < 0,
277
+ [generateTextColorUtilityClassName(errorForegroundColor, 'error')]: (
278
+ params,
279
+ ) => Boolean(params.node.failedLoad),
280
+ [generateBackgroundColorUtilityClassName(errorBackgroundColor, 'error')]:
281
+ (params) => Boolean(params.node.failedLoad),
282
+ [INTERNAL__GridClientUtilityCssClassName.BLUR]: () => column.blur,
283
+ },
284
+ valueFormatter:
285
+ dataType === DataCubeColumnDataType.NUMBER
286
+ ? (params) => {
287
+ const value = params.value as number | null | undefined;
288
+ if (
289
+ isNullable(value) ||
290
+ (value as unknown as string) ===
291
+ INTERNAL__GRID_CLIENT_MISSING_VALUE
292
+ ) {
293
+ return (
294
+ column.missingValueDisplayText ??
295
+ DEFAULT_MISSING_VALUE_DISPLAY_TEXT
296
+ );
297
+ }
298
+ const showNegativeNumberInParens =
299
+ column.negativeNumberInParens && value < 0;
300
+ // 1. apply the number scale
301
+ const scaledNumber = scaleNumber(value, column.numberScale);
302
+ // 2. apply the number formatter
303
+ const formattedValue = (
304
+ showNegativeNumberInParens
305
+ ? Math.abs(scaledNumber.value)
306
+ : scaledNumber.value
307
+ ).toLocaleString(undefined, {
308
+ useGrouping: column.displayCommas,
309
+ ...(column.decimals !== undefined
310
+ ? {
311
+ minimumFractionDigits: column.decimals,
312
+ maximumFractionDigits: column.decimals,
313
+ }
314
+ : {}),
315
+ });
316
+ // 3. add the parentheses (and then the unit)
317
+ return (
318
+ (showNegativeNumberInParens
319
+ ? `(${formattedValue})`
320
+ : formattedValue) +
321
+ (scaledNumber.unit ? ` ${scaledNumber.unit}` : '')
322
+ );
323
+ }
324
+ : (params) =>
325
+ params.value === INTERNAL__GRID_CLIENT_MISSING_VALUE
326
+ ? (column.missingValueDisplayText ??
327
+ DEFAULT_MISSING_VALUE_DISPLAY_TEXT)
328
+ : params.value,
329
+ tooltipValueGetter: (params) =>
330
+ isNonNullable(params.value) &&
331
+ params.value !== INTERNAL__GRID_CLIENT_MISSING_VALUE
332
+ ? `Value = ${params.value === '' ? "''" : params.value === true ? 'TRUE' : params.value === false ? 'FALSE' : params.value}`
333
+ : `Missing Value`,
334
+ loadingCellRenderer: DataCubeGridLoadingCellRenderer,
335
+ cellRenderer: getCellRenderer(columnData),
336
+ } satisfies ColDef;
337
+ }
338
+
339
+ function _groupDisplaySpec(
340
+ snapshot: DataCubeQuerySnapshot,
341
+ configuration: DataCubeConfiguration,
342
+ ) {
343
+ // TODO?: we can technically alternate the styling based on the column at various drilldown level
344
+ // but for now,we will simply use the same styling as the (default) grid styling
345
+ const fontFamily = configuration.fontFamily;
346
+ const fontSize = configuration.fontSize;
347
+ const fontBold = configuration.fontBold;
348
+ const fontItalic = configuration.fontItalic;
349
+ const fontStrikethrough = configuration.fontStrikethrough;
350
+ const fontUnderline = configuration.fontUnderline;
351
+ const fontCase = configuration.fontCase;
352
+ const textAlign = configuration.textAlign;
353
+ const normalForegroundColor = configuration.normalForegroundColor;
354
+ const normalBackgroundColor = configuration.normalBackgroundColor;
355
+
356
+ return {
357
+ cellDataType: false, // no point in specifying a type here since it can be of multiple types
358
+ hide: !snapshot.data.groupBy,
359
+ lockPosition: true,
360
+ lockPinned: true,
361
+ pinned: GridClientPinnedAlignement.LEFT,
362
+ cellClassRules: {
363
+ [generateFontFamilyUtilityClassName(fontFamily)]: () => true,
364
+ [generateFontSizeUtilityClassName(fontSize)]: () => true,
365
+ [INTERNAL__GridClientUtilityCssClassName.FONT_BOLD]: () => fontBold,
366
+ [INTERNAL__GridClientUtilityCssClassName.FONT_ITALIC]: () => fontItalic,
367
+ [INTERNAL__GridClientUtilityCssClassName.FONT_STRIKETHROUGH]: () =>
368
+ fontStrikethrough,
369
+ [generateFontUnderlineUtilityClassName(fontUnderline)]: () =>
370
+ Boolean(fontUnderline),
371
+ [generateFontCaseUtilityClassName(fontCase)]: (params) =>
372
+ Boolean(fontCase),
373
+ [generateTextAlignUtilityClassName(textAlign)]: () => true,
374
+ [generateTextColorUtilityClassName(normalForegroundColor, 'normal')]:
375
+ () => true,
376
+ [generateBackgroundColorUtilityClassName(
377
+ normalBackgroundColor,
378
+ 'normal',
379
+ )]: () => true,
380
+ },
381
+ tooltipValueGetter: (params) => {
382
+ if (
383
+ isNonNullable(params.value) &&
384
+ params.value !== INTERNAL__GRID_CLIENT_MISSING_VALUE
385
+ ) {
386
+ return (
387
+ `Group Value = ${params.value === '' ? "''" : params.value === true ? 'TRUE' : params.value === false ? 'FALSE' : params.value}` +
388
+ `${params.data[INTERNAL__GRID_CLIENT_ROW_GROUPING_COUNT_AGG_COLUMN_ID] !== undefined ? ` (${params.data[INTERNAL__GRID_CLIENT_ROW_GROUPING_COUNT_AGG_COLUMN_ID]})` : ''}`
389
+ );
390
+ }
391
+ return null;
392
+ },
393
+ loadingCellRenderer: DataCubeGridLoadingCellRenderer,
394
+ } satisfies ColDef;
395
+ }
396
+
397
+ function _sizeSpec(columnData: ColumnData) {
398
+ const { column } = columnData;
399
+ return {
400
+ // NOTE: there is a problem with ag-grid when scrolling horizontally, the header row
401
+ // lags behind the data, it seems to be caused by synchronizing scroll not working properly
402
+ // There is currently, no way around this
403
+ // See https://github.com/ag-grid/ag-grid/issues/5233
404
+ // See https://github.com/ag-grid/ag-grid/issues/7620
405
+ // See https://github.com/ag-grid/ag-grid/issues/6292
406
+ // See https://issues.chromium.org/issues/40890343#comment11
407
+ //
408
+ // TODO: if we support column resize to fit content, should we disable this behavior?
409
+ resizable: column.fixedWidth === undefined,
410
+ suppressAutoSize: column.fixedWidth !== undefined,
411
+ suppressSizeToFit: column.fixedWidth !== undefined,
412
+ width: column.fixedWidth,
413
+ minWidth: Math.max(
414
+ column.minWidth ?? INTERNAL__GRID_CLIENT_COLUMN_MIN_WIDTH,
415
+ INTERNAL__GRID_CLIENT_COLUMN_MIN_WIDTH,
416
+ ),
417
+ maxWidth: column.maxWidth,
418
+ // Make sure the column spans the width if possible so when total width
419
+ // is less than grid width, removing/adding one column will cause the other
420
+ // columns to take/give up space
421
+ flex:
422
+ column.fixedWidth === undefined ? 1 : (undefined as unknown as number),
423
+ } as ColDef;
424
+ }
425
+
426
+ function _sortSpec(columnData: ColumnData) {
427
+ const { name, snapshot } = columnData;
428
+ const sortColumns = snapshot.data.sortColumns;
429
+ const sortCol = _findCol(sortColumns, name);
430
+ return {
431
+ sortable: true, // if this is pivot column, no sorting is supported yet
432
+ sort: sortCol
433
+ ? sortCol.operation === DataCubeQuerySortOperator.ASCENDING
434
+ ? GridClientSortDirection.ASCENDING
435
+ : GridClientSortDirection.DESCENDING
436
+ : null,
437
+ sortIndex: sortCol ? sortColumns.indexOf(sortCol) : null,
438
+ } satisfies ColDef;
439
+ }
440
+
441
+ function _aggregationSpec(columnData: ColumnData) {
442
+ const { name, snapshot, column } = columnData;
443
+ const data = snapshot.data;
444
+ const pivotCol = _findCol(data.pivot?.columns, name);
445
+ const groupByCol = _findCol(data.groupBy?.columns, name);
446
+ const isGroupExtendedColumn = Boolean(
447
+ _findCol(data.groupExtendedColumns, name),
448
+ );
449
+ return {
450
+ enableRowGroup:
451
+ !isGroupExtendedColumn && column.kind === DataCubeColumnKind.DIMENSION,
452
+ rowGroup: !isGroupExtendedColumn && Boolean(groupByCol),
453
+ rowGroupIndex:
454
+ !isGroupExtendedColumn && groupByCol
455
+ ? (data.groupBy?.columns.indexOf(groupByCol) ?? null)
456
+ : null,
457
+ enablePivot:
458
+ !isGroupExtendedColumn && column.kind === DataCubeColumnKind.DIMENSION,
459
+ pivot: !isGroupExtendedColumn && Boolean(pivotCol),
460
+ pivotIndex:
461
+ !isGroupExtendedColumn && pivotCol
462
+ ? (data.pivot?.columns.indexOf(pivotCol) ?? null)
463
+ : null,
464
+ // NOTE: we don't quite care about populating these accurately
465
+ // since ag-grid aggregation does not support parameters, so
466
+ // its set of supported aggregators will never match that specified
467
+ // in the editor. But we MUST set this to make sure sorting works
468
+ // when row grouping is used, so we need to set a non-null value here.
469
+ aggFunc: !isGroupExtendedColumn ? column.aggregateOperator : null,
470
+ enableValue: false, // disable GUI interactions to modify this column's aggregate function
471
+ allowedAggFuncs: [], // disable GUI for options of the agg functions
472
+ } satisfies ColDef;
473
+ }
474
+
475
+ // --------------------------------- MAIN ---------------------------------
476
+
477
+ export function generateBaseGridOptions(view: DataCubeViewState): GridOptions {
478
+ const grid = view.grid;
479
+
480
+ return {
481
+ // -------------------------------------- README --------------------------------------
482
+ // NOTE: we observe performance degradataion when configuring the grid via React component
483
+ // props when the options is non-static, i.e. changed when the query configuration changes.
484
+ // As such, we must ONLY ADD STATIC CONFIGURATION HERE, and dynamic configuration should be
485
+ // programatically updated when the query is modified.
486
+ //
487
+ //
488
+ // -------------------------------------- ROW GROUPING --------------------------------------
489
+ rowGroupPanelShow: 'always',
490
+ // use the auto-generated group column to make it work with pivot mode
491
+ // See https://github.com/ag-grid/ag-grid/issues/8088
492
+ groupDisplayType: 'singleColumn',
493
+ suppressRowGroupHidesColumns: true, // keeps the column set stable even when row grouping is used
494
+ suppressAggFuncInHeader: true, // keeps the columns stable when aggregation is used
495
+ getChildCount: (data) =>
496
+ data[INTERNAL__GRID_CLIENT_ROW_GROUPING_COUNT_AGG_COLUMN_ID],
497
+ // -------------------------------------- PIVOT --------------------------------------
498
+ // NOTE: when enabled, pivot mode will show the pivot panel (allowing drag and drop)
499
+ // and pivot section in column tools panel, but it comes with many restrictions/opinionated
500
+ // behaviors on column grouping: i.e. it disallow full control of column definitions, so we
501
+ // couldn't display dimension columns which are not part of pivot while pivoting.
502
+ //
503
+ // Even setting flag pivotSuppressAutoColumn=true does not seem to remove the column
504
+ // auto-grouping behavior
505
+ //
506
+ // As such, we will just make use of column pivot settings to trigger server-side row
507
+ // model data-fetching when pivot changes, and would opt out from all GUI features
508
+ // that pivot mode offers by disabling pivot mode and will re-assess its usage in the future.
509
+ //
510
+ // pivotMode: Boolean(snapshot.data.pivot),
511
+ // pivotPanelShow: 'always',
512
+ // pivotSuppressAutoColumn: true,
513
+ // -------------------------------------- SORT --------------------------------------
514
+ // Force multi-sorting since this is what the query supports anyway
515
+ alwaysMultiSort: true,
516
+ // -------------------------------------- DISPLAY --------------------------------------
517
+ rowHeight: INTERNAL__GRID_CLIENT_ROW_HEIGHT,
518
+ headerHeight: INTERNAL__GRID_CLIENT_HEADER_HEIGHT,
519
+ noRowsOverlayComponent: () => (
520
+ <div className="flex items-center border-[1.5px] border-neutral-300 p-2 font-medium text-neutral-400">
521
+ <div>
522
+ <DataCubeIcon.WarningCircle className="mr-1 stroke-2 text-lg" />
523
+ </div>
524
+ 0 rows
525
+ </div>
526
+ ),
527
+ loadingOverlayComponent: () => (
528
+ <div className="flex items-center border-[1.5px] border-neutral-300 p-2 font-medium text-neutral-400">
529
+ <div>
530
+ <DataCubeIcon.Loader className="mr-1 animate-spin stroke-2 text-lg" />
531
+ </div>
532
+ Loading...
533
+ </div>
534
+ ),
535
+ // Show cursor position when scrolling
536
+ onBodyScroll: (event) => {
537
+ const rowCount = event.api.getDisplayedRowCount();
538
+ const range = event.api.getVerticalPixelRange();
539
+ const start = Math.max(
540
+ 1,
541
+ Math.ceil(range.top / INTERNAL__GRID_CLIENT_ROW_HEIGHT) + 1,
542
+ );
543
+ const end = Math.min(
544
+ rowCount,
545
+ Math.floor(range.bottom / INTERNAL__GRID_CLIENT_ROW_HEIGHT),
546
+ );
547
+ grid.setScrollHintText(`${start}-${end}/${rowCount}`);
548
+ event.api.hidePopupMenu(); // hide context-menu while scrolling
549
+ },
550
+ onBodyScrollEnd: () => grid.setScrollHintText(undefined),
551
+ scrollbarWidth: 10,
552
+ alwaysShowVerticalScroll: true, // this is needed to ensure column resize calculation is accurate
553
+ // -------------------------------------- CONTEXT MENU --------------------------------------
554
+ preventDefaultOnContextMenu: true, // prevent showing the browser's context menu
555
+ columnMenu: 'new', // ensure context menu works on header
556
+ // NOTE: dynamically generate the content of the context menu to make sure the items are not stale
557
+ getContextMenuItems: (params) =>
558
+ grid.controller.menuBuilder?.(params, false) ?? [],
559
+ getMainMenuItems: (params) =>
560
+ grid.controller.menuBuilder?.(params, true) ?? [],
561
+ // NOTE: when right-clicking empty space in the header, a menu will show up
562
+ // with 2 default options: 'Choose Columns` and `Reset Columns`, which is not
563
+ // a desired behavior, so we hide the popup menu immediately
564
+ onColumnMenuVisibleChanged: (event) => {
565
+ if (!event.column) {
566
+ const menuElement = document.querySelector(
567
+ `.${INTERNAL__GridClientUtilityCssClassName.ROOT} .ag-popup .ag-menu`,
568
+ ) as HTMLElement | undefined;
569
+ if (menuElement) {
570
+ menuElement.style.display = 'none';
571
+ }
572
+ event.api.hidePopupMenu();
573
+ }
574
+ },
575
+ // -------------------------------------- COLUMN SIZING --------------------------------------
576
+ autoSizePadding: INTERNAL__GRID_CLIENT_AUTO_RESIZE_PADDING,
577
+ // ensure columns are resized to fit the grid width initially and on window resize
578
+ // NOTE: this has to be used with `alwaysShowVerticalScroll` to ensure accurate sizing
579
+ // otherwise on initial load, the computation will be done when no data is rendered,
580
+ // so when data is rendered and the vertical scrollbar shows up, it will block a part of
581
+ // the last column.
582
+ autoSizeStrategy: {
583
+ type: 'fitGridWidth',
584
+ },
585
+ onGridSizeChanged: (event) => {
586
+ event.api.sizeColumnsToFit();
587
+ },
588
+ // -------------------------------------- TOOLTIP --------------------------------------
589
+ tooltipShowDelay: INTERNAL__GRID_CLIENT_TOOLTIP_SHOW_DELAY,
590
+ // though this is a nice behavior to have enabled, ag-grid not dismissing tooltip
591
+ // when context-menu is triggered makes it an undesirable interaction.
592
+ tooltipInteraction: false,
593
+ // -------------------------------------- COLUMN MOVING --------------------------------------
594
+ suppressDragLeaveHidesColumns: true, // disable this since it's quite easy to accidentally hide columns while moving
595
+ // -------------------------------------- SERVER SIDE ROW MODEL --------------------------------------
596
+ suppressScrollOnNewData: true,
597
+ suppressServerSideFullWidthLoadingRow: true, // make sure each column has its own loading indicator instead of the whole row
598
+ // -------------------------------------- SELECTION --------------------------------------
599
+ cellSelection: true,
600
+ // -------------------------------------- SIDEBAR --------------------------------------
601
+ sideBar: {
602
+ toolPanels: [
603
+ {
604
+ id: 'columns',
605
+ labelDefault: 'Columns',
606
+ labelKey: 'columns',
607
+ iconKey: 'columns',
608
+ toolPanel: 'agColumnsToolPanel',
609
+ minWidth: INTERNAL__GRID_CLIENT_SIDE_BAR_WIDTH,
610
+ width: INTERNAL__GRID_CLIENT_SIDE_BAR_WIDTH,
611
+ toolPanelParams: {
612
+ suppressValues: true,
613
+ suppressPivotMode: true,
614
+ },
615
+ },
616
+ ],
617
+ position: 'right',
618
+ },
619
+ allowDragFromColumnsToolPanel: true,
620
+ // -------------------------------------- PERFORMANCE --------------------------------------
621
+ animateRows: false, // improve performance
622
+ suppressColumnMoveAnimation: true, // improve performance
623
+ };
624
+ }
625
+
626
+ function generatePivotResultColumnHeaderTooltip(
627
+ id: string,
628
+ snapshot: DataCubeQuerySnapshot,
629
+ configuration: DataCubeConfiguration,
630
+ ) {
631
+ const values = id.split(PIVOT_COLUMN_NAME_VALUE_SEPARATOR);
632
+ if (
633
+ !snapshot.data.pivot ||
634
+ values.length > snapshot.data.pivot.columns.length + 1
635
+ ) {
636
+ return values.join(' / ');
637
+ }
638
+ if (values.length === snapshot.data.pivot.columns.length + 1) {
639
+ const baseColumnName = guaranteeNonNullable(values[values.length - 1]);
640
+ const columnConfiguration = _findCol(configuration.columns, baseColumnName);
641
+ return `Column = ${
642
+ columnConfiguration
643
+ ? columnConfiguration.displayName
644
+ ? `${columnConfiguration.displayName} (${columnConfiguration.name})`
645
+ : columnConfiguration.name
646
+ : baseColumnName
647
+ } ~ [ ${snapshot.data.pivot.columns.map((col, i) => `${_findCol(configuration.columns, col.name)?.displayName ?? col.name} = ${values[i]}`).join(', ')} ]`;
648
+ }
649
+ return `[ ${snapshot.data.pivot.columns
650
+ .slice(0, values.length)
651
+ .map(
652
+ (col, i) =>
653
+ `${_findCol(configuration.columns, col.name)?.displayName ?? col.name} = ${values[i]}`,
654
+ )
655
+ .join(', ')} ]`;
656
+ }
657
+
658
+ function generateDefinitionForPivotResultColumns(
659
+ pivotResultColumns: DataCubeQuerySnapshotColumn[],
660
+ snapshot: DataCubeQuerySnapshot,
661
+ configuration: DataCubeConfiguration,
662
+ view: DataCubeViewState,
663
+ ) {
664
+ const columns = pivotResultColumns
665
+ .map((col) => ({
666
+ ...col,
667
+ values: col.name.split(PIVOT_COLUMN_NAME_VALUE_SEPARATOR),
668
+ }))
669
+ .filter((col) => col.values.length > 1);
670
+
671
+ const columnDefs: ColGroupDef[] = [];
672
+
673
+ columns.forEach((col) => {
674
+ const groups: ColGroupDef[] = [];
675
+ let leaf: ColDef | undefined = undefined;
676
+ let id = '';
677
+ for (let i = 0; i < col.values.length; i++) {
678
+ const value = getNonNullableEntry(col.values, i);
679
+ id =
680
+ id === ''
681
+ ? getNonNullableEntry(col.values, i)
682
+ : `${id}${PIVOT_COLUMN_NAME_VALUE_SEPARATOR}${value}`;
683
+
684
+ if (i !== col.values.length - 1) {
685
+ groups.push({
686
+ groupId: id,
687
+ children: [],
688
+ suppressColumnsToolPanel: true,
689
+ headerName: value,
690
+ headerTooltip: generatePivotResultColumnHeaderTooltip(
691
+ id,
692
+ snapshot,
693
+ configuration,
694
+ ),
695
+ } satisfies ColGroupDef);
696
+ } else {
697
+ const column = _findCol(configuration.columns, value);
698
+ if (column) {
699
+ const columnData = {
700
+ name: col.name,
701
+ snapshot,
702
+ column,
703
+ configuration,
704
+ };
705
+ leaf = {
706
+ headerName: column.displayName ?? column.name,
707
+ colId: col.name,
708
+ field: col.name,
709
+ menuTabs: [],
710
+
711
+ ..._displaySpec(columnData),
712
+ ..._sizeSpec(columnData),
713
+
714
+ // disallow pinning and moving pivot result columns
715
+ pinned: false,
716
+ lockPinned: true,
717
+ lockPosition: true,
718
+ suppressColumnsToolPanel: true, // hide from column tool panel
719
+ headerTooltip: generatePivotResultColumnHeaderTooltip(
720
+ id,
721
+ snapshot,
722
+ configuration,
723
+ ),
724
+ } satisfies ColDef;
725
+ }
726
+ }
727
+ }
728
+
729
+ let currentCollection: (ColDef | ColGroupDef)[] = columnDefs;
730
+ groups.forEach((group) => {
731
+ const existingGroup = currentCollection.find(
732
+ (collection) =>
733
+ 'groupId' in collection && collection.groupId === group.groupId,
734
+ );
735
+ if (existingGroup) {
736
+ currentCollection = (existingGroup as ColGroupDef).children;
737
+ } else {
738
+ const newGroup = {
739
+ ...group,
740
+ headerClass: `${INTERNAL__GridClientUtilityCssClassName.PIVOT_COLUMN_GROUP} ${INTERNAL__GridClientUtilityCssClassName.PIVOT_COLUMN_GROUP_PREFIX}${currentCollection.length % INTERNAL__GRID_CLIENT_PIVOT_COLUMN_GROUP_COLOR_ROTATION_SIZE}`,
741
+ } satisfies ColGroupDef;
742
+ currentCollection.push(newGroup);
743
+ currentCollection = newGroup.children;
744
+ }
745
+ });
746
+
747
+ if (leaf) {
748
+ currentCollection.push(leaf);
749
+
750
+ // sort the leaf level columns based on the order of selected/configuration columns
751
+ (currentCollection as ColDef[]).sort((a, b) => {
752
+ const colAName = getNullableLastEntry(
753
+ a.colId?.split(PIVOT_COLUMN_NAME_VALUE_SEPARATOR) ?? [],
754
+ );
755
+ const colAConf = colAName
756
+ ? _findCol(configuration.columns, colAName)
757
+ : undefined;
758
+ const colBName = getNullableLastEntry(
759
+ b.colId?.split(PIVOT_COLUMN_NAME_VALUE_SEPARATOR) ?? [],
760
+ );
761
+ const colBConf = colBName
762
+ ? _findCol(configuration.columns, colBName)
763
+ : undefined;
764
+ return (
765
+ (colAConf
766
+ ? configuration.columns.indexOf(colAConf)
767
+ : Number.MAX_VALUE) -
768
+ (colBConf
769
+ ? configuration.columns.indexOf(colBConf)
770
+ : Number.MAX_VALUE)
771
+ );
772
+ });
773
+ }
774
+ });
775
+
776
+ return columnDefs;
777
+ }
778
+
779
+ export function generateColumnDefs(
780
+ snapshot: DataCubeQuerySnapshot,
781
+ configuration: DataCubeConfiguration,
782
+ view: DataCubeViewState,
783
+ ) {
784
+ // NOTE: only show columns which are fetched in select() as we
785
+ // can't solely rely on column selection because of certain restrictions
786
+ // from ag-grid, e.g. in the case of row grouping tree column: the columns
787
+ // which are grouped must be present in the column definitions, so even
788
+ // when some of these might not be selected explicitly by the users, they
789
+ // must still be included in the column definitions, and made hidden instead.
790
+ const columns = configuration.columns.filter((col) =>
791
+ snapshot.data.selectColumns.find((column) => column.name === col.name),
792
+ );
793
+ let pivotResultColumns: DataCubeQuerySnapshotColumn[] = [];
794
+
795
+ if (snapshot.data.pivot) {
796
+ const castColumns = snapshot.data.pivot.castColumns;
797
+ pivotResultColumns = castColumns.filter((col) =>
798
+ isPivotResultColumnName(col.name),
799
+ );
800
+ }
801
+
802
+ return [
803
+ // NOTE: Internal column used for programatically trigger data fetch when filter is modified
804
+ {
805
+ colId: INTERNAL__GRID_CLIENT_DATA_FETCH_MANUAL_TRIGGER_COLUMN_ID,
806
+ hide: true,
807
+ enableValue: false, // disable GUI interactions to modify this column's aggregate function
808
+ allowedAggFuncs: [], // disable GUI for options of the agg functions
809
+ enablePivot: false,
810
+ enableRowGroup: false,
811
+ filter: 'agTextColumnFilter',
812
+ suppressColumnsToolPanel: true,
813
+ },
814
+ ...generateDefinitionForPivotResultColumns(
815
+ pivotResultColumns,
816
+ snapshot,
817
+ configuration,
818
+ view,
819
+ ),
820
+ ...columns.map((column) => {
821
+ const columnData = {
822
+ name: column.name,
823
+ snapshot,
824
+ column,
825
+ configuration,
826
+ };
827
+ return {
828
+ headerName: column.displayName ?? column.name,
829
+ headerTooltip: `Column = ${
830
+ column.displayName
831
+ ? `${column.displayName} (${column.name})`
832
+ : column.name
833
+ }`,
834
+ suppressSpanHeaderHeight: true,
835
+ colId: column.name,
836
+ field: column.name,
837
+ menuTabs: [],
838
+
839
+ ..._displaySpec(columnData),
840
+ ..._sizeSpec(columnData),
841
+ ..._sortSpec(columnData),
842
+ ..._aggregationSpec(columnData),
843
+ } satisfies ColDef;
844
+ }),
845
+ ] satisfies (ColDef | ColGroupDef)[];
846
+ }
847
+
848
+ export function generateGridOptionsFromSnapshot(
849
+ snapshot: DataCubeQuerySnapshot,
850
+ configuration: DataCubeConfiguration,
851
+ view: DataCubeViewState,
852
+ ): GridOptions {
853
+ const gridOptions = {
854
+ /**
855
+ * NOTE: there is a strange issue where if we put dynamic configuration directly
856
+ * such as rowClassRules which depends on some changing state (e.g. alternateRows)
857
+ * as the grid component's props, the grid performance will be heavily compromised
858
+ * while if we programatically set it like this, it does not seem so taxing to the
859
+ * performance; perhaps something to do with React component rendering on props change
860
+ * so in general for grid options which are not static, we must configure them here
861
+ */
862
+ rowClassRules: configuration.alternateRows
863
+ ? {
864
+ [INTERNAL__GridClientUtilityCssClassName.HIGHLIGHT_ROW]: (params) =>
865
+ params.rowIndex % (configuration.alternateRowsCount * 2) >=
866
+ configuration.alternateRowsCount,
867
+ }
868
+ : {},
869
+ rowBuffer: DEFAULT_ROW_BUFFER,
870
+
871
+ // -------------------------------------- EVENT HANDLERS --------------------------------------
872
+ // NOTE: make sure the event source must not be 'api' since these handlers are meant for direct
873
+ // user interaction with the grid. Actions through context menu (i.e. grid controller) or programatic
874
+ // update of the grid options due to change in query snapshot should not trigger these handlers.
875
+
876
+ onColumnPinned: (event) => {
877
+ if (event.source !== 'api' && event.column) {
878
+ const column = event.column;
879
+ const pinned = column.getPinned();
880
+ view.grid.controller.pinColumn(
881
+ column.getColId(),
882
+ pinned === null
883
+ ? undefined
884
+ : pinned === GridClientPinnedAlignement.LEFT
885
+ ? DataCubeColumnPinPlacement.LEFT
886
+ : DataCubeColumnPinPlacement.RIGHT,
887
+ );
888
+ }
889
+ },
890
+
891
+ onColumnMoved: (event) => {
892
+ // make sure the move event is finished before syncing the changes
893
+ if (event.source !== 'api' && event.column && event.finished) {
894
+ view.grid.controller.rearrangeColumns(
895
+ (event.api.getColumnDefs() ?? [])
896
+ .filter((col): col is ColDef => !('children' in col))
897
+ .map((col) => col.colId ?? ''),
898
+ );
899
+ }
900
+ },
901
+
902
+ onColumnVisible: (event) => {
903
+ if (event.source !== 'api' && event.column) {
904
+ const column = event.column;
905
+ const isVisible = column.isVisible();
906
+ view.grid.controller.showColumn(column.getColId(), isVisible);
907
+ }
908
+ },
909
+
910
+ // -------------------------------------- COLUMNS --------------------------------------
911
+
912
+ columnDefs: generateColumnDefs(snapshot, configuration, view),
913
+ autoGroupColumnDef: {
914
+ // NOTE: the column ID here is set for explicitness, but this is not something ag-grid
915
+ // allows setting for auto-group column, for more advanced use cases, we might want to
916
+ // look into custom group columns
917
+ // See https://www.ag-grid.com/react-data-grid/grouping-custom-group-columns/
918
+ colId: INTERNAL__GRID_CLIENT_TREE_COLUMN_ID,
919
+ headerName: '',
920
+ cellRenderer: 'agGroupCellRenderer',
921
+
922
+ // display
923
+ ..._groupDisplaySpec(snapshot, configuration),
924
+
925
+ // size
926
+ suppressAutoSize: true,
927
+ suppressSizeToFit: true,
928
+ minWidth: 200,
929
+
930
+ // sorting
931
+ sortable: true,
932
+
933
+ // aggregation
934
+ showRowGroup: true,
935
+ suppressSpanHeaderHeight: true,
936
+ } satisfies ColDef,
937
+ } satisfies GridOptions;
938
+
939
+ return gridOptions;
940
+ }