@finos/legend-query-builder 3.0.7 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (320) hide show
  1. package/lib/__lib__/QueryBuilderDocumentation.d.ts +0 -1
  2. package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderDocumentation.js +0 -1
  4. package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
  5. package/lib/__lib__/QueryBuilderEvent.d.ts +18 -0
  6. package/lib/__lib__/QueryBuilderEvent.d.ts.map +1 -1
  7. package/lib/__lib__/QueryBuilderEvent.js +20 -0
  8. package/lib/__lib__/QueryBuilderEvent.js.map +1 -1
  9. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts +14 -0
  10. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts.map +1 -1
  11. package/lib/__lib__/QueryBuilderTelemetryHelper.js +43 -1
  12. package/lib/__lib__/QueryBuilderTelemetryHelper.js.map +1 -1
  13. package/lib/components/QueryBuilder.d.ts +0 -1
  14. package/lib/components/QueryBuilder.d.ts.map +1 -1
  15. package/lib/components/QueryBuilder.js +74 -36
  16. package/lib/components/QueryBuilder.js.map +1 -1
  17. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +0 -1
  18. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  19. package/lib/components/QueryBuilderDiffPanel.d.ts +0 -1
  20. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  21. package/lib/components/QueryBuilderParametersPanel.d.ts +0 -1
  22. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  23. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +0 -1
  24. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderResultPanel.d.ts +0 -1
  26. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  27. package/lib/components/QueryBuilderSideBar.d.ts +0 -1
  28. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  29. package/lib/components/QueryBuilderTextEditor.d.ts +0 -1
  30. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  31. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +0 -1
  32. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  33. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +0 -1
  34. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  35. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +0 -1
  36. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  37. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +0 -1
  38. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  39. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +0 -1
  40. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  41. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +0 -1
  42. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  43. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +0 -1
  44. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  45. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +13 -3
  46. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  47. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +0 -1
  48. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +0 -1
  50. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +17 -0
  52. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +152 -15
  54. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  55. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts +0 -1
  56. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +2 -2
  58. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  59. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +0 -1
  60. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  61. package/lib/components/filter/QueryBuilderFilterPanel.js +14 -3
  62. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  63. package/lib/components/shared/LambdaEditor.d.ts +0 -1
  64. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  65. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +0 -1
  66. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  67. package/lib/components/shared/LambdaParameterValuesEditor.js +2 -1
  68. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
  69. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +0 -1
  70. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  71. package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -1
  72. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  73. package/lib/graph/QueryBuilderMetaModelConst.d.ts +33 -0
  74. package/lib/graph/QueryBuilderMetaModelConst.d.ts.map +1 -1
  75. package/lib/graph/QueryBuilderMetaModelConst.js +34 -0
  76. package/lib/graph/QueryBuilderMetaModelConst.js.map +1 -1
  77. package/lib/graph-manager/QueryBuilderConst.d.ts +20 -0
  78. package/lib/graph-manager/QueryBuilderConst.d.ts.map +1 -0
  79. package/lib/graph-manager/QueryBuilderConst.js +21 -0
  80. package/lib/graph-manager/QueryBuilderConst.js.map +1 -0
  81. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
  82. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +3 -2
  83. package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
  84. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
  85. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +27 -14
  86. package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
  87. package/lib/index.css +2 -2
  88. package/lib/index.css.map +1 -1
  89. package/lib/package.json +4 -4
  90. package/lib/stores/QueryBuilderState.d.ts +3 -2
  91. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  92. package/lib/stores/QueryBuilderState.js +12 -6
  93. package/lib/stores/QueryBuilderState.js.map +1 -1
  94. package/lib/stores/QueryBuilderStateBuilder.d.ts +1 -1
  95. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  96. package/lib/stores/QueryBuilderStateBuilder.js +11 -2
  97. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  98. package/lib/stores/QueryBuilderStateHashUtils.d.ts +32 -1
  99. package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
  100. package/lib/stores/QueryBuilderStateHashUtils.js +32 -0
  101. package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
  102. package/lib/stores/QueryBuilderTextEditorState.d.ts.map +1 -1
  103. package/lib/stores/QueryBuilderTextEditorState.js +12 -6
  104. package/lib/stores/QueryBuilderTextEditorState.js.map +1 -1
  105. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +1 -1
  106. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
  107. package/lib/stores/explorer/QueryBuilderExplorerState.js +2 -2
  108. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  109. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
  110. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +1 -0
  111. package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
  112. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +2 -0
  113. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  114. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +14 -4
  115. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  116. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.d.ts +38 -0
  117. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.d.ts.map +1 -0
  118. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js +54 -0
  119. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js.map +1 -0
  120. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.d.ts +18 -0
  121. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.d.ts.map +1 -0
  122. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.js +80 -0
  123. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.js.map +1 -0
  124. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts +8 -1
  125. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.d.ts.map +1 -1
  126. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js +24 -1
  127. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.js.map +1 -1
  128. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
  129. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +23 -0
  130. package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
  131. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.d.ts +22 -0
  132. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.d.ts.map +1 -0
  133. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.js +61 -0
  134. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.js.map +1 -0
  135. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.d.ts +28 -0
  136. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.d.ts.map +1 -0
  137. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.js +55 -0
  138. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.js.map +1 -0
  139. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.d.ts +28 -0
  140. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.d.ts.map +1 -0
  141. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.js +55 -0
  142. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.js.map +1 -0
  143. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.d.ts +28 -0
  144. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.d.ts.map +1 -0
  145. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.js +55 -0
  146. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.js.map +1 -0
  147. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.d.ts +28 -0
  148. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.d.ts.map +1 -0
  149. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.js +55 -0
  150. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.js.map +1 -0
  151. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.d.ts +28 -0
  152. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.d.ts.map +1 -0
  153. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.js +55 -0
  154. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.js.map +1 -0
  155. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.d.ts +28 -0
  156. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.d.ts.map +1 -0
  157. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.js +55 -0
  158. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.js.map +1 -0
  159. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.d.ts +28 -0
  160. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.d.ts.map +1 -0
  161. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.js +55 -0
  162. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.js.map +1 -0
  163. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.d.ts +28 -0
  164. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.d.ts.map +1 -0
  165. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.js +55 -0
  166. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.js.map +1 -0
  167. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.d.ts +28 -0
  168. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.d.ts.map +1 -0
  169. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.js +55 -0
  170. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.js.map +1 -0
  171. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.d.ts +28 -0
  172. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.d.ts.map +1 -0
  173. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.js +55 -0
  174. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.js.map +1 -0
  175. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.d.ts +28 -0
  176. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.d.ts.map +1 -0
  177. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.js +55 -0
  178. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.js.map +1 -0
  179. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.d.ts +28 -0
  180. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.d.ts.map +1 -0
  181. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.js +55 -0
  182. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.js.map +1 -0
  183. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.d.ts +28 -0
  184. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.d.ts.map +1 -0
  185. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.js +55 -0
  186. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.js.map +1 -0
  187. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.d.ts +28 -0
  188. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.d.ts.map +1 -0
  189. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.js +55 -0
  190. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.js.map +1 -0
  191. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.d.ts +28 -0
  192. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.d.ts.map +1 -0
  193. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.js +55 -0
  194. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.js.map +1 -0
  195. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.d.ts +28 -0
  196. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.d.ts.map +1 -0
  197. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.js +55 -0
  198. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.js.map +1 -0
  199. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.d.ts +28 -0
  200. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.d.ts.map +1 -0
  201. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.js +55 -0
  202. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.js.map +1 -0
  203. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.d.ts +28 -0
  204. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.d.ts.map +1 -0
  205. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.js +55 -0
  206. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.js.map +1 -0
  207. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.d.ts +28 -0
  208. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.d.ts.map +1 -0
  209. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.js +55 -0
  210. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.js.map +1 -0
  211. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.d.ts +28 -0
  212. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.d.ts.map +1 -0
  213. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.js +55 -0
  214. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.js.map +1 -0
  215. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.d.ts +28 -0
  216. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.d.ts.map +1 -0
  217. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.js +55 -0
  218. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.js.map +1 -0
  219. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.d.ts +28 -0
  220. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.d.ts.map +1 -0
  221. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.js +55 -0
  222. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.js.map +1 -0
  223. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.d.ts +28 -0
  224. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.d.ts.map +1 -0
  225. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.js +55 -0
  226. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.js.map +1 -0
  227. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.d.ts +28 -0
  228. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.d.ts.map +1 -0
  229. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.js +55 -0
  230. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.js.map +1 -0
  231. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.d.ts +28 -0
  232. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.d.ts.map +1 -0
  233. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.js +55 -0
  234. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.js.map +1 -0
  235. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.d.ts +28 -0
  236. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.d.ts.map +1 -0
  237. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.js +55 -0
  238. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.js.map +1 -0
  239. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.d.ts +28 -0
  240. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.d.ts.map +1 -0
  241. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.js +55 -0
  242. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.js.map +1 -0
  243. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.d.ts +28 -0
  244. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.d.ts.map +1 -0
  245. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.js +55 -0
  246. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.js.map +1 -0
  247. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.d.ts +28 -0
  248. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.d.ts.map +1 -0
  249. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.js +55 -0
  250. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.js.map +1 -0
  251. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.d.ts +28 -0
  252. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.d.ts.map +1 -0
  253. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.js +55 -0
  254. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.js.map +1 -0
  255. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.d.ts +28 -0
  256. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.d.ts.map +1 -0
  257. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.js +55 -0
  258. package/lib/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.js.map +1 -0
  259. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
  260. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +9 -1
  261. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
  262. package/package.json +10 -10
  263. package/src/__lib__/QueryBuilderDocumentation.ts +0 -2
  264. package/src/__lib__/QueryBuilderEvent.ts +20 -0
  265. package/src/__lib__/QueryBuilderTelemetryHelper.ts +131 -1
  266. package/src/components/QueryBuilder.tsx +226 -188
  267. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +96 -60
  268. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +456 -94
  269. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +2 -4
  270. package/src/components/filter/QueryBuilderFilterPanel.tsx +102 -60
  271. package/src/components/shared/LambdaParameterValuesEditor.tsx +2 -1
  272. package/src/graph/QueryBuilderMetaModelConst.ts +34 -0
  273. package/src/graph-manager/QueryBuilderConst.ts +20 -0
  274. package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +10 -1
  275. package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +73 -28
  276. package/src/stores/QueryBuilderState.ts +12 -9
  277. package/src/stores/QueryBuilderStateBuilder.ts +33 -2
  278. package/src/stores/QueryBuilderStateHashUtils.ts +33 -0
  279. package/src/stores/QueryBuilderTextEditorState.ts +21 -14
  280. package/src/stores/explorer/QueryBuilderExplorerState.ts +2 -1
  281. package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +1 -0
  282. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +22 -3
  283. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.ts +98 -0
  284. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunctionLoader.ts +83 -0
  285. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationState.ts +31 -0
  286. package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +41 -0
  287. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunctionValueSpecificationBuilder.ts +175 -0
  288. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Annualized.ts +98 -0
  289. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cme.ts +98 -0
  290. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw.ts +98 -0
  291. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cw_Fm.ts +99 -0
  292. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus2.ts +98 -0
  293. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Cy_Minus3.ts +98 -0
  294. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Mtd.ts +98 -0
  295. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wa.ts +98 -0
  296. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P12Wtd.ts +98 -0
  297. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wa.ts +98 -0
  298. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P4Wtd.ts +98 -0
  299. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wa.ts +98 -0
  300. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_P52Wtd.ts +98 -0
  301. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pma.ts +98 -0
  302. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pmtd.ts +98 -0
  303. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pqtd.ts +98 -0
  304. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorDay.ts +98 -0
  305. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_PriorYear.ts +98 -0
  306. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw.ts +98 -0
  307. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pw_Fm.ts +98 -0
  308. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwa.ts +98 -0
  309. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pwtd.ts +98 -0
  310. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pymtd.ts +98 -0
  311. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pyqtd.ts +98 -0
  312. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pytd.ts +98 -0
  313. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywa.ts +98 -0
  314. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Pywtd.ts +98 -0
  315. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Qtd.ts +98 -0
  316. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_ReportEndDay.ts +98 -0
  317. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Wtd.ts +98 -0
  318. package/src/stores/fetch-structure/tds/aggregation/calendarFunctions/QueryBuilderAggregateCalendarFunction_Ytd.ts +98 -0
  319. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +18 -1
  320. package/tsconfig.json +35 -0
@@ -36,6 +36,11 @@ import {
36
36
  TrashIcon,
37
37
  PanelDnDEntry,
38
38
  PanelDnDEntryDragHandle,
39
+ CalendarIcon,
40
+ CalendarClockIcon,
41
+ CustomSelectorInput,
42
+ PURE_FunctionIcon,
43
+ PanelEntryDropZonePlaceholder,
39
44
  } from '@finos/legend-art';
40
45
  import {
41
46
  type QueryBuilderExplorerTreeDragSource,
@@ -61,6 +66,18 @@ import {
61
66
  generateFunctionCallString,
62
67
  LAMBDA_PIPE,
63
68
  VARIABLE_REFERENCE_TOKEN,
69
+ AbstractPropertyExpression,
70
+ PRIMITIVE_TYPE,
71
+ Property,
72
+ PropertyExplicitReference,
73
+ VariableExpression,
74
+ Multiplicity,
75
+ type ValueSpecification,
76
+ PrimitiveType,
77
+ GenericType,
78
+ GenericTypeExplicitReference,
79
+ observe_PrimitiveInstanceValue,
80
+ PrimitiveInstanceValue,
64
81
  } from '@finos/legend-graph';
65
82
  import {
66
83
  type QueryBuilderFunctionsExplorerDragSource,
@@ -73,7 +90,73 @@ import { LambdaEditor } from '../shared/LambdaEditor.js';
73
90
  import {
74
91
  type QueryBuilderVariableDragSource,
75
92
  QUERY_BUILDER_VARIABLE_DND_TYPE,
93
+ BasicValueSpecificationEditor,
76
94
  } from '../shared/BasicValueSpecificationEditor.js';
95
+ import { type QueryBuilderAggregateCalendarFunction } from '../../stores/fetch-structure/tds/aggregation/QueryBuilderAggregateCalendarFunction.js';
96
+ import {
97
+ instanceValue_setValues,
98
+ propertyExpression_setFunc,
99
+ } from '../../stores/shared/ValueSpecificationModifierHelper.js';
100
+ import { guaranteeNonNullable } from '@finos/legend-shared';
101
+ import { getPropertyChainName } from '../../stores/QueryBuilderPropertyEditorState.js';
102
+ import { generateDefaultValueForPrimitiveType } from '../../stores/QueryBuilderValueSpecificationHelper.js';
103
+ import { QUERY_BUILDER_CALENDAR_TYPE } from '../../graph-manager/QueryBuilderConst.js';
104
+
105
+ export type CalendarFunctionOption = {
106
+ label: string | React.ReactNode;
107
+ value: QueryBuilderAggregateCalendarFunction;
108
+ };
109
+
110
+ export const buildCalendarFunctionOption = (
111
+ calendarFunction: QueryBuilderAggregateCalendarFunction,
112
+ ): CalendarFunctionOption => ({
113
+ label: (
114
+ <div
115
+ className="query-builder__projection__calendar__function__label"
116
+ title={calendarFunction.getLabel()}
117
+ >
118
+ <PURE_FunctionIcon />
119
+ <div className="query-builder__projection__calendar__function__label__title">
120
+ {calendarFunction.getLabel()}
121
+ </div>
122
+ </div>
123
+ ),
124
+ value: calendarFunction,
125
+ });
126
+
127
+ export type CalendarFunctionDateColumnOption = {
128
+ label: string;
129
+ value: AbstractPropertyExpression;
130
+ };
131
+
132
+ export const buildCalendarFunctionDateColumnOption = (
133
+ dateColumn: Property | AbstractPropertyExpression,
134
+ parameter: VariableExpression,
135
+ humanizeLabel: boolean,
136
+ ): CalendarFunctionDateColumnOption => {
137
+ if (dateColumn instanceof Property) {
138
+ const propertyExpression = new AbstractPropertyExpression('');
139
+ propertyExpression_setFunc(
140
+ propertyExpression,
141
+ PropertyExplicitReference.create(guaranteeNonNullable(dateColumn)),
142
+ );
143
+ propertyExpression.parametersValues = [parameter];
144
+ return {
145
+ label: getPropertyChainName(propertyExpression, humanizeLabel),
146
+ value: propertyExpression,
147
+ };
148
+ } else {
149
+ return {
150
+ label: getPropertyChainName(dateColumn, humanizeLabel),
151
+ value: dateColumn,
152
+ };
153
+ }
154
+ };
155
+
156
+ export type CalendarTypeOption = {
157
+ label: string;
158
+ value: QUERY_BUILDER_CALENDAR_TYPE;
159
+ };
77
160
 
78
161
  const QueryBuilderProjectionColumnContextMenu = observer(
79
162
  forwardRef<
@@ -224,6 +307,8 @@ const QueryBuilderDerivationProjectionColumnEditor = observer(
224
307
  const QueryBuilderProjectionColumnEditor = observer(
225
308
  (props: { projectionColumnState: QueryBuilderProjectionColumnState }) => {
226
309
  const handleRef = useRef<HTMLDivElement>(null);
310
+ const applicationStore = useApplicationStore();
311
+
227
312
  const ref = useRef<HTMLDivElement>(null);
228
313
  const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] =
229
314
  useState(false);
@@ -232,6 +317,7 @@ const QueryBuilderProjectionColumnEditor = observer(
232
317
 
233
318
  const { projectionColumnState } = props;
234
319
  const tdsState = projectionColumnState.tdsState;
320
+ const isCalendarEnabled = tdsState.queryBuilderState.isCalendarEnabled;
235
321
  const isRemovalDisabled = tdsState.isColumnInUse(projectionColumnState);
236
322
 
237
323
  const removeColumn = (): void =>
@@ -258,6 +344,123 @@ const QueryBuilderProjectionColumnEditor = observer(
258
344
  projectionColumnState,
259
345
  );
260
346
 
347
+ // calendar
348
+ const aggregateCalendarFunctionDateColumns =
349
+ tdsState.queryBuilderState.class?.properties.filter((p) => {
350
+ const _type = p.genericType.value.rawType.name;
351
+ if (
352
+ _type === PRIMITIVE_TYPE.DATE ||
353
+ _type === PRIMITIVE_TYPE.STRICTDATE
354
+ ) {
355
+ return true;
356
+ }
357
+ return false;
358
+ }) ?? [];
359
+ const calendarFunctionDateColumnOptions =
360
+ aggregateCalendarFunctionDateColumns.map((option) =>
361
+ buildCalendarFunctionDateColumnOption(
362
+ option,
363
+ new VariableExpression(
364
+ aggregateColumnState?.calendarFunction?.lambdaParameterName ??
365
+ DEFAULT_LAMBDA_VARIABLE_NAME,
366
+ Multiplicity.ONE,
367
+ ),
368
+ tdsState.queryBuilderState.explorerState.humanizePropertyName,
369
+ ),
370
+ );
371
+ const calendarTypeOptions = Object.values(QUERY_BUILDER_CALENDAR_TYPE).map(
372
+ (ct) => ({
373
+ label: (
374
+ <div className="query-builder__projection__calendar__type__option">
375
+ <CalendarIcon />
376
+ <div className="query-builder__projection__calendar__type__option__title">
377
+ {ct}
378
+ </div>
379
+ </div>
380
+ ),
381
+ value: ct,
382
+ }),
383
+ );
384
+ const selectedCalendarTypeOption = aggregateColumnState?.calendarFunction
385
+ ?.calendarType
386
+ ? {
387
+ label: (
388
+ <div className="query-builder__projection__calendar__type__option">
389
+ <CalendarIcon />
390
+ <div className="query-builder__projection__calendar__type__option__title">
391
+ {aggregateColumnState.calendarFunction.calendarType}
392
+ </div>
393
+ </div>
394
+ ),
395
+ value: aggregateColumnState.calendarFunction.calendarType,
396
+ }
397
+ : null;
398
+ const onCalendarTypeOptionChange = (option: CalendarTypeOption): void => {
399
+ if (
400
+ option.value !== aggregateColumnState?.calendarFunction?.calendarType
401
+ ) {
402
+ aggregateColumnState?.calendarFunction?.setCalendarType(option.value);
403
+ }
404
+ };
405
+ const defaultEndDate = observe_PrimitiveInstanceValue(
406
+ new PrimitiveInstanceValue(
407
+ GenericTypeExplicitReference.create(
408
+ new GenericType(PrimitiveType.STRICTDATE),
409
+ ),
410
+ ),
411
+ tdsState.queryBuilderState.observerContext,
412
+ );
413
+ instanceValue_setValues(
414
+ defaultEndDate,
415
+ [generateDefaultValueForPrimitiveType(PRIMITIVE_TYPE.STRICTDATE)],
416
+ tdsState.queryBuilderState.observerContext,
417
+ );
418
+ const resetEndDate = (): void => {
419
+ if (aggregateColumnState?.calendarFunction) {
420
+ aggregateColumnState.calendarFunction.setEndDate(defaultEndDate);
421
+ }
422
+ };
423
+ const aggregateCalendarFunctions =
424
+ tdsState.aggregationState.calendarFunctions.filter((cf) =>
425
+ cf.isCompatibleWithColumn(projectionColumnState),
426
+ );
427
+ const calendarFunctionOptions = aggregateCalendarFunctions.map(
428
+ buildCalendarFunctionOption,
429
+ );
430
+ const selectedCalendarFunctionOption =
431
+ aggregateColumnState?.calendarFunction
432
+ ? buildCalendarFunctionOption(aggregateColumnState.calendarFunction)
433
+ : null;
434
+ const onCalendarFunctionOptionChange = (
435
+ option: CalendarFunctionOption | null,
436
+ ): void => {
437
+ if (option?.value !== aggregateColumnState?.calendarFunction) {
438
+ const lambdaParameterName =
439
+ aggregateColumnState?.calendarFunction?.lambdaParameterName;
440
+ aggregateColumnState?.setCalendarFunction(option?.value ?? undefined);
441
+ if (lambdaParameterName && aggregateColumnState.calendarFunction) {
442
+ aggregateColumnState.calendarFunction.setLambdaParameterName(
443
+ lambdaParameterName,
444
+ );
445
+ }
446
+ if (aggregateColumnState?.calendarFunction) {
447
+ if (calendarFunctionDateColumnOptions[0]) {
448
+ aggregateColumnState.calendarFunction.setDateColumn(
449
+ guaranteeNonNullable(calendarFunctionDateColumnOptions[0]).value,
450
+ );
451
+ } else {
452
+ applicationStore.notificationService.notifyWarning(
453
+ 'Please provide the date column field for the calendar function',
454
+ );
455
+ }
456
+ aggregateColumnState.calendarFunction.setCalendarType(
457
+ guaranteeNonNullable(calendarTypeOptions[0]).value,
458
+ );
459
+ aggregateColumnState.calendarFunction.setEndDate(defaultEndDate);
460
+ }
461
+ }
462
+ };
463
+
261
464
  // Drag and Drop
262
465
  const handleHover = useCallback(
263
466
  (
@@ -335,6 +538,61 @@ const QueryBuilderProjectionColumnEditor = observer(
335
538
 
336
539
  useDragPreviewLayer(dragPreviewConnector);
337
540
 
541
+ const toggleHideCalendarColumnState = (): void => {
542
+ if (aggregateColumnState) {
543
+ aggregateColumnState.setHideCalendarColumnState(
544
+ !aggregateColumnState.hideCalendarColumnState,
545
+ );
546
+ }
547
+ };
548
+
549
+ // Drag and Drop on calendar function date column
550
+ const handleDrop = useCallback(
551
+ (item: QueryBuilderExplorerTreeDragSource, type: string): void => {
552
+ if (type === QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.PRIMITIVE_PROPERTY) {
553
+ if (
554
+ item.node.type.name === PRIMITIVE_TYPE.DATE ||
555
+ item.node.type.name === PRIMITIVE_TYPE.STRICTDATE
556
+ ) {
557
+ aggregateColumnState?.calendarFunction?.setDateColumn(
558
+ buildPropertyExpressionFromExplorerTreeNodeData(
559
+ item.node,
560
+ tdsState.queryBuilderState.explorerState,
561
+ aggregateColumnState.calendarFunction.lambdaParameterName,
562
+ ),
563
+ );
564
+ } else {
565
+ applicationStore.notificationService.notifyWarning(
566
+ `${item.node.type.name} type is not compaible with calendar function date column`,
567
+ );
568
+ }
569
+ }
570
+ },
571
+ [
572
+ aggregateColumnState?.calendarFunction,
573
+ applicationStore.notificationService,
574
+ tdsState.queryBuilderState.explorerState,
575
+ ],
576
+ );
577
+ const [{ isDragOver }, dropTargetConnector] = useDrop<
578
+ QueryBuilderExplorerTreeDragSource,
579
+ void,
580
+ { isDragOver: boolean }
581
+ >(
582
+ () => ({
583
+ accept: [QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.PRIMITIVE_PROPERTY],
584
+ drop: (item, monitor): void => {
585
+ if (!monitor.didDrop()) {
586
+ handleDrop(item, monitor.getItemType() as string);
587
+ } // prevent drop event propagation to accomondate for nested DnD
588
+ },
589
+ collect: (monitor) => ({
590
+ isDragOver: monitor.isOver({ shallow: true }),
591
+ }),
592
+ }),
593
+ [handleDrop],
594
+ );
595
+
338
596
  return (
339
597
  <PanelDnDEntry
340
598
  ref={ref}
@@ -361,109 +619,213 @@ const QueryBuilderProjectionColumnEditor = observer(
361
619
  onOpen={onContextMenuOpen}
362
620
  onClose={onContextMenuClose}
363
621
  >
364
- <PanelDnDEntryDragHandle
365
- isBeingDragged={isBeingDragged}
366
- dropTargetConnector={handleRef}
367
- className="query-builder__projection__column__drag-handle__container"
368
- />
369
- <div className="query-builder__projection__column__name">
370
- <InputWithInlineValidation
371
- className="query-builder__projection__column__name__input input-group__input"
372
- spellCheck={false}
373
- value={projectionColumnState.columnName}
374
- onChange={changeColumnName}
375
- validationErrorMessage={
376
- isDuplicatedColumnName ? 'Duplicated column' : undefined
377
- }
622
+ <div className="query-builder__projection__column__container">
623
+ <PanelDnDEntryDragHandle
624
+ isBeingDragged={isBeingDragged}
625
+ dropTargetConnector={handleRef}
626
+ className="query-builder__projection__column__drag-handle__container"
378
627
  />
379
- </div>
380
- <div className="query-builder__projection__column__value">
381
- {projectionColumnState instanceof
382
- QueryBuilderSimpleProjectionColumnState && (
383
- <QueryBuilderSimpleProjectionColumnEditor
384
- projectionColumnState={projectionColumnState}
628
+ <div className="query-builder__projection__column__name">
629
+ <InputWithInlineValidation
630
+ className="query-builder__projection__column__name__input input-group__input"
631
+ spellCheck={false}
632
+ value={projectionColumnState.columnName}
633
+ onChange={changeColumnName}
634
+ error={isDuplicatedColumnName ? 'Duplicated column' : undefined}
385
635
  />
386
- )}
387
- {projectionColumnState instanceof
388
- QueryBuilderDerivationProjectionColumnState && (
389
- <QueryBuilderDerivationProjectionColumnEditor
390
- projectionColumnState={projectionColumnState}
391
- />
392
- )}
393
- </div>
394
- <div className="query-builder__projection__column__aggregate">
395
- <div className="query-builder__projection__column__aggregate__operator">
396
- {aggregateColumnState && (
397
- <div className="query-builder__projection__column__aggregate__operator__label">
398
- {aggregateColumnState.operator.getLabel(
399
- projectionColumnState,
400
- )}
401
- </div>
636
+ </div>
637
+ <div className="query-builder__projection__column__value">
638
+ {projectionColumnState instanceof
639
+ QueryBuilderSimpleProjectionColumnState && (
640
+ <QueryBuilderSimpleProjectionColumnEditor
641
+ projectionColumnState={projectionColumnState}
642
+ />
402
643
  )}
403
- <DropdownMenu
404
- className="query-builder__projection__column__aggregate__operator__dropdown"
405
- title="Choose Aggregate Operator..."
406
- disabled={!aggreateOperators.length}
407
- content={
408
- <MenuContent>
409
- {aggregateColumnState && (
410
- <MenuContentItem
411
- className="query-builder__projection__column__aggregate__operator__dropdown__option"
412
- onClick={changeOperator(undefined)}
413
- >
414
- (none)
415
- </MenuContentItem>
644
+ {projectionColumnState instanceof
645
+ QueryBuilderDerivationProjectionColumnState && (
646
+ <QueryBuilderDerivationProjectionColumnEditor
647
+ projectionColumnState={projectionColumnState}
648
+ />
649
+ )}
650
+ </div>
651
+ <div className="query-builder__projection__column__aggregate">
652
+ <div className="query-builder__projection__column__aggregate__operator">
653
+ {aggregateColumnState && (
654
+ <div className="query-builder__projection__column__aggregate__operator__label">
655
+ {aggregateColumnState.operator.getLabel(
656
+ projectionColumnState,
416
657
  )}
417
- {aggreateOperators.map((op) => (
418
- <MenuContentItem
419
- key={op.uuid}
420
- className="query-builder__projection__column__aggregate__operator__dropdown__option"
421
- onClick={changeOperator(op)}
422
- >
423
- {op.getLabel(projectionColumnState)}
424
- </MenuContentItem>
425
- ))}
426
- </MenuContent>
658
+ </div>
659
+ )}
660
+ {isCalendarEnabled &&
661
+ aggregateColumnState &&
662
+ aggregateCalendarFunctions.length > 0 && (
663
+ <div
664
+ className={
665
+ aggregateColumnState.hideCalendarColumnState
666
+ ? 'query-builder__projection__column__aggregate__calendar--clock--icon__hidden'
667
+ : 'query-builder__projection__column__aggregate__calendar--clock--icon'
668
+ }
669
+ onClick={toggleHideCalendarColumnState}
670
+ title="Click to select calendar function"
671
+ >
672
+ <CalendarClockIcon />
673
+ </div>
674
+ )}
675
+ <DropdownMenu
676
+ className="query-builder__projection__column__aggregate__operator__dropdown"
677
+ title="Choose Aggregate Operator..."
678
+ disabled={!aggreateOperators.length}
679
+ content={
680
+ <MenuContent>
681
+ {aggregateColumnState && (
682
+ <MenuContentItem
683
+ className="query-builder__projection__column__aggregate__operator__dropdown__option"
684
+ onClick={changeOperator(undefined)}
685
+ >
686
+ (none)
687
+ </MenuContentItem>
688
+ )}
689
+ {aggreateOperators.map((op) => (
690
+ <MenuContentItem
691
+ key={op.uuid}
692
+ className="query-builder__projection__column__aggregate__operator__dropdown__option"
693
+ onClick={changeOperator(op)}
694
+ >
695
+ {op.getLabel(projectionColumnState)}
696
+ </MenuContentItem>
697
+ ))}
698
+ </MenuContent>
699
+ }
700
+ menuProps={{
701
+ anchorOrigin: { vertical: 'bottom', horizontal: 'left' },
702
+ transformOrigin: { vertical: 'top', horizontal: 'left' },
703
+ elevation: 7,
704
+ }}
705
+ >
706
+ <div
707
+ className={clsx(
708
+ 'query-builder__projection__column__aggregate__operator__badge',
709
+ {
710
+ 'query-builder__projection__column__aggregate__operator__badge--activated':
711
+ Boolean(aggregateColumnState),
712
+ },
713
+ )}
714
+ >
715
+ <SigmaIcon />
716
+ </div>
717
+ <div className="query-builder__projection__column__aggregate__operator__dropdown__trigger">
718
+ <CaretDownIcon />
719
+ </div>
720
+ </DropdownMenu>
721
+ </div>
722
+ </div>
723
+ <div className="query-builder__projection__column__actions">
724
+ <button
725
+ className="query-builder__projection__column__action"
726
+ tabIndex={-1}
727
+ onClick={removeColumn}
728
+ disabled={isRemovalDisabled}
729
+ title={
730
+ isRemovalDisabled
731
+ ? // TODO: We may want to provide a list of all places where column is in use
732
+ "This column is used and can't be removed"
733
+ : 'Remove'
427
734
  }
428
- menuProps={{
429
- anchorOrigin: { vertical: 'bottom', horizontal: 'left' },
430
- transformOrigin: { vertical: 'top', horizontal: 'left' },
431
- elevation: 7,
432
- }}
433
735
  >
736
+ <TimesIcon />
737
+ </button>
738
+ </div>
739
+ </div>
740
+ {isCalendarEnabled &&
741
+ aggregateColumnState &&
742
+ aggregateCalendarFunctions.length > 0 && (
743
+ <div
744
+ className={clsx(
745
+ 'query-builder__projection__calendar__container',
746
+ {
747
+ 'query-builder__projection__calendar__container--hidden':
748
+ aggregateColumnState.hideCalendarColumnState,
749
+ },
750
+ )}
751
+ >
752
+ <div data-testid="test">
753
+ <CustomSelectorInput
754
+ className="query-builder__projection__calendar__function"
755
+ options={calendarFunctionOptions}
756
+ onChange={onCalendarFunctionOptionChange}
757
+ value={selectedCalendarFunctionOption}
758
+ placeholder={'Select Calendar Function'}
759
+ isClearable={true}
760
+ escapeClearsValue={true}
761
+ darkMode={
762
+ !applicationStore.layoutService
763
+ .TEMPORARY__isLightColorThemeEnabled
764
+ }
765
+ />
766
+ </div>
767
+ <div className="query-builder__projection__calendar__value">
768
+ <BasicValueSpecificationEditor
769
+ valueSpecification={
770
+ aggregateColumnState.calendarFunction?.endDate ??
771
+ defaultEndDate
772
+ }
773
+ setValueSpecification={(val: ValueSpecification): void => {
774
+ if (val instanceof PrimitiveInstanceValue) {
775
+ aggregateColumnState.calendarFunction?.setEndDate(val);
776
+ }
777
+ }}
778
+ graph={tdsState.queryBuilderState.graphManagerState.graph}
779
+ obseverContext={tdsState.queryBuilderState.observerContext}
780
+ typeCheckOption={{
781
+ expectedType: PrimitiveType.STRICTDATE,
782
+ }}
783
+ className="query-builder__parameters__value__editor"
784
+ resetValue={resetEndDate}
785
+ />
786
+ </div>
434
787
  <div
435
- className={clsx(
436
- 'query-builder__projection__column__aggregate__operator__badge',
437
- {
438
- 'query-builder__projection__column__aggregate__operator__badge--activated':
439
- Boolean(aggregateColumnState),
440
- },
441
- )}
788
+ className="query-builder__projection__calendar__date__column"
789
+ ref={dropTargetConnector}
442
790
  >
443
- <SigmaIcon />
444
- </div>
445
- <div className="query-builder__projection__column__aggregate__operator__dropdown__trigger">
446
- <CaretDownIcon />
791
+ <PanelEntryDropZonePlaceholder
792
+ showPlaceholder={isDragOver}
793
+ label="Change Date Column"
794
+ className="query-builder__projection__calendar__date__column__dnd__placeholder"
795
+ >
796
+ {aggregateColumnState.calendarFunction?.dateColumn ? (
797
+ <div className="query-builder__projection__calendar__date__column__label__box">
798
+ <div className="query-builder__projection__calendar__date__column__prefix">
799
+ on
800
+ </div>
801
+ <div className="query-builder__projection__calendar__date__column__label">
802
+ {getPropertyChainName(
803
+ aggregateColumnState.calendarFunction.dateColumn,
804
+ tdsState.queryBuilderState.explorerState
805
+ .humanizePropertyName,
806
+ )}
807
+ </div>
808
+ </div>
809
+ ) : (
810
+ <div className="query-builder__projection__calendar__date__column__dnd__placeholder">
811
+ Drag and drop date column here
812
+ </div>
813
+ )}
814
+ </PanelEntryDropZonePlaceholder>
447
815
  </div>
448
- </DropdownMenu>
449
- </div>
450
- </div>
451
- <div className="query-builder__projection__column__actions">
452
- <button
453
- className="query-builder__projection__column__action"
454
- tabIndex={-1}
455
- onClick={removeColumn}
456
- disabled={isRemovalDisabled}
457
- title={
458
- isRemovalDisabled
459
- ? // TODO: We may want to provide a list of all places where column is in use
460
- "This column is used and can't be removed"
461
- : 'Remove'
462
- }
463
- >
464
- <TimesIcon />
465
- </button>
466
- </div>
816
+ <CustomSelectorInput
817
+ className="query-builder__projection__calendar__type"
818
+ options={calendarTypeOptions}
819
+ onChange={onCalendarTypeOptionChange}
820
+ value={selectedCalendarTypeOption ?? calendarTypeOptions[0]}
821
+ placeholder={'Select calendar type'}
822
+ darkMode={
823
+ !applicationStore.layoutService
824
+ .TEMPORARY__isLightColorThemeEnabled
825
+ }
826
+ />
827
+ </div>
828
+ )}
467
829
  </ContextMenu>
468
830
  </PanelDnDEntry>
469
831
  );
@@ -513,9 +513,7 @@ const QueryBuilderWindowColumnModalEditor = observer(
513
513
  spellCheck={false}
514
514
  value={windowColumnState.columnName}
515
515
  onChange={changeColumnName}
516
- validationErrorMessage={
517
- isDuplicatedColumnName ? 'Duplicated column' : undefined
518
- }
516
+ error={isDuplicatedColumnName ? 'Duplicated column' : undefined}
519
517
  />
520
518
  </PanelFormSection>
521
519
  </div>
@@ -1087,7 +1085,7 @@ const QueryBuilderWindowColumnEditor = observer(
1087
1085
  spellCheck={false}
1088
1086
  value={windowColumnState.columnName}
1089
1087
  onChange={changeColumnName}
1090
- validationErrorMessage={
1088
+ error={
1091
1089
  isDuplicatedColumnName
1092
1090
  ? 'Duplicated column'
1093
1091
  : isInvalidColumnName