@finos/legend-query-builder 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. package/lib/components/QueryBuilder.d.ts +1 -0
  2. package/lib/components/QueryBuilder.d.ts.map +1 -1
  3. package/lib/components/QueryBuilder.js +11 -2
  4. package/lib/components/QueryBuilder.js.map +1 -1
  5. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +23 -0
  6. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -0
  7. package/lib/components/QueryBuilderConstantExpressionPanel.js +104 -0
  8. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -0
  9. package/lib/components/QueryBuilderDiffPanel.d.ts +1 -0
  10. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  11. package/lib/components/QueryBuilderDiffPanel.js +1 -2
  12. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  13. package/lib/components/QueryBuilderParametersPanel.d.ts +1 -9
  14. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  15. package/lib/components/QueryBuilderParametersPanel.js +8 -26
  16. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  17. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +1 -0
  18. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  19. package/lib/components/QueryBuilderPropertyExpressionEditor.js +60 -12
  20. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  21. package/lib/components/QueryBuilderResultPanel.d.ts +1 -0
  22. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  23. package/lib/components/QueryBuilderSideBar.d.ts +3 -1
  24. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderSideBar.js +6 -14
  26. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  27. package/lib/components/QueryBuilderTextEditor.d.ts +1 -0
  28. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  29. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +1 -0
  30. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  31. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +1 -0
  32. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  33. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +1 -0
  34. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  35. package/lib/components/explorer/QueryBuilderMilestoningEditor.js +12 -18
  36. package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
  37. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +1 -0
  38. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  39. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +1 -0
  40. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  41. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -0
  42. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  43. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.d.ts → QueryBuilderOLAPGroupByPanel.d.ts} +3 -2
  44. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +1 -0
  45. package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.js → QueryBuilderOLAPGroupByPanel.js} +2 -2
  46. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +1 -0
  47. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +1 -0
  48. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +9 -11
  50. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +1 -0
  52. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +1 -1
  54. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
  55. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +1 -0
  56. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +1 -0
  58. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  59. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +4 -4
  60. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  61. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +1 -0
  62. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  63. package/lib/components/filter/QueryBuilderFilterPanel.js +8 -9
  64. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  65. package/lib/components/shared/BasicValueSpecificationEditor.d.ts +12 -1
  66. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  67. package/lib/components/shared/BasicValueSpecificationEditor.js +11 -7
  68. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  69. package/lib/components/shared/LambdaEditor.d.ts +1 -0
  70. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  71. package/lib/components/shared/LambdaEditor.js +1 -15
  72. package/lib/components/shared/LambdaEditor.js.map +1 -1
  73. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +1 -0
  74. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  75. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +36 -0
  76. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -0
  77. package/lib/components/shared/QueryBuilderVariableSelector.js +50 -0
  78. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -0
  79. package/lib/components/watermark/QueryBuilderWatermark.d.ts +1 -0
  80. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  81. package/lib/components/watermark/QueryBuilderWatermark.js +9 -11
  82. package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
  83. package/lib/graphManager/QueryBuilderHashUtils.d.ts +2 -0
  84. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  85. package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
  86. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  87. package/lib/index.css +2 -2
  88. package/lib/index.css.map +1 -1
  89. package/lib/package.json +6 -6
  90. package/lib/stores/QueryBuilderConfig.d.ts +1 -0
  91. package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
  92. package/lib/stores/QueryBuilderConfig.js +1 -0
  93. package/lib/stores/QueryBuilderConfig.js.map +1 -1
  94. package/lib/stores/QueryBuilderConstantsState.d.ts +43 -0
  95. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -0
  96. package/lib/stores/QueryBuilderConstantsState.js +116 -0
  97. package/lib/stores/QueryBuilderConstantsState.js.map +1 -0
  98. package/lib/stores/QueryBuilderParametersState.d.ts +0 -4
  99. package/lib/stores/QueryBuilderParametersState.d.ts.map +1 -1
  100. package/lib/stores/QueryBuilderParametersState.js +0 -1
  101. package/lib/stores/QueryBuilderParametersState.js.map +1 -1
  102. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +3 -10
  103. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  104. package/lib/stores/QueryBuilderPropertyEditorState.js +6 -140
  105. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  106. package/lib/stores/QueryBuilderState.d.ts +9 -3
  107. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  108. package/lib/stores/QueryBuilderState.js +19 -4
  109. package/lib/stores/QueryBuilderState.js.map +1 -1
  110. package/lib/stores/QueryBuilderStateBuilder.d.ts +4 -3
  111. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  112. package/lib/stores/QueryBuilderStateBuilder.js +50 -42
  113. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  114. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  115. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +23 -25
  116. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  117. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  118. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +14 -78
  119. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  120. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  121. package/lib/stores/QueryBuilderValueSpecificationHelper.js +4 -20
  122. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  123. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +3 -3
  124. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  125. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +4 -4
  126. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  127. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +1 -1
  128. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  129. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +2 -2
  130. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  131. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts +3 -3
  132. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  133. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +6 -6
  134. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  135. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.d.ts → QueryBuilderOLAPGroupByOperatorLoader.d.ts} +1 -1
  136. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +1 -0
  137. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.js → QueryBuilderOLAPGroupByOperatorLoader.js} +1 -1
  138. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +1 -0
  139. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.d.ts → QueryBuilderOLAPGroupByState.d.ts} +1 -1
  140. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +1 -0
  141. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.js → QueryBuilderOLAPGroupByState.js} +1 -1
  142. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +1 -0
  143. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.d.ts → QueryBuilderOLAPGroupByStateBuilder.d.ts} +3 -3
  144. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +1 -0
  145. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.js → QueryBuilderOLAPGroupByStateBuilder.js} +4 -4
  146. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +1 -0
  147. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts} +2 -2
  148. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +1 -0
  149. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.js → QueryBuilderOLAPGroupByValueSpecificationBuilder.js} +2 -2
  150. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +1 -0
  151. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +1 -1
  152. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  153. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +5 -5
  154. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  155. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +10 -10
  156. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  157. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +1 -1
  158. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  159. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +2 -2
  160. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
  161. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +6 -4
  162. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
  163. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +27 -0
  164. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -0
  165. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +93 -0
  166. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -0
  167. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +26 -0
  168. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -0
  169. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +60 -0
  170. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -0
  171. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +70 -0
  172. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -0
  173. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +199 -0
  174. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -0
  175. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +49 -0
  176. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -0
  177. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js +24 -0
  178. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -0
  179. package/lib/stores/{QueryBuilderMilestoningState.d.ts → milestoning/QueryBuilderMilestoningState.d.ts} +6 -2
  180. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -0
  181. package/lib/stores/{QueryBuilderMilestoningState.js → milestoning/QueryBuilderMilestoningState.js} +20 -20
  182. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -0
  183. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +26 -0
  184. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -0
  185. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +55 -0
  186. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -0
  187. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
  188. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  189. package/lib/stores/shared/ValueSpecificationEditorHelper.js +58 -2
  190. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  191. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +2 -2
  192. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -1
  193. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +2 -2
  194. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -1
  195. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +2 -2
  196. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -1
  197. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +7 -4
  198. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -1
  199. package/lib/stores/workflows/ServiceQueryBuilderState.js +1 -1
  200. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  201. package/package.json +13 -13
  202. package/src/components/QueryBuilder.tsx +38 -0
  203. package/src/components/QueryBuilderConstantExpressionPanel.tsx +284 -0
  204. package/src/components/QueryBuilderDiffPanel.tsx +0 -2
  205. package/src/components/QueryBuilderParametersPanel.tsx +22 -103
  206. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +119 -36
  207. package/src/components/QueryBuilderSideBar.tsx +5 -22
  208. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +29 -39
  209. package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.tsx → QueryBuilderOLAPGroupByPanel.tsx} +1 -1
  210. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +18 -19
  211. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +1 -1
  212. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -9
  213. package/src/components/filter/QueryBuilderFilterPanel.tsx +16 -17
  214. package/src/components/shared/BasicValueSpecificationEditor.tsx +47 -22
  215. package/src/components/shared/LambdaEditor.tsx +0 -15
  216. package/src/components/shared/QueryBuilderVariableSelector.tsx +186 -0
  217. package/src/components/watermark/QueryBuilderWatermark.tsx +19 -31
  218. package/src/graphManager/QueryBuilderHashUtils.ts +2 -0
  219. package/src/stores/QueryBuilderConfig.ts +1 -0
  220. package/src/stores/QueryBuilderConstantsState.ts +173 -0
  221. package/src/stores/QueryBuilderParametersState.ts +0 -6
  222. package/src/stores/QueryBuilderPropertyEditorState.ts +6 -235
  223. package/src/stores/QueryBuilderState.ts +25 -4
  224. package/src/stores/QueryBuilderStateBuilder.ts +111 -52
  225. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +34 -51
  226. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +16 -105
  227. package/src/stores/QueryBuilderValueSpecificationHelper.ts +10 -29
  228. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +5 -0
  229. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +2 -2
  230. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +7 -0
  231. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.ts → QueryBuilderOLAPGroupByOperatorLoader.ts} +0 -0
  232. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.ts → QueryBuilderOLAPGroupByState.ts} +0 -0
  233. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.ts → QueryBuilderOLAPGroupByStateBuilder.ts} +3 -1
  234. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.ts} +1 -1
  235. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +1 -1
  236. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +11 -0
  237. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +1 -1
  238. package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +10 -5
  239. package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +165 -0
  240. package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +96 -0
  241. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +311 -0
  242. package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +77 -0
  243. package/src/stores/{QueryBuilderMilestoningState.ts → milestoning/QueryBuilderMilestoningState.ts} +55 -39
  244. package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +88 -0
  245. package/src/stores/shared/ValueSpecificationEditorHelper.ts +84 -2
  246. package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +3 -0
  247. package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +11 -5
  248. package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
  249. package/tsconfig.json +14 -6
  250. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.d.ts.map +0 -1
  251. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.js.map +0 -1
  252. package/lib/stores/QueryBuilderMilestoningState.d.ts.map +0 -1
  253. package/lib/stores/QueryBuilderMilestoningState.js.map +0 -1
  254. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.d.ts.map +0 -1
  255. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js.map +0 -1
  256. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.d.ts.map +0 -1
  257. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js.map +0 -1
  258. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.d.ts.map +0 -1
  259. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js.map +0 -1
  260. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts.map +0 -1
  261. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js.map +0 -1
@@ -24,7 +24,6 @@ import {
24
24
  ModalBody,
25
25
  ModalFooter,
26
26
  ModalHeader,
27
- PanelFormListItems,
28
27
  PanelFormSection,
29
28
  } from '@finos/legend-art';
30
29
  import {
@@ -37,14 +36,14 @@ import {
37
36
  import { observer } from 'mobx-react-lite';
38
37
  import { useCallback } from 'react';
39
38
  import { useDrop } from 'react-dnd';
40
- import {
41
- type QueryBuilderParameterDragSource,
42
- QUERY_BUILDER_PARAMETER_DND_TYPE,
43
- } from '../../stores/QueryBuilderParametersState.js';
44
39
  import type { QueryBuilderState } from '../../stores/QueryBuilderState.js';
45
40
  import type { QueryBuilderWatermarkState } from '../../stores/watermark/QueryBuilderWatermarkState.js';
46
- import { VariableExpressionViewer } from '../QueryBuilderParametersPanel.js';
47
- import { BasicValueSpecificationEditor } from '../shared/BasicValueSpecificationEditor.js';
41
+ import {
42
+ BasicValueSpecificationEditor,
43
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
44
+ type QueryBuilderVariableDragSource,
45
+ } from '../shared/BasicValueSpecificationEditor.js';
46
+ import { VariableSelector } from '../shared/QueryBuilderVariableSelector.js';
48
47
 
49
48
  const isParamaterCompatibleWithWaterMark = (
50
49
  parameter: VariableExpression,
@@ -62,24 +61,24 @@ const WatermarkValueEditor = observer(
62
61
  const graph = watermarkState.queryBuilderState.graphManagerState.graph;
63
62
 
64
63
  const handleDrop = useCallback(
65
- (item: QueryBuilderParameterDragSource): void => {
66
- watermarkState.setValue(item.variable.parameter);
64
+ (item: QueryBuilderVariableDragSource): void => {
65
+ watermarkState.setValue(item.variable);
67
66
  },
68
67
  [watermarkState],
69
68
  );
70
69
 
71
70
  const [{ isParameterValueDragOver }, dropTargetConnector] = useDrop<
72
- QueryBuilderParameterDragSource,
71
+ QueryBuilderVariableDragSource,
73
72
  void,
74
73
  { isParameterValueDragOver: boolean }
75
74
  >(
76
75
  () => ({
77
- accept: [QUERY_BUILDER_PARAMETER_DND_TYPE],
76
+ accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
78
77
  drop: (item, monitor): void => {
79
78
  if (
80
79
  !monitor.didDrop() &&
81
80
  // Only allows parameters with muliplicity 1 and type string
82
- isParamaterCompatibleWithWaterMark(item.variable.parameter)
81
+ isParamaterCompatibleWithWaterMark(item.variable)
83
82
  ) {
84
83
  handleDrop(item);
85
84
  } // prevent drop event propagation to accomondate for nested DnD
@@ -95,7 +94,7 @@ const WatermarkValueEditor = observer(
95
94
 
96
95
  return (
97
96
  <PanelFormSection>
98
- <div className="query-builder__parameter-editor">
97
+ <div className="query-builder__variable-editor">
99
98
  <PanelDropZone
100
99
  isDragOver={isParameterValueDragOver}
101
100
  dropTargetConnector={dropTargetConnector}
@@ -115,6 +114,9 @@ const WatermarkValueEditor = observer(
115
114
  resetValue={(): void => {
116
115
  watermarkState.resetValue();
117
116
  }}
117
+ isConstant={watermarkState.queryBuilderState.constantState.isValueSpecConstant(
118
+ watermarkValue,
119
+ )}
118
120
  />
119
121
  </PanelDropZone>
120
122
  </div>
@@ -130,10 +132,6 @@ export const QueryBuilderWatermarkEditor = observer(
130
132
  const handleClose = (): void => {
131
133
  watermarkState.setIsEditingWatermark(false);
132
134
  };
133
- const compatibleParameters =
134
- queryBuilderState.parametersState.parameterStates.filter((p) =>
135
- isParamaterCompatibleWithWaterMark(p.parameter),
136
- );
137
135
 
138
136
  return (
139
137
  <Dialog
@@ -162,20 +160,10 @@ export const QueryBuilderWatermarkEditor = observer(
162
160
  watermarkValue={watermarkState.value}
163
161
  />
164
162
  <PanelDivider />
165
- <PanelFormListItems title="List of available parameters">
166
- {compatibleParameters.length === 0 && (
167
- <> No available parameters </>
168
- )}
169
- {compatibleParameters.map((parameter) => (
170
- <VariableExpressionViewer
171
- key={parameter.uuid}
172
- queryBuilderState={queryBuilderState}
173
- variableExpressionState={parameter}
174
- isReadOnly={true}
175
- hideActions={true}
176
- />
177
- ))}
178
- </PanelFormListItems>
163
+ <VariableSelector
164
+ filterBy={isParamaterCompatibleWithWaterMark}
165
+ queryBuilderState={queryBuilderState}
166
+ />
179
167
  </>
180
168
  )}
181
169
  </PanelForm>
@@ -17,6 +17,8 @@
17
17
  export enum QUERY_BUILDER_HASH_STRUCTURE {
18
18
  // parameters state
19
19
  PARAMETERS_STATE = 'PARAMETERS_STATE',
20
+ CONSTANT_STATE = 'CONSTANT_STATE',
21
+ CONSTANT_EXPRESSION_STATE = 'CONSTANT_EXPRESSION_STATE',
20
22
 
21
23
  // projection state
22
24
  AGGREGATE_OPERATOR_AVERAGE = 'AGGREGATE_OPERATOR_AVERAGE',
@@ -21,6 +21,7 @@ export enum QUERY_BUILDER_SOURCE_ID_LABEL {
21
21
 
22
22
  export const DEFAULT_LAMBDA_VARIABLE_NAME = 'x';
23
23
  export const DEFAULT_VARIABLE_NAME = 'var';
24
+ export const DEFAULT_CONSTANT_VARIABLE_NAME = 'c_var';
24
25
  export const DEFAULT_POST_FILTER_LAMBDA_VARIABLE_NAME = 'row';
25
26
 
26
27
  export const QUERY_BUILDER_PROPERTY_SEARCH_MAX_DEPTH = 5;
@@ -0,0 +1,173 @@
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
+ import {
18
+ type Type,
19
+ type ValueSpecification,
20
+ GenericType,
21
+ GenericTypeExplicitReference,
22
+ observe_ValueSpecification,
23
+ VariableExpression,
24
+ } from '@finos/legend-graph';
25
+ import {
26
+ type Hashable,
27
+ hashArray,
28
+ deleteEntry,
29
+ addUniqueEntry,
30
+ IllegalStateError,
31
+ uuid,
32
+ assertErrorThrown,
33
+ } from '@finos/legend-shared';
34
+ import { action, makeObservable, observable } from 'mobx';
35
+ import { QUERY_BUILDER_HASH_STRUCTURE } from '../graphManager/QueryBuilderHashUtils.js';
36
+ import type { QueryBuilderState } from './QueryBuilderState.js';
37
+ import { buildDefaultInstanceValue } from './shared/ValueSpecificationEditorHelper.js';
38
+ import { valueSpecification_setGenericType } from './shared/ValueSpecificationModifierHelper.js';
39
+
40
+ export class QueryBuilderConstantExpressionState implements Hashable {
41
+ readonly queryBuilderState: QueryBuilderState;
42
+ readonly uuid = uuid();
43
+ variable: VariableExpression;
44
+ value: ValueSpecification;
45
+
46
+ constructor(
47
+ queryBuilderState: QueryBuilderState,
48
+ variable: VariableExpression,
49
+ value: ValueSpecification,
50
+ ) {
51
+ makeObservable(this, {
52
+ variable: observable,
53
+ value: observable,
54
+ setValueSpec: action,
55
+ changeValSpecType: action,
56
+ });
57
+ this.queryBuilderState = queryBuilderState;
58
+ this.value = observe_ValueSpecification(
59
+ value,
60
+ this.queryBuilderState.observableContext,
61
+ );
62
+ observe_ValueSpecification(
63
+ variable,
64
+ this.queryBuilderState.observableContext,
65
+ );
66
+ this.variable = variable;
67
+ }
68
+
69
+ changeValSpecType(type: Type): void {
70
+ const variableType = this.value.genericType?.value.rawType;
71
+ if (variableType !== type) {
72
+ try {
73
+ const valSpec = buildDefaultInstanceValue(
74
+ this.queryBuilderState.graphManagerState.graph,
75
+ type,
76
+ );
77
+ this.setValueSpec(valSpec);
78
+ } catch (error) {
79
+ assertErrorThrown(error);
80
+ this.queryBuilderState.applicationStore.notifyError(error.message);
81
+ }
82
+ }
83
+ }
84
+
85
+ setValueSpec(value: ValueSpecification): void {
86
+ if (value instanceof VariableExpression) {
87
+ throw new IllegalStateError(
88
+ 'Can not assign a parameter to another parameter',
89
+ );
90
+ }
91
+ this.value = observe_ValueSpecification(
92
+ value,
93
+ this.queryBuilderState.observableContext,
94
+ );
95
+ const valueSpecType = value.genericType?.value.rawType;
96
+ if (
97
+ valueSpecType &&
98
+ valueSpecType !== this.variable.genericType?.value.rawType
99
+ ) {
100
+ valueSpecification_setGenericType(
101
+ this.variable,
102
+ GenericTypeExplicitReference.create(new GenericType(valueSpecType)),
103
+ );
104
+ }
105
+ }
106
+
107
+ get hashCode(): string {
108
+ return hashArray([
109
+ QUERY_BUILDER_HASH_STRUCTURE.CONSTANT_EXPRESSION_STATE,
110
+ this.variable.name,
111
+ this.value,
112
+ ]);
113
+ }
114
+ }
115
+
116
+ export class QueryBuilderConstantsState implements Hashable {
117
+ readonly queryBuilderState: QueryBuilderState;
118
+ showConstantPanel = false;
119
+ constants: QueryBuilderConstantExpressionState[] = [];
120
+ selectedConstant: QueryBuilderConstantExpressionState | undefined;
121
+
122
+ constructor(queryBuilderState: QueryBuilderState) {
123
+ this.queryBuilderState = queryBuilderState;
124
+
125
+ makeObservable(this, {
126
+ constants: observable,
127
+ showConstantPanel: observable,
128
+ selectedConstant: observable,
129
+ addConstant: action,
130
+ removeConstant: action,
131
+ setShowConstantPanel: action,
132
+ setSelectedConstant: action,
133
+ });
134
+ }
135
+
136
+ get isEmpty(): boolean {
137
+ return !this.constants.length;
138
+ }
139
+
140
+ setShowConstantPanel(val: boolean): void {
141
+ this.showConstantPanel = val;
142
+ }
143
+
144
+ addConstant(val: QueryBuilderConstantExpressionState): void {
145
+ addUniqueEntry(this.constants, val);
146
+ }
147
+
148
+ removeConstant(val: QueryBuilderConstantExpressionState): void {
149
+ deleteEntry(this.constants, val);
150
+ }
151
+
152
+ setSelectedConstant(
153
+ val: QueryBuilderConstantExpressionState | undefined,
154
+ ): void {
155
+ this.selectedConstant = val;
156
+ }
157
+
158
+ isValueSpecConstant(value: ValueSpecification): boolean {
159
+ if (value instanceof VariableExpression) {
160
+ return Boolean(
161
+ this.constants.find((v) => v.variable.name === value.name),
162
+ );
163
+ }
164
+ return false;
165
+ }
166
+
167
+ get hashCode(): string {
168
+ return hashArray([
169
+ QUERY_BUILDER_HASH_STRUCTURE.CONSTANT_STATE,
170
+ hashArray(this.constants),
171
+ ]);
172
+ }
173
+ }
@@ -23,12 +23,6 @@ import {
23
23
  LambdaParametersState,
24
24
  } from './shared/LambdaParameterState.js';
25
25
 
26
- export const QUERY_BUILDER_PARAMETER_DND_TYPE = 'PARAMETER';
27
-
28
- export interface QueryBuilderParameterDragSource {
29
- variable: LambdaParameterState;
30
- }
31
-
32
26
  export class QueryBuilderParametersState
33
27
  extends LambdaParametersState
34
28
  implements Hashable
@@ -38,21 +38,14 @@ import {
38
38
  EnumValueInstanceValue,
39
39
  InstanceValue,
40
40
  PrimitiveInstanceValue,
41
- PRIMITIVE_TYPE,
41
+ type PRIMITIVE_TYPE,
42
42
  VariableExpression,
43
- getMilestoneTemporalStereotype,
44
- MILESTONING_STEREOTYPE,
45
43
  SimpleFunctionExpression,
46
44
  matchFunctionName,
47
45
  TYPE_CAST_TOKEN,
48
46
  observe_AbstractPropertyExpression,
49
47
  GenericTypeExplicitReference,
50
48
  GenericType,
51
- BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
52
- PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
53
- INTERNAL__PropagatedValue,
54
- Association,
55
- getGeneratedMilestonedPropertiesForAssociation,
56
49
  PropertyExplicitReference,
57
50
  PrimitiveType,
58
51
  } from '@finos/legend-graph';
@@ -61,7 +54,6 @@ import {
61
54
  generateDefaultValueForPrimitiveType,
62
55
  } from './QueryBuilderValueSpecificationHelper.js';
63
56
  import type { QueryBuilderState } from './QueryBuilderState.js';
64
- import type { QueryBuilderMilestoningState } from './QueryBuilderMilestoningState.js';
65
57
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
66
58
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../graphManager/QueryBuilderHashUtils.js';
67
59
  import {
@@ -69,236 +61,11 @@ import {
69
61
  functionExpression_setParametersValues,
70
62
  instanceValue_setValues,
71
63
  } from './shared/ValueSpecificationModifierHelper.js';
72
-
73
- export const getDerivedPropertyMilestoningSteoreotype = (
74
- property: DerivedProperty,
75
- graph: PureModel,
76
- ): MILESTONING_STEREOTYPE | undefined => {
77
- const owner = property._OWNER;
78
- if (owner instanceof Class) {
79
- return getMilestoneTemporalStereotype(owner, graph);
80
- } else if (owner instanceof Association) {
81
- const generatedMilestonedProperties =
82
- getGeneratedMilestonedPropertiesForAssociation(owner, property);
83
- if (generatedMilestonedProperties.length) {
84
- const ownerClass =
85
- generatedMilestonedProperties[0]?.genericType.value.rawType;
86
- return getMilestoneTemporalStereotype(
87
- guaranteeType(ownerClass, Class),
88
- graph,
89
- );
90
- }
91
- }
92
- return undefined;
93
- };
94
-
95
- /**
96
- * Check if the parameter value of the milestoned property is
97
- * the same as those specified in global scope, so that we can
98
- * potentially replace them with propgated value.
99
- */
100
- const matchMilestoningParameterValue = (
101
- stereotype: MILESTONING_STEREOTYPE,
102
- idx: number,
103
- parameterValue: ValueSpecification,
104
- milestoningDate: QueryBuilderMilestoningState,
105
- ): boolean => {
106
- const checkIfEquivalent = (
107
- param1: ValueSpecification | undefined,
108
- param2: ValueSpecification | undefined,
109
- ): boolean => {
110
- if (
111
- param1 instanceof VariableExpression &&
112
- param2 instanceof VariableExpression
113
- ) {
114
- return param1.name === param2.name;
115
- } else if (
116
- param1 instanceof PrimitiveInstanceValue &&
117
- param2 instanceof PrimitiveInstanceValue
118
- ) {
119
- if (
120
- param1.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE &&
121
- param2.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE
122
- ) {
123
- return true;
124
- }
125
- return (
126
- param1.genericType.value.rawType.name ===
127
- param2.genericType.value.rawType.name &&
128
- param1.values[0] === param2.values[0]
129
- );
130
- }
131
- return false;
132
- };
133
- switch (stereotype) {
134
- case MILESTONING_STEREOTYPE.BITEMPORAL:
135
- return (
136
- (idx === 0 &&
137
- checkIfEquivalent(parameterValue, milestoningDate.processingDate)) ||
138
- (idx === 1 &&
139
- checkIfEquivalent(parameterValue, milestoningDate.businessDate))
140
- );
141
- case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL:
142
- return checkIfEquivalent(parameterValue, milestoningDate.processingDate);
143
- case MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL:
144
- return checkIfEquivalent(parameterValue, milestoningDate.businessDate);
145
- default:
146
- }
147
- return false;
148
- };
64
+ import { generateMilestonedPropertyParameterValue } from './milestoning/QueryBuilderMilestoningHelper.js';
149
65
 
150
66
  export const prettyPropertyName = (value: string): string =>
151
67
  isCamelCase(value) ? prettyCamelCase(value) : prettyCONSTName(value);
152
68
 
153
- /**
154
- * Generate a parameter value for the derived property given the index if the property is milestoned.
155
- *
156
- * This method considers different scenarios for milestoning and take into account date propagation
157
- * See https://github.com/finos/legend-studio/pull/891
158
- */
159
- export const generateMilestonedPropertyParameterValue = (
160
- derivedPropertyExpressionState: QueryBuilderDerivedPropertyExpressionState,
161
- idx: number,
162
- ): ValueSpecification | undefined => {
163
- // Milestoning transformations should not be done on actual derived properties.
164
- if (
165
- derivedPropertyExpressionState.derivedProperty._OWNER.derivedProperties.includes(
166
- derivedPropertyExpressionState.derivedProperty,
167
- )
168
- ) {
169
- return undefined;
170
- }
171
- const milestoningState =
172
- derivedPropertyExpressionState.queryBuilderState.milestoningState;
173
- const temporalSource = getDerivedPropertyMilestoningSteoreotype(
174
- derivedPropertyExpressionState.derivedProperty,
175
- derivedPropertyExpressionState.queryBuilderState.graphManagerState.graph,
176
- );
177
- const temporalTarget =
178
- derivedPropertyExpressionState.propertyExpression.func.value.genericType
179
- .value.rawType instanceof Class &&
180
- derivedPropertyExpressionState.propertyExpression.func.value._OWNER
181
- ._generatedMilestonedProperties.length !== 0
182
- ? getMilestoneTemporalStereotype(
183
- derivedPropertyExpressionState.propertyExpression.func.value
184
- .genericType.value.rawType,
185
- derivedPropertyExpressionState.queryBuilderState.graphManagerState
186
- .graph,
187
- )
188
- : undefined;
189
- const shouldReturnMilestoningParameter =
190
- temporalTarget &&
191
- ((idx < derivedPropertyExpressionState.parameterValues.length &&
192
- (matchMilestoningParameterValue(
193
- temporalTarget,
194
- idx,
195
- guaranteeNonNullable(
196
- derivedPropertyExpressionState.parameterValues[idx],
197
- ),
198
- milestoningState,
199
- ) ||
200
- /**
201
- * Checks if the given milestoning needs to be overwritten or not.
202
- * Specially, we would need to rewrite the query if the user passes a single parameter
203
- * to the `bitemporal` property expression with `processing temporal` source.
204
- */
205
- (getDerivedPropertyMilestoningSteoreotype(
206
- derivedPropertyExpressionState.derivedProperty,
207
- derivedPropertyExpressionState.queryBuilderState.graphManagerState
208
- .graph,
209
- ) === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
210
- temporalTarget === MILESTONING_STEREOTYPE.BITEMPORAL &&
211
- derivedPropertyExpressionState.parameterValues.length === 1))) ||
212
- idx >= derivedPropertyExpressionState.parameterValues.length);
213
-
214
- if (!shouldReturnMilestoningParameter) {
215
- return undefined;
216
- }
217
-
218
- switch (temporalTarget) {
219
- case MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL: {
220
- if (!milestoningState.businessDate) {
221
- milestoningState.setBusinessDate(
222
- derivedPropertyExpressionState.queryBuilderState.milestoningState.buildMilestoningParameter(
223
- BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
224
- ),
225
- );
226
- }
227
- const parameter = new INTERNAL__PropagatedValue(() =>
228
- guaranteeNonNullable(milestoningState.businessDate),
229
- );
230
- return parameter;
231
- }
232
- case MILESTONING_STEREOTYPE.BITEMPORAL: {
233
- if (!milestoningState.processingDate) {
234
- milestoningState.setProcessingDate(
235
- derivedPropertyExpressionState.queryBuilderState.milestoningState.buildMilestoningParameter(
236
- PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
237
- ),
238
- );
239
- }
240
- if (!milestoningState.businessDate) {
241
- milestoningState.setBusinessDate(
242
- derivedPropertyExpressionState.queryBuilderState.milestoningState.buildMilestoningParameter(
243
- BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
244
- ),
245
- );
246
- }
247
- if (idx === 0) {
248
- if (
249
- temporalSource === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
250
- derivedPropertyExpressionState.parameterValues.length === 1
251
- ) {
252
- return guaranteeType(
253
- derivedPropertyExpressionState.propertyExpression
254
- .parametersValues[0],
255
- AbstractPropertyExpression,
256
- ).parametersValues[1];
257
- }
258
- const parameter = new INTERNAL__PropagatedValue(() =>
259
- guaranteeNonNullable(milestoningState.processingDate),
260
- );
261
- return parameter;
262
- } else {
263
- if (
264
- temporalSource === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
265
- derivedPropertyExpressionState.parameterValues.length === 1
266
- ) {
267
- return derivedPropertyExpressionState.parameterValues[0];
268
- } else if (
269
- temporalSource === MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL &&
270
- derivedPropertyExpressionState.parameterValues.length === 1
271
- ) {
272
- return guaranteeType(
273
- derivedPropertyExpressionState.propertyExpression
274
- .parametersValues[0],
275
- AbstractPropertyExpression,
276
- ).parametersValues[1];
277
- }
278
- const parameter = new INTERNAL__PropagatedValue(() =>
279
- guaranteeNonNullable(milestoningState.businessDate),
280
- );
281
- return parameter;
282
- }
283
- }
284
- case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL: {
285
- if (!milestoningState.processingDate) {
286
- milestoningState.setProcessingDate(
287
- derivedPropertyExpressionState.queryBuilderState.milestoningState.buildMilestoningParameter(
288
- PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
289
- ),
290
- );
291
- }
292
- const parameter = new INTERNAL__PropagatedValue(() =>
293
- guaranteeNonNullable(milestoningState.processingDate),
294
- );
295
- return parameter;
296
- }
297
- default:
298
- return undefined;
299
- }
300
- };
301
-
302
69
  export const getPropertyChainName = (
303
70
  propertyExpression: AbstractPropertyExpression,
304
71
  humanizePropertyName: boolean,
@@ -468,10 +235,12 @@ export class QueryBuilderDerivedPropertyExpressionState {
468
235
  readonly propertyExpression: AbstractPropertyExpression;
469
236
  readonly derivedProperty: DerivedProperty;
470
237
  readonly parameters: VariableExpression[] = [];
238
+ readonly propertyExpressionState: QueryBuilderPropertyExpressionState;
471
239
 
472
240
  constructor(
473
241
  queryBuilderState: QueryBuilderState,
474
242
  propertyExpression: AbstractPropertyExpression,
243
+ propertyExpressionState: QueryBuilderPropertyExpressionState,
475
244
  ) {
476
245
  this.path = getPropertyPath(propertyExpression);
477
246
  this.title = getPropertyChainName(propertyExpression, true);
@@ -484,6 +253,7 @@ export class QueryBuilderDerivedPropertyExpressionState {
484
253
  propertyExpression.func.value,
485
254
  DerivedProperty,
486
255
  );
256
+ this.propertyExpressionState = propertyExpressionState;
487
257
  // build the parameters of the derived properties
488
258
  if (Array.isArray(this.derivedProperty.parameters)) {
489
259
  this.parameters = this.derivedProperty.parameters.map((parameter) =>
@@ -625,6 +395,7 @@ export class QueryBuilderPropertyExpressionState implements Hashable {
625
395
  new QueryBuilderDerivedPropertyExpressionState(
626
396
  this.queryBuilderState,
627
397
  currentExpression,
398
+ this,
628
399
  );
629
400
  result.push(derivedPropertyExpressionState);
630
401
  }
@@ -72,10 +72,11 @@ import { QueryBuilderParametersState } from './QueryBuilderParametersState.js';
72
72
  import type { QueryBuilderFilterOperator } from './filter/QueryBuilderFilterOperator.js';
73
73
  import { getQueryBuilderCoreFilterOperators } from './filter/QueryBuilderFilterOperatorLoader.js';
74
74
  import { QueryBuilderChangeDetectionState } from './QueryBuilderChangeDetectionState.js';
75
- import { QueryBuilderMilestoningState } from './QueryBuilderMilestoningState.js';
75
+ import { QueryBuilderMilestoningState } from './milestoning/QueryBuilderMilestoningState.js';
76
76
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../graphManager/QueryBuilderHashUtils.js';
77
77
  import { QUERY_BUILDER_COMMAND_KEY } from './QueryBuilderCommand.js';
78
78
  import { QueryBuilderWatermarkState } from './watermark/QueryBuilderWatermarkState.js';
79
+ import { QueryBuilderConstantsState } from './QueryBuilderConstantsState.js';
79
80
 
80
81
  export abstract class QueryBuilderState implements CommandRegistrar {
81
82
  applicationStore: GenericLegendApplicationStore;
@@ -85,6 +86,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
85
86
  explorerState: QueryBuilderExplorerState;
86
87
  functionsExplorerState: QueryFunctionsExplorerState;
87
88
  parametersState: QueryBuilderParametersState;
89
+ constantState: QueryBuilderConstantsState;
88
90
  milestoningState: QueryBuilderMilestoningState;
89
91
  fetchStructureState: QueryBuilderFetchStructureState;
90
92
  filterState: QueryBuilderFilterState;
@@ -116,6 +118,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
116
118
  makeObservable(this, {
117
119
  explorerState: observable,
118
120
  parametersState: observable,
121
+ constantState: observable,
119
122
  functionsExplorerState: observable,
120
123
  fetchStructureState: observable,
121
124
  filterState: observable,
@@ -159,6 +162,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
159
162
  this.milestoningState = new QueryBuilderMilestoningState(this);
160
163
  this.explorerState = new QueryBuilderExplorerState(this);
161
164
  this.parametersState = new QueryBuilderParametersState(this);
165
+ this.constantState = new QueryBuilderConstantsState(this);
162
166
  this.functionsExplorerState = new QueryFunctionsExplorerState(this);
163
167
  this.fetchStructureState = new QueryBuilderFetchStructureState(this);
164
168
  this.filterState = new QueryBuilderFilterState(this, this.filterOperators);
@@ -200,6 +204,20 @@ export abstract class QueryBuilderState implements CommandRegistrar {
200
204
  return true;
201
205
  }
202
206
 
207
+ get allVariables(): VariableExpression[] {
208
+ const parameterVars = this.parametersState.parameterStates.map(
209
+ (paramState) => paramState.parameter,
210
+ );
211
+ const letVars = this.constantState.constants.map(
212
+ (letVar) => letVar.variable,
213
+ );
214
+ return [...parameterVars, ...letVars];
215
+ }
216
+
217
+ get allVariableNames(): string[] {
218
+ return this.allVariables.map((e) => e.name);
219
+ }
220
+
203
221
  setShowFunctionsExplorerPanel(val: boolean): void {
204
222
  this.showFunctionsExplorerPanel = val;
205
223
  }
@@ -258,6 +276,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
258
276
  this.explorerState = new QueryBuilderExplorerState(this);
259
277
  this.explorerState.refreshTreeData();
260
278
  this.parametersState = new QueryBuilderParametersState(this);
279
+ this.constantState = new QueryBuilderConstantsState(this);
261
280
  this.functionsExplorerState = new QueryFunctionsExplorerState(this);
262
281
  this.filterState = new QueryBuilderFilterState(this, this.filterOperators);
263
282
  this.watermarkState = new QueryBuilderWatermarkState(this);
@@ -284,10 +303,12 @@ export abstract class QueryBuilderState implements CommandRegistrar {
284
303
  this.milestoningState.updateMilestoningConfiguration();
285
304
  }
286
305
 
287
- changeMapping(val: Mapping): void {
306
+ changeMapping(val: Mapping, options?: { keepQueryContent?: boolean }): void {
288
307
  this.resetQueryResult();
289
- this.resetQueryContent();
290
- this.milestoningState.updateMilestoningConfiguration();
308
+ if (!options?.keepQueryContent) {
309
+ this.resetQueryContent();
310
+ this.milestoningState.updateMilestoningConfiguration();
311
+ }
291
312
  this.setMapping(val);
292
313
  }
293
314