@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
@@ -79,15 +79,15 @@ import {
79
79
  QueryBuilderDerivationProjectionColumnState,
80
80
  } from '../../stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js';
81
81
  import type { QueryBuilderState } from '../../stores/QueryBuilderState.js';
82
- import {
83
- type QueryBuilderParameterDragSource,
84
- QUERY_BUILDER_PARAMETER_DND_TYPE,
85
- } from '../../stores/QueryBuilderParametersState.js';
86
82
  import { QUERY_BUILDER_TEST_ID } from '../QueryBuilder_TestID.js';
87
83
  import { isTypeCompatibleForAssignment } from '../../stores/QueryBuilderValueSpecificationHelper.js';
88
84
  import { QUERY_BUILDER_GROUP_OPERATION } from '../../stores/QueryBuilderGroupOperationHelper.js';
89
85
  import { QueryBuilderTDSState } from '../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
90
- import { BasicValueSpecificationEditor } from '../shared/BasicValueSpecificationEditor.js';
86
+ import {
87
+ type QueryBuilderVariableDragSource,
88
+ BasicValueSpecificationEditor,
89
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
90
+ } from '../shared/BasicValueSpecificationEditor.js';
91
91
  import {
92
92
  QueryBuilderColumnInfoTooltip,
93
93
  renderPropertyTypeIcon,
@@ -95,7 +95,7 @@ import {
95
95
  import {
96
96
  type QueryBuilderOLAPColumnDragSource,
97
97
  QUERY_BUILDER_OLAP_COLUMN_DND_TYPE,
98
- } from '../../stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js';
98
+ } from '../../stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js';
99
99
  import type { QueryBuilderTDSColumnState } from '../../stores/fetch-structure/tds/QueryBuilderTDSColumnState.js';
100
100
 
101
101
  const QueryBuilderPostFilterConditionContextMenu = observer(
@@ -280,9 +280,9 @@ const QueryBuilderPostFilterConditionEditor = observer(
280
280
  isDragOver: boolean;
281
281
  }) => {
282
282
  const { node, isDragOver } = props;
283
- const graph =
284
- node.condition.postFilterState.tdsState.queryBuilderState
285
- .graphManagerState.graph;
283
+ const queryBuilderState =
284
+ node.condition.postFilterState.tdsState.queryBuilderState;
285
+ const graph = queryBuilderState.graphManagerState.graph;
286
286
  const applicationStore = useApplicationStore();
287
287
  const changeOperator = (val: QueryBuilderPostFilterOperator) => (): void =>
288
288
  node.condition.changeOperator(val);
@@ -299,15 +299,14 @@ const QueryBuilderPostFilterConditionEditor = observer(
299
299
  };
300
300
  // Drag and Drop on filter condition value
301
301
  const handleDrop = useCallback(
302
- (item: QueryBuilderParameterDragSource): void => {
303
- const parameterType =
304
- item.variable.parameter.genericType?.value.rawType;
302
+ (item: QueryBuilderVariableDragSource): void => {
303
+ const parameterType = item.variable.genericType?.value.rawType;
305
304
  const conditionValueType = node.condition.columnState.getColumnType();
306
305
  if (
307
306
  conditionValueType &&
308
307
  isTypeCompatibleForAssignment(parameterType, conditionValueType)
309
308
  ) {
310
- node.condition.setValue(item.variable.parameter);
309
+ node.condition.setValue(item.variable);
311
310
  } else {
312
311
  applicationStore.notifyWarning(
313
312
  `Incompatible parameter type ${parameterType?.name}. ${parameterType?.name} is not compatible with type ${conditionValueType?.name}.`,
@@ -317,12 +316,12 @@ const QueryBuilderPostFilterConditionEditor = observer(
317
316
  [applicationStore, node.condition],
318
317
  );
319
318
  const [{ isFilterValueDragOver }, dropConnector] = useDrop<
320
- QueryBuilderParameterDragSource,
319
+ QueryBuilderVariableDragSource,
321
320
  void,
322
321
  { isFilterValueDragOver: boolean }
323
322
  >(
324
323
  () => ({
325
- accept: [QUERY_BUILDER_PARAMETER_DND_TYPE],
324
+ accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
326
325
  drop: (item, monitor): void => {
327
326
  if (!monitor.didDrop()) {
328
327
  handleDrop(item);
@@ -417,10 +416,7 @@ const QueryBuilderPostFilterConditionEditor = observer(
417
416
  valueSpecification={node.condition.value}
418
417
  setValueSpecification={changeValueSpecification}
419
418
  graph={graph}
420
- obseverContext={
421
- node.condition.postFilterState.tdsState.queryBuilderState
422
- .observableContext
423
- }
419
+ obseverContext={queryBuilderState.observableContext}
424
420
  typeCheckOption={{
425
421
  expectedType: guaranteeNonNullable(
426
422
  node.condition.columnState.getColumnType(),
@@ -428,6 +424,9 @@ const QueryBuilderPostFilterConditionEditor = observer(
428
424
  }}
429
425
  resetValue={resetNode}
430
426
  selectorConfig={selectorConfig}
427
+ isConstant={queryBuilderState.constantState.isValueSpecConstant(
428
+ node.condition.value,
429
+ )}
431
430
  />
432
431
  </PanelEntryDropZonePlaceholder>
433
432
  </div>
@@ -21,7 +21,7 @@ import {
21
21
  ResizablePanelSplitter,
22
22
  } from '@finos/legend-art';
23
23
  import { QueryBuilderFilterPanel } from '../filter/QueryBuilderFilterPanel.js';
24
- import { QueryBuilderOlapGroupByPanel } from './QueryBuilderOLAPGroupByPanel_.js';
24
+ import { QueryBuilderOlapGroupByPanel } from './QueryBuilderOLAPGroupByPanel.js';
25
25
  import { QueryBuilderPostFilterPanel } from './QueryBuilderPostFilterPanel.js';
26
26
  import type { QueryBuilderTDSState } from '../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
27
27
 
@@ -55,10 +55,6 @@ import { QueryResultModifierModal } from './QueryBuilderResultModifierPanel.js';
55
55
  import { QUERY_BUILDER_TEST_ID } from '../QueryBuilder_TestID.js';
56
56
  import { flowResult } from 'mobx';
57
57
  import { useApplicationStore } from '@finos/legend-application';
58
- import {
59
- type QueryBuilderParameterDragSource,
60
- QUERY_BUILDER_PARAMETER_DND_TYPE,
61
- } from '../../stores/QueryBuilderParametersState.js';
62
58
  import {
63
59
  type ConcreteFunctionDefinition,
64
60
  generateFunctionCallString,
@@ -73,6 +69,10 @@ import { DEFAULT_LAMBDA_VARIABLE_NAME } from '../../stores/QueryBuilderConfig.js
73
69
  import type { QueryBuilderAggregateOperator } from '../../stores/fetch-structure/tds/aggregation/QueryBuilderAggregateOperator.js';
74
70
  import type { QueryBuilderTDSState } from '../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
75
71
  import { LambdaEditor } from '../shared/LambdaEditor.js';
72
+ import {
73
+ type QueryBuilderVariableDragSource,
74
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
75
+ } from '../shared/BasicValueSpecificationEditor.js';
76
76
 
77
77
  const QueryBuilderProjectionColumnContextMenu = observer(
78
78
  forwardRef<
@@ -146,16 +146,16 @@ const QueryBuilderDerivationProjectionColumnEditor = observer(
146
146
  (
147
147
  item:
148
148
  | QueryBuilderExplorerTreeDragSource
149
- | QueryBuilderParameterDragSource
149
+ | QueryBuilderVariableDragSource
150
150
  | QueryBuilderFunctionsExplorerDragSource,
151
151
  type: string,
152
152
  ): void => {
153
- if (type === QUERY_BUILDER_PARAMETER_DND_TYPE) {
153
+ if (type === QUERY_BUILDER_VARIABLE_DND_TYPE) {
154
154
  projectionColumnState.derivationLambdaEditorState.setLambdaString(
155
155
  `${
156
156
  projectionColumnState.derivationLambdaEditorState.lambdaString
157
157
  }${VARIABLE_REFERENCE_TOKEN}${
158
- (item as QueryBuilderParameterDragSource).variable.variableName
158
+ (item as QueryBuilderVariableDragSource).variable.name
159
159
  }`,
160
160
  );
161
161
  } else if (type === QUERY_BUILDER_FUNCTION_DND_TYPE) {
@@ -178,7 +178,7 @@ const QueryBuilderDerivationProjectionColumnEditor = observer(
178
178
  );
179
179
  const [, dropConnector] = useDrop<
180
180
  | QueryBuilderExplorerTreeDragSource
181
- | QueryBuilderParameterDragSource
181
+ | QueryBuilderVariableDragSource
182
182
  | QueryBuilderFunctionsExplorerDragSource
183
183
  >(
184
184
  () => ({
@@ -187,7 +187,7 @@ const QueryBuilderDerivationProjectionColumnEditor = observer(
187
187
  QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.CLASS_PROPERTY,
188
188
  QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.ENUM_PROPERTY,
189
189
  QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.PRIMITIVE_PROPERTY,
190
- QUERY_BUILDER_PARAMETER_DND_TYPE,
190
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
191
191
  QUERY_BUILDER_FUNCTION_DND_TYPE,
192
192
  ],
193
193
  drop: (item, monitor): void => {
@@ -70,10 +70,6 @@ import {
70
70
  } from '@finos/legend-shared';
71
71
  import { QUERY_BUILDER_TEST_ID } from '../QueryBuilder_TestID.js';
72
72
  import { useApplicationStore } from '@finos/legend-application';
73
- import {
74
- type QueryBuilderParameterDragSource,
75
- QUERY_BUILDER_PARAMETER_DND_TYPE,
76
- } from '../../stores/QueryBuilderParametersState.js';
77
73
  import type { ValueSpecification } from '@finos/legend-graph';
78
74
  import {
79
75
  type QueryBuilderProjectionColumnDragSource,
@@ -83,7 +79,11 @@ import {
83
79
  import type { QueryBuilderFilterOperator } from '../../stores/filter/QueryBuilderFilterOperator.js';
84
80
  import { isTypeCompatibleForAssignment } from '../../stores/QueryBuilderValueSpecificationHelper.js';
85
81
  import { QUERY_BUILDER_GROUP_OPERATION } from '../../stores/QueryBuilderGroupOperationHelper.js';
86
- import { BasicValueSpecificationEditor } from '../shared/BasicValueSpecificationEditor.js';
82
+ import {
83
+ BasicValueSpecificationEditor,
84
+ type QueryBuilderVariableDragSource,
85
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
86
+ } from '../shared/BasicValueSpecificationEditor.js';
87
87
 
88
88
  const QueryBuilderFilterGroupConditionEditor = observer(
89
89
  (props: {
@@ -139,6 +139,7 @@ const QueryBuilderFilterConditionEditor = observer(
139
139
  const { node, isDragOver } = props;
140
140
  const graph =
141
141
  node.condition.filterState.queryBuilderState.graphManagerState.graph;
142
+ const queryBuilderState = node.condition.filterState.queryBuilderState;
142
143
  const applicationStore = useApplicationStore();
143
144
  const changeOperator = (val: QueryBuilderFilterOperator) => (): void =>
144
145
  node.condition.changeOperator(val);
@@ -148,19 +149,18 @@ const QueryBuilderFilterConditionEditor = observer(
148
149
  node.condition.changeProperty(
149
150
  buildPropertyExpressionFromExplorerTreeNodeData(
150
151
  propertyNode,
151
- node.condition.filterState.queryBuilderState.explorerState,
152
+ queryBuilderState.explorerState,
152
153
  ),
153
154
  );
154
155
  // Drag and Drop on filter condition value
155
156
  const handleDrop = useCallback(
156
- (item: QueryBuilderParameterDragSource): void => {
157
- const parameterType =
158
- item.variable.parameter.genericType?.value.rawType;
157
+ (item: QueryBuilderVariableDragSource): void => {
158
+ const parameterType = item.variable.genericType?.value.rawType;
159
159
  const conditionValueType =
160
160
  node.condition.propertyExpressionState.propertyExpression.func.value
161
161
  .genericType.value.rawType;
162
162
  if (isTypeCompatibleForAssignment(parameterType, conditionValueType)) {
163
- node.condition.setValue(item.variable.parameter);
163
+ node.condition.setValue(item.variable);
164
164
  } else {
165
165
  applicationStore.notifyWarning(
166
166
  `Incompatible parameter type ${parameterType?.name}. ${parameterType?.name} is not compatible with type ${conditionValueType.name}.`,
@@ -170,12 +170,12 @@ const QueryBuilderFilterConditionEditor = observer(
170
170
  [applicationStore, node.condition],
171
171
  );
172
172
  const [{ isFilterValueDragOver }, dropConnector] = useDrop<
173
- QueryBuilderParameterDragSource,
173
+ QueryBuilderVariableDragSource,
174
174
  void,
175
175
  { isFilterValueDragOver: boolean }
176
176
  >(
177
177
  () => ({
178
- accept: [QUERY_BUILDER_PARAMETER_DND_TYPE],
178
+ accept: [QUERY_BUILDER_VARIABLE_DND_TYPE],
179
179
  drop: (item, monitor): void => {
180
180
  if (!monitor.didDrop()) {
181
181
  handleDrop(item);
@@ -212,7 +212,6 @@ const QueryBuilderFilterConditionEditor = observer(
212
212
  reloadValues: debouncedTypeaheadSearch,
213
213
  cleanUpReloadValues,
214
214
  };
215
-
216
215
  return (
217
216
  <div className="query-builder-filter-tree__node__label__content">
218
217
  <PanelEntryDropZonePlaceholder
@@ -270,10 +269,7 @@ const QueryBuilderFilterConditionEditor = observer(
270
269
  valueSpecification={node.condition.value}
271
270
  setValueSpecification={changeValueSpecification}
272
271
  graph={graph}
273
- obseverContext={
274
- node.condition.filterState.queryBuilderState
275
- .observableContext
276
- }
272
+ obseverContext={queryBuilderState.observableContext}
277
273
  typeCheckOption={{
278
274
  expectedType:
279
275
  node.condition.propertyExpressionState
@@ -282,6 +278,9 @@ const QueryBuilderFilterConditionEditor = observer(
282
278
  }}
283
279
  resetValue={resetNode}
284
280
  selectorConfig={selectorConfig}
281
+ isConstant={queryBuilderState.constantState.isValueSpecConstant(
282
+ node.condition.value,
283
+ )}
285
284
  />
286
285
  </PanelEntryDropZonePlaceholder>
287
286
  </div>
@@ -28,6 +28,7 @@ import {
28
28
  CustomSelectorInput,
29
29
  SaveIcon,
30
30
  PencilIcon,
31
+ DragPreviewLayer,
31
32
  } from '@finos/legend-art';
32
33
  import {
33
34
  type Enum,
@@ -80,7 +81,7 @@ type TypeCheckOption = {
80
81
  match?: boolean;
81
82
  };
82
83
 
83
- const ParameterInfoTooltip: React.FC<{
84
+ export const VariableInfoTooltip: React.FC<{
84
85
  variable: VariableExpression;
85
86
  children: React.ReactElement;
86
87
  placement?: TooltipPlacement | undefined;
@@ -136,35 +137,55 @@ const ParameterInfoTooltip: React.FC<{
136
137
  );
137
138
  };
138
139
 
140
+ export const QUERY_BUILDER_VARIABLE_DND_TYPE = 'VARIABLE';
141
+
142
+ export interface QueryBuilderVariableDragSource {
143
+ variable: VariableExpression;
144
+ }
145
+
139
146
  const VariableExpressionParameterEditor = observer(
140
147
  (props: {
141
148
  valueSpecification: VariableExpression;
142
- className?: string | undefined;
143
149
  resetValue: () => void;
150
+ className?: string | undefined;
151
+ isConstant?: boolean;
144
152
  }) => {
145
- const { valueSpecification, className, resetValue } = props;
153
+ const { valueSpecification, resetValue, isConstant, className } = props;
146
154
  const varName = valueSpecification.name;
147
155
  return (
148
- <div className={clsx('value-spec-editor__parameter', className)}>
149
- <div className="value-spec-editor__parameter__icon">
150
- <DollarIcon />
151
- </div>
152
- <div className="value-spec-editor__parameter__label">
153
- <div className="value-spec-editor__parameter__text">{varName}</div>
154
- <ParameterInfoTooltip variable={valueSpecification}>
155
- <div className="value-spec-editor__parameter__info">
156
- <InfoCircleIcon />
157
- </div>
158
- </ParameterInfoTooltip>
159
- <button
160
- className="value-spec-editor__parameter__reset-btn"
161
- title="Reset"
162
- onClick={resetValue}
163
- >
164
- <RefreshIcon />
165
- </button>
156
+ <>
157
+ <DragPreviewLayer
158
+ labelGetter={(item: QueryBuilderVariableDragSource): string =>
159
+ item.variable.name
160
+ }
161
+ types={[QUERY_BUILDER_VARIABLE_DND_TYPE]}
162
+ />
163
+ <div
164
+ className={clsx('value-spec-editor__variable', className, {
165
+ 'value-spec-editor__variable__constant': isConstant,
166
+ })}
167
+ >
168
+ <div className="value-spec-editor__variable__icon">
169
+ {isConstant ? <div className="icon">C</div> : <DollarIcon />}
170
+ </div>
171
+ <div className="value-spec-editor__variable__label">
172
+ <div className="value-spec-editor__variable__text">{varName}</div>
173
+ <VariableInfoTooltip variable={valueSpecification}>
174
+ <div className="value-spec-editor__variable__info">
175
+ <InfoCircleIcon />
176
+ </div>
177
+ </VariableInfoTooltip>
178
+
179
+ <button
180
+ className="value-spec-editor__variable__reset-btn"
181
+ title="Reset"
182
+ onClick={resetValue}
183
+ >
184
+ <RefreshIcon />
185
+ </button>
186
+ </div>
166
187
  </div>
167
- </div>
188
+ </>
168
189
  );
169
190
  },
170
191
  );
@@ -682,6 +703,7 @@ export const BasicValueSpecificationEditor: React.FC<{
682
703
  className?: string | undefined;
683
704
  setValueSpecification: (val: ValueSpecification) => void;
684
705
  resetValue: () => void;
706
+ isConstant?: boolean;
685
707
  selectorConfig?:
686
708
  | {
687
709
  values: string[] | undefined;
@@ -702,6 +724,7 @@ export const BasicValueSpecificationEditor: React.FC<{
702
724
  setValueSpecification,
703
725
  resetValue,
704
726
  selectorConfig,
727
+ isConstant,
705
728
  } = props;
706
729
  if (valueSpecification instanceof PrimitiveInstanceValue) {
707
730
  const _type = valueSpecification.genericType.value.rawType;
@@ -728,6 +751,7 @@ export const BasicValueSpecificationEditor: React.FC<{
728
751
  case PRIMITIVE_TYPE.NUMBER:
729
752
  case PRIMITIVE_TYPE.FLOAT:
730
753
  case PRIMITIVE_TYPE.DECIMAL:
754
+ case PRIMITIVE_TYPE.BINARY:
731
755
  case PRIMITIVE_TYPE.INTEGER:
732
756
  return (
733
757
  <NumberPrimitiveInstanceValueEditor
@@ -790,6 +814,7 @@ export const BasicValueSpecificationEditor: React.FC<{
790
814
  valueSpecification={valueSpecification}
791
815
  className={className}
792
816
  resetValue={resetValue}
817
+ isConstant={Boolean(isConstant)}
793
818
  />
794
819
  );
795
820
  } else if (valueSpecification instanceof INTERNAL__PropagatedValue) {
@@ -46,7 +46,6 @@ import {
46
46
  import { flowResult } from 'mobx';
47
47
  import { ParserError, type EngineError, type Type } from '@finos/legend-graph';
48
48
  import {
49
- createPassThroughOnKeyHandler,
50
49
  EDITOR_LANGUAGE,
51
50
  EDITOR_THEME,
52
51
  TAB_SIZE,
@@ -191,13 +190,6 @@ const LambdaEditorInline = observer(
191
190
  : EDITOR_THEME.LEGEND,
192
191
  ...lambdaEditorOptions,
193
192
  });
194
- // NOTE: if we ever set any hotkey explicitly, we would like to use the disposer partern instead
195
- // else, we could risk triggering these hotkeys command multiple times
196
- // e.g.
197
- // const onKeyDownEventDisposer = useRef<IDisposable | undefined>(undefined);
198
- // onKeyDownEventDisposer.current?.dispose();
199
- // onKeyDownEventDisposer.current = editor.onKeyDown(() => ...)
200
- _editor.onKeyDown(() => createPassThroughOnKeyHandler());
201
193
  setEditor(_editor);
202
194
  }
203
195
  }, [editor, applicationStore, useBaseTextEditorSettings]);
@@ -472,13 +464,6 @@ const LambdaEditorPopUp = observer(
472
464
  language: EDITOR_LANGUAGE.PURE,
473
465
  theme: EDITOR_THEME.LEGEND,
474
466
  });
475
- // NOTE: if we ever set any hotkey explicitly, we would like to use the disposer partern instead
476
- // else, we could risk triggering these hotkeys command multiple times
477
- // e.g.
478
- // const onKeyDownEventDisposer = useRef<IDisposable | undefined>(undefined);
479
- // onKeyDownEventDisposer.current?.dispose();
480
- // onKeyDownEventDisposer.current = editor.onKeyDown(() => ...)
481
- _editor.onKeyDown(() => createPassThroughOnKeyHandler());
482
467
  setEditor(_editor);
483
468
  }
484
469
  };
@@ -0,0 +1,186 @@
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
+ DollarIcon,
19
+ DragPreviewLayer,
20
+ InfoCircleIcon,
21
+ PanelFormListItems,
22
+ PencilIcon,
23
+ TimesIcon,
24
+ useDragPreviewLayer,
25
+ } from '@finos/legend-art';
26
+ import type {
27
+ ValueSpecification,
28
+ VariableExpression,
29
+ } from '@finos/legend-graph';
30
+ import { observer } from 'mobx-react-lite';
31
+ import { useDrag } from 'react-dnd';
32
+ import type { QueryBuilderState } from '../../stores/QueryBuilderState.js';
33
+ import { getValueSpecificationStringValue } from '../../stores/shared/ValueSpecificationEditorHelper.js';
34
+ import {
35
+ type QueryBuilderVariableDragSource,
36
+ QUERY_BUILDER_VARIABLE_DND_TYPE,
37
+ VariableInfoTooltip,
38
+ } from './BasicValueSpecificationEditor.js';
39
+
40
+ export const VariableViewer = observer(
41
+ (props: {
42
+ variable: VariableExpression;
43
+ isReadOnly: boolean;
44
+ constantValue?: ValueSpecification | undefined;
45
+ actions?: {
46
+ editVariable: () => void;
47
+ deleteVariable: () => void;
48
+ };
49
+ }) => {
50
+ const { variable, constantValue, actions, isReadOnly } = props;
51
+ const valueString = constantValue
52
+ ? getValueSpecificationStringValue(constantValue)
53
+ : undefined;
54
+ const name = variable.name;
55
+ const variableType = variable.genericType?.value.rawType;
56
+ const typeName = variableType?.name;
57
+ const editVariable = (): void => {
58
+ actions?.editVariable();
59
+ };
60
+ const deleteVariable = (): void => {
61
+ actions?.deleteVariable();
62
+ };
63
+ const [, dragConnector, dragPreviewConnector] = useDrag(
64
+ () => ({
65
+ type: QUERY_BUILDER_VARIABLE_DND_TYPE,
66
+ item: { variable: variable },
67
+ }),
68
+ [variable],
69
+ );
70
+ useDragPreviewLayer(dragPreviewConnector);
71
+
72
+ return (
73
+ <div className="query-builder__variables__variable" ref={dragConnector}>
74
+ <DragPreviewLayer
75
+ labelGetter={(item: QueryBuilderVariableDragSource): string =>
76
+ item.variable.name === '' ? '(unknown)' : item.variable.name
77
+ }
78
+ types={[QUERY_BUILDER_VARIABLE_DND_TYPE]}
79
+ />
80
+ <div
81
+ onClick={editVariable}
82
+ className="query-builder__variables__variable__content"
83
+ >
84
+ <div className="query-builder__variables__variable__icon">
85
+ <div className="query-builder__variables__variable-icon">
86
+ {constantValue ? (
87
+ <div className="icon query-builder__variables__variable-icon">
88
+ C
89
+ </div>
90
+ ) : (
91
+ <DollarIcon />
92
+ )}
93
+ </div>
94
+ </div>
95
+ <div className="query-builder__variables__variable__label">
96
+ {name}
97
+ {valueString ? (
98
+ <div className="query-builder__constants__value">
99
+ {valueString}
100
+ </div>
101
+ ) : (
102
+ <div className="query-builder__variables__variable__type">
103
+ <div className="query-builder__variables__variable__type__label">
104
+ {typeName}
105
+ </div>
106
+ </div>
107
+ )}
108
+ </div>
109
+ </div>
110
+ {actions && (
111
+ <div className="query-builder__variables__variable__actions">
112
+ <button
113
+ className="query-builder__variables__variable__action"
114
+ tabIndex={-1}
115
+ disabled={isReadOnly}
116
+ onClick={editVariable}
117
+ title="Edit"
118
+ >
119
+ <PencilIcon />
120
+ </button>
121
+ <button
122
+ className="query-builder__variables__variable__action"
123
+ tabIndex={-1}
124
+ onClick={deleteVariable}
125
+ disabled={isReadOnly}
126
+ title="Remove"
127
+ >
128
+ <TimesIcon />
129
+ </button>
130
+ <VariableInfoTooltip variable={variable}>
131
+ <div className="value-spec-editor__variable__info">
132
+ <InfoCircleIcon />
133
+ </div>
134
+ </VariableInfoTooltip>
135
+ </div>
136
+ )}
137
+ </div>
138
+ );
139
+ },
140
+ );
141
+
142
+ export const VariableSelector = observer(
143
+ (props: {
144
+ queryBuilderState: QueryBuilderState;
145
+ filterBy?: (variableExpression: VariableExpression) => boolean;
146
+ }) => {
147
+ const { queryBuilderState, filterBy } = props;
148
+ const isReadOnly = !queryBuilderState.isQuerySupported;
149
+ const filteredParameterStates =
150
+ queryBuilderState.parametersState.parameterStates.filter((p) =>
151
+ filterBy ? filterBy(p.parameter) : true,
152
+ );
153
+ const filteredConstantState =
154
+ queryBuilderState.constantState.constants.filter((c) =>
155
+ filterBy ? filterBy(c.variable) : true,
156
+ );
157
+ return (
158
+ <>
159
+ <PanelFormListItems title="Available parameters">
160
+ {filteredParameterStates.length === 0 && (
161
+ <> No available parameters </>
162
+ )}
163
+ {filteredParameterStates.map((pState) => (
164
+ <VariableViewer
165
+ key={pState.uuid}
166
+ variable={pState.parameter}
167
+ isReadOnly={isReadOnly}
168
+ />
169
+ ))}
170
+ </PanelFormListItems>
171
+ {Boolean(filteredConstantState.length) && (
172
+ <PanelFormListItems title="Available constants">
173
+ {filteredConstantState.map((constantState) => (
174
+ <VariableViewer
175
+ key={constantState.uuid}
176
+ variable={constantState.variable}
177
+ constantValue={constantState.value}
178
+ isReadOnly={isReadOnly}
179
+ />
180
+ ))}
181
+ </PanelFormListItems>
182
+ )}
183
+ </>
184
+ );
185
+ },
186
+ );