@finos/legend-query-builder 0.4.4 → 0.6.0

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 (295) 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 +105 -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 +10 -27
  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/CustomDatePicker.d.ts.map +1 -1
  70. package/lib/components/shared/CustomDatePicker.js +3 -3
  71. package/lib/components/shared/CustomDatePicker.js.map +1 -1
  72. package/lib/components/shared/LambdaEditor.d.ts +1 -0
  73. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  74. package/lib/components/shared/LambdaEditor.js +1 -15
  75. package/lib/components/shared/LambdaEditor.js.map +1 -1
  76. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +1 -0
  77. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  78. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +37 -0
  79. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -0
  80. package/lib/components/shared/QueryBuilderVariableSelector.js +53 -0
  81. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -0
  82. package/lib/components/watermark/QueryBuilderWatermark.d.ts +1 -0
  83. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  84. package/lib/components/watermark/QueryBuilderWatermark.js +9 -11
  85. package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
  86. package/lib/graphManager/QueryBuilderHashUtils.d.ts +2 -0
  87. package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
  88. package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
  89. package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
  90. package/lib/index.css +1 -17
  91. package/lib/index.css.map +1 -1
  92. package/lib/package.json +6 -6
  93. package/lib/stores/QueryBuilderConfig.d.ts +1 -0
  94. package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
  95. package/lib/stores/QueryBuilderConfig.js +1 -0
  96. package/lib/stores/QueryBuilderConfig.js.map +1 -1
  97. package/lib/stores/QueryBuilderConstantsState.d.ts +43 -0
  98. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -0
  99. package/lib/stores/QueryBuilderConstantsState.js +116 -0
  100. package/lib/stores/QueryBuilderConstantsState.js.map +1 -0
  101. package/lib/stores/QueryBuilderParametersState.d.ts +0 -4
  102. package/lib/stores/QueryBuilderParametersState.d.ts.map +1 -1
  103. package/lib/stores/QueryBuilderParametersState.js +0 -1
  104. package/lib/stores/QueryBuilderParametersState.js.map +1 -1
  105. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +3 -10
  106. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  107. package/lib/stores/QueryBuilderPropertyEditorState.js +6 -140
  108. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  109. package/lib/stores/QueryBuilderState.d.ts +10 -3
  110. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  111. package/lib/stores/QueryBuilderState.js +27 -4
  112. package/lib/stores/QueryBuilderState.js.map +1 -1
  113. package/lib/stores/QueryBuilderStateBuilder.d.ts +4 -3
  114. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  115. package/lib/stores/QueryBuilderStateBuilder.js +50 -42
  116. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  117. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  118. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +23 -25
  119. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  120. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
  121. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +14 -78
  122. package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
  123. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
  124. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  125. package/lib/stores/QueryBuilderValueSpecificationHelper.js +13 -20
  126. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  127. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -1
  128. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  129. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  130. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -1
  131. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  132. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +4 -0
  133. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  134. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +3 -3
  135. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
  136. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +4 -4
  137. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
  138. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +3 -2
  139. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  140. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +15 -2
  141. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  142. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts +3 -3
  143. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  144. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +6 -6
  145. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  146. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.d.ts → QueryBuilderOLAPGroupByOperatorLoader.d.ts} +1 -1
  147. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +1 -0
  148. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.js → QueryBuilderOLAPGroupByOperatorLoader.js} +1 -1
  149. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +1 -0
  150. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.d.ts → QueryBuilderOLAPGroupByState.d.ts} +1 -1
  151. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +1 -0
  152. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.js → QueryBuilderOLAPGroupByState.js} +1 -1
  153. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +1 -0
  154. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.d.ts → QueryBuilderOLAPGroupByStateBuilder.d.ts} +3 -3
  155. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +1 -0
  156. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.js → QueryBuilderOLAPGroupByStateBuilder.js} +4 -4
  157. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +1 -0
  158. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts} +2 -2
  159. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +1 -0
  160. package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.js → QueryBuilderOLAPGroupByValueSpecificationBuilder.js} +2 -2
  161. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +1 -0
  162. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +2 -1
  163. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  164. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +9 -1
  165. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  166. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +1 -1
  167. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
  168. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +2 -1
  169. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
  170. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +4 -0
  171. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  172. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +5 -5
  173. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
  174. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +10 -10
  175. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
  176. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +1 -1
  177. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  178. package/lib/stores/filter/QueryBuilderFilterState.d.ts +2 -1
  179. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  180. package/lib/stores/filter/QueryBuilderFilterState.js +9 -1
  181. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  182. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +2 -2
  183. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
  184. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +6 -4
  185. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
  186. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +27 -0
  187. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -0
  188. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +93 -0
  189. package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -0
  190. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +26 -0
  191. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -0
  192. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +60 -0
  193. package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -0
  194. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +70 -0
  195. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -0
  196. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +199 -0
  197. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -0
  198. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +49 -0
  199. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -0
  200. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js +24 -0
  201. package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -0
  202. package/lib/stores/{QueryBuilderMilestoningState.d.ts → milestoning/QueryBuilderMilestoningState.d.ts} +7 -2
  203. package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -0
  204. package/lib/stores/{QueryBuilderMilestoningState.js → milestoning/QueryBuilderMilestoningState.js} +30 -20
  205. package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -0
  206. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +26 -0
  207. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -0
  208. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +55 -0
  209. package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -0
  210. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
  211. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  212. package/lib/stores/shared/ValueSpecificationEditorHelper.js +58 -2
  213. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  214. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +2 -1
  215. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
  216. package/lib/stores/watermark/QueryBuilderWatermarkState.js +6 -0
  217. package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
  218. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +2 -2
  219. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -1
  220. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +2 -2
  221. package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -1
  222. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +2 -2
  223. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -1
  224. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +7 -4
  225. package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -1
  226. package/lib/stores/workflows/ServiceQueryBuilderState.js +1 -1
  227. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  228. package/package.json +13 -13
  229. package/src/components/QueryBuilder.tsx +38 -0
  230. package/src/components/QueryBuilderConstantExpressionPanel.tsx +291 -0
  231. package/src/components/QueryBuilderDiffPanel.tsx +0 -2
  232. package/src/components/QueryBuilderParametersPanel.tsx +29 -103
  233. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +119 -36
  234. package/src/components/QueryBuilderSideBar.tsx +5 -22
  235. package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +29 -39
  236. package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.tsx → QueryBuilderOLAPGroupByPanel.tsx} +1 -1
  237. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +18 -19
  238. package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +1 -1
  239. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -9
  240. package/src/components/filter/QueryBuilderFilterPanel.tsx +16 -17
  241. package/src/components/shared/BasicValueSpecificationEditor.tsx +47 -22
  242. package/src/components/shared/CustomDatePicker.tsx +3 -2
  243. package/src/components/shared/LambdaEditor.tsx +0 -15
  244. package/src/components/shared/QueryBuilderVariableSelector.tsx +193 -0
  245. package/src/components/watermark/QueryBuilderWatermark.tsx +19 -31
  246. package/src/graphManager/QueryBuilderHashUtils.ts +2 -0
  247. package/src/stores/QueryBuilderConfig.ts +1 -0
  248. package/src/stores/QueryBuilderConstantsState.ts +173 -0
  249. package/src/stores/QueryBuilderParametersState.ts +0 -6
  250. package/src/stores/QueryBuilderPropertyEditorState.ts +6 -235
  251. package/src/stores/QueryBuilderState.ts +36 -4
  252. package/src/stores/QueryBuilderStateBuilder.ts +111 -52
  253. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +34 -51
  254. package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +16 -105
  255. package/src/stores/QueryBuilderValueSpecificationHelper.ts +23 -29
  256. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +2 -0
  257. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +14 -2
  258. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +5 -0
  259. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +21 -4
  260. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +7 -0
  261. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.ts → QueryBuilderOLAPGroupByOperatorLoader.ts} +0 -0
  262. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.ts → QueryBuilderOLAPGroupByState.ts} +0 -0
  263. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.ts → QueryBuilderOLAPGroupByStateBuilder.ts} +3 -1
  264. package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.ts} +1 -1
  265. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +13 -0
  266. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +1 -1
  267. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +12 -0
  268. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +11 -0
  269. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +1 -1
  270. package/src/stores/filter/QueryBuilderFilterState.ts +13 -0
  271. package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +10 -5
  272. package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +165 -0
  273. package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +96 -0
  274. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +311 -0
  275. package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +77 -0
  276. package/src/stores/{QueryBuilderMilestoningState.ts → milestoning/QueryBuilderMilestoningState.ts} +66 -39
  277. package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +88 -0
  278. package/src/stores/shared/ValueSpecificationEditorHelper.ts +84 -2
  279. package/src/stores/watermark/QueryBuilderWatermarkState.ts +8 -0
  280. package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +3 -0
  281. package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +11 -5
  282. package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
  283. package/tsconfig.json +14 -6
  284. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.d.ts.map +0 -1
  285. package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.js.map +0 -1
  286. package/lib/stores/QueryBuilderMilestoningState.d.ts.map +0 -1
  287. package/lib/stores/QueryBuilderMilestoningState.js.map +0 -1
  288. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.d.ts.map +0 -1
  289. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js.map +0 -1
  290. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.d.ts.map +0 -1
  291. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js.map +0 -1
  292. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.d.ts.map +0 -1
  293. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js.map +0 -1
  294. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts.map +0 -1
  295. package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js.map +0 -1
@@ -38,12 +38,12 @@ import {
38
38
  Class,
39
39
  getMilestoneTemporalStereotype,
40
40
  DerivedProperty,
41
- MILESTONING_STEREOTYPE,
42
41
  PackageableElementExplicitReference,
43
42
  Multiplicity,
44
43
  CollectionInstanceValue,
45
44
  GenericTypeExplicitReference,
46
45
  GenericType,
46
+ INTERNAL__PropagatedValue,
47
47
  } from '@finos/legend-graph';
48
48
  import {
49
49
  addUniqueEntry,
@@ -55,7 +55,10 @@ import {
55
55
  UnsupportedOperationError,
56
56
  } from '@finos/legend-shared';
57
57
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graphManager/QueryBuilderSupportedFunctions.js';
58
- import { getDerivedPropertyMilestoningSteoreotype } from './QueryBuilderPropertyEditorState.js';
58
+ import {
59
+ getDerivedPropertyMilestoningSteoreotype,
60
+ validateMilestoningPropertyExpressionChain,
61
+ } from './milestoning/QueryBuilderMilestoningHelper.js';
59
62
 
60
63
  export const getNonCollectionValueSpecificationType = (
61
64
  valueSpecification: ValueSpecification,
@@ -209,6 +212,7 @@ export const generateDefaultValueForPrimitiveType = (
209
212
  case PRIMITIVE_TYPE.DECIMAL:
210
213
  case PRIMITIVE_TYPE.FLOAT:
211
214
  case PRIMITIVE_TYPE.INTEGER:
215
+ case PRIMITIVE_TYPE.BINARY:
212
216
  return 0;
213
217
  case PRIMITIVE_TYPE.DATE:
214
218
  case PRIMITIVE_TYPE.STRICTDATE:
@@ -301,33 +305,11 @@ export const validatePropertyExpressionChain = (
301
305
  guaranteeType(func, DerivedProperty),
302
306
  graph,
303
307
  );
304
- if (
305
- sourceStereotype !== MILESTONING_STEREOTYPE.BITEMPORAL &&
306
- targetStereotype !== sourceStereotype
307
- ) {
308
- if (targetStereotype === MILESTONING_STEREOTYPE.BITEMPORAL) {
309
- if (
310
- propertyExpression.parametersValues.length !== 3 &&
311
- !sourceStereotype
312
- ) {
313
- throw new UnsupportedOperationError(
314
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have exactly two parameters`,
315
- );
316
- } else if (propertyExpression.parametersValues.length < 2) {
317
- throw new UnsupportedOperationError(
318
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have at least one parameter`,
319
- );
320
- } else if (propertyExpression.parametersValues.length > 3) {
321
- throw new UnsupportedOperationError(
322
- `Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should not have more than two parameters`,
323
- );
324
- }
325
- } else if (propertyExpression.parametersValues.length !== 2) {
326
- throw new UnsupportedOperationError(
327
- `Property of milestoning sterotype '${targetStereotype}' should have exactly one parameter`,
328
- );
329
- }
330
- }
308
+ validateMilestoningPropertyExpressionChain(
309
+ sourceStereotype,
310
+ targetStereotype,
311
+ propertyExpression,
312
+ );
331
313
  }
332
314
  }
333
315
  }
@@ -361,3 +343,15 @@ export const createNullishValue = (graph: PureModel): CollectionInstanceValue =>
361
343
  new GenericType(graph.getType(CORE_PURE_PATH.ANY)),
362
344
  ),
363
345
  );
346
+
347
+ export const isValueExpressionReferencesinValue = (
348
+ variable: VariableExpression,
349
+ value: ValueSpecification,
350
+ ): boolean => {
351
+ if (value instanceof VariableExpression) {
352
+ return value.name === variable.name;
353
+ } else if (value instanceof INTERNAL__PropagatedValue) {
354
+ return isValueExpressionReferencesinValue(variable, value.getValue());
355
+ }
356
+ return false;
357
+ };
@@ -18,6 +18,7 @@ import type {
18
18
  Class,
19
19
  CompilationError,
20
20
  LambdaFunction,
21
+ VariableExpression,
21
22
  } from '@finos/legend-graph';
22
23
  import type { Hashable } from '@finos/legend-shared';
23
24
  import { computed, makeObservable } from 'mobx';
@@ -61,6 +62,7 @@ export abstract class QueryBuilderFetchStructureImplementationState
61
62
  abstract fetchProperties(
62
63
  nodes: QueryBuilderExplorerTreePropertyNodeData[],
63
64
  ): void;
65
+ abstract isVariableUsed(variable: VariableExpression): boolean;
64
66
  abstract checkBeforeChangingImplementation(onChange: () => void): void;
65
67
  abstract appendFetchStructure(
66
68
  lambdaFunction: LambdaFunction,
@@ -18,10 +18,11 @@ import type { QueryBuilderState } from '../../QueryBuilderState.js';
18
18
  import { action, computed, makeObservable, observable } from 'mobx';
19
19
  import {
20
20
  type CompilationError,
21
- PackageableElementExplicitReference,
22
- RootGraphFetchTree,
23
21
  type Class,
24
22
  type LambdaFunction,
23
+ type VariableExpression,
24
+ PackageableElementExplicitReference,
25
+ RootGraphFetchTree,
25
26
  getAllSuperclasses,
26
27
  } from '@finos/legend-graph';
27
28
  import {
@@ -51,6 +52,7 @@ import {
51
52
  type Hashable,
52
53
  } from '@finos/legend-shared';
53
54
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../../../graphManager/QueryBuilderHashUtils.js';
55
+ import { isValueExpressionReferencesinValue } from '../../QueryBuilderValueSpecificationHelper.js';
54
56
 
55
57
  export class QueryBuilderGraphFetchTreeState
56
58
  extends QueryBuilderFetchStructureImplementationState
@@ -247,6 +249,16 @@ export class QueryBuilderGraphFetchTreeState
247
249
  }
248
250
  }
249
251
 
252
+ isVariableUsed(variable: VariableExpression): boolean {
253
+ return Boolean(
254
+ Array.from(this.treeData?.nodes.values() ?? []).find((node) =>
255
+ node.tree.parameters.find((p) =>
256
+ isValueExpressionReferencesinValue(variable, p),
257
+ ),
258
+ ),
259
+ );
260
+ }
261
+
250
262
  get hashCode(): string {
251
263
  return hashArray([
252
264
  QUERY_BUILDER_HASH_STRUCTURE.GRAPH_FETCH_STATE,
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import {
18
+ type LambdaFunction,
18
19
  GraphFetchTreeInstanceValue,
19
20
  matchFunctionName,
20
21
  RootGraphFetchTree,
@@ -31,6 +32,7 @@ import { buildGraphFetchTreeData } from './QueryBuilderGraphFetchTreeUtil.js';
31
32
  export const processGraphFetchExpression = (
32
33
  expression: SimpleFunctionExpression,
33
34
  queryBuilderState: QueryBuilderState,
35
+ parentLambda: LambdaFunction,
34
36
  ): void => {
35
37
  const functionName = expression.functionName;
36
38
 
@@ -55,6 +57,7 @@ export const processGraphFetchExpression = (
55
57
  );
56
58
  QueryBuilderValueSpecificationProcessor.process(
57
59
  precedingExpression,
60
+ parentLambda,
58
61
  queryBuilderState,
59
62
  );
60
63
 
@@ -77,6 +80,7 @@ export const processGraphFetchExpression = (
77
80
  export const processGraphFetchSerializeExpression = (
78
81
  expression: SimpleFunctionExpression,
79
82
  queryBuilderState: QueryBuilderState,
83
+ parentLambda: LambdaFunction,
80
84
  ): void => {
81
85
  // update fetch-structure
82
86
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -104,6 +108,7 @@ export const processGraphFetchSerializeExpression = (
104
108
  );
105
109
  QueryBuilderValueSpecificationProcessor.process(
106
110
  precedingExpression,
111
+ parentLambda,
107
112
  queryBuilderState,
108
113
  );
109
114
 
@@ -39,14 +39,15 @@ import {
39
39
  import type { QueryBuilderState } from '../../QueryBuilderState.js';
40
40
  import {
41
41
  type CompilationError,
42
+ type LambdaFunction,
43
+ type ValueSpecification,
44
+ type VariableExpression,
42
45
  GRAPH_MANAGER_EVENT,
43
46
  extractSourceInformationCoordinates,
44
47
  LAMBDA_PIPE,
45
48
  RawLambda,
46
49
  isStubbed_RawLambda,
47
50
  Class,
48
- type LambdaFunction,
49
- type ValueSpecification,
50
51
  AbstractPropertyExpression,
51
52
  matchFunctionName,
52
53
  SimpleFunctionExpression,
@@ -91,9 +92,9 @@ import type { LambdaFunctionBuilderOption } from '../../QueryBuilderValueSpecifi
91
92
  import { appendProjection } from './projection/QueryBuilderProjectionValueSpecificationBuilder.js';
92
93
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graphManager/QueryBuilderSupportedFunctions.js';
93
94
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../../../graphManager/QueryBuilderHashUtils.js';
94
- import { QueryBuilderOLAPGroupByState } from './olapGroupBy/QueryBuilderOLAPGroupByState_.js';
95
+ import { QueryBuilderOLAPGroupByState } from './olapGroupBy/QueryBuilderOLAPGroupByState.js';
95
96
  import type { QueryBuilderTDS_OLAPOperator } from './olapGroupBy/operators/QueryBuilderTDS_OLAPOperator.js';
96
- import { getQueryBuilderCoreOLAPGroupByOperators } from './olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js';
97
+ import { getQueryBuilderCoreOLAPGroupByOperators } from './olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js';
97
98
  import type { QueryBuilderTDSColumnState } from './QueryBuilderTDSColumnState.js';
98
99
 
99
100
  export class QueryBuilderTDSState
@@ -636,6 +637,22 @@ export class QueryBuilderTDSState
636
637
  }
637
638
  }
638
639
 
640
+ isVariableUsed(variable: VariableExpression): boolean {
641
+ const columns = this.projectionColumns;
642
+ const derivationColumns = columns.filter(
643
+ filterByType(QueryBuilderDerivationProjectionColumnState),
644
+ );
645
+ if (derivationColumns.length) {
646
+ // we will return false if any derivation cols are present as we can't verify is the variable is ued
647
+ return false;
648
+ }
649
+ const usedInProjection = columns
650
+ .filter(filterByType(QueryBuilderSimpleProjectionColumnState))
651
+ .find((col) => col.isVariableUsed(variable));
652
+ const usedInPostFilter = this.postFilterState.isVariableUsed(variable);
653
+ return Boolean(usedInProjection ?? usedInPostFilter);
654
+ }
655
+
639
656
  get hashCode(): string {
640
657
  return hashArray([
641
658
  QUERY_BUILDER_HASH_STRUCTURE.PROJECTION_STATE,
@@ -15,6 +15,7 @@
15
15
  */
16
16
 
17
17
  import {
18
+ type LambdaFunction,
18
19
  CollectionInstanceValue,
19
20
  LambdaFunctionInstanceValue,
20
21
  matchFunctionName,
@@ -41,6 +42,7 @@ export const processTDSAggregateExpression = (
41
42
  expression: SimpleFunctionExpression,
42
43
  parentExpression: SimpleFunctionExpression | undefined,
43
44
  queryBuilderState: QueryBuilderState,
45
+ parentLambda: LambdaFunction,
44
46
  ): void => {
45
47
  // check parent expression
46
48
  assertTrue(
@@ -65,6 +67,7 @@ export const processTDSAggregateExpression = (
65
67
  // TODO?: do we want to do more validation here for the shape of the column lambda?
66
68
  guaranteeNonNullable(expression.parametersValues[0]),
67
69
  expression,
70
+ parentLambda,
68
71
  queryBuilderState,
69
72
  );
70
73
 
@@ -137,6 +140,7 @@ export const processTDSAggregateExpression = (
137
140
  export const processTDSGroupByExpression = (
138
141
  expression: SimpleFunctionExpression,
139
142
  queryBuilderState: QueryBuilderState,
143
+ parentLambda: LambdaFunction,
140
144
  ): void => {
141
145
  // update fetch-structureTABULAR_DATA_STRUCTURE
142
146
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -164,6 +168,7 @@ export const processTDSGroupByExpression = (
164
168
  );
165
169
  QueryBuilderValueSpecificationProcessor.process(
166
170
  precedingExpression,
171
+ parentLambda,
167
172
  queryBuilderState,
168
173
  );
169
174
 
@@ -178,6 +183,7 @@ export const processTDSGroupByExpression = (
178
183
  QueryBuilderValueSpecificationProcessor.processChild(
179
184
  value,
180
185
  expression,
186
+ parentLambda,
181
187
  queryBuilderState,
182
188
  ),
183
189
  );
@@ -193,6 +199,7 @@ export const processTDSGroupByExpression = (
193
199
  QueryBuilderValueSpecificationProcessor.processChild(
194
200
  value,
195
201
  expression,
202
+ parentLambda,
196
203
  queryBuilderState,
197
204
  ),
198
205
  );
@@ -44,11 +44,12 @@ import {
44
44
  QueryBuilderOLAPGroupByColumnState,
45
45
  QueryBuilderTDS_OLAPAggreationOperatorState,
46
46
  QueryBuilderTDS_OLAPRankOperatorState,
47
- } from './QueryBuilderOLAPGroupByState_.js';
47
+ } from './QueryBuilderOLAPGroupByState.js';
48
48
 
49
49
  export const processTDS_OLAPGroupByExpression = (
50
50
  expression: SimpleFunctionExpression,
51
51
  queryBuilderState: QueryBuilderState,
52
+ parentLambda: LambdaFunction,
52
53
  ): void => {
53
54
  // check parameters
54
55
  const parametersLength = expression.parametersValues.length;
@@ -90,6 +91,7 @@ export const processTDS_OLAPGroupByExpression = (
90
91
  );
91
92
  QueryBuilderValueSpecificationProcessor.process(
92
93
  precedingExpression,
94
+ parentLambda,
93
95
  queryBuilderState,
94
96
  );
95
97
 
@@ -34,7 +34,7 @@ import {
34
34
  type QueryBuilderOLAPGroupByColumnState,
35
35
  type QueryBuilderOLAPGroupByState,
36
36
  QueryBuilderTDS_OLAPAggreationOperatorState,
37
- } from './QueryBuilderOLAPGroupByState_.js';
37
+ } from './QueryBuilderOLAPGroupByState.js';
38
38
 
39
39
  const appendOLAPGroupByColumnState = (
40
40
  olapGroupByColumnState: QueryBuilderOLAPGroupByColumnState,
@@ -20,6 +20,7 @@ import {
20
20
  type Type,
21
21
  type ValueSpecification,
22
22
  type ExecutionResult,
23
+ type VariableExpression,
23
24
  Enumeration,
24
25
  PRIMITIVE_TYPE,
25
26
  observe_ValueSpecification,
@@ -42,6 +43,7 @@ import {
42
43
  hashArray,
43
44
  uniq,
44
45
  type Hashable,
46
+ isNonNullable,
45
47
  } from '@finos/legend-shared';
46
48
  import {
47
49
  action,
@@ -68,6 +70,7 @@ import { QUERY_BUILDER_GROUP_OPERATION } from '../../../QueryBuilderGroupOperati
68
70
  import type { QueryBuilderTDSState } from '../QueryBuilderTDSState.js';
69
71
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../../../../graphManager/QueryBuilderHashUtils.js';
70
72
  import type { QueryBuilderTDSColumnState } from '../QueryBuilderTDSColumnState.js';
73
+ import { isValueExpressionReferencesinValue } from '../../../QueryBuilderValueSpecificationHelper.js';
71
74
 
72
75
  export enum QUERY_BUILDER_POST_FILTER_DND_TYPE {
73
76
  GROUP_CONDITION = 'GROUP_CONDITION',
@@ -876,6 +879,16 @@ export class QueryBuilderPostFilterState
876
879
  Array.from(this.nodes.values()).forEach((node) => node.setIsOpen(true));
877
880
  }
878
881
 
882
+ isVariableUsed(variable: VariableExpression): boolean {
883
+ return Boolean(
884
+ Array.from(this.nodes.values())
885
+ .filter(filterByType(QueryBuilderPostFilterTreeConditionNodeData))
886
+ .map((node) => node.condition.value)
887
+ .filter(isNonNullable)
888
+ .find((value) => isValueExpressionReferencesinValue(variable, value)),
889
+ );
890
+ }
891
+
879
892
  get hashCode(): string {
880
893
  return hashArray([
881
894
  QUERY_BUILDER_HASH_STRUCTURE.POST_FILTER_STATE,
@@ -17,7 +17,7 @@
17
17
  import { Multiplicity } from '@finos/legend-graph';
18
18
  import { UnsupportedOperationError } from '@finos/legend-shared';
19
19
  import { QueryBuilderAggregateColumnState } from '../../aggregation/QueryBuilderAggregationState.js';
20
- import { QueryBuilderOLAPGroupByColumnState } from '../../olapGroupBy/QueryBuilderOLAPGroupByState_.js';
20
+ import { QueryBuilderOLAPGroupByColumnState } from '../../olapGroupBy/QueryBuilderOLAPGroupByState.js';
21
21
  import { QueryBuilderSimpleProjectionColumnState } from '../../projection/QueryBuilderProjectionColumnState.js';
22
22
  import type { QueryBuilderTDSColumnState } from '../../QueryBuilderTDSColumnState.js';
23
23
 
@@ -57,6 +57,7 @@ import {
57
57
  } from '../../../QueryBuilderConfig.js';
58
58
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../../../../graphManager/QueryBuilderHashUtils.js';
59
59
  import { LambdaEditorState } from '../../../shared/LambdaEditorState.js';
60
+ import { isValueExpressionReferencesinValue } from '../../../QueryBuilderValueSpecificationHelper.js';
60
61
 
61
62
  export const QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE = 'PROJECTION_COLUMN';
62
63
 
@@ -124,6 +125,17 @@ export class QueryBuilderSimpleProjectionColumnState
124
125
  this.lambdaParameterName = val;
125
126
  }
126
127
 
128
+ isVariableUsed(variable: VariableExpression): boolean {
129
+ return Boolean(
130
+ this.propertyExpressionState.derivedPropertyExpressionStates.find(
131
+ (derived) =>
132
+ derived.parameterValues.find((param) =>
133
+ isValueExpressionReferencesinValue(variable, param),
134
+ ),
135
+ ),
136
+ );
137
+ }
138
+
127
139
  changeProperty(
128
140
  node: QueryBuilderExplorerTreePropertyNodeData,
129
141
  humanizePropertyName: boolean,
@@ -17,6 +17,7 @@
17
17
  import {
18
18
  type INTERNAL__UnknownValueSpecification,
19
19
  type ValueSpecification,
20
+ type LambdaFunction,
20
21
  AbstractPropertyExpression,
21
22
  CollectionInstanceValue,
22
23
  DerivedProperty,
@@ -59,6 +60,7 @@ import {
59
60
  export const processTDSProjectExpression = (
60
61
  expression: SimpleFunctionExpression,
61
62
  queryBuilderState: QueryBuilderState,
63
+ parentLambda: LambdaFunction,
62
64
  ): void => {
63
65
  // update fetch-structure
64
66
  queryBuilderState.fetchStructureState.changeImplementation(
@@ -87,6 +89,7 @@ export const processTDSProjectExpression = (
87
89
  );
88
90
  QueryBuilderValueSpecificationProcessor.process(
89
91
  precedingExpression,
92
+ parentLambda,
90
93
  queryBuilderState,
91
94
  );
92
95
 
@@ -101,6 +104,7 @@ export const processTDSProjectExpression = (
101
104
  QueryBuilderValueSpecificationProcessor.processChild(
102
105
  value,
103
106
  expression,
107
+ parentLambda,
104
108
  queryBuilderState,
105
109
  ),
106
110
  );
@@ -236,6 +240,7 @@ export const processTDSProjectionDerivationExpression = (
236
240
  export const processTDSTakeExpression = (
237
241
  expression: SimpleFunctionExpression,
238
242
  queryBuilderState: QueryBuilderState,
243
+ parentLambda: LambdaFunction,
239
244
  ): void => {
240
245
  // check parameters
241
246
  assertTrue(
@@ -263,6 +268,7 @@ export const processTDSTakeExpression = (
263
268
  );
264
269
  QueryBuilderValueSpecificationProcessor.process(
265
270
  precedingExpression,
271
+ parentLambda,
266
272
  queryBuilderState,
267
273
  );
268
274
 
@@ -283,6 +289,7 @@ export const processTDSTakeExpression = (
283
289
  export const processTDSDistinctExpression = (
284
290
  expression: SimpleFunctionExpression,
285
291
  queryBuilderState: QueryBuilderState,
292
+ parentLambda: LambdaFunction,
286
293
  ): void => {
287
294
  // check parameters
288
295
  assertTrue(
@@ -309,6 +316,7 @@ export const processTDSDistinctExpression = (
309
316
  );
310
317
  QueryBuilderValueSpecificationProcessor.process(
311
318
  precedingExpression,
319
+ parentLambda,
312
320
  queryBuilderState,
313
321
  );
314
322
 
@@ -326,6 +334,7 @@ export const processTDSDistinctExpression = (
326
334
  export const processTDSSortExpression = (
327
335
  expression: SimpleFunctionExpression,
328
336
  queryBuilderState: QueryBuilderState,
337
+ parentLambda: LambdaFunction,
329
338
  ): void => {
330
339
  // check parameters
331
340
  assertTrue(
@@ -353,6 +362,7 @@ export const processTDSSortExpression = (
353
362
  );
354
363
  QueryBuilderValueSpecificationProcessor.process(
355
364
  precedingExpression,
365
+ parentLambda,
356
366
  queryBuilderState,
357
367
  );
358
368
 
@@ -367,6 +377,7 @@ export const processTDSSortExpression = (
367
377
  QueryBuilderValueSpecificationProcessor.processChild(
368
378
  value,
369
379
  expression,
380
+ parentLambda,
370
381
  queryBuilderState,
371
382
  ),
372
383
  );
@@ -47,7 +47,7 @@ import {
47
47
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../graphManager/QueryBuilderSupportedFunctions.js';
48
48
  import { buildGenericLambdaFunctionInstanceValue } from '../../../QueryBuilderValueSpecificationHelper.js';
49
49
  import { buildPropertyExpressionChain } from '../../../QueryBuilderValueSpecificationBuilderHelper.js';
50
- import { appendOLAPGroupByState } from '../olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js';
50
+ import { appendOLAPGroupByState } from '../olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js';
51
51
  import { appendPostFilter } from '../post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js';
52
52
 
53
53
  const buildSortExpression = (
@@ -31,6 +31,7 @@ import {
31
31
  ActionState,
32
32
  type Hashable,
33
33
  hashArray,
34
+ isNonNullable,
34
35
  } from '@finos/legend-shared';
35
36
  import type { QueryBuilderExplorerTreeDragSource } from '../explorer/QueryBuilderExplorerState.js';
36
37
  import { QueryBuilderPropertyExpressionState } from '../QueryBuilderPropertyEditorState.js';
@@ -39,6 +40,7 @@ import {
39
40
  type ExecutionResult,
40
41
  type AbstractPropertyExpression,
41
42
  type ValueSpecification,
43
+ type VariableExpression,
42
44
  observe_ValueSpecification,
43
45
  } from '@finos/legend-graph';
44
46
  import { DEFAULT_LAMBDA_VARIABLE_NAME } from '../QueryBuilderConfig.js';
@@ -51,6 +53,7 @@ import {
51
53
  import type { QueryBuilderFilterOperator } from './QueryBuilderFilterOperator.js';
52
54
  import { QUERY_BUILDER_GROUP_OPERATION } from '../QueryBuilderGroupOperationHelper.js';
53
55
  import { QUERY_BUILDER_HASH_STRUCTURE } from '../../graphManager/QueryBuilderHashUtils.js';
56
+ import { isValueExpressionReferencesinValue } from '../QueryBuilderValueSpecificationHelper.js';
54
57
 
55
58
  export enum QUERY_BUILDER_FILTER_DND_TYPE {
56
59
  GROUP_CONDITION = 'GROUP_CONDITION',
@@ -791,6 +794,16 @@ export class QueryBuilderFilterState
791
794
  Array.from(this.nodes.values()).forEach((node) => node.setIsOpen(true));
792
795
  }
793
796
 
797
+ isVariableUsed(variable: VariableExpression): boolean {
798
+ return Boolean(
799
+ Array.from(this.nodes.values())
800
+ .filter(filterByType(QueryBuilderFilterTreeConditionNodeData))
801
+ .map((node) => node.condition.value)
802
+ .filter(isNonNullable)
803
+ .find((value) => isValueExpressionReferencesinValue(variable, value)),
804
+ );
805
+ }
806
+
794
807
  get hashCode(): string {
795
808
  return hashArray([
796
809
  QUERY_BUILDER_HASH_STRUCTURE.FILTER_STATE,
@@ -17,6 +17,7 @@
17
17
  import { isNonNullable, guaranteeNonNullable } from '@finos/legend-shared';
18
18
  import {
19
19
  type ValueSpecification,
20
+ type LambdaFunction,
20
21
  extractElementNameFromPath,
21
22
  SimpleFunctionExpression,
22
23
  } from '@finos/legend-graph';
@@ -80,22 +81,25 @@ const buildFilterConditionExpression = (
80
81
 
81
82
  export const buildFilterExpression = (
82
83
  filterState: QueryBuilderFilterState,
83
- getAllFunc: SimpleFunctionExpression,
84
- ): SimpleFunctionExpression | undefined => {
84
+ lambdaFunction: LambdaFunction,
85
+ ): void => {
85
86
  const filterConditionExpressions = filterState.rootIds
86
87
  .map((e) => guaranteeNonNullable(filterState.nodes.get(e)))
87
88
  .map((e) => buildFilterConditionExpression(filterState, e))
88
89
  .filter(isNonNullable);
89
90
 
90
91
  if (!filterConditionExpressions.length) {
91
- return undefined;
92
+ return;
92
93
  }
93
94
  // main filter expression
94
95
  const filterExpression = new SimpleFunctionExpression(
95
96
  extractElementNameFromPath(QUERY_BUILDER_SUPPORTED_FUNCTIONS.FILTER),
96
97
  );
98
+ const currentExpression = guaranteeNonNullable(
99
+ lambdaFunction.expressionSequence[0],
100
+ );
97
101
  // param [0]
98
- filterExpression.parametersValues.push(getAllFunc);
102
+ filterExpression.parametersValues.push(currentExpression);
99
103
  // param [1]
100
104
  filterExpression.parametersValues.push(
101
105
  buildGenericLambdaFunctionInstanceValue(
@@ -104,5 +108,6 @@ export const buildFilterExpression = (
104
108
  filterState.queryBuilderState.graphManagerState.graph,
105
109
  ),
106
110
  );
107
- return filterExpression;
111
+ // reprocess filter as main expression
112
+ lambdaFunction.expressionSequence[0] = filterExpression;
108
113
  };